From 267b5f12dab7b2b3f188f487ed6c407f207d9af4 Mon Sep 17 00:00:00 2001
From: qq787203167 <787203167@qq.com>
Date: Wed, 25 May 2022 17:53:02 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=9F=A5?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
jero-web/src/common/lang/en-us.js | 7 ++--
jero-web/src/common/lang/zh-cn.js | 5 +--
.../components/footerProcess.vue | 4 +--
.../components/projectInformation.vue | 6 +++-
.../reviewedByThePersonInCharge.vue | 2 +-
.../processForm/handshakeProcess/index.vue | 1 +
.../processForm/taskListProcess/index.vue | 1 +
.../ProjectDetails/index.vue | 19 +++++++---
.../components/ProjectDetails.vue | 36 ++++++++++++-------
.../projectManagement/components/TaskList.vue | 4 +--
.../certificationProgressEchart.vue | 5 ++-
.../currentStatusOfTheProjectEcharts.vue | 6 ++--
.../components/deliverableStatusEchart.vue | 5 ++-
.../components/responsibilityList.vue | 13 +++++--
14 files changed, 79 insertions(+), 35 deletions(-)
diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js
index cdbb79f99..bd6ea6376 100644
--- a/jero-web/src/common/lang/en-us.js
+++ b/jero-web/src/common/lang/en-us.js
@@ -786,10 +786,10 @@ module.exports = {
importTemplate: 'Import Template',
verificationConfirmationDeadline: 'Verification compliance confirmation deadline',
technicalEvaluationResults: 'Technical Evaluation Results',
- engineeringConfirmation: 'EngineeringConfirmation',
+ engineeringConfirmation: 'Project Delivery',
feedbackFromTheEngineer: 'Feedback From The Engineer',
- completedBy: 'Completed by',
- completedTime: 'Completed time',
+ completedBy: 'Completed By',
+ completedTime: 'Completed Time',
replyFromProjectContactPerson: 'Responsible Persons reply',
answer: 'Answer',
distributionEngineer: 'Distribution Engineer',
@@ -891,4 +891,5 @@ module.exports = {
custom:'Custom',
notSelected:'Not selected',
ExportReport:'Export Report',
+ basicInformation:'Basic Information',
}
\ No newline at end of file
diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js
index 0343b852e..6dd6e00ee 100644
--- a/jero-web/src/common/lang/zh-cn.js
+++ b/jero-web/src/common/lang/zh-cn.js
@@ -794,7 +794,7 @@ module.exports = {
importTemplate: '导入模板',
verificationConfirmationDeadline: '验证符合性确认截止时间',
technicalEvaluationResults: '技术评估结果',
- engineeringConfirmation: '工程确认',
+ engineeringConfirmation: '工程交付',
feedbackFromTheEngineer: '工程师反馈意见',
completedBy: '填写人',
completedTime: '填写时间',
@@ -804,7 +804,7 @@ module.exports = {
reminderHandling: '提醒办理',
addFeedback: '添加反馈',
engineer: '工程师',
- engineeringConfirmationDetails: '工程确认详情',
+ engineeringConfirmationDetails: '工程交付详情',
reminder: '提醒',
adopt: '通过',
reviewedByThePersonInCharge: '负责人审核',
@@ -896,4 +896,5 @@ module.exports = {
custom:'自定义',
notSelected:'未选择',
ExportReport:'导出报告',
+ basicInformation:'基础信息',
}
\ No newline at end of file
diff --git a/jero-web/src/views/processCenter/components/footerProcess.vue b/jero-web/src/views/processCenter/components/footerProcess.vue
index 090db92d7..48821c688 100644
--- a/jero-web/src/views/processCenter/components/footerProcess.vue
+++ b/jero-web/src/views/processCenter/components/footerProcess.vue
@@ -107,8 +107,8 @@
box-sizing: border-box;
.process-header-title {
- height: 68px;
- line-height: 68px;
+ /*height: 68px;*/
+ /*line-height: 68px;*/
background: #FFFFFF;
text-align: right;
diff --git a/jero-web/src/views/processCenter/components/projectInformation.vue b/jero-web/src/views/processCenter/components/projectInformation.vue
index 102b8611d..65e75b9f7 100644
--- a/jero-web/src/views/processCenter/components/projectInformation.vue
+++ b/jero-web/src/views/processCenter/components/projectInformation.vue
@@ -2,7 +2,7 @@
@@ -49,6 +49,10 @@
queryProject: {
type: Object,
default: {}
+ },
+ title: {
+ type: String,
+ default: ''
}
},
data() {
diff --git a/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue b/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue
index 2bbc1a265..e7ebead41 100644
--- a/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue
+++ b/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue
@@ -1,7 +1,7 @@
-
-
+
-
+
-
+
@@ -169,6 +176,9 @@
}
})
},
+ currentStatus(item) {
+ this.$emit('TaskListChange', item)
+ },
getSetting() {
getAction(this.url.queryByProjectId, { projectId: this.$route.query.id }).then((res) => {
if (res.success) {
diff --git a/jero-web/src/views/projectManagement/components/TaskList.vue b/jero-web/src/views/projectManagement/components/TaskList.vue
index 50c4584c2..51a4d6989 100644
--- a/jero-web/src/views/projectManagement/components/TaskList.vue
+++ b/jero-web/src/views/projectManagement/components/TaskList.vue
@@ -141,7 +141,7 @@
certificationDirectory,
TaskListModel
},
- props:['isDisplayNum'],
+ props: ['isDisplayNum', 'areaOfResponsibility'],
data() {
return {
columns: [
@@ -257,7 +257,7 @@
mounted() {
this.getList()
this.long = localStorage.getItem('language') || 'zh-cn'
-
+ console.log(this.areaOfResponsibility)
},
methods: {
...mapGetters(['userInfo']),
diff --git a/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue b/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue
index bed58d4bd..dfa4961dd 100644
--- a/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue
+++ b/jero-web/src/views/projectManagement/components/certificationProgressEchart.vue
@@ -19,7 +19,7 @@
-
+
@@ -75,6 +75,9 @@
this.getData()
},
methods: {
+ responsibility(item) {
+ this.$emit('currentStatus', item)
+ },
getData() {
getAction(this.url.getProjectDetailsStatistics, { id: this.$route.query.id }).then((res) => {
if (res.success) {
diff --git a/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue b/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue
index d83b48662..7c0157783 100644
--- a/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue
+++ b/jero-web/src/views/projectManagement/components/currentStatusOfTheProjectEcharts.vue
@@ -26,7 +26,7 @@
-
+
@@ -174,8 +174,10 @@
})
}
this.getEcharts('main-left', this.$t('CurrentStatusOfTheProject'), color, data)
+ },
+ responsibility(item) {
+ this.$emit('currentStatus', item)
}
-
}
}
diff --git a/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue b/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue
index 6c120bd6a..31a91e2a7 100644
--- a/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue
+++ b/jero-web/src/views/projectManagement/components/deliverableStatusEchart.vue
@@ -21,7 +21,7 @@
-
+
@@ -250,6 +250,9 @@
,
mainBottomEcharts(data, color) {
this.getEcharts('main-bottom', this.$t('verificationComplianceConfirmationProgress'), color, data, 5)
+ },
+ responsibility(item) {
+ this.$emit('currentStatus', item)
}
}
}
diff --git a/jero-web/src/views/projectManagement/components/responsibilityList.vue b/jero-web/src/views/projectManagement/components/responsibilityList.vue
index cd0f0aea9..7cda45c34 100644
--- a/jero-web/src/views/projectManagement/components/responsibilityList.vue
+++ b/jero-web/src/views/projectManagement/components/responsibilityList.vue
@@ -26,6 +26,9 @@
:data-source="dataSource"
:columns="columns"
>
+
+ {{text}}
+
@@ -53,15 +56,16 @@
title: this.$t('areaOfResponsibility'),
dataIndex: 'dutyTerritory',
align: 'center',
- width:400,
- ellipsis: true
+ width: 400,
+ ellipsis: true,
+ scopedSlots: { customRender: 'areaOfResponsibility' }
},
{
title: this.$t('Quantity'),
dataIndex: 'amount',
align: 'center',
ellipsis: true,
- width:300,
+ width: 300
}
]
}
@@ -92,6 +96,9 @@
},
handleCancel() {
this.visible = false
+ },
+ areaOfResponsibilityClick(item) {
+ this.$emit('responsibility', item)
}
}
}
From 964e716616a8a74bb4efac6ffd4fd6a8bb9f1cb5 Mon Sep 17 00:00:00 2001
From: xiejunyu
Date: Wed, 25 May 2022 17:56:04 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=91=E5=BD=A2?=
=?UTF-8?q?=E7=88=B6=E7=BA=A7=E6=8E=A5=E5=8F=A3+=E6=A0=91=E5=BD=A2?=
=?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/SysCategoryController.java | 13 +++
.../system/controller/SysDictController.java | 2 +-
.../controller/SysDictItemController.java | 2 +
.../system/service/ISysCategoryService.java | 6 ++
.../system/service/ISysDictItemService.java | 4 +
.../system/service/ISysDictService.java | 2 +-
.../service/impl/SysCategoryServiceImpl.java | 84 +++++++++++++++++++
.../service/impl/SysDictItemServiceImpl.java | 79 +++++++++++++++++
.../service/impl/SysDictServiceImpl.java | 2 +-
9 files changed, 191 insertions(+), 3 deletions(-)
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysCategoryController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysCategoryController.java
index 830910af5..659e28fe9 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysCategoryController.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysCategoryController.java
@@ -16,6 +16,7 @@ import com.jero.modules.enums.FixedFieldEnum;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.model.TreeSelectModel;
import com.jero.modules.system.service.ISysCategoryService;
+import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@@ -27,6 +28,7 @@ import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@@ -44,6 +46,7 @@ import java.util.stream.Collectors;
* @Date: 2019-05-29
* @Version: V1.0
*/
+@Api(tags="标签内容-树形结构")
@RestController
@RequestMapping("/sys/category")
@Slf4j
@@ -94,6 +97,14 @@ public class SysCategoryController {
result.setResult(list);
return result;
}
+ @AutoLog(value = "标签内容-查询字典配置的父级名称")
+ @ApiOperation(value = "标签内容-查询字典配置的父级名称", notes = "标签内容-查询字典配置的父级名称")
+ @GetMapping(value = "/queryPid")
+ public Result> queryPid() {
+ List list = sysCategoryService.queryPid();
+
+ return Result.OK(list);
+ }
/**标签内容-树形结构列表
*
@@ -118,6 +129,7 @@ public class SysCategoryController {
@PostMapping(value = "/add")
public Result add(@RequestBody SysCategory sysCategory) {
Result result = new Result();
+ sysCategoryService.setAddOrdderNum(sysCategory);
sysCategory.setName(sysCategory.getName().replace(" ",""));
sysCategoryService.addSysCategory(sysCategory);
result.success("添加成功!");
@@ -133,6 +145,7 @@ public class SysCategoryController {
@PutMapping(value = "/edit")
public Result edit(@RequestBody SysCategory sysCategory) {
Result result = new Result();
+ sysCategoryService.setEditOrderNum(sysCategory);
SysCategory sysCategoryEntity = sysCategoryService.getById(sysCategory.getId());
if(sysCategoryEntity==null) {
result.error500("未找到对应实体");
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java
index 064aa382c..c25f4d9b1 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java
@@ -436,7 +436,7 @@ public class SysDictController {
@RequiresPermissions("dict:edit")
public Result edit(@RequestBody SysDict sysDict) {
Result result = new Result();
- sysDictService.setEditOrdderNum(sysDict);
+ sysDictService.setEditOrderNum(sysDict);
SysDict sysdict = sysDictService.getById(sysDict.getId());
if (sysdict == null) {
result.error500("未找到对应实体");
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictItemController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictItemController.java
index 46eacf4ed..0a360f37e 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictItemController.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictItemController.java
@@ -84,6 +84,7 @@ public class SysDictItemController {
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result add(@RequestBody SysDictItem sysDictItem) {
Result result = new Result();
+ sysDictItemService.setAddOrdderNum(sysDictItem);
//查询同名数据
List exitDictItemList = sysDictItemMapper.selctItemByName(sysDictItem.getItemText(),sysDictItem.getDictId());
if(CollectionUtils.isNotEmpty(exitDictItemList)){
@@ -127,6 +128,7 @@ public class SysDictItemController {
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
public Result edit(@RequestBody SysDictItem sysDictItem) {
Result result = new Result();
+ sysDictItemService.setEditOrderNum(sysDictItem);
SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
if (sysdict == null) {
result.error500("未找到对应实体");
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysCategoryService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysCategoryService.java
index 9e95752fe..793ced8fe 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysCategoryService.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysCategoryService.java
@@ -85,4 +85,10 @@ public interface ISysCategoryService extends IService {
public void updateDictDelFlag(int delFlag,String id);
List queryByTreeDicCode(String dicCode);
+
+ void setAddOrdderNum(SysCategory sysCategory);
+
+ void setEditOrderNum(SysCategory sysCategory);
+
+ List queryPid();
}
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java
index 21fd8cc2e..0d59ef710 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictItemService.java
@@ -30,4 +30,8 @@ public interface ISysDictItemService extends IService {
* @param id
*/
public void updateDictDelFlag(int delFlag,String id);
+
+ void setAddOrdderNum(SysDictItem sysDictItem);
+
+ void setEditOrderNum(SysDictItem sysDictItem);
}
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictService.java
index 3deed8b29..a73c187ec 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictService.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDictService.java
@@ -172,5 +172,5 @@ public interface ISysDictService extends IService {
void setAddOrdderNum(SysDict sysDict);
- void setEditOrdderNum(SysDict sysDict);
+ void setEditOrderNum(SysDict sysDict);
}
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java
index 5868d597d..d060ca6d6 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysCategoryServiceImpl.java
@@ -309,4 +309,88 @@ public class SysCategoryServiceImpl extends ServiceImpl queryByTreeDicCode(String dicCode) {
return sysCategoryMapper.queryByTreeDicCode(dicCode);
}
+
+ @Override
+ public void setAddOrdderNum(SysCategory sysCategory) {
+ Integer inputOrderNum = sysCategory.getSortOrder();
+ if(inputOrderNum != null) {
+ //查询展示顺序相同的
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("sys_dict_id",sysCategory.getSysDictId())
+ .eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .orderByAsc("sort_order");
+ queryWrapper.eq("sort_order", inputOrderNum);
+ Integer orderNumCount = sysCategoryMapper.selectCount(queryWrapper);
+ if (orderNumCount > 0) {//有重复展示顺序的,后面的号全+1
+ //设置排序
+ QueryWrapper orderNumQueryWrapper = new QueryWrapper<>();
+ orderNumQueryWrapper.ge("sort_order", inputOrderNum)
+ .eq("sys_dict_id",sysCategory.getSysDictId())
+ .eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .orderByAsc("sort_order");
+ List geOrderNumList = list(orderNumQueryWrapper);
+
+ //判断相邻的序号,去掉不邻的
+ for (int i = 0; i < geOrderNumList.size(); i++) {
+ if (geOrderNumList.size() == 1) {
+ break;
+ } else if (geOrderNumList.get(i + 1).getSortOrder() - geOrderNumList.get(i).getSortOrder() > 1) {
+ int deleteStart = geOrderNumList.get(i + 1).getSortOrder();
+ geOrderNumList = geOrderNumList.stream().filter(e -> e.getSortOrder() < deleteStart).collect(Collectors.toList());
+ break;
+ }
+ }
+
+ geOrderNumList.stream().forEach(e -> e.setSortOrder(e.getSortOrder() + 1));
+ saveOrUpdateBatch(geOrderNumList);
+ }
+ }
+ }
+
+ @Override
+ public void setEditOrderNum(SysCategory sysCategory) {
+ Integer inputOrderNum = sysCategory.getSortOrder();
+ if(inputOrderNum != null) {
+ //查询展示顺序相同的
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("sys_dict_id",sysCategory.getSysDictId())
+ .eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .orderByAsc("sort_order");
+ Integer orderNumData = list(queryWrapper).stream().filter(e -> e.getId().equals(sysCategory.getId()))
+ .map(e -> e.getSortOrder()).collect(Collectors.toList()).get(0);
+ queryWrapper.eq("sort_order", inputOrderNum);
+ Integer orderNumCount = sysCategoryMapper.selectCount(queryWrapper);
+ if (orderNumCount > 0 && !orderNumData.equals(inputOrderNum)) {//有重复展示顺序的,后面的号全+1
+ //设置排序
+ QueryWrapper orderNumQueryWrapper = new QueryWrapper<>();
+ orderNumQueryWrapper.ge("sort_order", inputOrderNum)
+ .eq("sys_dict_id",sysCategory.getSysDictId())
+ .eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .orderByAsc("sort_order");
+ List geOrderNumList = list(orderNumQueryWrapper);
+
+ //判断相邻的序号,去掉不邻的
+ for (int i = 0; i < geOrderNumList.size(); i++) {
+ if (geOrderNumList.size() == 1) {
+ break;
+ } else if (geOrderNumList.get(i + 1).getSortOrder() - geOrderNumList.get(i).getSortOrder() > 1) {
+ int deleteStart = geOrderNumList.get(i + 1).getSortOrder();
+ geOrderNumList = geOrderNumList.stream().filter(e -> e.getSortOrder() < deleteStart).collect(Collectors.toList());
+ break;
+ }
+ }
+
+ geOrderNumList.stream().forEach(e -> e.setSortOrder(e.getSortOrder() + 1));
+ saveOrUpdateBatch(geOrderNumList);
+ }
+ }
+ }
+
+ @Override
+ public List queryPid() {
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("pid",0);
+ List list = list(queryWrapper);
+ return list;
+ }
}
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java
index 6b07d515c..394f168f3 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictItemServiceImpl.java
@@ -1,6 +1,8 @@
package com.jero.modules.system.service.impl;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.jero.common.constant.CommonConstant;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.mapper.SysDictItemMapper;
import com.jero.modules.system.service.ISysDictItemService;
@@ -8,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
+import java.util.stream.Collectors;
/**
*
@@ -52,4 +55,80 @@ public class SysDictItemServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .eq("dict_id",sysDictItem.getDictId())
+ .orderByAsc("order_num");
+ queryWrapper.eq("order_num", inputOrderNum);
+ Integer orderNumCount = sysDictItemMapper.selectCount(queryWrapper);
+ if (orderNumCount > 0) {//有重复展示顺序的,后面的号全+1
+ //设置排序
+ QueryWrapper orderNumQueryWrapper = new QueryWrapper<>();
+ orderNumQueryWrapper.ge("order_num", inputOrderNum)
+ .eq("dict_id",sysDictItem.getDictId())
+ .eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .orderByAsc("order_num");
+ List geOrderNumList = list(orderNumQueryWrapper);
+
+ //判断相邻的序号,去掉不邻的
+ for (int i = 0; i < geOrderNumList.size(); i++) {
+ if (geOrderNumList.size() == 1) {
+ break;
+ } else if (geOrderNumList.get(i + 1).getSortOrder() - geOrderNumList.get(i).getSortOrder() > 1) {
+ int deleteStart = geOrderNumList.get(i + 1).getSortOrder();
+ geOrderNumList = geOrderNumList.stream().filter(e -> e.getSortOrder() < deleteStart).collect(Collectors.toList());
+ break;
+ }
+ }
+
+ geOrderNumList.stream().forEach(e -> e.setSortOrder(e.getSortOrder() + 1));
+ saveOrUpdateBatch(geOrderNumList);
+ }
+ }
+ }
+
+ @Override
+ public void setEditOrderNum(SysDictItem sysDictItem) {
+ Integer inputOrderNum = sysDictItem.getSortOrder();
+ if(inputOrderNum != null) {
+ //查询展示顺序相同的
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .eq("dict_id",sysDictItem.getDictId())
+ .orderByAsc("sort_order");
+ Integer orderNumData = list(queryWrapper).stream().filter(e -> e.getId().equals(sysDictItem.getId()))
+ .map(e -> e.getSortOrder()).collect(Collectors.toList()).get(0);
+ queryWrapper.eq("sort_order", inputOrderNum);
+ Integer orderNumCount = sysDictItemMapper.selectCount(queryWrapper);
+ if (orderNumCount > 0 && !orderNumData.equals(inputOrderNum)) {//有重复展示顺序的,后面的号全+1
+ //设置排序
+ QueryWrapper orderNumQueryWrapper = new QueryWrapper<>();
+ orderNumQueryWrapper.ge("sort_order", inputOrderNum)
+ .eq("dict_id",sysDictItem.getDictId())
+ .eq("del_flag", CommonConstant.DEL_FLAG_0)
+ .orderByAsc("sort_order");
+ List geOrderNumList = list(orderNumQueryWrapper);
+
+ //判断相邻的序号,去掉不邻的
+ for (int i = 0; i < geOrderNumList.size(); i++) {
+ if (geOrderNumList.size() == 1) {
+ break;
+ } else if (geOrderNumList.get(i + 1).getSortOrder() - geOrderNumList.get(i).getSortOrder() > 1) {
+ int deleteStart = geOrderNumList.get(i + 1).getSortOrder();
+ geOrderNumList = geOrderNumList.stream().filter(e -> e.getSortOrder() < deleteStart).collect(Collectors.toList());
+ break;
+ }
+ }
+
+ geOrderNumList.stream().forEach(e -> e.setSortOrder(e.getSortOrder() + 1));
+ saveOrUpdateBatch(geOrderNumList);
+ }
+ }
+ }
}
diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java
index ee647db3f..23b6dfd8c 100644
--- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java
+++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDictServiceImpl.java
@@ -484,7 +484,7 @@ public class SysDictServiceImpl extends ServiceImpl impl
}
@Override
- public void setEditOrdderNum(SysDict sysDict) {
+ public void setEditOrderNum(SysDict sysDict) {
Integer inputOrderNum = sysDict.getOrderNum();
if(inputOrderNum != null) {
//查询展示顺序相同的