Commit 213673b515d8fef338b29f74c6cd2da6fffd7656
Merge branch 'master' of http://git3.nong12.com/xtrade/order-service
Showing
5 changed files
with
233 additions
and
225 deletions
src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java
... | ... | @@ -88,8 +88,8 @@ public class DefaultOrderCreator { |
88 | 88 | OrderItemDo orderItemDo = new OrderItemDo(); |
89 | 89 | orderItemDo.setItemId(itemId); |
90 | 90 | orderItemDo.setOrderId(orderDo.getOrderId()); |
91 | - orderItemDo.setProductId(orderItem.getPid()); | |
92 | - orderItemDo.setProductName(orderItem.getPname()); | |
91 | + orderItemDo.setPid(orderItem.getPid()); | |
92 | + orderItemDo.setPname(orderItem.getPname()); | |
93 | 93 | // 销售单价 |
94 | 94 | BigDecimal price = BigDecimal.valueOf(orderItem.getPrice()); |
95 | 95 | // 销售数量 | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/entity/OrderItemDo.java
1 | -package com.diligrp.xtrade.order.domain.entity; | |
2 | - | |
3 | -import com.diligrp.xtrade.shared.domain.BaseDo; | |
4 | - | |
5 | -/** | |
6 | - * 订单详情实体数据 | |
7 | - * @author zhangxing | |
8 | - * | |
9 | - */ | |
10 | -public class OrderItemDo extends BaseDo { | |
11 | - | |
12 | - //订单详情id | |
13 | - private Long itemId; | |
14 | - | |
15 | - //订单id | |
16 | - private Long orderId; | |
17 | - | |
18 | - //商品名称 | |
19 | - private String productName; | |
20 | - | |
21 | - //商品id | |
22 | - private Long productId; | |
23 | - | |
24 | - //单价 | |
25 | - private Integer price; | |
26 | - | |
27 | - //数量 | |
28 | - private Double amount; | |
29 | - | |
30 | - //单位 | |
31 | - private Integer saleUnit; | |
32 | - | |
33 | - //件重 | |
34 | - private Double unitWeight; | |
35 | - | |
36 | - //卖家佣金 | |
37 | - private Long scommission; | |
38 | - | |
39 | - //买家佣金 | |
40 | - private Long bcommission; | |
41 | - | |
42 | - //佣金规则 | |
43 | - private Long ruleId; | |
44 | - | |
45 | - //费率描述 | |
46 | - private String ruleRate; | |
47 | - | |
48 | - //订单详情id | |
49 | - private Double weight; | |
50 | - | |
51 | - //金额 | |
52 | - private Long money; | |
53 | - | |
54 | - public Long getItemId() { | |
55 | - return itemId; | |
56 | - } | |
57 | - | |
58 | - public void setItemId(Long itemId) { | |
59 | - this.itemId = itemId; | |
60 | - } | |
61 | - | |
62 | - public Long getOrderId() { | |
63 | - return orderId; | |
64 | - } | |
65 | - | |
66 | - public void setOrderId(Long orderId) { | |
67 | - this.orderId = orderId; | |
68 | - } | |
69 | - | |
70 | - public String getProductName() { | |
71 | - return productName; | |
72 | - } | |
73 | - | |
74 | - public void setProductName(String productName) { | |
75 | - this.productName = productName; | |
76 | - } | |
77 | - | |
78 | - public Long getProductId() { | |
79 | - return productId; | |
80 | - } | |
81 | - | |
82 | - public void setProductId(Long productId) { | |
83 | - this.productId = productId; | |
84 | - } | |
85 | - | |
86 | - public Integer getPrice() { | |
87 | - return price; | |
88 | - } | |
89 | - | |
90 | - public void setPrice(Integer price) { | |
91 | - this.price = price; | |
92 | - } | |
93 | - | |
94 | - public Double getAmount() { | |
95 | - return amount; | |
96 | - } | |
97 | - | |
98 | - public void setAmount(Double amount) { | |
99 | - this.amount = amount; | |
100 | - } | |
101 | - | |
102 | - public Integer getSaleUnit() { | |
103 | - return saleUnit; | |
104 | - } | |
105 | - | |
106 | - public void setSaleUnit(Integer saleUnit) { | |
107 | - this.saleUnit = saleUnit; | |
108 | - } | |
109 | - | |
110 | - public Double getUnitWeight() { | |
111 | - return unitWeight; | |
112 | - } | |
113 | - | |
114 | - public void setUnitWeight(Double unitWeight) { | |
115 | - this.unitWeight = unitWeight; | |
116 | - } | |
117 | - | |
118 | - public Long getScommission() { | |
119 | - return scommission; | |
120 | - } | |
121 | - | |
122 | - public void setScommission(Long scommission) { | |
123 | - this.scommission = scommission; | |
124 | - } | |
125 | - | |
126 | - public Long getBcommission() { | |
127 | - return bcommission; | |
128 | - } | |
129 | - | |
130 | - public void setBcommission(Long bcommission) { | |
131 | - this.bcommission = bcommission; | |
132 | - } | |
133 | - | |
134 | - public Long getRuleId() { | |
135 | - return ruleId; | |
136 | - } | |
137 | - | |
138 | - public void setRuleId(Long ruleId) { | |
139 | - this.ruleId = ruleId; | |
140 | - } | |
141 | - | |
142 | - public String getRuleRate() { | |
143 | - return ruleRate; | |
144 | - } | |
145 | - | |
146 | - public void setRuleRate(String ruleRate) { | |
147 | - this.ruleRate = ruleRate; | |
148 | - } | |
149 | - | |
150 | - public Double getWeight() { | |
151 | - return weight; | |
152 | - } | |
153 | - | |
154 | - public void setWeight(Double weight) { | |
155 | - this.weight = weight; | |
156 | - } | |
157 | - | |
158 | - public Long getMoney() { | |
159 | - return money; | |
160 | - } | |
161 | - | |
162 | - public void setMoney(Long money) { | |
163 | - this.money = money; | |
164 | - } | |
165 | - | |
166 | -} | |
1 | +package com.diligrp.xtrade.order.domain.entity; | |
2 | + | |
3 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
4 | + | |
5 | +/** | |
6 | + * 订单详情实体数据 | |
7 | + * @author zhangxing | |
8 | + * | |
9 | + */ | |
10 | +public class OrderItemDo extends BaseDo { | |
11 | + | |
12 | + //订单详情id | |
13 | + private Long itemId; | |
14 | + | |
15 | + //订单id | |
16 | + private Long orderId; | |
17 | + | |
18 | + //商品名称 | |
19 | + private String pname; | |
20 | + | |
21 | + //商品id | |
22 | + private Long pid; | |
23 | + | |
24 | + //单价 | |
25 | + private Integer price; | |
26 | + | |
27 | + //数量 | |
28 | + private Double amount; | |
29 | + | |
30 | + //单位 | |
31 | + private Integer saleUnit; | |
32 | + | |
33 | + //件重 | |
34 | + private Double unitWeight; | |
35 | + | |
36 | + //卖家佣金 | |
37 | + private Long scommission; | |
38 | + | |
39 | + //买家佣金 | |
40 | + private Long bcommission; | |
41 | + | |
42 | + //佣金规则 | |
43 | + private Long ruleId; | |
44 | + | |
45 | + //费率描述 | |
46 | + private String ruleRate; | |
47 | + | |
48 | + //订单详情id | |
49 | + private Double weight; | |
50 | + | |
51 | + //金额 | |
52 | + private Long money; | |
53 | + | |
54 | + public Long getItemId() { | |
55 | + return itemId; | |
56 | + } | |
57 | + | |
58 | + public void setItemId(Long itemId) { | |
59 | + this.itemId = itemId; | |
60 | + } | |
61 | + | |
62 | + public Long getOrderId() { | |
63 | + return orderId; | |
64 | + } | |
65 | + | |
66 | + public void setOrderId(Long orderId) { | |
67 | + this.orderId = orderId; | |
68 | + } | |
69 | + | |
70 | + public Integer getPrice() { | |
71 | + return price; | |
72 | + } | |
73 | + | |
74 | + public void setPrice(Integer price) { | |
75 | + this.price = price; | |
76 | + } | |
77 | + | |
78 | + public Double getAmount() { | |
79 | + return amount; | |
80 | + } | |
81 | + | |
82 | + public void setAmount(Double amount) { | |
83 | + this.amount = amount; | |
84 | + } | |
85 | + | |
86 | + public Integer getSaleUnit() { | |
87 | + return saleUnit; | |
88 | + } | |
89 | + | |
90 | + public void setSaleUnit(Integer saleUnit) { | |
91 | + this.saleUnit = saleUnit; | |
92 | + } | |
93 | + | |
94 | + public Double getUnitWeight() { | |
95 | + return unitWeight; | |
96 | + } | |
97 | + | |
98 | + public void setUnitWeight(Double unitWeight) { | |
99 | + this.unitWeight = unitWeight; | |
100 | + } | |
101 | + | |
102 | + public Long getScommission() { | |
103 | + return scommission; | |
104 | + } | |
105 | + | |
106 | + public void setScommission(Long scommission) { | |
107 | + this.scommission = scommission; | |
108 | + } | |
109 | + | |
110 | + public Long getBcommission() { | |
111 | + return bcommission; | |
112 | + } | |
113 | + | |
114 | + public void setBcommission(Long bcommission) { | |
115 | + this.bcommission = bcommission; | |
116 | + } | |
117 | + | |
118 | + public Long getRuleId() { | |
119 | + return ruleId; | |
120 | + } | |
121 | + | |
122 | + public void setRuleId(Long ruleId) { | |
123 | + this.ruleId = ruleId; | |
124 | + } | |
125 | + | |
126 | + public String getRuleRate() { | |
127 | + return ruleRate; | |
128 | + } | |
129 | + | |
130 | + public void setRuleRate(String ruleRate) { | |
131 | + this.ruleRate = ruleRate; | |
132 | + } | |
133 | + | |
134 | + public Double getWeight() { | |
135 | + return weight; | |
136 | + } | |
137 | + | |
138 | + public void setWeight(Double weight) { | |
139 | + this.weight = weight; | |
140 | + } | |
141 | + | |
142 | + public Long getMoney() { | |
143 | + return money; | |
144 | + } | |
145 | + | |
146 | + public void setMoney(Long money) { | |
147 | + this.money = money; | |
148 | + } | |
149 | + | |
150 | + public String getPname() { | |
151 | + return pname; | |
152 | + } | |
153 | + | |
154 | + public void setPname(String pname) { | |
155 | + this.pname = pname; | |
156 | + } | |
157 | + | |
158 | + public Long getPid() { | |
159 | + return pid; | |
160 | + } | |
161 | + | |
162 | + public void setPid(Long pid) { | |
163 | + this.pid = pid; | |
164 | + } | |
165 | + | |
166 | +} | ... | ... |
src/main/resources/bootstrap.yml
... | ... | @@ -29,7 +29,7 @@ mybatis: |
29 | 29 | configuration: |
30 | 30 | map-underscore-to-camel-case: true |
31 | 31 | cache-enabled: true |
32 | - mapper-locations: classpath:mapping/com/diligrp/xtrade/*product/*Dao.xml | |
32 | + mapper-locations: classpath:mapping/com/diligrp/xtrade/*/*Dao.xml | |
33 | 33 | type-aliases-package: com.diligrp.xtrade.*.domain.entity |
34 | 34 | #logging: |
35 | 35 | # level: | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/order/OrderDao.xml
... | ... | @@ -64,29 +64,29 @@ |
64 | 64 | </select> |
65 | 65 | |
66 | 66 | <update id="updateBuyerInfo"> |
67 | - UPDATE xt_order | |
67 | + <![CDATA[UPDATE xt_order | |
68 | 68 | SET baccount = #{baccount},bcard_no = #{bcardNo}, |
69 | 69 | bcard_type =#{bcardType},bname = #{bname}, |
70 | 70 | bmobile = #{bmobile},modified_time =now() |
71 | - WHERE order_id=#{orderId} | |
71 | + WHERE order_id=#{orderId}]]> | |
72 | 72 | </update> |
73 | - | |
73 | + | |
74 | 74 | <update id="finishPayment"> |
75 | - UPDATE xt_order | |
75 | + <![CDATA[UPDATE xt_order | |
76 | 76 | SET order_status = 3, pay_type = #{payType}, |
77 | 77 | pay_src = #{paySrc}, pay_time = now(), modified_time = now() |
78 | - WHERE order_id=#{orderId} | |
78 | + WHERE order_id=#{orderId}]]> | |
79 | 79 | </update> |
80 | - | |
80 | + | |
81 | 81 | <update id="updateCommission"> |
82 | - UPDATE xt_order SET scommission = #{scommission}, bcommission = #{bcommission}, modified_time = now() | |
83 | - WHERE order_id=#{orderId} | |
82 | + <![CDATA[UPDATE xt_order SET scommission = #{scommission}, bcommission = #{bcommission}, modified_time = now() | |
83 | + WHERE order_id=#{orderId}]]> | |
84 | 84 | </update> |
85 | - | |
85 | + | |
86 | 86 | <update id="updateOrderStatus"> |
87 | - UPDATE xt_order | |
87 | + <![CDATA[UPDATE xt_order | |
88 | 88 | SET order_status = #{orderStatus}, modified_time = now() |
89 | - WHERE order_id=#{orderId} | |
89 | + WHERE order_id=#{orderId}]]> | |
90 | 90 | </update> |
91 | 91 | |
92 | 92 | </mapper> |
93 | 93 | \ No newline at end of file | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/order/OrderItemDao.xml
... | ... | @@ -2,62 +2,70 @@ |
2 | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 | <mapper namespace="com.diligrp.xtrade.order.dao.OrderItemDao"> |
4 | 4 | |
5 | - <sql id="QUERY_COLUMN_LIST"> | |
5 | + <sql id="QUERY_COLUMN_LIST"> | |
6 | 6 | <![CDATA[ |
7 | - `item_id` AS itemId, `order_id` AS orderId, `product_name` AS productName, `product_id` AS productId, `cate_id` AS cateId, `cate_name` AS cateName, `price`, `amount`, `sale_unit` AS saleUnit, `unit_weight` AS unitWeight, `scommission`, `bcommission`, `rule_id` ruleId, `rule_rate` ruleRate, `weight`, `total_money` AS totalMoney | |
7 | + `item_id` AS itemId, `order_id` AS orderId, `pname` AS pname, `pid` AS pid, `cate_id` AS cateId, `cate_name` AS cateName, `price`, `amount`, `sale_unit` AS saleUnit, `unit_weight` AS unitWeight, `scommission`, `bcommission`, `rule_id` ruleId, `rule_rate` ruleRate, `weight`, `total_money` AS totalMoney | |
8 | 8 | ]]> |
9 | 9 | </sql> |
10 | 10 | |
11 | - <insert id="insertEntity"> | |
12 | - INSERT INTO `xt_order_item`(`item_id`, `order_id`, `product_name`, `product_id`, `price`, `amount`, `sale_unit`, | |
13 | - `unit_weight`, `scommission`, `bcommission`, `rule_id`, `rule_rate`, `weight`, `total_money`, | |
14 | - `created_time`, `modified_time`) | |
15 | - VALUES (#{itemId}, #{orderId}, #{productName}, #{productId}, #{price}, #{amount}, #{saleUnit}, #{unitWeight}, | |
16 | - #{scommission}, #{bcommission}, #{ruleid}, #{ruleRate}, #{}weight, #{totalMoney}, NOW(), NOW()); | |
17 | - </insert> | |
18 | - <insert id="insertBatch" parameterType="java.util.List"> | |
19 | - INSERT INTO xt_order_item(item_id, order_id, product_name, product_id, cate_id, cate_name, price, amount, sale_unit, | |
20 | - unit_weight, scommission, bcommission, rule_id, rule_rate, weight, total_money, created_time, modified_time) | |
21 | - VALUES | |
22 | - <foreach collection="list" item="item" index="index" separator=","> | |
23 | - ( | |
24 | - #{item.itemId}, | |
25 | - #{item.orderId}, | |
26 | - #{item.productName}, | |
27 | - #{item.productId}, | |
28 | - null, | |
29 | - null, | |
30 | - #{item.price}, | |
31 | - #{item.amount}, | |
32 | - #{item.saleUnit}, | |
33 | - #{item.unitWeight}, | |
11 | + <insert id="insertEntity" parameterType="orderItemDo"> | |
12 | + INSERT INTO `xt_order_item`(`item_id`, `order_id`, `pname`, | |
13 | + `pid`, `price`, `amount`, `sale_unit`, | |
14 | + `unit_weight`, `scommission`, `bcommission`, `rule_id`, `rule_rate`, `weight`, | |
15 | + `total_money`, | |
16 | + `created_time`, `modified_time`) | |
17 | + VALUES (#{itemId}, #{orderId}, #{pname}, #{pid}, #{price}, | |
18 | + #{amount}, #{saleUnit}, #{unitWeight}, | |
19 | + #{scommission}, #{bcommission}, #{ruleid}, #{ruleRate}, #{weight}, #{totalMoney}, | |
20 | + NOW(), NOW()); | |
21 | + </insert> | |
22 | + <insert id="insertBatch" parameterType="java.util.List"> | |
23 | + INSERT INTO xt_order_item(item_id, order_id, pname, pid, | |
24 | + cate_id, cate_name, price, amount, sale_unit, | |
25 | + unit_weight, scommission, bcommission, rule_id, rule_rate, weight, total_money, | |
26 | + created_time, modified_time) | |
27 | + VALUES | |
28 | + <foreach collection="list" item="item" index="index" | |
29 | + separator=","> | |
30 | + ( | |
31 | + #{item.itemId}, | |
32 | + #{item.orderId}, | |
33 | + #{item.pname}, | |
34 | + #{item.pid}, | |
35 | + null, | |
36 | + null, | |
37 | + #{item.price}, | |
38 | + #{item.amount}, | |
39 | + #{item.saleUnit}, | |
40 | + #{item.unitWeight}, | |
34 | 41 | #{item.scommission}, |
35 | 42 | #{item.bcommission}, |
36 | 43 | #{item.ruleId}, |
37 | 44 | #{item.ruleRate}, |
38 | 45 | #{item.weight}, |
39 | 46 | #{item.money}, |
40 | - now(), | |
41 | - now() | |
42 | - ) | |
43 | - </foreach> | |
44 | - </insert> | |
47 | + now(), | |
48 | + now() | |
49 | + ) | |
50 | + </foreach> | |
51 | + </insert> | |
45 | 52 | |
46 | - <select id="selectItemsByOrderId" parameterType="long" resultType="orderItemDo"> | |
47 | - SELECT | |
48 | - <include refid="QUERY_COLUMN_LIST"/> | |
49 | - FROM `xt_order_item` | |
50 | - WHERE item_id =#{itemId} | |
51 | - </select> | |
53 | + <select id="selectItemsByOrderId" parameterType="long" | |
54 | + resultType="orderItemDo"> | |
55 | + SELECT | |
56 | + <include refid="QUERY_COLUMN_LIST" /> | |
57 | + FROM `xt_order_item` | |
58 | + WHERE order_id =#{orderId} | |
59 | + </select> | |
52 | 60 | |
53 | - <update id="updateCommission"> | |
54 | - UPDATE `xt_order_item` | |
55 | - SET `scommission`=#{scommission}, | |
56 | - `bcommission`=#{bcommission}, | |
57 | - `rule_id`=#{ruleId}, | |
58 | - `rule_rate`=#{ruleRate}, | |
59 | - modified_time = NOW() | |
60 | - WHERE item_id = #{itemId} | |
61 | - </update> | |
61 | + <update id="updateCommission"> | |
62 | + UPDATE `xt_order_item` | |
63 | + SET `scommission`=#{scommission}, | |
64 | + `bcommission`=#{bcommission}, | |
65 | + `rule_id`=#{ruleId}, | |
66 | + `rule_rate`=#{ruleRate}, | |
67 | + modified_time = NOW() | |
68 | + WHERE item_id = #{itemId} | |
69 | + </update> | |
62 | 70 | |
63 | 71 | </mapper> | ... | ... |