加盟商编码

This commit is contained in:
苏竹红
2024-06-19 14:01:37 +08:00
parent 998909c522
commit d0c6d77a36
15 changed files with 42 additions and 426 deletions

View File

@@ -55,7 +55,6 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
} else {
//更新阶段信息
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_31, null);
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
}
}

View File

@@ -138,8 +138,7 @@ public class DecorationServiceImpl implements DecorationService {
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_9);
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_90.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
//更新设计阶段状态完成//初始化装修款阶段
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91,
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_100));
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_91));
LineInfoDO lineInfo = lineInfoMapper.getByLineId(shopSubStageInfo.getLineId());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.DECORATION_MODEL_PAY, null);
}
@@ -149,7 +148,7 @@ public class DecorationServiceImpl implements DecorationService {
@Override
public DecorationStageVO getDecorationGoldStage(Long shopId) {
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_10);
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, null);
if (Objects.isNull(shopSubStageInfo)) {
log.error("getDecorationModeStage , shopSubStageInfo is null");
return null;
@@ -199,21 +198,6 @@ public class DecorationServiceImpl implements DecorationService {
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean submitDecorationModel(LinePaySubmitRequest request, PartnerUserInfoVO partnerUserInfoVO) {
DecorationDTO decoration = getDecorationDTO(request.getShopId());
if (decoration == null) {
log.error("拉取云立方接口获取数据为空");
return null;
}
if (CollectionUtils.isNotEmpty(decoration.getPayment())) {
request.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
//更新阶段状态
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102);
} else {
request.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_45.getCode());
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_101);
}
request.setPayBusinessType(PayBusinessTypeEnum.DECORATION_MODEL.getCode());
linePayService.submitPayInfo(request, partnerUserInfoVO);
return Boolean.TRUE;
}
@@ -247,18 +231,6 @@ public class DecorationServiceImpl implements DecorationService {
log.error("拉取云立方接口获取缴费信息为空");
return null;
}
//已完成
if (CollectionUtils.isNotEmpty(decoration.getPayment())) {
linePayInfo.setPayStatus((byte) WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode().intValue());
LinePaySubmitRequest submitRequest = new LinePaySubmitRequest();
submitRequest.setLineId(linePayInfo.getLineId());
submitRequest.setShopId(shopId);
submitRequest.setPayBusinessType(PayBusinessTypeEnum.DECORATION_MODEL.getCode());
submitRequest.setPayStatus(WorkflowSubStageStatusEnum.PAY_DEPOSIT_50.getCode());
linePayService.submitPayInfo(submitRequest, partnerUserInfoVO);
//更新阶段状态
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102);
}
return linePayInfo;
}
@@ -295,29 +267,28 @@ public class DecorationServiceImpl implements DecorationService {
approach = constructionScheduleDTO;
}
//计划撤场时间 //如果撤场并且视觉验收状态为-100则更新待验收
if (constructionScheduleDTO.getName().equals(CommonConstants.WITHDRAWAL)) {
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_13);
if(shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())
&& constructionScheduleDTO.getState().equals(ConstructionPhaseEnum.construction_FINSH.getCode())){
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_130);
//发送给品牌设计经理
EnterpriseUserDO enterpriseUser = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.DESIGN_MANAGER, lineInfo.getWantShopAreaId());
if (Objects.nonNull(enterpriseUser)){
Map<String, String> messageMap = new HashMap<>();
messageMap.put("storeName",shopInfo.getShopName());
messageMap.put("shopId",String.valueOf(shopId));
messageMap.put("shopName",shopInfo.getShopName());
messageMap.put("partnerUsername",lineInfo.getUsername());
messageMap.put("partnerMobile",lineInfo.getMobile());
commonService.sendMessage(Arrays.asList(enterpriseUser.getUserId()), MessageEnum.MESSAGE_28, messageMap);
}
}
ConstructionScheduleDTO withdrawal = constructionScheduleDTO;
if (Objects.nonNull(acceptanceInfoDO)) {
Date date = CoolDateUtils.parseDate(withdrawal.getPlanBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
acceptanceInfoDO.setPlanExitTime(date);
}
}
// if (constructionScheduleDTO.getName().equals(CommonConstants.WITHDRAWAL)) {
// ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_13);
// if(shopSubStageInfo.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus())
// && constructionScheduleDTO.getState().equals(ConstructionPhaseEnum.construction_FINSH.getCode())){
// //发送给品牌设计经理
// EnterpriseUserDO enterpriseUser = userAuthMappingService.getUserByRoleEnumAndWantShopAreaId(UserRoleEnum.DESIGN_MANAGER, lineInfo.getWantShopAreaId());
// if (Objects.nonNull(enterpriseUser)){
// Map<String, String> messageMap = new HashMap<>();
// messageMap.put("storeName",shopInfo.getShopName());
// messageMap.put("shopId",String.valueOf(shopId));
// messageMap.put("shopName",shopInfo.getShopName());
// messageMap.put("partnerUsername",lineInfo.getUsername());
// messageMap.put("partnerMobile",lineInfo.getMobile());
// commonService.sendMessage(Arrays.asList(enterpriseUser.getUserId()), MessageEnum.MESSAGE_28, messageMap);
// }
// }
// ConstructionScheduleDTO withdrawal = constructionScheduleDTO;
// if (Objects.nonNull(acceptanceInfoDO)) {
// Date date = CoolDateUtils.parseDate(withdrawal.getPlanBeginDate(), CoolDateUtils.DATE_FORMAT_DAY);
// acceptanceInfoDO.setPlanExitTime(date);
// }
// }
}
if (constructionScheduleDTO.getName().equals(CommonConstants.CONSTRUCTION_PHASE)) {
constructionSage = constructionScheduleDTO;
@@ -438,10 +409,6 @@ public class DecorationServiceImpl implements DecorationService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean miniSubmitAcceptanceSign(ThreeAcceptanceRequest request) {
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(request.getShopId(), ShopSubStageEnum.SHOP_STAGE_10);
if (!ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_102.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
throw new ServiceException(ErrorCodeEnum.FITMENT_FAIL);
}
//工程部验收签名
if (Objects.nonNull(request.getEngineeringAcceptance())) {
request.getEngineeringAcceptance().setAcceptanceTime(new Date());

View File

@@ -326,7 +326,7 @@ public class DeskServiceImpl implements DeskService {
@Override
public PageInfo<PreparationCommonPendingVO> systemBuildStorePendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_3, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30.getShopSubStageStatus()), Constants.ZERO_INTEGER);
return null;
}
@Override
@@ -348,7 +348,7 @@ public class DeskServiceImpl implements DeskService {
@Override
public PageInfo<PreparationCommonPendingVO> firstOrderListPendingList(Integer pageNum, Integer pageSize, LoginUserInfo user) {
return commonPendingVOPageInfo(pageNum, pageSize, user, ShopSubStageEnum.SHOP_STAGE_15, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus()), Constants.ONE_INTEGER);
return null;
}

View File

@@ -63,115 +63,12 @@ public class FirstOrderServiceImp implements FirstOrderService {
@Override
public Integer saveOrder(FirstOrderRequest request, LoginUserInfo user) {
log.info("save order:{}", JSONObject.toJSONString(request));
if (request == null) {
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
}
String userId = user.getUserId();
FirstOrderDO order = new FirstOrderDO();
try {
BeanUtils.copyProperties(order, request);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
FirstOrderDTO firstOrderDTO = firstOrderDAO.selectFirstOrderByShopId(order.getShopId());
Integer num;
if (Objects.isNull(firstOrderDTO)) {
//第一次提交
order.setCreateTime(new Date());
order.setCreateUserId(userId);
num = firstOrderDAO.insertFirstOrder(order);
} else {
//修改只更新下面2个
order.setId(firstOrderDTO.getId());
order.setUpdateTime(new Date());
order.setUpdateUserId(userId);
num = firstOrderDAO.updateByPrimaryKeySelective(order);
}
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152);
//发送消息至加盟商
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
Map<String,String> messageMap =new HashMap<>();
messageMap.put("totalOrderDeposit",request.getTotalOrderDeposit());
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.FIRST_ORDER, messageMap);
//云立方同步
if (num > 0) {
try {
String storeNum = shopInfo.getStoreNum();
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
log.info("saveOrder,flag:{}", flag);
if (flag == null) {
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
if (flag) {
//更改子阶段状态
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
preparationService.whetherToOpenForAcceptance(order.getShopId());
}
} catch (Exception e) {
log.error("获取鲜丰订货金异常", e);
}
}
return num;
return 1;
}
@Transactional(rollbackFor = Exception.class)
@Override
public FirstOrderDTO getOrder(Long shopId) {
log.info("getOrder shopId:{},", shopId);
if (shopId == null) {
log.error("shopId is null");
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
}
ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
FirstOrderDTO order = firstOrderDAO.selectFirstOrderByShopId(shopId);
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())) {
String userName = enterpriseUserDAO.getUserName(order.getCreateUserId());
order.setPartnerName(userName);
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
if (Objects.nonNull(shopInfo.getSupervisorUserId())){
EnterpriseUserDO userInfoById = enterpriseUserDAO.getUserInfoById(shopInfo.getSupervisorUserId());
order.setSubmiter(Objects.isNull(userInfoById) ? null : userInfoById.getName()+"_"+userInfoById.getJobnumber());
}
return order;
}
if (Objects.nonNull(order)) {
try {
String userName = enterpriseUserDAO.getUserName(order.getCreateUserId());
order.setPartnerName(userName);
String storeNum = shopInfo.getStoreNum();
Boolean flag = coolStoreStartFlowService.getFirstOrder(storeNum);
log.info("saveOrder,flag:{}", flag);
if (flag == null) {
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
if (flag) {
//更改子阶段状态
shopStageInfoDAO.updateShopStageInfo(order.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
preparationService.whetherToOpenForAcceptance(order.getShopId());
} else {
order.setFirstOrderSubStage(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus());
}
} catch (Exception e) {
log.error("获取鲜丰订货金异常", e);
}
}else {
order = new FirstOrderDTO();
}
if (Objects.nonNull(shopInfo.getSupervisorUserId())){
EnterpriseUserDO userInfoById = enterpriseUserDAO.getUserInfoById(shopInfo.getSupervisorUserId());
order.setSubmiter(Objects.isNull(userInfoById) ? null : userInfoById.getName()+"_"+userInfoById.getJobnumber());
}
return order;
return null;
}
}

View File

@@ -215,26 +215,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean flush(Long shopId) {
ShopStageInfoDO orderStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopId, ShopSubStageEnum.SHOP_STAGE_15);
try {
if (ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_152.getShopSubStageStatus().
equals(orderStageInfo.getShopSubStageStatus())) {
ShopInfoDO shopInfo = shopService.getShopInfo(shopId);
String shopNum = shopInfo.getStoreNum();
Boolean firstOrder = coolStoreStartFlowService.getFirstOrder(shopNum);
log.info("saveOrder,flag:{}", firstOrder);
if (firstOrder) {
//更改子阶段状态
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId,
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151, null);
preparationService.whetherToOpenForAcceptance(shopId);
}
}
return Boolean.TRUE;
} catch (Exception e) {
log.error("获取鲜丰订货金异常或更新状态失败");
throw new ServiceException(ErrorCodeEnum.GET_FIRST_ORDER);
}
return Boolean.TRUE;
}

View File

@@ -969,7 +969,7 @@ public class PointServiceImpl implements PointService {
updatePoint.setId(shopInfo.getPointId());
updatePoint.setPointStatus(PointStatusEnum.POINT_STATUS_6.getCode());
pointInfoDAO.updatePointInfo(updatePoint);
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Lists.newArrayList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_30, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40));
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Lists.newArrayList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_40));
ShopInfoDO updateShop = new ShopInfoDO();
updateShop.setId(shopId);
updateShop.setShopStage(ShopStageEnum.SHOP_STAGE_2.getShopStage());

View File

@@ -191,10 +191,9 @@ public class PreparationServiceImpl implements PreparationService {
List<ShopStageInfoDO> shopStageInfo = shopStageInfoDAO.getShopStageInfo(shopId, null);
if (CollectionUtils.isNotEmpty(shopStageInfo)) {
Map<Integer, ShopStageInfoDO> shopStageInfoDOMap = shopStageInfo.stream().collect(Collectors.toMap(ShopStageInfoDO::getShopSubStage, data -> data));
Boolean buildStoreCompletionFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_3.getShopSubStage()).getShopSubStageStatus());
Boolean buildStoreCompletionFlag = Boolean.TRUE;
Boolean contractCompletionFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_73.getShopSubStageStatus().equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_7.getShopSubStage()).getShopSubStageStatus());
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
//都完成了 初始化后续流程数据
if (buildStoreCompletionFlag && contractCompletionFlag) {
//初始化后续流程数据 设计阶段 装修阶段 开业运营方案 首批订货清单
@@ -216,27 +215,6 @@ public class PreparationServiceImpl implements PreparationService {
ShopStageInfoDO data3 = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_14.getShopSubStage());
data3.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_140.getShopSubStageStatus());
list.add(data3);
//发送督导钉钉
Map<String, String> messageMap = new HashMap<>();
messageMap.put("storeName",shopInfo.getShopName());
messageMap.put("shopId",String.valueOf(shopId));
messageMap.put("lineId", shopInfo.getLineId().toString());
messageMap.put("partnerUsername",lineInfo.getUsername());
messageMap.put("shopName",shopInfo.getShopName());
messageMap.put("partnerMobile",lineInfo.getMobile());
commonService.sendMessage(Arrays.asList(shopInfo.getSupervisorUserId()), MessageEnum.MESSAGE_26, messageMap);
ShopStageInfoDO data4 = shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_15.getShopSubStage());
data4.setShopSubStageStatus(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_150.getShopSubStageStatus());
list.add(data4);
//发送督导钉钉
Map<String, String> messageMap1 = new HashMap<>();
messageMap1.put("storeName",shopInfo.getShopName());
messageMap1.put("shopId",String.valueOf(shopId));
messageMap1.put("shopName",shopInfo.getShopName());
messageMap1.put("lineId", String.valueOf(shopInfo.getLineId()));
messageMap1.put("partnerUsername",lineInfo.getUsername());
messageMap1.put("partnerMobile",lineInfo.getMobile());
commonService.sendMessage(Arrays.asList(shopInfo.getSupervisorUserId()), MessageEnum.MESSAGE_27, messageMap1);
shopStageInfoDAO.batchUpdate(list);
}
}
@@ -268,9 +246,9 @@ public class PreparationServiceImpl implements PreparationService {
flushFlag = Boolean.TRUE;
}
//装修款
Integer Status1000 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_100.getShopSubStageStatus();
Integer Status1010 = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_101.getShopSubStageStatus();
Integer DecorationModel = collect.get(ShopSubStageEnum.SHOP_STAGE_10.getShopSubStage()).getShopSubStageStatus();
Integer Status1000 = 1000;
Integer Status1010 = 1010;
Integer DecorationModel = collect.get(100).getShopSubStageStatus();
if (Status1000.equals(DecorationModel) || Status1010.equals(DecorationModel)) {
decorationService.getDecorationModel(shopId, null);
flushFlag = Boolean.TRUE;

View File

@@ -75,36 +75,6 @@ public class SeeAcceptanceServiceImpl implements SeeAcceptanceService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean auditSeeAcceptance(SeeAcceptanceRequest request, LoginUserInfo user) {
if (request.getShopId() == null || request.getShopId() == 0) {
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
}
if (request.getResultType() == null) {
throw new ServiceException(ErrorCodeEnum.SEE_ACCEPTANCE_AUDIT_NULL);
}
if (Objects.isNull(user)) {
throw new ServiceException(ErrorCodeEnum.USER_NOT_LOGIN);
}
ShopAuditInfoDO shopAuditInfoDO = new ShopAuditInfoDO();
shopAuditInfoDO.setShopId(request.getShopId());
shopAuditInfoDO.setAuditType(AuditTypeEnum.VISUAL_ACCEPTANCE.getCode());
shopAuditInfoDO.setSubmittedUserId(user.getUserId());
shopAuditInfoDO.setSubmittedUserName(user.getName());
shopAuditInfoDO.setResultType(request.getResultType());
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())) {
shopAuditInfoDO.setPassReason(request.getReason());
} else {
shopAuditInfoDO.setRejectReason(request.getReason());
}
shopAuditInfoDO.setCreateTime(new Date());
shopAuditInfoDO.setDataType(CommonConstants.ONE);
Long id = shopAuditInfoDAO.addAuditInfo(shopAuditInfoDO);
if (AuditResultTypeEnum.PASS.getCode().equals(request.getResultType())) {
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_132, id);
preparationService.whetherToOpenForAcceptance(request.getShopId());
} else {
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_131, id);
}
return true;
}
@@ -136,103 +106,7 @@ public class SeeAcceptanceServiceImpl implements SeeAcceptanceService {
@Override
public PageInfo<fitmentCheckVO> getAcceptanceList(AcceptanceListRequest request, LoginUserInfo user) {
List<String> authRegionIds = userAuthMappingService.getAuthRegionIdAndSubRegionIdByUserId(user.getUserId());
List<Long> regions = new ArrayList<>();
for (String authRegionId : authRegionIds) {
regions.add(Long.parseLong(authRegionId));
}
PageHelper.startPage(request.getPageNum(), request.getPageSize());
if (regions.isEmpty()) {
log.info("该用户下权限没有管理区域");
return new PageInfo<>();
}
List<fitmentCheckVO> fitmentCheckVOList = new ArrayList<>();
//shopId,lineid,regionid,shopname,storenum,
List<ShopInfoDO> shopInfoDOS = shopInfoMapper.selectShopListByRegionId(regions, ShopSubStageEnum.SHOP_STAGE_13.getShopSubStage(),request.getSubStageStatus(),request.getKeyWord());
PageInfo pageInfo = new PageInfo<>(shopInfoDOS);
if (shopInfoDOS.isEmpty()) {
log.info("该工程部监理下门店为空");
return pageInfo;
}
Map<Long, ShopInfoDO> ShopIdmap = shopInfoDOS.stream().collect(Collectors.toMap(ShopInfoDO::getId, dto1 -> dto1));
//招商经理选址人员拓展经理id
List<Long> lineIds = shopInfoDOS.stream().filter(o -> o.getLineId() != null)
.map(ShopInfoDO::getLineId).distinct().collect(Collectors.toList());
List<LineInfoDO> lineInfos = lineInfoMapper.getByLineIds(lineIds);
Map<Long, LineInfoDO> lineInfoDOMap = lineInfos.stream().collect(Collectors.toMap(LineInfoDO::getId, dto -> dto));
//招商name
List<String> userIds = new ArrayList<>();
userIds.addAll(lineInfos.stream().filter(o -> o.getInvestmentManager() != null)
.map(LineInfoDO::getInvestmentManager).distinct().collect(Collectors.toList()));
//选址人员拓展经理name
userIds.addAll(lineInfos.stream().filter(o -> o.getDevelopmentManager() != null)
.map(LineInfoDO::getDevelopmentManager).distinct().collect(Collectors.toList()));
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
//所属战区
List<Long> regionIds = shopInfoDOS.stream().filter(o -> o.getRegionId() != null).
map(ShopInfoDO::getRegionId).distinct().collect(Collectors.toList());
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
//战区经理name
Map<Long, String> fightManger = new HashMap<>();
for (Long regionId : regionIds) {
String fightMangerUserId = sysRoleService.getUserIdByRegionIdWithRolePriority(regionId, Arrays.asList(UserRoleEnum.THEATER_MANAGER));
String userName = enterpriseUserDAO.getUserName(fightMangerUserId);
fightManger.put(regionId, userName);
}
//施工实际完成实际
List<Long> shopIds = new ArrayList<>(ShopIdmap.keySet());
List<AcceptanceInfoDO> acceptanceInfoDOS = acceptanceInfoDAO.selectByShopIds(shopIds);
Map<Long, AcceptanceInfoDO> acceptanceInfoDOSMap = acceptanceInfoDOS.stream()
.collect(Collectors.toMap(AcceptanceInfoDO::getShopId, dto1 -> dto1));
//验收状态
List<ShopStageInfoDO> subStageList = shopStageInfoDAO.getSubStageList(shopIds, ShopSubStageEnum.SHOP_STAGE_13.getShopSubStage());
List<Long> audits = subStageList.stream().filter(o -> o.getAuditId() != null).map(ShopStageInfoDO::getAuditId).collect(Collectors.toList());
//验收时间
List<ShopAuditInfoDO> auditInfoList = shopAuditInfoDAO.getAuditInfoList(audits);
Map<Long, ShopAuditInfoDO> auditMap = auditInfoList.stream().filter(o -> o.getShopId() != null).collect(Collectors.toMap(ShopAuditInfoDO::getShopId, Function.identity()));
Map<Long, ShopStageInfoDO> ShopStageInfoDOMap = subStageList.stream()
.collect(Collectors.toMap(ShopStageInfoDO::getShopId, dto1 -> dto1));
for (ShopInfoDO shopInfoDO : shopInfoDOS) {
Long shopId = shopInfoDO.getId();
Long lineId = shopInfoDO.getLineId();
Long regionId = shopInfoDO.getRegionId();
fitmentCheckVO fitmentCheckVO = new fitmentCheckVO();
fitmentCheckVO.setShopId(shopId);
fitmentCheckVO.setLineId(lineId);
fitmentCheckVO.setShopName(shopInfoDO.getShopName());
fitmentCheckVO.setStoreNum(shopInfoDO.getStoreNum());
fitmentCheckVO.setRegionId(regionId);
fitmentCheckVO.setRegion(regionNameMap.get(regionId));
fitmentCheckVO.setFightManager(fightManger.get(regionId));
if (lineId != null) {
fitmentCheckVO.setInvestmentManagerId(lineInfoDOMap.get(lineId)
.getInvestmentManager());
fitmentCheckVO.setInvestmentManager(userNameMap.get(lineInfoDOMap.get(lineId)
.getInvestmentManager()));
fitmentCheckVO.setSitterId(lineInfoDOMap.get(lineId)
.getDevelopmentManager());
fitmentCheckVO.setSitterName(userNameMap.get(lineInfoDOMap.get(lineId)
.getDevelopmentManager()));
fitmentCheckVO.setPartnerName(lineInfoDOMap.get(lineId).getUsername());
}
AcceptanceInfoDO acceptanceInfoDO = acceptanceInfoDOSMap.get(shopId);
if (shopId != null) {
if (Objects.nonNull(acceptanceInfoDO)) {
fitmentCheckVO.setActualEndTime(acceptanceInfoDO.getConstructionCompletionTime());
}
}
if (Objects.nonNull(auditMap.get(shopId))) {
fitmentCheckVO.setAcceptanceTime(auditMap.get(shopId).getCreateTime());
}
if (Objects.nonNull(ShopStageInfoDOMap.get(shopId))) {
fitmentCheckVO.setShopSubStageStatus(ShopStageInfoDOMap.get(shopId).getShopSubStageStatus());
}
fitmentCheckVOList.add(fitmentCheckVO);
}
pageInfo.setList(fitmentCheckVOList);
return pageInfo;
return null;
}

View File

@@ -112,10 +112,10 @@ public class ShopServiceImpl implements ShopService {
//进入选址不允许删除操作
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_3);
if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
}
// ShopStageInfoDO shopSubStageInfo = shopStageInfoDAO.getShopSubStageInfo(shopInfo.getId(), ShopSubStageEnum.SHOP_STAGE_3);
// if(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33.getShopSubStageStatus().equals(shopSubStageInfo.getShopSubStageStatus())){
// throw new ServiceException(ErrorCodeEnum.NOT_ALLOW_OPERATE);
// }
if(Objects.nonNull(shopInfo.getPointId())){
PointInfoDO pointInfo = pointInfoDAO.getPointInfoById(shopInfo.getPointId());
if(Objects.nonNull(pointInfo) && SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){

View File

@@ -459,7 +459,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
if (Constants.ZERO_INTEGER.equals(request.getAuditResult())) {
shopAuditInfoDO.setResultType(Constants.ONE_INTEGER);
shopAuditInfoDO.setRejectReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_32;
shopSubStageStatusEnum = null;
} else if (Constants.ONE_INTEGER.equals(request.getAuditResult())) {
ShopInfoDO shopInfoDO = shopInfoMapper.selectByPrimaryKey(shopId);
EnterpriseUserDO supervisor = userAuthMappingService.hierarchicalSearch(UserRoleEnum.SUPERVISION, shopInfoDO.getRegionId());
@@ -474,7 +474,7 @@ public class SysStoreAppServiceImpl implements SysStoreAppService, AuditResultSe
shopInfoMapper.updateByPrimaryKeySelective(shopInfoDO);
shopAuditInfoDO.setResultType(Constants.ZERO_INTEGER);
shopAuditInfoDO.setPassReason(request.getCause());
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_33;
shopSubStageStatusEnum = null;
//校验建店与加盟签约合同是否完成 并初始化后续流程数据
preparationService.contractAndBuildStoreCompletion(shopId);
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(shopInfoDO.getLineId());