Merge branch 'alipayplus_aps' into develop

master
Yixian 3 years ago
commit 469816d26e

@ -5,7 +5,7 @@
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>2.3.1</version>
<version>2.3.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>

@ -15,6 +15,8 @@ import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo;
import au.com.royalpay.payment.manage.merchants.beans.ClientUpdateInfo;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.permission.manager.PartnerMapping;
import au.com.royalpay.payment.manage.riskbusiness.bean.RiskEventQuery;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskBusinessService;
import au.com.royalpay.payment.manage.riskbusiness.core.RiskUploadService;
@ -30,6 +32,7 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
import au.com.royalpay.payment.tools.http.HttpUtils;
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.time.DateUtils;
@ -85,6 +88,9 @@ public class RetailAppController {
@Resource
private ClientAccountMapper clientAccountMapper;
@Resource
private ClientManager clientManager;
@Autowired
private RiskBusinessService riskBusinessService;
@ -686,6 +692,7 @@ public class RetailAppController {
public JSONObject getRiskEventMaterialsRemark(@PathVariable("risk_id") String riskId) {
return riskBusinessService.getRiskEventMaterialsRemark(riskId);
}
/**
* app
*
@ -709,6 +716,7 @@ public class RetailAppController {
/**
*
*
* @param material
* @param device
*/
@ -1007,4 +1015,14 @@ public class RetailAppController {
return retailAppService.getAccountBindInfos(device);
}
@GetMapping(value = "/{clientMoniker}/aps_kyc")
public JSONObject getApsKycClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject account, @PathVariable("clientMoniker") String clientMoniker) {
return clientManager.getApsKycClient(account, clientMoniker);
}
@PutMapping(value = "/aps_kyc")
public void updateApsKycClient(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject account, @RequestBody JSONObject item) {
clientManager.updateApsKycClient(account, item);
}
}

@ -0,0 +1,44 @@
package au.com.royalpay.payment.manage.apsKYC.domain.entity;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ApsNotice {
private static final long serialVersionUID = 1L;
private String id;
private Date createTime;
private String creator;
private Date modifyTime;
private String modifier;
/**
*
*/
private String title;
/**
*
*/
private String content;
/**
*
* 0
* 1
*/
private Integer status = 0;
}

@ -0,0 +1,72 @@
package au.com.royalpay.payment.manage.apsKYC.domain.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ApsNoticeClient {
private static final long serialVersionUID = 1L;
private String id;
private Date createTime;
private String creator;
private Date modifyTime;
private String modifier;
/**
* ID
*/
private String noticeId;
/**
* Code
*/
private String partnerCode;
/**
* id
*/
private String userId;
/**
*
*/
private Date readTime;
/**
*
* 0
* 1
* 2
* 3
*/
private Integer status;
/**
*
*/
private Date statusTime;
/**
*
* 0
* 1
*/
private Integer handle;
/**
*
*/
private Integer isValid;
}

@ -0,0 +1,20 @@
package au.com.royalpay.payment.manage.apsKYC.domain.repository;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import java.util.Date;
public interface ApsNoticeClientRepository {
void saveApsNoticeClient(ApsNoticeClient apsNoticeClient);
void updateApsNoticeClient(ApsNoticeClient apsNoticeClient);
PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds);
void updateApsNoticeClientByPartnerCode(Date modifyTime, String modifier, String partnerCode);
ApsNoticeClient getApsNoticeClientById(String id);
}

@ -0,0 +1,20 @@
package au.com.royalpay.payment.manage.apsKYC.domain.repository;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import java.util.List;
public interface ApsNoticeRepository {
PageList<JSONObject> getApsNotices(PageBounds pageBounds);
ApsNotice saveApsNotice(ApsNotice apsNotice);
void updateApsNotice(JSONObject apsNotice);
ApsNotice getApsNoticesById(String id);
List<JSONObject> getApsNotice(String id);
}

@ -0,0 +1,9 @@
package au.com.royalpay.payment.manage.apsKYC.domain.service;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
public interface ApsNoticeClientsService {
PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds);
}

@ -0,0 +1,19 @@
package au.com.royalpay.payment.manage.apsKYC.domain.service;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import au.com.royalpay.payment.manage.apsKYC.web.command.AddNoticeCommand;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
public interface ApsNoticeService {
PageList<JSONObject> getApsNotices(PageBounds pageBounds);
void saveApsNotice(JSONObject manager, AddNoticeCommand addNoticeCommand);
void updateApsNoticeClient(JSONObject manager, ApsNoticeClient apsNoticeClient);
AddNoticeCommand getApsNotice(String id);
void updateApsNotice(JSONObject manager, JSONObject apsNotice);
}

@ -0,0 +1,49 @@
package au.com.royalpay.payment.manage.apsKYC.domain.service.Impl;
import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository;
import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeClientsService;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ApsNoticeClientsServiceImpl implements ApsNoticeClientsService {
@Autowired
private ApsNoticeClientRepository apsNoticeClientRepository;
@Autowired
private ManagerMapper managerMapper;
@Autowired
private ClientAccountMapper clientAccountMapper;
@Override
public PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds) {
PageList<JSONObject> apsNoticeClients = apsNoticeClientRepository.getApsNoticeClients(id, pageBounds);
for (JSONObject apsNoticeClient : apsNoticeClients) {
if (apsNoticeClient.containsKey("modifier") && StringUtils.isNotBlank(apsNoticeClient.getString("modifier"))) {
JSONObject modifier = managerMapper.findDetail(apsNoticeClient.getString("modifier"));
if (modifier != null) {
apsNoticeClient.put("modifier_name", modifier.getString("username"));
}
}
if (apsNoticeClient.containsKey("user_id") && StringUtils.isNotBlank(apsNoticeClient.getString("user_id"))) {
if (apsNoticeClient.getString("user_id").equals("0")) {
apsNoticeClient.put("user_name", "未知");
} else {
JSONObject user = clientAccountMapper.findDetail(apsNoticeClient.getString("user_id"));
if (user != null) {
apsNoticeClient.put("user_name", user.getString("username"));
}
}
}
}
return apsNoticeClients;
}
}

@ -0,0 +1,83 @@
package au.com.royalpay.payment.manage.apsKYC.domain.service.Impl;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository;
import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeRepository;
import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeService;
import au.com.royalpay.payment.manage.apsKYC.web.command.AddNoticeCommand;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service
public class ApsNoticeServiceImpl implements ApsNoticeService {
@Autowired
private ApsNoticeRepository apsNoticeRepository;
@Autowired
private ApsNoticeClientRepository apsNoticeClientRepository;
@Override
public PageList<JSONObject> getApsNotices(PageBounds pageBounds) {
return apsNoticeRepository.getApsNotices(pageBounds);
}
@Override
public void saveApsNotice(JSONObject manager, AddNoticeCommand addNoticeCommand) {
// 保存消息数据
ApsNotice saveApsNotice = addNoticeCommand.saveApsNotice(addNoticeCommand, manager);
ApsNotice apsNotice = apsNoticeRepository.saveApsNotice(saveApsNotice);
for (String partnerCode : addNoticeCommand.getPartnerCodes()) {
if (StringUtils.isNotBlank(partnerCode)) {
apsNoticeClientRepository.updateApsNoticeClientByPartnerCode(new Date(), manager.getString("manager_id"), partnerCode);
ApsNoticeClient apsNoticeClient = addNoticeCommand.saveApsNoticeClient(partnerCode, manager, apsNotice.getId());
apsNoticeClientRepository.saveApsNoticeClient(apsNoticeClient);
}
}
}
@Override
public void updateApsNoticeClient(JSONObject manager, ApsNoticeClient apsNoticeClient) {
ApsNoticeClient apsNoticeClientById = apsNoticeClientRepository.getApsNoticeClientById(apsNoticeClient.getId());
apsNoticeClientById.setModifier(manager.getString("manager_id"));
apsNoticeClientById.setModifyTime(new Date());
if (apsNoticeClient.getHandle() != null) {
apsNoticeClientById.setHandle(apsNoticeClient.getHandle());
}
if (apsNoticeClient.getIsValid() != null) {
apsNoticeClientById.setIsValid(apsNoticeClient.getIsValid());
}
apsNoticeClientRepository.updateApsNoticeClient(apsNoticeClientById);
}
@Override
public AddNoticeCommand getApsNotice(String id) {
List<JSONObject> apsNotice = apsNoticeRepository.getApsNotice(id);
AddNoticeCommand addNoticeCommand = new AddNoticeCommand();
ArrayList<String> codes = new ArrayList<>();
for (JSONObject a : apsNotice) {
addNoticeCommand.setTitle(a.getString("title"));
addNoticeCommand.setContent(a.getString("content"));
addNoticeCommand.setCreateTime(a.getDate("create_time"));
codes.add(a.getString("partner_code"));
}
addNoticeCommand.setPartnerCodes(codes.toArray(new String[codes.size()]));
return addNoticeCommand;
}
@Override
public void updateApsNotice(JSONObject manager, JSONObject apsNotice) {
apsNotice.put("modifier", manager.getString("manager_id"));
apsNotice.put("modify_time", new Date());
apsNoticeRepository.updateApsNotice(apsNotice);
}
}

@ -0,0 +1,44 @@
package au.com.royalpay.payment.manage.apsKYC.infrastructure.repository;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeClientRepository;
import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeClientMapper;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Date;
@Repository
public class ApsNoticeClientRepositoryImpl implements ApsNoticeClientRepository {
@Autowired
private ApsNoticeClientMapper mapper;
@Override
public void saveApsNoticeClient(ApsNoticeClient apsNoticeClient) {
mapper.saveApsNoticeClient(apsNoticeClient);
}
@Override
public void updateApsNoticeClient(ApsNoticeClient apsNoticeClient) {
mapper.updateApsNoticeClient(apsNoticeClient);
}
@Override
public PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds) {
return mapper.getApsNoticeClients(id, pageBounds);
}
@Override
public void updateApsNoticeClientByPartnerCode(Date modifyTime, String modifier, String partnerCode) {
mapper.updateApsNoticeClientByPartnerCode(modifyTime, modifier, partnerCode);
}
@Override
public ApsNoticeClient getApsNoticeClientById(String id) {
return mapper.getApsNoticeClientById(id);
}
}

@ -0,0 +1,45 @@
package au.com.royalpay.payment.manage.apsKYC.infrastructure.repository;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice;
import au.com.royalpay.payment.manage.apsKYC.domain.repository.ApsNoticeRepository;
import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeMapper;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class ApsNoticeRepositoryImpl implements ApsNoticeRepository {
@Autowired
private ApsNoticeMapper mapper;
@Override
public PageList<JSONObject> getApsNotices(PageBounds pageBounds) {
return mapper.getApsNotices(pageBounds);
}
@Override
public ApsNotice saveApsNotice(ApsNotice apsNotice) {
mapper.saveApsNotice(apsNotice);
return mapper.getApsNoticesById(apsNotice.getId());
}
@Override
public void updateApsNotice(JSONObject apsNotice) {
mapper.updateApsNotice(apsNotice);
}
@Override
public ApsNotice getApsNoticesById(String id) {
return mapper.getApsNoticesById(id);
}
@Override
public List<JSONObject> getApsNotice(String id) {
return mapper.getApsNotice(id);
}
}

@ -0,0 +1,104 @@
package au.com.royalpay.payment.manage.apsKYC.web;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeClientsService;
import au.com.royalpay.payment.manage.apsKYC.domain.service.ApsNoticeService;
import au.com.royalpay.payment.manage.apsKYC.web.command.AddNoticeCommand;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/aps/kyc")
public class RestApsKYCController {
@Resource
private ApsNoticeService apsNoticeService;
@Resource
private ApsNoticeClientsService apsNoticeClientsService;
/**
*
*
* @param page
* @param pageSize
* @return
*/
@ManagerMapping(value = "/notices", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER})
public JSONObject getApsNotices(@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize) {
PageBounds pageBounds = new PageBounds(page, pageSize);
PageList<JSONObject> apply = apsNoticeService.getApsNotices(pageBounds);
return PageListUtils.buildPageListResult(apply);
}
/**
*
*
* @param id id
* @return AddNoticeCommand
*/
@ManagerMapping(value = "/notice", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER})
public AddNoticeCommand getApsNotice(@RequestParam String id) {
return apsNoticeService.getApsNotice(id);
}
/**
*
*
* @param manager
* @param apsNotice
*/
@ManagerMapping(value = "/notice", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SALES_MANAGER})
public void updateApsNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject apsNotice) {
apsNoticeService.updateApsNotice(manager, apsNotice);
}
/**
*
*
* @param page
* @param pageSize
* @param id id
* @return JSONObject
*/
@ManagerMapping(value = "/notice/clients", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.SALES_MANAGER})
public JSONObject getApsNoticeClients(@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "pageSize", defaultValue = "20") int pageSize,
@RequestParam String id) {
PageBounds pageBounds = new PageBounds(page, pageSize);
PageList<JSONObject> apply = apsNoticeClientsService.getApsNoticeClients(id, pageBounds);
return PageListUtils.buildPageListResult(apply);
}
/**
*
*
* @param manager
* @param addNoticeCommand
*/
@ManagerMapping(value = "/notice", method = RequestMethod.POST, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SALES_MANAGER})
public void addApsNotice(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody AddNoticeCommand addNoticeCommand) {
apsNoticeService.saveApsNotice(manager, addNoticeCommand);
}
/**
*
*
* @param manager
* @param apsNoticeClient
*/
@ManagerMapping(value = "/notice/client", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.SALES_MANAGER})
public void updateApsNoticeClient(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ApsNoticeClient apsNoticeClient) {
apsNoticeService.updateApsNoticeClient(manager, apsNoticeClient);
}
}

@ -0,0 +1,45 @@
package au.com.royalpay.payment.manage.apsKYC.web.command;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.joda.time.DateTime;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddNoticeCommand {
private String[] partnerCodes;
private String title;
private String content;
private Date createTime;
public ApsNotice saveApsNotice(AddNoticeCommand addNoticeDescriptor, JSONObject manager) {
return new ApsNotice()
.setCreateTime(new Date())
.setCreator(manager.getString("manager_id"))
.setTitle(addNoticeDescriptor.getTitle())
.setContent(addNoticeDescriptor.getContent());
}
public ApsNoticeClient saveApsNoticeClient(String partnerCode, JSONObject manager, String noticeId) {
return new ApsNoticeClient()
.setCreateTime(new Date())
.setCreator(manager.getString("manager_id"))
.setNoticeId(noticeId)
.setPartnerCode(partnerCode)
.setIsValid(0)
.setHandle(0)
.setStatus(0);
}
}

@ -0,0 +1,13 @@
package au.com.royalpay.payment.manage.apsKYC.web.command;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SelectApsNoticeCommand {
private int limit = 10;
private int page = 1;
}

@ -497,93 +497,211 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
}
}
PayChannel payChannel = PayChannel.fromChannelCode(channel);
for (JSONObject params : oneChannel.getValue()) {
if (payChannel == PayChannel.RPAY_CHANNEL_CARD) {
//rpaypmt_domestic_card
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card" + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//rpaypmt_overseas_card
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_overseas_card" + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} else {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = null;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE || payChannel == PayChannel.ALIPAY_APS_CASHIER) {
Map<Boolean, List<JSONObject>> groupByPayType = oneChannel.getValue().stream().collect(Collectors.groupingBy(e -> e.getString("pay_type").equals("alipay_cn")));
for (Map.Entry<Boolean, List<JSONObject>> payType : groupByPayType.entrySet()) {
BigDecimal totalAps = BigDecimal.ZERO;
BigDecimal total_surageAps = BigDecimal.ZERO;
BigDecimal net_surageAps = BigDecimal.ZERO;
BigDecimal royalpay_surageAps = BigDecimal.ZERO;
BigDecimal transaction_feeAps = BigDecimal.ZERO;
JSONObject jsonAps = new JSONObject();
if (payType.getKey()) {
for (JSONObject params : payType.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = null;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
totalAps = totalAps.add(tmpClearingAmount);
total_surageAps = total_surageAps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surageAps = royalpay_surageAps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surageAps = net_surageAps.add(params.getBigDecimal("channel_surcharge"));
transaction_feeAps = transaction_feeAps.add(params.getBigDecimal("transaction_fee"));
}
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
BigDecimal org_charge = total_surageAps.subtract(royalpay_surageAps);
jsonAps.put("channel", oneChannel.getKey() + ",alipayCN");
jsonAps.put("gross_amount", totalAps);
jsonAps.put("total_charge", total_surageAps);
jsonAps.put("transaction_fee", transaction_feeAps);
jsonAps.put("net_charge", net_surageAps);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
jsonAps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
jsonAps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
jsonAps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
jsonAps.put("royalpay_charge", royalpay_surageAps);
jsonAps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
jsonAps.put("commission_type", "1");
jsonAps.put("create_time", new Date());
amountByChannel.add(jsonAps);
}
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
if (!payType.getKey()) {
for (JSONObject params : payType.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = null;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
totalAps = totalAps.add(tmpClearingAmount);
total_surageAps = total_surageAps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surageAps = royalpay_surageAps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surageAps = net_surageAps.add(params.getBigDecimal("channel_surcharge"));
transaction_feeAps = transaction_feeAps.add(params.getBigDecimal("transaction_fee"));
}
BigDecimal org_charge = total_surageAps.subtract(royalpay_surageAps);
jsonAps.put("channel", oneChannel.getKey() + ",alipayOS");
jsonAps.put("gross_amount", totalAps);
jsonAps.put("total_charge", total_surageAps);
jsonAps.put("transaction_fee", transaction_feeAps);
jsonAps.put("net_charge", net_surageAps);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
jsonAps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
jsonAps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
jsonAps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
jsonAps.put("royalpay_charge", royalpay_surageAps);
jsonAps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
jsonAps.put("commission_type", "1");
jsonAps.put("create_time", new Date());
amountByChannel.add(jsonAps);
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
}
}
BigDecimal org_charge = total_surage.subtract(royalpay_surage);
json.put("channel", oneChannel.getKey());
json.put("gross_amount", total);
json.put("total_charge", total_surage);
json.put("transaction_fee", transaction_fee);
json.put("net_charge", net_surage);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
json.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
json.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
for (JSONObject params : oneChannel.getValue()) {
if (payChannel == PayChannel.RPAY_CHANNEL_CARD) {
//rpaypmt_domestic_card
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card" + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//rpaypmt_overseas_card
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_overseas_card" + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} else {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = null;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
int i = currencyScale(params.getString("clearing_currency"));
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
// net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
}
}
BigDecimal org_charge = total_surage.subtract(royalpay_surage);
json.put("channel", oneChannel.getKey());
json.put("gross_amount", total);
json.put("total_charge", total_surage);
json.put("transaction_fee", transaction_fee);
json.put("net_charge", net_surage);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
json.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
json.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
json.put("royalpay_charge", royalpay_surage);
json.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
json.put("commission_type", "1");
json.put("create_time", new Date());
amountByChannel.add(json);
}
json.put("royalpay_charge", royalpay_surage);
json.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
json.put("commission_type", "1");
json.put("create_time", new Date());
amountByChannel.add(json);
}
return amountByChannel;
}
@ -662,13 +780,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
public List<JSONObject> clientChannelAmount(int clientId, JSONObject orgInfo, Map<String, List<JSONObject>> channelMap, JSONObject channelCharge, int year, int month, int type) {
List<JSONObject> amountByChannel = new ArrayList<>();
for (Map.Entry<String, List<JSONObject>> oneChannel : channelMap.entrySet()) {
String recordId = "";
if (type == 1) {
recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey());
}
if (type == 2) {
recordId = financialAgentCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey());
}
BigDecimal total = BigDecimal.ZERO;
BigDecimal total_surage = BigDecimal.ZERO;
BigDecimal net_surage = BigDecimal.ZERO;
@ -692,138 +803,337 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
} catch (Exception e) {
}
PayChannel payChannel = PayChannel.fromChannelCode(channel);
for (JSONObject params : oneChannel.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
if (StringUtils.equals(channel.toLowerCase() + "_rate_value", "rpaypmt_card_rate_value")) {
//rpaypmt_domestic_card
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
int i = currencyScale(params.getString("clearing_currency"));
if (total.compareTo(BigDecimal.ZERO) == 0) {
datefrom = params.getDate("transaction_time");
dateto = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
datefrom = params.getDate("transaction_time");
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE || payChannel == PayChannel.ALIPAY_APS_CASHIER) {
Map<Boolean, List<JSONObject>> groupByPayType = oneChannel.getValue().stream().collect(Collectors.groupingBy(e -> e.getString("pay_type").equals("alipay_cn")));
for (Map.Entry<Boolean, List<JSONObject>> payType : groupByPayType.entrySet()) {
if (payType.getKey()) {
String recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey() + ",alipayCN");
BigDecimal total_aps = BigDecimal.ZERO;
BigDecimal total_surage_aps = BigDecimal.ZERO;
BigDecimal net_surage_aps = BigDecimal.ZERO;
BigDecimal royalpay_surage_aps = BigDecimal.ZERO;
BigDecimal transaction_fee_aps = BigDecimal.ZERO;
Date datefrom_aps = new Date();
Date dateto_aps = new Date();
JSONObject json_aps = new JSONObject();
for (JSONObject params : payType.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = BigDecimal.ZERO;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
int i = currencyScale(params.getString("clearing_currency"));
if (total_aps.compareTo(BigDecimal.ZERO) == 0) {
datefrom_aps = params.getDate("transaction_time");
dateto_aps = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
datefrom_aps = params.getDate("transaction_time");
}
if (params.getDate("transaction_time").after(dateto)) {
dateto_aps = params.getDate("transaction_time");
}
}
total_aps = total_aps.add(tmpClearingAmount);
total_surage_aps = total_surage_aps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage_aps = royalpay_surage_aps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage_aps = net_surage_aps.add(params.getBigDecimal("channel_surcharge"));
transaction_fee_aps = transaction_fee_aps.add(params.getBigDecimal("transaction_fee"));
}
if (params.getDate("transaction_time").after(dateto)) {
dateto = params.getDate("transaction_time");
BigDecimal org_charge = total_surage_aps.subtract(royalpay_surage_aps);
if (channel.toLowerCase().equals("alipay_direct")) {
channel = channel.replace("_", "");
}
json_aps.put("channel", oneChannel.getKey() + ",alipayCN");
json_aps.put("record_id", recordId);
json_aps.put("client_id", clientId);
if (clientRate != null) {
json_aps.put("client_rate", clientRate.getBigDecimal("rate_value"));
} else {
json_aps.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
}
json_aps.put("gross_amount", total);
json_aps.put("total_charge", total_surage);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
json_aps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
json_aps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
json_aps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
json_aps.put("royalpay_charge", royalpay_surage_aps);
if (type == 1) {
json_aps.put("net_charge", net_surage_aps);
}
if (type == 2) {
json_aps.put("org_net_charge", net_surage_aps);
}
json_aps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
json_aps.put("transaction_fee", transaction_fee_aps);
json_aps.put("commission_type", "1");
json_aps.put("create_time", new Date());
json_aps.put("date_from", DateFormatUtils.format(datefrom_aps, "yyyy-MM-dd"));
json_aps.put("date_to", DateFormatUtils.format(dateto_aps, "yyyy-MM-dd"));
json_aps.put("year", year);
json_aps.put("month", month);
amountByChannel.add(json_aps);
}
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//rpaypmt_overseas_card
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_overseas_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
if (!payType.getKey()) {
String recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey() + ",alipayOS");
BigDecimal total_aps = BigDecimal.ZERO;
BigDecimal total_surage_aps = BigDecimal.ZERO;
BigDecimal net_surage_aps = BigDecimal.ZERO;
BigDecimal royalpay_surage_aps = BigDecimal.ZERO;
BigDecimal transaction_fee_aps = BigDecimal.ZERO;
Date datefrom_aps = new Date();
Date dateto_aps = new Date();
JSONObject json_aps = new JSONObject();
for (JSONObject params : payType.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
BigDecimal channelRate = BigDecimal.ZERO;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
int i = currencyScale(params.getString("clearing_currency"));
if (total_aps.compareTo(BigDecimal.ZERO) == 0) {
datefrom_aps = params.getDate("transaction_time");
dateto_aps = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
datefrom_aps = params.getDate("transaction_time");
}
if (params.getDate("transaction_time").after(dateto)) {
dateto_aps = params.getDate("transaction_time");
}
}
total_aps = total_aps.add(tmpClearingAmount);
total_surage_aps = total_surage_aps.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage_aps = royalpay_surage_aps.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage_aps = net_surage_aps.add(params.getBigDecimal("channel_surcharge"));
transaction_fee_aps = transaction_fee_aps.add(params.getBigDecimal("transaction_fee"));
}
BigDecimal org_charge = total_surage_aps.subtract(royalpay_surage_aps);
if (channel.toLowerCase().equals("alipay_direct")) {
channel = channel.replace("_", "");
}
json_aps.put("channel", oneChannel.getKey() + ",alipayOS");
json_aps.put("record_id", recordId);
json_aps.put("client_id", clientId);
if (clientRate != null) {
json_aps.put("client_rate", clientRate.getBigDecimal("rate_value"));
} else {
json_aps.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
}
json_aps.put("gross_amount", total);
json_aps.put("total_charge", total_surage);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
json_aps.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
json_aps.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
json_aps.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
json_aps.put("royalpay_charge", royalpay_surage_aps);
if (type == 1) {
json_aps.put("net_charge", net_surage_aps);
}
if (type == 2) {
json_aps.put("org_net_charge", net_surage_aps);
}
json_aps.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
json_aps.put("transaction_fee", transaction_fee_aps);
json_aps.put("commission_type", "1");
json_aps.put("create_time", new Date());
json_aps.put("date_from", DateFormatUtils.format(datefrom_aps, "yyyy-MM-dd"));
json_aps.put("date_to", DateFormatUtils.format(dateto_aps, "yyyy-MM-dd"));
json_aps.put("year", year);
json_aps.put("month", month);
amountByChannel.add(json_aps);
}
if (total.compareTo(BigDecimal.ZERO) == 0) {
datefrom = params.getDate("transaction_time");
dateto = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
}
} else {
String recordId = "";
if (type == 1) {
recordId = financialPartnerCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey());
}
if (type == 2) {
recordId = financialAgentCommissionMapper.getRecordId(orgInfo.getInteger("org_id"), year, month, oneChannel.getKey());
}
for (JSONObject params : oneChannel.getValue()) {
BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount");
if (StringUtils.equals(channel.toLowerCase() + "_rate_value", "rpaypmt_card_rate_value")) {
//rpaypmt_domestic_card
BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_domestic_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
int i = currencyScale(params.getString("clearing_currency"));
if (total.compareTo(BigDecimal.ZERO) == 0) {
datefrom = params.getDate("transaction_time");
dateto = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
datefrom = params.getDate("transaction_time");
}
if (params.getDate("transaction_time").after(dateto)) {
dateto = params.getDate("transaction_time");
}
}
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//rpaypmt_overseas_card
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("rpaypmt_overseas_card_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback"));
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
if (params.getDate("transaction_time").after(dateto)) {
if (total.compareTo(BigDecimal.ZERO) == 0) {
datefrom = params.getDate("transaction_time");
dateto = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
datefrom = params.getDate("transaction_time");
}
if (params.getDate("transaction_time").after(dateto)) {
dateto = params.getDate("transaction_time");
}
}
}
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} else {
BigDecimal channelRate;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
} else {
BigDecimal channelRate;
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("aliapy_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
if ("alipay_cn".equalsIgnoreCase(params.getString("pay_type"))) {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal("alipayonline_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : ((orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))).divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
} else {
channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN));
}
BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge")
.subtract(params.getBigDecimal("surcharge_cashback"))
.subtract(params.getBigDecimal("transaction_fee"));
//增加货币判断
//增加transaction_fee为null异常
if (!params.containsKey("transaction_fee") || StringUtils.isEmpty(params.getString("transaction_fee"))) {
params.put("transaction_fee", BigDecimal.ZERO);
}
int i = currencyScale(params.getString("clearing_currency"));
if (total.compareTo(BigDecimal.ZERO) == 0) {
datefrom = params.getDate("transaction_time");
dateto = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
int i = currencyScale(params.getString("clearing_currency"));
if (total.compareTo(BigDecimal.ZERO) == 0) {
datefrom = params.getDate("transaction_time");
}
if (params.getDate("transaction_time").after(dateto)) {
dateto = params.getDate("transaction_time");
} else {
if (params.getDate("transaction_time").before(datefrom)) {
datefrom = params.getDate("transaction_time");
}
if (params.getDate("transaction_time").after(dateto)) {
dateto = params.getDate("transaction_time");
}
}
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
}
total = total.add(tmpClearingAmount);
total_surage = total_surage.add(tmpTotalSurcharge).setScale(i, RoundingMode.HALF_UP);
royalpay_surage = royalpay_surage.add(tmpClearingAmount.multiply(channelRate).setScale(i, RoundingMode.HALF_UP));
//net_surage = net_surage.add(getThirdPartyCharge(params.getString("channel"), params.getBigDecimal("clearing_amount"), channelCharge));
net_surage = net_surage.add(params.getBigDecimal("channel_surcharge"));
transaction_fee = transaction_fee.add(params.getBigDecimal("transaction_fee"));
}
BigDecimal org_charge = total_surage.subtract(royalpay_surage);
if (channel.toLowerCase().equals("alipay_direct")) {
channel = channel.replace("_", "");
}
json.put("channel", oneChannel.getKey());
json.put("record_id", recordId);
json.put("client_id", clientId);
if (clientRate != null) {
json.put("client_rate", clientRate.getBigDecimal("rate_value"));
} else {
json.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
}
json.put("gross_amount", total);
json.put("total_charge", total_surage);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
json.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
json.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
json.put("royalpay_charge", royalpay_surage);
if (type == 1) {
json.put("net_charge", net_surage);
}
if (type == 2) {
json.put("org_net_charge", net_surage);
}
json.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
json.put("transaction_fee", transaction_fee);
json.put("commission_type", "1");
json.put("create_time", new Date());
json.put("date_from", DateFormatUtils.format(datefrom, "yyyy-MM-dd"));
json.put("date_to", DateFormatUtils.format(dateto, "yyyy-MM-dd"));
json.put("year", year);
json.put("month", month);
amountByChannel.add(json);
}
BigDecimal org_charge = total_surage.subtract(royalpay_surage);
if (channel.toLowerCase().equals("alipay_direct")) {
channel = channel.replace("_", "");
}
json.put("channel", oneChannel.getKey());
json.put("record_id", recordId);
json.put("client_id", clientId);
if (clientRate != null) {
json.put("client_rate", clientRate.getBigDecimal("rate_value"));
} else {
json.put("client_rate", oneChannel.getValue().get(0).getBigDecimal("surcharge_rate").multiply(CommonConsts.HUNDRED));
}
json.put("gross_amount", total);
json.put("total_charge", total_surage);
if (payChannel == PayChannel.ALIPAY_APS_IN_STORE) {
json.put("org_rate", (orgInfo.getBigDecimal("retail_interchange_fee_value").add(orgInfo.getBigDecimal("retail_service_fee_value"))));
} else if (payChannel == PayChannel.ALIPAY_APS_CASHIER) {
json.put("org_rate", (orgInfo.getBigDecimal("online_interchange_fee_value").add(orgInfo.getBigDecimal("online_service_fee_value"))));
} else {
json.put("org_rate", orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value"));
}
json.put("royalpay_charge", royalpay_surage);
if (type == 1) {
json.put("net_charge", net_surage);
}
if (type == 2) {
json.put("org_net_charge", net_surage);
}
json.put("org_charge", org_charge.signum() < 0 ? new BigDecimal(0) : org_charge);
json.put("transaction_fee", transaction_fee);
json.put("commission_type", "1");
json.put("create_time", new Date());
json.put("date_from", DateFormatUtils.format(datefrom, "yyyy-MM-dd"));
json.put("date_to", DateFormatUtils.format(dateto, "yyyy-MM-dd"));
json.put("year", year);
json.put("month", month);
amountByChannel.add(json);
}
return amountByChannel;

@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by yixian on 2017-03-08.
@ -28,6 +29,7 @@ public class CityPartnerPrizeController {
/**
*
*
* @param param
*/
@PostMapping("/generate")
@ -42,8 +44,8 @@ public class CityPartnerPrizeController {
}
@GetMapping("/export/{monthStr}")
public void exportExcel(@PathVariable String monthStr,HttpServletResponse httpResponse) throws Exception {
cityPartnerPrizeService.exportMonthFiles(monthStr,httpResponse);
public void exportExcel(@PathVariable String monthStr, HttpServletResponse httpResponse) throws Exception {
cityPartnerPrizeService.exportMonthFiles(monthStr, httpResponse);
}
@GetMapping(value = "/months/{monthStr}")
@ -79,6 +81,7 @@ public class CityPartnerPrizeController {
int type = 1;
ArrayList<JSONObject> objectAlipayPlus = new ArrayList<>();
ArrayList<Object> unGmos = new ArrayList<>();
ArrayList<JSONObject> aps = new ArrayList<>();
for (JSONObject jsonObject : entry.getValue()) {
grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount"));
totalCharge = totalCharge.add(jsonObject.getBigDecimal("total_charge"));
@ -94,6 +97,8 @@ public class CityPartnerPrizeController {
if (StringUtils.equalsAny(jsonObject.getString("channel"), "alipay_cn", "alipay_ac_sg", "alipay_ac_mo", "alipay_ac_hk", "alipay_ac_lu", "alipay_ac_gb", "alipay_ac_us", "paytm", "kakaopay", "truemoney", "ezlink", "gcash", "tng", "dana", "easy_paisa", "bkash", "lazada_wallet_my")) {
jsonObject.put("channel", AlipayPlusChannelEnum.statusOf(jsonObject.getString("channel")).description());
objectAlipayPlus.add(jsonObject);
} else if (StringUtils.equalsAny(jsonObject.getString("channel"), "ApsInStore,alipayCN", "ApsInStore,alipayOS", "ApsCashier,alipayCN", "ApsCashier,alipayOS")) {
aps.add(jsonObject);
} else {
unGmos.add(jsonObject);
}
@ -109,7 +114,7 @@ public class CityPartnerPrizeController {
sumResult.put("org_name", cityPartnerName);
sumResult.put("org_id", org_id);
sumResult.put("net_charge", netCharge);
sumResult.put("type",type);
sumResult.put("type", type);
if (objectAlipayPlus.size() != 0) {
JSONObject totalAlipayPlus = new JSONObject();
for (JSONObject alipayPlus : objectAlipayPlus) {
@ -128,6 +133,12 @@ public class CityPartnerPrizeController {
totalAlipayPlus.put("AlipayPlus", objectAlipayPlus);
unGmos.add(totalAlipayPlus);
}
if(aps.size() != 0){
List<JSONObject> apsInfo = getApsInfo(aps, monthStr);
for (JSONObject jsonObject : apsInfo) {
unGmos.add(jsonObject);
}
}
sumResult.put("channel_detail", unGmos);
resultTotalCharge = resultTotalCharge.add(totalCharge);
resultRoyalpayCharge = resultRoyalpayCharge.add(royalpayCharge);
@ -150,6 +161,51 @@ public class CityPartnerPrizeController {
return result;
}
private List<JSONObject> getApsInfo(List<JSONObject> partnerPrizes, String monthStr) {
for (JSONObject prize : partnerPrizes) {
String[] channels = prize.getString("channel").split(",");
if (channels.length == 2) {
prize.put("channel", channels[0]);
prize.put("pay_type", channels[1]);
}
}
List<JSONObject> apsInfo = new ArrayList<>();
Map<String, List<JSONObject>> groupByChannel = partnerPrizes.stream().collect(Collectors.groupingBy(e -> e.getString("channel")));
for (Map.Entry<String, List<JSONObject>> channel : groupByChannel.entrySet()) {
if (channel.getKey().equals("ApsInStore") || channel.getKey().equals("ApsCashier")) {
JSONObject sumAps = new JSONObject();
sumAps.put("gross_amount", 0);
sumAps.put("total_charge", 0);
sumAps.put("royalpay_charge", 0);
sumAps.put("org_charge", 0);
sumAps.put("net_charge", 0);
sumAps.put("share_charge", 0);
for (JSONObject aps : channel.getValue()) {
plusKey(sumAps, aps, "gross_amount");
plusKey(sumAps, aps, "total_charge");
if (aps.get("parent_org_id") == null) {
aps.put("org_charge", aps.getBigDecimal("org_charge").add(aps.getBigDecimal("share_charge")));
}
plusKey(sumAps, aps, "royalpay_charge");
plusKey(sumAps, aps, "org_charge");
plusKey(sumAps, aps, "net_charge");
plusKey(sumAps, aps, "share_charge");
aps.put("monthstr", monthStr);
}
sumAps.put("org_rate", channel.getValue().get(0).getString("org_rate"));
sumAps.put("channel", channel.getKey());
sumAps.put("monthstr", monthStr);
sumAps.put("sunAps", channel.getValue());
apsInfo.add(sumAps);
}
}
return apsInfo;
}
private void plusKey(JSONObject sum, JSONObject prize, String key) {
sum.put(key, sum.getBigDecimal(key).add(prize.getBigDecimal(key)));
}
@ManagerMapping("/months/{monthStr}/orgs/{orgId}")
public JSONObject getCityPartnerPrizeDetail(@PathVariable String monthStr, @PathVariable String orgId) {
return cityPartnerPrizeService.getCityPartnerPrizeDetail(monthStr, orgId);
@ -247,10 +303,10 @@ public class CityPartnerPrizeController {
Map<String, List<JSONObject>> partenerPrizeMap = new HashMap<>();
for (JSONObject partnerPrizeInfo : partnerPrizeInfos) {
String key = partnerPrizeInfo.getString("org_id");
if(countPartnerPrizeMap.containsKey(key)){
partnerPrizeInfo.put("royalpay_charge",countPartnerPrizeMap.get(key).getBigDecimal("royalpay_charge"));
}else {
partnerPrizeInfo.put("royalpay_charge",BigDecimal.ZERO);
if (countPartnerPrizeMap.containsKey(key)) {
partnerPrizeInfo.put("royalpay_charge", countPartnerPrizeMap.get(key).getBigDecimal("royalpay_charge"));
} else {
partnerPrizeInfo.put("royalpay_charge", BigDecimal.ZERO);
}
if (partenerPrizeMap.containsKey(key)) {
partenerPrizeMap.get(key).add(partnerPrizeInfo);
@ -262,8 +318,6 @@ public class CityPartnerPrizeController {
}
JSONObject result = new JSONObject();
List<JSONObject> partnerInfos = new ArrayList<>(partenerPrizeMap.size());
BigDecimal resultGrossAmount = BigDecimal.ZERO;
@ -292,11 +346,11 @@ public class CityPartnerPrizeController {
}
sumResult.put("gross_amount", grossAmount);
sumResult.put("org_charge", orgCharge);
sumResult.put("org_net_charge",orgNetCharge);
sumResult.put("org_net_charge", orgNetCharge);
sumResult.put("org_name", cityPartnerName);
sumResult.put("org_id", org_id);
sumResult.put("channel_detail", entry.getValue());
sumResult.put("royalpay_charge",royalpayCharge);
sumResult.put("royalpay_charge", royalpayCharge);
resultGrossAmount = resultGrossAmount.add(grossAmount);
resultOrgCharge = resultOrgCharge.add(orgCharge);
resultAgentCharge = resultAgentCharge.add(agentCharge);
@ -322,14 +376,14 @@ public class CityPartnerPrizeController {
@GetMapping("/senior/{orgId}")
public void findOne(@RequestParam String monthStr, @PathVariable String orgId) {
cityPartnerPrizeService.getSenior(monthStr,orgId);
cityPartnerPrizeService.getSenior(monthStr, orgId);
}
@GetMapping("/senior/{orgId}/details")
public List<JSONObject> findDetail(@RequestParam String monthStr, @PathVariable String orgId) {
JSONObject params = new JSONObject();
params.put("monthStr",monthStr);
params.put("org_id",orgId);
return cityPartnerPrizeService.querySenior(params);
params.put("monthStr", monthStr);
params.put("org_id", orgId);
return cityPartnerPrizeService.querySenior(params);
}
}

@ -0,0 +1,34 @@
package au.com.royalpay.payment.manage.mappers.apskyc;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@AutoMapper(tablename = "sys_aps_notice_clients", pkName = "id")
public interface ApsNoticeClientMapper {
@AutoSql(SqlType.INSERT)
void saveApsNoticeClient(ApsNoticeClient apsNoticeClient);
@AutoSql(SqlType.UPDATE)
void updateApsNoticeClient(ApsNoticeClient apsNoticeClient);
PageList<JSONObject> getApsNoticeClients(String id, PageBounds pageBounds);
void updateApsNoticeClientByPartnerCode(@Param("modify_time") Date modifyTime, @Param("modifier") String modifier, @Param("partner_code") String partnerCode);
@AutoSql(SqlType.SELECT)
ApsNoticeClient getApsNoticeClientById(String id);
JSONObject getApsKycClient(@Param("client_moniker")String clientMoniker);
@AutoSql(SqlType.UPDATE)
void toUpdateApsKycClient(JSONObject updateReadTime);
}

@ -0,0 +1,27 @@
package au.com.royalpay.payment.manage.mappers.apskyc;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNotice;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.yixsoft.support.mybatis.autosql.annotations.AutoMapper;
import com.yixsoft.support.mybatis.autosql.annotations.AutoSql;
import com.yixsoft.support.mybatis.autosql.annotations.SqlType;
import java.util.List;
@AutoMapper(tablename = "sys_aps_notice", pkName = "id")
public interface ApsNoticeMapper {
PageList<JSONObject> getApsNotices(PageBounds pageBounds);
@AutoSql(SqlType.INSERT)
void saveApsNotice(ApsNotice apsNotice);
@AutoSql(SqlType.SELECT)
ApsNotice getApsNoticesById(String id);
@AutoSql(SqlType.UPDATE)
void updateApsNotice(JSONObject apsNotice);
List<JSONObject> getApsNotice(String id);
}

@ -85,7 +85,7 @@ public interface ClientManager {
@Transactional(noRollbackFor = EmailException.class)
void auditClientGreenChannel(JSONObject manager, String clientMoniker);
void checkAndSendInitEmail(JSONObject manager, String clientMoniker,String type);
void checkAndSendInitEmail(JSONObject manager, String clientMoniker, String type);
void markApproveEmailSendStatus(String clientMoniker, JSONObject manager);
@ -393,10 +393,11 @@ public interface ClientManager {
void getAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
void getAggregateCardAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
//重新制作卡支付合同
void getAggregateCardAgreeFileAgain(String clientMoniker, JSONObject manager) throws Exception;
void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal,String rateid,HttpServletResponse httpResponse);
void getAggregateCardPromotionaAgreeFile(String clientMoniker, JSONObject manager, boolean renewal, String rateid, HttpServletResponse httpResponse);
void getNewAggregateAgreeFile(String clientMoniker, JSONObject manager, boolean renewal) throws Exception;
@ -444,7 +445,7 @@ public interface ClientManager {
void changeApplicationSubMerchantById(String clientMoniker, String merchantAppId, NewSubMerchantIdApply subMerchantIdApply, JSONObject manager);
JSONObject querySubMerchantStatus(String clientMoniker,String subMerchantId);
JSONObject querySubMerchantStatus(String clientMoniker, String subMerchantId);
void registerAlipayGms(String clientMoniker, JSONObject manager);
@ -609,8 +610,11 @@ public interface ClientManager {
MerchantApplicationResult alipayPlusRegisterMerchant(String clientMoniker, ApsMerchantApplication apsMerchantApplication, JSONObject manager);//alipayplus 注册商户
String queryAlipayPlusOnlineStatus(boolean isOffline,String clientMoniker, JSONObject manager);
String queryAlipayPlusOnlineStatus(boolean isOffline, String clientMoniker, JSONObject manager);
String queryAlipayPlusOfflineStatus(String clientMoniker, JSONObject manager);
JSONObject getApsKycClient(JSONObject account, String clientMoniker);
void updateApsKycClient(JSONObject account, JSONObject item);
}

@ -32,7 +32,6 @@ import au.com.royalpay.payment.core.beans.MerchantApplicationResult;
import au.com.royalpay.payment.core.exceptions.EmailException;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager;
import au.com.royalpay.payment.core.impls.MerchantChannelPermissionManager;
import au.com.royalpay.payment.core.mappers.SysClientMapper;
import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver;
import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper;
@ -41,15 +40,15 @@ import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean;
import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean;
import au.com.royalpay.payment.manage.appclient.core.RetailRSvcService;
import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.apsKYC.domain.entity.ApsNoticeClient;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.gateway.core.GatewayMerchantApply;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeClientMapper;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.ClientsOperationLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogClientSubMerchantIdMapper;
import au.com.royalpay.payment.manage.mappers.payment.CommonSubMerchantIdMapper;
@ -328,6 +327,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private PaymentApi paymentApi;
@Resource
private ApsConfigService apsConfigService;
@Resource
private ApsNoticeClientMapper apsNoticeClientMapper;
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
@ -556,17 +557,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client.put("enable_alipayaps", false);
MerchantChannelPermissionResolver resolverApsInStore = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_IN_STORE.getChannelCode()).getChannelPermissionResolver();
MerchantChannelPermissionResolver resolverApsCashier = this.paymentApi.channelApi(PayChannel.ALIPAY_APS_CASHIER.getChannelCode()).getChannelPermissionResolver();
if(!Objects.isNull(resolverApsInStore) && !Objects.isNull(resolverApsCashier) &&
if (!Objects.isNull(resolverApsInStore) && !Objects.isNull(resolverApsCashier) &&
(resolverApsInStore.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency()) ||
resolverApsCashier.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency()))){
resolverApsCashier.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency()))) {
client.put("enable_alipayaps", true);
}
ApsConfigData apsConfig = apsConfigService.getApsConfigByClientId(client.getString("client_id"));
if (apsConfig == null) {
apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor());
if (client.getBoolean("enable_alipay")) {
apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor().setAlipayCnSwitch(false));
} else if (client.getBoolean("enable_alipayaps")) {
apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor().setAlipayCnSwitch(true));
}
}
if (apsConfig != null) {
client.put("aps_config_id", apsConfig.getId());
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
}
client.put("aps_config_id", apsConfig.getId());
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
return client;
}
@ -1591,14 +1598,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public void switchChannelPermission(JSONObject manager, String clientMoniker, String channel, boolean allow) {
PayChannel payChannel = PayChannel.fromChannelCode(channel);
if(payChannel == PayChannel.ALIPAY_APS){
if (payChannel == PayChannel.ALIPAY_APS) {
ArrayList<String> apsChannels = new ArrayList<>();
apsChannels.add(PayChannel.ALIPAY_APS_IN_STORE.getChannelCode());
apsChannels.add(PayChannel.ALIPAY_APS_CASHIER.getChannelCode());
apsChannels.forEach(apsChannel->{
apsChannels.forEach(apsChannel -> {
extracted(manager, clientMoniker, apsChannel, allow);
});
}else {
} else {
extracted(manager, clientMoniker, channel, allow);
}
}
@ -1613,7 +1620,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
try {
clientModifySupport.processModify(new SwitchChannelPermissionModify(manager, clientMoniker, merchantInfoProvider, channelApi.getChannelPermissionResolver(), allow));
} catch (Exception e) {
logger.error("Failed to change channel switch:{}", channel,e);
logger.error("Failed to change channel switch:{}", channel, e);
}
logger.info("{}({}) switched client {} channel {} to {}", manager.getString("display_name"), manager.getString("manager_id"), clientMoniker, channel, allow);
if (allow && (StringUtils.equalsAnyIgnoreCase("Wechat", channel) || StringUtils.equalsAnyIgnoreCase("Alipay", channel))) {
@ -7154,6 +7161,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return null;
}
@Override
public JSONObject getApsKycClient(JSONObject account, String clientMoniker) {
return apsNoticeClientMapper.getApsKycClient(clientMoniker);
}
@Override
public void updateApsKycClient(JSONObject account, JSONObject item) {
ApsNoticeClient apsNoticeClientById = apsNoticeClientMapper.getApsNoticeClientById(item.getString("id"));
if (apsNoticeClientById.getReadTime() == null) {
item.put("read_time", new Date());
}
item.put("status_time", new Date());
item.put("user_id", account.getString("account_id"));
apsNoticeClientMapper.toUpdateApsKycClient(item);
}
private void exportLetterOfferPDF(String clientMoniker, JSONObject manage) {
JSONObject info = convertClientLetterOfferInfo(clientMoniker);
String pdfPath = this.getClass().getClassLoader().getResource("").getPath() + "/templates/pdf/letter_of_offer.pdf";

@ -11,5 +11,5 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class ApsConfigDescriptor {
private Boolean alipayCnSwitch = false;
private Boolean alipayCnSwitch;
}

@ -29,8 +29,6 @@ public class ApsConfigData implements Serializable {
private String clientId;
private Boolean enableAlipayAps;
private Boolean alipayCnSwitch;
public static ApsConfigData saveData(String managerId, String clientId, ApsConfigDescriptor apsConfigDescriptor) {

@ -1,5 +1,7 @@
package au.com.royalpay.payment.manage.merchants.web;
import au.com.royalpay.payment.core.cancelorder.service.CancelOrderService;
import au.com.royalpay.payment.core.cancelorder.service.impl.CancelOrderServiceImpl;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
@ -63,6 +65,9 @@ public class PartnerViewController {
@Resource
private KycService kycService;
@Resource
private CancelOrderService cancelOrderService;
@RequestMapping(method = RequestMethod.GET)
@RequirePartner
@ResponseBody
@ -89,7 +94,7 @@ public class PartnerViewController {
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream();
clientManager.writeQrCodeBoard(null, account.getString("client_moniker"), config, ous,"PC");
clientManager.writeQrCodeBoard(null, account.getString("client_moniker"), config, ous, "PC");
}
@PartnerMapping(value = "/qrcode_board/aggregate", method = RequestMethod.GET)
@ -98,16 +103,16 @@ public class PartnerViewController {
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream();
clientManager.writeAggregateQrCodeBoard(null, account.getString("client_moniker"), config, ous,"pc");
clientManager.writeAggregateQrCodeBoard(null, account.getString("client_moniker"), config, ous, "pc");
}
@PartnerMapping(value = "/qrcode_board/CBBankAggregate", method = RequestMethod.GET)
public void getCBBankAggregateQRCodeBoardImage(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition", "attachment; filename=qr_board.jpg");
OutputStream ous = response.getOutputStream();
clientManager.writeCBBankAggregateQrCodeBoard(null, account.getString("client_moniker"), ous,"pc");
clientManager.writeCBBankAggregateQrCodeBoard(null, account.getString("client_moniker"), ous, "pc");
}
@PartnerMapping(value = "/poster", method = RequestMethod.GET)
@ -175,8 +180,8 @@ public class PartnerViewController {
@PartnerMapping(value = "/{clientMoniker}/order_expiry_config", method = RequestMethod.PUT)
@ResponseBody
public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setOrderExpiryConfig(account,clientMoniker, config.getString("order_expiry_config"));
public void setOrderExpiryConfig(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable String clientMoniker, @RequestBody JSONObject config) {
clientManager.setOrderExpiryConfig(account, clientMoniker, config.getString("order_expiry_config"));
}
@PartnerMapping(value = "/{clientMoniker}/surcharge_account", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ -195,13 +200,13 @@ public class PartnerViewController {
@PartnerMapping(value = "/{clientMoniker}/account/transactions/date", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ReadOnlyConnection
@ResponseBody
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker,@RequestParam String date) {
public List<JSONObject> accountTransactionsByDate(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker, @RequestParam String date) {
return clientManager.getAccountTransactionsByDetailId(manager, clientMoniker, date);
}
@PartnerMapping(value = "/{clientMoniker}/account/months", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public List<JSONObject> getAccountDetailByMonths(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker){
public List<JSONObject> getAccountDetailByMonths(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject manager, @PathVariable String clientMoniker) {
return clientManager.getAccountDetailByMonths(manager, clientMoniker);
}
@ -266,7 +271,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/pay_notice", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void togglePayNotice(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject enable) {
clientManager.togglePayNotice(account,account.getString("client_moniker"), enable.getBooleanValue("enable"));
clientManager.togglePayNotice(account, account.getString("client_moniker"), enable.getBooleanValue("enable"));
}
@PartnerMapping(value = "/audit_refund", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ -322,7 +327,7 @@ public class PartnerViewController {
@ResponseBody
public JSONObject getClientBankAccount(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
JSONObject bankInfo = clientManager.listClientBankAccounts(null, account.getString("client_moniker"));
bankInfo.put("account_no","***"+ StringUtils.substring(bankInfo.getString("account_no"), -4));
bankInfo.put("account_no", "***" + StringUtils.substring(bankInfo.getString("account_no"), -4));
return bankInfo;
}
@ -339,7 +344,7 @@ public class PartnerViewController {
if (!timezone.matches("^((Australia/West)|(Australia/Eucla)|(Australia/North)|(Australia/South)|(Australia/Brisbane)|(Australia/Melbourne)|(Australia/LHI))$")) {
throw new ParamInvalidException("timezone", "error.payment.valid.invalid_timezone");
}
clientManager.updateTimeZone(account,account.getString("client_moniker"), timezone);
clientManager.updateTimeZone(account, account.getString("client_moniker"), timezone);
}
@PartnerMapping(value = "/sub_partners", method = RequestMethod.GET)
@ -353,7 +358,7 @@ public class PartnerViewController {
public JSONObject listSubPartnersByPage(@RequestParam(defaultValue = "1") int page,
@RequestParam(required = false) String searchText,
@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.listSubClientsByPage(null, account.getString("client_moniker"), searchText,page);
return clientManager.listSubClientsByPage(null, account.getString("client_moniker"), searchText, page);
}
@PartnerMapping(value = "/devices", method = RequestMethod.GET, roles = PartnerRole.ADMIN)
@ -367,7 +372,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/device_ids", method = RequestMethod.GET, roles = PartnerRole.ADMIN)
@ResponseBody
public JSONObject listClientDeviceIds(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,
@RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids) {
@RequestParam(required = false) String client_type, @RequestParam(required = false) String[] client_ids) {
return clientManager.listClientDeviceIds(account.getString("client_moniker"), client_type, client_ids);
}
@ -483,7 +488,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/customer_surcharge_rate", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void setCustomerSurchargeRate(@RequestBody JSONObject pass, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.setCustomerSurchargeRate(account,account.getString("client_moniker"), pass.getBigDecimal("customer_surcharge_rate"));
clientManager.setCustomerSurchargeRate(account, account.getString("client_moniker"), pass.getBigDecimal("customer_surcharge_rate"));
}
@PartnerMapping(value = "/trade_logs/full_release_preauth", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ -496,7 +501,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/manual_settle", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void manualSettle(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam boolean manual_settle) {
clientManager.changeManualSettle(account,account.getIntValue("client_id"), manual_settle, account.getString("account_id"), 1, "商户" + (manual_settle ? "打开" : "关闭") + "手动清算");
clientManager.changeManualSettle(account, account.getIntValue("client_id"), manual_settle, account.getString("account_id"), 1, "商户" + (manual_settle ? "打开" : "关闭") + "手动清算");
}
@PartnerMapping(value = "/checkContract", method = RequestMethod.GET)
@ -520,7 +525,7 @@ public class PartnerViewController {
@PartnerMapping(value = "/compliance/files", method = RequestMethod.GET)
@ResponseBody
public JSONObject complianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
return clientManager.getAuthFiles(null,account.getString("client_moniker"));
return clientManager.getAuthFiles(null, account.getString("client_moniker"));
}
@ -557,17 +562,17 @@ public class PartnerViewController {
@PartnerMapping(value = "/verify/email", method = RequestMethod.PUT)
@ResponseBody
public void sendVerifyEmail(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) {
clientManager.sendVerifyEmail(account.getJSONObject("client"),account.getString("account_id"));
clientManager.sendVerifyEmail(account.getJSONObject("client"), account.getString("account_id"));
}
@PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT,roles = PartnerRole.ADMIN)
@PartnerMapping(value = "/update/partnerInfo", method = RequestMethod.PUT, roles = PartnerRole.ADMIN)
@ResponseBody
public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account,@RequestBody ClientRegisterInfo info) {
public void updatePartnerInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientRegisterInfo info) {
JSONObject client = account.getJSONObject("client");
if (client.getIntValue("approve_result") != 1){
clientManager.updateClientRegisterInfo(null,account.getString("client_moniker"),info);
}else {
if (client.getIntValue("approve_result") != 1) {
clientManager.updateClientRegisterInfo(null, account.getString("client_moniker"), info);
} else {
throw new BadRequestException("已通过审核,暂不能提交和修改");
}
@ -577,11 +582,11 @@ public class PartnerViewController {
@ResponseBody
public void updateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) {
JSONObject client = account.getJSONObject("client");
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4){
if (client.getIntValue("approve_result") != 1 && client.getIntValue("source") == 4) {
JSONObject manager = new JSONObject();
manager.put("display_name","client");
manager.put("display_name", "client");
clientManager.uploadAuthFiles(manager, account.getString("client_moniker"), filesInfo);
}else {
} else {
throw new BadRequestException("已通过审核,暂不能提交和修改");
}
}
@ -593,16 +598,16 @@ public class PartnerViewController {
JSONObject authFileStatus = signInAccountService.checkAuthFileStatus(client);
if (authFileStatus.getBooleanValue("client_less_file")) {
JSONObject manager = new JSONObject();
manager.put("display_name","client");
manager.put("display_name", "client");
clientManager.uploadAuthFilesForWaitCompliance(manager, account.getString("client_moniker"), filesInfo);
}else {
} else {
throw new BadRequestException("已通过审核,暂不能提交和修改");
}
}
@PartnerMapping(value = "/clientCompliance/{clientMoniker}/viewCommit", method = RequestMethod.POST)
@ResponseBody
public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject photoInfo) {
public void clientComplianceViewCommit(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject photoInfo) {
account.put("photo_info", photoInfo);
clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web");
}
@ -636,31 +641,50 @@ public class PartnerViewController {
/**
*
*
* @param clientMoniker
* @return
*/
@PartnerMapping(value = "/{clientMoniker}/incremental_service", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject getClientIncrementalService(@PathVariable String clientMoniker){
return clientManager.partnerIncrementalService(clientMoniker);
public JSONObject getClientIncrementalService(@PathVariable String clientMoniker) {
return clientManager.partnerIncrementalService(clientMoniker);
}
/**
*
*
* @param clientMoniker
* @param channel
* @return
*/
@PartnerMapping(value = "/{clientMoniker}/incremental_service/{channel}/info", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject getClientIncrementalServiceInfo(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("channel") String channel){
return clientManager.partnerIncrementalServiceInfo(clientMoniker,channel);
public JSONObject getClientIncrementalServiceInfo(@PathVariable("clientMoniker") String clientMoniker, @PathVariable("channel") String channel) {
return clientManager.partnerIncrementalServiceInfo(clientMoniker, channel);
}
@PartnerMapping(value = "/incremental_service/{channel}/login_token", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject getClientIncrementalServiceLoginToken(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable("channel") String sourceCode){
return clientManager.getClientIncrementalServiceLoginToken(account,sourceCode);
public JSONObject getClientIncrementalServiceLoginToken(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable("channel") String sourceCode) {
return clientManager.getClientIncrementalServiceLoginToken(account, sourceCode);
}
@PartnerMapping(value = "/{clientMoniker}/aps_kyc", method = RequestMethod.GET, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public JSONObject getApsKycClient(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @PathVariable("clientMoniker") String clientMoniker) {
return clientManager.getApsKycClient(account, clientMoniker);
}
@PartnerMapping(value = "/aps_kyc", method = RequestMethod.PUT, roles = {PartnerRole.ADMIN, PartnerRole.MANAGER})
@ResponseBody
public void updateApsKycClient(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject item) {
clientManager.updateApsKycClient(account, item);
}
@PartnerMapping(value = "/cancel_order", method = RequestMethod.POST)
@ResponseBody
public JSONObject cancel(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject order, Errors errors) {
System.out.println("=====>cancel_order");
return cancelOrderService.cancelOrderOrNot(order.getString("orderId"));
}
}

@ -181,6 +181,9 @@ public class TradeLogServiceImpl implements TradeLogService {
params.put("hide_sub_mch", mchConfig.getBooleanValue("hide_sub_mch"));
PageList<JSONObject> logs = orderMapper.listOrdersByClients(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc")));
logs.stream().forEach(log->{
log.put("is_today",DateUtils.isSameDay(Optional.ofNullable(log.getDate("transaction_time")).orElse(new Date()),new Date())) ;
});
if (timezone != null) {
TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time");
}

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeClientMapper">
<update id="updateApsNoticeClientByPartnerCode">
UPDATE sys_aps_notice_clients
SET modifier = #{modifier},
modify_time = #{modify_time},
is_valid = 1
WHERE partner_code = #{partner_code}
</update>
<select id="getApsNoticeClients" resultType="com.alibaba.fastjson.JSONObject">
SELECT *
FROM sys_aps_notice_clients
where notice_id = #{id}
</select>
<select id="getApsKycClient" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.*,
n.title,
n.content
FROM sys_aps_notice_clients c
INNER JOIN sys_aps_notice n ON n.id = c.notice_id
WHERE c.partner_code = #{client_moniker}
AND n.`status` = 0
AND c.`status` IN (0, 1)
AND c.is_valid = 0
AND c.handle = 0
</select>
</mapper>

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="au.com.royalpay.payment.manage.mappers.apskyc.ApsNoticeMapper">
<select id="getApsNotices"
resultType="com.alibaba.fastjson.JSONObject">
SELECT n.id,
n.create_time createTime,
n.title,
n.content,
n.status,
count(c.id) clientsNum,
sum(IF(c.`status` = 0, 1, 0)) noRead,
sum(IF(c.`status` = 2, 1, 0)) agree,
sum(IF(c.handle = 1, 1, 0)) handleNum
FROM sys_aps_notice n
INNER JOIN sys_aps_notice_clients c
ON n.id = c.notice_id
GROUP BY c.notice_id
ORDER BY n.create_time DESC
</select>
<select id="getApsNotice" resultType="com.alibaba.fastjson.JSONObject">
SELECT n.title, n.content, c.partner_code, n.create_time
FROM sys_aps_notice n
INNER JOIN sys_aps_notice_clients c ON c.notice_id = n.id
where n.id = #{id}
</select>
</mapper>

@ -104,7 +104,8 @@
p.short_name partner_name,
format(o.refund_amount * 100, 0) refund_fee,
t.clearing_status,
t.settle_amount
t.settle_amount,
t.transaction_time
</sql>
<update id="updateRefundAmount">

@ -70,20 +70,25 @@
.dh {
animation: myfirst 1s linear 0s infinite alternate;
}
.navbar-header a{
.navbar-header a {
color: #FFF;
}
.navbar-header .active{
.navbar-header .active {
background-color: #FFF !important;
}
.navbar-header .active a{
.navbar-header .active a {
color: #f06101 !important;
}
.navbar-header li {
float: left;
border: 1px solid #FFF;
padding: 3px 15px;
}
@media (min-width: 768px) {
.navbar-header {
list-style: none;
@ -150,13 +155,15 @@ margin-bottom: 10%;"/>
ng-click="toggleHideSideBar()">
<span class="sr-only">Toggle navigation</span>
</a>
<select class="navbar-header" style="height: 30px;border: 0;text-align: center;text-align-last:center;" ng-model="roleNow" ng-change="changeRole(roleNow)">
<select class="navbar-header" style="height: 30px;border: 0;text-align: center;text-align-last:center;"
ng-model="roleNow" ng-change="changeRole(roleNow)">
<option ng-repeat="x in role" value="{{x.value}}">{{x.module}}</option>
</select>
<div class="navbar-custom-menu">
<ul class="navbar-header" style="position: relative;left: 10%">
<li ui-sref-active="active" style="border-bottom-left-radius: 5px;border-top-left-radius: 5px;background-color: #FFF; ">
<a href="/manage.html" role="button" style="color:#f06101 !important;">v1</a>
<li ui-sref-active="active"
style="border-bottom-left-radius: 5px;border-top-left-radius: 5px;background-color: #FFF; ">
<a href="/manage.html" role="button" style="color:#f06101 !important;">v1</a>
</li>
<li ui-sref-active="active" style="border-bottom-right-radius: 5px;border-top-right-radius: 5px;">
<a href="/managev2.html" role="button">v2</a>
@ -174,8 +181,10 @@ margin-bottom: 10%;"/>
<i class="fa fa-wechat"></i> Bind WeChat
</a>
</li>
<li ng-if="('110'|withRole)" ng-class="{'dropdown notifications-menu open':openNotice,'dropdown notifications-menu':!openNotice}">
<a title="New Notice" ng-click="toggleOpenNotice()" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
<li ng-if="('110'|withRole)"
ng-class="{'dropdown notifications-menu open':openNotice,'dropdown notifications-menu':!openNotice}">
<a title="New Notice" ng-click="toggleOpenNotice()" class="dropdown-toggle"
data-toggle="dropdown" aria-expanded="true">
<i class="fa fa-bell-o"></i>
<span class="label label-warning" ng-if="notifyCounts">{{notifyCounts}}</span>
</a>
@ -185,20 +194,27 @@ margin-bottom: 10%;"/>
-->
<li>
<!--inner menu: contains the actual data-->
<div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; max-height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%;">
<li>
<a ng-if="partner_application_new" ui-sref="partner_apply">
<i class="fa fa-commenting"></i>
新的自主申请商户<span style="font-size:smaller;float:right;right: 0"></span>
</a>
</li>
<li>
<a ng-if="refundReviews && ('10000000000'|withRole)" ui-sref="refundReview">
<i class="fa fa-commenting"></i>
新的退款申请<span style="font-size:smaller;float:right;right: 0"></span>
</a>
</li>
</ul><div class="slimScrollBar" style="background: rgb(0, 0, 0); width: 3px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 195.122px;"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; background: rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;"></div></div>
<div class="slimScrollDiv"
style="position: relative; overflow: hidden; width: auto; max-height: 200px;">
<ul class="menu" style="overflow: hidden; width: 100%;">
<li>
<a ng-if="partner_application_new" ui-sref="partner_apply">
<i class="fa fa-commenting"></i>
新的自主申请商户<span style="font-size:smaller;float:right;right: 0"></span>
</a>
</li>
<li>
<a ng-if="refundReviews && ('10000000000'|withRole)" ui-sref="refundReview">
<i class="fa fa-commenting"></i>
新的退款申请<span style="font-size:smaller;float:right;right: 0"></span>
</a>
</li>
</ul>
<div class="slimScrollBar"
style="background: rgb(0, 0, 0); width: 3px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 195.122px;"></div>
<div class="slimScrollRail"
style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; background: rgb(51, 51, 51); opacity: 0.2; z-index: 90; right: 1px;"></div>
</div>
</li>
</ul>
</li>
@ -216,7 +232,8 @@ margin-bottom: 10%;"/>
<ul class="dropdown-menu user-dropdown-menu" ng-cloak>
<!--User image-->
<li class="user-header user-header-yedian">
<img ng-src="{{currentUser.org.logo||'static/images/r_white_logo.svg'}}" class="img-circle"
<img ng-src="{{currentUser.org.logo||'static/images/r_white_logo.svg'}}"
class="img-circle"
alt="User Image">
<p>
@ -306,17 +323,20 @@ margin-bottom: 10%;"/>
<i class="fa fa-plus"></i> <span>商户进件|New Partner</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('partner_analysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('partner_analysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="partners_analysis" ui-sref-opts="{reload:true}">
<i class="fa fa-list-alt"></i> <span>商户统计|Merchants Data</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('clientrate'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('clientrate'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="analysis_monitoring.client_rates" ui-sref-opts="{reload:true}">
<i class="fa fa-shopping-cart"></i> <span>商户活跃度</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('merchantAmount'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('merchantAmount'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="merchantAmountAnalysis" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>商户交易额统计</span>
</a>
@ -328,7 +348,8 @@ margin-bottom: 10%;"/>
</a>
</li>-->
<li ui-sref-active="active" ng-if="roleNow=='bduser' && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="roleNow=='bduser' && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="partnerKYCProgress" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>商户KYC认证进度</span>
</a>
@ -337,8 +358,10 @@ margin-bottom: 10%;"/>
</ul>
</li>
<li class="menu-group" ng-if="roleNow!=null && roleNow!='administrator' && roleNow!='developer'&& roleNow!='orgmanager'">
<p role="button" ng-class="{'active': Transaction,'is-hide':hideSideBar}" ng-click="Transaction = !Transaction">
<li class="menu-group"
ng-if="roleNow!=null && roleNow!='administrator' && roleNow!='developer'&& roleNow!='orgmanager'">
<p role="button" ng-class="{'active': Transaction,'is-hide':hideSideBar}"
ng-click="Transaction = !Transaction">
<span>交易管理|Transaction</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -355,22 +378,26 @@ margin-bottom: 10%;"/>
<i class="fa fa-list-alt"></i> <span>R-Service交易统计</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('transAnalysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('transAnalysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="analysis_transanalysis" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>交易数据|Transaction Data</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('dashboard'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('dashboard'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="analysis_gateway" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>Gateway统计</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('refundAnalysisApp'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('refundAnalysisApp'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="analysis_refundAnalysis" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>退款统计|Refund Analysis</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('channels_Analysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('channels_Analysis'|withModule) && (currentUser.org_id==null || currentUser.org_id==1)">
<a ui-sref="analysis_channelsAnalysis" ui-sref-opts="{reload:true}">
<i class="fa fa-area-chart"></i> <span>支付通道|Channels Analysis</span>
</a>
@ -427,7 +454,8 @@ margin-bottom: 10%;"/>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="analysis_monitoring.risk_business" ng-if="('10000000000' | withRole)" ui-sref-opts="{reload:true}">
<a ui-sref="analysis_monitoring.risk_business" ng-if="('10000000000' | withRole)"
ui-sref-opts="{reload:true}">
<i class="fa fa-list-alt"></i> <span>风控业务|Risk Business</span>
</a>
</li>
@ -459,7 +487,8 @@ margin-bottom: 10%;"/>
</ul>
</li>
<li class="menu-group" ng-if="('100' | withRole) && (currentUser.org_id==null || currentUser.org_id==1)">
<li class="menu-group"
ng-if="('100' | withRole) && (currentUser.org_id==null || currentUser.org_id==1)">
<p role="button" ng-class="{'active': Risk,'is-hide':hideSideBar}" ng-click="Risk = !Risk">
<span>风控管理|Risk</span>
<span class="pull-right-container">
@ -468,7 +497,8 @@ margin-bottom: 10%;"/>
</p>
<ul class="sidebar-menu" ng-class="{'active':Risk}">
<li ui-sref-active="active">
<a ui-sref="analysis_monitoring.risk_business_bd" ng-if="('100' | withRole)" ui-sref-opts="{reload:true}">
<a ui-sref="analysis_monitoring.risk_business_bd" ng-if="('100' | withRole)"
ui-sref-opts="{reload:true}">
<i class="fa fa-list-alt"></i> <span>风控业务|Risk Business</span>
</a>
</li>
@ -477,7 +507,8 @@ margin-bottom: 10%;"/>
<li class="menu-group" ng-if="roleNow=='compliance'">
<p role="button" ng-class="{'active': Compliance,'is-hide':hideSideBar}" ng-click="Compliance = !Compliance">
<p role="button" ng-class="{'active': Compliance,'is-hide':hideSideBar}"
ng-click="Compliance = !Compliance">
<span>合规管理|Compliance</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -540,8 +571,10 @@ margin-bottom: 10%;"/>
</ul>
</li>
<li class="menu-group" ng-if="roleNow=='accountant' || roleNow=='director' || ('1000000000'|withRole) || roleNow=='compliance'">
<p role="button" ng-class="{'active': Settlement,'is-hide':hideSideBar}" ng-click="Settlement = !Settlement">
<li class="menu-group"
ng-if="roleNow=='accountant' || roleNow=='director' || ('1000000000'|withRole) || roleNow=='compliance'">
<p role="button" ng-class="{'active': Settlement,'is-hide':hideSideBar}"
ng-click="Settlement = !Settlement">
<span>清算管理|Settlement</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -582,7 +615,8 @@ margin-bottom: 10%;"/>
<i class="fa fa fa-tv"></i> <span>清算月报</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('platformRevenue'|withModule) && (roleNow!='director') && roleNow !='compliance'">
<li ui-sref-active="active"
ng-if="('platformRevenue'|withModule) && (roleNow!='director') && roleNow !='compliance'">
<a ui-sref="analysis_report.platformsettle" ui-sref-opts="{reload:true}">
<i class="fa fa fa-money"></i> <span>清算验证|Validation</span>
</a>
@ -591,7 +625,8 @@ margin-bottom: 10%;"/>
</li>
<li class="menu-group" ng-if="roleNow=='accountant' || roleNow=='director'">
<p role="button" ng-class="{'active': Financial,'is-hide':hideSideBar}" ng-click="Financial = !Financial">
<p role="button" ng-class="{'active': Financial,'is-hide':hideSideBar}"
ng-click="Financial = !Financial">
<span>财务管理|Financial </span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -618,7 +653,8 @@ margin-bottom: 10%;"/>
<i class="fa fa-money"></i> <span>腾讯打款记录|Tencent Settlement</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('bdprize'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('bdprize'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<a ui-sref="analysis_bd.bd_prizes" ui-sref-opts="{reload:true}">
<i class="fa fa-usd"></i> <span>BD提成|BD Commissions</span>
</a>
@ -657,7 +693,8 @@ margin-bottom: 10%;"/>
</li>
<li class="menu-group" ng-if="roleNow=='sitemanager'">
<p role="button" ng-class="{'active': Promotion,'is-hide':hideSideBar}" ng-click="Promotion = !Promotion">
<p role="button" ng-class="{'active': Promotion,'is-hide':hideSideBar}"
ng-click="Promotion = !Promotion">
<span>营销活动管理|Promotion</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -759,11 +796,17 @@ margin-bottom: 10%;"/>
<i class="fa fa-file-text-o"></i> <span>积分商城|Integral Mall</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="aps_kyc" ui-sref-opts="{reload:true}">
<i class="fa fa-balance-scale"></i> <span>A+的KYC通知</span>
</a>
</li>
</ul>
</li>
<li class="menu-group" ng-if="roleNow=='administrator'">
<p role="button" ng-class="{'active': Organization,'is-hide':hideSideBar}" ng-click="Organization = !Organization">
<p role="button" ng-class="{'active': Organization,'is-hide':hideSideBar}"
ng-click="Organization = !Organization">
<span>组织架构|Organization</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -798,8 +841,10 @@ margin-bottom: 10%;"/>
</ul>
</li>
<li class="menu-group" ng-if="(roleNow=='bduser' || roleNow=='salesmanager' || roleNow=='director') && (currentUser.org_id==null || currentUser.org_id==1)">
<p role="button" ng-class="{'active': Performance,'is-hide':hideSideBar}" ng-click="Performance = !Performance">
<li class="menu-group"
ng-if="(roleNow=='bduser' || roleNow=='salesmanager' || roleNow=='director') && (currentUser.org_id==null || currentUser.org_id==1)">
<p role="button" ng-class="{'active': Performance,'is-hide':hideSideBar}"
ng-click="Performance = !Performance">
<span>绩效管理|Performance</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -811,12 +856,14 @@ margin-bottom: 10%;"/>
<i class="fa fa-hand-peace-o"></i> <span>BD销售量|BD Sale</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('bdprize'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('bdprize'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<a ui-sref="analysis_bd.bd_prizes" ui-sref-opts="{reload:true}">
<i class="fa fa-usd"></i> <span>BD提成|BD Commissions</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('bdprize'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<li ui-sref-active="active"
ng-if="('bdprize'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1)">
<a ui-sref="analysis_bd.bd_data_analysis" ui-sref-opts="{reload:true}">
<i class="fa fa-usd"></i> <span>BD团队分析|BD Team Analysis</span>
</a>
@ -850,7 +897,8 @@ margin-bottom: 10%;"/>
</li>
<li class="menu-group" ng-if="(roleNow=='salesmanager') || (roleNow=='director')">
<p role="button" ng-class="{'active': cityPartner,'is-hide':hideSideBar}" ng-click="cityPartner = !cityPartner">
<p role="button" ng-class="{'active': cityPartner,'is-hide':hideSideBar}"
ng-click="cityPartner = !cityPartner">
<span>合伙人管理|Partner</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -868,7 +916,8 @@ margin-bottom: 10%;"/>
<i class="fa fa-users"></i> <span>合伙人管理</span>
</a>
</li>
<li ui-sref-active="active" ng-if="('org_sale'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1 ||('10000000000000'|withRole))">
<li ui-sref-active="active"
ng-if="('org_sale'|withModule)&&(currentUser.org_id==null||currentUser.org_id==1 ||('10000000000000'|withRole))">
<a ui-sref="analysis_org.organlasis" ui-sref-opts="{reload:true}">
<i class="fa fa-hand-peace-o"></i> <span>合伙人销售量|City Partner Sale</span>
</a>
@ -887,7 +936,8 @@ margin-bottom: 10%;"/>
</li>
<li class="menu-group" ng-if="roleNow=='administrator'">
<p role="button" ng-class="{'active': Settings,'is-hide':hideSideBar}" ng-click="Settings = !Settings">
<p role="button" ng-class="{'active': Settings,'is-hide':hideSideBar}"
ng-click="Settings = !Settings">
<span>配置管理|Basic Settings</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -915,7 +965,8 @@ margin-bottom: 10%;"/>
</li>
<li class="menu-group" ng-if="roleNow=='developer'">
<p role="button" ng-class="{'active': Developer,'is-hide':hideSideBar}" ng-click="Developer = !Developer">
<p role="button" ng-class="{'active': Developer,'is-hide':hideSideBar}"
ng-click="Developer = !Developer">
<span>开发工具|Developer</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>
@ -946,7 +997,8 @@ margin-bottom: 10%;"/>
</li>
<li class="menu-group" ng-if="roleNow=='orgmanager'">
<p role="button" ng-class="{'active': OrgManager,'is-hide':hideSideBar}" ng-click="OrgManager = !OrgManager">
<p role="button" ng-class="{'active': OrgManager,'is-hide':hideSideBar}"
ng-click="OrgManager = !OrgManager">
<span>机构管理|OrgManager</span>
<span class="pull-right-container">
<i class="fa fa-angle-down pull-right"></i>

@ -0,0 +1,185 @@
/**
* Created by todking on 01/12/2021.
*/
define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
'use strict';
var app = angular.module('ApsKYC', ['ui.bootstrap', 'ui.router']);
app.config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('aps_kyc', {
url: '/aps_kyc',
templateUrl: '/static/apsKYC/templates/aps_kyc.html',
controller: 'ApsKYCCtrl'
});
}]);
app.controller('ApsKYCCtrl', ['$scope', '$http', '$uibModal', 'commonDialog', function ($scope, $http, $uibModal, commonDialog) {
var that = $scope
that.params = {};
that.noticeClients = {};
that.showClients = false
that.selectIndex = -1;
that.loadApsNotice = function (page) {
var params = angular.copy(that.params);
params.page = page || that.pagination.page || 1;
$http.get('/aps/kyc/notices', {params: params}).then(function (resp) {
that.apply = resp.data.data;
that.pagination = resp.data.pagination;
});
}
that.loadApsNotice(1);
that.stopNotice = function (id) {
commonDialog.confirm({
title: 'Confirm',
content: '你确定禁用该消息推送并且所有关联商户都不会继续推送?'
}).then(function () {
var item = {};
item.id = id;
item.status = 1;
$http.put('/aps/kyc/notice', item).then(function () {
that.loadApsNotice();
});
})
};
that.getNoticeClients = function (title, id, page, index) {
that.selectIndex = index
that.showClients = true
that.clientTitle = title
that.clientId = id;
if (that.showClients) {
that.loadApsNoticeClients(page);
}
};
that.loadApsNoticeClients = function (page) {
var params = angular.copy(that.params);
params.page = page || that.clientPagination.page || 1;
params.id = that.clientId;
$http.get('/aps/kyc/notice/clients', {params: params}).then(function (resp) {
that.noticeClients = resp.data.data;
that.clientPagination = resp.data.pagination;
});
};
that.addNotice = function () {
$uibModal
.open({
templateUrl: '/static/apsKYC/templates/add_aps_notice.html',
backdrop: false,
size: 'lg',
controller: 'addApsNoticeCtrl',
}).result.then(function () {
that.showClients = false
that.loadApsNotice(null)
});
};
that.catNotice = function (id) {
$scope.noticeDetail = {};
var params = angular.copy(that.params);
params.id = id;
$uibModal
.open({
templateUrl: '/static/apsKYC/templates/cat_aps_notice.html',
size: 'lg',
controller: ['$scope', '$http', function ($scope, $http) {
$http.get('/aps/kyc/notice', {params: params}).then(function (resp) {
$scope.noticeDetail = resp.data;
document.getElementById("input").innerHTML = resp.data.content
});
}],
});
};
that.updateNotice = function (id) {
var params = angular.copy(that.params);
params.id = id;
$uibModal
.open({
templateUrl: '/static/apsKYC/templates/add_aps_notice.html',
backdrop: false,
size: 'lg',
resolve: {
noticeId: function () {
return id;
}
},
controller: ['$scope', '$http', 'noticeId', function ($scope, $http, noticeId) {
$http.get('/aps/kyc/notice', {params: params}).then(function (resp) {
$scope.saveNoticeData = resp.data;
$scope.isUpdate = true;
});
$scope.saveNotice = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
var item = {};
item.id = noticeId;
item.title = $scope.saveNoticeData.title
item.content = $scope.saveNoticeData.content
$http.put('/aps/kyc/notice', item).then(function () {
alert("修改成功");
$scope.$close();
});
};
}],
});
};
that.setHandle = function (noticeId, id) {
commonDialog.confirm({
title: 'Confirm',
content: '你确定已帮商户开通A+支付?'
}).then(function () {
that.item = {};
that.item.id = id;
that.item.handle = 1;
$http.put('/aps/kyc/notice/client', that.item).then(function () {
that.loadApsNoticeClients()
that.loadApsNotice()
});
})
};
that.stopNoticeClient = function (noticeId, id) {
commonDialog.confirm({
title: 'Confirm',
content: '你确定不再通知商户该消息?'
}).then(function () {
that.item = {};
that.item.id = id;
that.item.isValid = 1;
$http.put('/aps/kyc/notice/client', that.item).then(function () {
that.loadApsNoticeClients()
that.loadApsNotice()
});
})
}
}]);
app.controller('addApsNoticeCtrl', ['$scope', '$http', function ($scope, $http) {
var that = $scope
$scope.isUpdate = false;
that.saveNoticeData = {}
that.saveNotice = function (form) {
if (form.$invalid) {
angular.forEach(form, function (item, key) {
if (key.indexOf('$') < 0) {
item.$dirty = true;
}
});
return;
}
let split = that.saveNoticeData.partnerCodes.split(``);
if (split.length >= 2) {
alert("商户编码格式存在问题");
return;
}
let codes = that.saveNoticeData.partnerCodes.split(",");
let newClients = [...new Set(codes)]
that.saveNoticeData.partnerCodes = newClients;
$http.post('/aps/kyc/notice', that.saveNoticeData).then(function () {
alert("新增成功");
that.$close();
});
};
}])
return app;
});

@ -0,0 +1,108 @@
<section class="content-header">
<h1>新增A+KYC通知</h1>
</section>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<form novalidate name="addNoticeFrom">
<div class="form-group"
ng-class="{'has-error':addNoticeFrom.partner_code.$invalid && addNoticeFrom.partner_code.$dirty}">
<label class="control-label col-sm-2" for="partner_code_input">* 商户编码</label>
<div class="col-xs-10">
<textarea
id="partner_code_input"
rows="5"
style="width: 100%;resize:none;"
required
ng-readonly="isUpdate"
ng-disabled="isUpdate"
name="partner_code"
placeholder="请输入商户编码(逗号隔开)"
ng-model="saveNoticeData.partnerCodes">
</textarea>
<div ng-messages="addNoticeFrom.partner_code.$error"
ng-if="addNoticeFrom.partner_code.$dirty">
<p class="small text-danger"
ng-message="required">required field
</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':addNoticeFrom.title.$invalid && addNoticeFrom.title.$dirty}">
<label class="control-label col-sm-2" for="title_input">* 通知标题</label>
<div class="col-xs-10">
<input type="text"
id="title_input"
required
style="width: 100%"
name="title"
placeholder="请输入通知标题"
ng-model="saveNoticeData.title">
<div ng-messages="addNoticeFrom.title.$error"
ng-if="addNoticeFrom.title.$dirty">
<p class="small text-danger"
ng-message="required">required field
</p>
</div>
</div>
</div>
<div class="form-group"
ng-class="{'has-error':addNoticeFrom.content.$invalid && addNoticeFrom.content.$dirty}">
<label class="control-label col-sm-2" for="content_input">* 通知内容</label>
<div class="col-xs-10">
<ueditor id="content_input" name="content" required ng-model="saveNoticeData.content"
ue-height="400"></ueditor>
<div ng-messages="addNoticeFrom.content.$error"
ng-if="addNoticeFrom.content.$dirty">
<p class="small text-danger"
ng-message="required">required field
</p>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="margin-bottom margin-top" style="text-align: right">
<a role="button"
style="margin-left: 10px;"
ng-click="$dismiss()"
class="btn btn-danger">cancel
</a>
<button class="btn btn-success"
type="button"
id="save-risk-btn"
ng-click="saveNotice(addNoticeFrom)">Save
</button>
</div>
</div>
<style type="text/css">
.edui-default .edui-editor {
border: 1px solid #d4d4d4;
background-color: white;
position: relative;
overflow: visible;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
width: 100% !important;
}
.edui-default .edui-editor-iframeholder {
width: 100% !important;
position: relative;
}
</style>

@ -0,0 +1,157 @@
<section class="content-header">
<h1>A+KYC通知</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-sitemap"></i> Compliance Management
</li>
<li class="active">A+KYC通知</li>
</ol>
</section>
<div class="box box-warning" style="margin-top: 30px;">
<div class="box-header">
<div class="row">
<div class="col-sm-12">
<div class="form-horizontal">
<button class="btn btn-success" style="float: right" type="button" ng-click="addNotice()">
<i class="fa fa-plus"></i> 新增
</button>
</div>
<br/><br/>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>通知时间</th>
<th>通知标题</th>
<th>通知商户数</th>
<th>未读数</th>
<th>同意数</th>
<th>合规处理数</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(index,item) in apply" ng-click="getNoticeClients(item.title,item.id,1,index)">
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}">{{ item.createTime }}
</td>
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}">{{ item.title }}</td>
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}">
<a href="" type="button">
{{ item.clientsNum }}
</a>
</td>
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}">{{ item.noRead }}</td>
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}">{{ item.agree }}</td>
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}">{{ item.handleNum }}
</td>
<td ng-style="{'background-color':selectIndex==index?'#f06101 ':''}"
style="text-align: center">
<a href="" type="button">
<i ng-if="item.status == 0" class="fa fa-times" style="color: red"
ng-click="stopNotice(item.id)">&nbsp;禁用</i>
<i ng-if="item.status == 1" readonly class="fa fa-times"
style="color: #727272">&nbsp;已禁用</i>
</a>
<span>&nbsp;|&nbsp; </span>
<a href="" type="button">
<i class="fa fa-file-text-o" ng-click="updateNotice(item.id)">&nbsp;编辑</i>
</a>
<span>&nbsp;|&nbsp; </span>
<a href="" type="button">
<i class="fa fa-eye" ng-click="catNotice(item.id)">&nbsp;预览</i>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<uib-pagination ng-if="apply.length"
class="pagination"
total-items="pagination.totalCount"
boundary-links="true"
ng-model="pagination.page"
items-per-page="pagination.limit"
max-size="10"
ng-change="loadApsNotice()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}
</div>
</div>
</div>
</div>
</div>
<div class="box box-danger" ng-if="showClients">
<div class="modal-body">
<h3>{{clientTitle}}—商户列表</h3>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>商户名称</th>
<th style="text-align: center">商户操作状态</th>
<th style="text-align: center">运营操作状态</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in noticeClients">
<td>{{item.partner_code}}</td>
<td style="text-align: center">
<span ng-if="item.status == 0" style="color: black">未读</span>
<span ng-if="item.status == 1" style="color: #c09d03">已读({{item.user_name}} {{ item.read_time
}})</span>
<span ng-if="item.status == 2" style="color: #00a65a">同意({{item.user_name}} {{ item.status_time
}})</span>
<span ng-if="item.status == 3" style="color: red">拒绝({{item.user_name}} {{ item.status_time
}})</span>
</td>
<td style="text-align: center">
<a href="" type="button"><span ng-if="item.handle == 0">未处理</span></a>
<span ng-if="item.handle == 1"
style="color: #00a65a">已处理({{ item.modifier_name }} {{ item.modify_time }})</span>
</td>
<td style="text-align: center">
<a href="" type="button" ng-if="item.is_valid == 0">
<i class="fa fa-times" style="color: red"
ng-click="stopNoticeClient(item.notice_id,item.id)">禁用</i>
<span ng-if="item.status == 2">&nbsp;|&nbsp; </span>
<i class="fa fa-check"
aria-hidden="true"
ng-if="item.status == 2"
ng-click="setHandle(item.notice_id,item.id)">处理</i>
</a>
<i ng-if="item.is_valid == 1" readonly class="fa fa-times"
style="color: #727272">已禁用</i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<uib-pagination ng-if="noticeClients.length"
class="pagination"
total-items="clientPagination.totalCount"
boundary-links="true"
ng-model="clientPagination.page"
items-per-page="clientPagination.limit"
max-size="10"
ng-change="loadApsNoticeClients()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="col-xs-12">Total Records:{{clientPagination.totalCount}};Total Pages:{{clientPagination.totalPages}}
</div>
</div>
</div>

@ -0,0 +1,40 @@
<div class="modal-header bg-green" style="text-align: center">
<h4>{{ noticeDetail.title }}</h4>
<span>({{ noticeDetail.createTime }})</span>
</div>
<div class="modal-body" style="padding: 20px">
<div class="row">
<div class="col-xs-12">
<div class="form-horizontal">
<div class="form-group">
<div class="col-xs-12">
<div id="input"></div>
</div>
</div>
</div>
</div>
</div>
<br/>
<br/>
<div>
<hr>
<div>已通知商户:</div>
<textarea
readonly
disabled
rows="3"
style="width: 100%;resize:none;"
ng-model="noticeDetail.partnerCodes"></textarea>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-danger" type="button" ng-click="$dismiss()">关闭</button>
</div>

@ -15,7 +15,6 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
}]);
app.controller('indexCtrl', ['$scope', '$rootScope', '$http', '$log', '$timeout', '$interval', '$q', '$uibModal', 'commonDialog', 'myLoginLogView',
function ($scope, $rootScope, $http, $log, $timeout, $interval, $q, $uibModal, commonDialog, myLoginLogView) {
var stompClient = null;
var newPartnerGuide_counts = 0;
var pwdcount = 0;
@ -44,15 +43,40 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
})
pwdcount++;
}
$http.get("/client/partner_info/PINE/aps_kyc").then(function (resp) {
if (resp.data != null && resp.data != "") {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/aps_kyc.html',
size: 'lg',
backdrop: false,
controller: ['$http', '$scope', function ($http, $scope) {
$http.get("/client/partner_info/PINE/aps_kyc").then(function (resp) {
$scope.item = resp.data
document.getElementById("aps_kyc_info").innerHTML = resp.data.content
});
$scope.updateApsKyc = function (status) {
var item = {};
item.id = $scope.item.id;
item.status = status;
$http.put("/client/partner_info/aps_kyc", item).then(function () {
$scope.$close();
});
}
}],
})
}
})
$scope.ComplianceToperfect = function () {
$uibModal.open({
templateUrl: '/static/payment/partner/templates/compliance_files_advice.html',
size: 'lg',
controller: 'partnerFilesCtrl',
resolve: {
file: ['$http', function ($http) {
return $http.get('/client/partner_info/compliance/clientViewFiles');
}],
file: ['$http', function ($http) {
return $http.get('/client/partner_info/compliance/clientViewFiles');
}],
kycFile: ['$http', function ($http) {
return $http.get('/client/partner_info/kyc/clientViewFiles');
}]
@ -61,7 +85,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
})
};
if(($scope.currentUser.lessComplianceFiles ||$scope.currentUser.lessKycFiles) && complianceNoticeCount==0 && $scope.currentUser.role!=3) {
if (($scope.currentUser.lessComplianceFiles || $scope.currentUser.lessKycFiles) && complianceNoticeCount == 0 && $scope.currentUser.role != 3) {
$scope.ComplianceToperfect();
complianceNoticeCount++;
}
@ -478,7 +502,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
})
}
}]);
app.controller('partnerFilesCtrl', ['$scope', '$http', '$sce', 'file', 'kycFile', function ($scope, $http, $sce, file , kycFile) {
app.controller('partnerFilesCtrl', ['$scope', '$http', '$sce', 'file', 'kycFile', function ($scope, $http, $sce, file, kycFile) {
$scope.file = angular.copy(file.data);
$scope.kycFile = angular.copy(kycFile.data);
var lang = navigator.language || navigator.userLanguage; //常规浏览器语言和IE浏览器
@ -556,13 +580,13 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
return function (gateway) {
switch (gateway + '') {
case '0':
return 'Retail In-Store';
return 'POS';
case '1':
return 'Retail In-Store';
return 'POS';
case '2':
return 'QR Code';
return 'M QR';
case '3':
return 'Online API';
return 'WEB QR';
case '4':
return 'In-APP H5';
case '5':
@ -574,7 +598,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
case '8':
return 'Mobile H5';
case '9':
return 'Third-Party Gateway';
return 'Cashier';
case '10':
return 'APP';
case '11':
@ -582,7 +606,7 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
case '12':
return 'MICROAPP';
case '13':
return 'Native QR Code';
return 'Native QR';
case '14':
return 'Share Link'
case '16':

@ -178,6 +178,7 @@ define(['angular', '../../analysis/org/analysis-org'], function (angular) {
$scope.commissionTypeMap = commissionTypeMap
$scope.seniors = {}
$scope.isAlipayPlus = false
$scope.isAps = false
$scope.active = function (log) {
$http.get('/sys/citypartner_prizes/senior/' + log.org_id + '/details?monthStr=' + $scope.monthData.monthstr).then(function (resp) {
$scope.seniors = resp.data
@ -189,6 +190,10 @@ define(['angular', '../../analysis/org/analysis-org'], function (angular) {
})
$scope.isAlipayPlus = false
}
$scope.activeAps = function (apsInfo){
$scope.ctrl.apsInfo = apsInfo
$scope.isAps = true
}
$scope.activeAlipayPlus= function (detail){
$scope.isAlipayPlus = !$scope.isAlipayPlus
if($scope.isAlipayPlus){

@ -122,11 +122,16 @@
<td ng-bind="detail.org_charge"></td>
<td ng-bind="detail.share_charge"></td>
<td>
{{detail.channel}}
<span ng-if="detail.channel == 'ApsInStore'">A+(Retail)</span>
<span ng-if="detail.channel == 'ApsCashier'">A+(Online)</span>
<span ng-if="detail.channel != 'ApsCashier'&& detail.channel != 'ApsInStore'">{{detail.channel}}</span>
<a role="button" ng-if="detail.channel == 'alipayPlus'"
ng-click="activeAlipayPlus(detail)">
<i class="fa fa-list-ul"></i>
</a>
<a role="button" ng-if="detail.sunAps" ng-click="activeAps(detail.sunAps)">
<i class="fa fa-list-ul"></i>
</a>
</td>
</tr>
</tbody>
@ -198,6 +203,47 @@
</tr>
</tbody>
</table>
<table ng-if="isAps"
class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Keep Rate</th>
<th>Transaction Amount</th>
<th>Total Charge</th>
<th>RoyalPay Charge</th>
<th>Net Charge</th>
<th>City Partner Charge</th>
<th>Share Charge</th>
<th>channel</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="aps in ctrl.apsInfo">
<td ng-bind="aps.org_rate"></td>
<td ng-bind="aps.gross_amount"></td>
<td ng-bind="aps.total_charge"></td>
<td ng-bind="aps.royalpay_charge"></td>
<td ng-bind="aps.net_charge"></td>
<td ng-bind="aps.org_charge"></td>
<td ng-bind="aps.share_charge"></td>
<td ng-if="aps.pay_type == 'alipayCN'">AlipayCN
<!-- <a ng-if="!aps.parent_org_id" role="button"-->
<!-- ng-href="/sys/citypartners/client/extract/{{aps.org_id}}/excel?year={{aps.year}}&month={{aps.month}}&channel={{aps.channel}}"-->
<!-- target="_blank" title="Download Transactions">-->
<!-- <i class="fa fa-download"></i>-->
<!-- </a>-->
<!-- <a ng-if="aps.parent_org_id" role="button"-->
<!-- ng-href="/sys/citypartners/client/extract/{{aps.org_id}}/agent/excel?year={{aps.year}}&month={{aps.month}}&channel={{aps.channel}}"-->
<!-- target="_blank" title="Download Transactions">-->
<!-- <i class="fa fa-download"></i>-->
<!-- </a>-->
</td>
<td ng-if="aps.pay_type == 'alipayOS'">Other wallets</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -796,6 +796,16 @@
</div>
</a>
</div>
<div class="col-sm-2 col-xs-6">
<a ui-sref="aps_kyc" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/aps_kyc.png"/>
<div class="description-text">
<span>A+的KYC通知</span>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="list-group" ng-if="role=='accountant' || role=='director'">

@ -2487,14 +2487,25 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
// $scope.init.channel[channel] = true
// return
// }
if ($scope.paymentInfo.alipay_cn_switch) {
commonDialog.alert({
title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay+(APS) channel",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
return;
if($scope.paymentInfo.aps_config_id){
if(channel == 'alipay' && !$scope.paymentInfo.alipay_cn_switch){
commonDialog.alert({
title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay channel",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
return;
}
if (channel == 'alipayaps' && $scope.paymentInfo.alipay_cn_switch) {
commonDialog.alert({
title: 'ERROR',
content: "Please switch AlipayCN to Alipay channel, and then close Alipay+(APS) channel",
type: 'error',
})
$scope.loadPartnerPaymentInfo()
return;
}
}
$scope.getComplianceInfo()
if ($scope.paymentInfo['enable_wechat'] && channel == 'wechat' && $scope.paymentInfo.open_status == 5 && info.length > 0) {
@ -7397,9 +7408,7 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.subMerchantInfo.website = $scope.subMerchantInfo.company_website;
$scope.subMerchantInfo.legalName = $scope.subMerchantInfo.company_name;
$scope.subMerchantInfo.registrationType = 'ENTERPRISE_REGISTRATION_NO'
if ($scope.subMerchantInfo.business_structure) {
$scope.subMerchantInfo.businessType = $scope.subMerchantInfo.business_structure == 'Company' ? 'ENTERPRISE' : 'INDIVIDUAL'
}
$scope.subMerchantInfo.shareholderName = $scope.subMerchantInfo.representativeInfo ? $scope.subMerchantInfo.representativeInfo.representative_person : "";
$scope.subMerchantInfo.shareholderId = $scope.subMerchantInfo.representativeInfo ? $scope.subMerchantInfo.representativeInfo.legal_representative_id : "";
$scope.subMerchantInfo.representativeName = $scope.subMerchantInfo.representativeInfo ? $scope.subMerchantInfo.representativeInfo.representative_person : "";
@ -7408,6 +7417,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.subMerchantInfo.registrationNo = $scope.subMerchantInfo.acn ? $scope.subMerchantInfo.acn : $scope.subMerchantInfo.abn;
$scope.subMerchantInfo.storeMCC = $scope.subMerchantInfo.alipayindustry;
$scope.subMerchantInfo.storeName = $scope.subMerchantInfo.store_name;
if($scope.subMerchantInfo.registrationNo){
$scope.subMerchantInfo.businessType='ENTERPRISE';
}else{
$scope.subMerchantInfo.businessType='INDIVIDUAL';
}
$scope.alipayMccCategory = {}
$scope.loadAlipayCategory = function () {

@ -0,0 +1,32 @@
<div class="modal-header bg-green">
<div></div>
<h4 style="text-align: center">{{ item.title }}</h4>
</div>
<div class="modal-body" style="padding: 20px">
<div class="row">
<div class="col-xs-12">
<div class="form-horizontal">
<div class="form-group">
<div class="col-xs-12">
<div id="aps_kyc_info"></div>
</div>
</div>
</div>
</div>
</div>
<br/>
<br/>
</div>
<div class="modal-footer">
<div style="display: flex;justify-content: space-between">
<div>
<button style="text-align: right" class="btn btn-warning" ng-click="updateApsKyc(1)" type="button">关闭
</button>
</div>
<div>
<button class="btn btn-danger" ng-click="updateApsKyc(3)" type="button">拒绝</button>
<button class="btn btn-success" ng-click="updateApsKyc(2)" type="button">同意</button>
</div>
</div>
</div>

@ -376,10 +376,7 @@
</tbody>
</table>
</div>
<div style="text-align: center">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope"
ng-if="('10'|withRole)" ng-click="complianceCheck()">check</a>
</div>
</div>
</div>
</div>
@ -483,6 +480,7 @@
<th>Service Fee</th>
<th>Active Time</th>
<th>Expire Time</th>
<th>Clean Days</th>
<th>Update Time</th>
<th>Operator</th>
<th>Remark</th>
@ -497,6 +495,7 @@
<td ng-bind="rate.transaction_fee + ' %'"></td>
<td ng-bind="rate.active_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.expiry_time|date:'yyyy-MM-dd'"></td>
<td>T+{{rate.clean_days}}</td>
<td ng-bind="rate.update_time|date:'yyyy-MM-dd'"></td>
<td ng-bind="rate.operator_name||'系统生成'"></td>
<td ng-bind="rate.remark|limitTo:20" title="{{rate.remark}}"></td>
@ -511,4 +510,9 @@
</div>
</div>
</div>
<div style="text-align: center">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope"
ng-if="('10'|withRole)" ng-click="complianceCheck()">check</a>
</div>
</div>

@ -84,19 +84,19 @@
<a role="button" ng-class="{'bg-primary':params.gateway==null}"
ng-click="params.gateway=null;loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([0,1])}"
ng-click="params.gateway=[0,1];initGatewayChild()">Retail In-Store</a> |
ng-click="params.gateway=[0,1];initGatewayChild()">POS</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([5,6])}"
ng-click="params.gateway=[5,6];initGatewayChild()">Retail API</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([2,7])}"
ng-click="params.gateway=[2,7];loadTradeLogs(1)">QR Code</a> |
ng-click="params.gateway=[2,7];loadTradeLogs(1)">M QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([3])}"
ng-click="params.gateway=[3];loadTradeLogs(1)">Online API</a> |
ng-click="params.gateway=[3];loadTradeLogs(1)">WEB QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([4])}"
ng-click="params.gateway=[4];loadTradeLogs(1)">In-APP H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([8])}"
ng-click="params.gateway=[8];loadTradeLogs(1)">Mobile H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([9])}"
ng-click="params.gateway=[9];loadTradeLogs(1)">Third Party Gateway</a> |
ng-click="params.gateway=[9];loadTradeLogs(1)">Cashier</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([10])}"
ng-click="params.gateway=[10];loadTradeLogs(1)">APP</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([11])}"
@ -104,7 +104,7 @@
<a role="button" ng-class="{'bg-primary':gatewaySelected([12])}"
ng-click="params.gateway=[12];loadTradeLogs(1)">MiniProgram</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([13])}"
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR Code</a> |
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([14])}"
ng-click="params.gateway=[14];loadTradeLogs(1)">Share Link</a>
</p>

@ -549,7 +549,7 @@
</div>
<!--AlipayCN支付渠道切换-->
<div class="panel panel-default" ng-if="(('111'|withRole))">
<div class="panel panel-default" ng-if="(('111'|withRole)) && paymentInfo.aps_config_id">
<div class="panel-heading">AlipayCN Channel Configuration</div>
<div class="panel-body">
<div class="form-horizontal">

@ -239,21 +239,19 @@
<a role="button" ng-class="{'bg-primary':params.gateway==null}"
ng-click="params.gateway=null;loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([0,1])}"
ng-click="params.gateway=[0,1];initGatewayChild()">Retail
In-Store</a> |
ng-click="params.gateway=[0,1];initGatewayChild()">POS</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([5,6])}"
ng-click="params.gateway=[5,6];initGatewayChild()">Retail API</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([2,7])}"
ng-click="params.gateway=[2,7];loadTradeLogs(1)">QR Code</a> |
ng-click="params.gateway=[2,7];loadTradeLogs(1)">M QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([3])}"
ng-click="params.gateway=[3];loadTradeLogs(1)">Online API</a> |
ng-click="params.gateway=[3];loadTradeLogs(1)">WEB QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([4])}"
ng-click="params.gateway=[4];loadTradeLogs(1)">In-APP H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([8])}"
ng-click="params.gateway=[8];loadTradeLogs(1)">Mobile H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([9])}"
ng-click="params.gateway=[9];loadTradeLogs(1)">Third Party
Gateway</a> |
ng-click="params.gateway=[9];loadTradeLogs(1)">Cashier</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([10])}"
ng-click="params.gateway=[10];loadTradeLogs(1)">APP</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([11])}"
@ -261,7 +259,7 @@
<a role="button" ng-class="{'bg-primary':gatewaySelected([12])}"
ng-click="params.gateway=[12];loadTradeLogs(1)">MiniProgram</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([13])}"
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR Code</a> |
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([14])}"
ng-click="params.gateway=[14];loadTradeLogs(1)">Share Link</a>
</p>
@ -780,6 +778,12 @@
title="Refund">
<i class="fa fa-undo"></i>
</a>
<a role="button"
ng-if="trade.is_today&&(trade.channel=='ApsInStore'||trade.channel=='ApsCashier') && trade.status==5 && trade.confirm_time!=null && trade.clearing_status<2 && trade.client_id==currentUser.client_id && currentUser.client.enable_refund"
class="text-bold text-danger" ng-click="cancelOrder(trade.order_id)"
title="Cancel">
<i class="fa fa-close"></i>
</a>
</td>
</tr>
</tbody>

@ -214,23 +214,21 @@
<a role="button" ng-class="{'bg-primary':params.gateway==null}"
ng-click="params.gateway=null;loadTradeLogs(1)">All</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([0,1])}"
ng-click="params.gateway=[0,1];initGatewayChild()">Retail
In-Store</a>
ng-click="params.gateway=[0,1];initGatewayChild()">POS</a>
|
<a role="button" ng-class="{'bg-primary':gatewaySelected([5,6])}"
ng-click="params.gateway=[5,6];loadTradeLogs(1);initGatewayChild()">Retail
API</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([2,7])}"
ng-click="params.gateway=[2,7];loadTradeLogs(1)">QR Code</a> |
ng-click="params.gateway=[2,7];loadTradeLogs(1)">M QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([3])}"
ng-click="params.gateway=[3];loadTradeLogs(1)">Online API</a> |
ng-click="params.gateway=[3];loadTradeLogs(1)">WEB QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([4])}"
ng-click="params.gateway=[4];loadTradeLogs(1)">In-APP H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([8])}"
ng-click="params.gateway=[8];loadTradeLogs(1)">Mobile H5</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([9])}"
ng-click="params.gateway=[9];loadTradeLogs(1)">Third Party
Gateway</a> |
ng-click="params.gateway=[9];loadTradeLogs(1)">Cashier</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([10])}"
ng-click="params.gateway=[10];loadTradeLogs(1)">APP</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([11])}"
@ -238,7 +236,7 @@
<a role="button" ng-class="{'bg-primary':gatewaySelected([12])}"
ng-click="params.gateway=[12];loadTradeLogs(1)">MiniProgram</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([13])}"
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR Code</a> |
ng-click="params.gateway=[13];loadTradeLogs(1)">Native QR</a> |
<a role="button" ng-class="{'bg-primary':gatewaySelected([14])}"
ng-click="params.gateway=[14];loadTradeLogs(1)">Share Link</a>
</p>

@ -110,6 +110,29 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
//取消订单
$scope.cancelOrder = function (orderId) {
commonDialog
.confirm({
title: 'Cancel order',
content: 'Are you sure you want to cancel this order?',
})
.then(function () {
$http.post('/client/partner_info/cancel_order',{orderId: orderId}).then(
function (resp) {
commonDialog.alert({
title: "Success",
content: "Cancel successfully",
type: "success",
})
$scope.loadTradeLogs()
},
function (resp) {
commonDialog.alert({ title: 'Error!', content: resp.data.message, type: 'error' })
}
)
})
}
/*$scope.htmlToolst = function(){
for(var i=0;i< $scope.tradeLogs.length;i++){
@ -445,6 +468,7 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.loadTradeLogs();
});
};
$scope.releasePreAuth = function (orderId) {
commonDialog.confirm({
title: 'Pre Authorization Completion',

Loading…
Cancel
Save