Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-11-03 13:44:31 +08:00
commit 9769277edc
7 changed files with 82 additions and 83 deletions

View File

@ -990,7 +990,7 @@ public class ResultRecordController extends AbstractController {
/** /**
* 删除 * 删除
*/ */
// http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=267&loginUserId=313 // http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=322&loginUserId=313
@RequestMapping("/new/resultRecordDetail") @RequestMapping("/new/resultRecordDetail")
public R newResultRecordList(RecordDetailDto recordDetailDto) { public R newResultRecordList(RecordDetailDto recordDetailDto) {
if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){ if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){

View File

@ -1,53 +1,73 @@
package com.lz.modules.flow.entity; package com.lz.modules.flow.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
* <p> * <p>
* 菜单权限表
* </p>*流转记录表 * </p>*流转记录表
* @author quyixiao * @author quyixiao
* @since 2020-09-03 * @since 2020-11-03
*/ */
@Data @Data
@TableName("lz_flow_record") @TableName("lz_flow_record")
@ApiModel(value = "流转记录表")
public class FlowRecord implements java.io.Serializable { public class FlowRecord implements java.io.Serializable {
// //
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
//是否删除状态1删除0有效 //是否删除状态1删除0有效
@ApiModelProperty(value = "是否删除状态1删除0有效", name = "isDelete")
private Integer isDelete; private Integer isDelete;
//创建时间 //创建时间
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
private Date gmtCreate; private Date gmtCreate;
//最后修改时间 //最后修改时间
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
private Date gmtModified; private Date gmtModified;
// //
@ApiModelProperty(value = "", name = "departmentLevel")
private String departmentLevel; private String departmentLevel;
//记录 id //记录 id
@ApiModelProperty(value = "记录 id", name = "recordId")
private Long recordId; private Long recordId;
//审批员工 id //审批员工 id
@ApiModelProperty(value = "审批员工 id", name = "approvalStaffId")
private Long approvalStaffId; private Long approvalStaffId;
//审批员工名称 //审批员工名称
@ApiModelProperty(value = "审批员工名称", name = "approvalStaffName")
private String approvalStaffName; private String approvalStaffName;
//流程名称 //流程名称
@ApiModelProperty(value = "流程名称", name = "flowName")
private String flowName; private String flowName;
//record 表中的员工 id //record 表中的员工 id
@ApiModelProperty(value = "record 表中的员工 id", name = "recordStaffId")
private Long recordStaffId; private Long recordStaffId;
//流程 id //流程 id
@ApiModelProperty(value = "流程 id", name = "flowId")
private Long flowId; private Long flowId;
//流程中的第几个步骤 //流程中的第几个步骤
@ApiModelProperty(value = "流程中的第几个步骤", name = "flowIndex")
private Integer flowIndex; private Integer flowIndex;
//0表示正常状态1 表示被驳回无用的流程 //0表示流程未到1 表示流程已走 2 当前流程 3其他人己经审批4跳过
@ApiModelProperty(value = "0表示流程未到1 表示流程已走 2 :当前流程 3其他人己经审批4跳过", name = "status")
private Integer status; private Integer status;
// 员工&权限id // 员工&权限id
@ApiModelProperty(value = " 员工&权限id", name = "flowStaffIdRole")
private String flowStaffIdRole; private String flowStaffIdRole;
//状态名称 //状态名称
@ApiModelProperty(value = "状态名称", name = "statusName")
private String statusName; private String statusName;
//步骤类型0依次1或签同时通知一人通过或拒绝即可2会签同时通知所有人同意才可 //步骤类型0依次1或签同时通知一人通过或拒绝即可2会签同时通知所有人同意才可
@ApiModelProperty(value = "步骤类型0依次1或签同时通知一人通过或拒绝即可2会签同时通知所有人同意才可", name = "type")
private Integer type; private Integer type;
//flow_manager表中id
@ApiModelProperty(value = "flow_manager表中id", name = "processId")
private Long processId;
/** /**
* *
* @return * @return
@ -229,14 +249,14 @@ public class FlowRecord implements java.io.Serializable {
} }
/** /**
* 0表示正常状态1 表示被驳回无用的流程 * 0表示流程未到1 表示流程已走 2 当前流程 3其他人己经审批4跳过
* @return * @return
*/ */
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
/** /**
* 0表示正常状态1 表示被驳回无用的流程 * 0表示流程未到1 表示流程已走 2 当前流程 3其他人己经审批4跳过
* @param status * @param status
*/ */
public void setStatus(Integer status) { public void setStatus(Integer status) {
@ -273,14 +293,36 @@ public class FlowRecord implements java.io.Serializable {
this.statusName = statusName; this.statusName = statusName;
} }
/**
* 步骤类型0依次1或签同时通知一人通过或拒绝即可2会签同时通知所有人同意才可
* @return
*/
public Integer getType() { public Integer getType() {
return type; return type;
} }
/**
* 步骤类型0依次1或签同时通知一人通过或拒绝即可2会签同时通知所有人同意才可
* @param type
*/
public void setType(Integer type) { public void setType(Integer type) {
this.type = type; this.type = type;
} }
/**
* flow_manager表中id
* @return
*/
public Long getProcessId() {
return processId;
}
/**
* flow_manager表中id
* @param processId
*/
public void setProcessId(Long processId) {
this.processId = processId;
}
@Override @Override
public String toString() { public String toString() {
return "FlowRecord{" + return "FlowRecord{" +
@ -299,6 +341,8 @@ public class FlowRecord implements java.io.Serializable {
",status=" + status + ",status=" + status +
",flowStaffIdRole=" + flowStaffIdRole + ",flowStaffIdRole=" + flowStaffIdRole +
",statusName=" + statusName + ",statusName=" + statusName +
",type=" + type +
",processId=" + processId +
"}"; "}";
} }
} }

View File

@ -15,8 +15,11 @@ import java.util.List;
public interface AssessService { public interface AssessService {
PageUtils userTaskList(AssessTaskReq req,Long userId); PageUtils userTaskList(AssessTaskReq req,Long userId);
/**
*
* @param staffRole
* @return null 为全部部门 size = 0 为没有部门
*/
List<Long> roleDepartment(StaffRole staffRole); List<Long> roleDepartment(StaffRole staffRole);
List<Long> roleEvgroup(StaffRole staffRole);
} }

View File

@ -1,5 +1,6 @@
package com.lz.modules.performance.service.impl; package com.lz.modules.performance.service.impl;
import com.alibaba.fastjson.JSON;
import com.lz.common.utils.DateUtils; import com.lz.common.utils.DateUtils;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.common.utils.StringUtil; import com.lz.common.utils.StringUtil;
@ -16,6 +17,7 @@ import com.lz.modules.performance.req.AssessTaskReq;
import com.lz.modules.performance.res.ChartStatisticalRes; import com.lz.modules.performance.res.ChartStatisticalRes;
import com.lz.modules.performance.res.TaskListRes; import com.lz.modules.performance.res.TaskListRes;
import com.lz.modules.performance.service.AssessService; import com.lz.modules.performance.service.AssessService;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.asm.Advice; import net.bytebuddy.asm.Advice;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -34,6 +36,7 @@ import java.util.stream.Collectors;
* @Desc: * @Desc:
* @Date: 2020/10/14 14:59 * @Date: 2020/10/14 14:59
*/ */
@Slf4j
@Service("assessService") @Service("assessService")
public class AssessServiceImpl implements AssessService { public class AssessServiceImpl implements AssessService {
@Autowired @Autowired
@ -82,6 +85,12 @@ public class AssessServiceImpl implements AssessService {
@Override @Override
public List<Long> roleDepartment(StaffRole staffRole) { public List<Long> roleDepartment(StaffRole staffRole) {
if(staffRole == null){
log.info("staffRole 为空");
return Collections.EMPTY_LIST;
}
log.info("获取 roleDepartment,staffRole: " + JSON.toJSONString(staffRole));
// 0 标识全部部门
if (staffRole.getDepartmentId() == 0) { if (staffRole.getDepartmentId() == 0) {
return null; return null;
} }
@ -97,21 +106,9 @@ public class AssessServiceImpl implements AssessService {
List<Long> collect = allDepart.stream().distinct().map(s -> Long.valueOf(s)).collect(Collectors.toList()); List<Long> collect = allDepart.stream().distinct().map(s -> Long.valueOf(s)).collect(Collectors.toList());
return collect; return collect;
} }
log.info("未获取到用户权限对应的部门 roleID: " + staffRole.getId());
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }
} }
@Override
public List<Long> roleEvgroup(StaffRole staffRole) {
if (staffRole.getDepartmentId() == 0) {
return null;
}
else {
return staffRoleEvaluationGroupService.selectEvaluationGroupIdsByRoleId(staffRole.getId());
}
}
} }

View File

@ -796,14 +796,16 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
} }
flowRecord.setApprovalStaffName(staffEntity.getName()); flowRecord.setApprovalStaffName(staffEntity.getName());
flowRecord.setApprovalStaffId(staffEntity.getId()); flowRecord.setApprovalStaffId(staffEntity.getId());
flowRecord.setFlowName(getFlow(flows, flowApprovalRole.getFlowId()).getOptDesc()); flowRecord.setFlowName(getFlow(flows, flowApprovalRole.getFlowId()).getOptDesc());
flowRecord.setRecordStaffId(resultRecord.getStaffId()); flowRecord.setRecordStaffId(resultRecord.getStaffId());
flowRecord.setFlowId(flowApprovalRole.getFlowId()); flowRecord.setFlowId(flowApprovalRole.getFlowId());
FlowChart flowChart = flowService.selectFlowChartByChartId(flowApprovalRole.getFlowId());
flowRecord.setProcessId(flowChart.getProcessId());
String staffRole = StaffRoles.getStaffRole(staffEntity.getId(), StringUtil.strToLongs(flowApprovalRole.getRoleId())); String staffRole = StaffRoles.getStaffRole(staffEntity.getId(), StringUtil.strToLongs(flowApprovalRole.getRoleId()));
if (i == 0) { if (i == 0) {
flowRecord.setStatus(FlowRecordStatusEnums.CURRENT_FLOW_STATUS.getStatus()); flowRecord.setStatus(FlowRecordStatusEnums.CURRENT_FLOW_STATUS.getStatus());
resultRecord.setFlowStaffIdRole(staffRole); resultRecord.setFlowStaffIdRole(staffRole);
FlowChart flowChart = flowService.selectFlowChartByChartId(flowRecord.getFlowId());
resultRecord.setFlowProcess(flowChart.getFlowProcess()); resultRecord.setFlowProcess(flowChart.getFlowProcess());
} else { } else {
flowRecord.setStatus(FlowRecordStatusEnums.UN_TO_STATUS.getStatus()); flowRecord.setStatus(FlowRecordStatusEnums.UN_TO_STATUS.getStatus());
@ -1119,6 +1121,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
List<FlowRecord> currentResultRecords = flowRecordService.selectFlowRecordByRecordIdStatus(recordDetailDto.getResultRecordId(),2); List<FlowRecord> currentResultRecords = flowRecordService.selectFlowRecordByRecordIdStatus(recordDetailDto.getResultRecordId(),2);
if(currentResultRecords !=null && currentResultRecords.size() > 0 ){ if(currentResultRecords !=null && currentResultRecords.size() > 0 ){
FlowRecord currentResultRecord = null; FlowRecord currentResultRecord = null;
if(currentResultRecords.size() == 1 ){
recordDetailDto.setLoginUserId(currentResultRecords.get(0).getApprovalStaffId());
}
for(FlowRecord flowRecord:currentResultRecords){ for(FlowRecord flowRecord:currentResultRecords){
if(flowRecord.getApprovalStaffId().equals(recordDetailDto.getLoginUserId())){ if(flowRecord.getApprovalStaffId().equals(recordDetailDto.getLoginUserId())){
currentResultRecord = flowRecord; currentResultRecord = flowRecord;

View File

@ -20,12 +20,13 @@
<result column="flow_staff_id_role" property="flowStaffIdRole"/> <result column="flow_staff_id_role" property="flowStaffIdRole"/>
<result column="status_name" property="statusName"/> <result column="status_name" property="statusName"/>
<result column="type" property="type"/> <result column="type" property="type"/>
<result column="process_id" property="processId"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, department_level AS departmentLevel, record_id AS recordId, approval_staff_id AS approvalStaffId, approval_staff_name AS approvalStaffName, flow_name AS flowName, record_staff_id AS recordStaffId, flow_id AS flowId, flow_index AS flowIndex, status AS status, flow_staff_id_role AS flowStaffIdRole, status_name AS statusName, type AS type id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, department_level AS departmentLevel, record_id AS recordId, approval_staff_id AS approvalStaffId, approval_staff_name AS approvalStaffName, flow_name AS flowName, record_staff_id AS recordStaffId, flow_id AS flowId, flow_index AS flowIndex, status AS status, flow_staff_id_role AS flowStaffIdRole, status_name AS statusName, type AS type, process_id AS processId
</sql> </sql>
@ -50,6 +51,7 @@
<if test="flowStaffIdRole != null">flow_staff_id_role, </if> <if test="flowStaffIdRole != null">flow_staff_id_role, </if>
<if test="statusName != null">status_name, </if> <if test="statusName != null">status_name, </if>
<if test="type != null">type, </if> <if test="type != null">type, </if>
<if test="processId != null">process_id, </if>
is_delete, is_delete,
gmt_create, gmt_create,
gmt_modified gmt_modified
@ -66,48 +68,13 @@
<if test="flowStaffIdRole != null">#{ flowStaffIdRole}, </if> <if test="flowStaffIdRole != null">#{ flowStaffIdRole}, </if>
<if test="statusName != null">#{ statusName}, </if> <if test="statusName != null">#{ statusName}, </if>
<if test="type != null">#{ type}, </if> <if test="type != null">#{ type}, </if>
<if test="processId != null">#{ processId}, </if>
0, 0,
now(), now(),
now() now()
) )
</insert> </insert>
<insert id="copyFlowRecord" parameterType="FlowRecord" useGeneratedKeys="true" keyProperty="id" >
insert into lz_flow_record(
<if test="departmentLevel != null">department_level, </if>
<if test="recordId != null">record_id, </if>
<if test="approvalStaffId != null">approval_staff_id, </if>
<if test="approvalStaffName != null">approval_staff_name, </if>
<if test="flowName != null">flow_name, </if>
<if test="recordStaffId != null">record_staff_id, </if>
<if test="flowId != null">flow_id, </if>
<if test="flowIndex != null">flow_index, </if>
<if test="status != null">status, </if>
<if test="flowStaffIdRole != null">flow_staff_id_role, </if>
<if test="statusName != null">status_name, </if>
<if test="type != null">type, </if>
is_delete,
gmt_create,
gmt_modified
)values(
<if test="departmentLevel != null">#{ departmentLevel}, </if>
<if test="recordId != null">#{ recordId}, </if>
<if test="approvalStaffId != null">#{ approvalStaffId}, </if>
<if test="approvalStaffName != null">#{ approvalStaffName}, </if>
<if test="flowName != null">#{ flowName}, </if>
<if test="recordStaffId != null">#{ recordStaffId}, </if>
<if test="flowId != null">#{ flowId}, </if>
<if test="flowIndex != null">#{ flowIndex}, </if>
<if test="status != null">#{ status}, </if>
<if test="flowStaffIdRole != null">#{ flowStaffIdRole}, </if>
<if test="statusName != null">#{ statusName}, </if>
<if test="type != null">#{ type}, </if>
0,
#{ gmtCreate},
#{ gmtModified}
)
</insert>
<update id="updateFlowRecordById" parameterType="FlowRecord" > <update id="updateFlowRecordById" parameterType="FlowRecord" >
update update
@ -126,7 +93,8 @@
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="flowStaffIdRole != null">flow_staff_id_role = #{flowStaffIdRole},</if> <if test="flowStaffIdRole != null">flow_staff_id_role = #{flowStaffIdRole},</if>
<if test="statusName != null">status_name = #{statusName},</if> <if test="statusName != null">status_name = #{statusName},</if>
<if test="type != null">type = #{type}</if> <if test="type != null">type = #{type},</if>
<if test="processId != null">process_id = #{processId}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
@ -150,7 +118,8 @@
status = #{status}, status = #{status},
flow_staff_id_role = #{flowStaffIdRole}, flow_staff_id_role = #{flowStaffIdRole},
status_name = #{statusName}, status_name = #{statusName},
type = #{type} type = #{type},
process_id = #{processId}
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
</update> </update>

View File

@ -125,27 +125,8 @@ public class MysqlMain {
} }
List<TablesBean> list = new ArrayList<TablesBean>(); List<TablesBean> list = new ArrayList<TablesBean>();
/*list.add(new TablesBean("lz_evaluation_group"));
list.add(new TablesBean("lz_evaluation_start_staff"));
list.add(new TablesBean("lz_flow_approval_role"));
list.add(new TablesBean("lz_flow_change"));
list.add(new TablesBean("lz_flow_chart"));
list.add(new TablesBean("lz_flow_chart_role"));
list.add(new TablesBean("lz_flow_start"));
list.add(new TablesBean("lz_result_calculate"));
list.add(new TablesBean("lz_result_dimension"));'
list.add(new TablesBean("lz_result_grade"));*/
//list.add(new TablesBean("lz_result_model"));
//list.add(new TablesBean("lz_result_score"));
//list.add(new TablesBean("lz_result_taget_lib"));
//list.add(new TablesBean("lz_flow_chart_detail_record")); list.add(new TablesBean("lz_flow_record"));
//list.add(new TablesBean("lz_flow_approval_role"));
list.add(new TablesBean("lz_staff_menu"));
list.add(new TablesBean("lz_staff_role"));
list.add(new TablesBean("lz_staff_role_evaluation_group"));
list.add(new TablesBean("lz_staff_role_menu"));
List<TablesBean> list2 = new ArrayList<TablesBean>(); List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments(); Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();