Commit 86fc9d7f by java-李谡

Merge branch 'develop' into 'master'

Develop

See merge request java-jdair-foc/foc-manage-2.0!1
parents 20c328dc 012cd898
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
<script src="${ctxStatic}/jquery-form/jquery-form.js" type="text/javascript"></script>
<title>论证部门管理</title>
<meta name="decorator" content="default"/>
</head>
<body>
<ul class="nav nav-tabs">
<li><a href="${ctx}/depart/depart/list">论证部门列表</a></li>
<shiro:hasPermission name="vrf:depart:edit">
<li><a href="${ctx}/depart/depart/form">新增论证部门</a></li>
</shiro:hasPermission>
<li class="active"><a href="${ctx}/airline/verifyAdd">航线管理部门列表</a></li>
</ul>
<sys:message content="${message}"/>
<div class="clearfix"></div>
<div style="background-color: #fff;padding:15px;margin: 10px 0">
<shiro:hasPermission name="vrf:verify:edit">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="添加默认论证部门" onclick="window.location.href='${ctx}/airline/verifyAdd/form'"/>
</shiro:hasPermission>
</div>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>编号</th>
<th>论证类型</th>
<th>论证部门</th>
<shiro:hasPermission name="vrf:verify:edit">
<th>操作</th>
</shiro:hasPermission>
</tr>
</thead>
<tbody>
<c:forEach items="${page}" var="verify" varStatus="vs">
<tr>
<td>${verify.sort}</td>
<td>${verify.label}</td>
<%-- <td>${verify.valueType}</td>--%>
<td>
<c:forEach items="${verify.dList}" var="depar" varStatus="ds">
${depar.departName}
</c:forEach>
</td>
</td>
<shiro:hasPermission name="vrf:verify:view">
<td>
<a href="${ctx}/airline/verifyAdd/form?type=${verify.valueType}&">编辑</a>
<a href="${ctx}/airline/verifyAdd/delete?valueType=${verify.valueType}&" onclick="return confirmx('确认要删除吗?', this.href)">删除</a>
</td>
</shiro:hasPermission>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>
\ No newline at end of file
......@@ -35,8 +35,10 @@
<li class="active"><a href="${ctx}/airline/verify/list">航线编辑</a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="verifyEntity" action="${ctx}${verifyEntity.verifType == '06' or verifyEntity.verifType == '07' or verifyEntity.verifType == '08' ?'/airline/verify/save':'/airline/connect/save' }" method="post" class="form-horizontal">
<form:form id="inputForm" modelAttribute="verifyEntity"
action="${ctx}${verifyEntity.verifType == '06' or verifyEntity.verifType == '07' or verifyEntity.verifType == '08' or verifyEntity.verifType == '09'?'/airline/verify/save':'/airline/connect/save' }"
method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<div class="control-group">
......@@ -45,13 +47,24 @@
<form:input path="verifNo" htmlEscape="false" maxlength="50" class="required"/>
</div>
</div>
<div class="control-group">
<div class="control-group">
<label class="control-label">开航指令单号:</label>
<div class="controls">
<form:input path="routeNo" htmlEscape="false" maxlength="50" class="required"/>
<form:input path="routeNo" htmlEscape="false" maxlength="50" />
</div>
</div>
<div class="control-group">
<label class="control-label">论证单号操作人:</label>
<div class="controls">
<form:input path="operateUser" htmlEscape="false" maxlength="50" class="required" />
</div>
</div>
<div class="control-group">
<label class="control-label">论证单号操作原因:</label>
<div class="controls">
<form:input path="reason" htmlEscape="false" maxlength="500" class="required" />
</div>
</div>
<c:choose>
<c:when test="${verifyEntity.verifType eq '06' or verifyEntity.verifType eq '07' or verifyEntity.verifType eq '08'}">
<div class="control-group">
......@@ -68,7 +81,7 @@
</c:when>
<c:otherwise>
<div class="control-group">
<label class="control-label">飞机号:</label>
<label class="control-label">航班号:</label>
<div class="controls">
<form:input path="flightNo" htmlEscape="false" maxlength="50" />
</div>
......
......@@ -57,6 +57,7 @@
</div>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/airline/verify/list">航线管理列表</a></li>
<li><a href="${ctx}/airline/verifyUpdateUser">论证单号修改展示列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="verifyEntity" action="${ctx}/airline/verify/list" method="post"
class="breadcrumb form-search ">
......@@ -102,7 +103,7 @@
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>编号</th><th>开航指令单号</th><th>论证单号</th><th>论证类型</th><th>机型</th><th>航线</th><th>剩余有效期(天)</th><th>航线状态</th>
<th>编号</th><th>论证单号</th><th>开航指令单号</th><th>论证类型</th><th>机型</th><th>航线</th><th>剩余有效期(天)</th><th>航线状态</th>
<th>发布时间</th>
<shiro:hasPermission name="vrf:verify:edit">
<th>操作</th>
......@@ -113,8 +114,8 @@
<tr>
<%--这里的序号与对应的数据不是绑定的--%>
<td>${page.pageSize*(page.pageNo-1)+vs.index+1}</td>
<td>${verify.routeNo}</td>
<td>${verify.verifNo}</td>
<td>${verify.routeNo}</td>
<td>${fns:getDictLabel(verify.verifType, 'vrf_verify_type', '')}</td>
<td>${verify.aircraft.typeName}</td>
......@@ -128,7 +129,8 @@
<td>
<c:choose>
<c:when test="${verify.verifType eq '06' or verify.verifType eq '07' or verify.verifType eq '08'}"><a href="${ctx}/airline/verify/form?id=${verify.id}&pageNo=${page.pageNo}&pageSize=${page.pageSize}">编辑</a></c:when>
<c:when test="${verify.verifType eq '06' or verify.verifType eq '07' or verify.verifType eq '08' or verify.verifType eq '09'}"><a
href="${ctx}/airline/verify/form?id=${verify.id}&pageNo=${page.pageNo}&pageSize=${page.pageSize}">编辑</a></c:when>
<c:otherwise> <a href="${ctx}/airline/connect/form?id=${verify.id}&pageNo=${page.pageNo}&pageSize=${page.pageSize}">编辑</a></c:otherwise>
</c:choose>
<a href="${ctx}/airline/verify/delete?id=${verify.id}&pageNo=${page.pageNo}&pageSize=${page.pageSize}" onclick="return confirmx('确认要删除吗?', this.href)">删除</a>
......
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
<script src="${ctxStatic}/jquery-form/jquery-form.js" type="text/javascript"></script>
<title>论证部门管理</title>
<meta name="decorator" content="default"/>
<script verify="text/javascript">
function page(n, s) {
if (n) $("#pageNo").val(n);
if (s) $("#pageSize").val(s);
$("#searchForm").attr("action", "${ctx}/airline/verifyUpdateUser/list");
$("#searchForm").submit();
return false;
}
var options = {
type: "POST",
url:urls,
dataType: 'json'
};
var url="${ctx}/airline/sailingfile/upload";
var urls=url;
function upload(id){
urls=url+"?id="+id;
options = {
type: "POST",
url:urls,
dataType: 'json',
success:function(data){
window.location.href='${ctx}/airline/verifyUpdateUser/list?message=成功';
}
};
$("#file").click();
}
$(document).ready(function(){
top.$.jBox.tip.mess=0;
$('#file').on('change', function(){
$('#form').ajaxForm(options).submit();
});
$("#btnImport").click(function(){
$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true},
bottomText:"导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!"});
});
});
</script>
</head>
<body>
<div id="importBox" class="hide">
<form id="importForm" action="${ctx}/airline/verify/import" method="post" enctype="multipart/form-data"
class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入,请稍等...');"><br/>
<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>
<input id="btnImportSubmit" class="btn btn-primary" type="submit" value=" 导 入 "/>
<a href="${ctx}/airline/verify/import/template">下载模板</a>
</form>
</div>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/airline/verify/list">航线管理列表</a></li>
<li><a href="${ctx}/airline/verifyUpdateUser">论证单号修改展示列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="verifyUpdateUserEntity" action="${ctx}/airline/verifyUpdateUser/list" method="post"
class="breadcrumb form-search ">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
<ul class="ul-form">
<li><label>论证单号:</label>
<form:input path="verifNo" htmlEscape="false" maxlength="100" class="input-small"/>
</li>
<li><label>修改人:</label>
<form:input path="operateUser" htmlEscape="false" maxlength="100" class="input-small"/>
</li>
<li><label>论证类型:</label> <form:select path="verifType" class="input-small">
<form:option value="" label="请选择" />
<form:options items="${fns:getDictList('vrf_verify_type')}"
itemLabel="label" itemValue="value" htmlEscape="false" />
</form:select>
</li>
<li class="btns">&nbsp;&nbsp;
<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
</li>
<li class="clearfix"></li>
</ul>
</form:form>
<sys:message content="${message}"/>
<div class="clearfix"></div>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>编号</th><th>论证单号</th><th>论证类型</th><th>机型</th><th>航线</th><th>修改人</th><th>修改时间</th><th>修改原因</th><th>原始单号</th>
<%-- <shiro:hasPermission name="vrf:verify:edit">
<th>操作</th>
</shiro:hasPermission></tr>--%>
</thead>
<tbody>
<c:forEach items="${page.list}" var="verify" varStatus="vs">
<tr>
<%--这里的序号与对应的数据不是绑定的--%>
<td>${page.pageSize*(page.pageNo-1)+vs.index+1}</td>
<td>${verify.verifNo}</td>
<td>${fns:getDictLabel(verify.verifType, 'vrf_verify_type', '')}</td>
<td>${verify.aircraft.typeName}</td>
<td>${verify.airline}
</td>
<td>${verify.operateUser}</td>
<td><fmt:formatDate value="${verify.operateTime}" type="both"/></td>
<td>${verify.reason}</td>
<td>${verify.originalId}</td>
<shiro:hasPermission name="vrf:verify:edit">
</shiro:hasPermission>
</tr>
</c:forEach>
</tbody>
</table>
<div class="pagination">${page}</div>
<form style="display:none" id="form" action="dynamicFields.action?method=uploadFile" method="post" enctype="multipart/form-data">
<input type="file" name="file" id="file" value="" /><br/>
<input type="submit" value="确认提交">
</form>
</body>
</html>
\ No newline at end of file
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
<title>航线编辑</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function () {
$("#verifNo").focus();
$("#inputForm").validate({
rules: {},
messages: {},
submitHandler: function (form) {
var checkArr = document.getElementsByName('check');
console.log(checkArr);
var str ='';
for (var i = 0; i < checkArr.length; i++) {
if (checkArr[i].checked){
str = str+checkArr[i].value.toString()+' '
}
}
console.log(str);
console.log(typeof(str));
$('#list').val(str);
loading('正在提交,请稍等...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function (error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox") || element.is(":radio") || element.parent().is(".input-append")) {
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
});
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li><a href="${ctx}/depart/depart/list">论证部门列表</a></li>
<shiro:hasPermission name="vrf:depart:edit">
<li><a href="${ctx}/depart/depart/form">新增论证部门</a></li>
</shiro:hasPermission>
<li class="active"><a href="${ctx}/airline/verifyAdd">航线管理部门列表</a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="userDepartEntity" action="${ctx}/airline/verifyAdd/add" method="post" class="form-horizontal">
<%-- <form:input path="type" htmlEscape="false" value="${type}" maxlength="50" class="required" style="display:none"/>--%>
<sys:message content="${message}"/>
<div class="control-group">
<label class="control-label" style="width: 120px">选择论证类型</label>
<div class="controls" style="width: 80%;margin-left: 140px">
<form:select path="type" class="input-large">
<form:option value="" label="请选择" />
<form:options items="${dictList}"
itemLabel="label" itemValue="valueType" htmlEscape="false" />
</form:select>
</div>
</div>
<div class="control-group">
<label class="control-label" style="width: 120px">选择部门</label>
<div class="controls" style="width: 80%;margin-left: 140px">
<c:forEach items="${allList}" var="depar" varStatus="ds">
<input type="checkbox" name="check" value="${depar.id}" ${depar.check==true?'checked':""} />
${depar.departName}
</c:forEach>
</div>
</div>
<form:input path="list" htmlEscape="false" maxlength="50" id="list" style="display:none" />
<div class="form-actions" style="margin-top: 0;border: 0;padding: 10px 100px 20px">
<shiro:hasPermission name="vrf:verify:edit"><input id="btnSubmit" class="btn btn-primary" type="submit"
value="保 存"/>&nbsp;</shiro:hasPermission>
<a href="${ctx}/airline/verifyAdd"><input id="btnCancel" class="btn" type="button" value="返回"/></a>
</div>
</form:form>
</body>
</html>
\ No newline at end of file
......@@ -10,20 +10,22 @@
$("#inputForm").validate({
rules: {
airportIata: {remote: "${ctx}/contact/airport/checkAirportIata?oldAirportIata=" + "${airportEntity.airportIata}" /*encodeURIComponent('${airportEntity.airportIata}')*/},
liftoffTime: {min:0},
landingTime: {min:0}
<%--airportName: {remote: "${ctx}/contact/airport/checkAirportName?id="+"${airportEntity.id}"},--%>
liftoffTime: {min: 0},
landingTime: {min: 0}
},
messages: {
airportIata: {remote: "该三字码已存在"},
airportIata: {remote: "该三字码已存在或被删除,如删除需要恢复使用,请联系管理员处理"},
// airportName: {remote: "该机场存在正在使用的三字码,请先屏蔽使用中的三字码后再添加"},
liftoffTime: {min: "不能为负"},
landingTime: {min: "不能为负"}
},
submitHandler: function(form){
submitHandler: function (form) {
loading('正在提交,请稍等...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
errorPlacement: function (error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
......
......@@ -5,6 +5,23 @@
<title>三字码管理</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(function () {
console.log(22222);
var cpLock = true;
$('#testInput').off().on({
compositionstart: function () {//中文输入开始
cpLock = false;
},
compositionend: function () {//中文输入结束
this.value = (this.value.replace(/[^A-Za-z]/g, '')).toUpperCase();
cpLock = true;
},
input: function () {//input框中的值发生变化
if (cpLock)
this.value = (this.value.replace(/[^A-Za-z]/g, '')).toUpperCase();
}
})
});
function page(n, s) {
if (n) $("#pageNo").val(n);
if (s) $("#pageSize").val(s);
......@@ -76,7 +93,10 @@
</li>
<li>
<label>三字码:</label>
<form:input path="airportIata" htmlEscape="false" maxlength="50" class="input-medium" onkeyup="this.value=(this.value.toUpperCase()).replace(/[^a-zA-Z]/g,'')" />
<%-- <form:input path="airportIata" htmlEscape="false" maxlength="50" class="input-medium" onkeyup="this.value=(this.value.toUpperCase()).replace(/[^a-zA-Z]/g,'')" />--%>
<form:input path="airportIata" htmlEscape="false" maxlength="50" class="input-medium" id="testInput"/>
<%-- onchange="this.value=this.value.toUpperCase()" style='text-transform: uppercase'--%>
<%-- onkeyup="this.value=this.value.replace(/[^a-zA-Z]/g,'')"/>--%>
</li>
<li>
<label>所属城市:</label>
......
......@@ -90,7 +90,9 @@
<!--
<td>${record.result == 'FAILD' ? '通话失败' : '通话成功'}</td>
-->
<td><c:if test="${empty record.downloadUrl}">通话失败</c:if><c:if test="${not empty record.downloadUrl}">通话成功</c:if></td>
<td><c:if test="${empty record.downloadUrl and record.result ne 'FAILD'}">通话失败</c:if>
<c:if test="${empty record.downloadUrl and record.result ne 'UNLISTEN'}">未接听</c:if>
<c:if test="${not empty record.downloadUrl}">通话成功</c:if></td>
<td><c:if test="${not empty record.downloadUrl}"><a href="${record.downloadUrl}">下载</a></c:if></td>
</tr>
</c:forEach>
......
......@@ -36,6 +36,7 @@
<ul class="nav nav-tabs">
<li><a href="${ctx}/depart/depart/list">论证部门管理</a></li>
<li class="active"><a href="${ctx}/depart/depart/form?id=${startnoEntity.id}">论证部门<shiro:hasPermission name="vrf:startno:edit">${not empty startnoEntity.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="vrf:depart:edit">查看</shiro:lacksPermission></a></li>
<li class="active"><a href="${ctx}/airline/verifyAdd">航线管理部门列表</a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="departEntity" action="${ctx}/depart/depart/save" method="post" class="form-horizontal">
......
......@@ -21,6 +21,7 @@
<shiro:hasPermission name="vrf:depart:edit">
<li><a href="${ctx}/depart/depart/form">新增论证部门</a></li>
</shiro:hasPermission>
<li><a href="${ctx}/airline/verifyAdd">航线管理部门列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="departEntity" action="${ctx}/depart/depart/list" method="post"
class="breadcrumb form-search ">
......
<?xml version="1.0" encoding="UTF-8"?>
<project name="manage" default="deploy" basedir=".">
<property environment="env" />
<property name="webapp.name" value="manage" />
<property name="catalina.home" value="/data/apache-tomcat-8.5.42" />
<property name="dist.dir" value="${basedir}/dist" />
<property name="WebContent.dir" value="${basedir}/WebContent" />
<property name="src.dir" value="${basedir}/src" />
<property name="resources.dir" value="${basedir}/resources" />
<property name="lib.dir" value="${WebContent.dir}/WEB-INF/lib" />
<property name="build.dir" value="${basedir}/build" />
<!-- 使用eclipse jdt进行编译,而不使用JDK编译 -->
<!-- <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" /> -->
<!-- 初始化classpath -->
<path id="project.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
<!-- 添加tomcat类路径 -->
<fileset dir="${catalina.home}/lib">
<include name="*.jar" />
</fileset>
</path>
<pathconvert pathsep="${line.separator}| |-- "
property="echo.path.compile"
refid="project.classpath">
</pathconvert>
<!-- show classpath jars -->
<target name="print_classpath">
<echo message="|-- compile classpath"/>
<echo message="| |"/>
<echo message="| |-- ${echo.path.compile}"/>
</target>
<!-- 删除之前的目录结构 -->
<target name="clear" description="清理旧文件">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete file="${catalina.home}/webapps/${webapp.name}.war" />
<delete dir="${catalina.home}/webapps/${webapp.name}" />
</target>
<!-- 创建目录结构 -->
<target name="init" depends="clear" description="创建初始化目录结构">
<mkdir dir="${build.dir}/classes" />
<mkdir dir="${dist.dir}" />
</target>
<!-- 编译java -->
<target name="compile" depends="init" description="编译java文件">
<echo message="begin compile..." />
<javac srcdir="${src.dir}" destdir="${build.dir}/classes"
includeantruntime="false" nowarn="on"
source="1.8" target="1.8" deprecation="true" debug="true"
encoding="UTF-8" classpathref="project.classpath"
>
<compilerarg line="-Xlint:unchecked" />
<!-- <classpath refid="project.classpath" /> -->
</javac>
<copy todir="${build.dir}/classes">
<fileset dir="${src.dir}">
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.sql" />
</fileset>
<fileset dir="${resources.dir}">
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.sql" />
</fileset>
</copy>
<echo message="end compile..." />
</target>
<!-- 打成war包, 名称默认为 项目名 -->
<target name="war" depends="compile" description="将工程打成war包">
<echo message="begin war..." />
<war destfile="${dist.dir}/${webapp.name}.war" basedir="${WebContent.dir}"
webxml="${WebContent.dir}/WEB-INF/web.xml">
<lib dir="${lib.dir}" />
<classes dir="${build.dir}/classes" />
<fileset dir="${WebContent.dir}">
<include name="***.*" />
</fileset>
</war>
<echo message="end war..." />
</target>
<!-- copy war包 tomcat的deploy目录 -->
<target name="deploy" depends="war" description="部署项目">
<echo message="begin deploy..." />
<copy file="${dist.dir}/${webapp.name}.war" todir="${catalina.home}/webapps" />
<echo message="end deploy..." />
</target>
</project>
\ No newline at end of file
......@@ -95,7 +95,7 @@ female.user.default.avatar=/images/user/avatar/female_avatar.png
# \u7537\u751F\u5934\u50CF
male.user.default.avatar=/images/user/avatar/male_avatar.png
foc.api.url=http://123.56.146.7/
foc.api.url=http://localhost:8080/
foc.sound.records.url=http://218.241.234.135:8080/ab/jsonData/cdrDataPage
......
#MySQL Database Config(The All Config Is Must)
db.table.prefix=foc_
jdbc.type=mysql
jdbc.driver.class=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://106.75.97.50:3306/jd_foc?useUnicode=true&characterEncoding=utf-8
jdbc.username=focuser
jdbc.password=FOC@2016
#\u521d\u59cb\u5316\u8fde\u63a5
jdbc.url=jdbc:mysql://106.75.105.96:5508/jd_foc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull
jdbc.username=sms_develop
jdbc.password=Develop2018!@#
#\u521d\u59cb\u5316\u8fde\u63a5
jdbc.initialSize=0
#\u8fde\u63a5\u6c60\u7684\u6700\u5927\u6d3b\u52a8\u4e2a\u6570
jdbc.maxActive=20
......
# Output pattern : date [thread] priority category - message FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7
log4j.rootLogger=DEBUG, Console, RollingFile
log4j.rootLogger=Console, RollingFile
#Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
......@@ -26,7 +26,7 @@ log4j.appender.RollingFile.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
#Project defalult level
#log4j.logger.org.activiti.engine.impl.persistence=DEBUG
#log4j.logger.org.apache.shiro=DEBUG
log4j.loggercom.ejweb=DEBUG
log4j.loggercom.ejweb=Console
log4j.loggercom.ejweb.core.security.shiro=WARN
log4j.loggercom.ejweb.core.utils.JedisUtils=WARN
log4j.loggercom.ejweb.modules.sys.web.LoginController=WARN
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ejweb.modules.airline.dao.VerifyDepartAddDao" >
<select id="findUserDeparList" resultType="com.ejweb.modules.depart.entity.UserDepartEntity">
SELECT
a.id,
a.is_verif,
a.is_risk,
a.depart_name
FROM foc_user_depart a
WHERE a.del_flag = '0'
</select>
<insert id="addUserDepartType" parameterType="com.ejweb.modules.depart.entity.AddDepartTypeDto">
insert into foc_user_depart_type(depart_id,type)
values
<foreach collection="dto.departIds" item="emp" separator=",">
(#{emp},#{dto.type})
</foreach>
</insert>
<delete id="deleteUserDepartType" parameterType="com.ejweb.modules.depart.entity.AddDepartTypeDto">
DELETE from foc_user_depart_type WHERE type=#{type}
</delete>
<select id="getDictAll" resultType="com.ejweb.modules.depart.entity.UserDictEntity">
SELECT
f.id,
f.value as valueType,
f.label
FROM `sys_dict` f
WHERE f.type = 'vrf_verify_type'
and f.del_flag = '0'
</select>
<select id="getUserDictAll" resultType="com.ejweb.modules.depart.entity.UserDictEntity">
SELECT
f.id,
f.VALUE AS valueType,
f.label
FROM
`sys_dict` f
INNER JOIN foc_user_depart_type fu ON fu.type = f.`value`
WHERE
f.type = 'vrf_verify_type'
AND f.del_flag = '0'
GROUP BY
fu.type
</select>
<select id="getUserDepartType" resultType="com.ejweb.modules.depart.entity.UserDepartTypeEntity">
SELECT
f.id,
fu.depart_name,
f.depart_id
FROM `foc_user_depart_type` f
INNER JOIN foc_user_depart fu on f.depart_id = fu.id AND fu.del_flag='0'
WHERE f.del_flag = '0'
<if test="valueType != null and valueType !=''">
AND f.type=#{valueType}
</if>
</select>
<update id="deleteUserDepart">
UPDATE foc_user_depart_type SET del_flag='1' where type = #{type}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ejweb.modules.airline.dao.VerifyUpdateUserDao">
<sql id="verifylist">
a.id,
a.apply_no,
a.verif_no,
a.verif_type,
a.roundtrip_type,
a.priority,
a.source,
a.aircraft_type,
case when verif_type='01' or verif_type='02' or verif_type='03' or verif_type='04' or verif_type='05'
then t.flight_no
else a.flight_no end flightNo,
a.route_no,
a.expiry_date,
t.depIata AS "areaSt.airportIata",
t.arrIata AS "areaAr.airportIata",
case when verif_type='01' or verif_type='02' or verif_type='03' or verif_type='04' or verif_type='05'
then p.city_name
else
u.airport_name end "areaSt.cityName",
r.city_name AS "areaAr.cityName",
a.aircraft_type AS "aircraft.id",
q.type_name AS "aircraft.typeName",
a.id AS "sailingfile.verifId",
s.id AS "sailingfile.id",
t.id AS "connect.id",
t.verif_id AS "connect.verifId",
t.Is_main AS "connect.IsMain"
</sql>
<sql id="verifyColumn">
a.id ,
a.apply_no,
a.verif_no,
a.verif_type,
a.roundtrip_type,
a.priority,
a.aircraft_type,
a.flight_no,
a.source,
a.route_no,
a.expiry_date,
a.depIata AS "areaSt.airportIata",
a.arrIata AS "areaAr.airportIata"
</sql>
<sql id="verifyJoins">
LEFT JOIN foc_airline_connect t ON t.verif_id=a.id
LEFT JOIN foc_airports p ON p.airport_iata = t.depIata
LEFT JOIN foc_airports r ON r.airport_iata = t.arrIata
LEFT JOIN foc_aircraft_type q ON q.id = a.aircraft_type
LEFT JOIN foc_sailing_file s ON s.verif_id=a.id
LEFT JOIN foc_airports u ON u.airport_iata = a.depIata
</sql>
<select id="get" resultType="com.ejweb.modules.airline.entity.VerifyEntity">
SELECT
<include refid="verifylist"/>
FROM foc_airline_verify a
<include refid="verifyJoins"/>
WHERE a.id = #{id}
</select>
<select id="get2" resultType="com.ejweb.modules.airline.entity.VerifyEntity">
SELECT
a.id,
a.apply_no,
a.verif_no,
a.verif_type,
a.roundtrip_type,
a.priority,
a.aircraft_type,
a.flight_no AS flightNo,
a.route_no,
a.source,
a.expiry_date,
a.depIata AS "areaSt.airportIata",
a.arrIata AS "areaAr.airportIata",
u.airport_name AS "areaSt.cityName",
a.aircraft_type AS "aircraft.id",
q.type_name AS "aircraft.typeName",
a.id AS "sailingfile.verifId",
s.id AS "sailingfile.id"
FROM foc_airline_verify a
LEFT JOIN foc_airports p ON p.airport_iata = a.depIata
LEFT JOIN foc_airports r ON r.airport_iata = a.arrIata
LEFT JOIN foc_aircraft_type q ON q.id = a.aircraft_type
LEFT JOIN foc_sailing_file s ON s.verif_id=a.id
LEFT JOIN foc_airports u ON u.airport_iata = a.depIata
WHERE a.id = #{id}
</select>
<select id="findAllList" resultType="com.ejweb.modules.airline.entity.VerifyUpdateUserEntity">
SELECT a.verif_no as verifNo,
a.id as verifId,
a.source,
CASE WHEN a.verif_type='01' OR a.verif_type='02'
OR a.verif_type='03' OR a.verif_type='04' OR a.verif_type='05'
THEN b.id
ELSE a.id END id,
CASE WHEN a.verif_type='01' OR a.verif_type='02'
OR a.verif_type='03' OR a.verif_type='04' OR a.verif_type='05'
THEN b.flight_no
ELSE a.flight_no
END flightNo,
a.route_no AS routeNo,
a.aircraft_type,
fu.update_user as operateUser,
fu.update_time as operateTime,
fu.original_id,
fu.reason,
b.depIata,
b.arrIata,
DATE_FORMAT(cc.update_date, '%Y-%m-%d') AS startTime,
CASE WHEN a.verif_type='01' OR a.verif_type='02'
OR a.verif_type='03' OR a.verif_type='04' OR a.verif_type='05' OR a.verif_type='09'
THEN p.city_name
ELSE tt.airport_name
END depIataName,
CASE WHEN a.verif_type='01' OR a.verif_type='02'
OR a.verif_type='03' OR a.verif_type='04' OR (a.verif_type='05' AND a.roundtrip_type!='01') OR a.verif_type='09'
THEN CONCAT(p.city_name,b.depIata,'=',r.city_name,b.arrIata)
WHEN a.verif_type='05' AND a.roundtrip_type='01'
THEN CONCAT(p.city_name,b.depIata,'-',r.city_name,b.arrIata)
ELSE CONCAT(tt.airport_name,a.depIata)
END airline,
a.verif_type as verifType,
r.city_name AS arrIataName,
a.verifued_count AS verifuedCount,
a.depart_id as departId,
d.file_path as filePath,
c.type_name AS "aircraft.typeName",
a.state
from foc_airline_verify a
left JOIN foc_airline_connect b on a.id = b.verif_id AND b.Is_main!='0'
LEFT JOIN foc_aircraft_type c on a.aircraft_type = c.id
LEFT JOIN foc_sailing_file d on a.id = d.verif_id
LEFT JOIN foc_airports p ON p.airport_iata = b.depIata
LEFT JOIN foc_sailing_command cc ON a.id = cc.verif_id
LEFT JOIN foc_airports r ON r.airport_iata = b.arrIata
LEFT JOIN foc_airports tt ON tt.airport_iata = a.depIata
INNER JOIN foc_airline_verify_update fu on a.id = fu.verify_id AND fu.del_flag=0
where a.del_flag = 0
<if test="verifNo!= null and verifNo!=''">
AND a.verif_no LIKE CONCAT('%', #{verifNo}, '%')
</if>
<if test="verifType!= null and verifType!=''">
AND a.verif_type=#{verifType}
</if>
<if test="operateUser!= null and operateUser!=''">
AND fu.update_user LIKE CONCAT('%',#{operateUser}, '%')
</if>
AND (a.verif_status='02' or a.verif_status='00')
<if test="areaSt!= null and areaSt.airportIata!=''">
AND (b.verif_id in (
SELECT id FROM foc_airline_verify where depIata = #{areaSt.airportIata} )
OR a.id IN
(SELECT verif_id FROM foc_airline_connect WHERE depIata = #{areaSt.airportIata} AND is_main != '0')
)
</if>
<if test="areaAr!= null and areaAr.airportIata!=''">
<!-- AND b.arrIata=#{areaAr.airportIata} -->
AND (b.verif_id in
( SELECT id FROM foc_airline_verify where arrIata = #{areaAr.airportIata} ) OR a.id IN
(SELECT verif_id FROM foc_airline_connect WHERE arrIata = #{areaAr.airportIata} AND is_main != '0')
)
</if>
order by fu.update_time DESC
/* ORDER BY a.route_no DESC*/
</select>
<select id="getDay" resultType="Integer">
SELECT
TIMESTAMPDIFF(
DAY,
ata_chn,
CURRENT_TIMESTAMP
)
FROM
foc_flight_dynamics
where dep_stn=#{depIata} and arr_stn=#{arrIata}
and ac_long_no in (SELECT flight_no FROM foc_ac_type s LEFT JOIN foc_airline_verify2type t ON s.type_id=t.type_id
where verif_id=#{verifId})
ORDER BY ata_chn DESC
LIMIT 1
</select>
<insert id="addUpdateUser">
INSERT INTO foc_airline_verify_update(
verify_id,
update_user,
reason,
original_id
) VALUES (
#{vue.id},
#{vue.operateUser},
#{vue.reason},
#{vue.originalId}
)
</insert>
</mapper>
\ No newline at end of file
......@@ -35,9 +35,15 @@
SELECT
<include refid="airportColumns"/>
FROM foc_airports a
WHERE a.airport_iata = #{airportIata} AND a.status != #{STATUS_DELETE}
WHERE a.airport_iata = #{airportIata}
</select>
<select id="getAirportByAirportName" resultType="integer">
SELECT
count(1)
FROM foc_airports a
WHERE a.airport_name = #{airportName} AND a.status = #{STATUS_SHOW}
</select>
<!-- 分页查询机场信息 -->
<select id="findList" resultType="com.ejweb.modules.contact.entity.AirportEntity">
SELECT
......
......@@ -37,7 +37,7 @@
<!-- 设置但JDBC类型为空时,某些驱动程序 要指定值,default:OTHER,插入空值时不需要指定类型 -->
<setting name="jdbcTypeForNull" value="NULL"/>
<setting name="logImpl" value="STDOUT_LOGGING" />
<!-- <setting name="logImpl" value="STDOUT_LOGGING" />-->
</settings>
......
......@@ -154,6 +154,6 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
// }
// System.out.println(DES3Utils.encrypt("jdbc:mysql://10.70.78.27:3306/foc?useUnicode=true&characterEncoding=utf-8", CONF_DESC_KEY));
System.out.println(DES3Utils.decrypt("7aaee3bf1b522eee9c5cade1a71670f3aed546d27bf021874da7580fa9df6021c87eaddeb9b9a6eb200842455cb776b4347eb35b6c4fb07af249a322047538d40a3047091eb83489e3f02dd6c57c44d6", CONF_DESC_KEY));
System.out.println(DES3Utils.decrypt("31a63fac8317458d81c034906825749f7c58c30a773c6927", CONF_DESC_KEY));
}
}
package com.ejweb.modules.airline.dao;
import java.util.List;
import com.ejweb.core.persistence.CrudDao;
import com.ejweb.modules.airline.entity.VerifyEntity;
import java.util.List;
public interface VerifyDao extends CrudDao<VerifyEntity>{
public VerifyEntity getverifyByVerifNo(VerifyEntity verifyEntity);
public List<VerifyEntity> findValidator(VerifyEntity verifyEntity);
public List<VerifyEntity> findverifNo(VerifyEntity verifyEntity);
public VerifyEntity getConnect(VerifyEntity verifyEntity);
public VerifyEntity getVerify(String id);
public VerifyEntity get2(String id);
......
package com.ejweb.modules.airline.dao;
import com.ejweb.modules.depart.entity.AddDepartTypeDto;
import com.ejweb.modules.depart.entity.UserDepartEntity;
import com.ejweb.modules.depart.entity.UserDepartTypeEntity;
import com.ejweb.modules.depart.entity.UserDictEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
* 论证部门Dao
* @author zhanglg
* @version 2016-08-24
*/
public interface VerifyDepartAddDao{
/**
*根据论证类type型查询 包含多少部门
* @param valueType
* @return
*/
public List<UserDepartTypeEntity> getUserDepartType(@Param("valueType")String valueType);
/**
* 查询已选所有论证类型
* @return
*/
public List<UserDictEntity> getUserDictAll();
public List<UserDictEntity> getDictAll();
/**
* 查询所有部门信息
* @return
*/
public List<UserDepartEntity> findUserDeparList();
/**
* 添加部门和类型关联信息
* @param addDepartTypeDto
* @return
*/
public Integer addUserDepartType(@Param("dto") AddDepartTypeDto addDepartTypeDto);
public Integer deleteUserDepartType(@Param("type") String type);
public void deleteUserDepart(@Param("type") String type);
}
\ No newline at end of file
package com.ejweb.modules.airline.dao;
import com.ejweb.core.persistence.CrudDao;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.airline.entity.VerifyUpdateUserEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface VerifyUpdateUserDao extends CrudDao<VerifyUpdateUserEntity>{
public List<VerifyUpdateUserEntity> findAllList(VerifyUpdateUserEntity verifyUpdateUserEntity);
public VerifyEntity get2(String id);
public Integer getDay(VerifyUpdateUserEntity verifyUpdateUserEntity);
public Integer addUpdateUser(@Param(value = "vue") VerifyUpdateUserEntity verifyUpdateUserEntity);
}
package com.ejweb.modules.airline.entity;
import java.util.Date;
import javax.validation.constraints.NotNull;
import com.ejweb.core.persistence.DataEntity;
import com.ejweb.core.utils.excel.annotation.ExcelField;
import com.ejweb.core.utils.excel.fieldtype.AircraftType;
import com.ejweb.modules.aircraft.entity.AircraftEntity;
import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.depart.entity.DepartEntity;
//import com.ejweb.modules.sys.entity.Area;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import java.util.Date;
//import com.ejweb.modules.sys.entity.Area;
/**
*
* Verify Entity
......@@ -38,8 +36,10 @@ public class VerifyEntity extends DataEntity<VerifyEntity> implements Cloneable{
@NotNull(message="论证单号不能为空")
@ExcelField(title="论证单号", type=0, align=3, sort=11)
private String verifNo;
private String operateUser;
private String reason;
@NotNull(message="论证类型不能为空")
@ExcelField(title="论证类型", type=0, align=2, sort=12, dictType="vrf_verify_type")
@ExcelField(title="论证类型", type=0, align=2, sort=12, dictType="vrf_verify_type")
private String verifType;
@NotNull(message="机型不能为空")
@ExcelField(title="机型", type=0, align=3, sort=13, fieldType=AircraftType.class)
......@@ -92,16 +92,26 @@ public class VerifyEntity extends DataEntity<VerifyEntity> implements Cloneable{
private String depIata;
private String arrIata;
private Date sailingDate;
public String getOperateUser() {
return operateUser;
}
private String process;
public void setOperateUser(String operateUser) {
this.operateUser = operateUser;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason.trim();
}
private Date sailingDate;
private String process;
private String airline;
private SailingFileEntity sailingfile;
......
package com.ejweb.modules.airline.service;
import com.ejweb.core.service.CrudService;
import com.ejweb.modules.airline.dao.VerifyDao;
import com.ejweb.modules.airline.dao.VerifyDepartAddDao;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.depart.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* Verify Service
*
* @author zhanglg
* @version 2016-8-23
*/
@Service
@Transactional(readOnly = true)
public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> {
@Autowired
private VerifyDepartAddDao verifyDepartAddDao;
//查询所有的类型对应的部门
public List<UserDictDepartEntity> findUserDeparDictAllList() {
List<UserDictEntity> userDictAll = verifyDepartAddDao.getUserDictAll();
List<UserDictDepartEntity> dictlist = new ArrayList<>();
Integer i = 1;
for (UserDictEntity ud : userDictAll) {
String valueType = ud.getValueType();
List<UserDepartTypeEntity> userDepartType = verifyDepartAddDao.getUserDepartType(valueType);
UserDictDepartEntity userDictEntity = new UserDictDepartEntity();
userDictEntity.setSort(i);
userDictEntity.setLabel(ud.getLabel());
userDictEntity.setValueType(ud.getValueType());
userDictEntity.setdList(userDepartType);
dictlist.add(userDictEntity);
i++;
}
return dictlist;
}
public List<UserDepartEntity> findAllList(UserDepartEntity userDepartEntity) {
//查询所有的部门
List<UserDepartEntity> allList = verifyDepartAddDao.findUserDeparList();
// 根据类型type值查询对应的部门信息
String type = userDepartEntity.getType();
List<UserDepartTypeEntity> byList = null;
if (type != null) {
byList = verifyDepartAddDao.getUserDepartType(type);
}
if (byList != null) {
for (UserDepartEntity udAll : allList) {
for (UserDepartTypeEntity udBy : byList) {
if (udAll.getId() == udBy.getDepartId() || udAll.getId().equals(udBy.getDepartId())) {
udAll.setCheck(true);
}
}
}
}
return allList;
}
public String addUserDepartType(UserDepartNoCheckVo userDepartEntity) {
AddDepartTypeDto addDepartTypeDto = new AddDepartTypeDto();
String type = userDepartEntity.getType();
String list = userDepartEntity.getList();
/* if (list == null || list == " ") {
verifyDepartAddDao.addUserDepartType(addDepartTypeDto);
return "1";
}*/
String[] split = list.split(" ");
List<String> departIdList = new ArrayList<>();
for (String sp : split) {
departIdList.add(sp);
}
addDepartTypeDto.setType(type);
addDepartTypeDto.setDepartIds(departIdList);
if (type != null && type != "") {
List<UserDepartTypeEntity> byList = verifyDepartAddDao.getUserDepartType(type);
// 不为空先删除在添加
if (byList != null) {
verifyDepartAddDao.deleteUserDepartType(type);
}
verifyDepartAddDao.addUserDepartType(addDepartTypeDto);
}
return "1";
}
public List<UserDictEntity> getDictAll() {
List<UserDictEntity> userDictAll = verifyDepartAddDao.getDictAll();
return userDictAll;
}
public String deleteUserDepart(String type) {
verifyDepartAddDao.deleteUserDepartType(type);
return "";
}
}
package com.ejweb.modules.airline.service;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ejweb.core.persistence.Page;
import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.airline.dao.ConnectDao;
import com.ejweb.modules.airline.dao.VerifyDao;
import com.ejweb.modules.airline.dao.VerifyUpdateUserDao;
import com.ejweb.modules.airline.entity.ConnectEntity;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.airline.entity.VerifyUpdateUserEntity;
import com.ejweb.modules.contact.dao.UserProfileDao;
import com.ejweb.modules.contact.entity.UserProfileEntity;
import com.ejweb.modules.depart.entity.DepartEntity;
import com.ejweb.modules.sys.utils.UserUtils;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Verify Service
......@@ -36,6 +37,8 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
private ConnectDao connectDao;
@Autowired
private UserProfileDao userProfileDao;
@Autowired
private VerifyUpdateUserDao verifyUpdateUserDao;
public VerifyEntity get(String id) {
VerifyEntity verifyEntity = verifyDao.get2(id);
......@@ -119,7 +122,24 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
}
@Transactional(readOnly = false)
public void save(VerifyEntity verifyEntity) {
public String saveVerify(VerifyEntity verifyEntity) {
String verifNo = verifyEntity.getVerifNo();
if (null!=verifNo&& ""!=verifNo){
List<VerifyEntity> validator = verifyDao.findverifNo(verifyEntity);
if (validator.size()!=0){
return "1";
}
}
VerifyUpdateUserEntity vue=new VerifyUpdateUserEntity();
VerifyEntity verifyDao2 = verifyDao.get2(verifyEntity.getId());
if (verifyDao2!=null){
vue.setId(verifyEntity.getId());
vue.setOperateUser(verifyEntity.getOperateUser());
vue.setReason(verifyEntity.getReason());
vue.setOriginalId(verifyDao2.getVerifNo());
verifyUpdateUserDao.addUpdateUser(vue);
}
if (StringUtils.isBlank(verifyEntity.getId())) {
verifyEntity.preInsert(); // 生成id
UserProfileEntity user = new UserProfileEntity();
......@@ -129,11 +149,13 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
DepartEntity depart = new DepartEntity();
depart.setId(departId);
verifyEntity.setDepart(depart);
//校验论证单号是否重复
verifyDao.insert(verifyEntity);
// 如果不是航线则结束
if ("06".equals(verifyEntity.getVerifType()) || "07".equals(verifyEntity.getVerifType())
|| "08".equals(verifyEntity.getVerifType())) {
return;
return"";
}
ConnectEntity connect = new ConnectEntity();
connect.preInsert(); // 生成id
......@@ -163,11 +185,11 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
verif.setExpiryDate(verifyEntity.getExpiryDate());
verif.setAircraft(verifyEntity.getAircraft());
if ("06".equals(verifyEntity.getVerifType()) || "07".equals(verifyEntity.getVerifType())
|| "08".equals(verifyEntity.getVerifType())) {
|| "08".equals(verifyEntity.getVerifType()) || "09".equals(verifyEntity.getVerifType())) {
verif.setAreaSt(verifyEntity.getAreaSt());
verif.setFlightNo(verifyEntity.getFlightNo());
verifyDao.update(verifyEntity);
return;
return"";
}
// 判断是否主数据
else if ("1".equals(verifyEntity.getConnect().getIsMain())) {
......@@ -184,9 +206,11 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
connect.setFlightNo(verifyEntity.getFlightNo());
connectDao.update(verifyEntity.getConnect());
}
return"";
}
public List<VerifyEntity> CheckValidator(VerifyEntity verifyEntity) {
return verifyDao.findValidator(verifyEntity);
}
......
package com.ejweb.modules.airline.service;
import com.ejweb.core.persistence.Page;
import com.ejweb.core.service.CrudService;
import com.ejweb.modules.airline.dao.VerifyUpdateUserDao;
import com.ejweb.modules.airline.entity.VerifyUpdateUserEntity;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Verify Service
*
* @author zhanglg
* @version 2016-8-23
*/
@Service
@Transactional(readOnly = true)
public class VerifyUpdateUserService extends CrudService<VerifyUpdateUserDao, VerifyUpdateUserEntity> {
@Autowired
private VerifyUpdateUserDao verifyDao;
/* @Autowired
private ConnectDao connectDao;
@Autowired
private UserProfileDao userProfileDao;*/
/* public VerifyEntity get(String id) {
VerifyEntity verifyEntity = verifyDao.get2(id);
return verifyEntity;
}*/
public Page<VerifyUpdateUserEntity> findList(Page<VerifyUpdateUserEntity> page, VerifyUpdateUserEntity verifyEntity) {
verifyEntity.setPage(page);
PageHelper.startPage(page.getPageNo(), page.getPageSize());
List<VerifyUpdateUserEntity> list = verifyDao.findAllList(verifyEntity);
for (VerifyUpdateUserEntity entity : list) {
if ("06".equals(entity.getVerifType()) || "07".equals(entity.getVerifType())
|| "08".equals(entity.getVerifType())) {
entity.setExpiryDate("长期有效");
} else {
Integer day = verifyDao.getDay(entity);
if (day != null) {
if (day <= 0) day = 0;
day = 90 - day;
if (day < 0) {
entity.setExpiryDate("0");
entity.setStatus("失效");
} else {
entity.setExpiryDate(day + "");
entity.setStatus("有效");
}
}
}
}
page.setList(list);
return page;
}
/* public boolean isNumeric(String str) {
Pattern pattern = Pattern.compile("[0-9]*");
Matcher isNum = pattern.matcher(str);
if (!isNum.matches()) {
return false;
}
return true;
}*/
}
package com.ejweb.modules.airline.web;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.aircraft.entity.AircraftEntity;
import com.ejweb.modules.aircraft.service.AircraftService;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.airline.service.VerifyService;
import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.contact.service.AirportService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -14,14 +17,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.aircraft.entity.AircraftEntity;
import com.ejweb.modules.aircraft.service.AircraftService;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.airline.service.VerifyService;
import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.contact.service.AirportService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -72,7 +70,11 @@ public class ConnectController extends BaseController {
if (!beanValidator(model, verifyEntity)){
return form(verifyEntity, model);
}
verifyService.save(verifyEntity);
String s = verifyService.saveVerify(verifyEntity);
if (s=="1"){
addMessage(redirectAttributes, "论证单号重复");
return "redirect:" + adminPath + "/airline/verify/list?repage";
}
addMessage(redirectAttributes, "保存成功");
return "redirect:" + adminPath + "/airline/verify/list?repage";
}
......
package com.ejweb.modules.airline.web;
import com.ejweb.core.base.BaseController;
import com.ejweb.modules.airline.service.VerifyAddService;
import com.ejweb.modules.depart.entity.UserDepartNoCheckVo;
import com.ejweb.modules.depart.entity.UserDepartEntity;
import com.ejweb.modules.depart.entity.UserDictDepartEntity;
import com.ejweb.modules.depart.entity.UserDictEntity;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import java.util.List;
/**
* Verify Controller
*
* @author zhanglg
* @version 1.0
* @team IT Team
* @time 2016年8月30日
*/
@Controller
@RequestMapping(value = "${adminPath}/airline/verifyAdd")
public class VerifyAddController extends BaseController {
private final Logger LOG = LoggerFactory.getLogger(VerifyAddController.class);
@Autowired
private VerifyAddService verifyService;
@RequiresPermissions("vrf:verify:view")
@RequestMapping(value = {"list", ""})
public String list( Model model) {
List<UserDictDepartEntity> dictlist = verifyService.findUserDeparDictAllList();
model.addAttribute("page", dictlist);
return "modules/airline/userDepart";
}
@RequiresPermissions("vrf:verify:view")
@RequestMapping(value = "form")
public String form(@ModelAttribute("userDepartEntity") UserDepartEntity userDepartEntity, Model model) {
if (!beanValidator(model, userDepartEntity)) {
return form(userDepartEntity, model);
}
List<UserDictEntity> dictList = verifyService.getDictAll();
model.addAttribute("dictList", dictList);
model.addAttribute("type", userDepartEntity.getType());
List<UserDepartEntity> allList = verifyService.findAllList(userDepartEntity);
model.addAttribute("allList",allList);
return "modules/airline/verifyUserForm";
}
/* @RequiresPermissions("vrf:verify:view")
@RequestMapping(value = "formOperate")
public String formUpdate(@ModelAttribute("userDepartEntity") UserDepartEntity userDepartEntity, Model model) {
if (!beanValidator(model, userDepartEntity)) {
return form(userDepartEntity, model);
}
model.addAttribute("type", userDepartEntity.getType());
List<UserDepartEntity> allList = verifyService.findAllList(userDepartEntity);
model.addAttribute("allList",allList);
return "modules/airline/verifyUserForm";
}*/
@RequiresPermissions("vrf:verify:edit")
@RequestMapping(value = "add")
public String addUserDepartType(UserDepartNoCheckVo userDepartNoCheckVo, Model model, RedirectAttributes redirectAttributes) {
UserDepartEntity userDepartEntity =new UserDepartEntity();
if (!beanValidator(model, userDepartNoCheckVo)) {
return form(userDepartEntity, model);
}
String type = userDepartNoCheckVo.getType();
String list = userDepartNoCheckVo.getList();
if (type == null|| type.equals("")) {
addMessage(redirectAttributes, "未选择类型");
return "redirect:" + adminPath + "/airline/verifyAdd/list?repage";
}else if(list == null || list.equals("")){
addMessage(redirectAttributes, "未选择部门");
return "redirect:" + adminPath + "/airline/verifyAdd/list?repage";
}
String s = verifyService.addUserDepartType(userDepartNoCheckVo);
addMessage(redirectAttributes, "操作成功");
return "redirect:" + adminPath + "/airline/verifyAdd/list?repage";
}
@RequiresPermissions("vrf:verify:view")
@RequestMapping(value = "delete")
public String deleteUserDepart(String valueType,Model model) {
verifyService.deleteUserDepart(valueType);
return "redirect:" + adminPath + "/airline/verifyAdd/list?repage";
}
}
package com.ejweb.modules.airline.web;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.persistence.Page;
import com.ejweb.core.utils.DateUtils;
......@@ -30,10 +11,25 @@ import com.ejweb.modules.aircraft.entity.AircraftEntity;
import com.ejweb.modules.aircraft.service.AircraftService;
import com.ejweb.modules.airline.entity.ConnectEntity;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.airline.entity.VerifyError;
import com.ejweb.modules.airline.service.VerifyService;
import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.contact.service.AirportService;
import com.ejweb.modules.airline.entity.VerifyError;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -48,6 +44,7 @@ import com.ejweb.modules.airline.entity.VerifyError;
@Controller
@RequestMapping(value = "${adminPath}/airline/verify")
public class VerifyController extends BaseController {
private final Logger LOG = LoggerFactory.getLogger(VerifyController.class);
@Autowired
private VerifyService verifyService;
......@@ -58,11 +55,17 @@ public class VerifyController extends BaseController {
@ModelAttribute
public VerifyEntity get(@RequestParam(required = false) String id) {
LOG.info("论证单ID:" + id);
VerifyEntity verifyEntity = null;
if (StringUtils.isNotBlank(id)) {
return verifyService.get(id);
} else {
return new VerifyEntity();
verifyEntity = verifyService.get(id);
LOG.info(verifyEntity.getVerifNo());
}
if (verifyEntity == null) {
LOG.info("未获取到相关论证数据");
verifyEntity = new VerifyEntity();
}
return verifyEntity;
}
@RequiresPermissions("vrf:verify:view")
......@@ -103,7 +106,11 @@ public class VerifyController extends BaseController {
if (!beanValidator(model, verifyEntity)) {
return form(verifyEntity, model);
}
verifyService.save(verifyEntity);
String s = verifyService.saveVerify(verifyEntity);
if (s=="1"){
addMessage(redirectAttributes, "论证单号重复");
return "redirect:" + adminPath + "/airline/verify/list?repage";
}
addMessage(redirectAttributes, "保存成功");
return "redirect:" + adminPath + "/airline/verify/list?repage";
}
......
package com.ejweb.modules.airline.web;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.persistence.Page;
import com.ejweb.modules.aircraft.service.AircraftService;
import com.ejweb.modules.airline.entity.VerifyEntity;
import com.ejweb.modules.airline.entity.VerifyError;
import com.ejweb.modules.airline.entity.VerifyUpdateUserEntity;
import com.ejweb.modules.airline.service.VerifyUpdateUserService;
import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.contact.service.AirportService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Verify Controller
*
* @author zhanglg
* @version 1.0
* @team IT Team
* @time 2016年8月30日
*/
@Controller
@RequestMapping(value = "${adminPath}/airline/verifyUpdateUser")
public class VerifyUpdateUserController extends BaseController {
private final Logger LOG = LoggerFactory.getLogger(VerifyUpdateUserController.class);
@Autowired
private VerifyUpdateUserService verifyService;
@Autowired
private AircraftService aircraftService;
@Autowired
private AirportService airportService;
/* @ModelAttribute
public VerifyEntity get(@RequestParam(required = false) String id) {
LOG.info("论证单ID:" + id);
VerifyEntity verifyEntity = null;
if (StringUtils.isNotBlank(id)) {
verifyEntity = verifyService.get(id);
LOG.info(verifyEntity.getVerifNo());
}
if (verifyEntity == null) {
LOG.info("未获取到相关论证数据");
verifyEntity = new VerifyEntity();
}
return verifyEntity;
}*/
@RequiresPermissions("vrf:verify:view")
@RequestMapping(value = {"list", ""})
public String list(VerifyUpdateUserEntity verifyUpdateUserEntity, HttpServletRequest request, HttpServletResponse response,
Model model, String message) {
if (message != null) {
model.addAttribute("message", message);
}
verifyUpdateUserEntity.setVerifStatus("02");
Page<VerifyUpdateUserEntity> page = verifyService.findList(new Page<VerifyUpdateUserEntity>(request, response), verifyUpdateUserEntity);
model.addAttribute("page", page);
List<AirportEntity> airportData = airportService.findAllList(new AirportEntity());
model.addAttribute("airportList", airportData);
return "modules/airline/verifyUpdateUserList";
}
@RequiresPermissions("vrf:verify:view")
@RequestMapping(value = "error")
public String error(VerifyEntity verifyEntity, Model model, List<VerifyError> list) {
model.addAttribute("list", list);
return "modules/airline/verifyError";
}
}
......@@ -9,6 +9,7 @@ import com.ejweb.modules.contact.entity.AirportEntity;
/**
* 三字码
* Airport DAO接口
*
* @author yuxg
* @version 2016-08-19
*/
......@@ -16,6 +17,8 @@ import com.ejweb.modules.contact.entity.AirportEntity;
public interface AirportDao extends CrudDao<AirportEntity> {
AirportEntity getAirportByAirportIata(AirportEntity airportEntity);
Integer getAirportByAirportName(AirportEntity airportEntity);
List<AirportEntity> findAllAirport(AirportEntity entity);
}
package com.ejweb.modules.contact.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.SpringContextHolder;
import com.ejweb.modules.contact.dao.AirportDao;
import com.ejweb.modules.contact.entity.AirportEntity;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 三字码 Airport Service
......@@ -37,6 +35,13 @@ public class AirportService extends CrudService<AirportDao, AirportEntity> {
return airportDao.getAirportByAirportIata(airportEntity);
}
public Integer getAirportByAirportName(String airportName) {
AirportEntity airportEntity = new AirportEntity();
airportEntity.setAirportName(airportName);
Integer count = airportDao.getAirportByAirportName(airportEntity);
return count;
}
// 保存或更新
@Transactional(readOnly = false)
public void save1(AirportEntity entity) {
......@@ -108,5 +113,5 @@ public class AirportService extends CrudService<AirportDao, AirportEntity> {
public List<AirportEntity> getAllAirportsData(AirportEntity entity){
return dao.findAllAirport(entity);
}
}
package com.ejweb.modules.contact.web;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ejweb.core.base.BaseController;
import com.ejweb.core.persistence.Page;
import com.ejweb.core.utils.DateUtils;
......@@ -33,10 +12,25 @@ import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.contact.service.AirportService;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 通讯录模块下的三字码 Airport Controller
*
*
* @author yuxg
* @version 2016-8-19
*/
......@@ -56,9 +50,9 @@ public class AirportController extends BaseController {
}
}
@RequestMapping(value = { "airportList", "" })
@RequestMapping(value = {"airportList", ""})
public String airportList(AirportEntity airportEntity, HttpServletRequest request, HttpServletResponse response,
Model model) {
Model model) {
String arilist = request.getParameter("airportsList");
String airportsId = airportEntity.getAirportsId();
String airportsName = airportEntity.getAirportsName();
......@@ -76,11 +70,11 @@ public class AirportController extends BaseController {
arr.add(arilist);
}
}
if(StringUtils.isEmpty(airportsName)){
if (StringUtils.isEmpty(airportsName)) {
airportsName = "";
for(int i=0;i<arr.size();i++){
for (int i = 0; i < arr.size(); i++) {
AirportEntity entity = airportService.get(arr.get(i));
airportsName += entity.getAirportName()+"-";
airportsName += entity.getAirportName() + "-";
}
}
Page<AirportEntity> page = airportService.findPage(new Page<AirportEntity>(request, response), airportEntity);
......@@ -100,16 +94,16 @@ public class AirportController extends BaseController {
}
if (StringUtils.isNotEmpty(airportsId)) {
model.addAttribute("airportsId", airportsId);
model.addAttribute("airportsName", airportsName.substring(0, airportsName.length()-1));
model.addAttribute("airportsName", airportsName.substring(0, airportsName.length() - 1));
}
model.addAttribute("page", page);
return "modules/contact/airportSelect";
}
@RequiresPermissions("im:airport:view")
@RequestMapping(value = { "list", "" })
@RequestMapping(value = {"list", ""})
public String list(AirportEntity airportEntity, HttpServletRequest request, HttpServletResponse response,
Model model) {
Model model) {
Page<AirportEntity> page = airportService.findPage(new Page<AirportEntity>(request, response), airportEntity);
model.addAttribute("page", page);
return "modules/contact/airportList";
......@@ -124,7 +118,7 @@ public class AirportController extends BaseController {
@RequiresPermissions("im:airport:edit")
@RequestMapping(value = "save")
public String save(AirportEntity airportEntity, HttpServletRequest request, Model model,
RedirectAttributes redirectAttributes) {
RedirectAttributes redirectAttributes) {
if (!beanValidator(model, airportEntity)) {
return form(airportEntity, model);
}
......@@ -143,7 +137,7 @@ public class AirportController extends BaseController {
/**
* 验证是否已存在该三字码名称
*
*
* @param oldAirportIata
* @param airportIata
* @return
......@@ -159,6 +153,25 @@ public class AirportController extends BaseController {
return "false"; // 存在
}
/**
* 验证机场是否有正在使用三字码
*
* @param airportName
* @return
*/
@ResponseBody
@RequestMapping("checkAirportName")
public String checkAirportName(String airportName, String id) {
if (StringUtils.isEmpty(airportName) || StringUtils.isNotEmpty(id)) {
return "true";
}
Integer count = airportService.getAirportByAirportName(airportName);
if (count == 0) {
return "true";
}
return "false";
}
@ResponseBody
@RequestMapping("airportData")
public List<Map<String, Object>> airportData(AirportEntity airportEntity) {
......@@ -178,7 +191,7 @@ public class AirportController extends BaseController {
/**
* 批量导入三字码
*
*
* @param file
* @param redirectAttributes
* @return
......@@ -227,7 +240,7 @@ public class AirportController extends BaseController {
/**
* 导出三字码数据
*
*
* @param airportEntity
* @param redirectAttributes
* @return
......@@ -235,10 +248,12 @@ public class AirportController extends BaseController {
@RequiresPermissions("im:airport:edit")
@RequestMapping(value = "batchExport", method = RequestMethod.POST)
public String exportFile(AirportEntity airportEntity, HttpServletRequest request, HttpServletResponse response,
RedirectAttributes redirectAttributes) {
RedirectAttributes redirectAttributes) {
try {
String fileName = "三字码数据" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
Page<AirportEntity> page = airportService.findPage(new Page<AirportEntity>(request, response, -1),
// Page<AirportEntity> page = airportService.findPage(new Page<AirportEntity>(request, response, -1),
// airportEntity);
Page<AirportEntity> page = airportService.findPage(new Page<AirportEntity>(1, 1000000000),
airportEntity);
new ExportExcel("三字码数据", AirportEntity.class).setDataList(page.getList()).write(response, fileName)
.dispose();
......@@ -251,7 +266,7 @@ public class AirportController extends BaseController {
/**
* 下载导入三字码数据模板
*
*
* @param response
* @param redirectAttributes
* @return
......
......@@ -203,14 +203,15 @@ public class UserProfileController extends BaseController {
}
userProfileEntity = userProfileEntity2;
}
userProfileService.save(userProfileEntity,1);
userProfileService.save(userProfileEntity, 1);
String message = "保存成功";
//用户类型不为空,旧华为状态(更新前)不为空,更新后状态为绑定
if (StringUtils.isNotBlank(userProfileEntity.getUserType()) && !(oldHuaweiStatus == null && userProfileEntity.getHuaweiStatus() == 0) && !(oldHuaweiStatus != null && oldHuaweiStatus == 0 && userProfileEntity.getHuaweiStatus() == 0)
&& (userProfileEntity.getUserType().equals("2") || userProfileEntity.getUserType().equals("4"))) {
&& (userProfileEntity.getUserType().equals("2") || userProfileEntity.getUserType().equals("4"))) {
StringBuilder url = new StringBuilder(GConstants.getValue("foc.api.url", "")).append("api/huaweiUC/");
Map<String, String> params = new HashMap<String, String>();
params.put("content", "{\"lang\":\"CN\",\"platform\":\"pc\",\"ignoreMaxSipNum\":\"true\",\"deviceToken\":\"deviceToken\",\"appkey\":\"gdfshgfhdgdf\",\"appCode\":\"1001\",\"language\":\"zh_CN\",\"versionName\":\"1.0\",\"userCode\":\"" + (StringUtils.isBlank(userProfileEntity.getCreateBy().getId()) ? "123" : userProfileEntity.getCreateBy().getId()) + "\",\"appPhone\":0,\"" + (userProfileEntity.getHuaweiStatus() == 0 ? "userDelIds" : "userIds") + "\":['" + userProfileEntity.getId() + "']}");
params.put("content", "{\"lang\":\"CN\",\"platform\":\"pc\",\"ignoreMaxSipNum\":\"true\",\"deviceToken\":\"deviceToken\",\"appkey\":\"gdfshgfhdgdf\",\"appCode\":\"1001\",\"language\":\"zh_CN\",\"versionName\":\"1.0\",\"userCode\":\"" + (StringUtils.isBlank(userProfileEntity.getCreateBy().getId()) ? "123" : userProfileEntity.getCreateBy().getId()) + "\",\"appPhone\":0,\"" + (userProfileEntity.getHuaweiStatus() == 0 ? "userDelIds" : "userIds") + "\":['" + userProfileEntity.getId() + "']}");
String sign = GlobalUtil.getParamsSignStr(GConstants.SIGN_PRIVATE_KEY, params.get("content"));
params.put("sign", sign);
if (userProfileEntity.getHuaweiStatus() == 0) {
......
......@@ -4,13 +4,13 @@ import com.ejweb.core.persistence.CrudDao;
import com.ejweb.modules.depart.entity.DepartEntity;
/**
*
*
* 论证部门Dao
* @author zhanglg
* @version 2016-08-24
*/
public interface DepartDao extends CrudDao<DepartEntity>{
public DepartEntity getdepartByName(DepartEntity departEntity);
}
\ No newline at end of file
package com.ejweb.modules.depart.entity;
import com.ejweb.core.persistence.DataEntity;
import java.util.List;
/**
*
* 论证部门Entity
* @author zy
* @version 2019-12-19
*/
public class AddDepartTypeDto extends DataEntity<AddDepartTypeDto> {
private static final long serialVersionUID = 1L;
private String type;
private List<String> departIds;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public List<String> getDepartIds() {
return departIds;
}
public void setDepartIds(List<String> departIds) {
this.departIds = departIds;
}
}
\ No newline at end of file
package com.ejweb.modules.depart.entity;
import com.ejweb.core.persistence.DataEntity;
/**
*
* 论证部门Entity
* @author zy
* @version 2019-12-19
*/
public class UserDepartEntity extends DataEntity<UserDepartEntity> {
private static final long serialVersionUID = 1L;
private String id;
private String departName;
private String type;
private String list;
private Boolean check=false;
public Boolean getCheck() {
return check;
}
public void setCheck(Boolean check) {
this.check = check;
}
public String getList() {
return list;
}
public void setList(String list) {
this.list = list;
}
public String getDepartName() {
return departName;
}
public void setDepartName(String departName) {
this.departName = departName;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
\ No newline at end of file
package com.ejweb.modules.depart.entity;
import com.ejweb.core.persistence.DataEntity;
/**
*
* 论证部门Entity
* @author zy
* @version 2019-12-19
*/
public class UserDepartNoCheckVo extends DataEntity<UserDepartNoCheckVo> {
private static final long serialVersionUID = 1L;
private String id;
private String departName;
private String type;
private String list;
public String getList() {
return list;
}
public void setList(String list) {
this.list = list;
}
public String getDepartName() {
return departName;
}
public void setDepartName(String departName) {
this.departName = departName;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
\ No newline at end of file
package com.ejweb.modules.depart.entity;
import com.ejweb.core.persistence.DataEntity;
/**
*
* 论证部门Entity
* @author zy
* @version 2019-12-19
*/
public class UserDepartTypeEntity extends DataEntity<UserDepartTypeEntity> {
private static final long serialVersionUID = 1L;
private String id;
private String departName;
private String type;
private String departId;
public String getDepartId() {
return departId;
}
public void setDepartId(String departId) {
this.departId = departId;
}
public String getDepartName() {
return departName;
}
public void setDepartName(String departName) {
this.departName = departName;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
\ No newline at end of file
package com.ejweb.modules.depart.entity;
import com.ejweb.core.persistence.DataEntity;
import java.util.List;
/**
*
* 论证部门和论证类型Entity
* @author zy
* @version 2019-12-19
*/
public class UserDictDepartEntity extends DataEntity<UserDictDepartEntity> {
private static final long serialVersionUID = 1L;
private String id;
private String label;
private String valueType;
private Integer sort;
private List<UserDepartTypeEntity> dList;
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValueType() {
return valueType;
}
public void setValueType(String valueType) {
this.valueType = valueType;
}
public List<UserDepartTypeEntity> getdList() {
return dList;
}
public void setdList(List<UserDepartTypeEntity> dList) {
this.dList = dList;
}
}
\ No newline at end of file
package com.ejweb.modules.depart.entity;
import com.ejweb.core.persistence.DataEntity;
/**
*
* 论证部门Entity
* @author zy
* @version 2019-12-19
*/
public class UserDictEntity extends DataEntity<UserDictEntity> {
private static final long serialVersionUID = 1L;
private String id;
private String label;
private String valueType;
public static long getSerialVersionUID() {
return serialVersionUID;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getValueType() {
return valueType;
}
public void setValueType(String valueType) {
this.valueType = valueType;
}
}
\ No newline at end of file
......@@ -3,18 +3,6 @@
*/
package com.ejweb.modules.sys.service;
import java.net.URLEncoder;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.apache.log4j.Logger;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ejweb.core.conf.GConstants;
......@@ -25,11 +13,7 @@ import com.ejweb.core.security.Digests;
import com.ejweb.core.security.shiro.session.SessionDAO;
import com.ejweb.core.service.BaseService;
import com.ejweb.core.service.ServiceException;
import com.ejweb.core.utils.Util;
import com.ejweb.core.utils.CacheUtils;
import com.ejweb.core.utils.Encodes;
import com.ejweb.core.utils.IdWorker;
import com.ejweb.core.utils.StringUtils;
import com.ejweb.core.utils.*;
import com.ejweb.core.web.Servlets;
import com.ejweb.modules.sys.dao.MenuDao;
import com.ejweb.modules.sys.dao.RoleDao;
......@@ -43,6 +27,15 @@ import com.ejweb.modules.sys.utils.UserUtils;
import com.github.pagehelper.PageHelper;
import com.hnatourism.b2b.util.DESPlus;
import com.jdair.util.http.client.HTTPClientUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
/**
* 系统管理,安全相关实体的管理类,包括用户、角色、菜单.
......@@ -446,63 +439,74 @@ public class SystemService extends BaseService implements InitializingBean {
@Transactional(readOnly = false)
public boolean validateServerPassword(String loginName, String password) {
long startTime = System.nanoTime();// 开始计时时间
try {
if(GConstants.getBoolean("use.new.login.api", false)){// 使用新的登录地址,默认使用旧地址
boolean isSuccess = HTTPClientUtil.callLogin(loginName, password);// 进行秘密校验
long endTime = System.nanoTime();// 结束计时时间
long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword]["+isSuccess+"]总共用时:" + Util.getDurationTime(duration));
return isSuccess;
}
StringBuilder buf = new StringBuilder(GConstants.getValue("hn.api.base.url", "https://dsp.jdair.net"));
buf.append("/flightinterface/uss/json/hnauser/hnauserLoginWithInfo.json?");
buf.append(GConstants.getValue("hn.api.base.param", "ai.cc=7&ai.cp=10.68.26.52"));
buf.append("&loginId=");
buf.append(URLEncoder.encode(loginName, "UTF-8"));
buf.append("&password=");
buf.append(password);
LOG.debug("[UserService login][validateServerPassword][URL]:" + buf.toString());
HCFetcher fetcher = HCFetcher.getInstance();
FetchEntity entity = fetcher.get(buf.toString());
if (entity == null) {// 再次重新尝试获取内容
entity = fetcher.get(buf.toString());
}
if (entity != null) {
String text = entity.getContent("UTF-8");
LOG.debug("[UserService validateServerPassword][result]:" + text);
JSONObject response = JSON.parseObject(text);
if (response.get("result") == null) {
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration));
return false;
}
JSONObject result = response.getJSONObject("result");
if ("1000".equals(result.getString("resultCode"))) { // 远程服务器登陆成功,更改数据库密码
long startTime = System.nanoTime();
try {
// 使用新的登录地址,默认使用旧地址
if (GConstants.getBoolean("use.new.login.api", false)) {
// 进行秘密校验
boolean isSuccess = HTTPClientUtil.callLogin(loginName, password);
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.info("[UserService login][validateServerPassword][" + isSuccess + "]总共用时:" + Util.getDurationTime(duration));
return isSuccess;
}
StringBuilder buf = new StringBuilder(GConstants.getValue("hn.api.base.url", "https://dsp.jdair.net"));
buf.append("/flightinterface/uss/json/hnauser/hnauserLoginWithInfo.json?");
buf.append(GConstants.getValue("hn.api.base.param", "ai.cc=7&ai.cp=10.68.26.52"));
//用户名密码使用DESPlus中的加密方法加密后,再urlencode
com.jdair.util.security.DESPlus plus = new com.jdair.util.security.DESPlus();
String loginNamePlus = plus.encrypt(loginName);
String passwordPlus = plus.encrypt(password);
LOG.info("账号encrypt后;" + loginNamePlus);
LOG.info("密码encrypt后;" + passwordPlus);
LOG.info("[UserService login][validateServerPassword][URL]:" + buf.toString());
buf.append("&loginIdSecure=");
buf.append(URLEncoder.encode(loginNamePlus, "UTF-8"));
buf.append("&passwordSecure=");
buf.append(URLEncoder.encode(passwordPlus, "UTF-8"));
LOG.info("密码encode后;" + URLEncoder.encode(password, "UTF-8"));
LOG.info("[UserService login][validateServerPassword][URL]:" + buf.toString());
HCFetcher fetcher = HCFetcher.getInstance();
FetchEntity entity = fetcher.get(buf.toString());
// 再次重新尝试获取内容
if (entity == null) {
entity = fetcher.get(buf.toString());
}
if (entity != null) {
String text = entity.getContent("UTF-8");
LOG.info("[UserService validateServerPassword][result]:" + text);
JSONObject response = JSON.parseObject(text);
if (response.get("result") == null) {
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.info("[UserService login][validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration));
return false;
}
JSONObject result = response.getJSONObject("result");
// 远程服务器登陆成功,更改数据库密码
if ("1000".equals(result.getString("resultCode"))) {
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.info("[UserService login][validateServerPassword][SUCCESS]总共用时:" + Util.getDurationTime(duration));
return true;
}
}
} catch (Exception e) {
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword][SUCCESS]总共用时:" + Util.getDurationTime(duration));
return true;
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
// if (fetcher != null) {fetcher.shutdown();}
}
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.debug("[UserService validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration));
return false;
e.printStackTrace();
} finally {
// if (fetcher != null) {fetcher.shutdown();}
}
long endTime = System.nanoTime();
long duration = endTime - startTime;
LOG.info("[UserService validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration));
return false;
}
/**
* 获取Key加载信息
......
......@@ -264,16 +264,16 @@ public class RoleController extends BaseController {
* 验证角色英文名是否有效
*
* @param oldEnName
* @param enName
* @param enname
* @return
*/
@RequiresPermissions("user")
@ResponseBody
@RequestMapping(value = "checkEnname")
public String checkEnName(String oldEnName, String enName) {
if (enName != null && enName.equals(oldEnName)) {
public String checkEnName(String oldEnName, String enname) {
if (enname != null && enname.equals(oldEnName)) {
return "true";
} else if (enName != null && systemService.getRoleByEnname(enName) == null) {
} else if (enname != null && systemService.getRoleByEnname(enname) == null) {
return "true";
}
return "false";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment