Commit d1666c63 authored by fangxinjiang's avatar fangxinjiang

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

parents 43bca193 b6b15833
...@@ -20,7 +20,6 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -20,7 +20,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.Set;
/** /**
* 封装-返回给前端的错误信息-简化版 * 封装-返回给前端的错误信息-简化版
...@@ -36,11 +35,8 @@ public class ErrorVO implements Serializable { ...@@ -36,11 +35,8 @@ public class ErrorVO implements Serializable {
@Schema(description = "行号") @Schema(description = "行号")
private int lineNum; private int lineNum;
@Schema(description = "员工姓名") @Schema(description = "唯一的名称(例如:合同的申请编码)")
private String empName; private String mainName;
@Schema(description = "身份证号")
private String empIdCard;
@Schema(description = "结果:0错误;1正确(例如:是否允许删除:0否;1是)") @Schema(description = "结果:0错误;1正确(例如:是否允许删除:0否;1是)")
private int result; private int result;
......
...@@ -72,4 +72,13 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac ...@@ -72,4 +72,13 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
**/ **/
String getMaxContractCode(); String getMaxContractCode();
/**
* @param applyNo
* @Description: 查询编码是否已存在
* @Author: hgw
* @Date: 2022/7/5 9:37
* @return: java.lang.String
**/
String getContractByApplyNo(@Param("applyNo") String applyNo);
} }
...@@ -54,9 +54,7 @@ import java.io.InputStream; ...@@ -54,9 +54,7 @@ import java.io.InputStream;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 员工合同 * 员工合同
...@@ -308,6 +306,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -308,6 +306,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
} }
} }
if (Common.isEmpty(tEmployeeContractInfo.getId())) { if (Common.isEmpty(tEmployeeContractInfo.getId())) {
// 针对编码再做一次重复性校验
String isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo());
if (Common.isNotNull(isCur)) {
String code = this.getCode();
isCur = baseMapper.getContractByApplyNo(tEmployeeContractInfo.getApplyNo());
if (Common.isNotNull(isCur)) {
return false;
}
tEmployeeContractInfo.setApplyNo(code);
}
baseMapper.insert(tEmployeeContractInfo); baseMapper.insert(tEmployeeContractInfo);
if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) { if (Common.isNotNull(tEmployeeContractInfo.getAttaList()) && Common.isNotNull(tEmployeeContractInfo.getId())) {
List<String> attaList = tEmployeeContractInfo.getAttaList(); List<String> attaList = tEmployeeContractInfo.getAttaList();
...@@ -434,8 +442,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -434,8 +442,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo == null) { if (contractInfo == null) {
errorVo.setErrorInfo(EmployeeContractConstants.NO_INFO); errorVo.setErrorInfo(EmployeeContractConstants.NO_INFO);
} else { } else {
errorVo.setEmpName(contractInfo.getEmpName()); errorVo.setMainName(contractInfo.getApplyNo());
errorVo.setEmpIdCard(contractInfo.getEmpIdcard());
if (!user.getId().equals(contractInfo.getCreateBy())) { if (!user.getId().equals(contractInfo.getCreateBy())) {
errorVo.setErrorInfo(EmployeeContractConstants.NOT_CREATE_USER); errorVo.setErrorInfo(EmployeeContractConstants.NOT_CREATE_USER);
} else if (contractInfo.getAuditStatus() != CommonConstants.ZERO_INT } else if (contractInfo.getAuditStatus() != CommonConstants.ZERO_INT
...@@ -571,7 +578,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -571,7 +578,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeContractConstants.NO_INFO)); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeContractConstants.NO_INFO));
} }
} else { } else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), EmployeeContractConstants.NO_INFO)); errorMessageList.add(new ErrorMessage(CommonConstants.ZERO_INT, EmployeeContractConstants.NO_INFO));
} }
} }
} }
...@@ -717,7 +724,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -717,7 +724,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
try { try {
ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class); ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class);
for (EmployeeContractExportVO vo : list) { for (EmployeeContractExportVO vo : list) {
util.convertEntity(vo,null,null,null); util.convertEntity(vo, null, null, null);
} }
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
...@@ -756,7 +763,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -756,7 +763,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
try { try {
ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class); ExcelUtil<EmployeeContractExportVO> util = new ExcelUtil<>(EmployeeContractExportVO.class);
for (EmployeeContractExportVO vo : list) { for (EmployeeContractExportVO vo : list) {
util.convertEntity(vo,null,null,null); util.convertEntity(vo, null, null, null);
} }
out = response.getOutputStream(); out = response.getOutputStream();
response.setContentType("multipart/form-data"); response.setContentType("multipart/form-data");
......
...@@ -109,6 +109,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -109,6 +109,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed("姓名和身份证不一致,请确认后再次新增"); return R.failed("姓名和身份证不一致,请确认后再次新增");
} }
} }
//项目编码校验
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo,tEmployeeProject.getDeptNo())
.eq(TSettleDomain::getStopFlag,CommonConstants.ZERO_STRING)
.eq(TSettleDomain::getDeleteFlag,CommonConstants.ZERO_STRING));
if (Common.isEmpty(tSettleDomain)) {
return R.failed("未找到对应的项目,请核实");
}
//项目状态为已减项 //项目状态为已减项
if (CommonConstants.dingleDigitIntArray[1] == employeeProject.getProjectStatus()) { if (CommonConstants.dingleDigitIntArray[1] == employeeProject.getProjectStatus()) {
if (!Common.isEmpty(tEmployeeInfo)) { if (!Common.isEmpty(tEmployeeInfo)) {
......
...@@ -174,6 +174,35 @@ ...@@ -174,6 +174,35 @@
a.REASON, a.REASON,
a.AUDIT_TIME_LAST a.AUDIT_TIME_LAST
</sql>
<!-- 导出 -->
<sql id="Base_Export_Column_List">
a.APPLY_NO,
a.EMP_NO,
a.EMP_NAME,
a.EMP_IDCARD,
a.CONTRACT_START,
a.CONTRACT_END,
a.FILE_PROVINCE,
a.FILE_CITY,
a.FILE_TOWN,
a.SUBJECT_DEPART,
a.DEPT_NO,
a.EMP_NATRUE,
a.CONTRACT_NAME,
a.CONTRACT_SUB_NAME,
a.SITUATION,
a.CONTRACT_TYPE,
a.CONTRACT_PARTY,
a.SUBJECT_UNIT,
a.AUDIT_STATUS,
a.IN_USE,
if(a.IS_FILE = 0,'有附件','无附件') FILES,
a.IS_FILE,
a.CREATE_NAME,
a.CREATE_TIME
</sql> </sql>
<sql id="tEmployeeContractInfo_where"> <sql id="tEmployeeContractInfo_where">
<if test="tEmployeeContractInfo != null"> <if test="tEmployeeContractInfo != null">
...@@ -351,6 +380,7 @@ ...@@ -351,6 +380,7 @@
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
</where> </where>
order by a.CREATE_TIME desc
</select> </select>
<!--list--> <!--list-->
...@@ -362,28 +392,36 @@ ...@@ -362,28 +392,36 @@
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
</where> </where>
order by a.CREATE_TIME desc
</select> </select>
<!--导出--> <!--导出-->
<select id="getTEmployeeContractExport" resultMap="tEmployeeContrctInfoExportMap"> <select id="getTEmployeeContractExport" resultMap="tEmployeeContrctInfoExportMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Export_Column_List"/>
FROM t_employee_contract_info a FROM t_employee_contract_info a
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
</where> </where>
order by a.CREATE_TIME desc
</select> </select>
<!--导出历史合并--> <!--导出历史合并-->
<select id="getTEmployeeContractExportHistory" resultMap="tEmployeeContrctInfoExportMap"> <select id="getTEmployeeContractExportHistory" resultMap="tEmployeeContrctInfoExportMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Export_Column_List"/>
,count(1) CREATE_NUM,
min(a.CONTRACT_START) START_DATE,
max(a.CONTRACT_END) END_DATE,
GROUP_CONCAT(concat(a.CONTRACT_START,'~',ifnull(a.CONTRACT_END,'')) ORDER BY a.CONTRACT_START asc) HISTORY
FROM t_employee_contract_info a FROM t_employee_contract_info a
<where> <where>
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null
<include refid="tEmployeeContractInfo_where"/> <include refid="tEmployeeContractInfo_where"/>
</where> </where>
GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN
order by a.CREATE_TIME desc
</select> </select>
<!--tEmployeeContractInfo简单分页查询--> <!--tEmployeeContractInfo简单分页查询-->
...@@ -407,4 +445,9 @@ ...@@ -407,4 +445,9 @@
SELECT ifnull(max(right(e.APPLY_NO,5)),0) APPLY_NO FROM t_employee_contract_info e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d') SELECT ifnull(max(right(e.APPLY_NO,5)),0) APPLY_NO FROM t_employee_contract_info e where e.DELETE_FLAG = 0 and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
</select> </select>
<!-- 根据编码获取数据 -->
<select id="getContractByApplyNo" resultType="java.lang.String">
SELECT e.id FROM t_employee_contract_info e where e.APPLY_NO = #{applyNo}
</select>
</mapper> </mapper>
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