增加store校验
This commit is contained in:
@@ -286,6 +286,7 @@ public enum ErrorCodeEnum {
|
||||
PRODUCTS_RECORD_NOT_EXIST(1511033,"预炸记录不存在!",null),
|
||||
PRODUCTS_DISCARDED(1511034,"产品已报销,无法操作",null),
|
||||
PRODUCTS_SALES_COMPLETED(1511034,"含有销售完成的产品,无法批量报销",null),
|
||||
STORE_IS_EXIST(1511035,"该门店已存在",null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<select id="getByStoreNum" resultMap="BaseResultMap">
|
||||
select *
|
||||
from store_${enterpriseId}
|
||||
where store_num = #{storeNum}
|
||||
where store_num = #{storeNum} and is_delete = 'effective'
|
||||
</select>
|
||||
|
||||
<select id="listByMobile" resultMap="BaseResultMap">
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.FranchiseFeeMapper;
|
||||
import com.cool.store.mapper.SignFranchiseMapper;
|
||||
import com.cool.store.mq.producer.SimpleMessageService;
|
||||
@@ -23,6 +24,7 @@ import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cool.store.enums.AuditExecuteEnum.FRANCHISEES;
|
||||
import static com.cool.store.enums.ExtendFieldTypeEnum.*;
|
||||
@@ -68,12 +70,17 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
private String eid;
|
||||
|
||||
@Resource
|
||||
private StoreDao storeDao;
|
||||
@Override
|
||||
@Async
|
||||
public void syncStore(Long shopId) {
|
||||
StoreRequestBody requestBody = new StoreRequestBody();
|
||||
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());
|
||||
PointInfoDO pointInfoDO = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
|
||||
BuildInformationDO buildInformationDO = buildInformationDAO.selectOneByShopId(shopId);
|
||||
@@ -86,7 +93,6 @@ public class SyncMainSysServerImpl implements SyncMainSysServer {
|
||||
requestBody.setCounty(pointInfoDO.getDistrict());
|
||||
requestBody.setLocation_address(shopInfo.getDetailAddress());
|
||||
requestBody.setStore_address(shopInfo.getDetailAddress());
|
||||
//todo 等待王硕确认
|
||||
if (shopInfo.getManagerRegionId() == null) {
|
||||
BigRegionDO byRegionId = bigRegionDAO.getByRegionId(shopInfo.getRegionId());
|
||||
if (byRegionId != null){
|
||||
|
||||
Reference in New Issue
Block a user