提交
This commit is contained in:
@@ -25,6 +25,8 @@ public class TbMemberIn implements Serializable {
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private Integer shopId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
@@ -106,4 +108,12 @@ public class TbMemberIn implements Serializable {
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
}
|
||||
@@ -276,6 +276,7 @@ public class PayService {
|
||||
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result memberIn(String openId,String userId,String amount,String shopId,String ip){
|
||||
if(ObjectUtil.isEmpty(openId)||ObjectUtil.isEmpty(userId)){
|
||||
return Result.fail("用户信息允许为空");
|
||||
@@ -287,6 +288,10 @@ public class PayService {
|
||||
return Result.fail("对应的用户信息不存在");
|
||||
}
|
||||
|
||||
if(ObjectUtil.isEmpty(tbShopUser.getIsVip())||!"1".equals(tbShopUser.getIsVip().toString())){
|
||||
return Result.fail("非会员用户不允许充值");
|
||||
}
|
||||
|
||||
|
||||
TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
|
||||
if(ObjectUtil.isEmpty(shopInfo)){
|
||||
@@ -305,8 +310,9 @@ public class PayService {
|
||||
|
||||
TbMemberIn memberIn=new TbMemberIn();
|
||||
memberIn.setAmount(payAmount);
|
||||
memberIn.setUserId(Integer.valueOf(tbShopUser.getId()));
|
||||
memberIn.setUserId(Integer.valueOf(tbShopUser.getUserId()));
|
||||
memberIn.setCode(tbShopUser.getCode());
|
||||
memberIn.setShopId(shopInfo.getId());
|
||||
memberIn.setStatus("7");
|
||||
memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
|
||||
memberIn.setCreateTime(new Date());
|
||||
@@ -335,7 +341,6 @@ public class PayService {
|
||||
if(response.getStatusCodeValue()==200&&ObjectUtil.isNotEmpty(response.getBody())){
|
||||
JSONObject object=JSONObject.parseObject(response.getBody());
|
||||
if(object.get("code").equals("0")){
|
||||
|
||||
memberIn.setOrderNo(object.getJSONObject("data").get("orderNumber").toString());
|
||||
memberIn.setUpdateTime(new Date());
|
||||
tbMemberInMapper.updateByPrimaryKeySelective(memberIn);
|
||||
@@ -403,7 +408,7 @@ public class PayService {
|
||||
memberIn.setUpdateTime(new Date());
|
||||
tbMemberInMapper.updateByPrimaryKeySelective(memberIn);
|
||||
|
||||
TbShopUser tbShopUser= tbShopUserMapper.selectByUserId(memberIn.getUserId().toString());
|
||||
TbShopUser tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(memberIn.getUserId().toString(),memberIn.getShopId().toString());
|
||||
if(ObjectUtil.isEmpty(tbShopUser)){
|
||||
return "用户信息不存在";
|
||||
}
|
||||
|
||||
@@ -12,10 +12,11 @@
|
||||
<result column="trade_no" jdbcType="VARCHAR" property="tradeNo" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, merchant_id, code, amount, status, order_no, trade_no, create_time,
|
||||
update_time
|
||||
update_time,shop_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
@@ -27,15 +28,15 @@
|
||||
delete from tb_member_in
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
|
||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into tb_member_in (id, user_id, merchant_id,
|
||||
code, amount, status,
|
||||
order_no, trade_no, create_time,
|
||||
update_time)
|
||||
update_time,shop_id)
|
||||
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},
|
||||
#{updateTime,jdbcType=TIMESTAMP})
|
||||
#{updateTime,jdbcType=TIMESTAMP},#{shopId,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbMemberIn">
|
||||
insert into tb_member_in
|
||||
|
||||
Reference in New Issue
Block a user