添加修改通知
This commit is contained in:
@@ -2,6 +2,7 @@ package cn.pluss.platform.task;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import cn.pluss.platform.BankCardService;
|
||||||
import cn.pluss.platform.MerchantAuditRecordService;
|
import cn.pluss.platform.MerchantAuditRecordService;
|
||||||
import cn.pluss.platform.entity.*;
|
import cn.pluss.platform.entity.*;
|
||||||
import cn.pluss.platform.exception.MsgException;
|
import cn.pluss.platform.exception.MsgException;
|
||||||
@@ -10,9 +11,11 @@ import cn.pluss.platform.klk.LakalaConfig;
|
|||||||
import cn.pluss.platform.klk.service.LklPayService;
|
import cn.pluss.platform.klk.service.LklPayService;
|
||||||
import cn.pluss.platform.klk.service.impl.LaKalaInterfaceImpl;
|
import cn.pluss.platform.klk.service.impl.LaKalaInterfaceImpl;
|
||||||
import cn.pluss.platform.mapper.*;
|
import cn.pluss.platform.mapper.*;
|
||||||
|
import cn.pluss.platform.merchant.AccountService;
|
||||||
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
import cn.pluss.platform.merchant.MerchantBaseInfoService;
|
||||||
import cn.pluss.platform.merchant.MerchantCashPlaceService;
|
import cn.pluss.platform.merchant.MerchantCashPlaceService;
|
||||||
import cn.pluss.platform.notice.NoticeService;
|
import cn.pluss.platform.notice.NoticeService;
|
||||||
|
import cn.pluss.platform.suixingfu.SxfConstants;
|
||||||
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
||||||
import cn.pluss.platform.userApp.UserAppService;
|
import cn.pluss.platform.userApp.UserAppService;
|
||||||
import cn.pluss.platform.util.IpUtils;
|
import cn.pluss.platform.util.IpUtils;
|
||||||
@@ -21,6 +24,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -95,6 +99,12 @@ public class LklMerAuditHandler {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserAppService uaService;
|
private UserAppService uaService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AccountService accountService;
|
||||||
|
|
||||||
|
@Setter(onMethod_ = {@Autowired})
|
||||||
|
private BankCardService bankCardService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MerchantChannelFeeMapper merchantChannelFeeMapper;
|
private MerchantChannelFeeMapper merchantChannelFeeMapper;
|
||||||
|
|
||||||
@@ -142,6 +152,77 @@ public class LklMerAuditHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void auditEditHandler(Map<String,Object> map){
|
||||||
|
log.info("拉卡拉修改通知接口返回解密数据:{}", JSONUtil.toJsonStr(map));
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(map) || !map.containsKey("reviewPass")) {
|
||||||
|
log.error("回调数据为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if("PASS".equals(map.get("reviewPass").toString())){
|
||||||
|
String applicationId=map.get("reviewRelatedId")+"";
|
||||||
|
|
||||||
|
MerchantAuditRecord auditRecord = new MerchantAuditRecord();
|
||||||
|
auditRecord.setChannel(5);
|
||||||
|
auditRecord.setApplicationId(applicationId);
|
||||||
|
auditRecord = merchantAuditRecordService.getOne(new QueryWrapper<>(auditRecord));
|
||||||
|
if (auditRecord == null) {
|
||||||
|
log.error("未查询到对应的工单信息");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auditRecord.setRemark("审核成功");
|
||||||
|
auditRecord.setThirdStatus("1");
|
||||||
|
UpdateWrapper<MerchantAuditRecord> wrapper = new UpdateWrapper<>();
|
||||||
|
wrapper.eq("applicationId", applicationId);
|
||||||
|
merchantAuditRecordService.update(auditRecord, wrapper);
|
||||||
|
|
||||||
|
|
||||||
|
MerchantChannelStatus channelStatus = new MerchantChannelStatus();
|
||||||
|
channelStatus.setStatus("3");
|
||||||
|
UpdateWrapper<MerchantChannelStatus> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("merchantCode", auditRecord.getMerchantCode())
|
||||||
|
.eq("channel", 5);
|
||||||
|
|
||||||
|
String merchantCode = auditRecord.getMerchantCode();
|
||||||
|
UserApp userApp = new UserApp().setMerchantCode(merchantCode).setUserType("promoter");
|
||||||
|
userApp = userAppMapper.selectOne(new QueryWrapper<>(userApp));
|
||||||
|
|
||||||
|
Account account = new Account().setUserId(userApp.getUserId() + "");
|
||||||
|
account = accountService.getOne(new QueryWrapper<>(account));
|
||||||
|
|
||||||
|
// 修改后的银行卡信息
|
||||||
|
JSONObject bak = account.getBak();
|
||||||
|
BankCard newBankCard = JSONObject.toJavaObject(bak, BankCard.class);
|
||||||
|
newBankCard.setAccountType(BankCard.ACCOUNT_TYPE_PRIVATE);
|
||||||
|
account.setBak(null);
|
||||||
|
int count = accountService.count(new QueryWrapper<Account>().eq("bankCardId", account.getBankCardId()));
|
||||||
|
if (count == 1) {
|
||||||
|
newBankCard.setId(Integer.parseInt(account.getBankCardId()));
|
||||||
|
bankCardService.updateById(newBankCard);
|
||||||
|
} else {
|
||||||
|
bankCardService.save(newBankCard);
|
||||||
|
account.setBankCardId(newBankCard.getId() + "");
|
||||||
|
accountService.updateById(account);
|
||||||
|
}
|
||||||
|
// 商户修改通过后,修改为最新的业务id
|
||||||
|
channelStatus.setApplicationId(applicationId);
|
||||||
|
|
||||||
|
mcsMapper.update(channelStatus, updateWrapper);
|
||||||
|
|
||||||
|
MerchantBaseInfo mbi = merchantBaseInfoService.getMerchantBaseInfoByMerchantCode(merchantCode);
|
||||||
|
|
||||||
|
noticeService.sendEditApplySuccessNotice(userApp.getUserId() + "", mbi.getAlias(), "次日到账");
|
||||||
|
|
||||||
|
sendNotice(userApp, "结算账户修改通知", "结算账户修改成功", applicationId + "_" + System.currentTimeMillis());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public MerchantChannelStatus queryMerchatChannelstatus(String customerNo, String externalCustomerNo) {
|
public MerchantChannelStatus queryMerchatChannelstatus(String customerNo, String externalCustomerNo) {
|
||||||
Map map = laKalaInterface.queryMerchat(customerNo, externalCustomerNo);
|
Map map = laKalaInterface.queryMerchat(customerNo, externalCustomerNo);
|
||||||
if (ObjectUtil.isEmpty(map)) {
|
if (ObjectUtil.isEmpty(map)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user