Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -87,9 +87,11 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
|
||||
|
||||
@Override
|
||||
public Boolean updateInfo(Long shopId, ShopUserEditDTO shopUserEditDTO) {
|
||||
long count = count(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getPhone, shopUserEditDTO.getPhone()).ne(ShopUser::getId, shopUserEditDTO.getId()));
|
||||
if (count > 0) {
|
||||
throw new ApiNotPrintException("手机号已存在");
|
||||
if (StrUtil.isNotBlank(shopUserEditDTO.getPhone())) {
|
||||
long count = count(new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getPhone, shopUserEditDTO.getPhone()).ne(ShopUser::getId, shopUserEditDTO.getId()));
|
||||
if (count > 0) {
|
||||
throw new ApiNotPrintException("手机号已存在");
|
||||
}
|
||||
}
|
||||
ShopUser shopUser = getUserInfo(shopId, shopUserEditDTO.getId());
|
||||
BeanUtil.copyProperties(shopUserEditDTO, shopUser);
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.czg.account.dto.user.userinfo.UserInfoAssetsSummaryDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoEditDTO;
|
||||
import com.czg.account.dto.user.userinfo.UserInfoPwdEditDTO;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.UserInfoService;
|
||||
import com.czg.config.RedisCst;
|
||||
@@ -16,6 +17,7 @@ import com.czg.service.RedisService;
|
||||
import com.czg.service.account.mapper.ShopUserMapper;
|
||||
import com.czg.service.account.mapper.UserInfoMapper;
|
||||
import com.czg.system.service.SmsService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
@@ -51,10 +53,17 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateInfo(long userId, UserInfoEditDTO userInfoEditDTO) {
|
||||
public Boolean updateInfo(long shopId, long userId, UserInfoEditDTO userInfoEditDTO) {
|
||||
UserInfo userInfo = getById(userId);
|
||||
BeanUtil.copyProperties(userInfoEditDTO, userInfo);
|
||||
return save(userInfo);
|
||||
if (save(userInfo)) {
|
||||
if (shopId != -1L) {
|
||||
ShopUser shopUser = BeanUtil.copyProperties(userInfo, ShopUser.class);
|
||||
return shopUserMapper.updateByQuery(shopUser, new QueryWrapper().eq(ShopUser::getShopId, shopId).eq(ShopUser::getUserId, userId)) > 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -435,7 +435,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
prodCouponAmount.setPrice((prodCouponAmount.getPrice().add(orderDetail.getUnitPrice())).multiply(orderDetail.getCouponNum()));
|
||||
} else {
|
||||
orderDetail.setCouponNum(BigDecimal.ZERO);
|
||||
orderDetail.setPayAmount(orderDetail.getNum().subtract(orderDetail.getReturnNum()).multiply(orderDetail.getUnitPrice()));
|
||||
orderDetail.setPayAmount((orderDetail.getNum().subtract(orderDetail.getReturnNum())).multiply(orderDetail.getUnitPrice()));
|
||||
}
|
||||
totalAmount.setPrice(totalAmount.getPrice().add(orderDetail.getPayAmount()));
|
||||
resultList.add(orderDetail);
|
||||
|
||||
Reference in New Issue
Block a user