Commit b169d734 authored by huyuchen's avatar huyuchen

huych-入职登记提交

parent a8e96132
......@@ -228,8 +228,104 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
.last(CommonConstants.LAST_ONE_SQL));
EmployeeRegistrationPre pre = new EmployeeRegistrationPre();
BeanUtils.copyProperties(preVo,pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
String natureItemBefore = null;
String natureItemAfter = null;
String contractItemBefore = null;
String contractItemAfter = null;
String contractXfBefore = null;
String contractXfAfter = null;
if (!preExit.getContractType().equals(pre.getContractType())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(preExit.getContractType())){
contractItemBefore = entry.getValue();
}
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(pre.getContractType())){
contractItemAfter = entry.getValue();
}
if (null != contractItemBefore && null != contractItemAfter) {
break;
}
}
}
if (!preExit.getEmpNature().equals(pre.getEmpNature())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "emp_natrue");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(preExit.getEmpNature())){
natureItemBefore = entry.getValue();
}
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(pre.getEmpNature())){
natureItemAfter = entry.getValue();
}
if (null != natureItemAfter && null != natureItemBefore) {
break;
}
}
}
if (null != preExit.getContractSubName() && null == pre.getContractSubName()) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type_sub");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(preExit.getContractSubName())){
contractXfBefore = entry.getValue();
break;
}
}
}
if (null == preExit.getContractSubName() && null != pre.getContractSubName()) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type_sub");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(pre.getContractSubName())){
contractXfAfter = entry.getValue();
break;
}
}
}
if (null != preExit.getContractSubName() && null != pre.getContractSubName()
&& !preExit.getContractSubName().equals(pre.getContractSubName())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type_sub");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(preExit.getContractSubName())){
contractXfBefore = entry.getValue();
}
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(pre.getContractSubName())){
contractXfAfter = entry.getValue();
}
if (null != contractXfBefore && null != contractXfAfter) {
break;
}
}
}
if (null != natureItemBefore) {
preExit.setEmpNature(natureItemBefore);
}
if (null != natureItemAfter) {
pre.setEmpNature(natureItemAfter);
}
if (null != contractItemBefore) {
preExit.setContractType(contractItemBefore);
}
if (null != contractItemAfter) {
pre.setContractType(contractItemAfter);
}
if (null != contractXfBefore) {
preExit.setContractSubName(contractXfBefore);
}
if (null != contractXfAfter) {
pre.setContractSubName(contractXfAfter);
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[4],
pre.getId().toString(), "", preExit, pre);
baseMapper.deleteById(preExit);
// if (Common.isNotNull(preVo.getServerItem())) {
// pre.setServerItem(preVo.getServerItem());
......@@ -268,9 +364,6 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
// pre.setContractSubName(null);
// }
}
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
baseMapper.insert(pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
// 事务提交后触发调度
......@@ -328,6 +421,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
String natureItemAfter = null;
String contractItemBefore = null;
String contractItemAfter = null;
String contractXfBefore = null;
String contractXfAfter = null;
if (!comparePre.getContractType().equals(employeeRegistrationPre.getContractType())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
......@@ -358,6 +453,42 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
}
}
if (null != comparePre.getContractSubName() && null == employeeRegistrationPre.getContractSubName()) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type_sub");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractSubName())){
contractXfBefore = entry.getValue();
break;
}
}
}
if (null == comparePre.getContractSubName() && null != employeeRegistrationPre.getContractSubName()) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type_sub");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractSubName())){
contractXfAfter = entry.getValue();
break;
}
}
}
if (null != comparePre.getContractSubName() && null != employeeRegistrationPre.getContractSubName()
&& !comparePre.getContractSubName().equals(employeeRegistrationPre.getContractSubName())) {
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type_sub");
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(comparePre.getContractSubName())){
contractXfBefore = entry.getValue();
}
if (Common.isNotNull(entry.getKey()) && entry.getKey().equals(employeeRegistrationPre.getContractSubName())){
contractXfAfter = entry.getValue();
}
if (null != contractXfBefore && null != contractXfAfter) {
break;
}
}
}
YifuUser user = SecurityUtils.getUser();
try {
updatePre.setServerItem(employeeRegistrationPre.getServerItem());
......@@ -366,6 +497,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
updatePre.setFileProvince(employeeRegistrationPre.getFileProvince());
updatePre.setFileCity(employeeRegistrationPre.getFileCity());
updatePre.setFileTown(employeeRegistrationPre.getFileTown());
updatePre.setContractSubName(null == employeeRegistrationPre.getContractSubName() ? "" : employeeRegistrationPre.getContractSubName());
baseMapper.updateById(employeeRegistrationPre);
if (null != natureItemBefore) {
comparePre.setEmpNature(natureItemBefore);
......@@ -379,6 +511,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (null != contractItemAfter) {
employeeRegistrationPre.setContractType(contractItemAfter);
}
if (null != contractXfBefore) {
comparePre.setContractSubName(contractXfBefore);
}
if (null != contractXfAfter) {
employeeRegistrationPre.setContractSubName(contractXfAfter);
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[4],
employeeRegistrationPre.getId().toString(), "", comparePre, employeeRegistrationPre,user);
} catch (Exception e) {
......
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