diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java index 5fd66d5a2..08b241db4 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java @@ -1,7 +1,12 @@ package com.iformall.controller.market; import com.iformall.annotation.SystemControllerLog; +import com.iformall.common.ErrorCode; import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.WxCardSpend; +import com.iformall.domain.po.WxMerchant; +import com.iformall.service.WxCardSpendService; +import com.iformall.service.WxMerchantService; import io.swagger.annotations.Api; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,6 +23,9 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import java.util.HashMap; +import java.util.Map; + @RestController @RequestMapping("/refund") @Api(description = "微信退款订单接口") @@ -27,6 +35,12 @@ public class WxRefundOrderController extends BaseController { @Autowired private WxRefundOrderService wxRefundOrderService; + @Autowired + private WxCardSpendService wxCardSpendService; + + @Autowired + private WxMerchantService wxMerchantService; + @ApiOperation("分页列表接口") @GetMapping("list") @@ -81,4 +95,30 @@ public class WxRefundOrderController extends BaseController { } + @ApiOperation("根据id查询接口") + @GetMapping("/findCardSendDetail") + @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) + public ResultData findCardSendDetail(Long id) { + if(id == null){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); + } + Map map = new HashMap<>(); + WxRefundOrder refundOrder = wxRefundOrderService.getById(id); + if(refundOrder == null){ + return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"退款订单未找到"); + } + map.put("refundOrder",refundOrder); + Long cardSpendId = Long.parseLong(refundOrder.getPayOrderNo()); + WxCardSpend cardSpend = wxCardSpendService.getById(cardSpendId); + if(cardSpend == null){ + return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"付款订单未找到"); + } + map.put("cardSpend",cardSpend); + WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId()); + map.put("merchant",merchant); + + return new ResultData(map); + } + + } diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023031300001__upd_cardSpend.sql b/mallinkAdmin/src/main/resources/db/migration/V2023031300001__upd_cardSpend.sql index ec5e2b84f..68bd3e086 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2023031300001__upd_cardSpend.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2023031300001__upd_cardSpend.sql @@ -7,6 +7,7 @@ ADD COLUMN `refund_status` smallint(2) NOT NULL DEFAULT 0 COMMENT '退款状态' ADD COLUMN `refund_remark` varchar(255) AFTER `refund_status`; + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, (select id from wx_flow_config where name = '营销审批' and tenant_id = '789') parent_id, @@ -54,5 +55,261 @@ select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, - (select id from wx_flow_config where name = '营销审批' and tenant_id = '1007') parent_id, - '1007' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; \ No newline at end of file + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1009') parent_id, + '1009' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1010') parent_id, + '1010' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1011') parent_id, + '1011' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1012') parent_id, + '1012' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1013') parent_id, + '1013' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1014') parent_id, + '1014' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1015') parent_id, + '1015' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1016') parent_id, + '1016' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1017') parent_id, + '1017' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1018') parent_id, + '1018' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1019') parent_id, + '1019' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1020') parent_id, + '1020' tenant_id,'1028' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1021') parent_id, + '1021' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1022') parent_id, + '1022' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1023') parent_id, + '1023' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1024') parent_id, + '1024' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1025') parent_id, + '1025' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1026') parent_id, + '1026' tenant_id,'1025' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1027') parent_id, + '1027' tenant_id,'1025' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1028') parent_id, + '1028' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1029') parent_id, + '1029' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1030') parent_id, + '1030' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1031') parent_id, + '1031' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1035') parent_id, + '1035' tenant_id,'1037' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1036') parent_id, + '1036' tenant_id,'1037' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1037') parent_id, + '1037' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1038') parent_id, + '1038' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1039') parent_id, + '1039' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1040') parent_id, + '1040' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1041') parent_id, + '1041' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1042') parent_id, + '1042' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1043') parent_id, + '1043' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1044') parent_id, + '1044' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1045') parent_id, + '1045' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1046') parent_id, + '1046' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1047') parent_id, + '1047' tenant_id,'1048' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1048') parent_id, + '1048' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1049') parent_id, + '1049' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + +INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1050') parent_id, + '1050' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1051') parent_id, + '1051' tenant_id,'1037' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1052') parent_id, + '1052' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1053') parent_id, + '1053' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1054') parent_id, + '1054' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1055') parent_id, + '1055' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1056') parent_id, + '1056' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1057') parent_id, + '1057' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1058') parent_id, + '1058' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1059') parent_id, + '1059' tenant_id,'1052' parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1060') parent_id, + '1060' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1061') parent_id, + '1061' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1062') parent_id, + '1062' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + + INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`,`parent_tenant_id`, `name`, `type`, `model_id`, `sort`) +select (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id, + (select id from wx_flow_config where name = '营销审批' and tenant_id = '1063') parent_id, + '1063' tenant_id,null parent_tenant_id, '消费卡退款审批' name, 31 type, 0 model_id, 10 sort from dual; + diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java index 78549e87b..3df5a5a48 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java @@ -9,9 +9,7 @@ import com.iformall.enums.EnumAppType; import com.iformall.enums.EnumPayType; import com.iformall.enums.EnumPayWay; import com.iformall.exception.MallinkException; -import com.iformall.service.WxAppinfoService; -import com.iformall.service.WxCouponOrderService; -import com.iformall.service.WxRefundOrderService; +import com.iformall.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -22,6 +20,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.HashMap; import java.util.Map; @RestController @@ -39,6 +38,7 @@ public class WxRefundOrderController extends BaseController { @Autowired private WxRefundOrderService wxRefundOrderService; + @ApiOperation(value = "退券退款", notes = "{\"couponOrderId\":\"string\"}") @PostMapping("/create") public ResultData create(@RequestBody Map paramMap) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java index 3ce8d395e..6f85d9ad7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java @@ -692,6 +692,14 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { record.setMerchantIdList(merchantIds); } } + if(EnumCardInfoType.CARD.equals(record.getCardType()) && record.getCardId() != null){ + WxCardInfo cardInfo = wxCardInfoService.getByCouponPasswordId(record.getCardId(), record); + if(cardInfo == null){ + record.setId(-999L); + }else{ + record.setCardId(cardInfo.getId()); + } + } } @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java index 94570ff88..0e14f7e07 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java @@ -1172,6 +1172,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { record.setRefundTimeStart(currentDate); record.setRefundOrderStatus(EnumRefundStatus.REFUND_WAIT.getCode()); record.setRefundVendor(wxOrder.getPayVendor()); + record.setRefundId("0");//卡退款没有退款订单-为空某些地方查询会有问题 // 退款订单 try { int sqlRow = wxRefundOrderMapper.insert(record); @@ -1196,12 +1197,19 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { logger.error("卡退款订单修改出错: " + cardSpendUpd.toString()); throw new MallinkException(ErrorCode.DB_FAIL); } + boolean hasAudit = hasWorkFlow(cardSend); if(hasAudit){ Map map = new HashMap(); map.put("businessId", String.valueOf(record.getId())); map.put("businessType", EnumFlowKey.CARD_ORDER_REFUND.getCode()); map.put("phone", bUser.getPhone()); + List variablesList = new ArrayList(); + Map tenantIdMap = new HashMap(); + tenantIdMap.put("key","tenantId"); + tenantIdMap.put("value",String.valueOf(cardSend.getTenantId())); + variablesList.add(tenantIdMap); + map.put("variables", variablesList); wxFlowService.start(map, bUser.getId(), bUser.getName(), bUser); return new ResultData(Result.SUCCESS,"提交审批成功"); }else{ @@ -1220,6 +1228,9 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { logger.error("付款订单未找到, e:"); throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); } + if(!DateUtils.isSameMonth(new Date(),cardSend.getCreateDate())){ + throw new MallinkException(ErrorCode.ORDER_PAY_REFUND_FAIL.getCode(), "只能退本月订单"); + } WxCardInfo cardInfo = wxCardInfoMapper.selectById(cardSend.getCardId()); if (cardInfo == null) { logger.error("card not found: " + cardSend.getCardId());