Merge branch 'version_1.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_1.0
This commit is contained in:
commit
bee21c30a7
@ -48,6 +48,7 @@ public class Constant {
|
||||
|
||||
public static final String SING = "【霖梓控股】";
|
||||
public static final Integer STATUS_3 = 3;
|
||||
public static String CHILD = "child";
|
||||
|
||||
/**
|
||||
* 菜单类型
|
||||
@ -155,6 +156,11 @@ public class Constant {
|
||||
public static final String INVELOMENT_TYPE_PRE_ENV = "preissue";
|
||||
public static final String FORMAL_APP_IDENTIFY = "www";
|
||||
public static final String ME = "ME";
|
||||
public static final String TYPE2 = "type2";
|
||||
public static final String TYPE1 = "type1";
|
||||
public static final String SELF = "self";
|
||||
public static final String TYPE = "type";
|
||||
|
||||
|
||||
public static final Integer TWO = 2;
|
||||
}
|
||||
|
||||
@ -10,9 +10,11 @@ import com.lz.modules.app.resp.ResultDetailResp;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
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.model.Auth;
|
||||
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.sys.controller.AbstractController;
|
||||
import com.lz.modules.sys.entity.SysUserEntity;
|
||||
@ -64,6 +66,8 @@ public class ResultRecordController extends AbstractController {
|
||||
@Autowired
|
||||
private ResultCommentService resultCommentService;
|
||||
|
||||
@Autowired
|
||||
private FlowRecordService flowRecordService;
|
||||
|
||||
|
||||
/**
|
||||
@ -86,6 +90,10 @@ public class ResultRecordController extends AbstractController {
|
||||
.put("departmentList", departmentList1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/getStaffResultDetail")
|
||||
public R getStaffResultDetail(ResultRecordReq req) {
|
||||
int yeJiCheckNum = 0;
|
||||
@ -100,48 +108,27 @@ public class ResultRecordController extends AbstractController {
|
||||
StaffDepartmentDto departmentDto = departmentsService.selectStaffAllDepartments(departmentsStaffRelateEntity.getDepartmentId());
|
||||
SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM");
|
||||
List<ResultDetailResp> list = new ArrayList<>();
|
||||
Long recordResultId = req.getRecordResultId();
|
||||
// 获取权限
|
||||
Auth auth = new Auth();
|
||||
List<RecordAuth> listAuth = new ArrayList<>();
|
||||
if (req.getRecordType() == 1) { //新增目标
|
||||
listAuth = recordAuthService.selectAuthInfo(7l);
|
||||
auth = recordAuthService.getAuth(listAuth);
|
||||
resultRecord = resultRecordService.createResultRecord(getUserId(), req.getRecordType(), 7l);
|
||||
flowRecordService.initFlowRecord(resultRecord, 7l, req.getType(), "月初目标");
|
||||
recordType = 3;
|
||||
} else if (req.getRecordType() == 2) { //新增业绩
|
||||
listAuth = recordAuthService.selectAuthInfo(8l);
|
||||
auth = recordAuthService.getAuth(listAuth);
|
||||
auth.setWenHuaEdit(1);
|
||||
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffId(getUserId());
|
||||
ResultRecord resultRecordNew = null;
|
||||
if (resultRecordOld != null) {
|
||||
Long recordId = resultRecordOld.getId();
|
||||
resultRecordOld.setId(null);
|
||||
resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), 8l));
|
||||
resultRecordService.insertResultRecord(resultRecordOld);
|
||||
resultRecordNew = resultRecordOld;
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||
// 保存业绩相关
|
||||
for (ResultDetail resultDetail : resultDetails) {
|
||||
resultDetail.setRecordId(resultRecordNew.getId());
|
||||
resultDetail.setId(null);
|
||||
resultDetailService.insertResultDetail(resultDetail);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resultRecordNew = createResultRecord(getUserId(), 2);
|
||||
}
|
||||
//保存文件价值观
|
||||
resultRecord = resultRecordService.initResult(getUserId(), req.getRecordType(), 8l);
|
||||
recordType = 3;
|
||||
resultDetailService.insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), getUserId());
|
||||
resultDetailService.insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), getUserId());
|
||||
recordResultId = resultRecordNew.getId();
|
||||
} else if (resultRecord != null) {
|
||||
Map<Long, Long> staffRoleMap = recordAuthService.selectRoleIdByStaffRoleInfo(resultRecord.getFlowStaffIdRole());
|
||||
listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(getUserId()));
|
||||
auth = recordAuthService.getAuth(listAuth);
|
||||
}
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordResultId);
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());
|
||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
||||
int tempType1 = NumberUtil.objToIntDefault(details.get(new Integer(1)), 0);
|
||||
@ -204,7 +191,6 @@ public class ResultRecordController extends AbstractController {
|
||||
list.add(comment);
|
||||
}
|
||||
}
|
||||
|
||||
String superStaff = recordAuthService.selectByStaffId(resultRecord.getStaffId());
|
||||
return R.ok()
|
||||
.put("staffName", staffEntity.getName())
|
||||
@ -215,12 +201,12 @@ public class ResultRecordController extends AbstractController {
|
||||
.put("list", list)
|
||||
.put("auth", auth)
|
||||
.put("recordType", recordType)
|
||||
.put("recordResultId", recordResultId)
|
||||
.put("recordResultId", resultRecord.getId())
|
||||
.put("yeJiCheckNum", yeJiCheckNum)
|
||||
.put("wenHuaJiaZhiGuanNum", wenHuaJiaZhiGuanNum)
|
||||
.put("lastResultNum", lastResultNum)
|
||||
.put("commentNum", commentNum)
|
||||
.put("superStaff",superStaff);
|
||||
.put("superStaff", superStaff);
|
||||
}
|
||||
|
||||
@RequestMapping("/commitApproval")
|
||||
@ -232,6 +218,19 @@ public class ResultRecordController extends AbstractController {
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
|
||||
resultRecord.setStatus(Constant.STATUS_3);
|
||||
resultRecordService.updateResultRecordById(resultRecord);
|
||||
} else if (req.getStatus() == 4) { // 驳回
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordId(req.getRecordResultId());
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordResultId());
|
||||
if (flowRecords.size() > 0 && req.getRollbackFlowId() > 0) {
|
||||
for (FlowRecord flowRecord : flowRecords) {
|
||||
if (flowRecord.getId().equals(req.getRollbackFlowId())) {
|
||||
resultRecord.setFlowStaffIdRole(flowRecord.getFlowStaffIdRole());
|
||||
} else {
|
||||
resultRecord.setStatus(1);
|
||||
}
|
||||
resultRecordService.updateResultRecordById(resultRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok("成功");
|
||||
}
|
||||
@ -264,7 +263,9 @@ public class ResultRecordController extends AbstractController {
|
||||
if (resultComment == null || !getUserId().equals(resultComment.getStaffId())) {
|
||||
resultComment = new ResultComment();
|
||||
}
|
||||
return R.ok().put("resultComment", resultComment);
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordId(recordId);
|
||||
return R.ok().put("resultComment", resultComment)
|
||||
.put("list",flowRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -355,47 +356,24 @@ public class ResultRecordController extends AbstractController {
|
||||
*/
|
||||
@RequestMapping("/detailAddOrUpdate")
|
||||
public R detailAddOrUpdate(ResultDetailReq req) {
|
||||
Long recordId = 0l;
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordId());
|
||||
req.setKeyResult(StringUtil.decodeBase64(req.getKeyResult()));
|
||||
req.setCheckResult(StringUtil.decodeBase64(req.getCheckResult()));
|
||||
req.setScoreComment(StringUtil.decodeBase64(req.getScoreComment()));
|
||||
ResultDetail old = resultDetailService.selectResultDetailById(req.getId());
|
||||
if (old != null) {
|
||||
com.lz.modules.app.utils.BeanUtils.copyProperty(old, req, false);
|
||||
old.setKeyResult(StringUtil.decodeBase64(req.getKeyResult()));
|
||||
old.setCheckResult(StringUtil.decodeBase64(req.getCheckResult()));
|
||||
old.setScoreComment(StringUtil.decodeBase64(req.getScoreComment()));
|
||||
recordId = old.getRecordId();
|
||||
resultDetailService.updateResultDetailById(old);
|
||||
} else {
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(req.getRecordId());
|
||||
if (resultRecord == null) {
|
||||
createResultRecord(getUserId(), req.getRecordType());
|
||||
}
|
||||
recordId = resultRecord.getId();
|
||||
req.setKeyResult(StringUtil.decodeBase64(req.getKeyResult()));
|
||||
req.setCheckResult(StringUtil.decodeBase64(req.getCheckResult()));
|
||||
req.setScoreComment(StringUtil.decodeBase64(req.getScoreComment()));
|
||||
ResultDetail resultDetail = new ResultDetail();
|
||||
BeanUtils.copyProperties(req, resultDetail);
|
||||
resultDetail.setRecordId(resultRecord.getId());
|
||||
resultDetail.setStaffId(getUserId());
|
||||
resultDetail.setStaffId(resultRecord.getStaffId());
|
||||
resultDetailService.insertResultDetail(resultDetail);
|
||||
}
|
||||
return R.ok("保存成功").put("recordId", recordId);
|
||||
return R.ok("保存成功").put("recordId", resultRecord.getId());
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
|
||||
@ -34,4 +34,5 @@ public class ResultRecordReq {
|
||||
private String departmentLevel ;
|
||||
private String resultComment;
|
||||
private Long resultCommitId;
|
||||
private Long rollbackFlowId;
|
||||
}
|
||||
|
||||
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 com.lz.common.utils.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 org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
||||
|
||||
@ -33,4 +36,8 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
||||
FlowRecord selectLastFlowRecordByRecordId(@Param("recordId") Long recordId);
|
||||
|
||||
FlowRecord selectNotApprovalStaffIdFlowRecords(@Param("recordId") Long recordId);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordId(@Param("recordId") Long recordId);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByResultRecordIdFlowId(@Param("recordId") Long recordId, @Param("rollbackFlowId") Long rollbackFlowId);
|
||||
}
|
||||
@ -9,7 +9,7 @@ import java.util.Date;
|
||||
* 菜单权限表
|
||||
* </p>*流转关系表
|
||||
* @author quyixiao
|
||||
* @since 2020-08-20
|
||||
* @since 2020-08-23
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -26,10 +26,8 @@ public class FlowDepartment implements java.io.Serializable {
|
||||
private Date gmtModified;
|
||||
//员工 id
|
||||
private Long staffId;
|
||||
//自己部门小伙伴 走的 流程id
|
||||
private Long childFlowId;
|
||||
//自己走的流程 id
|
||||
private Long selfFlowId;
|
||||
private String flowIds;
|
||||
//部门级别
|
||||
private String departmentLevel;
|
||||
//
|
||||
@ -109,34 +107,19 @@ public class FlowDepartment implements java.io.Serializable {
|
||||
this.staffId = staffId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自己部门小伙伴 走的 流程id
|
||||
* @return
|
||||
*/
|
||||
public Long getChildFlowId() {
|
||||
return childFlowId;
|
||||
}
|
||||
/**
|
||||
* 自己部门小伙伴 走的 流程id
|
||||
* @param childFlowId
|
||||
*/
|
||||
public void setChildFlowId(Long childFlowId) {
|
||||
this.childFlowId = childFlowId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自己走的流程 id
|
||||
* @return
|
||||
*/
|
||||
public Long getSelfFlowId() {
|
||||
return selfFlowId;
|
||||
public String getFlowIds() {
|
||||
return flowIds;
|
||||
}
|
||||
/**
|
||||
* 自己走的流程 id
|
||||
* @param selfFlowId
|
||||
* @param flowIds
|
||||
*/
|
||||
public void setSelfFlowId(Long selfFlowId) {
|
||||
this.selfFlowId = selfFlowId;
|
||||
public void setFlowIds(String flowIds) {
|
||||
this.flowIds = flowIds;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,8 +160,7 @@ public class FlowDepartment implements java.io.Serializable {
|
||||
",gmtCreate=" + gmtCreate +
|
||||
",gmtModified=" + gmtModified +
|
||||
",staffId=" + staffId +
|
||||
",childFlowId=" + childFlowId +
|
||||
",selfFlowId=" + selfFlowId +
|
||||
",flowIds=" + flowIds +
|
||||
",departmentLevel=" + departmentLevel +
|
||||
",parentId=" + parentId +
|
||||
"}";
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.Date;
|
||||
* 菜单权限表
|
||||
* </p>*流转关系表
|
||||
* @author quyixiao
|
||||
* @since 2020-08-20
|
||||
* @since 2020-08-23
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -29,7 +29,7 @@ public class StaffRole implements java.io.Serializable {
|
||||
//角色
|
||||
private String departmentLevel;
|
||||
//角色 id
|
||||
private Long roleId;
|
||||
private String typeRoleIds;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -124,15 +124,15 @@ public class StaffRole implements java.io.Serializable {
|
||||
* 角色 id
|
||||
* @return
|
||||
*/
|
||||
public Long getRoleId() {
|
||||
return roleId;
|
||||
public String getTypeRoleIds() {
|
||||
return typeRoleIds;
|
||||
}
|
||||
/**
|
||||
* 角色 id
|
||||
* @param roleId
|
||||
* @param typeRoleIds
|
||||
*/
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
public void setTypeRoleIds(String typeRoleIds) {
|
||||
this.typeRoleIds = typeRoleIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class StaffRole implements java.io.Serializable {
|
||||
",gmtModified=" + gmtModified +
|
||||
",staffId=" + staffId +
|
||||
",departmentLevel=" + departmentLevel +
|
||||
",roleId=" + roleId +
|
||||
",typeRoleIds=" + typeRoleIds +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -20,11 +20,25 @@ 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) {
|
||||
List<StaffRoleDto> staffRoleDtoList = new ArrayList<>();
|
||||
StaffRoleDto staffRoleDto = new StaffRoleDto(314l,6l);
|
||||
staffRoleDtoList.add(staffRoleDto);
|
||||
System.out.println(JSON.toJSONString(staffRoleDtoList));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
60
src/main/java/com/lz/modules/flow/model/TypeFlowDto.java
Normal file
60
src/main/java/com/lz/modules/flow/model/TypeFlowDto.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.lz.modules.flow.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lz.common.utils.Constant;
|
||||
import com.lz.common.utils.NumberUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class TypeFlowDto {
|
||||
private String type;
|
||||
private Long flowId;
|
||||
|
||||
public TypeFlowDto() {
|
||||
}
|
||||
|
||||
public TypeFlowDto(String type, Long flowId) {
|
||||
this.type = type;
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
|
||||
public static Long getFlowId(String flowInfo, String orderTo, Integer type) {
|
||||
Map<String, JSONObject> map = JSONObject.parseObject(flowInfo, Map.class);
|
||||
JSONObject flowType = map.get(orderTo);
|
||||
Map<String, Integer> list = JSONObject.parseObject(flowType.toJSONString(), Map.class);
|
||||
return NumberUtil.objToLongDefault(list.get(Constant.TYPE + type),0l);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
Map<String, Map<String, Long>> map = new HashMap<>();
|
||||
Map<String, Long> map1 = new HashMap<>();
|
||||
map1.put("type1" ,6l);
|
||||
map1.put("type2", 1l);
|
||||
|
||||
|
||||
Map<String,Long> map2 = new HashMap<>();
|
||||
map2.put("type1",7l);
|
||||
map2.put("type2",2l);
|
||||
|
||||
map.put("child",map1);
|
||||
map.put("self",map2);
|
||||
|
||||
String a = JSON.toJSONString(map);
|
||||
System.out.println(a);
|
||||
Long b = getFlowId(a,"self",2);
|
||||
System.out.println(b);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
47
src/main/java/com/lz/modules/flow/model/TypeRoleDto.java
Normal file
47
src/main/java/com/lz/modules/flow/model/TypeRoleDto.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.lz.modules.flow.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lz.common.utils.Constant;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class TypeRoleDto {
|
||||
private String type;
|
||||
private Long roleId;
|
||||
|
||||
public TypeRoleDto() {
|
||||
}
|
||||
|
||||
public TypeRoleDto(String type, Long roleId) {
|
||||
this.type = type;
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public static Long getRoleId(String flowInfo, Integer type) {
|
||||
Map<String, Long> a = JSONObject.parseObject(JSON.toJSONBytes(flowInfo), Map.class);
|
||||
return a.get(Constant.TYPE + type);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
Map<String,Long> map = new HashMap();
|
||||
map.put("type1",3l);
|
||||
map.put("type2",3l);
|
||||
System.out.println(JSON.toJSONString(map));
|
||||
|
||||
|
||||
Map<String,Long > a = JSONObject.parseObject(JSON.toJSONBytes(map),Map.class);
|
||||
System.out.println(a.get("type1"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -2,6 +2,9 @@ package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.flow.entity.FlowRecord;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -33,4 +36,10 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
||||
FlowRecord selectLastFlowRecordByRecordId(Long recordResultId);
|
||||
|
||||
FlowRecord selectNotApprovalStaffIdFlowRecords(Long recordId);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByRecordId(Long recordId);
|
||||
|
||||
void initFlowRecord(ResultRecord resultRecord , Long roleId , Integer type , String name);
|
||||
|
||||
List<FlowRecord> selectFlowRecordByResultRecordIdFlowId(Long recordResultId, Long rollbackFlowId);
|
||||
}
|
||||
@ -1,12 +1,23 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
|
||||
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.entity.FlowRecord;
|
||||
import com.lz.modules.flow.model.StaffRoleDto;
|
||||
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.apache.tomcat.util.bcel.Const;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 流转记录表 服务类
|
||||
@ -23,6 +34,12 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
||||
@Autowired
|
||||
private FlowRecordMapper flowRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
@Autowired
|
||||
private ResultRecordService resultRecordService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@ -66,5 +83,33 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
||||
return flowRecordMapper.selectNotApprovalStaffIdFlowRecords(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowRecord> selectFlowRecordByRecordId(Long recordId) {
|
||||
return flowRecordMapper.selectFlowRecordByRecordId(recordId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initFlowRecord(ResultRecord resultRecord, Long roleId , Integer type , String name) {
|
||||
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||
FlowRecord flowRecord = new FlowRecord();
|
||||
flowRecord.setFlowStaffIdRole(StaffRoleDto.getStaffRole(resultRecord.getStaffId(), roleId));
|
||||
OneTuple<Long> flowInfo = resultRecordService.getFlowInfo(resultRecord.getStaffId(), type);
|
||||
flowRecord.setFlowId(flowInfo.getFirst());
|
||||
flowRecord.setApprovalStaffId(resultRecord.getStaffId());
|
||||
flowRecord.setApprovalStaffName(staffEntity.getName());
|
||||
flowRecord.setFlowIndex(0);
|
||||
flowRecord.setFlowName(staffEntity.getName() + "-"+name);
|
||||
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||
flowRecord.setRecordId(resultRecord.getId());
|
||||
flowRecord.setStatus(0);
|
||||
flowRecord.setDepartmentLevel(Constant.ME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FlowRecord> selectFlowRecordByResultRecordIdFlowId(Long recordResultId, Long rollbackFlowId) {
|
||||
return flowRecordMapper.selectFlowRecordByResultRecordIdFlowId(recordResultId, rollbackFlowId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -297,4 +297,7 @@ public class ResultRecord implements java.io.Serializable {
|
||||
",staffName=" + staffName +
|
||||
"}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
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.app.ResultRecord;
|
||||
|
||||
@ -48,4 +49,10 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
||||
R approval(Long resultRecordId, Long userId);
|
||||
|
||||
List<ResultRecord> selectResultRecordByIds(List<Long> recordIds);
|
||||
|
||||
TwoTuple getFlowInfo(Long staffId,Integer type);
|
||||
|
||||
ResultRecord createResultRecord(Long userId, int type,Long roleId);
|
||||
|
||||
ResultRecord initResult(Long staffId ,Integer recordType,Long roleId) ;
|
||||
}
|
||||
@ -14,12 +14,17 @@ import com.lz.modules.app.resp.ResultRecordResp;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.DepartmentsStaffRelateService;
|
||||
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.model.StaffRoleDto;
|
||||
import com.lz.modules.flow.model.TypeFlowDto;
|
||||
import com.lz.modules.flow.model.TypeRoleDto;
|
||||
import com.lz.modules.flow.service.*;
|
||||
import com.lz.modules.sys.dao.app.ResultRecordMapper;
|
||||
import com.lz.modules.sys.entity.SysUserEntity;
|
||||
import com.lz.modules.sys.entity.app.ResultDetail;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@ -89,6 +94,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
|
||||
@Autowired
|
||||
private ResultDetailService resultDetailService;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -146,28 +154,20 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
}
|
||||
params.setDepartmentIds(departmentIds);
|
||||
|
||||
PageUtils pageUtils = null;
|
||||
if(params.getIsSelf() == 1){ // 我的业绩
|
||||
params.setStaffId(user.getUserId());
|
||||
pageUtils = PageUtils.startPage(params.getPage(), params.getLimit() ).doSelect(
|
||||
page -> resultRecordMapper.selectByCondition(page, params)
|
||||
);
|
||||
}else{ // 部门审批
|
||||
String departmentLevel = "";
|
||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(user.getUserId());
|
||||
if(flowDepartment !=null){
|
||||
departmentLevel = flowDepartment.getDepartmentLevel();
|
||||
}else{
|
||||
StaffRole staffRole = staffRoleService.selectByStaffId(user.getUserId());
|
||||
departmentLevel= staffRole.getDepartmentLevel();
|
||||
String departmentLevel = Constant.ME;
|
||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(user.getUserId());
|
||||
if (flowDepartment != null) {
|
||||
departmentLevel = flowDepartment.getDepartmentLevel();
|
||||
} else {
|
||||
StaffRole staffRole = staffRoleService.selectByStaffId(user.getUserId());
|
||||
if (staffRole != null) {
|
||||
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();
|
||||
if(CollectionUtils.isNotEmpty(resultRecords)){
|
||||
List<ResultRecordResp> list = new ArrayList<>();
|
||||
@ -223,17 +223,14 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
}
|
||||
|
||||
@Override
|
||||
public R approval(Long resultRecordId,Long userId) {
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||
StaffEntity staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||
StaffEntity mySelf = staffService.selectStaffById(userId);
|
||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffEntity.getId());
|
||||
Long flowId = flowDepartment != null ? flowDepartment.getSelfFlowId() : 0l; // 表示是部门主管自己
|
||||
public TwoTuple getFlowInfo(Long staffId, Integer type) {
|
||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffId);
|
||||
Long flowId = flowDepartment != null ? TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.SELF, type) : 0l; // 表示是部门主管自己
|
||||
if (flowDepartment == null) {
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffEntity.getId());
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
||||
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
|
||||
flowId = flowDepartment.getChildFlowId();//表示是部门下的普通员工
|
||||
flowId = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.CHILD, type);//表示是部门下的普通员工
|
||||
}
|
||||
List<FlowDepartment> list = new ArrayList<>();
|
||||
list.add(flowDepartment);
|
||||
@ -245,6 +242,61 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
break;
|
||||
}
|
||||
}
|
||||
return new TwoTuple(flowId, list);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultRecord createResultRecord(Long staffId, int type,Long roleId) {
|
||||
ResultRecord resultRecord = new ResultRecord();
|
||||
resultRecord.setMonthTime(new Date());
|
||||
resultRecord.setFlowStaffIdRole(resultDetailService.initRole(staffId,roleId));
|
||||
resultRecord.setStaffId(staffId);
|
||||
resultRecord.setStatus(0);
|
||||
resultRecord.setType(type);
|
||||
resultRecordService.insertResultRecord(resultRecord);
|
||||
return resultRecord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultRecord initResult(Long staffId ,Integer recordType,Long roleId) {
|
||||
ResultRecord resultRecordOld = resultRecordService.selectResultRecordByStaffId(staffId);
|
||||
ResultRecord resultRecordNew = null;
|
||||
if (resultRecordOld != null) {
|
||||
Long recordId = resultRecordOld.getId();
|
||||
resultRecordOld.setId(null);
|
||||
resultRecordOld.setType(Constant.TWO);
|
||||
resultRecordOld.setFlowStaffIdRole(resultDetailService.initRole(resultRecordOld.getStaffId(), roleId));
|
||||
resultRecordService.insertResultRecord(resultRecordOld);
|
||||
flowRecordService.initFlowRecord(resultRecordOld,roleId,recordType,"月未总结");
|
||||
resultRecordNew = resultRecordOld;
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||
// 保存业绩相关
|
||||
for (ResultDetail resultDetail : resultDetails) {
|
||||
resultDetail.setRecordId(resultRecordNew.getId());
|
||||
resultDetail.setId(null);
|
||||
resultDetail.setType(Constant.TWO);
|
||||
resultDetailService.insertResultDetail(resultDetail);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
resultRecordNew = resultRecordService.createResultRecord(staffId,recordType,roleId);
|
||||
}
|
||||
//保存文件价值观
|
||||
resultDetailService.insertWenHuaJiaZhiGua("做人:相信、包容、担当", resultRecordNew.getId(), staffId);
|
||||
resultDetailService.insertWenHuaJiaZhiGua("做事:用户第一、求真、极致", resultRecordNew.getId(), staffId);
|
||||
return resultRecordNew;
|
||||
}
|
||||
|
||||
|
||||
@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(),resultRecord.getType());
|
||||
Long flowId = flowInfo.getFirst();
|
||||
List<FlowDepartment> list = flowInfo.getSecond();
|
||||
List<FlowRelation> flowRelations = flowRelationService.selectFlowRelationAll();
|
||||
Map<String, FlowDepartment> staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p));
|
||||
// approvalList = [ME,ONE_D,TWO_D,HR,BOSS]
|
||||
@ -282,24 +334,24 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
List<StaffRoleDto> staffRoleDtos = new ArrayList<>();
|
||||
if (Constant.ME.equals(departmentLevel)) { //如果是自己
|
||||
approvalStaff = staff; // 是自己进行审批
|
||||
StaffRoleDto staffRoleDto = new StaffRoleDto(staff.getId(),flows.get(flowIndex-1).getRoleId());
|
||||
StaffRoleDto staffRoleDto = new StaffRoleDto(staff.getId(), flows.get(flowIndex - 1).getRoleId());
|
||||
staffRoleDtos.add(staffRoleDto);
|
||||
} else {
|
||||
FlowDepartment flowD = staffEntityMap.get(departmentLevel);
|
||||
if (flowD == null) {
|
||||
List<StaffRole> staffRoles = staffRoleService.selectByRole(departmentLevel);
|
||||
for(StaffRole staffRole: staffRoles ){
|
||||
for (StaffRole staffRole : staffRoles) {
|
||||
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||
Map<String, String> departmentIdMap = departmentsService.selectUserAllDepartmentIds(resultRecord.getDepartmentId());
|
||||
for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) {
|
||||
String value = departmentIdMap.get(staffRoleDepartment.getDepartmentId());
|
||||
if(StringUtil.isNotBlank(value) ){
|
||||
StaffRoleDto staffRoleDto = new StaffRoleDto(staffRole.getStaffId(),staffRole.getRoleId());
|
||||
if (StringUtil.isNotBlank(value)) {
|
||||
StaffRoleDto staffRoleDto = new StaffRoleDto(staffRole.getStaffId(), TypeRoleDto.getRoleId(staffRole.getTypeRoleIds(),resultRecord.getType()));
|
||||
staffRoleDtos.add(staffRoleDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(staffRoleDtos.size() == 1 ){ //表示只有一个审批的用户
|
||||
if (staffRoleDtos.size() == 1) { //表示只有一个审批的用户
|
||||
approvalStaff = staffService.selectStaffById(staffRoleDtos.get(0).getStaffId());
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -9,8 +9,7 @@
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="staff_id" property="staffId"/>
|
||||
<result column="child_flow_id" property="childFlowId"/>
|
||||
<result column="self_flow_id" property="selfFlowId"/>
|
||||
<result column="flow_ids" property="flowIds"/>
|
||||
<result column="department_level" property="departmentLevel"/>
|
||||
<result column="parent_id" property="parentId"/>
|
||||
</resultMap>
|
||||
@ -18,7 +17,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, child_flow_id AS childFlowId, self_flow_id AS selfFlowId, department_level AS departmentLevel, parent_id AS parentId
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, flow_ids AS flowIds, department_level AS departmentLevel, parent_id AS parentId
|
||||
</sql>
|
||||
|
||||
|
||||
@ -32,8 +31,7 @@
|
||||
<insert id="insertFlowDepartment" parameterType="FlowDepartment" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into lz_flow_department(
|
||||
<if test="staffId != null">staff_id, </if>
|
||||
<if test="childFlowId != null">child_flow_id, </if>
|
||||
<if test="selfFlowId != null">self_flow_id, </if>
|
||||
<if test="flowIds != null">flow_ids, </if>
|
||||
<if test="departmentLevel != null">department_level, </if>
|
||||
<if test="parentId != null">parent_id, </if>
|
||||
is_delete,
|
||||
@ -41,8 +39,7 @@
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="staffId != null">#{ staffId}, </if>
|
||||
<if test="childFlowId != null">#{ childFlowId}, </if>
|
||||
<if test="selfFlowId != null">#{ selfFlowId}, </if>
|
||||
<if test="flowIds != null">#{ flowIds}, </if>
|
||||
<if test="departmentLevel != null">#{ departmentLevel}, </if>
|
||||
<if test="parentId != null">#{ parentId}, </if>
|
||||
0,
|
||||
@ -59,8 +56,7 @@
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="staffId != null">staff_id = #{staffId},</if>
|
||||
<if test="childFlowId != null">child_flow_id = #{childFlowId},</if>
|
||||
<if test="selfFlowId != null">self_flow_id = #{selfFlowId},</if>
|
||||
<if test="flowIds != null">flow_ids = #{flowIds},</if>
|
||||
<if test="departmentLevel != null">department_level = #{departmentLevel},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId}</if>
|
||||
</trim>
|
||||
@ -76,8 +72,7 @@
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
staff_id = #{staffId},
|
||||
child_flow_id = #{childFlowId},
|
||||
self_flow_id = #{selfFlowId},
|
||||
flow_ids = #{flowIds},
|
||||
department_level = #{departmentLevel},
|
||||
parent_id = #{parentId}
|
||||
,gmt_modified = now()
|
||||
@ -90,6 +85,8 @@
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectByStaffId" resultType="com.lz.modules.flow.entity.FlowDepartment">
|
||||
select * from lz_flow_department where is_delete = 0 and staff_id = #{staffId} limit 1
|
||||
</select>
|
||||
|
||||
@ -124,6 +124,13 @@
|
||||
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 id="selectFlowRecordByRecordId" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId}
|
||||
</select>
|
||||
<select id="selectFlowRecordByResultRecordIdFlowId" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||
select * from lz_flow_record where is_delete = 0 and record_id = #{recordId} and id > #{rollbackFlowId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="staff_id" property="staffId"/>
|
||||
<result column="department_level" property="departmentLevel"/>
|
||||
<result column="role_id" property="roleId"/>
|
||||
<result column="type_role_ids" property="typeRoleIds"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, role_id AS roleId
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, department_level AS departmentLevel, type_role_ids AS typeRoleIds
|
||||
</sql>
|
||||
|
||||
|
||||
@ -31,14 +31,14 @@
|
||||
insert into lz_staff_role(
|
||||
<if test="staffId != null">staff_id, </if>
|
||||
<if test="departmentLevel != null">department_level, </if>
|
||||
<if test="roleId != null">role_id, </if>
|
||||
<if test="typeRoleIds != null">type_role_ids, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="staffId != null">#{ staffId}, </if>
|
||||
<if test="departmentLevel != null">#{ departmentLevel}, </if>
|
||||
<if test="roleId != null">#{ roleId}, </if>
|
||||
<if test="typeRoleIds != null">#{ typeRoleIds}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
@ -54,7 +54,7 @@
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="staffId != null">staff_id = #{staffId},</if>
|
||||
<if test="departmentLevel != null">department_level = #{departmentLevel},</if>
|
||||
<if test="roleId != null">role_id = #{roleId}</if>
|
||||
<if test="typeRoleIds != null">type_role_ids = #{typeRoleIds}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -69,7 +69,7 @@
|
||||
gmt_create = #{gmtCreate},
|
||||
staff_id = #{staffId},
|
||||
department_level = #{departmentLevel},
|
||||
role_id = #{roleId}
|
||||
type_role_ids = #{typeRoleIds}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -79,8 +79,6 @@
|
||||
update lz_staff_role set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="selectByStaffId" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and staff_id = #{staffId} limit 1
|
||||
</select>
|
||||
|
||||
@ -63,7 +63,7 @@ public class MysqlMain {
|
||||
|
||||
|
||||
|
||||
list.add(new TablesBean("luck"));
|
||||
list.add(new TablesBean("lz_staff_role"));
|
||||
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user