Commit 97dc9e38 authored by 周昊's avatar 周昊

1、app端修改固有现状风险新建报错问题

parent d9804bb3
package com.censoft.censoftrongtong.controller; package com.censoft.censoftrongtong.controller;
import cn.hutool.core.util.StrUtil;
import com.censoft.censoftrongtong.domain.*; import com.censoft.censoftrongtong.domain.*;
import com.censoft.censoftrongtong.domain.dto.*; import com.censoft.censoftrongtong.domain.dto.*;
import com.censoft.censoftrongtong.enums.RiskPlanStatusType; import com.censoft.censoftrongtong.enums.RiskPlanStatusType;
...@@ -339,6 +340,13 @@ public class RiskPlanAppController extends BaseController { ...@@ -339,6 +340,13 @@ public class RiskPlanAppController extends BaseController {
, @RequestParam(value = "measuresEmergencyFile[]", required = false) MultipartFile[] measuresEmergencyFile) { , @RequestParam(value = "measuresEmergencyFile[]", required = false) MultipartFile[] measuresEmergencyFile) {
String userId = getUserId().toString(); String userId = getUserId().toString();
if (StrUtil.isNotBlank(saveDto.getMeasuresDeptId()) && !"null".equals(saveDto.getMeasuresDeptId())){
saveDto.setMeasuresDeptLongId(Long.parseLong(saveDto.getMeasuresDeptId()));
}
if (StrUtil.isNotBlank(saveDto.getMeasuresUserId()) && !"null".equals(saveDto.getMeasuresUserId())){
saveDto.setMeasuresUserLongId(Long.parseLong(saveDto.getMeasuresUserId()));
}
//风险源照片 //风险源照片
if (pictureFile != null) { if (pictureFile != null) {
...@@ -439,6 +447,14 @@ public class RiskPlanAppController extends BaseController { ...@@ -439,6 +447,14 @@ public class RiskPlanAppController extends BaseController {
, @RequestParam(value = "measuresEmergencyFile[]", required = false) MultipartFile[] measuresEmergencyFile) { , @RequestParam(value = "measuresEmergencyFile[]", required = false) MultipartFile[] measuresEmergencyFile) {
String userId = getUserId().toString(); String userId = getUserId().toString();
if (StrUtil.isNotBlank(saveDto.getMeasuresDeptId()) && !"null".equals(saveDto.getMeasuresDeptId())){
saveDto.setMeasuresDeptLongId(Long.parseLong(saveDto.getMeasuresDeptId()));
}
if (StrUtil.isNotBlank(saveDto.getMeasuresUserId()) && !"null".equals(saveDto.getMeasuresUserId())){
saveDto.setMeasuresUserLongId(Long.parseLong(saveDto.getMeasuresUserId()));
}
//风险源照片 //风险源照片
if (pictureFile != null) { if (pictureFile != null) {
......
package com.censoft.censoftrongtong.domain.dto; package com.censoft.censoftrongtong.domain.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data; import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;
/** /**
* 固有风险清单库对象 risk_inherent_list * 固有风险清单库对象 risk_inherent_list
...@@ -85,12 +88,22 @@ public class RiskExistingListSaveDto { ...@@ -85,12 +88,22 @@ public class RiskExistingListSaveDto {
/** /**
* 管控责任单位id * 管控责任单位id
*/ */
private Long measuresDeptId; private String measuresDeptId;
/** /**
* 管控责任人id * 管控责任人id
*/ */
private Long measuresUserId; private String measuresUserId;
/**
* 管控责任单位id
*/
private Long measuresDeptLongId;
/**
* 管控责任人id
*/
private Long measuresUserLongId;
/** /**
* 管理措施附件 * 管理措施附件
......
...@@ -3,6 +3,8 @@ package com.censoft.censoftrongtong.domain.dto; ...@@ -3,6 +3,8 @@ package com.censoft.censoftrongtong.domain.dto;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data; import lombok.Data;
/** /**
...@@ -102,12 +104,22 @@ public class RiskInherentListSaveDto { ...@@ -102,12 +104,22 @@ public class RiskInherentListSaveDto {
/** /**
* 管控责任单位id * 管控责任单位id
*/ */
private Long measuresDeptId; private String measuresDeptId;
/** /**
* 管控责任人id * 管控责任人id
*/ */
private Long measuresUserId; private String measuresUserId;
/**
* 管控责任单位id
*/
private Long measuresDeptLongId;
/**
* 管控责任人id
*/
private Long measuresUserLongId;
/** /**
* 已采取的管理措施 * 已采取的管理措施
......
...@@ -75,6 +75,8 @@ public class RiskPlanExistingListServiceImpl ...@@ -75,6 +75,8 @@ public class RiskPlanExistingListServiceImpl
public Boolean saveRiskExistingListSaveDto(RiskExistingListSaveDto saveDto) { public Boolean saveRiskExistingListSaveDto(RiskExistingListSaveDto saveDto) {
RiskPlanExistingList existingList = new RiskPlanExistingList(); RiskPlanExistingList existingList = new RiskPlanExistingList();
BeanUtils.copyProperties(saveDto, existingList); BeanUtils.copyProperties(saveDto, existingList);
existingList.setMeasuresDeptId(saveDto.getMeasuresDeptLongId());
existingList.setMeasuresUserId(saveDto.getMeasuresUserLongId());
return saveOrUpdate(existingList); return saveOrUpdate(existingList);
} }
} }
...@@ -183,6 +183,8 @@ public class RiskPlanInherentListServiceImpl ...@@ -183,6 +183,8 @@ public class RiskPlanInherentListServiceImpl
public Boolean saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto) { public Boolean saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto) {
RiskPlanInherentList inherentList = new RiskPlanInherentList(); RiskPlanInherentList inherentList = new RiskPlanInherentList();
BeanUtils.copyProperties(saveDto, inherentList); BeanUtils.copyProperties(saveDto, inherentList);
inherentList.setMeasuresDeptId(saveDto.getMeasuresDeptLongId());
inherentList.setMeasuresUserId(saveDto.getMeasuresUserLongId());
return saveInherent(inherentList); return saveInherent(inherentList);
} }
......
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