memberIn 增加shopId merchantId

This commit is contained in:
GYJ
2024-06-20 15:19:03 +08:00
parent f4d177609c
commit c1790a3198
3 changed files with 35 additions and 10 deletions

View File

@@ -21,6 +21,8 @@ public class TbMemberIn implements Serializable {
private String tradeNo;
private String shopId;
private Date createTime;
private Date updateTime;
@@ -91,6 +93,14 @@ public class TbMemberIn implements Serializable {
this.tradeNo = tradeNo == null ? null : tradeNo.trim();
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public Date getCreateTime() {
return createTime;
}
@@ -106,4 +116,4 @@ public class TbMemberIn implements Serializable {
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}
}

View File

@@ -213,12 +213,14 @@ public class MemberService {
BigDecimal amount = new BigDecimal(String.valueOf(map.get("amount"))).setScale(2, RoundingMode.DOWN);
TbMemberIn memberIn = new TbMemberIn();
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
memberIn.setAmount(amount);
memberIn.setUserId(shopUser.getId());
memberIn.setCode(shopUser.getCode());
memberIn.setStatus("7");
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
memberIn.setCreateTime(new Date());
memberIn.setShopId(shopId);
tbMemberInMapper.insert(memberIn);
TbMerchantThirdApply thirdApply = tbMerchantThirdApplyMapper.selectByPrimaryKey(Integer.valueOf(shopInfo.getMerchantId()));
@@ -540,12 +542,14 @@ public class MemberService {
BigDecimal amount = new BigDecimal(String.valueOf(map.get("amount"))).setScale(2, RoundingMode.DOWN);
TbMemberIn memberIn = new TbMemberIn();
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
memberIn.setAmount(amount);
memberIn.setUserId(shopUser.getId());
memberIn.setCode(shopUser.getCode());
memberIn.setStatus("0");
memberIn.setCreateTime(new Date());
memberIn.setTradeNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
memberIn.setShopId(shopId);
tbMemberInMapper.insert(memberIn);
shopUser.setAmount(shopUser.getAmount().add(amount));

View File

@@ -10,15 +10,16 @@
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="order_no" jdbcType="VARCHAR" property="orderNo" />
<result column="trade_no" jdbcType="VARCHAR" property="tradeNo" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, user_id, merchant_id, code, amount, status, order_no, trade_no, create_time,
id, user_id, merchant_id, code, amount, status, order_no, trade_no, shop_id, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
select
<include refid="Base_Column_List" />
from tb_member_in
where id = #{id,jdbcType=INTEGER}
@@ -28,13 +29,13 @@
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn" keyProperty="id" useGeneratedKeys="true">
insert into tb_member_in (id, user_id, merchant_id,
code, amount, status,
order_no, trade_no, create_time,
insert into tb_member_in (id, user_id, merchant_id,
code, amount, status,
order_no, trade_no, shop_id, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{merchantId,jdbcType=INTEGER},
#{code,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
#{orderNo,jdbcType=VARCHAR}, #{tradeNo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{merchantId,jdbcType=INTEGER},
#{code,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
#{orderNo,jdbcType=VARCHAR}, #{tradeNo,jdbcType=VARCHAR}, #{shopId}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
@@ -64,6 +65,9 @@
<if test="tradeNo != null">
trade_no,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="createTime != null">
create_time,
</if>
@@ -96,6 +100,9 @@
<if test="tradeNo != null">
#{tradeNo,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
#{shopId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
@@ -128,6 +135,9 @@
<if test="tradeNo != null">
trade_no = #{tradeNo,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
@@ -146,8 +156,9 @@
status = #{status,jdbcType=VARCHAR},
order_no = #{orderNo,jdbcType=VARCHAR},
trade_no = #{tradeNo,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
</mapper>