diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantInfoController.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantInfoController.java index d964dc7..d17c12b 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantInfoController.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/MerchantInfoController.java @@ -41,6 +41,29 @@ public class MerchantInfoController { @Resource private SxfMerchantAuditService sxfMerchantAuditService; + /** + * 银盛修改费率接口 + * @param custId merchatId 示例 QRY24********95 + * @param channel 4是D0 6是D1 + * @param mercId 商户Code 示例 M8002023********12 + * @return + */ + @GetMapping("/updateMerchantRate") + public RespBody updateMerchantRate(@RequestParam String custId,@RequestParam Integer channel,@RequestParam String mercId) { + return merchantInfoService.updateMerchantRate(custId,channel,mercId); + } + + + + /** + * 修改状态查询接口 + * @param changeSysFlowId 变更流水号 merchantInfo/updateMerchantRate 返回 + * @return + */ + @GetMapping("/queryMerchantRate") + public RespBody queryMerchantRate(@RequestParam String changeSysFlowId,@RequestParam Integer channel) { + return merchantInfoService.queryCustChange(changeSysFlowId,channel); + } /** * 实名认证信息 diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java index 8ba9d39..733ee43 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/controller/NotifyController.java @@ -9,7 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; - +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedReader; +import java.io.IOException; @Slf4j @@ -22,58 +24,77 @@ public class NotifyController { @Autowired private HfMerService hfMerService; - + @RequestMapping("changeRateCallBack") + public void changeRateCallBack(HttpServletRequest request, HttpServletResponse response) throws IOException { + StringBuilder requestBody = new StringBuilder(); + try { + BufferedReader reader = request.getReader(); + String line; + while ((line = reader.readLine()) != null) { + requestBody.append(line); + } + } catch (IOException e) { + log.error("银盛修改费率回调结果:", e); + } + String requestBodyString = requestBody.toString(); + log.info("银盛修改费率回调结果 param:{}, body:{}",JSON.toJSONString(request.getParameterMap()),requestBodyString); + //费率回调 固定notifyType=5 status==00表示通过 + //{"notifyType":"5","change":{"note":"审核通过","changeSysFlowId":"CHG202404100018298"},"status":"00"} +// JSONObject bizContent = JSON.parseObject(JSON.parseObject(requestBodyString).get("bizContent").toString()); +// String string = bizContent.getString("status"); + response.setStatus(HttpServletResponse.SC_OK); + response.getWriter().write("success"); + } @PostMapping("feedCallBack") public String feedCallBack(HttpServletRequest request) throws Exception { log.info(JSON.toJSONString(request.getParameterMap())); - String type = request.getParameter("type"); + String type = request.getParameter("type"); //验签请参data String data = request.getParameter("data"); - //验签请参sign + //验签请参sign String sign = request.getParameter("sign"); - hfMerService.callBack(type,data,sign); + hfMerService.callBack(type, data, sign); return "SUCCESS"; } @PostMapping("testFeedCallBack") - public String feedCallBack(@RequestBody JSONObject object){ + public String feedCallBack(@RequestBody JSONObject object) { log.info(object.toJSONString()); String type = object.getString("type"); //验签请参data String data = object.getString("data"); //验签请参sign String sign = object.getString("sign"); - hfMerService.callBack(type.substring(1,type.length()-1),data.substring(1,data.length()-1),sign.substring(1,sign.length()-1)); + hfMerService.callBack(type.substring(1, type.length() - 1), data.substring(1, data.length() - 1), sign.substring(1, sign.length() - 1)); return "SUCCESS"; } @PostMapping("authUser") - public String authUser(@RequestParam("requestId") String requestId){ + public String authUser(@RequestParam("requestId") String requestId) { hfMerService.authInfo(requestId); return "SUCCESS"; } @PostMapping("merchantResident") - public String merchantResident(@RequestParam("userId") String userId){ - hfMerService.merchantResident(userId,null); + public String merchantResident(@RequestParam("userId") String userId) { + hfMerService.merchantResident(userId, null); return "SUCCESS"; } @PostMapping("createStore") - public String createStore(@RequestParam("userId") String userId){ + public String createStore(@RequestParam("userId") String userId) { hfMerService.createStore(userId); return "SUCCESS"; } @PostMapping("modifySettle") - public String modifySettle(@RequestParam("userId") String userId){ + public String modifySettle(@RequestParam("userId") String userId) { hfMerService.modifySettle(userId); return "SUCCESS"; } - } diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java index f2b4be9..b321244 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/interceptor/LoginInterceptor.java @@ -45,6 +45,7 @@ public class LoginInterceptor implements HandlerInterceptor { ||"/admin/notifyCallback/createStore".equals(requestURI) ||"/admin/notifyCallback/modifySettle".equals(requestURI) ||"/admin/promotion/merchantCode".equals(requestURI) + ||"/admin/notifyCallback/changeRateCallBack".equals(requestURI) ){ return true; } diff --git a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantInfoService.java b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantInfoService.java index 1e969fb..e9f7d48 100644 --- a/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantInfoService.java +++ b/newadmin/admin/src/main/java/com/chaozhanggui/admin/system/service/MerchantInfoService.java @@ -1,6 +1,8 @@ package com.chaozhanggui.admin.system.service; import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -462,4 +464,19 @@ public class MerchantInfoService { return new RespBody("000000"); } + public RespBody updateMerchantRate(String custId,Integer channel,String mercId){ + String s = merchantService.updateMerchantRate(custId, channel,mercId); + JSONObject jsonObject = JSON.parseObject(s); + RespBody result=new RespBody("000000"); + result.setData(jsonObject); + return result; + } + + public RespBody queryCustChange(String changeSysFlowId,Integer channel){ + String s = merchantService.queryCustChange(changeSysFlowId,channel); + JSONObject jsonObject = JSON.parseObject(s); + RespBody result=new RespBody("000000"); + result.setData(jsonObject); + return result; + } } diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelFeeMapper.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelFeeMapper.java index 3ba182c..6b22663 100644 --- a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelFeeMapper.java +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/dao/TbPlussMerchantChannelFeeMapper.java @@ -21,5 +21,7 @@ public interface TbPlussMerchantChannelFeeMapper { int updateByPrimaryKey(TbPlussMerchantChannelFee record); + void updateByMercIdAndChannel(TbPlussMerchantChannelFee record); + TbPlussMerchantChannelFee selectByChannelAndMerchantCode(@Param("channelId") Integer channelId,@Param("merchantCode") String merchantCode); } \ No newline at end of file diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateFeeDetail.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateFeeDetail.java new file mode 100644 index 0000000..f63b909 --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateFeeDetail.java @@ -0,0 +1,22 @@ +package com.chaozhanggui.dao.system.entity; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@AllArgsConstructor +public class RateFeeDetail { + private String rateType; + + private String rateFee; + + private String rateBottom; + + private String rateTop; + + public RateFeeDetail(String rateType, String rateFee, String rateBottom) { + this(rateType, rateFee, rateBottom, null); + } +} diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateFeeInfo.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateFeeInfo.java new file mode 100644 index 0000000..66179e1 --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateFeeInfo.java @@ -0,0 +1,21 @@ +package com.chaozhanggui.dao.system.entity; + + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class RateFeeInfo { + private RateFeeDetail wxPayFee; + + private RateFeeDetail aliPayFee; + + private RateFeeDetail bank1debitPayFee; + + private RateFeeDetail bank1creditPayFee; + + private RateFeeDetail bank2debitPayFee; + + private RateFeeDetail bank2creditPayFee; +} diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateInfo.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateInfo.java new file mode 100644 index 0000000..6ec621e --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateInfo.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.dao.system.entity; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +@Data +public class RateInfo { + + + private String contractType; + + private String notifyUrl; + + private RateFeeInfo codeScanT1Fee; + + private RateFeeDetail codeScanD0Fee; + + private String mercId; +} diff --git a/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateInfoD1.java b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateInfoD1.java new file mode 100644 index 0000000..ec912da --- /dev/null +++ b/newadmin/dao-api/src/main/java/com/chaozhanggui/dao/system/entity/RateInfoD1.java @@ -0,0 +1,18 @@ +package com.chaozhanggui.dao.system.entity; + +import lombok.Data; + +/** + * @author lyf + */ +@Data +public class RateInfoD1 { + + private String contractType; + + private String notifyUrl; + + private RateFeeInfo codeScanT1Fee; + + private String mercId; +} diff --git a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelFeeMapper.xml b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelFeeMapper.xml index da8b7ce..22dc399 100644 --- a/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelFeeMapper.xml +++ b/newadmin/dao-api/src/main/resources/mapper/TbPlussMerchantChannelFeeMapper.xml @@ -104,6 +104,15 @@ where id = #{id,jdbcType=INTEGER} + + update tb_pluss_merchant_channel_fee + set + fee_str = #{feeStr,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where merchant_code = #{merchantCode,jdbcType=VARCHAR} + AND channel = #{channel,jdbcType=VARCHAR} + +