提交修改
This commit is contained in:
parent
c0950a7282
commit
a8264f5e57
@ -10,9 +10,12 @@ import com.lz.modules.app.resp.ResultDetailResp;
|
|||||||
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.app.service.StaffService;
|
||||||
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
import com.lz.modules.flow.entity.RecordAuth;
|
import com.lz.modules.flow.entity.RecordAuth;
|
||||||
import com.lz.modules.flow.model.Auth;
|
import com.lz.modules.flow.model.Auth;
|
||||||
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.req.ResultDetailReq;
|
import com.lz.modules.flow.req.ResultDetailReq;
|
||||||
|
import com.lz.modules.flow.service.FlowRecordService;
|
||||||
import com.lz.modules.flow.service.RecordAuthService;
|
import com.lz.modules.flow.service.RecordAuthService;
|
||||||
import com.lz.modules.sys.controller.AbstractController;
|
import com.lz.modules.sys.controller.AbstractController;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
@ -22,8 +25,11 @@ import com.lz.modules.sys.entity.app.ResultRecord;
|
|||||||
import com.lz.modules.sys.service.app.ResultCommentService;
|
import com.lz.modules.sys.service.app.ResultCommentService;
|
||||||
import com.lz.modules.sys.service.app.ResultDetailService;
|
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 javafx.beans.property.ReadOnlyBooleanWrapper;
|
||||||
|
import net.sf.jsqlparser.parser.JJTCCJSqlParserState;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.hibernate.validator.constraints.URL;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@ -64,6 +70,8 @@ public class ResultRecordController extends AbstractController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ResultCommentService resultCommentService;
|
private ResultCommentService resultCommentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowRecordService flowRecordService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,6 +119,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
listAuth = recordAuthService.selectAuthInfo(8l);
|
listAuth = recordAuthService.selectAuthInfo(8l);
|
||||||
auth = recordAuthService.getAuth(listAuth);
|
auth = recordAuthService.getAuth(listAuth);
|
||||||
auth.setWenHuaEdit(1);
|
auth.setWenHuaEdit(1);
|
||||||
|
|
||||||
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffId(getUserId());
|
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffId(getUserId());
|
||||||
ResultRecord resultRecordNew = null;
|
ResultRecord resultRecordNew = null;
|
||||||
if (resultRecordOld != null) {
|
if (resultRecordOld != null) {
|
||||||
@ -118,6 +127,8 @@ public class ResultRecordController extends AbstractController {
|
|||||||
resultRecordOld.setId(null);
|
resultRecordOld.setId(null);
|
||||||
resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), 8l));
|
resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), 8l));
|
||||||
resultRecordService.insertResultRecord(resultRecordOld);
|
resultRecordService.insertResultRecord(resultRecordOld);
|
||||||
|
|
||||||
|
flowRecordService.initYeJi(resultRecordOld);
|
||||||
resultRecordNew = resultRecordOld;
|
resultRecordNew = resultRecordOld;
|
||||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
||||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||||
@ -129,10 +140,10 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
resultRecordNew = createResultRecord(getUserId(), 2);
|
resultRecordNew = resultRecordService.createResultRecord(getUserId(), 2);
|
||||||
}
|
}
|
||||||
//保存文件价值观
|
|
||||||
recordType = 3;
|
recordType = 3;
|
||||||
|
//保存文件价值观
|
||||||
resultDetailService.insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), getUserId());
|
resultDetailService.insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), getUserId());
|
||||||
resultDetailService.insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), getUserId());
|
resultDetailService.insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), getUserId());
|
||||||
recordResultId = resultRecordNew.getId();
|
recordResultId = resultRecordNew.getId();
|
||||||
@ -141,6 +152,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(getUserId()));
|
listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(getUserId()));
|
||||||
auth = recordAuthService.getAuth(listAuth);
|
auth = recordAuthService.getAuth(listAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordResultId);
|
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordResultId);
|
||||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||||
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
||||||
@ -204,7 +216,6 @@ public class ResultRecordController extends AbstractController {
|
|||||||
list.add(comment);
|
list.add(comment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
|
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
|
||||||
return R.ok()
|
return R.ok()
|
||||||
.put("staffName", staffEntity.getName())
|
.put("staffName", staffEntity.getName())
|
||||||
@ -264,7 +275,9 @@ public class ResultRecordController extends AbstractController {
|
|||||||
if (resultComment == null || !getUserId().equals(resultComment.getStaffId())) {
|
if (resultComment == null || !getUserId().equals(resultComment.getStaffId())) {
|
||||||
resultComment = new ResultComment();
|
resultComment = new ResultComment();
|
||||||
}
|
}
|
||||||
return R.ok().put("resultComment", resultComment);
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordId(recordId);
|
||||||
|
return R.ok().put("resultComment", resultComment)
|
||||||
|
.put("list",flowRecords);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -367,7 +380,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
} else {
|
} else {
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordId());
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordId());
|
||||||
if (resultRecord == null) {
|
if (resultRecord == null) {
|
||||||
createResultRecord(getUserId(), req.getRecordType());
|
resultRecordService.createResultRecord(getUserId(), req.getRecordType());
|
||||||
}
|
}
|
||||||
recordId = resultRecord.getId();
|
recordId = resultRecord.getId();
|
||||||
req.setKeyResult(StringUtil.decodeBase64(req.getKeyResult()));
|
req.setKeyResult(StringUtil.decodeBase64(req.getKeyResult()));
|
||||||
@ -382,20 +395,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok("保存成功").put("recordId", recordId);
|
return R.ok("保存成功").put("recordId", recordId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultRecord createResultRecord(Long staffId ,int type) {
|
|
||||||
ResultRecord resultRecord = new ResultRecord();
|
|
||||||
resultRecord.setMonthTime(new Date());
|
|
||||||
if (type == 1) {
|
|
||||||
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId,7l));
|
|
||||||
} else {
|
|
||||||
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId,8l));
|
|
||||||
}
|
|
||||||
resultRecord.setStaffId(getUserId());
|
|
||||||
resultRecord.setStatus(0);
|
|
||||||
resultRecord.setType(type);
|
|
||||||
resultRecordService.insertResultRecord(resultRecord);
|
|
||||||
return resultRecord;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
|
|||||||
21
src/main/java/com/lz/modules/app/utils/t/EightTuple.java
Normal file
21
src/main/java/com/lz/modules/app/utils/t/EightTuple.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
public class EightTuple<A, B, C, D, E, F, G, H> extends SevenTuple<A, B, C, D, E, F, G> {
|
||||||
|
|
||||||
|
|
||||||
|
private H eight;
|
||||||
|
|
||||||
|
public EightTuple(A a, B b, C c, D d, E e, F f, G g, H h) {
|
||||||
|
super(a, b, c, d, e, f, g);
|
||||||
|
eight = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public H getEight() {
|
||||||
|
return eight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEight(H eight) {
|
||||||
|
this.eight = eight;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/java/com/lz/modules/app/utils/t/EleventTuple.java
Normal file
22
src/main/java/com/lz/modules/app/utils/t/EleventTuple.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class EleventTuple<A, B, C, D, E, F, G, H, I, J, K> extends TenTuple<A, B, C, D, E, F, G, H, I, J> implements Serializable {
|
||||||
|
|
||||||
|
private K elevent;
|
||||||
|
|
||||||
|
public EleventTuple(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k) {
|
||||||
|
super(a, b, c, d, e, f, g, h, i, j);
|
||||||
|
elevent = k;
|
||||||
|
}
|
||||||
|
|
||||||
|
public K getElevent() {
|
||||||
|
return elevent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElevent(K elevent) {
|
||||||
|
this.elevent = elevent;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
33
src/main/java/com/lz/modules/app/utils/t/FiveTuple.java
Normal file
33
src/main/java/com/lz/modules/app/utils/t/FiveTuple.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//: net/mindview/util/FiveTuple.java
|
||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
|
||||||
|
/*****
|
||||||
|
*
|
||||||
|
* 增加类型参数是一件简单的事情
|
||||||
|
*
|
||||||
|
* @param <A>
|
||||||
|
* @param <B>
|
||||||
|
* @param <C>
|
||||||
|
* @param <D>
|
||||||
|
* @param <E>
|
||||||
|
*/
|
||||||
|
public class FiveTuple<A, B, C, D, E> extends FourTuple<A, B, C, D> {
|
||||||
|
private E fifth;
|
||||||
|
|
||||||
|
public FiveTuple(A a, B b, C c, D d, E e) {
|
||||||
|
super(a, b, c, d);
|
||||||
|
fifth = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public E getFifth() {
|
||||||
|
return fifth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFifth(E fifth) {
|
||||||
|
this.fifth = fifth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///:~
|
||||||
32
src/main/java/com/lz/modules/app/utils/t/FourTuple.java
Normal file
32
src/main/java/com/lz/modules/app/utils/t/FourTuple.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
//: net/mindview/util/FourTuple.java
|
||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* 355页
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param <A>
|
||||||
|
* @param <B>
|
||||||
|
* @param <C>
|
||||||
|
* @param <D>
|
||||||
|
*/
|
||||||
|
public class FourTuple<A, B, C, D> extends ThreeTuple<A, B, C> {
|
||||||
|
private D fourth;
|
||||||
|
|
||||||
|
public FourTuple(A a, B b, C c, D d) {
|
||||||
|
super(a, b, c);
|
||||||
|
fourth = d;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public D getFourth() {
|
||||||
|
return fourth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFourth(D fourth) {
|
||||||
|
this.fourth = fourth;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
interface ISuperTuple<A extends Object, B extends Object> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
19
src/main/java/com/lz/modules/app/utils/t/NineTuple.java
Normal file
19
src/main/java/com/lz/modules/app/utils/t/NineTuple.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
public class NineTuple<A, B, C, D, E, F, G, H, I> extends EightTuple<A, B, C, D, E, F, G, H> {
|
||||||
|
|
||||||
|
private I nine;
|
||||||
|
|
||||||
|
public NineTuple(A a, B b, C c, D d, E e, F f, G g, H h, I i) {
|
||||||
|
super(a, b, c, d, e, f, g, h);
|
||||||
|
nine = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
public I getNine() {
|
||||||
|
return nine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNine(I nine) {
|
||||||
|
this.nine = nine;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/main/java/com/lz/modules/app/utils/t/OneTuple.java
Normal file
22
src/main/java/com/lz/modules/app/utils/t/OneTuple.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class OneTuple<A> implements Serializable {
|
||||||
|
private A first;
|
||||||
|
|
||||||
|
public OneTuple(A a) {
|
||||||
|
first = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
public A getFirst() {
|
||||||
|
return first;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirst(A first) {
|
||||||
|
this.first = first;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
19
src/main/java/com/lz/modules/app/utils/t/SevenTuple.java
Normal file
19
src/main/java/com/lz/modules/app/utils/t/SevenTuple.java
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
public class SevenTuple<A, B, C, D, E, F, G> extends SixTuple<A, B, C, D, E, F> {
|
||||||
|
|
||||||
|
private G seven;
|
||||||
|
|
||||||
|
public SevenTuple(A a, B b, C c, D d, E e, F f, G g) {
|
||||||
|
super(a, b, c, d, e, f);
|
||||||
|
seven = g;
|
||||||
|
}
|
||||||
|
|
||||||
|
public G getSeven() {
|
||||||
|
return seven;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSeven(G seven) {
|
||||||
|
this.seven = seven;
|
||||||
|
}
|
||||||
|
}
|
||||||
48
src/main/java/com/lz/modules/app/utils/t/SixTuple.java
Normal file
48
src/main/java/com/lz/modules/app/utils/t/SixTuple.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
||||||
|
/******
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param <A>
|
||||||
|
* @param <B>
|
||||||
|
* @param <C>
|
||||||
|
* @param <D>
|
||||||
|
* @param <E>
|
||||||
|
* @param <F>
|
||||||
|
*/
|
||||||
|
public class SixTuple<A, B, C, D, E, F> extends FiveTuple<A, B, C, D, E> {
|
||||||
|
public F sixth;
|
||||||
|
|
||||||
|
public SixTuple(A a, B b, C c, D d, E e, F f) {
|
||||||
|
super(a, b, c, d, e);
|
||||||
|
sixth = f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public F getSixth() {
|
||||||
|
return sixth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSixth(F sixth) {
|
||||||
|
this.sixth = sixth;
|
||||||
|
}
|
||||||
|
|
||||||
|
static SixTuple<String, String, String, Float, Double, Byte> a() {
|
||||||
|
return new SixTuple<String, String, String, Float, Double, Byte>(
|
||||||
|
"11111", "", "hi", (float) 4.7,
|
||||||
|
1.1, (byte) 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SixTuple result = a();
|
||||||
|
|
||||||
|
System.out.println(result.getFirst());
|
||||||
|
|
||||||
|
System.out.println(JSON.toJSONString(result));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
46
src/main/java/com/lz/modules/app/utils/t/SuperTuple.java
Normal file
46
src/main/java/com/lz/modules/app/utils/t/SuperTuple.java
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
public class SuperTuple<A, B, C> {
|
||||||
|
|
||||||
|
private A first;
|
||||||
|
private B second;
|
||||||
|
private C third;
|
||||||
|
|
||||||
|
|
||||||
|
public SuperTuple(A a, B b, C c) {
|
||||||
|
this.first = a;
|
||||||
|
this.second = b;
|
||||||
|
this.third = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
public A getFirst() {
|
||||||
|
return first;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFirst(A first) {
|
||||||
|
this.first = first;
|
||||||
|
}
|
||||||
|
|
||||||
|
public B getSecond() {
|
||||||
|
return second;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecond(B second) {
|
||||||
|
this.second = second;
|
||||||
|
}
|
||||||
|
|
||||||
|
public C getThird() {
|
||||||
|
return third;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThird(C third) {
|
||||||
|
this.third = third;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String a = "";
|
||||||
|
String b = "";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
23
src/main/java/com/lz/modules/app/utils/t/TenTuple.java
Normal file
23
src/main/java/com/lz/modules/app/utils/t/TenTuple.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class TenTuple<A, B, C, D, E, F, G, H, I, J> extends NineTuple<A, B, C, D, E, F, G, H, I> implements Serializable {
|
||||||
|
|
||||||
|
private J ten;
|
||||||
|
|
||||||
|
public TenTuple(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j) {
|
||||||
|
super(a, b, c, d, e, f, g, h, i);
|
||||||
|
ten = j;
|
||||||
|
}
|
||||||
|
|
||||||
|
public J getTen() {
|
||||||
|
return ten;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTen(J ten) {
|
||||||
|
this.ten = ten;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
25
src/main/java/com/lz/modules/app/utils/t/ThreeTuple.java
Normal file
25
src/main/java/com/lz/modules/app/utils/t/ThreeTuple.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* @param <A>
|
||||||
|
* @param <B>
|
||||||
|
* @param <C>
|
||||||
|
*/
|
||||||
|
public class ThreeTuple<A, B, C> extends TwoTuple<A, B> {
|
||||||
|
private C third;
|
||||||
|
|
||||||
|
public ThreeTuple(A a, B b, C c) {
|
||||||
|
super(a, b);
|
||||||
|
third = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public C getThird() {
|
||||||
|
return third;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setThird(C third) {
|
||||||
|
this.third = third;
|
||||||
|
}
|
||||||
|
}
|
||||||
273
src/main/java/com/lz/modules/app/utils/t/Tuple.java
Normal file
273
src/main/java/com/lz/modules/app/utils/t/Tuple.java
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class Tuple implements Serializable {
|
||||||
|
|
||||||
|
private EleventTuple data;
|
||||||
|
|
||||||
|
|
||||||
|
public Tuple() {
|
||||||
|
this.data = new EleventTuple(null, null, null, null, null, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Tuple(Object a) {
|
||||||
|
this.data = new EleventTuple(a, null, null, null, null, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b) {
|
||||||
|
this.data = new EleventTuple(a, b, null, null, null, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c) {
|
||||||
|
this.data = new EleventTuple(a, b, c, null, null, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, null, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, null, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e, Object f) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, f, null, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e, Object f, Object g) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, f, g, null, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, f, g, h, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h, Object i) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, f, g, h, i, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h, Object i, Object j) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, f, g, h, i, j, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Object a, Object b, Object c, Object d, Object e, Object f, Object g, Object h, Object i, Object j, Object k) {
|
||||||
|
this.data = new EleventTuple(a, b, c, d, e, f, g, h, i, j, k);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EleventTuple getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(EleventTuple data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void add(Object object) {
|
||||||
|
EleventTuple<Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object> data = this.getData();
|
||||||
|
if (data.getFirst() == null) {
|
||||||
|
data.setFirst(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getSecond() == null) {
|
||||||
|
data.setSecond(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getThird() == null) {
|
||||||
|
data.setThird(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getFourth() == null) {
|
||||||
|
data.setFourth(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getFifth() == null) {
|
||||||
|
data.setFifth(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getSixth() == null) {
|
||||||
|
data.setSixth(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getElevent() == null) {
|
||||||
|
data.setElevent(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getEight() == null) {
|
||||||
|
data.setEight(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getNine() == null) {
|
||||||
|
data.setNine(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.getTen() == null) {
|
||||||
|
data.setTen(object);
|
||||||
|
this.setData(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tuple(Tuple tuple) {
|
||||||
|
this.data = new EleventTuple(null, null, null, null, null, null, null, null, null, null, null);
|
||||||
|
if (tuple == null || tuple.getData() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EleventTuple elevent = tuple.getData();
|
||||||
|
if (elevent.getFirst() != null) {
|
||||||
|
this.data.setFirst(elevent.getFirst());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getSecond() != null) {
|
||||||
|
this.data.setSecond(elevent.getSecond());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getThird() != null) {
|
||||||
|
this.data.setThird(elevent.getThird());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getFourth() != null) {
|
||||||
|
this.data.setFourth(elevent.getFourth());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getFifth() != null) {
|
||||||
|
this.data.setFifth(elevent.getFifth());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getSixth() != null) {
|
||||||
|
this.data.setSixth(elevent.getSixth());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getElevent() != null) {
|
||||||
|
this.data.setElevent(elevent.getElevent());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getEight() != null) {
|
||||||
|
this.data.setEight(elevent.getEight());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getNine() != null) {
|
||||||
|
this.data.setNine(elevent.getNine());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (elevent.getTen() != null) {
|
||||||
|
this.data.setTen(elevent.getTen());
|
||||||
|
this.setData(data);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getString(Tuple tuple) {
|
||||||
|
StringBuilder sb = new StringBuilder(" ");
|
||||||
|
EleventTuple elevent = tuple.getData();
|
||||||
|
if (elevent.getFirst() != null) {
|
||||||
|
sb.append(elevent.getFirst()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevent.getSecond() != null) {
|
||||||
|
sb.append(elevent.getSecond()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevent.getThird() != null) {
|
||||||
|
sb.append(elevent.getThird()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevent.getFourth() != null) {
|
||||||
|
sb.append(elevent.getFourth()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevent.getFifth() != null) {
|
||||||
|
sb.append(elevent.getFifth()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
if (elevent.getSixth() != null) {
|
||||||
|
sb.append(elevent.getSixth()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
if (elevent.getElevent() != null) {
|
||||||
|
sb.append(elevent.getElevent()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elevent.getEight() != null) {
|
||||||
|
sb.append(elevent.getEight()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
if (elevent.getNine() != null) {
|
||||||
|
sb.append(elevent.getNine()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
if (elevent.getTen() != null) {
|
||||||
|
sb.append(elevent.getTen()).append(" ");
|
||||||
|
}else{
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Tuple data = new Tuple("1", 2, 3);
|
||||||
|
|
||||||
|
System.out.println(JSON.toJSONString(data));
|
||||||
|
Tuple data1 = new Tuple(data);
|
||||||
|
data1.add(4);
|
||||||
|
data1.add(5);
|
||||||
|
System.out.println(JSON.toJSONString(data1));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
172
src/main/java/com/lz/modules/app/utils/t/TupleUtils.java
Normal file
172
src/main/java/com/lz/modules/app/utils/t/TupleUtils.java
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import tool.util.StringUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class TupleUtils {
|
||||||
|
|
||||||
|
public static final List<String> contains = new ArrayList<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
contains.add("String");
|
||||||
|
contains.add("Double");
|
||||||
|
contains.add("double");
|
||||||
|
contains.add("Float");
|
||||||
|
contains.add("float");
|
||||||
|
contains.add("Long");
|
||||||
|
contains.add("long");
|
||||||
|
contains.add("Integer");
|
||||||
|
contains.add("int");
|
||||||
|
contains.add("Byte");
|
||||||
|
contains.add("byte");
|
||||||
|
contains.add("Character");
|
||||||
|
contains.add("Short");
|
||||||
|
contains.add("short");
|
||||||
|
contains.add("boolean");
|
||||||
|
contains.add("Boolean");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, Object> tupleToMap(TwoTuple tuple) {
|
||||||
|
Map<String, Object> map = Maps.newHashMap();
|
||||||
|
if (tuple instanceof TenTuple) {
|
||||||
|
getTen(tuple, map);
|
||||||
|
|
||||||
|
} else if (tuple instanceof NineTuple) {
|
||||||
|
getNine(tuple, map);
|
||||||
|
|
||||||
|
} else if (tuple instanceof EightTuple) {
|
||||||
|
getEight(tuple, map);
|
||||||
|
|
||||||
|
} else if (tuple instanceof SevenTuple) {
|
||||||
|
getSeven(tuple, map);
|
||||||
|
|
||||||
|
|
||||||
|
} else if (tuple instanceof SixTuple) {
|
||||||
|
getSix(tuple, map);
|
||||||
|
|
||||||
|
|
||||||
|
} else if (tuple instanceof FiveTuple) {
|
||||||
|
getFive(tuple, map);
|
||||||
|
|
||||||
|
} else if (tuple instanceof FourTuple) {
|
||||||
|
getFourth(tuple, map);
|
||||||
|
|
||||||
|
} else if (tuple instanceof ThreeTuple) {
|
||||||
|
getThree(tuple, map);
|
||||||
|
|
||||||
|
} else if (tuple instanceof TwoTuple) {
|
||||||
|
getTwo(tuple, map);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getTen(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//10
|
||||||
|
String tenName = getSimpleName(((TenTuple) tuple).getTen().getClass().getSimpleName());
|
||||||
|
buildParams(tenName, "ten", ((TenTuple) tuple).getTen(), map);
|
||||||
|
|
||||||
|
//9
|
||||||
|
getNine(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getNine(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//9
|
||||||
|
String nineName = getSimpleName(((NineTuple) tuple).getNine().getClass().getSimpleName());
|
||||||
|
buildParams(nineName, "nine", ((NineTuple) tuple).getNine(), map);
|
||||||
|
|
||||||
|
//8
|
||||||
|
getEight(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getEight(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//8
|
||||||
|
String eight = getSimpleName(((EightTuple) tuple).getEight().getClass().getSimpleName());
|
||||||
|
buildParams(eight, "eight", ((EightTuple) tuple).getEight(), map);
|
||||||
|
|
||||||
|
|
||||||
|
//7
|
||||||
|
getSeven(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getSeven(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//7
|
||||||
|
String seven = getSimpleName(((SevenTuple) tuple).getSeven().getClass().getSimpleName());
|
||||||
|
buildParams(seven, "seven", ((SevenTuple) tuple).getSeven(), map);
|
||||||
|
|
||||||
|
//6
|
||||||
|
getSix(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getSix(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//6
|
||||||
|
String sixth = getSimpleName(((SixTuple) tuple).getSixth().getClass().getSimpleName());
|
||||||
|
buildParams(sixth, "sixth", ((SixTuple) tuple).getSixth(), map);
|
||||||
|
|
||||||
|
//5
|
||||||
|
getFive(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getFive(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//5
|
||||||
|
String fifth = getSimpleName(((FiveTuple) tuple).getFifth().getClass().getSimpleName());
|
||||||
|
buildParams(fifth, "fifth", ((FiveTuple) tuple).getFifth(), map);
|
||||||
|
|
||||||
|
|
||||||
|
//4
|
||||||
|
getFourth(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getFourth(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//4
|
||||||
|
String fourth = getSimpleName(((FourTuple) tuple).getFourth().getClass().getSimpleName());
|
||||||
|
buildParams(fourth, "fourth", ((FourTuple) tuple).getFourth(), map);
|
||||||
|
|
||||||
|
|
||||||
|
//3
|
||||||
|
getThree(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getThree(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//3
|
||||||
|
String third = getSimpleName(((ThreeTuple) tuple).getThird().getClass().getSimpleName());
|
||||||
|
buildParams(third, "third", ((ThreeTuple) tuple).getThird(), map);
|
||||||
|
|
||||||
|
//2
|
||||||
|
getTwo(tuple, map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void getTwo(TwoTuple tuple, Map<String, Object> map) {
|
||||||
|
//2
|
||||||
|
String secend = getSimpleName(tuple.getSecond().getClass().getSimpleName());
|
||||||
|
buildParams(secend, "secend", tuple.getSecond(), map);
|
||||||
|
|
||||||
|
//1
|
||||||
|
String firstName = getSimpleName(tuple.getFirst().getClass().getSimpleName());
|
||||||
|
buildParams(firstName, "first", tuple.getFirst(), map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void buildParams(String simpleName, String defaultValue, Object value, Map<String, Object> data) {
|
||||||
|
if (StringUtil.isEmpty(simpleName)) {
|
||||||
|
simpleName = defaultValue;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.put(simpleName, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSimpleName(String simpleName) {
|
||||||
|
if (contains.contains(simpleName)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (simpleName.substring(0, 1)).toLowerCase()
|
||||||
|
+ simpleName.substring(1, simpleName.length());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
20
src/main/java/com/lz/modules/app/utils/t/TwoTuple.java
Normal file
20
src/main/java/com/lz/modules/app/utils/t/TwoTuple.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package com.lz.modules.app.utils.t;
|
||||||
|
|
||||||
|
public class TwoTuple<A, B> extends OneTuple<A> {
|
||||||
|
private B second;
|
||||||
|
|
||||||
|
public TwoTuple(A a, B b) {
|
||||||
|
super(a);
|
||||||
|
second = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
public B getSecond() {
|
||||||
|
return second;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecond(B second) {
|
||||||
|
this.second = second;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -11,6 +11,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
||||||
|
|
||||||
@ -33,4 +36,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
FlowRecord selectLastFlowRecordByRecordId(@Param("recordId") Long recordId);
|
FlowRecord selectLastFlowRecordByRecordId(@Param("recordId") Long recordId);
|
||||||
|
|
||||||
FlowRecord selectNotApprovalStaffIdFlowRecords(@Param("recordId") Long recordId);
|
FlowRecord selectNotApprovalStaffIdFlowRecords(@Param("recordId") Long recordId);
|
||||||
|
|
||||||
|
List<FlowRecord> selectFlowRecordByRecordId(@Param("recordId") Long recordId);
|
||||||
}
|
}
|
||||||
@ -20,6 +20,14 @@ public class StaffRoleDto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static String getStaffRole(Long staffId ,Long roloId) {
|
||||||
|
List<StaffRoleDto> staffRoleDtoList = new ArrayList<>();
|
||||||
|
StaffRoleDto staffRoleDto = new StaffRoleDto(staffId,roloId);
|
||||||
|
staffRoleDtoList.add(staffRoleDto);
|
||||||
|
return JSON.toJSONString(staffRoleDtoList);
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
List<StaffRoleDto> staffRoleDtoList = new ArrayList<>();
|
List<StaffRoleDto> staffRoleDtoList = new ArrayList<>();
|
||||||
StaffRoleDto staffRoleDto = new StaffRoleDto(314l,6l);
|
StaffRoleDto staffRoleDto = new StaffRoleDto(314l,6l);
|
||||||
|
|||||||
@ -2,6 +2,9 @@ package com.lz.modules.flow.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -33,4 +36,8 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
|||||||
FlowRecord selectLastFlowRecordByRecordId(Long recordResultId);
|
FlowRecord selectLastFlowRecordByRecordId(Long recordResultId);
|
||||||
|
|
||||||
FlowRecord selectNotApprovalStaffIdFlowRecords(Long recordId);
|
FlowRecord selectNotApprovalStaffIdFlowRecords(Long recordId);
|
||||||
|
|
||||||
|
List<FlowRecord> selectFlowRecordByRecordId(Long recordId);
|
||||||
|
|
||||||
|
void initYeJi(ResultRecord resultRecord );
|
||||||
}
|
}
|
||||||
@ -1,12 +1,21 @@
|
|||||||
package com.lz.modules.flow.service.impl;
|
package com.lz.modules.flow.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.lz.common.utils.Constant;
|
||||||
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.service.StaffService;
|
||||||
|
import com.lz.modules.app.utils.t.OneTuple;
|
||||||
import com.lz.modules.flow.dao.FlowRecordMapper;
|
import com.lz.modules.flow.dao.FlowRecordMapper;
|
||||||
import com.lz.modules.flow.entity.FlowRecord;
|
import com.lz.modules.flow.entity.FlowRecord;
|
||||||
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.service.FlowRecordService;
|
import com.lz.modules.flow.service.FlowRecordService;
|
||||||
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 流转记录表 服务类
|
* 流转记录表 服务类
|
||||||
@ -23,6 +32,12 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
@Autowired
|
@Autowired
|
||||||
private FlowRecordMapper flowRecordMapper;
|
private FlowRecordMapper flowRecordMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StaffService staffService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResultRecordService resultRecordService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -66,5 +81,27 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
return flowRecordMapper.selectNotApprovalStaffIdFlowRecords(recordId);
|
return flowRecordMapper.selectNotApprovalStaffIdFlowRecords(recordId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FlowRecord> selectFlowRecordByRecordId(Long recordId) {
|
||||||
|
return flowRecordMapper.selectFlowRecordByRecordId(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initYeJi(ResultRecord resultRecord) {
|
||||||
|
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||||
|
FlowRecord flowRecord = new FlowRecord();
|
||||||
|
flowRecord.setFlowStaffIdRole(StaffRoleDto.getStaffRole(resultRecord.getStaffId(), 8l));
|
||||||
|
OneTuple<Long> flowInfo = resultRecordService.getFlowInfo(resultRecord.getStaffId());
|
||||||
|
flowRecord.setFlowId(flowInfo.getFirst());
|
||||||
|
flowRecord.setApprovalStaffId(resultRecord.getStaffId());
|
||||||
|
flowRecord.setApprovalStaffName(staffEntity.getName());
|
||||||
|
flowRecord.setFlowIndex(0);
|
||||||
|
flowRecord.setFlowName(staffEntity.getName() + "-新建目标");
|
||||||
|
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||||
|
flowRecord.setRecordId(resultRecord.getId());
|
||||||
|
flowRecord.setStatus(0);
|
||||||
|
flowRecord.setDepartmentLevel(Constant.ME);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
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.req.ResultRecordReq;
|
import com.lz.modules.app.req.ResultRecordReq;
|
||||||
|
import com.lz.modules.app.utils.t.TwoTuple;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||||
|
|
||||||
@ -48,4 +49,8 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
R approval(Long resultRecordId, Long userId);
|
R approval(Long resultRecordId, Long userId);
|
||||||
|
|
||||||
List<ResultRecord> selectResultRecordByIds(List<Long> recordIds);
|
List<ResultRecord> selectResultRecordByIds(List<Long> recordIds);
|
||||||
|
|
||||||
|
TwoTuple getFlowInfo(Long staffId);
|
||||||
|
|
||||||
|
ResultRecord createResultRecord(Long userId, int type);
|
||||||
}
|
}
|
||||||
@ -14,12 +14,14 @@ import com.lz.modules.app.resp.ResultRecordResp;
|
|||||||
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.app.service.StaffService;
|
||||||
|
import com.lz.modules.app.utils.t.TwoTuple;
|
||||||
import com.lz.modules.flow.entity.*;
|
import com.lz.modules.flow.entity.*;
|
||||||
import com.lz.modules.flow.model.StaffRoleDto;
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.service.*;
|
import com.lz.modules.flow.service.*;
|
||||||
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
||||||
import com.lz.modules.sys.entity.SysUserEntity;
|
import com.lz.modules.sys.entity.SysUserEntity;
|
||||||
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 lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
@ -89,6 +91,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentsService departmentsService;
|
private DepartmentsService departmentsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResultDetailService resultDetailService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -146,28 +151,20 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
params.setDepartmentIds(departmentIds);
|
params.setDepartmentIds(departmentIds);
|
||||||
|
String departmentLevel = Constant.ME;
|
||||||
PageUtils pageUtils = null;
|
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(user.getUserId());
|
||||||
if(params.getIsSelf() == 1){ // 我的业绩
|
if (flowDepartment != null) {
|
||||||
params.setStaffId(user.getUserId());
|
departmentLevel = flowDepartment.getDepartmentLevel();
|
||||||
pageUtils = PageUtils.startPage(params.getPage(), params.getLimit() ).doSelect(
|
} else {
|
||||||
page -> resultRecordMapper.selectByCondition(page, params)
|
StaffRole staffRole = staffRoleService.selectByStaffId(user.getUserId());
|
||||||
);
|
if (staffRole != null) {
|
||||||
}else{ // 部门审批
|
departmentLevel = staffRole.getDepartmentLevel();
|
||||||
String departmentLevel = "";
|
|
||||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(user.getUserId());
|
|
||||||
if(flowDepartment !=null){
|
|
||||||
departmentLevel = flowDepartment.getDepartmentLevel();
|
|
||||||
}else{
|
|
||||||
StaffRole staffRole = staffRoleService.selectByStaffId(user.getUserId());
|
|
||||||
departmentLevel= staffRole.getDepartmentLevel();
|
|
||||||
}
|
}
|
||||||
params.setDepartmentLevel(departmentLevel);
|
|
||||||
pageUtils = PageUtils.startPage(params.getPage(), params.getLimit() ).doSelect(
|
|
||||||
page -> resultRecordMapper.selectByConditionByLeader(page, params)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
params.setDepartmentLevel(departmentLevel);
|
||||||
|
PageUtils pageUtils = PageUtils.startPage(params.getPage(), params.getLimit()).doSelect(
|
||||||
|
page -> resultRecordMapper.selectByConditionByLeader(page, params)
|
||||||
|
);
|
||||||
List<ResultRecord> resultRecords = pageUtils.getList();
|
List<ResultRecord> resultRecords = pageUtils.getList();
|
||||||
if(CollectionUtils.isNotEmpty(resultRecords)){
|
if(CollectionUtils.isNotEmpty(resultRecords)){
|
||||||
List<ResultRecordResp> list = new ArrayList<>();
|
List<ResultRecordResp> list = new ArrayList<>();
|
||||||
@ -221,16 +218,12 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
public void updateFlowStaffIdRoleToNull(Long id) {
|
public void updateFlowStaffIdRoleToNull(Long id) {
|
||||||
resultRecordMapper.updateFlowStaffIdRoleToNull(id);
|
resultRecordMapper.updateFlowStaffIdRoleToNull(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R approval(Long resultRecordId,Long userId) {
|
public TwoTuple getFlowInfo(Long staffId) {
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffId);
|
||||||
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
|
||||||
StaffEntity mySelf = staffService.selectStaffById(userId);
|
|
||||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffEntity.getId());
|
|
||||||
Long flowId = flowDepartment != null ? flowDepartment.getSelfFlowId() : 0l; // 表示是部门主管自己
|
Long flowId = flowDepartment != null ? flowDepartment.getSelfFlowId() : 0l; // 表示是部门主管自己
|
||||||
if (flowDepartment == null) {
|
if (flowDepartment == null) {
|
||||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffEntity.getId());
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
||||||
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
|
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
|
||||||
flowId = flowDepartment.getChildFlowId();//表示是部门下的普通员工
|
flowId = flowDepartment.getChildFlowId();//表示是部门下的普通员工
|
||||||
@ -245,6 +238,34 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return new TwoTuple(flowId, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultRecord createResultRecord(Long staffId ,int type) {
|
||||||
|
ResultRecord resultRecord = new ResultRecord();
|
||||||
|
resultRecord.setMonthTime(new Date());
|
||||||
|
if (type == 1) {
|
||||||
|
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId,7l));
|
||||||
|
} else {
|
||||||
|
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId,8l));
|
||||||
|
}
|
||||||
|
resultRecord.setStaffId(staffId);
|
||||||
|
resultRecord.setStatus(0);
|
||||||
|
resultRecord.setType(type);
|
||||||
|
resultRecordService.insertResultRecord(resultRecord);
|
||||||
|
return resultRecord;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R approval(Long resultRecordId, Long userId) {
|
||||||
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||||
|
StaffEntity mySelf = staffService.selectStaffById(userId);
|
||||||
|
TwoTuple<Long, List<FlowDepartment>> flowInfo = getFlowInfo(resultRecord.getStaffId());
|
||||||
|
Long flowId = flowInfo.getFirst();
|
||||||
|
List<FlowDepartment> list = flowInfo.getSecond();
|
||||||
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));
|
||||||
// approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
// approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
||||||
|
|||||||
@ -124,6 +124,10 @@
|
|||||||
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and status = 0 and (approval_staff_id is null or approval_staff_id = '') order by id desc limit 1
|
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and status = 0 and (approval_staff_id is null or approval_staff_id = '') order by id desc limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectFlowRecordByRecordId" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||||
|
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user