安全事故bug修改和意见箱bug修改
This commit is contained in:
@ -333,6 +333,9 @@ public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMappe
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int editStatus(BusComplaintBoxBo bo) {
|
public int editStatus(BusComplaintBoxBo bo) {
|
||||||
|
if (bo.getStatus() == null){
|
||||||
|
throw new ServiceException("意见状态不能为空");
|
||||||
|
}
|
||||||
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(bo.getId());
|
BusComplaintBoxVo busComplaintBoxVo = baseMapper.selectVoById(bo.getId());
|
||||||
if (busComplaintBoxVo == null){
|
if (busComplaintBoxVo == null){
|
||||||
throw new ServiceException("找不到意见!!");
|
throw new ServiceException("找不到意见!!");
|
||||||
@ -343,7 +346,7 @@ public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMappe
|
|||||||
LambdaUpdateWrapper<BusComplaintBox> lqw = new LambdaUpdateWrapper<BusComplaintBox>();
|
LambdaUpdateWrapper<BusComplaintBox> lqw = new LambdaUpdateWrapper<BusComplaintBox>();
|
||||||
lqw.set(BusComplaintBox::getStatus, bo.getStatus());
|
lqw.set(BusComplaintBox::getStatus, bo.getStatus());
|
||||||
lqw.eq(BusComplaintBox::getId, bo.getId());
|
lqw.eq(BusComplaintBox::getId, bo.getId());
|
||||||
if ("5".equals(busComplaintBoxVo.getStatus())){
|
if ("5".equals(bo.getStatus())){
|
||||||
BusComplaintBoxDisposeLogging logging = new BusComplaintBoxDisposeLogging();
|
BusComplaintBoxDisposeLogging logging = new BusComplaintBoxDisposeLogging();
|
||||||
logging.setComplaintId(bo.getId());
|
logging.setComplaintId(bo.getId());
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
@ -351,6 +354,7 @@ public class BusComplaintBoxServiceImpl extends ServiceImpl<BusComplaintBoxMappe
|
|||||||
if (sysUserVo == null){
|
if (sysUserVo == null){
|
||||||
throw new ServiceException("找不到当前登录用户信息!");
|
throw new ServiceException("找不到当前登录用户信息!");
|
||||||
}
|
}
|
||||||
|
lqw.set(BusComplaintBox::getCurrentDisposeUserId, loginUser.getUserId());
|
||||||
logging.setUserId(loginUser.getUserId());
|
logging.setUserId(loginUser.getUserId());
|
||||||
logging.setUserName(sysUserVo.getNickName());
|
logging.setUserName(sysUserVo.getNickName());
|
||||||
logging.setAvatar(sysUserVo.getAvatar());
|
logging.setAvatar(sysUserVo.getAvatar());
|
||||||
|
|||||||
@ -0,0 +1,57 @@
|
|||||||
|
package org.dromara.safety.accident.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.contractor.domain.vo.contractor.SubContractorManagerVo;
|
||||||
|
import org.dromara.contractor.service.ISubContractorService;
|
||||||
|
import org.dromara.safety.accident.domain.bo.HseSafetySgdcBo;
|
||||||
|
import org.dromara.safety.accident.domain.vo.HseSafetySgdcVo;
|
||||||
|
import org.dromara.safety.accident.domain.vo.SgsbCountVo;
|
||||||
|
import org.dromara.safety.accident.service.IHseSafetySgdcService;
|
||||||
|
import org.dromara.system.domain.bo.SysUserBo;
|
||||||
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
|
import org.dromara.system.service.ISysUserService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全-事故调查
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-12-05
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/accident/public")
|
||||||
|
public class HseSafetyPublicController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysUserService userService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/getUserList")
|
||||||
|
public TableDataInfo<SysUserVo> list(SysUserBo user, PageQuery pageQuery) {
|
||||||
|
return userService.selectPageUserList(user, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,6 +15,10 @@ import org.dromara.common.log.enums.BusinessType;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.contractor.domain.vo.contractor.SubContractorManagerVo;
|
||||||
|
import org.dromara.contractor.service.ISubContractorService;
|
||||||
|
import org.dromara.project.domain.vo.projectteam.BusProjectTeamForemanVo;
|
||||||
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.safety.accident.domain.bo.HseSafetySgdcBo;
|
import org.dromara.safety.accident.domain.bo.HseSafetySgdcBo;
|
||||||
import org.dromara.safety.accident.domain.vo.HseSafetySgdcVo;
|
import org.dromara.safety.accident.domain.vo.HseSafetySgdcVo;
|
||||||
import org.dromara.safety.accident.domain.vo.SgsbCountVo;
|
import org.dromara.safety.accident.domain.vo.SgsbCountVo;
|
||||||
@ -38,6 +42,32 @@ public class HseSafetySgdcController extends BaseController {
|
|||||||
|
|
||||||
private final IHseSafetySgdcService hseSafetySgdcService;
|
private final IHseSafetySgdcService hseSafetySgdcService;
|
||||||
|
|
||||||
|
private final IBusProjectTeamService busProjectTeamService;
|
||||||
|
|
||||||
|
private final ISubContractorService contractorService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id查询项目班组班组长信息列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("accident:safetySgdc:edit")
|
||||||
|
@GetMapping("/listForeman/{projectId}")
|
||||||
|
public R<List<BusProjectTeamForemanVo>> listForeman(@NotNull(message = "项目id不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(busProjectTeamService.queryForemanListByProjectId(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id查询分包方管理人员信息列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("accident:safetySgdc:edit")
|
||||||
|
@GetMapping("/listManager/{projectId}")
|
||||||
|
public R<List<SubContractorManagerVo>> listManager(@NotNull(message = "项目id不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(contractorService.queryManagerListByProjectId(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询安全-事故调查列表
|
* 查询安全-事故调查列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -44,7 +44,7 @@ public class HseSafetySgzgbhController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 头部数据返回
|
* 头部数据返回
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("jxzgbh:yhzgbh:list")
|
@SaCheckPermission("accident:safetySgzgbh:list")
|
||||||
@GetMapping("/getListHead")
|
@GetMapping("/getListHead")
|
||||||
public R<HseSafetySgzgbhHeadVo> getListHead(HseSafetySgzgbhBo bo) {
|
public R<HseSafetySgzgbhHeadVo> getListHead(HseSafetySgzgbhBo bo) {
|
||||||
return R.ok(hseSafetySgzgbhService.getListHead(bo));
|
return R.ok(hseSafetySgzgbhService.getListHead(bo));
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全-事故调查业务对象 hse_safety_sgdc
|
* 档案-事故调查信息
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-12-05
|
* @date 2025-12-05
|
||||||
@ -44,16 +44,19 @@ public class HseSafetySgdcxqReq implements Serializable {
|
|||||||
* 责任部门
|
* 责任部门
|
||||||
*/
|
*/
|
||||||
private Long zrbm;
|
private Long zrbm;
|
||||||
|
private String zrbmName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主要负责人
|
* 主要负责人
|
||||||
*/
|
*/
|
||||||
private Long zyfzr;
|
private Long zyfzr;
|
||||||
|
private String zyfzrName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 次要负责人
|
* 次要负责人
|
||||||
*/
|
*/
|
||||||
private Long cyfzr;
|
private Long cyfzr;
|
||||||
|
private String cyfzrName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 责任划分
|
* 责任划分
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全-事故上报业务对象 hse_safety_sgsb
|
* 档案-损失情况信息
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-12-05
|
* @date 2025-12-05
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全-事故上报业务对象 hse_safety_sgsb
|
* 档案-事故详情信息
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-12-05
|
* @date 2025-12-05
|
||||||
|
|||||||
@ -18,7 +18,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全-事故整改闭环业务对象 hse_safety_sgzgbh
|
* 档案-事故整改与复查信息
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-12-05
|
* @date 2025-12-05
|
||||||
|
|||||||
@ -2,8 +2,12 @@ package org.dromara.safety.accident.domain.vo;
|
|||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.safety.accident.domain.HseSafetySgsb;
|
import org.dromara.safety.accident.domain.HseSafetySgsb;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -38,6 +42,8 @@ public class HseSafetySgsbVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "关联项目")
|
@ExcelProperty(value = "关联项目")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
@Translation(type = TransConstant.PROJECT_ID_TO_NAME, mapper = "projectId")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事故编号
|
* 事故编号
|
||||||
@ -162,4 +168,9 @@ public class HseSafetySgsbVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String createByName;
|
private String createByName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,24 +8,24 @@ import java.math.BigDecimal;
|
|||||||
public class SgsbCountVo {
|
public class SgsbCountVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本月上报事故
|
* 本月总上报事故
|
||||||
*/
|
*/
|
||||||
private Long bysbsg;
|
private Long bysbsg;
|
||||||
|
|
||||||
/**
|
|
||||||
* 待处理事故
|
|
||||||
*/
|
|
||||||
private Long dclsg;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已闭环事故
|
* 已闭环事故
|
||||||
*/
|
*/
|
||||||
private Long ybhsg;
|
private Long ybhsg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事故整改完成率
|
* 待整改事故
|
||||||
*/
|
*/
|
||||||
private BigDecimal sgzgwcl;
|
private Long dzgsg;
|
||||||
|
/**
|
||||||
|
* 已整改事故
|
||||||
|
*/
|
||||||
|
private Long yzgsg;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待调查事故
|
* 待调查事故
|
||||||
@ -43,8 +43,8 @@ public class SgsbCountVo {
|
|||||||
private Long ywcdc;
|
private Long ywcdc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待整改事故
|
* 总调查事故
|
||||||
*/
|
*/
|
||||||
private Long dzgsg;
|
private Long zdcsg;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,19 @@ public enum SGStatusEnum {
|
|||||||
/**
|
/**
|
||||||
* 未闭环
|
* 未闭环
|
||||||
*/
|
*/
|
||||||
OPEN_LOOP("1", "未闭环");
|
OPEN_LOOP("1", "未闭环"),
|
||||||
|
|
||||||
|
|
||||||
|
//事故调查保存状态
|
||||||
|
/**
|
||||||
|
* 草稿
|
||||||
|
*/
|
||||||
|
DRAFT("0", "草稿"),
|
||||||
|
/**
|
||||||
|
* 提交
|
||||||
|
*/
|
||||||
|
SUBMIT("1", "提交");
|
||||||
|
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|
||||||
|
|||||||
@ -313,6 +313,8 @@ public class HseSafetySgdcServiceImpl extends ServiceImpl<HseSafetySgdcMapper, H
|
|||||||
sgzg.setSglx(sgsb.getSglx());
|
sgzg.setSglx(sgsb.getSglx());
|
||||||
//事故等级
|
//事故等级
|
||||||
sgzg.setSgdj(sgsb.getSgdj());
|
sgzg.setSgdj(sgsb.getSgdj());
|
||||||
|
//事发时间
|
||||||
|
sgzg.setSfsj(sgsb.getSfsj());
|
||||||
//事故原因
|
//事故原因
|
||||||
sgzg.setSgyy(sgsb.getSgyy());
|
sgzg.setSgyy(sgsb.getSgyy());
|
||||||
//调查人
|
//调查人
|
||||||
@ -325,6 +327,8 @@ public class HseSafetySgdcServiceImpl extends ServiceImpl<HseSafetySgdcMapper, H
|
|||||||
sgzg.setZgStatus(SGStatusEnum.TO_BE_RECTIFIED.getCode());
|
sgzg.setZgStatus(SGStatusEnum.TO_BE_RECTIFIED.getCode());
|
||||||
//整改人
|
//整改人
|
||||||
sgzg.setZgr(sgdc.getZgfzr());
|
sgzg.setZgr(sgdc.getZgfzr());
|
||||||
|
//复查人
|
||||||
|
sgzg.setFcr(sgdc.getFcry());
|
||||||
//是否预期
|
//是否预期
|
||||||
sgzg.setIsFinish("0");
|
sgzg.setIsFinish("0");
|
||||||
//调查id
|
//调查id
|
||||||
@ -343,43 +347,40 @@ public class HseSafetySgdcServiceImpl extends ServiceImpl<HseSafetySgdcMapper, H
|
|||||||
long ddcsg = 0;
|
long ddcsg = 0;
|
||||||
long dczsg = 0;
|
long dczsg = 0;
|
||||||
long ywcdc = 0;
|
long ywcdc = 0;
|
||||||
long dzgsg = 0;
|
long zdcsg = 0;
|
||||||
|
|
||||||
List<HseSafetySgsb> sbList = baseMapper.getSgsbListByProjectId(projectId);
|
List<HseSafetySgsb> sbList = baseMapper.getSgsbListByProjectId(projectId);
|
||||||
|
if (sbList != null && !sbList.isEmpty()){
|
||||||
|
zdcsg = sbList.size();
|
||||||
|
}
|
||||||
for (HseSafetySgsb sgsb : sbList) {
|
for (HseSafetySgsb sgsb : sbList) {
|
||||||
//待调查事故 上报后 审核后 待调查
|
//待调查事故 上报后 审核后 待调查
|
||||||
if (sgsb.getSgzt().equals(SGStatusEnum.UNDER_INVESTIGATION.getCode())){
|
if (sgsb.getSgzt().equals(SGStatusEnum.UNDER_INVESTIGATION.getCode())){
|
||||||
|
HseSafetySgdcVo sgdcVo = baseMapper.selectVoOne(new LambdaQueryWrapper<HseSafetySgdc>().eq(HseSafetySgdc::getSgId, sgsb.getId()));
|
||||||
|
if (sgdcVo != null){
|
||||||
|
//待调查事故 已生成调查事件但还未调查
|
||||||
|
if (sgdcVo.getBczt() == null){
|
||||||
ddcsg++;
|
ddcsg++;
|
||||||
}else if (sgsb.getSgzt().equals(SGStatusEnum.SG_TO_BE_RECTIFIED.getCode())){
|
continue;
|
||||||
//调查中事故 待调查 填写完数据提交后 待整改
|
}
|
||||||
|
//调查中事故 已调查但提交状态为草稿
|
||||||
|
if (SGStatusEnum.DRAFT.getCode().equals(sgdcVo.getBczt())){
|
||||||
dczsg++;
|
dczsg++;
|
||||||
}else if (sgsb.getSgzt().equals(SGStatusEnum.SG_HAS_BEEN_RECTIFIED.getCode())){
|
}
|
||||||
//已完成调查 待整改 -> 已整改
|
}
|
||||||
|
|
||||||
|
}else if (sgsb.getSgzt().equals(SGStatusEnum.SG_TO_BE_RECTIFIED.getCode())){
|
||||||
|
//待整改
|
||||||
ywcdc++;
|
ywcdc++;
|
||||||
}
|
}
|
||||||
//待整改事项 查看整改表关联此调查的数据 整改状态为待整改
|
|
||||||
LambdaQueryWrapper<HseSafetySgdc> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(HseSafetySgdc::getSgId,sgsb.getId());
|
|
||||||
List<HseSafetySgdc> sgdcs = list(queryWrapper);
|
|
||||||
for (HseSafetySgdc sgdc : sgdcs) {
|
|
||||||
//寻找对应整改数据
|
|
||||||
LambdaQueryWrapper<HseSafetySgzgbh> zgqwr = new LambdaQueryWrapper<>();
|
|
||||||
zgqwr.eq(HseSafetySgzgbh::getDcId,sgdc.getId());
|
|
||||||
List<HseSafetySgzgbh> zgs = zgbhService.list(zgqwr);
|
|
||||||
for (HseSafetySgzgbh zg : zgs) {
|
|
||||||
//寻找待整改
|
|
||||||
if (zg.getZgStatus().equals(SGStatusEnum.TO_BE_RECTIFIED.getCode())){
|
|
||||||
dzgsg++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
countVo.setDdcsg(ddcsg);
|
countVo.setDdcsg(ddcsg);
|
||||||
countVo.setDczsg(dczsg);
|
countVo.setDczsg(dczsg);
|
||||||
countVo.setYwcdc(ywcdc);
|
countVo.setYwcdc(ywcdc);
|
||||||
countVo.setDzgsg(dzgsg);
|
countVo.setZdcsg(zdcsg);
|
||||||
|
|
||||||
return countVo;
|
return countVo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
|||||||
import org.dromara.safety.accident.domain.bo.HseSafetySgdcBo;
|
import org.dromara.safety.accident.domain.bo.HseSafetySgdcBo;
|
||||||
import org.dromara.safety.accident.domain.bo.HseSafetySgsbBo;
|
import org.dromara.safety.accident.domain.bo.HseSafetySgsbBo;
|
||||||
import org.dromara.safety.accident.domain.vo.HseSafetySgsbVo;
|
import org.dromara.safety.accident.domain.vo.HseSafetySgsbVo;
|
||||||
|
import org.dromara.safety.accident.domain.vo.HseSafetySgzgbhHeadVo;
|
||||||
import org.dromara.safety.accident.domain.vo.SgsbCountVo;
|
import org.dromara.safety.accident.domain.vo.SgsbCountVo;
|
||||||
import org.dromara.safety.accident.mapper.HseSafetySgsbMapper;
|
import org.dromara.safety.accident.mapper.HseSafetySgsbMapper;
|
||||||
import org.dromara.safety.accident.menu.SGStatusEnum;
|
import org.dromara.safety.accident.menu.SGStatusEnum;
|
||||||
@ -186,68 +187,79 @@ public class HseSafetySgsbServiceImpl extends ServiceImpl<HseSafetySgsbMapper, H
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SgsbCountVo getCount(Long projectId){
|
public SgsbCountVo getCount(Long projectId){
|
||||||
//获取对应列表
|
|
||||||
LambdaQueryWrapper<HseSafetySgsb> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(HseSafetySgsb::getProjectId, projectId);
|
|
||||||
List<HseSafetySgsb> list = this.list(lambdaQueryWrapper);
|
|
||||||
//获取整改对应列表
|
|
||||||
List<HseSafetySgzgbh> zgxxes = baseMapper.getSgzgList();
|
|
||||||
//获取调查列表
|
|
||||||
List<HseSafetySgdc> dcList = sgdcService.list();
|
|
||||||
//初始化统计信息
|
|
||||||
SgsbCountVo sgsbCountVo = new SgsbCountVo();
|
|
||||||
sgsbCountVo.setSgzgwcl(BigDecimal.ZERO);
|
|
||||||
|
|
||||||
long sbsg = 0;
|
SgsbCountVo sgzgbhHeadVo = new SgsbCountVo();
|
||||||
long dclsg = 0;
|
List<HseSafetySgsb> sgzgbhs = this.getBaseMapper().selectList(new LambdaQueryWrapper<HseSafetySgsb>().eq(HseSafetySgsb::getProjectId, projectId).le(HseSafetySgsb::getCreateTime, LocalDate.now().plusDays(1)).ge(HseSafetySgsb::getCreateTime, LocalDate.now().minusDays(29)));
|
||||||
long ybhsg = 0;
|
if (sgzgbhs != null && !sgzgbhs.isEmpty()) {
|
||||||
long zgwc = 0;
|
sgzgbhHeadVo.setBysbsg((long) sgzgbhs.size());
|
||||||
//获取时间
|
sgzgbhHeadVo.setDdcsg(sgzgbhs.stream().filter(jxYhzgbh -> SGStatusEnum.UNDER_INVESTIGATION.getCode().equals(jxYhzgbh.getSgzt())).count());
|
||||||
Date firstDay = getFirstDayOfMonth();
|
sgzgbhHeadVo.setDzgsg(sgzgbhs.stream().filter(jxYhzgbh -> SGStatusEnum.SG_TO_BE_RECTIFIED.getCode().equals(jxYhzgbh.getSgzt())).count());
|
||||||
Date lastDay = getLastDayOfMonth();
|
sgzgbhHeadVo.setYzgsg(sgzgbhs.stream().filter(jxYhzgbh -> SGStatusEnum.SG_HAS_BEEN_RECTIFIED.getCode().equals(jxYhzgbh.getSgzt())).count());
|
||||||
for (HseSafetySgsb hseSafetySgsb : list) {
|
sgzgbhHeadVo.setYbhsg(sgzgbhs.stream().filter(jxYhzgbh -> SGStatusEnum.SG_CLOSED_LOOP_OPERATION.getCode().equals(jxYhzgbh.getSgzt())).count());
|
||||||
//本月上报事故
|
|
||||||
if (hseSafetySgsb.getCreateTime().after(firstDay) && hseSafetySgsb.getCreateTime().before(lastDay)){
|
|
||||||
sbsg++;
|
|
||||||
//本月完成数量
|
|
||||||
for (HseSafetySgdc safetySgdc : dcList) {
|
|
||||||
if (hseSafetySgsb.getId() == safetySgdc.getSgId()){
|
|
||||||
//事故找到 调查 调查寻找整改
|
|
||||||
for (HseSafetySgzgbh zgxx : zgxxes) {
|
|
||||||
if (zgxx.getSgId() == safetySgdc.getId()){
|
|
||||||
//如果调查找到了整改 则查看状态
|
|
||||||
if (zgxx.getIsFinish().equals("1") || zgxx.getIsFinish().equals("3")){
|
|
||||||
zgwc++;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
return sgzgbhHeadVo;
|
||||||
}
|
// //获取对应列表
|
||||||
break;
|
// LambdaQueryWrapper<HseSafetySgsb> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
}
|
// lambdaQueryWrapper.eq(HseSafetySgsb::getProjectId, projectId);
|
||||||
}
|
// List<HseSafetySgsb> list = this.list(lambdaQueryWrapper);
|
||||||
}
|
// //获取整改对应列表
|
||||||
//待处理事故 新增后为已上报 审核通过后向调查新增 状态为草稿 原数据状态改为待调查
|
// List<HseSafetySgzgbh> zgxxes = baseMapper.getSgzgList();
|
||||||
if (hseSafetySgsb.getSgzt().equals(SGStatusEnum.REPORTED.getCode())){
|
// //获取调查列表
|
||||||
dclsg++;
|
// List<HseSafetySgdc> dcList = sgdcService.list();
|
||||||
}
|
// //初始化统计信息
|
||||||
//已闭环事故
|
// SgsbCountVo sgsbCountVo = new SgsbCountVo();
|
||||||
if (hseSafetySgsb.getSgzt().equals(SGStatusEnum.CLOSED_LOOP_OPERATION.getCode())){
|
// sgsbCountVo.setSgzgwcl(BigDecimal.ZERO);
|
||||||
ybhsg++;
|
//
|
||||||
}
|
// long sbsg = 0;
|
||||||
}
|
// long dclsg = 0;
|
||||||
sgsbCountVo.setBysbsg(sbsg);
|
// long ybhsg = 0;
|
||||||
sgsbCountVo.setDclsg(dclsg);
|
// long zgwc = 0;
|
||||||
sgsbCountVo.setYbhsg(ybhsg);
|
// //获取时间
|
||||||
|
// Date firstDay = getFirstDayOfMonth();
|
||||||
BigDecimal wcl;
|
// Date lastDay = getLastDayOfMonth();
|
||||||
if (sbsg == 0){
|
// for (HseSafetySgsb hseSafetySgsb : list) {
|
||||||
wcl = BigDecimal.ZERO;
|
// //本月上报事故
|
||||||
}else {
|
// if (hseSafetySgsb.getCreateTime().after(firstDay) && hseSafetySgsb.getCreateTime().before(lastDay)){
|
||||||
wcl = new BigDecimal(zgwc).divide(new BigDecimal(sbsg), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
|
// sbsg++;
|
||||||
}
|
// //本月完成数量
|
||||||
sgsbCountVo.setSgzgwcl(wcl);
|
// for (HseSafetySgdc safetySgdc : dcList) {
|
||||||
|
// if (hseSafetySgsb.getId() == safetySgdc.getSgId()){
|
||||||
return sgsbCountVo;
|
// //事故找到 调查 调查寻找整改
|
||||||
|
// for (HseSafetySgzgbh zgxx : zgxxes) {
|
||||||
|
// if (zgxx.getSgId() == safetySgdc.getId()){
|
||||||
|
// //如果调查找到了整改 则查看状态
|
||||||
|
// if (zgxx.getIsFinish().equals("1") || zgxx.getIsFinish().equals("3")){
|
||||||
|
// zgwc++;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// //待处理事故 新增后为已上报 审核通过后向调查新增 状态为草稿 原数据状态改为待调查
|
||||||
|
// if (hseSafetySgsb.getSgzt().equals(SGStatusEnum.REPORTED.getCode())){
|
||||||
|
// dclsg++;
|
||||||
|
// }
|
||||||
|
// //已闭环事故
|
||||||
|
// if (hseSafetySgsb.getSgzt().equals(SGStatusEnum.CLOSED_LOOP_OPERATION.getCode())){
|
||||||
|
// ybhsg++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// sgsbCountVo.setBysbsg(sbsg);
|
||||||
|
// sgsbCountVo.setDclsg(dclsg);
|
||||||
|
// sgsbCountVo.setYbhsg(ybhsg);
|
||||||
|
//
|
||||||
|
// BigDecimal wcl;
|
||||||
|
// if (sbsg == 0){
|
||||||
|
// wcl = BigDecimal.ZERO;
|
||||||
|
// }else {
|
||||||
|
// wcl = new BigDecimal(zgwc).divide(new BigDecimal(sbsg), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100));
|
||||||
|
// }
|
||||||
|
// sgsbCountVo.setSgzgwcl(wcl);
|
||||||
|
//
|
||||||
|
// return sgsbCountVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.common.utils.BatchNumberGenerator;
|
import org.dromara.common.utils.BatchNumberGenerator;
|
||||||
import org.dromara.mechanical.jxzgbh.domain.JxYhzgbh;
|
import org.dromara.mechanical.jxzgbh.domain.JxYhzgbh;
|
||||||
import org.dromara.mechanical.jxzgbh.domain.vo.JxZgxxHeadVo;
|
import org.dromara.mechanical.jxzgbh.domain.vo.JxZgxxHeadVo;
|
||||||
@ -26,6 +28,10 @@ import org.dromara.safety.accident.domain.bo.*;
|
|||||||
import org.dromara.safety.accident.domain.vo.*;
|
import org.dromara.safety.accident.domain.vo.*;
|
||||||
import org.dromara.safety.accident.menu.SGStatusEnum;
|
import org.dromara.safety.accident.menu.SGStatusEnum;
|
||||||
import org.dromara.safety.accident.service.*;
|
import org.dromara.safety.accident.service.*;
|
||||||
|
import org.dromara.system.domain.vo.SysDeptVo;
|
||||||
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
|
import org.dromara.system.service.ISysDeptService;
|
||||||
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
import org.dromara.safety.accident.domain.HseSafetySgzgbh;
|
||||||
@ -65,6 +71,12 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
|||||||
@Lazy
|
@Lazy
|
||||||
@Resource
|
@Resource
|
||||||
private IHseSafetySgdcService sgdcService;
|
private IHseSafetySgdcService sgdcService;
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private ISysUserService userService;
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询安全-事故整改闭环
|
* 查询安全-事故整改闭环
|
||||||
@ -199,6 +211,13 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
|||||||
if (sgzgbh == null) {
|
if (sgzgbh == null) {
|
||||||
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
||||||
}
|
}
|
||||||
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
throw new ServiceException("找不到当前登录人信息!!");
|
||||||
|
}
|
||||||
|
if (!sgzgbh.getZgr().equals(loginUser.getUserId())){
|
||||||
|
throw new ServiceException("当前登录人不是整改人不能进行整改填报!!");
|
||||||
|
}
|
||||||
if (SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(sgzgbh.getReviewStatus())) {
|
if (SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(sgzgbh.getReviewStatus())) {
|
||||||
throw new ServiceException("已闭环,不需要再新增整改信息");
|
throw new ServiceException("已闭环,不需要再新增整改信息");
|
||||||
}
|
}
|
||||||
@ -221,6 +240,7 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增复查信息
|
* 新增复查信息
|
||||||
|
*
|
||||||
* @param bo
|
* @param bo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -231,6 +251,13 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
|||||||
if (sgzgbh == null) {
|
if (sgzgbh == null) {
|
||||||
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
throw new ServiceException("找不到整改与闭环信息数据!!!");
|
||||||
}
|
}
|
||||||
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
throw new ServiceException("找不到当前登录人信息!!");
|
||||||
|
}
|
||||||
|
if (!sgzgbh.getFcr().equals(loginUser.getUserId())){
|
||||||
|
throw new ServiceException("当前登录人不是复查人不能进行复查填报!!");
|
||||||
|
}
|
||||||
if (SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(sgzgbh.getReviewStatus())) {
|
if (SGStatusEnum.CLOSED_LOOP_OPERATION.getCode().equals(sgzgbh.getReviewStatus())) {
|
||||||
throw new ServiceException("已闭环,不需要再新增复查信息");
|
throw new ServiceException("已闭环,不需要再新增复查信息");
|
||||||
}
|
}
|
||||||
@ -279,6 +306,17 @@ public class HseSafetySgzgbhServiceImpl extends ServiceImpl<HseSafetySgzgbhMappe
|
|||||||
throw new ServiceException("归档失败,找不到事故调查信息,请联系管理员");
|
throw new ServiceException("归档失败,找不到事故调查信息,请联系管理员");
|
||||||
}
|
}
|
||||||
HseSafetySgdcxqReq sgdcxqReq = BeanUtil.copyProperties(sgdcVo, HseSafetySgdcxqReq.class);
|
HseSafetySgdcxqReq sgdcxqReq = BeanUtil.copyProperties(sgdcVo, HseSafetySgdcxqReq.class);
|
||||||
|
if (sgdcxqReq != null) {
|
||||||
|
if (sgdcxqReq.getZrbm() != null) {
|
||||||
|
sgdcxqReq.setZrbmName(deptService.selectDeptNameById(sgdcxqReq.getZrbm()));
|
||||||
|
}
|
||||||
|
if (sgdcxqReq.getZyfzr() != null) {
|
||||||
|
sgdcxqReq.setZyfzrName(userService.queryNameById(sgdcxqReq.getZyfzr()));
|
||||||
|
}
|
||||||
|
if (sgdcxqReq.getCyfzr() != null) {
|
||||||
|
sgdcxqReq.setCyfzrName(userService.queryNameById(sgdcxqReq.getCyfzr()));
|
||||||
|
}
|
||||||
|
}
|
||||||
sgdanjlBo.setDcxq(JSONUtil.toJsonStr(sgdcxqReq));
|
sgdanjlBo.setDcxq(JSONUtil.toJsonStr(sgdcxqReq));
|
||||||
//事故整改与复查信息填充
|
//事故整改与复查信息填充
|
||||||
HseSafetySgzgbhVo vo = queryById(sgzgbh.getId());
|
HseSafetySgzgbhVo vo = queryById(sgzgbh.getId());
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package org.dromara.safety.enums;
|
|||||||
public enum AqEnums {
|
public enum AqEnums {
|
||||||
|
|
||||||
AQJDZT_S("是否交底", "1"),
|
AQJDZT_S("是否交底", "1"),
|
||||||
AQJDZT_F("是否交底", "2"),
|
AQJDZT_F("是否交底", "0"),
|
||||||
AQWXJX_S("是否存在危险迹象", "1"),
|
AQWXJX_S("是否存在危险迹象", "1"),
|
||||||
AQWXJX_F("是否存在危险迹象", "0");
|
AQWXJX_F("是否存在危险迹象", "0");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user