安全事故初始化
This commit is contained in:
@ -6,6 +6,11 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.mechanical.jxzgbh.domain.bo.JxYhzgbhBo;
|
||||
import org.dromara.mechanical.jxzgbh.domain.vo.JxZgxxHeadVo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyFcxxBo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyZgxxBo;
|
||||
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 +41,14 @@ public class HseSafetySgzgbhController extends BaseController {
|
||||
|
||||
private final IHseSafetySgzgbhService hseSafetySgzgbhService;
|
||||
|
||||
/**
|
||||
* 头部数据返回
|
||||
*/
|
||||
@SaCheckPermission("jxzgbh:yhzgbh:list")
|
||||
@GetMapping("/getListHead")
|
||||
public R<HseSafetySgzgbhHeadVo> getListHead(HseSafetySgzgbhBo bo) {
|
||||
return R.ok(hseSafetySgzgbhService.getListHead(bo));
|
||||
}
|
||||
/**
|
||||
* 查询安全-事故整改闭环列表
|
||||
*/
|
||||
@ -48,13 +61,13 @@ public class HseSafetySgzgbhController extends BaseController {
|
||||
/**
|
||||
* 导出安全-事故整改闭环列表
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:export")
|
||||
@Log(title = "安全-事故整改闭环", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HseSafetySgzgbhBo bo, HttpServletResponse response) {
|
||||
List<HseSafetySgzgbhVo> list = hseSafetySgzgbhService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "安全-事故整改闭环", HseSafetySgzgbhVo.class, response);
|
||||
}
|
||||
// @SaCheckPermission("accident:safetySgzgbh:export")
|
||||
// @Log(title = "安全-事故整改闭环", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HseSafetySgzgbhBo bo, HttpServletResponse response) {
|
||||
// List<HseSafetySgzgbhVo> list = hseSafetySgzgbhService.queryList(bo);
|
||||
// ExcelUtil.exportExcel(list, "安全-事故整改闭环", HseSafetySgzgbhVo.class, response);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取安全-事故整改闭环详细信息
|
||||
@ -71,35 +84,61 @@ public class HseSafetySgzgbhController extends BaseController {
|
||||
/**
|
||||
* 新增安全-事故整改闭环
|
||||
*/
|
||||
// @SaCheckPermission("accident:safetySgzgbh:add")
|
||||
// @Log(title = "安全-事故整改闭环", businessType = BusinessType.INSERT)
|
||||
// @RepeatSubmit()
|
||||
// @PostMapping()
|
||||
// public R<Void> add(@Validated(AddGroup.class) @RequestBody HseSafetySgzgbhBo bo) {
|
||||
// return toAjax(hseSafetySgzgbhService.insertByBo(bo));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增整改信息
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:add")
|
||||
@Log(title = "安全-事故整改闭环", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody HseSafetySgzgbhBo bo) {
|
||||
return toAjax(hseSafetySgzgbhService.insertByBo(bo));
|
||||
@PostMapping("/addZGxx")
|
||||
public R<Void> addZGxx(@Validated(AddGroup.class) @RequestBody HseSafetyZgxxBo bo) {
|
||||
return toAjax(hseSafetySgzgbhService.addZGxx(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增复查信息
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:add")
|
||||
@Log(title = "安全-事故整改闭环", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/addFCxx")
|
||||
public R<Void> addFCxx(@Validated(AddGroup.class) @RequestBody HseSafetyFcxxBo bo) {
|
||||
return toAjax(hseSafetySgzgbhService.addFCxx(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改安全-事故整改闭环
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:edit")
|
||||
@Log(title = "安全-事故整改闭环", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody HseSafetySgzgbhBo bo) {
|
||||
return toAjax(hseSafetySgzgbhService.updateByBo(bo));
|
||||
}
|
||||
// @SaCheckPermission("accident:safetySgzgbh:edit")
|
||||
// @Log(title = "安全-事故整改闭环", businessType = BusinessType.UPDATE)
|
||||
// @RepeatSubmit()
|
||||
// @PutMapping()
|
||||
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody HseSafetySgzgbhBo bo) {
|
||||
// return toAjax(hseSafetySgzgbhService.updateByBo(bo));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除安全-事故整改闭环
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("accident:safetySgzgbh:remove")
|
||||
@Log(title = "安全-事故整改闭环", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(hseSafetySgzgbhService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
// @SaCheckPermission("accident:safetySgzgbh:remove")
|
||||
// @Log(title = "安全-事故整改闭环", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{ids}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
// @PathVariable Long[] ids) {
|
||||
// return toAjax(hseSafetySgzgbhService.deleteWithValidByIds(List.of(ids), true));
|
||||
// }
|
||||
}
|
||||
|
||||
@ -74,6 +74,11 @@ public class HseSafetySgdanjl extends BaseEntity {
|
||||
*/
|
||||
private String sgxq;
|
||||
|
||||
/**
|
||||
* 损失情况
|
||||
*/
|
||||
private String ssqk;
|
||||
|
||||
/**
|
||||
* 调查详情
|
||||
*/
|
||||
|
||||
@ -39,6 +39,11 @@ public class HseSafetySgzgbh extends BaseEntity {
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 事故id
|
||||
*/
|
||||
private Long sgId;
|
||||
|
||||
/**
|
||||
* 事故编号
|
||||
*/
|
||||
|
||||
@ -64,10 +64,6 @@ public class HseSafetyZgxx extends BaseEntity {
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* pdf文件(多个文件逗号分隔)
|
||||
|
||||
@ -73,6 +73,12 @@ public class HseSafetySgdanjlBo extends BaseEntity {
|
||||
*/
|
||||
private String sgxq;
|
||||
|
||||
|
||||
/**
|
||||
* 损失情况
|
||||
*/
|
||||
private String ssqk;
|
||||
|
||||
/**
|
||||
* 调查详情
|
||||
*/
|
||||
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.safety.accident.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgdc;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 安全-事故调查业务对象 hse_safety_sgdc
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
@Data
|
||||
public class HseSafetySgdcxqReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 事故详细经过
|
||||
*/
|
||||
private String sgxxjg;
|
||||
|
||||
/**
|
||||
* 直接原因
|
||||
*/
|
||||
private String zjjy;
|
||||
|
||||
/**
|
||||
* 间接原因
|
||||
*/
|
||||
private String jjyy;
|
||||
|
||||
/**
|
||||
* 证据材料说明
|
||||
*/
|
||||
private String zjcl;
|
||||
|
||||
/**
|
||||
* 责任部门
|
||||
*/
|
||||
private Long zrbm;
|
||||
|
||||
/**
|
||||
* 主要负责人
|
||||
*/
|
||||
private Long zyfzr;
|
||||
|
||||
/**
|
||||
* 次要负责人
|
||||
*/
|
||||
private Long cyfzr;
|
||||
|
||||
/**
|
||||
* 责任划分
|
||||
*/
|
||||
private String zrhf;
|
||||
|
||||
/**
|
||||
* 责任认定说明
|
||||
*/
|
||||
private String zrrdsm;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package org.dromara.safety.accident.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgsb;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 安全-事故上报业务对象 hse_safety_sgsb
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
@Data
|
||||
public class HseSafetySgssqkReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 死亡人数
|
||||
*/
|
||||
private Long swrs;
|
||||
|
||||
/**
|
||||
* 重伤人数
|
||||
*/
|
||||
private Long zsrs;
|
||||
|
||||
/**
|
||||
* 轻伤人数
|
||||
*/
|
||||
private Long qsrs;
|
||||
|
||||
/**
|
||||
* 人员信息
|
||||
*/
|
||||
private String ryxx;
|
||||
|
||||
/**
|
||||
* 初步估算(万元-角分)
|
||||
*/
|
||||
private Long cbgs;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package org.dromara.safety.accident.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgsb;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 安全-事故上报业务对象 hse_safety_sgsb
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
@Data
|
||||
public class HseSafetySgxqReq implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 事发地点
|
||||
*/
|
||||
private String sfdd;
|
||||
|
||||
/**
|
||||
* 事故原因
|
||||
*/
|
||||
private String sgyy;
|
||||
|
||||
/**
|
||||
* 紧急措施
|
||||
*/
|
||||
private String jjcs;
|
||||
|
||||
|
||||
}
|
||||
@ -38,6 +38,12 @@ public class HseSafetySgzgbhBo extends BaseEntity {
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
|
||||
/**
|
||||
* 事故id
|
||||
*/
|
||||
private Long sgId;
|
||||
|
||||
/**
|
||||
* 事故编号
|
||||
*/
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
package org.dromara.safety.accident.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 安全-事故整改闭环业务对象 hse_safety_sgzgbh
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-12-05
|
||||
*/
|
||||
@Data
|
||||
public class HseSafetySgzgfcxqReq implements Serializable {
|
||||
|
||||
/**
|
||||
* 整改措施
|
||||
*/
|
||||
private String abarbeitungMeasure;
|
||||
|
||||
/**
|
||||
* 不通过原因
|
||||
*/
|
||||
private String notPassCause;
|
||||
|
||||
/**
|
||||
* 复查意见详情
|
||||
*/
|
||||
private String reviewOpinionParticulars;
|
||||
|
||||
}
|
||||
@ -69,10 +69,6 @@ public class HseSafetyZgxxBo extends BaseEntity {
|
||||
*/
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* pdf文件(多个文件逗号分隔)
|
||||
|
||||
@ -90,6 +90,12 @@ public class HseSafetySgdanjlVo implements Serializable {
|
||||
@ExcelProperty(value = "事故详情")
|
||||
private String sgxq;
|
||||
|
||||
|
||||
/**
|
||||
* 损失情况
|
||||
*/
|
||||
private String ssqk;
|
||||
|
||||
/**
|
||||
* 调查详情
|
||||
*/
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package org.dromara.safety.accident.domain.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HseSafetySgzgbhHeadVo {
|
||||
/**
|
||||
* 总数
|
||||
*/
|
||||
private Long zs = 0L;
|
||||
|
||||
/**
|
||||
* 待整改
|
||||
*/
|
||||
private Long dzg = 0L;
|
||||
|
||||
/**
|
||||
* 待验收
|
||||
*/
|
||||
private Long dys = 0L;
|
||||
|
||||
|
||||
/**
|
||||
* 已闭环
|
||||
*/
|
||||
private Long ybh = 0L;
|
||||
|
||||
|
||||
}
|
||||
@ -13,7 +13,7 @@ import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@ -48,6 +48,11 @@ public class HseSafetySgzgbhVo implements Serializable {
|
||||
@ExcelProperty(value = "关联项目")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 事故id
|
||||
*/
|
||||
private Long sgId;
|
||||
|
||||
/**
|
||||
* 事故编号
|
||||
*/
|
||||
@ -139,4 +144,10 @@ public class HseSafetySgzgbhVo implements Serializable {
|
||||
private String shzt;
|
||||
|
||||
|
||||
/**
|
||||
* 整改与复查记录
|
||||
*/
|
||||
private List<HseSafetyZgxxVo> zgxxVos;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -79,11 +79,6 @@ public class HseSafetyZgxxVo implements Serializable {
|
||||
@ExcelDictFormat(readConverterExp = "多=个文件逗号分隔")
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 顺序
|
||||
*/
|
||||
@ExcelProperty(value = "顺序")
|
||||
private Long sort;
|
||||
|
||||
/**
|
||||
* pdf文件(多个文件逗号分隔)
|
||||
@ -92,5 +87,10 @@ public class HseSafetyZgxxVo implements Serializable {
|
||||
@ExcelDictFormat(readConverterExp = "多=个文件逗号分隔")
|
||||
private String pdfId;
|
||||
|
||||
/**
|
||||
* 关联复查信息
|
||||
*/
|
||||
private HseSafetyFcxxVo fcxxVo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,81 @@
|
||||
package org.dromara.safety.accident.menu;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 消息类型枚举
|
||||
*
|
||||
* @author may
|
||||
*/
|
||||
@Getter
|
||||
public enum SGStatusEnum {
|
||||
|
||||
//事故状态 主数据
|
||||
/**
|
||||
* 已上报
|
||||
*/
|
||||
REPORTED("1", "已上报"),
|
||||
|
||||
/**
|
||||
* 待调查
|
||||
*/
|
||||
UNDER_INVESTIGATION("5", "待调查"),
|
||||
/**
|
||||
* 待整改
|
||||
*/
|
||||
SG_TO_BE_RECTIFIED("9", "待整改"),
|
||||
/**
|
||||
* 已整改
|
||||
*/
|
||||
SG_HAS_BEEN_RECTIFIED("14", "已整改"),
|
||||
|
||||
/**
|
||||
* 已闭环
|
||||
*/
|
||||
SG_CLOSED_LOOP_OPERATION("19", "已闭环"),
|
||||
|
||||
//整改状态
|
||||
/**
|
||||
* 待整改
|
||||
*/
|
||||
TO_BE_RECTIFIED("1", "待整改"),
|
||||
|
||||
/**
|
||||
* 整改中
|
||||
*/
|
||||
UNDER_RECTIFICATION("2", "整改中"),
|
||||
/**
|
||||
* 已整改
|
||||
*/
|
||||
HAS_BEEN_RECTIFIED("3", "已整改"),
|
||||
|
||||
//复查状态
|
||||
/**
|
||||
* 通过
|
||||
*/
|
||||
PASS("1", "通过"),
|
||||
/**
|
||||
* 不通过
|
||||
*/
|
||||
NO_PASS("2", "不通过"),
|
||||
//闭环状态
|
||||
/**
|
||||
* 已闭环
|
||||
*/
|
||||
CLOSED_LOOP_OPERATION("2", "已闭环"),
|
||||
/**
|
||||
* 未闭环
|
||||
*/
|
||||
OPEN_LOOP("1", "未闭环");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
SGStatusEnum(String code, String desc) {
|
||||
this.code = code;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -67,4 +67,11 @@ public interface IHseSafetyFcxxService extends IService<HseSafetyFcxx>{
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 通过整改id获取对应的复查信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HseSafetyFcxxVo getInfoVoById(Long id);
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package org.dromara.safety.accident.service;
|
||||
|
||||
import org.dromara.mechanical.jxzgbh.domain.bo.JxYhzgbhBo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyFcxxBo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyZgxxBo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetySgzgbhHeadVo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetySgzgbhVo;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetySgzgbhBo;
|
||||
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
||||
@ -67,4 +71,26 @@ public interface IHseSafetySgzgbhService extends IService<HseSafetySgzgbh>{
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 新增整改信息
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
Boolean addZGxx(HseSafetyZgxxBo bo);
|
||||
|
||||
/**
|
||||
* 新增复查信息
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
Boolean addFCxx(HseSafetyFcxxBo bo);
|
||||
|
||||
/**
|
||||
* 查询头部信息
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
HseSafetySgzgbhHeadVo getListHead(HseSafetySgzgbhBo bo);
|
||||
}
|
||||
|
||||
@ -67,4 +67,11 @@ public interface IHseSafetyZgxxService extends IService<HseSafetyZgxx>{
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 通过主数据id获取整改记录列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<HseSafetyZgxxVo> getZGBGInfoVoByIdList(Long id);
|
||||
}
|
||||
|
||||
@ -137,4 +137,9 @@ public class HseSafetyFcxxServiceImpl extends ServiceImpl<HseSafetyFcxxMapper, H
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HseSafetyFcxxVo getInfoVoById(Long id) {
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<HseSafetyFcxx>().eq(HseSafetyFcxx::getZgId, id));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package org.dromara.safety.accident.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -9,13 +11,28 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.utils.BatchNumberGenerator;
|
||||
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.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.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.dromara.safety.accident.service.IHseSafetySgzgbhService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
@ -31,6 +48,19 @@ import java.util.Collection;
|
||||
public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMapper, HseSafetySgzgbh> implements IHseSafetySgzgbhService {
|
||||
|
||||
private final HseSafetySgzgbhMapper baseMapper;
|
||||
@Resource
|
||||
private IHseSafetyZgxxService zgxxService;
|
||||
@Resource
|
||||
private IHseSafetyFcxxService fcxxService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IHseSafetySgsbService sgsbService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IHseSafetySgdanjlService sgdanjlService;
|
||||
@Lazy
|
||||
@Resource
|
||||
private IBusProjectService projectService;
|
||||
|
||||
/**
|
||||
* 查询安全-事故整改闭环
|
||||
@ -40,7 +70,14 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
*/
|
||||
@Override
|
||||
public HseSafetySgzgbhVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
HseSafetySgzgbhVo vo = baseMapper.selectVoById(id);
|
||||
if (null != vo){
|
||||
List<HseSafetyZgxxVo> zgxxVos =zgxxService.getZGBGInfoVoByIdList(vo.getId());
|
||||
if(!zgxxVos.isEmpty()){
|
||||
vo.setZgxxVos(zgxxVos);
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,4 +181,102 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增整改信息
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addZGxx(HseSafetyZgxxBo bo) {
|
||||
HseSafetySgzgbh sgzgbh = baseMapper.selectById(bo.getId());
|
||||
if(sgzgbh == null){
|
||||
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
||||
}
|
||||
if (SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(sgzgbh.getReviewStatus())){
|
||||
throw new ServiceException("已闭环,不需要再新增整改信息");
|
||||
}
|
||||
if (!SGStatusEnum.TO_BE_RECTIFIED.getCode().equals(sgzgbh.getZgStatus())){
|
||||
throw new ServiceException("已整改,不需要再新增整改信息");
|
||||
}
|
||||
HseSafetySgsb hseSafetySgsb = sgsbService.getBaseMapper().selectById(sgzgbh.getSgId());
|
||||
if (hseSafetySgsb == null){
|
||||
throw new ServiceException("找不到事故信息");
|
||||
}
|
||||
hseSafetySgsb.setSgzt(SGStatusEnum.SG_HAS_BEEN_RECTIFIED.getCode());
|
||||
sgsbService.getBaseMapper().updateById(hseSafetySgsb);
|
||||
//保存整改信息
|
||||
Boolean b = zgxxService.insertByBo(bo);
|
||||
//主数据修改整改状态
|
||||
sgzgbh.setZgStatus(SGStatusEnum.HAS_BEEN_RECTIFIED.getCode());
|
||||
baseMapper.updateById(sgzgbh);
|
||||
return b;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增复查信息
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean addFCxx(HseSafetyFcxxBo bo) {
|
||||
HseSafetySgzgbh sgzgbh = baseMapper.selectById(bo.getId());
|
||||
if(sgzgbh == null){
|
||||
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
||||
}
|
||||
if (SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(sgzgbh.getReviewStatus())){
|
||||
throw new ServiceException("已闭环,不需要再新增复查信息");
|
||||
}
|
||||
if (!SGStatusEnum.HAS_BEEN_RECTIFIED.getCode().equals(sgzgbh.getZgStatus())){
|
||||
throw new ServiceException("未整改,不能添加复查信息");
|
||||
}
|
||||
HseSafetySgsb hseSafetySgsb = sgsbService.getBaseMapper().selectById(sgzgbh.getSgId());
|
||||
if (hseSafetySgsb == null){
|
||||
throw new ServiceException("找不到事故信息");
|
||||
}
|
||||
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());
|
||||
if (projectVo != null){
|
||||
sgdanjlBo.setProject(projectVo.getProjectName());
|
||||
}
|
||||
sgdanjlBo.setSgbh(hseSafetySgsb.getSgbh());
|
||||
sgdanjlBo.setSfsj(hseSafetySgsb.getSfsj());
|
||||
sgdanjlBo.setSfdd(hseSafetySgsb.getSfdd());
|
||||
sgdanjlBo.setSgdj(hseSafetySgsb.getSgdj());
|
||||
sgdanjlBo.setSgyy(hseSafetySgsb.getSgyy());
|
||||
|
||||
|
||||
}else {
|
||||
hseSafetySgsb.setSgzt(SGStatusEnum.SG_TO_BE_RECTIFIED.getCode());
|
||||
sgzgbh.setZgStatus(SGStatusEnum.TO_BE_RECTIFIED.getCode());
|
||||
}
|
||||
sgsbService.getBaseMapper().updateById(hseSafetySgsb);
|
||||
baseMapper.updateById(sgzgbh);
|
||||
return b;
|
||||
}
|
||||
|
||||
@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)));
|
||||
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());
|
||||
sgzgbhHeadVo.setDys(sgzgbhs.stream().filter(jxYhzgbh -> SGStatusEnum.HAS_BEEN_RECTIFIED.getCode().equals(jxYhzgbh.getZgStatus()) && SGStatusEnum.OPEN_LOOP.getCode().equals(jxYhzgbh.getReviewStatus())).count());
|
||||
sgzgbhHeadVo.setYbh(sgzgbhs.stream().filter(jxYhzgbh -> SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(jxYhzgbh.getReviewStatus())).count());
|
||||
}
|
||||
return sgzgbhHeadVo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package org.dromara.safety.accident.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -9,6 +10,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.safety.accident.domain.bo.HseSafetyZgxxBo;
|
||||
import org.dromara.safety.accident.domain.vo.HseSafetyZgxxVo;
|
||||
@ -32,6 +36,10 @@ public class HseSafetyZgxxServiceImpl extends ServiceImpl<HseSafetyZgxxMapper, H
|
||||
|
||||
private final HseSafetyZgxxMapper baseMapper;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private IHseSafetyFcxxService fcxxService;
|
||||
|
||||
/**
|
||||
* 查询安全事故整改信息
|
||||
*
|
||||
@ -80,7 +88,6 @@ public class HseSafetyZgxxServiceImpl extends ServiceImpl<HseSafetyZgxxMapper, H
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAbarbeitungMeasure()), HseSafetyZgxx::getAbarbeitungMeasure, bo.getAbarbeitungMeasure());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAbarbeitungAccomplish()), HseSafetyZgxx::getAbarbeitungAccomplish, bo.getAbarbeitungAccomplish());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFileId()), HseSafetyZgxx::getFileId, bo.getFileId());
|
||||
lqw.eq(bo.getSort() != null, HseSafetyZgxx::getSort, bo.getSort());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPdfId()), HseSafetyZgxx::getPdfId, bo.getPdfId());
|
||||
return lqw;
|
||||
}
|
||||
@ -136,4 +143,16 @@ public class HseSafetyZgxxServiceImpl extends ServiceImpl<HseSafetyZgxxMapper, H
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
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 -> {
|
||||
HseSafetyFcxxVo fcxxVo= fcxxService.getInfoVoById(vo.getId());
|
||||
vo.setFcxxVo(fcxxVo);
|
||||
});
|
||||
}
|
||||
return zgxxVos;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user