修改创建订单,判断购物车为空处理

This commit is contained in:
韩鹏辉 2024-03-26 16:16:14 +08:00
parent 130d3259cc
commit f206777914
2 changed files with 19 additions and 0 deletions

View File

@ -95,6 +95,21 @@ public class MemberService {
return Result.fail(CodeEnum.MEMBERHAVED);
}
if(ObjectUtil.isNotNull(tbShopUsers)&&ObjectUtil.isNotEmpty(tbShopUsers)){
TbShopUser tbShopUser= tbShopUsers.get(0);
String code= RandomUtil.randomNumbers(6);
tbShopUser.setCode(code);
tbShopUser.setTelephone(phone);
tbShopUser.setBirthDay(map.get("birthDay")+"");
tbShopUser.setName(map.get("nickName")+"");
tbShopUser.setSex(Byte.parseByte(map.get("sex")+""));
tbShopUser.setLevel(Byte.parseByte(map.get("level")+""));
tbShopUser.setIsVip(Byte.parseByte("1"));
tbShopUser.setUpdatedAt(System.currentTimeMillis());
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
return Result.success(CodeEnum.SUCCESS);
}
TbShopUser tbShopUser=new TbShopUser();
tbShopUser.setAmount(BigDecimal.ZERO);
tbShopUser.setCreditAmount(BigDecimal.ZERO);

View File

@ -122,6 +122,10 @@
FROM
tb_shop_user_flow f
LEFT JOIN tb_shop_user u ON f.shop_user_id = u.id
where 1=1
<if test="memberId != null and memberId!=''">
and u.id = #{memberId}
</if>
order by f.id desc
</select>
</mapper>