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