From 3531de058133497e488596950ce4bfab1b00f4db Mon Sep 17 00:00:00 2001 From: chenrui <1950717904@qq.com> Date: Thu, 9 Jan 2025 16:38:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9V2=E7=89=88=E6=9C=AC=E6=BC=8F?= =?UTF-8?q?=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dept/controller/DeptController.java | 1 - .../system/dept/service/DeptServiceImpl.java | 8 ++++-- .../project/code/ruleItemList/add.html | 4 +-- .../project/code/ruleItemList/edit.html | 4 +-- .../project/code/statistical/statistical.html | 26 +++++++++++-------- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/controller/DeptController.java b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/controller/DeptController.java index 9250c779..65481c8a 100644 --- a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/controller/DeptController.java +++ b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/controller/DeptController.java @@ -97,7 +97,6 @@ public class DeptController extends BaseController { { return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); } - dept.setDeptId("111111111"); return toAjax(deptService.insertDept(dept)); } diff --git a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/service/DeptServiceImpl.java b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/service/DeptServiceImpl.java index 7e3c64e4..8804810b 100644 --- a/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/service/DeptServiceImpl.java +++ b/lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/dept/service/DeptServiceImpl.java @@ -1,5 +1,6 @@ package com.zdxt.auth.project.system.dept.service; +import cn.hutool.core.util.IdUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.zdxt.auth.common.constant.UserConstants; @@ -30,6 +31,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.ArrayList; import java.util.Date; @@ -229,7 +231,7 @@ public class DeptServiceImpl implements IDeptService public boolean checkDeptExistUser(String deptId) { int result = deptMapper.checkDeptExistUser(deptId); - return result > 0 ? true : false; + return result > 0; } /** @@ -261,6 +263,8 @@ public class DeptServiceImpl implements IDeptService } dept.setCreateBy(ShiroUtils.getLoginName()); dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); + //默认部门ID + dept.setDeptId(IdUtil.simpleUUID()); return deptMapper.insertDept(dept); } @@ -552,7 +556,7 @@ public class DeptServiceImpl implements IDeptService String encodeStr = ""; try { messageDigest = MessageDigest.getInstance("SHA-256"); - messageDigest.update(str.getBytes("UTF-8")); + messageDigest.update(str.getBytes(StandardCharsets.UTF_8)); encodeStr = byte2Hex(messageDigest.digest()); } catch (Exception e) { throw e; diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/add.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/add.html index 5a2304cb..96c90df7 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/add.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/add.html @@ -38,7 +38,7 @@ - +
@@ -58,7 +58,7 @@ $("#firstColor").hide(); $("#secondColor").hide(); $("#thirdColor").hide(); - } + }; $("#form-list-add").validate({ focusCleanup: true }); diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/edit.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/edit.html index 7d3dc0b3..84595fb1 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/edit.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/ruleItemList/edit.html @@ -39,7 +39,7 @@
- +
@@ -60,7 +60,7 @@ $("#secondColor").hide(); $("#thirdColor").hide();*/ colorChange(); - } + }; $("#form-list-edit").validate({ focusCleanup: true }); diff --git a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html index 8483ccca..15241f78 100644 --- a/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html +++ b/lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/statistical.html @@ -570,6 +570,7 @@ var tabStr = fillTable(tmpList); document.getElementById("echartEnforcerTable").innerHTML = tabStr; + enforcerAnalysis(enforcers, nums); }, error: function (er) { //失败,回调函数 @@ -582,7 +583,6 @@ var myChart = echarts.init(document.getElementById('echartEnforcer')); var app = {}; option = null; - option = { backgroundColor: '', tooltip: { @@ -648,7 +648,7 @@ position: 'top', formatter: '{c}', textStyle: { - color: '#666', //color of value + color: '#3786ef', //color of value fontSize: 14 } } @@ -656,13 +656,13 @@ itemStyle: { //通常情况下: normal: { - barBorderRadius: 20, + barBorderRadius: 10, //每个柱子的颜色即为colorList数组里的每一项,如果柱子数目多于colorList的长度,则柱子颜色循环使用该数组 color: function (params) { var colorList = [ - //['#f43e30', '#fa8576'], - //['#0db62a', '#38dc6f'], - //['#ff730a', '#ffb233'], + ['#f43e30', '#fa8576'], + ['#0db62a', '#38dc6f'], + ['#ff730a', '#ffb233'], ['#3786ef', '#81c0f8'], ['#3786ef', '#81c0f8'], ['#3786ef', '#81c0f8'], @@ -670,16 +670,21 @@ ]; var index = params.dataIndex; if (params.dataIndex >= colorList.length) { - index = params.dataIndex - colorList.length; + index = 0; + index = params.dataIndex - (colorList.length - 1); } - return new echarts.graphic.LinearGradient(0, 0, 0, 1, + // var color1 = colorList[index][0]; + // var color2 = colorList[index][1]; + // console.log(color1) + // console.log(color2) + return new echarts.graphic.LinearGradient(0, 0 ,0, 1, [{ offset: 0, - color: colorList[index][0] + color: '#3786ef' }, { offset: 1, - color: colorList[index][1] + color: '#81c0f8' } ]); }, @@ -970,7 +975,6 @@ function queryData() { var div = document.getElementById('seltime'); var selects = div.getElementsByTagName('select'); - debugger var obj = {}; for (var i = 0; i < selects.length; i++) { var select = selects[i];