Merge branch 'dev/feat/partner1.1_20230727' of http://git.hsayi.com:19062/HSAY/hsay-partner into dev/feat/partner1.1_20230727
This commit is contained in:
@@ -17,4 +17,7 @@ public interface MDMAreaService {
|
||||
*/
|
||||
List<MDMAreaDO> getSonArea(String code);
|
||||
|
||||
List<MDMAreaDO> getAllAreaCode(String code);
|
||||
|
||||
boolean getAreaProvinceType(String code);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.cool.store.dto.mdm.AccessTokenDTO;
|
||||
import com.cool.store.dto.response.MDMResultDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.InspectionTyeEnum;
|
||||
import com.cool.store.enums.OperateTypeEnum;
|
||||
import com.cool.store.enums.WorkflowStatusEnum;
|
||||
import com.cool.store.exception.ApiException;
|
||||
@@ -272,6 +273,8 @@ public class FlowServiceImpl implements FlowService {
|
||||
//4. 向面试稽核表中新增一条信息
|
||||
HyInspectionDO hyInspectionDO = new HyInspectionDO();
|
||||
hyInspectionDO.setInterviewPlanId(Long.parseLong(interviewPlanId));
|
||||
hyInspectionDO.setCreateTime(DateUtil.formatDateTime(passDate));
|
||||
hyInspectionDO.setType(InspectionTyeEnum.INTERVIEW_INSPECTION.getCode());
|
||||
inspectionMapper.insertSelective(hyInspectionDO);
|
||||
//发送加盟商资质审核通过短信
|
||||
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(partnerLineId);
|
||||
|
||||
@@ -88,6 +88,8 @@ public class InspectionSettingServiceImpl implements InspectionSettingService {
|
||||
inspectionSetting.setZoneName(param.getZoneName());
|
||||
inspectionSetting.setCreateUserId(userId);
|
||||
inspectionSetting.setCreateTime(new Date());
|
||||
inspectionSetting.setUpdateUserId(userId);
|
||||
inspectionSetting.setUpdateTime(new Date());
|
||||
Long inspectionSettingId = hyInspectionSettingDAO.addInspectionSetting(inspectionSetting);
|
||||
hyInspectionSettingMappingDAO.addInspectionSettingMapping(inspectionSettingId, openAreaMappingIds);
|
||||
return inspectionSettingId;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dto.inspection.interview.InspectionRevocationDTO;
|
||||
import com.cool.store.dto.inspection.interview.InspectionSubmissionDTO;
|
||||
import com.cool.store.entity.HyInspectionDO;
|
||||
import com.cool.store.entity.HyInterviewInspectionLogDO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.InspectionOperationTypeEnum;
|
||||
import com.cool.store.enums.InspectionStatusEnum;
|
||||
@@ -15,16 +17,22 @@ import com.cool.store.request.GetInterviewInspectionListReq;
|
||||
import com.cool.store.request.GetInterviewInspectionResultListReq;
|
||||
import com.cool.store.mapper.HyInterviewInspectionLogMapper;
|
||||
import com.cool.store.service.InterviewInspectionService;
|
||||
import com.cool.store.service.MDMAreaService;
|
||||
import com.cool.store.service.OpenAreaService;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import com.cool.store.vo.interview.InterviewInspectionHistoryInfo;
|
||||
import com.cool.store.vo.interview.InterviewInspectionInfo;
|
||||
import com.cool.store.vo.interview.InterviewInspectionResultVO;
|
||||
import com.cool.store.vo.interview.InterviewInspectionVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -41,6 +49,10 @@ public class InterviewInspectionServiceImpl implements InterviewInspectionServic
|
||||
@Autowired
|
||||
private HyInterviewInspectionLogMapper interviewInspectionLogMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
|
||||
|
||||
@Override
|
||||
public void submit(InspectionSubmissionDTO dto) throws ApiException {
|
||||
HyInspectionDO rawInspection = inspectionMapper.selectByPrimaryKey(dto.getInspectionId());
|
||||
@@ -108,17 +120,47 @@ public class InterviewInspectionServiceImpl implements InterviewInspectionServic
|
||||
|
||||
@Override
|
||||
public InterviewInspectionInfo interviewInspectionGetDetail(Long id) {
|
||||
return inspectionMapper.interviewInspectionGetDetail(id);
|
||||
InterviewInspectionInfo interviewInspectionInfo = inspectionMapper.interviewInspectionGetDetail(id);
|
||||
if (ObjectUtil.isNotNull(interviewInspectionInfo) && ObjectUtil.isNotNull(interviewInspectionInfo.getFilesStr())) {
|
||||
List<String> list = Arrays.asList(interviewInspectionInfo.getFilesStr().split(","));
|
||||
interviewInspectionInfo.setFiles(list);
|
||||
}
|
||||
return interviewInspectionInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InterviewInspectionHistoryInfo> interviewInspectionGetHistoryDetail(Long id) {
|
||||
return inspectionMapper.interviewInspectionGetHistoryDetail(id);
|
||||
List<InterviewInspectionHistoryInfo> interviewInspectionHistoryInfos = interviewInspectionLogMapper.interviewInspectionGetHistoryDetail(id);
|
||||
for (InterviewInspectionHistoryInfo interviewInspectionHistoryInfo : interviewInspectionHistoryInfos) {
|
||||
if (ObjectUtil.isNotNull(interviewInspectionHistoryInfo) && ObjectUtil.isNotNull(interviewInspectionHistoryInfo.getFilesStr())) {
|
||||
List<String> list = Arrays.asList(interviewInspectionHistoryInfo.getFilesStr().split(","));
|
||||
interviewInspectionHistoryInfo.setFiles(list);
|
||||
}
|
||||
}
|
||||
return interviewInspectionHistoryInfos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InterviewInspectionResultVO> interviewInspectionResultGetList(GetInterviewInspectionResultListReq request) {
|
||||
return inspectionMapper.interviewInspectionResultGetList(request);
|
||||
//给个默认时间
|
||||
if (StringUtil.isEmpty(request.getStartTime()) && StringUtil.isEmpty(request.getEndTime())) {
|
||||
request.setStartTime(getHourDayDate(0, -6, true)).setEndTime(getHourDayDate(0, 0, false));
|
||||
}
|
||||
//意向开店区域 不为空
|
||||
if (StringUtil.isNotEmpty(request.getWantShopArea())) {
|
||||
HyOpenAreaInfoDO hyOpenAreaInfoDO =hyOpenAreaInfoDAO.selectById(Convert.toLong(request.getWantShopArea()));
|
||||
if (ObjectUtil.isNull(hyOpenAreaInfoDO.getParentId())) {
|
||||
//是省
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
return inspectionMapper.interviewInspectionResultGetProvinceList(request.setUserId(CurrentUserHolder.getUserId()));
|
||||
} else {
|
||||
//并非省
|
||||
List<Long> codeList = hyOpenAreaInfoDAO.getAllAreaCode(request.getWantShopArea()).stream().map(HyOpenAreaInfoDO::getId).collect(Collectors.toList());
|
||||
request.setCodeList(codeList);
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
return inspectionMapper.interviewInspectionResultGetList(request.setUserId(CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
private String spliceFiles(List<String> files) {
|
||||
@@ -130,7 +172,38 @@ public class InterviewInspectionServiceImpl implements InterviewInspectionServic
|
||||
|
||||
@Override
|
||||
public List<InterviewInspectionVO> interviewInspectionGetList(GetInterviewInspectionListReq request) {
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
return inspectionMapper.interviewInspectionGetList(request);
|
||||
//给个默认时间
|
||||
if (StringUtil.isEmpty(request.getStartTime()) && StringUtil.isEmpty(request.getEndTime())) {
|
||||
request.setStartTime(getHourDayDate(0, -6, true)).setEndTime(getHourDayDate(0, 0, false));
|
||||
}
|
||||
//意向开店区域 不为空
|
||||
if (StringUtil.isNotEmpty(request.getWantShopArea())) {
|
||||
HyOpenAreaInfoDO hyOpenAreaInfoDO =hyOpenAreaInfoDAO.selectById(Convert.toLong(request.getWantShopArea()));
|
||||
if (ObjectUtil.isNull(hyOpenAreaInfoDO.getParentId())) {
|
||||
//是省
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
return inspectionMapper.interviewInspectionGetProvinceList(request.setUserId(CurrentUserHolder.getUserId()));
|
||||
} else {
|
||||
//并非省
|
||||
List<Long> codeList = hyOpenAreaInfoDAO.getAllAreaCode(request.getWantShopArea()).stream().map(HyOpenAreaInfoDO::getId).collect(Collectors.toList());
|
||||
request.setCodeList(codeList);
|
||||
}
|
||||
}
|
||||
PageHelper.startPage(request.getPageNum(), request.getPageSize());
|
||||
return inspectionMapper.interviewInspectionGetList(request.setUserId(CurrentUserHolder.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
private String getHourDayDate(int hour, int day, boolean pan) {
|
||||
Date today = new Date();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(today);
|
||||
calendar.add(Calendar.HOUR, hour);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, day);
|
||||
Date twoDay = calendar.getTime();
|
||||
String partner = pan ? "yyyy-MM-dd 00:00:00" : "yyyy-MM-dd 24:00:00";
|
||||
return new SimpleDateFormat(partner).format(twoDay);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,11 @@ import com.cool.store.entity.MDMAreaDO;
|
||||
import com.cool.store.mapper.MdmAreaMapper;
|
||||
import com.cool.store.service.MDMAreaService;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
@@ -57,4 +59,41 @@ public class MDMAreaServiceImpl implements MDMAreaService {
|
||||
return areaDOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MDMAreaDO> getAllAreaCode(String code) {
|
||||
if (StringUtil.isEmpty(code)) {
|
||||
return null;
|
||||
}
|
||||
//获取省下所有数据
|
||||
List<MDMAreaDO> provinceCodeList= mdmAreaMapper.getProvinceAllCode(code);
|
||||
if(CollectionUtils.isEmpty(provinceCodeList)){
|
||||
//获取市区下所有数据
|
||||
List<MDMAreaDO> cityCodeList= mdmAreaMapper.getSonArea(code);
|
||||
if(CollectionUtils.isEmpty(cityCodeList)){
|
||||
//获取区数据
|
||||
return mdmAreaMapper.getArea(code);
|
||||
}else {
|
||||
return cityCodeList;
|
||||
}
|
||||
}else {
|
||||
return provinceCodeList;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 省为true
|
||||
* 非省为false
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean getAreaProvinceType(String code) {
|
||||
if (StringUtil.isEmpty(code)) {
|
||||
return false;
|
||||
}
|
||||
//获取省下所有数据
|
||||
List<MDMAreaDO> provinceCodeList= mdmAreaMapper.getProvinceAllCode(code);
|
||||
return CollectionUtils.isEmpty(provinceCodeList)?false:true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.message.SendCardMessageDTO;
|
||||
import com.cool.store.enums.FeiShuNoticeMsgEnum;
|
||||
import com.cool.store.enums.MessageTypeEnum;
|
||||
import com.cool.store.http.ISVHttpRequest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -26,13 +28,17 @@ public class NoticeService {
|
||||
private ISVHttpRequest isvHttpRequest;
|
||||
public void sendFeiShuNotice(FeiShuNoticeMsgEnum feiShuNoticeMsgEnum, List<String> userIds,Object... objects) {
|
||||
try{
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(userIds);
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setMessageUrl(linkUrl);
|
||||
sendCardMessageDTO.setTitle(feiShuNoticeMsgEnum.getTitle());
|
||||
sendCardMessageDTO.setContent(MessageFormat.format(feiShuNoticeMsgEnum.getContent(),objects));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
if (CollectionUtils.isEmpty(userIds)){
|
||||
log.info("sendFeiShuNotice_feiShuNoticeMsgEnum:{} userIds:{},objects:{}",feiShuNoticeMsgEnum.getTitle(), JSONObject.toJSONString(userIds),JSONObject.toJSONString(objects));
|
||||
return;
|
||||
}
|
||||
SendCardMessageDTO sendCardMessageDTO = new SendCardMessageDTO();
|
||||
sendCardMessageDTO.setUserIds(userIds);
|
||||
sendCardMessageDTO.setMessageType(MessageTypeEnum.SCHEDULE_REMINDER);
|
||||
sendCardMessageDTO.setMessageUrl(linkUrl);
|
||||
sendCardMessageDTO.setTitle(feiShuNoticeMsgEnum.getTitle());
|
||||
sendCardMessageDTO.setContent(MessageFormat.format(feiShuNoticeMsgEnum.getContent(),objects));
|
||||
isvHttpRequest.sendFeiShuCardMessage(sendCardMessageDTO);
|
||||
}catch (Exception e){
|
||||
log.info("发送飞书通知失败");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user