diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023090400001_wx_coupon_credit_price.sql b/mallinkAdmin/src/main/resources/db/migration/V2023090400001_wx_coupon_credit_price.sql new file mode 100644 index 000000000..ef6c6c67b --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2023090400001_wx_coupon_credit_price.sql @@ -0,0 +1,402 @@ +ALTER TABLE `mallink`.`wx_order_0` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_1` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_2` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_3` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_4` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_5` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_6` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_7` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_8` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_9` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_10` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_11` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_12` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_13` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_14` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_15` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_16` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_17` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_18` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_19` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_20` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_21` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_22` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_23` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_24` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_25` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_26` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_27` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_28` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_29` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_30` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_31` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_32` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_33` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_34` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_35` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_36` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_37` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_38` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_39` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_40` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_41` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_42` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_43` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_44` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_45` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_46` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_47` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_48` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_49` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_50` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_51` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_52` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_53` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_54` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_55` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_56` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_57` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_58` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_59` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_60` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_61` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_62` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_63` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_64` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_65` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_66` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_67` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_68` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_69` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_70` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_71` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_72` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_73` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_74` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_75` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_76` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_77` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_78` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_79` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_80` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_81` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_82` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_83` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_84` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_85` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_86` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_87` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_88` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_89` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_90` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_91` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_92` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_93` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_94` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_95` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_96` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_97` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_98` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; +ALTER TABLE `mallink`.`wx_order_99` +ADD COLUMN `credit_price` int(11) NOT NULL DEFAULT 0 AFTER `payment`; + + +ALTER TABLE `mallink`.`wx_coupon_order_0` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_1` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_2` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_3` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_4` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_5` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_6` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_7` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_8` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_9` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_10` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_11` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_12` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_13` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_14` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_15` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_16` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_17` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_18` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_19` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_20` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_21` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_22` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_23` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_24` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_25` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_26` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_27` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_28` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_29` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_30` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_31` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_32` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_33` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_34` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_35` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_36` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_37` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_38` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_39` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_40` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_41` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_42` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_43` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_44` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_45` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_46` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_47` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_48` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_49` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_50` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_51` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_52` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_53` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_54` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_55` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_56` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_57` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_58` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_59` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_60` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_61` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_62` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_63` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_64` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_65` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_66` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_67` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_68` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_69` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_70` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_71` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_72` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_73` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_74` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_75` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_76` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_77` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_78` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_79` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_80` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_81` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_82` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_83` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_84` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_85` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_86` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_87` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_88` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_89` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_90` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_91` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_92` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_93` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_94` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_95` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_96` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_97` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_98` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; +ALTER TABLE `mallink`.`wx_coupon_order_99` +ADD COLUMN `coupon_credit_price` int(11) NOT NULL DEFAULT 0 AFTER `coupon_price`; \ No newline at end of file diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java index c91dfdc66..63d395274 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderExpiringSchedule.java @@ -166,6 +166,9 @@ public class CouponOrderExpiringSchedule { //券包子券没有库存 if(order != null && order.getParentOrderId() == 0l) { wxOrderService.stockBack(order); + + //积分退回 + wxOrderService.creditPayRefund(order); } } } @@ -239,6 +242,9 @@ public class CouponOrderExpiringSchedule { WxOrder order = wxOrderMapper.selectById(co.getOrderId(),co.getTenantId()); if(order != null) { wxOrderService.stockBack(order); + + //积分退回 + wxOrderService.creditPayRefund(order); } } } diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java index 282d50705..57936603c 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/OrderExpiringSchedule.java @@ -348,6 +348,9 @@ public class OrderExpiringSchedule { // 库存退回 wxOrderService.stockBack(order); + //积分退回 + wxOrderService.creditPayRefund(order); + // 微信 关单,批量的订单关单有问题 //wxOrderService.orderClose(order,payWay); diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index 6524874f1..5e9b6651a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java @@ -488,6 +488,13 @@ public class WxCoupon extends TenantEntity { return false; } + public boolean checkIsNeedCredit() { + if(creditPrice != null && creditPrice > 0) { + return true; + } + return false; + } + public boolean checkIsCard() { if(type == null) { return false; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java index 03211c35d..4454f0e5d 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java @@ -64,6 +64,8 @@ public class WxCouponOrder extends TenantEntity { private Date updateDate; @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") private Integer couponPrice; + @io.swagger.annotations.ApiModelProperty(value = "单券实际购买积分价格", name = "couponCreditPrice") + private Integer couponCreditPrice; @io.swagger.annotations.ApiModelProperty(value = "支付渠道EnumPayWay", name = "payVendor") private Integer payVendor; @io.swagger.annotations.ApiModelProperty(value = "支付渠道版本EnumPayVersion", name = "payVersion") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java b/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java index 4d0858f47..7534ba06f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java @@ -69,6 +69,9 @@ public class WxOrder extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") private Integer payment; + @io.swagger.annotations.ApiModelProperty(value="支付积分。",name="creditPrice") + private Integer creditPrice; + @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") private Date paymentTime; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java index bef1c8c2a..b0a72dab8 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderCouponVo.java @@ -49,6 +49,8 @@ public class WxOrderCouponVo extends TenantEntity { private Integer paymentType; @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") private Integer payment; + @io.swagger.annotations.ApiModelProperty(value="支付积分。",name="creditPrice") + private Integer creditPrice; @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") private Date paymentTime; @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败",name="orderStatus") @@ -233,6 +235,7 @@ public class WxOrderCouponVo extends TenantEntity { this.productId = o.getProductId(); this.paymentType = o.getPaymentType(); this.payment = o.getPayment(); + this.creditPrice = o.getCreditPrice(); this.paymentTime = o.getPaymentTime(); this.orderStatus = o.getOrderStatus(); this.createDate = o.getCreateDate(); diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayExpVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayExpVo.java index 83bc1c091..a1b54c926 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayExpVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayExpVo.java @@ -93,6 +93,7 @@ public class WxOrderPayExpVo extends WxOrder { this.setPaymentType(o.getPaymentType()); this.setMakeMerchantId(o.getMakeMerchantId()); this.setPayment(o.getPayment()); + this.setCreditPrice(o.getCreditPrice()); this.setPaymentTime(o.getPaymentTime()); this.setFreightPrice(o.getFreightPrice()); this.setOrderStatus(o.getOrderStatus()); diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayVo.java index a576da0c0..7c322a783 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxOrderPayVo.java @@ -115,6 +115,7 @@ public class WxOrderPayVo extends WxOrder { this.setPaymentType(o.getPaymentType()); this.setMakeMerchantId(o.getMakeMerchantId()); this.setPayment(o.getPayment()); + this.setCreditPrice(o.getCreditPrice()); this.setPaymentTime(o.getPaymentTime()); this.setFreightPrice(o.getFreightPrice()); this.setOrderStatus(o.getOrderStatus()); diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java index 9b5b108ba..0658f155b 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java @@ -233,6 +233,8 @@ public interface WxOrderService { boolean isPressOrder,Long orderGroupId,String formId,Integer shippinType,UserBasicInfoAddress address,String extParam,WxCouponChannel couponChannel, EnumPayWay payWay,EnumPayVersion payVersion); + void creditPayRefund(WxOrder order); + /** * 下订单成功后处理 * @param updateOrder diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java index 714c5d3c5..f2fee0811 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -1502,6 +1502,7 @@ public class WxOrderServiceImpl implements WxOrderService { couponOrder.setCreateDateTimes(curr.getTime()); couponOrder.setUpdateDate(curr); couponOrder.setCouponPrice(order.getPayment()); + couponOrder.setCouponCreditPrice(order.getCreditPrice()); wxCouponOrderMapper.insert(couponOrder); } @@ -1674,6 +1675,7 @@ public class WxOrderServiceImpl implements WxOrderService { couponOrder.setCreateDateTimes(curr.getTime()); couponOrder.setUpdateDate(curr); couponOrder.setCouponPrice(order.getPayment()); + couponOrder.setCouponCreditPrice(order.getCreditPrice()); couponOrder.setComposeOrderType(order.getComposeOrderType()); couponOrder.setComposeOrderId(order.getComposeOrderId()); @@ -3191,12 +3193,14 @@ public class WxOrderServiceImpl implements WxOrderService { // 当积分券或者积分停车券时 则进行积分支付 Integer orderType; if (coupon.checkIsCreditCoupon()) { - proxy.creditPay(user, coupon); orderType = EnumOrderType.CREDIT.getCode(); } else { orderType = EnumOrderType.COUPON.getCode(); } - + //扣除积分 + if(coupon.checkIsNeedCredit()){ + proxy.creditPay(user, coupon); + } // 4. 保存Order WxOrder record = new WxOrder(); @@ -3209,6 +3213,7 @@ public class WxOrderServiceImpl implements WxOrderService { record.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); record.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); record.setPayment(0); + record.setCreditPrice(coupon.getCreditPrice()); record.setFormId(formId); record.setOrderGroupId(0L); record.setExtParam(extParam); @@ -3250,11 +3255,13 @@ public class WxOrderServiceImpl implements WxOrderService { // 3. 当积分券或者积分停车券时 则进行积分支付 Integer orderType; if (coupon.checkIsCreditCoupon()) { - proxy.creditPay(user, coupon); orderType = EnumOrderType.CREDIT.getCode(); } else { orderType = EnumOrderType.COUPON.getCode(); } + if(coupon.checkIsNeedCredit()){ + proxy.creditPay(user, coupon); + } //扣库存的时候价格是什么样的,如果此时有变化,则不让继续。渠道的库存和价格可以随时修改。这里需要校验一下 if (stockReduceResult.isChannelStockReduce()) { @@ -3289,6 +3296,7 @@ public class WxOrderServiceImpl implements WxOrderService { record.setOrderGroupId(orderGroupId); record.setFormId(formId); record.setPayment(price.getRealPayMent()); + record.setCreditPrice(coupon.getCreditPrice()); record.setShippingType(shippinType); if(EnumOrderShopingType.DISTRIBUTION.getCode().equals(shippinType)){ record.setFreightPrice(coupon.getFreightPrice()); @@ -3324,7 +3332,7 @@ public class WxOrderServiceImpl implements WxOrderService { } return record; } - + @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public Long saveOuterOrderForCoupon(WxCUserBasicInfo user, WxCoupon coupon, Long couponChannelId, String formId, Long couponPasswordId) { @@ -3335,7 +3343,7 @@ public class WxOrderServiceImpl implements WxOrderService { throw new MallinkException(ErrorCode.COUPON_CHANNEL_IS_TAKE_OFF.getCode(),"投放渠道不存在"); } userCouponMerchantCheck(user, coupon,wxCouponChannel,"此券"); - if (coupon.checkIsCreditCoupon()) { + if (coupon.checkIsNeedCredit()) { //若用户剩余积分比积分售价低则不能支付 if (user.getCredit() == null || user.getCredit() < coupon.getCreditPrice()) { throw new MallinkException(ErrorCode.CREDIT_NOT_ENOUGH); @@ -3347,11 +3355,13 @@ public class WxOrderServiceImpl implements WxOrderService { // 3. 当积分券或者积分停车券时 则进行积分支付 Integer orderType; if (coupon.checkIsCreditCoupon()) { - creditPay(user, coupon); orderType = EnumOrderType.CREDIT.getCode(); } else { orderType = EnumOrderType.COUPON.getCode(); } + if(coupon.checkIsNeedCredit()){ + creditPay(user, coupon); + } // 4. 保存Order WxOrder record = new WxOrder(); @@ -3362,6 +3372,7 @@ public class WxOrderServiceImpl implements WxOrderService { record.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); record.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); record.setPayment(0); + record.setCreditPrice(coupon.getCreditPrice()); record.setFormId(formId); record.setOrderGroupId(0L); record.setComposeOrderId(0L); @@ -3470,6 +3481,28 @@ public class WxOrderServiceImpl implements WxOrderService { wxCreditHistoryService.saveOrUpdate(creditHistory,coupon); } + @Override + @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) + public void creditPayRefund(WxOrder order) { + if(order.getCreditPrice() == null || order.getCreditPrice() == 0){ + return; + } +//-------此处为【积分支付】退款记录增加积分操作------- + WxCreditHistory creditHistory = new WxCreditHistory(); + creditHistory.setCreditNum(order.getCreditPrice()); + creditHistory.setCUserId(order.getCUserId()); +// creditHistory.updateTenantInfo(coupon); + creditHistory.setTenantId(order.getFinalTenantId()); + creditHistory.setFinalTenantId(order.getFinalTenantId()); + creditHistory.setCreditType(EnumScoreType.REFUND_REDUCE_CREDIT.getCode()); + + //记录操作人类型 操作人id + creditHistory.setOperatorType(EnumUserType.CUSERBASIC.getCode()); + creditHistory.setOperatorId(order.getCUserId()); + creditHistory.setChangePurpose("积分兑换退款"+"[订单号:"+order.getId()+"]"); + + wxCreditHistoryService.saveOrUpdate(creditHistory,order); + } /** @@ -4029,7 +4062,7 @@ public class WxOrderServiceImpl implements WxOrderService { couponUserCheck(wxCUserBasicInfo, coupon,premsg); userCouponMerchantCheck(wxCUserBasicInfo, coupon,wxCouponChannel,premsg); - if (coupon.checkIsCreditCoupon()) { + if (coupon.checkIsNeedCredit()) { //若用户剩余积分比积分售价低则不能支付 if (wxCUserBasicInfo.getCredit() == null || wxCUserBasicInfo.getCredit() < coupon.getCreditPrice()) { throw new MallinkException(ErrorCode.CREDIT_NOT_ENOUGH.getCode(), premsg+"积分不够扣减值"); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java index 8820c6dce..3bca5f379 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java @@ -307,7 +307,6 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { wxCUserBasicInfo.setPoins(newScore); wxCUserBasicInfoMapper.updateScore(wxCUserBasicInfo); - } diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index 0fb95b902..3920e10f6 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -20,6 +20,7 @@ + @@ -41,7 +42,7 @@ - `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_type`,`c_user_id`,`owner_id`,`b_user_id`,`b_merchant_id`,`b_tenant_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`, `auto_refund`, + `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_type`,`c_user_id`,`owner_id`,`b_user_id`,`b_merchant_id`,`b_tenant_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`,`coupon_credit_price`, `auto_refund`, `verify_type`,`verify_remark`,`pay_vendor`,`pay_version`,`send_merchant_id`,`send_merchant_user_id`,`compose_order_type`,`compose_order_id`,`parent_coupon_order_id`,`coupon_number`, `freight_price`,`shipping_type`,`shipping_address`,`shipping_status`,`delivery_info`,`subsidy`,`ext_param` @@ -183,7 +184,7 @@ select co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id,co.order_id,co.expired_time, - co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark,co.pay_vendor,co.pay_version, + co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.coupon_credit_price,co.verify_type,co.verify_remark,co.pay_vendor,co.pay_version, co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.ext_param from wx_coupon_order co where co.tenant_id = #{tenantId} @@ -736,7 +737,7 @@ select co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id, - co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark, co.pay_vendor,co.pay_version, + co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.coupon_credit_price,co.verify_type,co.verify_remark, co.pay_vendor,co.pay_version, co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.subsidy,co.ext_param FROM wx_coupon_order co where co.id = #{id} and co.tenant_id = #{tenantId} @@ -834,7 +835,7 @@ select co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id, - co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark,co.pay_vendor,co.pay_version, + co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.coupon_credit_price,co.verify_type,co.verify_remark,co.pay_vendor,co.pay_version, co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.ext_param from wx_coupon_order co where co.tenant_id = #{tenantId} @@ -920,7 +921,7 @@ select - co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark,co.pay_vendor, + co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.coupon_credit_price,co.verify_type,co.verify_remark,co.pay_vendor, co.pay_version,co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.ext_param from wx_coupon_order co where co.c_user_id = #{cUserId} and co.`tenant_id` = #{tenantId} @@ -978,7 +979,7 @@ select - co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.verify_type,co.verify_remark,co.pay_vendor, + co.id,co.tenant_id,co.parent_tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.b_merchant_id,co.b_tenant_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price,co.coupon_credit_price,co.verify_type,co.verify_remark,co.pay_vendor, co.pay_version,co.`freight_price`,co.`shipping_type`,co.`shipping_address`,co.`shipping_status`,co.`delivery_info`,co.ext_param from wx_coupon_order co where co.c_user_id = #{cUserId} @@ -1014,7 +1015,7 @@ select - o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.product_name,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, + o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.product_name,o.payment_type,o.payment,o.credit_price,o.payment_time,o.order_status,o.create_date,o.update_date, o.compose_order_type,o.compose_order_id,o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,o.parent_order_id,o.ext_param,o.from_id from wx_order o @@ -377,7 +378,7 @@