提交代码

yy_dev
胡锐 1 year ago
parent 376a2eca67
commit e14632a65c
  1. 49
      cweb/src/main/java/com/cweb/controller/BsMerController.java
  2. 16
      cweb/src/main/java/com/cweb/controller/TestController.java
  3. 113
      service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
  4. 6
      service/src/main/java/com/hfkj/service/BsMerContractService.java
  5. 7
      service/src/main/java/com/hfkj/service/BsMerService.java
  6. 21
      service/src/main/java/com/hfkj/service/impl/BsMerContractServiceImpl.java
  7. 26
      service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java

@ -362,44 +362,28 @@ public class BsMerController {
} }
// 对私非法人结算 // 对私非法人结算
if (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber()) && if (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber())) {
(StringUtils.isBlank(merSettleAcct.getSettleIdCardPortraitImg()) if (StringUtils.isBlank(merSettleAcct.getSettleIdCardPortraitImg())
// || StringUtils.isBlank(merSettleAcct.getCommissionImg()) || StringUtils.isBlank(merSettleAcct.getCommissionImg())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardNationalEmblemImg()) || StringUtils.isBlank(merSettleAcct.getSettleIdCardNationalEmblemImg())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardName()) || StringUtils.isBlank(merSettleAcct.getSettleIdCardName())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardNo()) || StringUtils.isBlank(merSettleAcct.getSettleIdCardNo())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardPeriodStart()) || StringUtils.isBlank(merSettleAcct.getSettleIdCardPeriodStart())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardPeriodEnd()) || StringUtils.isBlank(merSettleAcct.getSettleIdCardPeriodEnd())
|| merSettleAcct.getSettleIdPeriodType() == null)) { || merSettleAcct.getSettleIdPeriodType() == null) {
log.error("configMerBasis error!","参数错误"); log.error("configMerBasis error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要结算人身份证信息"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要填写结算人身份证信息");
}
} else { } else {
// 对公结算、对私法人结算 // 对公结算、对私法人结算
merSettleAcct.setSettleIdCardName(bsMer.getLarName()); merSettleAcct.setSettleIdCardName(bsMer.getLarName());
merSettleAcct.setSettleIdCardNo(bsMer.getLarIdCard()); merSettleAcct.setSettleIdCardNo(bsMer.getLarIdCard());
merSettleAcct.setSettleIdCardPortraitImg(bsMer.getLarIdCardPortraitImg()); merSettleAcct.setSettleIdCardPortraitImg(bsMer.getLarIdCardPortraitImg());
merSettleAcct.setSettleIdCardNationalEmblemImg(bsMer.getLarIdCardNationalEmblemImg()); merSettleAcct.setSettleIdCardNationalEmblemImg(bsMer.getLarIdCardNationalEmblemImg());
merSettleAcct.setSettleIdPeriodType(bsMer.getBlisPeriodType()); merSettleAcct.setSettleIdPeriodType(bsMer.getLarIdCardPeriodType());
merSettleAcct.setSettleIdCardPeriodStart(bsMer.getLarIdCardPeriodStart()); merSettleAcct.setSettleIdCardPeriodStart(bsMer.getLarIdCardPeriodStart());
merSettleAcct.setSettleIdCardPeriodEnd(bsMer.getLarIdCardPeriodEnd()); merSettleAcct.setSettleIdCardPeriodEnd(bsMer.getLarIdCardPeriodEnd());
} }
/*
// 查询开户行
JSONObject cardBin = LaKaLaConfig.queryCardBin(merSettleAcct.getBankCardNo());
if (cardBin == null) {
log.error("configMerBasis error!","未找到银行卡bin信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到银行卡bin信息");
}
if (StringUtils.isBlank(cardBin.getString("bankCode"))
|| StringUtils.isBlank(cardBin.getString("clearingBankCode"))) {
log.error("configMerBasis error!","未找到银行卡bin信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请填写正确银行卡卡号");
}
merSettleAcct.setOpenningBankName(cardBin.getString("bankName"));
merSettleAcct.setOpenningBankCode(cardBin.getString("bankCode"));
merSettleAcct.setClearingBankCode(cardBin.getString("clearingBankCode"));*/
merService.configMerSettlement(merSettleAcct); merService.configMerSettlement(merSettleAcct);
@ -525,6 +509,25 @@ public class BsMerController {
} }
} }
@RequestMapping(value="/reconsider",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "复议")
public ResponseData reconsider(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("merId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "");
}
merService.reconsider(body.getLong("merId"));
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getMerDetail",method = RequestMethod.GET) @RequestMapping(value="/getMerDetail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询商户详情") @ApiOperation(value = "查询商户详情")

@ -43,6 +43,7 @@ import io.swagger.annotations.ApiOperation;
import net.coobird.thumbnailator.Thumbnails; import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -250,7 +251,8 @@ public class TestController {
//laKaLaTradeSeparateService.separate("1530202304261049572195600000"); //laKaLaTradeSeparateService.separate("1530202304261049572195600000");
// tradeOrderProfitSharingService.createProfitSharing(tradeOrderService.getOrderByOutTradeNo("ZF1130202304261734049211335408")); // tradeOrderProfitSharingService.createProfitSharing(tradeOrderService.getOrderByOutTradeNo("ZF1130202304261734049211335408"));
// return ResponseMsgUtil.success(saasCommon.getUpdateToken()); // return ResponseMsgUtil.success(saasCommon.getUpdateToken());
return ResponseMsgUtil.success(saasMerService.merchantInfo("123300981")); /* return ResponseMsgUtil.success(saasMerService.reconsiderSubmit("123364703"));*/
return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703"));
// return ResponseMsgUtil.success(""); // return ResponseMsgUtil.success("");
// 1200 // 1200
// return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>())); // return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>()));
@ -277,8 +279,16 @@ public class TestController {
public ResponseData saasUpdateFee(@RequestParam(value = "merId", required = true) Long merId) { public ResponseData saasUpdateFee(@RequestParam(value = "merId", required = true) Long merId) {
try { try {
// return ResponseMsgUtil.success(saasMerService.updateReview(reviewRelatedId)); // return ResponseMsgUtil.success(saasMerService.updateReview(reviewRelatedId);
return ResponseMsgUtil.success(saasMerService.merchantInfo("")); /* int[] idArray = {74,75,76,77,78,79,81,82,85,89,90,92,95,97,98,100,100,101,101,102,104,105};
for (int i = 0; i < idArray.length; i++) {
int id = idArray[i];
// saasMerService.updateFee(Long.parseLong(id+""));
}*/
// return ResponseMsgUtil.success("");
// return ResponseMsgUtil.success(saasMerService.updateFee(74L));
return ResponseMsgUtil.success(saasMerService.queryFee(85L));
//return ResponseMsgUtil.success(saasMerService.updateReview(merId.toString()));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);

@ -1,6 +1,5 @@
package com.hfkj.channel.saas; package com.hfkj.channel.saas;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.saas.config.SaasConfig; import com.hfkj.channel.saas.config.SaasConfig;
import com.hfkj.channel.saas.utils.GenerateAgreementUtil; import com.hfkj.channel.saas.utils.GenerateAgreementUtil;
@ -16,10 +15,7 @@ import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.model.MerBasisModel; import com.hfkj.model.MerBasisModel;
import com.hfkj.service.*; import com.hfkj.service.*;
import com.hfkj.sysenum.MerAttachType; import com.hfkj.sysenum.*;
import com.hfkj.sysenum.MerSettleType;
import com.hfkj.sysenum.MerTypeEnum;
import com.hfkj.sysenum.PlatformTypeEnum;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
@ -49,10 +45,10 @@ public class SaasMerService {
private BsMerService merService; private BsMerService merService;
@Resource @Resource
private BsIndustryService industryService; private BsStoreService storeService;
@Resource @Resource
private SecRegionService regionService; private BsIndustryService industryService;
@Resource @Resource
private BsMerRateService merRateService; private BsMerRateService merRateService;
@ -62,9 +58,6 @@ public class SaasMerService {
@Resource @Resource
private BsMerPlatformNoService merPlatformNoService; private BsMerPlatformNoService merPlatformNoService;
@Resource
private BsMerPlatformNoRateService merPlatformNoRateService;
@Resource @Resource
private BsMerAttachService merAttachService; private BsMerAttachService merAttachService;
@ -135,7 +128,8 @@ public class SaasMerService {
if (basisModel.getLarIdCardPeriodType().equals(2)) { if (basisModel.getLarIdCardPeriodType().equals(2)) {
Calendar larIdCardEnd = Calendar.getInstance(); Calendar larIdCardEnd = Calendar.getInstance();
larIdCardEnd.set(Calendar.YEAR, 2099); larIdCardEnd.set(Calendar.YEAR, 2099);
larIdCardEnd.set(Calendar.MONTH, 12); larIdCardEnd.set(Calendar.MONTH, 11);
larIdCardEnd.set(Calendar.DATE , 31);
body.put("larIdCardEnd", DateUtil.date2String(larIdCardEnd.getTime(), "yyyy-MM-dd")); body.put("larIdCardEnd", DateUtil.date2String(larIdCardEnd.getTime(), "yyyy-MM-dd"));
} else { } else {
body.put("larIdCardEnd", basisModel.getLarIdCardPeriodEnd().replace(".", "-")); body.put("larIdCardEnd", basisModel.getLarIdCardPeriodEnd().replace(".", "-"));
@ -172,16 +166,17 @@ public class SaasMerService {
// 非法人结算 // 非法人结算
if (basisModel.getMerSettleAcct().getSettleType().equals(MerSettleType.status3.getNumber())) { if (basisModel.getMerSettleAcct().getSettleType().equals(MerSettleType.status3.getNumber())) {
body.put("accountIdType", basisModel.getLarName()); body.put("accountIdType", "01");
body.put("accountName", basisModel.getMerSettleAcct().getSettleIdCardName());
body.put("accountIdDtStart", basisModel.getMerSettleAcct().getSettleIdCardPeriodStart().replace(".", "-")); body.put("accountIdDtStart", basisModel.getMerSettleAcct().getSettleIdCardPeriodStart().replace(".", "-"));
if (basisModel.getLarIdCardPeriodType().equals(2)) { if (basisModel.getMerSettleAcct().getSettleIdPeriodType().equals(2)) {
Calendar accountIdDtEnd = Calendar.getInstance(); Calendar accountIdDtEnd = Calendar.getInstance();
accountIdDtEnd.set(Calendar.YEAR, 2099); accountIdDtEnd.set(Calendar.YEAR, 2099);
accountIdDtEnd.set(Calendar.MONTH, 12); accountIdDtEnd.set(Calendar.MONTH, 11);
accountIdDtEnd.set(Calendar.DATE , 31); accountIdDtEnd.set(Calendar.DATE , 31);
body.put("accountIdDtEnd", DateUtil.date2String(accountIdDtEnd.getTime(), "yyyy-MM-dd")); body.put("accountIdDtEnd", DateUtil.date2String(accountIdDtEnd.getTime(), "yyyy-MM-dd"));
} else { } else {
body.put("accountIdDtEnd", basisModel.getLarIdCardPeriodEnd().replace(".", "-")); body.put("accountIdDtEnd", basisModel.getMerSettleAcct().getSettleIdCardPeriodEnd().replace(".", "-"));
} }
} }
/** --------- 结算信息---------- **/ /** --------- 结算信息---------- **/
@ -348,6 +343,83 @@ public class SaasMerService {
return responseObj; return responseObj;
} }
/**
* 进件复议
* @return
*/
public JSONObject reconsider(Long merId) throws Exception {
BsMer mer = merService.getMer(merId);
if (mer == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户信息");
}
if (!mer.getMerStatus().equals(MerStatusEnum.status4.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户状态不处于审核驳回状态,无法复议");
}
mer.setCompleteStatus(MerCompleteStatusEnum.status1.getNumber());
mer.setMerStatus(MerStatusEnum.status3.getNumber());
merService.editMer(mer);
List<BsStore> storeList = storeService.getStoreByMerId(merId, StoreCreateTypeEnum.type1);
storeList.get(0).setAloneSettle(false);
storeList.get(0).setStatus(StoreStatusEnum.status3.getNumber());
storeService.editStore(storeList.get(0));
// 平台
BsMerPlatformNo platformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1);
if (platformNo == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未提交过进件");
}
JSONObject responseObj = reconsiderSubmit(platformNo.getPlatformNo());
String orderNo = System.currentTimeMillis()+"";
// 增加进件记录
BsMerContractRecord record = new BsMerContractRecord();
record.setMerId(merId);
record.setPlatformType(PlatformTypeEnum.type1.getNumber());
record.setOrderNo(orderNo);
record.setContractId(responseObj.toJSONString());
record.setStatus(1);
merContractRecordService.insertRecord(record);
// 增加进件记录消息
BsMerContractRecordMsg recordMsg = new BsMerContractRecordMsg();
recordMsg.setOrderNo(orderNo);
recordMsg.setType(1);
recordMsg.setRequestContent(platformNo.getPlatformNo());
recordMsg.setResponseCode(null);
recordMsg.setResponseMsg(null);
recordMsg.setResponseContent(responseObj.toJSONString());
merContractRecordMsgService.insertRecordMsg(recordMsg);
return responseObj;
}
/**
* 进件复议提交
* @return
*/
public JSONObject reconsiderSubmit(String customerNo) throws Exception {
Map<String,Object> param = new HashMap<>();
param.put("customerNo", customerNo);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getToken());
JSONObject obj = new JSONObject();
obj.put("data", Base64.encodeBase64String(RSAUtil.encryptByPrivateKey(JSONObject.toJSONString(param).getBytes(), Base64.decodeBase64(RSAUtil.PRIVATE_KEY))));
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "open/merchant/reconsider/submit", obj, header);
System.out.println("请求地址:" + SaasConfig.requestMerUrl + "open/merchant/reconsider/submit");
System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("code").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
return JSONObject.parseObject(new String(RSAUtil.decryptByPublicKey(Base64.decodeBase64(responseObj.getString("data")), Base64.decodeBase64(RSAUtil.PUBLIC_KEY))));
}
/** /**
* 修改费率 * 修改费率
* @param merId 申请id * @param merId 申请id
@ -390,7 +462,7 @@ public class SaasMerService {
} }
/** /**
* 修改费率 * 查询费率
* @param merId 申请id * @param merId 申请id
* @return * @return
*/ */
@ -411,7 +483,7 @@ public class SaasMerService {
System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo()); System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo());
System.out.println("body:" + JSONObject.toJSONString(param)); System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString()); System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) { if (responseObj == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
} }
return responseObj; return responseObj;
@ -439,10 +511,13 @@ public class SaasMerService {
} }
} }
/**
* 查询商户结算
* @param customerNo
* @return
*/
public JSONObject getMerSettle(String customerNo) { public JSONObject getMerSettle(String customerNo) {
try { try {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("customerNo", customerNo); param.put("customerNo", customerNo);

@ -17,6 +17,12 @@ public interface BsMerContractService {
*/ */
void addMerContract(Long merId) throws Exception; void addMerContract(Long merId) throws Exception;
/**
* 复议提交
* @param merId
*/
void reconsider(Long merId) throws Exception;
/** /**
* 门店进件 * 门店进件
* @param storeId * @param storeId

@ -60,6 +60,13 @@ public interface BsMerService {
*/ */
BsMer getMer(Long merId); BsMer getMer(Long merId);
/**
* 复议提交
* @param merId
* @return
*/
void reconsider(Long merId) throws Exception;
/** /**
* 查询商户列表 * 查询商户列表
* @param param * @param param

@ -30,9 +30,6 @@ public class BsMerContractServiceImpl implements BsMerContractService {
@Resource @Resource
private BsStoreService storeService; private BsStoreService storeService;
@Resource
private LaKaLaMerService laKaLaMerService;
@Resource @Resource
private SaasMerService saasMerService; private SaasMerService saasMerService;
@ -58,13 +55,29 @@ public class BsMerContractServiceImpl implements BsMerContractService {
} }
@Override
public void reconsider(Long merId) throws Exception {
BsMer mer = merService.getMer(merId);
if (mer == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
}
if (mer.getCompleteStatus() != 1){
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户资料未完善");
}
// 当前的进件平台
BsPlatform platform = platformService.getCurrentPlatform();
if (platform.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
saasMerService.reconsider(merId);
}
}
@Override @Override
public void addStoreContract(Long storeId) throws Exception { public void addStoreContract(Long storeId) throws Exception {
BsStore store = storeService.getStoreById(storeId); BsStore store = storeService.getStoreById(storeId);
if (store == null) { if (store == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店");
} }
} }
} }

@ -3,6 +3,8 @@ package com.hfkj.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.config.LaKaLaConfig; import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.channel.saas.SaasMerService;
import com.hfkj.channel.saas.utils.SaasCommon;
import com.hfkj.channel.weixin.WeiXinMerService; import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.channel.weixin.utils.WeiXinUploadUtil; import com.hfkj.channel.weixin.utils.WeiXinUploadUtil;
import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorCode;
@ -300,6 +302,25 @@ public class BsMerServiceImpl implements BsMerService {
} }
/******* 开户许可证照片 *******/ /******* 开户许可证照片 *******/
/******* 结算委托书 *******/
// 处理法人身份证正面
List<BsMerAttach> commissionImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type99.getNumber());
if (commissionImg.size() > 0) {
for (BsMerAttach merAttach : commissionImg) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
if (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber()) && StringUtils.isNotBlank(merSettleAcct.getOpenningBankLicenseUrl())){
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type99.getNumber());
attach.setFileUrl(merSettleAcct.getCommissionImg());
merAttachService.editMerAttach(attach);
}
/******* 结算委托书 *******/
/******* 结算人身份证人像面 *******/ /******* 结算人身份证人像面 *******/
// 处理法人身份证正面 // 处理法人身份证正面
List<BsMerAttach> larIdCardPortraitImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type9.getNumber()); List<BsMerAttach> larIdCardPortraitImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type9.getNumber());
@ -411,6 +432,11 @@ public class BsMerServiceImpl implements BsMerService {
return merMapper.selectByPrimaryKey(merId); return merMapper.selectByPrimaryKey(merId);
} }
@Override
public void reconsider(Long merId) throws Exception {
merContractService.reconsider(merId);
}
@Override @Override
public List<BsMer> getMerList(Map<String, Object> param) { public List<BsMer> getMerList(Map<String, Object> param) {
BsMerExample example = new BsMerExample(); BsMerExample example = new BsMerExample();

Loading…
Cancel
Save