提交代码

yy_dev
胡锐 2 years ago
parent 641420874d
commit 71ffc282f9
  1. 37
      cweb/src/main/java/com/cweb/controller/TestController.java
  2. 72
      schedule/src/main/java/com/hfkj/schedule/Merchant.java
  3. 5
      service/pom.xml
  4. 171
      service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
  5. 8
      service/src/main/java/com/hfkj/service/BsMerSettleAcctApplyService.java
  6. 2
      service/src/main/java/com/hfkj/service/impl/BsDeviceOrderServiceImpl.java
  7. 28
      service/src/main/java/com/hfkj/service/impl/BsMerSettleAcctApplyServiceImpl.java

@ -149,14 +149,14 @@ public class TestController {
} }
} }
@RequestMapping(value="/saasTest1",method = RequestMethod.GET) @RequestMapping(value="/saasUpdateFee",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "saasTest") @ApiOperation(value = "saasUpdateFee")
public ResponseData saasTest1(@RequestParam(value = "reviewRelatedId", required = true) String reviewRelatedId) { 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.getMerSettle("122952457")); return ResponseMsgUtil.success(saasMerService.updateFee(merId));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
@ -164,6 +164,19 @@ public class TestController {
} }
} }
@RequestMapping(value="/updateReview",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "updateReview")
public ResponseData updateReview(@RequestParam(value = "reviewRelatedId", required = true) String reviewRelatedId) {
try {
return ResponseMsgUtil.success(saasMerService.updateReview(reviewRelatedId));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/soundSendMsg",method = RequestMethod.GET) @RequestMapping(value="/soundSendMsg",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ -282,6 +295,22 @@ public class TestController {
} }
} }
@RequestMapping(value="/generate",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "图片上传")
public ResponseData generate() {
try {
/* Configuration cfg = new Configuration();
Template template = configuration.getTemplate("indexHTKWECHAT_PAY.html");*/
return ResponseMsgUtil.success(null);
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/rebate", method = RequestMethod.GET) @RequestMapping(value = "/rebate", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "返利") @ApiOperation(value = "返利")

@ -51,6 +51,12 @@ public class Merchant {
@Resource @Resource
private BsMerContractRecordMsgService merContractRecordMsgService; private BsMerContractRecordMsgService merContractRecordMsgService;
@Resource
private BsMerSettleAcctApplyService merSettleAcctApplyService;
@Resource
private BsMerSettleAcctService merSettleAcctService;
@Resource @Resource
private WeiXinMerService weiXinMerService; private WeiXinMerService weiXinMerService;
@ -267,4 +273,70 @@ public class Merchant {
} }
/**
* 修改结算审批查询并更新
*/
@SneakyThrows
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void lklSettleAcctApply() {
Map<String, Object> param = new HashMap<>();
param.put("applyNoIsNotNull", true);
param.put("status", MerSettleAcctApplyStatus.status2.getNumber());
List<BsMerSettleAcctApply> applyList = merSettleAcctApplyService.getApplyList(param);
for (BsMerSettleAcctApply merSettleAcctApply : applyList) {
try {
JSONObject responseObj = saasMerService.updateReview(merSettleAcctApply.getApplyNo());
if (responseObj != null) {
if (responseObj.getString("reviewPass").equals("PASS")) {
BsMerSettleAcct settle = merSettleAcctService.getMerSettleByMerId(merSettleAcctApply.getMerId());
if (settle != null) {
settle.setStatus(0);
merSettleAcctService.editMerSettleAcct(settle);
settle = new BsMerSettleAcct();
settle.setMerId(settle.getMerId());
settle.setSettleType(merSettleAcctApply.getSettleType());
settle.setBankCardImg(merSettleAcctApply.getBankCardImg());
settle.setBankName(merSettleAcctApply.getBankName());
settle.setBankCardNo(merSettleAcctApply.getBankCardNo());
settle.setBankCardHolder(merSettleAcctApply.getBankCardHolder());
settle.setOpenningBankCityCode(merSettleAcctApply.getOpenningBankCityCode());
settle.setOpenningBankCityName(merSettleAcctApply.getOpenningBankCityName());
settle.setOpenningBankAreaCode(merSettleAcctApply.getOpenningBankAreaCode());
settle.setOpenningBankAreaName(merSettleAcctApply.getOpenningBankAreaName());
settle.setOpenningBankProvinceCode(merSettleAcctApply.getOpenningBankProvinceCode());
settle.setOpenningBankProvinceName(merSettleAcctApply.getOpenningBankProvinceName());
settle.setOpenningBankCode(merSettleAcctApply.getOpenningBankCode());
settle.setOpenningBankName(merSettleAcctApply.getOpenningBankName());
settle.setOpenningBankLicenseUrl(merSettleAcctApply.getOpenningBankLicenseUrl());
settle.setClearingBankCode(merSettleAcctApply.getClearingBankCode());
settle.setSettleIdCardName(merSettleAcctApply.getSettleIdCardName());
settle.setSettleIdCardNo(merSettleAcctApply.getSettleIdCardNo());
settle.setSettleIdCardAddress(merSettleAcctApply.getSettleIdCardAddress());
settle.setSettleIdCardPortraitImg(merSettleAcctApply.getSettleIdCardPortraitImg());
settle.setSettleIdCardNationalEmblemImg(merSettleAcctApply.getSettleIdCardNationalEmblemImg());
settle.setSettleIdPeriodType(merSettleAcctApply.getSettleIdPeriodType());
settle.setSettleIdCardPeriodStart(merSettleAcctApply.getSettleIdCardPeriodStart());
settle.setSettleIdCardPeriodEnd(merSettleAcctApply.getSettleIdCardPeriodEnd());
merSettleAcctService.editMerSettleAcct(settle);
}
merSettleAcctApply.setStatus(MerSettleAcctApplyStatus.status3.getNumber());
merSettleAcctApplyService.editData(merSettleAcctApply);
} else if (responseObj.getString("reviewPass").equals("UNPASS")) {
merSettleAcctApply.setStatus(MerSettleAcctApplyStatus.status4.getNumber());
merSettleAcctApply.setRejectReason(responseObj.getString("reviewResult"));
merSettleAcctApplyService.editData(merSettleAcctApply);
}
}
} catch (Exception e) {
}
}
}
} }

@ -364,6 +364,11 @@
<artifactId>alipay-sdk-java</artifactId> <artifactId>alipay-sdk-java</artifactId>
<version>4.34.0.ALL</version> <version>4.34.0.ALL</version>
</dependency> </dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>
<!--<dependency> <!--<dependency>
<groupId>com.huaweicloud</groupId> <groupId>com.huaweicloud</groupId>
<artifactId>esdk-obs-java</artifactId> <artifactId>esdk-obs-java</artifactId>

@ -282,67 +282,130 @@ public class SaasMerService {
* @return * @return
*/ */
public JSONObject updateSettleApply(Long applyId) { public JSONObject updateSettleApply(Long applyId) {
try { // 结算申请
// 结算申请 BsMerSettleAcctApply merSettleAcctApply = merSettleAcctApplyService.getApplyById(applyId);
BsMerSettleAcctApply merSettleAcctApply = merSettleAcctApplyService.getApplyById(applyId); if (merSettleAcctApply == null) {
if (merSettleAcctApply == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的结算申请");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的结算申请"); }
} // 平台商户
// 平台商户 BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merSettleAcctApply.getMerId(), PlatformTypeEnum.type1);
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merSettleAcctApply.getMerId(), PlatformTypeEnum.type1); if (merPlatformNo == null) {
if (merPlatformNo == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号"); }
}
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("accountKind", merSettleAcctApply.getSettleType().equals(MerSettleType.status1.getNumber())?"57":"58"); param.put("accountKind", merSettleAcctApply.getSettleType().equals(MerSettleType.status1.getNumber())?"57":"58");
param.put("accountName", merSettleAcctApply.getSettleIdCardName()); param.put("accountName", merSettleAcctApply.getSettleIdCardName());
param.put("accountNo", merSettleAcctApply.getBankCardNo()); param.put("accountNo", merSettleAcctApply.getBankCardNo());
param.put("bankName", merSettleAcctApply.getOpenningBankName()); param.put("bankName", merSettleAcctApply.getOpenningBankName());
param.put("bankNo", merSettleAcctApply.getOpenningBankCode()); param.put("bankNo", merSettleAcctApply.getOpenningBankCode());
param.put("clearingBankNo", merSettleAcctApply.getClearingBankCode()); param.put("clearingBankNo", merSettleAcctApply.getClearingBankCode());
param.put("identityNo", merSettleAcctApply.getSettleIdCardNo()); param.put("identityNo", merSettleAcctApply.getSettleIdCardNo());
param.put("settleCityCode", merSettleAcctApply.getOpenningBankCityCode()); param.put("settleCityCode", merSettleAcctApply.getOpenningBankCityCode());
param.put("settleCityName", merSettleAcctApply.getOpenningBankCityName()); param.put("settleCityName", merSettleAcctApply.getOpenningBankCityName());
param.put("settleCountyCode", merSettleAcctApply.getOpenningBankAreaCode()); param.put("settleCountyCode", merSettleAcctApply.getOpenningBankAreaCode());
param.put("settleCountyName", merSettleAcctApply.getOpenningBankAreaName()); param.put("settleCountyName", merSettleAcctApply.getOpenningBankAreaName());
param.put("settleProvinceCode", merSettleAcctApply.getOpenningBankProvinceCode()); param.put("settleProvinceCode", merSettleAcctApply.getOpenningBankProvinceCode());
param.put("settleProvinceName", merSettleAcctApply.getOpenningBankProvinceName()); param.put("settleProvinceName", merSettleAcctApply.getOpenningBankProvinceName());
List<Map<String, Object>> attachmentsMapList = new ArrayList<>(); List<Map<String, Object>> attachmentsMapList = new ArrayList<>();
Map<String, Object> attachmentsMap; Map<String, Object> attachmentsMap;
attachmentsMap = new HashMap<>();
if (StringUtils.isNotBlank(merSettleAcctApply.getBankCardImg())) {
attachmentsMap.put("imgType", "BANK_CARD");
attachmentsMap.put("imgPath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merSettleAcctApply.getBankCardImg()), "BANK_CARD", "0").getString("url"));
attachmentsMapList.add(attachmentsMap);
} else if (StringUtils.isNotBlank(merSettleAcctApply.getOpenningBankLicenseUrl())) {
attachmentsMap = new HashMap<>(); attachmentsMap = new HashMap<>();
attachmentsMap.put("imgType", "OPENING_PERMIT");
attachmentsMap.put("imgPath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merSettleAcctApply.getOpenningBankLicenseUrl()), "OPENING_PERMIT", "0").getString("url"));
attachmentsMapList.add(attachmentsMap);
}
if (StringUtils.isNotBlank(merSettleAcctApply.getBankCardImg())) { param.put("attachments", attachmentsMapList);
attachmentsMap.put("imgType", "BANK_CARD");
attachmentsMap.put("imgPath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merSettleAcctApply.getBankCardImg()), "BANK_CARD", "0").getString("url"));
attachmentsMapList.add(attachmentsMap);
} else if (StringUtils.isNotBlank(merSettleAcctApply.getOpenningBankLicenseUrl())) {
attachmentsMap = new HashMap<>();
attachmentsMap.put("imgType", "OPENING_PERMIT");
attachmentsMap.put("imgPath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merSettleAcctApply.getOpenningBankLicenseUrl()), "OPENING_PERMIT", "0").getString("url"));
attachmentsMapList.add(attachmentsMap);
}
param.put("attachments", attachmentsMapList); Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getUpdateToken());
Map<String,Object> header = new HashMap<>(); JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/settle/" + merPlatformNo.getPlatformNo(), param, header);
header.put("Authorization", "bearer " + saasCommon.getUpdateToken()); System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
merSettleAcctApply.setApplyNo(responseObj.getString("reviewRelatedId"));
merSettleAcctApplyService.editData(merSettleAcctApply);
return responseObj;
}
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/settle/" + merPlatformNo.getPlatformNo(), param, header); /**
System.out.println("body:" + JSONObject.toJSONString(param)); * 修改费率
System.out.println("response:" + responseObj.toJSONString()); * @param merId 申请id
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) { * @return
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message")); */
} public JSONObject updateFee(Long merId) {
merSettleAcctApply.setApplyNo(responseObj.getString("reviewRelatedId")); // 平台商户
merSettleAcctApplyService.editData(merSettleAcctApply); BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1);
return responseObj; if (merPlatformNo == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号");
}
Map<String,Object> param = new HashMap<>();
param.put("productCode", "WECHAT_PAY");
param.put("settlementType", "AUTOMATIC");
// 商户费率
List<Map<String, Object>> feesMapList = new ArrayList<>();
Map<String, Object> feesMap;
List<BsMerRate> rateList = merRateService.getRateListByMerId(merId);
for (BsMerRate rate : rateList) {
feesMap = new HashMap<>();
feesMap.put("fee", rate.getRatePct());
feesMap.put("feeType", rate.getRateSaasTypeCode());
feesMapList.add(feesMap);
}
param.put("fees", feesMapList);
} catch (Exception e) { Map<String,Object> header = new HashMap<>();
System.out.println(e); header.put("Authorization", "bearer " + saasCommon.getUpdateToken());
return null;
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/fee/" + merPlatformNo.getPlatformNo(), param, header);
System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo());
System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
merPlatformNo.setExt1(responseObj.getString("reviewRelatedId"));
merPlatformNoService.editMerPlatformNo(merPlatformNo);
return responseObj;
}
/**
* 修改费率
* @param merId 申请id
* @return
*/
public JSONObject queryFee(Long merId) {
// 平台商户
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1);
if (merPlatformNo == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号");
} }
Map<String,Object> param = new HashMap<>();
// param.put("productCode", "WECHAT_PAY");
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getUpdateToken());
String doSaasGet = HttpsUtils.doSaasGet(SaasConfig.requestMerUrl + "channel/customer/update/fee/" + merPlatformNo.getPlatformNo(), param, header, false);
JSONObject responseObj = JSONObject.parseObject(doSaasGet);
System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo());
System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
return responseObj;
} }
/** /**
@ -367,6 +430,7 @@ public class SaasMerService {
} }
} }
public JSONObject getMerSettle(String customerNo) { public JSONObject getMerSettle(String customerNo) {
try { try {
@ -451,4 +515,5 @@ public class SaasMerService {
return str; return str;
} }
} }

@ -4,6 +4,7 @@ import com.hfkj.entity.BsMerSettleAcct;
import com.hfkj.entity.BsMerSettleAcctApply; import com.hfkj.entity.BsMerSettleAcctApply;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @className: BsMerSettleAcctApplyService * @className: BsMerSettleAcctApplyService
@ -52,4 +53,11 @@ public interface BsMerSettleAcctApplyService {
*/ */
List<BsMerSettleAcctApply> getApplyListByMer(Long merId); List<BsMerSettleAcctApply> getApplyListByMer(Long merId);
/**
* 查询申请列表
* @param param
* @return
*/
List<BsMerSettleAcctApply> getApplyList(Map<String, Object> param);
} }

@ -187,8 +187,6 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付码状态错误"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付码状态错误");
} }
payQrCodeList.add(payQrCode); payQrCodeList.add(payQrCode);
} }
} }

@ -13,6 +13,8 @@ import com.hfkj.service.BsMerSettleAcctApplyService;
import com.hfkj.sysenum.AuditStatusEnum; import com.hfkj.sysenum.AuditStatusEnum;
import com.hfkj.sysenum.AuditVocationalWorkType; import com.hfkj.sysenum.AuditVocationalWorkType;
import com.hfkj.sysenum.MerSettleAcctApplyStatus; import com.hfkj.sysenum.MerSettleAcctApplyStatus;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -20,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @className: BsMerSettleAcctApplyServiceImpl * @className: BsMerSettleAcctApplyServiceImpl
@ -110,4 +113,29 @@ public class BsMerSettleAcctApplyServiceImpl implements BsMerSettleAcctApplyServ
return merSettleAcctApplyMapper.selectByExample(example); return merSettleAcctApplyMapper.selectByExample(example);
} }
@Override
public List<BsMerSettleAcctApply> getApplyList(Map<String, Object> param) {
BsMerSettleAcctApplyExample example = new BsMerSettleAcctApplyExample();
BsMerSettleAcctApplyExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getInteger(param, "applyType") != null) {
criteria.andApplyTypeEqualTo(MapUtils.getInteger(param, "applyType"));
}
if (MapUtils.getBoolean(param, "applyNoIsNotNull") != null) {
criteria.andApplyNoIsNotNull();
}
if (StringUtils.isNotBlank(MapUtils.getString(param, "applyNo"))) {
criteria.andApplyNoEqualTo(MapUtils.getString(param, "applyNo"));
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andApplyNoIsNotNull();
}
example.setOrderByClause("create_time desc");
return merSettleAcctApplyMapper.selectByExample(example);
}
} }

Loading…
Cancel
Save