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

This commit is contained in:
杜建超 2020-11-13 11:25:18 +08:00
commit 42a022cbca
17 changed files with 156 additions and 49 deletions

View File

@ -0,0 +1,35 @@
package com.lz.common.emun;
public enum ChartFlowType {
START(0, "目标制定"),
CHECK_RESULT(1, "目标确认"),
PROCESS(2, "执行中"),
INPUT_RESULT(3, "结果录入"),
SCORE(4, "评分"),
END(5, "审批节点"),
;
ChartFlowType(int code, String namee){
this.code = code;
this.name = name;
}
private int code;
private String name;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -52,9 +52,6 @@ public class ShiroConfig {
Map<String, String> filterMap = new LinkedHashMap<>();
filterMap.put("/webjars/**", "anon");
filterMap.put("/file/**", "anon");
filterMap.put("/user/lzstaffrole/role/**", "anon");
filterMap.put("/user/lzresultrecord/**", "anon");
filterMap.put("/user/lzstaffrole/listByGroupId/**", "anon");
filterMap.put("/test/**", "anon");
filterMap.put("/druid/**", "anon");
filterMap.put("/app/**", "anon");
@ -72,6 +69,7 @@ public class ShiroConfig {
filterMap.put("/dtlg/jump", "anon");
filterMap.put("/luck/getLuckById", "anon");
filterMap.put("/luck/updateLuck", "anon");
filterMap.put("/doc.html**", "anon");
filterMap.put("/**", "oauth2");
shiroFilter.setFilterChainDefinitionMap(filterMap);

View File

@ -1,5 +1,6 @@
package com.lz.modules.app.controller;
import com.lz.common.emun.ChartFlowType;
import com.lz.common.emun.WorkMsgTypeEnum;
import com.lz.common.utils.*;
import com.lz.modules.app.dto.ApprovalDto;
@ -362,7 +363,7 @@ public class ResultRecordController extends AbstractController {
flowChartDetailRecordService.selectFlowChartDetailRecordsByFlowProcess(resultRecord.getEvaluationId(), 4);//获取参与评分的人
List<StaffEntity> staffs = new ArrayList<>();
for (FlowChartDetailRecord record:flowChartDetailRecords
) {
) {
if(record.getOptType().intValue() == -1){
//自己
StaffEntity staffEntity = new StaffEntity();
@ -411,7 +412,7 @@ public class ResultRecordController extends AbstractController {
List<ResultRecortModelDto> resultRecortModelDtos = new ArrayList<>();
BigDecimal weight = BigDecimal.ZERO;
for (ResultModel model:resultModels
) {
) {
ResultRecortModelDto resultRecortModelDto = new ResultRecortModelDto();
BeanUtils.copyProperties(model, resultRecortModelDto);
if(resultRecortModelDto.getWeight().compareTo(BigDecimal.ZERO) == 0){//不限权重的
@ -423,7 +424,7 @@ public class ResultRecordController extends AbstractController {
List<ResultDetailDto> detailDtos =
resultDetailService.selectDtosByRecordId(resultRecord.getId(), model.getType());
for (ResultDetailDto dto:detailDtos
) {
) {
//下面设置计算公式
dto.setCalculate(setCalculateValue(calculateModels, dto)) ;
weight = weight.add(dto.getCheckWeight());
@ -478,6 +479,7 @@ public class ResultRecordController extends AbstractController {
return R.ok().put("data", resultRecordDetailDto);
}
//目前支持已生成对象的不支持当前非对象表中的数据如果要使用请用常量值

View File

@ -13,6 +13,10 @@ public class FlowRecordResp {
private int status;
private int realStatus;
private List<FlowDetailResp> flowDetailRespList;
}

View File

@ -77,4 +77,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
FlowRecord selectFlowRecordByRecordIdMinIdStatus(@Param("resultRecordId") Long resultRecordId, @Param("id") Long id, @Param("status") int status);
int batchUpdateExecution(@Param("recordIds")List<Long> recordIds,@Param("processId") int processId);
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(@Param("id") Long id, @Param("flowProcess") int flowProcess);
}

View File

@ -12,7 +12,7 @@ import java.util.Date;
* <p>
* </p>*业绩详情评分表
* @author quyixiao
* @since 2020-11-09
* @since 2020-11-12
*/
@Data
@ -43,6 +43,9 @@ public class ResultScore implements java.io.Serializable {
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
//评分权重
@ApiModelProperty(value = "评分权重", name = "weight")
private BigDecimal weight;
/**
*
* @return
@ -163,6 +166,21 @@ public class ResultScore implements java.io.Serializable {
this.scoreComment = scoreComment;
}
/**
* 评分权重
* @return
*/
public BigDecimal getWeight() {
return weight;
}
/**
* 评分权重
* @param weight
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
@Override
public String toString() {
return "ResultScore{" +
@ -174,6 +192,7 @@ public class ResultScore implements java.io.Serializable {
",detailId=" + detailId +
",approvalId=" + approvalId +
",scoreComment=" + scoreComment +
",weight=" + weight +
"}";
}
}

View File

@ -31,6 +31,10 @@ public class ResultDetailDto {
@ApiModelProperty(value = "关键结果", name = "keyResult")
private String keyResult;
//评分说明
@ApiModelProperty(value = "计算公式", name = "calculate")
private String calculate;
//考核权重
@ApiModelProperty(value = "考核权重", name = "checkWeight")
private BigDecimal checkWeight;
@ -47,9 +51,7 @@ public class ResultDetailDto {
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
//评分说明
@ApiModelProperty(value = "计算公式", name = "calculate")
private String calculate;
//优先级从大到小
@ApiModelProperty(value = "优先级,从小到大", name = "priority")
private Integer priority;

View File

@ -36,6 +36,10 @@ public class ResultScoreDto {
@ApiModelProperty(value = "所占权重", name = "weight")
private BigDecimal weight;
//评分说明
@ApiModelProperty(value = "计算公式", name = "calculate")
private String calculate;
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;

View File

@ -13,12 +13,12 @@ import java.util.Date;
* 菜单权限表
* </p>*业绩详情评分表
* @author quyixiao
* @since 2020-10-16
* @since 2020-11-12
*/
@Data
@ApiModel(value = "业绩详情评分Req")
@ApiModel(value = "业绩详情评分Req")
public class ResultScoreReq implements java.io.Serializable {
@ApiModelProperty(value = "currPage", name = "当前页码")
@ -52,6 +52,9 @@ public class ResultScoreReq implements java.io.Serializable {
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
//评分权重
@ApiModelProperty(value = "评分权重", name = "weight")
private BigDecimal weight;
/**
*
* @return
@ -157,9 +160,39 @@ public class ResultScoreReq implements java.io.Serializable {
this.approvalId = approvalId;
}
/**
* 评分说明
* @return
*/
public String getScoreComment() {
return scoreComment;
}
/**
* 评分说明
* @param scoreComment
*/
public void setScoreComment(String scoreComment) {
this.scoreComment = scoreComment;
}
/**
* 评分权重
* @return
*/
public BigDecimal getWeight() {
return weight;
}
/**
* 评分权重
* @param weight
*/
public void setWeight(BigDecimal weight) {
this.weight = weight;
}
@Override
public String toString() {
return "ResultScore{" +
return "ResultScoreReq{" +
",id=" + id +
",isDelete=" + isDelete +
",gmtCreate=" + gmtCreate +
@ -167,6 +200,8 @@ public class ResultScoreReq implements java.io.Serializable {
",acquireScore=" + acquireScore +
",detailId=" + detailId +
",approvalId=" + approvalId +
",scoreComment=" + scoreComment +
",weight=" + weight +
"}";
}
}

View File

@ -41,6 +41,6 @@ public interface FlowChartService extends IService<FlowChart> {
List<FlowChartDto> selectFlowChartDtoByFlowManagerId(Long id);
List<FlowChart> selectFlowChartsByGroupId(Long groupId);
//获取前端可设置的权限
List<FlowChartRoleDto> selectCanSetChartRoleByChartId(Long id);
}

View File

@ -74,4 +74,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
List<FlowRecord> selectFlowRecordByResultRecordId(Long resultRecordId);
FlowRecord selectFlowRecordByRecordIdMinIdStatus(Long resultRecordId, Long id, int i);
List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(Long id, int flowProcess);
}

View File

@ -200,5 +200,10 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
return flowRecordMapper.selectFlowRecordByRecordIdMinIdStatus(resultRecordId,id,status);
}
@Override
public List<FlowRecord> selectFlowRecordByRecordIdFlowProcess(Long id, int flowProcess){
return flowRecordMapper.selectFlowRecordByRecordIdFlowProcess(id,flowProcess);
}
}

View File

@ -149,8 +149,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
log.info("无有效考核人员");
R.error(groupStaffs.getEvaluationGroup().getName() + "——无有效考核人员");
}
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole, true)){
//流程流转中中途加人走的流程
EvaluationGroup evaluationGroup =
evaluationGroupService.selectEvaluationGroupByCopyId(groupStaffs.getEvaluationGroup().getId(),flowStart.getId());
switch (start(evaluationGroup, flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole, true)){
case 1:
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置考核模板");
@ -354,8 +356,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
for (ResultModelDto dto:resultModelDtos
) {
dto.setEvaluationGroupId(evaluationGroup.getId());//设置拷贝组的id
//下面拷贝一份考评组信息的维度信息
ResultModel resultModel = new ResultModel();
@ -379,9 +379,16 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//插入备份的考评组指标信息
resultTagetLibService.insertResultTagetLibs(resultTagetLibs);
}
}else{//流程流转中中途加人走的流程
evaluationGroup =
evaluationGroupService.selectEvaluationGroupByCopyId(evaluationGroup.getId(),flowStart.getId());
//拷贝一份流程
for(FlowChartDetailRecord flowChartDetailRecord: flowChartDetailRecords){
flowChartDetailRecord.setId(null);
flowChartDetailRecord.setGmtCreate(null);
flowChartDetailRecord.setGmtModified(null);
flowChartDetailRecord.setEvaluationGroupId(evaluationGroup.getId());
}
flowChartDetailRecordService.saveBatch(flowChartDetailRecords);
}else{
if(evaluationGroup == null){
log.info("无法找到拷贝组信息");
return 5;
@ -474,12 +481,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
return 0;
}
//下面初始化lz_flow流程表 lz_flow_approval_role流程审批表
List<FlowApprovalRole> flowApprovalRoles = new ArrayList<>();
int stepIndex = 0;
@ -545,10 +546,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//依次
stepIndex++;
}
}
//stepIndex++;
if(flowApprovalRole != null){
stepIndex = flowApprovalRole.getStepIndex() + 1;
}
@ -589,9 +587,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
stepIndex++;
}
}
//插入记录/flowChart/saveDetailProcs
if(flowApprovalRoles.size() > 0){
@ -600,12 +595,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//初始化lz_result_details数据
List<ResultDetail> resultDetails = new ArrayList<>();
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
//下面初始化参与人员
for (StaffSimpleInfo staffInfo:staffIds
) {
@ -719,8 +710,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//下面生成ResultDetail对象
for (ResultModelDto modelDto:resultModelDtos
) {
if(modelDto.getTagetLibs() != null && modelDto.getTagetLibs().size() > 0){//模板里面有添加指标
for (ResultTagetLibDto libDto:
modelDto.getTagetLibs()) {
@ -745,9 +734,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
resultDetailService.insertResultDetails(resultDetails);
}
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
//下面通知所有参与考核人员

View File

@ -1146,6 +1146,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
}
FlowRecordResp resp = new FlowRecordResp();
resp.setFlowName(flowRecord.getFlowName());
resp.setRealStatus(flowRecord.getStatus());
resp.setStaffName(flowRecord.getApprovalStaffName());
resp.setStatus(flowRecord.getStatus() == 2 ? 1 : flowRecord.getStatus());
@ -1204,11 +1205,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
for(FlowRecordResp flowRecordResp : flowRecordList){
List<FlowDetailResp> flowDetailResps = flowRecordResp.getFlowDetailRespList();
if(flowDetailResps !=null && flowDetailResps.size() ==1 ){
if(flowDetailResps !=null && flowDetailResps.size() ==1 && flowRecordResp.getRealStatus() == 2){
auth.put("transfer",flowDetailResps.get(0).getTransfer());
auth.put("tiaozhuang",flowDetailResps.get(0).getTiaozhuang());
}
}
Map<String, Object> map = new HashMap<>();
map.put("flowRecordList", flowRecordList);
map.put("resultCommentList", resultCommentList);
@ -1232,7 +1234,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
return auth;
}
public void mySetFlowDetailRespList(List<FlowDetailResp> flowDetailRespList ,FlowRecord flowRecord,Long loginUserId,Long recordStaffId){
FlowDetailResp flowDetailResp = new FlowDetailResp();
flowDetailResp.setCurrentStaffId(flowRecord.getApprovalStaffId());
@ -1251,7 +1252,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
flowDetailResp.setAvatar(staffEntity.getAvatar());
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
flowDetailResp.setDepartName(departmentsEntity.getDepartmentName());
if((new Integer(0).equals(flowRecord.getStatus()) || new Integer(2).equals(flowRecord.getStatus())) && flowRecord.getFlowProcess() != 0 ){
if(new Integer(0).equals(flowRecord.getStatus()) || new Integer(2).equals(flowRecord.getStatus())){
int position = 0 ;
StaffRole staffRole = staffRoleService.selectStaffRolesByStaffIdDepartmentLevelList(loginUserId,
Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName(),RoleEnums.MASTER_PM.getName()}));
@ -1292,6 +1293,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
*/
if(position == 1){ //如果是绩效管理员
initTiaoZhuangZhuangJiao(flowDetailResp,1,1);
if(flowRecord.getFlowProcess() == 0 ){//目标制定有转交但是没有跳过
initTiaoZhuangZhuangJiao(flowDetailResp,0,1);
}
}else if (position == 2 ){ //如果是审批节点人员
Map<String,Integer> auth = getAuth(flowRecord.getFlowStaffIdRole());
if(new Integer(1).equals(auth.get("transfer"))){

View File

@ -171,7 +171,7 @@
</update>
<select id="selectFlowChartDetailRecordsByFlowProcess" resultType="FlowChartDetailRecord" >
select * from lz_flow_chart_detail_record where evaluation_group_id=(select copy_id from lz_evaluation_group where id = #{groupId})
select * from lz_flow_chart_detail_record where evaluation_group_id=#{groupId}
and chart_id = (select id from lz_flow_chart where flow_process = #{flowProcess}) and is_delete = 0 order by step_index asc
</select>

View File

@ -280,5 +280,9 @@
</if>
</update>
<select id="selectFlowRecordByRecordIdFlowProcess" resultType="com.lz.modules.flow.entity.FlowRecord">
select * from lz_flow_record where is_delete = 0 and record_id = #{id} and flow_process = #{flowProcess}
</select>
</mapper>

View File

@ -12,12 +12,13 @@
<result column="detail_id" property="detailId"/>
<result column="approval_id" property="approvalId"/>
<result column="score_comment" property="scoreComment"/>
<result column="weight" property="weight"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight
</sql>
@ -34,6 +35,7 @@
<if test="detailId != null">detail_id, </if>
<if test="approvalId != null">approval_id, </if>
<if test="scoreComment != null">score_comment, </if>
<if test="weight != null">weight, </if>
is_delete,
gmt_create,
gmt_modified
@ -42,6 +44,7 @@
<if test="detailId != null">#{ detailId}, </if>
<if test="approvalId != null">#{ approvalId}, </if>
<if test="scoreComment != null">#{ scoreComment}, </if>
<if test="weight != null">#{ weight}, </if>
0,
now(),
now()
@ -58,7 +61,8 @@
<if test="acquireScore != null">acquire_score = #{acquireScore},</if>
<if test="detailId != null">detail_id = #{detailId},</if>
<if test="approvalId != null">approval_id = #{approvalId},</if>
<if test="scoreComment != null">score_comment = #{scoreComment}</if>
<if test="scoreComment != null">score_comment = #{scoreComment},</if>
<if test="weight != null">weight = #{weight}</if>
</trim>
,gmt_modified = now()
where id = #{id}
@ -74,7 +78,8 @@
acquire_score = #{acquireScore},
detail_id = #{detailId},
approval_id = #{approvalId},
score_comment = #{scoreComment}
score_comment = #{scoreComment},
weight = #{weight}
,gmt_modified = now()
where id = #{id}
</update>