Commit c05a7d58 by zhangyu

部门

parent 9efb1842
......@@ -3,7 +3,7 @@
<html>
<head>
<script src="${ctxStatic}/jquery-form/jquery-form.js" type="text/javascript"></script>
<title>航线管理部门列表</title>
<title>论证部门管理</title>
<meta name="decorator" content="default"/>
<script verify="text/javascript">
function page(n, s) {
......@@ -42,7 +42,7 @@
<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>
<li class="active"><a href="${ctx}/airline/verifyAdd">航线管理部门列表</a></li>
</ul>
<sys:message content="${message}"/>
<div class="clearfix"></div>
......
<%@ 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
......@@ -36,10 +36,6 @@
}
});
});
function changeCheck(item,e) {
console.log(222222);
item.check=e.check;
}
</script>
</head>
<body>
......
<?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 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
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.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 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";
}
}
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