diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java index 0d47f9372..3dbcf3d59 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java @@ -121,6 +121,13 @@ public class WxCouponController extends BaseController { EnumCouponType.COUPON_PREORDER.getCode()}; wxCoupon.setTypes(Arrays.asList(typeArray)); + + Integer[] sendTypeArray = { + EnumCouponSendType.ACTIVE.getCode(), + EnumCouponSendType.PASSIVE.getCode(),}; + + wxCoupon.setSendTypes(Arrays.asList(sendTypeArray)); + if(StringUtils.isNotBlank(wxCoupon.getSortColumn())){ String coryColumn = "c."+wxCoupon.getSortColumns(); wxCoupon.setSortColumns(coryColumn); diff --git a/mallinkAdmin/src/main/resources/db/migration/V2021101200001__order.sql b/mallinkAdmin/src/main/resources/db/migration/V2021101200001__order.sql new file mode 100644 index 000000000..5d673f4e7 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V2021101200001__order.sql @@ -0,0 +1,201 @@ +ALTER TABLE wx_order_0 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_1 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_2 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_3 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_4 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_5 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_6 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_7 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_8 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_9 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_10 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_11 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_12 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_13 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_14 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_15 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_16 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_17 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_18 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_19 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_20 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_21 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_22 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_23 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_24 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_25 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_26 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_27 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_28 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_29 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_30 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_31 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_32 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_33 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_34 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_35 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_36 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_37 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_38 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_39 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_40 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_41 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_42 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_43 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_44 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_45 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_46 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_47 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_48 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_49 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_50 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_51 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_52 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_53 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_54 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_55 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_56 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_57 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_58 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_59 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_60 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_61 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_62 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_63 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_64 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_65 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_66 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_67 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_68 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_69 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_70 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_71 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_72 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_73 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_74 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_75 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_76 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_77 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_78 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_79 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_80 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_81 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_82 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_83 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_84 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_85 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_86 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_87 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_88 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_89 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_90 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_91 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_92 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_93 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_94 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_95 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_96 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_97 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_98 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_order_99 ADD COLUMN `parent_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; + +ALTER TABLE wx_coupon_order_0 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_1 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_2 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_3 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_4 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_5 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_6 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_7 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_8 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_9 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_10 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_11 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_12 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_13 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_14 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_15 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_16 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_17 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_18 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_19 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_20 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_21 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_22 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_23 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_24 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_25 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_26 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_27 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_28 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_29 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_30 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_31 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_32 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_33 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_34 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_35 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_36 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_37 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_38 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_39 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_40 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_41 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_42 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_43 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_44 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_45 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_46 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_47 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_48 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_49 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_50 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_51 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_52 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_53 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_54 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_55 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_56 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_57 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_58 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_59 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_60 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_61 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_62 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_63 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_64 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_65 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_66 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_67 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_68 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_69 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_70 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_71 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_72 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_73 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_74 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_75 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_76 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_77 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_78 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_79 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_80 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_81 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_82 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_83 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_84 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_85 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_86 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_87 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_88 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_89 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_90 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_91 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_92 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_93 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_94 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_95 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_96 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_97 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_98 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; +ALTER TABLE wx_coupon_order_99 ADD COLUMN `parent_coupon_order_id` bigint(20) not null default 0 COMMENT '父订单编号'; 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 7ab4c659e..fc90fa0e9 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCouponOrder.java @@ -61,7 +61,10 @@ public class WxCouponOrder extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") private Integer composeOrderType; @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="composeOrderId") - private Long composeOrderId; + private Long composeOrderId; + + @io.swagger.annotations.ApiModelProperty(value="父订单编号",name="parentCouponOrderId") + private Long parentCouponOrderId; @io.swagger.annotations.ApiModelProperty(value="商品数量",name="couponNumber") private Integer couponNumber; 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 f7f4a0971..a67638368 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxOrder.java @@ -104,6 +104,10 @@ public class WxOrder extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") private Integer composeOrderType; + @io.swagger.annotations.ApiModelProperty(value="父订单编号",name="parentOrderId") + private Long parentOrderId; + + @TableField(exist = false) diff --git a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java index 2c0b459ac..8457fb8de 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxOrderService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxOrderService.java @@ -86,6 +86,13 @@ public interface WxOrderService { */ WxCouponOrder sendFreeCouponToUser(Long userId,TenantEntity tenantinfo,Long couponId, WxCouponSendVo wxCouponSendVo,EnumPayWay payWay,Long merchantId,Long bUserId); + /** + * 发券包子券 + * @param couponOrder + * @param couponIds + */ + void sendSubCouponToUser(WxCouponOrder couponOrder, List couponIds); + /** * orderSuccess 订单已支付 * @param updateOrder @@ -245,4 +252,5 @@ public interface WxOrderService { ResultData composeSaveOrder(boolean allowUnPayOrder,EnumComposeOrder composeOrderType,List composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); PageInfo listGoodsCAsPage(WxOrder wxOrder, Integer pageNum, Integer pageSize); + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java index 2a7bbb2bb..e3f2c40c6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java @@ -397,17 +397,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { logger.error("券: coupon-" + wxCoupon.getId() + "不存在" + "couponOrder-" + couponOrder.getId()); throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL); } - - // 2. 检查适用门店 - WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); - wxCouponMerchant.setProductId(wxCoupon.getId()); - wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); - List couponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant); - if (!couponMerchantList.stream().anyMatch(cm -> cm.getMerchantId().equals(bUser.getMerchantId()))) { - logger.error("券: coupon-" + wxCoupon.getId() + "核销: couponMerchantId-" + bUser.getMerchantId()); - throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); - } - // 3. 券包状态检查 if (couponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode()) { logger.error("已过期: couponOrder-" + couponOrder.getId()); @@ -425,6 +414,20 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { logger.error("券已被预核销: couponOrder-" + couponOrder.getId()); throw new MallinkException(ErrorCode.COUPON_ORDER_IS_PRE_VERIFY); } + if(EnumCouponType.COUPON_GIFT.getCode().equals(wxCoupon.getType())){ + logger.error("券为礼包卷: couponOrder-" + couponOrder.getId() ); + throw new MallinkException(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); + } + + // 2. 检查适用门店 + WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); + wxCouponMerchant.setProductId(wxCoupon.getId()); + wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); + List couponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant); + if (!couponMerchantList.stream().anyMatch(cm -> cm.getMerchantId().equals(bUser.getMerchantId()))) { + logger.error("券: coupon-" + wxCoupon.getId() + "核销: couponMerchantId-" + bUser.getMerchantId()); + throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); + } //如果开启了分账,就必须要配置分账账号 WxAppinfo appInfo = getAppinfo(couponOrder,couponOrder.getPayVendor()); @@ -490,21 +493,6 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { logger.error("券: coupon-" + wxCoupon.getId() + "不存在" + "couponOrder-" + couponOrder.getId()); throw new MallinkException(ErrorCode.COUPON_ORDER_IS_NULL); } - - // 2. 检查适用门店(自主核销有且只有一个门店) - WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); - wxCouponMerchant.setProductId(wxCoupon.getId()); - wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); - WxCouponMerchant cm = null; - try{ - cm = wxCouponMerchantMapper.selectOne(new QueryWrapper<>(wxCouponMerchant)); - }catch (Exception e){ - throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); - } - if(cm == null){ - throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); - } - // 3. 券包状态检查 if (couponOrder.getCouponOrderStatus() == EnumCouponOrderStatus.COUPON_ORDER_OVER_TIME.getCode()) { logger.error("已过期: couponOrder-" + couponOrder.getId()); @@ -522,6 +510,24 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { logger.error("券已被预核销: couponOrder-" + couponOrder.getId()); throw new MallinkException(ErrorCode.COUPON_ORDER_IS_PRE_VERIFY); } + if(!EnumCouponType.COUPON_DISTRIBUTION.getCode().equals(wxCoupon.getType())){ + logger.error("券类型不支持: couponOrder-" + couponOrder.getId() +"类型:" + wxCoupon.getType()); + throw new MallinkException(ErrorCode.COUPON_ORDER_TYPE_NOT_SUPPORTED); + } + + // 2. 检查适用门店(自主核销有且只有一个门店) + WxCouponMerchant wxCouponMerchant = new WxCouponMerchant(); + wxCouponMerchant.setProductId(wxCoupon.getId()); + wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode()); + WxCouponMerchant cm = null; + try{ + cm = wxCouponMerchantMapper.selectOne(new QueryWrapper<>(wxCouponMerchant)); + }catch (Exception e){ + throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); + } + if(cm == null){ + throw new MallinkException(ErrorCode.VERIFY_COUPON_ORDER_MERCHANT_IS_NULL); + } //如果开启了分账,就必须要配置分账账号 WxAppinfo appInfo = getAppinfo(couponOrder,couponOrder.getPayVendor()); 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 410ba58b0..09af77bbc 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java @@ -986,7 +986,7 @@ public class WxOrderServiceImpl implements WxOrderService { * @param coupon */ @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) - public WxCouponOrder createCouponOrder(WxOrder order, WxCUserBasicInfo user, WxCoupon coupon, Long couponPasswordId,EnumPayWay payWay,Long merchantId,Long bUserId) { + public WxCouponOrder createCouponOrder(WxOrder order, WxCUserBasicInfo user, WxCoupon coupon, Long couponPasswordId,EnumPayWay payWay,Long merchantId,Long bUserId,Long parentCouponOrderId) { Date curr = new Date(); Date valid_date = null; int limit_days = Constant.WX_LIMIT_DAYS; @@ -1065,7 +1065,7 @@ public class WxOrderServiceImpl implements WxOrderService { couponOrder.setCUserId(user.getId()); couponOrder.setOwnerId(user.getId()); couponOrder.setAutoRefund(coupon.getAutoRefund()); - couponOrder.setOrderId(order.getOrderNumber()); + couponOrder.setOrderId(order.getId()); couponOrder.setExpiredTime(valid_date); if (null != merchantId) { couponOrder.setSendMerchantId(merchantId); @@ -1077,6 +1077,8 @@ public class WxOrderServiceImpl implements WxOrderService { couponOrder.setComposeOrderId(order.getComposeOrderId()); couponOrder.setCouponNumber(order.getCouponNumber()); + couponOrder.setParentCouponOrderId(parentCouponOrderId); + couponOrder.setFreightPrice(order.getFreightPrice()); couponOrder.setShippingType(order.getShippingType()); couponOrder.setShippingAddress(order.getShippingAddress()); @@ -1205,7 +1207,7 @@ public class WxOrderServiceImpl implements WxOrderService { couponOrder.setCUserId(user.getId()); couponOrder.setOwnerId(user.getId()); couponOrder.setAutoRefund(coupon.getAutoRefund()); - couponOrder.setOrderId(order.getOrderNumber()); + couponOrder.setOrderId(order.getId()); couponOrder.setExpiredTime(valid_date); if (!isCard) { couponOrder.setCouponOrderStatus(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode()); @@ -1298,25 +1300,19 @@ public class WxOrderServiceImpl implements WxOrderService { throw new MallinkException(ErrorCode.COUPON_IS_NOT_FREE.getCode(), coupon.getTitle() + ErrorCode.COUPON_IS_NOT_FREE.getMessage()); } - Integer composeOrderType = EnumComposeOrder.SINGLE.getCode(); - if(EnumPayWay.PAY_WAY_NOT_UNPAY_GIFTLIST.equals(payWay)){ - composeOrderType = EnumComposeOrder.PACKAGECOUPON.getCode(); - }else{ - composeOrderType = EnumComposeOrder.SINGLE.getCode(); - if (Objects.nonNull(wxCouponSendVo) && Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), wxCouponSendVo.getSendType())) { - // 商户注券减库存操作 - try { - stockMerchantReduce(user, coupon, couponIdStr, wxCouponSendVo); - }catch(Exception e) { - throw new MallinkException(ErrorCode.COUPON_STOCK_ERR.getCode(), e.getMessage()); - } - } else { - // 减库存操作 - try { - stockReduce(false,user, coupon, couponIdStr,1); - }catch(Exception e) { - throw new MallinkException(ErrorCode.COUPON_STOCK_ERR.getCode(), e.getMessage()); - } + if (Objects.nonNull(wxCouponSendVo) && Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), wxCouponSendVo.getSendType())) { + // 商户注券减库存操作 + try { + stockMerchantReduce(user, coupon, couponIdStr, wxCouponSendVo); + }catch(Exception e) { + throw new MallinkException(ErrorCode.COUPON_STOCK_ERR.getCode(), e.getMessage()); + } + } else { + // 减库存操作 + try { + stockReduce(false,user, coupon, couponIdStr,1); + }catch(Exception e) { + throw new MallinkException(ErrorCode.COUPON_STOCK_ERR.getCode(), e.getMessage()); } } @@ -1345,7 +1341,7 @@ public class WxOrderServiceImpl implements WxOrderService { record.setCreateDate(curr); record.setUpdateDate(curr); record.setComposeOrderId(0L); - record.setComposeOrderType(composeOrderType); + record.setComposeOrderType(EnumComposeOrder.SINGLE.getCode()); record.setCouponNumber(1); // 保存订单 try { @@ -1358,7 +1354,7 @@ public class WxOrderServiceImpl implements WxOrderService { // 创建couponOrder WxCouponOrder couponOrder = null; try { - couponOrder = createCouponOrder(record, user, coupon, null,payWay,merchantId,bUserId); + couponOrder = createCouponOrder(record, user, coupon, null,payWay,merchantId,bUserId,null); } catch (Exception e) { logger.error("保存订单:" + e.getMessage()); throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(), coupon.getTitle() + ErrorCode.COUPON_ORDER_SAVE_ERR.getMessage()); @@ -1367,6 +1363,80 @@ public class WxOrderServiceImpl implements WxOrderService { return couponOrder; } + @Override + @Transactional(propagation = Propagation.NESTED, readOnly = false, rollbackFor = {Exception.class}) + public void sendSubCouponToUser(WxCouponOrder couponOrder, List couponIds) { + // check 用户状态 + WxCUserBasicInfo user = null; + try { + user = wxCUserBasicInfoMapper.selectById(couponOrder.getcUserId(),couponOrder.getFinalTenantId()); + } catch (Exception e) { + logger.error("userId : " + couponOrder.getcUserId() + ", e: " + e.getMessage(),e); + } + if (user == null) { + logger.error("用户不存在, userId: " + couponOrder.getcUserId()); + throw new MallinkException(ErrorCode.USER_IS_EMPTY); + } + for (Long couponId:couponIds) { + WxCoupon coupon = wxCouponMapper.selectById(couponId,couponOrder.getTenantId()); + if (coupon == null) { + logger.error("券不存在, couponId: " + couponId); + throw new MallinkException(ErrorCode.COUPON_IS_EMPTY); + } + if (coupon.getStatus() == EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode()) { + logger.error("券已下架, couponId: " + couponId); + throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF.getCode(), coupon.getTitle() + ErrorCode.COUPON_IS_TAKE_OFF.getMessage()); + } + if (coupon.getSendType() != 3 || coupon.getSalePrice() != 0) { + logger.error("券 sendType 错误, couponId: " + couponId); + throw new MallinkException(ErrorCode.COUPON_VALID_NOT_SUPPORTED.getCode(), coupon.getTitle() + ErrorCode.COUPON_IS_NOT_FREE.getMessage()); + } + + Date curr = new Date(); + + final IdWorker idWorker = IdWorker.get(); + Long orderNumber = idWorker.nextId(); + + // body + // tenant_id + merchant_id + title + subtitle + String bodyStr = coupon.getTitle() + "/" + coupon.getSubTitle(); + + WxOrder record = new WxOrder(); + record.setId(orderNumber); + record.updateTenantInfo(coupon); + record.setOrderNumber(orderNumber); + record.setProductId(couponId); + record.setType(EnumOrderType.COUPON.getCode()); + record.setCUserId(user.getId()); + record.setPaymentType(EnumPayType.PAY_PAYMENT.getCode()); + record.setPayment(coupon.getSalePrice()); + record.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode()); + record.setDetail(bodyStr); + record.setCreateDate(curr); + record.setUpdateDate(curr); + record.setComposeOrderId(0L); + record.setComposeOrderType(EnumComposeOrder.PACKAGECOUPON.getCode()); + record.setParentOrderId(couponOrder.getOrderId()); + record.setCouponNumber(1); + // 保存订单 + try { + wxOrderMapper.insert(record); + } catch (Exception e) { + logger.error("保存订单:" + e.getMessage()); + throw new MallinkException(ErrorCode.ORDER_SAVE_ERR.getCode(), coupon.getTitle() + ErrorCode.ORDER_SAVE_ERR.getMessage()); + } + + // 创建couponOrder + try { + createCouponOrder(record, user, coupon, null,EnumPayWay.PAY_WAY_NOT_UNPAY_GIFTLIST,null,null,couponOrder.getId()); + } catch (Exception e) { + logger.error("保存订单:" + e.getMessage()); + throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(), coupon.getTitle() + ErrorCode.COUPON_ORDER_SAVE_ERR.getMessage()); + } + + } + } + @Override @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) public WxCouponOrder couponOrderSuccess(WxOrder updateOrder) { @@ -1406,7 +1476,7 @@ public class WxOrderServiceImpl implements WxOrderService { // 创建couponOrder try { - return createCouponOrder(updateOrder, user, coupon, null,null,null,null); + return createCouponOrder(updateOrder, user, coupon, null,null,null,null,null); } catch (Exception e) { logger.error("创建券包:" + e.getMessage()); throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR); @@ -2166,7 +2236,7 @@ public class WxOrderServiceImpl implements WxOrderService { } // 5. 创建couponOrder try { - proxy.createCouponOrder(record, user, coupon, couponPasswordId,payWay,null,null); + proxy.createCouponOrder(record, user, coupon, couponPasswordId,payWay,null,null,null); } catch (Exception e) { logger.error("couponOrder失败:" + e.getMessage(),e); throw new MallinkException(ErrorCode.COUPON_ORDER_SAVE_ERR.getCode(),"["+coupon.getTitle()+"]保存券订单错误."+e.getMessage()); diff --git a/mallinkService/src/main/java/com/iformall/service/order/impl/batch/CouponPackageOrderAdapterService.java b/mallinkService/src/main/java/com/iformall/service/order/impl/batch/CouponPackageOrderAdapterService.java index d8b40c282..cc8c6edf1 100644 --- a/mallinkService/src/main/java/com/iformall/service/order/impl/batch/CouponPackageOrderAdapterService.java +++ b/mallinkService/src/main/java/com/iformall/service/order/impl/batch/CouponPackageOrderAdapterService.java @@ -94,9 +94,7 @@ public class CouponPackageOrderAdapterService extends BaseBatchOrderAdapterServi try { List longs = JSON.parseArray(wxCoupon.getGiftList(), Long.class); //发券包子券 - for (Long couponId:longs) { - wxOrderService.sendFreeCouponToUser(couponOrder.getCUserId(),couponOrder,couponId,null,EnumPayWay.PAY_WAY_NOT_UNPAY_GIFTLIST,null,null); - } + wxOrderService.sendSubCouponToUser(couponOrder,longs); } catch (MallinkException e) { throw e; } catch (Exception e){ @@ -109,5 +107,5 @@ public class CouponPackageOrderAdapterService extends BaseBatchOrderAdapterServi public String getPayProductName(WxCoupon lastCoupon) { return "[券包]"+lastCoupon.getTitle(); } - + } diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index c2735cf9f..f3fe68c84 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -24,6 +24,7 @@ + @@ -35,7 +36,7 @@ `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_type`,`c_user_id`,`owner_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`, `auto_refund`, - `verify_type`,`verify_remark`,`pay_vendor`,`send_merchant_id`,`send_merchant_user_id`,`compose_order_type`,`compose_order_id`,`coupon_number`, + `verify_type`,`verify_remark`,`pay_vendor`,`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` @@ -121,6 +122,10 @@ and `compose_order_id` = #{composeOrderId} + + and `parent_coupon_order_id` = #{parentCouponOrderId} + + and `shipping_type` = #{shippingType} diff --git a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml index a4d51d27e..b7eebfef3 100644 --- a/mallinkService/src/main/resources/mapper/WxOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxOrderMapper.xml @@ -29,11 +29,12 @@ + `id`,`order_number`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`freight_price`,`order_status`,`create_date`,`update_date`,`detail`, - `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id`,`form_id`,`total_payment`,`compose_order_id`,`coupon_number`,`compose_order_type`,`shipping_type`,`shipping_address` + `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id`,`form_id`,`total_payment`,`compose_order_id`,`coupon_number`,`compose_order_type`,`shipping_type`,`shipping_address`,`parent_order_id` @@ -129,6 +130,10 @@ and `shipping_type` = #{shippingType} + + + and `parent_order_id` = #{parentOrderId} + and `order_status` in @@ -265,7 +270,7 @@ o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,c.gift_list, - co.id as coupon_order_id,co.coupon_order_status,c.support_transfer,c.subsidy_num,o.compose_order_type,o.compose_order_id, + co.id as coupon_order_id,co.coupon_order_status,c.support_transfer,c.subsidy_num,o.compose_order_type,o.compose_order_id,o.parent_order_id, o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,co.`shipping_status`,co.`delivery_info` @@ -351,6 +356,7 @@ + @@ -404,6 +410,7 @@ + @@ -428,7 +435,7 @@ o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.c_user_id,o.coupon_channel_id,o.product_id,o.payment_type,o.payment,o.payment_time,o.order_status,o.create_date,o.update_date, c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date, o.compose_order_type,o.compose_order_id, - o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address` + o.`coupon_number`,o.`freight_price`,o.`shipping_type`,o.`shipping_address`,o.parent_order_id,