From 5fcaa5b9d0f5b84f8a25f3e2e8f27c3885d8710e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 08 十一月 2022 11:54:15 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java
index 4c71cb2..389166c 100644
--- a/src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java
+++ b/src/main/java/com/zy/crm/manager/service/impl/CstmrServiceImpl.java
@@ -1,6 +1,7 @@
package com.zy.crm.manager.service.impl;
import com.baomidou.mybatisplus.plugins.Page;
+import com.core.common.Cools;
import com.zy.crm.manager.mapper.CstmrMapper;
import com.zy.crm.manager.entity.Cstmr;
import com.zy.crm.manager.service.CstmrService;
@@ -16,7 +17,21 @@
}
@Override
- public String getNextUuid(Long hostId) {
+ public synchronized String getUuid(Long hostId) {
+ String uuid = null;
+ int times = 0;
+ while (Cools.isEmpty(uuid)) {
+ if (times > 100) { break; }
+ String nextUuid = getNextUuid(hostId);
+ if (selectByUuid(hostId, nextUuid) == null) {
+ uuid = nextUuid;
+ }
+ times ++;
+ }
+ return uuid;
+ }
+
+ private String getNextUuid(Long hostId) {
Cstmr cstmr = this.baseMapper.selectCstmrByNewestUuid(hostId);
if (cstmr == null) {
return "0001";
@@ -25,8 +40,8 @@
}
@Override
- public Page<Cstmr> getPage(Page page, Long hostId, String deptId, String condition) {
- return page.setRecords(baseMapper.listByPage(page, hostId, deptId, condition));
+ public Page<Cstmr> getPage(Page<Cstmr> page, Long hostId, String deptId, Long userId, String condition) {
+ return page.setRecords(baseMapper.listByPage(page, hostId, deptId, userId, condition));
}
--
Gitblit v1.9.1