Commit db6a016f authored by hongguangwu's avatar hongguangwu

MVP1.6.6-预入职相关_先删后加

parent 158a6764
...@@ -1313,17 +1313,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1313,17 +1313,19 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (attaList != null) { if (attaList != null) {
// 先删除其他信息 // 先删除其他信息
tAttaInfoService.deleteByDomainId(empId); tAttaInfoService.deleteByDomainId(empId);
TAttaInfo attaEmp;
List<TAttaInfo> attaEmpList = new ArrayList<>();
for (TAttaInfo atta : attaList) { for (TAttaInfo atta : attaList) {
if (Common.isEmpty(atta.getDomainId())) { attaEmp = new TAttaInfo();
atta.setDomainId(empId); BeanUtil.copyProperties(atta, attaEmp, ID);
if (Common.isNotNull(atta.getCreateBy())) { attaEmp.setDomainId(empId);
atta.setCreateBy(user.getId()); attaEmp.setCreateBy(user.getId());
atta.setCreateName(user.getNickname()); attaEmp.setCreateName(user.getNickname());
atta.setCreateTime(LocalDateTime.now()); attaEmp.setCreateTime(LocalDateTime.now());
} attaEmpList.add(attaEmp);
}
} }
tAttaInfoService.saveOrUpdateBatch(attaList); tAttaInfoService.saveOrUpdateBatch(attaList);
tAttaInfoService.saveBatch(attaEmpList);
} }
return R.ok("成功!"); return R.ok("成功!");
} }
......
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