Commit 2e9ba8dc authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 99b2dc14 a7820974
......@@ -276,7 +276,7 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
if (Common.isNotNull(idList)){
wrapper.in(TEmpBadRecord::getId,idList);
}
if (tEmpBadRecord.getLimitStart() >= 0 && tEmpBadRecord.getLimitEnd() >= 0){
if (tEmpBadRecord.getLimitStart() >= 0 && tEmpBadRecord.getLimitEnd() > 0){
wrapper.last(" limit "+ tEmpBadRecord.getLimitStart() +","+ tEmpBadRecord.getLimitEnd());
}
return baseMapper.selectList(wrapper);
......
......@@ -41,13 +41,18 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprCheckProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -71,6 +76,7 @@ import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@Log4j2
@EnableConfigurationProperties(DaprUpmsProperties.class)
public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMapper, TEmployeeProject> implements TEmployeeProjectService {
@Autowired
......@@ -89,6 +95,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Lazy
private DoJointTask doJointTask;
@Autowired
private DaprUpmsProperties daprUpmsProperties;
@Override
public R addCheck(TEmployeeProject tEmployeeProject) {
......@@ -354,6 +363,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String code = "";
if (Common.isNotNull(tEmployeeProject)) {
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeProject.setLeaveTime(LocalDateTime.now());
this.updateById(tEmployeeProject);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
......@@ -413,6 +423,24 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 新老项目档案List
List<EmployeeProjectNewOldVO> updateProjectList = new ArrayList<>();
// 调用字典服务,渲染字典值
R<Map<String, Map<String, Map<String, String>>>> dictR = HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId()
, "/dict/inner/getDictToLable", null, Map.class, SecurityConstants.FROM_IN);
Map<String, Map<String, Map<String, String>>> dictDataMap;
Map<String, Map<String, String>> dictMap;
// 民族
Map<String, String> empLabelMap;
if (dictR == null || dictR.getData() == null) {
return R.failed("获取字典失败!");
} else {
dictDataMap = dictR.getData();
dictMap = dictDataMap.get("data");
if (dictMap == null) {
return R.failed("获取字典失败!!");
}
empLabelMap = dictMap.get("reduce_project_reason");
}
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeXProjectVO excel = excelVOList.get(i);
......@@ -432,7 +460,14 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} else {
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeProject.setLeaveReason(excel.getLeaveReason());
// 校验字典数据是否正确-减项原因
if (Common.isNotNull(excel.getLeaveReason())) {
if (empLabelMap.get(excel.getLeaveReason()) == null) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.ARCHIVES_IMPORT_EMP_REDUCE_ERROR)));
} else {
tEmployeeProject.setLeaveReason(empLabelMap.get(excel.getLeaveReason()));
}
}
tEmployeeProject.setLeaveRemark(excel.getLeaveRemark());
tEmployeeProject.setLeaveTime(LocalDateTime.now());
updProjectList.add(tEmployeeProject);
......@@ -1087,9 +1122,13 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
@Override
public R getItemByEmpNo(String empIdcard, String empNo) {
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo, empNo));
.eq(TSettleDomain::getDepartNo, empNo)
.eq(TSettleDomain::getStopFlag, CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag, CommonConstants.ZERO_STRING));
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, empIdcard));
.eq(TEmployeeInfo::getEmpIdcard, empIdcard)
.eq(TEmployeeInfo::getFileStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
Map<String, Object> map = new HashMap<>();
String empCode = "";
if (Common.isNotNull(tEmployeeInfo)) {
......@@ -1098,7 +1137,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
String customerName = "";
if (Common.isNotNull(tSettleDomain)) {
TCustomerInfo tCustomerInfo = tCustomerInfoMapper.selectOne(Wrappers.<TCustomerInfo>query().lambda()
.eq(TCustomerInfo::getId, tSettleDomain.getCustomerId()));
.eq(TCustomerInfo::getId, tSettleDomain.getCustomerId())
.eq(TCustomerInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
if (Common.isNotNull(tCustomerInfo)) {
customerName = tCustomerInfo.getCustomerName();
}
......
......@@ -71,7 +71,7 @@
AND b.DEPT_NAME like concat('%',#{tElecEmployeeInfo.deptName},'%')
</if>
<if test="tElecEmployeeInfo.empNo != null and tElecEmployeeInfo.empNo.trim() != ''">
AND b.EMP_NO like = #{tElecEmployeeInfo.empNo}
AND b.EMP_NO = #{tElecEmployeeInfo.empNo}
</if>
<if test="tElecEmployeeInfo.deptNo != null and tElecEmployeeInfo.deptNo.trim() != ''">
AND b.DEPT_NO like concat('%',#{tElecEmployeeInfo.deptNo},'%')
......
......@@ -268,7 +268,8 @@ public interface ErrorCodes {
String ARCHIVES_IMPORT_EMP_HAVE_PROJECT = "archives.import.emp.have.project";
String ARCHIVES_IMPORT_EMP_EMAIL_CHECK = "archives.import.emp.email.check";
String ARCHIVES_IMPORT_EMP_EMAIL_LENGTH = "archives.import.emp.email.length";
// 减项原因在字典中未找到
String ARCHIVES_IMPORT_EMP_REDUCE_ERROR = "archives.import.emp.reduce.error";
/**
* 项目档案状态为已审核,禁止删除
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment