正在显示
52 个修改的文件
包含
4620 行增加
和
6 行删除
@@ -57,6 +57,7 @@ | @@ -57,6 +57,7 @@ | ||
57 | </properties> | 57 | </properties> |
58 | 58 | ||
59 | <dependencies> | 59 | <dependencies> |
60 | + | ||
60 | <!-- springframe start --> | 61 | <!-- springframe start --> |
61 | <dependency> | 62 | <dependency> |
62 | <groupId>org.springframework</groupId> | 63 | <groupId>org.springframework</groupId> |
@@ -185,7 +186,13 @@ | @@ -185,7 +186,13 @@ | ||
185 | <version>${junit.version}</version> | 186 | <version>${junit.version}</version> |
186 | <scope>test</scope> | 187 | <scope>test</scope> |
187 | </dependency> | 188 | </dependency> |
188 | - | 189 | + <!-- xstream --> |
190 | + <dependency> | ||
191 | + <groupId>com.thoughtworks.xstream</groupId> | ||
192 | + <artifactId>xstream</artifactId> | ||
193 | + <version>1.4.9</version> | ||
194 | + </dependency> | ||
195 | + | ||
189 | <!--mybatis--> | 196 | <!--mybatis--> |
190 | <dependency> | 197 | <dependency> |
191 | <groupId>org.mybatis</groupId> | 198 | <groupId>org.mybatis</groupId> |
1 | +package com.tianbo.controller.lost; | ||
2 | + | ||
3 | +import java.util.Date; | ||
4 | +import java.util.HashMap; | ||
5 | +import java.util.List; | ||
6 | +import java.util.Map; | ||
7 | + | ||
8 | +import javax.servlet.http.HttpServletRequest; | ||
9 | + | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
11 | +import org.springframework.stereotype.Controller; | ||
12 | +import org.springframework.ui.ModelMap; | ||
13 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
14 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
15 | + | ||
16 | +import com.tianbo.model.ManifestLoad; | ||
17 | +import com.tianbo.model.Sendlog; | ||
18 | +import com.tianbo.service.LostService; | ||
19 | +import com.tianbo.service.SendLogService; | ||
20 | +import com.tianbo.util.DateUtils; | ||
21 | +import com.tianbo.util.json.AjaxJson; | ||
22 | +import com.tianbo.util.json.JsonConversion; | ||
23 | +import com.tianbo.util.xml.XmlGen; | ||
24 | +import com.tianbo.xml.lost.AdditionalInformation; | ||
25 | +import com.tianbo.xml.lost.AssociatedTransportDocument; | ||
26 | +import com.tianbo.xml.lost.BorderTransportMeans; | ||
27 | +import com.tianbo.xml.lost.Consignment; | ||
28 | +import com.tianbo.xml.lost.DeclarationXmlEntity; | ||
29 | +import com.tianbo.xml.lost.HeadXmlEntity; | ||
30 | +import com.tianbo.xml.lost.ManifestXmlEntity; | ||
31 | +import com.tianbo.xml.lost.TransportContractDocument; | ||
32 | + | ||
33 | +@Controller | ||
34 | +@RequestMapping("/lost") | ||
35 | +public class LostApplyController { | ||
36 | + | ||
37 | + @Autowired | ||
38 | + private LostService lostService; | ||
39 | + | ||
40 | + @Autowired | ||
41 | + private SendLogService sendLogService; | ||
42 | + | ||
43 | + @RequestMapping(value = {"index", ""}) | ||
44 | + public String toFlight(ModelMap model,HttpServletRequest request) { | ||
45 | + | ||
46 | + return "lost/list"; | ||
47 | + } | ||
48 | + | ||
49 | + @RequestMapping(value ="edit") | ||
50 | + public String edit(ModelMap model,HttpServletRequest request) { | ||
51 | + model.put("ftId", request.getParameter("id")); | ||
52 | + return "lost/edit"; | ||
53 | + } | ||
54 | + | ||
55 | + @ResponseBody | ||
56 | + @RequestMapping(value = "getList") | ||
57 | + public String getList(HttpServletRequest request,int page,int limit){ | ||
58 | + int start = (page-1)*limit+1; | ||
59 | + int end = page*limit; | ||
60 | + List<ManifestLoad> lost = lostService.getList(start,end); | ||
61 | + ManifestLoad ft = new ManifestLoad(); | ||
62 | + int count = lostService.getCount(ft); | ||
63 | + Map<String,Object> map = new HashMap<>(); | ||
64 | + if(!lost.isEmpty()){ | ||
65 | + map.put("code", 0); | ||
66 | + map.put("count", count); | ||
67 | + map.put("msg", "success"); | ||
68 | + map.put("data", lost); | ||
69 | + }else { | ||
70 | + map.put("code", -1); | ||
71 | + map.put("msg", "请检查网络连接或重试"); | ||
72 | + map.put("data", ""); | ||
73 | + } | ||
74 | + return JsonConversion.writeMapJSON(map); | ||
75 | + } | ||
76 | + | ||
77 | + @ResponseBody | ||
78 | + @RequestMapping(value = "selectByParam") | ||
79 | + public String selectByParam(HttpServletRequest request,int page,int limit,String flightno,String flightdate,String waybillnomaster,String waybillnosecondary){ | ||
80 | + int start = (page-1)*limit+1; | ||
81 | + int end = page*limit; | ||
82 | + List<ManifestLoad> lost = lostService.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary); | ||
83 | + ManifestLoad fs = new ManifestLoad(); | ||
84 | + fs.setFlightno(flightno); | ||
85 | + int count = lostService.getCount(fs); | ||
86 | + Map<String,Object> map = new HashMap<>(); | ||
87 | + if(!lost.isEmpty()){ | ||
88 | + map.put("code", 0); | ||
89 | + map.put("count", count); | ||
90 | + map.put("msg", "success"); | ||
91 | + map.put("data", lost); | ||
92 | + }else { | ||
93 | + map.put("code", -1); | ||
94 | + map.put("msg", "无此条件信息"); | ||
95 | + map.put("data", ""); | ||
96 | + } | ||
97 | + return JsonConversion.writeMapJSON(map); | ||
98 | + } | ||
99 | + | ||
100 | + /** | ||
101 | + * 编辑或新增 | ||
102 | + * @param lost | ||
103 | + * @param redirectAttributes | ||
104 | + * @return | ||
105 | + */ | ||
106 | + @ResponseBody | ||
107 | + @RequestMapping(value = "editForm") | ||
108 | + public AjaxJson editForm(ModelMap model,HttpServletRequest request) { | ||
109 | + String id = request.getParameter("id"); | ||
110 | + String flightno = request.getParameter("flightno"); | ||
111 | + String flightdate = request.getParameter("flightdate"); | ||
112 | + String waybillnomaster = request.getParameter("waybillnomaster"); | ||
113 | + String waybillnosecondary = request.getParameter("waybillnosecondary"); | ||
114 | + String message = null; | ||
115 | + AjaxJson j = new AjaxJson(); | ||
116 | + | ||
117 | + try { | ||
118 | + if( id != null && id != ""){ | ||
119 | + ManifestLoad manifest = lostService.findById(id); | ||
120 | + manifest.setFlightno(flightno); | ||
121 | + manifest.setFlightdate(DateUtils.stringToDate(flightdate+" 00:00:00", "yyyy-MM-dd HH:mm:ss")); | ||
122 | + manifest.setWaybillnomaster(waybillnomaster); | ||
123 | + manifest.setWaybillnosecondary(waybillnosecondary); | ||
124 | + lostService.saveorupdate(manifest); | ||
125 | + }else{ | ||
126 | + ManifestLoad ml = new ManifestLoad(); | ||
127 | + ml.setId(id); | ||
128 | + ml.setFlightno(flightno); | ||
129 | + ml.setFlightdate(DateUtils.stringToDate(flightdate+" 00:00:00", "yyyy-MM-dd HH:mm:ss")); | ||
130 | + ml.setWaybillnomaster(waybillnomaster); | ||
131 | + ml.setWaybillnosecondary(waybillnosecondary); | ||
132 | + lostService.saveorupdate(ml); | ||
133 | + } | ||
134 | + j.setSuccess(true); | ||
135 | + message = "修改成功"; | ||
136 | + } catch (Exception e) { | ||
137 | + j.setSuccess(false); | ||
138 | + message = "修改失败"; | ||
139 | + e.printStackTrace(); | ||
140 | + } | ||
141 | + j.setMsg(message); | ||
142 | + return j; | ||
143 | + } | ||
144 | + | ||
145 | + /** | ||
146 | + * 删除 | ||
147 | + * @param lost | ||
148 | + * @param redirectAttributes | ||
149 | + * @return | ||
150 | + */ | ||
151 | + @ResponseBody | ||
152 | + @RequestMapping(value = "del") | ||
153 | + public AjaxJson delete(ModelMap model,HttpServletRequest request) { | ||
154 | + String id = request.getParameter("id"); | ||
155 | + String message = null; | ||
156 | + AjaxJson j = new AjaxJson(); | ||
157 | + | ||
158 | + try { | ||
159 | + | ||
160 | + lostService.del(id); | ||
161 | + j.setSuccess(true); | ||
162 | + message = "删除成功"; | ||
163 | + | ||
164 | + } catch (Exception e) { | ||
165 | + j.setSuccess(false); | ||
166 | + message = "删除失败"; | ||
167 | + e.printStackTrace(); | ||
168 | + } | ||
169 | + j.setMsg(message); | ||
170 | + return j; | ||
171 | + } | ||
172 | + | ||
173 | + /** | ||
174 | + * 删除 | ||
175 | + * @param lost | ||
176 | + * @param redirectAttributes | ||
177 | + * @return | ||
178 | + */ | ||
179 | + @ResponseBody | ||
180 | + @RequestMapping(value = "updateStatues") | ||
181 | + public AjaxJson updateStatues(ModelMap model,HttpServletRequest request) { | ||
182 | + String id = request.getParameter("id"); | ||
183 | + String message = null; | ||
184 | + AjaxJson j = new AjaxJson(); | ||
185 | + | ||
186 | + try { | ||
187 | + | ||
188 | + ManifestLoad manifestLoad = lostService.findById(id); | ||
189 | + manifestLoad.setStatus(""); | ||
190 | + lostService.saveorupdate(manifestLoad); | ||
191 | + j.setSuccess(true); | ||
192 | + message = "修改状态成功"; | ||
193 | + | ||
194 | + } catch (Exception e) { | ||
195 | + j.setSuccess(false); | ||
196 | + message = "修改状态失败"; | ||
197 | + e.printStackTrace(); | ||
198 | + } | ||
199 | + j.setMsg(message); | ||
200 | + return j; | ||
201 | + } | ||
202 | + | ||
203 | + | ||
204 | + /** | ||
205 | + * 申报 | ||
206 | + * @param lost | ||
207 | + * @param redirectAttributes | ||
208 | + * @return | ||
209 | + */ | ||
210 | + @ResponseBody | ||
211 | + @RequestMapping(value = "send") | ||
212 | + public AjaxJson send(ModelMap model,HttpServletRequest request) { | ||
213 | + String id = request.getParameter("id"); | ||
214 | + String flightno = request.getParameter("flightno"); | ||
215 | + String flightdate = request.getParameter("flightdate"); | ||
216 | + String waybillnomaster = request.getParameter("waybillnomaster"); | ||
217 | + String waybillnosecondary = request.getParameter("waybillnosecondary"); | ||
218 | + String remark = request.getParameter("remark"); | ||
219 | + String message = null; | ||
220 | + AjaxJson j = new AjaxJson(); | ||
221 | + try { | ||
222 | + //保存至sendLog表 | ||
223 | + Sendlog sendlog = new Sendlog(); | ||
224 | + sendlog.setAutoid(id); | ||
225 | + sendlog.setCreatedate(new Date()); | ||
226 | + sendlog.setMessagetype("MT8202"); | ||
227 | + sendlog.setReceiption("发送分拨申请"); | ||
228 | + sendLogService.save(sendlog); | ||
229 | + //生成报文并发送至文件夹 | ||
230 | + ManifestXmlEntity manifestXml = new ManifestXmlEntity(); | ||
231 | + setParam(flightno, flightdate, waybillnomaster, waybillnosecondary, remark, manifestXml); | ||
232 | + XmlGen.genLostXmlAndSend(manifestXml); | ||
233 | + j.setSuccess(true); | ||
234 | + message = "已发送申报报文"; | ||
235 | + ManifestLoad lost = lostService.findById(id); | ||
236 | + lost.setStatus("01");//已发送 | ||
237 | + lostService.saveorupdate(lost); | ||
238 | + } catch (Exception e) { | ||
239 | + j.setSuccess(false); | ||
240 | + message = "申报报文发送失败"; | ||
241 | + e.printStackTrace(); | ||
242 | + } | ||
243 | + j.setMsg(message); | ||
244 | + return j; | ||
245 | + } | ||
246 | + | ||
247 | + /** | ||
248 | + * @param flightno | ||
249 | + * @param flightdate | ||
250 | + * @param waybillnomaster | ||
251 | + * @param waybillnosecondary | ||
252 | + * @param remark | ||
253 | + * @param manifestXml | ||
254 | + */ | ||
255 | + public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary, | ||
256 | + String remark, ManifestXmlEntity manifestXml) { | ||
257 | + HeadXmlEntity headXml = new HeadXmlEntity(); | ||
258 | + DeclarationXmlEntity declarationXml = new DeclarationXmlEntity(); | ||
259 | + BorderTransportMeans transportMeans = new BorderTransportMeans(); | ||
260 | + transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班 | ||
261 | + AdditionalInformation information = new AdditionalInformation(); | ||
262 | + information.setContent(remark); | ||
263 | + Consignment consignment = new Consignment(); | ||
264 | + TransportContractDocument transportContractDocument = new TransportContractDocument(); | ||
265 | + transportContractDocument.setId(waybillnomaster.replace("-", ""));//主单号 | ||
266 | + AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); | ||
267 | + if(waybillnosecondary==""||waybillnosecondary==null){ | ||
268 | + associatedTransportDocument.setId("");//分单号 | ||
269 | + }else{ | ||
270 | + associatedTransportDocument.setId(waybillnomaster.replace("-", "")+"_"+waybillnosecondary);//分单号 | ||
271 | + } | ||
272 | + consignment.setAssociatedTransportDocument(associatedTransportDocument ); | ||
273 | + consignment.setTransportContractDocument(transportContractDocument ); | ||
274 | + declarationXml.setAdditionalInformation(information); | ||
275 | + declarationXml.setBorderTransportMeans(transportMeans); | ||
276 | + declarationXml.setConsignment(consignment); | ||
277 | + manifestXml.setHeadXml(headXml); | ||
278 | + manifestXml.setDeclarationXml(declarationXml); | ||
279 | + } | ||
280 | + | ||
281 | + | ||
282 | +} |
1 | +package com.tianbo.controller.lost; | ||
2 | + | ||
3 | +import java.lang.reflect.InvocationTargetException; | ||
4 | +import java.text.ParseException; | ||
5 | +import java.text.SimpleDateFormat; | ||
6 | +import java.util.Date; | ||
7 | +import java.util.HashMap; | ||
8 | +import java.util.List; | ||
9 | +import java.util.Map; | ||
10 | + | ||
11 | +import javax.servlet.http.HttpServletRequest; | ||
12 | + | ||
13 | +import org.apache.commons.beanutils.BeanUtils; | ||
14 | +import org.apache.commons.beanutils.ConvertUtils; | ||
15 | +import org.apache.commons.beanutils.Converter; | ||
16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
17 | +import org.springframework.stereotype.Controller; | ||
18 | +import org.springframework.ui.ModelMap; | ||
19 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
20 | +import org.springframework.web.bind.annotation.RequestParam; | ||
21 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
22 | + | ||
23 | +import com.tianbo.model.ManifestItem; | ||
24 | +import com.tianbo.model.ManifestLostChange; | ||
25 | +import com.tianbo.model.Sendlog; | ||
26 | +import com.tianbo.service.ItemService; | ||
27 | +import com.tianbo.service.LostChangeService; | ||
28 | +import com.tianbo.service.SendLogService; | ||
29 | +import com.tianbo.util.json.AjaxJson; | ||
30 | +import com.tianbo.util.json.JsonConversion; | ||
31 | +import com.tianbo.util.xml.XmlGen; | ||
32 | +import com.tianbo.xml.lost.AdditionalInformation; | ||
33 | +import com.tianbo.xml.lost.AssociatedTransportDocument; | ||
34 | +import com.tianbo.xml.lost.BorderTransportMeans; | ||
35 | +import com.tianbo.xml.lost.Consignment; | ||
36 | +import com.tianbo.xml.lost.DeclarationXmlEntity; | ||
37 | +import com.tianbo.xml.lost.HeadXmlEntity; | ||
38 | +import com.tianbo.xml.lost.ManifestXmlEntity; | ||
39 | +import com.tianbo.xml.lost.TransportContractDocument; | ||
40 | + | ||
41 | +@Controller | ||
42 | +@RequestMapping("/lost/change") | ||
43 | +public class LostChangeController { | ||
44 | + | ||
45 | + @Autowired | ||
46 | + private LostChangeService lostChangeService; | ||
47 | + | ||
48 | + @Autowired | ||
49 | + private ItemService itemService; | ||
50 | + | ||
51 | + | ||
52 | + @Autowired | ||
53 | + private SendLogService sendLogService; | ||
54 | + | ||
55 | + @RequestMapping(value = {"index", ""}) | ||
56 | + public String toFlight(ModelMap model,HttpServletRequest request) { | ||
57 | + | ||
58 | + return "lost/change/list"; | ||
59 | + } | ||
60 | + | ||
61 | + @RequestMapping(value ="editItem") | ||
62 | + public String editItem(ModelMap model,HttpServletRequest request) { | ||
63 | + String id = request.getParameter("id"); | ||
64 | + if(id!=null||id!=""){ | ||
65 | + model.put("ftId", id); | ||
66 | + } | ||
67 | + String waybillnomaster = request.getParameter("waybillnomaster"); | ||
68 | + if(waybillnomaster!=null||waybillnomaster!=""){ | ||
69 | + model.put("waybillnomaster", waybillnomaster); | ||
70 | + } | ||
71 | + | ||
72 | +// ManifestItem item = itemService.selectByPrimaryKey(id); | ||
73 | +// model.put("item", item); | ||
74 | + return "lost/change/item"; | ||
75 | + } | ||
76 | + @RequestMapping(value ="edit") | ||
77 | + public String edit(ModelMap model,HttpServletRequest request) { | ||
78 | + model.put("waybillnomaster", request.getParameter("waybillnomaster")); | ||
79 | + model.put("ftId", request.getParameter("id")); | ||
80 | + return "lost/change/edit"; | ||
81 | + } | ||
82 | + | ||
83 | + @ResponseBody | ||
84 | + @RequestMapping(value = "getList") | ||
85 | + public String getList(HttpServletRequest request,int page,int limit){ | ||
86 | + int start = (page-1)*limit+1; | ||
87 | + int end = page*limit; | ||
88 | + List<ManifestLostChange> lost = lostChangeService.getList(start,end); | ||
89 | + ManifestLostChange ft = new ManifestLostChange(); | ||
90 | + int count = lostChangeService.getCount(ft); | ||
91 | + Map<String,Object> map = new HashMap<>(); | ||
92 | + if(!lost.isEmpty()){ | ||
93 | + map.put("code", 0); | ||
94 | + map.put("count", count); | ||
95 | + map.put("msg", "success"); | ||
96 | + map.put("data", lost); | ||
97 | + }else { | ||
98 | + map.put("code", -1); | ||
99 | + map.put("msg", "请检查网络连接或重试"); | ||
100 | + map.put("data", ""); | ||
101 | + } | ||
102 | + return JsonConversion.writeMapJSON(map); | ||
103 | + } | ||
104 | + | ||
105 | + | ||
106 | + @ResponseBody | ||
107 | + @RequestMapping(value = "getIteamList") | ||
108 | + public String getIteamList(HttpServletRequest request,String waybillnomaster){ | ||
109 | + Map<String,Object> map = new HashMap<>(); | ||
110 | + try { | ||
111 | + if(waybillnomaster!=null && waybillnomaster!=""){ | ||
112 | + List<ManifestItem> ltem = itemService.getIteamList(waybillnomaster); | ||
113 | + if(!ltem.isEmpty()){ | ||
114 | + map.put("code", 0); | ||
115 | + map.put("msg", "success"); | ||
116 | + map.put("data", ltem); | ||
117 | + }else { | ||
118 | + map.put("code", 0); | ||
119 | + map.put("msg", ""); | ||
120 | + map.put("data", ""); | ||
121 | + } | ||
122 | + | ||
123 | + } | ||
124 | + } catch (Exception e) { | ||
125 | + map.put("code", -1); | ||
126 | + map.put("msg", "请检查网络连接或重试"); | ||
127 | + map.put("data", ""); | ||
128 | + e.printStackTrace(); | ||
129 | + } | ||
130 | + return JsonConversion.writeMapJSON(map); | ||
131 | + } | ||
132 | + | ||
133 | + @ResponseBody | ||
134 | + @RequestMapping(value = "selectByParam") | ||
135 | + public String selectByParam(HttpServletRequest request,int page,int limit,String flightno,String flightdate,String waybillnomaster,String waybillnosecondary){ | ||
136 | + int start = (page-1)*limit+1; | ||
137 | + int end = page*limit; | ||
138 | + List<ManifestLostChange> lost = lostChangeService.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary); | ||
139 | + ManifestLostChange fs = new ManifestLostChange(); | ||
140 | + fs.setFlightno(flightno); | ||
141 | + int count = lostChangeService.getCount(fs); | ||
142 | + Map<String,Object> map = new HashMap<>(); | ||
143 | + if(!lost.isEmpty()){ | ||
144 | + map.put("code", 0); | ||
145 | + map.put("count", count); | ||
146 | + map.put("msg", "success"); | ||
147 | + map.put("data", lost); | ||
148 | + }else { | ||
149 | + map.put("code", -1); | ||
150 | + map.put("msg", "无此条件信息"); | ||
151 | + map.put("data", ""); | ||
152 | + } | ||
153 | + return JsonConversion.writeMapJSON(map); | ||
154 | + } | ||
155 | + | ||
156 | + /** | ||
157 | + * 编辑或新增 | ||
158 | + * @param lost | ||
159 | + * @param redirectAttributes | ||
160 | + * @return | ||
161 | + * @throws InvocationTargetException | ||
162 | + * @throws IllegalAccessException | ||
163 | + */ | ||
164 | + @ResponseBody | ||
165 | + @RequestMapping(value = "editForm") | ||
166 | + public AjaxJson editForm(ModelMap model,@RequestParam Map<String, Object> params) throws IllegalAccessException, InvocationTargetException { | ||
167 | + ManifestLostChange lostChange = new ManifestLostChange(); | ||
168 | + DateConvert();//日期转化 | ||
169 | + BeanUtils.populate(lostChange, params); | ||
170 | + String message = null; | ||
171 | + AjaxJson j = new AjaxJson(); | ||
172 | + | ||
173 | + if(lostChange.getId()!=null&&lostChange.getId()!=""){ //存在ID 执行更新 | ||
174 | + try { | ||
175 | + lostChangeService.saveorupdate(lostChange); | ||
176 | + j.setSuccess(true); | ||
177 | + message = "修改成功"; | ||
178 | + } catch (Exception e) { | ||
179 | + j.setSuccess(false); | ||
180 | + message = "修改失败"; | ||
181 | + e.printStackTrace(); | ||
182 | + } | ||
183 | + } else { | ||
184 | + try { | ||
185 | + lostChangeService.saveorupdate(lostChange); | ||
186 | + j.setSuccess(true); | ||
187 | + message = "保存成功"; | ||
188 | + } catch (Exception e) { | ||
189 | + j.setSuccess(false); | ||
190 | + message = "保存失败"; | ||
191 | + e.printStackTrace(); | ||
192 | + } | ||
193 | + } | ||
194 | + | ||
195 | + j.setMsg(message); | ||
196 | + return j; | ||
197 | + } | ||
198 | + | ||
199 | + /** | ||
200 | + * 日期转化 | ||
201 | + */ | ||
202 | + public void DateConvert() { | ||
203 | + ConvertUtils.register(new Converter() { | ||
204 | + | ||
205 | + @SuppressWarnings("rawtypes") | ||
206 | + public Object convert(Class type, Object value) { | ||
207 | + | ||
208 | + | ||
209 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); | ||
210 | + try { | ||
211 | + return simpleDateFormat.parse(value.toString()); | ||
212 | + } catch (ParseException e) { | ||
213 | + e.printStackTrace(); | ||
214 | + } | ||
215 | + return null; | ||
216 | + } | ||
217 | + }, Date.class); | ||
218 | + } | ||
219 | + | ||
220 | + /** | ||
221 | + * 编辑或新增 | ||
222 | + * @param lost | ||
223 | + * @param redirectAttributes | ||
224 | + * @return | ||
225 | + * @throws InvocationTargetException | ||
226 | + * @throws IllegalAccessException | ||
227 | + */ | ||
228 | + @ResponseBody | ||
229 | + @RequestMapping(value = "editItemData") | ||
230 | + public AjaxJson editIteamData(ModelMap model,@RequestParam Map<String, Object> params) throws IllegalAccessException, InvocationTargetException { | ||
231 | + ManifestItem ml = new ManifestItem(); | ||
232 | + BeanUtils.populate(ml, params); | ||
233 | + String message = null; | ||
234 | + AjaxJson j = new AjaxJson(); | ||
235 | + | ||
236 | + try { | ||
237 | + itemService.saveorupdate(ml); | ||
238 | + j.setSuccess(true); | ||
239 | + message = "保存成功"; | ||
240 | + } catch (Exception e) { | ||
241 | + j.setSuccess(false); | ||
242 | + message = "保存失败"; | ||
243 | + e.printStackTrace(); | ||
244 | + } | ||
245 | + j.setMsg(message); | ||
246 | + return j; | ||
247 | + } | ||
248 | + | ||
249 | + /** | ||
250 | + * 删除 | ||
251 | + * @param lost | ||
252 | + * @param redirectAttributes | ||
253 | + * @return | ||
254 | + */ | ||
255 | + @ResponseBody | ||
256 | + @RequestMapping(value = "delItem") | ||
257 | + public AjaxJson delItem(ModelMap model,HttpServletRequest request) { | ||
258 | + String id = request.getParameter("id"); | ||
259 | + String message = null; | ||
260 | + AjaxJson j = new AjaxJson(); | ||
261 | + | ||
262 | + try { | ||
263 | + | ||
264 | + itemService.deleteByPrimaryKey(id); | ||
265 | + j.setSuccess(true); | ||
266 | + message = "删除成功"; | ||
267 | + | ||
268 | + } catch (Exception e) { | ||
269 | + j.setSuccess(false); | ||
270 | + message = "删除失败"; | ||
271 | + e.printStackTrace(); | ||
272 | + } | ||
273 | + j.setMsg(message); | ||
274 | + return j; | ||
275 | + } | ||
276 | + | ||
277 | + | ||
278 | + /** | ||
279 | + * 删除 | ||
280 | + * @param lost | ||
281 | + * @param redirectAttributes | ||
282 | + * @return | ||
283 | + */ | ||
284 | + @ResponseBody | ||
285 | + @RequestMapping(value = "del") | ||
286 | + public AjaxJson delete(ModelMap model,HttpServletRequest request) { | ||
287 | + String id = request.getParameter("id"); | ||
288 | + String message = null; | ||
289 | + AjaxJson j = new AjaxJson(); | ||
290 | + | ||
291 | + try { | ||
292 | + | ||
293 | + lostChangeService.deleteByPrimaryKey(id); | ||
294 | + j.setSuccess(true); | ||
295 | + message = "删除成功"; | ||
296 | + | ||
297 | + } catch (Exception e) { | ||
298 | + j.setSuccess(false); | ||
299 | + message = "删除失败"; | ||
300 | + e.printStackTrace(); | ||
301 | + } | ||
302 | + j.setMsg(message); | ||
303 | + return j; | ||
304 | + } | ||
305 | + | ||
306 | + /** | ||
307 | + * 删除 | ||
308 | + * @param lost | ||
309 | + * @param redirectAttributes | ||
310 | + * @return | ||
311 | + */ | ||
312 | + @ResponseBody | ||
313 | + @RequestMapping(value = "updateStatues") | ||
314 | + public AjaxJson updateStatues(ModelMap model,HttpServletRequest request) { | ||
315 | + String id = request.getParameter("id"); | ||
316 | + String message = null; | ||
317 | + AjaxJson j = new AjaxJson(); | ||
318 | + | ||
319 | + try { | ||
320 | + | ||
321 | + ManifestLostChange manifestLoad = lostChangeService.selectByPrimaryKey(id); | ||
322 | + manifestLoad.setStatus(""); | ||
323 | + lostChangeService.updateByPrimaryKeySelective(manifestLoad); | ||
324 | + j.setSuccess(true); | ||
325 | + message = "修改状态成功"; | ||
326 | + | ||
327 | + } catch (Exception e) { | ||
328 | + j.setSuccess(false); | ||
329 | + message = "修改状态失败"; | ||
330 | + e.printStackTrace(); | ||
331 | + } | ||
332 | + j.setMsg(message); | ||
333 | + return j; | ||
334 | + } | ||
335 | + | ||
336 | + | ||
337 | + /** | ||
338 | + * 申报 | ||
339 | + * @param lost | ||
340 | + * @param redirectAttributes | ||
341 | + * @return | ||
342 | + */ | ||
343 | + @ResponseBody | ||
344 | + @RequestMapping(value = "send") | ||
345 | + public AjaxJson send(ModelMap model,HttpServletRequest request) { | ||
346 | + String id = request.getParameter("id"); | ||
347 | + String flightno = request.getParameter("flightno"); | ||
348 | + String flightdate = request.getParameter("flightdate"); | ||
349 | + String waybillnomaster = request.getParameter("waybillnomaster"); | ||
350 | + String waybillnosecondary = request.getParameter("waybillnosecondary"); | ||
351 | + String remark = request.getParameter("remark"); | ||
352 | + String message = null; | ||
353 | + AjaxJson j = new AjaxJson(); | ||
354 | + try { | ||
355 | + //保存至sendLog表 | ||
356 | + Sendlog sendlog = new Sendlog(); | ||
357 | + sendlog.setAutoid(id); | ||
358 | + sendlog.setCreatedate(new Date()); | ||
359 | + sendlog.setMessagetype("MT8203"); | ||
360 | + sendlog.setReceiption("发送落装改配申请"); | ||
361 | + sendLogService.save(sendlog); | ||
362 | + //生成报文并发送至文件夹 | ||
363 | + ManifestXmlEntity manifestXml = new ManifestXmlEntity(); | ||
364 | + setParam(flightno, flightdate, waybillnomaster, waybillnosecondary, remark, manifestXml); | ||
365 | + XmlGen.genLostXmlAndSend(manifestXml); | ||
366 | + j.setSuccess(true); | ||
367 | + message = "已发送申报报文"; | ||
368 | + ManifestLostChange lost = lostChangeService.selectByPrimaryKey(id); | ||
369 | + lost.setStatus("01");//已发送 | ||
370 | + lostChangeService.saveorupdate(lost); | ||
371 | + } catch (Exception e) { | ||
372 | + j.setSuccess(false); | ||
373 | + message = "申报报文发送失败"; | ||
374 | + e.printStackTrace(); | ||
375 | + } | ||
376 | + j.setMsg(message); | ||
377 | + return j; | ||
378 | + } | ||
379 | + | ||
380 | + /** | ||
381 | + * @param flightno | ||
382 | + * @param flightdate | ||
383 | + * @param waybillnomaster | ||
384 | + * @param waybillnosecondary | ||
385 | + * @param remark | ||
386 | + * @param manifestXml | ||
387 | + */ | ||
388 | + public void setParam(String flightno, String flightdate, String waybillnomaster, String waybillnosecondary, | ||
389 | + String remark, ManifestXmlEntity manifestXml) { | ||
390 | + HeadXmlEntity headXml = new HeadXmlEntity(); | ||
391 | + DeclarationXmlEntity declarationXml = new DeclarationXmlEntity(); | ||
392 | + BorderTransportMeans transportMeans = new BorderTransportMeans(); | ||
393 | + transportMeans.setJourneyID(flightno+"/"+flightdate.substring(0,10).replace("-", ""));//航次航班 | ||
394 | + AdditionalInformation information = new AdditionalInformation(); | ||
395 | + information.setContent(remark); | ||
396 | + Consignment consignment = new Consignment(); | ||
397 | + TransportContractDocument transportContractDocument = new TransportContractDocument(); | ||
398 | + transportContractDocument.setId(waybillnomaster);//主单号 | ||
399 | + AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); | ||
400 | + associatedTransportDocument.setId(waybillnomaster+"_"+waybillnosecondary);//分单号 | ||
401 | + consignment.setAssociatedTransportDocument(associatedTransportDocument ); | ||
402 | + consignment.setTransportContractDocument(transportContractDocument ); | ||
403 | + declarationXml.setAdditionalInformation(information); | ||
404 | + declarationXml.setBorderTransportMeans(transportMeans); | ||
405 | + declarationXml.setConsignment(consignment); | ||
406 | + manifestXml.setHeadXml(headXml); | ||
407 | + manifestXml.setDeclarationXml(declarationXml); | ||
408 | + } | ||
409 | + | ||
410 | + | ||
411 | +} |
1 | +package com.tianbo.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import com.tianbo.model.ManifestLoad; | ||
8 | + | ||
9 | +public interface LostMapper { | ||
10 | + | ||
11 | + List<ManifestLoad> getList(@Param("start")int start, @Param("end")int end); | ||
12 | + | ||
13 | + int getCount(ManifestLoad fs); | ||
14 | + | ||
15 | + void del(@Param("id")String id); | ||
16 | + | ||
17 | + void insert(ManifestLoad ft); | ||
18 | + | ||
19 | + void update(ManifestLoad ft); | ||
20 | + | ||
21 | + List<ManifestLoad> selectByFlightno(@Param("start")int start, @Param("end")int end, @Param("flightno")String flightno); | ||
22 | + | ||
23 | + ManifestLoad get(String id); | ||
24 | + | ||
25 | + List<ManifestLoad> selectByParam(@Param("start")int start, @Param("end")int end, @Param("flightno")String flightno,@Param("flightdate")String flightdate,@Param("waybillnomaster")String waybillnomaster,@Param("waybillnosecondary")String waybillnosecondary); | ||
26 | + | ||
27 | +} |
1 | +package com.tianbo.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import com.tianbo.model.ManifestItem; | ||
8 | + | ||
9 | +public interface ManifestItemMapper { | ||
10 | + int deleteByPrimaryKey(String id); | ||
11 | + | ||
12 | + int insert(ManifestItem record); | ||
13 | + | ||
14 | + int insertSelective(ManifestItem record); | ||
15 | + | ||
16 | + ManifestItem selectByPrimaryKey(String id); | ||
17 | + | ||
18 | + int updateByPrimaryKeySelective(ManifestItem record); | ||
19 | + | ||
20 | + int updateByPrimaryKey(ManifestItem record); | ||
21 | + | ||
22 | + List<ManifestItem> getIteamList(@Param("waybillnomaster")String waybillnomaster); | ||
23 | + | ||
24 | +} |
1 | +package com.tianbo.mapper; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import com.tianbo.model.ManifestLostChange; | ||
8 | + | ||
9 | +public interface ManifestLostChangeMapper { | ||
10 | + int deleteByPrimaryKey(String id); | ||
11 | + | ||
12 | + int insert(ManifestLostChange record); | ||
13 | + | ||
14 | + int insertSelective(ManifestLostChange record); | ||
15 | + | ||
16 | + ManifestLostChange selectByPrimaryKey(String id); | ||
17 | + | ||
18 | + int updateByPrimaryKeySelective(ManifestLostChange record); | ||
19 | + | ||
20 | + int updateByPrimaryKey(ManifestLostChange record); | ||
21 | + | ||
22 | + List<ManifestLostChange> getList(@Param("start")int start, @Param("end")int end); | ||
23 | + | ||
24 | + int getCount(ManifestLostChange lostChange); | ||
25 | + | ||
26 | + List<ManifestLostChange> selectByParam(@Param("start")int start, @Param("end")int end, @Param("flightno")String flightno,@Param("flightdate")String flightdate,@Param("waybillnomaster")String waybillnomaster,@Param("waybillnosecondary")String waybillnosecondary); | ||
27 | +} |
@@ -12,7 +12,7 @@ public interface SendlogMapper { | @@ -12,7 +12,7 @@ public interface SendlogMapper { | ||
12 | 12 | ||
13 | int deleteByExample(SendlogExample example); | 13 | int deleteByExample(SendlogExample example); |
14 | 14 | ||
15 | - int insert(Sendlog record); | 15 | + int insert(Sendlog sendlog); |
16 | 16 | ||
17 | int insertSelective(Sendlog record); | 17 | int insertSelective(Sendlog record); |
18 | 18 | ||
@@ -28,4 +28,5 @@ public interface SendlogMapper { | @@ -28,4 +28,5 @@ public interface SendlogMapper { | ||
28 | List<Sendlog> getSendLogSecond(String billNoSecond); | 28 | List<Sendlog> getSendLogSecond(String billNoSecond); |
29 | 29 | ||
30 | List<Sendlog> getSendLogSecondByMain(String billNo); | 30 | List<Sendlog> getSendLogSecondByMain(String billNo); |
31 | + | ||
31 | } | 32 | } |
@@ -95,7 +95,7 @@ public class FlightSetting { | @@ -95,7 +95,7 @@ public class FlightSetting { | ||
95 | public void setWeek(String week) { | 95 | public void setWeek(String week) { |
96 | this.week = week; | 96 | this.week = week; |
97 | } | 97 | } |
98 | - | 98 | + |
99 | public String getId() { | 99 | public String getId() { |
100 | return id; | 100 | return id; |
101 | } | 101 | } |
1 | +package com.tianbo.model; | ||
2 | + | ||
3 | +public class ManifestItem { | ||
4 | + private String id; | ||
5 | + | ||
6 | + private String waybillnomaster; | ||
7 | + | ||
8 | + private String piece; | ||
9 | + | ||
10 | + private String packageCode; | ||
11 | + | ||
12 | + private String shippingMarks; | ||
13 | + | ||
14 | + private String dangerousCode; | ||
15 | + | ||
16 | + private String containerNumber; | ||
17 | + | ||
18 | + private String customProcedureCode; | ||
19 | + | ||
20 | + private String customTariffCode; | ||
21 | + | ||
22 | + private String consignCode; | ||
23 | + | ||
24 | + private String originalCode; | ||
25 | + | ||
26 | + private String description; | ||
27 | + | ||
28 | + private String remark; | ||
29 | + | ||
30 | + private String weight; | ||
31 | + | ||
32 | + private String orderNumber; | ||
33 | + | ||
34 | + public String getId() { | ||
35 | + return id; | ||
36 | + } | ||
37 | + | ||
38 | + public void setId(String id) { | ||
39 | + this.id = id == null ? null : id.trim(); | ||
40 | + } | ||
41 | + | ||
42 | + public String getWaybillnomaster() { | ||
43 | + return waybillnomaster; | ||
44 | + } | ||
45 | + | ||
46 | + public void setWaybillnomaster(String waybillnomaster) { | ||
47 | + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim(); | ||
48 | + } | ||
49 | + | ||
50 | + public String getPiece() { | ||
51 | + return piece; | ||
52 | + } | ||
53 | + | ||
54 | + public void setPiece(String piece) { | ||
55 | + this.piece = piece == null ? null : piece.trim(); | ||
56 | + } | ||
57 | + | ||
58 | + public String getPackageCode() { | ||
59 | + return packageCode; | ||
60 | + } | ||
61 | + | ||
62 | + public void setPackageCode(String packageCode) { | ||
63 | + this.packageCode = packageCode == null ? null : packageCode.trim(); | ||
64 | + } | ||
65 | + | ||
66 | + public String getShippingMarks() { | ||
67 | + return shippingMarks; | ||
68 | + } | ||
69 | + | ||
70 | + public void setShippingMarks(String shippingMarks) { | ||
71 | + this.shippingMarks = shippingMarks == null ? null : shippingMarks.trim(); | ||
72 | + } | ||
73 | + | ||
74 | + public String getDangerousCode() { | ||
75 | + return dangerousCode; | ||
76 | + } | ||
77 | + | ||
78 | + public void setDangerousCode(String dangerousCode) { | ||
79 | + this.dangerousCode = dangerousCode == null ? null : dangerousCode.trim(); | ||
80 | + } | ||
81 | + | ||
82 | + public String getContainerNumber() { | ||
83 | + return containerNumber; | ||
84 | + } | ||
85 | + | ||
86 | + public void setContainerNumber(String containerNumber) { | ||
87 | + this.containerNumber = containerNumber == null ? null : containerNumber.trim(); | ||
88 | + } | ||
89 | + | ||
90 | + public String getCustomProcedureCode() { | ||
91 | + return customProcedureCode; | ||
92 | + } | ||
93 | + | ||
94 | + public void setCustomProcedureCode(String customProcedureCode) { | ||
95 | + this.customProcedureCode = customProcedureCode == null ? null : customProcedureCode.trim(); | ||
96 | + } | ||
97 | + | ||
98 | + public String getCustomTariffCode() { | ||
99 | + return customTariffCode; | ||
100 | + } | ||
101 | + | ||
102 | + public void setCustomTariffCode(String customTariffCode) { | ||
103 | + this.customTariffCode = customTariffCode == null ? null : customTariffCode.trim(); | ||
104 | + } | ||
105 | + | ||
106 | + public String getConsignCode() { | ||
107 | + return consignCode; | ||
108 | + } | ||
109 | + | ||
110 | + public void setConsignCode(String consignCode) { | ||
111 | + this.consignCode = consignCode == null ? null : consignCode.trim(); | ||
112 | + } | ||
113 | + | ||
114 | + public String getOriginalCode() { | ||
115 | + return originalCode; | ||
116 | + } | ||
117 | + | ||
118 | + public void setOriginalCode(String originalCode) { | ||
119 | + this.originalCode = originalCode == null ? null : originalCode.trim(); | ||
120 | + } | ||
121 | + | ||
122 | + public String getDescription() { | ||
123 | + return description; | ||
124 | + } | ||
125 | + | ||
126 | + public void setDescription(String description) { | ||
127 | + this.description = description == null ? null : description.trim(); | ||
128 | + } | ||
129 | + | ||
130 | + public String getRemark() { | ||
131 | + return remark; | ||
132 | + } | ||
133 | + | ||
134 | + public void setRemark(String remark) { | ||
135 | + this.remark = remark == null ? null : remark.trim(); | ||
136 | + } | ||
137 | + | ||
138 | + public String getWeight() { | ||
139 | + return weight; | ||
140 | + } | ||
141 | + | ||
142 | + public void setWeight(String weight) { | ||
143 | + this.weight = weight == null ? null : weight.trim(); | ||
144 | + } | ||
145 | + | ||
146 | + public String getOrderNumber() { | ||
147 | + return orderNumber; | ||
148 | + } | ||
149 | + | ||
150 | + public void setOrderNumber(String orderNumber) { | ||
151 | + this.orderNumber = orderNumber == null ? null : orderNumber.trim(); | ||
152 | + } | ||
153 | +} |
1 | +package com.tianbo.model; | ||
2 | + | ||
3 | +import java.util.Date; | ||
4 | + | ||
5 | +public class ManifestLoad { | ||
6 | + | ||
7 | + private String id; | ||
8 | + private String flightno; | ||
9 | + private Date flightdate; | ||
10 | + private String waybillnomaster; | ||
11 | + private String waybillnosecondary; | ||
12 | + private String remark; | ||
13 | + private String status; | ||
14 | + private String receiption; | ||
15 | + private Date createdate; | ||
16 | + | ||
17 | + | ||
18 | + public Date getCreatedate() { | ||
19 | + return createdate; | ||
20 | + } | ||
21 | + | ||
22 | + public void setCreatedate(Date createdate) { | ||
23 | + this.createdate = createdate; | ||
24 | + } | ||
25 | + | ||
26 | + public String getFlightno() { | ||
27 | + return flightno; | ||
28 | + } | ||
29 | + | ||
30 | + public void setFlightno(String flightno) { | ||
31 | + this.flightno = flightno; | ||
32 | + } | ||
33 | + | ||
34 | + public String getRemark() { | ||
35 | + return remark; | ||
36 | + } | ||
37 | + | ||
38 | + public void setRemark(String remark) { | ||
39 | + this.remark = remark; | ||
40 | + } | ||
41 | + | ||
42 | + | ||
43 | + public String getReceiption() { | ||
44 | + return receiption; | ||
45 | + } | ||
46 | + | ||
47 | + public void setReceiption(String receiption) { | ||
48 | + this.receiption = receiption; | ||
49 | + } | ||
50 | + | ||
51 | + public String getId() { | ||
52 | + return id; | ||
53 | + } | ||
54 | + | ||
55 | + public void setId(String id) { | ||
56 | + this.id = id; | ||
57 | + } | ||
58 | + | ||
59 | + public Date getFlightdate() { | ||
60 | + return flightdate; | ||
61 | + } | ||
62 | + | ||
63 | + public void setFlightdate(Date flightdate) { | ||
64 | + this.flightdate = flightdate; | ||
65 | + } | ||
66 | + | ||
67 | + public String getWaybillnomaster() { | ||
68 | + return waybillnomaster; | ||
69 | + } | ||
70 | + | ||
71 | + public void setWaybillnomaster(String waybillnomaster) { | ||
72 | + this.waybillnomaster = waybillnomaster; | ||
73 | + } | ||
74 | + | ||
75 | + public String getWaybillnosecondary() { | ||
76 | + return waybillnosecondary; | ||
77 | + } | ||
78 | + | ||
79 | + public void setWaybillnosecondary(String waybillnosecondary) { | ||
80 | + this.waybillnosecondary = waybillnosecondary; | ||
81 | + } | ||
82 | + | ||
83 | + public String getStatus() { | ||
84 | + return status; | ||
85 | + } | ||
86 | + | ||
87 | + public void setStatus(String status) { | ||
88 | + this.status = status; | ||
89 | + } | ||
90 | + | ||
91 | +} |
1 | +package com.tianbo.model; | ||
2 | + | ||
3 | +import java.util.Date; | ||
4 | + | ||
5 | +public class ManifestLostChange { | ||
6 | + private String id; | ||
7 | + | ||
8 | + private String flightno; | ||
9 | + | ||
10 | + private Date flightdate; | ||
11 | + | ||
12 | + private String waybillnomaster; | ||
13 | + | ||
14 | + private String waybillnosecondary; | ||
15 | + | ||
16 | + private String cwaybillnomaster; | ||
17 | + | ||
18 | + private String cwaybillnosecondary; | ||
19 | + | ||
20 | + private Date createdate; | ||
21 | + | ||
22 | + private String status; | ||
23 | + | ||
24 | + private String receiption; | ||
25 | + | ||
26 | + private String cflightno; | ||
27 | + | ||
28 | + private Date cflightdate; | ||
29 | + | ||
30 | + public String getId() { | ||
31 | + return id; | ||
32 | + } | ||
33 | + | ||
34 | + public void setId(String id) { | ||
35 | + this.id = id == null ? null : id.trim(); | ||
36 | + } | ||
37 | + | ||
38 | + public String getFlightno() { | ||
39 | + return flightno; | ||
40 | + } | ||
41 | + | ||
42 | + public void setFlightno(String flightno) { | ||
43 | + this.flightno = flightno == null ? null : flightno.trim(); | ||
44 | + } | ||
45 | + | ||
46 | + public Date getFlightdate() { | ||
47 | + return flightdate; | ||
48 | + } | ||
49 | + | ||
50 | + public void setFlightdate(Date flightdate) { | ||
51 | + this.flightdate = flightdate; | ||
52 | + } | ||
53 | + | ||
54 | + public String getWaybillnomaster() { | ||
55 | + return waybillnomaster; | ||
56 | + } | ||
57 | + | ||
58 | + public void setWaybillnomaster(String waybillnomaster) { | ||
59 | + this.waybillnomaster = waybillnomaster == null ? null : waybillnomaster.trim(); | ||
60 | + } | ||
61 | + | ||
62 | + public String getWaybillnosecondary() { | ||
63 | + return waybillnosecondary; | ||
64 | + } | ||
65 | + | ||
66 | + public void setWaybillnosecondary(String waybillnosecondary) { | ||
67 | + this.waybillnosecondary = waybillnosecondary == null ? null : waybillnosecondary.trim(); | ||
68 | + } | ||
69 | + | ||
70 | + public String getCwaybillnomaster() { | ||
71 | + return cwaybillnomaster; | ||
72 | + } | ||
73 | + | ||
74 | + public void setCwaybillnomaster(String cwaybillnomaster) { | ||
75 | + this.cwaybillnomaster = cwaybillnomaster == null ? null : cwaybillnomaster.trim(); | ||
76 | + } | ||
77 | + | ||
78 | + public String getCwaybillnosecondary() { | ||
79 | + return cwaybillnosecondary; | ||
80 | + } | ||
81 | + | ||
82 | + public void setCwaybillnosecondary(String cwaybillnosecondary) { | ||
83 | + this.cwaybillnosecondary = cwaybillnosecondary == null ? null : cwaybillnosecondary.trim(); | ||
84 | + } | ||
85 | + | ||
86 | + public Date getCreatedate() { | ||
87 | + return createdate; | ||
88 | + } | ||
89 | + | ||
90 | + public void setCreatedate(Date createdate) { | ||
91 | + this.createdate = createdate; | ||
92 | + } | ||
93 | + | ||
94 | + public String getStatus() { | ||
95 | + return status; | ||
96 | + } | ||
97 | + | ||
98 | + public void setStatus(String status) { | ||
99 | + this.status = status == null ? null : status.trim(); | ||
100 | + } | ||
101 | + | ||
102 | + public String getReceiption() { | ||
103 | + return receiption; | ||
104 | + } | ||
105 | + | ||
106 | + public void setReceiption(String receiption) { | ||
107 | + this.receiption = receiption == null ? null : receiption.trim(); | ||
108 | + } | ||
109 | + | ||
110 | + public String getCflightno() { | ||
111 | + return cflightno; | ||
112 | + } | ||
113 | + | ||
114 | + public void setCflightno(String cflightno) { | ||
115 | + this.cflightno = cflightno == null ? null : cflightno.trim(); | ||
116 | + } | ||
117 | + | ||
118 | + public Date getCflightdate() { | ||
119 | + return cflightdate; | ||
120 | + } | ||
121 | + | ||
122 | + public void setCflightdate(Date cflightdate) { | ||
123 | + this.cflightdate = cflightdate; | ||
124 | + } | ||
125 | +} |
1 | +package com.tianbo.service; | ||
2 | + | ||
3 | + | ||
4 | +import java.util.List; | ||
5 | + | ||
6 | +import com.tianbo.model.ManifestItem; | ||
7 | + | ||
8 | + | ||
9 | +public interface ItemService { | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + ManifestItem selectByPrimaryKey(String id); | ||
15 | + | ||
16 | + void saveorupdate(ManifestItem manifest); | ||
17 | + | ||
18 | + void deleteByPrimaryKey(String id); | ||
19 | + | ||
20 | + void insertSelective(ManifestItem manifest); | ||
21 | + | ||
22 | + void updateByPrimaryKeySelective(ManifestItem manifest); | ||
23 | + | ||
24 | + List<ManifestItem> getIteamList(String flightno); | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | +} |
1 | +package com.tianbo.service; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import com.tianbo.model.ManifestLostChange; | ||
6 | + | ||
7 | + | ||
8 | +public interface LostChangeService { | ||
9 | + | ||
10 | + List<ManifestLostChange> getList(int start, int end); | ||
11 | + | ||
12 | + int getCount(ManifestLostChange ft); | ||
13 | + | ||
14 | + List<ManifestLostChange> selectByParam(int start, int end, String flightno, String flightdate, | ||
15 | + String waybillnomaster, String waybillnosecondary); | ||
16 | + | ||
17 | + ManifestLostChange selectByPrimaryKey(String id); | ||
18 | + | ||
19 | + void saveorupdate(ManifestLostChange manifest); | ||
20 | + | ||
21 | + void deleteByPrimaryKey(String id); | ||
22 | + | ||
23 | + void insertSelective(ManifestLostChange manifestLoad); | ||
24 | + | ||
25 | + void updateByPrimaryKeySelective(ManifestLostChange manifestLoad); | ||
26 | + | ||
27 | +} |
1 | +package com.tianbo.service; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import com.tianbo.model.ManifestLoad; | ||
6 | + | ||
7 | +public interface LostService { | ||
8 | + List<ManifestLoad> getList(int start, int end); | ||
9 | + | ||
10 | + int getCount(ManifestLoad mf); | ||
11 | + | ||
12 | + void del(String id); | ||
13 | + | ||
14 | + void saveorupdate(ManifestLoad mf); | ||
15 | + | ||
16 | + List<ManifestLoad> selectByFlightno(int start, int end, String flightno); | ||
17 | + | ||
18 | + public ManifestLoad findById(String id); | ||
19 | + | ||
20 | + List<ManifestLoad> selectByParam(int start, int end, String flightno, String flightdate, String waybillnomaster,String waybillnosecondary); | ||
21 | +} |
1 | +package com.tianbo.service.imp; | ||
2 | + | ||
3 | + | ||
4 | +import java.util.List; | ||
5 | +import java.util.UUID; | ||
6 | + | ||
7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | +import org.springframework.transaction.annotation.Transactional; | ||
10 | + | ||
11 | +import com.tianbo.mapper.ManifestItemMapper; | ||
12 | +import com.tianbo.model.ManifestItem; | ||
13 | +import com.tianbo.service.ItemService; | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | +@Service | ||
18 | +@Transactional | ||
19 | +public class ItemServiceImp implements ItemService{ | ||
20 | + @Autowired | ||
21 | + private ManifestItemMapper ItemDao; | ||
22 | + | ||
23 | + @Override | ||
24 | + public ManifestItem selectByPrimaryKey(String id) { | ||
25 | + // TODO Auto-generated method stub | ||
26 | + return ItemDao.selectByPrimaryKey(id); | ||
27 | + } | ||
28 | + | ||
29 | + @Override | ||
30 | + public void saveorupdate(ManifestItem manifest) { | ||
31 | + if (manifest.getId()==null||manifest.getId()==""){ | ||
32 | + manifest.setId(UUID.randomUUID().toString()); | ||
33 | + ItemDao.insert(manifest); | ||
34 | + }else{ | ||
35 | + // 更新用户数据 | ||
36 | + ItemDao.updateByPrimaryKeySelective(manifest); | ||
37 | + } | ||
38 | + | ||
39 | + } | ||
40 | + | ||
41 | + @Override | ||
42 | + public void deleteByPrimaryKey(String id) { | ||
43 | + // TODO Auto-generated method stub | ||
44 | + ItemDao.deleteByPrimaryKey(id); | ||
45 | + } | ||
46 | + | ||
47 | + @Override | ||
48 | + public void insertSelective(ManifestItem manifest) { | ||
49 | + // TODO Auto-generated method stub | ||
50 | + ItemDao.insertSelective(manifest); | ||
51 | + } | ||
52 | + | ||
53 | + @Override | ||
54 | + public void updateByPrimaryKeySelective(ManifestItem manifest) { | ||
55 | + // TODO Auto-generated method stub | ||
56 | + ItemDao.updateByPrimaryKeySelective(manifest); | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public List<ManifestItem> getIteamList(String waybillnomaster) { | ||
61 | + // TODO Auto-generated method stub | ||
62 | + return ItemDao.getIteamList(waybillnomaster); | ||
63 | + } | ||
64 | + | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | +} |
1 | +package com.tianbo.service.imp; | ||
2 | + | ||
3 | + | ||
4 | +import java.util.Date; | ||
5 | +import java.util.List; | ||
6 | +import java.util.UUID; | ||
7 | + | ||
8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
9 | +import org.springframework.stereotype.Service; | ||
10 | +import org.springframework.transaction.annotation.Transactional; | ||
11 | + | ||
12 | +import com.tianbo.mapper.ManifestLostChangeMapper; | ||
13 | +import com.tianbo.model.ManifestLostChange; | ||
14 | +import com.tianbo.service.LostChangeService; | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | +@Service | ||
19 | +@Transactional | ||
20 | +public class LostChangeServiceImp implements LostChangeService{ | ||
21 | + @Autowired | ||
22 | + private ManifestLostChangeMapper lostChangeDao; | ||
23 | + | ||
24 | + @Override | ||
25 | + public List<ManifestLostChange> getList(int start, int end) { | ||
26 | + // TODO Auto-generated method stub | ||
27 | + return lostChangeDao.getList(start,end); | ||
28 | + } | ||
29 | + | ||
30 | + @Override | ||
31 | + public int getCount(ManifestLostChange lostChange) { | ||
32 | + | ||
33 | + return lostChangeDao.getCount(lostChange); | ||
34 | + } | ||
35 | + | ||
36 | + @Override | ||
37 | + public List<ManifestLostChange> selectByParam(int start, int end, String flightno, String flightdate, | ||
38 | + String waybillnomaster, String waybillnosecondary) { | ||
39 | + // TODO Auto-generated method stub | ||
40 | + return lostChangeDao.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary); | ||
41 | + } | ||
42 | + | ||
43 | + @Override | ||
44 | + public ManifestLostChange selectByPrimaryKey(String id) { | ||
45 | + // TODO Auto-generated method stub | ||
46 | + return lostChangeDao.selectByPrimaryKey(id); | ||
47 | + } | ||
48 | + | ||
49 | + @Override | ||
50 | + public void saveorupdate(ManifestLostChange manifest) { | ||
51 | + if (manifest.getId()==null||manifest.getId()==""){ | ||
52 | + manifest.setId(UUID.randomUUID().toString()); | ||
53 | + manifest.setCreatedate(new Date()); | ||
54 | + lostChangeDao.insert(manifest); | ||
55 | + }else{ | ||
56 | + // 更新用户数据 | ||
57 | + manifest.setCreatedate(new Date()); | ||
58 | + lostChangeDao.updateByPrimaryKeySelective(manifest); | ||
59 | + } | ||
60 | + } | ||
61 | + | ||
62 | + @Override | ||
63 | + public void deleteByPrimaryKey(String id) { | ||
64 | + | ||
65 | + lostChangeDao.deleteByPrimaryKey(id); | ||
66 | + | ||
67 | + } | ||
68 | + | ||
69 | + @Override | ||
70 | + public void insertSelective(ManifestLostChange manifestLoad) { | ||
71 | + // TODO Auto-generated method stub | ||
72 | + lostChangeDao.insertSelective(manifestLoad); | ||
73 | + } | ||
74 | + | ||
75 | + @Override | ||
76 | + public void updateByPrimaryKeySelective(ManifestLostChange manifestLoad) { | ||
77 | + // TODO Auto-generated method stub | ||
78 | + lostChangeDao.updateByPrimaryKeySelective(manifestLoad); | ||
79 | + } | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | +} |
1 | +package com.tianbo.service.imp; | ||
2 | + | ||
3 | +import java.util.Date; | ||
4 | +import java.util.List; | ||
5 | +import java.util.UUID; | ||
6 | + | ||
7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | +import org.springframework.transaction.annotation.Transactional; | ||
10 | + | ||
11 | +import com.tianbo.mapper.LostMapper; | ||
12 | +import com.tianbo.model.ManifestLoad; | ||
13 | +import com.tianbo.service.LostService; | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | +@Service | ||
18 | +@Transactional | ||
19 | +public class LostServiceImp implements LostService{ | ||
20 | + @Autowired | ||
21 | + private LostMapper lostDao; | ||
22 | + | ||
23 | + | ||
24 | + @Override | ||
25 | + public List<ManifestLoad> getList(int start, int end) { | ||
26 | + | ||
27 | + return lostDao.getList(start,end); | ||
28 | + } | ||
29 | + | ||
30 | + | ||
31 | + @Override | ||
32 | + public int getCount(ManifestLoad fs) { | ||
33 | + | ||
34 | + return lostDao.getCount(fs); | ||
35 | + } | ||
36 | + | ||
37 | + | ||
38 | + @Override | ||
39 | + public void del(String id) { | ||
40 | + | ||
41 | + lostDao.del(id); | ||
42 | + } | ||
43 | + | ||
44 | + | ||
45 | + @Override | ||
46 | + public void saveorupdate(ManifestLoad ft) { | ||
47 | + if (ft.getId()==null||ft.getId()==""){ | ||
48 | + ft.setId(UUID.randomUUID().toString()); | ||
49 | + ft.setCreatedate(new Date()); | ||
50 | + lostDao.insert(ft); | ||
51 | + }else{ | ||
52 | + // 更新用户数据 | ||
53 | + ft.setCreatedate(new Date()); | ||
54 | + lostDao.update(ft); | ||
55 | + } | ||
56 | + } | ||
57 | + | ||
58 | + | ||
59 | + @Override | ||
60 | + public List<ManifestLoad> selectByFlightno(int start, int end, String flightno) { | ||
61 | + | ||
62 | + return lostDao.selectByFlightno(start,end,flightno); | ||
63 | + } | ||
64 | + | ||
65 | + | ||
66 | + @Override | ||
67 | + public ManifestLoad findById(String id) { | ||
68 | + // TODO Auto-generated method stub | ||
69 | + return lostDao.get(id); | ||
70 | + } | ||
71 | + | ||
72 | + | ||
73 | + @Override | ||
74 | + public List<ManifestLoad> selectByParam(int start, int end, String flightno, String flightdate, | ||
75 | + String waybillnomaster, String waybillnosecondary) { | ||
76 | + // TODO Auto-generated method stub | ||
77 | + return lostDao.selectByParam(start,end,flightno,flightdate,waybillnomaster,waybillnosecondary); | ||
78 | + } | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | ||
84 | +} |
@@ -31,5 +31,11 @@ public class SendLogServiceImpl implements SendLogService { | @@ -31,5 +31,11 @@ public class SendLogServiceImpl implements SendLogService { | ||
31 | // TODO Auto-generated method stub | 31 | // TODO Auto-generated method stub |
32 | return sendlogDao.getSendLogSecondByMain(billNo); | 32 | return sendlogDao.getSendLogSecondByMain(billNo); |
33 | } | 33 | } |
34 | + | ||
35 | + @Override | ||
36 | + public void save(Sendlog sendlog) { | ||
37 | + | ||
38 | + sendlogDao.insert(sendlog); | ||
39 | + } | ||
34 | 40 | ||
35 | } | 41 | } |
1 | +package com.tianbo.util; | ||
2 | + | ||
3 | +import java.lang.reflect.Field; | ||
4 | +import java.lang.reflect.Method; | ||
5 | +import java.math.BigDecimal; | ||
6 | +import java.sql.Timestamp; | ||
7 | +import java.text.DecimalFormat; | ||
8 | +import java.util.ArrayList; | ||
9 | +import java.util.HashMap; | ||
10 | +import java.util.List; | ||
11 | +import java.util.Map; | ||
12 | + | ||
13 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
14 | +import com.thoughtworks.xstream.converters.Converter; | ||
15 | +import com.thoughtworks.xstream.converters.MarshallingContext; | ||
16 | +import com.thoughtworks.xstream.converters.UnmarshallingContext; | ||
17 | +import com.thoughtworks.xstream.io.HierarchicalStreamReader; | ||
18 | +import com.thoughtworks.xstream.io.HierarchicalStreamWriter; | ||
19 | + | ||
20 | +public class NullConverter implements Converter { | ||
21 | + private Map<Class<?>, List<String>> attributes = null; | ||
22 | + | ||
23 | + public void regAttribute(Class<?> type, String attribute) | ||
24 | + { | ||
25 | + if (null == attributes) | ||
26 | + { | ||
27 | + attributes = new HashMap<Class<?>, List<String>>(); | ||
28 | + } | ||
29 | + | ||
30 | + List value = attributes.get(type); | ||
31 | + if (null == value) | ||
32 | + { | ||
33 | + value = new ArrayList<String>(); | ||
34 | + attributes.put(type, value); | ||
35 | + } | ||
36 | + | ||
37 | + value.add(attribute); | ||
38 | + } | ||
39 | + | ||
40 | + | ||
41 | + /** | ||
42 | + * 是否是属性(是属性的不用以单独标签实现) | ||
43 | + * @param type | ||
44 | + * @param attribute | ||
45 | + * @return | ||
46 | + */ | ||
47 | + public boolean isClassAttribute(Class<?> type,String attribute) { | ||
48 | + List<String> value = getAttributes(type); | ||
49 | + if (type.equals(Integer.class) || type.equals(Double.class) | ||
50 | + || type.equals(Long.class) || type.equals(Short.class) | ||
51 | + || type.equals(Float.class) || type.equals(BigDecimal.class) | ||
52 | + || type.equals(int.class) || type.equals(float.class) | ||
53 | + || type.equals(long.class) || type.equals(double.class) | ||
54 | + || type.equals(short.class)) { | ||
55 | + return true; | ||
56 | + } | ||
57 | + return false; | ||
58 | + } | ||
59 | + /** | ||
60 | + * 获取注册的属性 | ||
61 | + * @param type | ||
62 | + * @return | ||
63 | + */ | ||
64 | + public List<String> getAttributes(Class<?> type) { | ||
65 | + if (null != attributes){ | ||
66 | + return attributes.get(type); | ||
67 | + } | ||
68 | + return null; | ||
69 | + } | ||
70 | + /** | ||
71 | + * 输出对象的属性标签 | ||
72 | + * @param source | ||
73 | + * @param writer | ||
74 | + */ | ||
75 | + public void writerAttribute (Object source, HierarchicalStreamWriter writer) { | ||
76 | + Class cType = source.getClass(); | ||
77 | + List<String> value = getAttributes(cType); | ||
78 | + if ((null != value) && (value.size() > 0)){ | ||
79 | + Method[] methods = cType.getMethods(); | ||
80 | + for (Method method : methods){ | ||
81 | + String methodName = method.getName(); | ||
82 | + if (methodName.indexOf("get") != -1 && methodName != "getClass") { | ||
83 | + String name = methodName.substring(3); | ||
84 | + name = name.toLowerCase(); | ||
85 | + if (value.contains(name)){ | ||
86 | + Object o = null; | ||
87 | + try { | ||
88 | + o = method.invoke(source, null); | ||
89 | + } catch (Exception e) { | ||
90 | + e.printStackTrace(); | ||
91 | + } | ||
92 | + writer.addAttribute(name, o==null?"":o.toString()); | ||
93 | + } | ||
94 | + } | ||
95 | + } | ||
96 | + } | ||
97 | + } | ||
98 | + @SuppressWarnings("unchecked") | ||
99 | + public void marshal(Object source, HierarchicalStreamWriter writer, | ||
100 | + MarshallingContext context) { | ||
101 | + if (null == source) | ||
102 | + return; | ||
103 | + Class cType = source.getClass(); | ||
104 | + Field[] fields = cType.getDeclaredFields(); | ||
105 | + if (source instanceof List) { | ||
106 | + List list = (List) source; | ||
107 | + for (Object obj : list) { | ||
108 | + XStreamAlias alias = obj.getClass().getAnnotation(XStreamAlias.class); | ||
109 | + if (alias != null) { | ||
110 | + writer.startNode(alias.value()); | ||
111 | + marshal(obj, writer, context); | ||
112 | + writer.endNode(); | ||
113 | + }else { | ||
114 | + marshal(obj, writer, context); | ||
115 | + } | ||
116 | + } | ||
117 | + } else { | ||
118 | + for (Field field : fields) { | ||
119 | + //获得get方法 | ||
120 | + String temp1 = "get" | ||
121 | + + field.getName().substring(0, 1).toUpperCase() | ||
122 | + + field.getName().substring(1); | ||
123 | + Method m = null; | ||
124 | + try { | ||
125 | + m = cType.getMethod(temp1, null); | ||
126 | + } catch (SecurityException e1) { | ||
127 | + e1.printStackTrace(); | ||
128 | + } catch (NoSuchMethodException e1) { | ||
129 | + e1.printStackTrace(); | ||
130 | + } | ||
131 | + String methodName = m.getName(); | ||
132 | + if (methodName.indexOf("get") != -1 && methodName != "getClass") { | ||
133 | + boolean isBaseType = isBaseType(m.getReturnType()); | ||
134 | + String name = methodName.substring(3); | ||
135 | + Object o = null; | ||
136 | + try { | ||
137 | + o = m.invoke(source, null); | ||
138 | + } catch (Exception e) { | ||
139 | + e.printStackTrace(); | ||
140 | + } | ||
141 | + //递归打出基础类型值 | ||
142 | + if (isBaseType) { | ||
143 | + if(getAliasByNameAndType(name, cType)!=null){ | ||
144 | + writer.startNode(getAliasByNameAndType(name, cType).value()); | ||
145 | + writeData(o, m.getReturnType(), writer); | ||
146 | + writer.endNode(); | ||
147 | + } | ||
148 | + } else { | ||
149 | + XStreamAlias alias = getAliasByNameAndType(name, cType); | ||
150 | + if (alias == null) { | ||
151 | + marshal(o, writer, context); | ||
152 | + } else { | ||
153 | + writer.startNode(alias.value()); | ||
154 | + marshal(o, writer, context); | ||
155 | + writer.endNode(); | ||
156 | + } | ||
157 | + } | ||
158 | + } | ||
159 | + } | ||
160 | + } | ||
161 | + } | ||
162 | + | ||
163 | + /** | ||
164 | + * 根据Name和类获得Xstream注解 | ||
165 | + * @param name | ||
166 | + * Name | ||
167 | + * @param cType | ||
168 | + * 类 | ||
169 | + * @return | ||
170 | + * XStreamAlias | ||
171 | + */ | ||
172 | + private XStreamAlias getAliasByNameAndType(String name,Class<?> cType){ | ||
173 | + String temp = name.substring(0, 1).toLowerCase() | ||
174 | + + name.substring(1); | ||
175 | + Field f = null; | ||
176 | + try { | ||
177 | + f = cType.getDeclaredField(temp); | ||
178 | + } catch (SecurityException e) { | ||
179 | + e.printStackTrace(); | ||
180 | + } catch (NoSuchFieldException e) { | ||
181 | + e.printStackTrace(); | ||
182 | + } | ||
183 | + XStreamAlias alias = f.getAnnotation(XStreamAlias.class); | ||
184 | + return alias; | ||
185 | + } | ||
186 | + | ||
187 | + /** | ||
188 | + * 改写输出XML | ||
189 | + * @param o | ||
190 | + * @param ReturnType | ||
191 | + * @param writer | ||
192 | + */ | ||
193 | + private void writeData(Object o,Class<?> ReturnType,HierarchicalStreamWriter writer) { | ||
194 | + //如果是数字类型的话就要预设为0而不能为空 | ||
195 | + if (isNumValueType(ReturnType)) { | ||
196 | + if (o == null) { | ||
197 | + writer.setValue("0"); | ||
198 | + }else if (ReturnType.equals(Double.class)||ReturnType.equals(double.class)||ReturnType.equals(BigDecimal.class)) { | ||
199 | + DecimalFormat df = new DecimalFormat("#.##"); | ||
200 | + writer.setValue(df.format(o)); | ||
201 | + }else { | ||
202 | + writer.setValue(o.toString()); | ||
203 | + } | ||
204 | + } else { | ||
205 | + writer.setValue(o == null ? "" : o.toString()); | ||
206 | + } | ||
207 | + } | ||
208 | + | ||
209 | + public Object unmarshal(HierarchicalStreamReader reader, | ||
210 | + UnmarshallingContext context) { | ||
211 | + return null; | ||
212 | + } | ||
213 | + | ||
214 | + public boolean canConvert(Class type) { | ||
215 | + return true; | ||
216 | + } | ||
217 | + | ||
218 | + | ||
219 | + /** | ||
220 | + * 判断是否为基本类型 | ||
221 | + * @param type | ||
222 | + * @return | ||
223 | + * boolean | ||
224 | + */ | ||
225 | + private boolean isBaseType(Class<?> type) { | ||
226 | + if (type.equals(Integer.class) || type.equals(Double.class) | ||
227 | + || type.equals(String.class) || type.equals(Boolean.class) | ||
228 | + || type.equals(Long.class) || type.equals(Short.class) | ||
229 | + || type.equals(Byte.class) || type.equals(Float.class) | ||
230 | + || type.equals(BigDecimal.class) || type.equals(int.class) | ||
231 | + || type.equals(float.class) || type.equals(long.class) | ||
232 | + || type.equals(double.class) || type.equals(short.class) | ||
233 | + || type.equals(boolean.class) || type.equals(byte.class) | ||
234 | + || type.equals(Timestamp.class)) { | ||
235 | + return true; | ||
236 | + } | ||
237 | + return false; | ||
238 | + } | ||
239 | + | ||
240 | + /** | ||
241 | + * 判断是否为数字类型 | ||
242 | + * @param type | ||
243 | + * @return | ||
244 | + * boolean | ||
245 | + */ | ||
246 | + public boolean isNumValueType(Class<?> type) { | ||
247 | + if (type.equals(Integer.class) || type.equals(Double.class) | ||
248 | + || type.equals(Long.class) || type.equals(Short.class) | ||
249 | + || type.equals(Float.class) || type.equals(BigDecimal.class) | ||
250 | + || type.equals(int.class) || type.equals(float.class) | ||
251 | + || type.equals(long.class) || type.equals(double.class) | ||
252 | + || type.equals(short.class)) { | ||
253 | + return true; | ||
254 | + } | ||
255 | + return false; | ||
256 | + } | ||
257 | +} |
1 | +package com.tianbo.util.xml; | ||
2 | + | ||
3 | +import java.lang.reflect.Field; | ||
4 | +import java.lang.reflect.Method; | ||
5 | +import java.math.BigDecimal; | ||
6 | +import java.sql.Timestamp; | ||
7 | +import java.text.DecimalFormat; | ||
8 | +import java.util.List; | ||
9 | + | ||
10 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
11 | +import com.thoughtworks.xstream.converters.Converter; | ||
12 | +import com.thoughtworks.xstream.converters.MarshallingContext; | ||
13 | +import com.thoughtworks.xstream.converters.UnmarshallingContext; | ||
14 | +import com.thoughtworks.xstream.io.HierarchicalStreamReader; | ||
15 | +import com.thoughtworks.xstream.io.HierarchicalStreamWriter; | ||
16 | + | ||
17 | +public class NullConverter implements Converter { | ||
18 | + | ||
19 | + @SuppressWarnings("unchecked") | ||
20 | + public void marshal(Object source, HierarchicalStreamWriter writer, | ||
21 | + MarshallingContext context) { | ||
22 | + if (null == source) | ||
23 | + return; | ||
24 | + Class cType = source.getClass(); | ||
25 | + Field[] fields = cType.getDeclaredFields(); | ||
26 | + if (source instanceof List) { | ||
27 | + List list = (List) source; | ||
28 | + for (Object obj : list) { | ||
29 | + XStreamAlias alias = obj.getClass().getAnnotation(XStreamAlias.class); | ||
30 | + if (alias != null) { | ||
31 | + writer.startNode(alias.value()); | ||
32 | + marshal(obj, writer, context); | ||
33 | + writer.endNode(); | ||
34 | + }else { | ||
35 | + marshal(obj, writer, context); | ||
36 | + } | ||
37 | + } | ||
38 | + } else { | ||
39 | + for (Field field : fields) { | ||
40 | + //获得get方法 | ||
41 | + String temp1 = "get" | ||
42 | + + field.getName().substring(0, 1).toUpperCase() | ||
43 | + + field.getName().substring(1); | ||
44 | + Method m = null; | ||
45 | + try { | ||
46 | + m = cType.getMethod(temp1, null); | ||
47 | + } catch (SecurityException e1) { | ||
48 | + e1.printStackTrace(); | ||
49 | + } catch (NoSuchMethodException e1) { | ||
50 | + e1.printStackTrace(); | ||
51 | + } | ||
52 | + String methodName = m.getName(); | ||
53 | + if (methodName.indexOf("get") != -1 && methodName != "getClass") { | ||
54 | + boolean isBaseType = isBaseType(m.getReturnType()); | ||
55 | + String name = methodName.substring(3); | ||
56 | + Object o = null; | ||
57 | + try { | ||
58 | + o = m.invoke(source, null); | ||
59 | + } catch (Exception e) { | ||
60 | + e.printStackTrace(); | ||
61 | + } | ||
62 | + //递归打出基础类型值 | ||
63 | + if (isBaseType) { | ||
64 | + if(getAliasByNameAndType(name, cType)!=null){ | ||
65 | + writer.startNode(getAliasByNameAndType(name, cType).value()); | ||
66 | + writeData(o, m.getReturnType(), writer); | ||
67 | + writer.endNode(); | ||
68 | + } | ||
69 | + } else { | ||
70 | + XStreamAlias alias = getAliasByNameAndType(name, cType); | ||
71 | + if (alias == null) { | ||
72 | + marshal(o, writer, context); | ||
73 | + } else { | ||
74 | + writer.startNode(alias.value()); | ||
75 | + marshal(o, writer, context); | ||
76 | + writer.endNode(); | ||
77 | + } | ||
78 | + } | ||
79 | + } | ||
80 | + } | ||
81 | + } | ||
82 | + } | ||
83 | + | ||
84 | + /** | ||
85 | + * 根据Name和类获得Xstream注解 | ||
86 | + * @param name | ||
87 | + * Name | ||
88 | + * @param cType | ||
89 | + * 类 | ||
90 | + * @return | ||
91 | + * XStreamAlias | ||
92 | + */ | ||
93 | + private XStreamAlias getAliasByNameAndType(String name,Class<?> cType){ | ||
94 | + String temp = name.substring(0, 1).toLowerCase() | ||
95 | + + name.substring(1); | ||
96 | + Field f = null; | ||
97 | + try { | ||
98 | + f = cType.getDeclaredField(temp); | ||
99 | + } catch (SecurityException e) { | ||
100 | + e.printStackTrace(); | ||
101 | + } catch (NoSuchFieldException e) { | ||
102 | + e.printStackTrace(); | ||
103 | + } | ||
104 | + XStreamAlias alias = f.getAnnotation(XStreamAlias.class); | ||
105 | + return alias; | ||
106 | + } | ||
107 | + | ||
108 | + /** | ||
109 | + * 改写输出XML | ||
110 | + * @param o | ||
111 | + * @param ReturnType | ||
112 | + * @param writer | ||
113 | + */ | ||
114 | + private void writeData(Object o,Class<?> ReturnType,HierarchicalStreamWriter writer) { | ||
115 | + //如果是数字类型的话就要预设为0而不能为空 | ||
116 | + if (isNumValueType(ReturnType)) { | ||
117 | + if (o == null) { | ||
118 | + writer.setValue("0"); | ||
119 | + }else if (ReturnType.equals(Double.class)||ReturnType.equals(double.class)||ReturnType.equals(BigDecimal.class)) { | ||
120 | + DecimalFormat df = new DecimalFormat("#.##"); | ||
121 | + writer.setValue(df.format(o)); | ||
122 | + }else { | ||
123 | + writer.setValue(o.toString()); | ||
124 | + } | ||
125 | + } else { | ||
126 | + writer.setValue(o == null ? "" : o.toString()); | ||
127 | + } | ||
128 | + } | ||
129 | + | ||
130 | + public Object unmarshal(HierarchicalStreamReader reader, | ||
131 | + UnmarshallingContext context) { | ||
132 | + return null; | ||
133 | + } | ||
134 | + | ||
135 | + public boolean canConvert(Class type) { | ||
136 | + return true; | ||
137 | + } | ||
138 | + | ||
139 | + | ||
140 | + /** | ||
141 | + * 判断是否为基本类型 | ||
142 | + * @param type | ||
143 | + * @return | ||
144 | + * boolean | ||
145 | + */ | ||
146 | + private boolean isBaseType(Class<?> type) { | ||
147 | + if (type.equals(Integer.class) || type.equals(Double.class) | ||
148 | + || type.equals(String.class) || type.equals(Boolean.class) | ||
149 | + || type.equals(Long.class) || type.equals(Short.class) | ||
150 | + || type.equals(Byte.class) || type.equals(Float.class) | ||
151 | + || type.equals(BigDecimal.class) || type.equals(int.class) | ||
152 | + || type.equals(float.class) || type.equals(long.class) | ||
153 | + || type.equals(double.class) || type.equals(short.class) | ||
154 | + || type.equals(boolean.class) || type.equals(byte.class) | ||
155 | + || type.equals(Timestamp.class)) { | ||
156 | + return true; | ||
157 | + } | ||
158 | + return false; | ||
159 | + } | ||
160 | + | ||
161 | + /** | ||
162 | + * 判断是否为数字类型 | ||
163 | + * @param type | ||
164 | + * @return | ||
165 | + * boolean | ||
166 | + */ | ||
167 | + public boolean isNumValueType(Class<?> type) { | ||
168 | + if (type.equals(Integer.class) || type.equals(Double.class) | ||
169 | + || type.equals(Long.class) || type.equals(Short.class) | ||
170 | + || type.equals(Float.class) || type.equals(BigDecimal.class) | ||
171 | + || type.equals(int.class) || type.equals(float.class) | ||
172 | + || type.equals(long.class) || type.equals(double.class) | ||
173 | + || type.equals(short.class)) { | ||
174 | + return true; | ||
175 | + } | ||
176 | + return false; | ||
177 | + } | ||
178 | + | ||
179 | +} |
1 | +package com.tianbo.util.xml; | ||
2 | + | ||
3 | +import java.io.File; | ||
4 | +import java.io.FileNotFoundException; | ||
5 | +import java.io.FileOutputStream; | ||
6 | +import java.io.IOException; | ||
7 | +import java.io.OutputStream; | ||
8 | +import java.io.OutputStreamWriter; | ||
9 | +import java.nio.charset.Charset; | ||
10 | + | ||
11 | +import org.springframework.stereotype.Component; | ||
12 | + | ||
13 | +import com.thoughtworks.xstream.XStream; | ||
14 | +import com.tianbo.util.DateUtils; | ||
15 | +import com.tianbo.util.NullConverter; | ||
16 | +import com.tianbo.util.PropertiesUtils; | ||
17 | +import com.tianbo.xml.lost.ManifestXmlEntity; | ||
18 | + | ||
19 | +@Component | ||
20 | +public class XmlGen { | ||
21 | + | ||
22 | + /** | ||
23 | + * 生成落装申请报文 | ||
24 | + * @param entity | ||
25 | + */ | ||
26 | + public static String genLostXmlAndSend(ManifestXmlEntity xmlVO){ | ||
27 | + | ||
28 | + String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml"; | ||
29 | + | ||
30 | + XStream xstream = new XStream(); | ||
31 | + xstream.autodetectAnnotations(true); | ||
32 | + xstream.registerConverter(new NullConverter()); | ||
33 | + | ||
34 | + String xml = xstream.toXML(xmlVO); | ||
35 | + | ||
36 | + xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml; | ||
37 | + xml=xml.replace("__", "_"); | ||
38 | + | ||
39 | + String xmlPath =PropertiesUtils.readProperty("MT8202Path")+xmlFileName; | ||
40 | + | ||
41 | + xml2File(xmlVO, xmlFileName, xstream,xmlPath); | ||
42 | + | ||
43 | + return xml; | ||
44 | + } | ||
45 | + | ||
46 | + | ||
47 | + /** | ||
48 | + * 生成落装改配申请报文 | ||
49 | + * @param entity | ||
50 | + */ | ||
51 | + public static String genLostChangeXmlAndSend(ManifestXmlEntity xmlVO){ | ||
52 | + | ||
53 | + String xmlFileName = "CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS") + ".xml"; | ||
54 | + | ||
55 | + XStream xstream = new XStream(); | ||
56 | + xstream.autodetectAnnotations(true); | ||
57 | + xstream.registerConverter(new NullConverter()); | ||
58 | + | ||
59 | + String xml = xstream.toXML(xmlVO); | ||
60 | + | ||
61 | + xml="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+xml; | ||
62 | + xml=xml.replace("__", "_"); | ||
63 | + | ||
64 | + String xmlPath =PropertiesUtils.readProperty("MT8202Path")+xmlFileName; | ||
65 | + | ||
66 | + xml2File(xmlVO, xmlFileName, xstream,xmlPath); | ||
67 | + | ||
68 | + return xml; | ||
69 | + } | ||
70 | + | ||
71 | + | ||
72 | + | ||
73 | + /** | ||
74 | + * @param xmlVO | ||
75 | + * @param xmlFileName | ||
76 | + * @param xstream | ||
77 | + */ | ||
78 | + public static void xml2File(ManifestXmlEntity xmlVO, String xmlFileName, XStream xstream,String xmlPath) { | ||
79 | + File file = new File(xmlPath); | ||
80 | + if (!file.exists()) { | ||
81 | + try { | ||
82 | + file.createNewFile(); | ||
83 | + System.out.println("文件创建成功!"); | ||
84 | + } catch (IOException e) { | ||
85 | + System.out.println("文件创建失败!"); | ||
86 | + e.printStackTrace(); | ||
87 | + } | ||
88 | + } | ||
89 | + | ||
90 | + OutputStream out; | ||
91 | + try { | ||
92 | + out = new FileOutputStream(file); | ||
93 | + OutputStreamWriter writer = new OutputStreamWriter(out,Charset.forName("UTF-8")); | ||
94 | + writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); | ||
95 | + xstream.toXML(xmlVO, writer); | ||
96 | + out.close(); | ||
97 | + writer.close(); | ||
98 | + } catch (FileNotFoundException e) { | ||
99 | + e.printStackTrace(); | ||
100 | + }catch (IOException e) { | ||
101 | + e.printStackTrace(); | ||
102 | + } | ||
103 | + } | ||
104 | + | ||
105 | +} |
1 | +package com.tianbo.util.xml; | ||
2 | + | ||
3 | +import java.io.File; | ||
4 | +import java.io.FileNotFoundException; | ||
5 | +import java.io.FileOutputStream; | ||
6 | +import java.io.IOException; | ||
7 | +import java.io.OutputStream; | ||
8 | +import java.io.OutputStreamWriter; | ||
9 | +import java.nio.charset.Charset; | ||
10 | + | ||
11 | +import org.junit.Test; | ||
12 | + | ||
13 | +import com.thoughtworks.xstream.XStream; | ||
14 | +import com.thoughtworks.xstream.io.xml.DomDriver; | ||
15 | + | ||
16 | +public class xmlUtils { | ||
17 | + | ||
18 | + private Object obj; | ||
19 | + | ||
20 | + @Test // 将对象信息写入xml文件 | ||
21 | + public void writeXML() { | ||
22 | + XStream xstream = new XStream(new DomDriver("utf-8")); | ||
23 | + String xmlFileName = "student.xml"; | ||
24 | + File file = new File("C:\\Users\\admin\\Desktop\\" + xmlFileName); | ||
25 | + if (!file.exists()) { | ||
26 | + try { | ||
27 | + file.createNewFile(); | ||
28 | + System.out.println("文件创建成功!"); | ||
29 | + } catch (IOException e) { | ||
30 | + System.out.println("文件创建失败!"); | ||
31 | + e.printStackTrace(); | ||
32 | + } | ||
33 | + } | ||
34 | + // String xml = xstream.toXML(student);//不会直接生成xml文件,返回的仅仅只是xml文本字符串 | ||
35 | + // System.out.println(xml); | ||
36 | + OutputStream out; | ||
37 | + try { | ||
38 | + out = new FileOutputStream(file); | ||
39 | + OutputStreamWriter writer = new OutputStreamWriter(out, Charset.forName("GBK")); | ||
40 | + writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); | ||
41 | + xstream.toXML(obj, writer); | ||
42 | + out.close(); | ||
43 | + writer.close(); | ||
44 | + } catch (FileNotFoundException e) { | ||
45 | + e.printStackTrace(); | ||
46 | + } catch (IOException e) { | ||
47 | + e.printStackTrace(); | ||
48 | + } | ||
49 | + } | ||
50 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class AdditionalInformation { | ||
6 | + | ||
7 | + @XStreamAlias("Content") | ||
8 | + private String content; | ||
9 | + | ||
10 | + public String getContent() { | ||
11 | + return content; | ||
12 | + } | ||
13 | + | ||
14 | + public void setContent(String content) { | ||
15 | + this.content = content; | ||
16 | + } | ||
17 | + | ||
18 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class AssociatedTransportDocument { | ||
6 | + | ||
7 | + @XStreamAlias("ID") | ||
8 | + private String id; | ||
9 | + | ||
10 | + public String getId() { | ||
11 | + return id; | ||
12 | + } | ||
13 | + | ||
14 | + public void setId(String id) { | ||
15 | + this.id = id; | ||
16 | + } | ||
17 | + | ||
18 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class BorderTransportMeans { | ||
6 | + | ||
7 | + @XStreamAlias("JourneyID") | ||
8 | + private String journeyID; | ||
9 | + | ||
10 | + public String getJourneyID() { | ||
11 | + return journeyID; | ||
12 | + } | ||
13 | + | ||
14 | + public void setJourneyID(String journeyID) { | ||
15 | + this.journeyID = journeyID; | ||
16 | + } | ||
17 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class Consignment { | ||
6 | + | ||
7 | + @XStreamAlias("TransportContractDocument") | ||
8 | + private TransportContractDocument transportContractDocument; | ||
9 | + | ||
10 | + @XStreamAlias("AssociatedTransportDocument") | ||
11 | + private AssociatedTransportDocument associatedTransportDocument; | ||
12 | + | ||
13 | + public TransportContractDocument getTransportContractDocument() { | ||
14 | + return transportContractDocument; | ||
15 | + } | ||
16 | + | ||
17 | + public void setTransportContractDocument(TransportContractDocument transportContractDocument) { | ||
18 | + this.transportContractDocument = transportContractDocument; | ||
19 | + } | ||
20 | + | ||
21 | + public AssociatedTransportDocument getAssociatedTransportDocument() { | ||
22 | + return associatedTransportDocument; | ||
23 | + } | ||
24 | + | ||
25 | + public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) { | ||
26 | + this.associatedTransportDocument = associatedTransportDocument; | ||
27 | + } | ||
28 | + | ||
29 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class DeclarationXmlEntity { | ||
6 | + | ||
7 | + @XStreamAlias("BorderTransportMeans") | ||
8 | + private BorderTransportMeans borderTransportMeans; | ||
9 | + | ||
10 | + @XStreamAlias("Consignment") | ||
11 | + private Consignment consignment; | ||
12 | + | ||
13 | + @XStreamAlias("AdditionalInformation") | ||
14 | + private AdditionalInformation additionalInformation; | ||
15 | + | ||
16 | + public BorderTransportMeans getBorderTransportMeans() { | ||
17 | + return borderTransportMeans; | ||
18 | + } | ||
19 | + | ||
20 | + public void setBorderTransportMeans(BorderTransportMeans borderTransportMeans) { | ||
21 | + this.borderTransportMeans = borderTransportMeans; | ||
22 | + } | ||
23 | + | ||
24 | + public Consignment getConsignment() { | ||
25 | + return consignment; | ||
26 | + } | ||
27 | + | ||
28 | + public void setConsignment(Consignment consignment) { | ||
29 | + this.consignment = consignment; | ||
30 | + } | ||
31 | + | ||
32 | + public AdditionalInformation getAdditionalInformation() { | ||
33 | + return additionalInformation; | ||
34 | + } | ||
35 | + | ||
36 | + public void setAdditionalInformation(AdditionalInformation additionalInformation) { | ||
37 | + this.additionalInformation = additionalInformation; | ||
38 | + } | ||
39 | + | ||
40 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | +import com.tianbo.util.DateUtils; | ||
5 | + | ||
6 | +public class HeadXmlEntity { | ||
7 | + | ||
8 | + @XStreamAlias("MessageID") | ||
9 | + private String messageId="CN_MT8202_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS"); | ||
10 | + | ||
11 | + @XStreamAlias("FunctionCode") | ||
12 | + private String functionCode="2"; | ||
13 | + | ||
14 | + @XStreamAlias("MessageType") | ||
15 | + private String messageType="MT8202"; | ||
16 | + | ||
17 | + @XStreamAlias("SenderID") | ||
18 | + private String senderId="460470678920X_DXPENT0000460002"; | ||
19 | + | ||
20 | + @XStreamAlias("ReceiverID") | ||
21 | + private String receiverId="4604"; | ||
22 | + | ||
23 | + @XStreamAlias("SendTime") | ||
24 | + private String sendTime=DateUtils.currentFormatDate("yyyyMMddHHmmssSSS"); | ||
25 | + | ||
26 | + @XStreamAlias("Version") | ||
27 | + private String version="1.0"; | ||
28 | + | ||
29 | + | ||
30 | + public String getMessageType() { | ||
31 | + return messageType; | ||
32 | + } | ||
33 | + | ||
34 | + public void setMessageType(String messageType) { | ||
35 | + this.messageType = messageType; | ||
36 | + } | ||
37 | + | ||
38 | + public String getMessageId() { | ||
39 | + return messageId; | ||
40 | + } | ||
41 | + | ||
42 | + public void setMessageId(String messageId) { | ||
43 | + this.messageId = messageId; | ||
44 | + } | ||
45 | + | ||
46 | + | ||
47 | + public String getSenderId() { | ||
48 | + return senderId; | ||
49 | + } | ||
50 | + | ||
51 | + public void setSenderId(String senderId) { | ||
52 | + this.senderId = senderId; | ||
53 | + } | ||
54 | + | ||
55 | + | ||
56 | + public String getReceiverId() { | ||
57 | + return receiverId; | ||
58 | + } | ||
59 | + | ||
60 | + public void setReceiverId(String receiverId) { | ||
61 | + this.receiverId = receiverId; | ||
62 | + } | ||
63 | + | ||
64 | + public String getFunctionCode() { | ||
65 | + return functionCode; | ||
66 | + } | ||
67 | + | ||
68 | + public void setFunctionCode(String functionCode) { | ||
69 | + this.functionCode = functionCode; | ||
70 | + } | ||
71 | + | ||
72 | + public String getVersion() { | ||
73 | + return version; | ||
74 | + } | ||
75 | + | ||
76 | + public void setVersion(String version) { | ||
77 | + this.version = version; | ||
78 | + } | ||
79 | + | ||
80 | + public String getSendTime() { | ||
81 | + return sendTime; | ||
82 | + } | ||
83 | + | ||
84 | + public void setSendTime(String sendTime) { | ||
85 | + this.sendTime = sendTime; | ||
86 | + } | ||
87 | + public static void main(String[] args) { | ||
88 | + HeadXmlEntity hd = new HeadXmlEntity(); | ||
89 | + System.out.println(hd); | ||
90 | + } | ||
91 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | + | ||
4 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
5 | +import com.tianbo.util.xml.XmlGen; | ||
6 | + | ||
7 | +@XStreamAlias("Manifest") | ||
8 | +public class ManifestXmlEntity { | ||
9 | + | ||
10 | + @XStreamAlias("Head") | ||
11 | + private HeadXmlEntity headXml; | ||
12 | + | ||
13 | + @XStreamAlias("Declaration") | ||
14 | + private DeclarationXmlEntity declarationXml; | ||
15 | + | ||
16 | + | ||
17 | + public HeadXmlEntity getHeadXml() { | ||
18 | + return headXml; | ||
19 | + } | ||
20 | + | ||
21 | + public void setHeadXml(HeadXmlEntity headXml) { | ||
22 | + this.headXml = headXml; | ||
23 | + } | ||
24 | + | ||
25 | + public DeclarationXmlEntity getDeclarationXml() { | ||
26 | + return declarationXml; | ||
27 | + } | ||
28 | + | ||
29 | + public void setDeclarationXml(DeclarationXmlEntity declarationXml) { | ||
30 | + this.declarationXml = declarationXml; | ||
31 | + } | ||
32 | + | ||
33 | + public static void main(String[] args) { | ||
34 | + ManifestXmlEntity ms = getXmlEntity(); | ||
35 | + String xml = XmlGen.genLostXmlAndSend(ms); | ||
36 | + System.err.println(xml); | ||
37 | + } | ||
38 | + | ||
39 | + /** | ||
40 | + * @return | ||
41 | + */ | ||
42 | + public static ManifestXmlEntity getXmlEntity() { | ||
43 | + ManifestXmlEntity ms = new ManifestXmlEntity(); | ||
44 | + HeadXmlEntity headXml = new HeadXmlEntity(); | ||
45 | + DeclarationXmlEntity declarationXml = new DeclarationXmlEntity(); | ||
46 | + AdditionalInformation information = new AdditionalInformation(); | ||
47 | + BorderTransportMeans transportMeans = new BorderTransportMeans(); | ||
48 | + Consignment consignment = new Consignment(); | ||
49 | + AssociatedTransportDocument associatedTransportDocument = new AssociatedTransportDocument(); | ||
50 | + consignment.setAssociatedTransportDocument(associatedTransportDocument ); | ||
51 | + TransportContractDocument transportContractDocument = new TransportContractDocument(); | ||
52 | + consignment.setTransportContractDocument(transportContractDocument ); | ||
53 | + declarationXml.setAdditionalInformation(information); | ||
54 | + declarationXml.setBorderTransportMeans(transportMeans); | ||
55 | + declarationXml.setConsignment(consignment); | ||
56 | + ms.setHeadXml(headXml); | ||
57 | + ms.setDeclarationXml(declarationXml); | ||
58 | + return ms; | ||
59 | + } | ||
60 | + | ||
61 | +} |
1 | +package com.tianbo.xml.lost; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class TransportContractDocument { | ||
6 | + | ||
7 | + @XStreamAlias("ID") | ||
8 | + private String id; | ||
9 | + | ||
10 | + public String getId() { | ||
11 | + return id; | ||
12 | + } | ||
13 | + | ||
14 | + public void setId(String id) { | ||
15 | + this.id = id; | ||
16 | + } | ||
17 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class AdditionalInformation { | ||
6 | + | ||
7 | + @XStreamAlias("Content") | ||
8 | + private String content; | ||
9 | + | ||
10 | + public String getContent() { | ||
11 | + return content; | ||
12 | + } | ||
13 | + | ||
14 | + public void setContent(String content) { | ||
15 | + this.content = content; | ||
16 | + } | ||
17 | + | ||
18 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | +/** | ||
5 | + * 运输合同附加信息 | ||
6 | + * @author Promise | ||
7 | + * | ||
8 | + */ | ||
9 | +public class AssociatedTransportDocument { | ||
10 | + | ||
11 | + @XStreamAlias("ID") | ||
12 | + private String id; | ||
13 | + | ||
14 | + public String getId() { | ||
15 | + return id; | ||
16 | + } | ||
17 | + | ||
18 | + public void setId(String id) { | ||
19 | + this.id = id; | ||
20 | + } | ||
21 | + | ||
22 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class BorderTransportMeans { | ||
6 | + | ||
7 | + @XStreamAlias("JourneyID") | ||
8 | + private String journeyID; | ||
9 | + | ||
10 | + public String getJourneyID() { | ||
11 | + return journeyID; | ||
12 | + } | ||
13 | + | ||
14 | + public void setJourneyID(String journeyID) { | ||
15 | + this.journeyID = journeyID; | ||
16 | + } | ||
17 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class ChangeBorderTransportMeans { | ||
6 | + | ||
7 | + @XStreamAlias("JourneyID") | ||
8 | + private String journeyID; | ||
9 | + | ||
10 | + public String getJourneyID() { | ||
11 | + return journeyID; | ||
12 | + } | ||
13 | + | ||
14 | + public void setJourneyID(String journeyID) { | ||
15 | + this.journeyID = journeyID; | ||
16 | + } | ||
17 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +/** | ||
6 | + * 变更后提(运)单信息 | ||
7 | + * @author Promise | ||
8 | + * | ||
9 | + */ | ||
10 | +public class ChangeConsignment { | ||
11 | + | ||
12 | + @XStreamAlias("TransportContractDocument") | ||
13 | + private TransportContractDocument transportContractDocument; | ||
14 | + | ||
15 | + @XStreamAlias("TransportContractDocument") | ||
16 | + private AssociatedTransportDocument associatedTransportDocument; | ||
17 | + | ||
18 | + @XStreamAlias("TransportEquipment") | ||
19 | + private TransportEquipment transportEquipment; | ||
20 | + | ||
21 | + public TransportContractDocument getTransportContractDocument() { | ||
22 | + return transportContractDocument; | ||
23 | + } | ||
24 | + | ||
25 | + public void setTransportContractDocument(TransportContractDocument transportContractDocument) { | ||
26 | + this.transportContractDocument = transportContractDocument; | ||
27 | + } | ||
28 | + | ||
29 | + public AssociatedTransportDocument getAssociatedTransportDocument() { | ||
30 | + return associatedTransportDocument; | ||
31 | + } | ||
32 | + | ||
33 | + public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) { | ||
34 | + this.associatedTransportDocument = associatedTransportDocument; | ||
35 | + } | ||
36 | + | ||
37 | + public TransportEquipment getTransportEquipment() { | ||
38 | + return transportEquipment; | ||
39 | + } | ||
40 | + | ||
41 | + public void setTransportEquipment(TransportEquipment transportEquipment) { | ||
42 | + this.transportEquipment = transportEquipment; | ||
43 | + } | ||
44 | + | ||
45 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +public class Consignment { | ||
6 | + | ||
7 | + @XStreamAlias("TransportContractDocument") | ||
8 | + private TransportContractDocument transportContractDocument; | ||
9 | + | ||
10 | + @XStreamAlias("AssociatedTransportDocument") | ||
11 | + private AssociatedTransportDocument associatedTransportDocument; | ||
12 | + | ||
13 | + @XStreamAlias("ChangeConsignment") | ||
14 | + private ChangeConsignment changeConsignment; | ||
15 | + | ||
16 | + public TransportContractDocument getTransportContractDocument() { | ||
17 | + return transportContractDocument; | ||
18 | + } | ||
19 | + | ||
20 | + public void setTransportContractDocument(TransportContractDocument transportContractDocument) { | ||
21 | + this.transportContractDocument = transportContractDocument; | ||
22 | + } | ||
23 | + | ||
24 | + public AssociatedTransportDocument getAssociatedTransportDocument() { | ||
25 | + return associatedTransportDocument; | ||
26 | + } | ||
27 | + | ||
28 | + public void setAssociatedTransportDocument(AssociatedTransportDocument associatedTransportDocument) { | ||
29 | + this.associatedTransportDocument = associatedTransportDocument; | ||
30 | + } | ||
31 | + | ||
32 | + public ChangeConsignment getChangeConsignment() { | ||
33 | + return changeConsignment; | ||
34 | + } | ||
35 | + | ||
36 | + public void setChangeConsignment(ChangeConsignment changeConsignment) { | ||
37 | + this.changeConsignment = changeConsignment; | ||
38 | + } | ||
39 | + | ||
40 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
6 | + | ||
7 | +public class DeclarationXmlEntity { | ||
8 | + | ||
9 | + @XStreamAlias("BorderTransportMeans") | ||
10 | + private BorderTransportMeans borderTransportMeans; | ||
11 | + | ||
12 | + @XStreamAlias("ChangeBorderTransportMeans") | ||
13 | + private ChangeBorderTransportMeans changeBorderTransportMeans; | ||
14 | + | ||
15 | + @XStreamAlias("Consignment") | ||
16 | + private List<Consignment> consignment; | ||
17 | + | ||
18 | + @XStreamAlias("AdditionalInformation") | ||
19 | + private AdditionalInformation additionalInformation; | ||
20 | + | ||
21 | + public BorderTransportMeans getBorderTransportMeans() { | ||
22 | + return borderTransportMeans; | ||
23 | + } | ||
24 | + | ||
25 | + public void setBorderTransportMeans(BorderTransportMeans borderTransportMeans) { | ||
26 | + this.borderTransportMeans = borderTransportMeans; | ||
27 | + } | ||
28 | + | ||
29 | + | ||
30 | + public AdditionalInformation getAdditionalInformation() { | ||
31 | + return additionalInformation; | ||
32 | + } | ||
33 | + | ||
34 | + public void setAdditionalInformation(AdditionalInformation additionalInformation) { | ||
35 | + this.additionalInformation = additionalInformation; | ||
36 | + } | ||
37 | + | ||
38 | + public List<Consignment> getConsignment() { | ||
39 | + return consignment; | ||
40 | + } | ||
41 | + | ||
42 | + public void setConsignment(List<Consignment> consignment) { | ||
43 | + this.consignment = consignment; | ||
44 | + } | ||
45 | + | ||
46 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | +import com.tianbo.util.DateUtils; | ||
5 | + | ||
6 | +public class HeadXmlEntity { | ||
7 | + | ||
8 | + @XStreamAlias("MessageID") | ||
9 | + private String messageId="CN_MT8203_1P0_460470678920X_" + DateUtils.currentFormatDate("yyyyMMddHHmmssSSS"); | ||
10 | + | ||
11 | + @XStreamAlias("FunctionCode") | ||
12 | + private String functionCode="2"; | ||
13 | + | ||
14 | + @XStreamAlias("MessageType") | ||
15 | + private String messageType="MT8203"; | ||
16 | + | ||
17 | + @XStreamAlias("SenderID") | ||
18 | + private String senderId="460470678920X_DXPENT0000460002"; | ||
19 | + | ||
20 | + @XStreamAlias("ReceiverID") | ||
21 | + private String receiverId="4604"; | ||
22 | + | ||
23 | + @XStreamAlias("SendTime") | ||
24 | + private String sendTime=DateUtils.currentFormatDate("yyyyMMddHHmmssSSS"); | ||
25 | + | ||
26 | + @XStreamAlias("Version") | ||
27 | + private String version="1.0"; | ||
28 | + | ||
29 | + | ||
30 | + public String getMessageType() { | ||
31 | + return messageType; | ||
32 | + } | ||
33 | + | ||
34 | + public void setMessageType(String messageType) { | ||
35 | + this.messageType = messageType; | ||
36 | + } | ||
37 | + | ||
38 | + public String getMessageId() { | ||
39 | + return messageId; | ||
40 | + } | ||
41 | + | ||
42 | + public void setMessageId(String messageId) { | ||
43 | + this.messageId = messageId; | ||
44 | + } | ||
45 | + | ||
46 | + | ||
47 | + public String getSenderId() { | ||
48 | + return senderId; | ||
49 | + } | ||
50 | + | ||
51 | + public void setSenderId(String senderId) { | ||
52 | + this.senderId = senderId; | ||
53 | + } | ||
54 | + | ||
55 | + | ||
56 | + public String getReceiverId() { | ||
57 | + return receiverId; | ||
58 | + } | ||
59 | + | ||
60 | + public void setReceiverId(String receiverId) { | ||
61 | + this.receiverId = receiverId; | ||
62 | + } | ||
63 | + | ||
64 | + public String getFunctionCode() { | ||
65 | + return functionCode; | ||
66 | + } | ||
67 | + | ||
68 | + public void setFunctionCode(String functionCode) { | ||
69 | + this.functionCode = functionCode; | ||
70 | + } | ||
71 | + | ||
72 | + public String getVersion() { | ||
73 | + return version; | ||
74 | + } | ||
75 | + | ||
76 | + public void setVersion(String version) { | ||
77 | + this.version = version; | ||
78 | + } | ||
79 | + | ||
80 | + public String getSendTime() { | ||
81 | + return sendTime; | ||
82 | + } | ||
83 | + | ||
84 | + public void setSendTime(String sendTime) { | ||
85 | + this.sendTime = sendTime; | ||
86 | + } | ||
87 | + public static void main(String[] args) { | ||
88 | + HeadXmlEntity hd = new HeadXmlEntity(); | ||
89 | + System.out.println(hd); | ||
90 | + } | ||
91 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | +/** | ||
5 | + * 运输合同信息 | ||
6 | + * @author Promise | ||
7 | + * | ||
8 | + */ | ||
9 | +public class TransportContractDocument { | ||
10 | + | ||
11 | + @XStreamAlias("ID") | ||
12 | + private String id; | ||
13 | + | ||
14 | + public String getId() { | ||
15 | + return id; | ||
16 | + } | ||
17 | + | ||
18 | + public void setId(String id) { | ||
19 | + this.id = id; | ||
20 | + } | ||
21 | +} |
1 | +package com.tianbo.xml.lostChange; | ||
2 | + | ||
3 | +import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
4 | + | ||
5 | +/** | ||
6 | + * 集装箱(器)信息 | ||
7 | + * @author Promise | ||
8 | + * | ||
9 | + */ | ||
10 | +public class TransportEquipment { | ||
11 | + | ||
12 | + @XStreamAlias("EquipmentIdentification") //集装箱(器)编号信息 | ||
13 | + private String equipmentIdentification; | ||
14 | + | ||
15 | + @XStreamAlias("CharacteristicCode") | ||
16 | + private String characteristicCode; //集装箱(器)尺寸和类型 | ||
17 | + | ||
18 | + @XStreamAlias("SupplierPartyTypeCode") | ||
19 | + private String supplierPartyTypeCode; //集装箱(器)尺寸和类型 | ||
20 | + | ||
21 | + public String getEquipmentIdentification() { | ||
22 | + return equipmentIdentification; | ||
23 | + } | ||
24 | + | ||
25 | + public void setEquipmentIdentification(String equipmentIdentification) { | ||
26 | + this.equipmentIdentification = equipmentIdentification; | ||
27 | + } | ||
28 | + | ||
29 | + public String getCharacteristicCode() { | ||
30 | + return characteristicCode; | ||
31 | + } | ||
32 | + | ||
33 | + public void setCharacteristicCode(String characteristicCode) { | ||
34 | + this.characteristicCode = characteristicCode; | ||
35 | + } | ||
36 | +} |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.tianbo.mapper.LostMapper"> | ||
4 | + | ||
5 | + <sql id="lostColumns"> | ||
6 | + a.id AS "id", | ||
7 | + a.createdate AS "createdate", | ||
8 | + a.flightno AS "flightno", | ||
9 | + a.flightdate AS "flightdate", | ||
10 | + a.waybillnomaster AS "waybillnomaster", | ||
11 | + a.waybillnosecondary AS "waybillnosecondary", | ||
12 | + a.remark AS "remark", | ||
13 | + a.status AS "status", | ||
14 | + a.receiption AS "receiption", | ||
15 | + a.createdate AS "createdate" | ||
16 | + </sql> | ||
17 | + | ||
18 | + <sql id="lostJoins"> | ||
19 | + </sql> | ||
20 | + | ||
21 | + <select id="get" resultType="com.tianbo.model.ManifestLoad"> | ||
22 | + SELECT | ||
23 | + <include refid="lostColumns"/> | ||
24 | + FROM MANIFESTLOAD a | ||
25 | + <include refid="lostJoins"/> | ||
26 | + WHERE a.id = #{id} | ||
27 | + </select> | ||
28 | + | ||
29 | + <select id="getCount" parameterType="com.tianbo.model.ManifestLoad" resultType="java.lang.Integer" > | ||
30 | + select count(*) from MANIFESTLOAD | ||
31 | + WHERE 1=1 | ||
32 | + <if test="flightno != null and flightno != ''"> | ||
33 | + AND flightno like CONCAT(CONCAT('%',#{flightno}),'%') | ||
34 | + </if> | ||
35 | + </select> | ||
36 | + | ||
37 | + <select id="getList" resultType="com.tianbo.model.ManifestLoad"> | ||
38 | + SELECT | ||
39 | + T2.* | ||
40 | + FROM | ||
41 | + ( SELECT ROWNUM RN, T.* FROM ( SELECT * FROM ( SELECT * FROM MANIFESTLOAD ) ORDER BY createdate DESC ) T ) T2 | ||
42 | + WHERE | ||
43 | + RN BETWEEN #{start} AND #{end} | ||
44 | + </select> | ||
45 | + | ||
46 | + <select id="selectByFlightno" resultType="com.tianbo.model.ManifestLoad"> | ||
47 | + SELECT | ||
48 | + T2.* | ||
49 | + FROM | ||
50 | + ( SELECT ROWNUM RN, T.* FROM ( | ||
51 | + SELECT * FROM ( | ||
52 | + SELECT * FROM MANIFESTLOAD | ||
53 | + <if test="flightno != null and flightno != ''"> | ||
54 | + WHERE flightno like CONCAT(CONCAT('%',#{flightno}),'%') | ||
55 | + </if> | ||
56 | + ) ORDER BY createdate DESC ) T ) T2 | ||
57 | + WHERE | ||
58 | + RN BETWEEN #{start} AND #{end} | ||
59 | + </select> | ||
60 | + | ||
61 | + <select id="selectByParam" resultType="com.tianbo.model.ManifestLoad"> | ||
62 | + SELECT | ||
63 | + T2.* | ||
64 | + FROM | ||
65 | + ( SELECT ROWNUM RN, T.* FROM ( | ||
66 | + SELECT * FROM ( | ||
67 | + SELECT * FROM MANIFESTLOAD | ||
68 | + WHERE 1=1 | ||
69 | + <if test="flightno != null and flightno != ''"> | ||
70 | + AND flightno like CONCAT(CONCAT('%',#{flightno}),'%') | ||
71 | + </if> | ||
72 | + <if test="flightdate != null and flightdate != ''"> | ||
73 | + AND flightdate = "TO_DATE" ( #{flightdate}, 'yyyy-mm-dd' ) | ||
74 | + </if> | ||
75 | + <if test="waybillnomaster != null and waybillnomaster != ''"> | ||
76 | + AND waybillnomaster like CONCAT(CONCAT('%',#{waybillnomaster}),'%') | ||
77 | + </if> | ||
78 | + <if test="waybillnosecondary != null and waybillnosecondary != ''"> | ||
79 | + AND waybillnosecondary like CONCAT(CONCAT('%',#{waybillnosecondary}),'%') | ||
80 | + </if> | ||
81 | + ) ORDER BY createdate DESC ) T ) T2 | ||
82 | + WHERE | ||
83 | + RN BETWEEN #{start} AND #{end} | ||
84 | + </select> | ||
85 | + | ||
86 | + <insert id="insert" parameterType="com.tianbo.model.ManifestLoad"> | ||
87 | + INSERT INTO MANIFESTLOAD( | ||
88 | + id, | ||
89 | + createdate, | ||
90 | + flightno, | ||
91 | + flightdate, | ||
92 | + waybillnomaster, | ||
93 | + waybillnosecondary, | ||
94 | + remark, | ||
95 | + status, | ||
96 | + receiption | ||
97 | + ) VALUES ( | ||
98 | + #{id,jdbcType=VARCHAR}, | ||
99 | + #{createdate,jdbcType=DATE}, | ||
100 | + #{flightno,jdbcType=VARCHAR}, | ||
101 | + #{flightdate,jdbcType=DATE}, | ||
102 | + #{waybillnomaster,jdbcType=VARCHAR}, | ||
103 | + #{waybillnosecondary,jdbcType=VARCHAR}, | ||
104 | + #{remark,jdbcType=VARCHAR}, | ||
105 | + #{status,jdbcType=VARCHAR}, | ||
106 | + #{receiption,jdbcType=VARCHAR} | ||
107 | + ) | ||
108 | + </insert> | ||
109 | + | ||
110 | + <update id="update" parameterType="com.tianbo.model.ManifestLoad"> | ||
111 | + UPDATE MANIFESTLOAD | ||
112 | + SET | ||
113 | + flightno=#{flightno,jdbcType=VARCHAR}, | ||
114 | + flightdate=#{flightdate,jdbcType=DATE}, | ||
115 | + waybillnomaster=#{waybillnomaster,jdbcType=VARCHAR}, | ||
116 | + waybillnosecondary=#{waybillnosecondary,jdbcType=VARCHAR}, | ||
117 | + status=#{status,jdbcType=VARCHAR}, | ||
118 | + remark=#{remark,jdbcType=VARCHAR}, | ||
119 | + receiption=#{receiption,jdbcType=VARCHAR}, | ||
120 | + createdate=#{createdate,jdbcType=DATE} | ||
121 | + WHERE id = #{id} | ||
122 | + </update> | ||
123 | + | ||
124 | + <update id="del"> | ||
125 | + DELETE FROM MANIFESTLOAD | ||
126 | + WHERE id = #{id} | ||
127 | + </update> | ||
128 | + | ||
129 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
3 | +<mapper namespace="com.tianbo.mapper.ManifestItemMapper" > | ||
4 | + <resultMap id="BaseResultMap" type="com.tianbo.model.ManifestItem" > | ||
5 | + <id column="ID" property="id" jdbcType="VARCHAR" /> | ||
6 | + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" /> | ||
7 | + <result column="PIECE" property="piece" jdbcType="VARCHAR" /> | ||
8 | + <result column="PACKAGE_CODE" property="packageCode" jdbcType="VARCHAR" /> | ||
9 | + <result column="SHIPPING_MARKS" property="shippingMarks" jdbcType="VARCHAR" /> | ||
10 | + <result column="DANGEROUS_CODE" property="dangerousCode" jdbcType="VARCHAR" /> | ||
11 | + <result column="CONTAINER_NUMBER" property="containerNumber" jdbcType="VARCHAR" /> | ||
12 | + <result column="CUSTOM_PROCEDURE_CODE" property="customProcedureCode" jdbcType="VARCHAR" /> | ||
13 | + <result column="CUSTOM_TARIFF_CODE " property="customTariffCode" jdbcType="VARCHAR" /> | ||
14 | + <result column="CONSIGN_CODE" property="consignCode" jdbcType="VARCHAR" /> | ||
15 | + <result column="ORIGINAL_CODE" property="originalCode" jdbcType="VARCHAR" /> | ||
16 | + <result column="DESCRIPTION" property="description" jdbcType="VARCHAR" /> | ||
17 | + <result column="REMARK" property="remark" jdbcType="VARCHAR" /> | ||
18 | + <result column="WEIGHT" property="weight" jdbcType="VARCHAR" /> | ||
19 | + <result column="ORDER_NUMBER" property="orderNumber" jdbcType="VARCHAR" /> | ||
20 | + </resultMap> | ||
21 | + <sql id="Base_Column_List" > | ||
22 | + ID, WAYBILLNOMASTER, PIECE, PACKAGE_CODE, SHIPPING_MARKS, DANGEROUS_CODE, CONTAINER_NUMBER, | ||
23 | + CUSTOM_PROCEDURE_CODE, "CUSTOM_TARIFF_CODE ", CONSIGN_CODE, ORIGINAL_CODE, DESCRIPTION, | ||
24 | + REMARK, WEIGHT, ORDER_NUMBER | ||
25 | + </sql> | ||
26 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > | ||
27 | + select | ||
28 | + <include refid="Base_Column_List" /> | ||
29 | + from MANIFESTITEM | ||
30 | + where ID = #{id,jdbcType=VARCHAR} | ||
31 | + </select> | ||
32 | + | ||
33 | + <select id="getIteamList" resultMap="BaseResultMap" parameterType="java.lang.String" > | ||
34 | + select | ||
35 | + * | ||
36 | + from MANIFESTITEM | ||
37 | + where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR} ORDER BY ABS(ORDER_NUMBER) | ||
38 | + </select> | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > | ||
43 | + delete from MANIFESTITEM | ||
44 | + where ID = #{id,jdbcType=VARCHAR} | ||
45 | + </delete> | ||
46 | + <insert id="insert" parameterType="com.tianbo.model.ManifestItem" > | ||
47 | + insert into MANIFESTITEM (ID, WAYBILLNOMASTER, PIECE, | ||
48 | + PACKAGE_CODE, SHIPPING_MARKS, DANGEROUS_CODE, | ||
49 | + CONTAINER_NUMBER, CUSTOM_PROCEDURE_CODE, "CUSTOM_TARIFF_CODE ", | ||
50 | + CONSIGN_CODE, ORIGINAL_CODE, DESCRIPTION, | ||
51 | + REMARK, WEIGHT, ORDER_NUMBER | ||
52 | + ) | ||
53 | + values (#{id,jdbcType=VARCHAR}, #{waybillnomaster,jdbcType=VARCHAR}, #{piece,jdbcType=VARCHAR}, | ||
54 | + #{packageCode,jdbcType=VARCHAR}, #{shippingMarks,jdbcType=VARCHAR}, #{dangerousCode,jdbcType=VARCHAR}, | ||
55 | + #{containerNumber,jdbcType=VARCHAR}, #{customProcedureCode,jdbcType=VARCHAR}, #{customTariffCode,jdbcType=VARCHAR}, | ||
56 | + #{consignCode,jdbcType=VARCHAR}, #{originalCode,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, | ||
57 | + #{remark,jdbcType=VARCHAR}, #{weight,jdbcType=VARCHAR}, #{orderNumber,jdbcType=VARCHAR} | ||
58 | + ) | ||
59 | + </insert> | ||
60 | + <insert id="insertSelective" parameterType="com.tianbo.model.ManifestItem" > | ||
61 | + insert into MANIFESTITEM | ||
62 | + <trim prefix="(" suffix=")" suffixOverrides="," > | ||
63 | + <if test="id != null" > | ||
64 | + ID, | ||
65 | + </if> | ||
66 | + <if test="waybillnomaster != null" > | ||
67 | + WAYBILLNOMASTER, | ||
68 | + </if> | ||
69 | + <if test="piece != null" > | ||
70 | + PIECE, | ||
71 | + </if> | ||
72 | + <if test="packageCode != null" > | ||
73 | + PACKAGE_CODE, | ||
74 | + </if> | ||
75 | + <if test="shippingMarks != null" > | ||
76 | + SHIPPING_MARKS, | ||
77 | + </if> | ||
78 | + <if test="dangerousCode != null" > | ||
79 | + DANGEROUS_CODE, | ||
80 | + </if> | ||
81 | + <if test="containerNumber != null" > | ||
82 | + CONTAINER_NUMBER, | ||
83 | + </if> | ||
84 | + <if test="customProcedureCode != null" > | ||
85 | + CUSTOM_PROCEDURE_CODE, | ||
86 | + </if> | ||
87 | + <if test="customTariffCode != null" > | ||
88 | + "CUSTOM_TARIFF_CODE ", | ||
89 | + </if> | ||
90 | + <if test="consignCode != null" > | ||
91 | + CONSIGN_CODE, | ||
92 | + </if> | ||
93 | + <if test="originalCode != null" > | ||
94 | + ORIGINAL_CODE, | ||
95 | + </if> | ||
96 | + <if test="description != null" > | ||
97 | + DESCRIPTION, | ||
98 | + </if> | ||
99 | + <if test="remark != null" > | ||
100 | + REMARK, | ||
101 | + </if> | ||
102 | + <if test="weight != null" > | ||
103 | + WEIGHT, | ||
104 | + </if> | ||
105 | + <if test="orderNumber != null" > | ||
106 | + ORDER_NUMBER, | ||
107 | + </if> | ||
108 | + </trim> | ||
109 | + <trim prefix="values (" suffix=")" suffixOverrides="," > | ||
110 | + <if test="id != null" > | ||
111 | + #{id,jdbcType=VARCHAR}, | ||
112 | + </if> | ||
113 | + <if test="waybillnomaster != null" > | ||
114 | + #{waybillnomaster,jdbcType=VARCHAR}, | ||
115 | + </if> | ||
116 | + <if test="piece != null" > | ||
117 | + #{piece,jdbcType=VARCHAR}, | ||
118 | + </if> | ||
119 | + <if test="packageCode != null" > | ||
120 | + #{packageCode,jdbcType=VARCHAR}, | ||
121 | + </if> | ||
122 | + <if test="shippingMarks != null" > | ||
123 | + #{shippingMarks,jdbcType=VARCHAR}, | ||
124 | + </if> | ||
125 | + <if test="dangerousCode != null" > | ||
126 | + #{dangerousCode,jdbcType=VARCHAR}, | ||
127 | + </if> | ||
128 | + <if test="containerNumber != null" > | ||
129 | + #{containerNumber,jdbcType=VARCHAR}, | ||
130 | + </if> | ||
131 | + <if test="customProcedureCode != null" > | ||
132 | + #{customProcedureCode,jdbcType=VARCHAR}, | ||
133 | + </if> | ||
134 | + <if test="customTariffCode != null" > | ||
135 | + #{customTariffCode,jdbcType=VARCHAR}, | ||
136 | + </if> | ||
137 | + <if test="consignCode != null" > | ||
138 | + #{consignCode,jdbcType=VARCHAR}, | ||
139 | + </if> | ||
140 | + <if test="originalCode != null" > | ||
141 | + #{originalCode,jdbcType=VARCHAR}, | ||
142 | + </if> | ||
143 | + <if test="description != null" > | ||
144 | + #{description,jdbcType=VARCHAR}, | ||
145 | + </if> | ||
146 | + <if test="remark != null" > | ||
147 | + #{remark,jdbcType=VARCHAR}, | ||
148 | + </if> | ||
149 | + <if test="weight != null" > | ||
150 | + #{weight,jdbcType=VARCHAR}, | ||
151 | + </if> | ||
152 | + <if test="orderNumber != null" > | ||
153 | + #{orderNumber,jdbcType=VARCHAR}, | ||
154 | + </if> | ||
155 | + </trim> | ||
156 | + </insert> | ||
157 | + <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.model.ManifestItem" > | ||
158 | + update MANIFESTITEM | ||
159 | + <set > | ||
160 | + <if test="waybillnomaster != null" > | ||
161 | + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}, | ||
162 | + </if> | ||
163 | + <if test="piece != null" > | ||
164 | + PIECE = #{piece,jdbcType=VARCHAR}, | ||
165 | + </if> | ||
166 | + <if test="packageCode != null" > | ||
167 | + PACKAGE_CODE = #{packageCode,jdbcType=VARCHAR}, | ||
168 | + </if> | ||
169 | + <if test="shippingMarks != null" > | ||
170 | + SHIPPING_MARKS = #{shippingMarks,jdbcType=VARCHAR}, | ||
171 | + </if> | ||
172 | + <if test="dangerousCode != null" > | ||
173 | + DANGEROUS_CODE = #{dangerousCode,jdbcType=VARCHAR}, | ||
174 | + </if> | ||
175 | + <if test="containerNumber != null" > | ||
176 | + CONTAINER_NUMBER = #{containerNumber,jdbcType=VARCHAR}, | ||
177 | + </if> | ||
178 | + <if test="customProcedureCode != null" > | ||
179 | + CUSTOM_PROCEDURE_CODE = #{customProcedureCode,jdbcType=VARCHAR}, | ||
180 | + </if> | ||
181 | + <if test="customTariffCode != null" > | ||
182 | + "CUSTOM_TARIFF_CODE " = #{customTariffCode,jdbcType=VARCHAR}, | ||
183 | + </if> | ||
184 | + <if test="consignCode != null" > | ||
185 | + CONSIGN_CODE = #{consignCode,jdbcType=VARCHAR}, | ||
186 | + </if> | ||
187 | + <if test="originalCode != null" > | ||
188 | + ORIGINAL_CODE = #{originalCode,jdbcType=VARCHAR}, | ||
189 | + </if> | ||
190 | + <if test="description != null" > | ||
191 | + DESCRIPTION = #{description,jdbcType=VARCHAR}, | ||
192 | + </if> | ||
193 | + <if test="remark != null" > | ||
194 | + REMARK = #{remark,jdbcType=VARCHAR}, | ||
195 | + </if> | ||
196 | + <if test="weight != null" > | ||
197 | + WEIGHT = #{weight,jdbcType=VARCHAR}, | ||
198 | + </if> | ||
199 | + <if test="orderNumber != null" > | ||
200 | + ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR}, | ||
201 | + </if> | ||
202 | + </set> | ||
203 | + where ID = #{id,jdbcType=VARCHAR} | ||
204 | + </update> | ||
205 | + <update id="updateByPrimaryKey" parameterType="com.tianbo.model.ManifestItem" > | ||
206 | + update MANIFESTITEM | ||
207 | + set WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}, | ||
208 | + PIECE = #{piece,jdbcType=VARCHAR}, | ||
209 | + PACKAGE_CODE = #{packageCode,jdbcType=VARCHAR}, | ||
210 | + SHIPPING_MARKS = #{shippingMarks,jdbcType=VARCHAR}, | ||
211 | + DANGEROUS_CODE = #{dangerousCode,jdbcType=VARCHAR}, | ||
212 | + CONTAINER_NUMBER = #{containerNumber,jdbcType=VARCHAR}, | ||
213 | + CUSTOM_PROCEDURE_CODE = #{customProcedureCode,jdbcType=VARCHAR}, | ||
214 | + "CUSTOM_TARIFF_CODE " = #{customTariffCode,jdbcType=VARCHAR}, | ||
215 | + CONSIGN_CODE = #{consignCode,jdbcType=VARCHAR}, | ||
216 | + ORIGINAL_CODE = #{originalCode,jdbcType=VARCHAR}, | ||
217 | + DESCRIPTION = #{description,jdbcType=VARCHAR}, | ||
218 | + REMARK = #{remark,jdbcType=VARCHAR}, | ||
219 | + WEIGHT = #{weight,jdbcType=VARCHAR}, | ||
220 | + ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR} | ||
221 | + where ID = #{id,jdbcType=VARCHAR} | ||
222 | + </update> | ||
223 | +</mapper> |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | ||
3 | +<mapper namespace="com.tianbo.mapper.ManifestLostChangeMapper" > | ||
4 | + <resultMap id="BaseResultMap" type="com.tianbo.model.ManifestLostChange" > | ||
5 | + <id column="ID" property="id" jdbcType="VARCHAR" /> | ||
6 | + <result column="FLIGHTNO" property="flightno" jdbcType="VARCHAR" /> | ||
7 | + <result column="FLIGHTDATE" property="flightdate" jdbcType="DATE" /> | ||
8 | + <result column="WAYBILLNOMASTER" property="waybillnomaster" jdbcType="VARCHAR" /> | ||
9 | + <result column="WAYBILLNOSECONDARY" property="waybillnosecondary" jdbcType="VARCHAR" /> | ||
10 | + <result column="CWAYBILLNOMASTER" property="cwaybillnomaster" jdbcType="VARCHAR" /> | ||
11 | + <result column="CWAYBILLNOSECONDARY" property="cwaybillnosecondary" jdbcType="VARCHAR" /> | ||
12 | + <result column="CREATEDATE" property="createdate" jdbcType="DATE" /> | ||
13 | + <result column="STATUS" property="status" jdbcType="VARCHAR" /> | ||
14 | + <result column="RECEIPTION" property="receiption" jdbcType="VARCHAR" /> | ||
15 | + <result column="CFLIGHTNO" property="cflightno" jdbcType="VARCHAR" /> | ||
16 | + <result column="CFLIGHTDATE" property="cflightdate" jdbcType="DATE" /> | ||
17 | + </resultMap> | ||
18 | + <sql id="Base_Column_List" > | ||
19 | + ID, FLIGHTNO, FLIGHTDATE, WAYBILLNOMASTER, WAYBILLNOSECONDARY, CWAYBILLNOMASTER, | ||
20 | + CWAYBILLNOSECONDARY, CREATEDATE, STATUS, RECEIPTION, CFLIGHTNO, CFLIGHTDATE | ||
21 | + </sql> | ||
22 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > | ||
23 | + select | ||
24 | + <include refid="Base_Column_List" /> | ||
25 | + from MANIFESTLOSTCHANGE | ||
26 | + where ID = #{id,jdbcType=VARCHAR} | ||
27 | + </select> | ||
28 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.String" > | ||
29 | + delete from MANIFESTLOSTCHANGE | ||
30 | + where ID = #{id,jdbcType=VARCHAR} | ||
31 | + </delete> | ||
32 | + <insert id="insert" parameterType="com.tianbo.model.ManifestLostChange" > | ||
33 | + insert into MANIFESTLOSTCHANGE (ID, FLIGHTNO, FLIGHTDATE, | ||
34 | + WAYBILLNOMASTER, WAYBILLNOSECONDARY, CWAYBILLNOMASTER, | ||
35 | + CWAYBILLNOSECONDARY, CREATEDATE, STATUS, | ||
36 | + RECEIPTION, CFLIGHTNO, CFLIGHTDATE | ||
37 | + ) | ||
38 | + values (#{id,jdbcType=VARCHAR}, #{flightno,jdbcType=VARCHAR}, #{flightdate,jdbcType=DATE}, | ||
39 | + #{waybillnomaster,jdbcType=VARCHAR}, #{waybillnosecondary,jdbcType=VARCHAR}, #{cwaybillnomaster,jdbcType=VARCHAR}, | ||
40 | + #{cwaybillnosecondary,jdbcType=VARCHAR}, #{createdate,jdbcType=DATE}, #{status,jdbcType=VARCHAR}, | ||
41 | + #{receiption,jdbcType=VARCHAR}, #{cflightno,jdbcType=VARCHAR}, #{cflightdate,jdbcType=DATE} | ||
42 | + ) | ||
43 | + </insert> | ||
44 | + <insert id="insertSelective" parameterType="com.tianbo.model.ManifestLostChange" > | ||
45 | + insert into MANIFESTLOSTCHANGE | ||
46 | + <trim prefix="(" suffix=")" suffixOverrides="," > | ||
47 | + <if test="id != null" > | ||
48 | + ID, | ||
49 | + </if> | ||
50 | + <if test="flightno != null" > | ||
51 | + FLIGHTNO, | ||
52 | + </if> | ||
53 | + <if test="flightdate != null" > | ||
54 | + FLIGHTDATE, | ||
55 | + </if> | ||
56 | + <if test="waybillnomaster != null" > | ||
57 | + WAYBILLNOMASTER, | ||
58 | + </if> | ||
59 | + <if test="waybillnosecondary != null" > | ||
60 | + WAYBILLNOSECONDARY, | ||
61 | + </if> | ||
62 | + <if test="cwaybillnomaster != null" > | ||
63 | + CWAYBILLNOMASTER, | ||
64 | + </if> | ||
65 | + <if test="cwaybillnosecondary != null" > | ||
66 | + CWAYBILLNOSECONDARY, | ||
67 | + </if> | ||
68 | + <if test="createdate != null" > | ||
69 | + CREATEDATE, | ||
70 | + </if> | ||
71 | + <if test="status != null" > | ||
72 | + STATUS, | ||
73 | + </if> | ||
74 | + <if test="receiption != null" > | ||
75 | + RECEIPTION, | ||
76 | + </if> | ||
77 | + <if test="cflightno != null" > | ||
78 | + CFLIGHTNO, | ||
79 | + </if> | ||
80 | + <if test="cflightdate != null" > | ||
81 | + CFLIGHTDATE, | ||
82 | + </if> | ||
83 | + </trim> | ||
84 | + <trim prefix="values (" suffix=")" suffixOverrides="," > | ||
85 | + <if test="id != null" > | ||
86 | + #{id,jdbcType=VARCHAR}, | ||
87 | + </if> | ||
88 | + <if test="flightno != null" > | ||
89 | + #{flightno,jdbcType=VARCHAR}, | ||
90 | + </if> | ||
91 | + <if test="flightdate != null" > | ||
92 | + #{flightdate,jdbcType=DATE}, | ||
93 | + </if> | ||
94 | + <if test="waybillnomaster != null" > | ||
95 | + #{waybillnomaster,jdbcType=VARCHAR}, | ||
96 | + </if> | ||
97 | + <if test="waybillnosecondary != null" > | ||
98 | + #{waybillnosecondary,jdbcType=VARCHAR}, | ||
99 | + </if> | ||
100 | + <if test="cwaybillnomaster != null" > | ||
101 | + #{cwaybillnomaster,jdbcType=VARCHAR}, | ||
102 | + </if> | ||
103 | + <if test="cwaybillnosecondary != null" > | ||
104 | + #{cwaybillnosecondary,jdbcType=VARCHAR}, | ||
105 | + </if> | ||
106 | + <if test="createdate != null" > | ||
107 | + #{createdate,jdbcType=DATE}, | ||
108 | + </if> | ||
109 | + <if test="status != null" > | ||
110 | + #{status,jdbcType=VARCHAR}, | ||
111 | + </if> | ||
112 | + <if test="receiption != null" > | ||
113 | + #{receiption,jdbcType=VARCHAR}, | ||
114 | + </if> | ||
115 | + <if test="cflightno != null" > | ||
116 | + #{cflightno,jdbcType=VARCHAR}, | ||
117 | + </if> | ||
118 | + <if test="cflightdate != null" > | ||
119 | + #{cflightdate,jdbcType=DATE}, | ||
120 | + </if> | ||
121 | + </trim> | ||
122 | + </insert> | ||
123 | + <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.model.ManifestLostChange" > | ||
124 | + update MANIFESTLOSTCHANGE | ||
125 | + <set > | ||
126 | + <if test="flightno != null" > | ||
127 | + FLIGHTNO = #{flightno,jdbcType=VARCHAR}, | ||
128 | + </if> | ||
129 | + <if test="flightdate != null" > | ||
130 | + FLIGHTDATE = #{flightdate,jdbcType=DATE}, | ||
131 | + </if> | ||
132 | + <if test="waybillnomaster != null" > | ||
133 | + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}, | ||
134 | + </if> | ||
135 | + <if test="waybillnosecondary != null" > | ||
136 | + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}, | ||
137 | + </if> | ||
138 | + <if test="cwaybillnomaster != null" > | ||
139 | + CWAYBILLNOMASTER = #{cwaybillnomaster,jdbcType=VARCHAR}, | ||
140 | + </if> | ||
141 | + <if test="cwaybillnosecondary != null" > | ||
142 | + CWAYBILLNOSECONDARY = #{cwaybillnosecondary,jdbcType=VARCHAR}, | ||
143 | + </if> | ||
144 | + <if test="createdate != null" > | ||
145 | + CREATEDATE = #{createdate,jdbcType=DATE}, | ||
146 | + </if> | ||
147 | + <if test="status != null" > | ||
148 | + STATUS = #{status,jdbcType=VARCHAR}, | ||
149 | + </if> | ||
150 | + <if test="receiption != null" > | ||
151 | + RECEIPTION = #{receiption,jdbcType=VARCHAR}, | ||
152 | + </if> | ||
153 | + <if test="cflightno != null" > | ||
154 | + CFLIGHTNO = #{cflightno,jdbcType=VARCHAR}, | ||
155 | + </if> | ||
156 | + <if test="cflightdate != null" > | ||
157 | + CFLIGHTDATE = #{cflightdate,jdbcType=DATE}, | ||
158 | + </if> | ||
159 | + </set> | ||
160 | + where ID = #{id,jdbcType=VARCHAR} | ||
161 | + </update> | ||
162 | + <update id="updateByPrimaryKey" parameterType="com.tianbo.model.ManifestLostChange" > | ||
163 | + update MANIFESTLOSTCHANGE | ||
164 | + set FLIGHTNO = #{flightno,jdbcType=VARCHAR}, | ||
165 | + FLIGHTDATE = #{flightdate,jdbcType=DATE}, | ||
166 | + WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}, | ||
167 | + WAYBILLNOSECONDARY = #{waybillnosecondary,jdbcType=VARCHAR}, | ||
168 | + CWAYBILLNOMASTER = #{cwaybillnomaster,jdbcType=VARCHAR}, | ||
169 | + CWAYBILLNOSECONDARY = #{cwaybillnosecondary,jdbcType=VARCHAR}, | ||
170 | + CREATEDATE = #{createdate,jdbcType=DATE}, | ||
171 | + STATUS = #{status,jdbcType=VARCHAR}, | ||
172 | + RECEIPTION = #{receiption,jdbcType=VARCHAR}, | ||
173 | + CFLIGHTNO = #{cflightno,jdbcType=VARCHAR}, | ||
174 | + CFLIGHTDATE = #{cflightdate,jdbcType=DATE} | ||
175 | + where ID = #{id,jdbcType=VARCHAR} | ||
176 | + </update> | ||
177 | + | ||
178 | + | ||
179 | + <select id="getList" resultType="com.tianbo.model.ManifestLostChange"> | ||
180 | + SELECT | ||
181 | + T2.* | ||
182 | + FROM | ||
183 | + ( SELECT ROWNUM RN, T.* FROM ( SELECT * FROM ( SELECT * FROM MANIFESTLOSTCHANGE ) ORDER BY createdate DESC ) T ) T2 | ||
184 | + WHERE | ||
185 | + RN BETWEEN #{start} AND #{end} | ||
186 | + </select> | ||
187 | + | ||
188 | + <select id="getCount" parameterType="com.tianbo.model.ManifestLostChange" resultType="java.lang.Integer" > | ||
189 | + select count(*) from MANIFESTLOSTCHANGE | ||
190 | + WHERE 1=1 | ||
191 | + <if test="flightno != null and flightno != ''"> | ||
192 | + AND flightno like CONCAT(CONCAT('%',#{flightno}),'%') | ||
193 | + </if> | ||
194 | + </select> | ||
195 | + | ||
196 | + <select id="selectByParam" resultType="com.tianbo.model.ManifestLostChange"> | ||
197 | + SELECT | ||
198 | + T2.* | ||
199 | + FROM | ||
200 | + ( SELECT ROWNUM RN, T.* FROM ( | ||
201 | + SELECT * FROM ( | ||
202 | + SELECT * FROM MANIFESTLOSTCHANGE | ||
203 | + WHERE 1=1 | ||
204 | + <if test="flightno != null and flightno != ''"> | ||
205 | + AND flightno like CONCAT(CONCAT('%',#{flightno}),'%') | ||
206 | + </if> | ||
207 | + <if test="flightdate != null and flightdate != ''"> | ||
208 | + AND flightdate = "TO_DATE" ( #{flightdate}, 'yyyy-mm-dd' ) | ||
209 | + </if> | ||
210 | + <if test="waybillnomaster != null and waybillnomaster != ''"> | ||
211 | + AND waybillnomaster like CONCAT(CONCAT('%',#{waybillnomaster}),'%') | ||
212 | + </if> | ||
213 | + <if test="waybillnosecondary != null and waybillnosecondary != ''"> | ||
214 | + AND waybillnosecondary like CONCAT(CONCAT('%',#{waybillnosecondary}),'%') | ||
215 | + </if> | ||
216 | + ) ORDER BY createdate DESC ) T ) T2 | ||
217 | + WHERE | ||
218 | + RN BETWEEN #{start} AND #{end} | ||
219 | + </select> | ||
220 | +</mapper> |
@@ -8,6 +8,8 @@ | @@ -8,6 +8,8 @@ | ||
8 | #########################MYSQL################################################ | 8 | #########################MYSQL################################################ |
9 | jdbc.driver = oracle.jdbc.driver.OracleDriver | 9 | jdbc.driver = oracle.jdbc.driver.OracleDriver |
10 | #jdbc.url = jdbc:oracle:thin:@192.168.0.253:1522:CGODW | 10 | #jdbc.url = jdbc:oracle:thin:@192.168.0.253:1522:CGODW |
11 | -jdbc.url = jdbc:oracle:thin:@10.50.3.69:1521:CGODB | 11 | +#jdbc.url = jdbc:oracle:thin:@10.50.3.69:1521:CGODB |
12 | +jdbc.url = jdbc:oracle:thin:@218.28.199.134:8004:CGODB | ||
13 | +#jdbc.url = jdbc:oracle:thin:@10.50.3.70:1521:CGODB | ||
12 | jdbc.username = CGONMS | 14 | jdbc.username = CGONMS |
13 | jdbc.password = 1q2w3e4r | 15 | jdbc.password = 1q2w3e4r |
@@ -11,6 +11,9 @@ | @@ -11,6 +11,9 @@ | ||
11 | <!--自动扫描控制器--> | 11 | <!--自动扫描控制器--> |
12 | <context:component-scan base-package="com.tianbo.controller" /> | 12 | <context:component-scan base-package="com.tianbo.controller" /> |
13 | 13 | ||
14 | + <mvc:annotation-driven enable-matrix-variables="true"></mvc:annotation-driven> | ||
15 | + <mvc:default-servlet-handler/> | ||
16 | + | ||
14 | <!--视图渲染--> | 17 | <!--视图渲染--> |
15 | <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> | 18 | <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> |
16 | <property name="prefix" value="/WEB-INF/views/"/> | 19 | <property name="prefix" value="/WEB-INF/views/"/> |
1 | 1 | ||
2 | path1=D:/1test | 2 | path1=D:/1test |
3 | -targetPath=E:/2test/ | 3 | +targetPath= |
4 | #path1=//10.50.3.61/nms_customs_xml1 | 4 | #path1=//10.50.3.61/nms_customs_xml1 |
5 | #path2=//10.50.3.61/nms_customs_xml_SDM | 5 | #path2=//10.50.3.61/nms_customs_xml_SDM |
6 | #path3=//10.50.3.61/nms_customs_xml3 | 6 | #path3=//10.50.3.61/nms_customs_xml3 |
7 | #path=D:/1test | 7 | #path=D:/1test |
8 | -#targetPath=//10.50.3.61/nms_customs_xml/ | ||
8 | +#targetPath=//10.50.3.61/nms_customs_xml/ | ||
9 | +MT8202Path=E:/2test/ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | ||
3 | +<%@ page isELIgnored="false"%> | ||
4 | +<% | ||
5 | + String path = request.getContextPath(); | ||
6 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
7 | +%> | ||
8 | +<!doctype html> | ||
9 | +<html lang="zh"> | ||
10 | +<head> | ||
11 | + <meta charset="utf-8"> | ||
12 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
13 | + <title>落装改配修改</title> | ||
14 | + <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%> | ||
15 | + <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet"> | ||
16 | + <style type="text/css"> | ||
17 | + .layui-input-b1ock { | ||
18 | + margin-left: 25px; | ||
19 | + min-height: 36px; | ||
20 | + } | ||
21 | + </style> | ||
22 | + <script src="<%=basePath %>static/easyui/jquery.min.js"></script> | ||
23 | + <script src="<%=basePath %>static/layui2.4.5/layui.js"></script> | ||
24 | + <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script> | ||
25 | + <script> | ||
26 | + function child(d) { | ||
27 | + $("#id").val(d.id) | ||
28 | + $("#flightno").val(d.flightno); | ||
29 | + $("#cflightno").val(d.cflightno); | ||
30 | + $("#flightdate").val(d.flightdate.substring(0,10)); | ||
31 | + $("#cflightdate").val(d.cflightdate.substring(0,10)); | ||
32 | + $("#waybillnomaster").val(d.waybillnomaster); | ||
33 | + $("#cwaybillnomaster").val(d.cwaybillnomaster); | ||
34 | + $("#waybillnosecondary").val(d.waybillnosecondary); | ||
35 | + $("#cwaybillnosecondary").val(d.cwaybillnosecondary); | ||
36 | + } | ||
37 | + </script> | ||
38 | + <script> | ||
39 | + layui.use(['form','laydate'], function(){ | ||
40 | + var form = layui.form | ||
41 | + ,laydate = layui.laydate; | ||
42 | + //监听提交 | ||
43 | + form.on('submit(demo1)', function(data){ | ||
44 | + if(check()){ | ||
45 | + editForm(data.field); | ||
46 | + } | ||
47 | + return false; | ||
48 | + }); | ||
49 | + }); | ||
50 | + | ||
51 | + function editForm(data){ | ||
52 | + var billNo = $("#waybillnomaster").val(); | ||
53 | + data.waybillnomaster=billNo; | ||
54 | + $.ajax({ | ||
55 | + type : "post", | ||
56 | + url : "<%=basePath %>/lost/change/editForm", | ||
57 | + data : data, | ||
58 | + success: function(data){ | ||
59 | + if(data.success){ | ||
60 | + layer.alert( data.msg, function () { | ||
61 | + window.parent.location.reload(); //刷新父页面 | ||
62 | + parent.layer.close(index); //关闭当前弹窗 | ||
63 | + }); | ||
64 | + }else{ | ||
65 | + layer.alert( data.msg, function () { | ||
66 | + window.parent.location.reload(); //刷新父页面 | ||
67 | + parent.layer.close(index); //关闭当前弹窗 | ||
68 | + }); | ||
69 | + } | ||
70 | + }, | ||
71 | + error: function() { | ||
72 | + layer.alert("保存失败,请重试"); | ||
73 | + } | ||
74 | + }); | ||
75 | + } | ||
76 | + </script> | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | +</head > | ||
81 | + | ||
82 | +<body align="center"> | ||
83 | +<blockquote class="layui-elem-quote">原始信息</blockquote> | ||
84 | +<hr> | ||
85 | +<form class="layui-form" action="" lay-filter="example"> | ||
86 | +<input type="hidden" id="id" name="id" autocomplete="off" class="layui-input" > | ||
87 | + <div class="layui-form-item"> | ||
88 | + <div class="layui-inline"> | ||
89 | + <label class="layui-form-label">航班号</label> | ||
90 | + <div class="layui-input-inline"> | ||
91 | + <input type="text" id="flightno" placeholder="此项为必填项" style="text-transform:uppercase;" name="flightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> | ||
92 | + </div> | ||
93 | + </div> | ||
94 | + <div class="layui-inline"> | ||
95 | + <label class="layui-form-label">航班日期</label> | ||
96 | + <div class="layui-input-inline"> | ||
97 | + <input type="text" id="flightdate" placeholder="此项为必填项" name="flightdate" autocomplete="off" class="layui-input"> | ||
98 | + </div> | ||
99 | + </div> | ||
100 | + </div> | ||
101 | + <div class="layui-form-item"> | ||
102 | + <div class="layui-inline"> | ||
103 | + <label class="layui-form-label">主单号</label> | ||
104 | + <div class="layui-input-inline"> | ||
105 | + <input type="text" id="waybillnomaster" placeholder="此项为必填项" name="waybillnomaster" value="${waybillnomaster}" autocomplete="off" class="layui-input"> | ||
106 | + </div> | ||
107 | + </div> | ||
108 | + <div class="layui-inline"> | ||
109 | + <label class="layui-form-label">分单号</label> | ||
110 | + <div class="layui-input-inline"> | ||
111 | + <input type="text" id="waybillnosecondary" style="text-transform:uppercase;" name="waybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> | ||
112 | + </div> | ||
113 | + </div> | ||
114 | + </div> | ||
115 | + <blockquote class="layui-elem-quote">改配后信息</blockquote> | ||
116 | + <div class="layui-form-item"> | ||
117 | + <div class="layui-inline"> | ||
118 | + <label class="layui-form-label">航班号</label> | ||
119 | + <div class="layui-input-inline"> | ||
120 | + <input type="text" id="cflightno" style="text-transform:uppercase;" placeholder="此项为必填项" name="cflightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> | ||
121 | + </div> | ||
122 | + </div> | ||
123 | + <div class="layui-inline"> | ||
124 | + <label class="layui-form-label">航班日期</label> | ||
125 | + <div class="layui-input-inline"> | ||
126 | + <input type="text" id="cflightdate" placeholder="此项为必填项" name="cflightdate" autocomplete="off" class="layui-input"> | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + </div> | ||
130 | + <div class="layui-form-item"> | ||
131 | + <div class="layui-inline"> | ||
132 | + <label class="layui-form-label">主单号</label> | ||
133 | + <div class="layui-input-inline"> | ||
134 | + <input type="text" id="cwaybillnomaster" name="cwaybillnomaster" autocomplete="off" class="layui-input"> | ||
135 | + </div> | ||
136 | + </div> | ||
137 | + <div class="layui-inline"> | ||
138 | + <label class="layui-form-label">分单号</label> | ||
139 | + <div class="layui-input-inline"> | ||
140 | + <input type="text" id="cwaybillnosecondary" style="text-transform:uppercase;" name="cwaybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> | ||
141 | + </div> | ||
142 | + </div> | ||
143 | + </div> | ||
144 | + <blockquote class="layui-elem-quote">商品项信息 <a style="margin-left:450px" class="layui-btn layui-btn-xs" onclick="add()">新增</a></blockquote> | ||
145 | + | ||
146 | + <div class="layui-inline" > | ||
147 | + <table class="layui-hide" id="flightItem" lay-filter="flightItem" style="width:99%; text-align="center"></table> | ||
148 | + </div> | ||
149 | + <hr> | ||
150 | + <div class="layui-form-item" > | ||
151 | + <div class="layui-input-b1ock"> | ||
152 | + <button class="layui-btn" lay-submit="" lay-filter="demo1"> | ||
153 | + <c:if test="${empty ftId }">保存</c:if> | ||
154 | + <c:if test="${not empty ftId}">修改</c:if> | ||
155 | + </button> | ||
156 | + </div> | ||
157 | + </div> | ||
158 | +</form> | ||
159 | + <script type="text/javascript"> | ||
160 | + layui.use(['form', 'laydate'], function(){ | ||
161 | + var form = layui.form | ||
162 | + ,laydate = layui.laydate | ||
163 | + | ||
164 | + //日期 | ||
165 | + laydate.render({ | ||
166 | + elem: '#flightdate' | ||
167 | + }); | ||
168 | + laydate.render({ | ||
169 | + elem: '#cflightdate' | ||
170 | + }); | ||
171 | + }); | ||
172 | + | ||
173 | + function add(){ | ||
174 | + var waybillnomaster =$("#waybillnomaster").val(); | ||
175 | + parent.layer.open({ | ||
176 | + type: 2, | ||
177 | + title: "商品信息新增", | ||
178 | + shade: 0.8, | ||
179 | + id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748 | ||
180 | + moveType: 1, //拖拽模式,0或者1 | ||
181 | + type: 2, | ||
182 | + skin: 'layui-layer-rim', //加上边框 | ||
183 | + /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ | ||
184 | + area: ['700px', '386px'], | ||
185 | + maxmin: true, //开启最大化最小化按钮 | ||
186 | + content: "<%=basePath %>/lost/change/editItem?waybillnomaster="+waybillnomaster, | ||
187 | + zIndex: parent.layer.zIndex, | ||
188 | + success: function (layero, index) { | ||
189 | + // 获取子页面的iframe | ||
190 | + var frameId = $(layero).find("iframe").attr('id');//父页面获取子页面的iframe | ||
191 | + var iframe = parent.window['layui-layer-iframe' + index]; | ||
192 | + var iframeWin = parent.window[layero.find('iframe')[0]['name']]; | ||
193 | + parent.layer.setTop(layero); | ||
194 | + // 向子页面的全局函数child传参 | ||
195 | + //iframe.child(data); | ||
196 | + } | ||
197 | + ,end : function(){ | ||
198 | + layui.table.reload('flightItem') | ||
199 | + } | ||
200 | + }) | ||
201 | + } | ||
202 | + | ||
203 | + function check(){ | ||
204 | + var billNo = $("#waybillnomaster").val(); | ||
205 | + var cbillNo = $("#cwaybillnomaster").val(); | ||
206 | + var flightno = $("#flightno").val(); | ||
207 | + var cflightno = $("#cflightno").val(); | ||
208 | + var flightdate = $("#flightdate").val(); | ||
209 | + var cflightdate = $("#cflightdate").val(); | ||
210 | + var regs = /[a-z]/i; | ||
211 | + if(flightno==''){ | ||
212 | + $("#flightno").focus(); | ||
213 | + layer.tips('请输入航班号', '#flightno', { | ||
214 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
215 | + }); | ||
216 | + return false; | ||
217 | + }else if(flightdate==''){ | ||
218 | + $("#flightdate").focus(); | ||
219 | + layer.tips('请输入航班日期', '#flightdate', { | ||
220 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
221 | + }); | ||
222 | + return false; | ||
223 | + }else if(billNo==''){ | ||
224 | + $("#waybillnomaster").focus(); | ||
225 | + layer.tips('请输入主单号', '#waybillnomaster', { | ||
226 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
227 | + }); | ||
228 | + return false; | ||
229 | + }else if(billNo.indexOf("-") != -1){ | ||
230 | + billNo=billNo; | ||
231 | + if(billNo.length!=12){ | ||
232 | + $("#waybillnomaster").focus(); | ||
233 | + layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
234 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
235 | + }); | ||
236 | + return false; | ||
237 | + } | ||
238 | + }else if(regs.test(billNo)){ | ||
239 | + $("#waybillnomaster").focus(); | ||
240 | + layer.tips('主单号必须为数字', '#waybillnomaster', { | ||
241 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
242 | + }); | ||
243 | + return false; | ||
244 | + }else if(billNo.length!=11){ | ||
245 | + $("#waybillnomaster").focus(); | ||
246 | + layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
247 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
248 | + }); | ||
249 | + return false; | ||
250 | + }else if(cflightno==''){ | ||
251 | + $("#cflightno").focus(); | ||
252 | + layer.tips('请输入改配后航班号', '#cflightno', { | ||
253 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
254 | + }); | ||
255 | + return false; | ||
256 | + }else if(cflightdate==''){ | ||
257 | + $("#cflightdate").focus(); | ||
258 | + layer.tips('请输入改配后航班日期', '#cflightdate', { | ||
259 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
260 | + }); | ||
261 | + return false; | ||
262 | + }else if(regs.test(cbillNo)){ | ||
263 | + $("#cwaybillnomaster").focus(); | ||
264 | + layer.tips('主单号必须为数字', 'c#waybillnomaster', { | ||
265 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
266 | + }); | ||
267 | + return false; | ||
268 | + }else if(cbillNo==''){ | ||
269 | + return true; | ||
270 | + }else if(cbillNo.indexOf("-") != -1){ | ||
271 | + cbillNo=cbillNo; | ||
272 | + if(cbillNo.length!=12){ | ||
273 | + $("#cwaybillnomaster").focus(); | ||
274 | + layer.tips('主单号必须为11位', '#cwaybillnomaster', { | ||
275 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
276 | + }); | ||
277 | + return false; | ||
278 | + } | ||
279 | + }else if(cbillNo.length!=11){ | ||
280 | + $("#cwaybillnomaster").focus(); | ||
281 | + layer.tips('主单号必须为11位', '#cwaybillnomaster', { | ||
282 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
283 | + }); | ||
284 | + return false; | ||
285 | + }else { | ||
286 | + return true; | ||
287 | + } | ||
288 | + } | ||
289 | + | ||
290 | + | ||
291 | + layui.use('table', function(){ | ||
292 | + var table = layui.table; | ||
293 | + var waybillnomaster = $("#waybillnomaster").val(); | ||
294 | + table.render({ | ||
295 | + elem: '#flightItem' | ||
296 | + ,url:'<%=basePath %>/lost/change/getIteamList?waybillnomaster='+waybillnomaster | ||
297 | + /* ,toolbar: '#toolbar' */ | ||
298 | + ,page: false //开启分页 | ||
299 | + ,cols: [[ | ||
300 | + {field:'orderNumber', align:'center',title:'序号', width:130, sort: true} | ||
301 | + ,{field:'description', align:'center',title:'简要描述', width:150} | ||
302 | + ,{field:'piece', title:'件数',align:'center', width:130,} | ||
303 | + ,{field:'weight', title:'重量',align:'center', width:100,} | ||
304 | + ,{fixed: 'right', title:'操作',align:'center', toolbar: '#barDemo', width:135} | ||
305 | + ]] | ||
306 | + }) | ||
307 | + | ||
308 | + table.on('tool(flightItem)', function(obj){ | ||
309 | + var data = obj.data; | ||
310 | + console.log(obj) | ||
311 | + if(obj.event === 'edit'){ | ||
312 | + var data = obj.data; | ||
313 | + var id = data.id; | ||
314 | + parent.layer.open({ | ||
315 | + type: 2, | ||
316 | + title: "商品信息编辑", | ||
317 | + shade: 0.8, | ||
318 | + id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748 | ||
319 | + moveType: 1, //拖拽模式,0或者1 | ||
320 | + type: 2, | ||
321 | + skin: 'layui-layer-rim', //加上边框 | ||
322 | + /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ | ||
323 | + area: ['700px', '386px'], | ||
324 | + maxmin: true, //开启最大化最小化按钮 | ||
325 | + content: "<%=basePath %>/lost/change/editItem?id="+id, | ||
326 | + zIndex: parent.layer.zIndex, | ||
327 | + success: function (layero, index) { | ||
328 | + debugger; | ||
329 | + var layer = layui.layer; | ||
330 | + // 获取子页面的iframe | ||
331 | + var iframe = parent.window['layui-layer-iframe' + index]; | ||
332 | + parent.layer.setTop(layero); | ||
333 | + // 向子页面的全局函数child传参 | ||
334 | + iframe.child(data); | ||
335 | + } | ||
336 | + ,end : function(){ | ||
337 | + layui.table.reload('flightItem') | ||
338 | + } | ||
339 | + }) | ||
340 | + }else if(obj.event === 'del'){ | ||
341 | + var data = obj.data; | ||
342 | + var id = data.id; | ||
343 | + layer.confirm('您确定要删除吗', function(index){ | ||
344 | + $.ajax({ | ||
345 | + type : "post", | ||
346 | + url : "<%=basePath %>/lost/change/delItem?id="+id, | ||
347 | + data : data, | ||
348 | + success: function(data){ | ||
349 | + if(data.success){ | ||
350 | + layer.alert( data.msg, function (index) { | ||
351 | + layer.close(index); //关闭当前弹窗 | ||
352 | + layui.table.reload('flightItem') | ||
353 | + }); | ||
354 | + } | ||
355 | + }, | ||
356 | + error: function() { | ||
357 | + layer.alert("删除失败,请重试"); | ||
358 | + } | ||
359 | + }); | ||
360 | + }); | ||
361 | + } | ||
362 | + | ||
363 | + }) | ||
364 | + }) | ||
365 | + | ||
366 | + </script> | ||
367 | + <script type="text/html" id="barDemo"> | ||
368 | + <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> | ||
369 | + <a class="layui-btn layui-btn-xs" lay-event="del">删除</a> | ||
370 | + </script> | ||
371 | + </body > | ||
372 | +</html > |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | ||
3 | +<%@ page isELIgnored="false"%> | ||
4 | +<% | ||
5 | + String path = request.getContextPath(); | ||
6 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
7 | +%> | ||
8 | +<!doctype html> | ||
9 | +<html lang="zh"> | ||
10 | +<head> | ||
11 | + <meta charset="utf-8"> | ||
12 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
13 | + <title>商品项信息</title> | ||
14 | + <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%> | ||
15 | + <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet"> | ||
16 | + <style type="text/css"> | ||
17 | + .layui-input-block { | ||
18 | + width:100px; | ||
19 | + } | ||
20 | + .layui-elip, .layui-form-checkbox span, .layui-form-pane .layui-form-label{ | ||
21 | + text-overflow:inherit;!important | ||
22 | + } | ||
23 | + .layui-disabled{ | ||
24 | + background-color:rgb(235, 235, 228); | ||
25 | + } | ||
26 | + .layui-input1{ | ||
27 | + width:545px; | ||
28 | + height: 38px; | ||
29 | + line-height: 38px; | ||
30 | + border: 1px solid #e6e6e6; | ||
31 | + background-color: #fff; | ||
32 | + border-radius: 2px; | ||
33 | + box-sizing: border-box!important; | ||
34 | + } | ||
35 | + .left{ | ||
36 | + padding: 10px | ||
37 | + } | ||
38 | + </style> | ||
39 | + <script src="<%=basePath %>static/easyui/jquery.min.js"></script> | ||
40 | + <script src="<%=basePath %>static/layui2.4.5/layui.js"></script> | ||
41 | + <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script> | ||
42 | + <script> | ||
43 | + function child(d) { | ||
44 | + $("#orderNumber").val(d.orderNumber) | ||
45 | + $("#piece").val(d.piece); | ||
46 | + $("#packageCode").val(d.packageCode); | ||
47 | + $("#shippingMarks").val(d.shippingMarks); | ||
48 | + $("#containerNumber").val(d.containerNumber); | ||
49 | + $("#customProcedureCode").val(d.customProcedureCode); | ||
50 | + $("#customTariffCode").val(d.customTariffCode); | ||
51 | + $("#consignCode").val(d.consignCode); | ||
52 | + $("#originalCode").val(d.originalCode); | ||
53 | + $("#description").val(d.description); | ||
54 | + $("#remark").val(d.remark); | ||
55 | + $("#weight").val(d.weight); | ||
56 | + $("#id").val(d.id); | ||
57 | + $("#waybillnomaster").val(d.waybillnomaster); | ||
58 | + } | ||
59 | + </script> | ||
60 | + | ||
61 | + | ||
62 | + | ||
63 | +</head > | ||
64 | + | ||
65 | +<body style="text-align: center"> | ||
66 | +<hr> | ||
67 | + <form class="layui-form layui-form-pane" action=""> | ||
68 | + <input type="hidden" name="id" id = "id" /> | ||
69 | + <input type="hidden" name="waybillnomaster" id = "waybillnomaster" value="${waybillnomaster}" /> | ||
70 | + <div class="layui-form-item"> | ||
71 | + <div class="layui-inline"> | ||
72 | + <label class="layui-form-label">序号</label> | ||
73 | + <div class="layui-input-block"> | ||
74 | + <input type="text" name="orderNumber" id="orderNumber" autocomplete="off" class="layui-input"> | ||
75 | + </div> | ||
76 | + </div> | ||
77 | + <div class="layui-inline"> | ||
78 | + <label class="layui-form-label">托运货物件数</label> | ||
79 | + <div class="layui-input-block"> | ||
80 | + <input type="text" name="piece" id="piece" autocomplete="off" class="layui-input"> | ||
81 | + </div> | ||
82 | + </div> | ||
83 | + <div class="layui-inline"> | ||
84 | + <label class="layui-form-label">包装种类代码</label> | ||
85 | + <div class="layui-input-block"> | ||
86 | + <input type="text" name="packageCode" id="packageCode" autocomplete="off" class="layui-input"> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + </div> | ||
90 | + <div class="layui-form-item"> | ||
91 | + <div class="layui-inline"> | ||
92 | + <label class="layui-form-label">唛头</label> | ||
93 | + <div class="layui-input-block"> | ||
94 | + <input type="text" name="shippingMarks" id="shippingMarks" autocomplete="off" class="layui-input"> | ||
95 | + </div> | ||
96 | + </div> | ||
97 | + <div class="layui-inline"> | ||
98 | + <label class="layui-form-label">危险品编号</label> | ||
99 | + <div class="layui-input-block"> | ||
100 | + <input type="text" name="dangerousCode" id="dangerousCode" autocomplete="off" class="layui-input"> | ||
101 | + </div> | ||
102 | + </div> | ||
103 | + <div class="layui-inline"> | ||
104 | + <label class="layui-form-label">货物毛重KG</label> | ||
105 | + <div class="layui-input-block"> | ||
106 | + <input type="text" name="weight" id="weight"autocomplete="off" class="layui-input"> | ||
107 | + </div> | ||
108 | + </div> | ||
109 | + </div> | ||
110 | + <div class="layui-form-item"> | ||
111 | + <div class="layui-inline"> | ||
112 | + <label class="layui-form-label">集装箱编号</label> | ||
113 | + <div class="layui-input-block"> | ||
114 | + <input type="text" name="containerNumber" id="containerNumber" autocomplete="off" class="layui-input layui-disabled" disabled> | ||
115 | + </div> | ||
116 | + </div> | ||
117 | + <div class="layui-inline"> | ||
118 | + <label class="layui-form-label">海关手续代码</label> | ||
119 | + <div class="layui-input-block"> | ||
120 | + <input type="text" name="customProcedureCode" id="customProcedureCode" autocomplete="off" class="layui-input"> | ||
121 | + </div> | ||
122 | + </div> | ||
123 | + <div class="layui-inline"> | ||
124 | + <label class="layui-form-label">海关税则编号</label> | ||
125 | + <div class="layui-input-block"> | ||
126 | + <input type="text" name="customTariffCode" id="customTariffCode" autocomplete="off" class="layui-input"> | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + </div> | ||
130 | + <div class="layui-form-item"> | ||
131 | + <div class="layui-inline"> | ||
132 | + <label class="layui-form-label">唯一托运编号</label> | ||
133 | + <div class="layui-input-block"> | ||
134 | + <input type="text" name="consignCode" id="consignCode" autocomplete="off" class="layui-input"> | ||
135 | + </div> | ||
136 | + </div> | ||
137 | + <div class="layui-inline"> | ||
138 | + <label class="layui-form-label">原产地代码</label> | ||
139 | + <div class="layui-input-block"> | ||
140 | + <input type="text" name="originalCode" id="originalCode" autocomplete="off" class="layui-input"> | ||
141 | + </div> | ||
142 | + </div> | ||
143 | + <div class="layui-inline"> | ||
144 | + <label class="layui-form-label">货物简要描述</label> | ||
145 | + <div class="layui-input-block"> | ||
146 | + <input type="text" name="description" id="description" autocomplete="off" class="layui-input"> | ||
147 | + </div> | ||
148 | + </div> | ||
149 | + <div class="left" align="left"> | ||
150 | + <label class="layui-form-label">备注</label> | ||
151 | + <div class="layui-input-inline"> | ||
152 | + <input type="text" name="remark" id="remark" autocomplete="off" class="layui-input1"> | ||
153 | + </div> | ||
154 | + </div> | ||
155 | + </div> | ||
156 | + <div class="layui-form-item"> | ||
157 | + <button type="button" class="layui-btn" lay-submit="" lay-filter="demo1" > | ||
158 | + <c:if test="${empty ftId}">保存</c:if> | ||
159 | + <c:if test="${not empty ftId}">修改</c:if> | ||
160 | + </button> | ||
161 | + </div> | ||
162 | + </form> | ||
163 | + | ||
164 | + <script> | ||
165 | + layui.use(['layer', 'form','laydate'], function(){ | ||
166 | + var layer = layui.layer | ||
167 | + ,laydate=layui.laydate | ||
168 | + ,form = layui.form; | ||
169 | + //监听提交 | ||
170 | + form.on('submit(demo1)', function(data){ | ||
171 | + editForm(data.field); | ||
172 | + return false; | ||
173 | + }); | ||
174 | + }); | ||
175 | + | ||
176 | + function editForm(data){ | ||
177 | + $.ajax({ | ||
178 | + type : "post", | ||
179 | + url : "<%=basePath %>/lost/change/editItemData", | ||
180 | + data : data, | ||
181 | + success: function(data){ | ||
182 | + if(data.success){ | ||
183 | + layer.alert( data.msg, function (index, layero) { | ||
184 | + var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 | ||
185 | + parent.layer.close(index); //关闭当前弹窗 | ||
186 | + /* var layer = layui.layer; | ||
187 | + var table = layui.table; | ||
188 | + parent.layui.table.reload('flight',{page:{curr:1}}) | ||
189 | + layui.table.reload('flightItem',{page:{curr:1}}) */ | ||
190 | + | ||
191 | + }); | ||
192 | + }else{ | ||
193 | + layer.alert(data.msg, function () { | ||
194 | + window.parent.location.reload(); //刷新父页面 | ||
195 | + layer.close(index); //关闭当前弹窗 | ||
196 | + }); | ||
197 | + } | ||
198 | + } | ||
199 | + }); | ||
200 | + } | ||
201 | + </script> | ||
202 | +</body > | ||
203 | +</html > |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | ||
3 | +<%@ page isELIgnored="false"%> | ||
4 | +<% | ||
5 | + String path = request.getContextPath(); | ||
6 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
7 | +%> | ||
8 | +<!doctype html> | ||
9 | +<html lang="zh"> | ||
10 | +<head> | ||
11 | + <meta charset="utf-8"> | ||
12 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
13 | + <title>商品项信息</title> | ||
14 | + <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%> | ||
15 | + <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet"> | ||
16 | + <style type="text/css"> | ||
17 | + .layui-input-block { | ||
18 | + width:100px; | ||
19 | + } | ||
20 | + .layui-elip, .layui-form-checkbox span, .layui-form-pane .layui-form-label{ | ||
21 | + text-overflow:inherit;!important | ||
22 | + } | ||
23 | + .layui-disabled{ | ||
24 | + background-color:rgb(235, 235, 228); | ||
25 | + } | ||
26 | + .layui-input1{ | ||
27 | + width:545px; | ||
28 | + height: 38px; | ||
29 | + line-height: 38px; | ||
30 | + border: 1px solid #e6e6e6; | ||
31 | + background-color: #fff; | ||
32 | + border-radius: 2px; | ||
33 | + box-sizing: border-box!important; | ||
34 | + } | ||
35 | + .left{ | ||
36 | + padding: 10px | ||
37 | + } | ||
38 | + </style> | ||
39 | + <script src="<%=basePath %>static/easyui/jquery.min.js"></script> | ||
40 | + <script src="<%=basePath %>static/layui2.4.5/layui.js"></script> | ||
41 | + <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script> | ||
42 | + <script> | ||
43 | + function child(d) { | ||
44 | + debugger; | ||
45 | + $("#orderNumber").val(d.orderNumber) | ||
46 | + $("#piece").val(d.piece); | ||
47 | + $("#packageCode").val(d.packageCode); | ||
48 | + $("#shippingMarks").val(d.shippingMarks); | ||
49 | + $("#containerNumber").val(d.containerNumber); | ||
50 | + $("#customProcedureCode").val(d.customProcedureCode); | ||
51 | + $("#customTariffCode").val(d.customTariffCode); | ||
52 | + $("#consignCode").val(d.consignCode); | ||
53 | + $("#originalCode").val(d.originalCode); | ||
54 | + $("#description").val(d.description); | ||
55 | + $("#remark").val(d.remark); | ||
56 | + $("#weight").val(d.weight); | ||
57 | + } | ||
58 | + </script> | ||
59 | + | ||
60 | + | ||
61 | + | ||
62 | +</head > | ||
63 | + | ||
64 | +<body style="text-align: center"> | ||
65 | +<hr> | ||
66 | + <form class="layui-form layui-form-pane" action=""> | ||
67 | + <input type="hidden" name="id" id = "id" value="${item.id}"/> | ||
68 | + <input type="hidden" name="waybillnomaster" id = "waybillnomaster" value="${waybillnomaster}"/> | ||
69 | + <div class="layui-form-item"> | ||
70 | + <div class="layui-inline"> | ||
71 | + <label class="layui-form-label">序号</label> | ||
72 | + <div class="layui-input-block"> | ||
73 | + <input type="text" name="orderNumber" id="orderNumber" value="${item.orderNumber}"autocomplete="off" class="layui-input"> | ||
74 | + </div> | ||
75 | + </div> | ||
76 | + <div class="layui-inline"> | ||
77 | + <label class="layui-form-label">托运货物件数</label> | ||
78 | + <div class="layui-input-block"> | ||
79 | + <input type="text" name="piece" id="piece" value="${item.piece}" autocomplete="off" class="layui-input"> | ||
80 | + </div> | ||
81 | + </div> | ||
82 | + <div class="layui-inline"> | ||
83 | + <label class="layui-form-label">包装种类代码</label> | ||
84 | + <div class="layui-input-block"> | ||
85 | + <input type="text" name="packageCode" id="packageCode" value="${item.packageCode}" autocomplete="off" class="layui-input"> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | + <div class="layui-form-item"> | ||
90 | + <div class="layui-inline"> | ||
91 | + <label class="layui-form-label">唛头</label> | ||
92 | + <div class="layui-input-block"> | ||
93 | + <input type="text" name="shippingMarks" id="shippingMarks" value="${item.shippingMarks}" autocomplete="off" class="layui-input"> | ||
94 | + </div> | ||
95 | + </div> | ||
96 | + <div class="layui-inline"> | ||
97 | + <label class="layui-form-label">危险品编号</label> | ||
98 | + <div class="layui-input-block"> | ||
99 | + <input type="text" name="dangerousCode" id="dangerousCode" value="${item.dangerousCode}" autocomplete="off" class="layui-input"> | ||
100 | + </div> | ||
101 | + </div> | ||
102 | + <div class="layui-inline"> | ||
103 | + <label class="layui-form-label">货物毛重KG</label> | ||
104 | + <div class="layui-input-block"> | ||
105 | + <input type="text" name="weight" id="weight" value="${item.weight}" autocomplete="off" class="layui-input"> | ||
106 | + </div> | ||
107 | + </div> | ||
108 | + </div> | ||
109 | + <div class="layui-form-item"> | ||
110 | + <div class="layui-inline"> | ||
111 | + <label class="layui-form-label">集装箱编号</label> | ||
112 | + <div class="layui-input-block"> | ||
113 | + <input type="text" name="containerNumber" id="containerNumber" value="${item.containerNumber}" autocomplete="off" class="layui-input layui-disabled" disabled> | ||
114 | + </div> | ||
115 | + </div> | ||
116 | + <div class="layui-inline"> | ||
117 | + <label class="layui-form-label">海关手续代码</label> | ||
118 | + <div class="layui-input-block"> | ||
119 | + <input type="text" name="customProcedureCode" id="customProcedureCode" value="${item.customProcedureCode}" autocomplete="off" class="layui-input"> | ||
120 | + </div> | ||
121 | + </div> | ||
122 | + <div class="layui-inline"> | ||
123 | + <label class="layui-form-label">海关税则编号</label> | ||
124 | + <div class="layui-input-block"> | ||
125 | + <input type="text" name="customTariffCode" id="customTariffCode" value="${item.customTariffCode}" autocomplete="off" class="layui-input"> | ||
126 | + </div> | ||
127 | + </div> | ||
128 | + </div> | ||
129 | + <div class="layui-form-item"> | ||
130 | + <div class="layui-inline"> | ||
131 | + <label class="layui-form-label">唯一托运编号</label> | ||
132 | + <div class="layui-input-block"> | ||
133 | + <input type="text" name="consignCode" id="consignCode" value="${item.consignCode}" autocomplete="off" class="layui-input"> | ||
134 | + </div> | ||
135 | + </div> | ||
136 | + <div class="layui-inline"> | ||
137 | + <label class="layui-form-label">原产地代码</label> | ||
138 | + <div class="layui-input-block"> | ||
139 | + <input type="text" name="originalCode" id="originalCode" value="${item.originalCode}" autocomplete="off" class="layui-input"> | ||
140 | + </div> | ||
141 | + </div> | ||
142 | + <div class="layui-inline"> | ||
143 | + <label class="layui-form-label">货物简要描述</label> | ||
144 | + <div class="layui-input-block"> | ||
145 | + <input type="text" name="description" id="description" value="${item.description}" autocomplete="off" class="layui-input"> | ||
146 | + </div> | ||
147 | + </div> | ||
148 | + <div class="left" align="left"> | ||
149 | + <label class="layui-form-label">备注</label> | ||
150 | + <div class="layui-input-inline"> | ||
151 | + <input type="text" name="remark" id="remark" value="${item.remark}" autocomplete="off" class="layui-input1"> | ||
152 | + </div> | ||
153 | + </div> | ||
154 | + </div> | ||
155 | + <div class="layui-form-item"> | ||
156 | + <button class="layui-btn" lay-submit="" lay-filter="demo1" return false;> | ||
157 | + <c:if test="${empty ftId }">保存</c:if> | ||
158 | + <c:if test="${not empty ftId}">修改</c:if> | ||
159 | + </button> | ||
160 | + </div> | ||
161 | + </form> | ||
162 | + | ||
163 | + <script> | ||
164 | + layui.use(['layer', 'form','laydate'], function(){ | ||
165 | + var layer = layui.layer | ||
166 | + ,laydate=layui.laydate | ||
167 | + ,form = layui.form; | ||
168 | + //监听提交 | ||
169 | + form.on('submit(demo1)', function(data){ | ||
170 | + editForm(data.field); | ||
171 | + }); | ||
172 | + }); | ||
173 | + | ||
174 | + function editForm(data){ | ||
175 | + $.ajax({ | ||
176 | + type : "post", | ||
177 | + url : "<%=basePath %>/lost/change/editItemData", | ||
178 | + data : data, | ||
179 | + success: function(data){ | ||
180 | + if(data.success){ | ||
181 | + parent.layer.alert(data.msg, function () { | ||
182 | + var index = parent.layer.getFrameIndex(window.name) | ||
183 | + window.parent.location.reload(); //刷新父页面 | ||
184 | + parent.layer.close(index); //关闭当前弹窗 | ||
185 | + }); | ||
186 | + }else{ | ||
187 | + layer.alert(data.msg, function () { | ||
188 | + window.parent.location.reload(); //刷新父页面 | ||
189 | + layer.close(index); //关闭当前弹窗 | ||
190 | + }); | ||
191 | + } | ||
192 | + } | ||
193 | + }); | ||
194 | + } | ||
195 | + </script> | ||
196 | +</body > | ||
197 | +</html > |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<% | ||
3 | + String path = request.getContextPath(); | ||
4 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
5 | +%> | ||
6 | +<!doctype html> | ||
7 | +<html lang="zh"> | ||
8 | + | ||
9 | +<head> | ||
10 | + <meta charset="utf-8"> | ||
11 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
12 | + <title>落装改配申请列表</title> | ||
13 | + <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%> | ||
14 | + <%-- <link rel="stylesheet" href="<%=basePath %>/static/css/main.css" /> --%> | ||
15 | + | ||
16 | + <script src="<%=basePath %>static/easyui/jquery.min.js"></script> | ||
17 | + <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet"> | ||
18 | + <script src="<%=basePath %>static/layui2.4.5/layui.js"></script> | ||
19 | + <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script> | ||
20 | + <style> | ||
21 | + body{ | ||
22 | + .layui-input{color:#FF7F24;font-size: 16px} | ||
23 | + /* margin: 10px; */ | ||
24 | + /* text-align: center; */ | ||
25 | + } | ||
26 | + </style> | ||
27 | +</head> | ||
28 | +<body> | ||
29 | + <blockquote class="layui-elem-quote" align="left">落装改配申请列表</blockquote> | ||
30 | + <div> | ||
31 | + <div class="layui-inline"> | ||
32 | + <label class="layui-form-label" style="font-size: 15px; font-weight: bold; width: 70px;">航班号:</label> | ||
33 | + <div class="layui-input-inline"> | ||
34 | + <input type="text" name="flightno" id="flightno" autocomplete="off" class="layui-input" style="text-transform:uppercase;" onkeyup="this.value=this.value.toUpperCase()"/> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + <div class="layui-inline"> | ||
38 | + <label class="layui-form-label" | ||
39 | + style="font-weight: bold; font-size: 15px; width: 80px;">航班日期:</label> | ||
40 | + <div class="layui-input-inline"> | ||
41 | + <input type="text" autocomplete="off" class="layui-input" id="flightdate" name="flightdate"/> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + | ||
45 | + <div class="layui-inline"> | ||
46 | + <div class="layui-inline"> | ||
47 | + <label class="layui-form-label" | ||
48 | + style="font-weight: bold; font-size: 15px; width: 70px;">主单号:</label> | ||
49 | + <div class="layui-input-inline"> | ||
50 | + <input type="text" name="waybillnomaster" autocomplete="off" class="layui-input" id="waybillnomaster" /> | ||
51 | + </div> | ||
52 | + </div> | ||
53 | + </div> | ||
54 | + <div class="layui-inline"> | ||
55 | + <div class="layui-inline"> | ||
56 | + <label class="layui-form-label" | ||
57 | + style="font-weight: bold; font-size: 15px; width: 70px;">分单号:</label> | ||
58 | + <div class="layui-input-inline"> | ||
59 | + <input type="text" name="waybillnosecondary" autocomplete="off" class="layui-input" id="waybillnosecondary" style="text-transform:uppercase;" onkeyup="this.value=this.value.toUpperCase()"/> | ||
60 | + </div> | ||
61 | + </div> | ||
62 | + </div> | ||
63 | + <div class="layui-inline"> | ||
64 | + <button class="layui-btn" lay-submit="" id="searchBtn" data-type="getInfo">查询</button> | ||
65 | + <button class="layui-btn" data-type="reload" id="add">新增</button> | ||
66 | + </div> | ||
67 | + </div> | ||
68 | + <!-- <button class="layui-btn" lay-submit="" id="searchBtn" data-type="getInfo">查询</button> --> | ||
69 | + | ||
70 | + </div> | ||
71 | + <hr> | ||
72 | + <blockquote class="layui-elem-quote" align="left">落装改配申请明细</blockquote> | ||
73 | + | ||
74 | + <div class="layui-inline" > | ||
75 | + <table class="layui-hide" id="flight" lay-filter="flight" style="width:99%; text-align="center"></table> | ||
76 | + </div> | ||
77 | + <%-- | ||
78 | + <script type="text/html" id="toolbar"> | ||
79 | + <div class="layui-btn-container"> | ||
80 | + <button class="layui-btn layui-btn-sm" >新增</button> | ||
81 | + <input id="searchInput" type="text" placeholder="请输入关键字"> | ||
82 | + <button class="layui-btn layui-btn-sm" >查询</button> | ||
83 | + </div> | ||
84 | + </script> --%> | ||
85 | + | ||
86 | + <script type="text/html" id="barDemo"> | ||
87 | + | ||
88 | + <a class="layui-btn layui-btn-xs" lay-event="shoufa">收发明细</a> | ||
89 | + <a class="layui-btn layui-btn-xs" lay-event="edit">编辑运单</a> | ||
90 | + {{#console.log(d)}} | ||
91 | + {{# if(d.status =="01"){ }} | ||
92 | + <a class="layui-btn layui-btn-xs layui-btn-disabled">申报</a> | ||
93 | + {{# } else { }} | ||
94 | + <a class="layui-btn layui-btn-xs" lay-event="send" id="sb">申报</a> | ||
95 | + {{# } }} | ||
96 | + <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">修改状态</a> | ||
97 | + </script> | ||
98 | + | ||
99 | + | ||
100 | + <script> | ||
101 | + layui.use('table', function(){ | ||
102 | + var table = layui.table; | ||
103 | + | ||
104 | + table.render({ | ||
105 | + elem: '#flight' | ||
106 | + ,url:'<%=basePath %>/lost/change/getList' | ||
107 | + /* ,toolbar: '#toolbar' */ | ||
108 | + ,title: '落装改配申请' | ||
109 | + ,height: 'full-200' | ||
110 | + ,page: true //开启分页 | ||
111 | + ,cols: [[ | ||
112 | + {field:'waybillnomaster', align:'center',title:'主单号', width:130, sort: true} | ||
113 | + ,{field:'waybillnosecondary', align:'center',title:'分单号', width:150} | ||
114 | + ,{field:'cwaybillnomaster', title:'改配后主单号',align:'center', width:130,} | ||
115 | + ,{field:'cwaybillnosecondary',align:'center', title:'改配后分单号', width:150 ,templet: function(d){ | ||
116 | + return d.waybillnosecondary.substring(0,10) | ||
117 | + } | ||
118 | + } | ||
119 | + ,{field:'flightno', title:'航班号',align:'center', width:100,} | ||
120 | + ,{field:'cflightno',align:'center', title:'改配后航班号', width:115 ,templet: function(d){ | ||
121 | + return d.flightno.substring(0,10) | ||
122 | + } | ||
123 | + } | ||
124 | + ,{field:'status', align:'center',title:'状态', width:90,templet: function(d){ | ||
125 | + var text = d.status; | ||
126 | + if(text=="01"){ | ||
127 | + return '已发送' | ||
128 | + }else if(text=="02"){ | ||
129 | + return '申报成功' | ||
130 | + }else{ | ||
131 | + return '' | ||
132 | + } | ||
133 | + } | ||
134 | + } | ||
135 | + ,{field:'receiption', align:'center',title:'回执信息', width:336} | ||
136 | + ,{fixed: 'right', title:'操作',align:'center', toolbar: '#barDemo', width:300} | ||
137 | + ]] | ||
138 | + }); | ||
139 | + $('#searchBtn').on('click',function(){ | ||
140 | + var type = $(this).data('type'); | ||
141 | + active[type] ? active[type].call(this) : ''; | ||
142 | + }); | ||
143 | + // 点击获取数据 | ||
144 | + var active = { | ||
145 | + getInfo: function () { | ||
146 | + if(check()){ | ||
147 | + var flightno=$('#flightno').val(); | ||
148 | + var flightdate=$('#flightdate').val(); | ||
149 | + var waybillnomaster=$('#waybillnomaster').val(); | ||
150 | + var waybillnosecondary=$('#waybillnosecondary').val(); | ||
151 | + /* if (flightno) { */ | ||
152 | + var index = layer.msg('查询中,请稍候...',{icon: 16,time:false,shade:0}); | ||
153 | + setTimeout(function(){ | ||
154 | + table.reload('flight', { //表格的id | ||
155 | + url:'<%=basePath %>/lost/change/selectByParam', | ||
156 | + page:{ | ||
157 | + curr:1 //从第一页开始 | ||
158 | + }, | ||
159 | + where: { | ||
160 | + 'flightno':$.trim(flightno), | ||
161 | + 'flightdate':$.trim(flightdate), | ||
162 | + 'waybillnomaster':$.trim(waybillnomaster), | ||
163 | + 'waybillnosecondary':$.trim(waybillnosecondary) | ||
164 | + } | ||
165 | + }); | ||
166 | + layer.close(index); | ||
167 | + },800); | ||
168 | + /* } else { | ||
169 | + layer.msg("请输入航班号"); | ||
170 | + } */ | ||
171 | + } | ||
172 | + }, | ||
173 | + }; | ||
174 | + $("#flightno").bind("keyup", function (e) { | ||
175 | + if (e.keyCode == 13) { | ||
176 | + var type = "getInfo"; | ||
177 | + active[type] ? active[type].call(this) : ''; | ||
178 | + } | ||
179 | + }); | ||
180 | + | ||
181 | + //监听行工具事件 | ||
182 | + table.on('tool(flight)', function(obj){ | ||
183 | + var data = obj.data; | ||
184 | + console.log(obj) | ||
185 | + if(obj.event === 'del'){ | ||
186 | + layer.confirm('您确定要修改状态吗', function(index){ | ||
187 | + $.ajax({ | ||
188 | + type : "post", | ||
189 | + url : "<%=basePath %>/lost/change/updateStatues", | ||
190 | + data : data, | ||
191 | + success: function(data){ | ||
192 | + if(data.success){ | ||
193 | + layer.alert( data.msg, function () { | ||
194 | + window.parent.location.reload(); //刷新父页面 | ||
195 | + parent.layer.close(index); //关闭当前弹窗 | ||
196 | + }); | ||
197 | + } | ||
198 | + }, | ||
199 | + error: function() { | ||
200 | + layer.alert("删除失败,请重试"); | ||
201 | + } | ||
202 | + }); | ||
203 | + }); | ||
204 | + }else if(obj.event === 'send'){ | ||
205 | + layer.confirm('您确定要申报吗', function(index){ | ||
206 | + if (data) { | ||
207 | + var id = data.id; | ||
208 | + $.ajax({ | ||
209 | + type : "post", | ||
210 | + url : "<%=basePath %>/lost/change/send", | ||
211 | + data : data, | ||
212 | + success: function(data){ | ||
213 | + if(data.success){ | ||
214 | + debugger; | ||
215 | + layer.alert(data.msg, function () { | ||
216 | + window.parent.location.reload(); //刷新父页面 | ||
217 | + parent.layer.close(index); //关闭当前弹窗 | ||
218 | + | ||
219 | + }); | ||
220 | + }else{ | ||
221 | + layer.alert(data.msg, function () { | ||
222 | + window.parent.location.reload(); //刷新父页面 | ||
223 | + parent.layer.close(index); //关闭当前弹窗 | ||
224 | + }); | ||
225 | + } | ||
226 | + }, | ||
227 | + error: function() { | ||
228 | + layer.alert("申报失败", function () { | ||
229 | + window.parent.location.reload(); //刷新父页面 | ||
230 | + parent.layer.close(index); //关闭当前弹窗 | ||
231 | + }); | ||
232 | + } | ||
233 | + }); | ||
234 | + } else { | ||
235 | + alert("请选择需要申报的运单") | ||
236 | + } | ||
237 | + }); | ||
238 | + } else if(obj.event === 'edit'){ | ||
239 | + if (data) { | ||
240 | + var waybillnomaster = data.waybillnomaster; | ||
241 | + var id = data.id; | ||
242 | + layer.open({ | ||
243 | + type: 2, | ||
244 | + title: "落装改配申请", | ||
245 | + shade: 0.8, | ||
246 | + id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748 | ||
247 | + moveType: 1, //拖拽模式,0或者1 | ||
248 | + type: 2, | ||
249 | + skin: 'layui-layer-rim', //加上边框 | ||
250 | + /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ | ||
251 | + area: ['692px', '372px'], | ||
252 | + maxmin: true, //开启最大化最小化按钮 | ||
253 | + zIndex: layer.zIndex, //重点1 | ||
254 | + content: "<%=basePath %>/lost/change/edit?id="+id+"&waybillnomaster="+waybillnomaster, | ||
255 | + success: function (layero, index) { | ||
256 | + debugger; | ||
257 | + var layer = layui.layer; | ||
258 | + // 获取子页面的iframe | ||
259 | + var iframe = window['layui-layer-iframe' + index]; | ||
260 | + // 向子页面的全局函数child传参 | ||
261 | + iframe.child(data); | ||
262 | + layer.setTop(layero); //重点2 | ||
263 | + } | ||
264 | + }) | ||
265 | + } else { | ||
266 | + alert("请选择运单") | ||
267 | + } | ||
268 | + }else if(obj.event === 'shoufa'){ | ||
269 | + if (data) { | ||
270 | + var id = data.id; | ||
271 | + layer.open({ | ||
272 | + type: 2, | ||
273 | + title: "收发明细", | ||
274 | + shade: 0.8, | ||
275 | + id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748 | ||
276 | + moveType: 1, //拖拽模式,0或者1 | ||
277 | + type: 2, | ||
278 | + skin: 'layui-layer-rim', //加上边框 | ||
279 | + /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ | ||
280 | + area: ['692px', '372px'], | ||
281 | + maxmin: true, //开启最大化最小化按钮 | ||
282 | + content: "<%=basePath %>/lost/change/edit?id="+id, | ||
283 | + success: function (layero, index) { | ||
284 | + // 获取子页面的iframe | ||
285 | + var iframe = window['layui-layer-iframe' + index]; | ||
286 | + // 向子页面的全局函数child传参 | ||
287 | + iframe.child(data); | ||
288 | + } | ||
289 | + }) | ||
290 | + } else { | ||
291 | + alert("请选择需要申报的运单") | ||
292 | + } | ||
293 | + } | ||
294 | + | ||
295 | + }); | ||
296 | + | ||
297 | + }); | ||
298 | + $("#add").click(function(){ | ||
299 | + layer.open({ | ||
300 | + type: 2, | ||
301 | + title: "落装改配申请", //不显示标题栏 | ||
302 | + //closeBtn: 2, | ||
303 | + shade: 0.8, | ||
304 | + id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748 | ||
305 | + moveType: 1, //拖拽模式,0或者1 | ||
306 | + type: 2, | ||
307 | + skin: 'layui-layer-rim', //加上边框 | ||
308 | + /* area: [window.screen.width / 2 + 'px', window.screen.height / 2 + 'px'], //宽高 */ | ||
309 | + area: ['692px', '372px'], | ||
310 | + maxmin: true, //开启最大化最小化按钮 | ||
311 | + content: "<%=basePath %>/lost/change/edit", | ||
312 | + zIndex: layer.zIndex, | ||
313 | + success: function (layero, index) { | ||
314 | + // 获取子页面的iframe | ||
315 | + var iframe = window['layui-layer-iframe' + index]; | ||
316 | + // 向子页面的全局函数child传参 | ||
317 | + iframe.child(data); | ||
318 | + layer.setTop(layero); | ||
319 | + | ||
320 | + } | ||
321 | + }) | ||
322 | + }) | ||
323 | + </script> | ||
324 | + | ||
325 | + <script type="text/javascript"> | ||
326 | + layui.use(['form', 'laydate'], function(){ | ||
327 | + var form = layui.form | ||
328 | + ,laydate = layui.laydate; | ||
329 | + | ||
330 | + //日期 | ||
331 | + laydate.render({ | ||
332 | + elem: '#flightdate' | ||
333 | + }); | ||
334 | + }); | ||
335 | + | ||
336 | + function check(){ | ||
337 | + var billNo = $("#waybillnomaster").val(); | ||
338 | + var regs = /[a-z]/i; | ||
339 | + if(billNo==''){ | ||
340 | + return true; | ||
341 | + }else if(regs.test(billNo)){ | ||
342 | + $("#waybillnomaster").focus(); | ||
343 | + layer.tips('主单号必须为数字', '#waybillnomaster', { | ||
344 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
345 | + }); | ||
346 | + return false; | ||
347 | + } | ||
348 | + else{ | ||
349 | + if(billNo.indexOf("-") != -1){ | ||
350 | + billNo=billNo; | ||
351 | + if(billNo.length!=12){ | ||
352 | + $("#waybillnomaster").focus(); | ||
353 | + layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
354 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
355 | + }); | ||
356 | + return false; | ||
357 | + } | ||
358 | + }else{ | ||
359 | + // billNo = billNo.substring(0,3)+'-'+billNo.substring(3) | ||
360 | + if(billNo.length!=11){ | ||
361 | + $("#waybillnomaster").focus(); | ||
362 | + layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
363 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
364 | + }); | ||
365 | + return false; | ||
366 | + } | ||
367 | + } | ||
368 | + $("#waybillnomaster").val(billNo); | ||
369 | + return true; | ||
370 | + } | ||
371 | + } | ||
372 | + </script> | ||
373 | +</body> | ||
374 | +</html> |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> | ||
2 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | ||
3 | +<%@ page isELIgnored="false"%> | ||
4 | +<% | ||
5 | + String path = request.getContextPath(); | ||
6 | + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
7 | +%> | ||
8 | +<!doctype html> | ||
9 | +<html lang="zh"> | ||
10 | +<head> | ||
11 | + <meta charset="utf-8"> | ||
12 | + <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
13 | + <title>落装申请修改</title> | ||
14 | + <%-- <link href="<%=basePath %>static/css/login.css" rel="stylesheet"> --%> | ||
15 | + <link href="<%=basePath %>static/layui2.4.5/css/layui.css" rel="stylesheet"> | ||
16 | + <style type="text/css"> | ||
17 | + .layui-input-b1ock { | ||
18 | + margin-left: 510px; | ||
19 | + min-height: 36px; | ||
20 | + } | ||
21 | + </style> | ||
22 | + <script src="<%=basePath %>static/easyui/jquery.min.js"></script> | ||
23 | + <script src="<%=basePath %>static/layui2.4.5/layui.js"></script> | ||
24 | + <script type="text/javascript" src="<%=basePath %>static/layer-v3.0.3/layer/layer.js"></script> | ||
25 | + <script> | ||
26 | + function child(d) { | ||
27 | + $("#id").val(d.id) | ||
28 | + $("#flightno").val(d.flightno); | ||
29 | + $("#flightdate").val(d.flightdate.substring(0,10)); | ||
30 | + $("#waybillnomaster").val(d.waybillnomaster); | ||
31 | + $("#waybillnosecondary").val(d.waybillnosecondary); | ||
32 | + } | ||
33 | + </script> | ||
34 | + <script> | ||
35 | + layui.use(['layer', 'form','laydate'], function(){ | ||
36 | + var layer = layui.layer | ||
37 | + ,laydate=layui.laydate | ||
38 | + ,form = layui.form; | ||
39 | + //监听提交 | ||
40 | + form.on('submit(demo1)', function(data){ | ||
41 | + if(check()){ | ||
42 | + editForm(data.field); | ||
43 | + } | ||
44 | + return false; | ||
45 | + }); | ||
46 | + }); | ||
47 | + | ||
48 | + function editForm(data){ | ||
49 | + var billNo = $("#waybillnomaster").val(); | ||
50 | + data.waybillnomaster=billNo; | ||
51 | + $.ajax({ | ||
52 | + type : "post", | ||
53 | + url : "<%=basePath %>/lost/editForm", | ||
54 | + data : data, | ||
55 | + success: function(data){ | ||
56 | + if(data.success){ | ||
57 | + layer.alert( data.msg, function () { | ||
58 | + window.parent.location.reload(); //刷新父页面 | ||
59 | + parent.layer.close(index); //关闭当前弹窗 | ||
60 | + }); | ||
61 | + }else{ | ||
62 | + layer.alert( data.msg, function () { | ||
63 | + window.parent.location.reload(); //刷新父页面 | ||
64 | + parent.layer.close(index); //关闭当前弹窗 | ||
65 | + }); | ||
66 | + } | ||
67 | + }, | ||
68 | + error: function() { | ||
69 | + layer.alert("保存失败,请重试"); | ||
70 | + } | ||
71 | + }); | ||
72 | + } | ||
73 | + </script> | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | +</head > | ||
78 | + | ||
79 | +<body style="margin: auto"> | ||
80 | +<blockquote class="layui-elem-quote">运单信息编辑</blockquote> | ||
81 | +<hr> | ||
82 | +<form class="layui-form" action="" lay-filter="example"> | ||
83 | +<input type="hidden" id="id" name="id" autocomplete="off" class="layui-input" > | ||
84 | + <div class="layui-form-item"> | ||
85 | + <div class="layui-inline"> | ||
86 | + <label class="layui-form-label">航班号</label> | ||
87 | + <div class="layui-input-inline"> | ||
88 | + <input type="text" id="flightno" style="text-transform:uppercase;" name="flightno" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> | ||
89 | + </div> | ||
90 | + </div> | ||
91 | + <div class="layui-inline"> | ||
92 | + <label class="layui-form-label">航班日期</label> | ||
93 | + <div class="layui-input-inline"> | ||
94 | + <input type="text" id="flightdate" name="flightdate" autocomplete="off" class="layui-input"> | ||
95 | + </div> | ||
96 | + </div> | ||
97 | + </div> | ||
98 | + <div class="layui-form-item"> | ||
99 | + <div class="layui-inline"> | ||
100 | + <label class="layui-form-label">主单号</label> | ||
101 | + <div class="layui-input-inline"> | ||
102 | + <input type="text" id="waybillnomaster" name="waybillnomaster" autocomplete="off" class="layui-input"> | ||
103 | + </div> | ||
104 | + </div> | ||
105 | + <div class="layui-inline"> | ||
106 | + <label class="layui-form-label">分单号</label> | ||
107 | + <div class="layui-input-inline"> | ||
108 | + <input type="text" id="waybillnosecondary" style="text-transform:uppercase;" name="waybillnosecondary" autocomplete="off" class="layui-input" onkeyup="if (this.value != this.value.toUpperCase()) this.value=this.value.toUpperCase();"> | ||
109 | + </div> | ||
110 | + </div> | ||
111 | + </div> | ||
112 | + <div class="layui-form-item" > | ||
113 | + <div class="layui-input-b1ock"> | ||
114 | + <button class="layui-btn" lay-submit="" lay-filter="demo1"> | ||
115 | + <c:if test="${empty ftId }">保存</c:if> | ||
116 | + <c:if test="${not empty ftId}">修改</c:if> | ||
117 | + </button> | ||
118 | + </div> | ||
119 | + </div> | ||
120 | +</form> | ||
121 | + <script type="text/javascript"> | ||
122 | + layui.use(['form', 'laydate'], function(){ | ||
123 | + var form = layui.form | ||
124 | + ,laydate = layui.laydate; | ||
125 | + | ||
126 | + //日期 | ||
127 | + laydate.render({ | ||
128 | + elem: '#flightdate' | ||
129 | + }); | ||
130 | + }); | ||
131 | + | ||
132 | + function check(){ | ||
133 | + var billNo = $("#waybillnomaster").val(); | ||
134 | + var flightno = $("#flightno").val(); | ||
135 | + var flightdate = $("#flightdate").val(); | ||
136 | + var regs = /[a-z]/i; | ||
137 | + if(flightno==''){ | ||
138 | + $("#flightno").focus(); | ||
139 | + layer.tips('请输入航班号', '#flightno', { | ||
140 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
141 | + }); | ||
142 | + return false; | ||
143 | + }else if(flightdate==''){ | ||
144 | + $("#flightdate").focus(); | ||
145 | + layer.tips('请输入航班日期', '#flightdate', { | ||
146 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
147 | + }); | ||
148 | + return false; | ||
149 | + }else | ||
150 | + if(billNo==''){ | ||
151 | + $("#waybillnomaster").focus(); | ||
152 | + layer.tips('请输入主单号', '#waybillnomaster', { | ||
153 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
154 | + }); | ||
155 | + return false; | ||
156 | + }else if(regs.test(billNo)){ | ||
157 | + $("#waybillnomaster").focus(); | ||
158 | + layer.tips('主单号必须为数字', '#waybillnomaster', { | ||
159 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
160 | + }); | ||
161 | + return false; | ||
162 | + } | ||
163 | + else{ | ||
164 | + if(billNo.indexOf("-") != -1){ | ||
165 | + billNo=billNo; | ||
166 | + if(billNo.length!=12){ | ||
167 | + $("#waybillnomaster").focus(); | ||
168 | + layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
169 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
170 | + }); | ||
171 | + return false; | ||
172 | + } | ||
173 | + }else{ | ||
174 | + billNo = billNo.substring(0,3)+'-'+billNo.substring(3) | ||
175 | + if(billNo.length!=12){ | ||
176 | + $("#waybillnomaster").focus(); | ||
177 | + layer.tips('主单号必须为11位', '#waybillnomaster', { | ||
178 | + tips: [1, '#0FA6D8'] //还可配置颜色 | ||
179 | + }); | ||
180 | + return false; | ||
181 | + } | ||
182 | + } | ||
183 | + $("#waybillnomaster").val(billNo); | ||
184 | + return true; | ||
185 | + } | ||
186 | + } | ||
187 | + </script> | ||
188 | + </body > | ||
189 | +</html > |
-
请 注册 或 登录 后发表评论