订单详情调整

This commit is contained in:
2024-09-26 16:00:52 +08:00
parent a43aaa3e73
commit 64a56ac4c2
2 changed files with 4 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ public class ProductController {
@RequestParam(required = false) String code, @RequestParam(required = false) String code,
@RequestParam(required = false) Integer shopId @RequestParam(required = false) Integer shopId
) { ) {
if (shopId == null && StrUtil.isNotBlank(code)) { if (shopId == null && StrUtil.isBlank(code)) {
return Result.fail("参数缺失"); return Result.fail("参数缺失");
} }
return productService.queryShopIdByTableCode(userId, openId, code,lat,lng, shopId); return productService.queryShopIdByTableCode(userId, openId, code,lat,lng, shopId);

View File

@@ -131,7 +131,7 @@ public class ProductService {
} }
} }
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(shopId); TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(shopId != null ? shopId : tbShopTable.getShopId());
String distance = LocationUtils.getDistanceString( String distance = LocationUtils.getDistanceString(
Double.parseDouble(lng), Double.parseDouble(lat), Double.parseDouble(lng), Double.parseDouble(lat),
Double.parseDouble(shopInfo.getLng()), Double.parseDouble(shopInfo.getLat())); Double.parseDouble(shopInfo.getLng()), Double.parseDouble(shopInfo.getLat()));
@@ -148,7 +148,7 @@ public class ProductService {
concurrentMap.put("shopTableInfo", tbShopTable); concurrentMap.put("shopTableInfo", tbShopTable);
concurrentMap.put("storeInfo", shopInfo); concurrentMap.put("storeInfo", shopInfo);
concurrentMap.put("distance", distance); concurrentMap.put("distance", distance);
TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId.toString()); TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId != null ? shopId.toString() : tbShopTable.getShopId().toString());
try { try {
if (ObjectUtil.isEmpty(shopUser)) { if (ObjectUtil.isEmpty(shopUser)) {
TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId)); TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
@@ -169,7 +169,7 @@ public class ProductService {
shopUser.setConsumeNumber(0); shopUser.setConsumeNumber(0);
shopUser.setLevelConsume(BigDecimal.ZERO); shopUser.setLevelConsume(BigDecimal.ZERO);
shopUser.setStatus(Byte.parseByte("1")); shopUser.setStatus(Byte.parseByte("1"));
shopUser.setShopId(shopId.toString()); shopUser.setShopId(shopId != null ? shopId.toString() : tbShopTable.getShopId().toString());
shopUser.setUserId(userId); shopUser.setUserId(userId);
shopUser.setMiniOpenId(openId); shopUser.setMiniOpenId(openId);
shopUser.setCreatedAt(System.currentTimeMillis()); shopUser.setCreatedAt(System.currentTimeMillis());