Commit db6a016f authored by hongguangwu's avatar hongguangwu

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

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