Merge remote-tracking branch 'origin/dev/feat/partner1.1_20230727' into dev/feat/partner1.1_20230727

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/FlowServiceImpl.java
This commit is contained in:
俞扬
2023-07-20 19:20:20 +08:00
69 changed files with 2588 additions and 90 deletions

View File

@@ -0,0 +1,74 @@
package com.cool.store.service;
import com.cool.store.dto.inspection.setting.AddInspectionSettingDTO;
import com.cool.store.dto.inspection.setting.CheckInspectionSettingDTO;
import com.cool.store.dto.inspection.setting.DeleteInspectionSettingDTO;
import com.cool.store.dto.inspection.setting.UpdateInspectionSettingDTO;
import com.cool.store.vo.inspection.setting.InspectionSettingCheckVO;
import com.cool.store.vo.inspection.setting.InspectionSettingDetailVO;
import com.cool.store.vo.inspection.setting.InspectionSettingPageVO;
import com.github.pagehelper.PageInfo;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: InspectionSettingService
* @Description:
* @date 2023-07-18 15:57
*/
public interface InspectionSettingService {
/**
*稽核区域设置列表
* @param pageNum
* @param pageSize
* @return
*/
PageInfo<InspectionSettingPageVO> getInspectionSettingPage(Integer pageNum, Integer pageSize);
/**
* 获取详情
* @param inspectionSettingId
* @return
*/
InspectionSettingDetailVO getInspectionSettingDetail(Long inspectionSettingId);
/**
* 新增稽核区域设置
* @param userId
* @param param
* @return
*/
Long addInspectionSetting(String userId, AddInspectionSettingDTO param);
/**
* 更新稽核区域设置
* @param userId
* @param param
* @return
*/
Integer updateInspectionSetting(String userId, UpdateInspectionSettingDTO param);
/**
* 删除稽核区域设置
* @param userId
* @param inspectionSettingId
* @return
*/
Integer deleteInspectionSetting(String userId, Long inspectionSettingId);
/**
* 校验稽核区域设置
* @param param
* @return
*/
List<InspectionSettingCheckVO> checkInspectionSetting(CheckInspectionSettingDTO param);
/**
* 获取已经绑定的人员
* @return
*/
List<String> getBingUser();
}

View File

@@ -0,0 +1,46 @@
package com.cool.store.service;
import com.cool.store.request.GetInterviewInspectionListReq;
import com.cool.store.request.GetInterviewInspectionResultListReq;
import com.cool.store.response.ResponseResult;
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.PageInfo;
import com.cool.store.dto.inspection.interview.InspectionRevocationDTO;
import com.cool.store.dto.inspection.interview.InspectionSubmissionDTO;
import com.cool.store.exception.ApiException;
import com.cool.store.dto.inspection.interview.InspectionRevocationDTO;
import com.cool.store.dto.inspection.interview.InspectionSubmissionDTO;
import com.cool.store.exception.ApiException;
import java.util.List;
/**
* @author Fun Li
* @version 1.0
* @date 2023/7/19 16:50
*/
public interface InterviewInspectionService {
List<InterviewInspectionVO> interviewInspectionGetList(GetInterviewInspectionListReq request);
/**
* 提交稽核结果
*/
void submit(InspectionSubmissionDTO dto) throws ApiException;
/**
* 撤销稽核结果
*/
void revoke(InspectionRevocationDTO dto) throws ApiException;
InterviewInspectionInfo interviewInspectionGetDetail(Long id);
List<InterviewInspectionHistoryInfo> interviewInspectionGetHistoryDetail(Long id);
List<InterviewInspectionResultVO> interviewInspectionResultGetList(GetInterviewInspectionResultListReq request);
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service;
import com.cool.store.vo.region.RegionBaseInfoVO;
import com.cool.store.vo.region.RegionUserAndSubRegionVO;
import java.util.List;
@@ -18,4 +19,13 @@ public interface RegionService {
*/
RegionBaseInfoVO getRegionBaseInfoList();
/**
* 获取部门下的子部门和人
* @param regionId
* @return
*/
RegionUserAndSubRegionVO getRegionUserAndSubRegion(String regionId);
}

View File

@@ -21,10 +21,7 @@ import com.cool.store.enums.OperateTypeEnum;
import com.cool.store.enums.WorkflowStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.DingdingUserMapper;
import com.cool.store.mapper.HyPartnerCertificationInfoMapper;
import com.cool.store.mapper.HyPartnerInterviewMapper;
import com.cool.store.mapper.HyPartnerLineInfoMapper;
import com.cool.store.mapper.*;
import com.cool.store.oss.OSSServer;
import com.cool.store.request.*;
import com.cool.store.request.data.flow.KeyText;
@@ -102,6 +99,10 @@ public class FlowServiceImpl implements FlowService {
@Autowired
private HyPartnerBaseInfoDAO hyPartnerBaseInfoDAO;
@Autowired
private HyInspectionMapper inspectionMapper;
@Override
@Transactional
public void createQualifyVerify(CreateQualifyVerifyReq request) throws ApiException, IOException {
@@ -268,6 +269,10 @@ public class FlowServiceImpl implements FlowService {
//3. 生成通过函并修改数据库相关信息
//TODO 问题:如果因为 pdf 生成失败或者其他原因导致异常,但是由于 MDM 只是做回调,不对回调是否成功负责,会导致流程信息缺失
genPassLetterAndUpdateDB(partnerName, verifyCity, passDate, interviewId);
//4. 向面试稽核表中新增一条信息
HyInspectionDO hyInspectionDO = new HyInspectionDO();
hyInspectionDO.setInterviewPlanId(Long.parseLong(interviewPlanId));
inspectionMapper.insertSelective(hyInspectionDO);
//发送加盟商资质审核通过短信
HyPartnerBaseInfoDO hyPartnerBaseInfoDO = hyPartnerBaseInfoDAO.getByPartnerLineId(partnerLineId);
smsService.sendSms(null, CommonConstants.SMS_TEMPLATE_CODE_VERIFY, hyPartnerBaseInfoDO.getMobile());

View File

@@ -580,7 +580,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
}
List<String> result = new ArrayList<>();
if (hyIntendDevelopementMappingDO!=null){
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(Long.valueOf(hyIntendDevelopementMappingDO.getMappingId()));
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(hyIntendDevelopementMappingDO.getMappingId());
if (hyIntendDevZoneInfoDO!=null && StringUtil.isNotEmpty(hyIntendDevZoneInfoDO.getAssociatedRegionId())) {
List<String> list = JSONObject.parseArray(hyIntendDevZoneInfoDO.getAssociatedRegionId(), String.class);
result.addAll(list);
@@ -667,7 +667,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = hyIntendDevMappingDAO.selectByOpenAreaMappingId(Long.valueOf(wantShopArea),type);
List<String> result = new ArrayList<>();
if (hyIntendDevelopementMappingDO!=null){
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(Long.valueOf(hyIntendDevelopementMappingDO.getMappingId()));
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(hyIntendDevelopementMappingDO.getMappingId());
if (hyIntendDevZoneInfoDO!=null && StringUtil.isNotEmpty(hyIntendDevZoneInfoDO.getAssociatedRegionId())) {
List<String> list = JSONObject.parseArray(hyIntendDevZoneInfoDO.getAssociatedRegionId(), String.class);
result.addAll(list);
@@ -675,8 +675,7 @@ public class HyPartnerLineInfoServiceImpl implements HyPartnerLineInfoService {
}
String userId = "";
List<EnterpriseUserDO> userListByRegionIds = enterpriseUserDAO.getUserListByRegionIds(result);
String zoneId = hyIntendDevelopementMappingDO.getMappingId();
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(Long.valueOf(zoneId));
HyIntendDevZoneInfoDO hyIntendDevZoneInfoDO = hyIntendDevZoneInfoDAO.selectById(hyIntendDevelopementMappingDO.getMappingId());
if (CollectionUtils.isNotEmpty(userListByRegionIds)){
List<String> userIdList = userListByRegionIds.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList());
int i = userIdList.indexOf(hyIntendDevZoneInfoDO.getLastAllotUserId());

View File

@@ -0,0 +1,149 @@
package com.cool.store.service.impl;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.HyInspectionSettingDAO;
import com.cool.store.dao.HyInspectionSettingMappingDAO;
import com.cool.store.dao.HyOpenAreaInfoDAO;
import com.cool.store.dto.inspection.setting.AddInspectionSettingDTO;
import com.cool.store.dto.inspection.setting.CheckInspectionSettingDTO;
import com.cool.store.dto.inspection.setting.UpdateInspectionSettingDTO;
import com.cool.store.entity.HyInspectionSettingDO;
import com.cool.store.entity.HyInspectionSettingMappingDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.service.InspectionSettingService;
import com.cool.store.vo.inspection.setting.InspectionSettingCheckVO;
import com.cool.store.vo.inspection.setting.InspectionSettingDetailVO;
import com.cool.store.vo.inspection.setting.InspectionSettingPageVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
* @FileName: InspectionSettingServiceImpl
* @Description:
* @date 2023-07-18 16:06
*/
@Service
public class InspectionSettingServiceImpl implements InspectionSettingService {
@Resource
private HyInspectionSettingDAO hyInspectionSettingDAO;
@Resource
private HyInspectionSettingMappingDAO hyInspectionSettingMappingDAO;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
@Resource
private HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
@Override
public PageInfo<InspectionSettingPageVO> getInspectionSettingPage(Integer pageNum, Integer pageSize) {
Page<HyInspectionSettingDO> inspectionSettingPage = hyInspectionSettingDAO.getInspectionSettingPage(pageNum, pageSize);
Map<String, String> userNameMap = new HashMap<>();
if(CollectionUtils.isNotEmpty(inspectionSettingPage)){
List<String> userIds = inspectionSettingPage.stream().map(HyInspectionSettingDO::getInspectionUserId).distinct().collect(Collectors.toList());
List<String> updateUserIds = inspectionSettingPage.stream().map(HyInspectionSettingDO::getUpdateUserId).distinct().collect(Collectors.toList());
userIds.addAll(updateUserIds);
userNameMap = enterpriseUserDAO.getUserNameMap(userIds);
}
List<InspectionSettingPageVO> resultList = InspectionSettingPageVO.convert(inspectionSettingPage, userNameMap);
PageInfo resultPage = new PageInfo(inspectionSettingPage);
resultPage.setList(resultList);
return resultPage;
}
@Override
public InspectionSettingDetailVO getInspectionSettingDetail(Long inspectionSettingId) {
HyInspectionSettingDO inspectionSetting = hyInspectionSettingDAO.getInspectionSettingDetail(inspectionSettingId);
if(Objects.isNull(inspectionSetting)){
return null;
}
List<Long> openAreaMappingIds = hyInspectionSettingMappingDAO.getOpenAreaMappingIds(inspectionSettingId);
String inspectionUsername = enterpriseUserDAO.getUserName(inspectionSetting.getInspectionUserId());
return InspectionSettingDetailVO.convertVO(inspectionSetting, inspectionUsername, openAreaMappingIds);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Long addInspectionSetting(String userId, AddInspectionSettingDTO param) {
List<HyInspectionSettingDO> inspectionUserSetting = hyInspectionSettingDAO.getHyInspectionSettingByUserId(param.getInspectionUserId(), null);
if(CollectionUtils.isNotEmpty(inspectionUserSetting)){
throw new ServiceException(ErrorCodeEnum.INSPECTION_USER_OCCUPY);
}
List<Long> openAreaMappingIds = hyOpenAreaInfoDAO.filterLeafNode(param.getOpenAreaMappingIds());
if(CollectionUtils.isEmpty(openAreaMappingIds)){
throw new ServiceException(ErrorCodeEnum.OPEN_AREA_NULL);
}
HyInspectionSettingDO inspectionSetting = new HyInspectionSettingDO();
inspectionSetting.setInspectionUserId(param.getInspectionUserId());
inspectionSetting.setZoneName(param.getZoneName());
inspectionSetting.setCreateUserId(userId);
inspectionSetting.setCreateTime(new Date());
Long inspectionSettingId = hyInspectionSettingDAO.addInspectionSetting(inspectionSetting);
hyInspectionSettingMappingDAO.addInspectionSettingMapping(inspectionSettingId, openAreaMappingIds);
return inspectionSettingId;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer updateInspectionSetting(String userId, UpdateInspectionSettingDTO param) {
List<HyInspectionSettingDO> inspectionUserSetting = hyInspectionSettingDAO.getHyInspectionSettingByUserId(param.getInspectionUserId(), param.getInspectionSettingId());
if(CollectionUtils.isNotEmpty(inspectionUserSetting)){
throw new ServiceException(ErrorCodeEnum.INSPECTION_USER_OCCUPY);
}
List<Long> openAreaMappingIds = hyOpenAreaInfoDAO.filterLeafNode(param.getOpenAreaMappingIds());
if(CollectionUtils.isEmpty(openAreaMappingIds)){
throw new ServiceException(ErrorCodeEnum.OPEN_AREA_NULL);
}
HyInspectionSettingDO inspectionSetting = new HyInspectionSettingDO();
inspectionSetting.setId(param.getInspectionSettingId());
inspectionSetting.setInspectionUserId(param.getInspectionUserId());
inspectionSetting.setZoneName(param.getZoneName());
inspectionSetting.setUpdateUserId(userId);
inspectionSetting.setUpdateTime(new Date());
hyInspectionSettingDAO.updateInspectionSetting(inspectionSetting);
return hyInspectionSettingMappingDAO.updateInspectionSettingMapping(param.getInspectionSettingId(), openAreaMappingIds);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer deleteInspectionSetting(String userId, Long inspectionSettingId) {
HyInspectionSettingDO inspectionSetting = new HyInspectionSettingDO();
inspectionSetting.setId(inspectionSettingId);
inspectionSetting.setUpdateUserId(userId);
inspectionSetting.setUpdateTime(new Date());
inspectionSetting.setDeleted(Boolean.TRUE);
hyInspectionSettingDAO.updateInspectionSetting(inspectionSetting);
hyInspectionSettingMappingDAO.deleteInspectionSettingMapping(inspectionSettingId);
return hyInspectionSettingDAO.updateInspectionSetting(inspectionSetting);
}
@Override
public List<InspectionSettingCheckVO> checkInspectionSetting(CheckInspectionSettingDTO param) {
if(CollectionUtils.isEmpty(param.getOpenAreaMappingIds())){
return Lists.newArrayList();
}
List<HyInspectionSettingMappingDO> conflictInspectionSetting = hyInspectionSettingMappingDAO.getConflictInspectionSetting(param.getInspectionSettingId(), param.getOpenAreaMappingIds());
List<Long> inspectionSettingIds = ListUtils.emptyIfNull(conflictInspectionSetting).stream().map(HyInspectionSettingMappingDO::getInspectionSettingId).distinct().collect(Collectors.toList());
List<HyInspectionSettingDO> inspectionSettingList = hyInspectionSettingDAO.getHyInspectionSettingByIds(inspectionSettingIds);
List<String> inspectionUserIds = ListUtils.emptyIfNull(inspectionSettingList).stream().map(HyInspectionSettingDO::getInspectionUserId).distinct().collect(Collectors.toList());
List<Long> openAreaMappingIds = ListUtils.emptyIfNull(conflictInspectionSetting).stream().map(HyInspectionSettingMappingDO::getOpenAreaMappingId).distinct().collect(Collectors.toList());
Map<Long, String> areaNameMap = hyOpenAreaInfoDAO.getNameMapByIds(openAreaMappingIds);
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(inspectionUserIds);
return InspectionSettingCheckVO.convertVO(conflictInspectionSetting, inspectionSettingList, userNameMap, areaNameMap);
}
@Override
public List<String> getBingUser() {
return hyInspectionSettingDAO.getInspectionUserIds();
}
}

View File

@@ -0,0 +1,136 @@
package com.cool.store.service.impl;
import cn.hutool.core.date.DateUtil;
import com.cool.store.context.CurrentUserHolder;
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.enums.ErrorCodeEnum;
import com.cool.store.enums.InspectionOperationTypeEnum;
import com.cool.store.enums.InspectionStatusEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyInspectionMapper;
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.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 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 java.util.stream.Collectors;
/**
* @author Fun Li
* @version 1.0
* @date 2023/7/19 16:50
*/
@Service
public class InterviewInspectionServiceImpl implements InterviewInspectionService {
@Autowired
private HyInspectionMapper inspectionMapper;
@Autowired
private HyInterviewInspectionLogMapper interviewInspectionLogMapper;
@Override
public void submit(InspectionSubmissionDTO dto) throws ApiException {
HyInspectionDO rawInspection = inspectionMapper.selectByPrimaryKey(dto.getInspectionId());
if (Objects.isNull(rawInspection)) {
throw new ApiException(ErrorCodeEnum.INSPECTION_INFO_NOT_EXIST);
}
HyInspectionDO hyInspectionDO = new HyInspectionDO();
//稽核结果和说明及文件等
hyInspectionDO.setId(dto.getInspectionId());
if (dto.getWhetherPass().equals(0)) {
hyInspectionDO.setStatus(InspectionStatusEnum.NOT_PASS.getCode());
} else if (dto.getWhetherPass().equals(1)) {
hyInspectionDO.setStatus(InspectionStatusEnum.PASS.getCode());
}
hyInspectionDO.setDescription(dto.getDescription());
String filesStr = spliceFiles(dto.getFiles());
hyInspectionDO.setFiles(filesStr);
//稽核人,稽核时间,创建人
hyInspectionDO.setOperatorUserId(CurrentUserHolder.getUserId());
hyInspectionDO.setUpdator(CurrentUserHolder.getUserId());
hyInspectionDO.setInspectionTime(DateUtil.now());
hyInspectionDO.setCreator(rawInspection.getCreator() == null ? CurrentUserHolder.getUserId() : rawInspection.getCreator());
inspectionMapper.updateByPrimaryKeySelective(hyInspectionDO);
}
@Override
@Transactional
public void revoke(InspectionRevocationDTO dto) throws ApiException {
//2.1 查询之前的一次操作
HyInspectionDO hyInspectionDO = inspectionMapper.selectByPrimaryKey(dto.getInspectionId());
if (Objects.isNull(hyInspectionDO)) {
throw new ApiException(ErrorCodeEnum.INSPECTION_INFO_NOT_EXIST);
}
//1. 撤销操作记录写入数据库面试稽核操作记录表
HyInterviewInspectionLogDO inspectionLog = new HyInterviewInspectionLogDO();
inspectionLog.setOperatorUserId(CurrentUserHolder.getUserId());
inspectionLog.setInspectionId(dto.getInspectionId());
inspectionLog.setOperationType(InspectionOperationTypeEnum.REVOCATION.getCode());
inspectionLog.setDescription(dto.getDescription());
String filesStr = spliceFiles(dto.getFiles());
inspectionLog.setOperationTime(DateUtil.now());
inspectionLog.setFiles(filesStr);
interviewInspectionLogMapper.insertSelective(inspectionLog);
//2. 撤销操作之前的一次操作写入面试稽核操作记录表
inspectionLog.setOperatorUserId(hyInspectionDO.getOperatorUserId());
inspectionLog.setInspectionId(hyInspectionDO.getId());
if (hyInspectionDO.getStatus().equals(1)) {
inspectionLog.setOperationType(InspectionOperationTypeEnum.PASS.getCode());
} else if (hyInspectionDO.getStatus().equals(2)) {
inspectionLog.setOperationType(InspectionOperationTypeEnum.NOT_PASS.getCode());
}
inspectionLog.setDescription(hyInspectionDO.getDescription());
inspectionLog.setFiles(hyInspectionDO.getFiles());
inspectionLog.setOperationTime(hyInspectionDO.getInspectionTime());
interviewInspectionLogMapper.insertSelective(inspectionLog);
//3. 撤销操作之前的一次操作稽核信息状态修改为未稽核,并且将数据状态(其他字段)也恢复到未稽核时的状态
hyInspectionDO.setOperatorUserId(null);
hyInspectionDO.setStatus(InspectionStatusEnum.NOT_INSPECT.getCode());
hyInspectionDO.setFiles(null);
hyInspectionDO.setDescription(null);
hyInspectionDO.setInspectionTime(null);
hyInspectionDO.setUpdator(null);
inspectionMapper.updateByPrimaryKey(hyInspectionDO);
}
@Override
public InterviewInspectionInfo interviewInspectionGetDetail(Long id) {
return inspectionMapper.interviewInspectionGetDetail(id);
}
@Override
public List<InterviewInspectionHistoryInfo> interviewInspectionGetHistoryDetail(Long id) {
return inspectionMapper.interviewInspectionGetHistoryDetail(id);
}
@Override
public List<InterviewInspectionResultVO> interviewInspectionResultGetList(GetInterviewInspectionResultListReq request) {
return inspectionMapper.interviewInspectionResultGetList(request);
}
private String spliceFiles(List<String> files) {
if (files == null || files.size() == 0) {
return null;
}
return files.stream().map(String::valueOf).collect(Collectors.joining(","));
}
@Override
public List<InterviewInspectionVO> interviewInspectionGetList(GetInterviewInspectionListReq request) {
String userId = CurrentUserHolder.getUserId();
return inspectionMapper.interviewInspectionGetList(request);
}
}

View File

@@ -123,7 +123,7 @@ public class InterviewServiceImpl implements InterviewService {
//将 processInfo 解析为 List
if (!StringUtils.isEmpty(vo.getProcessInfo())) {
List<String> split = Arrays.asList(vo.getProcessInfo().split(","));
vo.setVedioList(split);
vo.setVideoList(split);
vo.setProcessInfo("");
}
//查询面试官和记录人信息(面试官必须有)
@@ -147,7 +147,7 @@ public class InterviewServiceImpl implements InterviewService {
return vo;
}
//查询开发主管
EnterpriseUserDO development = enterpriseUserService.getDevelopmentByZoneId(Long.parseLong(hyIntendDevelopementMappingDO.getMappingId()));
EnterpriseUserDO development = enterpriseUserService.getDevelopmentByZoneId(hyIntendDevelopementMappingDO.getMappingId());
vo.setDevelopmentDirector(development);
}
return vo;

View File

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.Objects;
/**
@@ -51,7 +52,6 @@ public class LoginServiceImpl implements LoginService {
throw new ServiceException(ErrorCodeEnum.USER_NOT_EXIST);
}
LoginUserInfo currentUser = new LoginUserInfo();
RefreshUser refreshUser = new RefreshUser();
// 查企业用户
EnterpriseUserDO enterpriseUser = enterpriseUserDAO.getUserInfoById(userId);
if(enterpriseUser == null){
@@ -78,12 +78,10 @@ public class LoginServiceImpl implements LoginService {
//生成令牌
RandomNumberGenerator randomNumberGenerator = new SecureRandomNumberGenerator();
String token = randomNumberGenerator.nextBytes().toHex();
String refreshToken = randomNumberGenerator.nextBytes().toHex();
currentUser.setName(enterpriseUser.getName());
currentUser.setAccessToken(token);
redisUtilPool.setString(CommonConstants.ACCESS_TOKEN_KEY + ":" + token, JSON.toJSONString(currentUser), CommonConstants.ACCESS_TOKEN_EXPIRE);
redisUtilPool.setString(MessageFormat.format(CommonConstants.ACCESS_TOKEN_KEY, token), JSON.toJSONString(currentUser), CommonConstants.ACCESS_TOKEN_EXPIRE);
redisUtilPool.setString(currentUser.getUserId(), token);
redisUtilPool.setString(CommonConstants.REFRESH_TOKEN_KEY+":"+refreshToken,JSON.toJSONString(refreshUser), CommonConstants.REFRESH_TOKEN_EXPIRE);
log.info("[" + enterpriseUser.getName() + "; action_token"+ token + "; userId" + currentUser.getUserId() +"]登入系统成功");
return currentUser;
}

View File

@@ -1,16 +1,21 @@
package com.cool.store.service.impl;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.RegionDAO;
import com.cool.store.dao.UserRegionMappingDAO;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.entity.RegionDO;
import com.cool.store.mq.producer.SimpleMessageService;
import com.cool.store.service.RegionService;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtil;
import com.cool.store.vo.region.RegionBaseInfoVO;
import com.cool.store.vo.region.RegionUserAndSubRegionVO;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @author zhangchenbiao
@@ -25,6 +30,10 @@ public class RegionServiceImpl implements RegionService {
private RedisUtil redisUtil;
@Resource
private RegionDAO regionDAO;
@Resource
private UserRegionMappingDAO userRegionMappingDAO;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
@Override
@@ -32,4 +41,12 @@ public class RegionServiceImpl implements RegionService {
List<RegionDO> regionBaseInfoList = regionDAO.getRegionBaseInfoList();
return RegionBaseInfoVO.convertTree(regionBaseInfoList);
}
@Override
public RegionUserAndSubRegionVO getRegionUserAndSubRegion(String regionId) {
List<RegionDO> subRegionList = regionDAO.getSubRegion(regionId);
List<String> userIds = userRegionMappingDAO.getUserListByRegionId(regionId);
Map<String, EnterpriseUserDO> userMap = enterpriseUserDAO.getUserMap(userIds);
return RegionUserAndSubRegionVO.convertVO(subRegionList, userIds, userMap);
}
}

View File

@@ -48,6 +48,8 @@ public class ZoneServiceImpl implements ZoneService {
EnterpriseUserDAO enterpriseUserDAO;
@Resource
RegionDAO regionDAO;
@Resource
HyOpenAreaInfoDAO hyOpenAreaInfoDAO;
@@ -67,12 +69,13 @@ public class ZoneServiceImpl implements ZoneService {
//添加战区映射的意向区域
hyIntendDevMappingDAO.deleteByOpenAreaIds(intentAreaSettingRequest.getOpenAreaIdList(),hyIntendDevZoneInfoDO.getType());
List<Long> openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList();
List<Long> openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList);
List<HyIntendDevelopementMappingDO> list = new ArrayList<>();
openAreaIdList.stream().forEach(x->{
openAreaIdFilterList.stream().forEach(x->{
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO();
hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType());
hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x));
hyIntendDevelopementMappingDO.setMappingId(String.valueOf(hyIntendDevZoneInfoDO.getId()));
hyIntendDevelopementMappingDO.setMappingId(hyIntendDevZoneInfoDO.getId());
list.add(hyIntendDevelopementMappingDO);
});
hyIntendDevMappingDAO.batchInsert(list);
@@ -95,12 +98,13 @@ public class ZoneServiceImpl implements ZoneService {
hyIntendDevMappingDAO.deleteByMappingIds(Arrays.asList(intentAreaSettingRequest.getId())
,intentAreaSettingRequest.getType());
List<Long> openAreaIdList = intentAreaSettingRequest.getOpenAreaIdList();
List<Long> openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList);
List<HyIntendDevelopementMappingDO> list = new ArrayList<>();
openAreaIdList.stream().forEach(x->{
openAreaIdFilterList.stream().forEach(x->{
HyIntendDevelopementMappingDO hyIntendDevelopementMappingDO = new HyIntendDevelopementMappingDO();
hyIntendDevelopementMappingDO.setType(intentAreaSettingRequest.getType());
hyIntendDevelopementMappingDO.setOpenAreaMappingId(String.valueOf(x));
hyIntendDevelopementMappingDO.setMappingId(String.valueOf(hyIntendDevZoneInfoDO.getId()));
hyIntendDevelopementMappingDO.setMappingId((hyIntendDevZoneInfoDO.getId()));
list.add(hyIntendDevelopementMappingDO);
});
hyIntendDevMappingDAO.batchInsert(list);
@@ -206,7 +210,8 @@ public class ZoneServiceImpl implements ZoneService {
//查询已经绑定战区的 意向区域
List<ZoneCheckDTO> list = hyIntendDevMappingDAO.selectByOpenAreaMappingIdList(intentAreaSettingRequest.getOpenAreaIdList(),intentAreaSettingRequest.getType(),intentAreaSettingRequest.getId());
List<Long> openAreaIdList = list.stream().map(ZoneCheckDTO::getOpenAreaMappingId).collect(Collectors.toList());
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdList);
List<Long> openAreaIdFilterList = hyOpenAreaInfoDAO.filterLeafNode(openAreaIdList);
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOList = openAreaInfoDAO.selectByIds(openAreaIdFilterList);
Map<Long, String> areaNameMap = hyOpenAreaInfoDOList.stream().collect(Collectors.toMap(HyOpenAreaInfoDO::getId, HyOpenAreaInfoDO::getAreaName));
List<ZoneCheckVO> result = new ArrayList<>();
list.forEach(x->{