diff --git a/bweb/src/main/java/com/bweb/controller/BsStoreDiscountActivityController.java b/bweb/src/main/java/com/bweb/controller/BsStoreDiscountActivityController.java
index c374a03..fd80a28 100644
--- a/bweb/src/main/java/com/bweb/controller/BsStoreDiscountActivityController.java
+++ b/bweb/src/main/java/com/bweb/controller/BsStoreDiscountActivityController.java
@@ -78,7 +78,7 @@ public class BsStoreDiscountActivityController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的参与类型");
}
if (partakeWayEnum.getNumber().equals(StoreDiscountActivityPartakeWayEnum.type3.getNumber())
- && body.getRestrictType() == null || body.getRestrictPartakeNum() == null) {
+ && (body.getRestrictType() == null || body.getRestrictPartakeNum() == null)) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要填写限制参与条件");
}
diff --git a/bweb/src/main/resources/dev/logback.xml b/bweb/src/main/resources/dev/logback.xml
index 9382585..7de8034 100644
--- a/bweb/src/main/resources/dev/logback.xml
+++ b/bweb/src/main/resources/dev/logback.xml
@@ -69,4 +69,24 @@
+
+
+ log/hsg.log
+
+ log/hsg/hsg.log.%d.%i
+
+
+ 64 MB
+
+
+
+
+ %d %p (%file:%line\)- %m%n
+
+ UTF-8
+
+
+
+
+
diff --git a/bweb/src/main/resources/prod/logback.xml b/bweb/src/main/resources/prod/logback.xml
index e509de0..8d8c1fe 100644
--- a/bweb/src/main/resources/prod/logback.xml
+++ b/bweb/src/main/resources/prod/logback.xml
@@ -69,4 +69,24 @@
+
+
+ log/hsg.log
+
+ log/hsg/hsg.log.%d.%i
+
+
+ 64 MB
+
+
+
+
+ %d %p (%file:%line\)- %m%n
+
+ UTF-8
+
+
+
+
+
diff --git a/cweb/src/main/java/com/cweb/controller/BsMerSettleAcctController.java b/cweb/src/main/java/com/cweb/controller/BsMerSettleAcctController.java
new file mode 100644
index 0000000..1ecc665
--- /dev/null
+++ b/cweb/src/main/java/com/cweb/controller/BsMerSettleAcctController.java
@@ -0,0 +1,163 @@
+package com.cweb.controller;
+
+import com.cweb.config.SysConfig;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hfkj.common.exception.ErrorCode;
+import com.hfkj.common.exception.ErrorHelp;
+import com.hfkj.common.exception.SysCode;
+import com.hfkj.common.security.UserCenter;
+import com.hfkj.common.utils.DateUtil;
+import com.hfkj.common.utils.ImageUtils;
+import com.hfkj.common.utils.ResponseMsgUtil;
+import com.hfkj.config.CommonSysConst;
+import com.hfkj.entity.*;
+import com.hfkj.model.*;
+import com.hfkj.obs.HuaWeiYunObs;
+import com.hfkj.service.*;
+import com.hfkj.sysenum.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import net.coobird.thumbnailator.Thumbnails;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.*;
+
+@Controller
+@Api(value = "商户结算信息")
+@RequestMapping(value = "/merSettleAcct")
+public class BsMerSettleAcctController {
+
+ private static Logger log = LoggerFactory.getLogger(BsMerSettleAcctController.class);
+
+ @Resource
+ private BsMerSettleAcctApplyService merSettleAcctApplyService;
+
+ @Resource
+ private BsMerService merService;
+ @Resource
+ private CommonService commonService;
+
+ @RequestMapping(value="/createApplyUpdateSettle",method = RequestMethod.POST)
+ @ResponseBody
+ @ApiOperation(value = "创建申请修改结算")
+ public ResponseData createApplyUpdateSettle(@RequestBody BsMerSettleAcctApply merSettleAcct) {
+ try {
+ if (merSettleAcct.getMerId() == null
+ || merSettleAcct.getApplyType() == null
+ || merSettleAcct.getSettleType() == null
+ || StringUtils.isBlank(merSettleAcct.getBankCardNo())
+ || StringUtils.isBlank(merSettleAcct.getBankCardHolder())
+ || merSettleAcct.getOpenningBankAreaCode() == null
+ || (merSettleAcct.getSettleType().equals(MerSettleType.status1.getNumber()) && StringUtils.isBlank(merSettleAcct.getOpenningBankLicenseUrl()))
+ || (merSettleAcct.getSettleType().equals(MerSettleType.status2.getNumber()) && StringUtils.isBlank(merSettleAcct.getBankCardImg()))
+ || (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber()) && StringUtils.isBlank(merSettleAcct.getBankCardImg()))
+ ) {
+ log.error("configMerBasis error!","参数错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
+ }
+
+ if (StringUtils.isBlank(merSettleAcct.getOpenningBankName())
+ || StringUtils.isBlank(merSettleAcct.getOpenningBankCode())
+ || StringUtils.isBlank(merSettleAcct.getClearingBankCode())) {
+ log.error("configMerBasis error!","参数错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
+ }
+
+ SecRegion openningBankArea = commonService.getRegionsById(merSettleAcct.getOpenningBankAreaCode());
+ if (openningBankArea == null) {
+ log.error("configMerBasis error!","参数错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的的开户地区");
+ }
+
+ SecRegion openningBankCity = commonService.getRegionsById(openningBankArea.getParentId());
+ if (openningBankCity == null) {
+ log.error("configMerBasis error!","参数错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的的开户地区");
+ }
+
+ SecRegion openningBankProvince = commonService.getRegionsById(openningBankCity.getParentId());
+ if (openningBankProvince == null) {
+ log.error("configMerBasis error!","参数错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的的开户地区");
+ }
+ merSettleAcct.setOpenningBankAreaName(openningBankArea.getRegionName());
+ merSettleAcct.setOpenningBankCityCode(openningBankCity.getRegionId());
+ merSettleAcct.setOpenningBankCityName(openningBankCity.getRegionName());
+ merSettleAcct.setOpenningBankProvinceCode(openningBankProvince.getRegionId());
+ merSettleAcct.setOpenningBankProvinceName(openningBankProvince.getRegionName());
+
+ // 查询商户详情
+ BsMer bsMer = merService.getMer(merSettleAcct.getMerId());
+ if (bsMer == null) {
+ log.error("configMerBasis error!","未知商户");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户");
+ }
+ if ((!bsMer.getMerStatus().equals(MerStatusEnum.status2.getNumber())
+ && !bsMer.getMerStatus().equals(MerStatusEnum.status4.getNumber()))) {
+ log.error("configMerBasis error!","状态错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
+ }
+
+ // 对私非法人结算
+ if (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber()) &&
+ (StringUtils.isBlank(merSettleAcct.getSettleIdCardPortraitImg())
+ || StringUtils.isBlank(merSettleAcct.getSettleIdCardNationalEmblemImg())
+ || StringUtils.isBlank(merSettleAcct.getSettleIdCardName())
+ || StringUtils.isBlank(merSettleAcct.getSettleIdCardNo())
+ || StringUtils.isBlank(merSettleAcct.getSettleIdCardPeriodStart())
+ || StringUtils.isBlank(merSettleAcct.getSettleIdCardPeriodEnd())
+ || merSettleAcct.getSettleIdPeriodType() == null)) {
+ log.error("configMerBasis error!","参数错误");
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "需要结算人身份证信息");
+ } else {
+ // 对公结算、对私法人结算
+ merSettleAcct.setSettleIdCardName(bsMer.getLarName());
+ merSettleAcct.setSettleIdCardNo(bsMer.getLarIdCard());
+ merSettleAcct.setSettleIdCardPortraitImg(bsMer.getLarIdCardPortraitImg());
+ merSettleAcct.setSettleIdCardNationalEmblemImg(bsMer.getLarIdCardNationalEmblemImg());
+ merSettleAcct.setSettleIdPeriodType(bsMer.getBlisPeriodType());
+ merSettleAcct.setSettleIdCardPeriodStart(bsMer.getLarIdCardPeriodStart());
+ merSettleAcct.setSettleIdCardPeriodEnd(bsMer.getLarIdCardPeriodEnd());
+ }
+
+ merSettleAcct.setApplyNo(System.currentTimeMillis()+"");
+ merSettleAcct.setStatus(MerSettleAcctApplyStatus.status1.getNumber());
+
+
+ return ResponseMsgUtil.success("申请成功");
+
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ return ResponseMsgUtil.exception(e);
+ }
+ }
+
+ @RequestMapping(value="/getMerDetail",method = RequestMethod.GET)
+ @ResponseBody
+ @ApiOperation(value = "查询商户详情")
+ public ResponseData getMerDetail(@RequestParam(value = "merId" , required = true) Long merId) {
+ try {
+
+ return ResponseMsgUtil.success(merService.getMerDetail(merId));
+
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ return ResponseMsgUtil.exception(e);
+ }
+ }
+
+}
diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java
index b6093b7..ef8cd3c 100644
--- a/cweb/src/main/java/com/cweb/controller/TestController.java
+++ b/cweb/src/main/java/com/cweb/controller/TestController.java
@@ -22,7 +22,9 @@ import com.hfkj.channel.weixin.utils.WxUtils;
import com.hfkj.channel.weixin.utils.sdk.WXPayConstants;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.HttpsUtils;
+import com.hfkj.common.utils.ImageUtils;
import com.hfkj.common.utils.ResponseMsgUtil;
+import com.hfkj.config.CommonSysConst;
import com.hfkj.config.device.SoundService;
import com.hfkj.config.mqtt.MqttProviderService;
import com.hfkj.entity.BsLklMcc;
@@ -98,8 +100,12 @@ public class TestController {
public ResponseData saasGetToken() {
try {
- // return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin("3100020709200056842"));
- return ResponseMsgUtil.success(LaKaLaConfig.uploadFile("", "", ""));
+ return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin("3100020709200056842"));
+/* // 转换成bas64
+ String imageUrl = "https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com/merchant/57/1682405639861.jpeg";
+ String base64ImgUrl = ImageUtils.getBase64ByImgUrl(imageUrl);
+ String fileType = imageUrl.substring(imageUrl.lastIndexOf(".") + 1);
+ return ResponseMsgUtil.success(LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl));*/
} catch (Exception e) {
log.error(e.getMessage(), e);
@@ -115,13 +121,14 @@ public class TestController {
// return ResponseMsgUtil.success(saasCommon.fileUpload(new File("D:/home/project/gratia-pay/filesystem/share/1680164428924.png"), "OTHERS", "0"));
// 996900 6900 6905
// return ResponseMsgUtil.success(saasCommon.getArea("1"));
- // return ResponseMsgUtil.success(saasCommon.getBank("6530", "大坪支行"));
+ //return ResponseMsgUtil.success(saasCommon.getBank("6530", "恒丰银行重庆渝北支行"));
// tradeOrderProfitSharingService.createProfitSharing(tradeOrderService.getOrderByOutTradeNo("ZF1130202304261043149211335400"));
// laKaLaLedgerService.queryLedgerMer("8226900481608NL");
//laKaLaTradeSeparateService.separate("1530202304261049572195600000");
// tradeOrderProfitSharingService.createProfitSharing(tradeOrderService.getOrderByOutTradeNo("ZF1130202304261734049211335408"));
- return ResponseMsgUtil.success(laKaLaTradeSeparateService.fallback("153020230426173509288272000001"));
+ // return ResponseMsgUtil.success(saasCommon.getUpdateToken());
+ return ResponseMsgUtil.success(saasMerService.updateSettleApply(38L));
// return ResponseMsgUtil.success("");
// 1200
// return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>()));
@@ -142,6 +149,22 @@ public class TestController {
}
}
+ @RequestMapping(value="/saasTest1",method = RequestMethod.GET)
+ @ResponseBody
+ @ApiOperation(value = "saasTest")
+ public ResponseData saasTest1(@RequestParam(value = "reviewRelatedId", required = true) String reviewRelatedId) {
+ try {
+
+ // return ResponseMsgUtil.success(saasMerService.updateReview(reviewRelatedId));
+ return ResponseMsgUtil.success(saasMerService.getMerSettle("122952457"));
+
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ return ResponseMsgUtil.exception(e);
+ }
+ }
+
+
@RequestMapping(value="/soundSendMsg",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "音响发送消息")
diff --git a/cweb/src/main/resources/dev/logback.xml b/cweb/src/main/resources/dev/logback.xml
index 80ee421..6011524 100644
--- a/cweb/src/main/resources/dev/logback.xml
+++ b/cweb/src/main/resources/dev/logback.xml
@@ -91,4 +91,25 @@
+
+
+ log/hsg.log
+
+ log/hsg/hsg.log.%d.%i
+
+
+ 64 MB
+
+
+
+
+ %d %p (%file:%line\)- %m%n
+
+ UTF-8
+
+
+
+
+
+
diff --git a/cweb/src/main/resources/prod/logback.xml b/cweb/src/main/resources/prod/logback.xml
index 19f75d1..60947fa 100644
--- a/cweb/src/main/resources/prod/logback.xml
+++ b/cweb/src/main/resources/prod/logback.xml
@@ -91,4 +91,24 @@
+
+ log/hsg.log
+
+ log/hsg/hsg.log.%d.%i
+
+
+ 64 MB
+
+
+
+
+ %d %p (%file:%line\)- %m%n
+
+ UTF-8
+
+
+
+
+
+
diff --git a/service/src/main/java/com/hfkj/channel/hsg/HsgIntegralService.java b/service/src/main/java/com/hfkj/channel/hsg/HsgIntegralService.java
index 0611866..e45b7c6 100644
--- a/service/src/main/java/com/hfkj/channel/hsg/HsgIntegralService.java
+++ b/service/src/main/java/com/hfkj/channel/hsg/HsgIntegralService.java
@@ -10,11 +10,13 @@ import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ResponseMsgUtil;
+import io.netty.channel.ConnectTimeoutException;
import org.apache.commons.collections4.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
+import java.net.SocketTimeoutException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@@ -29,7 +31,7 @@ public class HsgIntegralService {
private static Logger log = LoggerFactory.getLogger(HsgIntegralService.class);
/**
- * 返利
+ * 积分返利
* @param productType
* @param phone
* @param orderNo
@@ -47,10 +49,11 @@ public class HsgIntegralService {
BigDecimal price,
String storeName,
Date createTime) {
+ log.info("========== start 积分返利 ===========");
+ String requestJSON = "";
try {
Map mapPost = new HashMap<>();
- mapPost.put("apiKey" , HsgConfig.apiKey);
mapPost.put("merchId" , HsgConfig.merchId);
mapPost.put("productType" , productType.getNumber()); // 101 普通支付 102 商家活动差价返利
mapPost.put("orderNo" , orderNo);
@@ -59,9 +62,94 @@ public class HsgIntegralService {
mapPost.put("price" , price);
mapPost.put("title" , storeName);
mapPost.put("createTime" , createTime);
- mapPost.put("sign" , WxUtils.generateSignApi(mapPost, MapUtils.getString(mapPost, "apiKey"), WXPayConstants.SignType.MD5));
+ mapPost.put("sign" , WxUtils.generateSignApi(mapPost, HsgConfig.apiKey, WXPayConstants.SignType.MD5));
+
+ requestJSON = JSONObject.toJSONString(mapPost);
+ log.info("请求参数:" + requestJSON);
JSONObject response = HttpsUtils.doPost(HsgConfig.hsgDomainName+"v1/orderRebate/rebate", mapPost, new HashMap<>());
- System.out.println(response);
+ log.info("响应参数:" + response);
+ if (response == null) {
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求超时");
+ }
+ if (!response.getString("return_code").equals("000000")) {
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg"));
+ }
+ return true;
+
+ } catch (SocketTimeoutException | ConnectTimeoutException e) {
+ log.info("请求超时:" + e);
+ return false;
+ } catch (Exception e) {
+ log.info("出现异常:" + e);
+ return false;
+ } finally {
+ log.info("========== end 积分返利 ===========");
+ }
+ }
+
+ /**
+ * 退款返利
+ * @param orderId
+ * @param orderNo
+ * @return
+ */
+ public static Boolean recycleIntegral(String orderId,String orderNo) {
+ log.info("========== start 退款返利 ===========");
+ String requestJSON = "";
+ try {
+ Map mapPost = new HashMap<>();
+ mapPost.put("merchId" , HsgConfig.merchId);
+ mapPost.put("orderId" , orderId);
+ mapPost.put("orderNo" , orderNo);
+ mapPost.put("sign" , WxUtils.generateSignApi(mapPost, HsgConfig.apiKey, WXPayConstants.SignType.MD5));
+
+ requestJSON = JSONObject.toJSONString(mapPost);
+ log.info("请求参数:" + requestJSON);
+ JSONObject response = HttpsUtils.doPost(HsgConfig.hsgDomainName+"v1/orderRebate/recycleIntegral", mapPost, new HashMap<>());
+ log.info("响应参数:" + response.toJSONString());
+
+ if (response == null) {
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求超时");
+ }
+ if (!response.getString("return_code").equals("000000")) {
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg"));
+ }
+ return true;
+
+ } catch (SocketTimeoutException | ConnectTimeoutException e) {
+ log.info("请求超时:" + e);
+
+ return false;
+ } catch (Exception e) {
+ log.info("出现异常:" + e);
+ return false;
+ } finally {
+ log.info("========== end 退款返利 ===========");
+ }
+ }
+
+ /**
+ * 通知退还积分状态
+ * @param orderId
+ * @param orderNo
+ * @return
+ */
+ public static Boolean refundReturn(String orderId,String orderNo, Boolean status) {
+ log.info("========== start 通知退还积分状态 ===========");
+ String requestJSON = "";
+ try {
+ Map mapPost = new HashMap<>();
+ mapPost.put("merchId" , HsgConfig.merchId);
+ mapPost.put("orderId" , orderId);
+ mapPost.put("orderNo" , orderNo);
+ mapPost.put("refundStatus" , status.equals(true)?"succeed":"fail");
+ mapPost.put("sign" , WxUtils.generateSignApi(mapPost, HsgConfig.apiKey, WXPayConstants.SignType.MD5));
+
+ requestJSON = JSONObject.toJSONString(mapPost);
+ log.info("请求参数:" + requestJSON);
+ JSONObject response = HttpsUtils.doPost(HsgConfig.hsgDomainName+"v1/orderRebate/refundReturn", mapPost, new HashMap<>());
+ log.info("响应参数:" + response.toJSONString());
+
if (response == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求超时");
}
@@ -69,8 +157,15 @@ public class HsgIntegralService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, response.getString("return_msg"));
}
return true;
+
+ } catch (SocketTimeoutException | ConnectTimeoutException e) {
+ log.info("请求超时:" + e);
+ return false;
} catch (Exception e) {
+ log.info("出现异常:" + e);
return false;
+ } finally {
+ log.info("========== end 通知退还积分状态 ===========");
}
}
diff --git a/service/src/main/java/com/hfkj/channel/hsg/config/HsgConfig.java b/service/src/main/java/com/hfkj/channel/hsg/config/HsgConfig.java
index b15317c..ee96e65 100644
--- a/service/src/main/java/com/hfkj/channel/hsg/config/HsgConfig.java
+++ b/service/src/main/java/com/hfkj/channel/hsg/config/HsgConfig.java
@@ -9,9 +9,8 @@ import com.hfkj.config.CommonSysConst;
**/
public class HsgConfig {
+ public final static String hsgDomainName = CommonSysConst.getSysConfig().getHsg_domain_name();
public final static String apiKey = "0C7897EA3BD96156A5881618FF2FF645";
-
public final static String merchId = "20230258302";
- public final static String hsgDomainName = CommonSysConst.getSysConfig().getHsg_domain_name();
}
diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
index 3194b26..f67fb9f 100644
--- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
+++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
@@ -96,7 +96,7 @@ public class LaKaLaTradeService {
map.put("term_no", merPlatformTerm.getTermNo());
map.put("out_trade_no", order.getOutTradeNo());
map.put("auth_code", authCode);
- map.put("total_amount", order.getTradeAmount().multiply(new BigDecimal("100")).intValue());
+ map.put("total_amount", order.getTradeActualAmount().multiply(new BigDecimal("100")).intValue());
map.put("notify_url", CommonSysConst.getSysConfig().getLkl_micro_pay_ret_url());
map.put("settle_type", order.getProfitSharingStatus().equals(true)?"1":"0");
@@ -208,7 +208,7 @@ public class LaKaLaTradeService {
map.put("out_trade_no", order.getOutTradeNo());
map.put("account_type", order.getPayMode());
map.put("trans_type", "51");
- map.put("total_amount", order.getTradeAmount().multiply(new BigDecimal("100")).intValue());
+ map.put("total_amount", order.getTradeActualAmount().multiply(new BigDecimal("100")).intValue());
map.put("subject", mer.getMerAbbreviate());
map.put("notify_url", CommonSysConst.getSysConfig().getLkl_micro_pay_ret_url());
diff --git a/service/src/main/java/com/hfkj/channel/lakala/config/LaKaLaConfig.java b/service/src/main/java/com/hfkj/channel/lakala/config/LaKaLaConfig.java
index 4ea9daa..845bd41 100644
--- a/service/src/main/java/com/hfkj/channel/lakala/config/LaKaLaConfig.java
+++ b/service/src/main/java/com/hfkj/channel/lakala/config/LaKaLaConfig.java
@@ -174,7 +174,8 @@ public class LaKaLaConfig {
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/uploadFile", param, heard);
- System.out.println("body:");
+ System.out.println("body:" + JSONObject.toJSONString(param));
+ System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
diff --git a/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java b/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
index 9e6eed4..af897e1 100644
--- a/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
+++ b/service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
@@ -1,5 +1,6 @@
package com.hfkj.channel.saas;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.saas.config.SaasConfig;
import com.hfkj.channel.saas.utils.RSAUtil;
@@ -52,6 +53,8 @@ public class SaasMerService {
@Resource
private BsMerRateService merRateService;
+ @Resource
+ private BsMerSettleAcctApplyService merSettleAcctApplyService;
@Resource
private BsMerPlatformNoService merPlatformNoService;
@@ -274,22 +277,63 @@ public class SaasMerService {
/**
* 修改结算信息
- * @param customerNo
+ * @param applyId 申请id
* @return
*/
- public JSONObject updateSettle(String customerNo) {
+ public JSONObject updateSettleApply(Long applyId) {
try {
+ // 结算申请
+ BsMerSettleAcctApply merSettleAcctApply = merSettleAcctApplyService.getApplyById(applyId);
+ if (merSettleAcctApply == null) {
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的结算申请");
+ }
+ // 平台商户
+ BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merSettleAcctApply.getMerId(), PlatformTypeEnum.type1);
+ if (merPlatformNo == null) {
+ throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号");
+ }
+
Map param = new HashMap<>();
- param.put("customerNo", customerNo);
+ param.put("accountKind", merSettleAcctApply.getSettleType().equals(MerSettleType.status1.getNumber())?"57":"58");
+ param.put("accountName", merSettleAcctApply.getSettleIdCardName());
+ param.put("accountNo", merSettleAcctApply.getBankCardNo());
+ param.put("bankName", merSettleAcctApply.getOpenningBankName());
+ param.put("bankNo", merSettleAcctApply.getOpenningBankCode());
+ param.put("clearingBankNo", merSettleAcctApply.getClearingBankCode());
+ param.put("identityNo", merSettleAcctApply.getSettleIdCardNo());
+ param.put("settleCityCode", merSettleAcctApply.getOpenningBankCityCode());
+ param.put("settleCityName", merSettleAcctApply.getOpenningBankCityName());
+ param.put("settleCountyCode", merSettleAcctApply.getOpenningBankAreaCode());
+ param.put("settleCountyName", merSettleAcctApply.getOpenningBankAreaName());
+ param.put("settleProvinceCode", merSettleAcctApply.getOpenningBankProvinceCode());
+ param.put("settleProvinceName", merSettleAcctApply.getOpenningBankProvinceName());
+
+ List