Merge branch 'ww' into test
This commit is contained in:
@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.entity;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class TbShopUser implements Serializable {
|
public class TbShopUser implements Serializable {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -61,6 +62,7 @@ public class TbShopUser implements Serializable {
|
|||||||
private Long updatedAt;
|
private Long updatedAt;
|
||||||
|
|
||||||
private String miniOpenId;
|
private String miniOpenId;
|
||||||
|
private Date joinTime;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -295,4 +297,12 @@ public class TbShopUser implements Serializable {
|
|||||||
public void setDynamicCode(String dynamicCode) {
|
public void setDynamicCode(String dynamicCode) {
|
||||||
this.dynamicCode = dynamicCode;
|
this.dynamicCode = dynamicCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getJoinTime() {
|
||||||
|
return joinTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJoinTime(Date joinTime) {
|
||||||
|
this.joinTime = joinTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public class MemberService {
|
|||||||
tbShopUser.setLevel(Byte.parseByte(String.valueOf(map.get("level"))));
|
tbShopUser.setLevel(Byte.parseByte(String.valueOf(map.get("level"))));
|
||||||
tbShopUser.setIsVip(Byte.parseByte("1"));
|
tbShopUser.setIsVip(Byte.parseByte("1"));
|
||||||
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
||||||
|
tbShopUser.setJoinTime(new Date());
|
||||||
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
}
|
}
|
||||||
@@ -168,6 +169,7 @@ public class MemberService {
|
|||||||
tbShopUser.setCode(code);
|
tbShopUser.setCode(code);
|
||||||
tbShopUser.setIsVip(Byte.parseByte("1"));
|
tbShopUser.setIsVip(Byte.parseByte("1"));
|
||||||
tbShopUser.setCreatedAt(System.currentTimeMillis());
|
tbShopUser.setCreatedAt(System.currentTimeMillis());
|
||||||
|
tbShopUser.setJoinTime(new Date());
|
||||||
tbShopUserMapper.insert(tbShopUser);
|
tbShopUserMapper.insert(tbShopUser);
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class ProductService {
|
|||||||
|
|
||||||
if (product.getIsDistribute() != 1 && product.getTypeEnum().equals("sku")) {
|
if (product.getIsDistribute() != 1 && product.getTypeEnum().equals("sku")) {
|
||||||
throw new MsgException("多规格非共享商品暂不支持修改库存");
|
throw new MsgException("多规格非共享商品暂不支持修改库存");
|
||||||
}else {
|
} else {
|
||||||
tbProductMapper.updateStock(productStockDTO.getShopId(), productStockDTO.getProductId(), productStockDTO.getStock());
|
tbProductMapper.updateStock(productStockDTO.getShopId(), productStockDTO.getProductId(), productStockDTO.getStock());
|
||||||
tbProductSkuMapper.updateStock(productStockDTO.getShopId(), productStockDTO.getProductId(), productStockDTO.getStock());
|
tbProductSkuMapper.updateStock(productStockDTO.getShopId(), productStockDTO.getProductId(), productStockDTO.getStock());
|
||||||
|
|
||||||
@@ -213,9 +213,15 @@ public class ProductService {
|
|||||||
data.put("shopId", productStockDTO.getShopId());
|
data.put("shopId", productStockDTO.getShopId());
|
||||||
data.put("skuId", tbProductSkus.isEmpty() ? null : tbProductSkus.get(0).getId());
|
data.put("skuId", tbProductSkus.isEmpty() ? null : tbProductSkus.get(0).getId());
|
||||||
data.put("productId", productStockDTO.getProductId());
|
data.put("productId", productStockDTO.getProductId());
|
||||||
data.put("type", "pc收银机修改库存");
|
// data.put("type", "pc收银机修改库存");
|
||||||
data.put("subType", product.getStockNumber() > productStockDTO.getStock() ? -1 : 1);
|
data.put("subType", product.getStockNumber() > productStockDTO.getStock() ? -1 : 1);
|
||||||
data.put("number",productStockDTO.getStock() - product.getStockNumber());
|
data.put("number", productStockDTO.getStock() - product.getStockNumber());
|
||||||
|
data.put("remark", "pc收银机修改库存");
|
||||||
|
if (product.getStockNumber() > productStockDTO.getStock()) {
|
||||||
|
data.put("type", "盘点出库");
|
||||||
|
}else {
|
||||||
|
data.put("type", "盘点入库");
|
||||||
|
}
|
||||||
producer.sendStockRecordMsg(data);
|
producer.sendStockRecordMsg(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,12 +32,13 @@
|
|||||||
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
||||||
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
||||||
<result column="mini_open_id" jdbcType="VARCHAR" property="miniOpenId" />
|
<result column="mini_open_id" jdbcType="VARCHAR" property="miniOpenId" />
|
||||||
|
<result column="join_time" jdbcType="VARCHAR" property="joinTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, amount, credit_amount, consume_amount, consume_number, level_consume, status,
|
id, amount, credit_amount, consume_amount, consume_number, level_consume, status,
|
||||||
merchant_id, shop_id, user_id, parent_id, parent_level, name, head_img, sex, birth_day,
|
merchant_id, shop_id, user_id, parent_id, parent_level, name, head_img, sex, birth_day,
|
||||||
telephone, is_vip, code, is_attention, attention_at, is_shareholder, level, distribute_type,
|
telephone, is_vip, code, is_attention, attention_at, is_shareholder, level, distribute_type,
|
||||||
sort, created_at, updated_at, mini_open_id,dynamic_code
|
sort, created_at, updated_at, mini_open_id,dynamic_code,join_time
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -59,7 +60,7 @@
|
|||||||
code, is_attention, attention_at,
|
code, is_attention, attention_at,
|
||||||
is_shareholder, level, distribute_type,
|
is_shareholder, level, distribute_type,
|
||||||
sort, created_at, updated_at,
|
sort, created_at, updated_at,
|
||||||
mini_open_id)
|
mini_open_id,join_time)
|
||||||
values (#{id,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{creditAmount,jdbcType=DECIMAL},
|
values (#{id,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{creditAmount,jdbcType=DECIMAL},
|
||||||
#{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER}, #{levelConsume,jdbcType=DECIMAL},
|
#{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER}, #{levelConsume,jdbcType=DECIMAL},
|
||||||
#{status,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
|
#{status,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
|
||||||
@@ -69,7 +70,7 @@
|
|||||||
#{code,jdbcType=VARCHAR}, #{isAttention,jdbcType=TINYINT}, #{attentionAt,jdbcType=INTEGER},
|
#{code,jdbcType=VARCHAR}, #{isAttention,jdbcType=TINYINT}, #{attentionAt,jdbcType=INTEGER},
|
||||||
#{isShareholder,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{distributeType,jdbcType=VARCHAR},
|
#{isShareholder,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{distributeType,jdbcType=VARCHAR},
|
||||||
#{sort,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
|
#{sort,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
|
||||||
#{miniOpenId,jdbcType=VARCHAR})
|
#{miniOpenId,jdbcType=VARCHAR},#{joinTime,jdbcType=TIMESTAMP})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||||
insert into tb_shop_user
|
insert into tb_shop_user
|
||||||
@@ -158,6 +159,9 @@
|
|||||||
<if test="miniOpenId != null">
|
<if test="miniOpenId != null">
|
||||||
mini_open_id,
|
mini_open_id,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="joinTime != null">
|
||||||
|
join_time,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -244,6 +248,9 @@
|
|||||||
<if test="miniOpenId != null">
|
<if test="miniOpenId != null">
|
||||||
#{miniOpenId,jdbcType=VARCHAR},
|
#{miniOpenId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="joinTime != null">
|
||||||
|
#{joinTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||||
@@ -330,6 +337,9 @@
|
|||||||
<if test="miniOpenId != null">
|
<if test="miniOpenId != null">
|
||||||
mini_open_id = #{miniOpenId,jdbcType=VARCHAR},
|
mini_open_id = #{miniOpenId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="joinTime != null">
|
||||||
|
join_time = #{joinTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
@@ -361,7 +371,8 @@
|
|||||||
sort = #{sort,jdbcType=INTEGER},
|
sort = #{sort,jdbcType=INTEGER},
|
||||||
created_at = #{createdAt,jdbcType=BIGINT},
|
created_at = #{createdAt,jdbcType=BIGINT},
|
||||||
updated_at = #{updatedAt,jdbcType=BIGINT},
|
updated_at = #{updatedAt,jdbcType=BIGINT},
|
||||||
mini_open_id = #{miniOpenId,jdbcType=VARCHAR}
|
mini_open_id = #{miniOpenId,jdbcType=VARCHAR},
|
||||||
|
join_time = #{joinTime,jdbcType=TIMESTAMP}
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user