Commit 878064234dbdc7a6d490b04f0a8885475e16043a
1 parent
958340f3
update:购物车增加是否选中字段
Showing
6 changed files
with
102 additions
and
6 deletions
etrade-order/src/main/java/com/diligrp/etrade/order/domain/ShopCartMessageDto.java
@@ -89,6 +89,9 @@ public class ShopCartMessageDto implements Serializable { | @@ -89,6 +89,9 @@ public class ShopCartMessageDto implements Serializable { | ||
89 | */ | 89 | */ |
90 | private LocalDateTime cacheTime; | 90 | private LocalDateTime cacheTime; |
91 | 91 | ||
92 | + /** 选中状态 */ | ||
93 | + private Integer checkFlag; | ||
94 | + | ||
92 | public LocalDateTime getCacheTime() { | 95 | public LocalDateTime getCacheTime() { |
93 | return cacheTime; | 96 | return cacheTime; |
94 | } | 97 | } |
@@ -199,4 +202,12 @@ public class ShopCartMessageDto implements Serializable { | @@ -199,4 +202,12 @@ public class ShopCartMessageDto implements Serializable { | ||
199 | public void setCreaterId(Long createrId) { | 202 | public void setCreaterId(Long createrId) { |
200 | this.createrId = createrId; | 203 | this.createrId = createrId; |
201 | } | 204 | } |
205 | + | ||
206 | + public Integer getCheckFlag() { | ||
207 | + return checkFlag; | ||
208 | + } | ||
209 | + | ||
210 | + public void setCheckFlag(Integer checkFlag) { | ||
211 | + this.checkFlag = checkFlag; | ||
212 | + } | ||
202 | } | 213 | } |
etrade-order/src/main/java/com/diligrp/etrade/order/model/ShopCartMessage.java
@@ -85,6 +85,9 @@ public class ShopCartMessage extends BaseDo implements Serializable { | @@ -85,6 +85,9 @@ public class ShopCartMessage extends BaseDo implements Serializable { | ||
85 | */ | 85 | */ |
86 | private Long createrId; | 86 | private Long createrId; |
87 | 87 | ||
88 | + /** 选中状态 */ | ||
89 | + private Integer checkFlag; | ||
90 | + | ||
88 | 91 | ||
89 | private static final long serialVersionUID = 1L; | 92 | private static final long serialVersionUID = 1L; |
90 | 93 | ||
@@ -234,7 +237,8 @@ public class ShopCartMessage extends BaseDo implements Serializable { | @@ -234,7 +237,8 @@ public class ShopCartMessage extends BaseDo implements Serializable { | ||
234 | && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) | 237 | && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) |
235 | && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion())) | 238 | && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion())) |
236 | && (this.getCreater() == null ? other.getCreater() == null : this.getCreater().equals(other.getCreater())) | 239 | && (this.getCreater() == null ? other.getCreater() == null : this.getCreater().equals(other.getCreater())) |
237 | - && (this.getCreaterId() == null ? other.getCreaterId() == null : this.getCreaterId().equals(other.getCreaterId())); | 240 | + && (this.getCreaterId() == null ? other.getCreaterId() == null : this.getCreaterId().equals(other.getCreaterId())) |
241 | + && (this.getCheckFlag() == null ? other.getCheckFlag() == null : this.getCheckFlag().equals(other.getCheckFlag())); | ||
238 | } | 242 | } |
239 | 243 | ||
240 | @Override | 244 | @Override |
@@ -256,6 +260,7 @@ public class ShopCartMessage extends BaseDo implements Serializable { | @@ -256,6 +260,7 @@ public class ShopCartMessage extends BaseDo implements Serializable { | ||
256 | result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode()); | 260 | result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode()); |
257 | result = prime * result + ((getCreater() == null) ? 0 : getCreater().hashCode()); | 261 | result = prime * result + ((getCreater() == null) ? 0 : getCreater().hashCode()); |
258 | result = prime * result + ((getCreaterId() == null) ? 0 : getCreaterId().hashCode()); | 262 | result = prime * result + ((getCreaterId() == null) ? 0 : getCreaterId().hashCode()); |
263 | + result = prime * result + ((getCheckFlag() == null) ? 0 : getCheckFlag().hashCode()); | ||
259 | return result; | 264 | return result; |
260 | } | 265 | } |
261 | 266 | ||
@@ -280,8 +285,25 @@ public class ShopCartMessage extends BaseDo implements Serializable { | @@ -280,8 +285,25 @@ public class ShopCartMessage extends BaseDo implements Serializable { | ||
280 | sb.append(", version=").append(version); | 285 | sb.append(", version=").append(version); |
281 | sb.append(", creater=").append(creater); | 286 | sb.append(", creater=").append(creater); |
282 | sb.append(", createrId=").append(createrId); | 287 | sb.append(", createrId=").append(createrId); |
288 | + sb.append(", checkFlag=").append(checkFlag); | ||
283 | sb.append(", serialVersionUID=").append(serialVersionUID); | 289 | sb.append(", serialVersionUID=").append(serialVersionUID); |
284 | sb.append("]"); | 290 | sb.append("]"); |
285 | return sb.toString(); | 291 | return sb.toString(); |
286 | } | 292 | } |
293 | + | ||
294 | + public Integer getCheckFlag() { | ||
295 | + return checkFlag; | ||
296 | + } | ||
297 | + | ||
298 | + public void setCheckFlag(Integer checkFlag) { | ||
299 | + this.checkFlag = checkFlag; | ||
300 | + } | ||
301 | + | ||
302 | + public Long getShopCartId() { | ||
303 | + return shopCartId; | ||
304 | + } | ||
305 | + | ||
306 | + public void setShopCartId(Long shopCartId) { | ||
307 | + this.shopCartId = shopCartId; | ||
308 | + } | ||
287 | } | 309 | } |
288 | \ No newline at end of file | 310 | \ No newline at end of file |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/OrderServiceImpl.java
@@ -362,7 +362,7 @@ public class OrderServiceImpl implements OrderService { | @@ -362,7 +362,7 @@ public class OrderServiceImpl implements OrderService { | ||
362 | //插入订单商品 并计算卖家费用 | 362 | //插入订单商品 并计算卖家费用 |
363 | List<OrderGoods> orderGoods = orderGoodsService.buildOrderGoods(order,buyerOrderDto.getProductDtoList()); | 363 | List<OrderGoods> orderGoods = orderGoodsService.buildOrderGoods(order,buyerOrderDto.getProductDtoList()); |
364 | //插入订单商品买方手续费 | 364 | //插入订单商品买方手续费 |
365 | - orderPaymentFeeService.buildSellerPaymentFees(order,orderGoods,YesOrNoEnum.NO.getCode()); | 365 | + //orderPaymentFeeService.buildSellerPaymentFees(order,orderGoods,YesOrNoEnum.NO.getCode()); |
366 | 366 | ||
367 | orderMapper.updateOrderOtherById(order); | 367 | orderMapper.updateOrderOtherById(order); |
368 | //配送信息 | 368 | //配送信息 |
etrade-order/src/main/java/com/diligrp/etrade/order/service/impl/ShopCartImpl.java
@@ -14,6 +14,7 @@ import com.diligrp.etrade.order.model.ShopCart; | @@ -14,6 +14,7 @@ import com.diligrp.etrade.order.model.ShopCart; | ||
14 | import com.diligrp.etrade.order.model.ShopCartMessage; | 14 | import com.diligrp.etrade.order.model.ShopCartMessage; |
15 | import com.diligrp.etrade.order.service.IShopCartMessageService; | 15 | import com.diligrp.etrade.order.service.IShopCartMessageService; |
16 | import com.diligrp.etrade.order.service.IShopCartService; | 16 | import com.diligrp.etrade.order.service.IShopCartService; |
17 | +import com.diligrp.etrade.order.type.ShopCartMessageCheckFlag; | ||
17 | import com.diligrp.etrade.order.type.ShopCartMessageProductState; | 18 | import com.diligrp.etrade.order.type.ShopCartMessageProductState; |
18 | import com.diligrp.etrade.shop.domain.response.ProductListVo; | 19 | import com.diligrp.etrade.shop.domain.response.ProductListVo; |
19 | import com.diligrp.etrade.shop.domain.response.ProductPresetVo; | 20 | import com.diligrp.etrade.shop.domain.response.ProductPresetVo; |
@@ -188,6 +189,7 @@ public class ShopCartImpl implements IShopCartService { | @@ -188,6 +189,7 @@ public class ShopCartImpl implements IShopCartService { | ||
188 | int in = shopCartMapper.insertSelective(shopCart); | 189 | int in = shopCartMapper.insertSelective(shopCart); |
189 | Assert.isTrue(in > 0, "购物车添加失败"); | 190 | Assert.isTrue(in > 0, "购物车添加失败"); |
190 | shopCartMessageDto.setShopCartId(shopCart.getId()); | 191 | shopCartMessageDto.setShopCartId(shopCart.getId()); |
192 | + shopCartMessageDto.setCheckFlag(ShopCartMessageCheckFlag.CHECK.getCodeInteger()); | ||
191 | shopCartMessageService.saveShopCartMessage(shopCartMessageDto); | 193 | shopCartMessageService.saveShopCartMessage(shopCartMessageDto); |
192 | return; | 194 | return; |
193 | } | 195 | } |
etrade-order/src/main/java/com/diligrp/etrade/order/type/ShopCartMessageCheckFlag.java
0 → 100644
1 | +package com.diligrp.etrade.order.type; | ||
2 | + | ||
3 | +import com.diligrp.etrade.core.type.IEnumType; | ||
4 | + | ||
5 | +public enum ShopCartMessageCheckFlag implements IEnumType { | ||
6 | + CHECK("选中", 1), | ||
7 | + UN_CHECK("未选中", 2); | ||
8 | + | ||
9 | + private String name; | ||
10 | + private Integer code; | ||
11 | + | ||
12 | + private ShopCartMessageCheckFlag(String name, Integer code) { | ||
13 | + this.name = name; | ||
14 | + this.code = code; | ||
15 | + } | ||
16 | + | ||
17 | + public static ShopCartMessageCheckFlag getByCode(Integer code) { | ||
18 | + for (ShopCartMessageCheckFlag temp : ShopCartMessageCheckFlag.values()) { | ||
19 | + if (temp.getCodeInteger().equals(code)) { | ||
20 | + return temp; | ||
21 | + } | ||
22 | + } | ||
23 | + return null; | ||
24 | + } | ||
25 | + | ||
26 | + public static String getNameByCode(Integer code) { | ||
27 | + for (ShopCartMessageCheckFlag temp : ShopCartMessageCheckFlag.values()) { | ||
28 | + if (temp.getCodeInteger().equals(code)) { | ||
29 | + return temp.getName(); | ||
30 | + } | ||
31 | + } | ||
32 | + return null; | ||
33 | + } | ||
34 | + | ||
35 | + public Integer getCodeInteger() { | ||
36 | + return this.code; | ||
37 | + } | ||
38 | + | ||
39 | + public String getName() { | ||
40 | + return this.name; | ||
41 | + } | ||
42 | + | ||
43 | + public int getCode() { | ||
44 | + return this.code; | ||
45 | + } | ||
46 | + | ||
47 | + public String toString() { | ||
48 | + return this.name; | ||
49 | + } | ||
50 | +} | ||
0 | \ No newline at end of file | 51 | \ No newline at end of file |
etrade-order/src/main/resources/com/diligrp/etrade/dao/mapper/shopCart/ShopCartMessageMapper.xml
@@ -17,11 +17,12 @@ | @@ -17,11 +17,12 @@ | ||
17 | <result column="version" jdbcType="TINYINT" property="version"/> | 17 | <result column="version" jdbcType="TINYINT" property="version"/> |
18 | <result column="creater" jdbcType="VARCHAR" property="creater"/> | 18 | <result column="creater" jdbcType="VARCHAR" property="creater"/> |
19 | <result column="creater_id" jdbcType="BIGINT" property="createrId"/> | 19 | <result column="creater_id" jdbcType="BIGINT" property="createrId"/> |
20 | + <result column="check_flag" jdbcType="TINYINT" property="checkFlag"/> | ||
20 | </resultMap> | 21 | </resultMap> |
21 | <sql id="Base_Column_List"> | 22 | <sql id="Base_Column_List"> |
22 | id | 23 | id |
23 | , shop_cart_id, created_time, modified_time, market_id, product_id, `number`, | 24 | , shop_cart_id, created_time, modified_time, market_id, product_id, `number`, |
24 | - unit_amount, unit_weight, weight, amount, `type`, version, creater, creater_id | 25 | + unit_amount, unit_weight, weight, amount, `type`, version, creater, creater_id,check_flag |
25 | </sql> | 26 | </sql> |
26 | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> | 27 | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
27 | select | 28 | select |
@@ -125,12 +126,12 @@ | @@ -125,12 +126,12 @@ | ||
125 | market_id, product_id, `number`, | 126 | market_id, product_id, `number`, |
126 | unit_amount, unit_weight, weight, | 127 | unit_amount, unit_weight, weight, |
127 | amount, `type`, version, | 128 | amount, `type`, version, |
128 | - creater, creater_id) | 129 | + creater, creater_id,check_flag) |
129 | values (#{shopCartId,jdbcType=BIGINT}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP}, | 130 | values (#{shopCartId,jdbcType=BIGINT}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP}, |
130 | #{marketId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT}, | 131 | #{marketId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT}, |
131 | #{unitAmount,jdbcType=BIGINT}, #{unitWeight,jdbcType=BIGINT}, #{weight,jdbcType=BIGINT}, | 132 | #{unitAmount,jdbcType=BIGINT}, #{unitWeight,jdbcType=BIGINT}, #{weight,jdbcType=BIGINT}, |
132 | #{amount,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{version,jdbcType=TINYINT}, | 133 | #{amount,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{version,jdbcType=TINYINT}, |
133 | - #{creater,jdbcType=VARCHAR}, #{createrId,jdbcType=BIGINT}) | 134 | + #{creater,jdbcType=VARCHAR}, #{createrId,jdbcType=BIGINT}, #{checkFlag,jdbcType=TINYINT}) |
134 | </insert> | 135 | </insert> |
135 | <insert id="insertSelective" keyColumn="id" keyProperty="id" | 136 | <insert id="insertSelective" keyColumn="id" keyProperty="id" |
136 | parameterType="com.diligrp.etrade.order.model.ShopCartMessage" useGeneratedKeys="true"> | 137 | parameterType="com.diligrp.etrade.order.model.ShopCartMessage" useGeneratedKeys="true"> |
@@ -174,6 +175,9 @@ | @@ -174,6 +175,9 @@ | ||
174 | <if test="createrId != null"> | 175 | <if test="createrId != null"> |
175 | creater_id, | 176 | creater_id, |
176 | </if> | 177 | </if> |
178 | + <if test="checkFlag != null"> | ||
179 | + check_flag, | ||
180 | + </if> | ||
177 | </trim> | 181 | </trim> |
178 | <trim prefix="values (" suffix=")" suffixOverrides=","> | 182 | <trim prefix="values (" suffix=")" suffixOverrides=","> |
179 | <if test="shopCartId != null"> | 183 | <if test="shopCartId != null"> |
@@ -214,6 +218,9 @@ | @@ -214,6 +218,9 @@ | ||
214 | <if test="createrId != null"> | 218 | <if test="createrId != null"> |
215 | #{createrId,jdbcType=BIGINT}, | 219 | #{createrId,jdbcType=BIGINT}, |
216 | </if> | 220 | </if> |
221 | + <if test="checkFlag != null"> | ||
222 | + #{checkFlag,jdbcType=TINYINT}, | ||
223 | + </if> | ||
217 | </trim> | 224 | </trim> |
218 | </insert> | 225 | </insert> |
219 | <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.etrade.order.domain.ShopCartMessageDto"> | 226 | <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.etrade.order.domain.ShopCartMessageDto"> |
@@ -258,6 +265,9 @@ | @@ -258,6 +265,9 @@ | ||
258 | <if test="createrId != null"> | 265 | <if test="createrId != null"> |
259 | creater_id = #{createrId,jdbcType=BIGINT}, | 266 | creater_id = #{createrId,jdbcType=BIGINT}, |
260 | </if> | 267 | </if> |
268 | + <if test="checkFlag != null"> | ||
269 | + check_flag = #{checkFlag,jdbcType=TINYINT}, | ||
270 | + </if> | ||
261 | </set> | 271 | </set> |
262 | where id = #{id,jdbcType=BIGINT} and version=#{version,jdbcType=TINYINT} | 272 | where id = #{id,jdbcType=BIGINT} and version=#{version,jdbcType=TINYINT} |
263 | </update> | 273 | </update> |
@@ -276,7 +286,8 @@ | @@ -276,7 +286,8 @@ | ||
276 | `type` = #{type,jdbcType=TINYINT}, | 286 | `type` = #{type,jdbcType=TINYINT}, |
277 | version = #{version,jdbcType=TINYINT}, | 287 | version = #{version,jdbcType=TINYINT}, |
278 | creater = #{creater,jdbcType=VARCHAR}, | 288 | creater = #{creater,jdbcType=VARCHAR}, |
279 | - creater_id = #{createrId,jdbcType=BIGINT} | 289 | + creater_id = #{createrId,jdbcType=BIGINT}, |
290 | + check_flag = #{checkFlag,jdbcType=TINYINT} | ||
280 | where id = #{id,jdbcType=BIGINT} | 291 | where id = #{id,jdbcType=BIGINT} |
281 | </update> | 292 | </update> |
282 | </mapper> | 293 | </mapper> |
283 | \ No newline at end of file | 294 | \ No newline at end of file |