beetlsql3-dev
Mlxa0324 2 years ago
parent 85d23de625
commit ce833778b3

@ -1114,13 +1114,15 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
.limit(1, 1)
.select(CourseInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
CourseInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getOrderIndex();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
CourseInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getOrderIndex();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
} break;
@ -1134,20 +1136,22 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
.limit(1, 2)
.select(CourseInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
@ -1161,20 +1165,22 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
.limit(1, 2)
.select(CourseInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置底状态!");
}
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
default:
log.error("不支持的移动类型!");

@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.jlw.aliPay.utils.StringUtils;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.util.PlatformException;
import com.ibeetl.jlw.dao.CourseInfoDao;
import com.ibeetl.jlw.dao.ResourcesInfoDao;
import com.ibeetl.jlw.entity.CourseInfo;
@ -331,13 +332,15 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo>{
.limit(1, 1)
.select(ResourcesInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
ResourcesInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getOrderIndex();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
ResourcesInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getOrderIndex();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
} break;
@ -349,20 +352,22 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo>{
.limit(1, 2)
.select(ResourcesInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
@ -374,20 +379,22 @@ public class ResourcesInfoService extends CoreBaseService<ResourcesInfo>{
.limit(1, 2)
.select(ResourcesInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置底状态!");
}
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
default:
log.error("不支持的移动类型!");

@ -208,19 +208,21 @@ public class StudentClientLinkService extends CoreBaseService<StudentClientLink>
.limit(1, 1)
.select(StudentClientLink::getStudentClientLinkOrder);
if (CollectionUtil.isNotEmpty(result)) {
StudentClientLink minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getStudentClientLinkOrder();
// 置顶就现有的最小值减1。但是需要确保结果小于0
BigDecimal calcedOrder = BigDecimal.valueOf(NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1));
// 改变排序记录值
StudentClientLink updatePO = new StudentClientLink();
updatePO.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
updatePO.setStudentClientLinkOrder(calcedOrder);
updateTemplate(updatePO);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
StudentClientLink minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getStudentClientLinkOrder();
// 置顶就现有的最小值减1。但是需要确保结果小于0
BigDecimal calcedOrder = BigDecimal.valueOf(NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1));
// 改变排序记录值
StudentClientLink updatePO = new StudentClientLink();
updatePO.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
updatePO.setStudentClientLinkOrder(calcedOrder);
updateTemplate(updatePO);
} break;
@ -234,27 +236,28 @@ public class StudentClientLinkService extends CoreBaseService<StudentClientLink>
.limit(1, 2)
.select(StudentClientLink::getStudentClientLinkOrder);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getStudentClientLinkOrder();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getStudentClientLinkOrder();
}
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getStudentClientLinkOrder();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getStudentClientLinkOrder();
}
// 左移位后的值
double calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 改变排序记录值
StudentClientLink updatePO = new StudentClientLink();
updatePO.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
updatePO.setStudentClientLinkOrder(BigDecimal.valueOf(calcedOrder));
updateTemplate(updatePO);
// 左移位后的值
double calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
}
// 改变排序记录值
StudentClientLink updatePO = new StudentClientLink();
updatePO.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
updatePO.setStudentClientLinkOrder(BigDecimal.valueOf(calcedOrder));
updateTemplate(updatePO);
} break;
@ -268,26 +271,28 @@ public class StudentClientLinkService extends CoreBaseService<StudentClientLink>
.limit(1, 2)
.select(StudentClientLink::getStudentClientLinkOrder);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getStudentClientLinkOrder();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getStudentClientLinkOrder();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 右移位后的值
double calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 改变排序记录值
StudentClientLink updatePO = new StudentClientLink();
updatePO.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
updatePO.setStudentClientLinkOrder(BigDecimal.valueOf(calcedOrder));
updateTemplate(updatePO);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getStudentClientLinkOrder();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getStudentClientLinkOrder();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 右移位后的值
double calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 改变排序记录值
StudentClientLink updatePO = new StudentClientLink();
updatePO.setStudentClientLinkId(studentClientLink.getStudentClientLinkId());
updatePO.setStudentClientLinkOrder(BigDecimal.valueOf(calcedOrder));
updateTemplate(updatePO);
} break;

@ -1210,13 +1210,15 @@ public class TeacherOpenCourseMergeCourseInfoService extends CoreBaseService<Tea
.limit(1, 1)
.select(TeacherOpenCourseMergeCourseInfo::getTeacherOpenCourseMergeCourseInfoOrder);
if (CollectionUtil.isNotEmpty(result)) {
TeacherOpenCourseMergeCourseInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getTeacherOpenCourseMergeCourseInfoOrder();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
TeacherOpenCourseMergeCourseInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getTeacherOpenCourseMergeCourseInfoOrder();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
} break;
@ -1230,20 +1232,22 @@ public class TeacherOpenCourseMergeCourseInfoService extends CoreBaseService<Tea
.limit(1, 2)
.select(TeacherOpenCourseMergeCourseInfo::getTeacherOpenCourseMergeCourseInfoOrder);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getTeacherOpenCourseMergeCourseInfoOrder();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getTeacherOpenCourseMergeCourseInfoOrder();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getTeacherOpenCourseMergeCourseInfoOrder();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getTeacherOpenCourseMergeCourseInfoOrder();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
@ -1257,20 +1261,22 @@ public class TeacherOpenCourseMergeCourseInfoService extends CoreBaseService<Tea
.limit(1, 2)
.select(TeacherOpenCourseMergeCourseInfo::getTeacherOpenCourseMergeCourseInfoOrder);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getTeacherOpenCourseMergeCourseInfoOrder();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getTeacherOpenCourseMergeCourseInfoOrder();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置底状态!");
}
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getTeacherOpenCourseMergeCourseInfoOrder();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getTeacherOpenCourseMergeCourseInfoOrder();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
default:
log.error("不支持的移动类型!");

@ -484,13 +484,15 @@ public class TeacherOpenCourseMergeResourcesInfoService extends CoreBaseService<
.limit(1, 1)
.select(TeacherOpenCourseMergeResourcesInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
TeacherOpenCourseMergeResourcesInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getOrderIndex();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
TeacherOpenCourseMergeResourcesInfo minOrderClientLink = result.get(0);
// 最小的排序值
BigDecimal minLinkOrder = minOrderClientLink.getOrderIndex();
// 置顶就现有的最小值减1。但是需要确保结果小于0
calcedOrder = NumberUtil.sub(min(minLinkOrder.floatValue(), 0), 1);
} break;
@ -505,20 +507,22 @@ public class TeacherOpenCourseMergeResourcesInfoService extends CoreBaseService<
.limit(1, 2)
.select(TeacherOpenCourseMergeResourcesInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置顶状态!");
}
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.subtract(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 左移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
@ -532,20 +536,22 @@ public class TeacherOpenCourseMergeResourcesInfoService extends CoreBaseService<
.limit(1, 2)
.select(TeacherOpenCourseMergeResourcesInfo::getOrderIndex);
if (CollectionUtil.isNotEmpty(result)) {
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
if (CollectionUtil.isEmpty(result)) {
throw new PlatformException("已处于置底状态!");
}
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
// 找到应该安插的位置
BigDecimal LinkOrder0 = result.get(0).getOrderIndex();
BigDecimal LinkOrder1 = LinkOrder0.add(BigDecimal.ONE);
if (result.size() == 2) {
LinkOrder1 = result.get(1).getOrderIndex();
}
BigDecimal min = NumberUtil.min(LinkOrder0, LinkOrder1);
BigDecimal max = NumberUtil.max(LinkOrder0, LinkOrder1);
// 右移位后的值
calcedOrder = RandomUtil.randomDouble(min.doubleValue(), max.doubleValue(), 6, RoundingMode.HALF_UP);
} break;
default:
log.error("不支持的移动类型!");

Loading…
Cancel
Save