From f6050b9a0d04cf8a19485c0176067fb46620872c Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Tue, 29 Dec 2020 18:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=A3=80=E6=9F=A5=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkitem/v2/CheckItemController.java | 4 ++-- .../v2/CheckItemOptionController.java | 2 +- .../checkitem/v2/ICheckItemDao.java | 2 +- .../v2/ICheckItemOptionDao.java | 2 +- .../v2/impl/CheckItemServiceImpl.java | 2 +- .../v2/impl/CheckItemOptionServiceImpl.java | 2 +- .../checkitem/v2/checkitem-mapper.xml | 19 +++++++++++++++++-- .../checkitem/v2/list-checkitem.html | 10 +++++----- .../checkitem/v2/list-tree-checkitem.html | 14 +++++++------- .../checkitem/v2/save-checkitem.html | 11 ++++++----- .../checkitem/v2/update-checkitem.html | 4 ++-- .../v2/list-checkitemoption.html | 8 ++++---- .../v2/save-checkitemoption.html | 2 +- .../v2/update-checkitemoption.html | 4 ++-- .../route/enterprise/v2/list-enterprise.html | 4 ++-- 15 files changed, 53 insertions(+), 37 deletions(-) diff --git a/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java b/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java index 2725927..3a73ae6 100644 --- a/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java +++ b/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitem/v2/CheckItemController.java @@ -31,8 +31,8 @@ import java.util.Map; * @Version: 1.0 **/ @Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "企业检查项接口") -@RestController -@RequestMapping(ISystemConstant.API_PREFIX + "enterprise/checkitem/v2") +@RestController("CheckItemV2Controller") +@RequestMapping(ISystemConstant.API_PREFIX + "/enterprise/checkitem/v2") public class CheckItemController extends AbstractController { @Autowired diff --git a/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitemoption/v2/CheckItemOptionController.java b/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitemoption/v2/CheckItemOptionController.java index 69809e8..3201b34 100644 --- a/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitemoption/v2/CheckItemOptionController.java +++ b/src/main/java/com/cm/inspection/controller/apis/enterprise/checkitemoption/v2/CheckItemOptionController.java @@ -29,7 +29,7 @@ import java.util.Map; * @Version: 1.0 **/ @Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "检查项选项接口") -@RestController +@RestController("CheckItemOptionV2Controller") @RequestMapping(ISystemConstant.API_PREFIX + "/enterprise/checkitemoption/v2") public class CheckItemOptionController extends AbstractController { diff --git a/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java b/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java index e2483e1..a015138 100644 --- a/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java +++ b/src/main/java/com/cm/inspection/dao/enterprise/checkitem/v2/ICheckItemDao.java @@ -18,7 +18,7 @@ import java.util.Map; * @Date: 2020-03-25 22:59 * @Version: 1.0 **/ -@Repository +@Repository("ICheckItemV2Dao") public interface ICheckItemDao { /** diff --git a/src/main/java/com/cm/inspection/dao/enterprise/checkitemoption/v2/ICheckItemOptionDao.java b/src/main/java/com/cm/inspection/dao/enterprise/checkitemoption/v2/ICheckItemOptionDao.java index beb092f..e086bfd 100644 --- a/src/main/java/com/cm/inspection/dao/enterprise/checkitemoption/v2/ICheckItemOptionDao.java +++ b/src/main/java/com/cm/inspection/dao/enterprise/checkitemoption/v2/ICheckItemOptionDao.java @@ -17,7 +17,7 @@ import java.util.Map; * @Date: 2020-04-14 08:58 * @Version: 1.0 **/ -@Repository +@Repository("ICheckItemOptionV2Dao") public interface ICheckItemOptionDao { /** diff --git a/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java b/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java index e321ce9..2849797 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterprise/checkitem/v2/impl/CheckItemServiceImpl.java @@ -29,7 +29,7 @@ import java.util.Map; * @Date: 2020-03-25 22:59 * @Version: 1.0 **/ -@Service +@Service("CheckItemServiceV2Impl") public class CheckItemServiceImpl extends BaseService implements ICheckItemService { @Autowired diff --git a/src/main/java/com/cm/inspection/service/enterprise/checkitemoption/v2/impl/CheckItemOptionServiceImpl.java b/src/main/java/com/cm/inspection/service/enterprise/checkitemoption/v2/impl/CheckItemOptionServiceImpl.java index 5691326..4d6be91 100644 --- a/src/main/java/com/cm/inspection/service/enterprise/checkitemoption/v2/impl/CheckItemOptionServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/enterprise/checkitemoption/v2/impl/CheckItemOptionServiceImpl.java @@ -28,7 +28,7 @@ import java.util.Map; * @Date: 2020-04-14 08:58 * @Version: 1.0 **/ -@Service +@Service("CheckItemOptionServiceV2Impl") public class CheckItemOptionServiceImpl extends BaseService implements ICheckItemOptionService { @Autowired diff --git a/src/main/resources/mybatis/mapper/enterprise/checkitem/v2/checkitem-mapper.xml b/src/main/resources/mybatis/mapper/enterprise/checkitem/v2/checkitem-mapper.xml index 01b6a63..1b87273 100644 --- a/src/main/resources/mybatis/mapper/enterprise/checkitem/v2/checkitem-mapper.xml +++ b/src/main/resources/mybatis/mapper/enterprise/checkitem/v2/checkitem-mapper.xml @@ -24,6 +24,7 @@ INSERT INTO gen_enterprise_check_item_v2( check_item_id, check_item_parent_id, + enterprise_id, type, name, summary, @@ -37,6 +38,7 @@ ) VALUES( #{checkItemId}, #{checkItemParentId}, + #{enterpriseId}, #{type}, #{name}, #{summary}, @@ -128,17 +130,26 @@ t1.icon, t1.icon_press, t1.check_item_parent_id, + t1.enterprise_id, t1.check_item_id FROM gen_enterprise_check_item_v2 t1 WHERE t1.is_delete = 0 - + AND ( + t1.name LIKE CONCAT('%', #{keywords}, '%') + OR + t1.summary LIKE CONCAT('%', #{keywords}, '%') + ) + + + AND + t1.enterprise_id = #{enterpriseId} AND - check_item_parent_id = #{checkItemParentId} + t1.check_item_parent_id = #{checkItemParentId} AND @@ -173,6 +184,10 @@ AND check_item_parent_id = #{checkItemParentId} + + AND + enterprise_id = #{enterpriseId} + diff --git a/src/main/resources/static/route/enterprise/checkitem/v2/list-checkitem.html b/src/main/resources/static/route/enterprise/checkitem/v2/list-checkitem.html index 50c5a56..a0f17b9 100644 --- a/src/main/resources/static/route/enterprise/checkitem/v2/list-checkitem.html +++ b/src/main/resources/static/route/enterprise/checkitem/v2/list-checkitem.html @@ -61,7 +61,7 @@ var resizeTimeout = null; var enterpriseId = top.restAjax.params(window.location.href).enterpriseId; var parentId = top.restAjax.params(window.location.href).parentId; - var tableUrl = top.restAjax.path('api/checkitem/listpagecheckitem?enterpriseId={enterpriseId}&parentId={parentId}', [enterpriseId, parentId]); + var tableUrl = top.restAjax.path('api/enterprise/checkitem/v2/listpage?enterpriseId={enterpriseId}&parentId={parentId}', [enterpriseId, parentId]); // 初始化表格 function initTable() { @@ -156,7 +156,7 @@ yes: function (index) { top.dialog.close(index); var layIndex; - top.restAjax.delete(top.restAjax.path('api/checkitem/removecheckitem/{ids}', [ids]), {}, null, function (code, data) { + top.restAjax.delete(top.restAjax.path('api/enterprise/checkitem/v2/remove/{ids}', [ids]), {}, null, function (code, data) { top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); parent.common.refreshTree('leftTree'); reloadTable(); @@ -195,7 +195,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/checkitem/save-checkitem.html?checkItemParentId={parentId}', [parentId]), + content: top.restAjax.path('route/enterprise/checkitem/v2/save-checkitem.html?enterpriseId={enterpriseId}&checkItemParentId={parentId}', [enterpriseId, parentId]), end: function() { parent.common.refreshTree('leftTree'); reloadTable(); @@ -214,7 +214,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/checkitem/update-checkitem.html?checkItemId={checkItemId}', [checkDatas[0].checkItemId]), + content: top.restAjax.path('route/enterprise/checkitem/v2/update-checkitem.html?checkItemId={checkItemId}', [checkDatas[0].checkItemId]), end: function() { parent.common.refreshTree('leftTree'); reloadTable(); @@ -241,7 +241,7 @@ var layEvent = obj.event; if(layEvent === 'operationEvent') { top.dialog.open({ - url: top.restAjax.path('route/checkitemoption/list-checkitemoption.html?checkItemId={checkItemId}', [data.checkItemId]), + url: top.restAjax.path('route/enterprise/checkitemoption/v2/list-checkitemoption.html?checkItemId={checkItemId}', [data.checkItemId]), title: '【'+ data.name + '】检查选项配置', width: '800px', height: '500px', diff --git a/src/main/resources/static/route/enterprise/checkitem/v2/list-tree-checkitem.html b/src/main/resources/static/route/enterprise/checkitem/v2/list-tree-checkitem.html index 8769bf2..6f8d2db 100644 --- a/src/main/resources/static/route/enterprise/checkitem/v2/list-tree-checkitem.html +++ b/src/main/resources/static/route/enterprise/checkitem/v2/list-tree-checkitem.html @@ -16,9 +16,9 @@ -
-
-
+
+
+
@@ -27,7 +27,7 @@
-
+
@@ -58,11 +58,11 @@ // 初始化大小 function initSize() { $('#leftTreeWrap').css({ - height: $win.height() - 30, + height: $win.height(), overflow: 'auto' }); $('#listContentWrap').css({ - height: $win.height() - 50, + height: $win.height() - 20, }); } // 刷新图标 @@ -80,7 +80,7 @@ type: 'get', url: top.restAjax.path('api/enterprise/checkitem/v2/listztree', []), autoParam: ['id'], - otherParam: {}, + otherParam: {'enterpriseId': enterpriseId}, dataFilter: function (treeId, parentNode, childNodes) { if (!childNodes) return null; for (var i = 0, l = childNodes.length; i < l; i++) { diff --git a/src/main/resources/static/route/enterprise/checkitem/v2/save-checkitem.html b/src/main/resources/static/route/enterprise/checkitem/v2/save-checkitem.html index 73769eb..7c698a4 100644 --- a/src/main/resources/static/route/enterprise/checkitem/v2/save-checkitem.html +++ b/src/main/resources/static/route/enterprise/checkitem/v2/save-checkitem.html @@ -61,9 +61,9 @@ {{# var files = d[fileName];}} {{# for(var i = 0, item = files[i]; item = files[i++];) { }}
- - - + + + @@ -138,6 +138,7 @@ var form = layui.form; var laytpl = layui.laytpl; var laydate = layui.laydate; + var enterpriseId = top.restAjax.params(window.location.href).enterpriseId; var checkItemParentId = top.restAjax.params(window.location.href).checkItemParentId; var viewerObj = {}; @@ -160,7 +161,7 @@ return; } var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/checkitem/getcheckitembyid/{checkItemParentId}', [checkItemParentId]), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('api/enterprise/checkitem/v2/getbyid/{checkItemParentId}', [checkItemParentId]), {}, null, function(code, data) { form.val('dataForm', { checkItemParentId: data.checkItemId, checkItemParentName: data.name @@ -181,7 +182,7 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - top.restAjax.post(top.restAjax.path('api/checkitem/savecheckitem', []), formData.field, null, function(code, data) { + top.restAjax.post(top.restAjax.path('api/enterprise/checkitem/v2/save/{enterpriseId}', [enterpriseId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/enterprise/checkitem/v2/update-checkitem.html b/src/main/resources/static/route/enterprise/checkitem/v2/update-checkitem.html index 418b900..8e21821 100644 --- a/src/main/resources/static/route/enterprise/checkitem/v2/update-checkitem.html +++ b/src/main/resources/static/route/enterprise/checkitem/v2/update-checkitem.html @@ -148,7 +148,7 @@ // 初始化内容 function initData() { var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/checkitem/getcheckitembyid/{checkItemId}', [checkItemId]), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('api/enterprise/checkitem/v2/getbyid/{checkItemId}', [checkItemId]), {}, null, function(code, data) { var dataFormData = {}; for(var i in data) { dataFormData[i] = data[i] +''; @@ -173,7 +173,7 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/checkitem/updatecheckitem/{checkItemId}', [checkItemId]), formData.field, null, function(code, data) { + top.restAjax.put(top.restAjax.path('api/enterprise/checkitem/v2/update/{checkItemId}', [checkItemId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/enterprise/checkitemoption/v2/list-checkitemoption.html b/src/main/resources/static/route/enterprise/checkitemoption/v2/list-checkitemoption.html index dcf5663..c8e6a44 100644 --- a/src/main/resources/static/route/enterprise/checkitemoption/v2/list-checkitemoption.html +++ b/src/main/resources/static/route/enterprise/checkitemoption/v2/list-checkitemoption.html @@ -52,7 +52,7 @@ var common = layui.common; var resizeTimeout = null; var checkItemId = top.restAjax.params(window.location.href).checkItemId; - var tableUrl = 'api/checkitemoption/listpagecheckitemoption?checkItemId='+ checkItemId; + var tableUrl = 'api/enterprise/checkitemoption/v2/listpage?checkItemId='+ checkItemId; // 初始化表格 function initTable() { @@ -168,7 +168,7 @@ yes: function (index) { top.dialog.close(index); var layIndex; - top.restAjax.delete(top.restAjax.path('api/checkitemoption/removecheckitemoption/{ids}', [ids]), {}, null, function (code, data) { + top.restAjax.delete(top.restAjax.path('api/enterprise/checkitemoption/v2/remove/{ids}', [ids]), {}, null, function (code, data) { top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}); reloadTable(); }, function (code, data) { @@ -207,7 +207,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/checkitemoption/save-checkitemoption.html?checkItemId={checkItemId}', [checkItemId]), + content: top.restAjax.path('route/enterprise/checkitemoption/v2/save-checkitemoption.html?checkItemId={checkItemId}', [checkItemId]), end: function() { reloadTable(); } @@ -225,7 +225,7 @@ area: ['100%', '100%'], shadeClose: true, anim: 2, - content: top.restAjax.path('route/checkitemoption/update-checkitemoption.html?checkItemId={checkItemId}&checkItemOptionId={checkItemOptionId}', [checkItemId, checkDatas[0].checkItemOptionId]), + content: top.restAjax.path('route/enterprise/checkitemoption/v2/update-checkitemoption.html?checkItemId={checkItemId}&checkItemOptionId={checkItemOptionId}', [checkItemId, checkDatas[0].checkItemOptionId]), end: function() { reloadTable(); } diff --git a/src/main/resources/static/route/enterprise/checkitemoption/v2/save-checkitemoption.html b/src/main/resources/static/route/enterprise/checkitemoption/v2/save-checkitemoption.html index 78ee1b5..b453303 100644 --- a/src/main/resources/static/route/enterprise/checkitemoption/v2/save-checkitemoption.html +++ b/src/main/resources/static/route/enterprise/checkitemoption/v2/save-checkitemoption.html @@ -92,7 +92,7 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - top.restAjax.post(top.restAjax.path('api/checkitemoption/savecheckitemoption', []), formData.field, null, function(code, data) { + top.restAjax.post(top.restAjax.path('api/enterprise/checkitemoption/v2/save', []), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/enterprise/checkitemoption/v2/update-checkitemoption.html b/src/main/resources/static/route/enterprise/checkitemoption/v2/update-checkitemoption.html index 53f7dfe..04a1a6a 100644 --- a/src/main/resources/static/route/enterprise/checkitemoption/v2/update-checkitemoption.html +++ b/src/main/resources/static/route/enterprise/checkitemoption/v2/update-checkitemoption.html @@ -81,7 +81,7 @@ // 初始化内容 function initData() { var loadLayerIndex; - top.restAjax.get(top.restAjax.path('api/checkitemoption/getcheckitemoptionbyid/{checkItemOptionId}', [checkItemOptionId]), {}, null, function(code, data) { + top.restAjax.get(top.restAjax.path('api/enterprise/checkitemoption/v2/getbyid/{checkItemOptionId}', [checkItemOptionId]), {}, null, function(code, data) { var dataFormData = {}; for(var i in data) { dataFormData[i] = data[i] + ''; @@ -103,7 +103,7 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - top.restAjax.put(top.restAjax.path('api/checkitemoption/updatecheckitemoption/{checkItemOptionId}', [checkItemOptionId]), formData.field, null, function(code, data) { + top.restAjax.put(top.restAjax.path('api/enterprise/checkitemoption/v2/update/{checkItemOptionId}', [checkItemOptionId]), formData.field, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, { time: 0, btn: [top.dataMessage.button.yes, top.dataMessage.button.no], diff --git a/src/main/resources/static/route/enterprise/v2/list-enterprise.html b/src/main/resources/static/route/enterprise/v2/list-enterprise.html index 627ac26..eef27c7 100644 --- a/src/main/resources/static/route/enterprise/v2/list-enterprise.html +++ b/src/main/resources/static/route/enterprise/v2/list-enterprise.html @@ -365,7 +365,7 @@ return rowData; } }, - {field: 'operation', width: 100, title: '操作', fixed: 'right', align:'center', + {field: 'operation', width: 160, title: '操作', fixed: 'right', align:'center', templet: function(row) { return '
' + '' + @@ -505,7 +505,7 @@ top.dialog.open({ url: top.restAjax.path('route/enterprise/checkitem/v2/list-tree-checkitem.html?enterpriseId={enterpriseId}', [data.enterpriseId]), title: '污染情况', - width: '600px', + width: '80%', height: '80%', onClose: function() {} });