增加store校验

This commit is contained in:
shuo.wang
2025-07-15 11:05:30 +08:00
parent 61db5b9d0f
commit 070b8f0b8a
3 changed files with 10 additions and 3 deletions

View File

@@ -286,6 +286,7 @@ public enum ErrorCodeEnum {
PRODUCTS_RECORD_NOT_EXIST(1511033,"预炸记录不存在!",null), PRODUCTS_RECORD_NOT_EXIST(1511033,"预炸记录不存在!",null),
PRODUCTS_DISCARDED(1511034,"产品已报销,无法操作",null), PRODUCTS_DISCARDED(1511034,"产品已报销,无法操作",null),
PRODUCTS_SALES_COMPLETED(1511034,"含有销售完成的产品,无法批量报销",null), PRODUCTS_SALES_COMPLETED(1511034,"含有销售完成的产品,无法批量报销",null),
STORE_IS_EXIST(1511035,"该门店已存在",null),
; ;

View File

@@ -76,7 +76,7 @@
<select id="getByStoreNum" resultMap="BaseResultMap"> <select id="getByStoreNum" resultMap="BaseResultMap">
select * select *
from store_${enterpriseId} from store_${enterpriseId}
where store_num = #{storeNum} where store_num = #{storeNum} and is_delete = 'effective'
</select> </select>
<select id="listByMobile" resultMap="BaseResultMap"> <select id="listByMobile" resultMap="BaseResultMap">

View File

@@ -5,6 +5,7 @@ import com.cool.store.context.CurrentUserHolder;
import com.cool.store.dao.*; import com.cool.store.dao.*;
import com.cool.store.entity.*; import com.cool.store.entity.*;
import com.cool.store.enums.*; import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.FranchiseFeeMapper; import com.cool.store.mapper.FranchiseFeeMapper;
import com.cool.store.mapper.SignFranchiseMapper; import com.cool.store.mapper.SignFranchiseMapper;
import com.cool.store.mq.producer.SimpleMessageService; import com.cool.store.mq.producer.SimpleMessageService;
@@ -23,6 +24,7 @@ import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import static com.cool.store.enums.AuditExecuteEnum.FRANCHISEES; import static com.cool.store.enums.AuditExecuteEnum.FRANCHISEES;
import static com.cool.store.enums.ExtendFieldTypeEnum.*; import static com.cool.store.enums.ExtendFieldTypeEnum.*;
@@ -68,12 +70,17 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
private LineInfoDAO lineInfoDAO; private LineInfoDAO lineInfoDAO;
@Value("${mybatis.configuration.variables.enterpriseId}") @Value("${mybatis.configuration.variables.enterpriseId}")
private String eid; private String eid;
@Resource
private StoreDao storeDao;
@Override @Override
@Async @Async
public void syncStore(Long shopId) { public void syncStore(Long shopId) {
StoreRequestBody requestBody = new StoreRequestBody(); StoreRequestBody requestBody = new StoreRequestBody();
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId); ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
StoreDO storeDO = storeDao.getByStoreNum(shopInfo.getShopCode());
if (Objects.nonNull(storeDO)){
throw new ServiceException(ErrorCodeEnum.STORE_IS_EXIST);
}
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId()); LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfo.getLineId());
PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(shopInfo.getPointId()); PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
BuildInformationDO buildInformationDO = buildInformationDAO.selectOneByShopId(shopId); BuildInformationDO buildInformationDO = buildInformationDAO.selectOneByShopId(shopId);
@@ -86,7 +93,6 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
requestBody.setCounty(pointInfoDO.getDistrict()); requestBody.setCounty(pointInfoDO.getDistrict());
requestBody.setLocation_address(shopInfo.getDetailAddress()); requestBody.setLocation_address(shopInfo.getDetailAddress());
requestBody.setStore_address(shopInfo.getDetailAddress()); requestBody.setStore_address(shopInfo.getDetailAddress());
//todo 等待王硕确认
if (shopInfo.getManagerRegionId() == null) { if (shopInfo.getManagerRegionId() == null) {
BigRegionDO byRegionId = bigRegionDAO.getByRegionId(shopInfo.getRegionId()); BigRegionDO byRegionId = bigRegionDAO.getByRegionId(shopInfo.getRegionId());
if (byRegionId != null){ if (byRegionId != null){