添加pos 机退款接口

This commit is contained in:
韩鹏辉
2023-06-14 17:54:49 +08:00
parent f864f69d03
commit 400bbe6e0f

View File

@@ -61,7 +61,6 @@ public class LklMerAuditHandler{
private MerchantBaseInfoService merchantBaseInfoService; private MerchantBaseInfoService merchantBaseInfoService;
@Setter(onMethod_ = {@Autowired, @Lazy}) @Setter(onMethod_ = {@Autowired, @Lazy})
private MerchantCashPlaceService cashPlaceService; private MerchantCashPlaceService cashPlaceService;
@@ -70,7 +69,6 @@ public class LklMerAuditHandler{
private MerchantAuditRecordService merchantAuditRecordService; private MerchantAuditRecordService merchantAuditRecordService;
private final UserAppMapper userAppMapper; private final UserAppMapper userAppMapper;
private final UserInfoMapper userInfoMapper; private final UserInfoMapper userInfoMapper;
private final MerchantStoreMapper merchantStoreMapper; private final MerchantStoreMapper merchantStoreMapper;
@@ -100,7 +98,6 @@ public class LklMerAuditHandler{
private MerchantChannelFeeMapper merchantChannelFeeMapper; private MerchantChannelFeeMapper merchantChannelFeeMapper;
public void auditHandler(Map<String, Object> map) { public void auditHandler(Map<String, Object> map) {
execute(map); execute(map);
} }
@@ -114,14 +111,16 @@ public class LklMerAuditHandler{
return; return;
} }
if("SUCCESS".equals(map.get("status").toString())||"REVIEW_PASS".equals(map.get("status").toString())){
MerchantChannelStatus mcs = self.auditCallback(map); MerchantChannelStatus mcs = self.auditCallback(map);
if (ObjectUtil.isNotEmpty(mcs)) {
try { try {
log.info("===================>进件回调,创建店铺开始,商户编号mno为:{}<=====================", map.get("customerNo").toString()); log.info("===================>进件回调,创建店铺开始,商户编号mno为:{}<=====================", map.get("customerNo").toString());
self.createStore(mcs); self.createStore(mcs);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.info("创建店铺信息异常,异常信息:{}", e.getMessage()); log.info("创建店铺信息异常,异常信息:{}", e.getMessage());
@@ -137,13 +136,10 @@ public class LklMerAuditHandler{
} }
} }
} }
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)) {
@@ -172,7 +168,6 @@ public class LklMerAuditHandler{
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public MerchantChannelStatus auditCallback(Map<String, Object> map) { public MerchantChannelStatus auditCallback(Map<String, Object> map) {
MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus() MerchantChannelStatus merchantChannelStatus = new MerchantChannelStatus()
@@ -185,6 +180,7 @@ public class LklMerAuditHandler{
return merchantChannelStatus; return merchantChannelStatus;
} }
if ("SUCCESS".equals(map.get("status").toString()) || "REVIEW_PASS".equals(map.get("status").toString())) {
merchantChannelStatus.setApplicationId(map.get("contractId").toString()); merchantChannelStatus.setApplicationId(map.get("contractId").toString());
merchantChannelStatus.setStatus("3"); merchantChannelStatus.setStatus("3");
merchantChannelStatus.setExtra(JSONObject.parseObject("{\n" + merchantChannelStatus.setExtra(JSONObject.parseObject("{\n" +
@@ -220,8 +216,6 @@ public class LklMerAuditHandler{
} }
MerchantAuditRecord lastRecord = merchantAuditRecordService.getLastRecord(merchantChannelStatus.getMerchantCode()); MerchantAuditRecord lastRecord = merchantAuditRecordService.getLastRecord(merchantChannelStatus.getMerchantCode());
if (lastRecord != null) { if (lastRecord != null) {
lastRecord.setStatus(merchantChannelStatus.getStatus()); lastRecord.setStatus(merchantChannelStatus.getStatus());
@@ -243,9 +237,32 @@ public class LklMerAuditHandler{
sendNotice(userApp, "收银呗审核通知", "拉卡拉进件成功", merchantChannelStatus.getApplicationId()); sendNotice(userApp, "收银呗审核通知", "拉卡拉进件成功", merchantChannelStatus.getApplicationId());
} }
return merchantChannelStatus; return merchantChannelStatus;
} else {
merchantChannelStatus.setApplicationId(map.get("contractId").toString());
merchantChannelStatus.setStatus("2");
merchantChannelStatus.setExtra(JSONObject.parseObject("{\n" +
"\t\"code\": \"" + map.get("status") + "\",\n" +
"\t\"msg\": \"" + map.get("remark") + "\"\n" +
"}"));
merchantChannelStatus.setRemark("成功");
merchantChannelStatus.setUpdateTime(new Date());
MerchantAuditRecord lastRecord = merchantAuditRecordService.getLastRecord(merchantChannelStatus.getMerchantCode());
if (lastRecord != null) {
lastRecord.setStatus("2");
lastRecord.setThirdStatus("1");
lastRecord.setRemark(map.get("remark") + "");
merchantAuditRecordService.updateById(lastRecord);
mcsMapper.updateById(merchantChannelStatus);
} }
return null;
}
}
public void createStore(MerchantChannelStatus merchantChannelStatus) { public void createStore(MerchantChannelStatus merchantChannelStatus) {
@@ -295,7 +312,6 @@ public class LklMerAuditHandler{
} }
public void sendNotice(UserApp userApp, String title, String msg, String uniqueKey) { public void sendNotice(UserApp userApp, String title, String msg, String uniqueKey) {
Notice notice = new Notice(1, 1, userApp); Notice notice = new Notice(1, 1, userApp);
notice.setNoticeCode(uniqueKey); notice.setNoticeCode(uniqueKey);