订单详情调整
This commit is contained in:
@@ -45,7 +45,7 @@ public class ProductController {
|
||||
@RequestParam(required = false) String code,
|
||||
@RequestParam(required = false) Integer shopId
|
||||
) {
|
||||
if (shopId == null && StrUtil.isNotBlank(code)) {
|
||||
if (shopId == null && StrUtil.isBlank(code)) {
|
||||
return Result.fail("参数缺失");
|
||||
}
|
||||
return productService.queryShopIdByTableCode(userId, openId, code,lat,lng, shopId);
|
||||
|
||||
@@ -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(
|
||||
Double.parseDouble(lng), Double.parseDouble(lat),
|
||||
Double.parseDouble(shopInfo.getLng()), Double.parseDouble(shopInfo.getLat()));
|
||||
@@ -148,7 +148,7 @@ public class ProductService {
|
||||
concurrentMap.put("shopTableInfo", tbShopTable);
|
||||
concurrentMap.put("storeInfo", shopInfo);
|
||||
concurrentMap.put("distance", distance);
|
||||
TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId.toString());
|
||||
TbShopUser shopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId != null ? shopId.toString() : tbShopTable.getShopId().toString());
|
||||
try {
|
||||
if (ObjectUtil.isEmpty(shopUser)) {
|
||||
TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
||||
@@ -169,7 +169,7 @@ public class ProductService {
|
||||
shopUser.setConsumeNumber(0);
|
||||
shopUser.setLevelConsume(BigDecimal.ZERO);
|
||||
shopUser.setStatus(Byte.parseByte("1"));
|
||||
shopUser.setShopId(shopId.toString());
|
||||
shopUser.setShopId(shopId != null ? shopId.toString() : tbShopTable.getShopId().toString());
|
||||
shopUser.setUserId(userId);
|
||||
shopUser.setMiniOpenId(openId);
|
||||
shopUser.setCreatedAt(System.currentTimeMillis());
|
||||
|
||||
Reference in New Issue
Block a user