Commit 058daa9c authored by hongguangwu's avatar hongguangwu

编码优化

parent 09de76ba
...@@ -55,4 +55,12 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac ...@@ -55,4 +55,12 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
int updateInUseStatusById(@Param("empId")String empId, @Param("deptId")String deptId int updateInUseStatusById(@Param("empId")String empId, @Param("deptId")String deptId
, @Param("id")String id, @Param("status")String status); , @Param("id")String id, @Param("status")String status);
/**
* @Description: 获取当日合同最大编码
* @Author: hgw
* @Date: 2022/7/1 15:03
* @return: java.lang.String
**/
String getMaxContractCode();
} }
...@@ -65,4 +65,12 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> { ...@@ -65,4 +65,12 @@ public interface TEmployeeInfoMapper extends BaseMapper<TEmployeeInfo> {
*/ */
List<EmployeeExportVO> getTEmployeeLeaveExportList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo); List<EmployeeExportVO> getTEmployeeLeaveExportList(@Param("tEmployeeInfo") TEmployeeInfo tEmployeeInfo);
/**
* @Description: 获取当日最大的编码
* @Author: hgw
* @Date: 2022/7/1 14:57
* @return: java.lang.String
**/
String getMaxEmpCode();
} }
...@@ -213,6 +213,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -213,6 +213,15 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (Common.isNotNull(nowNumObj)) { if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj; SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1; nowNums = (Integer) value.get() + 1;
} else {
String empCode = null;
try {
empCode = baseMapper.getMaxContractCode();
nowNums = Integer.parseInt(empCode) + 1;
} catch (NumberFormatException e) {
log.error("获取人员合同当日最大编码时出错:" + empCode);
nowNums = 1;
}
} }
cache.put(nowDay, nowNums); cache.put(nowDay, nowNums);
return "HT" + nowDay + this.getFourNum(String.valueOf(nowNums)); return "HT" + nowDay + this.getFourNum(String.valueOf(nowNums));
......
...@@ -777,6 +777,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -777,6 +777,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
} }
saveEmp.setEmpName(excel.getEmpName()); saveEmp.setEmpName(excel.getEmpName());
saveEmp.setEmpIdcard(excel.getEmpIdcard()); saveEmp.setEmpIdcard(excel.getEmpIdcard());
saveEmp.setEmpPhone(excel.getEmpPhone());
// 校验手机号 // 校验手机号
checkPhone = new TEmployeeInfo(); checkPhone = new TEmployeeInfo();
...@@ -932,6 +933,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -932,6 +933,9 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(excel.getRemark())) { if (Common.isNotNull(excel.getRemark())) {
saveEmp.setRemark(excel.getRemark()); saveEmp.setRemark(excel.getRemark());
} }
if (Common.isNotNull(excel.getPost())) {
saveEmp.setPost(excel.getPost());
}
this.setBaseData(saveEmp, CommonConstants.dingleDigitStrArray[4], user); this.setBaseData(saveEmp, CommonConstants.dingleDigitStrArray[4], user);
saveList.add(saveEmp); saveList.add(saveEmp);
} }
...@@ -1031,6 +1035,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -1031,6 +1035,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
if (Common.isNotNull(nowNumObj)) { if (Common.isNotNull(nowNumObj)) {
SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj; SimpleValueWrapper value = (SimpleValueWrapper) nowNumObj;
nowNums = (Integer) value.get() + 1; nowNums = (Integer) value.get() + 1;
} else {
String empCode = null;
try {
empCode = baseMapper.getMaxEmpCode();
nowNums = Integer.parseInt(empCode) + 1;
} catch (NumberFormatException e) {
log.error("获取人员档案当日最大编码时出错:" + empCode);
nowNums = 1;
}
} }
cache.put(nowDay, nowNums); cache.put(nowDay, nowNums);
return "ZM" + nowDay + this.getFiveNum(String.valueOf(nowNums)); return "ZM" + nowDay + this.getFiveNum(String.valueOf(nowNums));
......
...@@ -321,4 +321,9 @@ ...@@ -321,4 +321,9 @@
where EMP_ID = #{empId} and SETTLE_DOMAIN = #{deptId} and ID != #{id} where EMP_ID = #{empId} and SETTLE_DOMAIN = #{deptId} and ID != #{id}
</update> </update>
<!-- 获取当日最大的编码 -->
<select id="getMaxContractCode" resultType="java.lang.String">
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>
</mapper> </mapper>
...@@ -556,4 +556,9 @@ ...@@ -556,4 +556,9 @@
GROUP BY a.id GROUP BY a.id
</select> </select>
<!-- 获取当日最大的编码 -->
<select id="getMaxEmpCode" resultType="java.lang.String">
SELECT ifnull(max(right(e.EMP_CODE,5)),0) EMP_CODE FROM t_employee_info e where e.DELETE_FLAG = '0' and e.CREATE_TIME>DATE_FORMAT(now(),'%Y-%m-%d')
</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