diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 5fc78c4..0a0cb2c 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -86,6 +86,51 @@ public class TestController { private BsStoreService storeService; @Resource private LaKaLaLedgerService laKaLaLedgerService; + @Resource + private LaKaLaTradeSeparateService laKaLaTradeSeparateService; + + @RequestMapping(value="/separate",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "separate") + public ResponseData separate(@RequestParam(value = "ProfitSharingOrderNo", required = true) String ProfitSharingOrderNo) { + try { + + return ResponseMsgUtil.success(laKaLaTradeSeparateService.separate(ProfitSharingOrderNo)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/separateQuery",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "separateQuery") + public ResponseData separateQuery(@RequestParam(value = "ProfitSharingOrderNo", required = true) String ProfitSharingOrderNo) { + try { + + return ResponseMsgUtil.success(laKaLaTradeSeparateService.query(ProfitSharingOrderNo)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryAmt",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "separateQuery") + public ResponseData separateQueryAmt(@RequestParam(value = "ProfitSharingOrderNo", required = true) String ProfitSharingOrderNo) { + try { + + return ResponseMsgUtil.success(laKaLaTradeSeparateService.queryAmt(ProfitSharingOrderNo)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/saas",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "saas") diff --git a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java index f04cbc9..d50d674 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java @@ -44,10 +44,10 @@ public class LaKaLaTradeSeparateService { // 交易分账 BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo); if (null == tradeOrderProfitSharing) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到交易分账记录"); } if (!tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "业务不处于待处理状态"); } // 查询交易详情 BsTradeOrder tradeOrder = tradeOrderService.getOrderByTradeNoId(tradeOrderProfitSharing.getTradeOrderId()); 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 40d05a6..1a06b2e 100644 --- a/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java +++ b/service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java @@ -209,12 +209,12 @@ public class LaKaLaTradeService { map.put("account_type", order.getPayMode()); map.put("trans_type", "51"); map.put("total_amount", order.getTradeActualAmount().multiply(new BigDecimal("100")).intValue()); + map.put("settle_type", order.getProfitSharingStatus()==true?1:0); if (StringUtils.isNotBlank(order.getSubject())) { map.put("subject", order.getSubject()); } else { map.put("subject", mer.getMerAbbreviate()); } - if (order.getCreateType() != null && order.getCreateType().equals(TradeOrderCreateTypeEnum.type3.getCode())) { map.put("notify_url", CommonSysConst.getSysConfig().getLkl_open_api_pay_notify_url()); } else { @@ -343,7 +343,7 @@ public class LaKaLaTradeService { if (order.getProfitSharingStatus().equals(true)) { // 查询分账记录 BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getProfitSharingByTradeOrderId(ProfitSharingCmdTypeEnum.CMD_TYPE_1, order.getId()); - if (tradeOrderProfitSharing != null) { + if (tradeOrderProfitSharing != null && tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status3.getNumber())) { laKaLaTradeSeparateService.cancel(tradeOrderProfitSharing.getProfitSharingOrderNo()); } } diff --git a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java index 8027388..76a8a2b 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java @@ -203,10 +203,8 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS surplusProfit = totalProfit; } else if (tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type3.getNumber())) { - // 平台交易成本价 - BigDecimal finalCostPrice = tradeOrder.getTradeActualAmount().multiply(tradeOrder.getStoreDiscountFinalCostPrice()).setScale(2, BigDecimal.ROUND_HALF_DOWN); // 实际交易金额 - 平台交易成本价 = 利润 - totalProfit = tradeOrder.getTradeActualAmount().subtract(finalCostPrice); + totalProfit = tradeOrder.getStoreDiscountProfitPrice(); // 剩余利润 surplusProfit = totalProfit; }