Commit 0e81751d by java-李谡

修改论证类型

parent 9eee3809
...@@ -853,7 +853,8 @@ LEFT JOIN foc_airports t2 on t.arrIata = t2.airport_iata where s.id=#{verifId} ) ...@@ -853,7 +853,8 @@ LEFT JOIN foc_airports t2 on t.arrIata = t2.airport_iata where s.id=#{verifId} )
OR a.verif_type = '02' OR a.verif_type = '02'
OR a.verif_type = '03' OR a.verif_type = '03'
OR a.verif_type = '04' OR a.verif_type = '04'
OR a.verif_type = '05' THEN OR a.verif_type = '05'
OR a.verif_type = '09' THEN
tmp.depName tmp.depName
ELSE ELSE
r.airport_name r.airport_name
...@@ -863,7 +864,8 @@ LEFT JOIN foc_airports t2 on t.arrIata = t2.airport_iata where s.id=#{verifId} ) ...@@ -863,7 +864,8 @@ LEFT JOIN foc_airports t2 on t.arrIata = t2.airport_iata where s.id=#{verifId} )
OR a.verif_type = '02' OR a.verif_type = '02'
OR a.verif_type = '03' OR a.verif_type = '03'
OR a.verif_type = '04' OR a.verif_type = '04'
OR a.verif_type = '05' THEN OR a.verif_type = '05'
OR a.verif_type = '09' THEN
tmp.depIata tmp.depIata
ELSE ELSE
a.depIata a.depIata
......
...@@ -245,10 +245,10 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo ...@@ -245,10 +245,10 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
// String decrypted = DES3Utils.decrypt("dc6788486fc8fa4660890b4cba7ee6ada527e2e604dbe7fa0fdcf7401a0dd11996450d7fea85f2d9724b7d8fff30a4826c098fd51da0815035030eec22e491802aa2975c67259d9ca89540576b301b6d", CONF_DESC_KEY); // String decrypted = DES3Utils.decrypt("dc6788486fc8fa4660890b4cba7ee6ada527e2e604dbe7fa0fdcf7401a0dd11996450d7fea85f2d9724b7d8fff30a4826c098fd51da0815035030eec22e491802aa2975c67259d9ca89540576b301b6d", CONF_DESC_KEY);
// System.out.println(decrypted); // System.out.println(decrypted);
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.encrypt("foctest", CONF_DESC_KEY));
//// DESPlus des = new DESPlus(CONF_DESC_KEY);//定义密钥 //// DESPlus des = new DESPlus(CONF_DESC_KEY);//定义密钥
// 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.encrypt("jdbc:mysql://10.70.78.27:3306/foc?useUnicode=true&characterEncoding=utf-8", CONF_DESC_KEY));
// System.out.println(DES3Utils.decrypt("dc6788486fc8fa4660890b4cba7ee6adad2da747310eb02e0fdcf7401a0dd11996450d7fea85f2d9724b7d8fff30a4826c098fd51da0815035030eec22e491802aa2975c67259d9ca89540576b301b6d", CONF_DESC_KEY)); System.out.println(DES3Utils.decrypt("0e8dfd0927dd5d88fee454c6aef2a68a38e20f99110a3d5a933c45a72bf468e954c33fb8cfe5bcae", CONF_DESC_KEY));
// } catch (Exception e) { // } catch (Exception e) {
// e.printStackTrace(); // e.printStackTrace();
// } // }
......
...@@ -233,7 +233,8 @@ public class PlanUtil { ...@@ -233,7 +233,8 @@ public class PlanUtil {
case "02": case "02":
case "03": case "03":
case "04": case "04":
case "09":
if(StringUtils.isBlank(start)&&StringUtils.isBlank(end)){ if(StringUtils.isBlank(start)&&StringUtils.isBlank(end)){
return ""; return "";
......
/** /**
* *
*/ */
package com.ejweb.modules.sailing.service; package com.ejweb.modules.sailing.service;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ejweb.core.base.CurdService; import com.ejweb.core.base.CurdService;
import com.ejweb.core.base.PageEntity; import com.ejweb.core.base.PageEntity;
import com.ejweb.core.conf.GConstants; import com.ejweb.core.conf.GConstants;
...@@ -58,49 +37,62 @@ import com.ejweb.modules.verify.entity.ConnectionPlan; ...@@ -58,49 +37,62 @@ import com.ejweb.modules.verify.entity.ConnectionPlan;
import com.ejweb.modules.verify.entity.MailEntity; import com.ejweb.modules.verify.entity.MailEntity;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
*
* @team suzhou
* @author huhy * @author huhy
* @version 1.0 * @version 1.0
* @team suzhou
* @time 2016年9月5日 * @time 2016年9月5日
*/ */
@Service @Service
public class SailingCommandService extends CurdService<SailingCommandDao, SailingCommandEntity> { public class SailingCommandService extends CurdService<SailingCommandDao, SailingCommandEntity> {
@Autowired @Autowired
private AirlineVerifyDao verifyDao; private AirlineVerifyDao verifyDao;
@Autowired @Autowired
RouteVerifyDao routeVerifyDao ; RouteVerifyDao routeVerifyDao;
@Autowired @Autowired
AssessmentDao assessmentDao; AssessmentDao assessmentDao;
@Autowired @Autowired
private NotifyDao notifyDao; private NotifyDao notifyDao;
@Autowired @Autowired
private VerifyManageDao manageDao; private VerifyManageDao manageDao;
/** /**
* 开航指令分页查询 * 开航指令分页查询
* *
* @author huhy
* @time 2016年9月6日
* @param bean * @param bean
* @return * @return
* @author huhy
* @time 2016年9月6日
*/ */
public PageEntity<SailingCommandEntity> getCommandList(SailingCommandBean bean) { public PageEntity<SailingCommandEntity> getCommandList(SailingCommandBean bean) {
PageInfo<SailingCommandEntity> pageInfo = null; PageInfo<SailingCommandEntity> pageInfo = null;
// 必须紧贴dao的查询方法 // 必须紧贴dao的查询方法
PageHelper.startPage(bean.getPageNo(), bean.getPageSize()); PageHelper.startPage(bean.getPageNo(), bean.getPageSize());
if(StringUtils.isEmpty(bean.getSort())){ if (StringUtils.isEmpty(bean.getSort())) {
PageHelper.orderBy(" verifNo DESC"); PageHelper.orderBy(" verifNo DESC");
} } else
else PageHelper.orderBy(bean.getSort());
PageHelper.orderBy(bean.getSort());
pageInfo = new PageInfo<SailingCommandEntity>(dao.getList(bean)); pageInfo = new PageInfo<SailingCommandEntity>(dao.getList(bean));
if (pageInfo.getPages() < bean.getPageNo()) {// 页码大于总页数,则返回NULL if (pageInfo.getPages() < bean.getPageNo()) {// 页码大于总页数,则返回NULL
return null; return null;
} }
...@@ -109,17 +101,17 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -109,17 +101,17 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
if (list == null || list.size() == 0) {// 如果没有数据则返回NULL if (list == null || list.size() == 0) {// 如果没有数据则返回NULL
return null; return null;
} }
for(SailingCommandEntity entity: list){ for (SailingCommandEntity entity : list) {
List<String> lst= verifyDao.getTypeList(entity.getVerifId()); List<String> lst = verifyDao.getTypeList(entity.getVerifId());
if(lst!=null&&lst.size()!=0){ if (lst != null && lst.size() != 0) {
entity.setTypeList(verifyDao.getTypeList(entity.getVerifId())); entity.setTypeList(verifyDao.getTypeList(entity.getVerifId()));
} }
entity.setConnect(verifyDao.getConnectList(entity.getVerifId())); entity.setConnect(verifyDao.getConnectList(entity.getVerifId()));
entity.setDepName(verifyDao.getConnetList(entity.getVerifId())); entity.setDepName(verifyDao.getConnetList(entity.getVerifId()));
String typelist=verifyDao.getTypeList1(entity.getVerifId()); String typelist = verifyDao.getTypeList1(entity.getVerifId());
if(StringUtils.isNoneBlank(typelist)) if (StringUtils.isNoneBlank(typelist))
entity.setAircraftName(entity.getAircraftName()+":"+typelist); entity.setAircraftName(entity.getAircraftName() + ":" + typelist);
} }
PageEntity<SailingCommandEntity> page = new PageEntity<SailingCommandEntity>(); PageEntity<SailingCommandEntity> page = new PageEntity<SailingCommandEntity>();
page.setPageNo(pageInfo.getPageNum()); page.setPageNo(pageInfo.getPageNum());
...@@ -132,90 +124,96 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -132,90 +124,96 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
/** /**
* 开航指令详细信息 * 开航指令详细信息
* @author huhy *
* @time 2016年9月6日
* @param bean * @param bean
* @return * @return
* @author huhy
* @time 2016年9月6日
*/ */
@Transactional(readOnly=false) @Transactional(readOnly = false)
public SailingCdDeatailEntity updateAndGetCommandDetail(SailingCmDetailBean bean) { public SailingCdDeatailEntity updateAndGetCommandDetail(SailingCmDetailBean bean) {
SailingCdDeatailEntity entity = dao.getSailingDetail(bean); SailingCdDeatailEntity entity = dao.getSailingDetail(bean);
// String formText = ""; // String formText = "";
if (entity != null ) { if (entity != null) {
AirlineVerifyDetailBean dbean=new AirlineVerifyDetailBean(); AirlineVerifyDetailBean dbean = new AirlineVerifyDetailBean();
dbean.setVerifId(bean.getVerifId()); dbean.setVerifId(bean.getVerifId());
entity.setVerify2type(verifyDao.getVerify2typeList(dbean)); entity.setVerify2type(verifyDao.getVerify2typeList(dbean));
// 去掉历史快照 及 开航指令单 // 去掉历史快照 及 开航指令单
// entity.setHistory(verifyDao.getHistoryList(entity.getId())); // entity.setHistory(verifyDao.getHistoryList(entity.getId()));
/* if(StringUtils.isEmpty(entity.getFormText())){ /* if(StringUtils.isEmpty(entity.getFormText())){
bean.setVerifType(entity.getVerifType()); bean.setVerifType(entity.getVerifType());
formText = dao.getformText(bean); formText = dao.getformText(bean);
entity.setFormText(formText); entity.setFormText(formText);
}*/ }*/
entity.setFormText("."); entity.setFormText(".");
AssessmentFindListBean bn=new AssessmentFindListBean(); AssessmentFindListBean bn = new AssessmentFindListBean();
bn.setVerifId(bean.getVerifId()); bn.setVerifId(bean.getVerifId());
List<AssessmentFindListEntity> riskList=assessmentDao.getAssessmentFindList(bn); List<AssessmentFindListEntity> riskList = assessmentDao.getAssessmentFindList(bn);
entity.setRiskList(riskList); entity.setRiskList(riskList);
AirlineVerifyDetailBean airBean=new AirlineVerifyDetailBean(); AirlineVerifyDetailBean airBean = new AirlineVerifyDetailBean();
airBean.setVerifId(bean.getVerifId()); airBean.setVerifId(bean.getVerifId());
List<Map<String, String>> listm= verifyDao.getverifyFileList(airBean); List<Map<String, String>> listm = verifyDao.getverifyFileList(airBean);
entity.setConnect(verifyDao.getConnectList(bean.getVerifId())); entity.setConnect(verifyDao.getConnectList(bean.getVerifId()));
if(listm!=null&&listm.size()>0){ if (listm != null && listm.size() > 0) {
Map<String, String> map=listm.get(0); Map<String, String> map = listm.get(0);
String fileName = map.get("fileName"); String fileName = map.get("fileName");
String filePath = map.get("filePath"); String filePath = map.get("filePath");
List<ConnectionPlan> lst= planlist( fileName, filePath); List<ConnectionPlan> lst = planlist(fileName, filePath);
entity.setConnectionPlan(lst); entity.setConnectionPlan(lst);
} }
if(StringUtils.isEmpty(entity.getVerifyText())){ if (StringUtils.isEmpty(entity.getVerifyText())) {
RouteVerifyBean routebean=new RouteVerifyBean(); RouteVerifyBean routebean = new RouteVerifyBean();
routebean.setVerifId(bean.getVerifId()); routebean.setVerifId(bean.getVerifId());
List<RouteVerifyEntity> list= routeVerifyDao.findlist(routebean); List<RouteVerifyEntity> list = routeVerifyDao.findlist(routebean);
StringBuffer sb=new StringBuffer(); StringBuffer sb = new StringBuffer();
for(RouteVerifyEntity route : list){ for (RouteVerifyEntity route : list) {
sb.append(route.getFormText()); sb.append(route.getFormText());
sb.append("<table width=\"80%\"><tr>"); sb.append("<table width=\"80%\"><tr>");
sb.append("<td height=\"104\" width=\"197\">论证意见</td>"); sb.append("<td height=\"104\" width=\"197\">论证意见</td>");
sb.append("<td>"); sb.append("<td>");
switch(route.getVerifyStatus()){ switch (route.getVerifyStatus()) {
case "00": sb.append("无意见"); case "00":
break; sb.append("无意见");
case "01": sb.append("可行"); break;
break; case "01":
case "02": sb.append("不可行"); sb.append("可行");
break; break;
case "03": sb.append("条件可行"); case "02":
break; sb.append("不可行");
case "04": sb.append("条件满足"); break;
break; case "03":
} sb.append("条件可行");
sb.append("</td></tr><tr>"); break;
sb.append("<td height=\"104\" width=\"172\">备注、注意事项</td>"); case "04":
sb.append("<td>"); sb.append("条件满足");
sb.append(route.getRemarks()); break;
sb.append("</td>"); }
sb.append("</tr></table>").append("<br/>"); sb.append("</td></tr><tr>");
} sb.append("<td height=\"104\" width=\"172\">备注、注意事项</td>");
sb.append("<td>");
sb.append(route.getRemarks());
sb.append("</td>");
sb.append("</tr></table>").append("<br/>");
}
entity.setVerifyText(sb.toString()); entity.setVerifyText(sb.toString());
} }
Map<String, String> map=verifyDao.getDetail(entity.getVerifId()); Map<String, String> map = verifyDao.getDetail(entity.getVerifId());
if(StringUtils.isEmpty(entity.getSailingText())){ if (StringUtils.isEmpty(entity.getSailingText())) {
entity.setSailingText(updateAndGetSailingText(entity,map)); entity.setSailingText(updateAndGetSailingText(entity, map));
} }
if(StringUtils.isEmpty(entity.getConRemarks())){ if (StringUtils.isEmpty(entity.getConRemarks())) {
StringBuilder sb =new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("<table><tr>"); sb.append("<table><tr>");
sb.append("<td height=\"104\" width=\"172\">论证总结</td>"); sb.append("<td height=\"104\" width=\"172\">论证总结</td>");
sb.append("<td><textarea style=\"width:500px;height:80px;\">").append(entity.getVerifRemarks()==null?"":entity.getVerifRemarks()).append("</textarea></td>"); sb.append("<td><textarea style=\"width:500px;height:80px;\">").append(entity.getVerifRemarks() == null ? "" : entity.getVerifRemarks()).append("</textarea></td>");
sb.append("</tr><tr>"); sb.append("</tr><tr>");
sb.append("<td height=\"104\">航路类型</td>"); sb.append("<td height=\"104\">航路类型</td>");
sb.append("<td>").append(entity.getRouteType()).append("</td>"); sb.append("<td>").append(entity.getRouteType()).append("</td>");
...@@ -231,56 +229,58 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -231,56 +229,58 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
sb.append("</tr></table>"); sb.append("</tr></table>");
entity.setConRemarks(sb.toString()); entity.setConRemarks(sb.toString());
} }
} }
return entity; return entity;
} }
/** /**
*
* @author zhanglg
* @time 2016年12月15日
* @param entity * @param entity
* @author zhanglg
* @time 2016年12月15日
*/ */
@Transactional(readOnly=false) @Transactional(readOnly = false)
private String updateAndGetSailingText(SailingCdDeatailEntity entity,Map<String, String> map) { private String updateAndGetSailingText(SailingCdDeatailEntity entity, Map<String, String> map) {
String depName= map.get("depName"); String depName = map.get("depName");
if(StringUtils.isNoneBlank(depName)&&!depName.contains("=")&&!depName.contains("-")){ if (StringUtils.isNoneBlank(depName) && !depName.contains("=") && !depName.contains("-")) {
map.put("depName", PlanUtil.GetLine(map.get("depName"),map.get("arrName"),map.get("roundtripType"),map.get("vertype"))); map.put("depName", PlanUtil.GetLine(map.get("depName"), map.get("arrName"), map.get("roundtripType"), map.get("vertype")));
map.put("depIata", PlanUtil.GetLine(map.get("depIata"),map.get("arrIata"),map.get("roundtripType"),map.get("vertype"))); map.put("depIata", PlanUtil.GetLine(map.get("depIata"), map.get("arrIata"), map.get("roundtripType"), map.get("vertype")));
} }
String vertype=""; String vertype = "";
switch(map.get("vertype")){ switch (map.get("vertype")) {
case "01": case "01":
case "02": case "02":
vertype="新开航线"; vertype = "新开航线";
break; break;
case "03": case "03":
case "04": case "04":
vertype="重开航线"; vertype = "重开航线";
break; break;
case "05": case "05":
vertype="调机"; vertype = "调机";
break; break;
case "06": case "06":
vertype="备降场"; vertype = "备降场";
break; break;
case "07": case "07":
vertype="过夜机场"; vertype = "过夜机场";
break;
case "08":
vertype = "训练场";
break;
case "09":
vertype = "计划变更";
break; break;
case "08":
vertype="训练场";
break;
} }
String routeNo = entity.getRouteNo(); String routeNo = entity.getRouteNo();
if(StringUtils.isBlank(routeNo)){ if (StringUtils.isBlank(routeNo)) {
routeNo = updateAndrGenertRouteNo(entity.getVerifType()); routeNo = updateAndrGenertRouteNo(entity.getVerifType());
} }
StringBuffer sb=new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"><tbody><tr><td style=\"text-align:center\" colspan=\"8\">").append(vertype).append("指令</td></tr>"); sb.append("<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"80%\"><tbody><tr><td style=\"text-align:center\" colspan=\"8\">").append(vertype).append("指令</td></tr>");
sb.append("<tr><td colspan=\"2\" style=\"width:15%\">开航指令号</td><td colspan=\"3\" style=\"width:28%\">颁发日期</td><td colspan=\"3\" style=\"width:25%\">完成日期</td></tr>"); sb.append("<tr><td colspan=\"2\" style=\"width:15%\">开航指令号</td><td colspan=\"3\" style=\"width:28%\">颁发日期</td><td colspan=\"3\" style=\"width:25%\">完成日期</td></tr>");
sb.append("<tr><td colspan=\"2\">"); sb.append("<tr><td colspan=\"2\">");
...@@ -289,44 +289,45 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -289,44 +289,45 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
sb.append("\"/>"); sb.append("\"/>");
sb.append("</td>"); sb.append("</td>");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
sb.append("<td colspan=\"3\">").append( format.format(new Date())).append("</td><td colspan=\"3\">"); sb.append("<td colspan=\"3\">").append(format.format(new Date())).append("</td><td colspan=\"3\">");
sb.append(map.get("startTime")).append("</td></tr>"); sb.append(map.get("startTime")).append("</td></tr>");
sb.append("<tr><td>标题</td><td colspan=\"7\" style=\"text-align:center\">关于组织"); sb.append("<tr><td>标题</td><td colspan=\"7\" style=\"text-align:center\">关于组织");
sb.append(map.get("aircraftLabel")).append("飞机执行").append(map.get("depName")).append(vertype).append("的指令</td></tr>"); sb.append(map.get("aircraftLabel")).append("飞机执行").append(map.get("depName")).append(vertype).append("的指令</td></tr>");
sb.append("<tr><td colspan=\"8\" style=\"text-align:center;background-color:#e5e5e5;\">开航信息及准备工作完成时限</td></tr>"); sb.append("<tr><td colspan=\"8\" style=\"text-align:center;background-color:#e5e5e5;\">开航信息及准备工作完成时限</td></tr>");
sb.append("<tr style=\"text-align:center\"><td>序号</td><td>航班号</td><td style=\"width:20%\" colspan=\"2\" >航线</td><td colspan=\"2\">机型</td><td colspan=\"2\">预计开通日期</td></tr>"); sb.append("<tr style=\"text-align:center\"><td>序号</td><td>航班号</td><td style=\"width:20%\" colspan=\"2\" >航线</td><td colspan=\"2\">机型</td><td colspan=\"2\">预计开通日期</td></tr>");
int n=1; int n = 1;
switch(map.get("vertype")){ switch (map.get("vertype")) {
case "01": case "01":
case "02": case "02":
case "03": case "03":
case "04": case "04":
case "05": case "05":
for(Map<String,String> map1:entity.getConnect()){ case "09":
sb.append("<tr style=\"text-align:center\"><td>"); for (Map<String, String> map1 : entity.getConnect()) {
sb.append(n).append("</td><td>"); sb.append("<tr style=\"text-align:center\"><td>");
sb.append(map1.get("flightNo")); sb.append(n).append("</td><td>");
sb.append(map1.get("flightNo"));
sb.append("</td><td colspan=\"2\">");
sb.append(map1.get("depName") + "=" + map1.get("arrName"));
sb.append("</td><td colspan=\"2\">");
sb.append(map.get("aircraftLabel") + ":" + map.get("typeNames"));
sb.append("</td><td colspan=\"2\">");
sb.append(map.get("startTime"));
sb.append("</td></tr>");
n++;
}
break;
default:
sb.append("<tr style=\"text-align:center\"><td>1</td><td>");
sb.append(map.get("flightNo") == null ? "" : map.get("flightNo"));
sb.append("</td><td colspan=\"2\">"); sb.append("</td><td colspan=\"2\">");
sb.append(map1.get("depName")+"="+map1.get("arrName")); sb.append(map.get("airportName"));
sb.append("</td><td colspan=\"2\">"); sb.append("</td><td colspan=\"2\">");
sb.append(map.get("aircraftLabel")+":"+map.get("typeNames")); sb.append(map.get("aircraftLabel") + ":" + map.get("typeNames"));
sb.append("</td><td colspan=\"2\">"); sb.append("</td><td colspan=\"2\">");
sb.append(map.get("startTime")); sb.append(map.get("startTime"));
sb.append("</td></tr>"); sb.append("</td></tr>");
n++; break;
}
break;
default:
sb.append("<tr style=\"text-align:center\"><td>1</td><td>");
sb.append(map.get("flightNo")==null?"":map.get("flightNo"));
sb.append("</td><td colspan=\"2\">");
sb.append(map.get("airportName"));
sb.append("</td><td colspan=\"2\">");
sb.append(map.get("aircraftLabel")+":"+map.get("typeNames"));
sb.append("</td><td colspan=\"2\">");
sb.append(map.get("startTime"));
sb.append("</td></tr>");
break;
} }
sb.append("<tr><td colspan=\"8\" style=\"text-align:center;background-color:#e5e5e5;\">运行控制部组织协调中心意见</td></tr>"); sb.append("<tr><td colspan=\"8\" style=\"text-align:center;background-color:#e5e5e5;\">运行控制部组织协调中心意见</td></tr>");
sb.append("<tr><td colspan=\"8\" ><p style=\"text-align:center\">北京首都航空有限公司拟于"); sb.append("<tr><td colspan=\"8\" ><p style=\"text-align:center\">北京首都航空有限公司拟于");
...@@ -346,11 +347,12 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -346,11 +347,12 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
/** /**
* 开航指令修改 * 开航指令修改
* @author huhy *
* @time 2016年9月6日
* @param bean * @param bean
* @author huhy
* @time 2016年9月6日
*/ */
@Transactional(readOnly=false) @Transactional(readOnly = false)
public Boolean update(SailingCmUpdateBean bean) { public Boolean update(SailingCmUpdateBean bean) {
String verifType = ""; String verifType = "";
String routeNo = ""; String routeNo = "";
...@@ -632,13 +634,15 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -632,13 +634,15 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
return true; return true;
} }
/** /**
* 开航指令修改 * 开航指令修改
* @author huhy *
* @time 2016年9月6日
* @param bean * @param bean
* @author huhy
* @time 2016年9月6日
*/ */
@Transactional(readOnly=false) @Transactional(readOnly = false)
public Boolean updateFile(SailingCmUpdateBean bean) { public Boolean updateFile(SailingCmUpdateBean bean) {
String verifType = ""; String verifType = "";
String routeNo = ""; String routeNo = "";
...@@ -880,28 +884,28 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -880,28 +884,28 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
private static String getLastDate(String datestr) { private static String getLastDate(String datestr) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
Date date = null; Date date = null;
try { try {
date = sdf.parse(datestr); date = sdf.parse(datestr);
} catch (ParseException e) { } catch (ParseException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(date); cal.setTime(date);
cal.add(Calendar.MONTH, -1); cal.add(Calendar.MONTH, -1);
return sdf.format(cal.getTime()); return sdf.format(cal.getTime());
} }
/** /**
*
* @author huhy
* @time 2016年9月6日
* @param entity * @param entity
* @param verifType * @param verifType
* @return * @return
* @author huhy
* @time 2016年9月6日
*/ */
@Transactional(readOnly=false) @Transactional(readOnly = false)
public String updateAndrGenertRouteNo(String verifType) { public String updateAndrGenertRouteNo(String verifType) {
DateFormat df = new SimpleDateFormat("yyyy"); DateFormat df = new SimpleDateFormat("yyyy");
String routeNo = ""; String routeNo = "";
...@@ -911,72 +915,71 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -911,72 +915,71 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
String type; String type;
if ("08".equals(verifType)) { if ("08".equals(verifType)) {
routeNoFrex = "XLKH" + year; routeNoFrex = "XLKH" + year;
type="07"; type = "07";
}else{ } else {
routeNoFrex = "KH" + year; routeNoFrex = "KH" + year;
type="06"; type = "06";
} }
sailingCommandEntity.setRouteNo(routeNoFrex); sailingCommandEntity.setRouteNo(routeNoFrex);
routeNo=dao.getVerifNo(routeNoFrex); routeNo = dao.getVerifNo(routeNoFrex);
if(StringUtils.isBlank(routeNo)){ if (StringUtils.isBlank(routeNo)) {
routeNo = dao.findRouteNo(sailingCommandEntity); routeNo = dao.findRouteNo(sailingCommandEntity);
}else{ } else {
verifyDao.updateNo(type); verifyDao.updateNo(type);
} }
if(StringUtils.isBlank(routeNo)){ if (StringUtils.isBlank(routeNo)) {
routeNo=routeNoFrex+"001"; routeNo = routeNoFrex + "001";
}else{ } else {
routeNo = routeNoFrex + String.format("%03d", Integer.valueOf(routeNo) + 1); routeNo = routeNoFrex + String.format("%03d", Integer.valueOf(routeNo) + 1);
} }
return routeNo; return routeNo;
} }
public List<Map<String, String>> getCommandFile(SailingCmDetailBean bean) { public List<Map<String, String>> getCommandFile(SailingCmDetailBean bean) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
List<Map<String, String>> list=dao.getCommandFile(bean); List<Map<String, String>> list = dao.getCommandFile(bean);
if(list.size()>0){ if (list.size() > 0) {
Map<String, String> map1=verifyDao.getDetail(bean.getVerifId()); Map<String, String> map1 = verifyDao.getDetail(bean.getVerifId());
String depName= map1.get("depName"); String depName = map1.get("depName");
if(StringUtils.isNoneBlank(depName)&&!depName.contains("=")&&!depName.contains("-")){ if (StringUtils.isNoneBlank(depName) && !depName.contains("=") && !depName.contains("-")) {
map1.put("depName", PlanUtil.GetLine(map1.get("depName"),map1.get("arrName"),map1.get("roundtripType"),map1.get("vertype"))); map1.put("depName", PlanUtil.GetLine(map1.get("depName"), map1.get("arrName"), map1.get("roundtripType"), map1.get("vertype")));
map1.put("depIata", PlanUtil.GetLine(map1.get("depIata"),map1.get("arrIata"),map1.get("roundtripType"),map1.get("vertype"))); map1.put("depIata", PlanUtil.GetLine(map1.get("depIata"), map1.get("arrIata"), map1.get("roundtripType"), map1.get("vertype")));
} }
Map<String, String> map=list.get(0); Map<String, String> map = list.get(0);
map.put("fileName", "北京首都航空关于使用"+map1.get("aircraftLabel")+"机型执行"+map1.get("depName")+map1.get("verifType")+"航线的开航指令("+map1.get("routeNo")+").doc"); map.put("fileName", "北京首都航空关于使用" + map1.get("aircraftLabel") + "机型执行" + map1.get("depName") + map1.get("verifType") + "航线的开航指令(" + map1.get("routeNo") + ").doc");
} }
return list; return list;
} }
public void sendMail(String verifId, String plan, String routeNo) {
public void sendMail(String verifId,String plan,String routeNo) { List<String> ccmails = verifyDao.getmail("9");
List<String> ccmails= verifyDao.getmail("9"); List<String> mails = verifyDao.getmailYK(new MailEntity());
List<String> mails= verifyDao.getmailYK(new MailEntity()); if (mails == null || mails.size() == 0) return;
if(mails==null||mails.size()==0)return;
String templateName = "template_9.ftl"; String templateName = "template_9.ftl";
Map<String, String> map=verifyDao.getDetail(verifId); Map<String, String> map = verifyDao.getDetail(verifId);
String depName= map.get("depName"); String depName = map.get("depName");
String flight =PlanUtil.flightContent(map); String flight = PlanUtil.flightContent(map);
String line =PlanUtil.lineContent(map); String line = PlanUtil.lineContent(map);
map.put("line", line); map.put("line", line);
map.put("lineEN", PlanUtil.lineENContent(map)); map.put("lineEN", PlanUtil.lineENContent(map));
if(StringUtils.isNoneBlank(depName)&&!depName.contains("=")&&!depName.contains("-")){ if (StringUtils.isNoneBlank(depName) && !depName.contains("=") && !depName.contains("-")) {
map.put("depName", PlanUtil.GetLine(map.get("depName"),map.get("arrName"),map.get("roundtripType"),map.get("vertype"))); map.put("depName", PlanUtil.GetLine(map.get("depName"), map.get("arrName"), map.get("roundtripType"), map.get("vertype")));
map.put("depIata", PlanUtil.GetLine(map.get("depIata"),map.get("arrIata"),map.get("roundtripType"),map.get("vertype"))); map.put("depIata", PlanUtil.GetLine(map.get("depIata"), map.get("arrIata"), map.get("roundtripType"), map.get("vertype")));
} }
map.put("url", "https://ifos.jdair.net/im/login"); map.put("url", "https://ifos.jdair.net/im/login");
if(!map.containsKey("routeNo")){ if (!map.containsKey("routeNo")) {
map.put("routeNo", routeNo); map.put("routeNo", routeNo);
} }
try { try {
String en=com.ejweb.core.util.TemplateFactory.generateHtmlFromFtl("template_en_9.ftl", map); String en = com.ejweb.core.util.TemplateFactory.generateHtmlFromFtl("template_en_9.ftl", map);
String title="首都航空关于"+flight; String title = "首都航空关于" + flight;
VerifyEmailHandler.getInstance().sendEmail(title+"的开航指令提示(智能首航论证系统提示)",en+ com.ejweb.core.util.TemplateFactory.generateHtmlFromFtl(templateName, map)+plan, mails,ccmails); VerifyEmailHandler.getInstance().sendEmail(title + "的开航指令提示(智能首航论证系统提示)", en + com.ejweb.core.util.TemplateFactory.generateHtmlFromFtl(templateName, map) + plan, mails, ccmails);
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
...@@ -985,73 +988,74 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -985,73 +988,74 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} }
public List<ConnectionPlan> planlist(String fileName,String filePath){ public List<ConnectionPlan> planlist(String fileName, String filePath) {
//读取文件 //读取文件
try { try {
//获取目标文件的绝对路径 //获取目标文件的绝对路径
// String fullFileName = filePath; // String fullFileName = filePath;
String fullFileName = GConstants.FILE_UPLOAD_DIR+filePath; String fullFileName = GConstants.FILE_UPLOAD_DIR + filePath;
InputStream in = null; InputStream in = null;
in = new FileInputStream(fullFileName); in = new FileInputStream(fullFileName);
ImportExcel ei = new ImportExcel(fileName,in, 1, 0); ImportExcel ei = new ImportExcel(fileName, in, 1, 0);
try { try {
List<ConnectionPlan> lst = ei.getDataList(ConnectionPlan.class); List<ConnectionPlan> lst = ei.getDataList(ConnectionPlan.class);
List<ConnectionPlan> list=new ArrayList<ConnectionPlan>(); List<ConnectionPlan> list = new ArrayList<ConnectionPlan>();
for(ConnectionPlan p:lst){ for (ConnectionPlan p : lst) {
p.setField10(getTime(p.getField10())); p.setField10(getTime(p.getField10()));
p.setField11(getTime(p.getField11())); p.setField11(getTime(p.getField11()));
p.setField13(getTime(p.getField13())); p.setField13(getTime(p.getField13()));
p.setField14(getTime(p.getField14())); p.setField14(getTime(p.getField14()));
p.setField17(getTime(p.getField17())); p.setField17(getTime(p.getField17()));
p.setField18(getTime(p.getField18())); p.setField18(getTime(p.getField18()));
if(StringUtils.isNoneBlank(p.getField1())){ if (StringUtils.isNoneBlank(p.getField1())) {
list.add(p); list.add(p);
} }
} }
return list; return list;
} catch (InstantiationException e) { } catch (InstantiationException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} catch (InvalidFormatException e) { } catch (InvalidFormatException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
} }
return null; return null;
} }
private String getTime(String f){
private String getTime(String f) {
Pattern pattern = Pattern.compile("\\d+\\.\\d+$|-\\d+\\.\\d+$"); Pattern pattern = Pattern.compile("\\d+\\.\\d+$|-\\d+\\.\\d+$");
Matcher isNum = pattern.matcher(f); Matcher isNum = pattern.matcher(f);
if( isNum.matches() ){ if (isNum.matches()) {
Double d18=Double.parseDouble(f); Double d18 = Double.parseDouble(f);
if(d18<1){ if (d18 < 1) {
int m=(int) (d18*24*60); int m = (int) (d18 * 24 * 60);
int h=m/60; int h = m / 60;
m=m%60; m = m % 60;
Double hh=d18*24; Double hh = d18 * 24;
if(hh-h>0.999){ if (hh - h > 0.999) {
h++; h++;
m=0; m = 0;
} }
return String.format("%02d", h)+":"+String.format("%02d", m); return String.format("%02d", h) + ":" + String.format("%02d", m);
}else if(f.length()<4){ } else if (f.length() < 4) {
f=String.format("%1$4s", f); f = String.format("%1$4s", f);
return f.replaceAll(" ", "0"); return f.replaceAll(" ", "0");
} }
}else{ } else {
return f; return f;
} }
...@@ -1059,12 +1063,11 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -1059,12 +1063,11 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
} }
public void updateAirTypes(SailingCmUpdateBean bean) { public void updateAirTypes(SailingCmUpdateBean bean) {
AirlineVerifyAddBean addBean= new AirlineVerifyAddBean(); AirlineVerifyAddBean addBean = new AirlineVerifyAddBean();
List<AirType> list=new ArrayList<AirType>(); List<AirType> list = new ArrayList<AirType>();
bean.getVerify2type().forEach(p->{ bean.getVerify2type().forEach(p -> {
AirType a=new AirType(); AirType a = new AirType();
a.setTypeId(p.get("typeId")); a.setTypeId(p.get("typeId"));
a.setId(IdWorker.getNextId()); a.setId(IdWorker.getNextId());
list.add(a); list.add(a);
...@@ -1072,11 +1075,11 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin ...@@ -1072,11 +1075,11 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
addBean.setAirTypes(list); addBean.setAirTypes(list);
addBean.setUserCode(bean.getUserCode()); addBean.setUserCode(bean.getUserCode());
addBean.setId(bean.getVerifId()); addBean.setId(bean.getVerifId());
VerifyManageDeleteBean delBean=new VerifyManageDeleteBean(); VerifyManageDeleteBean delBean = new VerifyManageDeleteBean();
delBean.setDelFlag("0"); delBean.setDelFlag("0");
delBean.setVerifId(bean.getVerifId()); delBean.setVerifId(bean.getVerifId());
manageDao.delete_airline_verify2type(delBean); manageDao.delete_airline_verify2type(delBean);
verifyDao.insertAirTypes(addBean); verifyDao.insertAirTypes(addBean);
} }
} }
...@@ -512,11 +512,11 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> { ...@@ -512,11 +512,11 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> {
verifNoFrex = "XL" + year; verifNoFrex = "XL" + year;
type="05"; type="05";
} }
else if ("03".equals(verifType) || "04".equals(verifType)) { else if ("03".equals(verifType) || "04".equals(verifType) || "05".equals(verifType) || "07".equals(verifType) || "09".equals(verifType)) {
verifNoFrex = "LZC" + year; verifNoFrex = "LZC" + year;
type="04"; type="04";
} else { } else {
// 01、02、05、06、07 // 01、02、06
verifNoFrex = "LZX" + year; verifNoFrex = "LZX" + year;
type="03"; type="03";
} }
......
...@@ -311,6 +311,7 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen ...@@ -311,6 +311,7 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen
case "02": case "02":
case "03": case "03":
case "04": case "04":
case "09":
{ {
List<Connect> connects = new ArrayList<>(); List<Connect> connects = new ArrayList<>();
Connect connect = new Connect(); Connect connect = new Connect();
......
/** /**
* *
*/ */
package com.ejweb.modules.verify.service; package com.ejweb.modules.verify.service;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ejweb.core.base.BaseService; import com.ejweb.core.base.BaseService;
import com.ejweb.core.base.PageEntity; import com.ejweb.core.base.PageEntity;
import com.ejweb.core.util.IdWorker; import com.ejweb.core.util.IdWorker;
import com.ejweb.core.util.VerifyEmailHandler;
import com.ejweb.core.util.PlanUtil; import com.ejweb.core.util.PlanUtil;
import com.ejweb.modules.depart.dao.DepartDao; import com.ejweb.core.util.VerifyEmailHandler;
import com.ejweb.modules.notify.bean.NotifyAddBean; import com.ejweb.modules.notify.bean.NotifyAddBean;
import com.ejweb.modules.notify.dao.NotifyDao; import com.ejweb.modules.notify.dao.NotifyDao;
import com.ejweb.modules.verify.bean.AirlineVerifyDetailBean; import com.ejweb.modules.verify.bean.*;
import com.ejweb.modules.verify.bean.ConditionBean;
import com.ejweb.modules.verify.bean.ConditionDetailBean;
import com.ejweb.modules.verify.bean.ConditionUpdateBean;
import com.ejweb.modules.verify.bean.ConditionUpdateBean.DepartIds; import com.ejweb.modules.verify.bean.ConditionUpdateBean.DepartIds;
import com.ejweb.modules.verify.bean.FeedbackAddBean;
import com.ejweb.modules.verify.dao.AirlineVerifyDao; import com.ejweb.modules.verify.dao.AirlineVerifyDao;
import com.ejweb.modules.verify.dao.ConditionDao; import com.ejweb.modules.verify.dao.ConditionDao;
import com.ejweb.modules.verify.entity.AirlineVerifyDetailEntity; import com.ejweb.modules.verify.entity.AirlineVerifyDetailEntity;
...@@ -37,65 +20,68 @@ import com.ejweb.modules.verify.entity.ConditionEntity; ...@@ -37,65 +20,68 @@ import com.ejweb.modules.verify.entity.ConditionEntity;
import com.ejweb.modules.verify.entity.MailEntity; import com.ejweb.modules.verify.entity.MailEntity;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.util.*;
/** /**
*
* @team IT Team
* @author zhanglg * @author zhanglg
* @version 1.0 * @version 1.0
* @time 2016年9月12日 * @team IT Team
* @time 2016年9月12日
*/ */
@Service @Service
@Transactional(readOnly = true) @Transactional(readOnly = true)
public class ConditionService extends BaseService<ConditionDao>{ public class ConditionService extends BaseService<ConditionDao> {
@Autowired @Autowired
AirlineVerifyDao verifyDao; AirlineVerifyDao verifyDao;
@Autowired @Autowired
NotifyDao notifyDao; NotifyDao notifyDao;
@Autowired
private DepartDao departDao;
public PageEntity<ConditionEntity> findList(ConditionBean bean) { public PageEntity<ConditionEntity> findList(ConditionBean bean) {
PageInfo<ConditionEntity> pageInfo = null; PageInfo<ConditionEntity> pageInfo = null;
// 必须紧贴dao的查询方法 // 必须紧贴dao的查询方法
PageHelper.startPage(bean.getPageNo(), bean.getPageSize()); PageHelper.startPage(bean.getPageNo(), bean.getPageSize());
if(StringUtils.isEmpty(bean.getSort())){ if (StringUtils.isEmpty(bean.getSort())) {
PageHelper.orderBy(" verifNo DESC"); PageHelper.orderBy(" verifNo DESC");
} else {
PageHelper.orderBy(bean.getSort());
} }
else
PageHelper.orderBy(bean.getSort());
pageInfo = new PageInfo<ConditionEntity>(dao.findList(bean)); pageInfo = new PageInfo<ConditionEntity>(dao.findList(bean));
// 页码大于总页数,则返回NULL
if(pageInfo.getPages()<bean.getPageNo()){// 页码大于总页数,则返回NULL if (pageInfo.getPages() < bean.getPageNo()) {
return null; return null;
} }
List<ConditionEntity> list = pageInfo.getList(); List<ConditionEntity> list = pageInfo.getList();
if (list == null || list.size() == 0) {// 如果没有数据则返回NULL // 如果没有数据则返回NULL
return new PageEntity<ConditionEntity>(); if (list == null || list.size() == 0) {
return new PageEntity<ConditionEntity>();
} }
for(ConditionEntity entity: list){ for (ConditionEntity entity : list) {
// if("782933547965988864".equals(entity.getVerifId())){ List<Map<String, String>> list1 = verifyDao.getConnectList(entity.getVerifId());
List<Map<String, String>> list2 = new ArrayList<>();
List<Map<String, String>> list1= verifyDao.getConnectList(entity.getVerifId()); Map<String, String> map2 = null;
List<Map<String, String>> list2=new ArrayList<Map<String, String>>(); for (Map<String, String> map : list1) {
Map<String, String> map2=new HashMap<String, String>(); map2 = new HashMap<>(4);
for(Map<String, String> map:list1){ map2.put("flightNo", map.get("flightNo"));
map2.put("flightNo", map.get("flightNo")); map2.put("depIata", map.get("depIata"));
map2.put("depIata", map.get("depIata")); map2.put("arrIata", map.get("arrIata"));
map2.put("arrIata", map.get("arrIata")); map2.put("IsMain", map.get("IsMain"));
map2.put("IsMain", map.get("IsMain")); list2.add(map2);
list2.add(map2); }
}
entity.setConnect(list2);
entity.setConnect(list2); entity.setDepIataLabel(verifyDao.getConnetList(entity.getVerifId()));
entity.setDepIataLabel(verifyDao.getConnetList(entity.getVerifId())); entity.setTypeList(verifyDao.getTypeList(entity.getVerifId()));
entity.setTypeList(verifyDao.getTypeList(entity.getVerifId())); String typelist = verifyDao.getTypeList1(entity.getVerifId());
String typelist=verifyDao.getTypeList1(entity.getVerifId()); if (StringUtils.isNoneBlank(typelist)) {
if(StringUtils.isNoneBlank(typelist)) entity.setAircraftLabel(entity.getAircraftLabel() + ":" + typelist);
entity.setAircraftLabel(entity.getAircraftLabel()+":"+typelist); }
//}
} }
PageEntity<ConditionEntity> page = new PageEntity<ConditionEntity>(); PageEntity<ConditionEntity> page = new PageEntity<ConditionEntity>();
page.setPageNo(pageInfo.getPageNum()); page.setPageNo(pageInfo.getPageNum());
...@@ -105,108 +91,111 @@ public class ConditionService extends BaseService<ConditionDao>{ ...@@ -105,108 +91,111 @@ public class ConditionService extends BaseService<ConditionDao>{
page.setList(list); page.setList(list);
return page; return page;
} }
@Transactional(readOnly = false) @Transactional(readOnly = false)
public int updateAndAdd(ConditionUpdateBean bean){ public int updateAndAdd(ConditionUpdateBean bean) {
dao.updateFeedback(bean); dao.updateFeedback(bean);
dao.deleteFeedback(bean); dao.deleteFeedback(bean);
List<String> lst=new ArrayList<String>(); List<String> lst = new ArrayList<String>();
for(DepartIds departId : bean.getDepartIds()){ for (DepartIds departId : bean.getDepartIds()) {
lst.add(departId.getDepartId()); lst.add(departId.getDepartId());
FeedbackAddBean feedbean=new FeedbackAddBean(); FeedbackAddBean feedbean = new FeedbackAddBean();
feedbean.setConditionId(bean.getConditionId()); feedbean.setConditionId(bean.getConditionId());
feedbean.setVerifId(bean.getVerifId()); feedbean.setVerifId(bean.getVerifId());
feedbean.setDepartId(departId.getDepartId()); feedbean.setDepartId(departId.getDepartId());
String cid=IdWorker.getNextId(); String cid = IdWorker.getNextId();
feedbean.setId(cid); feedbean.setId(cid);
feedbean.setUserCode(bean.getUserCode()); feedbean.setUserCode(bean.getUserCode());
dao.insertfeedback(feedbean); dao.insertfeedback(feedbean);
// 条件反馈提醒 // 条件反馈提醒
AirlineVerifyDetailBean verifybean = new AirlineVerifyDetailBean(); AirlineVerifyDetailBean verifybean = new AirlineVerifyDetailBean();
verifybean.setVerifId(bean.getVerifId()); verifybean.setVerifId(bean.getVerifId());
AirlineVerifyDetailEntity VerifyDetailEntity = verifyDao.get(verifybean); AirlineVerifyDetailEntity VerifyDetailEntity = verifyDao.get(verifybean);
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
Map<String, String> map=verifyDao.getDetail(bean.getVerifId()); Map<String, String> map = verifyDao.getDetail(bean.getVerifId());
map.put("depName", PlanUtil.GetLine(map.get("depName"),map.get("arrName"),map.get("roundtripType"),map.get("vertype"))); map.put("depName", PlanUtil.GetLine(map.get("depName"), map.get("arrName"), map.get("roundtripType"), map.get("vertype")));
map.put("depIata", PlanUtil.GetLine(map.get("depIata"),map.get("arrIata"),map.get("roundtripType"),map.get("vertype"))); sb.append("论证单号为").append(VerifyDetailEntity.getVerifNo()) map.put("depIata", PlanUtil.GetLine(map.get("depIata"), map.get("arrIata"), map.get("roundtripType"), map.get("vertype")));
.append(map.get("verifType")).append(map.get("depName")) sb.append("论证单号为").append(VerifyDetailEntity.getVerifNo())
.append("的航线产生一条论证条件需要您进行配合评估,请尽快进行反馈。"); .append(map.get("verifType")).append(map.get("depName"))
StringBuffer url=new StringBuffer(); .append("的航线产生一条论证条件需要您进行配合评估,请尽快进行反馈。");
url.append("<<<a href='argument-condition-estimate-details.htm?verifId=").append(bean.getVerifId()); StringBuffer url = new StringBuffer();
url.append("&verifNo=").append(map.get("verifNo")); url.append("<<<a href='argument-condition-estimate-details.htm?verifId=").append(bean.getVerifId());
url.append("&departType=02&cid=").append(bean.getConditionId()); url.append("&verifNo=").append(map.get("verifNo"));
url.append("'>点击查看</a>"); url.append("&departType=02&cid=").append(bean.getConditionId());
url.append("'>点击查看</a>");
NotifyAddBean addbean = new NotifyAddBean();
addbean.setUrl(url.toString()); NotifyAddBean addbean = new NotifyAddBean();
addbean.setType("7"); addbean.setUrl(url.toString());
addbean.setContent(sb.toString()); addbean.setType("7");
addbean.setTitle("条件反馈提醒"); addbean.setContent(sb.toString());
addbean.setCreateBy(bean.getUserCode()); addbean.setTitle("条件反馈提醒");
addbean.setUpdateBy(bean.getUserCode()); addbean.setCreateBy(bean.getUserCode());
addbean.setCreateDate(new Date()); addbean.setUpdateBy(bean.getUserCode());
addbean.setUpdateDate(new Date()); addbean.setCreateDate(new Date());
addbean.setId(IdWorker.getNextId()); addbean.setUpdateDate(new Date());
addbean.setDepartId(departId.getDepartId()); addbean.setId(IdWorker.getNextId());
addbean.setVerifId(bean.getConditionId()); addbean.setDepartId(departId.getDepartId());
addbean.setConId(bean.getVerifId()); addbean.setVerifId(bean.getConditionId());
notifyDao.saveNotify(addbean); addbean.setConId(bean.getVerifId());
} notifyDao.saveNotify(addbean);
sendmail(bean.getVerifId(),bean.getConditionId(),lst); }
// 完成审核通知置灰 sendmail(bean.getVerifId(), bean.getConditionId(), lst);
NotifyAddBean addbean=new NotifyAddBean(); // 完成审核通知置灰
addbean.setVerifId(bean.getConditionId()); NotifyAddBean addbean = new NotifyAddBean();
addbean.setType("6"); addbean.setVerifId(bean.getConditionId());
notifyDao.NotifyComplete(addbean); addbean.setType("6");
return 0; notifyDao.NotifyComplete(addbean);
return 0;
} }
public ConditionDetailEntity getDetail(ConditionDetailBean bean){
public ConditionDetailEntity getDetail(ConditionDetailBean bean) {
return dao.getDetail(bean); return dao.getDetail(bean);
} }
/** /**
*
* @author zhanglg
* @time 2016年9月20日
* @param bean * @param bean
* @return * @return
* @author zhanglg
* @time 2016年9月20日
*/ */
public List<ConditionEntity> findAllList(ConditionBean bean) { public List<ConditionEntity> findAllList(ConditionBean bean) {
return dao.findAllList( bean); return dao.findAllList(bean);
} }
public void sendmail(String verifId,String conditionId, List<String> lst) {
public void sendmail(String verifId, String conditionId, List<String> lst) {
List<String> ccmails= verifyDao.getmail("6");
MailEntity entity1=new MailEntity(); List<String> ccmails = verifyDao.getmail("6");
MailEntity entity1 = new MailEntity();
entity1.setType("6"); entity1.setType("6");
entity1.setList(lst); entity1.setList(lst);
List<String> mails= verifyDao.getmailNew1(entity1); List<String> mails = verifyDao.getmailNew1(entity1);
if(mails==null||mails.size()==0)return; if (mails == null || mails.size() == 0) return;
String templateName = "template_6.ftl"; String templateName = "template_6.ftl";
Map<String, String> map=verifyDao.getDetail(verifId); Map<String, String> map = verifyDao.getDetail(verifId);
map.put("url", "https://ifos.jdair.net/im/login"); map.put("url", "https://ifos.jdair.net/im/login");
map.put("depName", PlanUtil.GetLine(map.get("depName"),map.get("arrName"),map.get("roundtripType"),map.get("vertype"))); map.put("depName", PlanUtil.GetLine(map.get("depName"), map.get("arrName"), map.get("roundtripType"), map.get("vertype")));
map.put("depIata", PlanUtil.GetLine(map.get("depIata"),map.get("arrIata"),map.get("roundtripType"),map.get("vertype"))); Map<String, String> map1=dao.getCondition(conditionId); map.put("depIata", PlanUtil.GetLine(map.get("depIata"), map.get("arrIata"), map.get("roundtripType"), map.get("vertype")));
Map<String, String> map1 = dao.getCondition(conditionId);
try { try {
if("02".equals(map1.get("verifyStatus"))){ if ("02".equals(map1.get("verifyStatus"))) {
map.put("feedback","不可行"); map.put("feedback", "不可行");
}else if("03".equals(map1.get("verifyStatus"))){ } else if ("03".equals(map1.get("verifyStatus"))) {
map.put("feedback","条件可行"); map.put("feedback", "条件可行");
}else{ } else {
return; return;
} }
map.put("condition",map1.get("condition")); map.put("condition", map1.get("condition"));
map.put("backName", map1.get("departName")); map.put("backName", map1.get("departName"));
String flight =PlanUtil.flightContent(map); String flight = PlanUtil.flightContent(map);
String line =PlanUtil.lineContent(map); String line = PlanUtil.lineContent(map);
map.put("line", line); map.put("line", line);
String title="首都航空关于"+flight; String title = "首都航空关于" + flight;
VerifyEmailHandler.getInstance().sendEmail(title+"的论证条件流转的提示(智能首航论证系统提示)", com.ejweb.core.util.TemplateFactory.generateHtmlFromFtl(templateName, map), mails,ccmails); VerifyEmailHandler.getInstance().sendEmail(title + "的论证条件流转的提示(智能首航论证系统提示)", com.ejweb.core.util.TemplateFactory.generateHtmlFromFtl(templateName, map), mails, ccmails);
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
......
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