Commit fe8c14a1 authored by chenhao's avatar chenhao

提交修改流程信息的代码 陈浩

parent efe3224c
package com.yeejoin.amos.boot.module.common.api.entity; package com.yeejoin.amos.boot.module.common.api.entity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/** /**
* 流程日志 * 流程日志
...@@ -16,12 +17,16 @@ import java.util.Date; ...@@ -16,12 +17,16 @@ import java.util.Date;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) //@Accessors(chain = true)
@TableName("cb_failure_repairlog") @TableName("cb_failure_repairlog")
public class FailureRepairlog extends BaseEntity { public class FailureRepairlog extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 流程处理人
*/
@TableField("process_auditor_id")
private Long processAuditorId;
/** /**
* 流程处理人 * 流程处理人
*/ */
...@@ -33,7 +38,11 @@ public class FailureRepairlog extends BaseEntity { ...@@ -33,7 +38,11 @@ public class FailureRepairlog extends BaseEntity {
*/ */
@TableField("process_department") @TableField("process_department")
private String processDepartment; private String processDepartment;
/**
* 处理人所属部门Id
*/
@TableField("process_department_id")
private Long processDepartmentId;
/** /**
* 流程处理结果 * 流程处理结果
*/ */
......
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
/** /**
* 流程日志接口类 * 流程日志接口类
...@@ -8,5 +9,8 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -8,5 +9,8 @@ package com.yeejoin.amos.boot.module.common.api.service;
* @date 2021-08-12 * @date 2021-08-12
*/ */
public interface IFailureRepairlogService { public interface IFailureRepairlogService {
public FailureRepairlog findByprocessAuditorId(Long userId);
public FailureRepairlog findByFaultId(Long faultId) ;
} }
...@@ -3,20 +3,17 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -3,20 +3,17 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit; import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum; import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum; import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
......
...@@ -4,12 +4,10 @@ import java.text.SimpleDateFormat; ...@@ -4,12 +4,10 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
import jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -32,14 +30,14 @@ import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; ...@@ -32,14 +30,14 @@ import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit; import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails; import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum; import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FailureDetailsMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService; import com.yeejoin.amos.boot.module.common.api.service.IFailureAuditService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService; import com.yeejoin.amos.boot.module.common.api.service.IFailureDetailsService;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import rx.internal.util.LinkedArrayList;
/** /**
* 服务实现类 * 服务实现类
* *
...@@ -67,6 +65,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -67,6 +65,9 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired @Autowired
FailureRepairlogServiceImpl failureRepairlogService; FailureRepairlogServiceImpl failureRepairlogService;
@Autowired
IFailureRepairlogService failureRepairlog;
public static String EMERGENCY_COMMAND = "应急指挥科"; public static String EMERGENCY_COMMAND = "应急指挥科";
...@@ -303,8 +304,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -303,8 +304,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
} }
// 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致 // 当流程节点为应急指挥科时,需要判断当前用户所在的部门id和前面处理的用户部门id是否一致
if (name.contains(EMERGENCY_COMMAND)) { if (name.contains(EMERGENCY_COMMAND)) {
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(sequenceNbr); FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(sequenceNbr);
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId(); Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) { if (auditDepartmentId.intValue() == seq.intValue()) {
map.put("taskId", detail.getString("id")); map.put("taskId", detail.getString("id"));
map.put("checkFlag", true); map.put("checkFlag", true);
...@@ -345,10 +346,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -345,10 +346,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
wrapper.eq(FailureDetails::getProcessId, procressId); wrapper.eq(FailureDetails::getProcessId, procressId);
FailureDetails failureDetails = this.baseMapper.selectOne(wrapper); FailureDetails failureDetails = this.baseMapper.selectOne(wrapper);
// 通过故障报修单查找创建人的部门ID // 通过故障报修单查找创建人的部门ID
FailureAudit failureAuditDetail = failureAuditService.findByFaultId(failureDetails.getSequenceNbr()); FailureRepairlog failureRepairlog = failureRepairlogService.findByFaultId(failureDetails.getSequenceNbr());
// 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务 // 再去判断当前的任务节点信息是不是维修部门,是的话将于第一次填报保单的操作人部门id进行匹配,符合将视作为一条合法的待办任务
if (task.getString("name").contains(EMERGENCY_COMMAND)) { if (task.getString("name").contains(EMERGENCY_COMMAND)) {
Long auditDepartmentId = failureAuditDetail.getAuditDepartmentId(); Long auditDepartmentId = failureRepairlog.getProcessDepartmentId();
if (auditDepartmentId.intValue() == seq.intValue()) { if (auditDepartmentId.intValue() == seq.intValue()) {
countNum++; countNum++;
continue; continue;
...@@ -378,7 +379,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -378,7 +379,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i)); JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
if(detail.containsKey("operator") && !detail.getString("name").equals("维修中")) { if(detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
//从流程记录表中拿到处理人的名称 //从流程记录表中拿到处理人的名称
detail.replace("operator", null); FailureRepairlog failureRepairlog=failureRepairlogService.findByprocessAuditorId(Long.parseLong(detail.getString("operator")));
detail.replace("operator", failureRepairlog.getProcessAuditor());
list.add(object); list.add(object);
} }
}); });
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureMaintainDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto; import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain; import com.yeejoin.amos.boot.module.common.api.entity.FailureMaintain;
import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum; import com.yeejoin.amos.boot.module.common.api.enums.AuditResultEnum;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum; import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FailureMaintainMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService; import com.yeejoin.amos.boot.module.common.api.service.IFailureMaintainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Date;
import java.util.List;
/** /**
* 服务实现类 * 服务实现类
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit; import com.yeejoin.amos.boot.module.common.api.entity.FailureAudit;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog; import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FailureRepairlogMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService; import com.yeejoin.amos.boot.module.common.api.service.IFailureRepairlogService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/** /**
* 流程日志服务实现类 * 流程日志服务实现类
...@@ -42,4 +45,20 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto ...@@ -42,4 +45,20 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
queryWrapper.eq("fault_id", faultId).orderByAsc("process_time"); queryWrapper.eq("fault_id", faultId).orderByAsc("process_time");
return baseMapper.selectList(queryWrapper); return baseMapper.selectList(queryWrapper);
} }
public FailureRepairlog findByprocessAuditorId(Long userId) {
QueryWrapper<FailureRepairlog> queryWrapper = new QueryWrapper<FailureRepairlog>();
queryWrapper.eq("process_auditor_id", userId);
queryWrapper.last("LIMIT 1");
return baseMapper.selectOne(queryWrapper);
}
public FailureRepairlog findByFaultId(Long faultId) {
LambdaQueryWrapper<FailureRepairlog> wrapper = new LambdaQueryWrapper<FailureRepairlog>();
wrapper.eq(FailureRepairlog::getIsDelete, false);
wrapper.eq(FailureRepairlog::getFaultId, faultId);
wrapper.orderByAsc(FailureRepairlog::getProcessTime);
wrapper.last("LIMIT 1");
return this.baseMapper.selectOne(wrapper);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment