正在显示
13 个修改的文件
包含
195 行增加
和
11 行删除
@@ -739,9 +739,13 @@ public class ManifestController extends BasicController { | @@ -739,9 +739,13 @@ public class ManifestController extends BasicController { | ||
739 | 739 | ||
740 | if (pre == null) { | 740 | if (pre == null) { |
741 | pre = new PreparesecondaryEntity(); | 741 | pre = new PreparesecondaryEntity(); |
742 | - pre.setCarrier(manifest.getCarrier()); | ||
743 | - pre.setFlightdate(manifest.getFlightdate()); | ||
744 | - pre.setFlightno(manifest.getFlightno()); | 742 | + pre.setCarrier(manifest.getCarrier());//承运人 |
743 | + pre.setFlightno(manifest.getFlightno());//航班号 | ||
744 | + pre.setFlightdate(manifest.getFlightdate());//航班日期 | ||
745 | + pre.setOriginatingstation(manifest.getOriginatingstation());//起始站 | ||
746 | + pre .setCustomscode(manifest.getCustomscode());//海关关区 | ||
747 | + pre.setDelivery_station(manifest.getDelivery_station());//交运货站 | ||
748 | + pre.setDe_type(manifest.getDe_type());//交运类型 | ||
745 | } | 749 | } |
746 | model.addAttribute("pre", pre); | 750 | model.addAttribute("pre", pre); |
747 | request.setAttribute("version", System.currentTimeMillis()); | 751 | request.setAttribute("version", System.currentTimeMillis()); |
@@ -910,6 +914,20 @@ public class ManifestController extends BasicController { | @@ -910,6 +914,20 @@ public class ManifestController extends BasicController { | ||
910 | manifest.setSave_time(new Long(System.currentTimeMillis())); | 914 | manifest.setSave_time(new Long(System.currentTimeMillis())); |
911 | // 处理预配时间 | 915 | // 处理预配时间 |
912 | manifest = manifestService.save(manifest); | 916 | manifest = manifestService.save(manifest); |
917 | + //同步分单信息 | ||
918 | + List<PreparesecondaryEntity> subList = preparesecondaryServer.findByMain(manifest.getWaybillnomaster()); | ||
919 | + if(!subList.isEmpty()&&subList.size()>0){ | ||
920 | + for (PreparesecondaryEntity preparesecondaryEntity : subList) { | ||
921 | + preparesecondaryEntity.setCarrier(manifest.getCarrier());//承运人 | ||
922 | + preparesecondaryEntity.setFlightno(manifest.getFlightno());//航班号 | ||
923 | + preparesecondaryEntity.setFlightdate(manifest.getFlightdate());//航班日期 | ||
924 | + preparesecondaryEntity.setOriginatingstation(manifest.getOriginatingstation());//起始站 | ||
925 | + preparesecondaryEntity .setCustomscode(manifest.getCustomscode());//海关关区 | ||
926 | + preparesecondaryEntity.setDelivery_station(manifest.getDelivery_station());//交运货站 | ||
927 | + preparesecondaryEntity.setDe_type(manifest.getDe_type());//交运类型 | ||
928 | + preparesecondaryServer.save(preparesecondaryEntity); | ||
929 | + } | ||
930 | + } | ||
913 | 931 | ||
914 | model.setData(manifest); | 932 | model.setData(manifest); |
915 | model.setStatus(200); | 933 | model.setStatus(200); |
@@ -1028,7 +1046,7 @@ public class ManifestController extends BasicController { | @@ -1028,7 +1046,7 @@ public class ManifestController extends BasicController { | ||
1028 | String sliPath = MessageKit.getMessagePath(MessageType.SLI); | 1046 | String sliPath = MessageKit.getMessagePath(MessageType.SLI); |
1029 | 1047 | ||
1030 | manifest.setAgentcompany(getAgent().getNameCn()); | 1048 | manifest.setAgentcompany(getAgent().getNameCn()); |
1031 | - manifest.setAgentman(getAgent().getNameCn()); | 1049 | + manifest.setAgentman(getAgent().getThreeCode()); |
1032 | manifest.setAgentcompanycode(getAgent().getThreeCode()); | 1050 | manifest.setAgentcompanycode(getAgent().getThreeCode()); |
1033 | 1051 | ||
1034 | new XmlBuildTask(manifestService.sendNDLRXml(manifest), ndlrPath).perform(); | 1052 | new XmlBuildTask(manifestService.sendNDLRXml(manifest), ndlrPath).perform(); |
@@ -1150,7 +1168,7 @@ public class ManifestController extends BasicController { | @@ -1150,7 +1168,7 @@ public class ManifestController extends BasicController { | ||
1150 | if (StringUtils.isNotBlank(flightno) && flightno.length() > 2) { | 1168 | if (StringUtils.isNotBlank(flightno) && flightno.length() > 2) { |
1151 | carrier = flightno.substring(0, 2); | 1169 | carrier = flightno.substring(0, 2); |
1152 | flightno = flightno.replace(carrier, ""); | 1170 | flightno = flightno.replace(carrier, ""); |
1153 | - } | 1171 | + } |
1154 | preparesecondary.setCarrier(carrier); | 1172 | preparesecondary.setCarrier(carrier); |
1155 | preparesecondary.setFlightno(flightno); | 1173 | preparesecondary.setFlightno(flightno); |
1156 | 1174 |
@@ -92,7 +92,7 @@ public class ReceiptController { | @@ -92,7 +92,7 @@ public class ReceiptController { | ||
92 | } | 92 | } |
93 | } else if (StringUtils.isNoneBlank(waybillNo) && StringUtils.isNoneBlank(waybillNoSub)) { | 93 | } else if (StringUtils.isNoneBlank(waybillNo) && StringUtils.isNoneBlank(waybillNoSub)) { |
94 | // 分单报文 | 94 | // 分单报文 |
95 | - List<PreparesecondaryEntity> list = preparesecondaryService.findByMawbNo(waybillNoSub); | 95 | + List<PreparesecondaryEntity> list = preparesecondaryService.findByMainAndSub(waybillNo,waybillNoSub); |
96 | if (list != null && list.size() > 0) { | 96 | if (list != null && list.size() > 0) { |
97 | PreparesecondaryEntity bean = list.get(0); | 97 | PreparesecondaryEntity bean = list.get(0); |
98 | bean.setResponse_code(response_code); | 98 | bean.setResponse_code(response_code); |
1 | +package com.agent.controller.system; | ||
2 | + | ||
3 | +import org.slf4j.Logger; | ||
4 | +import org.slf4j.LoggerFactory; | ||
5 | + | ||
6 | +import java.io.*; | ||
7 | +import java.net.HttpURLConnection; | ||
8 | +import java.net.MalformedURLException; | ||
9 | +import java.net.URL; | ||
10 | +import java.net.URLEncoder; | ||
11 | + | ||
12 | +public class HttpUtil { | ||
13 | + static Logger logger = LoggerFactory.getLogger(HttpUtil.class); | ||
14 | + public static String sendData(String url, String SAMLResponse,String providerId) { | ||
15 | + StringBuilder str = new StringBuilder(); | ||
16 | + BufferedReader bf = null; | ||
17 | + OutputStreamWriter writer = null; | ||
18 | + String param= null; | ||
19 | + try { | ||
20 | + param = "SAMLResponse="+ URLEncoder.encode(SAMLResponse,"UTF-8")+"&"+"providerId="+providerId; | ||
21 | + | ||
22 | + } catch (UnsupportedEncodingException e) { | ||
23 | + e.printStackTrace(); | ||
24 | + } | ||
25 | + try { | ||
26 | + URL Url = new URL(url); | ||
27 | + HttpURLConnection conn = (HttpURLConnection) Url.openConnection(); | ||
28 | + conn.setDoInput(true); | ||
29 | + conn.setDoOutput(true); | ||
30 | + //conn.setRequestProperty("X-Rrquested-With", "XMLHttpRequest"); | ||
31 | + //conn.setRequestProperty("Connection", "keep-alive"); | ||
32 | + //conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); | ||
33 | + conn.setRequestMethod("POST"); | ||
34 | + conn.connect(); | ||
35 | + StringBuffer params = new StringBuffer(); | ||
36 | + //表单参数与get形式一样 | ||
37 | + //params.append("SAMLResponse").append("=").append(SAMLResponse).append("&") | ||
38 | + // .append("providerId").append("=").append(providerId); | ||
39 | + writer = new OutputStreamWriter(conn.getOutputStream(), "UTF-8"); | ||
40 | + writer.write(param); | ||
41 | + writer.flush(); | ||
42 | + bf = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); | ||
43 | + String inputLine = null; | ||
44 | + while ((inputLine = bf.readLine()) != null) { | ||
45 | + str.append(inputLine); | ||
46 | + } | ||
47 | + } catch (MalformedURLException e) { | ||
48 | + e.printStackTrace(); | ||
49 | + } catch (IOException e) { | ||
50 | + e.printStackTrace(); | ||
51 | + } finally { | ||
52 | + try { | ||
53 | + writer.close(); | ||
54 | + bf.close(); | ||
55 | + } catch (IOException e) { | ||
56 | + e.printStackTrace(); | ||
57 | + } | ||
58 | + } | ||
59 | + return str.toString(); | ||
60 | + } | ||
61 | + | ||
62 | +} |
@@ -31,6 +31,7 @@ import com.agent.service.system.RoleService; | @@ -31,6 +31,7 @@ import com.agent.service.system.RoleService; | ||
31 | import com.agent.service.system.UserService; | 31 | import com.agent.service.system.UserService; |
32 | import com.agent.util.Constants; | 32 | import com.agent.util.Constants; |
33 | import com.agent.vo.ResponseModel; | 33 | import com.agent.vo.ResponseModel; |
34 | +import com.alibaba.fastjson.JSONObject; | ||
34 | import com.framework.mail.MailSenderService; | 35 | import com.framework.mail.MailSenderService; |
35 | import com.framework.shiro.SessionUtil; | 36 | import com.framework.shiro.SessionUtil; |
36 | import com.framework.util.MD5Tools; | 37 | import com.framework.util.MD5Tools; |
@@ -233,5 +234,99 @@ public class LoginController { | @@ -233,5 +234,99 @@ public class LoginController { | ||
233 | 234 | ||
234 | return rm; | 235 | return rm; |
235 | } | 236 | } |
237 | + | ||
238 | + /** | ||
239 | + * 登录操作api | ||
240 | + * | ||
241 | + * @return | ||
242 | + */ | ||
243 | + @RequestMapping(value = "/loginApi", method = RequestMethod.POST) | ||
244 | + public String loginApi(HttpServletRequest request) { | ||
245 | + ResponseModel rm = new ResponseModel(200, "", null); | ||
246 | + HttpUtil util=new HttpUtil(); | ||
247 | + | ||
248 | + String url="http://10.5.13.25/services/rest/token/verifySAMLResponse"; | ||
249 | + String SAMLResponse=request.getParameter("SAMLResponse"); | ||
250 | + String providerId=request.getParameter("providerId"); | ||
251 | + System.out.println("providerId----->"+providerId); | ||
252 | + | ||
253 | + String result=util.sendData(url,SAMLResponse,providerId); | ||
254 | + | ||
255 | + System.out.println("result----->"+result); | ||
256 | + System.out.print("SAMLResponse------>"+SAMLResponse); | ||
257 | + JSONObject j = JSONObject.parseObject(result); | ||
258 | + | ||
259 | + if(request!=null){ | ||
260 | + if("0x0000".equals(j.get("status"))){ | ||
261 | + | ||
262 | + UserEntity user = new UserEntity(); | ||
263 | + user.setLoginaccount(j.get("appLoginID").toString()); | ||
264 | + user.setPassword(j.get("appLoginPass").toString()); | ||
265 | + if (!j.get("appLoginID").toString().equals("admin")) {} | ||
266 | + // 远程登录 | ||
267 | + // 用户数据 | ||
268 | + LoginData login = FLogin.login(user); | ||
269 | + // 登录成功! | ||
270 | + if (login.getCode() == 20000) { | ||
271 | + // 往数据库中插入数据 | ||
272 | + UserEntity ue = userService.findByLoginaccount(user.getLoginaccount()); | ||
273 | + // 用户存在 | ||
274 | + if (ue != null) { | ||
275 | + // 修改密码 | ||
276 | + userService.updatePassword(ue.getLoginaccount(), MD5Tools.MD5(j.get("appLoginPass").toString())); | ||
277 | + } else { | ||
278 | + // 用户不存在,插入数据 | ||
279 | + BasicAgentEntity agent = new BasicAgentEntity(); | ||
280 | + agent.setContact(login.getInfodata().getContact()); | ||
281 | + agent.setNameCn(login.getInfodata().getCompany()); | ||
282 | + agent.setCountryCode("CN"); | ||
283 | + agent.setAddress(login.getInfodata().getAddress()); | ||
284 | + int agent_id = agentSerive.save2(agent); | ||
285 | + | ||
286 | + ue = new UserEntity(); | ||
287 | + ue.setLoginaccount(j.get("appLoginID").toString()); | ||
288 | + // 设置用户名密码 | ||
289 | + ue.setPassword(MD5Tools.MD5(j.get("appLoginPass").toString())); | ||
290 | + ue.setRealName(login.getInfodata().getContact()); | ||
291 | + ue.setMobile(login.getInfodata().getMobile()); | ||
292 | + ue.setStatus(0); | ||
293 | + ue.setAgent(new Long(agent_id)); | ||
294 | + RoleEntity re = new RoleEntity(); | ||
295 | + re.setId(new Long(1)); | ||
296 | + ue.setRole(re); | ||
297 | + // 删除密码 | ||
298 | + userService.save(ue); | ||
299 | + } | ||
236 | 300 | ||
301 | + // 登录用户 | ||
302 | + Subject subject = SecurityUtils.getSubject(); | ||
303 | + subject.getSession().setAttribute("user", user); | ||
304 | + UsernamePasswordToken token = null; | ||
305 | + token = new UsernamePasswordToken(j.get("appLoginID").toString(), MD5Tools.MD5(j.get("appLoginPass").toString())); | ||
306 | + | ||
307 | + try { | ||
308 | + subject.login(token); | ||
309 | + subject.getSession().setAttribute("permission", roleService | ||
310 | + .findAllFunctionByRole(((UserEntity) subject.getSession().getAttribute("user")).getRole())); | ||
311 | + subject.getSession().setAttribute("all_function", functionService.findAll()); | ||
312 | + return "redirect:/index"; | ||
313 | + } catch (UnknownAccountException e) { | ||
314 | + e.printStackTrace(); | ||
315 | + rm.setStatus(500); | ||
316 | + rm.setMsg("账号不存在"); | ||
317 | + } catch (IncorrectCredentialsException e) { | ||
318 | + e.printStackTrace(); | ||
319 | + rm.setStatus(500); | ||
320 | + rm.setMsg("密码错误"); | ||
321 | + } catch (LockedAccountException e) { | ||
322 | + e.printStackTrace(); | ||
323 | + rm.setStatus(500); | ||
324 | + rm.setMsg("账号被锁定"); | ||
325 | + } | ||
326 | + } | ||
327 | + } | ||
328 | + | ||
329 | + } | ||
330 | + return "login"; | ||
331 | + } | ||
237 | } | 332 | } |
@@ -33,6 +33,7 @@ public class IMFSend extends Thread{ | @@ -33,6 +33,7 @@ public class IMFSend extends Thread{ | ||
33 | //9是发送成功 | 33 | //9是发送成功 |
34 | if(message !=null){ | 34 | if(message !=null){ |
35 | if(message.indexOf("<CODE>9</CODE>")== 9){ | 35 | if(message.indexOf("<CODE>9</CODE>")== 9){ |
36 | + //移除并返回列表 key 的尾元素。 | ||
36 | jedis.rpop("tmp-queue"); | 37 | jedis.rpop("tmp-queue"); |
37 | }else{ | 38 | }else{ |
38 | //如果发送不成功继续发送 | 39 | //如果发送不成功继续发送 |
@@ -25,6 +25,9 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{ | @@ -25,6 +25,9 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{ | ||
25 | @Query(value = "SELECT * FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1 AND WAYBILLNOSECONDARY = ?2", nativeQuery = true) | 25 | @Query(value = "SELECT * FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1 AND WAYBILLNOSECONDARY = ?2", nativeQuery = true) |
26 | List<PreparesecondaryEntity> findByMainAndSub(String waybillnomaster,String waybillnoSub); | 26 | List<PreparesecondaryEntity> findByMainAndSub(String waybillnomaster,String waybillnoSub); |
27 | 27 | ||
28 | + @Query(value = "SELECT * FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1", nativeQuery = true) | ||
29 | + List<PreparesecondaryEntity> findByMain(String waybillnomaster); | ||
30 | + | ||
28 | @Modifying | 31 | @Modifying |
29 | @Query(value = "DELETE FROM PREPARESECONDARY WHERE PREPAREMASTERID = ?1", nativeQuery = true) | 32 | @Query(value = "DELETE FROM PREPARESECONDARY WHERE PREPAREMASTERID = ?1", nativeQuery = true) |
30 | void deleteAll(Long id); | 33 | void deleteAll(Long id); |
@@ -52,6 +52,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity | @@ -52,6 +52,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity | ||
52 | return preparesecondaryRepository.findByMawbNo(mawbNo); | 52 | return preparesecondaryRepository.findByMawbNo(mawbNo); |
53 | } | 53 | } |
54 | 54 | ||
55 | + public List<PreparesecondaryEntity> findByMain(String waybillnomaster) { | ||
56 | + return preparesecondaryRepository.findByMain(waybillnomaster); | ||
57 | + } | ||
58 | + | ||
55 | public List<PreparesecondaryEntity> findByMainAndSub(String waybillnomaster,String waybillnoSub) { | 59 | public List<PreparesecondaryEntity> findByMainAndSub(String waybillnomaster,String waybillnoSub) { |
56 | return preparesecondaryRepository.findByMainAndSub(waybillnomaster, waybillnoSub); | 60 | return preparesecondaryRepository.findByMainAndSub(waybillnomaster, waybillnoSub); |
57 | } | 61 | } |
@@ -12,7 +12,8 @@ | @@ -12,7 +12,8 @@ | ||
12 | 12 | ||
13 | # 69 | 13 | # 69 |
14 | jdbc.driverClassName=oracle.jdbc.driver.OracleDriver | 14 | jdbc.driverClassName=oracle.jdbc.driver.OracleDriver |
15 | -jdbc.url=jdbc:oracle:thin:@10.50.3.69:1521:CGODB | 15 | +#jdbc.url=jdbc:oracle:thin:@10.50.3.70:1521:CGODB |
16 | +jdbc.url=jdbc:oracle:thin:@218.28.199.134:8004:CGODB | ||
16 | jdbc.username=CGOASM | 17 | jdbc.username=CGOASM |
17 | jdbc.password=vmvnv1v2 | 18 | jdbc.password=vmvnv1v2 |
18 | 19 | ||
@@ -31,7 +32,7 @@ timeBetweenEvictionRunsMillis=3000 | @@ -31,7 +32,7 @@ timeBetweenEvictionRunsMillis=3000 | ||
31 | minEvictableIdleTimeMillis=300000 | 32 | minEvictableIdleTimeMillis=300000 |
32 | 33 | ||
33 | #spring-data-jpa sql config | 34 | #spring-data-jpa sql config |
34 | -showSql=false | 35 | +showSql=true |
35 | generateDdl=none | 36 | generateDdl=none |
36 | formatSql=true | 37 | formatSql=true |
37 | 38 |
@@ -90,9 +90,9 @@ | @@ -90,9 +90,9 @@ | ||
90 | /**/cross/** = anon | 90 | /**/cross/** = anon |
91 | /tracking/detail/** = anon | 91 | /tracking/detail/** = anon |
92 | 92 | ||
93 | - | 93 | + /manifest/save = anon |
94 | /logout = logout | 94 | /logout = logout |
95 | - /** = authc | 95 | + /** = anon |
96 | 96 | ||
97 | </value> | 97 | </value> |
98 | </property> | 98 | </property> |
@@ -207,7 +207,7 @@ | @@ -207,7 +207,7 @@ | ||
207 | <td class="kv-content" colspan="3"> | 207 | <td class="kv-content" colspan="3"> |
208 | <input required id="productname" name="productname" maxlength="200" type="text" style="width: 96%;" | 208 | <input required id="productname" name="productname" maxlength="200" type="text" style="width: 96%;" |
209 | oninput="onInputChange(event,'productname','oninput')" value="${manifest.productname}" | 209 | oninput="onInputChange(event,'productname','oninput')" value="${manifest.productname}" |
210 | - onpropertychange="onInputChange(event,'productname','onpropertychange')" /> | 210 | + onpropertychange="onInputChange(event,'productname','onpropertychange')" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" onpaste="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" oncontextmenu="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\ ]/g,'')" /> |
211 | </td> | 211 | </td> |
212 | 212 | ||
213 | <td class="kv-label"><spring:message code="delivery.special.cargo.code" /></td> | 213 | <td class="kv-label"><spring:message code="delivery.special.cargo.code" /></td> |
-
请 注册 或 登录 后发表评论