From f1d0daee3b8fddf2378d5a09a4aa986537581798 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 17:35:05 +0800 Subject: [PATCH 1/7] // --- .../V2023031300001__upd_cardSpend.sql | 261 +++++++++++++++++- .../impl/WxRefundOrderServiceImpl.java | 7 + 2 files changed, 266 insertions(+), 2 deletions(-) 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/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java index 94570ff88..350d9fd6f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java @@ -1196,12 +1196,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{ From 287a68f2b95d5a0a1a7c2fc742834af18e413e9e Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 18:11:08 +0800 Subject: [PATCH 2/7] //card --- .../controller/WxRefundOrderController.java | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java index 78549e87b..a2e947a20 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,12 @@ public class WxRefundOrderController extends BaseController { @Autowired private WxRefundOrderService wxRefundOrderService; + @Autowired + private WxCardSpendService wxCardSpendService; + + @Autowired + private WxMerchantService wxMerchantService; + @ApiOperation(value = "退券退款", notes = "{\"couponOrderId\":\"string\"}") @PostMapping("/create") public ResultData create(@RequestBody Map paramMap) { @@ -94,4 +99,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("refundOrder",refundOrder); + WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId()); + map.put("merchant",merchant); + + return new ResultData(map); + } + + } From aef2f0ec38ad71561c75babde6c3b03a220d2a27 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 18:25:37 +0800 Subject: [PATCH 3/7] //card --- .../com/iformall/service/impl/WxRefundOrderServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) 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 350d9fd6f..cfe17506f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRefundOrderServiceImpl.java @@ -1227,6 +1227,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()); From dae9152259d93bdd6d9c7e6bcb722f7fd36cb7fd Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 18:27:16 +0800 Subject: [PATCH 4/7] //card --- .../market/WxRefundOrderController.java | 40 +++++++++++++++++++ .../controller/WxRefundOrderController.java | 31 -------------- 2 files changed, 40 insertions(+), 31 deletions(-) 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..50d1f8030 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("refundOrder",refundOrder); + WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId()); + map.put("merchant",merchant); + + return new ResultData(map); + } + + } diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java index a2e947a20..3df5a5a48 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxRefundOrderController.java @@ -38,11 +38,6 @@ public class WxRefundOrderController extends BaseController { @Autowired private WxRefundOrderService wxRefundOrderService; - @Autowired - private WxCardSpendService wxCardSpendService; - - @Autowired - private WxMerchantService wxMerchantService; @ApiOperation(value = "退券退款", notes = "{\"couponOrderId\":\"string\"}") @PostMapping("/create") @@ -99,30 +94,4 @@ 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("refundOrder",refundOrder); - WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId()); - map.put("merchant",merchant); - - return new ResultData(map); - } - - } From bbea176e370a864e4bad4ed277abfa910c3dce4f Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 18:35:15 +0800 Subject: [PATCH 5/7] //card --- .../com/iformall/controller/market/WxRefundOrderController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 50d1f8030..08b241db4 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxRefundOrderController.java @@ -113,7 +113,7 @@ public class WxRefundOrderController extends BaseController { if(cardSpend == null){ return new ResultData(ErrorCode.ORDER_IS_NOT_FIND.getCode(),"付款订单未找到"); } - map.put("refundOrder",refundOrder); + map.put("cardSpend",cardSpend); WxMerchant merchant = wxMerchantService.getById(cardSpend.getMerchantId()); map.put("merchant",merchant); From 4bd932305bd61932d23733d9a529bd04d3773bc5 Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 19:02:28 +0800 Subject: [PATCH 6/7] //card --- .../java/com/iformall/service/impl/WxRefundOrderServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 cfe17506f..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); From 75ad0d4380251682c70297d042938094e3679fdd Mon Sep 17 00:00:00 2001 From: xhxu Date: Wed, 15 Mar 2023 19:30:33 +0800 Subject: [PATCH 7/7] //card --- .../com/iformall/service/impl/WxCardSpendServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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