Commit 878064234dbdc7a6d490b04f0a8885475e16043a

Authored by fengliang
1 parent 958340f3

update:购物车增加是否选中字段

etrade-order/src/main/java/com/diligrp/etrade/order/domain/ShopCartMessageDto.java
... ... @@ -89,6 +89,9 @@ public class ShopCartMessageDto implements Serializable {
89 89 */
90 90 private LocalDateTime cacheTime;
91 91  
  92 + /** 选中状态 */
  93 + private Integer checkFlag;
  94 +
92 95 public LocalDateTime getCacheTime() {
93 96 return cacheTime;
94 97 }
... ... @@ -199,4 +202,12 @@ public class ShopCartMessageDto implements Serializable {
199 202 public void setCreaterId(Long createrId) {
200 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 85 */
86 86 private Long createrId;
87 87  
  88 + /** 选中状态 */
  89 + private Integer checkFlag;
  90 +
88 91  
89 92 private static final long serialVersionUID = 1L;
90 93  
... ... @@ -234,7 +237,8 @@ public class ShopCartMessage extends BaseDo implements Serializable {
234 237 && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
235 238 && (this.getVersion() == null ? other.getVersion() == null : this.getVersion().equals(other.getVersion()))
236 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 244 @Override
... ... @@ -256,6 +260,7 @@ public class ShopCartMessage extends BaseDo implements Serializable {
256 260 result = prime * result + ((getVersion() == null) ? 0 : getVersion().hashCode());
257 261 result = prime * result + ((getCreater() == null) ? 0 : getCreater().hashCode());
258 262 result = prime * result + ((getCreaterId() == null) ? 0 : getCreaterId().hashCode());
  263 + result = prime * result + ((getCheckFlag() == null) ? 0 : getCheckFlag().hashCode());
259 264 return result;
260 265 }
261 266  
... ... @@ -280,8 +285,25 @@ public class ShopCartMessage extends BaseDo implements Serializable {
280 285 sb.append(", version=").append(version);
281 286 sb.append(", creater=").append(creater);
282 287 sb.append(", createrId=").append(createrId);
  288 + sb.append(", checkFlag=").append(checkFlag);
283 289 sb.append(", serialVersionUID=").append(serialVersionUID);
284 290 sb.append("]");
285 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 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 362 //插入订单商品 并计算卖家费用
363 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 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 14 import com.diligrp.etrade.order.model.ShopCartMessage;
15 15 import com.diligrp.etrade.order.service.IShopCartMessageService;
16 16 import com.diligrp.etrade.order.service.IShopCartService;
  17 +import com.diligrp.etrade.order.type.ShopCartMessageCheckFlag;
17 18 import com.diligrp.etrade.order.type.ShopCartMessageProductState;
18 19 import com.diligrp.etrade.shop.domain.response.ProductListVo;
19 20 import com.diligrp.etrade.shop.domain.response.ProductPresetVo;
... ... @@ -188,6 +189,7 @@ public class ShopCartImpl implements IShopCartService {
188 189 int in = shopCartMapper.insertSelective(shopCart);
189 190 Assert.isTrue(in > 0, "购物车添加失败");
190 191 shopCartMessageDto.setShopCartId(shopCart.getId());
  192 + shopCartMessageDto.setCheckFlag(ShopCartMessageCheckFlag.CHECK.getCodeInteger());
191 193 shopCartMessageService.saveShopCartMessage(shopCartMessageDto);
192 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 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 17 <result column="version" jdbcType="TINYINT" property="version"/>
18 18 <result column="creater" jdbcType="VARCHAR" property="creater"/>
19 19 <result column="creater_id" jdbcType="BIGINT" property="createrId"/>
  20 + <result column="check_flag" jdbcType="TINYINT" property="checkFlag"/>
20 21 </resultMap>
21 22 <sql id="Base_Column_List">
22 23 id
23 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 26 </sql>
26 27 <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
27 28 select
... ... @@ -125,12 +126,12 @@
125 126 market_id, product_id, `number`,
126 127 unit_amount, unit_weight, weight,
127 128 amount, `type`, version,
128   - creater, creater_id)
  129 + creater, creater_id,check_flag)
129 130 values (#{shopCartId,jdbcType=BIGINT}, #{createdTime,jdbcType=TIMESTAMP}, #{modifiedTime,jdbcType=TIMESTAMP},
130 131 #{marketId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT}, #{number,jdbcType=BIGINT},
131 132 #{unitAmount,jdbcType=BIGINT}, #{unitWeight,jdbcType=BIGINT}, #{weight,jdbcType=BIGINT},
132 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 135 </insert>
135 136 <insert id="insertSelective" keyColumn="id" keyProperty="id"
136 137 parameterType="com.diligrp.etrade.order.model.ShopCartMessage" useGeneratedKeys="true">
... ... @@ -174,6 +175,9 @@
174 175 <if test="createrId != null">
175 176 creater_id,
176 177 </if>
  178 + <if test="checkFlag != null">
  179 + check_flag,
  180 + </if>
177 181 </trim>
178 182 <trim prefix="values (" suffix=")" suffixOverrides=",">
179 183 <if test="shopCartId != null">
... ... @@ -214,6 +218,9 @@
214 218 <if test="createrId != null">
215 219 #{createrId,jdbcType=BIGINT},
216 220 </if>
  221 + <if test="checkFlag != null">
  222 + #{checkFlag,jdbcType=TINYINT},
  223 + </if>
217 224 </trim>
218 225 </insert>
219 226 <update id="updateByPrimaryKeySelective" parameterType="com.diligrp.etrade.order.domain.ShopCartMessageDto">
... ... @@ -258,6 +265,9 @@
258 265 <if test="createrId != null">
259 266 creater_id = #{createrId,jdbcType=BIGINT},
260 267 </if>
  268 + <if test="checkFlag != null">
  269 + check_flag = #{checkFlag,jdbcType=TINYINT},
  270 + </if>
261 271 </set>
262 272 where id = #{id,jdbcType=BIGINT} and version=#{version,jdbcType=TINYINT}
263 273 </update>
... ... @@ -276,7 +286,8 @@
276 286 `type` = #{type,jdbcType=TINYINT},
277 287 version = #{version,jdbcType=TINYINT},
278 288 creater = #{creater,jdbcType=VARCHAR},
279   - creater_id = #{createrId,jdbcType=BIGINT}
  289 + creater_id = #{createrId,jdbcType=BIGINT},
  290 + check_flag = #{checkFlag,jdbcType=TINYINT}
280 291 where id = #{id,jdbcType=BIGINT}
281 292 </update>
282 293 </mapper>
283 294 \ No newline at end of file
... ...