| @@ -1,4 +1,4 @@ | |||||
| CREATE TABLE `wx_compose_order` ( | |||||
| CREATE TABLE `wx_batch_order` ( | |||||
| `id` bigint(20) NOT NULL, | `id` bigint(20) NOT NULL, | ||||
| `tenant_id` varchar(5) NOT NULL, | `tenant_id` varchar(5) NOT NULL, | ||||
| `parent_tenant_id` varchar(5) DEFAULT NULL, | `parent_tenant_id` varchar(5) DEFAULT NULL, | ||||
| @@ -213,206 +213,509 @@ ALTER TABLE wx_order_97 ADD COLUMN `coupon_number` int(8) COMMENT '购买 | |||||
| ALTER TABLE wx_order_98 ADD COLUMN `coupon_number` int(8) COMMENT '购买券数量'; | ALTER TABLE wx_order_98 ADD COLUMN `coupon_number` int(8) COMMENT '购买券数量'; | ||||
| ALTER TABLE wx_order_99 ADD COLUMN `coupon_number` int(8) COMMENT '购买券数量'; | ALTER TABLE wx_order_99 ADD COLUMN `coupon_number` int(8) COMMENT '购买券数量'; | ||||
| ALTER TABLE wx_pay_order_0 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_1 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_2 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_3 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_4 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_5 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_6 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_7 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_8 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_9 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_10 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_11 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_12 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_13 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_14 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_15 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_16 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_17 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_18 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_19 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_20 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_21 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_22 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_23 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_24 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_25 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_26 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_27 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_28 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_29 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_30 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_31 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_32 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_33 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_34 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_35 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_36 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_37 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_38 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_39 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_40 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_41 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_42 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_43 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_44 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_45 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_46 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_47 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_48 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_49 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_50 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_51 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_52 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_53 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_54 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_55 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_56 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_57 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_58 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_59 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_60 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_61 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_62 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_63 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_64 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_65 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_66 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_67 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_68 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_69 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_70 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_71 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_72 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_73 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_74 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_75 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_76 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_77 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_78 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_79 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_80 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_81 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_82 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_83 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_84 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_85 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_86 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_87 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_88 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_89 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_90 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_91 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_92 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_93 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_94 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_95 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_96 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_97 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_98 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_99 ADD COLUMN `compose_order` TINYINT(1) COMMENT '是否为组合订单,1-是 0-不是'; | |||||
| ALTER TABLE wx_pay_order_0 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_1 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_2 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_3 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_4 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_5 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_6 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_7 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_8 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_9 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_10 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_11 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_12 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_13 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_14 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_15 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_16 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_17 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_18 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_19 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_20 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_21 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_22 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_23 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_24 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_25 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_26 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_27 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_28 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_29 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_30 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_31 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_32 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_33 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_34 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_35 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_36 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_37 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_38 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_39 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_40 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_41 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_42 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_43 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_44 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_45 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_46 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_47 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_48 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_49 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_50 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_51 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_52 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_53 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_54 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_55 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_56 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_57 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_58 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_59 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_60 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_61 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_62 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_63 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_64 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_65 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_66 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_67 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_68 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_69 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_70 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_71 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_72 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_73 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_74 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_75 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_76 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_77 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_78 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_79 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_80 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_81 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_82 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_83 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_84 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_85 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_86 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_87 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_88 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_89 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_90 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_91 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_92 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_93 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_94 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_95 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_96 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_97 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_98 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_pay_order_99 ADD COLUMN `compose_order` TINYINT(1) COMMENT '组合订单类型'; | |||||
| CREATE TABLE wx_compose_order_0 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_1 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_2 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_3 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_4 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_5 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_6 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_7 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_8 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_9 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_10 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_11 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_12 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_13 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_14 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_15 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_16 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_17 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_18 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_19 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_20 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_21 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_22 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_23 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_24 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_25 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_26 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_27 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_28 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_29 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_30 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_31 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_32 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_33 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_34 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_35 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_36 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_37 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_38 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_39 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_40 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_41 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_42 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_43 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_44 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_45 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_46 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_47 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_48 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_49 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_50 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_51 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_52 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_53 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_54 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_55 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_56 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_57 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_58 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_59 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_60 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_61 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_62 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_63 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_64 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_65 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_66 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_67 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_68 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_69 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_70 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_71 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_72 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_73 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_74 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_75 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_76 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_77 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_78 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_79 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_80 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_81 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_82 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_83 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_84 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_85 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_86 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_87 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_88 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_89 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_90 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_91 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_92 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_93 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_94 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_95 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_96 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_97 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_98 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_compose_order_99 LIKE wx_compose_order; | |||||
| CREATE TABLE wx_batch_order_0 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_1 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_2 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_3 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_4 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_5 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_6 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_7 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_8 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_9 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_10 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_11 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_12 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_13 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_14 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_15 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_16 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_17 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_18 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_19 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_20 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_21 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_22 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_23 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_24 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_25 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_26 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_27 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_28 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_29 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_30 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_31 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_32 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_33 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_34 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_35 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_36 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_37 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_38 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_39 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_40 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_41 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_42 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_43 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_44 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_45 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_46 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_47 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_48 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_49 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_50 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_51 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_52 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_53 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_54 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_55 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_56 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_57 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_58 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_59 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_60 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_61 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_62 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_63 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_64 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_65 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_66 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_67 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_68 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_69 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_70 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_71 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_72 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_73 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_74 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_75 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_76 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_77 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_78 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_79 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_80 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_81 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_82 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_83 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_84 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_85 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_86 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_87 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_88 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_89 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_90 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_91 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_92 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_93 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_94 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_95 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_96 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_97 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_98 LIKE wx_batch_order; | |||||
| CREATE TABLE wx_batch_order_99 LIKE wx_batch_order; | |||||
| drop table wx_compose_order; | |||||
| drop table wx_batch_order; | |||||
| ALTER TABLE wx_coupon_order_0 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_1 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_2 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_3 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_4 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_5 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_6 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_7 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_8 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_9 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_10 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_11 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_12 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_13 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_14 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_15 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_16 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_17 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_18 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_19 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_20 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_21 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_22 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_23 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_24 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_25 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_26 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_27 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_28 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_29 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_30 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_31 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_32 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_33 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_34 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_35 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_36 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_37 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_38 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_39 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_40 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_41 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_42 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_43 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_44 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_45 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_46 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_47 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_48 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_49 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_50 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_51 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_52 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_53 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_54 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_55 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_56 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_57 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_58 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_59 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_60 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_61 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_62 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_63 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_64 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_65 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_66 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_67 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_68 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_69 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_70 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_71 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_72 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_73 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_74 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_75 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_76 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_77 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_78 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_79 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_80 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_81 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_82 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_83 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_84 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_85 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_86 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_87 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_88 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_89 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_90 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_91 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_92 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_93 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_94 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_95 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_96 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_97 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_98 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_99 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_0 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_1 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_2 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_3 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_4 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_5 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_6 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_7 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_8 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_9 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_10 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_11 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_12 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_13 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_14 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_15 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_16 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_17 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_18 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_19 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_20 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_21 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_22 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_23 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_24 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_25 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_26 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_27 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_28 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_29 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_30 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_31 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_32 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_33 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_34 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_35 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_36 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_37 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_38 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_39 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_40 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_41 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_42 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_43 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_44 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_45 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_46 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_47 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_48 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_49 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_50 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_51 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_52 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_53 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_54 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_55 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_56 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_57 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_58 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_59 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_60 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_61 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_62 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_63 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_64 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_65 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_66 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_67 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_68 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_69 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_70 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_71 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_72 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_73 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_74 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_75 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_76 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_77 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_78 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_79 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_80 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_81 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_82 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_83 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_84 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_85 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_86 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_87 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_88 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_89 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_90 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_91 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_92 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_93 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_94 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_95 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_96 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_97 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_98 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_order_99 ADD COLUMN `compose_order_type` tinyint(1) not null default 0 COMMENT '组合订单类型'; | |||||
| ALTER TABLE wx_coupon_order_0 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_1 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_2 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_3 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_4 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_5 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_6 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_7 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_8 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_9 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_10 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_11 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_12 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_13 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_14 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_15 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_16 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_17 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_18 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_19 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_20 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_21 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_22 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_23 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_24 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_25 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_26 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_27 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_28 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_29 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_30 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_31 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_32 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_33 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_34 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_35 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_36 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_37 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_38 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_39 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_40 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_41 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_42 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_43 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_44 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_45 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_46 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_47 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_48 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_49 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_50 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_51 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_52 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_53 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_54 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_55 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_56 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_57 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_58 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_59 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_60 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_61 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_62 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_63 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_64 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_65 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_66 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_67 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_68 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_69 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_70 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_71 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_72 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_73 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_74 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_75 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_76 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_77 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_78 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_79 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_80 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_81 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_82 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_83 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_84 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_85 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_86 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_87 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_88 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_89 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_90 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_91 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_92 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_93 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_94 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_95 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_96 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_97 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_98 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| ALTER TABLE wx_coupon_order_99 ADD COLUMN `compose_order_id` bigint(20) COMMENT '组合订单编号'; | |||||
| @@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Qualifier; | |||||
| import org.springframework.data.redis.core.RedisTemplate; | import org.springframework.data.redis.core.RedisTemplate; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -60,21 +61,34 @@ public class WxOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| RedisLock redisLock; | RedisLock redisLock; | ||||
| //券包下单的逻辑和组合下单的逻辑差不错,但是库存走的是券包的库存,子订单的分账需要调用多次分账 | |||||
| @ApiOperation(value = "券包下单,", notes = "[{\"signleOrder\":{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"},\"count\":8},]") | |||||
| @PostMapping("couponPackageSave") | |||||
| public ResultData couponPackageSave(@RequestBody List<OrderComposeSaveDto> orderSaveDto) { | |||||
| Long memberId; | |||||
| try { | |||||
| memberId = getMemberId(); | |||||
| } catch (Exception e) { | |||||
| return new ResultData(Result.ERROR,e.getMessage()); | |||||
| } | |||||
| return wxOrderService.composeSaveOrder(EnumComposeOrder.PACKAGECOUPON,orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||||
| } | |||||
| @ApiOperation(value = "多个券多个数量组合下订单(购物车组合)", notes = "[{\"signleOrder\":{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"},\"count\":8},]") | @ApiOperation(value = "多个券多个数量组合下订单(购物车组合)", notes = "[{\"signleOrder\":{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"},\"count\":8},]") | ||||
| @PostMapping("composeSave") | @PostMapping("composeSave") | ||||
| public ResultData saveOrder(@RequestBody List<OrderComposeSaveDto> orderSaveDto) { | |||||
| public ResultData composeSave(@RequestBody List<OrderComposeSaveDto> orderSaveDto) { | |||||
| Long memberId; | Long memberId; | ||||
| try { | try { | ||||
| memberId = getMemberId(); | memberId = getMemberId(); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return new ResultData(Result.ERROR,e.getMessage()); | return new ResultData(Result.ERROR,e.getMessage()); | ||||
| } | } | ||||
| return wxOrderService.composeSaveOrder(orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||||
| return wxOrderService.composeSaveOrder(EnumComposeOrder.BATCH,orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||||
| } | } | ||||
| @ApiOperation(value = "单个券单个数量下订单,拼团,砍价用", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||||
| @ApiOperation(value = "单个券单个订单,拼团,砍价用", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\",\"orderGroupId\":\"String\",\"formId\":\"String\"}") | |||||
| @PostMapping("singleSave") | @PostMapping("singleSave") | ||||
| public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | public ResultData saveOrder(@RequestBody OrderSaveDto orderSaveDto) { | ||||
| Long memberId; | Long memberId; | ||||
| @@ -83,7 +97,12 @@ public class WxOrderController extends BaseController { | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return new ResultData(Result.ERROR,e.getMessage()); | return new ResultData(Result.ERROR,e.getMessage()); | ||||
| } | } | ||||
| return wxOrderService.singleSaveOrder(orderSaveDto,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||||
| List<OrderComposeSaveDto> list = new ArrayList<>(); | |||||
| OrderComposeSaveDto dto = new OrderComposeSaveDto(); | |||||
| dto.setSignleOrder(orderSaveDto); | |||||
| dto.setCount(1); | |||||
| list.add(dto); | |||||
| return wxOrderService.composeSaveOrder(EnumComposeOrder.SINGLE,list,memberId,EnumPayWay.PAY_WAY_WECHAT,getTenantInfo()); | |||||
| } | } | ||||
| @ApiOperation(value = "取消订单", notes = "{\"orderId\":\"string\"}") | @ApiOperation(value = "取消订单", notes = "{\"orderId\":\"string\"}") | ||||
| @@ -24,7 +24,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| @@ -41,6 +41,8 @@ import com.iformall.service.WxCouponService; | |||||
| import com.iformall.service.WxOrderService; | import com.iformall.service.WxOrderService; | ||||
| import com.iformall.service.WxPayAccountService; | import com.iformall.service.WxPayAccountService; | ||||
| import com.iformall.service.WxPayOrderService; | import com.iformall.service.WxPayOrderService; | ||||
| import com.iformall.service.order.OrderFactory; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.utils.IPUtil; | import com.iformall.utils.IPUtil; | ||||
| @@ -73,6 +75,9 @@ public class WxPayOrderController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxAppinfoService wxAppinfoService; | private WxAppinfoService wxAppinfoService; | ||||
| @Autowired | |||||
| OrderFactory orderFactory; | |||||
| /** | /** | ||||
| * 微信支付 | * 微信支付 | ||||
| * @param paramMap | * @param paramMap | ||||
| @@ -90,17 +95,22 @@ public class WxPayOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | ||||
| } | } | ||||
| String composeOrderType = paramMap.get("composeOrderType"); | |||||
| if (StringUtils.isBlank(composeOrderType)) { | |||||
| logger.info("composeOrderType不能为空: " + paramMap.toString()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "composeOrderType不能为空"); | |||||
| } | |||||
| WxCUser user = getWxCUser(); | WxCUser user = getWxCUser(); | ||||
| if (!user.basicInfoIs()) { | if (!user.basicInfoIs()) { | ||||
| logger.error("暂未成为会员,请授权手机号"); | logger.error("暂未成为会员,请授权手机号"); | ||||
| return new ResultData(ErrorCode.USER_IS_NOT_MEMBER.getCode(), "暂未成为会员,请授权手机号"); | return new ResultData(ErrorCode.USER_IS_NOT_MEMBER.getCode(), "暂未成为会员,请授权手机号"); | ||||
| } | } | ||||
| String composeOrderTag = paramMap.get("composeOrderTag"); | |||||
| return _create(orderIdStr,composeOrderTag,user.getUserId(),EnumPayWay.PAY_WAY_WECHAT,user.getAppId(),new PayExtraParam("openId",user.getOpenId()),request); | |||||
| return _create(orderIdStr,composeOrderType,user.getUserId(),EnumPayWay.PAY_WAY_WECHAT,user.getAppId(),new PayExtraParam("openId",user.getOpenId()),request); | |||||
| } | } | ||||
| private ResultData _create(String orderIdStr,String compseOrderTag,Long userId, EnumPayWay payWay,String appId,PayExtraParam parm,HttpServletRequest request) { | |||||
| private ResultData _create(String orderIdStr,String composeOrderType,Long userId, EnumPayWay payWay,String appId,PayExtraParam parm,HttpServletRequest request) { | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId,getFinalTenantId()); | WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId,getFinalTenantId()); | ||||
| if ( null == wxCUserBasicInfo) { | if ( null == wxCUserBasicInfo) { | ||||
| logger.error("会员用户不存在."+userId); | logger.error("会员用户不存在."+userId); | ||||
| @@ -123,9 +133,7 @@ public class WxPayOrderController extends BaseController { | |||||
| record.setOrderId(orderId); | record.setOrderId(orderId); | ||||
| try { | try { | ||||
| record.setIp(IPUtil.getIpAddr(request)); | record.setIp(IPUtil.getIpAddr(request)); | ||||
| if ((!StringUtils.isBlank(compseOrderTag)) && "1".equals(compseOrderTag)) { | |||||
| record.setComposeOrder(EnumComposeOrder.YES.getCode()); | |||||
| } | |||||
| record.setComposeOrder(Integer.parseInt(composeOrderType)); | |||||
| return wxPayOrderService.createPayOrder(appInfo, wxCUserBasicInfo, record, payWay,parm); | return wxPayOrderService.createPayOrder(appInfo, wxCUserBasicInfo, record, payWay,parm); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | logger.error("payment wechat, order create error, req 2: " + record.toString() + ", e:" + e.getMessage()); | ||||
| @@ -192,17 +200,7 @@ public class WxPayOrderController extends BaseController { | |||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "未查询到payOrder."); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, "未查询到payOrder."); | ||||
| } | } | ||||
| WxComposeOrder composeOrder = null; | |||||
| WxOrder order = null; | |||||
| if ((null != payOrder.getComposeOrder()) && (EnumComposeOrder.YES.getCode().intValue() == payOrder.getComposeOrder().intValue())) { | |||||
| composeOrder = wxOrderService.getComposeOrder(orderId, payOrder); | |||||
| }else { | |||||
| order = wxOrderService.getById(orderId,payOrder.getTenantId()); | |||||
| if (check(orderId, order, payOrder)) { | |||||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||||
| } | |||||
| } | |||||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(payOrder.getComposeOrder()).getComposeOrder(payOrder.getOrderId(), payOrder.getTenantId()); | |||||
| //查询微信订单状态并更新 | //查询微信订单状态并更新 | ||||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(payOrder, EnumPayWay.getEnum(payOrder.getPayVendor())); | WxAppinfo appInfo = wxAppinfoService.getCAppInfo(payOrder, EnumPayWay.getEnum(payOrder.getPayVendor())); | ||||
| @@ -213,13 +211,13 @@ public class WxPayOrderController extends BaseController { | |||||
| } | } | ||||
| WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); | WxPayAccount payAccount = wxPayAccountService.getById(appInfo.getPayId()); | ||||
| try { | try { | ||||
| WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(payOrder, composeOrder,order, appInfo, payAccount, IdWorker.get(),false); | |||||
| WxPayOrder wo = wxPayOrderService.handleWxOrderQuery(payOrder, composeOrder,appInfo, payAccount, IdWorker.get(),false); | |||||
| if (null != wo) { | if (null != wo) { | ||||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", composeOrder); | |||||
| } | } | ||||
| }catch(MallinkException e) { | }catch(MallinkException e) { | ||||
| //已经同步了微信的支付状态,表示已经更新 | //已经同步了微信的支付状态,表示已经更新 | ||||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", order); | |||||
| return new ResultData(Result.SUCCESS, "支付状态更新成功", composeOrder); | |||||
| } | } | ||||
| return new ResultData(ErrorCode.PAY_ORDER_ERROR, "查询微信订单支付状态失败,请稍后!"); | return new ResultData(ErrorCode.PAY_ORDER_ERROR, "查询微信订单支付状态失败,请稍后!"); | ||||
| @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.enums.EnumAppType; | import com.iformall.enums.EnumAppType; | ||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.enums.EnumOrderStatus; | import com.iformall.enums.EnumOrderStatus; | ||||
| import com.iformall.enums.EnumOrderType; | import com.iformall.enums.EnumOrderType; | ||||
| import com.iformall.enums.EnumPayStatus; | import com.iformall.enums.EnumPayStatus; | ||||
| @@ -31,6 +32,8 @@ import com.iformall.service.WxOrderService; | |||||
| import com.iformall.service.WxPayOrderService; | import com.iformall.service.WxPayOrderService; | ||||
| import com.iformall.service.WxRefundOrderService; | import com.iformall.service.WxRefundOrderService; | ||||
| import com.iformall.service.helper.WxPayOrderServiceHelper; | import com.iformall.service.helper.WxPayOrderServiceHelper; | ||||
| import com.iformall.service.order.OrderFactory; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.PayServiceFactory; | import com.iformall.service.pay.PayServiceFactory; | ||||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| @@ -84,6 +87,9 @@ public class OrderExpiringSchedule { | |||||
| @Autowired | @Autowired | ||||
| PayServiceFactory payServiceFactory; | PayServiceFactory payServiceFactory; | ||||
| @Autowired | |||||
| OrderFactory orderFactory; | |||||
| private List<WxMall> getMalls() { | private List<WxMall> getMalls() { | ||||
| WxMall wxMall =new WxMall(); | WxMall wxMall =new WxMall(); | ||||
| return wxMallMapper.findList(wxMall); | return wxMallMapper.findList(wxMall); | ||||
| @@ -252,7 +258,7 @@ public class OrderExpiringSchedule { | |||||
| public boolean wxPaySuccess(WxOrder order,boolean autoReHandle,EnumPayWay payWay) throws MallinkException, Exception { | public boolean wxPaySuccess(WxOrder order,boolean autoReHandle,EnumPayWay payWay) throws MallinkException, Exception { | ||||
| WxPayOrder payOrderq = new WxPayOrder(); | WxPayOrder payOrderq = new WxPayOrder(); | ||||
| payOrderq.setOrderId(order.getId()); | |||||
| payOrderq.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||||
| payOrderq.setTenantId(order.getTenantId()); | payOrderq.setTenantId(order.getTenantId()); | ||||
| List<WxPayOrder> payorderlist = wxPayOrderMapper.findList(payOrderq); | List<WxPayOrder> payorderlist = wxPayOrderMapper.findList(payOrderq); | ||||
| if (null == payorderlist || payorderlist.size() <=0 ) { | if (null == payorderlist || payorderlist.size() <=0 ) { | ||||
| @@ -292,7 +298,10 @@ public class OrderExpiringSchedule { | |||||
| //如果是支付成功,并且需要重试成功流程, | //如果是支付成功,并且需要重试成功流程, | ||||
| if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode().intValue() == payResult.getCode()) { | if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode().intValue() == payResult.getCode()) { | ||||
| if (autoReHandle) { | if (autoReHandle) { | ||||
| wxPayOrderService.handleSuccessOrder(wxpayOrder, null, order, payResult, true,true); | |||||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(wxpayOrder.getComposeOrder()).getComposeOrder(wxpayOrder.getOrderId(), wxpayOrder.getTenantId()); | |||||
| //无论是不是批量的,都是执行单个订单 | |||||
| composeOrder.setSingleOrder(order); | |||||
| wxPayOrderService.handleSuccessOrder(wxpayOrder, composeOrder, payResult, true,true); | |||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -310,8 +319,8 @@ public class OrderExpiringSchedule { | |||||
| // 库存退回 | // 库存退回 | ||||
| wxOrderService.stockBack(order); | wxOrderService.stockBack(order); | ||||
| // 微信 关单 | |||||
| wxOrderService.orderClose(order,payWay); | |||||
| // 微信 关单,批量的订单关单有问题 | |||||
| //wxOrderService.orderClose(order,payWay); | |||||
| // 订单状态更改 | // 订单状态更改 | ||||
| WxOrder updateOrder = new WxOrder(); | WxOrder updateOrder = new WxOrder(); | ||||
| @@ -370,7 +379,7 @@ public class OrderExpiringSchedule { | |||||
| wxOrderService.stockBack(order); | wxOrderService.stockBack(order); | ||||
| } | } | ||||
| // 微信 关单 | // 微信 关单 | ||||
| wxOrderService.orderClose(updateOrder,payWay); | |||||
| //wxOrderService.orderClose(updateOrder,payWay); | |||||
| logger.info("拼团订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | logger.info("拼团订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | ||||
| } | } | ||||
| @@ -256,7 +256,7 @@ public class BaseMyBatisConfiguration { | |||||
| ShardingSphere wxComposeOrderSharding = new ShardingSphere(); | ShardingSphere wxComposeOrderSharding = new ShardingSphere(); | ||||
| wxComposeOrderSharding.setColumn("tenant_id"); | wxComposeOrderSharding.setColumn("tenant_id"); | ||||
| wxComposeOrderSharding.setTableName("wx_compose_order"); | |||||
| wxComposeOrderSharding.setTableName("wx_batch_order"); | |||||
| wxComposeOrderSharding.setCount(100); | wxComposeOrderSharding.setCount(100); | ||||
| wxComposeOrderSharding.setRule(EnumShardingRule.HASH.getCode()); | wxComposeOrderSharding.setRule(EnumShardingRule.HASH.getCode()); | ||||
| shardingList.add(wxComposeOrderSharding); | shardingList.add(wxComposeOrderSharding); | ||||
| @@ -9,11 +9,11 @@ import lombok.ToString; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| @TableName(value = "wx_compose_order") | |||||
| @TableName(value = "wx_batch_order") | |||||
| @Data | @Data | ||||
| @ToString(callSuper = true) | @ToString(callSuper = true) | ||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxComposeOrder extends TenantEntity { | |||||
| public class WxBatchOrder extends TenantEntity { | |||||
| /** | /** | ||||
| * | * | ||||
| @@ -54,7 +54,11 @@ public class WxCouponOrder extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="赠券商户编号",name="sendMerchantId") | @io.swagger.annotations.ApiModelProperty(value="赠券商户编号",name="sendMerchantId") | ||||
| private Long sendMerchantId; | private Long sendMerchantId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="赠券商户员工编号",name="sendMerchantUserId") | @io.swagger.annotations.ApiModelProperty(value="赠券商户员工编号",name="sendMerchantUserId") | ||||
| private Long sendMerchantUserId; | |||||
| private Long sendMerchantUserId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") | |||||
| private Integer composeOrderType; | |||||
| @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="composeOrderId") | |||||
| private Long composeOrderId; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String couponName; | private String couponName; | ||||
| @@ -99,6 +99,9 @@ public class WxOrder extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="couponNumber") | @io.swagger.annotations.ApiModelProperty(value="组合订单编号",name="couponNumber") | ||||
| private Integer couponNumber; | private Integer couponNumber; | ||||
| @io.swagger.annotations.ApiModelProperty(value="组合订单类型EnumComposeOrder",name="composeOrderType") | |||||
| private Integer composeOrderType; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected List<Integer> statusS; | protected List<Integer> statusS; | ||||
| @@ -1,13 +1,16 @@ | |||||
| package com.iformall.enums; | package com.iformall.enums; | ||||
| import com.iformall.domain.po.WxOrder; | |||||
| /** | /** | ||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| public enum EnumComposeOrder { | public enum EnumComposeOrder { | ||||
| YES(1, "是多券种组合订单"), | |||||
| NO(0, "非多券种组合订单,如拼团,砍价"); | |||||
| SINGLE(0, "单个订单类型,如拼团,砍价"), | |||||
| BATCH(1, "多券种组合订单类型"), | |||||
| PACKAGECOUPON(2,"券包组合订单类型") | |||||
| ; | |||||
| public static EnumComposeOrder getEnum(Integer code) { | public static EnumComposeOrder getEnum(Integer code) { | ||||
| for (EnumComposeOrder value : values()) { | for (EnumComposeOrder value : values()) { | ||||
| @@ -33,4 +36,20 @@ public enum EnumComposeOrder { | |||||
| public String getMessage() { | public String getMessage() { | ||||
| return message; | return message; | ||||
| } | } | ||||
| public static Long getPayOrderId(WxOrder order) { | |||||
| if (order.getComposeOrderType().intValue() == SINGLE.getCode().intValue()) { | |||||
| return order.getId(); | |||||
| }else { | |||||
| return order.getComposeOrderId(); | |||||
| } | |||||
| } | |||||
| public static boolean isSingle(Integer type) { | |||||
| if (type.intValue() == SINGLE.getCode().intValue()) { | |||||
| return true; | |||||
| }else { | |||||
| return false; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,20 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import java.util.List; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| public interface WxBatchOrderMapper extends CommonMapper<WxBatchOrder, Long> { | |||||
| List<WxBatchOrder> findList(WxBatchOrder order); | |||||
| Integer countList(WxBatchOrder order); | |||||
| WxBatchOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| void updateCUserId(WxBatchOrder order); | |||||
| } | |||||
| @@ -1,20 +0,0 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import java.util.List; | |||||
| import org.apache.ibatis.annotations.Param; | |||||
| public interface WxComposeOrderMapper extends CommonMapper<WxComposeOrder, Long> { | |||||
| List<WxComposeOrder> findList(WxComposeOrder order); | |||||
| Integer countList(WxComposeOrder order); | |||||
| WxComposeOrder selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||||
| void updateCUserId(WxComposeOrder order); | |||||
| } | |||||
| @@ -88,7 +88,7 @@ public interface WxCouponOrderService { | |||||
| * 核销分账 | * 核销分账 | ||||
| * @param couponOrder | * @param couponOrder | ||||
| */ | */ | ||||
| void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,Integer payWay); | |||||
| void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,Integer payWay,boolean mulityShare); | |||||
| /** | /** | ||||
| * 核销后补贴 | * 核销后补贴 | ||||
| @@ -11,7 +11,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.dto.OrderComposeSaveDto; | import com.iformall.domain.dto.OrderComposeSaveDto; | ||||
| import com.iformall.domain.dto.OrderSaveDto; | import com.iformall.domain.dto.OrderSaveDto; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| @@ -22,8 +22,10 @@ import com.iformall.domain.vo.WxCouponSendVo; | |||||
| import com.iformall.domain.vo.WxOrderCouponPressVo; | import com.iformall.domain.vo.WxOrderCouponPressVo; | ||||
| import com.iformall.domain.vo.WxOrderCouponVo; | import com.iformall.domain.vo.WxOrderCouponVo; | ||||
| import com.iformall.domain.vo.WxOrderQueryVo; | import com.iformall.domain.vo.WxOrderQueryVo; | ||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.enums.EnumOrderStatus; | import com.iformall.enums.EnumOrderStatus; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| public interface WxOrderService { | public interface WxOrderService { | ||||
| @@ -114,7 +116,7 @@ public interface WxOrderService { | |||||
| /** | /** | ||||
| * 订单关单 | * 订单关单 | ||||
| */ | */ | ||||
| ResultData orderClose(WxOrder order,EnumPayWay payWay); | |||||
| //ResultData orderClose(WxOrder order,EnumPayWay payWay); | |||||
| /** | /** | ||||
| * 根据Id获得实体 | * 根据Id获得实体 | ||||
| @@ -194,7 +196,7 @@ public interface WxOrderService { | |||||
| * @param coupon | * @param coupon | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxComposeOrder saveOrderForCoupon(WxCUserBasicInfo user, List<OrderComposeSaveDto> orderSave,EnumPayWay payWay); | |||||
| WxComposeOrder saveOrderForCoupon(EnumComposeOrder composeOrderType,WxCUserBasicInfo user, List<OrderComposeSaveDto> orderSave,EnumPayWay payWay); | |||||
| void sendOrderSuccessActionMsg(WxOrder updateOrder); | void sendOrderSuccessActionMsg(WxOrder updateOrder); | ||||
| /** | /** | ||||
| @@ -243,10 +245,5 @@ public interface WxOrderService { | |||||
| //ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | //ResultData saveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | ||||
| ResultData composeSaveOrder(List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | |||||
| ResultData singleSaveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | |||||
| WxComposeOrder getComposeOrder(Long orderId,TenantEntity tenantEntity); | |||||
| ResultData composeSaveOrder(EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity); | |||||
| } | } | ||||
| @@ -7,23 +7,25 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| import com.iformall.domain.po.WxPayOrder; | import com.iformall.domain.po.WxPayOrder; | ||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.enums.EnumPayShare; | import com.iformall.enums.EnumPayShare; | ||||
| import com.iformall.enums.EnumPayWay; | import com.iformall.enums.EnumPayWay; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | ||||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | ||||
| public interface WxPayOrderService { | public interface WxPayOrderService { | ||||
| public void handleSuccessOrder(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxOrder order,PayQueryAdapterResult queryResult,boolean isScheduleTask,boolean composeSingleOrder); | |||||
| public void handleSuccessOrder(WxPayOrder oldRecord,WxComposeOrder composeOrder,PayQueryAdapterResult queryResult,boolean isScheduleTask,boolean isOneChildOrder); | |||||
| public WxPayOrder handleWxOrderQuery(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxOrder order,WxAppinfo appInfo,WxPayAccount payAccount,IdWorker idworker,boolean repeatPay); | |||||
| public WxPayOrder handleWxOrderQuery(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxAppinfo appInfo,WxPayAccount payAccount,IdWorker idworker,boolean repeatPay); | |||||
| /** | /** | ||||
| * 创建支付订单 | * 创建支付订单 | ||||
| @@ -11,7 +11,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| @@ -558,12 +558,23 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| logger.error("核销记账失败"+e.getMessage(),e); | logger.error("核销记账失败"+e.getMessage(),e); | ||||
| } | } | ||||
| } else { | } else { | ||||
| try { | |||||
| // 核销分账 | |||||
| shareAfterVerify(couponOrder, bUser.getMerchantId(),couponOrder.getPayVendor()); | |||||
| } catch (Exception e) { | |||||
| logger.error("核销记账失败"+e.getMessage(),e); | |||||
| } | |||||
| //如果是组合的,则为多次 | |||||
| if ((couponOrder.getComposeOrderType().intValue() == EnumComposeOrder.BATCH.getCode().intValue()) | |||||
| || (couponOrder.getComposeOrderType().intValue() == EnumComposeOrder.PACKAGECOUPON.getCode().intValue())) { | |||||
| try { | |||||
| // 核销分账 | |||||
| shareAfterVerify(couponOrder, bUser.getMerchantId(),couponOrder.getPayVendor(),true); | |||||
| } catch (Exception e) { | |||||
| logger.error("核销记账失败"+e.getMessage(),e); | |||||
| } | |||||
| }else { | |||||
| try { | |||||
| // 核销分账 | |||||
| shareAfterVerify(couponOrder, bUser.getMerchantId(),couponOrder.getPayVendor(),false); | |||||
| } catch (Exception e) { | |||||
| logger.error("核销记账失败"+e.getMessage(),e); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| try { | try { | ||||
| @@ -635,19 +646,29 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,Integer payWay) { | |||||
| public void shareAfterVerify(WxCouponOrder couponOrder, Long merchantId,Integer payWay,boolean mulityShare) { | |||||
| // 微信分账 | // 微信分账 | ||||
| try { | try { | ||||
| WxPayOrder wxPayOrder = new WxPayOrder(); | WxPayOrder wxPayOrder = new WxPayOrder(); | ||||
| Long orderId = couponOrder.getOrderId(); | |||||
| if (!EnumComposeOrder.isSingle(couponOrder.getComposeOrderType())) { | |||||
| orderId = couponOrder.getComposeOrderId(); | |||||
| } | |||||
| wxPayOrder.updateTenantInfo(couponOrder); | wxPayOrder.updateTenantInfo(couponOrder); | ||||
| wxPayOrder.setOrderId(couponOrder.getOrderId()); | |||||
| wxPayOrder.setOrderId(orderId); | |||||
| wxPayOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | wxPayOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | ||||
| wxPayOrder = wxPayOrderMapper.selectOne(new QueryWrapper(wxPayOrder)); | wxPayOrder = wxPayOrderMapper.selectOne(new QueryWrapper(wxPayOrder)); | ||||
| if (wxPayOrder != null && wxPayOrder.getShare().equals(EnumPayShare.YES.getCode())) { | if (wxPayOrder != null && wxPayOrder.getShare().equals(EnumPayShare.YES.getCode())) { | ||||
| WxSharingOrderDto wxSharingOrderDto = new WxSharingOrderDto(); | WxSharingOrderDto wxSharingOrderDto = new WxSharingOrderDto(); | ||||
| wxSharingOrderDto.setCUserId(wxPayOrder.getCUserId()); | wxSharingOrderDto.setCUserId(wxPayOrder.getCUserId()); | ||||
| wxSharingOrderDto.setMerchantId(merchantId); | wxSharingOrderDto.setMerchantId(merchantId); | ||||
| wxSharingOrderDto.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | |||||
| if (mulityShare) { | |||||
| wxSharingOrderDto.setType(EnumProfitSharingOrderType.PROFIT_SHARING_MULTI.getCode()); | |||||
| }else { | |||||
| wxSharingOrderDto.setType(EnumProfitSharingOrderType.PROFIT_SHARING_SINGLE.getCode()); | |||||
| } | |||||
| wxSharingOrderDto.setPayAmount(wxPayOrder.getPayAmount()); | wxSharingOrderDto.setPayAmount(wxPayOrder.getPayAmount()); | ||||
| wxSharingOrderDto.setRateAmount(wxPayOrder.getRateAmount()); | wxSharingOrderDto.setRateAmount(wxPayOrder.getRateAmount()); | ||||
| wxSharingOrderDto.setOrderId(wxPayOrder.getId()); | wxSharingOrderDto.setOrderId(wxPayOrder.getId()); | ||||
| @@ -459,7 +459,7 @@ public class WxGameServiceImpl implements WxGameService { | |||||
| ocsd.setSignleOrder(orderSaveDto); | ocsd.setSignleOrder(orderSaveDto); | ||||
| ocsd.setCount(1); | ocsd.setCount(1); | ||||
| orderSave.add(ocsd); | orderSave.add(ocsd); | ||||
| ResultData resultData1 = wxOrderService.composeSaveOrder(orderSave, userId, EnumPayWay.PAY_WAY_WECHAT, wxGame); | |||||
| ResultData resultData1 = wxOrderService.composeSaveOrder(EnumComposeOrder.SINGLE,orderSave, userId, EnumPayWay.PAY_WAY_WECHAT, wxGame); | |||||
| if(resultData1.code == Result.SUCCESS && resultData1.data != null && resultData1.data instanceof WxOrder){ | if(resultData1.code == Result.SUCCESS && resultData1.data != null && resultData1.data instanceof WxOrder){ | ||||
| WxOrder order = (WxOrder)resultData1.data; | WxOrder order = (WxOrder)resultData1.data; | ||||
| @@ -19,6 +19,10 @@ import javax.servlet.http.HttpServletResponse; | |||||
| import com.iformall.domain.vo.*; | import com.iformall.domain.vo.*; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.order.OrderAdapterService; | |||||
| import com.iformall.service.order.OrderFactory; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -44,9 +48,9 @@ import com.iformall.domain.dto.OrderComposeSaveDto; | |||||
| import com.iformall.domain.dto.OrderSaveDto; | import com.iformall.domain.dto.OrderSaveDto; | ||||
| import com.iformall.domain.dto.WxSharingOrderDto; | import com.iformall.domain.dto.WxSharingOrderDto; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.WxCardInfo; | import com.iformall.domain.po.WxCardInfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxCouponMerchant; | import com.iformall.domain.po.WxCouponMerchant; | ||||
| @@ -65,10 +69,10 @@ import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.po.msg.FmInsideOrderSuccessMsg; | import com.iformall.domain.po.msg.FmInsideOrderSuccessMsg; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxAppinfoMapper; | import com.iformall.mapper.WxAppinfoMapper; | ||||
| import com.iformall.mapper.WxBatchOrderMapper; | |||||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | import com.iformall.mapper.WxCUserBasicInfoMapper; | ||||
| import com.iformall.mapper.WxCUserMapper; | import com.iformall.mapper.WxCUserMapper; | ||||
| import com.iformall.mapper.WxCardInfoMapper; | import com.iformall.mapper.WxCardInfoMapper; | ||||
| import com.iformall.mapper.WxComposeOrderMapper; | |||||
| import com.iformall.mapper.WxCouponChannelMapper; | import com.iformall.mapper.WxCouponChannelMapper; | ||||
| import com.iformall.mapper.WxCouponMapper; | import com.iformall.mapper.WxCouponMapper; | ||||
| import com.iformall.mapper.WxCouponMerchantMapper; | import com.iformall.mapper.WxCouponMerchantMapper; | ||||
| @@ -197,12 +201,15 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| WxCouponChannelService wxCouponChannelService; | WxCouponChannelService wxCouponChannelService; | ||||
| @Autowired | @Autowired | ||||
| WxComposeOrderMapper wxComposeOrderMapper; | |||||
| WxBatchOrderMapper wxBatchOrderMapper; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("couponDetailRedisTemplate") | @Qualifier("couponDetailRedisTemplate") | ||||
| RedisTemplate<String, WxCouponCVo> cdRedisTemplate; | RedisTemplate<String, WxCouponCVo> cdRedisTemplate; | ||||
| @Autowired | |||||
| OrderFactory orderFactory; | |||||
| @Override | @Override | ||||
| public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findList(record)); | ||||
| @@ -993,7 +1000,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| try { | try { | ||||
| WxPayOrder payOrderQ = new WxPayOrder(); | WxPayOrder payOrderQ = new WxPayOrder(); | ||||
| payOrderQ.updateTenantInfo(order); | payOrderQ.updateTenantInfo(order); | ||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | ||||
| payOrder = wxPayOrderMapper.selectOne(new QueryWrapper(payOrderQ)); | payOrder = wxPayOrderMapper.selectOne(new QueryWrapper(payOrderQ)); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -1062,6 +1069,8 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| if (null != bUserId) { | if (null != bUserId) { | ||||
| couponOrder.setSendMerchantUserId(bUserId); | couponOrder.setSendMerchantUserId(bUserId); | ||||
| } | } | ||||
| couponOrder.setComposeOrderType(order.getComposeOrderType()); | |||||
| couponOrder.setComposeOrderId(order.getComposeOrderId()); | |||||
| //有支付信息,从支付信息中取渠道 | //有支付信息,从支付信息中取渠道 | ||||
| if (null != payOrder) { | if (null != payOrder) { | ||||
| couponOrder.setPayVendor(payOrder.getPayVendor()); | couponOrder.setPayVendor(payOrder.getPayVendor()); | ||||
| @@ -1308,6 +1317,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setDetail(bodyStr); | record.setDetail(bodyStr); | ||||
| record.setCreateDate(curr); | record.setCreateDate(curr); | ||||
| record.setUpdateDate(curr); | record.setUpdateDate(curr); | ||||
| record.setComposeOrderType(EnumComposeOrder.SINGLE.getCode()); | |||||
| // 保存订单 | // 保存订单 | ||||
| try { | try { | ||||
| @@ -1648,29 +1658,29 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| /** | /** | ||||
| * 微信关闭订单 | * 微信关闭订单 | ||||
| */ | */ | ||||
| @Override | |||||
| public ResultData orderClose(WxOrder order,EnumPayWay payWay) { | |||||
| // 1. get c appid | |||||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order,payWay); | |||||
| // 2. get pay order | |||||
| WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| payOrderQ.updateTenantInfo(order); | |||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | |||||
| List<WxPayOrder> payOrders = wxPayOrderMapper.selectList(new QueryWrapper(payOrderQ)); | |||||
| // 3. wx pay order close | |||||
| for (WxPayOrder payOrder : payOrders) { | |||||
| try { | |||||
| wxPayOrderService.payOrderClose(appInfo, payOrder); | |||||
| } catch (Exception e) { | |||||
| logger.error("微信关单失败:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR); | |||||
| } | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| // @Override | |||||
| // public ResultData orderClose(WxOrder order,EnumPayWay payWay) { | |||||
| // // 1. get c appid | |||||
| // WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order,payWay); | |||||
| // // 2. get pay order | |||||
| // WxPayOrder payOrderQ = new WxPayOrder(); | |||||
| // payOrderQ.updateTenantInfo(order); | |||||
| // payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||||
| // payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | |||||
| // List<WxPayOrder> payOrders = wxPayOrderMapper.selectList(new QueryWrapper(payOrderQ)); | |||||
| // | |||||
| // // 3. wx pay order close | |||||
| // for (WxPayOrder payOrder : payOrders) { | |||||
| // try { | |||||
| // wxPayOrderService.payOrderClose(appInfo, payOrder); | |||||
| // } catch (Exception e) { | |||||
| // logger.error("微信关单失败:" + e.getMessage()); | |||||
| // throw new MallinkException(ErrorCode.PAY_ORDER_ERROR); | |||||
| // } | |||||
| // } | |||||
| // | |||||
| // return new ResultData(); | |||||
| // } | |||||
| @Override | @Override | ||||
| public WxOrder getById(Long id,String tenantId) { | public WxOrder getById(Long id,String tenantId) { | ||||
| @@ -1969,7 +1979,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @Override | @Override | ||||
| public WxComposeOrder saveOrderForCoupon(WxCUserBasicInfo user,List<OrderComposeSaveDto> orderSave,EnumPayWay payWay) { | |||||
| public WxComposeOrder saveOrderForCoupon(EnumComposeOrder composeOrderType,WxCUserBasicInfo user,List<OrderComposeSaveDto> orderSave,EnumPayWay payWay) { | |||||
| WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | ||||
| // 防止同一用户重复下单,1秒内 | // 防止同一用户重复下单,1秒内 | ||||
| String key = new StringBuilder().append("saveComposeOrder:").append(user.getId()).toString(); | String key = new StringBuilder().append("saveComposeOrder:").append(user.getId()).toString(); | ||||
| @@ -1980,14 +1990,15 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| cUserBasicInfoRedisTemplate.opsForValue().set(key, user, 1000, TimeUnit.MILLISECONDS); | cUserBasicInfoRedisTemplate.opsForValue().set(key, user, 1000, TimeUnit.MILLISECONDS); | ||||
| WxComposeOrder composeOrder = createWxComposeOrder(user, orderSave, payWay); | |||||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(composeOrderType.getCode()); | |||||
| WxComposeOrder composeOrder = orderAdapterService.createDBMainOrder(user, orderSave, payWay); | |||||
| for (int i = 0 ; i < orderSave.size(); i ++) { | for (int i = 0 ; i < orderSave.size(); i ++) { | ||||
| OrderComposeSaveDto orderdto = orderSave.get(i); | OrderComposeSaveDto orderdto = orderSave.get(i); | ||||
| //券是一个数量一个订单, 实物是一个产品一个订单 | //券是一个数量一个订单, 实物是一个产品一个订单 | ||||
| int totalOrderCount = 1; | int totalOrderCount = 1; | ||||
| if (orderdto.getWxCoupon().oneNumberOneOrder()) { | |||||
| if (orderAdapterService.isOneNumberOneOrder(orderdto.getWxCoupon())) { | |||||
| totalOrderCount = orderdto.getCount(); | totalOrderCount = orderdto.getCount(); | ||||
| } | } | ||||
| int perCouponNumber = 1; | int perCouponNumber = 1; | ||||
| @@ -2033,87 +2044,6 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| return composeOrder; | return composeOrder; | ||||
| } | } | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public WxOrder saveSingleOrderForCoupon(WxCUserBasicInfo user,OrderSaveDto orderSaveDto,WxCoupon coupon,EnumPayWay payWay,int couponNumber) { | |||||
| WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | |||||
| // 防止同一用户重复下单,1秒内 | |||||
| String key = new StringBuilder().append("saveSingleOrder:").append(user.getId()).toString(); | |||||
| boolean hasKey = cUserBasicInfoRedisTemplate.hasKey(key); | |||||
| if (hasKey) { | |||||
| logger.error("用户正在下单,请求异常返回,user: {} " + JSON.toJSONString(user)); | |||||
| throw new MallinkException(ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION); | |||||
| } | |||||
| cUserBasicInfoRedisTemplate.opsForValue().set(key, user, 1000, TimeUnit.MILLISECONDS); | |||||
| // 是否砍价 | |||||
| boolean isPress = orderSaveDto.getPress() != null ? orderSaveDto.getPress() : false; | |||||
| WxOrder order = null; | |||||
| if (checkCouponIsFree(coupon)) { | |||||
| // 免费券 | |||||
| order = proxy.saveFreeOrderForCoupon(null,user, coupon,couponNumber, orderSaveDto.getCouponChannelId(), orderSaveDto.getFormId(), null,payWay); | |||||
| if (order != null) { | |||||
| // 6. 下订单完成,发送内部消息 | |||||
| // 下订单完成,发送内部消息 | |||||
| try { | |||||
| proxy.sendOrderSuccessActionMsg(order); | |||||
| } catch (Exception e) { | |||||
| logger.error("内部消息发送失败: " + e.getMessage(),e); | |||||
| throw new MallinkException(ErrorCode.MSG_INSIDE_ERROR); | |||||
| } | |||||
| } | |||||
| } else { | |||||
| // 有价券 | |||||
| order = proxy.saveNoFreeOrderForCoupon(null,user, coupon,couponNumber, orderSaveDto.getCouponChannelId(), isPress, orderSaveDto.getOrderGroupId(), orderSaveDto.getFormId()); | |||||
| } | |||||
| // couponActionLog | |||||
| // try { | |||||
| // wxCouponActionLogService.addOne(order, order.getProductId(), order.getOrderNumber(), EnumCouponSendSendType.ACTIVE.getCode(), orderdto.getSignleOrder().getCouponChannelId(),0L); | |||||
| // } catch (Exception e) { | |||||
| // // 库存恢复 | |||||
| // stockBack(order); | |||||
| // logger.error("保存订单:" + e.getMessage()); | |||||
| // throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); | |||||
| // } | |||||
| return order; | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public WxComposeOrder createWxComposeOrder(WxCUserBasicInfo user,List<OrderComposeSaveDto> orderSave,EnumPayWay payWay) { | |||||
| WxComposeOrder order =new WxComposeOrder(); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| order.setId(idWorker.nextId()); | |||||
| order.setCUserId(user.getId()); | |||||
| int payment = 0; | |||||
| for (OrderComposeSaveDto ocsd : orderSave) { | |||||
| boolean isPress = ocsd.getSignleOrder().getPress() != null ? ocsd.getSignleOrder().getPress() : false; | |||||
| payment = payment+getCouponPayment(ocsd.getWxCoupon(), isPress, ocsd.getSignleOrder().getOrderGroupId(),ocsd.getCount()); | |||||
| } | |||||
| order.setPayment(payment); | |||||
| order.setCreateDate(new Date()); | |||||
| wxComposeOrderMapper.insert(order); | |||||
| return order; | |||||
| } | |||||
| private int getCouponPayment(WxCoupon coupon,boolean isPress,Long orderGroupId,int couponNumber) { | |||||
| // 4.1 券价格 | |||||
| int payment = coupon.getSalePrice()*couponNumber; | |||||
| //Integer orderStatus = EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode(); | |||||
| if (isPress || coupon.getType().equals(EnumCouponType.COUPON_PRESS.getCode())) { | |||||
| // 砍价券 初始是全价即面额 | |||||
| payment = coupon.getPrice()*couponNumber; | |||||
| } | |||||
| if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | |||||
| if (orderGroupId == null) { | |||||
| // 拼团券 初始是全价即面额 | |||||
| payment = coupon.getPrice()*couponNumber; | |||||
| } else { | |||||
| //orderStatus = EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode(); | |||||
| } | |||||
| } | |||||
| return payment; | |||||
| } | |||||
| @Override | @Override | ||||
| public boolean checkCouponIsFree(WxCoupon coupon) { | public boolean checkCouponIsFree(WxCoupon coupon) { | ||||
| return coupon.getSalePrice() == 0; | return coupon.getSalePrice() == 0; | ||||
| @@ -2145,9 +2075,8 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setPayment(0); | record.setPayment(0); | ||||
| record.setFormId(formId); | record.setFormId(formId); | ||||
| record.setOrderGroupId(0L); | record.setOrderGroupId(0L); | ||||
| if (null != composeOrder) { | |||||
| record.setComposeOrderId(composeOrder.getId()); | |||||
| } | |||||
| record.setComposeOrderId(composeOrder.getMainOrderId()); | |||||
| record.setComposeOrderType(composeOrder.getComposeOrderType()); | |||||
| record.setCouponNumber(couponNumber); | record.setCouponNumber(couponNumber); | ||||
| try { | try { | ||||
| proxy.saveFreeOrder(record, user, coupon); | proxy.saveFreeOrder(record, user, coupon); | ||||
| @@ -2209,9 +2138,8 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| record.setFormId(formId); | record.setFormId(formId); | ||||
| record.setPayment(payment); | record.setPayment(payment); | ||||
| record.setOrderStatus(orderStatus); | record.setOrderStatus(orderStatus); | ||||
| if (null != composeOrder) { | |||||
| record.setComposeOrderId(composeOrder.getId()); | |||||
| } | |||||
| record.setComposeOrderId(composeOrder.getMainOrderId()); | |||||
| record.setComposeOrderType(composeOrder.getComposeOrderType()); | |||||
| record.setCouponNumber(couponNumber); | record.setCouponNumber(couponNumber); | ||||
| try { | try { | ||||
| orderNumber = proxy.saveNoFreeOrder(record, user, coupon, isPress); | orderNumber = proxy.saveNoFreeOrder(record, user, coupon, isPress); | ||||
| @@ -2501,9 +2429,8 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Override | @Override | ||||
| public ResultData composeSaveOrder(List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity) { | |||||
| logger.info("composeOrderSave: " + composeOrderSaveDto); | |||||
| //TODO 事务,所有券都购买成功才行 | |||||
| public ResultData composeSaveOrder(EnumComposeOrder composeOrderType,List<OrderComposeSaveDto> composeOrderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity) { | |||||
| logger.info("composeSaveOrder: " + composeOrderSaveDto); | |||||
| try { | try { | ||||
| if (null == composeOrderSaveDto || composeOrderSaveDto.size() <= 0 ) { | if (null == composeOrderSaveDto || composeOrderSaveDto.size() <= 0 ) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"无商品信息"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"无商品信息"); | ||||
| @@ -2522,11 +2449,12 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| for ( int i =0 ; i< composeOrderSaveDto.size(); i++ ) { | for ( int i =0 ; i< composeOrderSaveDto.size(); i++ ) { | ||||
| OrderComposeSaveDto ocsd = composeOrderSaveDto.get(i); | OrderComposeSaveDto ocsd = composeOrderSaveDto.get(i); | ||||
| singleOrderCheck(ocsd,ocsd.getSignleOrder(),ocsd.getCount(),wxCUserBasicInfo,payWay,tenantEntity,i+1,singleProduct); | |||||
| WxCoupon coupon = singleOrderCheck(ocsd.getSignleOrder(),ocsd.getCount(),wxCUserBasicInfo,payWay,tenantEntity,i+1,singleProduct); | |||||
| ocsd.setWxCoupon(coupon); | |||||
| } | } | ||||
| WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | ||||
| try { | try { | ||||
| WxComposeOrder order = proxy.saveOrderForCoupon(wxCUserBasicInfo, composeOrderSaveDto, payWay); | |||||
| WxComposeOrder order = proxy.saveOrderForCoupon(composeOrderType,wxCUserBasicInfo, composeOrderSaveDto, payWay); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error("saveOrderForCoupon error.",e); | logger.error("saveOrderForCoupon error.",e); | ||||
| @@ -2546,43 +2474,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| @Override | |||||
| public ResultData singleSaveOrder(OrderSaveDto orderSaveDto,Long cUserId,EnumPayWay payWay,TenantEntity tenantEntity) { | |||||
| logger.info("singleOrderSave: " + orderSaveDto); | |||||
| try { | |||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUserId,tenantEntity.getFinalTenantId()); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + cUserId); | |||||
| return new ResultData(ErrorCode.MEMBER_IS_LOCKED); | |||||
| } | |||||
| int couponNumber = 1; | |||||
| boolean singleNumber = true; | |||||
| WxCoupon coupon = singleOrderCheck(null,orderSaveDto,couponNumber,wxCUserBasicInfo,payWay,tenantEntity,1,singleNumber); | |||||
| WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); | |||||
| try { | |||||
| WxOrder order = proxy.saveSingleOrderForCoupon(wxCUserBasicInfo, orderSaveDto,coupon, payWay,couponNumber); | |||||
| return new ResultData(order); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("saveOrderForCoupon error.",e); | |||||
| throw new MallinkException(e.getErrorCode(), e.getMessage()); | |||||
| } catch (Exception e) { | |||||
| logger.error("saveOrderForCoupon error.",e); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL.getCode(), e.getMessage()); | |||||
| } | |||||
| }catch(MallinkException me) { | |||||
| return new ResultData(me.getErrorCode(),me.getMessage()); | |||||
| }catch(Exception e) { | |||||
| logger.error("composeSaveOrder error.",e); | |||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | |||||
| } | |||||
| } | |||||
| private WxCoupon singleOrderCheck(OrderComposeSaveDto ocsd,OrderSaveDto orderSaveDto,int productCount,WxCUserBasicInfo wxCUserBasicInfo,EnumPayWay payWay,TenantEntity tenantEntity,int curindex,boolean singleProduct) { | |||||
| private WxCoupon singleOrderCheck(OrderSaveDto orderSaveDto,int productCount,WxCUserBasicInfo wxCUserBasicInfo,EnumPayWay payWay,TenantEntity tenantEntity,int curindex,boolean singleProduct) { | |||||
| logger.info("OrderSave: " + orderSaveDto); | logger.info("OrderSave: " + orderSaveDto); | ||||
| String premsg = ""; | String premsg = ""; | ||||
| if (singleProduct) { | if (singleProduct) { | ||||
| @@ -2608,10 +2500,6 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF.getCode(),premsg+"【"+coupon.getTitle()+"】已作废"); | throw new MallinkException(ErrorCode.COUPON_IS_TAKE_OFF.getCode(),premsg+"【"+coupon.getTitle()+"】已作废"); | ||||
| } | } | ||||
| if (null != ocsd) { | |||||
| ocsd.setWxCoupon(coupon); | |||||
| } | |||||
| //判断是否是拼团订单,如果是拼团订单,判断现在进行中的,和已完成的数量是否超出券的限制 | //判断是否是拼团订单,如果是拼团订单,判断现在进行中的,和已完成的数量是否超出券的限制 | ||||
| if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | ||||
| int ordercount = this.countUserCouponGroupOrder(wxCUserBasicInfo,coupon.getId(),coupon.getTenantId()); | int ordercount = this.countUserCouponGroupOrder(wxCUserBasicInfo,coupon.getId(),coupon.getTenantId()); | ||||
| @@ -2739,9 +2627,4 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public WxComposeOrder getComposeOrder(Long orderId, TenantEntity tenantEntity) { | |||||
| return wxComposeOrderMapper.selectById(orderId, tenantEntity.getTenantId()); | |||||
| } | |||||
| } | } | ||||
| @@ -18,6 +18,9 @@ import com.iformall.mapper.*; | |||||
| import com.iformall.pay.*; | import com.iformall.pay.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.helper.WxPayOrderServiceHelper; | import com.iformall.service.helper.WxPayOrderServiceHelper; | ||||
| import com.iformall.service.order.OrderAdapterService; | |||||
| import com.iformall.service.order.OrderFactory; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.PayServiceFactory; | import com.iformall.service.pay.PayServiceFactory; | ||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.service.pay.service.pay.CDrivingPayService; | import com.iformall.service.pay.service.pay.CDrivingPayService; | ||||
| @@ -105,7 +108,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| WxCashOutService cashOutService; | WxCashOutService cashOutService; | ||||
| @Autowired | @Autowired | ||||
| WxComposeOrderMapper wxComposeOrderMapper; | |||||
| WxBatchOrderMapper wxBatchOrderMapper; | |||||
| @Autowired | |||||
| OrderFactory orderFactory; | |||||
| JSONObject errorMapQuery = JSON.parseObject("{" + | JSONObject errorMapQuery = JSON.parseObject("{" + | ||||
| "\"ORDERNOTEXIST\":{\"detail\":\"此交易订单号不存在\",\"reason\":\"查询系统中不存在此交易订单号\",\"resolution\":\"该API只能查提交支付交易返回成功的订单,请商户检查需要查询的订单号是否正确\"},\n" + | "\"ORDERNOTEXIST\":{\"detail\":\"此交易订单号不存在\",\"reason\":\"查询系统中不存在此交易订单号\",\"resolution\":\"该API只能查提交支付交易返回成功的订单,请商户检查需要查询的订单号是否正确\"},\n" + | ||||
| @@ -114,7 +120,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| //方法必须为public AopContext.currentProxy() | //方法必须为public AopContext.currentProxy() | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @Override | @Override | ||||
| public void handleSuccessOrder(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxOrder order,PayQueryAdapterResult queryResult,boolean isScheduleTask,boolean composeSingleOrder) { | |||||
| public void handleSuccessOrder(WxPayOrder oldRecord,WxComposeOrder composeOrder,PayQueryAdapterResult queryResult,boolean isScheduleTask,boolean isOneChildOrder) { | |||||
| Date curDate = new Date(); | Date curDate = new Date(); | ||||
| if (oldRecord.getPayOrderStatus() != EnumPayStatus.PAY_STATUS_SUCCESS.getCode()) { | if (oldRecord.getPayOrderStatus() != EnumPayStatus.PAY_STATUS_SUCCESS.getCode()) { | ||||
| WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | ||||
| @@ -136,12 +142,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| oldRecord.setUpdateTime(curDate); | oldRecord.setUpdateTime(curDate); | ||||
| wxPayOrderMapper.updateById(oldRecord); | wxPayOrderMapper.updateById(oldRecord); | ||||
| if (isComposeOrder(oldRecord)) { | |||||
| if (EnumComposeOrder.isSingle(composeOrder.getComposeOrderType())) { | |||||
| //如果是组合订单的单独处理。如定时处理的单个订单 | //如果是组合订单的单独处理。如定时处理的单个订单 | ||||
| if (composeSingleOrder) { | |||||
| if (isOneChildOrder) { | |||||
| //处理其他信息 | //处理其他信息 | ||||
| try { | try { | ||||
| proxy.handleOrderPaySingleOrderSuccess(oldRecord, order, transactionId,isScheduleTask); | |||||
| proxy.handleOrderPaySingleOrderSuccess(composeOrder.getSingleOrder(),oldRecord, transactionId,isScheduleTask); | |||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | ||||
| } | } | ||||
| @@ -149,10 +155,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| if ( null == composeOrder) { | if ( null == composeOrder) { | ||||
| throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(),"composeOrder is null."); | throw new MallinkException(ErrorCode.PAY_ORDER_ERROR.getCode(),"composeOrder is null."); | ||||
| } | } | ||||
| List<WxOrder> orderList = getComposeChildOrders(composeOrder.getId(),oldRecord); | |||||
| List<WxOrder> orderList = orderFactory.getOrderAdapterService(composeOrder.getComposeOrderType()).getChildOrders(composeOrder, oldRecord.getTenantId()); | |||||
| for (WxOrder o : orderList) { | for (WxOrder o : orderList) { | ||||
| try { | try { | ||||
| proxy.handleOrderPaySingleOrderSuccess(oldRecord, o, transactionId, isScheduleTask); | |||||
| proxy.handleOrderPaySingleOrderSuccess(o,oldRecord, transactionId, isScheduleTask); | |||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| logger.error("handleSuccessOrder error.",e); | logger.error("handleSuccessOrder error.",e); | ||||
| } | } | ||||
| @@ -161,7 +167,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| }else { | }else { | ||||
| //处理其他信息 | //处理其他信息 | ||||
| try { | try { | ||||
| proxy.handleOrderPaySingleOrderSuccess(oldRecord, order, transactionId,isScheduleTask); | |||||
| proxy.handleOrderPaySingleOrderSuccess(composeOrder.getSingleOrder(),oldRecord, transactionId,isScheduleTask); | |||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage()); | ||||
| } | } | ||||
| @@ -169,23 +175,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| } | } | ||||
| private boolean isComposeOrder(WxPayOrder record) { | |||||
| if ((null != record.getComposeOrder()) && (EnumComposeOrder.YES.getCode().intValue() == record.getComposeOrder().intValue())) { | |||||
| return true; | |||||
| } | |||||
| return false; | |||||
| } | |||||
| private List<WxOrder> getComposeChildOrders(Long composeOrderId,TenantEntity tenantEntity) { | |||||
| WxOrder orderq = new WxOrder(); | |||||
| orderq.setComposeOrderId(composeOrderId); | |||||
| orderq.updateTenantInfo(tenantEntity); | |||||
| List<WxOrder> orderList = wxOrderService.findList(orderq); | |||||
| return orderList; | |||||
| } | |||||
| @Override | @Override | ||||
| public WxPayOrder handleWxOrderQuery(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxOrder order,WxAppinfo appInfo,WxPayAccount payAccount,IdWorker idworker,boolean repeatPay) { | |||||
| public WxPayOrder handleWxOrderQuery(WxPayOrder oldRecord,WxComposeOrder composeOrder,WxAppinfo appInfo,WxPayAccount payAccount,IdWorker idworker,boolean repeatPay) { | |||||
| PayQueryAdapterResult queryResult = null; | PayQueryAdapterResult queryResult = null; | ||||
| int wxpaystatus = 0; | int wxpaystatus = 0; | ||||
| try { | try { | ||||
| @@ -199,7 +192,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode()==wxpaystatus) { | if (EnumPayStatus.PAY_STATUS_SUCCESS.getCode()==wxpaystatus) { | ||||
| //直接调用不会触发事务,spring事务基于AOP代理 | //直接调用不会触发事务,spring事务基于AOP代理 | ||||
| WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | ||||
| proxy.handleSuccessOrder(oldRecord,composeOrder,order,queryResult,false,false); | |||||
| proxy.handleSuccessOrder(oldRecord,composeOrder,queryResult,false,false); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_EXIST.getCode(),"该订单已经支付,请勿重复支付!"); | throw new MallinkException(ErrorCode.PAY_ORDER_EXIST.getCode(),"该订单已经支付,请勿重复支付!"); | ||||
| }else if (EnumPayStatus.PAY_STATUS_REFUND.getCode()==wxpaystatus) { | }else if (EnumPayStatus.PAY_STATUS_REFUND.getCode()==wxpaystatus) { | ||||
| throw new MallinkException(ErrorCode.PAY_ORDER_REFUND.getCode(),"该订单已经退款,无法支付!"); | throw new MallinkException(ErrorCode.PAY_ORDER_REFUND.getCode(),"该订单已经退款,无法支付!"); | ||||
| @@ -233,29 +226,19 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| * //如果是组合订单,则wxPayOrder对应的是WxcomposeOrder.为了兼容之前的,需要把支付相关信息也保存到子订单里面去 | * //如果是组合订单,则wxPayOrder对应的是WxcomposeOrder.为了兼容之前的,需要把支付相关信息也保存到子订单里面去 | ||||
| * //如果是非组合订单,则wxPayOrder对应的是wxOrder | * //如果是非组合订单,则wxPayOrder对应的是wxOrder | ||||
| */ | */ | ||||
| WxComposeOrder composeOrder = null; | |||||
| WxOrder order = null; | |||||
| if (isComposeOrder(record)) { | |||||
| composeOrder = wxComposeOrderMapper.selectById(record.getOrderId(), appInfo.getTenantId()); | |||||
| if (null == composeOrder) { | |||||
| logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| List<WxOrder> orderList = getComposeChildOrders(composeOrder.getId(),appInfo.getTenantInfo()); | |||||
| for (WxOrder o : orderList) { | |||||
| checkSinglePayOrder(o, user, payWay); | |||||
| } | |||||
| }else { | |||||
| // 1. check 订单 | |||||
| order = wxOrderMapper.selectById(record.getOrderId(),appInfo.getTenantId()); | |||||
| if (order == null) { | |||||
| logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| checkSinglePayOrder(order, user, payWay); | |||||
| } | |||||
| PayAdapterResult payResult = createPayOrder(appInfo, user, record,composeOrder,order, payWay, params); | |||||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(record.getComposeOrder()); | |||||
| WxComposeOrder composeOrder = orderAdapterService.getComposeOrder(record.getOrderId(),appInfo.getTenantId()); | |||||
| if (null == composeOrder) { | |||||
| logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, appInfo.getTenantId()); | |||||
| for (WxOrder o : orderList) { | |||||
| checkSinglePayOrder(o, user, payWay); | |||||
| } | |||||
| PayAdapterResult payResult = createPayOrder(appInfo, user, record,composeOrder, payWay, params); | |||||
| if (payResult.isSuccess()) { | if (payResult.isSuccess()) { | ||||
| return new ResultData(Result.SUCCESS,"创建支付单成功",payResult.getData()); | return new ResultData(Result.SUCCESS,"创建支付单成功",payResult.getData()); | ||||
| }else { | }else { | ||||
| @@ -328,17 +311,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| } | } | ||||
| private PayAdapterResult createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user,WxPayOrder record,WxComposeOrder composeOrder,WxOrder order, EnumPayWay payWay,PayExtraParam params) { | |||||
| /** | |||||
| * 如果composeOrder存在,支付关联composeOrder | |||||
| * 如果composeOrder不存在,支付关联WxOrder | |||||
| */ | |||||
| boolean isComposeOrder = isComposeOrder(record); | |||||
| Long orderId = order.getId(); | |||||
| if (isComposeOrder) { | |||||
| orderId = composeOrder.getId(); | |||||
| } | |||||
| private PayAdapterResult createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user,WxPayOrder record,WxComposeOrder composeOrder, EnumPayWay payWay,PayExtraParam params) { | |||||
| IdWorker idworker = IdWorker.get(); | IdWorker idworker = IdWorker.get(); | ||||
| EnumPayShare isShare = EnumPayShare.NO; | EnumPayShare isShare = EnumPayShare.NO; | ||||
| @@ -351,7 +324,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| Date currentDate = new Date(); | Date currentDate = new Date(); | ||||
| //一个订单只有一条支付记录。 | //一个订单只有一条支付记录。 | ||||
| WxPayOrder orderq = new WxPayOrder(); | WxPayOrder orderq = new WxPayOrder(); | ||||
| orderq.setOrderId(orderId); | |||||
| orderq.setOrderId(composeOrder.getMainOrderId()); | |||||
| List<WxPayOrder> list = wxPayOrderMapper.findList(orderq); | List<WxPayOrder> list = wxPayOrderMapper.findList(orderq); | ||||
| WxPayOrder oldRecord = null; | WxPayOrder oldRecord = null; | ||||
| if (null != list && list.size() > 0) { | if (null != list && list.size() > 0) { | ||||
| @@ -361,11 +334,11 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| if (null != oldRecord) { | if (null != oldRecord) { | ||||
| //如果是已经支付成功,则不能再次支付。如果是支付中的,也不能再次支付,等待微信同步结果 | //如果是已经支付成功,则不能再次支付。如果是支付中的,也不能再次支付,等待微信同步结果 | ||||
| if (oldRecord.getPayOrderStatus()==EnumPayStatus.PAY_STATUS_SUCCESS.getCode()) { | if (oldRecord.getPayOrderStatus()==EnumPayStatus.PAY_STATUS_SUCCESS.getCode()) { | ||||
| logger.error("已支付>>>" + order); | |||||
| logger.error("已支付>>>" + record); | |||||
| throw new MallinkException(ErrorCode.PAY_ORDER_EXIST); | throw new MallinkException(ErrorCode.PAY_ORDER_EXIST); | ||||
| //如果是支付中的,则调用微信接口查询支付状态 | //如果是支付中的,则调用微信接口查询支付状态 | ||||
| }else if (oldRecord.getPayOrderStatus()==EnumPayStatus.PAY_STATUS_WAIT.getCode()) { | }else if (oldRecord.getPayOrderStatus()==EnumPayStatus.PAY_STATUS_WAIT.getCode()) { | ||||
| record = handleWxOrderQuery(oldRecord,composeOrder,order,appInfo,payAccount,idworker,true); | |||||
| record = handleWxOrderQuery(oldRecord,composeOrder,appInfo,payAccount,idworker,true); | |||||
| if (null == record) { | if (null == record) { | ||||
| throw new MallinkException(ErrorCode.PAY_ORDER_PAYING.getCode(),"订单微信查询支付状态失败!"); | throw new MallinkException(ErrorCode.PAY_ORDER_PAYING.getCode(),"订单微信查询支付状态失败!"); | ||||
| } | } | ||||
| @@ -391,7 +364,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| record.setId(id); | record.setId(id); | ||||
| record.updateTenantInfo(order); | |||||
| record.updateTenantInfo(appInfo.getTenantInfo()); | |||||
| record.setCUserId(user.getId()); | record.setCUserId(user.getId()); | ||||
| record.setCreateTime(currentDate); | record.setCreateTime(currentDate); | ||||
| record.setUpdateTime(currentDate); | record.setUpdateTime(currentDate); | ||||
| @@ -399,14 +372,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| record.setPayTimeEnd(currentDate); | record.setPayTimeEnd(currentDate); | ||||
| // 支付单号 | // 支付单号 | ||||
| record.setPayOrderNo(String.valueOf(id)); | record.setPayOrderNo(String.valueOf(id)); | ||||
| record.setPayAmount(order.getPayment()); | |||||
| record.setPayAmount(composeOrder.getPayment()); | |||||
| record.setPayFrom(payWay.getCode()); | record.setPayFrom(payWay.getCode()); | ||||
| record.setPayVendor(payWay.getCode()); | record.setPayVendor(payWay.getCode()); | ||||
| record.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | record.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | ||||
| record.setShare(isShare.getCode()); | record.setShare(isShare.getCode()); | ||||
| if (isComposeOrder) { | |||||
| record.setComposeOrder(EnumComposeOrder.YES.getCode()); | |||||
| } | |||||
| record.setComposeOrder(composeOrder.getComposeOrderType()); | |||||
| if (isShare == EnumPayShare.YES) { | if (isShare == EnumPayShare.YES) { | ||||
| // 分账金额 | // 分账金额 | ||||
| int iChargeFee = PayUtils.getPayRate(record.getPayAmount(), payAccount.getRate(), false); | int iChargeFee = PayUtils.getPayRate(record.getPayAmount(), payAccount.getRate(), false); | ||||
| @@ -430,7 +401,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| logger.debug("wxPayRecord md5 before:"+record.toString()); | logger.debug("wxPayRecord md5 before:"+record.toString()); | ||||
| String beforemd5 = HashUtil.md5(record.toString()); | String beforemd5 = HashUtil.md5(record.toString()); | ||||
| PayAdapterResult payResult = payServiceFactory.getPayAdapterService(payWay.getCode()).pay(payAccount, composeOrder,order, record,isShare,appInfo, currentDate, params); | |||||
| PayAdapterResult payResult = payServiceFactory.getPayAdapterService(payWay.getCode()).pay(payAccount, record,composeOrder,isShare,appInfo, currentDate, params); | |||||
| String aftermd5 = HashUtil.md5(record.toString()); | String aftermd5 = HashUtil.md5(record.toString()); | ||||
| if (beforemd5.equals(aftermd5)) { | if (beforemd5.equals(aftermd5)) { | ||||
| logger.error("支付方式["+payWay.getCode()+"]支付接口【pay】过程中 WxPayOrder 未做更新.record:"+record.toString()); | logger.error("支付方式["+payWay.getCode()+"]支付接口【pay】过程中 WxPayOrder 未做更新.record:"+record.toString()); | ||||
| @@ -466,7 +437,12 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| try { | try { | ||||
| // 1. check 订单 | // 1. check 订单 | ||||
| WxOrder order = wxOrderMapper.selectById(record.getOrderId(),appInfo.getTenantId()); | |||||
| WxComposeOrder composeOrder = orderFactory.getOrderAdapterService(EnumComposeOrder.SINGLE.getCode()).getComposeOrder(record.getOrderId(), appInfo.getTenantId()); | |||||
| if (composeOrder == null) { | |||||
| logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| WxOrder order = composeOrder.getSingleOrder(); | |||||
| if (order == null) { | if (order == null) { | ||||
| logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); | logger.error("pay order, order not allow, repaymentReq: " + record.toString() + ", payWay: " + payWay.toString()); | ||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | ||||
| @@ -486,7 +462,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| // 2. check 是否有支付订单 | // 2. check 是否有支付订单 | ||||
| Date currentDate = new Date(); | Date currentDate = new Date(); | ||||
| WxPayOrder pq = new WxPayOrder(); | WxPayOrder pq = new WxPayOrder(); | ||||
| pq.setOrderId(record.getOrderId()); | |||||
| pq.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||||
| List<WxPayOrder> list = wxPayOrderMapper.findList(pq); | List<WxPayOrder> list = wxPayOrderMapper.findList(pq); | ||||
| String payOrderNo = ""; | String payOrderNo = ""; | ||||
| if (list.size() <= 0) { | if (list.size() <= 0) { | ||||
| @@ -534,7 +510,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| logger.debug("wxPayRecord md5 before:"+record.toString()); | logger.debug("wxPayRecord md5 before:"+record.toString()); | ||||
| String beforemd5 = HashUtil.md5(record.toString()); | String beforemd5 = HashUtil.md5(record.toString()); | ||||
| PayAdapterResult payResult = payServiceFactory.getPayAdapterService(payWay.getCode()).pay(payAccount, null,order, record,isShare,appInfo, currentDate, params); | |||||
| PayAdapterResult payResult = payServiceFactory.getPayAdapterService(payWay.getCode()).pay(payAccount, record,composeOrder,isShare,appInfo, currentDate, params); | |||||
| String aftermd5 = HashUtil.md5(record.toString()); | String aftermd5 = HashUtil.md5(record.toString()); | ||||
| if (beforemd5.equals(aftermd5)) { | if (beforemd5.equals(aftermd5)) { | ||||
| logger.error("支付方式["+payWay.getCode()+"]支付接口【pay】过程中 WxPayOrder 未做更新.record:"+record.toString()); | logger.error("支付方式["+payWay.getCode()+"]支付接口【pay】过程中 WxPayOrder 未做更新.record:"+record.toString()); | ||||
| @@ -810,8 +786,22 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void handler(WxPayOrder record,WxComposeOrder composeOrder,List<WxOrder> composeChildOrders,WxOrder order, String transactionId,Long cUserId) { | |||||
| public void handleOrderPaySuccess(WxPayOrder record, String transactionId) { | |||||
| WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | |||||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(record.getComposeOrder()); | |||||
| WxComposeOrder composeOrder = orderAdapterService.getComposeOrder(record.getOrderId(), record.getTenantId()); | |||||
| List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, record.getTenantId()); | |||||
| proxy.handler(record,composeOrder,orderList,transactionId,null); | |||||
| //组合支付的订单,循环所有子订单 | |||||
| for (WxOrder o : orderList) { | |||||
| proxy.handleOrderPaySingleOrderSuccess(o,record, transactionId, false); | |||||
| } | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public void handler(WxPayOrder record,WxComposeOrder composeOrder,List<WxOrder> composeChildOrders, String transactionId,Long cUserId) { | |||||
| Date currentDate = new Date(); | Date currentDate = new Date(); | ||||
| EnumPayStatus payStatus = EnumPayStatus.getEnum(record.getPayOrderStatus()); | EnumPayStatus payStatus = EnumPayStatus.getEnum(record.getPayOrderStatus()); | ||||
| // 判断支付状态 | // 判断支付状态 | ||||
| @@ -836,39 +826,8 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| "is paid success , orderId : " + record.getOrderId()); | "is paid success , orderId : " + record.getOrderId()); | ||||
| return; | return; | ||||
| } | } | ||||
| if ((null != record.getComposeOrder()) && (EnumComposeOrder.YES.getCode().intValue() == record.getComposeOrder().intValue()) ) { | |||||
| if (composeOrder == null) { | |||||
| logger.error("pay success handle, order " + record.getOrderId() + " not found , payOrderid : " + record.getPayOrderNo()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| if (null != cUserId) { | |||||
| composeOrder.setCUserId(cUserId); | |||||
| wxComposeOrderMapper.updateCUserId(composeOrder); | |||||
| if (null != composeChildOrders) { | |||||
| List<Long> ids = new ArrayList<Long>(); | |||||
| for (WxOrder o : composeChildOrders) { | |||||
| ids.add(o.getId()); | |||||
| } | |||||
| if (ids.size() > 0 ) { | |||||
| WxOrder updateOrders = new WxOrder(); | |||||
| updateOrders.setIds(ids); | |||||
| updateOrders.setCUserId(cUserId); | |||||
| updateOrders.updateTenantInfo(order); | |||||
| wxOrderMapper.updateCUserId(updateOrders); | |||||
| } | |||||
| } | |||||
| } | |||||
| }else { | |||||
| if (order == null) { | |||||
| logger.error("pay success handle, order " + record.getOrderId() + " not found , payOrderid : " + record.getPayOrderNo()); | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| if (null != cUserId) { | |||||
| order.setCUserId(cUserId); | |||||
| wxOrderMapper.updateCUserId(order); | |||||
| } | |||||
| if (null != cUserId) { | |||||
| orderFactory.getOrderAdapterService(composeOrder.getComposeOrderType()).updateChildOrdersCUserId(composeOrder, composeChildOrders, cUserId); | |||||
| } | } | ||||
| // 修改支付订单状态 | // 修改支付订单状态 | ||||
| @@ -890,27 +849,8 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public void handleOrderPaySuccess(WxPayOrder record, String transactionId) { | |||||
| WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | |||||
| if (isComposeOrder(record)) { | |||||
| WxComposeOrder composeOrder = wxComposeOrderMapper.selectById(record.getOrderId(), record.getTenantId()); | |||||
| List<WxOrder> orderList = getComposeChildOrders(composeOrder.getId(),record); | |||||
| proxy.handler(record,composeOrder,orderList,null,transactionId,null); | |||||
| //组合支付的订单,循环所有子订单 | |||||
| for (WxOrder o : orderList) { | |||||
| proxy.handleOrderPaySingleOrderSuccess(record, o, transactionId, false); | |||||
| } | |||||
| }else { | |||||
| WxOrder order = wxOrderMapper.selectById(record.getOrderId(),record.getTenantId()); | |||||
| proxy.handler(record,null,null,order,transactionId,null); | |||||
| proxy.handleOrderPaySingleOrderSuccess(record, order, transactionId,false); | |||||
| } | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| public void handleOrderPaySingleOrderSuccess(WxPayOrder record,WxOrder order, String transactionId,boolean isScheduleTask) { | |||||
| public void handleOrderPaySingleOrderSuccess(WxOrder order,WxPayOrder record, String transactionId,boolean isScheduleTask) { | |||||
| Long productId = order.getProductId(); | Long productId = order.getProductId(); | ||||
| WxCoupon wxCoupon = wxCouponMapper.selectById(productId,order.getTenantId()); | WxCoupon wxCoupon = wxCouponMapper.selectById(productId,order.getTenantId()); | ||||
| if(wxCoupon != null) { | if(wxCoupon != null) { | ||||
| @@ -985,11 +925,13 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| } | } | ||||
| WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | WxPayOrderServiceImpl proxy = (WxPayOrderServiceImpl) AopContext.currentProxy(); | ||||
| WxOrder order = wxOrderMapper.selectById(record.getOrderId(),record.getTenantId()); | |||||
| proxy.handler(record, null, null, order, transcationId, basicUserId); | |||||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(record.getComposeOrder()); | |||||
| WxComposeOrder composeOrder = orderAdapterService.getComposeOrder(record.getOrderId(), record.getTenantId()); | |||||
| List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, record.getTenantId()); | |||||
| proxy.handler(record, composeOrder,orderList, transcationId, basicUserId); | |||||
| // B端收银台核销券处理, 收银台支付和券支付可能不是同一个人 | // B端收银台核销券处理, 收银台支付和券支付可能不是同一个人 | ||||
| WxPayOrder payOrderQ = new WxPayOrder(); | WxPayOrder payOrderQ = new WxPayOrder(); | ||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setOrderId(composeOrder.getMainOrderId()); | |||||
| //payOrderQ.setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | //payOrderQ.setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | ||||
| //payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | //payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | ||||
| try { | try { | ||||
| @@ -997,7 +939,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| if (unPayOrder != null) { | if (unPayOrder != null) { | ||||
| // 更新券支付状态 | // 更新券支付状态 | ||||
| try { | try { | ||||
| unPayOrder.setOrderId(order.getId()); | |||||
| unPayOrder.setOrderId(composeOrder.getMainOrderId()); | |||||
| unPayOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | unPayOrder.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | ||||
| unPayOrder.setPayVendor(payWay.getCode()); | unPayOrder.setPayVendor(payWay.getCode()); | ||||
| wxPayOrderMapper.updateById(unPayOrder); | wxPayOrderMapper.updateById(unPayOrder); | ||||
| @@ -1020,9 +962,10 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| } | } | ||||
| // 修改订单状态 | // 修改订单状态 | ||||
| order.setCUserId(basicUserId); | |||||
| //order.setCUserId(basicUserId); handler方法已经处理了 | |||||
| try { | try { | ||||
| int _count = wxOrderService.microPayOrderSuccess(order); | |||||
| int _count = wxOrderService.microPayOrderSuccess(composeOrder.getSingleOrder()); | |||||
| if (_count > 1) { | if (_count > 1) { | ||||
| logger.error("order micro pay count > 1"); | logger.error("order micro pay count > 1"); | ||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL); | throw new MallinkException(ErrorCode.ORDER_IS_FAIL); | ||||
| @@ -1045,7 +988,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| if (record.getShare().equals(EnumPayShare.NO.getCode())) { | if (record.getShare().equals(EnumPayShare.NO.getCode())) { | ||||
| //结算记录 | //结算记录 | ||||
| try { | try { | ||||
| proxy.createMerchantSubsidy(record, order, new Date(),true); | |||||
| proxy.createMerchantSubsidy(record, composeOrder.getSingleOrder(), new Date(),true); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("收银台结算记录失败,{}", e.getMessage()); | logger.error("收银台结算记录失败,{}", e.getMessage()); | ||||
| } | } | ||||
| @@ -1110,7 +1053,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| private void doCouponPayOrder(WxMerchantBUser user, WxPayOrder record, WxOrder order,EnumPayWay payWay) { | private void doCouponPayOrder(WxMerchantBUser user, WxPayOrder record, WxOrder order,EnumPayWay payWay) { | ||||
| // B端收银台核销券处理 | // B端收银台核销券处理 | ||||
| WxPayOrder payOrderQ = new WxPayOrder(); | WxPayOrder payOrderQ = new WxPayOrder(); | ||||
| payOrderQ.setOrderId(order.getId()); | |||||
| payOrderQ.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||||
| payOrderQ.setCUserId(record.getCUserId()); | payOrderQ.setCUserId(record.getCUserId()); | ||||
| payOrderQ.setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | payOrderQ.setPayFrom(EnumPayFrom.INSIDE_B.getCode()); | ||||
| payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_WAIT.getCode()); | ||||
| @@ -1121,7 +1064,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| try { | try { | ||||
| WxPayOrder payOrderCoupon = new WxPayOrder(); | WxPayOrder payOrderCoupon = new WxPayOrder(); | ||||
| payOrderCoupon.setId(unPayOrder.getId()); | payOrderCoupon.setId(unPayOrder.getId()); | ||||
| payOrderCoupon.setOrderId(order.getId()); | |||||
| payOrderCoupon.setOrderId(EnumComposeOrder.getPayOrderId(order)); | |||||
| payOrderCoupon.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | payOrderCoupon.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode()); | ||||
| wxPayOrderMapper.updateById(payOrderCoupon); | wxPayOrderMapper.updateById(payOrderCoupon); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -1212,29 +1155,17 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| return; | return; | ||||
| } | } | ||||
| WxComposeOrder composeOrder = null; | |||||
| WxOrder order = null; | |||||
| boolean isComposeOrder = isComposeOrder(record); | |||||
| List<WxOrder> orderList = null; | |||||
| if (isComposeOrder) { | |||||
| composeOrder = wxComposeOrderMapper.selectById(record.getOrderId(), record.getTenantId()); | |||||
| if (composeOrder == null) { | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| } | |||||
| orderList = getComposeChildOrders(composeOrder.getId(),record); | |||||
| for (WxOrder o : orderList) { | |||||
| checkSingleOrder(o, record); | |||||
| } | |||||
| }else { | |||||
| order = wxOrderMapper.selectById(record.getOrderId(),record.getTenantId()); | |||||
| checkSingleOrder(order, record); | |||||
| } | |||||
| OrderAdapterService orderAdapterService = orderFactory.getOrderAdapterService(record.getComposeOrder()); | |||||
| WxComposeOrder composeOrder = orderAdapterService.getComposeOrder(record.getOrderId(), record.getTenantId()); | |||||
| List<WxOrder> orderList = orderAdapterService.getChildOrders(composeOrder, record.getTenantId()); | |||||
| for (WxOrder o : orderList) { | |||||
| checkSingleOrder(o, record); | |||||
| } | |||||
| if (record.getId() > 0) { | if (record.getId() > 0) { | ||||
| // 有价券 | // 有价券 | ||||
| if (EnumPayStatus.PAY_STATUS_FAIL.getCode() == status) { | if (EnumPayStatus.PAY_STATUS_FAIL.getCode() == status) { | ||||
| // 1. get appinfo | // 1. get appinfo | ||||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(order,EnumPayWay.getEnum(record.getPayVendor())); | |||||
| WxAppinfo appInfo = wxAppinfoService.getCAppInfo(record,EnumPayWay.getEnum(record.getPayVendor())); | |||||
| // 前端支付取消, | // 前端支付取消, | ||||
| // 回调未返回,主动检查支付订单状态 | // 回调未返回,主动检查支付订单状态 | ||||
| try { | try { | ||||
| @@ -1276,16 +1207,9 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| */ | */ | ||||
| } else if (record.getPayOrderStatus() == EnumPayStatus.PAY_STATUS_CANCEL.getCode()) { | } else if (record.getPayOrderStatus() == EnumPayStatus.PAY_STATUS_CANCEL.getCode()) { | ||||
| try { | try { | ||||
| if (isComposeOrder && null != orderList) { | |||||
| for (WxOrder o : orderList) { | |||||
| wxOrderService.updateOrderStatus(o, EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | |||||
| } | |||||
| }else { | |||||
| int _count = wxOrderService.updateOrderStatus(order, EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | |||||
| if (_count > 1) { | |||||
| throw new MallinkException(ErrorCode.ORDER_IS_FAIL); | |||||
| } | |||||
| } | |||||
| for (WxOrder o : orderList) { | |||||
| wxOrderService.updateOrderStatus(o, EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL); | |||||
| } | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL); | throw new MallinkException(ErrorCode.DB_FAIL); | ||||
| @@ -0,0 +1,47 @@ | |||||
| package com.iformall.service.order; | |||||
| import java.util.List; | |||||
| import com.iformall.domain.dto.OrderComposeSaveDto; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| public interface OrderAdapterService { | |||||
| /** | |||||
| * 数据库创建组合主订单,不是wxOrder.单个的模式不用创建 | |||||
| * @return | |||||
| */ | |||||
| WxComposeOrder createDBMainOrder(WxCUserBasicInfo user,List<OrderComposeSaveDto> orderSave,EnumPayWay payWay); | |||||
| /** | |||||
| * 是否是一个数量一个订单。一个产品肯定是一个订单 | |||||
| * @return | |||||
| */ | |||||
| boolean isOneNumberOneOrder(WxCoupon coupon); | |||||
| /** | |||||
| * 查询订单信息,单个模式查询WxOrder | |||||
| * @param mainOrderId | |||||
| * @param tenantEntity | |||||
| * @return | |||||
| */ | |||||
| WxComposeOrder getComposeOrder(Long mainOrderId,String tenantId); | |||||
| /** | |||||
| * 查询子订单 | |||||
| * @return | |||||
| */ | |||||
| List<WxOrder> getChildOrders(WxComposeOrder composeOrder, String tenantId); | |||||
| /** | |||||
| * 更新子订单cUserId | |||||
| * @param orderList | |||||
| * @param cUserId | |||||
| */ | |||||
| void updateChildOrdersCUserId(WxComposeOrder composeOrder,List<WxOrder> orderList,Long cUserId); | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| package com.iformall.service.order; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.service.order.impl.BatchOrderAdapterService; | |||||
| @Service | |||||
| public class OrderFactory { | |||||
| @Autowired | |||||
| BatchOrderAdapterService batchOrderAdapterService; | |||||
| public OrderAdapterService getOrderAdapterService(Integer composeOrderType) { | |||||
| return null; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| package com.iformall.service.order.entity; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import lombok.Data; | |||||
| @Data | |||||
| public class WxComposeOrder { | |||||
| public WxComposeOrder(Long mainOrderId,Integer composeOrderType) { | |||||
| this.mainOrderId = mainOrderId; | |||||
| this.composeOrderType = composeOrderType; | |||||
| } | |||||
| private Long mainOrderId; | |||||
| private Integer composeOrderType; | |||||
| private Integer payment; | |||||
| private WxOrder singleOrder;//单个模式时不用重复查询 | |||||
| private Object mainOrder;//真正的主订单对象 | |||||
| } | |||||
| @@ -0,0 +1,108 @@ | |||||
| package com.iformall.service.order.impl; | |||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.transaction.annotation.Propagation; | |||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.dto.OrderComposeSaveDto; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.mapper.WxBatchOrderMapper; | |||||
| import com.iformall.mapper.WxOrderMapper; | |||||
| import com.iformall.service.WxOrderService; | |||||
| import com.iformall.service.order.OrderAdapterService; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.order.util.OrderHelper; | |||||
| /** | |||||
| * 购物车批量下单 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Service | |||||
| public class BatchOrderAdapterService implements OrderAdapterService { | |||||
| @Autowired | |||||
| WxBatchOrderMapper wxBatchOrderMapper; | |||||
| @Autowired | |||||
| WxOrderMapper wxOrderMapper; | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public WxComposeOrder createDBMainOrder(WxCUserBasicInfo user,List<OrderComposeSaveDto> orderSave,EnumPayWay payWay) { | |||||
| WxBatchOrder order =new WxBatchOrder(); | |||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| order.setId(idWorker.nextId()); | |||||
| order.setCUserId(user.getId()); | |||||
| int payment = 0; | |||||
| for (OrderComposeSaveDto ocsd : orderSave) { | |||||
| boolean isPress = ocsd.getSignleOrder().getPress() != null ? ocsd.getSignleOrder().getPress() : false; | |||||
| payment = payment+OrderHelper.getCouponPayment(ocsd.getWxCoupon(), isPress, ocsd.getSignleOrder().getOrderGroupId(),ocsd.getCount()); | |||||
| } | |||||
| order.setPayment(payment); | |||||
| order.setCreateDate(new Date()); | |||||
| wxBatchOrderMapper.insert(order); | |||||
| return new WxComposeOrder(order.getId(),EnumComposeOrder.BATCH.getCode()); | |||||
| } | |||||
| @Override | |||||
| public boolean isOneNumberOneOrder(WxCoupon coupon) { | |||||
| return coupon.oneNumberOneOrder(); | |||||
| } | |||||
| @Override | |||||
| public WxComposeOrder getComposeOrder(Long mainOrderId, String tenantId) { | |||||
| WxBatchOrder order = wxBatchOrderMapper.selectById(mainOrderId, tenantId); | |||||
| WxComposeOrder corder = new WxComposeOrder(order.getId(),EnumComposeOrder.BATCH.getCode()); | |||||
| corder.setPayment(order.getPayment()); | |||||
| corder.setMainOrder(order); | |||||
| return corder; | |||||
| } | |||||
| @Override | |||||
| public List<WxOrder> getChildOrders(WxComposeOrder composeOrder, String tenantId) { | |||||
| WxOrder orderq = new WxOrder(); | |||||
| orderq.setComposeOrderId(composeOrder.getMainOrderId()); | |||||
| orderq.setComposeOrderType(EnumComposeOrder.BATCH.getCode()); | |||||
| orderq.setTenantId(tenantId); | |||||
| List<WxOrder> orderList = wxOrderMapper.findList(orderq); | |||||
| return orderList; | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void updateChildOrdersCUserId(WxComposeOrder composeOrder,List<WxOrder> orderList, Long cUserId) { | |||||
| if (null != cUserId) { | |||||
| WxBatchOrder order = (WxBatchOrder) composeOrder.getMainOrder(); | |||||
| order.setCUserId(cUserId); | |||||
| wxBatchOrderMapper.updateCUserId(order); | |||||
| if (null != orderList) { | |||||
| List<Long> ids = new ArrayList<Long>(); | |||||
| for (WxOrder o : orderList) { | |||||
| ids.add(o.getId()); | |||||
| } | |||||
| if (ids.size() > 0 ) { | |||||
| WxOrder updateOrders = new WxOrder(); | |||||
| updateOrders.setIds(ids); | |||||
| updateOrders.setCUserId(cUserId); | |||||
| updateOrders.updateTenantInfo(order); | |||||
| wxOrderMapper.updateCUserId(updateOrders); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,78 @@ | |||||
| package com.iformall.service.order.impl; | |||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import org.springframework.transaction.annotation.Propagation; | |||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.dto.OrderComposeSaveDto; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.domain.po.WxOrder; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumComposeOrder; | |||||
| import com.iformall.enums.EnumPayWay; | |||||
| import com.iformall.mapper.WxBatchOrderMapper; | |||||
| import com.iformall.mapper.WxOrderMapper; | |||||
| import com.iformall.service.order.OrderAdapterService; | |||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.order.util.OrderHelper; | |||||
| /** | |||||
| * 购物车批量下单 | |||||
| * @author alascor | |||||
| * | |||||
| */ | |||||
| @Service | |||||
| public class SingleOrderAdapterService implements OrderAdapterService { | |||||
| @Autowired | |||||
| WxOrderMapper wxOrderMapper; | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public WxComposeOrder createDBMainOrder(WxCUserBasicInfo user,List<OrderComposeSaveDto> orderSave,EnumPayWay payWay) { | |||||
| //do nothing, | |||||
| return new WxComposeOrder(0L, EnumComposeOrder.SINGLE.getCode()); | |||||
| } | |||||
| @Override | |||||
| public boolean isOneNumberOneOrder(WxCoupon coupon) { | |||||
| return true; | |||||
| } | |||||
| @Override | |||||
| public WxComposeOrder getComposeOrder(Long mainOrderId, String tenantId) { | |||||
| WxOrder wxOrder = wxOrderMapper.selectById(mainOrderId, tenantId); | |||||
| WxComposeOrder corder = new WxComposeOrder(wxOrder.getId(),EnumComposeOrder.SINGLE.getCode()); | |||||
| corder.setPayment(wxOrder.getPayment()); | |||||
| corder.setSingleOrder(wxOrder); | |||||
| return corder; | |||||
| } | |||||
| @Override | |||||
| public List<WxOrder> getChildOrders(WxComposeOrder composeOrder, String tenantId) { | |||||
| List<WxOrder> list = new ArrayList<WxOrder>(); | |||||
| list.add(composeOrder.getSingleOrder()); | |||||
| return list; | |||||
| } | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||||
| @Override | |||||
| public void updateChildOrdersCUserId(WxComposeOrder composeOrder,List<WxOrder> orderList, Long cUserId) { | |||||
| WxOrder order = composeOrder.getSingleOrder(); | |||||
| order.setCUserId(cUserId); | |||||
| wxOrderMapper.updateCUserId(order); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,26 @@ | |||||
| package com.iformall.service.order.util; | |||||
| import com.iformall.domain.po.WxCoupon; | |||||
| import com.iformall.enums.EnumCouponType; | |||||
| public class OrderHelper { | |||||
| public static int getCouponPayment(WxCoupon coupon,boolean isPress,Long orderGroupId,int couponNumber) { | |||||
| // 4.1 券价格 | |||||
| int payment = coupon.getSalePrice()*couponNumber; | |||||
| //Integer orderStatus = EnumOrderStatus.ORDER_STATUS_PENDING_PAYMENT.getCode(); | |||||
| if (isPress || coupon.getType().equals(EnumCouponType.COUPON_PRESS.getCode())) { | |||||
| // 砍价券 初始是全价即面额 | |||||
| payment = coupon.getPrice()*couponNumber; | |||||
| } | |||||
| if (coupon.getType().equals(EnumCouponType.COUPON_GROUP.getCode())) { | |||||
| if (orderGroupId == null) { | |||||
| // 拼团券 初始是全价即面额 | |||||
| payment = coupon.getPrice()*couponNumber; | |||||
| } else { | |||||
| //orderStatus = EnumOrderStatus.ORDER_STATUS_COOPERATING_UNPAID.getCode(); | |||||
| } | |||||
| } | |||||
| return payment; | |||||
| } | |||||
| } | |||||
| @@ -5,11 +5,12 @@ import java.util.Date; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| import com.iformall.domain.po.WxPayOrder; | import com.iformall.domain.po.WxPayOrder; | ||||
| import com.iformall.enums.EnumPayShare; | import com.iformall.enums.EnumPayShare; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | ||||
| import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayQueryAdapterResult; | ||||
| @@ -28,7 +29,7 @@ public interface PayAdapterService { | |||||
| * @return | * @return | ||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| public PayAdapterResult pay(WxPayAccount payAccount,WxComposeOrder composeOrder,WxOrder order,WxPayOrder record ,EnumPayShare isShare,WxAppinfo appInfo,Date currentDate, PayExtraParam params) throws Exception; | |||||
| public PayAdapterResult pay(WxPayAccount payAccount,WxPayOrder record ,WxComposeOrder composeOrder,EnumPayShare isShare,WxAppinfo appInfo,Date currentDate, PayExtraParam params) throws Exception; | |||||
| /** | /** | ||||
| * 查询支付结果,调用对应端的API查询支付结果 | * 查询支付结果,调用对应端的API查询支付结果 | ||||
| @@ -16,7 +16,7 @@ import com.iformall.common.Result; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.PosCouponOrderVerify; | import com.iformall.domain.po.PosCouponOrderVerify; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxCouponOrder; | import com.iformall.domain.po.WxCouponOrder; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| @@ -7,11 +7,12 @@ import java.util.Map; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| import com.iformall.domain.po.WxPayOrder; | import com.iformall.domain.po.WxPayOrder; | ||||
| import com.iformall.enums.EnumPayShare; | import com.iformall.enums.EnumPayShare; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.service.pay.service.pay.CDrivingPayService; | import com.iformall.service.pay.service.pay.CDrivingPayService; | ||||
| import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | ||||
| @@ -22,7 +23,7 @@ import com.iformall.service.pay.service.pay.wx.BaseWxPayAdapterService; | |||||
| public class WxH5PayService extends BaseWxPayAdapterService implements CDrivingPayService{ | public class WxH5PayService extends BaseWxPayAdapterService implements CDrivingPayService{ | ||||
| @Override | @Override | ||||
| public PayAdapterResult pay(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order, WxPayOrder record, EnumPayShare isShare, | |||||
| public PayAdapterResult pay(WxPayAccount payAccount, WxPayOrder record,WxComposeOrder composeOrder, EnumPayShare isShare, | |||||
| WxAppinfo appInfo, Date currentDate, PayExtraParam params) throws Exception { | WxAppinfo appInfo, Date currentDate, PayExtraParam params) throws Exception { | ||||
| // TODO Auto-generated method stub | // TODO Auto-generated method stub | ||||
| return null; | return null; | ||||
| @@ -13,7 +13,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| import com.iformall.domain.po.WxPayOrder; | import com.iformall.domain.po.WxPayOrder; | ||||
| @@ -26,6 +26,7 @@ import com.iformall.pay.WxPay; | |||||
| import com.iformall.pay.WxPayOrderP; | import com.iformall.pay.WxPayOrderP; | ||||
| import com.iformall.pay.WxPayOrderSP; | import com.iformall.pay.WxPayOrderSP; | ||||
| import com.iformall.pay.WxPayment; | import com.iformall.pay.WxPayment; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.service.pay.service.pay.CDrivingPayService; | import com.iformall.service.pay.service.pay.CDrivingPayService; | ||||
| import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | import com.iformall.service.pay.service.pay.entity.PayAdapterResult; | ||||
| @@ -60,7 +61,7 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| "\"NOT_UTF8\":{\"detail\":\"编码格式错误\",\"reason\":\"未使用指定编码格式\",\"resolution\":\"请使用UTF-8编码格式\"}}"); | "\"NOT_UTF8\":{\"detail\":\"编码格式错误\",\"reason\":\"未使用指定编码格式\",\"resolution\":\"请使用UTF-8编码格式\"}}"); | ||||
| private WxPayOrderP generateWxPayOrderP(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order, WxPayOrder record,String openId,String appId,Date currentDate) throws Exception { | |||||
| private WxPayOrderP generateWxPayOrderP(WxPayAccount payAccount,WxComposeOrder composeOrder, WxPayOrder record,String openId,String appId,Date currentDate) throws Exception { | |||||
| // 统一下单 普通商户模式 | // 统一下单 普通商户模式 | ||||
| String noncestr = Utility.generate32UUID(); | String noncestr = Utility.generate32UUID(); | ||||
| WxPayOrderP wxPayOrderP = new WxPayOrderP(); | WxPayOrderP wxPayOrderP = new WxPayOrderP(); | ||||
| @@ -68,30 +69,14 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| wxPayOrderP.setAppid(appId); | wxPayOrderP.setAppid(appId); | ||||
| wxPayOrderP.setMch_id(payAccount.getMchId()); | wxPayOrderP.setMch_id(payAccount.getMchId()); | ||||
| wxPayOrderP.setNonce_str(noncestr); | wxPayOrderP.setNonce_str(noncestr); | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderP.setBody("组合商品"); | |||||
| }else { | |||||
| wxPayOrderP.setBody(order.getDetail()); | |||||
| } | |||||
| wxPayOrderP.setBody("在线商品"); | |||||
| wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); | wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderP.setTotal_fee(composeOrder.getPayment()); | |||||
| }else { | |||||
| wxPayOrderP.setTotal_fee(order.getPayment()); | |||||
| } | |||||
| wxPayOrderP.setTotal_fee(composeOrder.getPayment()); | |||||
| wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP | wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderP.setGoods_tag("组合商品"); | |||||
| }else { | |||||
| wxPayOrderP.setGoods_tag(String.valueOf(order.getProductId())); | |||||
| } | |||||
| wxPayOrderP.setGoods_tag("在线商品"); | |||||
| wxPayOrderP.setNotify_url(payAccount.getPayNotifyUrl()); | wxPayOrderP.setNotify_url(payAccount.getPayNotifyUrl()); | ||||
| wxPayOrderP.setTrade_type(WxPay.TradeType.JSAPI.name()); // 终端类型 | wxPayOrderP.setTrade_type(WxPay.TradeType.JSAPI.name()); // 终端类型 | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderP.setProduct_id(String.valueOf(composeOrder.getId())); // 订单ID | |||||
| }else { | |||||
| wxPayOrderP.setProduct_id(String.valueOf(order.getId())); | |||||
| } | |||||
| wxPayOrderP.setProduct_id(String.valueOf(composeOrder.getMainOrderId())); // 订单ID | |||||
| wxPayOrderP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentDate)); | wxPayOrderP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentDate)); | ||||
| Date futureDate = new Date(); | Date futureDate = new Date(); | ||||
| futureDate.setTime(currentDate.getTime() + 15 * 60 * 1000); | futureDate.setTime(currentDate.getTime() + 15 * 60 * 1000); | ||||
| @@ -150,7 +135,7 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| private WxPayOrderSP generateWxPayOrderSP(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order, WxPayOrder record,WxAppinfo appInfo,String openId,String appId,Date currentDate,EnumPayShare isShare) throws Exception { | |||||
| private WxPayOrderSP generateWxPayOrderSP(WxPayAccount payAccount, WxComposeOrder composeOrder,WxPayOrder record,WxAppinfo appInfo,String openId,String appId,Date currentDate,EnumPayShare isShare) throws Exception { | |||||
| String noncestr = Utility.generate32UUID(); | String noncestr = Utility.generate32UUID(); | ||||
| WxPayOrderSP wxPayOrderSP = new WxPayOrderSP(); | WxPayOrderSP wxPayOrderSP = new WxPayOrderSP(); | ||||
| wxPayOrderSP.setSub_openid(openId); | wxPayOrderSP.setSub_openid(openId); | ||||
| @@ -159,27 +144,14 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| wxPayOrderSP.setSub_appid(appId); | wxPayOrderSP.setSub_appid(appId); | ||||
| wxPayOrderSP.setSub_mch_id(payAccount.getSubMchId()); | wxPayOrderSP.setSub_mch_id(payAccount.getSubMchId()); | ||||
| wxPayOrderSP.setNonce_str(noncestr); | wxPayOrderSP.setNonce_str(noncestr); | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderSP.setBody("组合商品"); | |||||
| }else { | |||||
| wxPayOrderSP.setBody(order.getDetail()); | |||||
| } | |||||
| wxPayOrderSP.setBody("在线商品"); | |||||
| wxPayOrderSP.setOut_trade_no(record.getPayOrderNo()); | wxPayOrderSP.setOut_trade_no(record.getPayOrderNo()); | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderSP.setTotal_fee(composeOrder.getPayment().toString()); | |||||
| }else { | |||||
| wxPayOrderSP.setTotal_fee(order.getPayment().toString()); | |||||
| } | |||||
| wxPayOrderSP.setTotal_fee(composeOrder.getPayment().toString()); | |||||
| wxPayOrderSP.setSpbill_create_ip(record.getIp()); // 终端IP | wxPayOrderSP.setSpbill_create_ip(record.getIp()); // 终端IP | ||||
| wxPayOrderSP.setGoods_tag(String.valueOf(order.getProductId())); // 券ID | |||||
| wxPayOrderSP.setGoods_tag("在线商品"); // 券ID | |||||
| wxPayOrderSP.setNotify_url(payAccount.getPayNotifyUrl()); | wxPayOrderSP.setNotify_url(payAccount.getPayNotifyUrl()); | ||||
| wxPayOrderSP.setTrade_type(WxPay.TradeType.JSAPI.name()); // 终端类型 | wxPayOrderSP.setTrade_type(WxPay.TradeType.JSAPI.name()); // 终端类型 | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderSP.setProduct_id("组合商品"); // 券ID | |||||
| }else { | |||||
| wxPayOrderSP.setProduct_id(String.valueOf(order.getProductId())); | |||||
| } | |||||
| wxPayOrderSP.setProduct_id(String.valueOf(composeOrder.getMainOrderId())); // | |||||
| wxPayOrderSP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentDate)); | wxPayOrderSP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentDate)); | ||||
| Date futureDate = new Date(); | Date futureDate = new Date(); | ||||
| futureDate.setTime(currentDate.getTime() + 15 * 60 * 1000); | futureDate.setTime(currentDate.getTime() + 15 * 60 * 1000); | ||||
| @@ -242,7 +214,7 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| @Override | @Override | ||||
| public PayAdapterResult pay(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order, WxPayOrder record,EnumPayShare isShare,WxAppinfo appInfo,Date currentDate, PayExtraParam params) throws Exception { | |||||
| public PayAdapterResult pay(WxPayAccount payAccount, WxPayOrder record,WxComposeOrder composeOrder,EnumPayShare isShare,WxAppinfo appInfo,Date currentDate, PayExtraParam params) throws Exception { | |||||
| if (null == params ) { | if (null == params ) { | ||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"openId为空"); | throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"openId为空"); | ||||
| } | } | ||||
| @@ -252,7 +224,7 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| } | } | ||||
| //普通商户模式 | //普通商户模式 | ||||
| if (payAccount.getType() == EnumPayMode.MCH.getCode()) { | if (payAccount.getType() == EnumPayMode.MCH.getCode()) { | ||||
| WxPayOrderP wxPayOrderP = generateWxPayOrderP(payAccount,composeOrder,order,record,openId,appInfo.getAppId(),currentDate); | |||||
| WxPayOrderP wxPayOrderP = generateWxPayOrderP(payAccount,composeOrder,record,openId,appInfo.getAppId(),currentDate); | |||||
| String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderP)); | String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderP)); | ||||
| log.info("pay order, wechat pushOrder, " + wxPayOrderP.toString() + ", response: " + response.toString()); | log.info("pay order, wechat pushOrder, " + wxPayOrderP.toString() + ", response: " + response.toString()); | ||||
| Map<String, String> returnMap = WxPayment.xmlToMap(response); | Map<String, String> returnMap = WxPayment.xmlToMap(response); | ||||
| @@ -260,7 +232,7 @@ public class WxMiniAppPayAdapterService extends BaseWxPayAdapterService implemen | |||||
| } else { | } else { | ||||
| // 统一下单 // 服务商模式 | // 统一下单 // 服务商模式 | ||||
| WxPayOrderSP wxPayOrderSP = generateWxPayOrderSP(payAccount,composeOrder,order,record,appInfo,openId,appInfo.getAppId(),currentDate,isShare); | |||||
| WxPayOrderSP wxPayOrderSP = generateWxPayOrderSP(payAccount,composeOrder,record,appInfo,openId,appInfo.getAppId(),currentDate,isShare); | |||||
| String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderSP)); | String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderSP)); | ||||
| log.info("pay order, wechat pushOrder, " + wxPayOrderSP.toString() + ", response: " + response.toString()); | log.info("pay order, wechat pushOrder, " + wxPayOrderSP.toString() + ", response: " + response.toString()); | ||||
| Map<String, String> returnMap = WxPayment.xmlToMap(response); | Map<String, String> returnMap = WxPayment.xmlToMap(response); | ||||
| @@ -12,7 +12,7 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.domain.po.WxAppinfo; | import com.iformall.domain.po.WxAppinfo; | ||||
| import com.iformall.domain.po.WxCUser; | import com.iformall.domain.po.WxCUser; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.WxComposeOrder; | |||||
| import com.iformall.domain.po.WxBatchOrder; | |||||
| import com.iformall.domain.po.WxMall; | import com.iformall.domain.po.WxMall; | ||||
| import com.iformall.domain.po.WxOrder; | import com.iformall.domain.po.WxOrder; | ||||
| import com.iformall.domain.po.WxPayAccount; | import com.iformall.domain.po.WxPayAccount; | ||||
| @@ -30,6 +30,7 @@ import com.iformall.pay.WxMicroPayOrderSP; | |||||
| import com.iformall.pay.WxPay; | import com.iformall.pay.WxPay; | ||||
| import com.iformall.pay.WxPayment; | import com.iformall.pay.WxPayment; | ||||
| import com.iformall.service.WxCUserService; | import com.iformall.service.WxCUserService; | ||||
| import com.iformall.service.order.entity.WxComposeOrder; | |||||
| import com.iformall.service.pay.entity.PayExtraParam; | import com.iformall.service.pay.entity.PayExtraParam; | ||||
| import com.iformall.service.pay.service.pay.CPassivePayService; | import com.iformall.service.pay.service.pay.CPassivePayService; | ||||
| import com.iformall.service.pay.service.pay.entity.CreateUser; | import com.iformall.service.pay.service.pay.entity.CreateUser; | ||||
| @@ -46,7 +47,7 @@ import me.chanjar.weixin.common.error.WxErrorException; | |||||
| @Service | @Service | ||||
| public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implements CPassivePayService{ | public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implements CPassivePayService{ | ||||
| private WxMicroPayOrderP generateWxMicroPayOrderP(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order, WxPayOrder record, EnumPayShare isShare, | |||||
| private WxMicroPayOrderP generateWxMicroPayOrderP(WxPayAccount payAccount, WxComposeOrder composeOrder, WxPayOrder record, EnumPayShare isShare, | |||||
| WxAppinfo appInfo, Date currentDate,String bAppId,String bUserPhone) throws Exception { | WxAppinfo appInfo, Date currentDate,String bAppId,String bUserPhone) throws Exception { | ||||
| String noncestr = Utility.generate32UUID(); | String noncestr = Utility.generate32UUID(); | ||||
| WxMicroPayOrderP wxPayOrderP = new WxMicroPayOrderP(); | WxMicroPayOrderP wxPayOrderP = new WxMicroPayOrderP(); | ||||
| @@ -54,11 +55,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| wxPayOrderP.setMch_id(payAccount.getMchId()); | wxPayOrderP.setMch_id(payAccount.getMchId()); | ||||
| wxPayOrderP.setDevice_info(bUserPhone); | wxPayOrderP.setDevice_info(bUserPhone); | ||||
| wxPayOrderP.setNonce_str(noncestr); | wxPayOrderP.setNonce_str(noncestr); | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderP.setBody("组合商品"); | |||||
| }else { | |||||
| wxPayOrderP.setBody(order.getDetail()); | |||||
| } | |||||
| wxPayOrderP.setBody("在线商品"); | |||||
| wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); | wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); | ||||
| wxPayOrderP.setTotal_fee(record.getPayAmount()); | wxPayOrderP.setTotal_fee(record.getPayAmount()); | ||||
| wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP | wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP | ||||
| @@ -104,7 +101,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| } | } | ||||
| private WxMicroPayOrderSP generateWxMicroPayOrderSP(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order,WxPayOrder record, EnumPayShare isShare, | |||||
| private WxMicroPayOrderSP generateWxMicroPayOrderSP(WxPayAccount payAccount, WxComposeOrder composeOrder,WxPayOrder record, EnumPayShare isShare, | |||||
| WxAppinfo appInfo, Date currentDate,String bUserPhone) throws Exception { | WxAppinfo appInfo, Date currentDate,String bUserPhone) throws Exception { | ||||
| String noncestr = Utility.generate32UUID(); | String noncestr = Utility.generate32UUID(); | ||||
| WxMicroPayOrderSP wxPayOrderSP = new WxMicroPayOrderSP(); | WxMicroPayOrderSP wxPayOrderSP = new WxMicroPayOrderSP(); | ||||
| @@ -114,11 +111,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| wxPayOrderSP.setSub_mch_id(payAccount.getSubMchId()); | wxPayOrderSP.setSub_mch_id(payAccount.getSubMchId()); | ||||
| wxPayOrderSP.setDevice_info(bUserPhone); | wxPayOrderSP.setDevice_info(bUserPhone); | ||||
| wxPayOrderSP.setNonce_str(noncestr); | wxPayOrderSP.setNonce_str(noncestr); | ||||
| if (null != composeOrder) { | |||||
| wxPayOrderSP.setBody("组合商品"); | |||||
| }else { | |||||
| wxPayOrderSP.setBody(order.getDetail()); | |||||
| } | |||||
| wxPayOrderSP.setBody("在线商品"); | |||||
| wxPayOrderSP.setOut_trade_no(record.getPayOrderNo()); | wxPayOrderSP.setOut_trade_no(record.getPayOrderNo()); | ||||
| wxPayOrderSP.setTotal_fee(record.getPayAmount()); | wxPayOrderSP.setTotal_fee(record.getPayAmount()); | ||||
| wxPayOrderSP.setSpbill_create_ip(record.getIp()); | wxPayOrderSP.setSpbill_create_ip(record.getIp()); | ||||
| @@ -170,7 +163,7 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| @Override | @Override | ||||
| public PayAdapterResult pay(WxPayAccount payAccount, WxComposeOrder composeOrder,WxOrder order, WxPayOrder record, EnumPayShare isShare, | |||||
| public PayAdapterResult pay(WxPayAccount payAccount, WxPayOrder record, WxComposeOrder composeOrder, EnumPayShare isShare, | |||||
| WxAppinfo appInfo, Date currentDate, PayExtraParam params) throws Exception { | WxAppinfo appInfo, Date currentDate, PayExtraParam params) throws Exception { | ||||
| if (payAccount.getType() == EnumPayMode.MCH.getCode()) { | if (payAccount.getType() == EnumPayMode.MCH.getCode()) { | ||||
| // 扫码支付 普通商户模式 | // 扫码支付 普通商户模式 | ||||
| @@ -183,12 +176,12 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"bUserPhone 不能为空"); | throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"bUserPhone 不能为空"); | ||||
| } | } | ||||
| WxMicroPayOrderP wxPayOrderP = generateWxMicroPayOrderP(payAccount, composeOrder,order, record, isShare, appInfo, currentDate, bAppId, bUserPhone); | |||||
| WxMicroPayOrderP wxPayOrderP = generateWxMicroPayOrderP(payAccount, composeOrder,record, isShare, appInfo, currentDate, bAppId, bUserPhone); | |||||
| String response = WxPay.micropay(BeanUtils.toStringMap(wxPayOrderP)); | String response = WxPay.micropay(BeanUtils.toStringMap(wxPayOrderP)); | ||||
| log.info("pay order, wechat micropay, " + wxPayOrderP.toString() + ", response: " + response.toString()); | log.info("pay order, wechat micropay, " + wxPayOrderP.toString() + ", response: " + response.toString()); | ||||
| Map<String, String> returnMap = WxPayment.xmlToMap(response); | Map<String, String> returnMap = WxPayment.xmlToMap(response); | ||||
| returnMap.put("payOrderId", record.getPayOrderNo()); | returnMap.put("payOrderId", record.getPayOrderNo()); | ||||
| returnMap.put("orderId", String.valueOf(order.getId())); | |||||
| returnMap.put("orderId", String.valueOf(composeOrder.getMainOrderId())); | |||||
| return getWxMicroPayOrderPResult(returnMap, record, payAccount); | return getWxMicroPayOrderPResult(returnMap, record, payAccount); | ||||
| } else { | } else { | ||||
| // 统一下单 // 服务商模式 | // 统一下单 // 服务商模式 | ||||
| @@ -196,12 +189,12 @@ public class WxMiniMaPayAdapterService extends BaseWxPayAdapterService implement | |||||
| if (StringUtils.isBlank(bUserPhone)) { | if (StringUtils.isBlank(bUserPhone)) { | ||||
| throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"bUserPhone 不能为空"); | throw new MallinkException(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"bUserPhone 不能为空"); | ||||
| } | } | ||||
| WxMicroPayOrderSP wxPayOrderSP = generateWxMicroPayOrderSP(payAccount, composeOrder,order, record, isShare, appInfo, currentDate, bUserPhone); | |||||
| WxMicroPayOrderSP wxPayOrderSP = generateWxMicroPayOrderSP(payAccount, composeOrder,record, isShare, appInfo, currentDate, bUserPhone); | |||||
| String response = WxPay.micropay(BeanUtils.toStringMap(wxPayOrderSP)); | String response = WxPay.micropay(BeanUtils.toStringMap(wxPayOrderSP)); | ||||
| log.info("pay order, wechat micropay, " + wxPayOrderSP.toString() + ", response: " + response.toString()); | log.info("pay order, wechat micropay, " + wxPayOrderSP.toString() + ", response: " + response.toString()); | ||||
| Map<String, String> returnMap = WxPayment.xmlToMap(response); | Map<String, String> returnMap = WxPayment.xmlToMap(response); | ||||
| returnMap.put("payOrderId", record.getPayOrderNo()); | returnMap.put("payOrderId", record.getPayOrderNo()); | ||||
| returnMap.put("orderId", String.valueOf(order.getId())); | |||||
| returnMap.put("orderId", String.valueOf(composeOrder.getMainOrderId())); | |||||
| return getWxMicroPayOrderSPResutl(returnMap, record, payAccount); | return getWxMicroPayOrderSPResutl(returnMap, record, payAccount); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,7 +1,7 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.iformall.mapper.WxComposeOrderMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxComposeOrder"> | |||||
| <mapper namespace="com.iformall.mapper.WxBatchOrderMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxBatchOrder"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | <id column="id" jdbcType="BIGINT" property="id"/> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | ||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | ||||
| @@ -47,23 +47,23 @@ | |||||
| </sql> | </sql> | ||||
| <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> | ||||
| select <include refid="allColumns"/> from wx_compose_order where id =#{id} and tenant_id=#{tenantId} | |||||
| select <include refid="allColumns"/> from wx_batch_order where id =#{id} and tenant_id=#{tenantId} | |||||
| </select> | </select> | ||||
| <select id="findList" parameterType="com.iformall.domain.po.WxComposeOrder" resultMap="BaseResultMap"> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxBatchOrder" resultMap="BaseResultMap"> | |||||
| select | select | ||||
| <include refid="allColumns"/> | <include refid="allColumns"/> | ||||
| from wx_compose_order | |||||
| from wx_batch_order | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="countList" parameterType="com.iformall.domain.po.WxComposeOrder" resultType="java.lang.Integer"> | |||||
| select count(1) from wx_compose_order | |||||
| <select id="countList" parameterType="com.iformall.domain.po.WxBatchOrder" resultType="java.lang.Integer"> | |||||
| select count(1) from wx_batch_order | |||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <update id="updateCUserId" parameterType="com.iformall.domain.po.WxComposeOrder"> | |||||
| update wx_compose_order set `c_user_id` = #{cUserId} where id =#{id} and tenant_id=#{tenantId} | |||||
| <update id="updateCUserId" parameterType="com.iformall.domain.po.WxBatchOrder"> | |||||
| update wx_batch_order set `c_user_id` = #{cUserId} where id =#{id} and tenant_id=#{tenantId} | |||||
| </update> | </update> | ||||
| </mapper> | </mapper> | ||||
| @@ -22,10 +22,13 @@ | |||||
| <result column="pay_vendor" jdbcType="INTEGER" property="payVendor" /> | <result column="pay_vendor" jdbcType="INTEGER" property="payVendor" /> | ||||
| <result column="send_merchant_id" jdbcType="INTEGER" property="sendMerchantId" /> | <result column="send_merchant_id" jdbcType="INTEGER" property="sendMerchantId" /> | ||||
| <result column="send_merchant_user_id" jdbcType="INTEGER" property="sendMerchantUserId" /> | <result column="send_merchant_user_id" jdbcType="INTEGER" property="sendMerchantUserId" /> | ||||
| <result column="compose_order_type" jdbcType="INTEGER" property="composeOrderType" /> | |||||
| <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `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` | |||||
| `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` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -101,6 +104,14 @@ | |||||
| <if test=" null != sendMerchantUserId "> | <if test=" null != sendMerchantUserId "> | ||||
| and `send_merchant_user_id` = #{sendMerchantUserId} | and `send_merchant_user_id` = #{sendMerchantUserId} | ||||
| </if> | </if> | ||||
| <if test=" null != composeOrderType "> | |||||
| and `compose_order_type` = #{composeOrderType} | |||||
| </if> | |||||
| <if test=" null != composeOrderId "> | |||||
| and `compose_order_id` = #{composeOrderId} | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| @@ -25,11 +25,12 @@ | |||||
| <result column="total_payment" jdbcType="INTEGER" property="totalPayment"/> | <result column="total_payment" jdbcType="INTEGER" property="totalPayment"/> | ||||
| <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId"/> | <result column="compose_order_id" jdbcType="BIGINT" property="composeOrderId"/> | ||||
| <result column="coupon_number" jdbcType="INTEGER" property="couponNumber"/> | <result column="coupon_number" jdbcType="INTEGER" property="couponNumber"/> | ||||
| <result column="compose_order_type" jdbcType="INTEGER" property="composeOrderType"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`order_number`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`order_status`,`create_date`,`update_date`,`detail`, | `id`,`order_number`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`coupon_channel_id`,`product_id`,`type`,`payment_type`,`payment`,`payment_time`,`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` | |||||
| `press_end_date`,`press_current_num`,`press_current_value`,`order_group_id`,`form_id`,`total_payment`,`compose_order_id`,`coupon_number`,`compose_order_type` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -117,6 +118,10 @@ | |||||
| <if test=" null != composeOrderId "> | <if test=" null != composeOrderId "> | ||||
| and `compose_order_id` = #{composeOrderId} | and `compose_order_id` = #{composeOrderId} | ||||
| </if> | </if> | ||||
| <if test=" null != composeOrderType "> | |||||
| and `compose_order_type` = #{composeOrderType} | |||||
| </if> | |||||
| <if test=" null != statusS "> | <if test=" null != statusS "> | ||||
| and `order_status` in | and `order_status` in | ||||