Commit 544ec217 by zhangyu

部门

parent c05a7d58
...@@ -5,36 +5,6 @@ ...@@ -5,36 +5,6 @@
<script src="${ctxStatic}/jquery-form/jquery-form.js" type="text/javascript"></script> <script src="${ctxStatic}/jquery-form/jquery-form.js" type="text/javascript"></script>
<title>论证部门管理</title> <title>论证部门管理</title>
<meta name="decorator" content="default"/> <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/verifyAdd/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/verify/list?message=成功';
}
};
$("#file").click();
}
</script>
</head> </head>
<body> <body>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
...@@ -46,15 +16,23 @@ ...@@ -46,15 +16,23 @@
</ul> </ul>
<sys:message content="${message}"/> <sys:message content="${message}"/>
<div class="clearfix"></div> <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"> <table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead> <thead>
<tr> <tr>
<th>编号</th> <th>编号</th>
<th>论证类型</th> <th>论证类型</th>
<th>论证部门</th> <th>论证部门</th>
<shiro:hasPermission name="vrf:verify:edit"> <shiro:hasPermission name="vrf:verify:edit">
<th>操作</th> <th>操作</th>
</shiro:hasPermission></tr> </shiro:hasPermission>
</tr>
</thead> </thead>
<tbody> <tbody>
<c:forEach items="${page}" var="verify" varStatus="vs"> <c:forEach items="${page}" var="verify" varStatus="vs">
...@@ -70,19 +48,14 @@ ...@@ -70,19 +48,14 @@
</td> </td>
<shiro:hasPermission name="vrf:verify:view"> <shiro:hasPermission name="vrf:verify:view">
<td> <td>
<a href="${ctx}/airline/verifyAdd/form?type=${verify.valueType}&">添加</a> <a href="${ctx}/airline/verifyAdd/form?type=${verify.valueType}&">编辑</a>
<a href="${ctx}/airline/verifyAdd/form?id=${verify.valueType}&">编辑</a> <a href="${ctx}/airline/verifyAdd/delete?valueType=${verify.valueType}&" onclick="return confirmx('确认要删除吗?', this.href)">删除</a>
</td> </td>
</shiro:hasPermission> </shiro:hasPermission>
</tr> </tr>
</c:forEach> </c:forEach>
</tbody> </tbody>
</table> </table>
<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> </body>
......
...@@ -47,13 +47,24 @@ ...@@ -47,13 +47,24 @@
<form:input path="verifNo" htmlEscape="false" maxlength="50" class="required"/> <form:input path="verifNo" htmlEscape="false" maxlength="50" class="required"/>
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label">开航指令单号:</label> <label class="control-label">开航指令单号:</label>
<div class="controls"> <div class="controls">
<form:input path="routeNo" htmlEscape="false" maxlength="50" class="required"/> <form:input path="routeNo" htmlEscape="false" maxlength="50" class="required"/>
</div> </div>
</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:choose>
<c:when test="${verifyEntity.verifType eq '06' or verifyEntity.verifType eq '07' or verifyEntity.verifType eq '08'}"> <c:when test="${verifyEntity.verifType eq '06' or verifyEntity.verifType eq '07' or verifyEntity.verifType eq '08'}">
<div class="control-group"> <div class="control-group">
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
</div> </div>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/airline/verify/list">航线管理列表</a></li> <li class="active"><a href="${ctx}/airline/verify/list">航线管理列表</a></li>
<li><a href="${ctx}/airline/verifyUpdateUser">论证单号修改展示列表</a></li>
</ul> </ul>
<form:form id="searchForm" modelAttribute="verifyEntity" action="${ctx}/airline/verify/list" method="post" <form:form id="searchForm" modelAttribute="verifyEntity" action="${ctx}/airline/verify/list" method="post"
class="breadcrumb form-search "> class="breadcrumb form-search ">
......
...@@ -40,20 +40,38 @@ ...@@ -40,20 +40,38 @@
</head> </head>
<body> <body>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active">航线部门管理</li> <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> </ul>
<br/> <br/>
<form:form id="inputForm" modelAttribute="userDepartEntity" action="${ctx}/airline/verifyAdd/add" method="post" class="form-horizontal"> <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"/> <%-- <form:input path="type" htmlEscape="false" value="${type}" maxlength="50" class="required" style="display:none"/>--%>
<sys:message content="${message}"/> <sys:message content="${message}"/>
<c:forEach items="${allList}" var="depar" varStatus="ds"> <div class="control-group">
<input type="checkbox" name="check" value="${depar.id}" ${depar.check==true?'checked':""} /> <label class="control-label" style="width: 120px">选择论证类型</label>
${depar.departName} <div class="controls" style="width: 80%;margin-left: 140px">
</c:forEach> <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> </div>
<form:input path="list" htmlEscape="false" maxlength="50" id="list" style="display:none" /> <form:input path="list" htmlEscape="false" maxlength="50" id="list" style="display:none" />
<div class="form-actions"> <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" <shiro:hasPermission name="vrf:verify:edit"><input id="btnSubmit" class="btn btn-primary" type="submit"
value="保 存"/>&nbsp;</shiro:hasPermission> value="保 存"/>&nbsp;</shiro:hasPermission>
<a href="${ctx}/airline/verifyAdd"><input id="btnCancel" class="btn" type="button" value="返回"/></a> <a href="${ctx}/airline/verifyAdd"><input id="btnCancel" class="btn" type="button" value="返回"/></a>
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li><a href="${ctx}/depart/depart/list">论证部门管理</a></li> <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}/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/> </ul><br/>
<form:form id="inputForm" modelAttribute="departEntity" action="${ctx}/depart/depart/save" method="post" class="form-horizontal"> <form:form id="inputForm" modelAttribute="departEntity" action="${ctx}/depart/depart/save" method="post" class="form-horizontal">
......
...@@ -21,20 +21,8 @@ ...@@ -21,20 +21,8 @@
<delete id="deleteUserDepartType" parameterType="com.ejweb.modules.depart.entity.AddDepartTypeDto"> <delete id="deleteUserDepartType" parameterType="com.ejweb.modules.depart.entity.AddDepartTypeDto">
DELETE from foc_user_depart_type WHERE type=#{type} DELETE from foc_user_depart_type WHERE type=#{type}
</delete> </delete>
<!-- <select id="getUserDepartAll" resultType="com.ejweb.modules.depart.entity.UserDegetUserDepartTypepartEntity"> <select id="getDictAll" resultType="com.ejweb.modules.depart.entity.UserDictEntity">
SELECT SELECT
f.id,
fu.depart_name,
f.type
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="isVerif != null and isVerif !=''">
AND is_verif=#{isVerif}
</if>
</select>-->
<select id="getUserDictAll" resultType="com.ejweb.modules.depart.entity.UserDictEntity">
SELECT
f.id, f.id,
f.value as valueType, f.value as valueType,
f.label f.label
...@@ -42,6 +30,20 @@ ...@@ -42,6 +30,20 @@
WHERE f.type = 'vrf_verify_type' WHERE f.type = 'vrf_verify_type'
and f.del_flag = '0' and f.del_flag = '0'
</select> </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 id="getUserDepartType" resultType="com.ejweb.modules.depart.entity.UserDepartTypeEntity">
SELECT SELECT
f.id, f.id,
...@@ -54,4 +56,7 @@ ...@@ -54,4 +56,7 @@
AND f.type=#{valueType} AND f.type=#{valueType}
</if> </if>
</select> </select>
<update id="deleteUserDepart">
UPDATE foc_user_depart_type SET del_flag='1' where type = #{type}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -23,10 +23,12 @@ public interface VerifyDepartAddDao{ ...@@ -23,10 +23,12 @@ public interface VerifyDepartAddDao{
public List<UserDepartTypeEntity> getUserDepartType(@Param("valueType")String valueType); public List<UserDepartTypeEntity> getUserDepartType(@Param("valueType")String valueType);
/** /**
* 查询所有论证类型 * 查询已选所有论证类型
* @return * @return
*/ */
public List<UserDictEntity> getUserDictAll(); public List<UserDictEntity> getUserDictAll();
public List<UserDictEntity> getDictAll();
/** /**
* 查询所有部门信息 * 查询所有部门信息
* @return * @return
...@@ -42,6 +44,6 @@ public interface VerifyDepartAddDao{ ...@@ -42,6 +44,6 @@ public interface VerifyDepartAddDao{
public Integer deleteUserDepartType(@Param("type") String type); public Integer deleteUserDepartType(@Param("type") String type);
public List<UserDepartEntity> getUserDepartAll(String isVerif); public void deleteUserDepart(@Param("type") String type);
} }
\ No newline at end of file
package com.ejweb.modules.airline.entity; 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.persistence.DataEntity;
import com.ejweb.core.utils.excel.annotation.ExcelField; import com.ejweb.core.utils.excel.annotation.ExcelField;
import com.ejweb.core.utils.excel.fieldtype.AircraftType; import com.ejweb.core.utils.excel.fieldtype.AircraftType;
import com.ejweb.modules.aircraft.entity.AircraftEntity; import com.ejweb.modules.aircraft.entity.AircraftEntity;
import com.ejweb.modules.contact.entity.AirportEntity; import com.ejweb.modules.contact.entity.AirportEntity;
import com.ejweb.modules.depart.entity.DepartEntity; import com.ejweb.modules.depart.entity.DepartEntity;
//import com.ejweb.modules.sys.entity.Area;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import java.util.Date;
//import com.ejweb.modules.sys.entity.Area;
/** /**
* *
* Verify Entity * Verify Entity
...@@ -38,8 +36,10 @@ public class VerifyEntity extends DataEntity<VerifyEntity> implements Cloneable{ ...@@ -38,8 +36,10 @@ public class VerifyEntity extends DataEntity<VerifyEntity> implements Cloneable{
@NotNull(message="论证单号不能为空") @NotNull(message="论证单号不能为空")
@ExcelField(title="论证单号", type=0, align=3, sort=11) @ExcelField(title="论证单号", type=0, align=3, sort=11)
private String verifNo; private String verifNo;
private String operateUser;
private String reason;
@NotNull(message="论证类型不能为空") @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; private String verifType;
@NotNull(message="机型不能为空") @NotNull(message="机型不能为空")
@ExcelField(title="机型", type=0, align=3, sort=13, fieldType=AircraftType.class) @ExcelField(title="机型", type=0, align=3, sort=13, fieldType=AircraftType.class)
...@@ -92,16 +92,26 @@ public class VerifyEntity extends DataEntity<VerifyEntity> implements Cloneable{ ...@@ -92,16 +92,26 @@ public class VerifyEntity extends DataEntity<VerifyEntity> implements Cloneable{
private String depIata; private String depIata;
private String arrIata; 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 String airline;
private SailingFileEntity sailingfile; private SailingFileEntity sailingfile;
......
...@@ -28,7 +28,7 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -28,7 +28,7 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> {
public List<UserDictDepartEntity> findUserDeparDictAllList() { public List<UserDictDepartEntity> findUserDeparDictAllList() {
List<UserDictEntity> userDictAll = verifyDepartAddDao.getUserDictAll(); List<UserDictEntity> userDictAll = verifyDepartAddDao.getUserDictAll();
List<UserDictDepartEntity> dictlist = new ArrayList<>(); List<UserDictDepartEntity> dictlist = new ArrayList<>();
Integer i=1; Integer i = 1;
for (UserDictEntity ud : userDictAll) { for (UserDictEntity ud : userDictAll) {
String valueType = ud.getValueType(); String valueType = ud.getValueType();
List<UserDepartTypeEntity> userDepartType = verifyDepartAddDao.getUserDepartType(valueType); List<UserDepartTypeEntity> userDepartType = verifyDepartAddDao.getUserDepartType(valueType);
...@@ -48,7 +48,10 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -48,7 +48,10 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> {
List<UserDepartEntity> allList = verifyDepartAddDao.findUserDeparList(); List<UserDepartEntity> allList = verifyDepartAddDao.findUserDeparList();
// 根据类型type值查询对应的部门信息 // 根据类型type值查询对应的部门信息
String type = userDepartEntity.getType(); String type = userDepartEntity.getType();
List<UserDepartTypeEntity> byList = verifyDepartAddDao.getUserDepartType(type); List<UserDepartTypeEntity> byList = null;
if (type != null) {
byList = verifyDepartAddDao.getUserDepartType(type);
}
if (byList != null) { if (byList != null) {
for (UserDepartEntity udAll : allList) { for (UserDepartEntity udAll : allList) {
for (UserDepartTypeEntity udBy : byList) { for (UserDepartTypeEntity udBy : byList) {
...@@ -60,11 +63,12 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -60,11 +63,12 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> {
} }
return allList; return allList;
} }
public String addUserDepartType(UserDepartNoCheckVo userDepartEntity) { public String addUserDepartType(UserDepartNoCheckVo userDepartEntity) {
AddDepartTypeDto addDepartTypeDto = new AddDepartTypeDto(); AddDepartTypeDto addDepartTypeDto = new AddDepartTypeDto();
String type = userDepartEntity.getType(); String type = userDepartEntity.getType();
String list = userDepartEntity.getList(); String list = userDepartEntity.getList();
if (list==null||list==" "){ if (list == null || list == " ") {
verifyDepartAddDao.addUserDepartType(addDepartTypeDto); verifyDepartAddDao.addUserDepartType(addDepartTypeDto);
return "1"; return "1";
} }
...@@ -78,7 +82,7 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -78,7 +82,7 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> {
if (type != null && type != "") { if (type != null && type != "") {
List<UserDepartTypeEntity> byList = verifyDepartAddDao.getUserDepartType(type); List<UserDepartTypeEntity> byList = verifyDepartAddDao.getUserDepartType(type);
// 不为空先删除在添加 // 不为空先删除在添加
if(byList!=null){ if (byList != null) {
verifyDepartAddDao.deleteUserDepartType(type); verifyDepartAddDao.deleteUserDepartType(type);
} }
verifyDepartAddDao.addUserDepartType(addDepartTypeDto); verifyDepartAddDao.addUserDepartType(addDepartTypeDto);
...@@ -86,7 +90,13 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -86,7 +90,13 @@ public class VerifyAddService extends CrudService<VerifyDao, VerifyEntity> {
return "1"; return "1";
} }
public List<UserDepartEntity> getUserDepart(String isVerif) { public List<UserDictEntity> getDictAll() {
return verifyDepartAddDao.getUserDepartAll(isVerif); List<UserDictEntity> userDictAll = verifyDepartAddDao.getDictAll();
return userDictAll;
}
public String deleteUserDepart(String type) {
verifyDepartAddDao.deleteUserDepartType(type);
return "";
} }
} }
package com.ejweb.modules.airline.service; 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.persistence.Page;
import com.ejweb.core.service.CrudService; import com.ejweb.core.service.CrudService;
import com.ejweb.core.utils.StringUtils; import com.ejweb.core.utils.StringUtils;
import com.ejweb.modules.airline.dao.ConnectDao; import com.ejweb.modules.airline.dao.ConnectDao;
import com.ejweb.modules.airline.dao.VerifyDao; 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.ConnectEntity;
import com.ejweb.modules.airline.entity.VerifyEntity; 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.dao.UserProfileDao;
import com.ejweb.modules.contact.entity.UserProfileEntity; import com.ejweb.modules.contact.entity.UserProfileEntity;
import com.ejweb.modules.depart.entity.DepartEntity; import com.ejweb.modules.depart.entity.DepartEntity;
import com.ejweb.modules.sys.utils.UserUtils; import com.ejweb.modules.sys.utils.UserUtils;
import com.github.pagehelper.PageHelper; 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 * Verify Service
...@@ -36,6 +37,8 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -36,6 +37,8 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
private ConnectDao connectDao; private ConnectDao connectDao;
@Autowired @Autowired
private UserProfileDao userProfileDao; private UserProfileDao userProfileDao;
@Autowired
private VerifyUpdateUserDao verifyUpdateUserDao;
public VerifyEntity get(String id) { public VerifyEntity get(String id) {
VerifyEntity verifyEntity = verifyDao.get2(id); VerifyEntity verifyEntity = verifyDao.get2(id);
...@@ -119,7 +122,24 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -119,7 +122,24 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
} }
@Transactional(readOnly = false) @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.findValidator(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())) { if (StringUtils.isBlank(verifyEntity.getId())) {
verifyEntity.preInsert(); // 生成id verifyEntity.preInsert(); // 生成id
UserProfileEntity user = new UserProfileEntity(); UserProfileEntity user = new UserProfileEntity();
...@@ -129,11 +149,13 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -129,11 +149,13 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
DepartEntity depart = new DepartEntity(); DepartEntity depart = new DepartEntity();
depart.setId(departId); depart.setId(departId);
verifyEntity.setDepart(depart); verifyEntity.setDepart(depart);
//校验论证单号是否重复
verifyDao.insert(verifyEntity); verifyDao.insert(verifyEntity);
// 如果不是航线则结束 // 如果不是航线则结束
if ("06".equals(verifyEntity.getVerifType()) || "07".equals(verifyEntity.getVerifType()) if ("06".equals(verifyEntity.getVerifType()) || "07".equals(verifyEntity.getVerifType())
|| "08".equals(verifyEntity.getVerifType())) { || "08".equals(verifyEntity.getVerifType())) {
return; return"";
} }
ConnectEntity connect = new ConnectEntity(); ConnectEntity connect = new ConnectEntity();
connect.preInsert(); // 生成id connect.preInsert(); // 生成id
...@@ -167,7 +189,7 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -167,7 +189,7 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
verif.setAreaSt(verifyEntity.getAreaSt()); verif.setAreaSt(verifyEntity.getAreaSt());
verif.setFlightNo(verifyEntity.getFlightNo()); verif.setFlightNo(verifyEntity.getFlightNo());
verifyDao.update(verifyEntity); verifyDao.update(verifyEntity);
return; return"";
} }
// 判断是否主数据 // 判断是否主数据
else if ("1".equals(verifyEntity.getConnect().getIsMain())) { else if ("1".equals(verifyEntity.getConnect().getIsMain())) {
...@@ -184,9 +206,11 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> { ...@@ -184,9 +206,11 @@ public class VerifyService extends CrudService<VerifyDao, VerifyEntity> {
connect.setFlightNo(verifyEntity.getFlightNo()); connect.setFlightNo(verifyEntity.getFlightNo());
connectDao.update(verifyEntity.getConnect()); connectDao.update(verifyEntity.getConnect());
} }
return"";
} }
public List<VerifyEntity> CheckValidator(VerifyEntity verifyEntity) { public List<VerifyEntity> CheckValidator(VerifyEntity verifyEntity) {
return verifyDao.findValidator(verifyEntity); return verifyDao.findValidator(verifyEntity);
} }
......
package com.ejweb.modules.airline.web; package com.ejweb.modules.airline.web;
import java.util.List; import com.ejweb.core.base.BaseController;
import com.ejweb.core.utils.StringUtils;
import javax.servlet.http.HttpServletRequest; import com.ejweb.modules.aircraft.entity.AircraftEntity;
import javax.servlet.http.HttpServletResponse; 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.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
...@@ -14,14 +17,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -14,14 +17,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ejweb.core.base.BaseController; import javax.servlet.http.HttpServletRequest;
import com.ejweb.core.utils.StringUtils; import javax.servlet.http.HttpServletResponse;
import com.ejweb.modules.aircraft.entity.AircraftEntity; import java.util.List;
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;
...@@ -72,7 +70,11 @@ public class ConnectController extends BaseController { ...@@ -72,7 +70,11 @@ public class ConnectController extends BaseController {
if (!beanValidator(model, verifyEntity)){ if (!beanValidator(model, verifyEntity)){
return form(verifyEntity, model); 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, "保存成功"); addMessage(redirectAttributes, "保存成功");
return "redirect:" + adminPath + "/airline/verify/list?repage"; return "redirect:" + adminPath + "/airline/verify/list?repage";
} }
......
...@@ -5,6 +5,7 @@ import com.ejweb.modules.airline.service.VerifyAddService; ...@@ -5,6 +5,7 @@ import com.ejweb.modules.airline.service.VerifyAddService;
import com.ejweb.modules.depart.entity.UserDepartNoCheckVo; import com.ejweb.modules.depart.entity.UserDepartNoCheckVo;
import com.ejweb.modules.depart.entity.UserDepartEntity; import com.ejweb.modules.depart.entity.UserDepartEntity;
import com.ejweb.modules.depart.entity.UserDictDepartEntity; import com.ejweb.modules.depart.entity.UserDictDepartEntity;
import com.ejweb.modules.depart.entity.UserDictEntity;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -50,11 +51,24 @@ public class VerifyAddController extends BaseController { ...@@ -50,11 +51,24 @@ public class VerifyAddController extends BaseController {
if (!beanValidator(model, userDepartEntity)) { if (!beanValidator(model, userDepartEntity)) {
return form(userDepartEntity, model); return form(userDepartEntity, model);
} }
List<UserDictEntity> dictList = verifyService.getDictAll();
model.addAttribute("dictList", dictList);
model.addAttribute("type", userDepartEntity.getType()); model.addAttribute("type", userDepartEntity.getType());
List<UserDepartEntity> allList = verifyService.findAllList(userDepartEntity); List<UserDepartEntity> allList = verifyService.findAllList(userDepartEntity);
model.addAttribute("allList",allList); model.addAttribute("allList",allList);
return "modules/airline/verifyUserForm"; 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") @RequiresPermissions("vrf:verify:edit")
@RequestMapping(value = "add") @RequestMapping(value = "add")
...@@ -67,11 +81,11 @@ public class VerifyAddController extends BaseController { ...@@ -67,11 +81,11 @@ public class VerifyAddController extends BaseController {
addMessage(redirectAttributes, "操作成功"); addMessage(redirectAttributes, "操作成功");
return "redirect:" + adminPath + "/airline/verifyAdd/list?repage"; return "redirect:" + adminPath + "/airline/verifyAdd/list?repage";
} }
/* @RequiresPermissions("vrf:verify:view") @RequiresPermissions("vrf:verify:view")
@RequestMapping(value = "get") @RequestMapping(value = "delete")
public String getUserDepart(String isVerif) { public String deleteUserDepart(String valueType,Model model) {
verifyService.getUserDepart(isVerif); verifyService.deleteUserDepart(valueType);
return null; return "redirect:" + adminPath + "/airline/verifyAdd/list?repage";
}*/ }
} }
...@@ -106,7 +106,11 @@ public class VerifyController extends BaseController { ...@@ -106,7 +106,11 @@ public class VerifyController extends BaseController {
if (!beanValidator(model, verifyEntity)) { if (!beanValidator(model, verifyEntity)) {
return form(verifyEntity, model); 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, "保存成功"); addMessage(redirectAttributes, "保存成功");
return "redirect:" + adminPath + "/airline/verify/list?repage"; return "redirect:" + adminPath + "/airline/verify/list?repage";
} }
......
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