Merge #32 into master from cc_20260113_open
开业日期报备
* cc_20260113_open: (15 commits squashed)
- feat:阶段调整
- feat:开业阶段调整
- feat:开业日期报备
- feat:开业日期报备代办
- feat:文本通知
- feat:数据处理
- fix:bug
- feat:通知功能
- Merge branch 'master' into cc_20260113_open
# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/LineServiceImpl.java
- feat:开业代办新增代办预计开业时间
- feat:开业时间查询
- feat:开业
- feat:PC计划开业时间
- Merge branch 'master' into cc_20260113_open
# Conflicts:
#	coolstore-partner-dao/src/main/java/com/cool/store/mapper/ShopStageInfoMapper.java
- Merge branch 'master' into cc_20260113_open
# Conflicts:
#	coolstore-partner-web/src/main/java/com/cool/store/controller/webc/MiniShopController.java
Signed-off-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/32
This commit is contained in:
@@ -22,4 +22,11 @@ public interface DataHandleService {
|
||||
*/
|
||||
Integer dataHandleServiceV25();
|
||||
|
||||
/**
|
||||
* 开业日期筹备阶段批量新增
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
Boolean openStageBatchInsert(Long shopId);
|
||||
|
||||
}
|
||||
|
||||
@@ -178,6 +178,16 @@ public interface DeskService {
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> openingAcceptance(DeskRequest deskRequest, LoginUserInfo user );
|
||||
|
||||
|
||||
/**
|
||||
* 开业确认代办
|
||||
* @param deskRequest
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PreparationCommonPendingVO> openingConfirmPendingList(DeskRequest deskRequest, LoginUserInfo user );
|
||||
|
||||
|
||||
/**
|
||||
* 测量阶段
|
||||
|
||||
|
||||
@@ -109,5 +109,13 @@ public interface PreparationService {
|
||||
*/
|
||||
Boolean buildStoreComplete(Long shopId);
|
||||
|
||||
/**
|
||||
* 开始开业日期报备
|
||||
* 培训登记与开业门店验收 完成都调用 都完成 开启开始开业日期报备
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
Boolean theOpeningDateIsReported(Long shopId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.dto.OpenInfoDTO;
|
||||
import com.cool.store.dto.UserDTO;
|
||||
import com.cool.store.entity.LineInfoDO;
|
||||
import com.cool.store.entity.ShopInfoDO;
|
||||
@@ -144,4 +145,26 @@ public interface ShopService {
|
||||
Boolean checkShopCodeRepeat(String shopCode,Long shopId);
|
||||
|
||||
Boolean isShowButton(Long shopId);
|
||||
|
||||
/**
|
||||
* 提交开业报备
|
||||
* @param openDateReportRequest
|
||||
* @return
|
||||
*/
|
||||
Boolean submitOpenDateReport(OpenDateReportRequest openDateReportRequest);
|
||||
|
||||
/**
|
||||
* 确认开业
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
Boolean confirmOpen(OpenDateReportRequest request,String userId);
|
||||
|
||||
/**
|
||||
* 获取开业信息
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
OpenInfoDTO getShopOpenInfo(Long shopId);
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.aliyun.sdk.service.dysmsapi20170525.models.*;
|
||||
import com.aliyun.sdk.service.dysmsapi20170525.AsyncClient;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dto.message.SendMessageDTO;
|
||||
import com.cool.store.dto.message.SendTextMessageDTO;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.mq.producer.SimpleMessageService;
|
||||
import com.cool.store.request.AuditResultRequest;
|
||||
@@ -22,6 +23,7 @@ import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
@@ -230,5 +232,39 @@ public class CommonService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 企微发送文本消息通知
|
||||
* @param userIdList 消息接收人列表
|
||||
* @param message 消息标题
|
||||
* @param requestMap 消息内容
|
||||
*/
|
||||
public void sendTextMessage(List<String> userIdList, MessageEnum message, Map<String, String> requestMap) {
|
||||
log.info("message:{}, request:{}, userIds:{}", message.getTitle(), JSONObject.toJSONString(requestMap), JSONObject.toJSONString(userIdList));
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
log.info("消息接收人列表为空");
|
||||
return;
|
||||
}
|
||||
userIdList = userIdList.stream().filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
log.info("消息接收人列表为空(已过滤空值)");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String outBusinessId = UUIDUtils.get8UUID();
|
||||
SendTextMessageDTO messageDTO = new SendTextMessageDTO();
|
||||
messageDTO.setCorpId(dingCorpId);
|
||||
messageDTO.setUserIds(String.join(Constants.COMMA, userIdList));
|
||||
messageDTO.setOutBusinessId(outBusinessId);
|
||||
messageDTO.setAppType("qw_self_dkf");
|
||||
messageDTO.setMessageType("text");
|
||||
messageDTO.setTitle(message.getTitle());
|
||||
messageDTO.setContent(message.getContent(requestMap));
|
||||
simpleMessageService.send(JSONObject.toJSONString(messageDTO), RocketMqTagEnum.STORE_DING_QUEUE);
|
||||
log.info("文本消息发送成功, outBusinessId:{}", outBusinessId);
|
||||
} catch (Exception e) {
|
||||
log.error("文本消息发送失败, title:{}, userIdList:{}", message.getTitle(), JSONObject.toJSONString(userIdList), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.unit.DataUnit;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.Page;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Array;
|
||||
@@ -84,6 +86,107 @@ public class DataHandleServiceImpl implements DataHandleService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean openStageBatchInsert(Long shopId) {
|
||||
int pageSize = 100;
|
||||
int pageNum = 1;
|
||||
LocalDate selectStartDate = LocalDate.now();
|
||||
|
||||
while (true) {
|
||||
// 使用PageHelper分页查询,每页100条
|
||||
PageHelper.startPage(pageNum, pageSize);
|
||||
List<ShopInfoDO> shopInfoDOS = shopInfoDAO.selectByIdOrSelectAll(shopId);
|
||||
|
||||
// 如果没有数据了,退出循环
|
||||
if (CollectionUtils.isEmpty(shopInfoDOS)) {
|
||||
break;
|
||||
}
|
||||
|
||||
List<ShopStageInfoDO> addShopStageList = new ArrayList<>();
|
||||
|
||||
for (ShopInfoDO shopInfo : shopInfoDOS) {
|
||||
Long currentShopId = shopInfo.getId();
|
||||
Long lineId = shopInfo.getLineId();
|
||||
|
||||
// 查询门店的所有阶段数据
|
||||
List<ShopStageInfoDO> shopStageInfoList = shopStageInfoDAO.getShopStageInfo(currentShopId, null);
|
||||
if (CollectionUtils.isEmpty(shopStageInfoList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 将阶段数据转换为Map,方便查找
|
||||
Map<Integer, ShopStageInfoDO> infoDOMap = shopStageInfoList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
ShopStageInfoDO::getShopSubStage,
|
||||
v -> v,
|
||||
(k1, k2) -> k1
|
||||
));
|
||||
|
||||
// 3. 检查是否已经有开业日期筹备阶段数据,如果有则跳过
|
||||
ShopStageInfoDO openStageInfo = infoDOMap.get(ShopSubStageEnum.SHOP_STAGE_30.getShopSubStage());
|
||||
if (Objects.nonNull(openStageInfo)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2. 判断培训阶段与开业验收阶段是否都完成
|
||||
ShopStageInfoDO trainingStage = infoDOMap.get(ShopSubStageEnum.SHOP_STAGE_5.getShopSubStage());
|
||||
ShopStageInfoDO acceptanceStage = infoDOMap.get(ShopSubStageEnum.SHOP_STAGE_27.getShopSubStage());
|
||||
|
||||
// 判断培训阶段是否完成
|
||||
boolean trainingCompleted = false;
|
||||
if (Objects.nonNull(trainingStage)) {
|
||||
Integer trainingStatus = trainingStage.getShopSubStageStatus();
|
||||
trainingCompleted = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51.getShopSubStageStatus().equals(trainingStatus);
|
||||
}
|
||||
|
||||
// 判断开业验收阶段是否完成
|
||||
boolean acceptanceCompleted = false;
|
||||
if (Objects.nonNull(acceptanceStage)) {
|
||||
Integer acceptanceStatus = acceptanceStage.getShopSubStageStatus();
|
||||
acceptanceCompleted = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_276.getShopSubStageStatus().equals(acceptanceStatus);
|
||||
}
|
||||
|
||||
// 创建开业日期筹备阶段数据
|
||||
ShopStageInfoDO newOpenStage = new ShopStageInfoDO();
|
||||
newOpenStage.setLineId(lineId);
|
||||
newOpenStage.setShopId(currentShopId);
|
||||
ShopStageEnum shopStageEnum = ShopSubStageEnum.SHOP_STAGE_30.getShopStageEnum();
|
||||
newOpenStage.setShopStage(shopStageEnum.getShopStage());
|
||||
newOpenStage.setShopSubStage(ShopSubStageEnum.SHOP_STAGE_30.getShopSubStage());
|
||||
|
||||
// 如果培训阶段和开业验收阶段都完成,则开业日期筹备阶段为已完成,否则为未开始
|
||||
ShopSubStageStatusEnum initStatus;
|
||||
if (trainingCompleted && acceptanceCompleted) {
|
||||
initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_320; // 已完成
|
||||
} else {
|
||||
initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00; // 待填写(未开始)
|
||||
}
|
||||
|
||||
newOpenStage.setShopSubStageStatus(initStatus.getShopSubStageStatus());
|
||||
newOpenStage.setRemark(ShopSubStageEnum.SHOP_STAGE_30.getShopSubStageName() + CommonConstants.PATH_BAR + initStatus.getShopSubStageStatusName());
|
||||
newOpenStage.setIsTerminated(initStatus.isTerminated());
|
||||
newOpenStage.setPlanCompleteTime(ShopSubStageEnum.SHOP_STAGE_30.getPlanCompleteTime(selectStartDate));
|
||||
|
||||
addShopStageList.add(newOpenStage);
|
||||
}
|
||||
|
||||
// 批量插入当前页的数据
|
||||
if (CollectionUtils.isNotEmpty(addShopStageList)) {
|
||||
shopStageInfoDAO.batchInsert(addShopStageList);
|
||||
}
|
||||
|
||||
// 判断是否还有下一页
|
||||
Page<ShopInfoDO> page = (Page<ShopInfoDO>) shopInfoDOS;
|
||||
if (page.getPageNum() >= page.getPages()) {
|
||||
break;
|
||||
}
|
||||
pageNum++;
|
||||
}
|
||||
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
public void licenseHandle(ShopStageInfoDO shopStageInfoDO){
|
||||
if (Objects.isNull(shopStageInfoDO)){
|
||||
@@ -198,4 +301,8 @@ public class DataHandleServiceImpl implements DataHandleService {
|
||||
}
|
||||
return shopStageInfoDAO.batchInsert(addShopStageList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -560,11 +560,12 @@ public class DeskServiceImpl implements DeskService {
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> openingAcceptance(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||
//如果是督导
|
||||
//如果运营顾问 查询直接返回
|
||||
List<Integer> stageList = new ArrayList<>();
|
||||
Boolean flag = Boolean.FALSE;
|
||||
if (userRoleIds.contains(UserRoleEnum.QW_SUPERVISION.getCode()) || userRoleIds.contains(UserRoleEnum.SUPERVISION.getCode())) {
|
||||
stageList.addAll(Arrays.asList(SHOP_SUB_STAGE_STATUS_270.getShopSubStageStatus(),SHOP_SUB_STAGE_STATUS_274.getShopSubStageStatus()));
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList);
|
||||
}
|
||||
if (userRoleIds.contains(UserRoleEnum.OPERATION_GENERAL_CONSULTANT.getCode()) ) {
|
||||
stageList.add(SHOP_SUB_STAGE_STATUS_272.getShopSubStageStatus());
|
||||
@@ -576,6 +577,11 @@ public class DeskServiceImpl implements DeskService {
|
||||
return commonPendingVOPageInfo(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_27, stageList, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> openingConfirmPendingList(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
return operationCustomQueryList(deskRequest, user, ShopSubStageEnum.SHOP_STAGE_30, Arrays.asList(SHOP_SUB_STAGE_STATUS_310.getShopSubStageStatus()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PreparationCommonPendingVO> measurePendingList(DeskRequest deskRequest, LoginUserInfo user) {
|
||||
List<Long> userRoleIds = enterpriseUserRoleMapper.getUserRoleIds(user.getUserId());
|
||||
@@ -825,6 +831,26 @@ public class DeskServiceImpl implements DeskService {
|
||||
return this.commonPendingVOPage(deskRequest, null, shopSubStageEnum, subStageStatusList, filterFlag, null, operationsConsultantUserId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 运营顾问对于的代办
|
||||
* @param deskRequest
|
||||
* @param user
|
||||
* @param shopSubStageEnum
|
||||
* @param subStageStatusList
|
||||
* @return
|
||||
*/
|
||||
private PageInfo<PreparationCommonPendingVO> operationCustomQueryList(DeskRequest deskRequest, LoginUserInfo user, ShopSubStageEnum shopSubStageEnum, List<Integer> subStageStatusList) {
|
||||
PageHelper.startPage(deskRequest.getPageNum(), deskRequest.getPageSize());
|
||||
List<ShopStageInfoDO> specialShopStageInfo = shopStageInfoDAO.getOperationsConsultantStageInfo(null, shopSubStageEnum.getShopSubStage(),
|
||||
subStageStatusList, user.getUserId(), deskRequest);
|
||||
PageInfo result = new PageInfo<>(specialShopStageInfo);
|
||||
List<PreparationCommonPendingVO> list = convert(specialShopStageInfo, subStageStatusList);
|
||||
result.setList(list);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通用查询
|
||||
*
|
||||
@@ -846,6 +872,13 @@ public class DeskServiceImpl implements DeskService {
|
||||
List<ShopStageInfoDO> specialShopStageInfo = shopStageInfoDAO.getSpecialShopStageInfo(null, shopSubStageEnum.getShopSubStage(),
|
||||
subStageStatusList, user == null ? null : user.getUserId(), authRegionIds, ownShopFlag, deskRequest, operationsConsultantUserId);
|
||||
PageInfo result = new PageInfo<>(specialShopStageInfo);
|
||||
List<PreparationCommonPendingVO> list = convert(specialShopStageInfo, subStageStatusList);
|
||||
result.setList(list);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<PreparationCommonPendingVO> convert(List<ShopStageInfoDO> specialShopStageInfo,List<Integer> subStageStatusList){
|
||||
List<Long> shopIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getShopId).collect(Collectors.toList());
|
||||
List<Long> lineIds = specialShopStageInfo.stream().map(ShopStageInfoDO::getLineId).collect(Collectors.toList());
|
||||
List<ShopInfoDO> shopInfoList = shopInfoDAO.getShopListByIds(shopIds);
|
||||
@@ -911,12 +944,16 @@ public class DeskServiceImpl implements DeskService {
|
||||
preparationCommonPendingVO.setFranchiseBrand(shopInfoDO.getFranchiseBrand());
|
||||
preparationCommonPendingVO.setInvestRegionId(shopInfoDO.getInvestRegionId());
|
||||
preparationCommonPendingVO.setInvestRegionName(regionNameMap.get(shopInfoDO.getInvestRegionId()));
|
||||
if (shopInfoDO!=null&&shopInfoDO.getPlanOpenDate()!=null){
|
||||
preparationCommonPendingVO.setPlanOpenDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,shopInfoDO.getPlanOpenDate()));
|
||||
}
|
||||
list.add(preparationCommonPendingVO);
|
||||
});
|
||||
result.setList(list);
|
||||
return result;
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void doThing(Map<Long, List<DeskStageDTO>> deskStageMap, List<ShopStageInfoDO> subStageList) {
|
||||
for (ShopStageInfoDO shopStageInfoDO : subStageList) {
|
||||
List<DeskStageDTO> deskStageDTOS = deskStageMap.get(shopStageInfoDO.getShopId());
|
||||
|
||||
@@ -391,8 +391,25 @@ public class PreparationServiceImpl implements PreparationService {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean theOpeningDateIsReported(Long shopId) {
|
||||
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 openFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_276.getShopSubStageStatus().
|
||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_27.getShopSubStage()).getShopSubStageStatus());
|
||||
|
||||
Boolean trainingFlag = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51.getShopSubStageStatus().
|
||||
equals(shopStageInfoDOMap.get(ShopSubStageEnum.SHOP_STAGE_5.getShopSubStage()).getShopSubStageStatus());
|
||||
|
||||
log.info("theOpeningDateIsReported openFlag->{},TrainingFlag->{}",openFlag,trainingFlag);
|
||||
//建店完成了 状态修改
|
||||
if (openFlag && trainingFlag) {
|
||||
shopStageInfoDAO.batchUpdateShopStageStatus(shopId, Arrays.asList(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_300));
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.service.impl;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.OpenInfoDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.Preparation.ScheduleDTO;
|
||||
import com.cool.store.dto.ShopNameAndCodeDTO;
|
||||
@@ -14,6 +15,7 @@ import com.cool.store.enums.point.ShopStatusEnum;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.EnterpriseUserRoleMapper;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.cool.store.mapper.StoreMapper;
|
||||
import com.cool.store.request.*;
|
||||
import com.cool.store.response.BranchShopDetailResponse;
|
||||
import com.cool.store.response.BranchShopResponse;
|
||||
@@ -989,6 +991,82 @@ public class ShopServiceImpl implements ShopService {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean submitOpenDateReport(OpenDateReportRequest request) {
|
||||
if (Objects.isNull(request.getShopId())||Objects.isNull(request.getOpenDate())){
|
||||
throw new ServiceException(PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
//查询门店
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (Objects.isNull(shopInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
shopInfo.setPlanOpenDate(request.getOpenDate());
|
||||
shopInfoDAO.updateShopInfo(shopInfo);
|
||||
//阶段状态变为待确定
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_310);
|
||||
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(shopInfo.getLineId());
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("partnerUsername", lineInfo.getUsername());
|
||||
map.put("storeName", shopInfo.getShopName());
|
||||
map.put("planOpenDate", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,shopInfo.getPlanOpenDate()));
|
||||
map.put("shopAddress", shopInfo.getDetailAddress());
|
||||
commonService.sendQWMessage(Collections.singletonList(shopInfo.getOperationsConsultant()),
|
||||
MessageEnum.MESSAGE_63, map);
|
||||
//新增
|
||||
List<EnterpriseUserDO> sendUsers = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.OPERATION_GENERAL_CONSULTANT, shopInfo.getRegionId());
|
||||
if (CollectionUtils.isNotEmpty(sendUsers)){
|
||||
List<String> userIdList = sendUsers.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
|
||||
commonService.sendTextMessage(userIdList,MessageEnum.MESSAGE_100,map);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean confirmOpen(OpenDateReportRequest request,String userId) {
|
||||
log.info("confirmOpen_request:{}",JSONObject.toJSONString(request));
|
||||
if (Objects.isNull(request.getShopId())||Objects.isNull(request.getOpenDate())){
|
||||
throw new ServiceException(PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
//查询门店
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(request.getShopId());
|
||||
if (Objects.isNull(shopInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
//只能运营顾问操作
|
||||
if (StringUtils.isNotEmpty(shopInfo.getOperationsConsultant())&&!shopInfo.getOperationsConsultant().equals(userId)){
|
||||
throw new ServiceException(ErrorCodeEnum.NO_OPERATIONS_CONSULTANT);
|
||||
}
|
||||
shopInfo.setActualOpenDate(request.getOpenDate());
|
||||
shopInfoDAO.updateShopInfo(shopInfo);
|
||||
//阶段状态变为带确定
|
||||
shopStageInfoDAO.updateShopStageInfo(request.getShopId(),ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_320);
|
||||
//更新门店为开业状态 且使用开业日期
|
||||
StoreDO store = storeDao.getByStoreNum(shopInfo.getShopCode());
|
||||
if (store!=null){
|
||||
storeDao.updateStoreStatus(store.getStoreId(),"open",request.getOpenDate());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpenInfoDTO getShopOpenInfo(Long shopId) {
|
||||
if (Objects.isNull(shopId)){
|
||||
throw new ServiceException(PARAMS_VALIDATE_ERROR);
|
||||
}
|
||||
ShopInfoDO shopInfo = shopInfoDAO.getShopInfo(shopId);
|
||||
if (Objects.isNull(shopInfo)){
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_NOT_FIND);
|
||||
}
|
||||
OpenInfoDTO openInfoDTO = new OpenInfoDTO();
|
||||
openInfoDTO.setShopId(shopId);
|
||||
openInfoDTO.setPlanOpenDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,shopInfo.getPlanOpenDate()));
|
||||
openInfoDTO.setActualOpenDate(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,shopInfo.getActualOpenDate()));
|
||||
return openInfoDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取招商经理信息
|
||||
* @param
|
||||
|
||||
@@ -181,9 +181,8 @@ public class TempUserDetailServiceImpl implements TempUserDetailService {
|
||||
}
|
||||
//不能放到下面
|
||||
shopStageInfoDAO.updateShopStageInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_51);
|
||||
//状态结束
|
||||
preparationService.whetherToOpenForAcceptance(shopId);
|
||||
preparationService.updateShopStatus(shopId);
|
||||
//状态结束 开业日期报备
|
||||
preparationService.theOpeningDateIsReported(shopId);
|
||||
//培训完成,将订货状态为等待培训中的切为待授权
|
||||
ShopStageInfoDO shopStage = shopStageInfoDAO.getByShopIdAndSubStage(shopId, ShopSubStageEnum.SHOP_STAGE_17.getShopSubStage());
|
||||
if (shopStage!=null&&shopStage.getShopSubStageStatus().equals(ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_171.getShopSubStageStatus())){
|
||||
|
||||
@@ -145,9 +145,9 @@ public class OpeningAcceptanceServiceImpl implements OpeningAcceptanceService {
|
||||
Long auditId = shopAuditInfoDO.getId();
|
||||
List<OperationLogDO> operationLogs = operationLogDAO.getBySubStageStatusEnumAndsStatus(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_272, OperationTypeEnum.OPERATION_TYPE_1.getCode());
|
||||
operationLogService.batchUpdateProcessed(operationLogs, auditId, user.getUserId(), request.getCause());
|
||||
//开业验收完成之后 看门店整个流程是否完成
|
||||
//开业验收完成之后 开业日期报备打开
|
||||
if (status == AcceptanceStatusEnum.ACCEPTED.getCode()){
|
||||
preparationService.updateShopStatus(request.getShopId());
|
||||
preparationService.theOpeningDateIsReported(request.getShopId());
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user