提交代码

yy_dev
胡锐 2 years ago
parent df34abef57
commit 3ad6d027dc
  1. 45
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 6
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java
  3. 3
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
  4. 4
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java

@ -86,6 +86,51 @@ public class TestController {
private BsStoreService storeService; private BsStoreService storeService;
@Resource @Resource
private LaKaLaLedgerService laKaLaLedgerService; 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) @RequestMapping(value="/saas",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "saas") @ApiOperation(value = "saas")

@ -44,10 +44,10 @@ public class LaKaLaTradeSeparateService {
// 交易分账 // 交易分账
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo); BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo);
if (null == tradeOrderProfitSharing) { 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())) { 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()); BsTradeOrder tradeOrder = tradeOrderService.getOrderByTradeNoId(tradeOrderProfitSharing.getTradeOrderId());
@ -92,7 +92,7 @@ public class LaKaLaTradeSeparateService {
System.out.println("response:" + responseBody.toJSONString()); System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("code").equals("SACS0000")) { if (!responseBody.getString("code").equals("SACS0000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("msg"));
} }
JSONObject respData = responseBody.getJSONObject("resp_data"); JSONObject respData = responseBody.getJSONObject("resp_data");

@ -211,6 +211,7 @@ public class LaKaLaTradeService {
map.put("total_amount", order.getTradeActualAmount().multiply(new BigDecimal("100")).intValue()); map.put("total_amount", order.getTradeActualAmount().multiply(new BigDecimal("100")).intValue());
map.put("subject", mer.getMerAbbreviate()); map.put("subject", mer.getMerAbbreviate());
map.put("notify_url", CommonSysConst.getSysConfig().getLkl_micro_pay_ret_url()); map.put("notify_url", CommonSysConst.getSysConfig().getLkl_micro_pay_ret_url());
map.put("settle_type", order.getProfitSharingStatus()==true?1:0);
Map<String, Object> locationInfo = new HashMap<>(); Map<String, Object> locationInfo = new HashMap<>();
locationInfo.put("request_ip", "0.0.0.0"); locationInfo.put("request_ip", "0.0.0.0");
@ -328,7 +329,7 @@ public class LaKaLaTradeService {
if (order.getProfitSharingStatus().equals(true)) { if (order.getProfitSharingStatus().equals(true)) {
// 查询分账记录 // 查询分账记录
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getProfitSharingByTradeOrderId(ProfitSharingCmdTypeEnum.CMD_TYPE_1, order.getId()); 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()); laKaLaTradeSeparateService.cancel(tradeOrderProfitSharing.getProfitSharingOrderNo());
} }
} }

@ -203,10 +203,8 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
surplusProfit = totalProfit; surplusProfit = totalProfit;
} else if (tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type3.getNumber())) { } 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; surplusProfit = totalProfit;
} }

Loading…
Cancel
Save