Commit df043978 authored by hongguangwu's avatar hongguangwu

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

parents f8aa486a 827b9246
...@@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
...@@ -55,25 +56,25 @@ public class FddContractAttachInfo extends BaseEntity { ...@@ -55,25 +56,25 @@ public class FddContractAttachInfo extends BaseEntity {
* 合同试用期开始时间 * 合同试用期开始时间
*/ */
@Schema(description ="合同试用期开始时间") @Schema(description ="合同试用期开始时间")
private LocalDateTime periodStart; private LocalDate periodStart;
/** /**
* 合同试用期结束时间 * 合同试用期结束时间
*/ */
@Schema(description ="合同试用期结束时间") @Schema(description ="合同试用期结束时间")
private LocalDateTime periodEnd; private LocalDate periodEnd;
/** /**
* 合同起始时间 * 合同起始时间
*/ */
@Schema(description ="合同起始时间") @Schema(description ="合同起始时间")
private LocalDateTime contractStart; private LocalDate contractStart;
/** /**
* 合同到期时间 * 合同到期时间
*/ */
@Schema(description ="合同到期时间") @Schema(description ="合同到期时间")
private LocalDateTime contractEnd; private LocalDate contractEnd;
/** /**
* 试用期工资 元/月 * 试用期工资 元/月
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.archives.entity; package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity; import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
...@@ -61,5 +62,10 @@ public class FddTemplateFieldInfo extends BaseEntity { ...@@ -61,5 +62,10 @@ public class FddTemplateFieldInfo extends BaseEntity {
@Schema(description ="模板ID") @Schema(description ="模板ID")
private String templateId; private String templateId;
/**
* 对应法大大模板字段值
*/
@Schema(description ="对应法大大模板字段值")
@TableField(exist = false)
private String fieldValue;
} }
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.entity;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
...@@ -122,5 +123,11 @@ public class TEmpBadRecord extends BaseEntity { ...@@ -122,5 +123,11 @@ public class TEmpBadRecord extends BaseEntity {
@ExcelProperty("其他损失") @ExcelProperty("其他损失")
private BigDecimal loseFeeOther; private BigDecimal loseFeeOther;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField(exist = false)
private String attaIds;
} }
...@@ -75,15 +75,15 @@ public class EmployeeExportVO extends BaseEntity { ...@@ -75,15 +75,15 @@ public class EmployeeExportVO extends BaseEntity {
@ExcelProperty(value = "邮箱") @ExcelProperty(value = "邮箱")
private String empEmail; private String empEmail;
@ExcelAttribute(name = "户籍所在省", isDataId = true, isArea = true) @ExcelAttribute(name = "户籍所在省", isArea = true)
@ExcelProperty(value = "户籍所在省") @ExcelProperty(value = "户籍所在省")
private String idProvince; private String idProvince;
@ExcelAttribute(name = "户籍所在市", isDataId = true, isArea = true, parentField = "idProvince") @ExcelAttribute(name = "户籍所在市", isArea = true, parentField = "idProvince")
@ExcelProperty(value = "户籍所在市") @ExcelProperty(value = "户籍所在市")
private String idCity; private String idCity;
@ExcelAttribute(name = "户籍所在县", isDataId = true, isArea = true, parentField = "idCity") @ExcelAttribute(name = "户籍所在县", isArea = true, parentField = "idCity")
@ExcelProperty(value = "户籍所在县") @ExcelProperty(value = "户籍所在县")
private String idTown; private String idTown;
......
...@@ -67,6 +67,11 @@ ...@@ -67,6 +67,11 @@
<version>1.8.0</version> <version>1.8.0</version>
<artifactId>fadada-java-sdk-api3</artifactId> <artifactId>fadada-java-sdk-api3</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.hutool</groupId>
<version>5.8.0</version>
<artifactId>hutool-all</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller; ...@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService; import com.yifu.cloud.plus.v1.yifu.archives.service.FddContractInfoService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
...@@ -111,4 +112,17 @@ public class FddContractInfoController { ...@@ -111,4 +112,17 @@ public class FddContractInfoController {
return R.ok(fddContractInfoService.removeById(id)); return R.ok(fddContractInfoService.removeById(id));
} }
/**
* @param fddContractInfo
* @Author: huyc
* @Date: 2022/6/30
* @Description: 发送法大大电子合同定稿任务
* @return: com.yifu.cloud.v1.common.core.util.R<java.lang.String>
**/
@Operation(summary = "发送法大大电子合同定稿任务", description = "发送法大大电子合同定稿任务")
@SysLog("发送法大大电子合同定稿任务" )
@PostMapping("/send")
public R<String> send(FddContractInfo fddContractInfo) throws ApiException {
return fddContractInfoService.saveEmpContract(fddContractInfo);
}
} }
...@@ -81,7 +81,6 @@ public class TEmployeeProjectController { ...@@ -81,7 +81,6 @@ public class TEmployeeProjectController {
return R.ok(tEmployeeProjectService.getTEmployeeProjectInfoPage(page,tEmployeeProject)); return R.ok(tEmployeeProjectService.getTEmployeeProjectInfoPage(page,tEmployeeProject));
} }
/** /**
* 通过id查询项目档案表 * 通过id查询项目档案表
* @param id id * @param id id
...@@ -142,7 +141,7 @@ public class TEmployeeProjectController { ...@@ -142,7 +141,7 @@ public class TEmployeeProjectController {
@Operation(summary = "新增项目档案校验", description = "新增项目档案校验") @Operation(summary = "新增项目档案校验", description = "新增项目档案校验")
@SysLog("新增项目档案校验" ) @SysLog("新增项目档案校验" )
@PostMapping("/check") @PostMapping("/check")
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_addcheck')" ) @PreAuthorize("@pms.hasPermission('archives_temployeeproject_add')" )
public R addCheck(@RequestBody TEmployeeProject tEmployeeProject) { public R addCheck(@RequestBody TEmployeeProject tEmployeeProject) {
return R.ok(tEmployeeProjectService.addCheck(tEmployeeProject)); return R.ok(tEmployeeProjectService.addCheck(tEmployeeProject));
} }
...@@ -176,6 +175,21 @@ public class TEmployeeProjectController { ...@@ -176,6 +175,21 @@ public class TEmployeeProjectController {
return R.ok(tEmployeeProjectService.deleteEmpPro(tEmployeeProject)); return R.ok(tEmployeeProjectService.deleteEmpPro(tEmployeeProject));
} }
/**
* 减项
* @param excelVOList
* @param bindingResult
* @Author huyc
* @Date 2022-06-20
*/
@Operation(summary = "批量减项", description = "批量减项")
@SysLog("批量减项" )
@PostMapping("/batchDeleteEmpPro")
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_batchdelempproinfo')" )
public R<List<ErrorMessage>> batchDeleteEmpPro(@RequestExcel List<EmployeeProjectVO> excelVOList, BindingResult bindingResult) {
return tEmployeeProjectService.batchDeleteEmpPro(excelVOList,bindingResult);
}
/** /**
* 批量新增项目档案信息 * 批量新增项目档案信息
* *
......
...@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -19,7 +19,9 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.fadada.api.exception.ApiException;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/** /**
* 法大大合同与员工合同信息 * 法大大合同与员工合同信息
...@@ -29,4 +31,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo; ...@@ -29,4 +31,5 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractInfo;
*/ */
public interface FddContractInfoService extends IService<FddContractInfo> { public interface FddContractInfoService extends IService<FddContractInfo> {
R<String> saveEmpContract(FddContractInfo fddContractInfo) throws ApiException;
} }
...@@ -21,6 +21,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.service; ...@@ -21,6 +21,8 @@ package com.yifu.cloud.plus.v1.yifu.archives.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
import java.util.List;
/** /**
* 法大大字段对应信息表 * 法大大字段对应信息表
* *
...@@ -28,5 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo; ...@@ -28,5 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
* @date 2022-06-28 16:24:12 * @date 2022-06-28 16:24:12
*/ */
public interface FddTemplateFieldInfoService extends IService<FddTemplateFieldInfo> { public interface FddTemplateFieldInfoService extends IService<FddTemplateFieldInfo> {
List<FddTemplateFieldInfo> getFddFields(String templateId, String type);
} }
...@@ -45,8 +45,24 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> { ...@@ -45,8 +45,24 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R reEmpInfo(JSONObject jsonObject); R reEmpInfo(JSONObject jsonObject);
/**
* @param tEmployeeProject
* @Description: 减项
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R deleteEmpPro(TEmployeeProject tEmployeeProject); R deleteEmpPro(TEmployeeProject tEmployeeProject);
/**
* @param list
* @Description: 批量减项
* @Author: huyc
* @Date: 2022/6/21 10:30
* @return: R
**/
R<List<ErrorMessage>> batchDeleteEmpPro(List<EmployeeProjectVO> list, BindingResult bindingResult);
/** /**
* @param excelVOList * @param excelVOList
* @param bindingResult * @param bindingResult
...@@ -91,7 +107,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> { ...@@ -91,7 +107,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
/** /**
* @param ids * @param ids
* @Description: 批量删除项目档案 * @Description: 批量删除项目档案
* @Author: hgw * @Author: huyc
* @Date: 2022/6/22 12:30 * @Date: 2022/6/22 12:30
* @return: R * @return: R
**/ **/
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.FddTemplateFieldInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddTemplateFieldInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.FddTemplateFieldInfoMapper;
...@@ -23,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FddTemplateFieldInfoService; ...@@ -23,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.FddTemplateFieldInfoService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 法大大字段对应信息表 * 法大大字段对应信息表
* *
...@@ -33,4 +36,17 @@ import org.springframework.stereotype.Service; ...@@ -33,4 +36,17 @@ import org.springframework.stereotype.Service;
@RequiredArgsConstructor @RequiredArgsConstructor
public class FddTemplateFieldInfoServiceImpl extends ServiceImpl<FddTemplateFieldInfoMapper, FddTemplateFieldInfo> implements FddTemplateFieldInfoService { public class FddTemplateFieldInfoServiceImpl extends ServiceImpl<FddTemplateFieldInfoMapper, FddTemplateFieldInfo> implements FddTemplateFieldInfoService {
/**
* @ClassName: com.yifu.cloud.v1.hr.basicArchives.service.impl.FddTemplateFieldInfoServiceImpl.java
* @author huyc
* @date 2022/6/30
* @Description 按模板和角色获取具体字段参数
* @param templateId: 模板ID type:0 个人角色 1 公司角色
*/
@Override
public List<FddTemplateFieldInfo> getFddFields(String templateId, String type) {
return baseMapper.selectList(Wrappers.<FddTemplateFieldInfo>query().lambda()
.eq(FddTemplateFieldInfo::getType,type)
.eq(FddTemplateFieldInfo::getTemplateId,templateId));
}
} }
...@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord; ...@@ -34,6 +34,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpBadRecord;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpWorkRecording;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject; import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpBadRecordMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmpBadRecordMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
...@@ -66,7 +67,7 @@ import java.util.List; ...@@ -66,7 +67,7 @@ import java.util.List;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, TEmpBadRecord> implements TEmpBadRecordService { public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, TEmpBadRecord> implements TEmpBadRecordService {
private final TAttaInfoMapper attaInfoMapper;
private final TEmployeeInfoMapper employeeInfoMapper; private final TEmployeeInfoMapper employeeInfoMapper;
private final TEmployeeProjectMapper projectMapper; private final TEmployeeProjectMapper projectMapper;
...@@ -128,7 +129,17 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T ...@@ -128,7 +129,17 @@ public class TEmpBadRecordServiceImpl extends ServiceImpl<TEmpBadRecordMapper, T
@Override @Override
public R<Boolean> saveDiy(TEmpBadRecord tEmpBadRecord) { public R<Boolean> saveDiy(TEmpBadRecord tEmpBadRecord) {
return R.ok(baseMapper.insert(tEmpBadRecord) > 0); int res = baseMapper.insert(tEmpBadRecord);
if (res < 0){
return R.failed();
}
//更新附件信息
List<String> ids;
if (Common.isNotNull(tEmpBadRecord.getAttaIds())){
ids = Common.initStrToList(tEmpBadRecord.getAttaIds(),CommonConstants.COMMA_STRING);
attaInfoMapper.updateDomainId(tEmpBadRecord.getId(),ids);
}
return R.ok();
} }
private void importEmpBadRecord(List<EmpBadRecordVo> excelVOList, List<ErrorMessage> errorMessageList) { private void importEmpBadRecord(List<EmpBadRecordVo> excelVOList, List<ErrorMessage> errorMessageList) {
......
...@@ -189,7 +189,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -189,7 +189,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeProject::getEmpId,tEmployeeProject.getEmpId()) .eq(TEmployeeProject::getEmpId,tEmployeeProject.getEmpId())
.eq(TEmployeeProject::getProjectStatus,CommonConstants.dingleDigitIntArray[0])); .eq(TEmployeeProject::getProjectStatus,CommonConstants.dingleDigitIntArray[0]));
if (count.compareTo(CommonConstants.DEPT_TREE_ROOT_ID) >0) { if (count.compareTo(CommonConstants.DEPT_TREE_ROOT_ID) >0) {
return R.failed("该人员存在其他进行中的项目,禁止同步减档!"); return R.failed("人员在该项目下存在进行中/未完结的服务");
} }
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]); tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfoMapper.updateById(tEmployeeInfo); tEmployeeInfoMapper.updateById(tEmployeeInfo);
...@@ -203,6 +203,60 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -203,6 +203,60 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed("传参为空!"); return R.failed("传参为空!");
} }
@Override
public R<List<ErrorMessage>> batchDeleteEmpPro(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult) {
// 通用校验获取失败的数据
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
Map<Long,ErrorMessage> errorMsgMap = new HashMap<>();
if (Common.isNotNull(errorMessageList)){
errorMessageList.stream().forEach(errorMessage -> errorMsgMap.put(errorMessage.getLineNum(),errorMessage));
}
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
EmployeeProjectVO excel = excelVOList.get(i);
Set<String> errorMsg = new HashSet<>();
// 已有验证报错直接下一个
if (Common.isNotNull(errorMsgMap.get(i + 2))) {
continue;
}
//根据身份证和项目编码获取项目档案
TEmployeeProject tEmployeeProject = this.getOne(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpIdcard, excel.getEmpIdcard())
.eq(TEmployeeProject::getDeptNo, excel.getDeptNo())
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL));
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
TEmployeeProject tEmployeeProjectOld = this.getById(tEmployeeProject.getId());
if (Common.isNotNull(tEmployeeProject)) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getIsLeaveEmployee() == CommonConstants.dingleDigitIntArray[1]) {
Long count = this.count(Wrappers.<TEmployeeProject>query().lambda()
.eq(TEmployeeProject::getEmpId, tEmployeeProject.getEmpId())
.eq(TEmployeeProject::getProjectStatus, CommonConstants.dingleDigitIntArray[0]));
if (count.compareTo(CommonConstants.DEPT_TREE_ROOT_ID) > 0) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.ARCHIVES_PROJECT_CHANGE_NOT_EXIST));
}
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
}
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
this.updateById(tEmployeeProject);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(), "", tEmployeeProjectOld, tEmployeeInfo);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProject.getId(), tEmployeeInfoOld, tEmployeeProject);
}
if (!CollUtil.isEmpty(errorMsg)) {
errorMessageList.add(new ErrorMessage((long) (i + 2), errorMsg));
}
}
if (CollUtil.isNotEmpty(errorMessageList)) {
return R.failed(errorMessageList);
}
return R.ok();
}
/** /**
* 新增档案操作记录 * 新增档案操作记录
* @param excelVOList * @param excelVOList
...@@ -228,6 +282,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -228,6 +282,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
// 获取身份证、手机号列表,批量查询档案 // 获取身份证、手机号列表,批量查询档案
Map<String, Integer> idCardMap = new HashMap<>(); Map<String, Integer> idCardMap = new HashMap<>();
String idCard; String idCard;
String deptNo;
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
...@@ -240,10 +295,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -240,10 +295,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
idCard = excel.getEmpIdcard(); idCard = excel.getEmpIdcard();
if (idCardMap.get(idCard) != null) { deptNo = excel.getDeptNo();
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号与第" + idCardMap.get(idCard) + "行重复!")); if (idCardMap.get(idCard.concat(deptNo)) != null) {
errorMsgMap.put((i + 2L), new ErrorMessage("第" + (i + 2) + "行身份证号+项目编码与第" + idCardMap.get(idCard) + "行重复!"));
} else { } else {
idCardMap.put(idCard, i + 2); idCardMap.put(idCard.concat(deptNo), i + 2);
} }
//根据身份证获取人员档案 //根据身份证获取人员档案
...@@ -734,7 +790,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -734,7 +790,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_STRING) .eq(TEmployeeProject::getProjectStatus,CommonConstants.ZERO_STRING)
.eq(TEmployeeProject::getEmpIdcard,empIdCard)); .eq(TEmployeeProject::getEmpIdcard,empIdCard));
Map<String,String> projectMap = new HashMap<>(); Map<String,String> projectMap = new HashMap<>();
if (Common.isEmpty(projects)){ if (Common.isNotNull(projects)){
for (TEmployeeProject project:projects){ for (TEmployeeProject project:projects){
projectMap.put(project.getDeptName(),project.getDeptNo()); projectMap.put(project.getDeptName(),project.getDeptNo());
} }
......
...@@ -283,4 +283,8 @@ public interface ErrorCodes { ...@@ -283,4 +283,8 @@ public interface ErrorCodes {
* 对应项目编码无项目档案信息,请核实后导入 * 对应项目编码无项目档案信息,请核实后导入
*/ */
String ARCHIVES_PROJECT_EMP_NOT_EXIST = "archives.project.emp.not.exist"; String ARCHIVES_PROJECT_EMP_NOT_EXIST = "archives.project.emp.not.exist";
/**
* 人员在该项目下存在进行中/未完结的服务
*/
String ARCHIVES_PROJECT_CHANGE_NOT_EXIST = "archives.project.change.not.exist";
} }
...@@ -39,6 +39,8 @@ public class ExcelUtil <T> implements Serializable { ...@@ -39,6 +39,8 @@ public class ExcelUtil <T> implements Serializable {
private Field[] fields; private Field[] fields;
public void convertEntity(T vo, String[] exportFields, Map<String,String> diyDicMap, String dateFormat) { public void convertEntity(T vo, String[] exportFields, Map<String,String> diyDicMap, String dateFormat) {
String provinceTemp;
String cityTemp;
// 得到所有定义字段 // 得到所有定义字段
Field[] allFields = clazz.getDeclaredFields(); Field[] allFields = clazz.getDeclaredFields();
List<Field> fields = new ArrayList<>(); List<Field> fields = new ArrayList<>();
...@@ -129,12 +131,7 @@ public class ExcelUtil <T> implements Serializable { ...@@ -129,12 +131,7 @@ public class ExcelUtil <T> implements Serializable {
} }
} else if (attr.isArea()){ } else if (attr.isArea()){
//区域字段处理 TODO //区域字段处理 TODO
if (!Common.isNotNull(attr.parentField())) { value = getAreaLabel("area_"+field.get(vo));
value = getAreaLabel("area_"+field.get(vo) + "_0", attr);
} else {
// TODO
value = getAreaLabel("area_"+field.get(vo)+ "_" + getFieldValueByName(attr.parentField(), vo, null), attr);
}
} }
field.set(vo, Common.isNotNull(value)?value:field.get(vo)); field.set(vo, Common.isNotNull(value)?value:field.get(vo));
}catch (Exception e){ }catch (Exception e){
...@@ -224,6 +221,7 @@ public class ExcelUtil <T> implements Serializable { ...@@ -224,6 +221,7 @@ public class ExcelUtil <T> implements Serializable {
String tempStr = ""; String tempStr = "";
ErrorMessage errorTemp = null; ErrorMessage errorTemp = null;
errorMessageHashMap = new HashMap<>(); errorMessageHashMap = new HashMap<>();
Map<String,Field> mapArea = new HashMap<>();
// 参数校验 // 参数校验
ExcelAttribute attr = null; ExcelAttribute attr = null;
try{ try{
...@@ -272,45 +270,49 @@ public class ExcelUtil <T> implements Serializable { ...@@ -272,45 +270,49 @@ public class ExcelUtil <T> implements Serializable {
tempStr = dicMap.get(attr.dataType() + "_" + c.trim()); tempStr = dicMap.get(attr.dataType() + "_" + c.trim());
}*/ }*/
} else { }
if (attr.isArea()) { }else {
//区域字段处理 TODO if (attr.isArea()) {
if (!Common.isNotNull(attr.parentField())) { //区域字段处理 TODO
tempStr = getAreaValue("area_"+c.trim(), tempStr, attr,rowNum,errorTemp); if (!Common.isNotNull(attr.parentField())) {
} else { tempStr = getAreaValue("area_"+c.trim(), tempStr, attr,rowNum,errorTemp);
// TODO
tempStr = getAreaValue("area_"+c.trim()+ "_" + getFieldValueByName(attr.parentField(), data, DateUtil.ISO_EXPANDED_DATE_FORMAT), tempStr, attr,rowNum,errorTemp);
}
} else { } else {
//直接按值去找数据 TODO // TODO
tempStr = getDicValue(c.trim() , tempStr, attr,rowNum,errorTemp); tempStr = getAreaValue("area_"+c.trim()+ "_" + getFieldValueByName(attr.parentField(), data, DateUtil.ISO_EXPANDED_DATE_FORMAT), tempStr, attr,rowNum,errorTemp);
} }
} else {
//直接按值去找数据 TODO
tempStr = getDicValue(c.trim() , tempStr, attr,rowNum,errorTemp);
} }
if (!StringUtils.isNotBlank(tempStr)) { }
if (attr.isOrgan()) { if (!StringUtils.isNotBlank(tempStr)) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的单位或结算主体数据,请确认存在结算主体权限"), errorTemp); if (attr.isOrgan()) {
} errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的单位或结算主体数据,请确认存在结算主体权限"), errorTemp);
if (attr.isArea()) { }
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的区域数据"), errorTemp); if (attr.isArea()) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的区域数据"), errorTemp);
} else {
if (Common.isNotNull(attr.errorInfoImport())) {
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "数据'" + c + "':" + attr.errorInfoImport()), errorTemp);
} else { } else {
if (Common.isNotNull(attr.errorInfoImport())) { errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的字典数据"), errorTemp);
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "数据'" + c + "':" + attr.errorInfoImport()), errorTemp);
} else {
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, "未找到:" + c + "的字典数据"), errorTemp);
}
} }
continue;
}
if (Common.isNotNull(tempStr)){
c = tempStr;
} }
continue;
}
if (Common.isNotNull(tempStr)){
c = tempStr;
mapArea.put(tempStr,field);
} }
// 取得类型,并根据对象类型设置值. // 取得类型,并根据对象类型设置值.
fieldType = field.getType(); fieldType = field.getType();
if (fieldType == null) { if (fieldType == null) {
continue; continue;
} }
if (String.class == fieldType) { if (attr.isArea()){
// 区域字段单独处理
continue;
}else if (String.class == fieldType) {
field.set(data, c); field.set(data, c);
} else if (BigDecimal.class == fieldType) { } else if (BigDecimal.class == fieldType) {
c = c.indexOf('%') != -1 ? c.replace("%", "") : c; c = c.indexOf('%') != -1 ? c.replace("%", "") : c;
...@@ -363,6 +365,11 @@ public class ExcelUtil <T> implements Serializable { ...@@ -363,6 +365,11 @@ public class ExcelUtil <T> implements Serializable {
} }
} }
} }
if (Common.isNotNull(mapArea)){
for (Map.Entry<String, Field> entry: mapArea.entrySet()){
entry.getValue().set(data,entry.getKey());
}
}
}catch (Exception e){ }catch (Exception e){
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常,请联系管理人员"), errorTemp); errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常,请联系管理人员"), errorTemp);
}finally { }finally {
...@@ -432,12 +439,12 @@ public class ExcelUtil <T> implements Serializable { ...@@ -432,12 +439,12 @@ public class ExcelUtil <T> implements Serializable {
} }
return propertyValue; return propertyValue;
} }
private String getAreaLabel(String c, ExcelAttribute attr) { private String getAreaLabel(String c) {
return (String)RedisUtil.redis.opsForValue().get(c); return (String)RedisUtil.redis.opsForValue().get(c);
} }
private String getAreaValue(String c, String tempStr, ExcelAttribute attr,Integer rowNum, ErrorMessage errorTemp) { private String getAreaValue(String c, String tempStr, ExcelAttribute attr,Integer rowNum, ErrorMessage errorTemp) {
tempStr = (String)RedisUtil.redis.opsForValue().get(c); tempStr = String.valueOf(RedisUtil.redis.opsForValue().get(c));
if (Common.isEmpty(tempStr)){ if (Common.isEmpty(tempStr)){
errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常,请联系管理人员"), errorTemp); errorMessageHashMap = initErrorMessage(errorMessageHashMap, new ErrorMessage(rowNum, attr.name() + ":" + c.trim() + "校验异常,请联系管理人员"), errorTemp);
return CommonConstants.EMPTY_STRING; return CommonConstants.EMPTY_STRING;
......
...@@ -87,6 +87,7 @@ import.file.type.error=\u5BFC\u5165\u7684\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u7 ...@@ -87,6 +87,7 @@ import.file.type.error=\u5BFC\u5165\u7684\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u7
archives.project.emp.not.exist=\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u65E0\u9879\u76EE\u6863\u6848\u4FE1\u606F\uFF0C\u8BF7\u6838\u5B9E\u540E\u5BFC\u5165 archives.project.emp.not.exist=\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u65E0\u9879\u76EE\u6863\u6848\u4FE1\u606F\uFF0C\u8BF7\u6838\u5B9E\u540E\u5BFC\u5165
archives.project.change.not.exist=\u4EBA\u5458\u5728\u8BE5\u9879\u76EE\u4E0B\u5B58\u5728\u8FDB\u884C\u4E2D/\u672A\u5B8C\u7ED3\u7684\u670D\u52A1
......
...@@ -49,15 +49,13 @@ public class DictItemRedisInit { ...@@ -49,15 +49,13 @@ public class DictItemRedisInit {
if (Common.isNotNull(allAreas)){ if (Common.isNotNull(allAreas)){
Map<String,SysArea> areaMap = new HashMap<>(); Map<String,SysArea> areaMap = new HashMap<>();
for (SysArea area:allAreas){ for (SysArea area:allAreas){
redisUtil.set("area_" + area.getId() redisUtil.set("area_" + area.getId(),area.getAreaName());
+ CommonConstants.DOWN_LINE_STRING
+(Common.isEmpty(area.getParentId())?"0":area.getParentId()),area.getAreaName());
areaMap.put(area.getId().toString(),area); areaMap.put(area.getId().toString(),area);
} }
SysArea temp; SysArea temp;
for (SysArea area:allAreas){ for (SysArea area:allAreas){
if (Common.isNotNull(area.getParentId()) && area.getParentId().intValue() > 0){ if (Common.isNotNull(area.getParentId()) && area.getParentId().intValue() > 0){
temp = areaMap.get(area.getParentId()); temp = areaMap.get(area.getParentId().toString());
redisUtil.set("area_" + area.getAreaName() redisUtil.set("area_" + area.getAreaName()
+ CommonConstants.DOWN_LINE_STRING + CommonConstants.DOWN_LINE_STRING
+(Common.isNotNull(temp)?temp.getAreaName():""),area.getId()); +(Common.isNotNull(temp)?temp.getAreaName():""),area.getId());
......
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