红圈通接口 加校验

This commit is contained in:
shuo.wang
2025-08-04 10:47:00 +08:00
parent a7065fabd9
commit 9bb391559c
6 changed files with 48 additions and 0 deletions

View File

@@ -234,6 +234,7 @@ public enum ErrorCodeEnum {
STATUS_NOT_SUPPORT_SUMMIT(121006,"该状态不支持提交",null), STATUS_NOT_SUPPORT_SUMMIT(121006,"该状态不支持提交",null),
DESIGN_NO_COMPLETE(121007,"请先完成设计阶段!",null), DESIGN_NO_COMPLETE(121007,"请先完成设计阶段!",null),
SIGN_COMPLETED(121008,"你已完成验收,无需重复操作!",null), SIGN_COMPLETED(121008,"你已完成验收,无需重复操作!",null),
SHOP_CODE_EXIST(121009,"存在重复门店编码请联系CRM工作人员处理",null),
UPDATE_FAIL(131000,"修改失败,表单不存在!",null), UPDATE_FAIL(131000,"修改失败,表单不存在!",null),
LICENSE_LEGAL_STAGE_FAIL(131001,"营业执照阶段未上传!",null), LICENSE_LEGAL_STAGE_FAIL(131001,"营业执照阶段未上传!",null),

View File

@@ -339,4 +339,7 @@ public class ShopInfoDAO {
example.createCriteria().andEqualTo("shopCode", shopCode); example.createCriteria().andEqualTo("shopCode", shopCode);
return shopInfoMapper.selectOneByExample(example); return shopInfoMapper.selectOneByExample(example);
} }
public Integer getNumByShopCode(String shopCode){
return shopInfoMapper.getNumByShopCode(shopCode);
}
} }

View File

@@ -146,4 +146,5 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
List<IsCreateStoreDTO> selectIsCreateStore(); List<IsCreateStoreDTO> selectIsCreateStore();
Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList); Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList);
Integer getNumByShopCode(@Param("shopCode") String shopCode);
} }

View File

@@ -559,6 +559,9 @@
and b.is_delete = 'effective' and b.is_delete = 'effective'
and a.region_id != 459 and a.region_id != 459
</select> </select>
<select id="getNumByShopCode" resultType="java.lang.Integer">
select count(1) from xfsg_shop_info where shop_code = #{shopCode} and deleted = 0 and shop_status != 2
</select>
<update id="batchUpdate" parameterType="list"> <update id="batchUpdate" parameterType="list">
<foreach collection="list" item="item" index="index" open="" close="" separator=";"> <foreach collection="list" item="item" index="index" open="" close="" separator=";">

View File

@@ -43,6 +43,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean assignDesigner(AssignDesignerRequest request) { public Boolean assignDesigner(AssignDesignerRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -76,6 +80,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean submitDesignDrawing(SubmitDesignDrawingRequest request) { public Boolean submitDesignDrawing(SubmitDesignDrawingRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -102,6 +110,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean assignQuotation(AssignQuotationRequest request) { public Boolean assignQuotation(AssignQuotationRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -125,6 +137,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean submitQuotationSheet(SubmitQuotationSheetRequest request) { public Boolean submitQuotationSheet(SubmitQuotationSheetRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -152,6 +168,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean submitConstructionOrder(ConstructionOrderRequest request) { public Boolean submitConstructionOrder(ConstructionOrderRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -174,6 +194,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean entryConfirmation(EntryConfirmationRequest request) { public Boolean entryConfirmation(EntryConfirmationRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -195,6 +219,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean constructionCompleted(ConstructionCompletedRequest request) { public Boolean constructionCompleted(ConstructionCompletedRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -216,6 +244,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean decorationAcceptance(HqtDecorationAcceptanceRequest request) { public Boolean decorationAcceptance(HqtDecorationAcceptanceRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null) { if (shopInfoDO == null) {
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);

View File

@@ -179,6 +179,10 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
@Override @Override
public Boolean assignSurveyors(AssignSurveyorsRequest request) { public Boolean assignSurveyors(AssignSurveyorsRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null){ if (shopInfoDO == null){
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
@@ -225,6 +229,10 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
@Override @Override
public Boolean submitMeasurementDiagram(SubmitMeasurementRequest request) { public Boolean submitMeasurementDiagram(SubmitMeasurementRequest request) {
Integer numByShopCode = shopInfoDAO.getNumByShopCode(request.getShopCode());
if(numByShopCode > 1){
throw new ServiceException(ErrorCodeEnum.SHOP_CODE_EXIST);
}
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode()); ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfoByShopCode(request.getShopCode());
if (shopInfoDO == null){ if (shopInfoDO == null){
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);