Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
首航-临时账号
api
Commits
0e81751d
Commit
0e81751d
authored
Jul 03, 2018
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改论证类型
parent
9eee3809
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
430 additions
and
434 deletions
+430
-434
AirlineVerifyDao.xml
resources/mapper/modules/verify/AirlineVerifyDao.xml
+4
-2
SecurityPropertyPlaceholderConfigurer.java
src/com/ejweb/core/conf/SecurityPropertyPlaceholderConfigurer.java
+2
-2
PlanUtil.java
src/com/ejweb/core/util/PlanUtil.java
+2
-1
SailingCommandService.java
src/com/ejweb/modules/sailing/service/SailingCommandService.java
+292
-289
AirlineVerifiedService.java
src/com/ejweb/modules/verify/service/AirlineVerifiedService.java
+2
-2
AirlineVerifyService.java
src/com/ejweb/modules/verify/service/AirlineVerifyService.java
+1
-0
ConditionService.java
src/com/ejweb/modules/verify/service/ConditionService.java
+127
-138
No files found.
resources/mapper/modules/verify/AirlineVerifyDao.xml
View file @
0e81751d
...
...
@@ -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 = '03'
OR a.verif_type = '04'
OR a.verif_type = '05' THEN
OR a.verif_type = '05'
OR a.verif_type = '09' THEN
tmp.depName
ELSE
r.airport_name
...
...
@@ -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 = '03'
OR a.verif_type = '04'
OR a.verif_type = '05' THEN
OR a.verif_type = '05'
OR a.verif_type = '09' THEN
tmp.depIata
ELSE
a.depIata
...
...
src/com/ejweb/core/conf/SecurityPropertyPlaceholderConfigurer.java
View file @
0e81751d
...
...
@@ -245,10 +245,10 @@ public class SecurityPropertyPlaceholderConfigurer extends PropertyPlaceholderCo
// String decrypted = DES3Utils.decrypt("dc6788486fc8fa4660890b4cba7ee6ada527e2e604dbe7fa0fdcf7401a0dd11996450d7fea85f2d9724b7d8fff30a4826c098fd51da0815035030eec22e491802aa2975c67259d9ca89540576b301b6d", CONF_DESC_KEY);
// 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);//定义密钥
// 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) {
// e.printStackTrace();
// }
...
...
src/com/ejweb/core/util/PlanUtil.java
View file @
0e81751d
...
...
@@ -233,7 +233,8 @@ public class PlanUtil {
case
"02"
:
case
"03"
:
case
"04"
:
case
"09"
:
if
(
StringUtils
.
isBlank
(
start
)&&
StringUtils
.
isBlank
(
end
)){
return
""
;
...
...
src/com/ejweb/modules/sailing/service/SailingCommandService.java
View file @
0e81751d
/**
*
*
*/
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.PageEntity
;
import
com.ejweb.core.conf.GConstants
;
...
...
@@ -58,49 +37,62 @@ import com.ejweb.modules.verify.entity.ConnectionPlan;
import
com.ejweb.modules.verify.entity.MailEntity
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
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
* @version 1.0
* @team suzhou
* @time 2016年9月5日
*/
@Service
public
class
SailingCommandService
extends
CurdService
<
SailingCommandDao
,
SailingCommandEntity
>
{
@Autowired
private
AirlineVerifyDao
verifyDao
;
private
AirlineVerifyDao
verifyDao
;
@Autowired
RouteVerifyDao
routeVerifyDao
;
RouteVerifyDao
routeVerifyDao
;
@Autowired
AssessmentDao
assessmentDao
;
@Autowired
private
NotifyDao
notifyDao
;
@Autowired
@Autowired
private
VerifyManageDao
manageDao
;
/**
* 开航指令分页查询
*
* @author huhy
* @time 2016年9月6日
*
* @param bean
* @return
* @author huhy
* @time 2016年9月6日
*/
public
PageEntity
<
SailingCommandEntity
>
getCommandList
(
SailingCommandBean
bean
)
{
PageInfo
<
SailingCommandEntity
>
pageInfo
=
null
;
// 必须紧贴dao的查询方法
PageHelper
.
startPage
(
bean
.
getPageNo
(),
bean
.
getPageSize
());
if
(
StringUtils
.
isEmpty
(
bean
.
getSort
()))
{
if
(
StringUtils
.
isEmpty
(
bean
.
getSort
()))
{
PageHelper
.
orderBy
(
" verifNo DESC"
);
}
else
PageHelper
.
orderBy
(
bean
.
getSort
());
}
else
PageHelper
.
orderBy
(
bean
.
getSort
());
pageInfo
=
new
PageInfo
<
SailingCommandEntity
>(
dao
.
getList
(
bean
));
if
(
pageInfo
.
getPages
()
<
bean
.
getPageNo
())
{
// 页码大于总页数,则返回NULL
return
null
;
}
...
...
@@ -109,17 +101,17 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
if
(
list
==
null
||
list
.
size
()
==
0
)
{
// 如果没有数据则返回NULL
return
null
;
}
for
(
SailingCommandEntity
entity:
list
)
{
List
<
String
>
lst
=
verifyDao
.
getTypeList
(
entity
.
getVerifId
());
if
(
lst
!=
null
&&
lst
.
size
()!=
0
)
{
for
(
SailingCommandEntity
entity
:
list
)
{
List
<
String
>
lst
=
verifyDao
.
getTypeList
(
entity
.
getVerifId
());
if
(
lst
!=
null
&&
lst
.
size
()
!=
0
)
{
entity
.
setTypeList
(
verifyDao
.
getTypeList
(
entity
.
getVerifId
()));
}
entity
.
setConnect
(
verifyDao
.
getConnectList
(
entity
.
getVerifId
()));
entity
.
setDepName
(
verifyDao
.
getConnetList
(
entity
.
getVerifId
()));
String
typelist
=
verifyDao
.
getTypeList1
(
entity
.
getVerifId
());
if
(
StringUtils
.
isNoneBlank
(
typelist
))
entity
.
setAircraftName
(
entity
.
getAircraftName
()
+
":"
+
typelist
);
String
typelist
=
verifyDao
.
getTypeList1
(
entity
.
getVerifId
());
if
(
StringUtils
.
isNoneBlank
(
typelist
))
entity
.
setAircraftName
(
entity
.
getAircraftName
()
+
":"
+
typelist
);
}
PageEntity
<
SailingCommandEntity
>
page
=
new
PageEntity
<
SailingCommandEntity
>();
page
.
setPageNo
(
pageInfo
.
getPageNum
());
...
...
@@ -132,90 +124,96 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
/**
* 开航指令详细信息
* @author huhy
* @time 2016年9月6日
*
* @param bean
* @return
* @author huhy
* @time 2016年9月6日
*/
@Transactional
(
readOnly
=
false
)
@Transactional
(
readOnly
=
false
)
public
SailingCdDeatailEntity
updateAndGetCommandDetail
(
SailingCmDetailBean
bean
)
{
SailingCdDeatailEntity
entity
=
dao
.
getSailingDetail
(
bean
);
// String formText = "";
if
(
entity
!=
null
)
{
AirlineVerifyDetailBean
dbean
=
new
AirlineVerifyDetailBean
();
// String formText = "";
if
(
entity
!=
null
)
{
AirlineVerifyDetailBean
dbean
=
new
AirlineVerifyDetailBean
();
dbean
.
setVerifId
(
bean
.
getVerifId
());
entity
.
setVerify2type
(
verifyDao
.
getVerify2typeList
(
dbean
));
// 去掉历史快照 及 开航指令单
// entity.setHistory(verifyDao.getHistoryList(entity.getId()));
// entity.setHistory(verifyDao.getHistoryList(entity.getId()));
/* if(StringUtils.isEmpty(entity.getFormText())){
bean.setVerifType(entity.getVerifType());
formText = dao.getformText(bean);
entity.setFormText(formText);
}*/
entity
.
setFormText
(
"."
);
AssessmentFindListBean
bn
=
new
AssessmentFindListBean
();
entity
.
setFormText
(
"."
);
AssessmentFindListBean
bn
=
new
AssessmentFindListBean
();
bn
.
setVerifId
(
bean
.
getVerifId
());
List
<
AssessmentFindListEntity
>
riskList
=
assessmentDao
.
getAssessmentFindList
(
bn
);
List
<
AssessmentFindListEntity
>
riskList
=
assessmentDao
.
getAssessmentFindList
(
bn
);
entity
.
setRiskList
(
riskList
);
AirlineVerifyDetailBean
airBean
=
new
AirlineVerifyDetailBean
();
AirlineVerifyDetailBean
airBean
=
new
AirlineVerifyDetailBean
();
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
()));
if
(
listm
!=
null
&&
listm
.
size
()>
0
)
{
Map
<
String
,
String
>
map
=
listm
.
get
(
0
);
String
fileName
=
map
.
get
(
"fileName"
);
String
filePath
=
map
.
get
(
"filePath"
);
List
<
ConnectionPlan
>
lst
=
planlist
(
fileName
,
filePath
);
entity
.
setConnectionPlan
(
lst
);
if
(
listm
!=
null
&&
listm
.
size
()
>
0
)
{
Map
<
String
,
String
>
map
=
listm
.
get
(
0
);
String
fileName
=
map
.
get
(
"fileName"
);
String
filePath
=
map
.
get
(
"filePath"
);
List
<
ConnectionPlan
>
lst
=
planlist
(
fileName
,
filePath
);
entity
.
setConnectionPlan
(
lst
);
}
if
(
StringUtils
.
isEmpty
(
entity
.
getVerifyText
()))
{
RouteVerifyBean
routebean
=
new
RouteVerifyBean
();
if
(
StringUtils
.
isEmpty
(
entity
.
getVerifyText
()))
{
RouteVerifyBean
routebean
=
new
RouteVerifyBean
();
routebean
.
setVerifId
(
bean
.
getVerifId
());
List
<
RouteVerifyEntity
>
list
=
routeVerifyDao
.
findlist
(
routebean
);
StringBuffer
sb
=
new
StringBuffer
();
for
(
RouteVerifyEntity
route
:
list
){
sb
.
append
(
route
.
getFormText
());
sb
.
append
(
"<table width=\"80%\"><tr>"
);
sb
.
append
(
"<td height=\"104\" width=\"197\">论证意见</td>"
);
sb
.
append
(
"<td>"
);
switch
(
route
.
getVerifyStatus
()){
case
"00"
:
sb
.
append
(
"无意见"
);
break
;
case
"01"
:
sb
.
append
(
"可行"
);
break
;
case
"02"
:
sb
.
append
(
"不可行"
);
break
;
case
"03"
:
sb
.
append
(
"条件可行"
);
break
;
case
"04"
:
sb
.
append
(
"条件满足"
);
break
;
}
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/>"
);
}
List
<
RouteVerifyEntity
>
list
=
routeVerifyDao
.
findlist
(
routebean
);
StringBuffer
sb
=
new
StringBuffer
();
for
(
RouteVerifyEntity
route
:
list
)
{
sb
.
append
(
route
.
getFormText
());
sb
.
append
(
"<table width=\"80%\"><tr>"
);
sb
.
append
(
"<td height=\"104\" width=\"197\">论证意见</td>"
);
sb
.
append
(
"<td>"
);
switch
(
route
.
getVerifyStatus
())
{
case
"00"
:
sb
.
append
(
"无意见"
);
break
;
case
"01"
:
sb
.
append
(
"可行"
);
break
;
case
"02"
:
sb
.
append
(
"不可行"
);
break
;
case
"03"
:
sb
.
append
(
"条件可行"
);
break
;
case
"04"
:
sb
.
append
(
"条件满足"
);
break
;
}
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
());
}
Map
<
String
,
String
>
map
=
verifyDao
.
getDetail
(
entity
.
getVerifId
());
if
(
StringUtils
.
isEmpty
(
entity
.
getSailingText
()))
{
entity
.
setSailingText
(
updateAndGetSailingText
(
entity
,
map
));
Map
<
String
,
String
>
map
=
verifyDao
.
getDetail
(
entity
.
getVerifId
());
if
(
StringUtils
.
isEmpty
(
entity
.
getSailingText
()))
{
entity
.
setSailingText
(
updateAndGetSailingText
(
entity
,
map
));
}
if
(
StringUtils
.
isEmpty
(
entity
.
getConRemarks
()))
{
StringBuilder
sb
=
new
StringBuilder
();
if
(
StringUtils
.
isEmpty
(
entity
.
getConRemarks
()))
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"<table><tr>"
);
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
(
"<td height=\"104\">航路类型</td>"
);
sb
.
append
(
"<td>"
).
append
(
entity
.
getRouteType
()).
append
(
"</td>"
);
...
...
@@ -231,56 +229,58 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
sb
.
append
(
"</tr></table>"
);
entity
.
setConRemarks
(
sb
.
toString
());
}
}
return
entity
;
}
/**
*
* @author zhanglg
* @time 2016年12月15日
* @param entity
* @author zhanglg
* @time 2016年12月15日
*/
@Transactional
(
readOnly
=
false
)
private
String
updateAndGetSailingText
(
SailingCdDeatailEntity
entity
,
Map
<
String
,
String
>
map
)
{
String
depName
=
map
.
get
(
"depName"
);
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map
.
get
(
"depIata"
),
map
.
get
(
"arrIata"
),
map
.
get
(
"roundtripType"
),
map
.
get
(
"vertype"
)));
}
String
vertype
=
""
;
switch
(
map
.
get
(
"vertype"
)){
case
"01"
:
case
"02"
:
vertype
=
"新开航线"
;
break
;
case
"03"
:
case
"04"
:
vertype
=
"重开航线"
;
break
;
case
"05"
:
vertype
=
"调机"
;
break
;
case
"06"
:
vertype
=
"备降场"
;
break
;
case
"07"
:
vertype
=
"过夜机场"
;
@Transactional
(
readOnly
=
false
)
private
String
updateAndGetSailingText
(
SailingCdDeatailEntity
entity
,
Map
<
String
,
String
>
map
)
{
String
depName
=
map
.
get
(
"depName"
);
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map
.
get
(
"depIata"
),
map
.
get
(
"arrIata"
),
map
.
get
(
"roundtripType"
),
map
.
get
(
"vertype"
)));
}
String
vertype
=
""
;
switch
(
map
.
get
(
"vertype"
))
{
case
"01"
:
case
"02"
:
vertype
=
"新开航线"
;
break
;
case
"03"
:
case
"04"
:
vertype
=
"重开航线"
;
break
;
case
"05"
:
vertype
=
"调机"
;
break
;
case
"06"
:
vertype
=
"备降场"
;
break
;
case
"07"
:
vertype
=
"过夜机场"
;
break
;
case
"08"
:
vertype
=
"训练场"
;
break
;
case
"09"
:
vertype
=
"计划变更"
;
break
;
case
"08"
:
vertype
=
"训练场"
;
break
;
}
String
routeNo
=
entity
.
getRouteNo
();
if
(
StringUtils
.
isBlank
(
routeNo
))
{
if
(
StringUtils
.
isBlank
(
routeNo
))
{
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
(
"<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\">"
);
...
...
@@ -289,44 +289,45 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
sb
.
append
(
"\"/>"
);
sb
.
append
(
"</td>"
);
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
(
"<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
(
"<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>"
);
int
n
=
1
;
switch
(
map
.
get
(
"vertype"
)){
case
"01"
:
case
"02"
:
case
"03"
:
case
"04"
:
case
"05"
:
for
(
Map
<
String
,
String
>
map1:
entity
.
getConnect
()){
sb
.
append
(
"<tr style=\"text-align:center\"><td>"
);
sb
.
append
(
n
).
append
(
"</td><td>"
);
sb
.
append
(
map1
.
get
(
"flightNo"
));
int
n
=
1
;
switch
(
map
.
get
(
"vertype"
))
{
case
"01"
:
case
"02"
:
case
"03"
:
case
"04"
:
case
"05"
:
case
"09"
:
for
(
Map
<
String
,
String
>
map1
:
entity
.
getConnect
())
{
sb
.
append
(
"<tr style=\"text-align:center\"><td>"
);
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
(
map
1
.
get
(
"depName"
)+
"="
+
map1
.
get
(
"arr
Name"
));
sb
.
append
(
map
.
get
(
"airport
Name"
));
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
(
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
(
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
;
break
;
}
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\">北京首都航空有限公司拟于"
);
...
...
@@ -346,11 +347,12 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
/**
* 开航指令修改
* @author huhy
* @time 2016年9月6日
*
* @param bean
* @author huhy
* @time 2016年9月6日
*/
@Transactional
(
readOnly
=
false
)
@Transactional
(
readOnly
=
false
)
public
Boolean
update
(
SailingCmUpdateBean
bean
)
{
String
verifType
=
""
;
String
routeNo
=
""
;
...
...
@@ -632,13 +634,15 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
return
true
;
}
/**
* 开航指令修改
* @author huhy
* @time 2016年9月6日
*
* @param bean
* @author huhy
* @time 2016年9月6日
*/
@Transactional
(
readOnly
=
false
)
@Transactional
(
readOnly
=
false
)
public
Boolean
updateFile
(
SailingCmUpdateBean
bean
)
{
String
verifType
=
""
;
String
routeNo
=
""
;
...
...
@@ -880,28 +884,28 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
private
static
String
getLastDate
(
String
datestr
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Date
date
=
null
;
try
{
date
=
sdf
.
parse
(
datestr
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Date
date
=
null
;
try
{
date
=
sdf
.
parse
(
datestr
);
}
catch
(
ParseException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
add
(
Calendar
.
MONTH
,
-
1
);
return
sdf
.
format
(
cal
.
getTime
());
}
/**
*
* @author huhy
* @time 2016年9月6日
* @param entity
* @param verifType
* @return
* @author huhy
* @time 2016年9月6日
*/
@Transactional
(
readOnly
=
false
)
@Transactional
(
readOnly
=
false
)
public
String
updateAndrGenertRouteNo
(
String
verifType
)
{
DateFormat
df
=
new
SimpleDateFormat
(
"yyyy"
);
String
routeNo
=
""
;
...
...
@@ -911,72 +915,71 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
String
type
;
if
(
"08"
.
equals
(
verifType
))
{
routeNoFrex
=
"XLKH"
+
year
;
type
=
"07"
;
}
else
{
type
=
"07"
;
}
else
{
routeNoFrex
=
"KH"
+
year
;
type
=
"06"
;
type
=
"06"
;
}
sailingCommandEntity
.
setRouteNo
(
routeNoFrex
);
routeNo
=
dao
.
getVerifNo
(
routeNoFrex
);
if
(
StringUtils
.
isBlank
(
routeNo
))
{
routeNo
=
dao
.
getVerifNo
(
routeNoFrex
);
if
(
StringUtils
.
isBlank
(
routeNo
))
{
routeNo
=
dao
.
findRouteNo
(
sailingCommandEntity
);
}
else
{
}
else
{
verifyDao
.
updateNo
(
type
);
}
if
(
StringUtils
.
isBlank
(
routeNo
))
{
routeNo
=
routeNoFrex
+
"001"
;
}
else
{
if
(
StringUtils
.
isBlank
(
routeNo
))
{
routeNo
=
routeNoFrex
+
"001"
;
}
else
{
routeNo
=
routeNoFrex
+
String
.
format
(
"%03d"
,
Integer
.
valueOf
(
routeNo
)
+
1
);
}
return
routeNo
;
}
public
List
<
Map
<
String
,
String
>>
getCommandFile
(
SailingCmDetailBean
bean
)
{
// TODO Auto-generated method stub
List
<
Map
<
String
,
String
>>
list
=
dao
.
getCommandFile
(
bean
);
if
(
list
.
size
()>
0
)
{
Map
<
String
,
String
>
map1
=
verifyDao
.
getDetail
(
bean
.
getVerifId
());
String
depName
=
map1
.
get
(
"depName"
);
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map1
.
get
(
"depIata"
),
map1
.
get
(
"arrIata"
),
map1
.
get
(
"roundtripType"
),
map1
.
get
(
"vertype"
)));
}
Map
<
String
,
String
>
map
=
list
.
get
(
0
);
map
.
put
(
"fileName"
,
"北京首都航空关于使用"
+
map1
.
get
(
"aircraftLabel"
)+
"机型执行"
+
map1
.
get
(
"depName"
)+
map1
.
get
(
"verifType"
)+
"航线的开航指令("
+
map1
.
get
(
"routeNo"
)+
").doc"
);
List
<
Map
<
String
,
String
>>
list
=
dao
.
getCommandFile
(
bean
);
if
(
list
.
size
()
>
0
)
{
Map
<
String
,
String
>
map1
=
verifyDao
.
getDetail
(
bean
.
getVerifId
());
String
depName
=
map1
.
get
(
"depName"
);
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map1
.
get
(
"depIata"
),
map1
.
get
(
"arrIata"
),
map1
.
get
(
"roundtripType"
),
map1
.
get
(
"vertype"
)));
}
Map
<
String
,
String
>
map
=
list
.
get
(
0
);
map
.
put
(
"fileName"
,
"北京首都航空关于使用"
+
map1
.
get
(
"aircraftLabel"
)
+
"机型执行"
+
map1
.
get
(
"depName"
)
+
map1
.
get
(
"verifType"
)
+
"航线的开航指令("
+
map1
.
get
(
"routeNo"
)
+
").doc"
);
}
return
list
;
}
public
void
sendMail
(
String
verifId
,
String
plan
,
String
routeNo
)
{
List
<
String
>
ccmails
=
verifyDao
.
getmail
(
"9"
);
List
<
String
>
mails
=
verifyDao
.
getmailYK
(
new
MailEntity
());
if
(
mails
==
null
||
mails
.
size
()==
0
)
return
;
public
void
sendMail
(
String
verifId
,
String
plan
,
String
routeNo
)
{
List
<
String
>
ccmails
=
verifyDao
.
getmail
(
"9"
);
List
<
String
>
mails
=
verifyDao
.
getmailYK
(
new
MailEntity
());
if
(
mails
==
null
||
mails
.
size
()
==
0
)
return
;
String
templateName
=
"template_9.ftl"
;
Map
<
String
,
String
>
map
=
verifyDao
.
getDetail
(
verifId
);
String
depName
=
map
.
get
(
"depName"
);
String
flight
=
PlanUtil
.
flightContent
(
map
);
String
line
=
PlanUtil
.
lineContent
(
map
);
Map
<
String
,
String
>
map
=
verifyDao
.
getDetail
(
verifId
);
String
depName
=
map
.
get
(
"depName"
);
String
flight
=
PlanUtil
.
flightContent
(
map
);
String
line
=
PlanUtil
.
lineContent
(
map
);
map
.
put
(
"line"
,
line
);
map
.
put
(
"lineEN"
,
PlanUtil
.
lineENContent
(
map
));
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map
.
get
(
"depIata"
),
map
.
get
(
"arrIata"
),
map
.
get
(
"roundtripType"
),
map
.
get
(
"vertype"
)));
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map
.
get
(
"depIata"
),
map
.
get
(
"arrIata"
),
map
.
get
(
"roundtripType"
),
map
.
get
(
"vertype"
)));
}
map
.
put
(
"url"
,
"https://ifos.jdair.net/im/login"
);
if
(!
map
.
containsKey
(
"routeNo"
))
{
map
.
put
(
"routeNo"
,
routeNo
);
if
(!
map
.
containsKey
(
"routeNo"
))
{
map
.
put
(
"routeNo"
,
routeNo
);
}
try
{
String
en
=
com
.
ejweb
.
core
.
util
.
TemplateFactory
.
generateHtmlFromFtl
(
"template_en_9.ftl"
,
map
);
String
title
=
"首都航空关于"
+
flight
;
VerifyEmailHandler
.
getInstance
().
sendEmail
(
title
+
"的开航指令提示(智能首航论证系统提示)"
,
en
+
com
.
ejweb
.
core
.
util
.
TemplateFactory
.
generateHtmlFromFtl
(
templateName
,
map
)+
plan
,
mails
,
ccmails
);
String
en
=
com
.
ejweb
.
core
.
util
.
TemplateFactory
.
generateHtmlFromFtl
(
"template_en_9.ftl"
,
map
);
String
title
=
"首都航空关于"
+
flight
;
VerifyEmailHandler
.
getInstance
().
sendEmail
(
title
+
"的开航指令提示(智能首航论证系统提示)"
,
en
+
com
.
ejweb
.
core
.
util
.
TemplateFactory
.
generateHtmlFromFtl
(
templateName
,
map
)
+
plan
,
mails
,
ccmails
);
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
...
...
@@ -985,73 +988,74 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
public
List
<
ConnectionPlan
>
planlist
(
String
fileName
,
String
filePath
)
{
public
List
<
ConnectionPlan
>
planlist
(
String
fileName
,
String
filePath
)
{
//读取文件
try
{
//获取目标文件的绝对路径
// String fullFileName = filePath;
String
fullFileName
=
GConstants
.
FILE_UPLOAD_DIR
+
filePath
;
// String fullFileName = filePath;
String
fullFileName
=
GConstants
.
FILE_UPLOAD_DIR
+
filePath
;
InputStream
in
=
null
;
in
=
new
FileInputStream
(
fullFileName
);
ImportExcel
ei
=
new
ImportExcel
(
fileName
,
in
,
1
,
0
);
try
{
List
<
ConnectionPlan
>
lst
=
ei
.
getDataList
(
ConnectionPlan
.
class
);
List
<
ConnectionPlan
>
list
=
new
ArrayList
<
ConnectionPlan
>();
for
(
ConnectionPlan
p:
lst
)
{
p
.
setField10
(
getTime
(
p
.
getField10
()));
p
.
setField11
(
getTime
(
p
.
getField11
()));
p
.
setField13
(
getTime
(
p
.
getField13
()));
p
.
setField14
(
getTime
(
p
.
getField14
()));
p
.
setField17
(
getTime
(
p
.
getField17
()));
p
.
setField18
(
getTime
(
p
.
getField18
()));
if
(
StringUtils
.
isNoneBlank
(
p
.
getField1
()))
{
list
.
add
(
p
);
}
}
return
list
;
}
catch
(
InstantiationException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
InvalidFormatException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
in
=
new
FileInputStream
(
fullFileName
);
ImportExcel
ei
=
new
ImportExcel
(
fileName
,
in
,
1
,
0
);
try
{
List
<
ConnectionPlan
>
lst
=
ei
.
getDataList
(
ConnectionPlan
.
class
);
List
<
ConnectionPlan
>
list
=
new
ArrayList
<
ConnectionPlan
>();
for
(
ConnectionPlan
p
:
lst
)
{
p
.
setField10
(
getTime
(
p
.
getField10
()));
p
.
setField11
(
getTime
(
p
.
getField11
()));
p
.
setField13
(
getTime
(
p
.
getField13
()));
p
.
setField14
(
getTime
(
p
.
getField14
()));
p
.
setField17
(
getTime
(
p
.
getField17
()));
p
.
setField18
(
getTime
(
p
.
getField18
()));
if
(
StringUtils
.
isNoneBlank
(
p
.
getField1
()))
{
list
.
add
(
p
);
}
}
return
list
;
}
catch
(
InstantiationException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
InvalidFormatException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
return
null
;
}
private
String
getTime
(
String
f
){
private
String
getTime
(
String
f
)
{
Pattern
pattern
=
Pattern
.
compile
(
"\\d+\\.\\d+$|-\\d+\\.\\d+$"
);
Matcher
isNum
=
pattern
.
matcher
(
f
);
if
(
isNum
.
matches
()
)
{
Double
d18
=
Double
.
parseDouble
(
f
);
if
(
d18
<
1
)
{
int
m
=(
int
)
(
d18
*
24
*
60
);
int
h
=
m
/
60
;
m
=
m
%
60
;
Double
hh
=
d18
*
24
;
if
(
hh
-
h
>
0.999
)
{
if
(
isNum
.
matches
())
{
Double
d18
=
Double
.
parseDouble
(
f
);
if
(
d18
<
1
)
{
int
m
=
(
int
)
(
d18
*
24
*
60
);
int
h
=
m
/
60
;
m
=
m
%
60
;
Double
hh
=
d18
*
24
;
if
(
hh
-
h
>
0.999
)
{
h
++;
m
=
0
;
m
=
0
;
}
return
String
.
format
(
"%02d"
,
h
)
+
":"
+
String
.
format
(
"%02d"
,
m
);
}
else
if
(
f
.
length
()<
4
)
{
f
=
String
.
format
(
"%1$4s"
,
f
);
return
String
.
format
(
"%02d"
,
h
)
+
":"
+
String
.
format
(
"%02d"
,
m
);
}
else
if
(
f
.
length
()
<
4
)
{
f
=
String
.
format
(
"%1$4s"
,
f
);
return
f
.
replaceAll
(
" "
,
"0"
);
}
}
else
{
}
else
{
return
f
;
}
...
...
@@ -1059,12 +1063,11 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
}
public
void
updateAirTypes
(
SailingCmUpdateBean
bean
)
{
AirlineVerifyAddBean
addBean
=
new
AirlineVerifyAddBean
();
List
<
AirType
>
list
=
new
ArrayList
<
AirType
>();
bean
.
getVerify2type
().
forEach
(
p
->
{
AirType
a
=
new
AirType
();
AirlineVerifyAddBean
addBean
=
new
AirlineVerifyAddBean
();
List
<
AirType
>
list
=
new
ArrayList
<
AirType
>();
bean
.
getVerify2type
().
forEach
(
p
->
{
AirType
a
=
new
AirType
();
a
.
setTypeId
(
p
.
get
(
"typeId"
));
a
.
setId
(
IdWorker
.
getNextId
());
list
.
add
(
a
);
...
...
@@ -1072,11 +1075,11 @@ public class SailingCommandService extends CurdService<SailingCommandDao, Sailin
addBean
.
setAirTypes
(
list
);
addBean
.
setUserCode
(
bean
.
getUserCode
());
addBean
.
setId
(
bean
.
getVerifId
());
VerifyManageDeleteBean
delBean
=
new
VerifyManageDeleteBean
();
VerifyManageDeleteBean
delBean
=
new
VerifyManageDeleteBean
();
delBean
.
setDelFlag
(
"0"
);
delBean
.
setVerifId
(
bean
.
getVerifId
());
manageDao
.
delete_airline_verify2type
(
delBean
);
verifyDao
.
insertAirTypes
(
addBean
);
}
}
src/com/ejweb/modules/verify/service/AirlineVerifiedService.java
View file @
0e81751d
...
...
@@ -512,11 +512,11 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> {
verifNoFrex
=
"XL"
+
year
;
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
;
type
=
"04"
;
}
else
{
// 01、02、0
5、06、07
// 01、02、0
6
verifNoFrex
=
"LZX"
+
year
;
type
=
"03"
;
}
...
...
src/com/ejweb/modules/verify/service/AirlineVerifyService.java
View file @
0e81751d
...
...
@@ -311,6 +311,7 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen
case
"02"
:
case
"03"
:
case
"04"
:
case
"09"
:
{
List
<
Connect
>
connects
=
new
ArrayList
<>();
Connect
connect
=
new
Connect
();
...
...
src/com/ejweb/modules/verify/service/ConditionService.java
View file @
0e81751d
/**
*
*
*/
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.PageEntity
;
import
com.ejweb.core.util.IdWorker
;
import
com.ejweb.core.util.VerifyEmailHandler
;
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.dao.NotifyDao
;
import
com.ejweb.modules.verify.bean.AirlineVerifyDetailBean
;
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.*
;
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.ConditionDao
;
import
com.ejweb.modules.verify.entity.AirlineVerifyDetailEntity
;
...
...
@@ -37,65 +20,68 @@ import com.ejweb.modules.verify.entity.ConditionEntity;
import
com.ejweb.modules.verify.entity.MailEntity
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
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
* @version 1.0
* @time 2016年9月12日
* @team IT Team
* @time 2016年9月12日
*/
@Service
@Transactional
(
readOnly
=
true
)
public
class
ConditionService
extends
BaseService
<
ConditionDao
>
{
public
class
ConditionService
extends
BaseService
<
ConditionDao
>
{
@Autowired
AirlineVerifyDao
verifyDao
;
@Autowired
NotifyDao
notifyDao
;
@Autowired
private
DepartDao
departDao
;
public
PageEntity
<
ConditionEntity
>
findList
(
ConditionBean
bean
)
{
PageInfo
<
ConditionEntity
>
pageInfo
=
null
;
// 必须紧贴dao的查询方法
PageHelper
.
startPage
(
bean
.
getPageNo
(),
bean
.
getPageSize
());
if
(
StringUtils
.
isEmpty
(
bean
.
getSort
()))
{
if
(
StringUtils
.
isEmpty
(
bean
.
getSort
()))
{
PageHelper
.
orderBy
(
" verifNo DESC"
);
}
else
{
PageHelper
.
orderBy
(
bean
.
getSort
());
}
else
PageHelper
.
orderBy
(
bean
.
getSort
());
pageInfo
=
new
PageInfo
<
ConditionEntity
>(
dao
.
findList
(
bean
));
if
(
pageInfo
.
getPages
()<
bean
.
getPageNo
()){
// 页码大于总页数,则返回NULL
// 页码大于总页数,则返回NULL
if
(
pageInfo
.
getPages
()
<
bean
.
getPageNo
())
{
return
null
;
}
List
<
ConditionEntity
>
list
=
pageInfo
.
getList
();
if
(
list
==
null
||
list
.
size
()
==
0
)
{
// 如果没有数据则返回NULL
return
new
PageEntity
<
ConditionEntity
>();
// 如果没有数据则返回NULL
if
(
list
==
null
||
list
.
size
()
==
0
)
{
return
new
PageEntity
<
ConditionEntity
>();
}
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
<
Map
<
String
,
String
>>();
Map
<
String
,
String
>
map2
=
new
HashMap
<
String
,
String
>();
for
(
Map
<
String
,
String
>
map:
list1
){
map2
.
put
(
"flightNo"
,
map
.
get
(
"flightNo"
));
map2
.
put
(
"depIata"
,
map
.
get
(
"depIata"
));
map2
.
put
(
"arrIata"
,
map
.
get
(
"arrIata"
));
map2
.
put
(
"IsMain"
,
map
.
get
(
"IsMain"
));
list2
.
add
(
map2
);
}
entity
.
setConnect
(
list2
);
entity
.
setDepIataLabel
(
verifyDao
.
getConnetList
(
entity
.
getVerifId
()));
entity
.
setTypeList
(
verifyDao
.
getTypeList
(
entity
.
getVerifId
()));
String
typelist
=
verifyDao
.
getTypeList1
(
entity
.
getVerifId
());
if
(
StringUtils
.
isNoneBlank
(
typelist
))
entity
.
setAircraftLabel
(
entity
.
getAircraftLabel
()+
":"
+
typelist
);
//}
for
(
ConditionEntity
entity
:
list
)
{
List
<
Map
<
String
,
String
>>
list1
=
verifyDao
.
getConnectList
(
entity
.
getVerifId
());
List
<
Map
<
String
,
String
>>
list2
=
new
ArrayList
<>();
Map
<
String
,
String
>
map2
=
null
;
for
(
Map
<
String
,
String
>
map
:
list1
)
{
map2
=
new
HashMap
<>(
4
);
map2
.
put
(
"flightNo"
,
map
.
get
(
"flightNo"
));
map2
.
put
(
"depIata"
,
map
.
get
(
"depIata"
));
map2
.
put
(
"arrIata"
,
map
.
get
(
"arrIata"
));
map2
.
put
(
"IsMain"
,
map
.
get
(
"IsMain"
));
list2
.
add
(
map2
);
}
entity
.
setConnect
(
list2
);
entity
.
setDepIataLabel
(
verifyDao
.
getConnetList
(
entity
.
getVerifId
()));
entity
.
setTypeList
(
verifyDao
.
getTypeList
(
entity
.
getVerifId
()));
String
typelist
=
verifyDao
.
getTypeList1
(
entity
.
getVerifId
());
if
(
StringUtils
.
isNoneBlank
(
typelist
))
{
entity
.
setAircraftLabel
(
entity
.
getAircraftLabel
()
+
":"
+
typelist
);
}
}
PageEntity
<
ConditionEntity
>
page
=
new
PageEntity
<
ConditionEntity
>();
page
.
setPageNo
(
pageInfo
.
getPageNum
());
...
...
@@ -105,108 +91,111 @@ public class ConditionService extends BaseService<ConditionDao>{
page
.
setList
(
list
);
return
page
;
}
@Transactional
(
readOnly
=
false
)
public
int
updateAndAdd
(
ConditionUpdateBean
bean
){
dao
.
updateFeedback
(
bean
);
dao
.
deleteFeedback
(
bean
);
List
<
String
>
lst
=
new
ArrayList
<
String
>();
for
(
DepartIds
departId
:
bean
.
getDepartIds
()){
lst
.
add
(
departId
.
getDepartId
());
FeedbackAddBean
feedbean
=
new
FeedbackAddBean
();
feedbean
.
setConditionId
(
bean
.
getConditionId
());
feedbean
.
setVerifId
(
bean
.
getVerifId
());
feedbean
.
setDepartId
(
departId
.
getDepartId
());
String
cid
=
IdWorker
.
getNextId
();
feedbean
.
setId
(
cid
);
feedbean
.
setUserCode
(
bean
.
getUserCode
());
dao
.
insertfeedback
(
feedbean
);
// 条件反馈提醒
AirlineVerifyDetailBean
verifybean
=
new
AirlineVerifyDetailBean
();
verifybean
.
setVerifId
(
bean
.
getVerifId
());
AirlineVerifyDetailEntity
VerifyDetailEntity
=
verifyDao
.
get
(
verifybean
);
StringBuffer
sb
=
new
StringBuffer
();
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map
.
get
(
"depIata"
),
map
.
get
(
"arrIata"
),
map
.
get
(
"roundtripType"
),
map
.
get
(
"vertype"
)));
sb
.
append
(
"论证单号为"
).
append
(
VerifyDetailEntity
.
getVerifNo
())
.
append
(
map
.
get
(
"verifType"
)).
append
(
map
.
get
(
"depName"
))
.
append
(
"的航线产生一条论证条件需要您进行配合评估,请尽快进行反馈。"
);
StringBuffer
url
=
new
StringBuffer
();
url
.
append
(
"<<<a href='argument-condition-estimate-details.htm?verifId="
).
append
(
bean
.
getVerifId
());
url
.
append
(
"&verifNo="
).
append
(
map
.
get
(
"verifNo"
));
url
.
append
(
"&departType=02&cid="
).
append
(
bean
.
getConditionId
());
url
.
append
(
"'>点击查看</a>"
);
NotifyAddBean
addbean
=
new
NotifyAddBean
();
addbean
.
setUrl
(
url
.
toString
());
addbean
.
setType
(
"7"
);
addbean
.
setContent
(
sb
.
toString
());
addbean
.
setTitle
(
"条件反馈提醒"
);
addbean
.
setCreateBy
(
bean
.
getUserCode
());
addbean
.
setUpdateBy
(
bean
.
getUserCode
());
addbean
.
setCreateDate
(
new
Date
());
addbean
.
setUpdateDate
(
new
Date
());
addbean
.
setId
(
IdWorker
.
getNextId
());
addbean
.
setDepartId
(
departId
.
getDepartId
());
addbean
.
setVerifId
(
bean
.
getConditionId
());
addbean
.
setConId
(
bean
.
getVerifId
());
notifyDao
.
saveNotify
(
addbean
);
}
sendmail
(
bean
.
getVerifId
(),
bean
.
getConditionId
(),
lst
);
// 完成审核通知置灰
NotifyAddBean
addbean
=
new
NotifyAddBean
();
addbean
.
setVerifId
(
bean
.
getConditionId
());
addbean
.
setType
(
"6"
);
notifyDao
.
NotifyComplete
(
addbean
);
return
0
;
public
int
updateAndAdd
(
ConditionUpdateBean
bean
)
{
dao
.
updateFeedback
(
bean
);
dao
.
deleteFeedback
(
bean
);
List
<
String
>
lst
=
new
ArrayList
<
String
>();
for
(
DepartIds
departId
:
bean
.
getDepartIds
())
{
lst
.
add
(
departId
.
getDepartId
());
FeedbackAddBean
feedbean
=
new
FeedbackAddBean
();
feedbean
.
setConditionId
(
bean
.
getConditionId
());
feedbean
.
setVerifId
(
bean
.
getVerifId
());
feedbean
.
setDepartId
(
departId
.
getDepartId
());
String
cid
=
IdWorker
.
getNextId
();
feedbean
.
setId
(
cid
);
feedbean
.
setUserCode
(
bean
.
getUserCode
());
dao
.
insertfeedback
(
feedbean
);
// 条件反馈提醒
AirlineVerifyDetailBean
verifybean
=
new
AirlineVerifyDetailBean
();
verifybean
.
setVerifId
(
bean
.
getVerifId
());
AirlineVerifyDetailEntity
VerifyDetailEntity
=
verifyDao
.
get
(
verifybean
);
StringBuffer
sb
=
new
StringBuffer
();
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
(
"depIata"
,
PlanUtil
.
GetLine
(
map
.
get
(
"depIata"
),
map
.
get
(
"arrIata"
),
map
.
get
(
"roundtripType"
),
map
.
get
(
"vertype"
)));
sb
.
append
(
"论证单号为"
).
append
(
VerifyDetailEntity
.
getVerifNo
())
.
append
(
map
.
get
(
"verifType"
)).
append
(
map
.
get
(
"depName"
))
.
append
(
"的航线产生一条论证条件需要您进行配合评估,请尽快进行反馈。"
);
StringBuffer
url
=
new
StringBuffer
();
url
.
append
(
"<<<a href='argument-condition-estimate-details.htm?verifId="
).
append
(
bean
.
getVerifId
());
url
.
append
(
"&verifNo="
).
append
(
map
.
get
(
"verifNo"
));
url
.
append
(
"&departType=02&cid="
).
append
(
bean
.
getConditionId
());
url
.
append
(
"'>点击查看</a>"
);
NotifyAddBean
addbean
=
new
NotifyAddBean
();
addbean
.
setUrl
(
url
.
toString
());
addbean
.
setType
(
"7"
);
addbean
.
setContent
(
sb
.
toString
());
addbean
.
setTitle
(
"条件反馈提醒"
);
addbean
.
setCreateBy
(
bean
.
getUserCode
());
addbean
.
setUpdateBy
(
bean
.
getUserCode
());
addbean
.
setCreateDate
(
new
Date
());
addbean
.
setUpdateDate
(
new
Date
());
addbean
.
setId
(
IdWorker
.
getNextId
());
addbean
.
setDepartId
(
departId
.
getDepartId
());
addbean
.
setVerifId
(
bean
.
getConditionId
());
addbean
.
setConId
(
bean
.
getVerifId
());
notifyDao
.
saveNotify
(
addbean
);
}
sendmail
(
bean
.
getVerifId
(),
bean
.
getConditionId
(),
lst
);
// 完成审核通知置灰
NotifyAddBean
addbean
=
new
NotifyAddBean
();
addbean
.
setVerifId
(
bean
.
getConditionId
());
addbean
.
setType
(
"6"
);
notifyDao
.
NotifyComplete
(
addbean
);
return
0
;
}
public
ConditionDetailEntity
getDetail
(
ConditionDetailBean
bean
){
public
ConditionDetailEntity
getDetail
(
ConditionDetailBean
bean
)
{
return
dao
.
getDetail
(
bean
);
}
/**
*
* @author zhanglg
* @time 2016年9月20日
* @param bean
* @return
* @author zhanglg
* @time 2016年9月20日
*/
public
List
<
ConditionEntity
>
findAllList
(
ConditionBean
bean
)
{
return
dao
.
findAllList
(
bean
);
return
dao
.
findAllList
(
bean
);
}
public
void
sendmail
(
String
verifId
,
String
conditionId
,
List
<
String
>
lst
)
{
List
<
String
>
ccmails
=
verifyDao
.
getmail
(
"6"
);
MailEntity
entity1
=
new
MailEntity
();
public
void
sendmail
(
String
verifId
,
String
conditionId
,
List
<
String
>
lst
)
{
List
<
String
>
ccmails
=
verifyDao
.
getmail
(
"6"
);
MailEntity
entity1
=
new
MailEntity
();
entity1
.
setType
(
"6"
);
entity1
.
setList
(
lst
);
List
<
String
>
mails
=
verifyDao
.
getmailNew1
(
entity1
);
if
(
mails
==
null
||
mails
.
size
()==
0
)
return
;
List
<
String
>
mails
=
verifyDao
.
getmailNew1
(
entity1
);
if
(
mails
==
null
||
mails
.
size
()
==
0
)
return
;
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
(
"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
(
"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
);
try
{
if
(
"02"
.
equals
(
map1
.
get
(
"verifyStatus"
)))
{
map
.
put
(
"feedback"
,
"不可行"
);
}
else
if
(
"03"
.
equals
(
map1
.
get
(
"verifyStatus"
)))
{
map
.
put
(
"feedback"
,
"条件可行"
);
}
else
{
if
(
"02"
.
equals
(
map1
.
get
(
"verifyStatus"
)))
{
map
.
put
(
"feedback"
,
"不可行"
);
}
else
if
(
"03"
.
equals
(
map1
.
get
(
"verifyStatus"
)))
{
map
.
put
(
"feedback"
,
"条件可行"
);
}
else
{
return
;
}
map
.
put
(
"condition"
,
map1
.
get
(
"condition"
));
map
.
put
(
"condition"
,
map1
.
get
(
"condition"
));
map
.
put
(
"backName"
,
map1
.
get
(
"departName"
));
String
flight
=
PlanUtil
.
flightContent
(
map
);
String
line
=
PlanUtil
.
lineContent
(
map
);
String
flight
=
PlanUtil
.
flightContent
(
map
);
String
line
=
PlanUtil
.
lineContent
(
map
);
map
.
put
(
"line"
,
line
);
String
title
=
"首都航空关于"
+
flight
;
VerifyEmailHandler
.
getInstance
().
sendEmail
(
title
+
"的论证条件流转的提示(智能首航论证系统提示)"
,
com
.
ejweb
.
core
.
util
.
TemplateFactory
.
generateHtmlFromFtl
(
templateName
,
map
),
mails
,
ccmails
);
String
title
=
"首都航空关于"
+
flight
;
VerifyEmailHandler
.
getInstance
().
sendEmail
(
title
+
"的论证条件流转的提示(智能首航论证系统提示)"
,
com
.
ejweb
.
core
.
util
.
TemplateFactory
.
generateHtmlFromFtl
(
templateName
,
map
),
mails
,
ccmails
);
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment