红圈通接口 加校验
This commit is contained in:
@@ -234,6 +234,7 @@ public enum ErrorCodeEnum {
|
||||
STATUS_NOT_SUPPORT_SUMMIT(121006,"该状态不支持提交",null),
|
||||
DESIGN_NO_COMPLETE(121007,"请先完成设计阶段!",null),
|
||||
SIGN_COMPLETED(121008,"你已完成验收,无需重复操作!",null),
|
||||
SHOP_CODE_EXIST(121009,"存在重复门店编码,请联系CRM工作人员处理",null),
|
||||
|
||||
UPDATE_FAIL(131000,"修改失败,表单不存在!",null),
|
||||
LICENSE_LEGAL_STAGE_FAIL(131001,"营业执照阶段未上传!",null),
|
||||
|
||||
@@ -339,4 +339,7 @@ public class ShopInfoDAO {
|
||||
example.createCriteria().andEqualTo("shopCode", shopCode);
|
||||
return shopInfoMapper.selectOneByExample(example);
|
||||
}
|
||||
public Integer getNumByShopCode(String shopCode){
|
||||
return shopInfoMapper.getNumByShopCode(shopCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,4 +146,5 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
|
||||
List<IsCreateStoreDTO> selectIsCreateStore();
|
||||
Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList);
|
||||
Integer getNumByShopCode(@Param("shopCode") String shopCode);
|
||||
}
|
||||
|
||||
@@ -559,6 +559,9 @@
|
||||
and b.is_delete = 'effective'
|
||||
and a.region_id != 459
|
||||
</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">
|
||||
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
||||
|
||||
@@ -43,6 +43,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -76,6 +80,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -102,6 +110,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -125,6 +137,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -152,6 +168,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -174,6 +194,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -195,6 +219,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -216,6 +244,10 @@ public class DecorationDesignInfoServiceImpl implements DecorationDesignInfoServ
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
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());
|
||||
if (shopInfoDO == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
|
||||
@@ -179,6 +179,10 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
|
||||
|
||||
@Override
|
||||
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());
|
||||
if (shopInfoDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
@@ -225,6 +229,10 @@ public class DecorationMeasureServiceImpl implements DecorationMeasureService {
|
||||
|
||||
@Override
|
||||
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());
|
||||
if (shopInfoDO == null){
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_NOT_EXIST);
|
||||
|
||||
Reference in New Issue
Block a user