Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
1572d6df84
@ -0,0 +1,88 @@
|
||||
package com.lz.modules.flow.model;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* </p>*考核模板流程记录表
|
||||
* @author quyixiao
|
||||
* @since 2020-10-19
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "考核模板流程记录表ListDto")
|
||||
public class FlowChartDetailRecordListDto {
|
||||
//
|
||||
@ApiModelProperty(value = "结点id,必传", name = "id")
|
||||
private Long id;
|
||||
//考核组ID
|
||||
@ApiModelProperty(value = "考核组ID", name = "evaluationGroupId")
|
||||
private Long evaluationGroupId;
|
||||
//0关闭,1开启
|
||||
@ApiModelProperty(value = "0关闭,1开启", name = "status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "小结点列表", name = "recordSimpleDtos")
|
||||
private List<FlowChartDetailRecordSimpleDto> recordSimpleDtos;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 考核组ID
|
||||
* @return
|
||||
*/
|
||||
public Long getEvaluationGroupId() {
|
||||
return evaluationGroupId;
|
||||
}
|
||||
/**
|
||||
* 考核组ID
|
||||
* @param evaluationGroupId
|
||||
*/
|
||||
public void setEvaluationGroupId(Long evaluationGroupId) {
|
||||
this.evaluationGroupId = evaluationGroupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0关闭,1开启
|
||||
* @return
|
||||
*/
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
/**
|
||||
* 0关闭,1开启
|
||||
* @param status
|
||||
*/
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FlowChartDetailRecordDto{" +
|
||||
",id=" + id +
|
||||
",evaluationGroupId=" + evaluationGroupId +
|
||||
",status=" + status +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
package com.lz.modules.flow.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* </p>*考核模板流程记录表
|
||||
* @author quyixiao
|
||||
* @since 2020-10-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "考核模板流程记录表SimpleDto")
|
||||
public class FlowChartDetailRecordSimpleDto implements java.io.Serializable {
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "是否删除0或者不传,不删除,1删除", name = "isDelete")
|
||||
private Integer isDelete;
|
||||
@ApiModelProperty(value = "人员集合,如果人员中途离职,第二次返回会自动去掉", name = "staffs")
|
||||
private List<StaffSimpleDto> staffs;
|
||||
//-1考核人员自己,0人员id,1一级主管,2二级主管....
|
||||
@ApiModelProperty(value = "-1考核人员自己,0人员id,1一级主管,2二级主管....", name = "optType")
|
||||
private Integer optType;
|
||||
//role id集合,逗号隔开
|
||||
@ApiModelProperty(value = "role id集合,逗号隔开", name = "roleIds")
|
||||
private String roleIds;
|
||||
//步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以)
|
||||
@ApiModelProperty(value = "步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以)", name = "stepType")
|
||||
private Integer stepType;
|
||||
|
||||
//权重,评分时所占权重
|
||||
@ApiModelProperty(value = "权重,评分时所占权重", name = "weight")
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* -1考核人员自己,0人员id,1一级主管,2二级主管....
|
||||
* @return
|
||||
*/
|
||||
public Integer getOptType() {
|
||||
return optType;
|
||||
}
|
||||
/**
|
||||
* -1考核人员自己,0人员id,1一级主管,2二级主管....
|
||||
* @param optType
|
||||
*/
|
||||
public void setOptType(Integer optType) {
|
||||
this.optType = optType;
|
||||
}
|
||||
|
||||
/**
|
||||
* role id集合,逗号隔开
|
||||
* @return
|
||||
*/
|
||||
public String getRoleIds() {
|
||||
return roleIds;
|
||||
}
|
||||
/**
|
||||
* role id集合,逗号隔开
|
||||
* @param roleIds
|
||||
*/
|
||||
public void setRoleIds(String roleIds) {
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以)
|
||||
* @return
|
||||
*/
|
||||
public Integer getStepType() {
|
||||
return stepType;
|
||||
}
|
||||
/**
|
||||
* 步骤类型0:依次,1或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可以)
|
||||
* @param stepType
|
||||
*/
|
||||
public void setStepType(Integer stepType) {
|
||||
this.stepType = stepType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FlowChartDetailRecord{" +
|
||||
",id=" + id +
|
||||
",optType=" + optType +
|
||||
",roleIds=" + roleIds +
|
||||
",stepType=" + stepType +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
package com.lz.modules.flow.model;
|
||||
import com.lz.modules.flow.req.FlowChartDetailRecordListReq;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -36,6 +37,9 @@ public class FlowChartDto {
|
||||
|
||||
@ApiModelProperty(value = "节点权限列表", name = "roleDtos")
|
||||
private List<FlowChartRoleDto> roleDtos;
|
||||
|
||||
@ApiModelProperty(value = "节点详细数据", name = "chartDetails")
|
||||
private FlowChartDetailRecordListDto chartDetails;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
package com.lz.modules.flow.req;
|
||||
import com.lz.modules.flow.model.FlowChartDetailRecordSimpleDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -13,7 +14,7 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "考核模板流程记录表ListDto")
|
||||
@ApiModel(value = "考核模板流程记录表ListReq")
|
||||
public class FlowChartDetailRecordListReq {
|
||||
//
|
||||
@ApiModelProperty(value = "结点id,必传", name = "id")
|
||||
|
||||
@ -18,7 +18,7 @@ import java.util.Date;
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "考核模板流程记录表SimpleDto")
|
||||
@ApiModel(value = "考核模板流程记录表SimpleReq")
|
||||
public class FlowChartDetailRecordSimpleReq implements java.io.Serializable {
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
|
||||
@ -8,9 +8,7 @@ import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.entity.FlowChart;
|
||||
import com.lz.modules.flow.entity.FlowChartDetailRecord;
|
||||
import com.lz.modules.flow.entity.FlowManager;
|
||||
import com.lz.modules.flow.model.FlowChartDetailRecordDto;
|
||||
import com.lz.modules.flow.model.FlowChartDto;
|
||||
import com.lz.modules.flow.model.FlowChartRoleDto;
|
||||
import com.lz.modules.flow.model.*;
|
||||
import com.lz.modules.flow.req.FlowChartDetailRecordListReq;
|
||||
import com.lz.modules.flow.req.FlowChartDetailRecordSimpleReq;
|
||||
import com.lz.modules.flow.service.FlowChartDetailRecordService;
|
||||
@ -48,10 +46,9 @@ public class FlowChartController {
|
||||
private StaffService staffService;
|
||||
|
||||
@GetMapping("/getByFlowManagerId")
|
||||
@ApiOperation("根据Manager Id获取大流程节点")
|
||||
@ApiImplicitParam(name = "id",value = "流程id,绩效请传1", required = true, dataType = "String",paramType = "query")
|
||||
@ApiOperation("获取大流程节点")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChartDto.class)})
|
||||
public R getByFlowManagerId(@RequestParam Long id) {
|
||||
public R getByFlowManagerId(@RequestParam @ApiParam("流程id,绩效请传1") Long id, @RequestParam @ApiParam(value = "考评组id,新建时传0", defaultValue = "0") Long groupId) {
|
||||
FlowManager flowManager = flowManagerService.selectFlowManagerById(id);
|
||||
if(flowManager != null){
|
||||
List<FlowChartDto> flowChartDtos = flowChartService.selectFlowChartDtoByFlowManagerId(flowManager.getId());
|
||||
@ -59,6 +56,42 @@ public class FlowChartController {
|
||||
) {
|
||||
List<FlowChartRoleDto> flowCharts = flowChartService.selectChartRoleByChartId(dto.getId());
|
||||
dto.setRoleDtos(flowCharts);
|
||||
if(groupId > 0){
|
||||
//获取节点已保存的数据
|
||||
FlowChartDetailRecordListDto flowChartDetailRecordListDto = new FlowChartDetailRecordListDto();
|
||||
flowChartDetailRecordListDto.setEvaluationGroupId(groupId);
|
||||
flowChartDetailRecordListDto.setId(dto.getId());
|
||||
List<FlowChartDetailRecordSimpleDto> recordSimpleDtos = new ArrayList<>();
|
||||
List<FlowChartDetailRecord> flowChartDetailRecords =
|
||||
flowChartDetailRecordService.selectFlowChartDetailRecordByGroupIdAndChartId(groupId, dto.getId());
|
||||
|
||||
for (FlowChartDetailRecord record:flowChartDetailRecords
|
||||
) {
|
||||
flowChartDetailRecordListDto.setStatus(dto.getStatus());
|
||||
FlowChartDetailRecordSimpleDto detailRecordSimpleDto = new FlowChartDetailRecordSimpleDto();
|
||||
|
||||
BeanUtils.copyProperties(record, detailRecordSimpleDto);
|
||||
if(record.getOptType().intValue() == ChartOptType.APPOINT.getCode()
|
||||
&& record.getOptIds() != null
|
||||
&& record.getOptIds().length() > 0){
|
||||
List<Long> ids = Arrays.stream(record.getOptIds().split(",")).map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//指定人员,搜索人员信息
|
||||
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(ids);
|
||||
detailRecordSimpleDto.setStaffs(staffSimpleDtos);
|
||||
|
||||
}
|
||||
recordSimpleDtos.add(detailRecordSimpleDto);
|
||||
|
||||
}
|
||||
flowChartDetailRecordListDto.setRecordSimpleDtos(recordSimpleDtos);
|
||||
dto.setChartDetails(flowChartDetailRecordListDto);
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok().put("data",flowChartDtos);
|
||||
@ -66,7 +99,7 @@ public class FlowChartController {
|
||||
return R.error("无相关流程");
|
||||
}
|
||||
|
||||
@GetMapping("/getRoleByChatId")
|
||||
/*@GetMapping("/getRoleByChatId")
|
||||
@ApiOperation("根据流程节点 Id获取相关权限")
|
||||
@ApiImplicitParam(name = "id",value = "节点id", required = true, dataType = "String",paramType = "query")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = FlowChartRoleDto.class)})
|
||||
@ -74,7 +107,7 @@ public class FlowChartController {
|
||||
|
||||
List<FlowChartRoleDto> flowCharts = flowChartService.selectChartRoleByChartId(id);
|
||||
return R.ok().put("data",flowCharts);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
@ -91,7 +124,7 @@ public class FlowChartController {
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/saveDetailProc")
|
||||
/*@PostMapping("/saveDetailProc")
|
||||
@ApiOperation("保存流程节点小流程")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecord.class)})
|
||||
public R saveDetailProc(@RequestBody @ApiParam FlowChartDetailRecord flowChartDetailRecord) {
|
||||
@ -100,7 +133,7 @@ public class FlowChartController {
|
||||
}
|
||||
flowChartDetailRecordService.insertFlowChartDetailRecord(flowChartDetailRecord);
|
||||
return R.ok().put("data", flowChartDetailRecord);
|
||||
}
|
||||
}*/
|
||||
|
||||
@PostMapping("/saveDetailProcs")
|
||||
@ApiOperation("保存流程节点小流程列表")
|
||||
@ -152,14 +185,19 @@ public class FlowChartController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/getDetailProc")
|
||||
/* @GetMapping("/getDetailProc")
|
||||
@ApiOperation("获取已保存的考核节点详情")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecordDto.class)})
|
||||
public R getDetailProc(@RequestParam @ApiParam("考核组id") Long groupId, @RequestParam @ApiParam("节点id") Long chartId) {
|
||||
|
||||
return R.ok().put("data", flowChartDetailRecordDtos);
|
||||
}*/
|
||||
|
||||
private List<FlowChartDetailRecordDto> getChartDetailRecort(Long chartId, Long groupId){
|
||||
List<FlowChartDetailRecord> flowChartDetailRecords = flowChartDetailRecordService.selectFlowChartDetailRecordByGroupIdAndChartId(groupId, chartId);
|
||||
List<FlowChartDetailRecordDto> flowChartDetailRecordDtos = new ArrayList<>();
|
||||
for (FlowChartDetailRecord record:flowChartDetailRecords
|
||||
) {
|
||||
) {
|
||||
FlowChartDetailRecordDto dto = new FlowChartDetailRecordDto();
|
||||
BeanUtils.copyProperties(record, dto);
|
||||
if(record.getOptType().intValue() == ChartOptType.APPOINT.getCode()
|
||||
@ -178,10 +216,9 @@ public class FlowChartController {
|
||||
}
|
||||
flowChartDetailRecordDtos.add(dto);
|
||||
}
|
||||
return R.ok().put("data", flowChartDetailRecordDtos);
|
||||
return flowChartDetailRecordDtos;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/delete")
|
||||
public R list(@RequestBody Long id) {
|
||||
flowChartService.deleteFlowChartById(id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user