奖惩
This commit is contained in:
@ -11,6 +11,7 @@ import org.dromara.device.domain.bo.DeviceAccessRecordBo;
|
|||||||
import org.dromara.device.domain.vo.DeviceAccessRecordVo;
|
import org.dromara.device.domain.vo.DeviceAccessRecordVo;
|
||||||
import org.dromara.device.domain.vo.DeviceInfoCountVo;
|
import org.dromara.device.domain.vo.DeviceInfoCountVo;
|
||||||
import org.dromara.device.service.IDeviceAccessRecordService;
|
import org.dromara.device.service.IDeviceAccessRecordService;
|
||||||
|
import org.redisson.api.RList;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@ -137,4 +138,13 @@ public class DeviceInfoController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(deviceInfoService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(deviceInfoService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备信息列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/deviceList")
|
||||||
|
public R<List<DeviceInfoVo>> deviceList(DeviceInfoBo bo) {
|
||||||
|
List<DeviceInfoVo> list = deviceInfoService.queryList(bo);
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,5 +95,10 @@ public class DeviceAccessRecordVo implements Serializable {
|
|||||||
@ExcelProperty(value = "详细说明", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "详细说明", converter = ExcelDictConvert.class)
|
||||||
private String details;
|
private String details;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,15 @@ public class QltQualityInspectionUpdateReq implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String inspectionImgFile;
|
private String inspectionImgFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整改单位(1分包 2班组)
|
||||||
|
*/
|
||||||
|
private String rectificationUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整改单位id
|
||||||
|
*/
|
||||||
|
private Long rectificationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班组id
|
* 班组id
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.safety.controller;
|
package org.dromara.safety.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
@ -13,6 +14,12 @@ import org.dromara.contractor.service.ISubContractorService;
|
|||||||
import org.dromara.project.domain.BusProjectTeam;
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
import org.dromara.project.service.IBusProjectTeamService;
|
import org.dromara.project.service.IBusProjectTeamService;
|
||||||
import org.dromara.safety.domain.HseViolationRecord;
|
import org.dromara.safety.domain.HseViolationRecord;
|
||||||
|
import org.dromara.safety.domain.dto.safetyinspection.HseSafetyInspectionQueryReq;
|
||||||
|
import org.dromara.safety.domain.dto.violationrecord.HseViolationRecordQueryReq;
|
||||||
|
import org.dromara.safety.domain.vo.HseRPCountVo;
|
||||||
|
import org.dromara.safety.domain.vo.safetyinspection.HseSafetyInspectionVo;
|
||||||
|
import org.dromara.safety.domain.vo.violationrecord.HseViolationRecordVo;
|
||||||
|
import org.dromara.safety.service.IHseSafetyInspectionService;
|
||||||
import org.dromara.safety.service.IHseViolationRecordService;
|
import org.dromara.safety.service.IHseViolationRecordService;
|
||||||
import org.dromara.system.domain.SysUser;
|
import org.dromara.system.domain.SysUser;
|
||||||
import org.dromara.system.service.ISysUserService;
|
import org.dromara.system.service.ISysUserService;
|
||||||
@ -52,6 +59,8 @@ public class HseRewardsPunishmentsController extends BaseController {
|
|||||||
|
|
||||||
private final ISubConstructionUserService constructionUserService;
|
private final ISubConstructionUserService constructionUserService;
|
||||||
|
|
||||||
|
private final IHseSafetyInspectionService safetyInspectionService;
|
||||||
|
|
||||||
private final IHseViolationRecordService hseViolationRecordService;
|
private final IHseViolationRecordService hseViolationRecordService;
|
||||||
/**
|
/**
|
||||||
* 查询奖惩记录列表
|
* 查询奖惩记录列表
|
||||||
@ -120,6 +129,22 @@ public class HseRewardsPunishmentsController extends BaseController {
|
|||||||
return toAjax(hseRewardsPunishmentsService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(hseRewardsPunishmentsService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/amountCount/{projectId}")
|
||||||
|
public R<HseRPCountVo> amountCount(@PathVariable Long projectId) {
|
||||||
|
return R.ok(hseRewardsPunishmentsService.amountCount(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/typeCount/{projectId}")
|
||||||
|
public R<Map<String, Long>> typeCount(@PathVariable Long projectId) {
|
||||||
|
return R.ok(hseRewardsPunishmentsService.typeCount(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分包单位列表
|
* 分包单位列表
|
||||||
@ -163,8 +188,23 @@ public class HseRewardsPunishmentsController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全工单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/safetyInspectionList")
|
||||||
|
public TableDataInfo<HseSafetyInspectionVo> safetyInspectionList(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
|
||||||
|
req.setCheckCorrectorNull(true);
|
||||||
|
return safetyInspectionService.queryPageListWeb(req, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询AI工单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/aiList")
|
||||||
|
public TableDataInfo<HseViolationRecordVo> aiList(HseViolationRecordQueryReq req, PageQuery pageQuery) {
|
||||||
|
req.setCheckCorrectorNull(true);
|
||||||
|
return hseViolationRecordService.queryPageList(req, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,4 +102,16 @@ public class HseRpObjectController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(hseRpPersonService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(hseRpPersonService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 奖惩对象列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/objectList/{rpId}")
|
||||||
|
public R<List<HseRpPersonVo>> objectList(@PathVariable Long rpId) {
|
||||||
|
HseRpObjectBo bo = new HseRpObjectBo();
|
||||||
|
bo.setRpId(rpId);
|
||||||
|
List<HseRpPersonVo> list = hseRpPersonService.queryList(bo);
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,11 @@ public class HseRewardsPunishments extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String rpCode;
|
private String rpCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型:1-奖励,2-惩罚
|
* 类型:1-奖励,2-惩罚
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,6 +34,8 @@ public class HseRewardsPunishmentsBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String rpCode;
|
private String rpCode;
|
||||||
|
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型:1-奖励,2-惩罚
|
* 类型:1-奖励,2-惩罚
|
||||||
*/
|
*/
|
||||||
@ -86,7 +89,19 @@ public class HseRewardsPunishmentsBo extends BaseEntity {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象信息
|
||||||
*/
|
*/
|
||||||
private List<HseRpObjectBo> persons;
|
private List<HseRpObjectBo> persons;
|
||||||
|
|
||||||
|
|||||||
@ -62,4 +62,7 @@ public class HseSafetyInspectionQueryReq implements Serializable {
|
|||||||
|
|
||||||
|
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
|
|
||||||
|
private Boolean checkCorrectorNull=false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,16 @@ public class HseSafetyInspectionUpdateReq implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String inspectionResult;
|
private String inspectionResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整改单位(1分包 2班组)
|
||||||
|
*/
|
||||||
|
private String rectificationUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 整改单位id
|
||||||
|
*/
|
||||||
|
private Long rectificationId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 整改班组id
|
* 整改班组id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -48,4 +48,6 @@ public class HseViolationRecordQueryReq implements Serializable {
|
|||||||
|
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private Boolean checkCorrectorNull=false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,56 @@
|
|||||||
|
package org.dromara.safety.domain.vo;
|
||||||
|
|
||||||
|
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.excel.annotation.ExcelDictFormat;
|
||||||
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
|
import org.dromara.safety.domain.HseRewardsPunishments;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 奖惩记录视图对象 hse_rewards_punishments
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
* @date 2025-12-04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
@AutoMapper(target = HseRewardsPunishments.class)
|
||||||
|
public class HseRPCountVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总数
|
||||||
|
*/
|
||||||
|
private Integer total;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待审批数量
|
||||||
|
*/
|
||||||
|
private Long waitApproval;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 奖励金额
|
||||||
|
*/
|
||||||
|
private BigDecimal reward;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 惩罚金额
|
||||||
|
*/
|
||||||
|
private BigDecimal penalty;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,9 @@
|
|||||||
package org.dromara.safety.domain.vo;
|
package org.dromara.safety.domain.vo;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.safety.domain.HseRewardsPunishments;
|
import org.dromara.safety.domain.HseRewardsPunishments;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@ -12,7 +15,7 @@ import lombok.Data;
|
|||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,6 +45,8 @@ public class HseRewardsPunishmentsVo implements Serializable {
|
|||||||
@ExcelDictFormat(readConverterExp = "如=RP001")
|
@ExcelDictFormat(readConverterExp = "如=RP001")
|
||||||
private String rpCode;
|
private String rpCode;
|
||||||
|
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型:1-奖励,2-惩罚
|
* 类型:1-奖励,2-惩罚
|
||||||
*/
|
*/
|
||||||
@ -74,6 +79,12 @@ public class HseRewardsPunishmentsVo implements Serializable {
|
|||||||
@ExcelProperty(value = "发起人")
|
@ExcelProperty(value = "发起人")
|
||||||
private Long submitter;
|
private Long submitter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人名称
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "submitter")
|
||||||
|
private String submitterName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 奖惩对象类型(1-分包 2-班组 3-人)
|
* 奖惩对象类型(1-分包 2-班组 3-人)
|
||||||
*/
|
*/
|
||||||
@ -99,11 +110,25 @@ public class HseRewardsPunishmentsVo implements Serializable {
|
|||||||
@ExcelProperty(value = "附件")
|
@ExcelProperty(value = "附件")
|
||||||
private String file;
|
private String file;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件url
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "file")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "备注")
|
@ExcelProperty(value = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 奖惩对象列表
|
||||||
|
*/
|
||||||
|
private List<HseRpPersonVo> rpObjects;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.safety.service;
|
package org.dromara.safety.service;
|
||||||
|
|
||||||
|
import org.dromara.safety.domain.vo.HseRPCountVo;
|
||||||
import org.dromara.safety.domain.vo.HseRewardsPunishmentsVo;
|
import org.dromara.safety.domain.vo.HseRewardsPunishmentsVo;
|
||||||
import org.dromara.safety.domain.bo.HseRewardsPunishmentsBo;
|
import org.dromara.safety.domain.bo.HseRewardsPunishmentsBo;
|
||||||
import org.dromara.safety.domain.HseRewardsPunishments;
|
import org.dromara.safety.domain.HseRewardsPunishments;
|
||||||
@ -7,8 +8,11 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 奖惩记录Service接口
|
* 奖惩记录Service接口
|
||||||
@ -67,4 +71,20 @@ public interface IHseRewardsPunishmentsService extends IService<HseRewardsPunish
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 金额统计
|
||||||
|
*
|
||||||
|
* @param projectId 项目ID
|
||||||
|
*/
|
||||||
|
HseRPCountVo amountCount( Long projectId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型统计
|
||||||
|
*
|
||||||
|
* @param projectId 项目ID
|
||||||
|
*/
|
||||||
|
Map<String, Long> typeCount(Long projectId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -215,7 +215,7 @@ public class HseQuestionUserAnswerServiceImpl extends ServiceImpl<HseQuestionUse
|
|||||||
}
|
}
|
||||||
// 8. 遍历临时对象,进行存储
|
// 8. 遍历临时对象,进行存储
|
||||||
if (CollUtil.isEmpty(tempList)) {
|
if (CollUtil.isEmpty(tempList)) {
|
||||||
return true;
|
throw new ServiceException("压缩包中未解析到施工人员文件");
|
||||||
}
|
}
|
||||||
// 8.1 获取用户身份证列表
|
// 8.1 获取用户身份证列表
|
||||||
Set<String> idCardList = tempList.stream().map(HseQuestionUserAnswerUploadTemp::getUserIdCard)
|
Set<String> idCardList = tempList.stream().map(HseQuestionUserAnswerUploadTemp::getUserIdCard)
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
package org.dromara.safety.service.impl;
|
package org.dromara.safety.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||||
|
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||||
|
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||||
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
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;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -9,16 +15,26 @@ 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.design.domain.DesScheme;
|
||||||
|
import org.dromara.safety.domain.HseRpObject;
|
||||||
|
import org.dromara.safety.domain.bo.HseRpObjectBo;
|
||||||
|
import org.dromara.safety.domain.vo.HseRPCountVo;
|
||||||
|
import org.dromara.safety.domain.vo.HseRpPersonVo;
|
||||||
|
import org.dromara.safety.service.IHseRpObjectService;
|
||||||
|
import org.dromara.system.domain.vo.SysDictDataVo;
|
||||||
|
import org.dromara.system.service.ISysDictTypeService;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.safety.domain.bo.HseRewardsPunishmentsBo;
|
import org.dromara.safety.domain.bo.HseRewardsPunishmentsBo;
|
||||||
import org.dromara.safety.domain.vo.HseRewardsPunishmentsVo;
|
import org.dromara.safety.domain.vo.HseRewardsPunishmentsVo;
|
||||||
import org.dromara.safety.domain.HseRewardsPunishments;
|
import org.dromara.safety.domain.HseRewardsPunishments;
|
||||||
import org.dromara.safety.mapper.HseRewardsPunishmentsMapper;
|
import org.dromara.safety.mapper.HseRewardsPunishmentsMapper;
|
||||||
import org.dromara.safety.service.IHseRewardsPunishmentsService;
|
import org.dromara.safety.service.IHseRewardsPunishmentsService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.math.BigDecimal;
|
||||||
import java.util.Map;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 奖惩记录Service业务层处理
|
* 奖惩记录Service业务层处理
|
||||||
@ -28,10 +44,14 @@ import java.util.Collection;
|
|||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPunishmentsMapper, HseRewardsPunishments> implements IHseRewardsPunishmentsService {
|
public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPunishmentsMapper, HseRewardsPunishments> implements IHseRewardsPunishmentsService {
|
||||||
|
|
||||||
private final HseRewardsPunishmentsMapper baseMapper;
|
private final HseRewardsPunishmentsMapper baseMapper;
|
||||||
|
|
||||||
|
private final IHseRpObjectService rpObjectService;
|
||||||
|
|
||||||
|
private final ISysDictTypeService dictTypeService;
|
||||||
/**
|
/**
|
||||||
* 查询奖惩记录
|
* 查询奖惩记录
|
||||||
*
|
*
|
||||||
@ -40,7 +60,12 @@ public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPuni
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HseRewardsPunishmentsVo queryById(Long id){
|
public HseRewardsPunishmentsVo queryById(Long id){
|
||||||
return baseMapper.selectVoById(id);
|
HseRewardsPunishmentsVo hseRewardsPunishmentsVo = baseMapper.selectVoById(id);
|
||||||
|
HseRpObjectBo hseRpObjectBo = new HseRpObjectBo();
|
||||||
|
hseRpObjectBo.setRpId(id);
|
||||||
|
List<HseRpPersonVo> hseRpPersonVos = rpObjectService.queryList(hseRpObjectBo);
|
||||||
|
hseRewardsPunishmentsVo.setRpObjects(hseRpPersonVos);
|
||||||
|
return hseRewardsPunishmentsVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,6 +98,7 @@ public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPuni
|
|||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<HseRewardsPunishments> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<HseRewardsPunishments> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByDesc(HseRewardsPunishments::getId);
|
lqw.orderByDesc(HseRewardsPunishments::getId);
|
||||||
|
lqw.eq(bo.getProjectId()!=null, HseRewardsPunishments::getProjectId, bo.getProjectId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getRpCode()), HseRewardsPunishments::getRpCode, bo.getRpCode());
|
lqw.eq(StringUtils.isNotBlank(bo.getRpCode()), HseRewardsPunishments::getRpCode, bo.getRpCode());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getType()), HseRewardsPunishments::getType, bo.getType());
|
lqw.eq(StringUtils.isNotBlank(bo.getType()), HseRewardsPunishments::getType, bo.getType());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), HseRewardsPunishments::getCategory, bo.getCategory());
|
lqw.eq(StringUtils.isNotBlank(bo.getCategory()), HseRewardsPunishments::getCategory, bo.getCategory());
|
||||||
@ -83,6 +109,7 @@ public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPuni
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), HseRewardsPunishments::getStatus, bo.getStatus());
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), HseRewardsPunishments::getStatus, bo.getStatus());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getReason()), HseRewardsPunishments::getReason, bo.getReason());
|
lqw.eq(StringUtils.isNotBlank(bo.getReason()), HseRewardsPunishments::getReason, bo.getReason());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getFile()), HseRewardsPunishments::getFile, bo.getFile());
|
lqw.eq(StringUtils.isNotBlank(bo.getFile()), HseRewardsPunishments::getFile, bo.getFile());
|
||||||
|
lqw.between(bo.getStartTime()!=null && bo.getEndTime()!=null, HseRewardsPunishments::getCreateTime, bo.getStartTime(), bo.getEndTime());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +120,7 @@ public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPuni
|
|||||||
* @return 是否新增成功
|
* @return 是否新增成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean insertByBo(HseRewardsPunishmentsBo bo) {
|
public Boolean insertByBo(HseRewardsPunishmentsBo bo) {
|
||||||
HseRewardsPunishments add = MapstructUtils.convert(bo, HseRewardsPunishments.class);
|
HseRewardsPunishments add = MapstructUtils.convert(bo, HseRewardsPunishments.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
@ -100,6 +128,18 @@ public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPuni
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setId(add.getId());
|
bo.setId(add.getId());
|
||||||
}
|
}
|
||||||
|
List<HseRpObject> hseRpObjects = new ArrayList<>();
|
||||||
|
for (HseRpObjectBo item : bo.getPersons()) {
|
||||||
|
HseRpObject hseRpObject = new HseRpObject();
|
||||||
|
hseRpObject.setRpId(add.getId());
|
||||||
|
hseRpObject.setObjectId(item.getObjectId());
|
||||||
|
hseRpObject.setObjectName(item.getObjectName());
|
||||||
|
hseRpObject.setAmount(item.getAmount());
|
||||||
|
hseRpObjects.add(hseRpObject);
|
||||||
|
}
|
||||||
|
if (!hseRpObjects.isEmpty()) {
|
||||||
|
rpObjectService.saveBatch(hseRpObjects);
|
||||||
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,4 +177,88 @@ public class HseRewardsPunishmentsServiceImpl extends ServiceImpl<HseRewardsPuni
|
|||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HseRPCountVo amountCount(Long projectId) {
|
||||||
|
List<HseRewardsPunishments> list = lambdaQuery().eq(HseRewardsPunishments::getProjectId, projectId).list();
|
||||||
|
HseRPCountVo hseRPCountVo = new HseRPCountVo();
|
||||||
|
hseRPCountVo.setTotal(list.size());
|
||||||
|
hseRPCountVo.setWaitApproval(list.stream().filter(item -> BusinessStatusEnum.WAITING.getStatus().equals(item.getStatus())).count());
|
||||||
|
hseRPCountVo.setReward(list.stream().filter(item -> "1".equals(item.getType())).map(HseRewardsPunishments::getAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||||
|
hseRPCountVo.setPenalty(list.stream().filter(item -> "2".equals(item.getType())).map(HseRewardsPunishments::getAmount).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
||||||
|
return hseRPCountVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Long> typeCount(Long projectId) {
|
||||||
|
List<HseRewardsPunishments> list = lambdaQuery().eq(HseRewardsPunishments::getProjectId, projectId).list();
|
||||||
|
|
||||||
|
// 按category分组并统计数量
|
||||||
|
Map<String, Long> categoryCountMap = list.stream()
|
||||||
|
// 过滤空分类(可选,根据业务需求决定是否保留null分类)
|
||||||
|
.filter(item -> item.getCategory() != null && !item.getCategory().trim().isEmpty())
|
||||||
|
// 分组字段:category,统计方式:计数
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
HseRewardsPunishments::getCategory, // 分组依据
|
||||||
|
Collectors.counting() // 统计每个分组的数量
|
||||||
|
));
|
||||||
|
|
||||||
|
List<SysDictDataVo> workOrderCategory = dictTypeService.selectDictDataByType("work_order_category");
|
||||||
|
Map<String, Long> linkedHashMap = new LinkedHashMap<>();
|
||||||
|
for (SysDictDataVo item : workOrderCategory) {
|
||||||
|
linkedHashMap.put(item.getDictLabel(), categoryCountMap.getOrDefault(item.getDictValue(), 0L));
|
||||||
|
}
|
||||||
|
return linkedHashMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||||
|
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||||
|
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||||
|
*
|
||||||
|
* @param processEvent 参数
|
||||||
|
*/
|
||||||
|
@org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('RewardsPunishments')")
|
||||||
|
public void processHandler(ProcessEvent processEvent) {
|
||||||
|
log.info("设计方案审核任务执行了{}", processEvent.toString());
|
||||||
|
HseRewardsPunishments rewardsPunishments = this.getById(Convert.toLong(processEvent.getBusinessId()));
|
||||||
|
rewardsPunishments.setStatus(processEvent.getStatus());
|
||||||
|
if (processEvent.getSubmit()) {
|
||||||
|
rewardsPunishments.setStatus(BusinessStatusEnum.WAITING.getStatus());
|
||||||
|
}
|
||||||
|
this.updateById(rewardsPunishments);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行任务创建监听
|
||||||
|
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||||
|
* 在方法中判断流程节点key
|
||||||
|
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||||
|
* //执行业务逻辑
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* @param processTaskEvent 参数
|
||||||
|
*/
|
||||||
|
@org.springframework.context.event.EventListener(condition = "#processTaskEvent.flowCode.endsWith('completeScheme')")
|
||||||
|
public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
|
||||||
|
log.info("设计方案审核任务创建了{}", processTaskEvent.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听删除流程事件
|
||||||
|
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||||
|
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||||
|
*
|
||||||
|
* @param processDeleteEvent 参数
|
||||||
|
*/
|
||||||
|
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('completeScheme')")
|
||||||
|
public void processDeleteHandler(ProcessDeleteEvent processDeleteEvent) {
|
||||||
|
log.info("监听删除流程事件,设计方案审核任务执行了{}", processDeleteEvent.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -395,6 +395,7 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
|||||||
String status = req.getStatus();
|
String status = req.getStatus();
|
||||||
String reviewType = req.getReviewType();
|
String reviewType = req.getReviewType();
|
||||||
// 精准查询
|
// 精准查询
|
||||||
|
lqw.isNotNull(req.getCheckCorrectorNull(), HseSafetyInspection::getCorrectorId);
|
||||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), HseSafetyInspection::getProjectId, projectId);
|
lqw.eq(ObjectUtils.isNotEmpty(projectId), HseSafetyInspection::getProjectId, projectId);
|
||||||
lqw.like(StringUtils.isNotBlank(checkProject), HseSafetyInspection::getCheckProject, checkProject);
|
lqw.like(StringUtils.isNotBlank(checkProject), HseSafetyInspection::getCheckProject, checkProject);
|
||||||
lqw.eq(ObjectUtils.isNotEmpty(rectificationId), HseSafetyInspection::getRectificationId, rectificationId);
|
lqw.eq(ObjectUtils.isNotEmpty(rectificationId), HseSafetyInspection::getRectificationId, rectificationId);
|
||||||
|
|||||||
@ -21,10 +21,7 @@ import org.dromara.common.sse.dto.SseMessageDto;
|
|||||||
import org.dromara.common.sse.utils.SseMessageUtils;
|
import org.dromara.common.sse.utils.SseMessageUtils;
|
||||||
import org.dromara.project.domain.BusProjectTeamMember;
|
import org.dromara.project.domain.BusProjectTeamMember;
|
||||||
import org.dromara.project.service.IBusProjectTeamMemberService;
|
import org.dromara.project.service.IBusProjectTeamMemberService;
|
||||||
import org.dromara.safety.domain.HseRecognizeRecord;
|
import org.dromara.safety.domain.*;
|
||||||
import org.dromara.safety.domain.HseViolationLevel;
|
|
||||||
import org.dromara.safety.domain.HseViolationLevelRole;
|
|
||||||
import org.dromara.safety.domain.HseViolationRecord;
|
|
||||||
import org.dromara.safety.domain.dto.violationrecord.*;
|
import org.dromara.safety.domain.dto.violationrecord.*;
|
||||||
import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum;
|
import org.dromara.safety.domain.enums.HseSafetyInspectionReviewTypeEnum;
|
||||||
import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum;
|
import org.dromara.safety.domain.enums.HseSafetyInspectionStatusEnum;
|
||||||
@ -343,6 +340,7 @@ public class HseViolationRecordServiceImpl extends ServiceImpl<HseViolationRecor
|
|||||||
String violationType = req.getViolationType();
|
String violationType = req.getViolationType();
|
||||||
LocalDate violationTime = req.getViolationTime();
|
LocalDate violationTime = req.getViolationTime();
|
||||||
Long correctorId = req.getCorrectorId();
|
Long correctorId = req.getCorrectorId();
|
||||||
|
lqw.isNotNull(req.getCheckCorrectorNull(), HseViolationRecord::getCorrectorId);
|
||||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), HseViolationRecord::getProjectId, projectId);
|
lqw.eq(ObjectUtils.isNotEmpty(projectId), HseViolationRecord::getProjectId, projectId);
|
||||||
lqw.eq(StringUtils.isNotBlank(violationType), HseViolationRecord::getViolationType, violationType);
|
lqw.eq(StringUtils.isNotBlank(violationType), HseViolationRecord::getViolationType, violationType);
|
||||||
lqw.eq(ObjectUtils.isNotEmpty(correctorId), HseViolationRecord::getCorrectorId, correctorId);
|
lqw.eq(ObjectUtils.isNotEmpty(correctorId), HseViolationRecord::getCorrectorId, correctorId);
|
||||||
|
|||||||
Reference in New Issue
Block a user