shopUser增加 店铺名称字段

This commit is contained in:
2024-07-03 16:29:11 +08:00
parent 09bfa5bdec
commit 376134fc19
2 changed files with 15 additions and 0 deletions

View File

@@ -7,9 +7,11 @@ import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.TbMerchantAccountMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
import com.chaozhanggui.system.cashierservice.dao.TbUserInfoMapper;
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.AuthUserDto;
@@ -55,6 +57,8 @@ public class UserContoller {
@Autowired
private TbShopUserMapper shopUserMapper;
@Autowired
private TbShopInfoMapper shopInfoMapper;
@Autowired
private TbUserInfoMapper userInfoMapper;
// @GetMapping("/userInfo")
@@ -80,6 +84,7 @@ public class UserContoller {
@GetMapping("/shopUserInfo")
public Result shopUserInfo(@RequestParam("userId") String userId ,@RequestHeader("openId") String openId,@RequestParam("shopId") String shopId ) throws Exception {
TbShopUser shopUser=new TbShopUser();
TbShopInfo tbShopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
if (StringUtils.isNotBlank(shopId) && !shopId.equals("null")) {
shopUser = shopUserMapper.selectByUserIdAndShopId(userId, shopId);
if (ObjectUtil.isEmpty(shopUser)) {
@@ -116,6 +121,7 @@ public class UserContoller {
}else {
shopUser.setAmount(BigDecimal.ZERO);
}
shopUser.setShopName(tbShopInfo.getShopName());
return Result.success(CodeEnum.SUCCESS,shopUser);
}