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