机械安全模块修改

This commit is contained in:
lg
2025-12-05 18:54:36 +08:00
parent 2884699ff2
commit 0db70d3d73
7 changed files with 121 additions and 1 deletions

View File

@ -97,11 +97,27 @@ public class JxAqjcgl extends BaseEntity {
*/
private String riskGrade;
/**
* 整改状态
*/
private String abarbeitungState;
/**
* 整改责任人
*/
private Long abarbeitung;
/**
* 选择分包还是班组
*/
private String rectificationUnit;
/**
* 整改单位
*/
private Long rectificationId;
/**
* 整改日期
*/

View File

@ -57,6 +57,22 @@ public class JxAqjcglBo extends BaseEntity {
*/
private String participants;
/**
* 整改状态
*/
private String abarbeitungState;
/**
* 选择分包还是班组
*/
private String rectificationUnit;
/**
* 整改单位
*/
private Long rectificationId;
/**
* 所属项目(如田东)
*/

View File

@ -71,6 +71,26 @@ public class JxAqjcglVo implements Serializable {
@ExcelProperty(value = "检查人")
private Long inspector;
/**
* 整改状态
*/
private String abarbeitungState;
/**
* 选择分包还是班组
*/
private String rectificationUnit;
/**
* 整改单位
*/
private Long rectificationId;
/**
* 整改单位
*/
private String rectificationName;
/**
* 检查人
*/

View File

@ -1,9 +1,11 @@
package org.dromara.mechanical.jxaqgl.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.enums.InspectionRectificationUnitType;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -11,6 +13,8 @@ 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.contractor.domain.SubContractor;
import org.dromara.contractor.service.ISubContractorService;
import org.dromara.mechanical.jxaqgl.domain.JxAqjcglJcnr;
import org.dromara.mechanical.jxaqgl.domain.JxAqjcglWtxq;
import org.dromara.mechanical.jxaqgl.domain.MonthDateRange;
@ -25,6 +29,9 @@ import org.dromara.mechanical.jxzgbh.domain.bo.JxYhzgbhBo;
import org.dromara.mechanical.jxzgbh.domain.bo.JxZgxxBo;
import org.dromara.mechanical.jxzgbh.service.IJxYhzgbhService;
import org.dromara.mechanical.jxzgbh.service.IJxZgxxService;
import org.dromara.project.domain.BusProjectTeam;
import org.dromara.project.service.IBusProjectService;
import org.dromara.project.service.IBusProjectTeamService;
import org.dromara.system.service.impl.SysOssServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
@ -58,6 +65,12 @@ public class JxAqjcglServiceImpl extends ServiceImpl<JxAqjcglMapper, JxAqjcgl> i
private final SysOssServiceImpl sysOssService;
@Resource
private ISubContractorService contractorService;
@Resource
private IBusProjectTeamService projectTeamService;
@Lazy
@Autowired
private IJxYhzgbhService jxYhzgbhService;
@ -82,6 +95,23 @@ public class JxAqjcglServiceImpl extends ServiceImpl<JxAqjcglMapper, JxAqjcgl> i
List<JxAqjcglJcnr> jxAqjcglJcnrs = jxAqjcglJcnrService.getBaseMapper().selectList(new LambdaQueryWrapper<JxAqjcglJcnr>().eq(JxAqjcglJcnr::getMasterId, jxAqjcglVo.getId()));
jxAqjcglVo.setWtxqBoList(jxAqjcglWtxqs);
jxAqjcglVo.setJcnrList(jxAqjcglJcnrs);
// 关联整改单位信息
Long rectificationId = jxAqjcglVo.getRectificationId();
String rectificationUnit = jxAqjcglVo.getRectificationUnit();
if (rectificationId != null && rectificationUnit != null) {
if (rectificationUnit.equals(InspectionRectificationUnitType.CONTRACTOR.getValue())) {
SubContractor contractor = contractorService.getById(rectificationId);
jxAqjcglVo.setRectificationName(contractor.getName());
} else if (rectificationUnit.equals(InspectionRectificationUnitType.TEAM.getValue())) {
BusProjectTeam team = projectTeamService.getById(rectificationId);
if (team != null) {
jxAqjcglVo.setRectificationName(team.getTeamName());
}
}
}
}
}
@ -179,6 +209,7 @@ public class JxAqjcglServiceImpl extends ServiceImpl<JxAqjcglMapper, JxAqjcgl> i
JxAqjcgl update = MapstructUtils.convert(bo, JxAqjcgl.class);
validEntityBeforeSave(update);
if ("2".equals(bo.getInspectionResult())){
update.setAbarbeitungState("1");
JxYhzgbh jxYhzgbh = jxYhzgbhService.getBaseMapper().selectOne(new LambdaQueryWrapper<JxYhzgbh>().eq(JxYhzgbh::getMasterId, update.getId()));
if (jxYhzgbh != null) throw new ServiceException("该数据已存在整改数据");
// 不通过转为整改数据

View File

@ -1,5 +1,7 @@
package org.dromara.mechanical.jxzgbh.domain.vo;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.mechanical.jxzgbh.domain.JxFcxx;
@ -103,4 +105,15 @@ public class JxFcxxVo implements Serializable {
private Integer sort;
/**
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
}

View File

@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor;
import org.dromara.mechanical.jxaqgl.domain.JxAqjcgl;
import org.dromara.mechanical.jxaqgl.domain.JxAqjcglWtxq;
import org.dromara.mechanical.jxaqgl.domain.MonthDateRange;
import org.dromara.mechanical.jxaqgl.service.IJxAqjcglService;
import org.dromara.mechanical.jxaqgl.service.IJxAqjcglWtxqService;
import org.dromara.mechanical.jxzgbh.domain.JxFcxx;
import org.dromara.mechanical.jxzgbh.domain.JxZgxx;
@ -53,6 +54,8 @@ public class JxYhzgbhServiceImpl extends ServiceImpl<JxYhzgbhMapper, JxYhzgbh> i
private final IJxAqjcglWtxqService jxAqjcglWtxqService;
private final IJxAqjcglService jxAqjcglService;
/**
* 查询机械隐患整改与闭环
*
@ -98,6 +101,7 @@ public class JxYhzgbhServiceImpl extends ServiceImpl<JxYhzgbhMapper, JxYhzgbh> i
public TableDataInfo<JxYhzgbhVo> queryPageList(JxYhzgbhBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<JxYhzgbh> lqw = buildQueryWrapper(bo);
Page<JxYhzgbhVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().forEach(this::saveValue);
return TableDataInfo.build(result);
}
@ -200,6 +204,11 @@ public class JxYhzgbhServiceImpl extends ServiceImpl<JxYhzgbhMapper, JxYhzgbh> i
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean zgPutBo(JxZgxxBo bo) {
// 安全检查记录
if (bo.getMasterId() == null) throw new RuntimeException("主表id不能为空");
JxYhzgbhVo jxYhzgbhVo = this.getBaseMapper().selectVoOne(new LambdaQueryWrapper<JxYhzgbh>().eq(JxYhzgbh::getId, bo.getMasterId()));
jxAqjcglService.getBaseMapper().update(new LambdaUpdateWrapper<JxAqjcgl>().eq(JxAqjcgl::getId, jxYhzgbhVo.getMasterId()).set(JxAqjcgl::getAbarbeitungState, "2"));
Long l = jxZgxxService.getBaseMapper().selectCount(new LambdaQueryWrapper<JxZgxx>().eq(JxZgxx::getMasterId, bo.getMasterId()));
bo.setSort(Integer.parseInt(l+"") + 1);
// 将状态修改为已整改
@ -210,8 +219,14 @@ public class JxYhzgbhServiceImpl extends ServiceImpl<JxYhzgbhMapper, JxYhzgbh> i
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean fcPutBo(JxFcxxBo bo) {
// 不通过修改整改信息状态
if (bo.getReviewOpinion().equals("2")) {
if (bo.getMasterId() == null) throw new RuntimeException("主表id不能为空");
this.getBaseMapper().update(new LambdaUpdateWrapper<JxYhzgbh>().eq(JxYhzgbh::getId, bo.getMasterId()).set(JxYhzgbh::getAbarbeitungState,"1"));
// 安全检查记录
JxYhzgbhVo jxYhzgbhVo = this.getBaseMapper().selectVoOne(new LambdaQueryWrapper<JxYhzgbh>().eq(JxYhzgbh::getId, bo.getMasterId()));
jxAqjcglService.getBaseMapper().update(new LambdaUpdateWrapper<JxAqjcgl>().eq(JxAqjcgl::getId, jxYhzgbhVo.getMasterId()).set(JxAqjcgl::getAbarbeitungState, "1"));
}
this.getBaseMapper().update(new LambdaUpdateWrapper<JxYhzgbh>().eq(JxYhzgbh::getId, bo.getMasterId()).set(JxYhzgbh::getReviewOpinion,bo.getReviewOpinion()));

View File

@ -333,6 +333,16 @@ public class XzdContractMachineryServiceImpl extends ServiceImpl<XzdContractMach
});
iXzdContractAdvanceInfoService.saveBatch(yskx);
}
//印章信息
xzdBusinessChangeService.remove(new LambdaQueryWrapper<XzdBusinessChange>().eq(XzdBusinessChange::getContractChangeId, update.getId()));
if (bo.getSealInfo() != null && !bo.getSealInfo().isEmpty()){
for (XzdBusinessChange sealInfo : bo.getSealInfo()) {
sealInfo.setContractChangeId(update.getId());
sealInfo.setType("13");
}
xzdBusinessChangeService.saveBatch(bo.getSealInfo());
}
/**
* 扣款与奖励项
*/
@ -366,7 +376,6 @@ public class XzdContractMachineryServiceImpl extends ServiceImpl<XzdContractMach
xzdEquipmentLeasingService.saveBatch(bo.getJqlist());
}
return baseMapper.updateById(update) > 0;
}