提交修改
This commit is contained in:
parent
735e53effb
commit
e8e7ad6f16
@ -167,6 +167,9 @@ public class Constant {
|
|||||||
public static final String SELF = "self";
|
public static final String SELF = "self";
|
||||||
public static final String TYPE = "type";
|
public static final String TYPE = "type";
|
||||||
|
|
||||||
|
public static final String node = "node";
|
||||||
|
public static final String startNode = "startNode";
|
||||||
|
|
||||||
public static final String OSS_BUCCKET = "my-wallet";
|
public static final String OSS_BUCCKET = "my-wallet";
|
||||||
public static final Integer TWO = 2;
|
public static final Integer TWO = 2;
|
||||||
public static final Integer ONE = 1;
|
public static final Integer ONE = 1;
|
||||||
|
|||||||
@ -1,14 +1,21 @@
|
|||||||
package com.lz.modules.app.controller;
|
package com.lz.modules.app.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.lz.common.utils.PageUtils;
|
import com.lz.common.utils.PageUtils;
|
||||||
import com.lz.common.utils.R;
|
import com.lz.common.utils.R;
|
||||||
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.resp.Step;
|
||||||
import com.lz.modules.flow.entity.Flow;
|
import com.lz.modules.flow.entity.Flow;
|
||||||
|
import com.lz.modules.flow.entity.FlowDepartment;
|
||||||
import com.lz.modules.flow.entity.FlowManager;
|
import com.lz.modules.flow.entity.FlowManager;
|
||||||
|
import com.lz.modules.flow.entity.FlowRelation;
|
||||||
import com.lz.modules.flow.model.FlowDto;
|
import com.lz.modules.flow.model.FlowDto;
|
||||||
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.service.FlowDepartmentService;
|
import com.lz.modules.flow.service.FlowDepartmentService;
|
||||||
import com.lz.modules.flow.service.FlowManagerService;
|
import com.lz.modules.flow.service.FlowManagerService;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
@ -71,6 +78,33 @@ public class FlowManagerController {
|
|||||||
public R flowInfo(@PathVariable("staffId") Long staffId){
|
public R flowInfo(@PathVariable("staffId") Long staffId){
|
||||||
return flowDepartmentService.selectFlowManager(staffId);
|
return flowDepartmentService.selectFlowManager(staffId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/get/flow/{id}")
|
||||||
|
public R flow(@PathVariable("id") Long staffId){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/save/flow")
|
||||||
|
public R saveFlow(Long id ,String data){
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,18 +1,26 @@
|
|||||||
package com.lz.modules.app.controller;
|
package com.lz.modules.app.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.lz.modules.app.dao.DepartmentsDao;
|
import com.lz.modules.app.dao.DepartmentsDao;
|
||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.resp.Step;
|
||||||
import com.lz.modules.app.service.DepartmentsService;
|
import com.lz.modules.app.service.DepartmentsService;
|
||||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||||
|
import com.lz.modules.app.service.StaffService;
|
||||||
|
import com.lz.modules.flow.model.FlowModel;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
import com.lz.modules.sys.service.app.ResultDetailService;
|
||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -26,6 +34,12 @@ public class TestController {
|
|||||||
private DepartmentsService departmentsService;
|
private DepartmentsService departmentsService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResultDetailService resultDetailService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||||
|
|
||||||
@ -72,4 +86,63 @@ public class TestController {
|
|||||||
departmentsStaffRelateService.updateById(l);
|
departmentsStaffRelateService.updateById(l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {
|
||||||
|
* "type": "node",
|
||||||
|
* "left": 818,
|
||||||
|
* "top": 510,
|
||||||
|
* "uuid": "id3",
|
||||||
|
* "prev": [
|
||||||
|
* "id1",
|
||||||
|
* "id2"
|
||||||
|
* ],
|
||||||
|
* "next": [
|
||||||
|
* "id4",
|
||||||
|
* "id5"
|
||||||
|
* ],
|
||||||
|
* "formData": {
|
||||||
|
* "stepName": "名称1",
|
||||||
|
* "ruleGroupList": [{
|
||||||
|
* "name": "名称2",
|
||||||
|
* "nextStep": "id5"
|
||||||
|
* },
|
||||||
|
* {
|
||||||
|
* "name": "名称6",
|
||||||
|
* "nextStep": "id7"
|
||||||
|
* }
|
||||||
|
* ]
|
||||||
|
* },
|
||||||
|
* "nextIfId": "id12",
|
||||||
|
* "nextElseId": "id11"
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
@RequestMapping("/test/step")
|
||||||
|
public void step(){
|
||||||
|
Long staffId = 294l;
|
||||||
|
ResultRecord resultRecord = new ResultRecord();
|
||||||
|
resultRecord.setType(2);
|
||||||
|
resultRecord.setStaffId(staffId);
|
||||||
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(resultRecord.getStaffId());
|
||||||
|
resultRecord.setDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
|
List<Step> test = resultDetailService.getStepList(resultRecord);
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
if(CollectionUtils.isNotEmpty(test)){
|
||||||
|
Step step = test.get(0);
|
||||||
|
StaffEntity staffEntity = staffService.selectStaffById(staffId);
|
||||||
|
if(staffEntity !=null && !staffEntity.getName().equals(step.getName())){
|
||||||
|
list.add(staffEntity.getName());
|
||||||
|
}
|
||||||
|
for(Step s:test){
|
||||||
|
list.add(s.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println(JSON.toJSONString(list));
|
||||||
|
List<FlowModel> flowModels = new ArrayList<>();
|
||||||
|
FlowModel flowModel = new FlowModel();
|
||||||
|
|
||||||
|
for(String s:list){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
src/main/java/com/lz/modules/app/enums/FlowNodeEnum.java
Normal file
35
src/main/java/com/lz/modules/app/enums/FlowNodeEnum.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package com.lz.modules.app.enums;
|
||||||
|
|
||||||
|
public enum FlowNodeEnum {
|
||||||
|
|
||||||
|
startNode("开始", "startNode"),
|
||||||
|
endNode("结束", "endNode"),
|
||||||
|
tempNode("案例", "tempNode"),
|
||||||
|
ifNode("条件", "ifNode"),
|
||||||
|
expandNode("分组", "expandNode"),
|
||||||
|
nodeNode("节点", "nodeNode");
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String desc ;
|
||||||
|
|
||||||
|
FlowNodeEnum(String name, String desc) {
|
||||||
|
this.name = name;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/main/java/com/lz/modules/flow/model/FlowModel.java
Normal file
17
src/main/java/com/lz/modules/flow/model/FlowModel.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package com.lz.modules.flow.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FlowModel {
|
||||||
|
private String type;
|
||||||
|
private int left = 818;
|
||||||
|
private int top = 510;
|
||||||
|
private String uuid;
|
||||||
|
private List<String> prev;
|
||||||
|
private List<String> next;
|
||||||
|
private FormDataModel formData;
|
||||||
|
|
||||||
|
}
|
||||||
11
src/main/java/com/lz/modules/flow/model/FormDataModel.java
Normal file
11
src/main/java/com/lz/modules/flow/model/FormDataModel.java
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package com.lz.modules.flow.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FormDataModel {
|
||||||
|
private String stepName;
|
||||||
|
private List<RuleGroupModel> ruleGroupList;
|
||||||
|
}
|
||||||
10
src/main/java/com/lz/modules/flow/model/RuleGroupModel.java
Normal file
10
src/main/java/com/lz/modules/flow/model/RuleGroupModel.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package com.lz.modules.flow.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class RuleGroupModel {
|
||||||
|
private String name;
|
||||||
|
private String nextStep;
|
||||||
|
|
||||||
|
}
|
||||||
@ -216,8 +216,6 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
int type = resultRecord.getType();
|
int type = resultRecord.getType();
|
||||||
List<Step> stepList = new ArrayList<>();
|
List<Step> stepList = new ArrayList<>();
|
||||||
StaffEntity mySelf = staffService.selectStaffById(staffId);
|
StaffEntity mySelf = staffService.selectStaffById(staffId);
|
||||||
|
|
||||||
|
|
||||||
List<FlowRecord> flowRecordList = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
|
List<FlowRecord> flowRecordList = flowRecordService.selectFlowRecordByResultRecordIdFlowId(resultRecord.getId());
|
||||||
SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd HH:mm");
|
SimpleDateFormat myFmt2 = new SimpleDateFormat("MM-dd HH:mm");
|
||||||
FlowRecord lastFlowRecord = null;
|
FlowRecord lastFlowRecord = null;
|
||||||
@ -231,7 +229,6 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
stepList.add(new Step(name, time, 1, ""));
|
stepList.add(new Step(name, time, 1, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
//approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
||||||
List<String> approvalList = new ArrayList<>();
|
List<String> approvalList = new ArrayList<>();
|
||||||
Map<String,String> roleNameMap = new HashMap<>();
|
Map<String,String> roleNameMap = new HashMap<>();
|
||||||
@ -244,7 +241,6 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
|
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
|
||||||
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
|
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
|
||||||
|
|
||||||
|
|
||||||
Long flowId = flowInfo.getFirst();
|
Long flowId = flowInfo.getFirst();
|
||||||
List<Flow> flows = flowService.selectByFlowId(flowId);
|
List<Flow> flows = flowService.selectByFlowId(flowId);
|
||||||
|
|
||||||
@ -276,6 +272,7 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
String departmentLevel = approvalList.get(index);
|
String departmentLevel = approvalList.get(index);
|
||||||
stepList.add(new Step(roleNameMap.get(departmentLevel), "", 0, ""));
|
stepList.add(new Step(roleNameMap.get(departmentLevel), "", 0, ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
return stepList;
|
return stepList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -316,7 +316,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return leader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user