作者 Promise

更新字段并自动发送

  1 +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
  2 + <wb-module deploy-name="statistics">
  3 + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
  4 + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
  5 + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
  6 + <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
  7 + <property name="context-root" value="statistics"/>
  8 + <property name="java-output-path" value="/statistics/target/classes"/>
  9 + </wb-module>
  10 +</project-modules>
@@ -146,7 +146,14 @@ @@ -146,7 +146,14 @@
146 <dependency> 146 <dependency>
147 <groupId>com.mchange</groupId> 147 <groupId>com.mchange</groupId>
148 <artifactId>c3p0</artifactId> 148 <artifactId>c3p0</artifactId>
149 - <version>0.9.5.1</version> 149 + <version>0.9.5.2</version>
  150 + </dependency>
  151 +
  152 + <!--druid-->
  153 + <dependency>
  154 + <groupId>com.alibaba</groupId>
  155 + <artifactId>druid</artifactId>
  156 + <version>1.1.12</version>
150 </dependency> 157 </dependency>
151 158
152 <dependency> 159 <dependency>
@@ -157,7 +164,7 @@ @@ -157,7 +164,7 @@
157 164
158 165
159 <!--servlet/jsp api start--> 166 <!--servlet/jsp api start-->
160 - <dependency> 167 +<!-- <dependency>
161 <groupId>javax.servlet</groupId> 168 <groupId>javax.servlet</groupId>
162 <artifactId>servlet-api</artifactId> 169 <artifactId>servlet-api</artifactId>
163 <version>2.5</version> 170 <version>2.5</version>
@@ -168,7 +175,7 @@ @@ -168,7 +175,7 @@
168 <artifactId>jsp-api</artifactId> 175 <artifactId>jsp-api</artifactId>
169 <version>2.1</version> 176 <version>2.1</version>
170 <scope>provided</scope> 177 <scope>provided</scope>
171 - </dependency> 178 + </dependency> -->
172 <!--servlet/jsp api end--> 179 <!--servlet/jsp api end-->
173 180
174 <!--junit4--> 181 <!--junit4-->
@@ -49,7 +49,11 @@ public class DataController { @@ -49,7 +49,11 @@ public class DataController {
49 return "updateT"; 49 return "updateT";
50 } 50 }
51 51
52 - @RequestMapping(value = "updateMain", method = RequestMethod.POST) 52 +
  53 + /*
  54 + * 更新空字段
  55 + */
  56 + @RequestMapping(value = "updateNull", method = RequestMethod.POST)
53 @ResponseBody 57 @ResponseBody
54 public AjaxJson updateMain(HttpSession session,ModelMap modelMap, 58 public AjaxJson updateMain(HttpSession session,ModelMap modelMap,
55 @RequestParam String flightno, 59 @RequestParam String flightno,
@@ -63,7 +67,8 @@ public class DataController { @@ -63,7 +67,8 @@ public class DataController {
63 Originmanifestmaster mainfest = new Originmanifestmaster(); 67 Originmanifestmaster mainfest = new Originmanifestmaster();
64 mainfest.setFlightno(flightno); 68 mainfest.setFlightno(flightno);
65 mainfest.setFlightDate(flightdate); 69 mainfest.setFlightDate(flightdate);
66 - dataService.updateMain(mainfest); 70 + dataService.updateMain(mainfest); //更新主单空字段
  71 + dataService.update(mainfest); //更新分单空字段
67 j.setSuccess(true); 72 j.setSuccess(true);
68 message = "主单更新完毕"; 73 message = "主单更新完毕";
69 } catch (Exception e) { 74 } catch (Exception e) {
@@ -77,7 +82,7 @@ public class DataController { @@ -77,7 +82,7 @@ public class DataController {
77 return j; 82 return j;
78 } 83 }
79 84
80 - @RequestMapping(value = "updateSecond", method = RequestMethod.POST) 85 + /*@RequestMapping(value = "updateSecond", method = RequestMethod.POST)
81 @ResponseBody 86 @ResponseBody
82 public AjaxJson updateSecond(HttpSession session,ModelMap modelMap, 87 public AjaxJson updateSecond(HttpSession session,ModelMap modelMap,
83 @RequestParam String flightno, 88 @RequestParam String flightno,
@@ -104,8 +109,16 @@ public class DataController { @@ -104,8 +109,16 @@ public class DataController {
104 109
105 j.setMsg(message); 110 j.setMsg(message);
106 return j; 111 return j;
107 - } 112 + }*/
108 113
  114 + /**
  115 + * 更新分单状态并手动发送
  116 + * @param session
  117 + * @param modelMap
  118 + * @param flightno
  119 + * @param flightdate
  120 + * @return
  121 + */
109 @RequestMapping(value = "updateMainStatus", method = RequestMethod.POST) 122 @RequestMapping(value = "updateMainStatus", method = RequestMethod.POST)
110 @ResponseBody 123 @ResponseBody
111 public AjaxJson updateMainStatus(HttpSession session,ModelMap modelMap, 124 public AjaxJson updateMainStatus(HttpSession session,ModelMap modelMap,
@@ -123,10 +136,10 @@ public class DataController { @@ -123,10 +136,10 @@ public class DataController {
123 dataService.updateMainStatus(mainfest); 136 dataService.updateMainStatus(mainfest);
124 137
125 j.setSuccess(true); 138 j.setSuccess(true);
126 - message = "主单状态更新完成"; 139 + message = "状态更新完成";
127 } catch (Exception e) { 140 } catch (Exception e) {
128 j.setSuccess(false); 141 j.setSuccess(false);
129 - message = "主单状态更新失败"; 142 + message = "状态更新失败";
130 e.printStackTrace(); 143 e.printStackTrace();
131 } 144 }
132 145
@@ -135,6 +148,79 @@ public class DataController { @@ -135,6 +148,79 @@ public class DataController {
135 } 148 }
136 149
137 /** 150 /**
  151 + * 更新主单状态并自动发送
  152 + * @param session
  153 + * @param modelMap
  154 + * @param flightno
  155 + * @param flightdate
  156 + * @return
  157 + */
  158 + @RequestMapping(value = "updateMainStatusAuto", method = RequestMethod.POST)
  159 + @ResponseBody
  160 + public AjaxJson updateMainStatusAuto(HttpSession session,ModelMap modelMap,
  161 + @RequestParam String flightno,
  162 + @RequestParam String flightdate
  163 + )
  164 + {
  165 + String message = null;
  166 + AjaxJson j = new AjaxJson();
  167 +
  168 + try {
  169 + Originmanifestmaster mainfest = new Originmanifestmaster();
  170 + mainfest.setFlightno(flightno);
  171 + mainfest.setFlightDate(flightdate);
  172 + dataService.updateMainStatusAuto(mainfest);
  173 +
  174 + j.setSuccess(true);
  175 + message = "状态更新完成";
  176 + } catch (Exception e) {
  177 + j.setSuccess(false);
  178 + message = "状态更新失败";
  179 + e.printStackTrace();
  180 + }
  181 +
  182 + j.setMsg(message);
  183 + return j;
  184 + }
  185 +
  186 + /**
  187 + * 更新分单状态
  188 + * @param session
  189 + * @param modelMap
  190 + * @param flightno
  191 + * @param flightdate
  192 + * @return
  193 + */
  194 + @RequestMapping(value = "updateSecondStatus", method = RequestMethod.POST)
  195 + @ResponseBody
  196 + public AjaxJson updateSecondStatus(HttpSession session,ModelMap modelMap,
  197 + @RequestParam String flightno,
  198 + @RequestParam String flightdate
  199 + )
  200 + {
  201 + String message = null;
  202 + AjaxJson j = new AjaxJson();
  203 +
  204 + try {
  205 + Originmanifestmaster mainfest = new Originmanifestmaster();
  206 + mainfest.setFlightno(flightno);
  207 + mainfest.setFlightDate(flightdate);
  208 + dataService.updateSecondStatus(mainfest);
  209 +
  210 + j.setSuccess(true);
  211 + message = "状态更新完成";
  212 + } catch (Exception e) {
  213 + j.setSuccess(false);
  214 + message = "状态更新失败";
  215 + e.printStackTrace();
  216 + }
  217 +
  218 + j.setMsg(message);
  219 + return j;
  220 + }
  221 +
  222 +
  223 + /**
138 * 修改原始的航班日期 224 * 修改原始的航班日期
139 * 225 *
140 * @param session 226 * @param session
@@ -9,14 +9,9 @@ import org.apache.shiro.authz.UnauthenticatedException; @@ -9,14 +9,9 @@ import org.apache.shiro.authz.UnauthenticatedException;
9 import org.apache.shiro.subject.Subject; 9 import org.apache.shiro.subject.Subject;
10 import org.springframework.stereotype.Controller; 10 import org.springframework.stereotype.Controller;
11 import org.springframework.transaction.annotation.Transactional; 11 import org.springframework.transaction.annotation.Transactional;
12 -import org.springframework.ui.Model;  
13 import org.springframework.web.bind.annotation.RequestMapping; 12 import org.springframework.web.bind.annotation.RequestMapping;
14 import org.springframework.web.bind.annotation.RequestMethod; 13 import org.springframework.web.bind.annotation.RequestMethod;
15 import org.springframework.web.bind.annotation.ResponseBody; 14 import org.springframework.web.bind.annotation.ResponseBody;
16 -import org.springframework.web.servlet.ModelAndView;  
17 -  
18 -  
19 -import javax.servlet.http.HttpServletRequest;  
20 15
21 /** 16 /**
22 * Created by mrz on 2017/8/28. 17 * Created by mrz on 2017/8/28.
@@ -183,7 +183,8 @@ public class PreController { @@ -183,7 +183,8 @@ public class PreController {
183 public AjaxJson transitfestSearch(HttpSession session,ModelMap modelMap, 183 public AjaxJson transitfestSearch(HttpSession session,ModelMap modelMap,
184 @RequestParam String flightno, 184 @RequestParam String flightno,
185 @RequestParam String flightdate, 185 @RequestParam String flightdate,
186 - @RequestParam String tflightno 186 + @RequestParam String tflightno,
  187 + @RequestParam String tflightdate
187 ) 188 )
188 { 189 {
189 String message = null; 190 String message = null;
@@ -193,7 +194,8 @@ public class PreController { @@ -193,7 +194,8 @@ public class PreController {
193 mainfest.setFlightno(flightno); 194 mainfest.setFlightno(flightno);
194 mainfest.setFlightDate(flightdate); 195 mainfest.setFlightDate(flightdate);
195 mainfest.setPreCarrier(tflightno.substring(0,2)); 196 mainfest.setPreCarrier(tflightno.substring(0,2));
196 - mainfest.setPreFlightno(tflightno.substring(2)); 197 + mainfest.setPreFlightDate(tflightno.substring(2));
  198 + mainfest.setPreFlightDate(tflightdate);
197 199
198 List<Originmanifestmaster> list = mainfestService.getList(mainfest); 200 List<Originmanifestmaster> list = mainfestService.getList(mainfest);
199 if(list.size()!=0||!list.isEmpty()){ 201 if(list.size()!=0||!list.isEmpty()){
1 package com.tianbo.controller.billNo; 1 package com.tianbo.controller.billNo;
2 2
3 -import java.util.ArrayList;  
4 import java.util.HashMap; 3 import java.util.HashMap;
5 import java.util.List; 4 import java.util.List;
6 import java.util.Map; 5 import java.util.Map;
@@ -32,6 +32,10 @@ public interface OriginmanifestmasterMapper { @@ -32,6 +32,10 @@ public interface OriginmanifestmasterMapper {
32 32
33 void updateStatus(Originmanifestmaster mainfest); 33 void updateStatus(Originmanifestmaster mainfest);
34 34
  35 + void updateMainStatusAuto(Originmanifestmaster mainfest);
  36 +
  37 + void updateSecondStatus(Originmanifestmaster mainfest);
  38 +
35 void updateMainStatus(Originmanifestmaster mainfest); 39 void updateMainStatus(Originmanifestmaster mainfest);
36 40
37 void updateAllStatus(Originmanifestmaster mainfest); 41 void updateAllStatus(Originmanifestmaster mainfest);
@@ -42,4 +46,6 @@ public interface OriginmanifestmasterMapper { @@ -42,4 +46,6 @@ public interface OriginmanifestmasterMapper {
42 46
43 void updateFlightDate(@Param("flightno")String flightno, @Param("flightdate")String flightdate, @Param("uFlightdate")String uFlightdate); 47 void updateFlightDate(@Param("flightno")String flightno, @Param("flightdate")String flightdate, @Param("uFlightdate")String uFlightdate);
44 48
  49 +
  50 +
45 } 51 }
@@ -4,9 +4,11 @@ import java.util.Date; @@ -4,9 +4,11 @@ import java.util.Date;
4 4
5 public class Originmanifestmaster { 5 public class Originmanifestmaster {
6 6
7 - private String PreCarrier; 7 + private String preCarrier;
8 8
9 - private String PreFlightno; 9 + private String preFlightno;
  10 +
  11 + private String preFlightDate;
10 12
11 private String autoid; 13 private String autoid;
12 14
@@ -449,18 +451,24 @@ public class Originmanifestmaster { @@ -449,18 +451,24 @@ public class Originmanifestmaster {
449 } 451 }
450 452
451 public String getPreFlightno() { 453 public String getPreFlightno() {
452 - return PreFlightno;  
453 - }  
454 -  
455 - public void setPreFlightno(String preFlightno) {  
456 - PreFlightno = preFlightno; 454 + return preFlightno;
457 } 455 }
458 456
459 public String getPreCarrier() { 457 public String getPreCarrier() {
460 - return PreCarrier; 458 + return preCarrier;
461 } 459 }
462 460
463 public void setPreCarrier(String preCarrier) { 461 public void setPreCarrier(String preCarrier) {
464 - PreCarrier = preCarrier; 462 + this.preCarrier = preCarrier;
  463 + }
  464 +
  465 + public String getPreFlightDate() {
  466 + return preFlightDate;
  467 + }
  468 +
  469 + public void setPreFlightDate(String preFlightDate) {
  470 + this.preFlightDate = preFlightDate;
465 } 471 }
466 } 472 }
  473 +
  474 +
@@ -10,6 +10,10 @@ public interface DataService { @@ -10,6 +10,10 @@ public interface DataService {
10 10
11 public void updateMainStatus(Originmanifestmaster mainfest); 11 public void updateMainStatus(Originmanifestmaster mainfest);
12 12
  13 + public void updateMainStatusAuto(Originmanifestmaster mainfest);
  14 +
  15 + public void updateSecondStatus(Originmanifestmaster mainfest);
  16 +
13 public void updateStatus(Originmanifestmaster mainfest); 17 public void updateStatus(Originmanifestmaster mainfest);
14 18
15 public void updateAllMainStatus(Originmanifestmaster mainfest); 19 public void updateAllMainStatus(Originmanifestmaster mainfest);
@@ -19,4 +23,6 @@ public interface DataService { @@ -19,4 +23,6 @@ public interface DataService {
19 public void updateToT(Originmanifestmaster mainfest); 23 public void updateToT(Originmanifestmaster mainfest);
20 24
21 public void updateFlightDate(String flightno, String flightdate, String uFlightdate); 25 public void updateFlightDate(String flightno, String flightdate, String uFlightdate);
  26 +
  27 +
22 } 28 }
@@ -31,6 +31,17 @@ public class DataServiceImpl implements DataService { @@ -31,6 +31,17 @@ public class DataServiceImpl implements DataService {
31 } 31 }
32 32
33 @Override 33 @Override
  34 + public void updateMainStatusAuto(Originmanifestmaster mainfest) {
  35 + MainfestDao.updateMainStatusAuto(mainfest);
  36 + }
  37 +
  38 + @Override
  39 + public void updateSecondStatus(Originmanifestmaster mainfest) {
  40 + MainfestDao.updateSecondStatus(mainfest);
  41 + }
  42 +
  43 +
  44 + @Override
34 public void updateStatus(Originmanifestmaster mainfest) { 45 public void updateStatus(Originmanifestmaster mainfest) {
35 MainfestDao.updateStatus(mainfest); 46 MainfestDao.updateStatus(mainfest);
36 47
@@ -60,4 +71,7 @@ public class DataServiceImpl implements DataService { @@ -60,4 +71,7 @@ public class DataServiceImpl implements DataService {
60 } 71 }
61 72
62 73
  74 +
  75 +
  76 +
63 } 77 }
@@ -31,45 +31,32 @@ @@ -31,45 +31,32 @@
31 select count(*) from FLIGHTSETTING 31 select count(*) from FLIGHTSETTING
32 WHERE 1=1 32 WHERE 1=1
33 <if test="flightno != null and flightno != ''"> 33 <if test="flightno != null and flightno != ''">
34 - AND flightno = #{flightno} 34 + AND flightno like CONCAT(CONCAT('%',#{flightno}),'%')
35 </if> 35 </if>
36 </select> 36 </select>
37 37
38 <select id="getList" resultType="com.tianbo.model.FlightSetting"> 38 <select id="getList" resultType="com.tianbo.model.FlightSetting">
39 SELECT 39 SELECT
40 - * 40 + T2.*
41 FROM 41 FROM
42 - (  
43 - SELECT ROWNUM  
44 - rn,  
45 - ft.*  
46 - FROM  
47 - FLIGHTSETTING ft  
48 - ORDER BY ft.createdate desc  
49 - ) cr 42 + ( SELECT ROWNUM RN, T.* FROM ( SELECT * FROM ( SELECT * FROM FLIGHTSETTING ) ORDER BY createdate DESC ) T ) T2
50 WHERE 43 WHERE
51 - cr.rn BETWEEN #{start} AND #{end}  
52 - 44 + RN BETWEEN #{start} AND #{end}
53 </select> 45 </select>
54 46
55 <select id="selectByFlightno" resultType="com.tianbo.model.FlightSetting"> 47 <select id="selectByFlightno" resultType="com.tianbo.model.FlightSetting">
56 SELECT 48 SELECT
57 - * 49 + T2.*
58 FROM 50 FROM
59 - (  
60 - SELECT ROWNUM  
61 - rn,  
62 - ft.*  
63 - FROM  
64 - FLIGHTSETTING ft 51 + ( SELECT ROWNUM RN, T.* FROM (
  52 + SELECT * FROM (
  53 + SELECT * FROM FLIGHTSETTING
65 <if test="flightno != null and flightno != ''"> 54 <if test="flightno != null and flightno != ''">
66 - WHERE ft.flightno = #{flightno} 55 + WHERE flightno like CONCAT(CONCAT('%',#{flightno}),'%')
67 </if> 56 </if>
68 - ORDER BY ft.createdate desc  
69 - ) cr 57 + ) ORDER BY createdate DESC ) T ) T2
70 WHERE 58 WHERE
71 - cr.rn BETWEEN #{start} AND #{end}  
72 - 59 + RN BETWEEN #{start} AND #{end}
73 </select> 60 </select>
74 61
75 <insert id="insert" parameterType="com.tianbo.model.FlightSetting"> 62 <insert id="insert" parameterType="com.tianbo.model.FlightSetting">
@@ -196,9 +196,9 @@ @@ -196,9 +196,9 @@
196 SUBSTR( "ORIGINMANIFESTMASTER"."FLIGHTNO", 3 ) AS ORIGINAL_FLIGHTNO, 196 SUBSTR( "ORIGINMANIFESTMASTER"."FLIGHTNO", 3 ) AS ORIGINAL_FLIGHTNO,
197 "ORIGINMANIFESTMASTER"."FLIGHT_DATE" AS ORIGINAL_FLIGHTDATE, 197 "ORIGINMANIFESTMASTER"."FLIGHT_DATE" AS ORIGINAL_FLIGHTDATE,
198 "ORIGINMANIFESTMASTER"."WAYBILLNOMASTER" AS ORIGINAL_BILLNO, 198 "ORIGINMANIFESTMASTER"."WAYBILLNOMASTER" AS ORIGINAL_BILLNO,
199 - #{PreCarrier} AS PRE_CARRIER,  
200 - #{PreFlightno} AS PRE_FLIGHTNO,  
201 - "ORIGINMANIFESTMASTER"."FLIGHT_DATE" AS PRE_FLIGHTDATE, 199 + #{preCarrier} AS PRE_CARRIER,
  200 + #{preFlightno} AS PRE_FLIGHTNO,
  201 + #{preFlightDate} AS PRE_FLIGHTDATE,
202 "ORIGINMANIFESTMASTER"."WAYBILLNOMASTER" AS PRE_BILLNO, 202 "ORIGINMANIFESTMASTER"."WAYBILLNOMASTER" AS PRE_BILLNO,
203 "ORIGINMANIFESTMASTER"."TOTALPIECE" AS BILLPIECE, 203 "ORIGINMANIFESTMASTER"."TOTALPIECE" AS BILLPIECE,
204 "ORIGINMANIFESTMASTER"."TOTALWEIGHT" AS BILLWEIGHT, 204 "ORIGINMANIFESTMASTER"."TOTALWEIGHT" AS BILLWEIGHT,
@@ -808,35 +808,41 @@ @@ -808,35 +808,41 @@
808 AND 808 AND
809 FLIGHT_DATE = TO_DATE (#{flightDate}, 'yyyy-mm-dd')) 809 FLIGHT_DATE = TO_DATE (#{flightDate}, 'yyyy-mm-dd'))
810 </update> 810 </update>
  811 +
811 <update id="updateMainStatus" parameterType="com.tianbo.model.Originmanifestmaster"> 812 <update id="updateMainStatus" parameterType="com.tianbo.model.Originmanifestmaster">
812 - UPDATE ORIGINMANIFESTMASTER SET STATUS='17' WHERE AUTOID IN (  
813 - SELECT  
814 - MESSAGEAUTOID  
815 - FROM  
816 - "SENDLOG"  
817 - WHERE  
818 - MESSAGEAUTOID IN (  
819 - SELECT  
820 - AUTOID  
821 - FROM  
822 - ORIGINMANIFESTMASTER 813 + UPDATE ORIGINMANIFESTMASTER
  814 + SET
  815 + STATUS='17'
823 WHERE 816 WHERE
824 FLIGHT_DATE = TO_DATE (#{flightDate}, 'yyyy-mm-dd') 817 FLIGHT_DATE = TO_DATE (#{flightDate}, 'yyyy-mm-dd')
825 AND 818 AND
826 FLIGHTNO=#{flightno} 819 FLIGHTNO=#{flightno}
827 - )  
828 - AND RECEIPTION LIKE '%50001%'  
829 - ) 820 + AND
  821 + ( RECEIPTINFORMATION LIKE '%31143%' OR RECEIPTINFORMATION LIKE '%50001%' OR RECEIPTINFORMATION LIKE '%11104%' )
830 </update> 822 </update>
831 823
832 - <update id="updateAllMainStatus" parameterType="com.tianbo.model.Originmanifestmaster">  
833 - UPDATE ORIGINMANIFESTMASTER SET STATUS='17' WHERE AUTOID IN (  
834 - SELECT  
835 - MESSAGEAUTOID  
836 - FROM  
837 - "SENDLOG" 824 + <update id="updateMainStatusAuto" parameterType="com.tianbo.model.Originmanifestmaster">
  825 + UPDATE ORIGINMANIFESTMASTER
  826 + SET
  827 + STATUS='01'
838 WHERE 828 WHERE
839 - MESSAGEAUTOID IN ( 829 + FLIGHT_DATE = TO_DATE (#{flightDate}, 'yyyy-mm-dd')
  830 + AND
  831 + FLIGHTNO=#{flightno}
  832 + AND
  833 + ( RECEIPTINFORMATION LIKE '%31143%' OR RECEIPTINFORMATION LIKE '%50001%' OR RECEIPTINFORMATION LIKE '%11104%' )
  834 + </update>
  835 +
  836 + <update id="updateSecondStatus" parameterType="com.tianbo.model.Originmanifestmaster">
  837 + UPDATE ORIGINMANIFESTSECONDARY
  838 + SET STATUS = '17'
  839 + WHERE (
  840 + RECEIPTION LIKE '%50001%'
  841 + OR RECEIPTION LIKE '%31143%'
  842 + OR RECEIPTION LIKE '%11104%'
  843 + OR RECEIPTION LIKE '%50002%'
  844 + )
  845 + AND ORIGINMANIFESTMASTERAUTOID IN (
840 SELECT 846 SELECT
841 AUTOID 847 AUTOID
842 FROM 848 FROM
@@ -846,15 +852,16 @@ @@ -846,15 +852,16 @@
846 AND 852 AND
847 FLIGHTNO=#{flightno} 853 FLIGHTNO=#{flightno}
848 ) 854 )
849 - )  
850 </update> 855 </update>
851 856
852 <update id="updateFlightDate"> 857 <update id="updateFlightDate">
853 UPDATE ORIGINMANIFESTMASTER 858 UPDATE ORIGINMANIFESTMASTER
854 - SET FLIGHT_DATE = TO_DATE (#{uFlightdate}, 'yyyy-mm-dd') 859 + SET
  860 + FLIGHT_DATE = TO_DATE (#{uFlightdate}, 'yyyy-mm-dd')
855 WHERE 861 WHERE
856 FLIGHTNO=#{flightno} 862 FLIGHTNO=#{flightno}
857 - AND FLIGHT_DATE = TO_DATE(#{flightdate}, 'yyyy-mm-dd') 863 + AND
  864 + FLIGHT_DATE = TO_DATE(#{flightdate}, 'yyyy-mm-dd')
858 </update> 865 </update>
859 866
860 867
@@ -9,8 +9,8 @@ @@ -9,8 +9,8 @@
9 <context:property-placeholder location="classpath:config/jdbc.properties"/> 9 <context:property-placeholder location="classpath:config/jdbc.properties"/>
10 10
11 11
12 - <!--设置数据源c3p0-->  
13 - <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> 12 +
  13 + <!-- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
14 <property name="driverClass" value="${jdbc.driver}"/> 14 <property name="driverClass" value="${jdbc.driver}"/>
15 <property name="jdbcUrl" value="${jdbc.url}"/> 15 <property name="jdbcUrl" value="${jdbc.url}"/>
16 <property name="user" value="${jdbc.username}"/> 16 <property name="user" value="${jdbc.username}"/>
@@ -18,6 +18,37 @@ @@ -18,6 +18,37 @@
18 <property name="maxPoolSize" value="50"/> 18 <property name="maxPoolSize" value="50"/>
19 <property name="minPoolSize" value="2"/> 19 <property name="minPoolSize" value="2"/>
20 <property name="maxIdleTime" value="60"/> 20 <property name="maxIdleTime" value="60"/>
  21 + </bean> -->
  22 +
  23 + <!--设置数据源druid-->
  24 +
  25 + <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
  26 + <!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
  27 + <property name="driverClassName" value="${jdbc.driver}" />
  28 +
  29 + <!-- 基本属性 url、user、password -->
  30 + <property name="url" value="${jdbc.url}" />
  31 + <property name="username" value="${jdbc.username}" />
  32 + <property name="password" value="${jdbc.password}" />
  33 +
  34 + <!-- 配置初始化大小、最小、最大 -->
  35 + <property name="initialSize" value="1" />
  36 + <property name="minIdle" value="3" />
  37 + <property name="maxActive" value="60" />
  38 +
  39 + <!-- 配置获取连接等待超时的时间 -->
  40 + <property name="maxWait" value="60000" />
  41 +
  42 + <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
  43 + <property name="timeBetweenEvictionRunsMillis" value="60000" />
  44 +
  45 + <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
  46 + <property name="minEvictableIdleTimeMillis" value="300000" />
  47 +
  48 + <property name="validationQuery" value="select 1 from dual" />
  49 + <property name="testWhileIdle" value="true" />
  50 + <property name="testOnBorrow" value="false" />
  51 + <property name="testOnReturn" value="false" />
21 </bean> 52 </bean>
22 53
23 <!--sqlsessionFactory bean--> 54 <!--sqlsessionFactory bean-->
@@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
80 <div class="layui-inline"> 80 <div class="layui-inline">
81 <label class="layui-form-label">跨天数</label> 81 <label class="layui-form-label">跨天数</label>
82 <div class="layui-input-inline"> 82 <div class="layui-input-inline">
83 - <input type="text" id="crossdatys" name="crossdatys" autocomplete="off" class="layui-input"> 83 + <input type="number" id="crossdatys" name="crossdatys" autocomplete="off" class="layui-input">
84 </div> 84 </div>
85 </div> 85 </div>
86 </div> 86 </div>
@@ -94,7 +94,7 @@ @@ -94,7 +94,7 @@
94 <div class="layui-inline"> 94 <div class="layui-inline">
95 <label class="layui-form-label">星期</label> 95 <label class="layui-form-label">星期</label>
96 <div class="layui-input-inline"> 96 <div class="layui-input-inline">
97 - <input type="text" id="week" name="week" autocomplete="off" class="layui-input"> 97 + <input type="number" id="week" name="week" autocomplete="off" class="layui-input">
98 </div> 98 </div>
99 </div> 99 </div>
100 </div> 100 </div>
@@ -5,43 +5,54 @@ @@ -5,43 +5,54 @@
5 %> 5 %>
6 <!doctype html> 6 <!doctype html>
7 <html lang="zh"> 7 <html lang="zh">
  8 +
8 <head> 9 <head>
9 <meta charset="utf-8"> 10 <meta charset="utf-8">
10 <meta name="viewport" content="width=device-width, initial-scale=1"> 11 <meta name="viewport" content="width=device-width, initial-scale=1">
11 - <title>航班日期修改</title> 12 + <title>航班跨天配置</title>
12 <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%> 13 <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%>
  14 + <%-- <link rel="stylesheet" href="<%=basePath %>/static/css/main.css" /> --%>
  15 +
13 <script src="<%=basePath %>static/easyui/jquery.min.js"></script> 16 <script src="<%=basePath %>static/easyui/jquery.min.js"></script>
14 <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet"> 17 <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet">
15 <script src="<%=basePath %>static/layui2.4.5/layui.js"></script> 18 <script src="<%=basePath %>static/layui2.4.5/layui.js"></script>
16 <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script> 19 <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script>
17 </head> 20 </head>
18 -<body>  
19 -<div class="demoTable"> 21 +
  22 +<body align='center'>
  23 + <!-- <ul class="layui-nav layui-bg-blue">
  24 + <li class="layui-nav-item">新舱单系统航班跨天配置</li>
  25 + </ul> -->
  26 + <div>&nbsp;</div>
  27 + <div>
20 航班号: 28 航班号:
21 <div class="layui-inline"> 29 <div class="layui-inline">
22 <input class="layui-input" style="text-transform:uppercase;" name="flightno" id="flightno" autocomplete="off" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> 30 <input class="layui-input" style="text-transform:uppercase;" name="flightno" id="flightno" autocomplete="off" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();">
23 </div> 31 </div>
24 <button class="layui-btn" lay-submit="" id="searchBtn" data-type="getInfo">查询</button> 32 <button class="layui-btn" lay-submit="" id="searchBtn" data-type="getInfo">查询</button>
25 <button class="layui-btn" data-type="reload" id="add">新增</button> 33 <button class="layui-btn" data-type="reload" id="add">新增</button>
26 -</div>  
27 -<table class="layui-hide" id="flight" lay-filter="flight"></table> 34 + </div>
  35 + <div class="layui-inline" >
  36 + <table class="layui-hide" id="flight" lay-filter="flight" style="width:99%;"></table>
  37 + </div>
  38 +
28 <%-- 39 <%--
29 -<script type="text/html" id="toolbar"> 40 + <script type="text/html" id="toolbar">
30 <div class="layui-btn-container"> 41 <div class="layui-btn-container">
31 <button class="layui-btn layui-btn-sm" >新增</button> 42 <button class="layui-btn layui-btn-sm" >新增</button>
32 <input id="searchInput" type="text" placeholder="请输入关键字"> 43 <input id="searchInput" type="text" placeholder="请输入关键字">
33 <button class="layui-btn layui-btn-sm" >查询</button> 44 <button class="layui-btn layui-btn-sm" >查询</button>
34 </div> 45 </div>
35 -</script> --%> 46 + </script> --%>
36 47
37 -<script type="text/html" id="barDemo"> 48 + <script type="text/html" id="barDemo">
38 <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> 49 <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
39 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> 50 <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
40 -</script> 51 + </script>
41 52
42 53
43 -<script>  
44 -layui.use('table', function(){ 54 + <script>
  55 + layui.use('table', function(){
45 var table = layui.table; 56 var table = layui.table;
46 57
47 table.render({ 58 table.render({
@@ -51,8 +62,7 @@ layui.use('table', function(){ @@ -51,8 +62,7 @@ layui.use('table', function(){
51 ,title: '航班跨天配置' 62 ,title: '航班跨天配置'
52 ,page: true //开启分页 63 ,page: true //开启分页
53 ,cols: [[ 64 ,cols: [[
54 - {type: 'checkbox', fixed: 'left'}  
55 - ,{field:'flightno', title:'航班号', width:90, fixed: 'left', unresize: true, sort: true} 65 + {field:'flightno', title:'航班号', width:100, fixed: 'left', unresize: true, sort: true}
56 ,{field:'crossdatys', title:'跨天数', width:120, edit: 'text'} 66 ,{field:'crossdatys', title:'跨天数', width:120, edit: 'text'}
57 ,{field:'originatingstation', title:'起始站', width:80, edit: 'text', sort: true} 67 ,{field:'originatingstation', title:'起始站', width:80, edit: 'text', sort: true}
58 ,{field:'week', title:'星期', width:100} 68 ,{field:'week', title:'星期', width:100}
@@ -122,15 +132,14 @@ layui.use('table', function(){ @@ -122,15 +132,14 @@ layui.use('table', function(){
122 var id = data.id; 132 var id = data.id;
123 layer.open({ 133 layer.open({
124 type: 2, 134 type: 2,
125 - title: "航班跨天编辑", //不显示标题栏  
126 - closeBtn: 2, 135 + title: "航班跨天编辑",
127 shade: 0.8, 136 shade: 0.8,
128 id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748 137 id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
129 moveType: 1, //拖拽模式,0或者1 138 moveType: 1, //拖拽模式,0或者1
130 type: 2, 139 type: 2,
131 skin: 'layui-layer-rim', //加上边框 140 skin: 'layui-layer-rim', //加上边框
132 /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ 141 /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */
133 - area: ['700px', '260px'], 142 + area: ['700px', '220px'],
134 maxmin: true, //开启最大化最小化按钮 143 maxmin: true, //开启最大化最小化按钮
135 content: "<%=basePath %>/flight/edit?id="+id, 144 content: "<%=basePath %>/flight/edit?id="+id,
136 success: function (layero, index) { 145 success: function (layero, index) {
@@ -148,7 +157,7 @@ layui.use('table', function(){ @@ -148,7 +157,7 @@ layui.use('table', function(){
148 157
149 }); 158 });
150 159
151 -}); 160 + });
152 $("#add").click(function(){ 161 $("#add").click(function(){
153 layer.open({ 162 layer.open({
154 type: 2, 163 type: 2,
@@ -172,8 +181,6 @@ layui.use('table', function(){ @@ -172,8 +181,6 @@ layui.use('table', function(){
172 } 181 }
173 }) 182 })
174 }) 183 })
175 -</script>  
176 -  
177 - 184 + </script>
178 </body> 185 </body>
179 </html> 186 </html>
@@ -214,6 +214,7 @@ @@ -214,6 +214,7 @@
214 function transform() { 214 function transform() {
215 var flightno = $("#flightno").val(); 215 var flightno = $("#flightno").val();
216 var flightdate = $("#flightdate").val(); 216 var flightdate = $("#flightdate").val();
  217 + var tflightdate = $("#tflightdate").val();
217 var tflightno = $("#tflightno").val(); 218 var tflightno = $("#tflightno").val();
218 if(flightno==''){ 219 if(flightno==''){
219 $("#flightno").focus(); 220 $("#flightno").focus();
@@ -235,16 +236,24 @@ @@ -235,16 +236,24 @@
235 tips: [1, '#0FA6D8'] //还可配置颜色 236 tips: [1, '#0FA6D8'] //还可配置颜色
236 }); 237 });
237 return false; 238 return false;
  239 + }
  240 + else if(tflightdate==''){
  241 + $("#tflightdate").focus();
  242 + layer.tips('请输入转运航班日期', '#tflightdate', {
  243 + tips: [1, '#0FA6D8'] //还可配置颜色
  244 + });
  245 + return false;
238 } else { 246 } else {
239 layer.confirm('您确定要进行国际转运申请吗?', {icon: 3, title:'系统提示',shade: false}, function(index){ 247 layer.confirm('您确定要进行国际转运申请吗?', {icon: 3, title:'系统提示',shade: false}, function(index){
240 var flightno = $("#flightno").val(); 248 var flightno = $("#flightno").val();
241 var flightdate = $("#flightdate").val(); 249 var flightdate = $("#flightdate").val();
242 var tflightno = $("#tflightno").val(); 250 var tflightno = $("#tflightno").val();
  251 + var tflightdate = $("#tflightdate").val();
243 $.ajax({ 252 $.ajax({
244 url: "<%=basePath %>/Mainfest/Transit", 253 url: "<%=basePath %>/Mainfest/Transit",
245 type: "POST", 254 type: "POST",
246 datatype:"json", 255 datatype:"json",
247 - data:{flightno: flightno,flightdate:flightdate,tflightno:tflightno}, 256 + data:{flightno: flightno,flightdate:flightdate,tflightdate:tflightdate,tflightno:tflightno},
248 success: function(data){ 257 success: function(data){
249 if(data.success){ 258 if(data.success){
250 layer.alert( data.msg, function () { 259 layer.alert( data.msg, function () {
@@ -32,22 +32,17 @@ @@ -32,22 +32,17 @@
32 </div> 32 </div>
33 <div class="layui-col-md4"> 33 <div class="layui-col-md4">
34 <div class="layui-col-md4"> 34 <div class="layui-col-md4">
35 - <button class="" type="button" onclick="updateMain()" value="" maxlength="1" >主单空字段</button> 35 + <!-- <button class="" type="button" onclick="updateMain()" value="" maxlength="1" >主单空字段</button> -->
  36 + <button class="" type="button" onclick="updateNull()" value="" maxlength="1" >更新字段空值</button>
36 </div> 37 </div>
37 <div class="layui-col-md4"> 38 <div class="layui-col-md4">
38 - <button class="" type="button" onclick="updateSecond()" value="" maxlength="1" >分单空字段</button> 39 + <button class="" type="button" onclick="updateMainStatus()" value="" maxlength="1" >更新主单状态手动发送</button>
39 </div> 40 </div>
40 <div class="layui-col-md4"> 41 <div class="layui-col-md4">
41 - <button class="" type="button" onclick="updateMainStatus()" value="" maxlength="1" >主50001状态</button> 42 + <button class="" type="button" onclick="updateMainStatusAuto()" value="" maxlength="1" >更新主单状态自动发送</button>
42 </div> 43 </div>
43 <div class="layui-col-md4"> 44 <div class="layui-col-md4">
44 - <button class="" type="button" onclick="updateAllMainStatus()" value="" maxlength="1" >主单全状态</button>  
45 - </div>  
46 - <div class="layui-col-md4">  
47 - <button class="" type="button" onclick="updateAllStatus()" value="" maxlength="1" >分单全状态</button>  
48 - </div>  
49 - <div class="layui-col-md4">  
50 - <button class="" type="button" onclick="updateStatus()" value="" maxlength="1" >分50001状态</button> 45 + <button class="" type="button" onclick="updateSecondStatus()" value="" maxlength="1" >更新分单状态</button>
51 </div> 46 </div>
52 </div> 47 </div>
53 </div> 48 </div>
@@ -80,7 +75,7 @@ @@ -80,7 +75,7 @@
80 }); 75 });
81 } 76 }
82 77
83 - function updateMain() { 78 + function updateNull() {
84 var flightno = $("#flightno").val(); 79 var flightno = $("#flightno").val();
85 var flightdate = $("#flightdate").val(); 80 var flightdate = $("#flightdate").val();
86 81
@@ -99,11 +94,11 @@ @@ -99,11 +94,11 @@
99 }); 94 });
100 return false; 95 return false;
101 } else{ 96 } else{
102 - layer.confirm('您确定要更新主单56号令必填字段吗?', {icon: 3, title:'更新主单空字段',shade: false}, function(index){ 97 + layer.confirm('您确定要更新56号令必填字段吗?', {icon: 3, title:'填充空字段',shade: false}, function(index){
103 var flightno = $("#flightno").val(); 98 var flightno = $("#flightno").val();
104 var flightdate = $("#flightdate").val(); 99 var flightdate = $("#flightdate").val();
105 $.ajax({ 100 $.ajax({
106 - url: "<%=basePath %>/Data/updateMain", 101 + url: "<%=basePath %>/Data/updateNull",
107 type: "POST", 102 type: "POST",
108 datatype:"json", 103 datatype:"json",
109 data:{flightno: flightno,flightdate:flightdate}, 104 data:{flightno: flightno,flightdate:flightdate},
@@ -192,7 +187,7 @@ @@ -192,7 +187,7 @@
192 }); 187 });
193 return false; 188 return false;
194 } else{ 189 } else{
195 - layer.confirm('您确定要更新回执为50001状态的主单状态吗?', {icon: 3, title:'50001状态主单',shade: false}, function(index){ 190 + layer.confirm('您确定要更新主单状态并手动发送吗?', {icon: 3, title:'主单状态',shade: false}, function(index){
196 var flightno = $("#flightno").val(); 191 var flightno = $("#flightno").val();
197 var flightdate = $("#flightdate").val(); 192 var flightdate = $("#flightdate").val();
198 $.ajax({ 193 $.ajax({
@@ -263,7 +258,7 @@ @@ -263,7 +258,7 @@
263 } 258 }
264 } 259 }
265 260
266 - function updateAllMainStatus() { 261 + function updateMainStatusAuto() {
267 var flightno = $("#flightno").val(); 262 var flightno = $("#flightno").val();
268 var flightdate = $("#flightdate").val(); 263 var flightdate = $("#flightdate").val();
269 264
@@ -282,11 +277,11 @@ @@ -282,11 +277,11 @@
282 }); 277 });
283 return false; 278 return false;
284 } else{ 279 } else{
285 - layer.confirm('您确定要更新主单全部状态吗?', {icon: 3, title:'主单状态',shade: false}, function(index){ 280 + layer.confirm('您确定要更新主单状态并自动发送吗?', {icon: 3, title:'主单状态',shade: false}, function(index){
286 var flightno = $("#flightno").val(); 281 var flightno = $("#flightno").val();
287 var flightdate = $("#flightdate").val(); 282 var flightdate = $("#flightdate").val();
288 $.ajax({ 283 $.ajax({
289 - url: "<%=basePath %>/Data/updateAllMainStatus", 284 + url: "<%=basePath %>/Data/updateMainStatusAuto",
290 type: "POST", 285 type: "POST",
291 datatype:"json", 286 datatype:"json",
292 data:{flightno: flightno,flightdate:flightdate}, 287 data:{flightno: flightno,flightdate:flightdate},
@@ -308,7 +303,7 @@ @@ -308,7 +303,7 @@
308 } 303 }
309 } 304 }
310 305
311 - function updateAllStatus() { 306 + function updateSecondStatus() {
312 var flightno = $("#flightno").val(); 307 var flightno = $("#flightno").val();
313 var flightdate = $("#flightdate").val(); 308 var flightdate = $("#flightdate").val();
314 309
@@ -327,11 +322,11 @@ @@ -327,11 +322,11 @@
327 }); 322 });
328 return false; 323 return false;
329 } else{ 324 } else{
330 - layer.confirm('您确定要更新分单吗?', {icon: 3, title:'分单状态',shade: false}, function(index){ 325 + layer.confirm('您确定要更新分单状态吗?', {icon: 3, title:'分单状态',shade: false}, function(index){
331 var flightno = $("#flightno").val(); 326 var flightno = $("#flightno").val();
332 var flightdate = $("#flightdate").val(); 327 var flightdate = $("#flightdate").val();
333 $.ajax({ 328 $.ajax({
334 - url: "<%=basePath %>/Data/updateAllStatus", 329 + url: "<%=basePath %>/Data/updateSecondStatus",
335 type: "POST", 330 type: "POST",
336 datatype:"json", 331 datatype:"json",
337 data:{flightno: flightno,flightdate:flightdate}, 332 data:{flightno: flightno,flightdate:flightdate},