Merge remote-tracking branch 'origin/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -51,6 +51,8 @@ public class CommonService {
|
||||
private SimpleMessageService simpleMessageService;
|
||||
@Value("${coolstore.page.domain}")
|
||||
private String coolStoreDomainUrl;
|
||||
@Value("${cool.app.id}")
|
||||
private String appId;
|
||||
@Value("${mybatis.configuration.variables.enterpriseId}")
|
||||
private String enterpriseId;
|
||||
@Value("${enterprise.dingCorpId}")
|
||||
@@ -73,7 +75,7 @@ public class CommonService {
|
||||
return (AuditResultService) applicationContext.getBean(auditEnum.getClazz());
|
||||
}
|
||||
|
||||
public void sendMessage(List<String> userIds, MessageEnum message, String... param){
|
||||
public void sendMessage(List<String> userIds, MessageEnum message, Map<String, String> requestMap){
|
||||
if(CollectionUtils.isEmpty(userIds)){
|
||||
return;
|
||||
}
|
||||
@@ -81,9 +83,12 @@ public class CommonService {
|
||||
if(CollectionUtils.isEmpty(userIds)){
|
||||
return;
|
||||
}
|
||||
String mobileParam = MessageFormat.format("{0}&eid={1}&corpId={2}&appType=dingding2&lineId={3}", "", enterpriseId, dingCorpId, null);
|
||||
try {
|
||||
String messageUrl = coolStoreDomainUrl + "dd-noticemsg?miniAppId={0}&appId={1}&corpId={2}&appUrl=" + URLEncoder.encode("pages/common-web-view/index?routerUrl=notice&target=" + mobileParam, StandardCharsets.UTF_8.name());
|
||||
String messageUrl = message.getMessageUrl(coolStoreDomainUrl, appId, dingCorpId, requestMap);
|
||||
if(StringUtils.isBlank(messageUrl)){
|
||||
log.info("获取通知url为空");
|
||||
return;
|
||||
}
|
||||
SendMessageDTO messageDTO = new SendMessageDTO();
|
||||
messageDTO.setCorpId(dingCorpId);
|
||||
messageDTO.setUserIds(String.join(Constants.COMMA, userIds));
|
||||
@@ -91,17 +96,18 @@ public class CommonService {
|
||||
messageDTO.setAppType("dingding2");
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("message_url", messageUrl);
|
||||
map.put("pcMessageUrl", messageUrl);
|
||||
JSONObject headJson = new JSONObject();
|
||||
headJson.put("bgcolor", "FFBBBBBB");
|
||||
map.put("head", headJson);
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("title", message.getTitle());
|
||||
body.put("image", message.getImageUrl());
|
||||
body.put("content", MessageFormat.format(message.getContent(), param));
|
||||
body.put("content", message.getContent(requestMap));
|
||||
map.put("body",body);
|
||||
messageDTO.setOaJson(map);
|
||||
simpleMessageService.send(JSONObject.toJSONString(messageDTO), RocketMqTagEnum.STORE_DING_QUEUE);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,12 @@ public class FirstOrderServiceImp implements FirstOrderService {
|
||||
throw new ServiceException(ErrorCodeEnum.FIRST_ORDER_PARAM_NULL);
|
||||
}
|
||||
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()))
|
||||
{
|
||||
order.setFirstOrderSubStage( ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151.getShopSubStageStatus());
|
||||
return order;
|
||||
}
|
||||
if (Objects.nonNull(order)) {
|
||||
try {
|
||||
ShopInfoDO shopInfo = shopService.getShopInfo(order.getShopId());
|
||||
|
||||
@@ -163,7 +163,11 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
if(InterviewTypeEnum.SECOND_INTERVIEW.equals(interviewType)){
|
||||
messageEnum = MessageEnum.MESSAGE_10;
|
||||
}
|
||||
commonService.sendMessage(Arrays.asList(interviewerUserId), messageEnum, lineInfo.getUsername(), DateUtils.parseDateToStr(DateUtils.NOTICE_DATE, startTime));
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("lineId", String.valueOf(lineInfo.getId()));
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("appointmentTime", DateUtils.parseDateToStr(DateUtils.NOTICE_DATE, startTime));
|
||||
commonService.sendMessage(Arrays.asList(interviewerUserId), messageEnum, messageMap);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@@ -463,7 +467,12 @@ public class LineInterviewServiceImpl extends LineFlowService implements LineInt
|
||||
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), null, WorkflowSubStageStatusEnum.getInterviewRejectStatus(interviewType),userId);
|
||||
String noticeTime = DateUtils.parseDateToStr(DateUtils.NOTICE_DATE, interviewInfo.getStartTime());
|
||||
String interviewUserName = enterpriseUserDAO.getUserName(interviewInfo.getInterviewerUserId());
|
||||
commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()), MessageEnum.MESSAGE_4, lineInfo.getUsername(), noticeTime, interviewUserName);
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("lineId", String.valueOf(lineInfo.getId()));
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("interviewTime", noticeTime);
|
||||
messageMap.put("interviewUsername", interviewUserName);
|
||||
commonService.sendMessage(Arrays.asList(lineInfo.getInvestmentManager()), MessageEnum.MESSAGE_4, messageMap);
|
||||
return lineInterviewDAO.updateInterviewInfo(updateInterviewInfo) > 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,8 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
private ShopInfoDAO shopInfoDAO;
|
||||
@Resource
|
||||
private CoolStoreStartFlowService coolStoreStartFlowService;
|
||||
@Resource
|
||||
private LineInfoDAO lineInfoDAO;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -113,7 +115,7 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
throw new ServiceException(ErrorCodeEnum.SHOP_ID_IS_NULL);
|
||||
}
|
||||
OpeningOperationPlanDO openingOperationPlanDO = openingOperationPlanDAO.selectByShopId(shopId);
|
||||
if (Objects.nonNull(openingOperationPlanDO) ) {
|
||||
if (Objects.nonNull(openingOperationPlanDO)) {
|
||||
OpeningOperationPlanVO openingOperationPlanVO = new OpeningOperationPlanVO(openingOperationPlanDO);
|
||||
String preparationUserIds = openingOperationPlanDO.getPreparationUserIds();
|
||||
List<String> stream = Arrays.stream(preparationUserIds.split(CommonConstants.COMMA)).collect(Collectors.toList());
|
||||
@@ -134,26 +136,41 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
public PageInfo<OpeningOperationPlanListVO> getPlanListPage(PlanListRequest request) {
|
||||
log.info("getPlanListPage request:{}", JSONObject.toJSONString(request));
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
//去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,lineinfo 加盟商name,手机号,招商经理id,open_plan,提交时间,审核状态
|
||||
//TODO 拆表 产品沟通限定时间
|
||||
//不指定时间为3个月数据 去shop_info表查询店铺名字,店铺code,开店负责人id,督导id,区域id,open_plan,提交时间,审核状态
|
||||
List<OpenPlanShopInfoDTO> openPlanShopInfoDTOS = openingOperationPlanDAO.getOpenPlanShopListByCondition(request);
|
||||
//lineinfo 加盟商name,手机号,招商经理name,
|
||||
if (CollectionUtils.isEmpty(openPlanShopInfoDTOS)) {
|
||||
log.error("查询运营方案列表没有数据");
|
||||
return null;
|
||||
}
|
||||
List<Long> lines = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getLineId).collect(Collectors.toList());
|
||||
List<PlanLineDTO> lineInfos = lineInfoDAO.getLines(lines);
|
||||
Map<Long, PlanLineDTO> lineInfoMap = lineInfos.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, dto -> dto));
|
||||
for (OpenPlanShopInfoDTO openPlanShopInfoDTO : openPlanShopInfoDTOS) {
|
||||
openPlanShopInfoDTO.setPartnerName(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getUsername());
|
||||
openPlanShopInfoDTO.setMobile(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getMobile());
|
||||
openPlanShopInfoDTO.setInvestmentManagerId(lineInfoMap.get(openPlanShopInfoDTO.getLineId()).getInvestmentManagerId());
|
||||
}
|
||||
PageInfo pageInfo = new PageInfo<>(openPlanShopInfoDTOS);
|
||||
//开店负责人id,督导id,招商经理id // TODO id 为null过滤
|
||||
//开店负责人id,督导id,招商经理id //
|
||||
Set<String> userIdset = openPlanShopInfoDTOS.stream()
|
||||
.filter(dto -> dto.getShopManagerUserId() != null)
|
||||
.map(OpenPlanShopInfoDTO::getShopManagerUserId)
|
||||
.collect(Collectors.toSet());
|
||||
userIdset.addAll(openPlanShopInfoDTOS.stream()
|
||||
.filter(dto -> dto.getSupervisorUserId() != null)
|
||||
.map(OpenPlanShopInfoDTO::getSupervisorUserId)
|
||||
.collect(Collectors.toSet()));
|
||||
userIdset.addAll(openPlanShopInfoDTOS.stream()
|
||||
.filter(dto -> dto.getInvestmentManagerId() != null)
|
||||
.map(OpenPlanShopInfoDTO::getInvestmentManagerId)
|
||||
.collect(Collectors.toSet()));
|
||||
List<String> userlist = new ArrayList<>();
|
||||
userlist.addAll(userIdset);
|
||||
Map<String, EnterpriseUserDO> vonameMap = enterpriseUserDAO.getUserMap(userlist);
|
||||
List<String> userIdList = new ArrayList<>(userIdset);
|
||||
Map<String, String> vonameMap = enterpriseUserDAO.getUserNameMap(userIdList);
|
||||
log.info("getPlanListPage vonameMap:{}", JSONObject.toJSONString(vonameMap));
|
||||
//region
|
||||
List<Long> regionIds = openPlanShopInfoDTOS.stream().map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList());
|
||||
List<Long> regionIds = openPlanShopInfoDTOS.stream()
|
||||
.filter(dto -> dto.getRegionId() != null).map(OpenPlanShopInfoDTO::getRegionId).collect(Collectors.toList());
|
||||
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
|
||||
List<OpeningOperationPlanListVO> openingOperationPlanListVOList = new ArrayList<>();
|
||||
openPlanShopInfoDTOS.forEach(x -> {
|
||||
@@ -163,23 +180,13 @@ public class OpeningOperationPlanImpl implements OpeningOperationPlanService {
|
||||
openingOperationPlanListVO.setStoreNum(x.getStoreNum());
|
||||
openingOperationPlanListVO.setPartnerName(x.getPartnerName());
|
||||
openingOperationPlanListVO.setMobile(x.getMobile());
|
||||
//TODO
|
||||
String[] split = regionNameMap.getOrDefault(x.getRegionId(), "").split("-");
|
||||
if (split.length > 0) {
|
||||
openingOperationPlanListVO.setBigName(split[0]);
|
||||
openingOperationPlanListVO.setFightName(split[1]);
|
||||
}
|
||||
if (!StringUtils.isEmpty(x.getInvestmentManagerId())) {
|
||||
openingOperationPlanListVO.setInvestmentManagerName
|
||||
(vonameMap.get(x.getInvestmentManagerId()).getName());
|
||||
}
|
||||
if (!StringUtils.isEmpty(x.getShopManagerUserId())) {
|
||||
openingOperationPlanListVO.setShopManagerName
|
||||
(vonameMap.get(x.getInvestmentManagerId()).getName());
|
||||
}
|
||||
if (!StringUtils.isEmpty(x.getSupervisorUserId())) {
|
||||
openingOperationPlanListVO.setSupervisorName(vonameMap.get(x.getSupervisorUserId()).getName());
|
||||
}
|
||||
openingOperationPlanListVO.setRegion(regionNameMap.get(x.getRegionId()));
|
||||
openingOperationPlanListVO.setInvestmentManagerName
|
||||
(vonameMap.get(x.getInvestmentManagerId()));
|
||||
openingOperationPlanListVO.setShopManagerName
|
||||
(vonameMap.get(x.getInvestmentManagerId()));
|
||||
openingOperationPlanListVO.setSupervisorName(
|
||||
vonameMap.get(x.getSupervisorUserId()));
|
||||
openingOperationPlanListVO.setSubmissionTime(x.getSubmissionTime());
|
||||
openingOperationPlanListVO.setResultType(x.getResultType());
|
||||
openingOperationPlanListVOList.add(openingOperationPlanListVO);
|
||||
|
||||
@@ -385,7 +385,11 @@ public class PointServiceImpl implements PointService {
|
||||
result = pointInfoDAO.updatePointInfo(updatePoint);
|
||||
}
|
||||
List<String> sendMessageUserIds = JSONObject.parseArray(nextAuditRecord.getHandlerUserIds(), String.class);
|
||||
commonService.sendMessage(sendMessageUserIds, MessageEnum.MESSAGE_13, pointInfo.getPointName(), pointInfo.getAddress());
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("pointId", String.valueOf(pointInfo.getId()));
|
||||
messageMap.put("pointName", pointInfo.getPointName());
|
||||
messageMap.put("pointAddress", pointInfo.getAddress());
|
||||
commonService.sendMessage(sendMessageUserIds, MessageEnum.MESSAGE_13, messageMap);
|
||||
}else{
|
||||
PointInfoDO updatePoint = new PointInfoDO();
|
||||
updatePoint.setId(pointInfo.getId());
|
||||
@@ -394,7 +398,11 @@ public class PointServiceImpl implements PointService {
|
||||
if(SelectStatusEnum.SELECT_STATUS_1.getCode().equals(pointInfo.getSelectStatus())){
|
||||
initUploadRentContract(pointInfo);
|
||||
}
|
||||
commonService.sendMessage(Arrays.asList(pointInfo.getDevelopmentManager()), MessageEnum.MESSAGE_11, pointInfo.getPointName(), pointInfo.getAddress());
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("pointId", String.valueOf(pointInfo.getId()));
|
||||
messageMap.put("pointName", pointInfo.getPointName());
|
||||
messageMap.put("pointAddress", pointInfo.getAddress());
|
||||
commonService.sendMessage(Arrays.asList(pointInfo.getDevelopmentManager()), MessageEnum.MESSAGE_11, messageMap);
|
||||
result = pointInfoDAO.updatePointInfo(updatePoint);
|
||||
}
|
||||
return result;
|
||||
@@ -414,7 +422,12 @@ public class PointServiceImpl implements PointService {
|
||||
pointInfoUpdate.setStorageStatus(StorageStatusEnum.NOT_IN_STORAGE.getCode());
|
||||
//删除剩余未完成的审核记录
|
||||
pointAuditRecordDAO.deletePointAuditRecord(pointId, pointInfo.getSubmitAuditCount());
|
||||
commonService.sendMessage(Arrays.asList(pointInfo.getDevelopmentManager()), MessageEnum.MESSAGE_12, pointInfo.getPointName(), pointInfo.getAddress(), reason);
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("pointId", String.valueOf(pointInfo.getId()));
|
||||
messageMap.put("pointName", pointInfo.getPointName());
|
||||
messageMap.put("pointAddress", pointInfo.getAddress());
|
||||
messageMap.put("reason", reason);
|
||||
commonService.sendMessage(Arrays.asList(pointInfo.getDevelopmentManager()), MessageEnum.MESSAGE_12, messageMap);
|
||||
return pointInfoDAO.updatePointInfo(pointInfoUpdate);
|
||||
}
|
||||
|
||||
@@ -685,7 +698,13 @@ public class PointServiceImpl implements PointService {
|
||||
//更新已被选择的铺位的拓展经理
|
||||
pointInfoDAO.updateSelectedDevelopmentManager(lineId, request.getDevelopmentManager());
|
||||
String wantShopName = hyOpenAreaInfoDAO.selectNameMapById(lineInfo.getWantShopAreaId());
|
||||
commonService.sendMessage(Arrays.asList(request.getDevelopmentManager()), MessageEnum.MESSAGE_14, lineInfo.getUsername(), lineInfo.getMobile(), wantShopName);
|
||||
|
||||
Map<String, String> messageMap = new HashMap<>();
|
||||
messageMap.put("lineId", String.valueOf(lineId));
|
||||
messageMap.put("partnerUsername", lineInfo.getUsername());
|
||||
messageMap.put("partnerMobile", lineInfo.getMobile());
|
||||
messageMap.put("wantShopName", wantShopName);
|
||||
commonService.sendMessage(Arrays.asList(request.getDevelopmentManager()), MessageEnum.MESSAGE_14, messageMap);
|
||||
//删除未选择的推荐铺位
|
||||
return pointRecommendDAO.turnLineUpdateRecommendStatus(lineId, request.getDevelopmentManager());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user