|
|
|
@ -326,9 +326,16 @@ public class DangerSourceServiceImpl extends BaseServiceImpl<DangerSourceMapper,
|
|
|
|
|
public Boolean importDangerSource(HazardInstanceDTO req) { |
|
|
|
|
List<DangerSourceEntity> sourceList = req.getHazardList().stream().map(h -> { |
|
|
|
|
DangerSourceEntity result = JSONObject.parseObject(JSON.toJSONString(h), DangerSourceEntity.class); |
|
|
|
|
result.setId(null); |
|
|
|
|
result.setLibraryId(h.getId()); |
|
|
|
|
result.setRefDept(req.getDeptId()); |
|
|
|
|
result.setRefDeptName(req.getDeptName()); |
|
|
|
|
result.setApplyType(req.getApplyType()); |
|
|
|
|
result.setCreateTime(null); |
|
|
|
|
result.setCreateDept(null); |
|
|
|
|
result.setCreateUser(null); |
|
|
|
|
result.setUpdateUser(null); |
|
|
|
|
result.setUpdateTime(null); |
|
|
|
|
return result; |
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
return this.saveBatch(sourceList); |
|
|
|
|