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

This commit is contained in:
zhangchenbiao
2023-07-20 09:44:10 +08:00
20 changed files with 1008 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
package com.cool.store.service;
import com.cool.store.dto.inspection.interview.InspectionRevocationDTO;
import com.cool.store.dto.inspection.interview.InspectionSubmissionDTO;
import com.cool.store.exception.ApiException;
/**
* @author Fun Li
* @version 1.0
* @date 2023/7/19 16:50
*/
public interface InterviewInspectionService {
/**
* 提交稽核结果
*/
void submit(InspectionSubmissionDTO dto);
/**
* 撤销稽核结果
*/
void revoke(InspectionRevocationDTO dto) throws ApiException;
}

View File

@@ -563,7 +563,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);
@@ -650,7 +650,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);
@@ -658,8 +658,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,104 @@
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.HyInspection;
import com.cool.store.entity.HyInterviewInspectionLog;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.InspectionOperationTypeEnum;
import com.cool.store.enums.InspectionStatusEnum;
import com.cool.store.enums.InspectionTyeEnum;
import com.cool.store.exception.ApiException;
import com.cool.store.mapper.HyInspectionMapper;
import com.cool.store.mapper.HyInterviewInspectionLogMapper;
import com.cool.store.service.InterviewInspectionService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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) {
HyInspection hyInspection = new HyInspection();
//稽核结果和说明及文件等
hyInspection.setId(dto.getInspectionId());
if (dto.getWhetherPass().equals(0)) {
hyInspection.setStatus(InspectionStatusEnum.NOT_PASS.getCode());
} else if (dto.getWhetherPass().equals(1)) {
hyInspection.setStatus(InspectionStatusEnum.PASS.getCode());
}
hyInspection.setDescription(dto.getDescription());
String filesStr = spliceFiles(dto.getFiles());
hyInspection.setFiles(filesStr);
//稽核人,稽核时间
hyInspection.setOperatorUserId(CurrentUserHolder.getUserId());
hyInspection.setUpdator(CurrentUserHolder.getUserId());
hyInspection.setInspectionTime(DateUtil.now());
inspectionMapper.updateByPrimaryKeySelective(hyInspection);
}
@Override
public void revoke(InspectionRevocationDTO dto) throws ApiException {
//2.1 查询之前的一次操作
HyInspection hyInspection = inspectionMapper.selectByPrimaryKey(dto.getInspectionId());
if (Objects.isNull(hyInspection)) {
throw new ApiException(ErrorCodeEnum.INSPECTION_INFO_NOT_EXIST);
}
//1. 撤销操作记录写入数据库面试稽核操作记录表
HyInterviewInspectionLog inspectionLog = new HyInterviewInspectionLog();
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.updateByPrimaryKeySelective(inspectionLog);
//2. 撤销操作之前的一次操作写入面试稽核操作记录表
inspectionLog.setOperatorUserId(hyInspection.getOperatorUserId());
inspectionLog.setInspectionId(hyInspection.getId());
if (hyInspection.getStatus().equals(1)) {
inspectionLog.setOperationType(InspectionOperationTypeEnum.PASS.getCode());
} else if (hyInspection.getStatus().equals(2)) {
inspectionLog.setOperationType(InspectionOperationTypeEnum.NOT_PASS.getCode());
}
inspectionLog.setDescription(hyInspection.getDescription());
inspectionLog.setFiles(hyInspection.getFiles());
inspectionLog.setOperationTime(DateUtil.now());
//3. 撤销操作之前的一次操作稽核信息状态修改为未稽核,并且将数据状态(其他字段)也恢复到未稽核时的状态
hyInspection.setOperatorUserId(null);
hyInspection.setStatus(InspectionStatusEnum.NOT_INSPECT.getCode());
hyInspection.setFiles(null);
hyInspection.setDescription(null);
hyInspection.setInspectionTime(null);
hyInspection.setUpdator(null);
inspectionMapper.updateByPrimaryKey(hyInspection);
}
private String spliceFiles(List<String> files) {
if (files == null || files.size() == 0) {
return null;
}
return files.stream().map(String::valueOf).collect(Collectors.joining(","));
}
}

View File

@@ -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

@@ -72,7 +72,7 @@ public class ZoneServiceImpl implements ZoneService {
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);
@@ -100,7 +100,7 @@ public class ZoneServiceImpl implements ZoneService {
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);