lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/BusinessCodeConst.java
@@ -116,6 +116,10 @@ String PCR0022 = "PCR0022"; //主管é¨çº§é¢å¯¼ String PCR0023 = "PCR0023"; //ä¸»ç®¡å·¥èº String PCR0024 = "PCR0024"; //å¯é¨çº§é¢å¯¼ String PCR0025 = "PCR0025"; //éè¿ã驳å String APPROVED = "1"; String REJECTED = "2"; lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EamReportProductHazardsEnum.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ package org.jeecg.modules.eam.constant; public enum EamReportProductHazardsEnum { //å¾ æäº¤ PENDING_SUBMIT, //å¾ ä¸»ç®¡å·¥èºç¡®è®¤ PENDING_SUPERIOR_TECHNICAL_CONFIRMATION, //å¾ é¨çº§é¢å¯¼ç¡®è®¤ PENDING_DEPARTMENT_LEADER_CONFIRMATION, //已宿 REPAIR_COMPLETED, //已驳å REJECTED; public static EamReportProductHazardsEnum getInstance(String code) { EamReportProductHazardsEnum[] values = EamReportProductHazardsEnum.values(); for (EamReportProductHazardsEnum value : values) { if (value.name().equals(code)) { return value; } } return null; } } lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportProductHazardsDto.java
@@ -10,6 +10,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -26,7 +27,7 @@ @TableName("eam_report_product_hazards") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) public class EamReportProductHazardsDto { public class EamReportProductHazardsDto extends FlowTaskVo implements Serializable { /**主é®*/ @TableId(type = IdType.ASSIGN_ID) @@ -88,6 +89,10 @@ @Excel(name = "主管工èºç¡®è®¤æè§", width = 15) @ApiModelProperty(value = "主管工èºç¡®è®¤æè§") private String technologistComment; /**主管工èºç¡®è®¤ç»æ*/ @Excel(name = "主管工èºç¡®è®¤ç»æ", width = 15) @ApiModelProperty(value = "主管工èºç¡®è®¤ç»æ") private String technologistResult; /**é¨çº§é¢å¯¼*/ @Excel(name = "é¨çº§é¢å¯¼", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼") @@ -102,6 +107,10 @@ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤æè§", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼ç¡®è®¤æè§") private String deputyDepartmentComment; /**é¨çº§é¢å¯¼ç¡®è®¤ç»æ*/ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤ç»æ", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼ç¡®è®¤ç»æ") private String deputyDepartmentResult; //å表å±ç¤º @TableField(exist = false) private String equipmentCode; @@ -111,4 +120,5 @@ private String equipmentModel; @TableField(exist = false) private String installationPosition; } lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamReportProductHazards.java
@@ -50,6 +50,11 @@ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "æ´æ°æ¥æ") private Date updateTime; /**å 餿 è®°*/ @Excel(name = "å 餿 è®°", width = 15) @ApiModelProperty(value = "å 餿 è®°") @TableLogic private Integer delFlag; /**æ¥ä¿®ID*/ @Excel(name = "æ¥ä¿®ID", width = 15) @ApiModelProperty(value = "æ¥ä¿®ID") @@ -58,6 +63,11 @@ @Excel(name = "设å¤ID", width = 15) @ApiModelProperty(value = "设å¤ID") private String equipmentId; /**ç¡®è®¤ç¶æ*/ @Excel(name = "ç¡®è®¤ç¶æ", width = 15) @ApiModelProperty(value = "ç¡®è®¤ç¶æ") @Dict(dicCode = "confirm_status") private String confirmStatus; /**æä½å·¥*/ @Excel(name = "æä½å·¥", width = 15) @ApiModelProperty(value = "æä½å·¥") @@ -90,6 +100,10 @@ @Excel(name = "主管工èºç¡®è®¤æè§", width = 15) @ApiModelProperty(value = "主管工èºç¡®è®¤æè§") private String technologistComment; /**主管工èºç¡®è®¤ç»æ*/ @Excel(name = "主管工èºç¡®è®¤ç»æ", width = 15) @ApiModelProperty(value = "主管工èºç¡®è®¤ç»æ") private String technologistResult; /**é¨çº§é¢å¯¼*/ @Excel(name = "é¨çº§é¢å¯¼", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼") @@ -104,6 +118,10 @@ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤æè§", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼ç¡®è®¤æè§") private String deputyDepartmentComment; /**é¨çº§é¢å¯¼ç¡®è®¤ç»æ*/ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤ç»æ", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼ç¡®è®¤ç»æ") private String deputyDepartmentResult; //å表å±ç¤º @TableField(exist = false) private String equipmentCode; @@ -113,4 +131,13 @@ private String equipmentModel; @TableField(exist = false) private String installationPosition; /**æ¹æ¬¡å·*/ @TableField(exist = false) private String batchNumber; /**å å·¥é¶ä»¶å·*/ @TableField(exist = false) private String processingPart; /**ä»¶æ°*/ @TableField(exist = false) private String quantity; } lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportProductHazardsMapper.xml
@@ -3,7 +3,8 @@ <mapper namespace="org.jeecg.modules.eam.mapper.EamReportProductHazardsMapper"> <select id="queryPageList" resultType="org.jeecg.modules.eam.request.EamReportProductHazardsQuery"> select erph.*, e.equipment_code, e.equipment_name,e.equipment_model, e.installation_position select erph.*, e.equipment_code, e.equipment_name,e.equipment_model, e.installation_position, arr.processing_part,arr.batch_number,arr.quantity from eam_report_product_hazards erph inner join eam_equipment e on erph.equipment_id = e.id lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/request/EamReportProductHazardsQuery.java
@@ -1,15 +1,13 @@ package org.jeecg.modules.eam.request; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecg.common.aspect.annotation.Dict; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -50,6 +48,11 @@ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "æ´æ°æ¥æ") private Date updateTime; /**å 餿 è®°*/ @Excel(name = "å 餿 è®°", width = 15) @ApiModelProperty(value = "å 餿 è®°") @TableLogic private Integer delFlag; /**æ¥ä¿®ID*/ @Excel(name = "æ¥ä¿®ID", width = 15) @ApiModelProperty(value = "æ¥ä¿®ID") @@ -58,9 +61,15 @@ @Excel(name = "设å¤ID", width = 15) @ApiModelProperty(value = "设å¤ID") private String equipmentId; /**ç¡®è®¤ç¶æ*/ @Excel(name = "ç¡®è®¤ç¶æ", width = 15) @ApiModelProperty(value = "ç¡®è®¤ç¶æ") @Dict(dicCode = "confirm_status") private String confirmStatus; /**æä½å·¥*/ @Excel(name = "æä½å·¥", width = 15) @ApiModelProperty(value = "æä½å·¥") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String confirmer; /**æä½å·¥ç¡®è®¤æ¶é´*/ @Excel(name = "æä½å·¥ç¡®è®¤æ¶é´", width = 15, format = "yyyy-MM-dd") @@ -71,6 +80,7 @@ /**产åæå¤±æ åµ*/ @Excel(name = "产åæå¤±æ åµ", width = 15) @ApiModelProperty(value = "产åæå¤±æ åµ") @Dict(dicCode = "yn") private String productLoss; /**产åæå¤±è´¨éå½±ååæ*/ @Excel(name = "产åæå¤±è´¨éå½±ååæ", width = 15) @@ -79,6 +89,7 @@ /**主管工èº*/ @Excel(name = "主管工èº", width = 15) @ApiModelProperty(value = "主管工èº") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String technologist; /**主管工èºç¡®è®¤æ¶é´*/ @Excel(name = "主管工èºç¡®è®¤æ¶é´", width = 15, format = "yyyy-MM-dd") @@ -90,9 +101,14 @@ @Excel(name = "主管工èºç¡®è®¤æè§", width = 15) @ApiModelProperty(value = "主管工èºç¡®è®¤æè§") private String technologistComment; /**主管工èºç¡®è®¤ç»æ*/ @Excel(name = "主管工èºç¡®è®¤ç»æ", width = 15) @ApiModelProperty(value = "主管工èºç¡®è®¤ç»æ") private String technologistResult; /**é¨çº§é¢å¯¼*/ @Excel(name = "é¨çº§é¢å¯¼", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") private String deputyDepartment; /**é¨çº§é¢å¯¼ç¡®è®¤æ¶é´*/ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤æ¶é´", width = 15, format = "yyyy-MM-dd") @@ -104,6 +120,10 @@ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤æè§", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼ç¡®è®¤æè§") private String deputyDepartmentComment; /**é¨çº§é¢å¯¼ç¡®è®¤ç»æ*/ @Excel(name = "é¨çº§é¢å¯¼ç¡®è®¤ç»æ", width = 15) @ApiModelProperty(value = "é¨çº§é¢å¯¼ç¡®è®¤ç»æ") private String deputyDepartmentResult; //å表å±ç¤º @TableField(exist = false) private String equipmentCode; @@ -115,4 +135,13 @@ private String installationPosition; private String column; private String order; /**æ¹æ¬¡å·*/ @TableField(exist = false) private String batchNumber; /**å å·¥é¶ä»¶å·*/ @TableField(exist = false) private String processingPart; /**ä»¶æ°*/ @TableField(exist = false) private String quantity; } lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamReportProductHazardsService.java
@@ -40,6 +40,12 @@ Result<?> submit(String id); /** * æµç¨å®¡æ ¸ * @param eamReportProductHazardsDto */ Result<?> audit(EamReportProductHazardsDto eamReportProductHazardsDto); /** * å é¤ * @param id * @return lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportAccidentsRegisterServiceImpl.java
@@ -129,6 +129,9 @@ if (StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getEquipmentName())) { queryWrapper.like("e.equipment_name", eamReportAccidentsRegisterQuery.getEquipmentName()); } if (StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getRegisterStatus())) { queryWrapper.eq("aar.register_status", eamReportAccidentsRegisterQuery.getRegisterStatus()); } queryWrapper.eq("aar.del_flag", CommonConstant.DEL_FLAG_0); //æåº if (StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getColumn()) && StringUtils.isNotBlank(eamReportAccidentsRegisterQuery.getOrder())) { @@ -223,7 +226,7 @@ public Result<?> audit(EamReportAccidentsRegisterDto eamReportAccidentsRegisterDto){ EamReportAccidentsRegister eamReportAccidentsRegister = this.baseMapper.selectById(eamReportAccidentsRegisterDto.getId()); if (eamReportAccidentsRegister == null) { throw new JeecgBootException("维修工åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); throw new JeecgBootException("å·¥åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); } // è·åå½åç»å½ç¨æ· LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); @@ -271,6 +274,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getDistrictConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getDistrictConfirm()); values.put("districtResult", eamReportAccidentsRegisterDto.getDistrictResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getDistrictConfirm()); eamReportAccidentsRegister.setDistrict(user.getUsername()); eamReportAccidentsRegister.setDistrictTime(new Date()); @@ -298,6 +302,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getCenterDirectorConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getCenterDirectorConfirm()); values.put("centerDirectorResult", eamReportAccidentsRegisterDto.getCenterDirectorResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getCenterDirectorConfirm()); eamReportAccidentsRegister.setCenterDirector(user.getUsername()); eamReportAccidentsRegister.setCenterDirectorTime(new Date()); @@ -325,6 +330,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getRepairConfirmComment()); values.put("comment", eamReportAccidentsRegisterDto.getRepairConfirmComment()); values.put("repairConfirmResult", eamReportAccidentsRegisterDto.getRepairConfirmResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getRepairConfirmComment()); eamReportAccidentsRegister.setRepairConfirm(user.getUsername()); eamReportAccidentsRegister.setRepairConfirmTime(new Date()); @@ -338,7 +344,7 @@ eamReportAccidentsRegister.setSuggestionTakeSteps(eamReportAccidentsRegisterDto.getSuggestionTakeSteps()); eamReportAccidentsRegister.setSuggestionTakeStepsTime(eamReportAccidentsRegisterDto.getSuggestionTakeStepsTime()); if ("2".equals(eamReportAccidentsRegisterDto.getRepairConfirmResult())){ //ç»´ä¿®ç»é¿æç» //维修工æç» eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.PENDING_REPAIR_TEAM_LEADER.name()); @@ -358,6 +364,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getRepairGroupLeaderComment()); values.put("comment", eamReportAccidentsRegisterDto.getRepairGroupLeaderComment()); values.put("repairGroupLeaderResult", eamReportAccidentsRegisterDto.getRepairGroupLeaderResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getRepairGroupLeaderComment()); eamReportAccidentsRegister.setRepairGroupLeader(user.getUsername()); eamReportAccidentsRegister.setRepairGroupLeaderTime(new Date()); @@ -383,12 +390,13 @@ } values.put("organization",eamReportAccidentsRegisterDto.getRepairDistrictComment()); values.put("comment", eamReportAccidentsRegisterDto.getRepairDistrictComment()); values.put("repairDistrictResult", eamReportAccidentsRegisterDto.getRepairDistrictResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getRepairDistrictComment()); eamReportAccidentsRegister.setRepairDistrict(user.getUsername()); eamReportAccidentsRegister.setRepairDistrictTime(new Date()); eamReportAccidentsRegister.setRepairDistrictResult(eamReportAccidentsRegisterDto.getRepairDistrictResult()); eamReportAccidentsRegister.setRepairDistrictComment(eamReportAccidentsRegisterDto.getRepairDistrictComment()); if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ if ("2".equals(eamReportAccidentsRegisterDto.getRepairDistrictResult())){ //ç»´ä¿®åºé¿æç» eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { @@ -408,6 +416,7 @@ } values.put("organization",eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); values.put("technicalDirectorResult", eamReportAccidentsRegisterDto.getTechnicalDirectorResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); eamReportAccidentsRegister.setCheckAgree(eamReportAccidentsRegisterDto.getCheckAgree()); eamReportAccidentsRegister.setDisagreeReason(eamReportAccidentsRegisterDto.getDisagreeReason()); @@ -417,7 +426,7 @@ eamReportAccidentsRegister.setTechnicalDirectorTime(new Date()); eamReportAccidentsRegister.setTechnicalDirectorResult(eamReportAccidentsRegisterDto.getTechnicalDirectorResult()); eamReportAccidentsRegister.setTechnicalDirectorConfirm(eamReportAccidentsRegisterDto.getTechnicalDirectorConfirm()); if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ if ("2".equals(eamReportAccidentsRegisterDto.getTechnicalDirectorResult())){ //ææ¯è´è´£äººæç» eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { @@ -437,12 +446,13 @@ } values.put("organization",eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); values.put("technicalDirectorLeaderResult", eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); eamReportAccidentsRegister.setTechnicalDirectorLeader(user.getUsername()); eamReportAccidentsRegister.setTechnicalDirectorLeaderTime(new Date()); eamReportAccidentsRegister.setTechnicalDirectorLeaderResult(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderResult()); eamReportAccidentsRegister.setTechnicalDirectorLeaderConfirm(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderConfirm()); if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ if ("2".equals(eamReportAccidentsRegisterDto.getTechnicalDirectorLeaderResult())){ //ææ¯ä¸»ç®¡å®¤çº§é¢å¯¼æç» eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { @@ -456,12 +466,13 @@ } values.put("organization",eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); values.put("comment", eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); values.put("technicalDirectorPartResult", eamReportAccidentsRegisterDto.getTechnicalDirectorPartResult()); eamReportAccidentsRegisterDto.setComment(eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); eamReportAccidentsRegister.setTechnicalDirectorPart(user.getUsername()); eamReportAccidentsRegister.setTechnicalDirectorPartTime(new Date()); eamReportAccidentsRegister.setTechnicalDirectorPartResult(eamReportAccidentsRegisterDto.getTechnicalDirectorPartResult()); eamReportAccidentsRegister.setTechnicalDirectorPartConfirm(eamReportAccidentsRegisterDto.getTechnicalDirectorPartConfirm()); if ("2".equals(eamReportAccidentsRegisterDto.getCenterDirectorResult())){ if ("2".equals(eamReportAccidentsRegisterDto.getTechnicalDirectorPartResult())){ //ææ¯ä¸»ç®¡å®¤çº§é¢å¯¼æç» eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.REJECTED.name()); }else { lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportProductHazardsServiceImpl.java
@@ -1,5 +1,8 @@ package org.jeecg.modules.eam.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -8,22 +11,39 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.flowable.engine.TaskService; import org.flowable.task.api.Task; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.DataBaseConstant; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.eam.constant.BusinessCodeConst; import org.jeecg.modules.eam.constant.EamReportAccidentsRegisterEnum; import org.jeecg.modules.eam.constant.EamReportProductHazardsEnum; import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; import org.jeecg.modules.eam.entity.EamEquipment; import org.jeecg.modules.eam.entity.EamReportAccidentsRegister; import org.jeecg.modules.eam.entity.EamReportProductHazards; import org.jeecg.modules.eam.entity.EamReportRepair; import org.jeecg.modules.eam.mapper.EamReportProductHazardsMapper; import org.jeecg.modules.eam.request.EamReportProductHazardsQuery; import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.service.IEamReportProductHazardsService; import org.jeecg.modules.eam.service.IEamReportRepairService; import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; import org.jeecg.modules.flowable.apithird.service.FlowCommonService; import org.jeecg.modules.flowable.service.IFlowDefinitionService; import org.jeecg.modules.flowable.service.IFlowTaskService; import org.jeecg.modules.system.entity.BaseFactory; import org.jeecg.modules.system.entity.BaseFactoryUser; import org.jeecg.modules.system.service.IBaseFactoryService; import org.jeecg.modules.system.service.IBaseFactoryUserService; import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.vo.UserSelector; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -31,9 +51,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.util.Arrays; import java.util.List; import java.util.Set; import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; /** @@ -43,7 +62,7 @@ * @Version: V1.0 */ @Service("IEamReportProductHazardsService") public class EamReportProductHazardsServiceImpl extends ServiceImpl<EamReportProductHazardsMapper, EamReportProductHazards> implements IEamReportProductHazardsService { public class EamReportProductHazardsServiceImpl extends ServiceImpl<EamReportProductHazardsMapper, EamReportProductHazards> implements IEamReportProductHazardsService, FlowCallBackServiceI { @Autowired private IBaseFactoryUserService baseFactoryUserService; @@ -52,7 +71,25 @@ @Autowired @Lazy private IEamReportRepairService iEamReportRepairService; @Resource private IFlowMyBusinessService flowMyBusinessService; @Resource private TaskService taskService; @Resource private IFlowTaskService flowTaskService; @Autowired private ISysUserService sysUserService; @Resource private FlowCommonService flowCommonService; @Resource private IFlowDefinitionService flowDefinitionService; @Resource private IEamEquipmentService eamEquipmentService; /** * å页å表 * @param page @@ -94,6 +131,13 @@ if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getEquipmentName())) { queryWrapper.like("e.equipment_name", eamReportProductHazardsQuery.getEquipmentName()); } if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getConfirmStatus())) { queryWrapper.eq("erph.confirm_status", eamReportProductHazardsQuery.getConfirmStatus()); } if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getProductLoss())) { queryWrapper.eq("erph.product_loss", eamReportProductHazardsQuery.getProductLoss()); } queryWrapper.eq("erph.del_flag", CommonConstant.DEL_FLAG_0); //æåº if (StringUtils.isNotBlank(eamReportProductHazardsQuery.getColumn()) && StringUtils.isNotBlank(eamReportProductHazardsQuery.getOrder())) { String column = eamReportProductHazardsQuery.getColumn(); @@ -137,7 +181,164 @@ */ @Override public Result<?> submit(String id){ EamReportProductHazards eamReportProductHazards=this.getById(id); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); EamEquipment eamEquipment = eamEquipmentService.getById(eamReportProductHazards.getEquipmentId()); List<UserSelector> userSelectorList = sysUserService.selectOperatorList(eamEquipment.getEquipmentCode(), eamEquipment.getFactoryOrgCode(), BusinessCodeConst.PCR0024); // å¯å¨è®¾å¤äºæ ç»è®°æµç¨ flowCommonService.initActBusiness("设å¤ç¼å·ï¼" + eamEquipment.getEquipmentCode() + ", 设å¤åç§°ï¼" + eamEquipment.getEquipmentName()+"å起产åå®å ¨éæ£ç¡®è®¤æµç¨", eamReportProductHazards.getId(), "IEamReportProductHazardsService", "eam_report_product_hazards", null); Map<String, Object> variables = new HashMap<>(); variables.put("dataId", eamReportProductHazards.getId()); variables.put("organization", "æä½å·¥æäº¤å¯å¨æµç¨"); variables.put("comment", "æä½å·¥æäº¤åå¯å¨æµç¨"); variables.put("proofreading", true); if (CollectionUtils.isEmpty(userSelectorList)) { throw new JeecgBootException("è®¾å¤æªåå¨ä¸»ç®¡å·¥èºï¼æ æ³è¿å ¥ä¸çº§å®¡æ¹ï¼"); }else { List<String> usernameList = userSelectorList.stream().map(UserSelector::getUsername).collect(Collectors.toList()); variables.put("NextAssignee", usernameList); } Result result = flowDefinitionService.startProcessInstanceByKey("eam_report_product_hazards", variables); if (!result.isSuccess()) { return Result.error("æµç¨å¯å¨å¤±è´¥"); } else { eamReportProductHazards.setConfirmer(user.getUsername()); eamReportProductHazards.setConfirmTime(new Date()); eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUPERIOR_TECHNICAL_CONFIRMATION.name()); this.updateById(eamReportProductHazards); return result; } } /** * æµç¨å®¡æ ¸ * @param eamReportProductHazardsDto */ @Override public Result<?> audit(EamReportProductHazardsDto eamReportProductHazardsDto){ EamReportProductHazards eamReportProductHazards = this.baseMapper.selectById(eamReportProductHazardsDto.getId()); if (eamReportProductHazards == null) { throw new JeecgBootException("å·¥åä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); } // è·åå½åç»å½ç¨æ· LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); if (user == null || StrUtil.isBlank(user.getId())) { throw new JeecgBootException("æªè·åå°ç»å½ç¨æ·ï¼è¯·éæ°ç»å½ååè¯ï¼"); } eamReportProductHazardsDto.setAssignee(user.getUsername()); // è·åæµç¨ä¸å¡è®°å½ FlowMyBusiness flowMyBusiness = flowMyBusinessService.getFlowMyBusiness(eamReportProductHazardsDto.getInstanceId()); if (flowMyBusiness == null) { throw new JeecgBootException("æµç¨å®ä¾ä¸åå¨ï¼è¯·å·æ°åéè¯ï¼"); } boolean userAuthorized = isUserAuthorized(flowMyBusiness, user); if (!userAuthorized) { throw new JeecgBootException("ç¨æ·æ ææä½æ¤ä»»å¡ï¼è¯·å·æ°åéè¯ï¼"); } // 认é¢ä»»å¡ if (!claimTask(flowMyBusiness.getTaskId(), user)) { throw new JeecgBootException("ä»»å¡ä¸åå¨ã已宿æå·²è¢«ä»äººè®¤é¢ï¼"); } EamEquipment equipment = eamEquipmentService.getById(eamReportProductHazardsDto.getEquipmentId()); if (equipment == null) { throw new JeecgBootException("设å¤ä¸åå¨ï¼è¯·æ£æ¥ï¼"); } EamReportProductHazardsEnum status = EamReportProductHazardsEnum.getInstance(eamReportProductHazards.getConfirmStatus()); if (status == null) { return null; } //æµç¨åé Map<String, Object> values = new HashMap<>(); List<String> userApprovalList; List<UserSelector> userSelectors; switch (status) { //å¾ ä¸»ç®¡å·¥èºç¡®è®¤ case PENDING_SUPERIOR_TECHNICAL_CONFIRMATION: userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0025); if (CollectionUtil.isEmpty(userSelectors)) { throw new JeecgBootException("è®¾å¤æªåå¨å¯é¨çº§é¢å¯¼ï¼æ æ³è¿å ¥ä¸çº§å®¡æ¹ï¼"); }else{ userApprovalList= userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); values.put("NextAssignee", userApprovalList); values.put("dataId", eamReportProductHazardsDto.getId()); if (StrUtil.isEmpty(eamReportProductHazardsDto.getTechnologistComment())){ eamReportProductHazardsDto.setTechnologistComment(""); } values.put("organization",eamReportProductHazardsDto.getTechnologistComment()); values.put("comment", eamReportProductHazardsDto.getTechnologistComment()); values.put("technologistResult", eamReportProductHazardsDto.getTechnologistResult()); eamReportProductHazardsDto.setComment(eamReportProductHazardsDto.getTechnologistComment()); eamReportProductHazards.setTechnologist(user.getUsername()); eamReportProductHazards.setTechnologistTime(new Date()); eamReportProductHazards.setTechnologistResult(eamReportProductHazardsDto.getTechnologistResult()); eamReportProductHazards.setTechnologistComment(eamReportProductHazardsDto.getTechnologistComment()); if ("2".equals(eamReportProductHazardsDto.getTechnologistResult())){ //ä¸»ç®¡å·¥èºæç» eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REJECTED.name()); }else { eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_DEPARTMENT_LEADER_CONFIRMATION.name()); } } break; //å¾ å¯é¨çº§é¢å¯¼ç¡®è®¤ case PENDING_DEPARTMENT_LEADER_CONFIRMATION: values.put("dataId", eamReportProductHazardsDto.getId()); if (StrUtil.isEmpty(eamReportProductHazardsDto.getDeputyDepartmentComment())){ eamReportProductHazardsDto.setDeputyDepartmentComment(""); } values.put("organization",eamReportProductHazardsDto.getDeputyDepartmentComment()); values.put("comment", eamReportProductHazardsDto.getDeputyDepartmentComment()); values.put("deputyDepartmentResult", eamReportProductHazardsDto.getDeputyDepartmentResult()); eamReportProductHazardsDto.setComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); eamReportProductHazards.setDeputyDepartment(user.getUsername()); eamReportProductHazards.setDeputyDepartmentTime(new Date()); eamReportProductHazards.setDeputyDepartmentResult(eamReportProductHazardsDto.getDeputyDepartmentResult()); eamReportProductHazards.setDeputyDepartmentComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); if ("2".equals(eamReportProductHazardsDto.getDeputyDepartmentResult())){ //å¯é¨çº§é¢å¯¼æç» eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REJECTED.name()); }else { eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REPAIR_COMPLETED.name()); } break; default: throw new JeecgBootException("审æ¹å¤±è´¥"); } eamReportProductHazardsDto.setValues(values); //ä¿åå·¥å this.updateById(eamReportProductHazards); Result result = flowTaskService.complete(eamReportProductHazardsDto); if (!result.isSuccess()) { throw new JeecgBootException("审æ¹å¤±è´¥ï¼è¯·å·æ°æ¥çï¼"); } return Result.ok("å®¡æ¹æå"); } private boolean claimTask(String taskId, LoginUser user) { Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); if (task == null) { return false; } if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { return false; } taskService.claim(taskId, user.getUsername()); return true; } /** * å¤æç¨æ·æ¯å¦æ¥ææ¤æé * @param flowMyBusiness * @param user * @return */ private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) { List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); return todoUsers != null && todoUsers.contains(user.getUsername()); } /** @@ -166,4 +367,26 @@ this.removeById(id); return true; } @Override public void afterFlowHandle(FlowMyBusiness business) { } @Override public Object getBusinessDataById(String dataId) { return null; } @Override public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) { return Collections.emptyMap(); } @Override public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { //è·åä¸ä¸æ¥å¤ç人 Object object = values.get("NextAssignee"); return (List<String>) object; } } lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
@@ -197,6 +197,8 @@ EamReportProductHazards eamReportProductHazards=new EamReportProductHazards(); eamReportProductHazards.setEquipmentId(eamReportRepair.getEquipmentId()); eamReportProductHazards.setReportId(eamReportRepair.getId()); eamReportProductHazards.setDelFlag(Integer.valueOf(CommonConstant.DEFAULT_0)); eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUBMIT.name()); iEamReportProductHazardsService.save(eamReportProductHazards); } if (StrUtil.isNotEmpty(eamReportRepair.getIsAccidentsRegister())&&("1").equals(eamReportRepair.getIsAccidentsRegister())) { @@ -208,7 +210,7 @@ eamReportAccidentsRegister.setRegisterStatus(EamReportAccidentsRegisterEnum.PENDING_SUBMIT.name()); iEamReportAccidentsRegisterService.save(eamReportAccidentsRegister); } //çæç»´ä¿®å·¥å,å¯è½ä¼æé¢åæä½ //çæç»´ä¿®å·¥å EamRepairOrder eamRepairOrder=new EamRepairOrder(); BeanUtils.copyProperties(eamReportRepairRequest, eamRepairOrder); String codeSeq = businessCodeRuleService.generateBusinessCodeSeq(BusinessCodeConst.REPAIR_ORDER_CODE_RULE); lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportAccidentsRegisterController.java
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamReportProductHazardsController.java
@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.util.StrUtil; import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; @@ -19,6 +20,7 @@ import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; import org.jeecg.modules.eam.dto.EamReportRepairDto; import org.jeecg.modules.eam.entity.EamReportProductHazards; import org.jeecg.modules.eam.entity.EamReportRepair; import org.jeecg.modules.eam.request.EamReportProductHazardsQuery; import org.jeecg.modules.eam.service.IEamReportProductHazardsService; @@ -27,6 +29,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.modules.eam.service.IEamReportRepairService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -50,7 +53,8 @@ public class EamReportProductHazardsController extends JeecgController<EamReportProductHazards, IEamReportProductHazardsService> { @Autowired private IEamReportProductHazardsService eamReportProductHazardsService; @Autowired private IEamReportRepairService eamReportRepairService; /** * å页å表æ¥è¯¢ * @@ -85,6 +89,43 @@ public Result<String> add(@RequestBody EamReportProductHazards eamReportProductHazards) { eamReportProductHazardsService.save(eamReportProductHazards); return Result.OK("æ·»å æåï¼"); } /** * æä½å·¥æäº¤-åèµ·æµç¨ * @param id * @return */ @ApiOperation(value = "设å¤äºæ ç»è®°è¡¨-æäº¤", notes = "设å¤äºæ ç»è®°è¡¨-æäº¤") @GetMapping(value = "/submit") public Result<?> submit(String id){ // æ ¡éªé¢åæé LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); if (!BusinessCodeConst.PCR0001.equals(user.getPost())) { return Result.error("æäº¤å¤±è´¥,没ææäº¤æéï¼,éæä½å·¥æäº¤"); } eamReportProductHazardsService.submit(id); return Result.OK("æäº¤æåï¼"); } /** * æçå¾ å æ§è¡/å®¡æ¹ * * @param eamReportProductHazardsDto * @return */ @AutoLog(value = "设å¤äºæ ç»è®°è¡¨-æ§è¡/审æ¹") @ApiOperation(value = "设å¤äºæ ç»è®°è¡¨-æ§è¡/审æ¹", notes = "设å¤äºæ ç»è®°è¡¨-æ§è¡/审æ¹") @PostMapping(value = "/perform") public Result<?> audit(@RequestBody EamReportProductHazardsDto eamReportProductHazardsDto){ if (eamReportProductHazardsDto == null) { return Result.error("审æ¹ç对象ä¸è½ä¸ºç©ºï¼"); } // æ£æ¥è¯·æ±åæ° if (StrUtil.isBlank(eamReportProductHazardsDto.getTaskId()) || StrUtil.isBlank(eamReportProductHazardsDto.getDataId()) || StrUtil.isBlank(eamReportProductHazardsDto.getInstanceId())) { return Result.error("审æ¹ä»»å¡é误æä¸åå¨ï¼"); } return eamReportProductHazardsService.audit(eamReportProductHazardsDto); } /** @@ -148,6 +189,10 @@ if(eamReportProductHazards==null) { return Result.error("æªæ¾å°å¯¹åºæ°æ®"); } EamReportRepair eamReportRepair=eamReportRepairService.getById(eamReportProductHazards.getReportId()); eamReportProductHazards.setBatchNumber(eamReportRepair.getBatchNumber()); eamReportProductHazards.setProcessingPart(eamReportRepair.getProcessingPart()); eamReportProductHazards.setQuantity(eamReportRepair.getQuantity()); return Result.OK(eamReportProductHazards); }