Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
dd845a1ac7
@ -10,9 +10,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @类描述:字符串工具类
|
|
||||||
* @author 陈金虎 2017年1月16日 下午11:43:50
|
* @author 陈金虎 2017年1月16日 下午11:43:50
|
||||||
|
* @类描述:字符串工具类
|
||||||
* @注意:本内容仅限于杭州霖梓网络科技有限公司内部传阅,禁止外泄以及用于其他的商业目的
|
* @注意:本内容仅限于杭州霖梓网络科技有限公司内部传阅,禁止外泄以及用于其他的商业目的
|
||||||
*/
|
*/
|
||||||
public class StringUtil extends StringUtils {
|
public class StringUtil extends StringUtils {
|
||||||
@ -23,6 +22,7 @@ public class StringUtil extends StringUtils {
|
|||||||
private static final String[] DUOTRIKEY = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V"};
|
private static final String[] DUOTRIKEY = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V"};
|
||||||
private static final String[] CARDINALNUM = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
|
private static final String[] CARDINALNUM = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
|
||||||
private static final String[] NUMBERS = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
|
private static final String[] NUMBERS = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过StringBuffer来组装字符串
|
* 通过StringBuffer来组装字符串
|
||||||
*
|
*
|
||||||
@ -62,10 +62,8 @@ public class StringUtil extends StringUtils {
|
|||||||
/**
|
/**
|
||||||
* 把list按分隔符转换成字符串
|
* 把list按分隔符转换成字符串
|
||||||
*
|
*
|
||||||
* @param strList
|
* @param strList list数据
|
||||||
* list数据
|
* @param separator 分隔符
|
||||||
* @param separator
|
|
||||||
* 分隔符
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String turnListToStr(Collection<String> strList, String separator) {
|
public static String turnListToStr(Collection<String> strList, String separator) {
|
||||||
@ -86,10 +84,8 @@ public class StringUtil extends StringUtils {
|
|||||||
/**
|
/**
|
||||||
* 把字符串数组按分隔符转化成字符串
|
* 把字符串数组按分隔符转化成字符串
|
||||||
*
|
*
|
||||||
* @param strArr
|
* @param strArr 字符串数组
|
||||||
* 字符串数组
|
* @param separator 分隔符
|
||||||
* @param separator
|
|
||||||
* 分隔符
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String turnArrayToStr(String separator, String... strArr) {
|
public static String turnArrayToStr(String separator, String... strArr) {
|
||||||
@ -149,12 +145,10 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @方法描述:将字符串中的emoji符号转换为*
|
* @param source 待处理字符串
|
||||||
*
|
|
||||||
* @author huyang 2017年4月6日下午12:38:04
|
|
||||||
* @param source
|
|
||||||
* 待处理字符串
|
|
||||||
* @return
|
* @return
|
||||||
|
* @方法描述:将字符串中的emoji符号转换为*
|
||||||
|
* @author huyang 2017年4月6日下午12:38:04
|
||||||
* @注意:本内容仅限于杭州霖梓网络科技有限公司内部传阅,禁止外泄以及用于其他的商业目的
|
* @注意:本内容仅限于杭州霖梓网络科技有限公司内部传阅,禁止外泄以及用于其他的商业目的
|
||||||
*/
|
*/
|
||||||
public static String filterEmoji(String source) {
|
public static String filterEmoji(String source) {
|
||||||
@ -182,10 +176,10 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Title: UrlEncoder
|
|
||||||
* @Description: 字符串编码
|
|
||||||
* @param sStr
|
* @param sStr
|
||||||
* @return
|
* @return
|
||||||
|
* @Title: UrlEncoder
|
||||||
|
* @Description: 字符串编码
|
||||||
*/
|
*/
|
||||||
public final static String UrlEncoder(String sStr) {
|
public final static String UrlEncoder(String sStr) {
|
||||||
String sReturnCode = "";
|
String sReturnCode = "";
|
||||||
@ -197,10 +191,10 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Title: UrlDecoder
|
|
||||||
* @Description: 字符串解码
|
|
||||||
* @param sStr
|
* @param sStr
|
||||||
* @return
|
* @return
|
||||||
|
* @Title: UrlDecoder
|
||||||
|
* @Description: 字符串解码
|
||||||
*/
|
*/
|
||||||
public static String UrlDecoder(String sStr) {
|
public static String UrlDecoder(String sStr) {
|
||||||
if (isEmpty(sStr)) {
|
if (isEmpty(sStr)) {
|
||||||
@ -276,7 +270,6 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fmai 根据时间数据生产相应的字符串
|
* fmai 根据时间数据生产相应的字符串
|
||||||
*
|
*
|
||||||
@ -306,7 +299,6 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 首字母大写
|
* 首字母大写
|
||||||
*
|
*
|
||||||
@ -334,7 +326,6 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将对象转为字符串
|
* 将对象转为字符串
|
||||||
*
|
*
|
||||||
@ -355,7 +346,6 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String removeDoubleChar(String str) {
|
public static String removeDoubleChar(String str) {
|
||||||
if (str.indexOf("\"") == 0) {
|
if (str.indexOf("\"") == 0) {
|
||||||
str = str.substring(1, str.length()); //去掉第一个 "
|
str = str.substring(1, str.length()); //去掉第一个 "
|
||||||
@ -367,10 +357,9 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过请求参数获取键值对
|
* 通过请求参数获取键值对
|
||||||
|
*
|
||||||
* @param requestParams
|
* @param requestParams
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -389,9 +378,9 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 除去数组中的空值和签名参数
|
* 除去数组中的空值和签名参数
|
||||||
|
*
|
||||||
* @param sArray 签名参数组
|
* @param sArray 签名参数组
|
||||||
* @return 去掉空值与签名参数后的新签名参数组
|
* @return 去掉空值与签名参数后的新签名参数组
|
||||||
*/
|
*/
|
||||||
@ -418,6 +407,7 @@ public class StringUtil extends StringUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 把数组所有元素排序,并按照“参数=参数值”的模式用“&”字符拼接成字符串
|
* 把数组所有元素排序,并按照“参数=参数值”的模式用“&”字符拼接成字符串
|
||||||
|
*
|
||||||
* @param params 需要排序并参与字符拼接的参数组
|
* @param params 需要排序并参与字符拼接的参数组
|
||||||
* @return 拼接后字符串
|
* @return 拼接后字符串
|
||||||
*/
|
*/
|
||||||
@ -508,6 +498,7 @@ public class StringUtil extends StringUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 截取一个字符串中两个字符串中间的字符串
|
* 截取一个字符串中两个字符串中间的字符串
|
||||||
|
*
|
||||||
* @param str
|
* @param str
|
||||||
* @param strStart
|
* @param strStart
|
||||||
* @param strEnd
|
* @param strEnd
|
||||||
@ -537,6 +528,7 @@ public class StringUtil extends StringUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Object转换String
|
* Object转换String
|
||||||
|
*
|
||||||
* @param obj
|
* @param obj
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -550,6 +542,7 @@ public class StringUtil extends StringUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号的粗略校验(要求严谨时,慎用)
|
* 手机号的粗略校验(要求严谨时,慎用)
|
||||||
|
*
|
||||||
* @param inputStr
|
* @param inputStr
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -580,8 +573,10 @@ public class StringUtil extends StringUtils {
|
|||||||
public static List<Long> strs2list(String strs) {
|
public static List<Long> strs2list(String strs) {
|
||||||
return strs2list(strs, ",");
|
return strs2list(strs, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据分隔符获取Long型的集合
|
* 根据分隔符获取Long型的集合
|
||||||
|
*
|
||||||
* @param listStr
|
* @param listStr
|
||||||
* @param symbol
|
* @param symbol
|
||||||
* @return
|
* @return
|
||||||
@ -605,6 +600,7 @@ public class StringUtil extends StringUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 将字符串的首字母转大写
|
* 将字符串的首字母转大写
|
||||||
|
*
|
||||||
* @param str 需要转换的字符串
|
* @param str 需要转换的字符串
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -643,6 +639,7 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
System.out.println(realNameTo2("xxxxx"));
|
System.out.println(realNameTo2("xxxxx"));
|
||||||
@ -674,4 +671,16 @@ public class StringUtil extends StringUtils {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<Long> strToLongs(String roleIds) {
|
||||||
|
List<Long> list = new ArrayList<>();
|
||||||
|
if (StringUtil.isEmpty(roleIds)) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
String[] roleId = roleIds.split(",");
|
||||||
|
for (String r : roleId) {
|
||||||
|
list.add(NumberUtil.objToLongDefault(r, -1));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -642,4 +642,12 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -257,4 +257,13 @@ public class TestController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// http://localhost:8080/lz_management/test/resultrecord?resultRecordId=157
|
||||||
|
@RequestMapping("/test/resultrecord")
|
||||||
|
public void resultRecorcd(Long resultRecordId) throws Exception{
|
||||||
|
R r = resultRecordService.initFlowRecord(resultRecordId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,36 @@
|
|||||||
|
package com.lz.modules.app.enums;
|
||||||
|
|
||||||
|
public enum FlowApprovalRoleTypeEnums {
|
||||||
|
|
||||||
|
ME(-1,"自己"),
|
||||||
|
STAFF(0,"指定员工"),
|
||||||
|
ONE_SUPPER(1,"一级主管"),
|
||||||
|
TWO_SUPPER(2,"二级主管"),
|
||||||
|
THREE_SUPPER(3,"三级主管"),
|
||||||
|
FOUR_SUPPER(4,"四级主管"),
|
||||||
|
FIVE_SUPPER(5,"五级主管");
|
||||||
|
|
||||||
|
private Integer type;
|
||||||
|
private String desc ;
|
||||||
|
|
||||||
|
FlowApprovalRoleTypeEnums(Integer type, String desc) {
|
||||||
|
this.type = type;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package com.lz.modules.app.enums;
|
||||||
|
|
||||||
|
public enum FlowRecordStatusEnums {
|
||||||
|
|
||||||
|
UN_TO_STATUS(0, "流程未到"),
|
||||||
|
FINISHED_STATUS(1, "流程已走"),
|
||||||
|
CURRENT_FLOW_STATUS(2, "当前流程"),
|
||||||
|
SKIP_STATUS(3, "跳过");
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
private String desc ;
|
||||||
|
|
||||||
|
FlowRecordStatusEnums(Integer name, String desc) {
|
||||||
|
this.status = name;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDesc(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -34,4 +34,6 @@ public interface FlowApprovalRoleMapper extends BaseMapper<FlowApprovalRole> {
|
|||||||
|
|
||||||
|
|
||||||
Long insertFlowApprovalRoles(@Param("list") List<FlowApprovalRole> flowApprovalRoles);
|
Long insertFlowApprovalRoles(@Param("list") List<FlowApprovalRole> flowApprovalRoles);
|
||||||
|
|
||||||
|
List<FlowApprovalRole> selectFlowApprovalRoleList(@Param("flowIds") List<Long> flowIds);
|
||||||
}
|
}
|
||||||
@ -58,4 +58,5 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
|
|
||||||
List<TaskListDto> selectFinishTasksByApprovalStaffId(@Param("approvalStaffId") Long approvalStaffId, @Param("page") IPage page);
|
List<TaskListDto> selectFinishTasksByApprovalStaffId(@Param("approvalStaffId") Long approvalStaffId, @Param("page") IPage page);
|
||||||
|
|
||||||
|
void insertFlowRecords(@Param("flowRecords") List<FlowRecord> flowRecords);
|
||||||
}
|
}
|
||||||
@ -28,6 +28,9 @@ public class StaffRoleDto {
|
|||||||
return JSON.toJSONString(staffRoleDtoList);
|
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);
|
||||||
|
|||||||
30
src/main/java/com/lz/modules/flow/model/StaffRoles.java
Normal file
30
src/main/java/com/lz/modules/flow/model/StaffRoles.java
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package com.lz.modules.flow.model;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class StaffRoles {
|
||||||
|
|
||||||
|
private Long staffId;
|
||||||
|
private List<Long> roleIds;
|
||||||
|
|
||||||
|
public StaffRoles(Long staffId, List<Long> roleIds) {
|
||||||
|
this.staffId = staffId;
|
||||||
|
this.roleIds = roleIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getStaffRole(Long staffId, List<Long> roloIds) {
|
||||||
|
Set<Long> set = new HashSet<>();
|
||||||
|
for (Long roleId : roloIds) {
|
||||||
|
set.add(roleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> list = new ArrayList<>();
|
||||||
|
list.addAll(set);
|
||||||
|
Map<String, List<Long>> map = new HashMap<>();
|
||||||
|
map.put(staffId + "", list );
|
||||||
|
return JSON.toJSONString(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -33,4 +33,6 @@ public interface FlowApprovalRoleService extends IService<FlowApprovalRole> {
|
|||||||
|
|
||||||
|
|
||||||
Long insertFlowApprovalRoles(List<FlowApprovalRole> flowApprovalRoles);
|
Long insertFlowApprovalRoles(List<FlowApprovalRole> flowApprovalRoles);
|
||||||
|
|
||||||
|
List<FlowApprovalRole> selectFlowApprovalRoleList(List<Long> flowIds);
|
||||||
}
|
}
|
||||||
@ -57,4 +57,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
|||||||
Long copyFlowRecord(FlowRecord flowRecord);
|
Long copyFlowRecord(FlowRecord flowRecord);
|
||||||
|
|
||||||
PageUtils selectTaskListByApprovalStaffId(AssessTaskReq req, Long approvalStaffId);
|
PageUtils selectTaskListByApprovalStaffId(AssessTaskReq req, Long approvalStaffId);
|
||||||
|
|
||||||
|
void insertFlowRecords(List<FlowRecord> flowRecords);
|
||||||
}
|
}
|
||||||
@ -89,5 +89,12 @@ public class FlowApprovalRoleServiceImpl extends ServiceImpl<FlowApprovalRoleMap
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FlowApprovalRole> selectFlowApprovalRoleList(List<Long> flowIds) {
|
||||||
|
|
||||||
|
return flowApprovalRoleMapper.selectFlowApprovalRoleList(flowIds);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,4 +158,9 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
|
|
||||||
return pageUtils;
|
return pageUtils;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertFlowRecords(List<FlowRecord> flowRecords) {
|
||||||
|
flowRecordMapper.insertFlowRecords(flowRecords);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -265,7 +265,7 @@ public class FlowStartController {
|
|||||||
flowApprovalRole.setFlowId(flow.getId());
|
flowApprovalRole.setFlowId(flow.getId());
|
||||||
flowApprovalRole.setApprovalId(Long.parseLong(id));
|
flowApprovalRole.setApprovalId(Long.parseLong(id));
|
||||||
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
||||||
flowApprovalRole.setRoleId(Long.parseLong(roleId));
|
flowApprovalRole.setRoleId(roleId);
|
||||||
flowApprovalRole.setType(flowChartDetailRecord.getOptType());
|
flowApprovalRole.setType(flowChartDetailRecord.getOptType());
|
||||||
flowApprovalRoles.add(flowApprovalRole);
|
flowApprovalRoles.add(flowApprovalRole);
|
||||||
flowApprovalRole.setStepIndex(stepIndex);
|
flowApprovalRole.setStepIndex(stepIndex);
|
||||||
@ -295,7 +295,7 @@ public class FlowStartController {
|
|||||||
FlowApprovalRole flowApprovalRole = new FlowApprovalRole();
|
FlowApprovalRole flowApprovalRole = new FlowApprovalRole();
|
||||||
flowApprovalRole.setFlowId(flow.getId());
|
flowApprovalRole.setFlowId(flow.getId());
|
||||||
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
flowApprovalRole.setStepType(flowChartDetailRecord.getStepType());
|
||||||
flowApprovalRole.setRoleId(Long.parseLong(roleId));
|
flowApprovalRole.setRoleId(roleId);
|
||||||
flowApprovalRole.setType(flowChartDetailRecord.getOptType());
|
flowApprovalRole.setType(flowChartDetailRecord.getOptType());
|
||||||
flowApprovalRoles.add(flowApprovalRole);
|
flowApprovalRoles.add(flowApprovalRole);
|
||||||
flowApprovalRole.setStepIndex(stepIndex);
|
flowApprovalRole.setStepIndex(stepIndex);
|
||||||
|
|||||||
@ -107,4 +107,5 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
|
|
||||||
void batchDeleteByStaffIds(List<String> staffIds);
|
void batchDeleteByStaffIds(List<String> staffIds);
|
||||||
|
|
||||||
|
R initFlowRecord(Long resultRecordId);
|
||||||
}
|
}
|
||||||
@ -12,6 +12,8 @@ import com.lz.modules.app.dto.GraphicsStatisticalDto;
|
|||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
|
import com.lz.modules.app.enums.FlowApprovalRoleTypeEnums;
|
||||||
|
import com.lz.modules.app.enums.FlowRecordStatusEnums;
|
||||||
import com.lz.modules.app.req.ResultRecordReq;
|
import com.lz.modules.app.req.ResultRecordReq;
|
||||||
import com.lz.modules.app.resp.OwnResultResp;
|
import com.lz.modules.app.resp.OwnResultResp;
|
||||||
import com.lz.modules.app.resp.ResultRecordResp;
|
import com.lz.modules.app.resp.ResultRecordResp;
|
||||||
@ -21,10 +23,7 @@ import com.lz.modules.app.service.StaffService;
|
|||||||
import com.lz.modules.app.utils.t.TwoTuple;
|
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.enums.FlowRecordEnum;
|
import com.lz.modules.flow.enums.FlowRecordEnum;
|
||||||
import com.lz.modules.flow.model.Auth;
|
import com.lz.modules.flow.model.*;
|
||||||
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.flow.service.*;
|
||||||
import com.lz.modules.job.business.DingtalkBusiness;
|
import com.lz.modules.job.business.DingtalkBusiness;
|
||||||
import com.lz.modules.performance.req.AssessDetailReq;
|
import com.lz.modules.performance.req.AssessDetailReq;
|
||||||
@ -118,6 +117,9 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DingtalkBusiness dingtalkBusiness;
|
private DingtalkBusiness dingtalkBusiness;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FlowApprovalRoleService flowApprovalRoleService;
|
||||||
|
|
||||||
@Value("${dingtalk.appid}")
|
@Value("${dingtalk.appid}")
|
||||||
private String appid;
|
private String appid;
|
||||||
|
|
||||||
@ -684,6 +686,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
lastFlowRecordNoStatus.setGmtCreate(new Date()); //更新驳回时间
|
lastFlowRecordNoStatus.setGmtCreate(new Date()); //更新驳回时间
|
||||||
flowRecordService.updateFlowRecordById(lastFlowRecordNoStatus);
|
flowRecordService.updateFlowRecordById(lastFlowRecordNoStatus);
|
||||||
|
|
||||||
|
|
||||||
// 可能会被删除
|
// 可能会被删除
|
||||||
FlowRecord lastUsedFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(resultRecord.getId());
|
FlowRecord lastUsedFlowRecord = flowRecordService.selectLastFlowRecordByRecordId(resultRecord.getId());
|
||||||
lastUsedFlowRecord.setId(null);
|
lastUsedFlowRecord.setId(null);
|
||||||
@ -746,4 +749,86 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
public void batchDeleteByStaffIds(List<String> staffIds) {
|
public void batchDeleteByStaffIds(List<String> staffIds) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R initFlowRecord(Long resultRecordId) {
|
||||||
|
ResultRecord resultRecord = resultRecordMapper.selectResultRecordById(resultRecordId);
|
||||||
|
List<Flow> flows = flowService.selectByFlowId(resultRecord.getEvaluationId());
|
||||||
|
List<Long> flowIds = new ArrayList<>();
|
||||||
|
for(Flow flow:flows){
|
||||||
|
flowIds.add(flow.getId());
|
||||||
|
}
|
||||||
|
List<FlowApprovalRole> flowApprovalRoles =flowApprovalRoleService.selectFlowApprovalRoleList(flowIds);
|
||||||
|
List<FlowRecord> flowRecords = new ArrayList<>();
|
||||||
|
int i = 0 ;
|
||||||
|
DepartmentsStaffRelateEntity relateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(resultRecord.getStaffId());
|
||||||
|
Map<String, String> map = departmentsService.selectUserAllDepartmentInFo(relateEntity.getDepartmentId());
|
||||||
|
|
||||||
|
for(FlowApprovalRole flowApprovalRole:flowApprovalRoles){
|
||||||
|
FlowRecord flowRecord = new FlowRecord();
|
||||||
|
flowRecord.setRecordId(resultRecord.getId());
|
||||||
|
StaffEntity staffEntity = new StaffEntity();
|
||||||
|
if(FlowApprovalRoleTypeEnums.ME.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = staffService.selectStaffById(resultRecord.getStaffId());
|
||||||
|
}else if(FlowApprovalRoleTypeEnums.STAFF.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = staffService.selectStaffById(flowApprovalRole.getApprovalId());
|
||||||
|
}else if(FlowApprovalRoleTypeEnums.ONE_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = getDepartmentStaff(map,1);
|
||||||
|
}else if(FlowApprovalRoleTypeEnums.TWO_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = getDepartmentStaff(map,2);
|
||||||
|
}else if(FlowApprovalRoleTypeEnums.THREE_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = getDepartmentStaff(map,3);
|
||||||
|
}else if(FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = getDepartmentStaff(map,4);
|
||||||
|
}else if(FlowApprovalRoleTypeEnums.FOUR_SUPPER.getType().equals(flowApprovalRole.getType())){
|
||||||
|
staffEntity = getDepartmentStaff(map,5);
|
||||||
|
}
|
||||||
|
flowRecord.setApprovalStaffName(staffEntity.getName());
|
||||||
|
flowRecord.setApprovalStaffId(staffEntity.getId());
|
||||||
|
flowRecord.setFlowName(getFlow(flows,flowApprovalRole.getFlowId()).getOptDesc());
|
||||||
|
flowRecord.setRecordStaffId(resultRecord.getStaffId());
|
||||||
|
flowRecord.setFlowId(flowApprovalRole.getFlowId());
|
||||||
|
String staffRole = StaffRoles.getStaffRole(resultRecord.getStaffId(), StringUtil.strToLongs(flowApprovalRole.getRoleId()));
|
||||||
|
if(i == 0 ){
|
||||||
|
flowRecord.setStatus(FlowRecordStatusEnums.CURRENT_FLOW_STATUS.getStatus());
|
||||||
|
resultRecord.setFlowStaffIdRole(staffRole);
|
||||||
|
}else{
|
||||||
|
flowRecord.setStatus(FlowRecordStatusEnums.UN_TO_STATUS.getStatus());
|
||||||
|
}
|
||||||
|
flowRecord.setFlowStaffIdRole(staffRole);
|
||||||
|
flowRecord.setFlowIndex(flowApprovalRole.getStepIndex());
|
||||||
|
flowRecord.setType(flowApprovalRole.getStepType()); //步骤类型0:依次,1:或签(同时通知,一人通过或拒绝即可),2会签(同时通知,所有人同意才可)
|
||||||
|
i ++;
|
||||||
|
flowRecords.add(flowRecord);
|
||||||
|
}
|
||||||
|
flowRecordService.insertFlowRecords(flowRecords);
|
||||||
|
resultRecordService.updateResultRecordById(resultRecord);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public StaffEntity getDepartmentStaff(Map<String, String> map, int level) {
|
||||||
|
for (int i = 1; i < 6; i++) {
|
||||||
|
String deparment = map.get("dd" + i );
|
||||||
|
if (StringUtil.isNotBlank(deparment)) {
|
||||||
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectDepartmentByDepartmentId(deparment);
|
||||||
|
if (departmentsStaffRelateEntity != null) {
|
||||||
|
StaffEntity staffEntity = staffService.selectStaffById(departmentsStaffRelateEntity.getStaffId());
|
||||||
|
if (level == i) {
|
||||||
|
return staffEntity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new StaffEntity();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Flow getFlow(List<Flow> flows,Long flowId){
|
||||||
|
for(Flow flow : flows){
|
||||||
|
if(flow.getId().equals(flowId)){
|
||||||
|
return flow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new Flow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,5 +118,15 @@
|
|||||||
;
|
;
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectFlowApprovalRoleList" resultType="com.lz.modules.flow.entity.FlowApprovalRole">
|
||||||
|
select * from lz_flow_approval_role where flow_id in
|
||||||
|
<foreach collection="flowIds" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
order by step_index asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -108,6 +108,7 @@
|
|||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
<update id="updateFlowRecordById" parameterType="FlowRecord" >
|
<update id="updateFlowRecordById" parameterType="FlowRecord" >
|
||||||
update
|
update
|
||||||
lz_flow_record
|
lz_flow_record
|
||||||
@ -221,5 +222,44 @@
|
|||||||
order by r.gmt_modified desc
|
order by r.gmt_modified desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertFlowRecords">
|
||||||
|
insert into lz_flow_record(
|
||||||
|
department_level,
|
||||||
|
record_id,
|
||||||
|
approval_staff_id,
|
||||||
|
approval_staff_name,
|
||||||
|
flow_name,
|
||||||
|
record_staff_id,
|
||||||
|
flow_id,
|
||||||
|
flow_index,
|
||||||
|
status,
|
||||||
|
flow_staff_id_role,
|
||||||
|
status_name,
|
||||||
|
type,
|
||||||
|
is_delete,
|
||||||
|
gmt_create,
|
||||||
|
gmt_modified
|
||||||
|
)values
|
||||||
|
<foreach collection="flowRecords" item="item" separator=",">
|
||||||
|
( #{ item.departmentLevel},
|
||||||
|
#{ item.recordId},
|
||||||
|
#{ item.approvalStaffId},
|
||||||
|
#{ item.approvalStaffName},
|
||||||
|
#{ item.flowName},
|
||||||
|
#{ item.recordStaffId},
|
||||||
|
#{ item.flowId},
|
||||||
|
#{ item.flowIndex},
|
||||||
|
#{ item.status},
|
||||||
|
#{ item.flowStaffIdRole},
|
||||||
|
#{ item.statusName},
|
||||||
|
#{ item.type},
|
||||||
|
0,
|
||||||
|
now(),
|
||||||
|
now()
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ public class MysqlMain {
|
|||||||
//list.add(new TablesBean("lz_flow_chart_detail_record"));
|
//list.add(new TablesBean("lz_flow_chart_detail_record"));
|
||||||
//list.add(new TablesBean("lz_flow_approval_role"));
|
//list.add(new TablesBean("lz_flow_approval_role"));
|
||||||
|
|
||||||
list.add(new TablesBean("lz_evaluation_group"));
|
list.add(new TablesBean("lz_flow_record"));
|
||||||
|
|
||||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user