安全事故接口优化
This commit is contained in:
@ -96,6 +96,7 @@ public class JxWhjlServiceImpl extends ServiceImpl<JxWhjlMapper, JxWhjl> impleme
|
||||
lqw.eq(bo.getMaintenanceDate() != null, JxWhjl::getMaintenanceDate, bo.getMaintenanceDate());
|
||||
lqw.eq(bo.getMaintenanceHours() != null, JxWhjl::getMaintenanceHours, bo.getMaintenanceHours());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaintenanceItems()), JxWhjl::getMaintenanceItems, bo.getMaintenanceItems());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEquipmentName()), JxWhjl::getEquipmentName, bo.getEquipmentName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPartsReplaced()), JxWhjl::getPartsReplaced, bo.getPartsReplaced());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterialsUsed()), JxWhjl::getMaterialsUsed, bo.getMaterialsUsed());
|
||||
lqw.eq(bo.getMaintainer() != null, JxWhjl::getMaintainer, bo.getMaintainer());
|
||||
|
||||
@ -6,6 +6,8 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetySgzgbhBo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetySgzgbhHeadVo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -36,6 +38,15 @@ public class HseSafetySgdanjlController extends BaseController {
|
||||
|
||||
private final IHseSafetySgdanjlService hseSafetySgdanjlService;
|
||||
|
||||
/**
|
||||
* 头部数据返回
|
||||
*/
|
||||
// @SaCheckPermission("jxzgbh:yhzgbh:list")
|
||||
// @GetMapping("/getListHead")
|
||||
// public R<HseSafetySgzgbhHeadVo> getListHead(HseSafetySgzgbhBo bo) {
|
||||
// return R.ok(hseSafetySgzgbhService.getListHead(bo));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询安全-事故档案记录列表
|
||||
*/
|
||||
@ -61,7 +72,7 @@ public class HseSafetySgdanjlController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgdanjl:query")
|
||||
// @SaCheckPermission("accident:safetySgdanjl:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<HseSafetySgdanjlVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
|
||||
@ -57,6 +57,15 @@ public class HseSafetySgzgbhController extends BaseController {
|
||||
public TableDataInfo<HseSafetySgzgbhVo> list(HseSafetySgzgbhBo bo, PageQuery pageQuery) {
|
||||
return hseSafetySgzgbhService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 查询安全-事故整改闭环列表
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:add")
|
||||
@GetMapping("/getNoPass")
|
||||
public R<String> getNoPass(HseSafetySgzgbhBo bo) {
|
||||
String noPass = hseSafetySgzgbhService.getNoPass(bo);
|
||||
return R.ok(noPass);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出安全-事故整改闭环列表
|
||||
@ -74,7 +83,7 @@ public class HseSafetySgzgbhController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:query")
|
||||
// @SaCheckPermission("accident:safetySgzgbh:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<HseSafetySgzgbhVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
|
||||
@ -4,6 +4,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -47,12 +49,7 @@ public class HseSafetyFcxx extends BaseEntity {
|
||||
/**
|
||||
* 复查日期
|
||||
*/
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 复查意见
|
||||
*/
|
||||
private String reviewOpinion;
|
||||
private LocalDate reviewDate;
|
||||
|
||||
/**
|
||||
* 复查状态
|
||||
|
||||
@ -4,6 +4,8 @@ import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -42,12 +44,12 @@ public class HseSafetyZgxx extends BaseEntity {
|
||||
/**
|
||||
* 整改开始日期
|
||||
*/
|
||||
private Date abarbeitungKsdate;
|
||||
private LocalDate abarbeitungKsdate;
|
||||
|
||||
/**
|
||||
* 整改结束日期
|
||||
*/
|
||||
private Date abarbeitungJsdate;
|
||||
private LocalDate abarbeitungJsdate;
|
||||
|
||||
/**
|
||||
* 整改措施
|
||||
|
||||
@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -37,7 +39,7 @@ public class HseSafetyFcxxBo extends BaseEntity {
|
||||
/**
|
||||
* 整改ID
|
||||
*/
|
||||
@NotNull(message = "整改ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "整改ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long zgId;
|
||||
|
||||
/**
|
||||
@ -50,13 +52,9 @@ public class HseSafetyFcxxBo extends BaseEntity {
|
||||
* 复查日期
|
||||
*/
|
||||
@NotNull(message = "复查日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date reviewDate;
|
||||
private LocalDate reviewDate;
|
||||
|
||||
|
||||
/**
|
||||
* 复查意见
|
||||
*/
|
||||
@NotBlank(message = "复查意见不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reviewOpinion;
|
||||
|
||||
/**
|
||||
* 复查状态
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package org.dromara.safety.accident.domain.bo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@ -7,11 +8,14 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 安全-事故整改闭环业务对象 hse_safety_sgzgbh
|
||||
@ -26,6 +30,24 @@ public class HseSafetySgzgfcxqReq implements Serializable {
|
||||
* 整改措施
|
||||
*/
|
||||
private String abarbeitungMeasure;
|
||||
/**
|
||||
* 整改图片
|
||||
*/
|
||||
private String zgFileId;
|
||||
|
||||
private List<String> zgFileUrls;
|
||||
|
||||
/**
|
||||
* 整改pdf文件
|
||||
*/
|
||||
private String zgPdfId;
|
||||
|
||||
private List<String> zgPdfUrls;
|
||||
|
||||
/**
|
||||
* 复查状态
|
||||
*/
|
||||
private String reviewState;
|
||||
|
||||
/**
|
||||
* 不通过原因
|
||||
@ -37,4 +59,16 @@ public class HseSafetySgzgfcxqReq implements Serializable {
|
||||
*/
|
||||
private String reviewOpinionParticulars;
|
||||
|
||||
/**
|
||||
* 文件id (多个文件逗号分隔)
|
||||
*/
|
||||
private String fcFileId;
|
||||
private List<String> fcFileUrls;
|
||||
|
||||
/**
|
||||
* pdf文件(多个文件逗号分隔)
|
||||
*/
|
||||
private String fcPdfId;
|
||||
private List<String> fcPdfUrls;
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@ -44,13 +46,13 @@ public class HseSafetyZgxxBo extends BaseEntity {
|
||||
* 整改开始日期
|
||||
*/
|
||||
@NotNull(message = "整改开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date abarbeitungKsdate;
|
||||
private LocalDate abarbeitungKsdate;
|
||||
|
||||
/**
|
||||
* 整改结束日期
|
||||
*/
|
||||
@NotNull(message = "整改结束日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date abarbeitungJsdate;
|
||||
private LocalDate abarbeitungJsdate;
|
||||
|
||||
/**
|
||||
* 整改措施
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.dromara.safety.accident.domain.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.safety.accident.domain.HseSafetyFcxx;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
@ -13,7 +16,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -53,18 +56,14 @@ public class HseSafetyFcxxVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "复查人")
|
||||
private Long review;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "review")
|
||||
private String reviewName;
|
||||
|
||||
/**
|
||||
* 复查日期
|
||||
*/
|
||||
@ExcelProperty(value = "复查日期")
|
||||
private Date reviewDate;
|
||||
|
||||
/**
|
||||
* 复查意见
|
||||
*/
|
||||
@ExcelProperty(value = "复查意见")
|
||||
private String reviewOpinion;
|
||||
private LocalDate reviewDate;
|
||||
|
||||
/**
|
||||
* 复查状态
|
||||
@ -90,6 +89,7 @@ public class HseSafetyFcxxVo implements Serializable {
|
||||
@ExcelProperty(value = "文件id ", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "多=个文件逗号分隔")
|
||||
private String fileId;
|
||||
private List<String> fileUrls;
|
||||
|
||||
/**
|
||||
* pdf文件(多个文件逗号分隔)
|
||||
@ -97,6 +97,7 @@ public class HseSafetyFcxxVo implements Serializable {
|
||||
@ExcelProperty(value = "pdf文件", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "多=个文件逗号分隔")
|
||||
private String pdfId;
|
||||
private List<String> pdfUrls;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -90,12 +92,16 @@ public class HseSafetySgzgbhVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "调查人")
|
||||
private Long jsr;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "jsr")
|
||||
private String jsrName;
|
||||
|
||||
/**
|
||||
* 上报人
|
||||
*/
|
||||
@ExcelProperty(value = "上报人")
|
||||
private Long sbr;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "sbr")
|
||||
private String sbrName;
|
||||
|
||||
/**
|
||||
* 上报时间
|
||||
@ -114,6 +120,8 @@ public class HseSafetySgzgbhVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "整改人")
|
||||
private Long zgr;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "zgr")
|
||||
private String zgrName;
|
||||
|
||||
/**
|
||||
* 复查状态
|
||||
@ -126,6 +134,8 @@ public class HseSafetySgzgbhVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "复查人")
|
||||
private Long fcr;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "fcr")
|
||||
private String fcrName;
|
||||
|
||||
/**
|
||||
* 最终闭环状态
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
package org.dromara.safety.accident.domain.vo;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.safety.accident.domain.HseSafetyZgxx;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
@ -13,7 +16,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -47,18 +50,20 @@ public class HseSafetyZgxxVo implements Serializable {
|
||||
*/
|
||||
@ExcelProperty(value = "整改责任人")
|
||||
private Long abarbeitung;
|
||||
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "abarbeitung")
|
||||
private String abarbeitungName;
|
||||
|
||||
/**
|
||||
* 整改开始日期
|
||||
*/
|
||||
@ExcelProperty(value = "整改开始日期")
|
||||
private Date abarbeitungKsdate;
|
||||
private LocalDate abarbeitungKsdate;
|
||||
|
||||
/**
|
||||
* 整改结束日期
|
||||
*/
|
||||
@ExcelProperty(value = "整改结束日期")
|
||||
private Date abarbeitungJsdate;
|
||||
private LocalDate abarbeitungJsdate;
|
||||
|
||||
/**
|
||||
* 整改措施
|
||||
@ -78,6 +83,7 @@ public class HseSafetyZgxxVo implements Serializable {
|
||||
@ExcelProperty(value = "文件id ", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "多=个文件逗号分隔")
|
||||
private String fileId;
|
||||
private List<String> fileUrls;
|
||||
|
||||
|
||||
/**
|
||||
@ -86,6 +92,7 @@ public class HseSafetyZgxxVo implements Serializable {
|
||||
@ExcelProperty(value = "pdf文件", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "多=个文件逗号分隔")
|
||||
private String pdfId;
|
||||
private List<String> pdfUrls;
|
||||
|
||||
/**
|
||||
* 关联复查信息
|
||||
|
||||
@ -93,4 +93,11 @@ public interface IHseSafetySgzgbhService extends IService<HseSafetySgzgbh>{
|
||||
* @return
|
||||
*/
|
||||
HseSafetySgzgbhHeadVo getListHead(HseSafetySgzgbhBo bo);
|
||||
|
||||
/**
|
||||
* 获取不通过原因
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
String getNoPass(HseSafetySgzgbhBo bo);
|
||||
}
|
||||
|
||||
@ -77,7 +77,6 @@ public class HseSafetyFcxxServiceImpl extends ServiceImpl<HseSafetyFcxxMapper, H
|
||||
lqw.eq(bo.getZgId() != null, HseSafetyFcxx::getZgId, bo.getZgId());
|
||||
lqw.eq(bo.getReview() != null, HseSafetyFcxx::getReview, bo.getReview());
|
||||
lqw.eq(bo.getReviewDate() != null, HseSafetyFcxx::getReviewDate, bo.getReviewDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReviewOpinion()), HseSafetyFcxx::getReviewOpinion, bo.getReviewOpinion());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReviewState()), HseSafetyFcxx::getReviewState, bo.getReviewState());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNotPassCause()), HseSafetyFcxx::getNotPassCause, bo.getNotPassCause());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReviewOpinionParticulars()), HseSafetyFcxx::getReviewOpinionParticulars, bo.getReviewOpinionParticulars());
|
||||
|
||||
@ -73,9 +73,9 @@ public class HseSafetySgdanjlServiceImpl extends ServiceImpl<HseSafetySgdanjlMap
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<HseSafetySgdanjl> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByDesc(HseSafetySgdanjl::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getDanbh()), HseSafetySgdanjl::getDanbh, bo.getDanbh());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProject()), HseSafetySgdanjl::getProject, bo.getProject());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSgbh()), HseSafetySgdanjl::getSgbh, bo.getSgbh());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDanbh()), HseSafetySgdanjl::getDanbh, bo.getDanbh());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getProject()), HseSafetySgdanjl::getProject, bo.getProject());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSgbh()), HseSafetySgdanjl::getSgbh, bo.getSgbh());
|
||||
lqw.eq(bo.getSfsj() != null, HseSafetySgdanjl::getSfsj, bo.getSfsj());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSfdd()), HseSafetySgdanjl::getSfdd, bo.getSfdd());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSglx()), HseSafetySgdanjl::getSglx, bo.getSglx());
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package org.dromara.safety.accident.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
@ -16,23 +19,21 @@ import org.dromara.mechanical.jxzgbh.domain.JxYhzgbh;
|
||||
import org.dromara.mechanical.jxzgbh.domain.vo.JxZgxxHeadVo;
|
||||
import org.dromara.project.domain.vo.project.BusProjectVo;
|
||||
import org.dromara.project.service.IBusProjectService;
|
||||
import org.dromara.safety.accident.domain.HseSafetyFcxx;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgsb;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyFcxxBo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetySgdanjlBo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyZgxxBo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetySgzgbhHeadVo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetyZgxxVo;
|
||||
import org.dromara.safety.accident.domain.HseSafetyZgxx;
|
||||
import org.dromara.safety.accident.domain.bo.*;
|
||||
import org.dromara.safety.accident.domain.vo.*;
|
||||
import org.dromara.safety.accident.menu.SGStatusEnum;
|
||||
import org.dromara.safety.accident.service.*;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetySgzgbhBo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetySgzgbhVo;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
||||
import org.dromara.safety.accident.mapper.HseSafetySgzgbhMapper;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@ -61,6 +62,9 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
@Lazy
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IHseSafetySgdcService sgdcService;
|
||||
|
||||
/**
|
||||
* 查询安全-事故整改闭环
|
||||
@ -191,7 +195,7 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addZGxx(HseSafetyZgxxBo bo) {
|
||||
HseSafetySgzgbh sgzgbh = baseMapper.selectById(bo.getId());
|
||||
HseSafetySgzgbh sgzgbh = baseMapper.selectById(bo.getMasterId());
|
||||
if(sgzgbh == null){
|
||||
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
||||
}
|
||||
@ -223,7 +227,7 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addFCxx(HseSafetyFcxxBo bo) {
|
||||
HseSafetySgzgbh sgzgbh = baseMapper.selectById(bo.getId());
|
||||
HseSafetySgzgbh sgzgbh = baseMapper.selectById(bo.getMasterId());
|
||||
if(sgzgbh == null){
|
||||
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
||||
}
|
||||
@ -235,15 +239,22 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
}
|
||||
HseSafetySgsb hseSafetySgsb = sgsbService.getBaseMapper().selectById(sgzgbh.getSgId());
|
||||
if (hseSafetySgsb == null){
|
||||
throw new ServiceException("找不到事故信息");
|
||||
throw new ServiceException("归档失败,找不到事故信息,请联系管理员");
|
||||
}
|
||||
HseSafetyZgxx zgxx = zgxxService.getBaseMapper().selectOne(new LambdaQueryWrapper<HseSafetyZgxx>().eq(HseSafetyZgxx::getMasterId, sgzgbh.getId()).orderByDesc(HseSafetyZgxx::getCreateTime).last("limit 1"));
|
||||
if (zgxx == null){
|
||||
throw new ServiceException("找不到整改信息");
|
||||
}
|
||||
bo.setZgId(zgxx.getId());
|
||||
Boolean b = fcxxService.insertByBo(bo);
|
||||
//修改主数据整改状态合复查状态
|
||||
sgzgbh.setFcStatus(bo.getReviewState());
|
||||
if (SGStatusEnum.PASS.getCode().equals(bo.getReviewState())){
|
||||
sgzgbh.setReviewStatus(SGStatusEnum.CLOSED_LOOP_OPERATION.getCode());
|
||||
hseSafetySgsb.setSgzt(SGStatusEnum.SG_CLOSED_LOOP_OPERATION.getCode());
|
||||
//复查通过则生成档案信息数据
|
||||
HseSafetySgdanjlBo sgdanjlBo = new HseSafetySgdanjlBo();
|
||||
//填充基础数据
|
||||
String banBen = BatchNumberGenerator.generateBatchNumber("ANQSGDANJL-");
|
||||
sgdanjlBo.setDanbh(banBen);
|
||||
BusProjectVo projectVo = projectService.selectById(hseSafetySgsb.getProjectId());
|
||||
@ -253,9 +264,51 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
sgdanjlBo.setSgbh(hseSafetySgsb.getSgbh());
|
||||
sgdanjlBo.setSfsj(hseSafetySgsb.getSfsj());
|
||||
sgdanjlBo.setSfdd(hseSafetySgsb.getSfdd());
|
||||
sgdanjlBo.setSglx(hseSafetySgsb.getSglx());
|
||||
sgdanjlBo.setSgdj(hseSafetySgsb.getSgdj());
|
||||
sgdanjlBo.setSgyy(hseSafetySgsb.getSgyy());
|
||||
|
||||
//事故详情填充
|
||||
HseSafetySgxqReq sgxqReq = BeanUtil.copyProperties(hseSafetySgsb, HseSafetySgxqReq.class);
|
||||
sgdanjlBo.setSgxq(JSONUtil.toJsonStr(sgxqReq));
|
||||
//事故损失情况填充
|
||||
HseSafetySgssqkReq sgssqkReq = BeanUtil.copyProperties(hseSafetySgsb, HseSafetySgssqkReq.class);
|
||||
sgdanjlBo.setSsqk(JSONUtil.toJsonStr(sgssqkReq));
|
||||
//事故调查详情填充
|
||||
HseSafetySgdcVo sgdcVo = sgdcService.queryById(sgzgbh.getDcId());
|
||||
if (sgdcVo == null){
|
||||
throw new ServiceException("归档失败,找不到事故调查信息,请联系管理员");
|
||||
}
|
||||
HseSafetySgdcxqReq sgdcxqReq = BeanUtil.copyProperties(sgdcVo, HseSafetySgdcxqReq.class);
|
||||
sgdanjlBo.setDcxq(JSONUtil.toJsonStr(sgdcxqReq));
|
||||
//事故整改与复查信息填充
|
||||
HseSafetySgzgbhVo vo = queryById(sgzgbh.getId());
|
||||
if (vo == null){
|
||||
throw new ServiceException("归档失败,找不到事故整改与复查信息,请联系管理员");
|
||||
}
|
||||
List<HseSafetySgzgfcxqReq> reqs = new ArrayList<>();
|
||||
if (vo.getZgxxVos() != null){
|
||||
vo.getZgxxVos().forEach(v -> {
|
||||
HseSafetySgzgfcxqReq req = new HseSafetySgzgfcxqReq();
|
||||
req.setAbarbeitungMeasure(v.getAbarbeitungMeasure());
|
||||
req.setZgFileId(v.getFileId());
|
||||
req.setZgFileUrls(v.getFileUrls());
|
||||
req.setZgPdfId(v.getPdfId());
|
||||
req.setZgPdfUrls(v.getPdfUrls());
|
||||
if (v.getFcxxVo() == null){
|
||||
throw new ServiceException("归档失败,找不到对应的复查记录,请联系管理员");
|
||||
}
|
||||
req.setReviewState(v.getFcxxVo().getReviewState());
|
||||
req.setNotPassCause(v.getFcxxVo().getNotPassCause());
|
||||
req.setReviewOpinionParticulars(v.getFcxxVo().getReviewOpinionParticulars());
|
||||
req.setFcFileId(v.getFcxxVo().getFileId());
|
||||
req.setFcFileUrls(v.getFcxxVo().getFileUrls());
|
||||
req.setFcPdfId(v.getFcxxVo().getPdfId());
|
||||
req.setFcPdfUrls(v.getFcxxVo().getPdfUrls());
|
||||
reqs.add(req);
|
||||
});
|
||||
}
|
||||
sgdanjlBo.setZgfcxq(JSONUtil.toJsonStr(reqs));
|
||||
sgdanjlService.insertByBo(sgdanjlBo);
|
||||
|
||||
}else {
|
||||
hseSafetySgsb.setSgzt(SGStatusEnum.SG_TO_BE_RECTIFIED.getCode());
|
||||
@ -269,7 +322,7 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
@Override
|
||||
public HseSafetySgzgbhHeadVo getListHead(HseSafetySgzgbhBo bo) {
|
||||
HseSafetySgzgbhHeadVo sgzgbhHeadVo = new HseSafetySgzgbhHeadVo();
|
||||
List<HseSafetySgzgbh> sgzgbhs = this.getBaseMapper().selectList(new LambdaQueryWrapper<HseSafetySgzgbh>().le(HseSafetySgzgbh::getCreateTime, LocalDate.now().plusDays(1)).ge(HseSafetySgzgbh::getCreateTime, LocalDate.now().minusDays(29)));
|
||||
List<HseSafetySgzgbh> sgzgbhs = this.getBaseMapper().selectList(new LambdaQueryWrapper<HseSafetySgzgbh>().eq(HseSafetySgzgbh::getProjectId,bo.getProjectId()).le(HseSafetySgzgbh::getCreateTime, LocalDate.now().plusDays(1)).ge(HseSafetySgzgbh::getCreateTime, LocalDate.now().minusDays(29)));
|
||||
if ( sgzgbhs != null && !sgzgbhs.isEmpty()) {
|
||||
sgzgbhHeadVo.setZs((long) sgzgbhs.size());
|
||||
sgzgbhHeadVo.setDzg(sgzgbhs.stream().filter(jxYhzgbh -> jxYhzgbh.getZgStatus().equals(SGStatusEnum.TO_BE_RECTIFIED.getCode())).count());
|
||||
@ -279,4 +332,17 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
return sgzgbhHeadVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNoPass(HseSafetySgzgbhBo bo) {
|
||||
HseSafetyZgxx zgxx = zgxxService.getBaseMapper().selectOne(new LambdaQueryWrapper<HseSafetyZgxx>().eq(HseSafetyZgxx::getMasterId, bo.getId()).orderByDesc(HseSafetyZgxx::getCreateTime).last("limit 1"));
|
||||
if (zgxx == null){
|
||||
throw new ServiceException("找不到整改信息");
|
||||
}
|
||||
HseSafetyFcxx fcxx = fcxxService.getBaseMapper().selectOne(new LambdaQueryWrapper<HseSafetyFcxx>().eq(HseSafetyFcxx::getZgId, zgxx.getId()).orderByDesc(HseSafetyFcxx::getCreateTime).last("limit 1"));
|
||||
if (fcxx == null){
|
||||
throw new ServiceException("找不到复查信息");
|
||||
}
|
||||
return fcxx.getNotPassCause();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,6 +12,9 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetyFcxxVo;
|
||||
import org.dromara.safety.accident.service.IHseSafetyFcxxService;
|
||||
import org.dromara.system.domain.vo.SysOssVo;
|
||||
import org.dromara.system.service.ISysOssService;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyZgxxBo;
|
||||
@ -20,6 +23,7 @@ import org.dromara.safety.accident.domain.HseSafetyZgxx;
|
||||
import org.dromara.safety.accident.mapper.HseSafetyZgxxMapper;
|
||||
import org.dromara.safety.accident.service.IHseSafetyZgxxService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@ -39,6 +43,8 @@ public class HseSafetyZgxxServiceImpl extends ServiceImpl<HseSafetyZgxxMapper, H
|
||||
@Lazy
|
||||
@Resource
|
||||
private IHseSafetyFcxxService fcxxService;
|
||||
@Resource
|
||||
private ISysOssService ossService;
|
||||
|
||||
/**
|
||||
* 查询安全事故整改信息
|
||||
@ -148,11 +154,45 @@ public class HseSafetyZgxxServiceImpl extends ServiceImpl<HseSafetyZgxxMapper, H
|
||||
public List<HseSafetyZgxxVo> getZGBGInfoVoByIdList(Long id) {
|
||||
List<HseSafetyZgxxVo> zgxxVos = baseMapper.selectVoList(new LambdaQueryWrapper<HseSafetyZgxx>().eq(HseSafetyZgxx::getMasterId, id));
|
||||
if (zgxxVos != null && !zgxxVos.isEmpty()) {
|
||||
zgxxVos.forEach(vo -> {
|
||||
for (HseSafetyZgxxVo vo : zgxxVos) {
|
||||
String[] filesStr = vo.getFileId().split(",");
|
||||
if (filesStr.length > 0) {
|
||||
List<String> fileUrls = getUrls1(filesStr);
|
||||
vo.setFileUrls(fileUrls);
|
||||
}
|
||||
String[] pdfsStr = vo.getPdfId().split(",");
|
||||
if (pdfsStr.length > 0) {
|
||||
List<String> pdfUrls = getUrls1(pdfsStr);
|
||||
vo.setPdfUrls(pdfUrls);
|
||||
}
|
||||
HseSafetyFcxxVo fcxxVo = fcxxService.getInfoVoById(vo.getId());
|
||||
if (fcxxVo != null) {
|
||||
String[] filesStr1 = fcxxVo.getFileId().split(",");
|
||||
if (filesStr1.length > 0) {
|
||||
List<String> fileUrls1 = getUrls1(filesStr1);
|
||||
fcxxVo.setFileUrls(fileUrls1);
|
||||
}
|
||||
String[] pdfsStr1 = fcxxVo.getPdfId().split(",");
|
||||
if (pdfsStr1.length > 0) {
|
||||
List<String> pdfUrls1 = getUrls1(pdfsStr1);
|
||||
fcxxVo.setPdfUrls(pdfUrls1);
|
||||
}
|
||||
}
|
||||
vo.setFcxxVo(fcxxVo);
|
||||
});
|
||||
}
|
||||
}
|
||||
return zgxxVos;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<String> getUrls1(String[] idStr) {
|
||||
List<String> pdfUrls1 = new ArrayList<>();
|
||||
for (String fileId : idStr) {
|
||||
SysOssVo ossVo = ossService.getById(Long.parseLong(fileId));
|
||||
if (ossVo != null) {
|
||||
pdfUrls1.add(ossVo.getUrl());
|
||||
}
|
||||
}
|
||||
return pdfUrls1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public class HseGcjkBo extends BaseEntity {
|
||||
/**
|
||||
* 监控编号
|
||||
*/
|
||||
@NotBlank(message = "监控编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "监控编号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String monitorNo;
|
||||
|
||||
/**
|
||||
|
||||
@ -81,6 +81,7 @@ public class HseGcjkServiceImpl extends ServiceImpl<HseGcjkMapper, HseGcjk> impl
|
||||
lqw.orderByDesc(HseGcjk::getId);
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMonitorNo()), HseGcjk::getMonitorNo, bo.getMonitorNo());
|
||||
lqw.eq(bo.getMasterId() != null, HseGcjk::getMasterId, bo.getMasterId());
|
||||
lqw.eq(bo.getProjectId() != null, HseGcjk::getProjectId, bo.getProjectId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getDeName()), HseGcjk::getDeName, bo.getDeName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMonitorContent()), HseGcjk::getMonitorContent, bo.getMonitorContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMonitorFrequency()), HseGcjk::getMonitorFrequency, bo.getMonitorFrequency());
|
||||
|
||||
Reference in New Issue
Block a user