企业检查项

This commit is contained in:
wenc000 2020-12-29 18:14:10 +08:00
parent e4c6ed1f60
commit f6050b9a0d
15 changed files with 53 additions and 37 deletions

View File

@ -31,8 +31,8 @@ import java.util.Map;
* @Version: 1.0 * @Version: 1.0
**/ **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "企业检查项接口") @Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "企业检查项接口")
@RestController @RestController("CheckItemV2Controller")
@RequestMapping(ISystemConstant.API_PREFIX + "enterprise/checkitem/v2") @RequestMapping(ISystemConstant.API_PREFIX + "/enterprise/checkitem/v2")
public class CheckItemController extends AbstractController { public class CheckItemController extends AbstractController {
@Autowired @Autowired

View File

@ -29,7 +29,7 @@ import java.util.Map;
* @Version: 1.0 * @Version: 1.0
**/ **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "检查项选项接口") @Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "检查项选项接口")
@RestController @RestController("CheckItemOptionV2Controller")
@RequestMapping(ISystemConstant.API_PREFIX + "/enterprise/checkitemoption/v2") @RequestMapping(ISystemConstant.API_PREFIX + "/enterprise/checkitemoption/v2")
public class CheckItemOptionController extends AbstractController { public class CheckItemOptionController extends AbstractController {

View File

@ -18,7 +18,7 @@ import java.util.Map;
* @Date: 2020-03-25 22:59 * @Date: 2020-03-25 22:59
* @Version: 1.0 * @Version: 1.0
**/ **/
@Repository @Repository("ICheckItemV2Dao")
public interface ICheckItemDao { public interface ICheckItemDao {
/** /**

View File

@ -17,7 +17,7 @@ import java.util.Map;
* @Date: 2020-04-14 08:58 * @Date: 2020-04-14 08:58
* @Version: 1.0 * @Version: 1.0
**/ **/
@Repository @Repository("ICheckItemOptionV2Dao")
public interface ICheckItemOptionDao { public interface ICheckItemOptionDao {
/** /**

View File

@ -29,7 +29,7 @@ import java.util.Map;
* @Date: 2020-03-25 22:59 * @Date: 2020-03-25 22:59
* @Version: 1.0 * @Version: 1.0
**/ **/
@Service @Service("CheckItemServiceV2Impl")
public class CheckItemServiceImpl extends BaseService implements ICheckItemService { public class CheckItemServiceImpl extends BaseService implements ICheckItemService {
@Autowired @Autowired

View File

@ -28,7 +28,7 @@ import java.util.Map;
* @Date: 2020-04-14 08:58 * @Date: 2020-04-14 08:58
* @Version: 1.0 * @Version: 1.0
**/ **/
@Service @Service("CheckItemOptionServiceV2Impl")
public class CheckItemOptionServiceImpl extends BaseService implements ICheckItemOptionService { public class CheckItemOptionServiceImpl extends BaseService implements ICheckItemOptionService {
@Autowired @Autowired

View File

@ -24,6 +24,7 @@
INSERT INTO gen_enterprise_check_item_v2( INSERT INTO gen_enterprise_check_item_v2(
check_item_id, check_item_id,
check_item_parent_id, check_item_parent_id,
enterprise_id,
type, type,
name, name,
summary, summary,
@ -37,6 +38,7 @@
) VALUES( ) VALUES(
#{checkItemId}, #{checkItemId},
#{checkItemParentId}, #{checkItemParentId},
#{enterpriseId},
#{type}, #{type},
#{name}, #{name},
#{summary}, #{summary},
@ -128,17 +130,26 @@
t1.icon, t1.icon,
t1.icon_press, t1.icon_press,
t1.check_item_parent_id, t1.check_item_parent_id,
t1.enterprise_id,
t1.check_item_id t1.check_item_id
FROM FROM
gen_enterprise_check_item_v2 t1 gen_enterprise_check_item_v2 t1
WHERE WHERE
t1.is_delete = 0 t1.is_delete = 0
<if test="keywords != null and keywords != ''"> <if test="keywords != null and keywords != ''">
<!-- 这里添加检索关键字 --> AND (
t1.name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.summary LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="enterpriseId != null and enterpriseId != ''">
AND
t1.enterprise_id = #{enterpriseId}
</if> </if>
<if test="checkItemParentId != null and checkItemParentId != ''"> <if test="checkItemParentId != null and checkItemParentId != ''">
AND AND
check_item_parent_id = #{checkItemParentId} t1.check_item_parent_id = #{checkItemParentId}
</if> </if>
<if test="type != null"> <if test="type != null">
AND AND
@ -173,6 +184,10 @@
AND AND
check_item_parent_id = #{checkItemParentId} check_item_parent_id = #{checkItemParentId}
</if> </if>
<if test="enterpriseId != null and enterpriseId != ''">
AND
enterprise_id = #{enterpriseId}
</if>
</select> </select>
<!-- 通过上级ID统计下级数量 --> <!-- 通过上级ID统计下级数量 -->

View File

@ -61,7 +61,7 @@
var resizeTimeout = null; var resizeTimeout = null;
var enterpriseId = top.restAjax.params(window.location.href).enterpriseId; var enterpriseId = top.restAjax.params(window.location.href).enterpriseId;
var parentId = top.restAjax.params(window.location.href).parentId; 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() { function initTable() {
@ -156,7 +156,7 @@
yes: function (index) { yes: function (index) {
top.dialog.close(index); top.dialog.close(index);
var layIndex; 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}); top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
parent.common.refreshTree('leftTree'); parent.common.refreshTree('leftTree');
reloadTable(); reloadTable();
@ -195,7 +195,7 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, 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() { end: function() {
parent.common.refreshTree('leftTree'); parent.common.refreshTree('leftTree');
reloadTable(); reloadTable();
@ -214,7 +214,7 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, 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() { end: function() {
parent.common.refreshTree('leftTree'); parent.common.refreshTree('leftTree');
reloadTable(); reloadTable();
@ -241,7 +241,7 @@
var layEvent = obj.event; var layEvent = obj.event;
if(layEvent === 'operationEvent') { if(layEvent === 'operationEvent') {
top.dialog.open({ 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 + '】检查选项配置', title: '【'+ data.name + '】检查选项配置',
width: '800px', width: '800px',
height: '500px', height: '500px',

View File

@ -16,9 +16,9 @@
</style> </style>
</head> </head>
<body> <body>
<div class="layui-fluid layui-anim layui-anim-fadein"> <div class="layui-anim layui-anim-fadein">
<div class="layui-row layui-col-space15"> <div class="layui-row">
<div class="layui-col-md2"> <div class="layui-col-xs2">
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-body left-tree-wrap"> <div class="layui-card-body left-tree-wrap">
<div id="leftTreeWrap"> <div id="leftTreeWrap">
@ -27,7 +27,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-col-md10"> <div class="layui-col-xs10">
<div class="layui-card"> <div class="layui-card">
<div id="listContentWrap" class="layui-card-body"> <div id="listContentWrap" class="layui-card-body">
<iframe id="listContent" frameborder="0" class="layadmin-iframe"></iframe> <iframe id="listContent" frameborder="0" class="layadmin-iframe"></iframe>
@ -58,11 +58,11 @@
// 初始化大小 // 初始化大小
function initSize() { function initSize() {
$('#leftTreeWrap').css({ $('#leftTreeWrap').css({
height: $win.height() - 30, height: $win.height(),
overflow: 'auto' overflow: 'auto'
}); });
$('#listContentWrap').css({ $('#listContentWrap').css({
height: $win.height() - 50, height: $win.height() - 20,
}); });
} }
// 刷新图标 // 刷新图标
@ -80,7 +80,7 @@
type: 'get', type: 'get',
url: top.restAjax.path('api/enterprise/checkitem/v2/listztree', []), url: top.restAjax.path('api/enterprise/checkitem/v2/listztree', []),
autoParam: ['id'], autoParam: ['id'],
otherParam: {}, otherParam: {'enterpriseId': enterpriseId},
dataFilter: function (treeId, parentNode, childNodes) { dataFilter: function (treeId, parentNode, childNodes) {
if (!childNodes) return null; if (!childNodes) return null;
for (var i = 0, l = childNodes.length; i < l; i++) { for (var i = 0, l = childNodes.length; i < l; i++) {

View File

@ -61,9 +61,9 @@
{{# var files = d[fileName];}} {{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }} {{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box"> <div class="upload-image-box">
<span class="upload-image-span"> <span class="upload-image-span">
<img src="route/file/downloadfile/false/{{item.fileId}}" align="加载失败"> <img src="route/file/downloadfile/false/{{item.fileId}}" align="加载失败">
</span> </span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="iconRemoveFile"> <a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="iconRemoveFile">
<i class="fa fa-trash-o"></i> <i class="fa fa-trash-o"></i>
</a> </a>
@ -138,6 +138,7 @@
var form = layui.form; var form = layui.form;
var laytpl = layui.laytpl; var laytpl = layui.laytpl;
var laydate = layui.laydate; var laydate = layui.laydate;
var enterpriseId = top.restAjax.params(window.location.href).enterpriseId;
var checkItemParentId = top.restAjax.params(window.location.href).checkItemParentId; var checkItemParentId = top.restAjax.params(window.location.href).checkItemParentId;
var viewerObj = {}; var viewerObj = {};
@ -160,7 +161,7 @@
return; return;
} }
var loadLayerIndex; 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', { form.val('dataForm', {
checkItemParentId: data.checkItemId, checkItemParentId: data.checkItemId,
checkItemParentName: data.name checkItemParentName: data.name
@ -181,7 +182,7 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; 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, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes, top.dataMessage.button.no],

View File

@ -148,7 +148,7 @@
// 初始化内容 // 初始化内容
function initData() { function initData() {
var loadLayerIndex; 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 = {}; var dataFormData = {};
for(var i in data) { for(var i in data) {
dataFormData[i] = data[i] +''; dataFormData[i] = data[i] +'';
@ -173,7 +173,7 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; 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, { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes, top.dataMessage.button.no],

View File

@ -52,7 +52,7 @@
var common = layui.common; var common = layui.common;
var resizeTimeout = null; var resizeTimeout = null;
var checkItemId = top.restAjax.params(window.location.href).checkItemId; 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() { function initTable() {
@ -168,7 +168,7 @@
yes: function (index) { yes: function (index) {
top.dialog.close(index); top.dialog.close(index);
var layIndex; 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}); top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
reloadTable(); reloadTable();
}, function (code, data) { }, function (code, data) {
@ -207,7 +207,7 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, 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() { end: function() {
reloadTable(); reloadTable();
} }
@ -225,7 +225,7 @@
area: ['100%', '100%'], area: ['100%', '100%'],
shadeClose: true, shadeClose: true,
anim: 2, 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() { end: function() {
reloadTable(); reloadTable();
} }

View File

@ -92,7 +92,7 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; 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, { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes, top.dataMessage.button.no],

View File

@ -81,7 +81,7 @@
// 初始化内容 // 初始化内容
function initData() { function initData() {
var loadLayerIndex; 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 = {}; var dataFormData = {};
for(var i in data) { for(var i in data) {
dataFormData[i] = data[i] + ''; dataFormData[i] = data[i] + '';
@ -103,7 +103,7 @@
top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index); top.dialog.close(index);
var loadLayerIndex; 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, { var layerIndex = top.dialog.msg(top.dataMessage.updateSuccess, {
time: 0, time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no], btn: [top.dataMessage.button.yes, top.dataMessage.button.no],

View File

@ -365,7 +365,7 @@
return rowData; return rowData;
} }
}, },
{field: 'operation', width: 100, title: '操作', fixed: 'right', align:'center', {field: 'operation', width: 160, title: '操作', fixed: 'right', align:'center',
templet: function(row) { templet: function(row) {
return '<div class="layui-btn-group">' + return '<div class="layui-btn-group">' +
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="pollutionEvent">污染情况</button>' + '<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="pollutionEvent">污染情况</button>' +
@ -505,7 +505,7 @@
top.dialog.open({ top.dialog.open({
url: top.restAjax.path('route/enterprise/checkitem/v2/list-tree-checkitem.html?enterpriseId={enterpriseId}', [data.enterpriseId]), url: top.restAjax.path('route/enterprise/checkitem/v2/list-tree-checkitem.html?enterpriseId={enterpriseId}', [data.enterpriseId]),
title: '污染情况', title: '污染情况',
width: '600px', width: '80%',
height: '80%', height: '80%',
onClose: function() {} onClose: function() {}
}); });