接口加拦截
This commit is contained in:
@@ -7,6 +7,7 @@ import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.request.OpeningOperationPlanAuditRequest;
|
||||
@@ -55,6 +56,10 @@ public class AuditOpeningOperationPlanImpl implements AuditOpeningOperationPlanS
|
||||
log.error("auditPlan request is null");
|
||||
throw new ServiceException("auditPlan request is null");
|
||||
}
|
||||
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_14);
|
||||
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_141.getShopSubStageStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
try {
|
||||
ShopAuditInfoDO shopAuditInfoDO = request.toShopAuditInfoDO();
|
||||
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
|
||||
|
||||
@@ -303,10 +303,12 @@ public class DeskServiceImpl implements DeskService {
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo : list) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
if (deskStageMap.get(vo.getShopId()) != null) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
@@ -324,10 +326,12 @@ public class DeskServiceImpl implements DeskService {
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo : list) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
if (deskStageMap.get(vo.getShopId()) != null) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
@@ -345,10 +349,12 @@ public class DeskServiceImpl implements DeskService {
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo : list) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
if (deskStageMap.get(vo.getShopId()) != null) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
@@ -365,10 +371,12 @@ public class DeskServiceImpl implements DeskService {
|
||||
}
|
||||
List<Long> shopIds = list.stream().map(PreparationCommonPendingVO::getShopId).collect(Collectors.toList());
|
||||
Map<Long, List<DeskStageDTO>> deskStageMap = new HashMap<>();
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_8.getShopSubStage());
|
||||
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStages(shopIds, ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
|
||||
doThing(deskStageMap, subStageList);
|
||||
for (PreparationCommonPendingVO vo : list) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
if (deskStageMap.get(vo.getShopId()) != null) {
|
||||
vo.setSubmitTime(deskStageMap.get(vo.getShopId()).get(0).getActualCompleteTime());
|
||||
}
|
||||
}
|
||||
pageInfo.setList(list);
|
||||
return pageInfo;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.ShopStageInfoDAO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.point.ShopSubStageEnum;
|
||||
import com.cool.store.enums.point.ShopSubStageStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.*;
|
||||
@@ -54,6 +55,10 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean submitLicense(FranchiseFeeRequest request) {
|
||||
log.info("submitLicense request:{}", JSONObject.toJSONString(request));
|
||||
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_7);
|
||||
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_70.getShopSubStageStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
FranchiseFeeDO franchiseFeeDO = request.toFranchiseFeeDO();
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_71);
|
||||
if (request.getId() != null) {
|
||||
@@ -112,6 +117,10 @@ public class FranchiseFeeServiceImpl implements FranchiseFeeService {
|
||||
|
||||
@Override
|
||||
public Boolean auditFranchiseFee(AuditFranchiseFeeRequest request, LoginUserInfo user) {
|
||||
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_7);
|
||||
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_72.getShopSubStageStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
|
||||
shopAuditInfoDO.setShopId(request.getShopId());
|
||||
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
|
||||
|
||||
@@ -143,6 +143,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
protected Boolean auditPass(Long auditId, LineInfoDO lineInfo, String userId) {
|
||||
if (!lineInfo.getWorkflowStage().equals(WorkflowStageEnum.INTENT.getCode())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
lineInfo.setId(lineInfo.getId());
|
||||
lineInfo.setWorkflowStage(WorkflowStageEnum.STORE.getCode());
|
||||
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_125.getCode());
|
||||
|
||||
@@ -950,6 +950,10 @@ public class PointServiceImpl implements PointService {
|
||||
if(!ShopStageEnum.SHOP_STAGE_1.getShopStage().equals(shopInfo.getShopStage())){
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_STAGE_NOT_OPERATE);
|
||||
}
|
||||
ShopStageInfoDO shopStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_2);
|
||||
if (!shopStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21.getShopSubStageStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
//正新放开限制
|
||||
// if(!request.getOperateUserId().equals(lineInfo.getDevelopmentManager())){
|
||||
|
||||
@@ -197,6 +197,9 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
@Override
|
||||
public void registrationCompleted(Long shopId) {
|
||||
ShopStageInfoDO shopStageInfoDO = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_5);
|
||||
if (!shopStageInfoDO.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_50.getShopSubStageStatus())){
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
|
||||
}
|
||||
if(shopStageInfoDO != null){
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51);
|
||||
//状态结束
|
||||
|
||||
Reference in New Issue
Block a user