Commit efca1f5a by java-李谡

修改论证类型

parent 0e81751d
...@@ -188,6 +188,33 @@ ...@@ -188,6 +188,33 @@
) )
</insert> </insert>
<select id="getAssessment" resultType="com.ejweb.modules.verify.entity.RouteverifyEntity">
select
id,
verif_id as verifyId,
assessment_status as assessmentStatus,
depart_id as deportId,
create_date as createDate,
create_by as createBy,
update_by as updateBy,
update_date as updateDate
from foc_risk_assessment
where verif_id = #{verifyId}
and depart_id = #{deportId}
</select>
<update id="updateAssessment">
update foc_risk_assessment
set verif_id = #{verifyId} ,
assessment_status = #{assessmentStatus} ,
depart_id = #{deportId} ,
create_date = #{createDate} ,
create_by = #{createBy} ,
update_by = #{updateBy} ,
update_date = #{updateDate}
where id = #{id}
</update>
<insert id="insertVerified"> <insert id="insertVerified">
insert into foc_airline_verified ( insert into foc_airline_verified (
id, id,
......
...@@ -220,6 +220,11 @@ ...@@ -220,6 +220,11 @@
delete from foc_conclusion_file delete from foc_conclusion_file
where verif_id=#{verifId} where verif_id=#{verifId}
</delete> </delete>
<delete id="deleteConclusion">
delete from foc_airline_conclusion
where verif_id=#{verifId}
</delete>
<insert id="insertConclusionFile"> <insert id="insertConclusionFile">
INSERT INTO foc_conclusion_file( INSERT INTO foc_conclusion_file(
id, id,
......
...@@ -324,12 +324,13 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -324,12 +324,13 @@ public class UserService extends CurdService<UserDao, UserEntity> {
@Transactional(readOnly = false) @Transactional(readOnly = false)
public boolean validateServerPassword(LoginBean loginBean) { public boolean validateServerPassword(LoginBean loginBean) {
long startTime = System.nanoTime();// 开始计时时间 long startTime = System.nanoTime();
try { try {
if (GConstants.getBoolean("use.new.login.api", false)) {// 使用新的登录地址,默认使用旧地址 // 使用新的登录地址,默认使用旧地址
if (GConstants.getBoolean("use.new.login.api", false)) {
boolean isSuccess = HTTPClientUtil.callLogin(loginBean.getLoginName(), loginBean.getPassword());// 进行秘密校验 // 进行秘密校验
long endTime = System.nanoTime();// 结束计时时间 boolean isSuccess = HTTPClientUtil.callLogin(loginBean.getLoginName(), loginBean.getPassword());
long endTime = System.nanoTime();
long duration = endTime - startTime; long duration = endTime - startTime;
LOG.info("[UserService login][validateServerPassword][" + isSuccess + "]总共用时:" + Util.getDurationTime(duration)); LOG.info("[UserService login][validateServerPassword][" + isSuccess + "]总共用时:" + Util.getDurationTime(duration));
return isSuccess; return isSuccess;
...@@ -337,16 +338,25 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -337,16 +338,25 @@ public class UserService extends CurdService<UserDao, UserEntity> {
StringBuilder buf = new StringBuilder(GConstants.getValue("hn.api.base.url", "https://dsp.jdair.net")); StringBuilder buf = new StringBuilder(GConstants.getValue("hn.api.base.url", "https://dsp.jdair.net"));
buf.append("/flightinterface/uss/json/hnauser/hnauserLoginWithInfo.json?"); buf.append("/flightinterface/uss/json/hnauser/hnauserLoginWithInfo.json?");
buf.append(GConstants.getValue("hn.api.base.param", "ai.cc=7&ai.cp=10.68.26.52")); buf.append(GConstants.getValue("hn.api.base.param", "ai.cc=7&ai.cp=10.68.26.52"));
buf.append("&loginId="); //用户名密码使用DESPlus中的加密方法加密后,再urlencode
buf.append(URLEncoder.encode(loginBean.getLoginName(), "UTF-8")); DESPlus plus = new DESPlus();
buf.append("&password="); String loginName = plus.encrypt(loginBean.getLoginName());
buf.append(URLEncoder.encode(loginBean.getPassword(), "UTF-8")); String password = plus.encrypt(loginBean.getPassword());
LOG.info("密码encode后;"+URLEncoder.encode(loginBean.getPassword(),"UTF-8")); LOG.info("账号encrypt后;" + loginName);
LOG.info("密码encrypt后;" + password);
LOG.info("[UserService login][validateServerPassword][URL]:" + buf.toString());
buf.append("&loginIdSecure=");
buf.append(URLEncoder.encode(loginName, "UTF-8"));
buf.append("&passwordSecure=");
buf.append(URLEncoder.encode(password, "UTF-8"));
LOG.info("密码encode后;" + URLEncoder.encode(loginBean.getPassword(), "UTF-8"));
LOG.info("[UserService login][validateServerPassword][URL]:" + buf.toString()); LOG.info("[UserService login][validateServerPassword][URL]:" + buf.toString());
HCFetcher fetcher = HCFetcher.getInstance(); HCFetcher fetcher = HCFetcher.getInstance();
FetchEntity entity = fetcher.get(buf.toString()); FetchEntity entity = fetcher.get(buf.toString());
if (entity == null) {// 再次重新尝试获取内容 // 再次重新尝试获取内容
if (entity == null) {
entity = fetcher.get(buf.toString()); entity = fetcher.get(buf.toString());
} }
...@@ -361,7 +371,8 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -361,7 +371,8 @@ public class UserService extends CurdService<UserDao, UserEntity> {
return false; return false;
} }
JSONObject result = response.getJSONObject("result"); JSONObject result = response.getJSONObject("result");
if ("1000".equals(result.getString("resultCode"))) { // 远程服务器登陆成功,更改数据库密码 // 远程服务器登陆成功,更改数据库密码
if ("1000".equals(result.getString("resultCode"))) {
long endTime = System.nanoTime(); long endTime = System.nanoTime();
long duration = endTime - startTime; long duration = endTime - startTime;
...@@ -552,68 +563,6 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -552,68 +563,6 @@ public class UserService extends CurdService<UserDao, UserEntity> {
return dao.getUserSeatList(bean); return dao.getUserSeatList(bean);
} }
public static void main(String[] args) {
try {
// 先默认写死URL,后期通过配置读取
// StringBuilder buf = new
// StringBuilder(GConstants.JDAIR_BASE_API+"/flightinterface/uss/json/mobile/messSend.json?"+GConstants.JDAIR_BASE_PARAM+"&loginId=");
// DESPlus desPlus = new DESPlus();
// String pass = "5127340@q";
// //String test="123456789@"+System.currentTimeMillis();
// DESPlus dess;
// try
// {
// dess = new DESPlus( );//定义密钥
// System.out.println( "加密前的字符:" + pass );
// String pass1 = dess.encrypt( pass );
// String pass2 = dess.decrypt(pass1);
//// String miwen = "9affe36dba5385c41ac289290d7f86f8";
// System.out.println( "加密后的字符 pass1:" + pass1 );
// System.out.println( "加密后的字符 pass2:" + pass2 );
//
//// DESPlus des1 = new DESPlus();//定义密钥
//// System.out.println( "解密后的字符:" + des1.decrypt( pass2 ));
// } catch ( Exception e )
// {
// e.printStackTrace();
// }
// System.exit(0);
StringBuilder buf = new StringBuilder("https://10.72.32.251:8443/crm/BaseUrl/uss/json/login/userLogin.json?" + GConstants.JDAIR_BASE_PARAM);
DESPlus des = new DESPlus();// 定义密钥
String miwen = des.encrypt("5127340@q");
buf.append("&loginId=").append("yan_zhang3").append("&password=").append(miwen);
System.out.println(buf.toString());
// FetchEntity entity = HCFetcher.getInstance().post(buf.toString(), null);
// if (entity.isSuccess()) {
// System.out.println(entity.getContent("UTF-8"));
//
// Map<String, Object> response = JSON.parseObject(entity.getContent("UTF-8"),
// new TypeReference<Map<String, Object>>() {
// });
// if (response.get("result") == null) {
// System.out.println("false");
// return;
// }
// @SuppressWarnings("unchecked")
// Map<String, String> result = (Map<String, String>) response.get("result");
// if (result.get("resultCode") != null && result.get("resultCode").equals("1000")) { // 远程服务器登陆成功,更改数据库密码
// System.out.println("true");
// return;
// }
// }
} catch (Exception e) {
} finally {
// if (fetcher != null) {fetcher.shutdown();}
}
System.out.println("false");
}
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void addOuterUser(OuterUserAddBean bean) { public void addOuterUser(OuterUserAddBean bean) {
bean.setId(IdWorker.getNextNumId()); bean.setId(IdWorker.getNextNumId());
......
...@@ -333,6 +333,7 @@ public class AirlineVerifyController { ...@@ -333,6 +333,7 @@ public class AirlineVerifyController {
case "03": case "03":
case "04": case "04":
case "05": case "05":
case "09":
airlineVerifyEntity.setDepIataLabel(airLineVerifyService.getConnetList(airlineVerifyEntity.getVerifId())); airlineVerifyEntity.setDepIataLabel(airLineVerifyService.getConnetList(airlineVerifyEntity.getVerifId()));
......
...@@ -41,7 +41,7 @@ public interface AirlineConclusionDao extends BaseDao { ...@@ -41,7 +41,7 @@ public interface AirlineConclusionDao extends BaseDao {
List<Map<String, String>> getVerifyFile(AirlineConclusionDetailBean bean); List<Map<String, String>> getVerifyFile(AirlineConclusionDetailBean bean);
void updateXZRS(AirlineConclusionUpdateBean bean); void updateXZRS(AirlineConclusionUpdateBean bean);
void deleteConclusion(AirlineConclusionDetailBean bean);
void deleteConclusionFile(ConclusionFileBean conclusionBean); void deleteConclusionFile(ConclusionFileBean conclusionBean);
} }
...@@ -34,6 +34,10 @@ public interface AirlineVerifiedDao extends BaseDao { ...@@ -34,6 +34,10 @@ public interface AirlineVerifiedDao extends BaseDao {
void insertAssessment(RouteverifyEntity entity); void insertAssessment(RouteverifyEntity entity);
RouteverifyEntity getAssessment(RouteverifyEntity entity);
void updateAssessment(RouteverifyEntity entity);
String findDepartId(AirlineVerifiedAddBean bean); String findDepartId(AirlineVerifiedAddBean bean);
List<AirlineVerifiedEntity> findFormText(AirlineVerifiedDetailBean bean); List<AirlineVerifiedEntity> findFormText(AirlineVerifiedDetailBean bean);
......
package com.ejweb.modules.verify.service; package com.ejweb.modules.verify.service;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
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.file.Html2File; import com.ejweb.core.file.Html2File;
...@@ -27,26 +14,27 @@ import com.ejweb.modules.upload.bean.UploadFileBean; ...@@ -27,26 +14,27 @@ import com.ejweb.modules.upload.bean.UploadFileBean;
import com.ejweb.modules.user.dao.UserDao; import com.ejweb.modules.user.dao.UserDao;
import com.ejweb.modules.user.entity.User; import com.ejweb.modules.user.entity.User;
import com.ejweb.modules.user.entity.UserEntity; import com.ejweb.modules.user.entity.UserEntity;
import com.ejweb.modules.verify.bean.AirlineVerifiedAddBean; import com.ejweb.modules.verify.bean.*;
import com.ejweb.modules.verify.bean.AirlineVerifiedBean;
import com.ejweb.modules.verify.bean.AirlineVerifiedDetailBean;
import com.ejweb.modules.verify.bean.AirlineVerifyDetailBean;
import com.ejweb.modules.verify.bean.AirlineVerifyUpdateStatusBean;
import com.ejweb.modules.verify.bean.RecordAddBean;
import com.ejweb.modules.verify.bean.VerifiedFileBean;
import com.ejweb.modules.verify.dao.AirlineVerifiedDao; import com.ejweb.modules.verify.dao.AirlineVerifiedDao;
import com.ejweb.modules.verify.dao.AirlineVerifyDao; import com.ejweb.modules.verify.dao.AirlineVerifyDao;
import com.ejweb.modules.verify.dao.RecordDao; import com.ejweb.modules.verify.dao.RecordDao;
import com.ejweb.modules.verify.entity.AirlineVerifiedEntity; import com.ejweb.modules.verify.entity.*;
import com.ejweb.modules.verify.entity.AirlineVerifyDetailEntity;
import com.ejweb.modules.verify.entity.AirlineVerifyEntity;
import com.ejweb.modules.verify.entity.MailEntity;
import com.ejweb.modules.verify.entity.RouteverifyEntity;
import com.ejweb.modules.verify.entity.VerifiedDetailEntity;
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 org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 航线论证审核service * 航线论证审核service
...@@ -224,26 +212,29 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> { ...@@ -224,26 +212,29 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> {
notifyDao.saveNotify(addbean); notifyDao.saveNotify(addbean);
} }
// 不是草稿时,无论审核是否通过,生成信息通报单附件 // 不是草稿时,无论审核是否通过,生成信息通报单附件
if(!"0".equals(bean.getStatus())){ if(!"0".equals(bean.getStatus())){
if(bean.getFormText()!=null&&!"".equals(bean.getFormText())){ if(bean.getFormText()!=null&&!"".equals(bean.getFormText())){
try { try {
AirlineVerifiedDetailBean detailBean = new AirlineVerifiedDetailBean();
detailBean.setVerifId(bean.getVerifId());
List list = dao.getVerifiedFile(detailBean);
if (CollectionUtils.isEmpty(list)) {
UploadFileBean uploadFileBean = Html2File.convertHtml2Word(bean.getFormText()); UploadFileBean uploadFileBean = Html2File.convertHtml2Word(bean.getFormText());
VerifiedFileBean routeFileBean=new VerifiedFileBean(); VerifiedFileBean routeFileBean = new VerifiedFileBean();
routeFileBean.setId(IdWorker.getNextId()); routeFileBean.setId(IdWorker.getNextId());
routeFileBean.setFileName("信息通报单.doc"); routeFileBean.setFileName("信息通报单.doc");
routeFileBean.setExtesion(uploadFileBean.getExtesion()); routeFileBean.setExtesion(uploadFileBean.getExtesion());
routeFileBean.setMd5(uploadFileBean.getMd5()); routeFileBean.setMd5(uploadFileBean.getMd5());
routeFileBean.setFilePath(uploadFileBean.getPath()); routeFileBean.setFilePath(uploadFileBean.getPath());
routeFileBean.setFileSize(String.valueOf(uploadFileBean.getSize()) ); routeFileBean.setFileSize(String.valueOf(uploadFileBean.getSize()));
routeFileBean.setVerifId(bean.getVerifId()); routeFileBean.setVerifId(bean.getVerifId());
routeFileBean.setCreateBy(bean.getUserCode()); routeFileBean.setCreateBy(bean.getUserCode());
//dao.deleteVerifIdFile(routeFileBean); // dao.deleteVerifIdFile(routeFileBean);
dao.insertVerifIdFile(routeFileBean); dao.insertVerifIdFile(routeFileBean);
}
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
...@@ -263,6 +254,14 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> { ...@@ -263,6 +254,14 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> {
// 插入foc_risk_assessment // 插入foc_risk_assessment
for (int i = 0; i < riskDeparts.size(); i++) { for (int i = 0; i < riskDeparts.size(); i++) {
routeverifyEntity.setDeportId(riskDeparts.get(i).getDepartId()); routeverifyEntity.setDeportId(riskDeparts.get(i).getDepartId());
routeverifyEntity.setVerifyId(bean.getVerifId());
routeverifyEntity = dao.getAssessment(routeverifyEntity);
if (routeverifyEntity != null) {
routeverifyEntity.setAssessmentStatus("00");
dao.updateAssessment(routeverifyEntity);
} else {
routeverifyEntity = new RouteverifyEntity();
routeverifyEntity.setDeportId(riskDeparts.get(i).getDepartId());
routeverifyEntity.setAssessmentStatus("00"); routeverifyEntity.setAssessmentStatus("00");
routeverifyEntity.setId(IdWorker.getNextId()); routeverifyEntity.setId(IdWorker.getNextId());
routeverifyEntity.setVerifyId(bean.getVerifId()); routeverifyEntity.setVerifyId(bean.getVerifId());
...@@ -271,6 +270,7 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> { ...@@ -271,6 +270,7 @@ public class AirlineVerifiedService extends BaseService<AirlineVerifiedDao> {
routeverifyEntity.setCreateBy(user.getName()); routeverifyEntity.setCreateBy(user.getName());
routeverifyEntity.setUpdateBy(user.getName()); routeverifyEntity.setUpdateBy(user.getName());
dao.insertAssessment(routeverifyEntity); dao.insertAssessment(routeverifyEntity);
}
//发送评估消息 //发送评估消息
NotifyAddBean addbean=new NotifyAddBean(); NotifyAddBean addbean=new NotifyAddBean();
......
...@@ -459,6 +459,9 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen ...@@ -459,6 +459,9 @@ public List<com.ejweb.modules.route.entity.AirlineVerifyEntity> getRiskAssessmen
if("01".equals(bean.getVerifStatus())){ if("01".equals(bean.getVerifStatus())){
NotifyAddBean addbean=new NotifyAddBean(); NotifyAddBean addbean=new NotifyAddBean();
addbean.setConId(bean.getVerifId()); addbean.setConId(bean.getVerifId());
AirlineConclusionDetailBean detailBean = new AirlineConclusionDetailBean();
detailBean.setVerifId(bean.getVerifId());
conclusionDao.deleteConclusion(detailBean);
notifyDao.NotifyComplete(addbean); notifyDao.NotifyComplete(addbean);
// 增加论证终止操作履历 // 增加论证终止操作履历
......
...@@ -405,7 +405,7 @@ public VerifyManageAddBean ConnectChange(VerifyManageDetailEntity entity, String ...@@ -405,7 +405,7 @@ public VerifyManageAddBean ConnectChange(VerifyManageDetailEntity entity, String
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();
connect.setId(IdWorker.getNextId()); connect.setId(IdWorker.getNextId());
......
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