企业检查项

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
**/
@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

View File

@ -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 {

View File

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

View File

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

View File

@ -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

View File

@ -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

View File

@ -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
<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 test="checkItemParentId != null and checkItemParentId != ''">
AND
check_item_parent_id = #{checkItemParentId}
t1.check_item_parent_id = #{checkItemParentId}
</if>
<if test="type != null">
AND
@ -173,6 +184,10 @@
AND
check_item_parent_id = #{checkItemParentId}
</if>
<if test="enterpriseId != null and enterpriseId != ''">
AND
enterprise_id = #{enterpriseId}
</if>
</select>
<!-- 通过上级ID统计下级数量 -->

View File

@ -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',

View File

@ -16,9 +16,9 @@
</style>
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row layui-col-space15">
<div class="layui-col-md2">
<div class="layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-xs2">
<div class="layui-card">
<div class="layui-card-body left-tree-wrap">
<div id="leftTreeWrap">
@ -27,7 +27,7 @@
</div>
</div>
</div>
<div class="layui-col-md10">
<div class="layui-col-xs10">
<div class="layui-card">
<div id="listContentWrap" class="layui-card-body">
<iframe id="listContent" frameborder="0" class="layadmin-iframe"></iframe>
@ -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++) {

View File

@ -61,9 +61,9 @@
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/downloadfile/false/{{item.fileId}}" align="加载失败">
</span>
<span class="upload-image-span">
<img src="route/file/downloadfile/false/{{item.fileId}}" align="加载失败">
</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">
<i class="fa fa-trash-o"></i>
</a>
@ -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],

View File

@ -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],

View File

@ -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();
}

View File

@ -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],

View File

@ -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],

View File

@ -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 '<div class="layui-btn-group">' +
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="pollutionEvent">污染情况</button>' +
@ -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() {}
});