Commit 97979645 authored by 周昊's avatar 周昊

1、修改固有风险字段

parent 90797942
......@@ -328,10 +328,10 @@ public class RiskPlanAppController extends BaseController {
* 添加固有风险
*
* @param saveDto 固有风险表单
* @real_return {@link R<Integer>}
* @real_return {@link R<Boolean>}
*/
@PostMapping("/inherent")
public R<Integer> saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto
public R<Boolean> saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto
, @RequestParam(value = "pictureFile[]", required = false) MultipartFile[] pictureFile
, @RequestParam(value = "measuresProjectFile[]", required = false) MultipartFile[] measuresProjectFile
, @RequestParam(value = "measuresAdministrationFile[]", required = false) MultipartFile[] measuresAdministrationFile
......
package com.censoft.censoftrongtong.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 固有风险清单库对象 risk_plan_inherent_list
......@@ -12,422 +13,170 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2023-06-26
*/
public class RiskPlanInherentList extends BaseEntity
{
@Data
@TableName("risk_plan_inherent_list")
public class RiskPlanInherentList extends BaseEntity {
private static final long serialVersionUID = 1L;
/** id */
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/** 评估人id */
@Excel(name = "评估人id")
/**
* 评估人id
*/
@TableField("user_id")
private Long userId;
/** 房间id */
@Excel(name = "房间id")
/**
* 房间id
*/
@TableField("room_id")
private Long roomId;
/** 计划id */
@Excel(name = "计划id")
/**
* 计划id
*/
@TableField("plan_id")
private Long planId;
/** 风险code */
@Excel(name = "风险code")
private String code;
/** 风险源名称 */
@Excel(name = "风险源名称")
/**
* 风险源名称
*/
@TableField("name")
private String name;
/** 风险类型 */
@Excel(name = "风险类型")
private String type;
/**
* 风险点类型
*/
@TableField("point_type")
private String pointType;
/** 风险描述 */
@Excel(name = "风险描述")
private String describe;
/**
* 安全警示标志
*/
@TableField("safety_warning_signs")
private String safetyWarningSigns;
/** 评估模型 */
@Excel(name = "评估模型")
private String evaluationModel;
/**
* 风险因素
*/
@TableField("factor")
private String factor;
/** 评估范围 */
@Excel(name = "评估范围")
private String evaluationRange;
/**
* 准事故类型
*/
@TableField("type")
private String type;
/** 风险等级 */
@Excel(name = "风险等级")
/**
* 风险等级
*/
@TableField("level")
private String level;
/** 风险可能性 */
@Excel(name = "风险可能性")
/**
* 风险可能性
*/
@TableField("risk_likelihood")
private String riskLikelihood;
/** 后果严重性 */
@Excel(name = "后果严重性")
/**
* 后果严重性
*/
@TableField("risk_severity")
private String riskSeverity;
/** 存在部位 */
@Excel(name = "存在部位")
/**
* 存在部位
*/
@TableField("presence_location")
private String presenceLocation;
/** 风险源照片id */
@Excel(name = "风险源照片id")
/**
* 风险源照片id
*/
@TableField("picture_file_ids")
private String pictureFileIds;
/** 风险因素 */
@Excel(name = "风险因素")
private String factor;
/** 工程技术措施 */
@Excel(name = "工程技术措施")
/**
* 工程技术措施
*/
@TableField("measures_project")
private String measuresProject;
/** 工程技术措施附件 */
@Excel(name = "工程技术措施附件")
/**
* 工程技术措施附件
*/
@TableField("measures_project_file_ids")
private String measuresProjectFileIds;
/** 应采取的管理措施 */
@Excel(name = "应采取的管理措施")
/**
* 应采取的管理措施
*/
@TableField("measures_administration")
private String measuresAdministration;
/** 已采取的管理措施1 */
@Excel(name = "已采取的管理措施")
private String takenMeasuresAdministration;
/** 管控责任单位id1 */
@Excel(name = "管控责任单位id")
/**
* 管控责任单位id
*/
@TableField("measures_dept_id")
private Long measuresDeptId;
/** 管控责任人id1 */
@Excel(name = "管控责任人id")
private String measuresUserId;
/**
* 管控责任人id
*/
@TableField("measures_user_id")
private Long measuresUserId;
/** 已采取的管理措施 */
@Excel(name = "已采取的管理措施附件")
/**
* 已采取的管理措施
*/
@TableField("measures_administration_file_ids")
private String measuresAdministrationFileIds;
/** 危险源名称1 */
@Excel(name = "危险源名称")
/**
* 危险源名称
*/
@TableField("hazard_source_name")
private String hazardSourceName;
/** 是否存在重大危险源 1*/
@Excel(name = "是否存在重大危险源")
/**
* 是否存在重大危险源
*/
@TableField("major_hazard_source")
private Boolean majorHazardSource;
/** 重大危险源描述1 */
@Excel(name = "重大危险源描述")
private Boolean majorHazardSourceDescription;
/**
* 重大危险源描述
*/
@TableField("major_hazard_source_description")
private String majorHazardSourceDescription;
/** 应急处置措施 */
@Excel(name = "应急处置措施")
/**
* 应急措施
*/
@TableField("measures_emergency")
private String measuresEmergency;
/** 应急处置措施附件 */
@Excel(name = "应急处置措施附件")
/**
* 应急处置措施附件
*/
@TableField("measures_emergency_file_ids")
private String measuresEmergencyFileIds;
/** 参考依据 */
@Excel(name = "参考依据")
/**
* 参考依据
*/
@TableField("reference_basis")
private String referenceBasis;
/** 删除标志(0代表存在 1代表删除) */
/**
* 删除标志(0代表存在 1代表删除)
*/
@TableField("del_flag")
private String delFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setRoomId(Long roomId)
{
this.roomId = roomId;
}
public Long getRoomId()
{
return roomId;
}
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setDescribe(String describe)
{
this.describe = describe;
}
public String getDescribe()
{
return describe;
}
public void setEvaluationModel(String evaluationModel)
{
this.evaluationModel = evaluationModel;
}
public String getEvaluationModel()
{
return evaluationModel;
}
public void setEvaluationRange(String evaluationRange)
{
this.evaluationRange = evaluationRange;
}
public String getEvaluationRange()
{
return evaluationRange;
}
public void setLevel(String level)
{
this.level = level;
}
public String getLevel()
{
return level;
}
public void setPresenceLocation(String presenceLocation)
{
this.presenceLocation = presenceLocation;
}
public String getPresenceLocation()
{
return presenceLocation;
}
public void setPictureFileIds(String pictureFileIds)
{
this.pictureFileIds = pictureFileIds;
}
public String getPictureFileIds()
{
return pictureFileIds;
}
public void setFactor(String factor)
{
this.factor = factor;
}
public String getFactor()
{
return factor;
}
public void setMeasuresProject(String measuresProject)
{
this.measuresProject = measuresProject;
}
public String getMeasuresProject()
{
return measuresProject;
}
public void setMeasuresProjectFileIds(String measuresProjectFileIds)
{
this.measuresProjectFileIds = measuresProjectFileIds;
}
public String getMeasuresProjectFileIds()
{
return measuresProjectFileIds;
}
public void setMeasuresAdministration(String measuresAdministration)
{
this.measuresAdministration = measuresAdministration;
}
public String getMeasuresAdministration()
{
return measuresAdministration;
}
public void setMeasuresAdministrationFileIds(String measuresAdministrationFileIds)
{
this.measuresAdministrationFileIds = measuresAdministrationFileIds;
}
public String getMeasuresAdministrationFileIds()
{
return measuresAdministrationFileIds;
}
public void setMeasuresEmergency(String measuresEmergency)
{
this.measuresEmergency = measuresEmergency;
}
public String getMeasuresEmergency()
{
return measuresEmergency;
}
public void setMeasuresEmergencyFileIds(String measuresEmergencyFileIds)
{
this.measuresEmergencyFileIds = measuresEmergencyFileIds;
}
public String getMeasuresEmergencyFileIds()
{
return measuresEmergencyFileIds;
}
public void setReferenceBasis(String referenceBasis)
{
this.referenceBasis = referenceBasis;
}
public String getReferenceBasis()
{
return referenceBasis;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
public String getRiskLikelihood() {
return riskLikelihood;
}
public void setRiskLikelihood(String riskLikelihood) {
this.riskLikelihood = riskLikelihood;
}
public String getRiskSeverity() {
return riskSeverity;
}
public void setRiskSeverity(String riskSeverity) {
this.riskSeverity = riskSeverity;
}
public String getTakenMeasuresAdministration() {
return takenMeasuresAdministration;
}
public void setTakenMeasuresAdministration(String takenMeasuresAdministration) {
this.takenMeasuresAdministration = takenMeasuresAdministration;
}
public Long getMeasuresDeptId() {
return measuresDeptId;
}
public void setMeasuresDeptId(Long measuresDeptId) {
this.measuresDeptId = measuresDeptId;
}
public String getMeasuresUserId() {
return measuresUserId;
}
public void setMeasuresUserId(String measuresUserId) {
this.measuresUserId = measuresUserId;
}
public String getHazardSourceName() {
return hazardSourceName;
}
public void setHazardSourceName(String hazardSourceName) {
this.hazardSourceName = hazardSourceName;
}
public Boolean getMajorHazardSource() {
return majorHazardSource;
}
public void setMajorHazardSource(Boolean majorHazardSource) {
this.majorHazardSource = majorHazardSource;
}
public Boolean getMajorHazardSourceDescription() {
return majorHazardSourceDescription;
}
public void setMajorHazardSourceDescription(Boolean majorHazardSourceDescription) {
this.majorHazardSourceDescription = majorHazardSourceDescription;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userId", getUserId())
.append("roomId", getRoomId())
.append("planId", getPlanId())
.append("code", getCode())
.append("name", getName())
.append("type", getType())
.append("describe", getDescribe())
.append("evaluationModel", getEvaluationModel())
.append("evaluationRange", getEvaluationRange())
.append("level", getLevel())
.append("riskLikelihood", getRiskLikelihood())
.append("riskSeverity", getRiskSeverity())
.append("presenceLocation", getPresenceLocation())
.append("pictureFileIds", getPictureFileIds())
.append("factor", getFactor())
.append("measuresProject", getMeasuresProject())
.append("measuresProjectFileIds", getMeasuresProjectFileIds())
.append("measuresAdministration", getMeasuresAdministration())
.append("measuresAdministrationFileIds", getMeasuresAdministrationFileIds())
.append("measuresEmergency", getMeasuresEmergency())
.append("measuresEmergencyFileIds", getMeasuresEmergencyFileIds())
.append("referenceBasis", getReferenceBasis())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}
package com.censoft.censoftrongtong.domain.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
/**
......@@ -9,74 +12,135 @@ import lombok.Data;
* @date 2023-06-26
*/
@Data
public class RiskInherentListSaveDto{
public class RiskInherentListSaveDto {
/** id */
/**
* id
*/
private Long id;
/** 评估人id */
/**
* 评估人id
*/
private Long userId;
/** 房间id */
/**
* 房间id
*/
private Long roomId;
/** 计划id */
/**
* 计划id
*/
private Long planId;
/** 风险源名称 */
/**
* 风险源名称
*/
private String name;
/** 风险因素 */
/**
* 风险点类型
*/
private String pointType;
/**
* 安全警示标志
*/
private String safetyWarningSigns;
/**
* 风险因素
*/
private String factor;
/** 事故类型 */
/**
* 准事故类型
*/
private String type;
/** 风险等级 */
/**
* 风险等级
*/
private String level;
/** 存在部位 */
/**
* 风险可能性
*/
private String riskLikelihood;
/**
* 后果严重性
*/
private String riskSeverity;
/**
* 存在部位
*/
private String presenceLocation;
/** 风险源照片id */
/**
* 风险源照片id
*/
private String pictureFileIds;
/** 工程技术措施 */
/**
* 工程技术措施
*/
private String measuresProject;
/** 工程技术措施附件 */
/**
* 工程技术措施附件
*/
private String measuresProjectFileIds;
/** 应采取的管理措施 */
/**
* 应采取的管理措施
*/
private String measuresAdministration;
/** 已采取的管理措施 */
private String takenMeasuresAdministration;
/** 管控责任单位id */
/**
* 管控责任单位id
*/
private Long measuresDeptId;
/** 管控责任人id */
private String measuresUserId;
/**
* 管控责任人id
*/
private Long measuresUserId;
/** 管理措施附件 */
/**
* 已采取的管理措施
*/
private String measuresAdministrationFileIds;
/** 危险源名称 */
/**
* 危险源名称
*/
private String hazardSourceName;
/** 是否存在重大危险源 */
/**
* 是否存在重大危险源
*/
private Boolean majorHazardSource;
/** 重大危险源描述 */
private Boolean majorHazardSourceDescription;
/**
* 重大危险源描述
*/
private String majorHazardSourceDescription;
/** 应急处置措施 */
/**
* 应急措施
*/
private String measuresEmergency;
/** 应急处置措施附件 */
/**
* 应急处置措施附件
*/
private String measuresEmergencyFileIds;
/** 参考依据 */
/**
* 参考依据
*/
private String referenceBasis;
}
package com.censoft.censoftrongtong.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppExistingListDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDetailsDto;
......@@ -14,56 +15,8 @@ import java.util.List;
* @author ruoyi
* @date 2023-06-26
*/
public interface RiskPlanInherentListMapper
public interface RiskPlanInherentListMapper extends BaseMapper<RiskPlanInherentList>
{
/**
* 查询固有风险清单库
*
* @param id 固有风险清单库主键
* @return 固有风险清单库
*/
public RiskPlanInherentList selectRiskPlanInherentListById(Long id);
/**
* 查询固有风险清单库列表
*
* @param riskPlanInherentList 固有风险清单库
* @return 固有风险清单库集合
*/
public List<RiskPlanInherentList> selectRiskPlanInherentListList(RiskPlanInherentList riskPlanInherentList);
/**
* 新增固有风险清单库
*
* @param riskPlanInherentList 固有风险清单库
* @return 结果
*/
public int insertRiskPlanInherentList(RiskPlanInherentList riskPlanInherentList);
/**
* 修改固有风险清单库
*
* @param riskPlanInherentList 固有风险清单库
* @return 结果
*/
public int updateRiskPlanInherentList(RiskPlanInherentList riskPlanInherentList);
/**
* 删除固有风险清单库
*
* @param id 固有风险清单库主键
* @return 结果
*/
public int deleteRiskPlanInherentListById(Long id);
/**
* 批量删除固有风险清单库
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRiskPlanInherentListByIds(Long[] ids);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(@Param("projectId") Long projectId, @Param("buildingId") Long buildingId, @Param("floorId") Long floorId, @Param("roomId") Long roomId);
RiskPlanAppInherentListDetailsDto getRiskPlanAppInherentListDetailsDtoByInherentId(@Param("inherentId") Long inherentId);
......
package com.censoft.censoftrongtong.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.dto.RiskInherentListSaveDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppExistingListDto;
......@@ -14,59 +15,12 @@ import java.util.List;
* @author ruoyi
* @date 2023-06-26
*/
public interface IRiskPlanInherentListService
public interface IRiskPlanInherentListService extends IService<RiskPlanInherentList>
{
/**
* 查询固有风险清单库
*
* @param id 固有风险清单库主键
* @return 固有风险清单库
*/
public RiskPlanInherentList selectRiskPlanInherentListById(Long id);
/**
* 查询固有风险清单库列表
*
* @param riskPlanInherentList 固有风险清单库
* @return 固有风险清单库集合
*/
public List<RiskPlanInherentList> selectRiskPlanInherentListList(RiskPlanInherentList riskPlanInherentList);
/**
* 新增固有风险清单库
*
* @param riskPlanInherentList 固有风险清单库
* @return 结果
*/
public int insertRiskPlanInherentList(RiskPlanInherentList riskPlanInherentList);
/**
* 修改固有风险清单库
*
* @param riskPlanInherentList 固有风险清单库
* @return 结果
*/
public int updateRiskPlanInherentList(RiskPlanInherentList riskPlanInherentList);
/**
* 批量删除固有风险清单库
*
* @param ids 需要删除的固有风险清单库主键集合
* @return 结果
*/
public int deleteRiskPlanInherentListByIds(Long[] ids);
/**
* 删除固有风险清单库信息
*
* @param id 固有风险清单库主键
* @return 结果
*/
public int deleteRiskPlanInherentListById(Long id);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long projectId, Long buildingId, Long floorId, Long roomId);
Integer saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto);
Boolean saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto);
RiskPlanAppInherentListDetailsDto getRiskPlanAppInherentListDetailsDtoByInherentId(Long inherentId);
......
package com.censoft.censoftrongtong.service.impl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.censoft.censoftrongtong.domain.RiskPlan;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.RiskPlanTask;
......@@ -25,10 +20,12 @@ import com.ruoyi.system.service.ISysUploadFileService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.date.DateUnit;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* 固有风险清单库Service业务层处理
......@@ -37,7 +34,9 @@ import javax.annotation.Resource;
* @date 2023-06-26
*/
@Service
public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListService {
public class RiskPlanInherentListServiceImpl
extends ServiceImpl<RiskPlanInherentListMapper, RiskPlanInherentList>
implements IRiskPlanInherentListService {
@Autowired
private RiskPlanInherentListMapper riskPlanInherentListMapper;
@Autowired
......@@ -52,28 +51,6 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
@Resource
private IRiskPlanTaskService riskPlanTaskService;
/**
* 查询固有风险清单库
*
* @param id 固有风险清单库主键
* @return 固有风险清单库
*/
@Override
public RiskPlanInherentList selectRiskPlanInherentListById(Long id) {
return riskPlanInherentListMapper.selectRiskPlanInherentListById(id);
}
/**
* 查询固有风险清单库列表
*
* @param riskPlanInherentList 固有风险清单库
* @return 固有风险清单库
*/
@Override
public List<RiskPlanInherentList> selectRiskPlanInherentListList(RiskPlanInherentList riskPlanInherentList) {
return riskPlanInherentListMapper.selectRiskPlanInherentListList(riskPlanInherentList);
}
/**
* 新增固有风险清单库
*
......@@ -81,7 +58,7 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
* @return 结果
*/
@Override
public int insertRiskPlanInherentList(RiskPlanInherentList riskPlanInherentList) {
public boolean save(RiskPlanInherentList riskPlanInherentList) {
/**
* 解题思路
* 1.判断当前任务状态是否待执行状态
......@@ -114,7 +91,7 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
riskPlanInherentList.setCreateTime(DateUtils.getNowDate());
return riskPlanInherentListMapper.insertRiskPlanInherentList(riskPlanInherentList);
return riskPlanInherentListMapper.insert(riskPlanInherentList)>0;
}
/**
......@@ -124,7 +101,7 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
* @return 结果
*/
@Override
public int updateRiskPlanInherentList(RiskPlanInherentList riskPlanInherentList) {
public boolean updateById(RiskPlanInherentList riskPlanInherentList) {
/**
* 解题思路
* 1.判断当前任务状态是否待执行状态
......@@ -155,65 +132,24 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
}
}
riskPlanInherentList.setUpdateTime(DateUtils.getNowDate());
return riskPlanInherentListMapper.updateRiskPlanInherentList(riskPlanInherentList);
}
/**
* 批量删除固有风险清单库
*
* @param ids 需要删除的固有风险清单库主键
* @return 结果
*/
@Override
public int deleteRiskPlanInherentListByIds(Long[] ids) {
/**
* 解题思路
* 1.判断当前任务状态是否待执行状态
* 2.待执行修改执行状态变为已完成否则不操作
* 3.改为已完成添加任务执行记录
*/
RiskPlanInherentList riskPlanInherentList=riskPlanInherentListMapper.selectRiskPlanInherentListById(ids[0]);
RiskPlanTask riskPlanTask=riskPlanTaskMapper.getLastRiskPlanTaskByPlanId(riskPlanInherentList.getPlanId());
//计划
RiskPlan riskPlan = riskPlanMapper.selectRiskPlanById(riskPlanTask.getPlanId());
if (riskPlanTask!=null) {
if (riskPlanTask.getTaskKey().equals("WAIT_START")&&riskPlanTask.getStatus().equals("running")) {
//修改任务状态
riskPlanTask.setStatus("completed");
riskPlanTask.setCompletedTime(new Date());
int rs=riskPlanTaskMapper.updateRiskPlanTask(riskPlanTask);
if (rs>-1) {//修改状态成功
System.out.println("修改状态成功");
}
//创建任务执行状态
RiskPlanTask riskPlanTask1 = new RiskPlanTask();
riskPlanTask1.setPlanId(riskPlanTask.getPlanId());
riskPlanTask1.setApprovalUserId(riskPlan.getLeaderUserId());
riskPlanTask1.setTaskKey(RiskPlanStatusType.RUNNING.getStatus());
riskPlanTask1.setTaskName(RiskPlanStatusType.RUNNING.getTitle());
riskPlanTask1.setStatus("running");
riskPlanTask1.setStartTime(new Date());
riskPlanTaskService.insertRiskPlanTask(riskPlanTask1);
}
}
return riskPlanInherentListMapper.deleteRiskPlanInherentListByIds(ids);
return riskPlanInherentListMapper.updateById(riskPlanInherentList)>0;
}
/**
* 删除固有风险清单库信息
*
* @param id 固有风险清单库主键
* @param entity 固有风险清单库主键
* @return 结果
*/
@Override
public int deleteRiskPlanInherentListById(Long id) {
public boolean removeById(RiskPlanInherentList entity) {
/**
* 解题思路
* 1.判断当前任务状态是否待执行状态
* 2.待执行修改执行状态变为已完成否则不操作
* 3.改为已完成添加任务执行记录
*/
RiskPlanInherentList riskPlanInherentList=riskPlanInherentListMapper.selectRiskPlanInherentListById(id);
RiskPlanInherentList riskPlanInherentList=riskPlanInherentListMapper.selectById(entity.getId());
RiskPlanTask riskPlanTask=riskPlanTaskMapper.getLastRiskPlanTaskByPlanId(riskPlanInherentList.getPlanId());
//计划
RiskPlan riskPlan = riskPlanMapper.selectRiskPlanById(riskPlanTask.getPlanId());
......@@ -237,7 +173,7 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
riskPlanTaskService.insertRiskPlanTask(riskPlanTask1);
}
}
return riskPlanInherentListMapper.deleteRiskPlanInherentListById(id);
return riskPlanInherentListMapper.deleteById(entity.getId())>0;
}
@Override
......@@ -246,10 +182,10 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
}
@Override
public Integer saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto) {
public Boolean saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto) {
RiskPlanInherentList inherentList = new RiskPlanInherentList();
BeanUtils.copyProperties(saveDto, inherentList);
return insertRiskPlanInherentList(inherentList);
return save(inherentList);
}
@Override
......
......@@ -3,72 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.censoft.censoftrongtong.mapper.RiskPlanInherentListMapper">
<resultMap type="com.censoft.censoftrongtong.domain.RiskPlanInherentList" id="RiskPlanInherentListResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="roomId" column="room_id" />
<result property="planId" column="plan_id" />
<result property="code" column="code" />
<result property="name" column="name" />
<result property="type" column="type" />
<result property="describe" column="describe" />
<result property="evaluationModel" column="evaluation_model" />
<result property="evaluationRange" column="evaluation_range" />
<result property="level" column="level" />
<result property="riskLikelihood" column="risk_likelihood" />
<result property="riskSeverity" column="risk_severity" />
<result property="presenceLocation" column="presence_location" />
<result property="pictureFileIds" column="picture_file_ids" />
<result property="factor" column="factor" />
<result property="measuresProject" column="measures_project" />
<result property="measuresProjectFileIds" column="measures_project_file_ids" />
<result property="measuresAdministration" column="measures_administration" />
<result property="measuresAdministrationFileIds" column="measures_administration_file_ids" />
<result property="measuresEmergency" column="measures_emergency" />
<result property="measuresEmergencyFileIds" column="measures_emergency_file_ids" />
<result property="referenceBasis" column="reference_basis" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectRiskPlanInherentListVo">
select * from risk_plan_inherent_list
</sql>
<select id="selectRiskPlanInherentListList" parameterType="com.censoft.censoftrongtong.domain.RiskPlanInherentList" resultMap="RiskPlanInherentListResult">
<include refid="selectRiskPlanInherentListVo"/>
<where>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="roomId != null "> and room_id = #{roomId}</if>
<if test="planId != null "> and plan_id = #{planId}</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="describe != null and describe != ''"> and describe = #{describe}</if>
<if test="evaluationModel != null and evaluationModel != ''"> and evaluation_model = #{evaluationModel}</if>
<if test="evaluationRange != null and evaluationRange != ''"> and evaluation_range = #{evaluationRange}</if>
<if test="level != null and level != ''"> and level = #{level}</if>
<if test="presenceLocation != null and presenceLocation != ''"> and presence_location = #{presenceLocation}</if>
<if test="pictureFileIds != null and pictureFileIds != ''"> and picture_file_ids = #{pictureFileIds}</if>
<if test="factor != null and factor != ''"> and factor = #{factor}</if>
<if test="measuresProject != null and measuresProject != ''"> and measures_project = #{measuresProject}</if>
<if test="measuresProjectFileIds != null and measuresProjectFileIds != ''"> and measures_project_file_ids = #{measuresProjectFileIds}</if>
<if test="measuresAdministration != null and measuresAdministration != ''"> and measures_administration = #{measuresAdministration}</if>
<if test="measuresAdministrationFileIds != null and measuresAdministrationFileIds != ''"> and measures_administration_file_ids = #{measuresAdministrationFileIds}</if>
<if test="measuresEmergency != null and measuresEmergency != ''"> and measures_emergency = #{measuresEmergency}</if>
<if test="measuresEmergencyFileIds != null and measuresEmergencyFileIds != ''"> and measures_emergency_file_ids = #{measuresEmergencyFileIds}</if>
<if test="referenceBasis != null and referenceBasis != ''"> and reference_basis = #{referenceBasis}</if>
</where>
</select>
<select id="selectRiskPlanInherentListById" parameterType="Long" resultMap="RiskPlanInherentListResult">
<include refid="selectRiskPlanInherentListVo"/>
where id = #{id}
</select>
<select id="getInherentListByPlanId"
resultType="com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDto">
SELECT
......@@ -154,135 +88,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
reil.inherent_id = #{inherentId}
</select>
<insert id="insertRiskPlanInherentList" parameterType="com.censoft.censoftrongtong.domain.RiskPlanInherentList" useGeneratedKeys="true" keyProperty="id">
insert into risk_plan_inherent_list
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="roomId != null">room_id,</if>
<if test="planId != null">plan_id,</if>
<if test="code != null">code,</if>
<if test="name != null">name,</if>
<if test="type != null">type,</if>
<if test="describe != null">describe,</if>
<if test="evaluationModel != null">evaluation_model,</if>
<if test="evaluationRange != null">evaluation_range,</if>
<if test="level != null">level,</if>
<if test="riskLikelihood != null">risk_likelihood,</if>
<if test="riskSeverity != null">risk_severity,</if>
<if test="presenceLocation != null">presence_location,</if>
<if test="pictureFileIds != null">picture_file_ids,</if>
<if test="factor != null">factor,</if>
<if test="measuresProject != null">measures_project,</if>
<if test="measuresProjectFileIds != null">measures_project_file_ids,</if>
<if test="measuresAdministration != null">measures_administration,</if>
<if test="measuresAdministrationFileIds != null">measures_administration_file_ids,</if>
<if test="measuresEmergency != null">measures_emergency,</if>
<if test="measuresEmergencyFileIds != null">measures_emergency_file_ids,</if>
<if test="takenMeasuresAdministration != null">taken_measures_administration,</if>
<if test="measuresDeptId != null">measures_deptId,</if>
<if test="measuresUserId != null">measures_userId,</if>
<if test="hazardSourceName != null">hazard_sourceName,</if>
<if test="majorHazardSource != null">major_hazard_source,</if>
<if test="majorHazardSourceDescription != null">major_hazard_source_description,</if>
<if test="referenceBasis != null">reference_basis,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="roomId != null">#{roomId},</if>
<if test="planId != null">#{planId},</if>
<if test="code != null">#{code},</if>
<if test="name != null">#{name},</if>
<if test="type != null">#{type},</if>
<if test="describe != null">#{describe},</if>
<if test="evaluationModel != null">#{evaluationModel},</if>
<if test="evaluationRange != null">#{evaluationRange},</if>
<if test="level != null">#{level},</if>
<if test="riskLikelihood != null">#{riskLikelihood},</if>
<if test="riskSeverity != null">#{riskSeverity},</if>
<if test="presenceLocation != null">#{presenceLocation},</if>
<if test="pictureFileIds != null">#{pictureFileIds},</if>
<if test="factor != null">#{factor},</if>
<if test="measuresProject != null">#{measuresProject},</if>
<if test="measuresProjectFileIds != null">#{measuresProjectFileIds},</if>
<if test="measuresAdministration != null">#{measuresAdministration},</if>
<if test="measuresAdministrationFileIds != null">#{measuresAdministrationFileIds},</if>
<if test="measuresEmergency != null">#{measuresEmergency},</if>
<if test="measuresEmergencyFileIds != null">#{measuresEmergencyFileIds},</if>
<if test="takenMeasuresAdministration != null">#{takenMeasuresAdministration},</if>
<if test="measuresDeptId != null">#{measuresDeptId},</if>
<if test="measuresUserId != null">#{measuresUserId},</if>
<if test="hazardSourceName != null">#{hazardSourceName},</if>
<if test="majorHazardSource != null">#{majorHazardSource},</if>
<if test="majorHazardSourceDescription != null">#{majorHazardSourceDescription},</if>
<if test="referenceBasis != null">#{referenceBasis},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateRiskPlanInherentList" parameterType="com.censoft.censoftrongtong.domain.RiskPlanInherentList">
update risk_plan_inherent_list
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="roomId != null">room_id = #{roomId},</if>
<if test="planId != null">plan_id = #{planId},</if>
<if test="code != null">code = #{code},</if>
<if test="name != null">name = #{name},</if>
<if test="type != null">type = #{type},</if>
<if test="describe != null">describe = #{describe},</if>
<if test="evaluationModel != null">evaluation_model = #{evaluationModel},</if>
<if test="evaluationRange != null">evaluation_range = #{evaluationRange},</if>
<if test="level != null">level = #{level},</if>
<if test="riskLikelihood != null">risk_likelihood = #{riskLikelihood},</if>
<if test="riskSeverity != null">risk_severity = #{riskSeverity},</if>
<if test="presenceLocation != null">presence_location = #{presenceLocation},</if>
<if test="pictureFileIds != null">picture_file_ids = #{pictureFileIds},</if>
<if test="factor != null">factor = #{factor},</if>
<if test="measuresProject != null">measures_project = #{measuresProject},</if>
<if test="measuresProjectFileIds != null">measures_project_file_ids = #{measuresProjectFileIds},</if>
<if test="measuresAdministration != null">measures_administration = #{measuresAdministration},</if>
<if test="measuresAdministrationFileIds != null">measures_administration_file_ids = #{measuresAdministrationFileIds},</if>
<if test="measuresEmergency != null">measures_emergency = #{measuresEmergency},</if>
<if test="measuresEmergencyFileIds != null">measures_emergency_file_ids = #{measuresEmergencyFileIds},</if>
<if test="takenMeasuresAdministration != null">taken_measures_administration = #{takenMeasuresAdministration},</if>
<if test="measuresDeptId != null">measures_deptId = #{measuresDeptId},</if>
<if test="measuresUserId != null">measures_userId = #{measuresUserId},</if>
<if test="hazardSourceName != null">hazard_sourceName = #{hazardSourceName},</if>
<if test="majorHazardSource != null">major_hazard_source = #{majorHazardSource},</if>
<if test="majorHazardSourceDescription != null">major_hazard_source_description = #{majorHazardSourceDescription},</if>
<if test="referenceBasis != null">reference_basis = #{referenceBasis},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRiskPlanInherentListById" parameterType="Long">
delete from risk_plan_inherent_list where id = #{id}
</delete>
<delete id="deleteRiskPlanInherentListByIds" parameterType="String">
delete from risk_plan_inherent_list where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
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