门店编码重复校验
This commit is contained in:
@@ -342,4 +342,10 @@ public class ShopInfoDAO {
|
|||||||
public Integer getNumByShopCode(String shopCode){
|
public Integer getNumByShopCode(String shopCode){
|
||||||
return shopInfoMapper.getNumByShopCode(shopCode);
|
return shopInfoMapper.getNumByShopCode(shopCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ShopInfoDO> getShopListByShopCode(String shopCode){
|
||||||
|
Example example = new Example(ShopInfoDO.class);
|
||||||
|
example.createCriteria().andEqualTo("shopCode", shopCode);
|
||||||
|
return shopInfoMapper.selectByExample(example);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,4 +134,10 @@ public interface ShopService {
|
|||||||
List<UserDTO> getSubStageHandle(Long shopId,Integer subStage);
|
List<UserDTO> getSubStageHandle(Long shopId,Integer subStage);
|
||||||
|
|
||||||
ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage);
|
ShopStageInfoVO getShopStageStatus(Long shopId, Integer subStage);
|
||||||
|
/**
|
||||||
|
* @Auther: wangshuo
|
||||||
|
* @Date: 2025/8/4
|
||||||
|
* @description: 校验门店编码重复
|
||||||
|
*/
|
||||||
|
Boolean checkShopCodeRepeat(String shopCode,Long shopId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ import static com.cool.store.enums.point.ShopSubStageStatusEnum.*;
|
|||||||
@Service
|
@Service
|
||||||
public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ShopService shopService;
|
||||||
@Resource
|
@Resource
|
||||||
private HqtAPIService hqtAPIService;
|
private HqtAPIService hqtAPIService;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -132,6 +134,10 @@ public class OrderSysInfoServiceImpl implements OrderSysInfoService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (request.getType().equals(OrderSysTypeEnum.ORDER_SYS_TYPE_2.getType())) {
|
if (request.getType().equals(OrderSysTypeEnum.ORDER_SYS_TYPE_2.getType())) {
|
||||||
|
//检验门店编码是否重复
|
||||||
|
if(shopService.checkShopCodeRepeat(request.getShopCode(), request.getShopId())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
|
||||||
|
}
|
||||||
shopInfoDAO.updateShopCode(request.getShopCode(), request.getShopId());
|
shopInfoDAO.updateShopCode(request.getShopCode(), request.getShopId());
|
||||||
orderSysInfoDO.setReceivingFirmName(request.getReceivingFirmName());
|
orderSysInfoDO.setReceivingFirmName(request.getReceivingFirmName());
|
||||||
orderSysInfoDO.setReceivingMsBankAccount(request.getReceivingMsBankAccount());
|
orderSysInfoDO.setReceivingMsBankAccount(request.getReceivingMsBankAccount());
|
||||||
|
|||||||
@@ -308,6 +308,10 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateShopCode(UpdateShopCodeRequest request, String userId) {
|
public Integer updateShopCode(UpdateShopCodeRequest request, String userId) {
|
||||||
|
//检验门店编码是否重复
|
||||||
|
if(this.checkShopCodeRepeat(request.getShopCode(), request.getShopId())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
|
||||||
|
}
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
if (Objects.isNull(shopInfo)) {
|
if (Objects.isNull(shopInfo)) {
|
||||||
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
throw new ServiceException(ErrorCodeEnum.POINT_NOT_EXIST);
|
||||||
@@ -429,6 +433,10 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer updateBranchShopDetail(BranchShopDetailRequest request, String userId) {
|
public Integer updateBranchShopDetail(BranchShopDetailRequest request, String userId) {
|
||||||
|
//检验门店编码是否重复
|
||||||
|
if(this.checkShopCodeRepeat(request.getShopCode(), request.getShopId())){
|
||||||
|
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
|
||||||
|
}
|
||||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||||
shopInfo.setUpdateUserId(userId);
|
shopInfo.setUpdateUserId(userId);
|
||||||
shopInfo.setUpdateTime(new Date());
|
shopInfo.setUpdateTime(new Date());
|
||||||
@@ -893,6 +901,22 @@ public class ShopServiceImpl implements ShopService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean checkShopCodeRepeat(String shopCode, Long shopId) {
|
||||||
|
//false 未重复, true 重复
|
||||||
|
List<ShopInfoDO> shopListByShopCode = shopInfoDAO.getShopListByShopCode(shopCode);
|
||||||
|
if (CollectionUtils.isEmpty(shopListByShopCode)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(shopListByShopCode)&&shopId ==null){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (shopListByShopCode.size() == 1 && shopListByShopCode.get(0).getId().equals(shopId)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取招商经理信息
|
* 获取招商经理信息
|
||||||
* @param
|
* @param
|
||||||
|
|||||||
Reference in New Issue
Block a user