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 tradeNo;
private String shopId;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
@@ -91,6 +93,14 @@ public class TbMemberIn implements Serializable {
this.tradeNo = tradeNo == null ? null : tradeNo.trim(); this.tradeNo = tradeNo == null ? null : tradeNo.trim();
} }
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
@@ -106,4 +116,4 @@ public class TbMemberIn implements Serializable {
public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
this.updateTime = 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); BigDecimal amount = new BigDecimal(String.valueOf(map.get("amount"))).setScale(2, RoundingMode.DOWN);
TbMemberIn memberIn = new TbMemberIn(); TbMemberIn memberIn = new TbMemberIn();
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
memberIn.setAmount(amount); memberIn.setAmount(amount);
memberIn.setUserId(shopUser.getId()); memberIn.setUserId(shopUser.getId());
memberIn.setCode(shopUser.getCode()); memberIn.setCode(shopUser.getCode());
memberIn.setStatus("7"); memberIn.setStatus("7");
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId())); memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
memberIn.setCreateTime(new Date()); memberIn.setCreateTime(new Date());
memberIn.setShopId(shopId);
tbMemberInMapper.insert(memberIn); tbMemberInMapper.insert(memberIn);
TbMerchantThirdApply thirdApply = tbMerchantThirdApplyMapper.selectByPrimaryKey(Integer.valueOf(shopInfo.getMerchantId())); 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); BigDecimal amount = new BigDecimal(String.valueOf(map.get("amount"))).setScale(2, RoundingMode.DOWN);
TbMemberIn memberIn = new TbMemberIn(); TbMemberIn memberIn = new TbMemberIn();
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
memberIn.setAmount(amount); memberIn.setAmount(amount);
memberIn.setUserId(shopUser.getId()); memberIn.setUserId(shopUser.getId());
memberIn.setCode(shopUser.getCode()); memberIn.setCode(shopUser.getCode());
memberIn.setStatus("0"); memberIn.setStatus("0");
memberIn.setCreateTime(new Date()); memberIn.setCreateTime(new Date());
memberIn.setTradeNo("cash".concat(SnowFlakeUtil.generateOrderNo())); memberIn.setTradeNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
memberIn.setShopId(shopId);
tbMemberInMapper.insert(memberIn); tbMemberInMapper.insert(memberIn);
shopUser.setAmount(shopUser.getAmount().add(amount)); shopUser.setAmount(shopUser.getAmount().add(amount));

View File

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