Browse Source

执法事项相关

v2
蟑螂恶霸 2 years ago
parent
commit
8e3fe27dc5
  1. 2
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppTestSIQController.java
  2. 93
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/linkage/add.html
  3. 12
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/linkage/edit.html
  4. 6
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/linkage/view.html
  5. 1
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/LinkageDictServiceImpl.java
  6. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/LinkageDictMapper.xml

2
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppTestSIQController.java

@ -1,7 +1,7 @@
package com.zdxt.app.controller; package com.zdxt.app.controller;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.zdxt.code.utils.IdCardCryptoUtil; import com.zdxt.common.util.IdCardCryptoUtil;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

93
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/linkage/add.html

@ -1,31 +1,30 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="zdxtInclude :: header('新增关联')" /> <th:block th:include="include :: header('修改节点')" />
<th:block th:include="zdxtInclude :: select2-css" /> <th:block th:include="include :: select2-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-linkage-add"> <form class="form-horizontal m" id="form-dept-edit">
<!--<input id="treeId" name="parentId" type="hidden"/>-->
<input id="treeId" name="parentId" type="hidden" th:value="${linkage.id}" /> <input id="treeId" name="parentId" type="hidden" th:value="${linkage.id}" />
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">上级节点:</label> <label class="col-sm-3 control-label">上级部门:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<!--<input class="form-control" type="text" onclick="selectDeptTree()" id="treeName" readonly="true">--> <input class="form-control" type="text" id="treeName" onclick="selectItemTree()" readonly="true">
<input class="form-control" type="text" onclick="selectItemTree()" id="treeName" readonly="true" th:value="${linkage.title}">
<span class="input-group-addon"><i class="fa fa-search"></i></span> <span class="input-group-addon"><i class="fa fa-search"></i></span>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">名称:</label> <label class="col-sm-3 control-label is-required">节点名称:</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input class="form-control" type="text" placeholder="请输入名称" name="title" id="title" required> <input class="form-control" type="text" name="deptName" id="title" required>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<input class="form-control" type="text" name="srot" placeholder="请输入排序" required> <input class="form-control" type="text" name="srot" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -34,47 +33,14 @@
<input class="form-control" type="text" placeholder="请输入值" name="value" id="value" required> <input class="form-control" type="text" placeholder="请输入值" name="value" id="value" required>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">领域:</label>
<div class="col-sm-8">
<input class="form-control" type="text" placeholder="请输入领域" name="domain" id="domain">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门:</label>
<div class="col-sm-8">
<input class="form-control" type="text" placeholder="请输入部门" name="dept" id="dept">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">要求:</label>
<div class="col-sm-8">
<input class="form-control" type="text" placeholder="请输入要求" name="demand" id="demand">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">依据:</label>
<div class="col-sm-8">
<input class="form-control" type="text" placeholder="请输入依据" name="basis" id="basis">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
</form> </form>
</div> </div>
<th:block th:include="zdxtInclude :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="zdxtInclude :: select2-js" /> <th:block th:include="include :: select2-js" />
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "code/linkage"; var prefix = ctx + "code/linkage";
$("#form-linkage-add").validate({ $("#form-dept-edit").validate({
onkeyup: false, onkeyup: false,
rules:{ rules:{
deptName:{ deptName:{
@ -83,10 +49,13 @@
type: "post", type: "post",
dataType: "json", dataType: "json",
data: { data: {
"deptId": function() {
return $("#id").val();
},
"parentId": function() { "parentId": function() {
return $("input[name='parentId']").val(); return $("input[name='parentId']").val();
}, },
"title" : function() { "deptName": function() {
return $.common.trim($("#title").val()); return $.common.trim($("#title").val());
} }
}, },
@ -95,19 +64,13 @@
} }
} }
}, },
orderNum:{ srot:{
digits:true digits:true
}, },
email:{
email:true,
},
phone:{
isPhone:true,
},
}, },
messages: { messages: {
"deptName": { "deptName": {
remote: "节点已经存在" remote: "部门已经存在"
} }
}, },
focusCleanup: true focusCleanup: true
@ -115,35 +78,37 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-linkage-add').serialize()); $.operate.save(prefix + "/edit", $('#form-dept-edit').serialize());
} }
} }
/*部门管理-新增-选择父部门树*/ /*部门管理-修改-选择部门树*/
function selectItemTree() { function selectItemTree() {
var id = $("#treeId").val();
var options = { var options = {
title: '部门选择', title: '节点选择',
width: "380", width: "380",
url: prefix + "/selectItemTree/" + $("#treeId").val(), url: prefix + "/selectItemTree/" + $("#treeId").val(),
// url: prefix + "/selectDeptTree/123",
callBack: doSubmit callBack: doSubmit
}; };
$.modal.openOptions(options); $.modal.openOptions(options);
} }
function doSubmit(index, layero){ function doSubmit(index, layero){
var tree = layero.find("iframe")[0].contentWindow.$._tree;
if ($.tree.notAllowLastLevel(tree)) {
var body = layer.getChildFrame('body', index); var body = layer.getChildFrame('body', index);
$("#treeId").val(body.find('#treeId').val()); $("#treeId").val(body.find('#treeId').val());
$("#treeName").val(body.find('#treeName').val()); $("#treeName").val(body.find('#treeName').val());
layer.close(index); layer.close(index);
} }
}
$(function() { $(function() {
$('#deptType').select2({ $('#deptType').select2({
placeholder: "请选择类型", placeholder: "请选择类型",
allowClear: true allowClear: true
}); });
}) })
</script> </script>
</body> </body>
</html> </html>

12
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/linkage/edit.html

@ -25,13 +25,13 @@
<input class="form-control" type="text" name="deptName" th:field="*{title}" id="title" required> <input class="form-control" type="text" name="deptName" th:field="*{title}" id="title" required>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required> <input class="form-control" type="text" name="srot" th:field="*{srot}" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">值:</label> <label class="col-sm-3 control-label is-required">值:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input class="form-control" type="text" placeholder="请输入值" name="value" id="value" required> <input class="form-control" type="text" placeholder="请输入值" name="value" th:field="*{value}" id="value" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -48,7 +48,7 @@
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" /> <th:block th:include="include :: select2-js" />
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "system/dept"; var prefix = ctx + "code/linkage";
$("#form-dept-edit").validate({ $("#form-dept-edit").validate({
onkeyup: false, onkeyup: false,
@ -74,7 +74,7 @@
} }
} }
}, },
orderNum:{ srot:{
digits:true digits:true
}, },
}, },
@ -94,8 +94,8 @@
/*部门管理-修改-选择部门树*/ /*部门管理-修改-选择部门树*/
function selectItemTree() { function selectItemTree() {
var deptId = $("#treeId").val(); var id = $("#treeId").val();
if(deptId > 0) { if(id > 0 || id.length > 1) {
var options = { var options = {
title: '节点选择', title: '节点选择',
width: "380", width: "380",

6
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/linkage/view.html

@ -97,9 +97,9 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
// if (row.parentId != 0) { // if (row.parentId != 0) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.deptId + '\',820,508)"><i class="fa fa-edit"></i> 编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\',820,508)"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.deptId + '\',820,508)"><i class="fa fa-plus"></i> 新增</a> '); actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.id + '\',820,508)"><i class="fa fa-plus"></i> 新增</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.deptId + '\')"><i class="fa fa-trash"></i> 删除</a>'); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash"></i> 删除</a>');
return actions.join(''); return actions.join('');
// } else { // } else {
// return ""; // return "";

1
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/LinkageDictServiceImpl.java

@ -46,6 +46,7 @@ public class LinkageDictServiceImpl implements ILinkageDictService
return linkageDictMapper.selectLinkageDictById(id); return linkageDictMapper.selectLinkageDictById(id);
} }
@Override @Override
@DataScope
public LinkageDict selectLinkageDictByValueAndParentId(String value, String parentId) public LinkageDict selectLinkageDictByValueAndParentId(String value, String parentId)
{ {
return linkageDictMapper.selectLinkageDictByValueAndParentId(value, parentId); return linkageDictMapper.selectLinkageDictByValueAndParentId(value, parentId);

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/LinkageDictMapper.xml

@ -40,17 +40,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updator != null and updator != ''"> and updator = #{updator}</if> <if test="updator != null and updator != ''"> and updator = #{updator}</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
or (`value` = 100 or `value` = 'law_item' or `value` = 'check_item')
</where> </where>
</select> </select>
<select id="selectLinkageDictById" parameterType="String" resultMap="LinkageDictResult"> <select id="selectLinkageDictById" parameterType="String" resultMap="LinkageDictResult">
<include refid="selectLinkageDictVo"/> select ld.id, ld.title, ld.`value`, ld.parent_id, ld.`desc`, ld.srot, ld.`status`, ld.`domain`, ld.dept, ld.dept_id, ld.demand, ld.basis, ld.creator, ld.create_time, ld.updator, ld.update_time,
(select title from linkage_dict where id = ld.parent_id) parent_name
from linkage_dict ld
where id = #{id} where id = #{id}
</select> </select>
<select id="selectLinkageDictByValueAndParentId" parameterType="String" resultMap="LinkageDictResult"> <select id="selectLinkageDictByValueAndParentId" parameterType="String" resultMap="LinkageDictResult">
<include refid="selectLinkageDictVo"/> <include refid="selectLinkageDictVo"/>
where `value` = #{value} and parent_id = #{parentId} where `value` = #{value} and parent_id = #{parentId}
<!-- 数据范围过滤 -->
${params.dataScope}
</select> </select>
<insert id="insertLinkageDict" parameterType="LinkageDict"> <insert id="insertLinkageDict" parameterType="LinkageDict">

Loading…
Cancel
Save