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")
public R newResultRecordList(RecordDetailDto recordDetailDto) {
if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){

View File

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

View File

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

View File

@ -1,5 +1,6 @@
package com.lz.modules.performance.service.impl;
import com.alibaba.fastjson.JSON;
import com.lz.common.utils.DateUtils;
import com.lz.common.utils.PageUtils;
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.TaskListRes;
import com.lz.modules.performance.service.AssessService;
import lombok.extern.slf4j.Slf4j;
import net.bytebuddy.asm.Advice;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -34,6 +36,7 @@ import java.util.stream.Collectors;
* @Desc:
* @Date: 2020/10/14 14:59
*/
@Slf4j
@Service("assessService")
public class AssessServiceImpl implements AssessService {
@Autowired
@ -82,6 +85,12 @@ public class AssessServiceImpl implements AssessService {
@Override
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) {
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());
return collect;
}
log.info("未获取到用户权限对应的部门 roleID: " + staffRole.getId());
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.setApprovalStaffId(staffEntity.getId());
flowRecord.setFlowName(getFlow(flows, flowApprovalRole.getFlowId()).getOptDesc());
flowRecord.setRecordStaffId(resultRecord.getStaffId());
flowRecord.setFlowId(flowApprovalRole.getFlowId());
FlowChart flowChart = flowService.selectFlowChartByChartId(flowApprovalRole.getFlowId());
flowRecord.setProcessId(flowChart.getProcessId());
String staffRole = StaffRoles.getStaffRole(staffEntity.getId(), StringUtil.strToLongs(flowApprovalRole.getRoleId()));
if (i == 0) {
flowRecord.setStatus(FlowRecordStatusEnums.CURRENT_FLOW_STATUS.getStatus());
resultRecord.setFlowStaffIdRole(staffRole);
FlowChart flowChart = flowService.selectFlowChartByChartId(flowRecord.getFlowId());
resultRecord.setFlowProcess(flowChart.getFlowProcess());
} else {
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);
if(currentResultRecords !=null && currentResultRecords.size() > 0 ){
FlowRecord currentResultRecord = null;
if(currentResultRecords.size() == 1 ){
recordDetailDto.setLoginUserId(currentResultRecords.get(0).getApprovalStaffId());
}
for(FlowRecord flowRecord:currentResultRecords){
if(flowRecord.getApprovalStaffId().equals(recordDetailDto.getLoginUserId())){
currentResultRecord = flowRecord;

View File

@ -20,12 +20,13 @@
<result column="flow_staff_id_role" property="flowStaffIdRole"/>
<result column="status_name" property="statusName"/>
<result column="type" property="type"/>
<result column="process_id" property="processId"/>
</resultMap>
<!-- 通用查询结果列 -->
<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>
@ -50,6 +51,7 @@
<if test="flowStaffIdRole != null">flow_staff_id_role, </if>
<if test="statusName != null">status_name, </if>
<if test="type != null">type, </if>
<if test="processId != null">process_id, </if>
is_delete,
gmt_create,
gmt_modified
@ -66,48 +68,13 @@
<if test="flowStaffIdRole != null">#{ flowStaffIdRole}, </if>
<if test="statusName != null">#{ statusName}, </if>
<if test="type != null">#{ type}, </if>
<if test="processId != null">#{ processId}, </if>
0,
now(),
now()
)
</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
@ -126,7 +93,8 @@
<if test="status != null">status = #{status},</if>
<if test="flowStaffIdRole != null">flow_staff_id_role = #{flowStaffIdRole},</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>
,gmt_modified = now()
where id = #{id}
@ -150,7 +118,8 @@
status = #{status},
flow_staff_id_role = #{flowStaffIdRole},
status_name = #{statusName},
type = #{type}
type = #{type},
process_id = #{processId}
,gmt_modified = now()
where id = #{id}
</update>

View File

@ -125,27 +125,8 @@ public class MysqlMain {
}
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_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.add(new TablesBean("lz_flow_record"));
List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();