Commit edf09961 authored by 周昊's avatar 周昊

1、开发接口添加固有风险

parent 6ca61ccc
package com.censoft.censoftrongtong.domain.dto;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 固有风险清单库对象 risk_inherent_list
*
* @author ruoyi
* @date 2023-06-26
*/
@Data
public class RiskInherentListSaveDto{
/** id */
private Long id;
/** 评估人id */
private Long userId;
/** 房间id */
private Long roomId;
/** 计划id */
private Long planId;
/** 风险源名称 */
private String name;
/** 风险因素 */
private String factor;
/** 事故类型 */
private String type;
/** 风险等级 */
private String level;
/** 存在部位 */
private String presenceLocation;
/** 风险源照片id */
private String pictureFileIds;
/** 工程技术措施 */
private String measuresProject;
/** 工程技术措施附件 */
private String measuresProjectFileIds;
/** 管理措施 */
private String measuresAdministration;
/** 管理措施附件 */
private String measuresAdministrationFileIds;
/** 应急处置措施 */
private String measuresEmergency;
/** 应急处置措施附件 */
private String measuresEmergencyFileIds;
/** 参考依据 */
private String referenceBasis;
}
package com.censoft.censoftrongtong.service;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.dto.RiskInherentListSaveDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDto;
import java.util.List;
......@@ -62,4 +63,6 @@ public interface IRiskPlanInherentListService
public int deleteRiskPlanInherentListById(Long id);
List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long planId, Long buildingId, Long floorId, Long roomId);
Integer saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto);
}
......@@ -3,10 +3,12 @@ package com.censoft.censoftrongtong.service.impl;
import java.util.List;
import com.censoft.censoftrongtong.domain.RiskPlanInherentList;
import com.censoft.censoftrongtong.domain.dto.RiskInherentListSaveDto;
import com.censoft.censoftrongtong.domain.dto.RiskPlanAppInherentListDto;
import com.censoft.censoftrongtong.mapper.RiskPlanInherentListMapper;
import com.censoft.censoftrongtong.service.IRiskPlanInherentListService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -100,4 +102,11 @@ public class RiskPlanInherentListServiceImpl implements IRiskPlanInherentListSer
public List<RiskPlanAppInherentListDto> getInherentListByPlanId(Long planId, Long buildingId, Long floorId, Long roomId) {
return riskPlanInherentListMapper.getInherentListByPlanId(planId, buildingId, floorId, roomId);
}
@Override
public Integer saveRiskInherentListSaveDto(RiskInherentListSaveDto saveDto) {
RiskPlanInherentList inherentList = new RiskPlanInherentList();
BeanUtils.copyProperties(saveDto,inherentList);
return insertRiskPlanInherentList(inherentList);
}
}
......@@ -14,6 +14,8 @@ ruoyi:
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
captchaType: math
# 服务器地址
serverAddress: http://192.168.4.232/dev-api
# 开发环境配置
server:
......
package com.ruoyi.framework.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.unit.DataSize;
import javax.servlet.MultipartConfigElement;
/**
* @author 周昊
* @desc ...
* @date 2023-06-28 14:54:58
*/
@Configuration
public class FileUploadConfig {
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize(DataSize.ofMegabytes(10)); // 设置最大文件大小为10MB
factory.setMaxRequestSize(DataSize.ofMegabytes(20)); // 设置最大请求大小为10MB
return factory.createMultipartConfig();
}
}
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