修改待办受理号生成逻辑
This commit is contained in:
parent
225aaff6a9
commit
aa519bdec1
|
|
@ -672,7 +672,14 @@ public class TSBizRemListServiceImpl extends ServiceImpl<TSBizRemListMapper, TSB
|
|||
BeanUtils.copyProperties(tsTaskList, taskListNew);
|
||||
taskListNew.setTasklistid(null);
|
||||
//设置受理号
|
||||
taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
// taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListNew.setAcceptno(acceptno);
|
||||
|
||||
//设置签收人信息
|
||||
taskListNew.setSignuserid(aicUser.getPrimaryKey());
|
||||
taskListNew.setSignloginname(aicUser.getName());
|
||||
|
|
@ -903,7 +910,14 @@ public class TSBizRemListServiceImpl extends ServiceImpl<TSBizRemListMapper, TSB
|
|||
BeanUtils.copyProperties(tsTaskList, taskListNew);
|
||||
taskListNew.setTasklistid(null);
|
||||
//设置受理号
|
||||
taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
// taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListNew.setAcceptno(acceptno);
|
||||
|
||||
//设置签收人信息
|
||||
taskListNew.setSignuserid(aicUser.getPrimaryKey());
|
||||
taskListNew.setSignloginname(aicUser.getName());
|
||||
|
|
|
|||
|
|
@ -120,7 +120,14 @@ public class TSTaskListServiceImpl extends BaseServiceImpl<TSTaskListMapper, TST
|
|||
@Override
|
||||
public String startWorkFlow(TSTaskList taskListModel, AICUser user, String definitionName) {
|
||||
//受理编号
|
||||
taskListModel.setAcceptno(user.getRegionID().substring(0, 6) + uuidUtil.getCurAcceptNo());
|
||||
// taskListModel.setAcceptno(user.getRegionID().substring(0, 6) + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListModel.setAcceptno(acceptno);
|
||||
|
||||
ResultMap resultMap = workFlowService.startAndClaim(user.getPrimaryKey(), null, definitionName, null);
|
||||
String workflowid = resultMap.getWorkflowid();
|
||||
taskListModel.setWorkflowid(workflowid);
|
||||
|
|
@ -139,7 +146,14 @@ public class TSTaskListServiceImpl extends BaseServiceImpl<TSTaskListMapper, TST
|
|||
@Override
|
||||
public String startWorkFlow(TSTaskList taskListModel, List<String> userids, String decorg, String definitionName) {
|
||||
//受理编号
|
||||
taskListModel.setAcceptno(decorg.substring(0, 6) + uuidUtil.getCurAcceptNo());
|
||||
// taskListModel.setAcceptno(decorg.substring(0, 6) + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListModel.setAcceptno(acceptno);
|
||||
|
||||
ResultMap resultMap = workFlowService.startAndClaim(userids.get(0), userids, definitionName, null);
|
||||
String workflowid = resultMap.getWorkflowid();
|
||||
taskListModel.setWorkflowid(workflowid);
|
||||
|
|
@ -308,7 +322,14 @@ public class TSTaskListServiceImpl extends BaseServiceImpl<TSTaskListMapper, TST
|
|||
@Override
|
||||
public String startWorkFlowApp(TSTaskList taskListModel, String definitionName) {
|
||||
//受理编号
|
||||
taskListModel.setAcceptno("400000" + uuidUtil.getCurAcceptNo());
|
||||
// taskListModel.setAcceptno("400000" + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListModel.setAcceptno(acceptno);
|
||||
|
||||
// ResultMap resultMap = workFlowService.startAndClaim(user.getPrimaryKey(), null, definitionName, null);
|
||||
ResultMap resultMap = workFlowService.startAndClaimApp(null, null, definitionName, null);
|
||||
String workflowid = resultMap.getWorkflowid();
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ import javax.servlet.ServletContextListener;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
|
@ -707,7 +708,14 @@ public class BizSerIllegalRemController extends BaseController implements Servle
|
|||
BeanUtils.copyProperties(tsTaskList, taskListNew);
|
||||
taskListNew.setTasklistid(null);
|
||||
//设置受理号
|
||||
taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
// taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListNew.setAcceptno(acceptno);
|
||||
|
||||
//设置签收人信息
|
||||
taskListNew.setSignuserid(aicUser.getPrimaryKey());
|
||||
taskListNew.setSignloginname(aicUser.getName());
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -664,7 +665,14 @@ public class TSBizSerIllegalRemServiceImpl extends BaseServiceImpl<TSBizSerIlleg
|
|||
BeanUtils.copyProperties(tsTaskList, taskListNew);
|
||||
taskListNew.setTasklistid(null);
|
||||
//设置受理号
|
||||
taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
// taskListNew.setAcceptno(aicUser.getRegionID().substring(0, Math.min(aicUser.getRegionID().length(), 6)) + uuidUtil.getCurAcceptNo());
|
||||
//因xr_id_maker容易被锁,临时用新的生成规则生成受理编号
|
||||
LocalDateTime nowLocalDateTime = LocalDateTime.now(); // 获取当前日期和时间
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); // 定义格式化模式
|
||||
String formattedDate = nowLocalDateTime.format(formatter); // 将日期格式化为字符串
|
||||
String acceptno = "7" + formattedDate + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 8);
|
||||
taskListNew.setAcceptno(acceptno);
|
||||
|
||||
//设置签收人信息
|
||||
taskListNew.setSignuserid(aicUser.getPrimaryKey());
|
||||
taskListNew.setSignloginname(aicUser.getName());
|
||||
|
|
|
|||
|
|
@ -74,29 +74,29 @@ public class UuidUtil {
|
|||
*
|
||||
* @return 新产生的流水号
|
||||
*/
|
||||
// public synchronized String getCurAcceptNo() {
|
||||
// return getTridmaker("acceptNoForCase");
|
||||
// }
|
||||
public synchronized String getCurAcceptNo() {
|
||||
return getTridmaker("acceptNoForCase");
|
||||
}
|
||||
|
||||
/**
|
||||
* 规则年月日+5位顺序号。例如:13060400001
|
||||
*
|
||||
* @return 新产生的流水号(Redis) todo: 新的一年要重新获取
|
||||
*/
|
||||
public String getCurAcceptNo() {
|
||||
String key = "Redis_acceptNoForCase";
|
||||
String num = null;
|
||||
if (redisService.exists(key)) {
|
||||
num = redisService.incr(key);
|
||||
|
||||
// 根据规则生成受理号
|
||||
LocalDate localDate = LocalDate.now();
|
||||
int year = localDate.getYear();
|
||||
return "7" + String.valueOf(year).substring(2, 4) + beforeZeroFill(num, 8);
|
||||
} else {
|
||||
throw new RuntimeException("获取新产生的流水号异常");
|
||||
}
|
||||
}
|
||||
// public String getCurAcceptNo() {
|
||||
// String key = "Redis_acceptNoForCase";
|
||||
// String num = null;
|
||||
// if (redisService.exists(key)) {
|
||||
// num = redisService.incr(key);
|
||||
//
|
||||
// // 根据规则生成受理号
|
||||
// LocalDate localDate = LocalDate.now();
|
||||
// int year = localDate.getYear();
|
||||
// return "7" + String.valueOf(year).substring(2, 4) + beforeZeroFill(num, 8);
|
||||
// } else {
|
||||
// throw new RuntimeException("获取新产生的流水号异常");
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// /**
|
||||
|
|
|
|||
Loading…
Reference in New Issue