作者 Kevin

1、调整分单件重顺序;

2、分单增加特货代码;
3、修改同一个公司对应多个地址会被覆盖的bug;
4、修改其它bug;
5、修改件重数据出现逗号的bug;
不能预览此文件类型
不能预览此文件类型
不能预览此文件类型
@@ -52,7 +52,6 @@ import com.agent.service.agent.PubDgService; @@ -52,7 +52,6 @@ import com.agent.service.agent.PubDgService;
52 import com.agent.service.agent.TBasCarrierService; 52 import com.agent.service.agent.TBasCarrierService;
53 import com.agent.service.agent.WaybillReceiptService; 53 import com.agent.service.agent.WaybillReceiptService;
54 import com.agent.service.system.RoleService; 54 import com.agent.service.system.RoleService;
55 -import com.agent.smb.RemoteFileKit;  
56 import com.agent.util.HttpJsonMsg; 55 import com.agent.util.HttpJsonMsg;
57 import com.agent.vo.ResponseModel; 56 import com.agent.vo.ResponseModel;
58 import com.agent.vo.agent.CommodityVo; 57 import com.agent.vo.agent.CommodityVo;
@@ -81,7 +80,8 @@ import com.alibaba.fastjson.JSONArray; @@ -81,7 +80,8 @@ import com.alibaba.fastjson.JSONArray;
81 import com.alibaba.fastjson.JSONObject; 80 import com.alibaba.fastjson.JSONObject;
82 import com.framework.core.Servlets; 81 import com.framework.core.Servlets;
83 import com.framework.shiro.SessionUtil; 82 import com.framework.shiro.SessionUtil;
84 -import com.framework.util.CustomMessageKit; 83 +import com.framework.util.MessageKit;
  84 +import com.framework.util.MessageType;
85 import com.plugin.easyui.DataGrid; 85 import com.plugin.easyui.DataGrid;
86 import com.plugin.easyui.EasyPage; 86 import com.plugin.easyui.EasyPage;
87 87
@@ -132,7 +132,7 @@ public class ManifestController extends BasicController { @@ -132,7 +132,7 @@ public class ManifestController extends BasicController {
132 132
133 @Resource 133 @Resource
134 private ConsignorService consignorService; 134 private ConsignorService consignorService;
135 - 135 +
136 @Resource 136 @Resource
137 private ConsigneeService consigneeService; 137 private ConsigneeService consigneeService;
138 138
@@ -145,7 +145,7 @@ public class ManifestController extends BasicController { @@ -145,7 +145,7 @@ public class ManifestController extends BasicController {
145 * @return 145 * @return
146 */ 146 */
147 @RequestMapping(value = "/list") 147 @RequestMapping(value = "/list")
148 - public String getList(HttpServletRequest request,Model model) { 148 + public String getList(HttpServletRequest request, Model model) {
149 request.setAttribute("version", System.currentTimeMillis()); 149 request.setAttribute("version", System.currentTimeMillis());
150 return "manifest/list"; 150 return "manifest/list";
151 } 151 }
@@ -820,8 +820,8 @@ public class ManifestController extends BasicController { @@ -820,8 +820,8 @@ public class ManifestController extends BasicController {
820 manifest.setCarrier(carrier); 820 manifest.setCarrier(carrier);
821 manifest.setFlightno(flightno); 821 manifest.setFlightno(flightno);
822 822
823 - consigneeService.saveFromManifest(manifest, Tools.getUserId());  
824 - consignorService.saveFromManifest(manifest, Tools.getUserId()); 823 +// consigneeService.saveFromManifest(manifest, Tools.getUserId());
  824 +// consignorService.saveFromManifest(manifest, Tools.getUserId());
825 825
826 ResponseModel model = new ResponseModel(); 826 ResponseModel model = new ResponseModel();
827 try { 827 try {
@@ -856,21 +856,24 @@ public class ManifestController extends BasicController { @@ -856,21 +856,24 @@ public class ManifestController extends BasicController {
856 @RequestMapping(value = "/backout") 856 @RequestMapping(value = "/backout")
857 @ResponseBody 857 @ResponseBody
858 public ResponseModel backout(HttpServletRequest request, Long id) { 858 public ResponseModel backout(HttpServletRequest request, Long id) {
859 - ResponseModel model = new ResponseModel(1, null, ""); 859 + ResponseModel model = new ResponseModel(200, null, "");
860 ManifestEntity manifest = null; 860 ManifestEntity manifest = null;
861 try { 861 try {
862 if (id != null) { 862 if (id != null) {
863 - WaybillReceiptType type = WaybillReceiptType.DELETE;  
864 863
865 manifest = manifestService.findOne((id)); 864 manifest = manifestService.findOne((id));
866 - String rootPath = request.getSession().getServletContext().getRealPath("/");  
867 - String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml"; // 获取生成报文路径  
868 - String ndlxml = XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), path); // 转换报文  
869 - System.out.println(path);  
870 - System.out.println(ndlxml);  
871 - new RedisSaveMessage().saveMessage(ndlxml); // 发送  
872 - model.setStatus(200);  
873 865
  866 + // String deletePath = MessageKit.getMessagePath(MessageType.DELETE);
  867 + // String deletexml =
  868 + // XmlUtil.convertToXml2(manifestService.sendBackoutXml(manifest), deletePath);
  869 + // // 转换报文
  870 + // System.out.println("===================deletexml===================");
  871 + // System.out.println(deletexml);
  872 +
  873 + // new RedisSaveMessage().saveMessage(ndlxml);
  874 + // model.setStatus(200);
  875 +
  876 + WaybillReceiptType type = WaybillReceiptType.DELETE;
874 manifest.setResponse_text("主单——" + type.getName()); 877 manifest.setResponse_text("主单——" + type.getName());
875 manifest.setResponse_code(String.valueOf(type.getValue())); 878 manifest.setResponse_code(String.valueOf(type.getValue()));
876 manifestService.save(manifest); 879 manifestService.save(manifest);
@@ -919,8 +922,8 @@ public class ManifestController extends BasicController { @@ -919,8 +922,8 @@ public class ManifestController extends BasicController {
919 manifest.setCarrier(carrier); 922 manifest.setCarrier(carrier);
920 manifest.setFlightno(flightno); 923 manifest.setFlightno(flightno);
921 924
922 - consigneeService.saveFromManifest(manifest, Tools.getUserId());  
923 - consignorService.saveFromManifest(manifest, Tools.getUserId()); 925 +// consigneeService.saveFromManifest(manifest, Tools.getUserId());
  926 +// consignorService.saveFromManifest(manifest, Tools.getUserId());
924 927
925 ResponseModel model = new ResponseModel(); 928 ResponseModel model = new ResponseModel();
926 try { 929 try {
@@ -929,8 +932,8 @@ public class ManifestController extends BasicController { @@ -929,8 +932,8 @@ public class ManifestController extends BasicController {
929 model.setStatus(500); 932 model.setStatus(500);
930 model.setMsg("该订单号已存在!"); 933 model.setMsg("该订单号已存在!");
931 } else { 934 } else {
932 - String responseCode = manifest.getResponse_code();  
933 - int resCode = NumKit.parseInt(responseCode); 935 + // String responseCode = manifest.getResponse_code();
  936 + // int resCode = NumKit.parseInt(responseCode);
934 // WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode); 937 // WaybillReceiptType oldType = WaybillReceiptType.valueOf(resCode);
935 // WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE : 938 // WaybillReceiptType type = oldType != null ? WaybillReceiptType.UPDATE :
936 // WaybillReceiptType.APPLY; 939 // WaybillReceiptType.APPLY;
@@ -947,18 +950,16 @@ public class ManifestController extends BasicController { @@ -947,18 +950,16 @@ public class ManifestController extends BasicController {
947 receiptService.saveFromManifest(manifest, type); 950 receiptService.saveFromManifest(manifest, type);
948 951
949 // 生成报文并且发送 952 // 生成报文并且发送
950 - // String rootPath = request.getSession().getServletContext().getRealPath("/");  
951 - // String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";  
952 - String ndlrPath = CustomMessageKit.getMessagePath("ndlr");  
953 - String dlcPath = CustomMessageKit.getMessagePath("dlc");  
954 - String sliPath = CustomMessageKit.getMessagePath("sli"); 953 + String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
  954 + String dlcPath = MessageKit.getMessagePath(MessageType.DLCF);
  955 + String sliPath = MessageKit.getMessagePath(MessageType.SLI);
955 956
956 String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), ndlrPath); 957 String ndlrxml = XmlUtil.convertToXml2(manifestService.sendNDLRXml(manifest), ndlrPath);
957 String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), dlcPath); 958 String dlcfxml = XmlUtil.convertToXml2(manifestService.sendDLCFXml(manifest), dlcPath);
958 String slifxml = XmlUtil.convertToXml2(FSXmlKit.sliXml(manifest), sliPath); 959 String slifxml = XmlUtil.convertToXml2(FSXmlKit.sliXml(manifest), sliPath);
959 960
960 - RemoteFileKit.putFile(ndlrPath);  
961 - RemoteFileKit.putFile(dlcPath); 961 + // RemoteFileKit.putFile(ndlrPath);
  962 + // RemoteFileKit.putFile(dlcPath);
962 // RemoteFileKit.putFile(sliPath); 963 // RemoteFileKit.putFile(sliPath);
963 964
964 System.err.println("===================ndlrxml==================="); 965 System.err.println("===================ndlrxml===================");
@@ -1070,8 +1071,8 @@ public class ManifestController extends BasicController { @@ -1070,8 +1071,8 @@ public class ManifestController extends BasicController {
1070 preparesecondary.setCarrier(carrier); 1071 preparesecondary.setCarrier(carrier);
1071 preparesecondary.setFlightno(flightno); 1072 preparesecondary.setFlightno(flightno);
1072 1073
1073 - consigneeService.saveFromPreparesecondary(preparesecondary, Tools.getUserId());  
1074 - consignorService.saveFromPreparesecondary(preparesecondary, Tools.getUserId()); 1074 +// consigneeService.saveFromPreparesecondary(preparesecondary, Tools.getUserId());
  1075 +// consignorService.saveFromPreparesecondary(preparesecondary, Tools.getUserId());
1075 1076
1076 ResponseModel model = new ResponseModel(); 1077 ResponseModel model = new ResponseModel();
1077 try { 1078 try {
@@ -1106,18 +1107,20 @@ public class ManifestController extends BasicController { @@ -1106,18 +1107,20 @@ public class ManifestController extends BasicController {
1106 PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id); 1107 PreparesecondaryEntity preparesecondary = preparesecondaryServer.findOne(id);
1107 if (preparesecondary != null) { 1108 if (preparesecondary != null) {
1108 try { 1109 try {
1109 - WaybillReceiptType type = WaybillReceiptType.DELETE;  
1110 1110
1111 - String rootPath = request.getSession().getServletContext().getRealPath("/");  
1112 - String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";  
1113 - String ndlrxml = XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary),  
1114 - path); 1111 + // String rootPath = request.getSession().getServletContext().getRealPath("/");
  1112 + // String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";
  1113 + // String ndlrxml =
  1114 + // XmlUtil.convertToXml2(manifestService.backoutpresenddlcfNdlrXml(preparesecondary),
  1115 + // path);
1115 // String dlcfxml = 1116 // String dlcfxml =
1116 // XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), 1117 // XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary),
1117 // path); 1118 // path);
1118 1119
1119 // System.out.println(ndlrxml); 1120 // System.out.println(ndlrxml);
1120 - new RedisSaveMessage().saveMessage(ndlrxml); 1121 + // new RedisSaveMessage().saveMessage(ndlrxml);
  1122 +
  1123 + WaybillReceiptType type = WaybillReceiptType.DELETE;
1121 preparesecondary.setResponse_text("分单——" + type.getName()); 1124 preparesecondary.setResponse_text("分单——" + type.getName());
1122 preparesecondary.setResponse_code(String.valueOf(type.getValue())); 1125 preparesecondary.setResponse_code(String.valueOf(type.getValue()));
1123 preparesecondaryServer.save(preparesecondary); 1126 preparesecondaryServer.save(preparesecondary);
@@ -1150,8 +1153,8 @@ public class ManifestController extends BasicController { @@ -1150,8 +1153,8 @@ public class ManifestController extends BasicController {
1150 preparesecondary.setCarrier(carrier); 1153 preparesecondary.setCarrier(carrier);
1151 preparesecondary.setFlightno(flightno); 1154 preparesecondary.setFlightno(flightno);
1152 1155
1153 - consigneeService.saveFromPreparesecondary(preparesecondary, Tools.getUserId());  
1154 - consignorService.saveFromPreparesecondary(preparesecondary, Tools.getUserId()); 1156 +// consigneeService.saveFromPreparesecondary(preparesecondary, Tools.getUserId());
  1157 +// consignorService.saveFromPreparesecondary(preparesecondary, Tools.getUserId());
1155 1158
1156 ResponseModel model = new ResponseModel(); 1159 ResponseModel model = new ResponseModel();
1157 try { 1160 try {
@@ -1176,18 +1179,16 @@ public class ManifestController extends BasicController { @@ -1176,18 +1179,16 @@ public class ManifestController extends BasicController {
1176 receiptService.saveFromPreparesecondary(preparesecondary, type); 1179 receiptService.saveFromPreparesecondary(preparesecondary, type);
1177 1180
1178 // 生成报文并且发送 1181 // 生成报文并且发送
1179 - // String rootPath = request.getSession().getServletContext().getRealPath("/");  
1180 - // String path = rootPath + "/excel/manifest" + new Date().getTime() + ".xml";  
1181 - String ndlrPath = CustomMessageKit.getMessagePath("ndlr");  
1182 - String dlcPath = CustomMessageKit.getMessagePath("dlc");  
1183 - String fhlPath = CustomMessageKit.getMessagePath("fhl"); 1182 + String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
  1183 + String dlcPath = MessageKit.getMessagePath(MessageType.DLCF);
  1184 + String fhlPath = MessageKit.getMessagePath(MessageType.FHL);
1184 1185
1185 String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(preparesecondary), ndlrPath); 1186 String ndlrxml = XmlUtil.convertToXml2(manifestService.presenddlcfNdlrXml(preparesecondary), ndlrPath);
1186 String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), dlcPath); 1187 String dlcfxml = XmlUtil.convertToXml2(manifestService.presenddlcfdlcfXml(preparesecondary), dlcPath);
1187 String fhlfxml = XmlUtil.convertToXml2(FSXmlKit.fhlXml(preparesecondary), fhlPath); 1188 String fhlfxml = XmlUtil.convertToXml2(FSXmlKit.fhlXml(preparesecondary), fhlPath);
1188 1189
1189 - RemoteFileKit.putFile(ndlrPath);  
1190 - RemoteFileKit.putFile(dlcPath); 1190 + // RemoteFileKit.putFile(ndlrPath);
  1191 + // RemoteFileKit.putFile(dlcPath);
1191 // RemoteFileKit.putFile(fhlPath); 1192 // RemoteFileKit.putFile(fhlPath);
1192 1193
1193 // 发送redis储存数据 1194 // 发送redis储存数据
@@ -290,7 +290,7 @@ public class ManifestEntity extends BasicEntity implements Serializable { @@ -290,7 +290,7 @@ public class ManifestEntity extends BasicEntity implements Serializable {
290 private Long USER_ID; // 报文所属的用户id 290 private Long USER_ID; // 报文所属的用户id
291 291
292 public String getUnlodingcode() { 292 public String getUnlodingcode() {
293 - return unlodingcode; 293 + return StringUtils.isBlank(unlodingcode)?getDestinationstation():unlodingcode;
294 } 294 }
295 295
296 public void setUnlodingcode(String unlodingcode) { 296 public void setUnlodingcode(String unlodingcode) {
@@ -537,7 +537,7 @@ public class ManifestEntity extends BasicEntity implements Serializable { @@ -537,7 +537,7 @@ public class ManifestEntity extends BasicEntity implements Serializable {
537 537
538 @Column(name = "PREPARETOTALPIECE") 538 @Column(name = "PREPARETOTALPIECE")
539 public String getPreparetotalpiece() { 539 public String getPreparetotalpiece() {
540 - return preparetotalpiece; 540 + return StringUtils.isBlank(preparetotalpiece)?getTotalpiece():preparetotalpiece;
541 } 541 }
542 542
543 public void setPreparetotalpiece(String preparetotalpiece) { 543 public void setPreparetotalpiece(String preparetotalpiece) {
@@ -546,7 +546,7 @@ public class ManifestEntity extends BasicEntity implements Serializable { @@ -546,7 +546,7 @@ public class ManifestEntity extends BasicEntity implements Serializable {
546 546
547 @Column(name = "PREPARETOTALWEIGHT") 547 @Column(name = "PREPARETOTALWEIGHT")
548 public String getPreparetotalweight() { 548 public String getPreparetotalweight() {
549 - return preparetotalweight; 549 + return StringUtils.isBlank(preparetotalweight)?getTotalweight():preparetotalweight;
550 } 550 }
551 551
552 public void setPreparetotalweight(String preparetotalweight) { 552 public void setPreparetotalweight(String preparetotalweight) {
@@ -879,7 +879,7 @@ public class ManifestEntity extends BasicEntity implements Serializable { @@ -879,7 +879,7 @@ public class ManifestEntity extends BasicEntity implements Serializable {
879 879
880 @Column(name = "REACH_STATION") 880 @Column(name = "REACH_STATION")
881 public String getReach_station() { 881 public String getReach_station() {
882 - return reach_station; 882 + return StringUtils.isBlank(reach_station)?getDestinationstation():reach_station;
883 } 883 }
884 884
885 public void setReach_station(String reach_station) { 885 public void setReach_station(String reach_station) {
@@ -299,7 +299,7 @@ public class PreparesecondaryEntity extends BasicEntity { @@ -299,7 +299,7 @@ public class PreparesecondaryEntity extends BasicEntity {
299 private Long USER_ID; 299 private Long USER_ID;
300 300
301 public String getUnlodingcode() { 301 public String getUnlodingcode() {
302 - return unlodingcode; 302 + return StringUtils.isBlank(unlodingcode)?getDestinationstation():unlodingcode;
303 } 303 }
304 304
305 public void setUnlodingcode(String unlodingcode) { 305 public void setUnlodingcode(String unlodingcode) {
@@ -538,7 +538,7 @@ public class PreparesecondaryEntity extends BasicEntity { @@ -538,7 +538,7 @@ public class PreparesecondaryEntity extends BasicEntity {
538 538
539 @Column(name = "PREPAREPIECE") 539 @Column(name = "PREPAREPIECE")
540 public String getPreparepiece() { 540 public String getPreparepiece() {
541 - return preparepiece; 541 + return StringUtils.isBlank(preparepiece)?getTotalpiece():preparepiece;
542 } 542 }
543 543
544 public void setPreparepiece(String preparepiece) { 544 public void setPreparepiece(String preparepiece) {
@@ -547,7 +547,7 @@ public class PreparesecondaryEntity extends BasicEntity { @@ -547,7 +547,7 @@ public class PreparesecondaryEntity extends BasicEntity {
547 547
548 @Column(name = "PREPAREWEIGHT") 548 @Column(name = "PREPAREWEIGHT")
549 public String getPrepareweight() { 549 public String getPrepareweight() {
550 - return prepareweight; 550 + return StringUtils.isBlank(prepareweight)?getTotalweight():prepareweight;
551 } 551 }
552 552
553 public void setPrepareweight(String prepareweight) { 553 public void setPrepareweight(String prepareweight) {
@@ -916,7 +916,7 @@ public class PreparesecondaryEntity extends BasicEntity { @@ -916,7 +916,7 @@ public class PreparesecondaryEntity extends BasicEntity {
916 916
917 @Column(name = "REACH_STATION") 917 @Column(name = "REACH_STATION")
918 public String getReach_station() { 918 public String getReach_station() {
919 - return reach_station; 919 + return StringUtils.isBlank(reach_station)?getDestinationstation():reach_station;
920 } 920 }
921 921
922 public void setReach_station(String reach_station) { 922 public void setReach_station(String reach_station) {
@@ -19,7 +19,8 @@ import com.agent.service.BasicService; @@ -19,7 +19,8 @@ import com.agent.service.BasicService;
19 import com.agent.smb.RemoteFileKit; 19 import com.agent.smb.RemoteFileKit;
20 import com.agent.xml.common.XmlUtil; 20 import com.agent.xml.common.XmlUtil;
21 import com.agent.xml.manifestdeclare.DeclareXmlBody; 21 import com.agent.xml.manifestdeclare.DeclareXmlBody;
22 -import com.framework.util.CustomMessageKit; 22 +import com.framework.util.MessageKit;
  23 +import com.framework.util.MessageType;
23 import com.google.common.base.Splitter; 24 import com.google.common.base.Splitter;
24 25
25 import tools.Tools; 26 import tools.Tools;
@@ -126,9 +127,14 @@ public class WaybillReceiptService extends BasicService<WaybillReceiptEntity> { @@ -126,9 +127,14 @@ public class WaybillReceiptService extends BasicService<WaybillReceiptEntity> {
126 if (type != WaybillReceiptType.TEMP_SAVE) { 127 if (type != WaybillReceiptType.TEMP_SAVE) {
127 ManifestService mbs = new ManifestService(); 128 ManifestService mbs = new ManifestService();
128 DeclareXmlBody dpxb = mbs.generateWaybillReceiptXml(manifest, type, null); 129 DeclareXmlBody dpxb = mbs.generateWaybillReceiptXml(manifest, type, null);
129 - String dpxbPath = CustomMessageKit.getMessagePath("manifest");  
130 - XmlUtil.convertToXml2(dpxb, dpxbPath);  
131 - RemoteFileKit.putFile(dpxbPath); 130 + String dpxbPath = MessageKit
  131 + .getMessagePath(type != WaybillReceiptType.DELETE ? MessageType.RECEIPT : MessageType.DELETE);
  132 + String deletexml = XmlUtil.convertToXml2(dpxb, dpxbPath);
  133 + if (type == WaybillReceiptType.DELETE) {
  134 + System.out.println("===================deletexml===================");
  135 + System.out.println(deletexml);
  136 + RemoteFileKit.putFile(dpxbPath);
  137 + }
132 } 138 }
133 } 139 }
134 } 140 }
@@ -160,9 +166,15 @@ public class WaybillReceiptService extends BasicService<WaybillReceiptEntity> { @@ -160,9 +166,15 @@ public class WaybillReceiptService extends BasicService<WaybillReceiptEntity> {
160 if (type != WaybillReceiptType.TEMP_SAVE) { 166 if (type != WaybillReceiptType.TEMP_SAVE) {
161 ManifestService mbs = new ManifestService(); 167 ManifestService mbs = new ManifestService();
162 DeclareXmlBody dpxb = mbs.generateWaybillReceiptXml(prepare, type, null); 168 DeclareXmlBody dpxb = mbs.generateWaybillReceiptXml(prepare, type, null);
163 - String dpxbPath = CustomMessageKit.getMessagePath("secondary");  
164 - XmlUtil.convertToXml2(dpxb, dpxbPath);  
165 - RemoteFileKit.putFile(dpxbPath); 169 + String dpxbPath = MessageKit
  170 + .getMessagePath(type != WaybillReceiptType.DELETE ? MessageType.RECEIPT : MessageType.DELETE);
  171 + String deletexml = XmlUtil.convertToXml2(dpxb, dpxbPath);
  172 + if (type == WaybillReceiptType.DELETE) {
  173 + System.out.println("===================deletexml===================");
  174 + System.out.println(deletexml);
  175 +
  176 + RemoteFileKit.putFile(dpxbPath);
  177 + }
166 } 178 }
167 } else { 179 } else {
168 System.err.println("prepare is null"); 180 System.err.println("prepare is null");
@@ -8,7 +8,7 @@ import java.io.IOException; @@ -8,7 +8,7 @@ import java.io.IOException;
8 import java.io.InputStream; 8 import java.io.InputStream;
9 import java.io.OutputStream; 9 import java.io.OutputStream;
10 10
11 -import com.framework.util.CustomMessageKit; 11 +import com.framework.util.MessageKit;
12 12
13 import jcifs.smb.SmbFile; 13 import jcifs.smb.SmbFile;
14 import jcifs.smb.SmbFileOutputStream; 14 import jcifs.smb.SmbFileOutputStream;
@@ -24,7 +24,7 @@ import jcifs.smb.SmbFileOutputStream; @@ -24,7 +24,7 @@ import jcifs.smb.SmbFileOutputStream;
24 * 24 *
25 */ 25 */
26 public class RemoteFileKit { 26 public class RemoteFileKit {
27 - private static final String REMOTE_DIR = CustomMessageKit.getMessageSmbRemoteDir(); 27 + private static final String REMOTE_DIR = MessageKit.getMessageSmbRemoteDir();
28 28
29 public RemoteFileKit() { 29 public RemoteFileKit() {
30 } 30 }
@@ -4,11 +4,15 @@ import java.text.SimpleDateFormat; @@ -4,11 +4,15 @@ import java.text.SimpleDateFormat;
4 import java.util.Date; 4 import java.util.Date;
5 import java.util.Locale; 5 import java.util.Locale;
6 6
  7 +import javax.annotation.Resource;
  8 +
7 import org.apache.commons.lang.StringUtils; 9 import org.apache.commons.lang.StringUtils;
8 10
9 import com.agent.entity.Constant; 11 import com.agent.entity.Constant;
  12 +import com.agent.entity.agent.BasicAgentEntity;
10 import com.agent.entity.agent.ManifestEntity; 13 import com.agent.entity.agent.ManifestEntity;
11 import com.agent.entity.agent.PreparesecondaryEntity; 14 import com.agent.entity.agent.PreparesecondaryEntity;
  15 +import com.agent.service.agent.BasicAgentService;
12 import com.agent.xml.fhlsli.common.ApplicableFreightRateServiceCharge; 16 import com.agent.xml.fhlsli.common.ApplicableFreightRateServiceCharge;
13 import com.agent.xml.fhlsli.common.ArrivalEvent; 17 import com.agent.xml.fhlsli.common.ArrivalEvent;
14 import com.agent.xml.fhlsli.common.AssociatedParty; 18 import com.agent.xml.fhlsli.common.AssociatedParty;
@@ -49,6 +53,8 @@ import com.agent.xml.fhlsli.sli.IncludedMasterConsignmentItem; @@ -49,6 +53,8 @@ import com.agent.xml.fhlsli.sli.IncludedMasterConsignmentItem;
49 import com.agent.xml.fhlsli.sli.ReportedStatus; 53 import com.agent.xml.fhlsli.sli.ReportedStatus;
50 import com.agent.xml.fhlsli.sli.SliMasterConsignment; 54 import com.agent.xml.fhlsli.sli.SliMasterConsignment;
51 55
  56 +import tools.Tools;
  57 +
52 /** 58 /**
53 * Depiction:给天信达用 59 * Depiction:给天信达用
54 * <p> 60 * <p>
@@ -60,6 +66,25 @@ import com.agent.xml.fhlsli.sli.SliMasterConsignment; @@ -60,6 +66,25 @@ import com.agent.xml.fhlsli.sli.SliMasterConsignment;
60 * 66 *
61 */ 67 */
62 public class FSXmlKit { 68 public class FSXmlKit {
  69 +
  70 + @Resource
  71 + private static BasicAgentService agentService;
  72 +
  73 + private static BasicAgentEntity getAgent() {
  74 + BasicAgentEntity agent = agentService.findOne(Tools.getUserId());
  75 + if(agent==null) {
  76 + agent = new BasicAgentEntity();
  77 + }
  78 + if(StringUtils.isBlank(agent.getThreeCode())){
  79 + agent.setThreeCode("");
  80 + }
  81 +
  82 + if(StringUtils.isBlank(agent.getNameCn())){
  83 + agent.setNameCn("");
  84 + }
  85 +
  86 + return agent;
  87 + }
63 88
64 private static String getDateWithZone() { 89 private static String getDateWithZone() {
65 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.CHINA); 90 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.CHINA);
@@ -128,7 +153,8 @@ public class FSXmlKit { @@ -128,7 +153,8 @@ public class FSXmlKit {
128 sliMasterConsignment.setConsigneeParty(consigneeParty); 153 sliMasterConsignment.setConsigneeParty(consigneeParty);
129 154
130 FreightForwarderParty freightForwarderParty = new FreightForwarderParty(); 155 FreightForwarderParty freightForwarderParty = new FreightForwarderParty();
131 - freightForwarderParty.setName(me.getAgentman()); 156 +// freightForwarderParty.setPrimaryID(getAgent().getThreeCode());//代理人代码
  157 +// freightForwarderParty.setName(getAgent().getNameEn());//代理人名称
132 PostalStructuredAddress agentdAddress = new PostalStructuredAddress(); 158 PostalStructuredAddress agentdAddress = new PostalStructuredAddress();
133 agentdAddress.setCityName(""); 159 agentdAddress.setCityName("");
134 agentdAddress.setCountryID(""); 160 agentdAddress.setCountryID("");
@@ -136,7 +162,9 @@ public class FSXmlKit { @@ -136,7 +162,9 @@ public class FSXmlKit {
136 sliMasterConsignment.setFreightForwarderParty(freightForwarderParty); 162 sliMasterConsignment.setFreightForwarderParty(freightForwarderParty);
137 163
138 AssociatedParty associatedParty = new AssociatedParty(); 164 AssociatedParty associatedParty = new AssociatedParty();
139 - associatedParty.setName(me.getAgentcompany()); 165 +
  166 + associatedParty.setPrimaryID(getAgent().getThreeCode());//代理人代码
  167 + associatedParty.setName(getAgent().getNameEn());//代理人名称
140 associatedParty.setPostalStructuredAddress(agentdAddress); 168 associatedParty.setPostalStructuredAddress(agentdAddress);
141 sliMasterConsignment.setAssociatedParty(associatedParty); 169 sliMasterConsignment.setAssociatedParty(associatedParty);
142 170
@@ -184,9 +212,9 @@ public class FSXmlKit { @@ -184,9 +212,9 @@ public class FSXmlKit {
184 212
185 HandlingInstructions handlingInstructions = new HandlingInstructions(); 213 HandlingInstructions handlingInstructions = new HandlingInstructions();
186 //特货代码 214 //特货代码
187 -// handlingInstructions.setDescriptionCode(me.getSpecialgoodscode()!=null?me.getSpecialgoodscode():""); 215 + handlingInstructions.setDescriptionCode(me.getSpecialgoodscode()!=null?me.getSpecialgoodscode():"");
188 //特货描述 216 //特货描述
189 -// handlingInstructions.setDescription(me.getSpecialgoods); 217 + handlingInstructions.setDescription("");
190 sliMasterConsignment.setHandlingInstructions(handlingInstructions); 218 sliMasterConsignment.setHandlingInstructions(handlingInstructions);
191 219
192 AssociatedReferenceDocument associatedReferenceDocument = new AssociatedReferenceDocument(); 220 AssociatedReferenceDocument associatedReferenceDocument = new AssociatedReferenceDocument();
@@ -346,7 +374,9 @@ public class FSXmlKit { @@ -346,7 +374,9 @@ public class FSXmlKit {
346 includedHouseConsignment.setConsigneeParty(consigneeParty); 374 includedHouseConsignment.setConsigneeParty(consigneeParty);
347 375
348 FreightForwarderParty freightForwarderParty = new FreightForwarderParty(); 376 FreightForwarderParty freightForwarderParty = new FreightForwarderParty();
349 - freightForwarderParty.setName(pe.getAgentman()); 377 +// freightForwarderParty.setPrimaryID(getAgent().getThreeCode());//代理人代码
  378 +// freightForwarderParty.setName(getAgent().getNameEn());//代理人名称
  379 +
350 PostalStructuredAddress agentdAddress = new PostalStructuredAddress(); 380 PostalStructuredAddress agentdAddress = new PostalStructuredAddress();
351 agentdAddress.setCityName(""); 381 agentdAddress.setCityName("");
352 agentdAddress.setCountryID(""); 382 agentdAddress.setCountryID("");
@@ -354,7 +384,8 @@ public class FSXmlKit { @@ -354,7 +384,8 @@ public class FSXmlKit {
354 includedHouseConsignment.setFreightForwarderParty(freightForwarderParty); 384 includedHouseConsignment.setFreightForwarderParty(freightForwarderParty);
355 385
356 AssociatedParty associatedParty = new AssociatedParty(); 386 AssociatedParty associatedParty = new AssociatedParty();
357 - associatedParty.setName(pe.getAgentcompany()); 387 + associatedParty.setPrimaryID(getAgent().getThreeCode());//代理人代码
  388 + associatedParty.setName(getAgent().getNameEn());//代理人名称
358 associatedParty.setPostalStructuredAddress(agentdAddress); 389 associatedParty.setPostalStructuredAddress(agentdAddress);
359 includedHouseConsignment.setAssociatedParty(associatedParty); 390 includedHouseConsignment.setAssociatedParty(associatedParty);
360 391
@@ -400,8 +431,8 @@ public class FSXmlKit { @@ -400,8 +431,8 @@ public class FSXmlKit {
400 includedHouseConsignment.setSpecifiedLogisticsTransportMovement(transport); 431 includedHouseConsignment.setSpecifiedLogisticsTransportMovement(transport);
401 432
402 HandlingInstructions handlingInstructions = new HandlingInstructions(); 433 HandlingInstructions handlingInstructions = new HandlingInstructions();
403 - handlingInstructions.setDescriptionCode(pe.getSpecialgoodscode());  
404 - handlingInstructions.setDescription(pe.getSpecialgoodscode()); 434 + handlingInstructions.setDescriptionCode(pe.getSpecialgoodscode());//特货代码
  435 +// handlingInstructions.setDescription(pe.getSpecialgoodscode());//特货描述
405 includedHouseConsignment.setHandlingInstructions(handlingInstructions); 436 includedHouseConsignment.setHandlingInstructions(handlingInstructions);
406 437
407 IncludedAccountingNote includedAccountingNote = new IncludedAccountingNote(); 438 IncludedAccountingNote includedAccountingNote = new IncludedAccountingNote();
@@ -13,7 +13,7 @@ import java.util.Date; @@ -13,7 +13,7 @@ import java.util.Date;
13 * Create Date:2018年6月7日 下午3:45:16 13 * Create Date:2018年6月7日 下午3:45:16
14 * 14 *
15 */ 15 */
16 -public class CustomMessageKit { 16 +public class MessageKit {
17 17
18 // smb://mrz:vmvnv1v2VV@10.50.3.61/nms_customs_xml2/ 18 // smb://mrz:vmvnv1v2VV@10.50.3.61/nms_customs_xml2/
19 public static String getMessageSmbRemoteDir() { 19 public static String getMessageSmbRemoteDir() {
@@ -30,8 +30,8 @@ public class CustomMessageKit { @@ -30,8 +30,8 @@ public class CustomMessageKit {
30 return sb.toString(); 30 return sb.toString();
31 } 31 }
32 32
33 - public static String getMessageLocalDir() {  
34 - String dirPath = PropertiesLoader.get("custom.message.localdir", "/application.properties"); 33 + public static String getMessageLocalDir(MessageType type) {
  34 + String dirPath = PropertiesLoader.get("custom.message.localdir." + type.getName(), "/application.properties");
35 File dir = new File(dirPath); 35 File dir = new File(dirPath);
36 if (dir == null || !dir.exists()) { 36 if (dir == null || !dir.exists()) {
37 dir.mkdirs(); 37 dir.mkdirs();
@@ -39,14 +39,10 @@ public class CustomMessageKit { @@ -39,14 +39,10 @@ public class CustomMessageKit {
39 return dirPath; 39 return dirPath;
40 } 40 }
41 41
42 - public static String getMessagePath(String prefix) {  
43 - return getMessageLocalDir() + "/" + prefix + "_" + getMessageName(); 42 + public static String getMessagePath(MessageType type) {
  43 + return getMessageLocalDir(type) + "/" + getMessageName();
44 } 44 }
45 45
46 -// public static String getMessagePath() {  
47 -// return getMessageLocalDir() + "/" + getMessageName();  
48 -// }  
49 -  
50 public static String getMessageName() { 46 public static String getMessageName() {
51 return "CN_MT2201_1P0_4604_70678920X_" + TimeUtils.getDate(new Date(), "yyyyMMddHHmmssSSS") + ".xml"; 47 return "CN_MT2201_1P0_4604_70678920X_" + TimeUtils.getDate(new Date(), "yyyyMMddHHmmssSSS") + ".xml";
52 } 48 }
  1 +package com.framework.util;
  2 +
  3 +/**
  4 + * Depiction:报文类型
  5 + * <p>
  6 + * Modify:
  7 + * <p>
  8 + * Author: Kevin Lynn
  9 + * <p>
  10 + * Create Date:2018年2月13日 上午11:53:15
  11 + *
  12 + */
  13 +public enum MessageType {
  14 + NDLR("ndlr", 1), DLCF("dlcf", 2), SLI("sli", 3), FHL("fhl", 4), RECEIPT("receipt", 5),DELETE("delete", 6);;
  15 +
  16 + private String name;
  17 + private int value;
  18 +
  19 + private MessageType(String name, int value) {
  20 + this.name = name;
  21 + this.value = value;
  22 + }
  23 +
  24 + public static String getName(int value) {
  25 + for (MessageType role : MessageType.values()) {
  26 + if (role.getValue() == value) {
  27 + return role.name;
  28 + }
  29 + }
  30 + return null;
  31 + }
  32 +
  33 + public static MessageType valueOf(int value) {
  34 + for (MessageType role : MessageType.values()) {
  35 + if (role.getValue() == value) {
  36 + return role;
  37 + }
  38 + }
  39 + return null;
  40 + }
  41 +
  42 + public String getName() {
  43 + return name;
  44 + }
  45 +
  46 + public void setName(String name) {
  47 + this.name = name;
  48 + }
  49 +
  50 + public int getValue() {
  51 + return value;
  52 + }
  53 +
  54 + public void setValue(int value) {
  55 + this.value = value;
  56 + }
  57 +
  58 + @Override
  59 + public String toString() {
  60 + return "(" + this.value + "," + this.name + ")";
  61 + }
  62 +}
@@ -27,7 +27,12 @@ service.xquery=BA8EC @@ -27,7 +27,12 @@ service.xquery=BA8EC
27 #custom.message.localdir=/Users/Kevin/Desktop/agent/message 27 #custom.message.localdir=/Users/Kevin/Desktop/agent/message
28 28
29 #server 29 #server
30 -custom.message.localdir=/home/agent_xml 30 +custom.message.localdir.receipt=/home/agent_xml/receipt
  31 +custom.message.localdir.ndlr=/home/agent_xml/ndlr
  32 +custom.message.localdir.dlcf=/home/agent_xml/dlcf
  33 +custom.message.localdir.sli=/home/agent_xml/sli
  34 +custom.message.localdir.fhl=/home/agent_xml/fhl
  35 +custom.message.localdir.delete=/home/agent_xml/delete
31 36
32 custom.message.username=mrz 37 custom.message.username=mrz
33 custom.message.password=vmvnv1v2VV 38 custom.message.password=vmvnv1v2VV
不能预览此文件类型
@@ -14,9 +14,9 @@ @@ -14,9 +14,9 @@
14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
15 <meta name="viewport" content="width=device-width, initial-scale=1"> 15 <meta name="viewport" content="width=device-width, initial-scale=1">
16 <title><spring:message code="menu.consignee_info_set" /></title> 16 <title><spring:message code="menu.consignee_info_set" /></title>
17 -<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js"></script>  
18 -<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js"></script>  
19 -<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js"></script> 17 +<script type="text/javascript" src="<%=basePath%>resource/easyui/jquery.min.js?version=${version}"></script>
  18 +<script type="text/javascript" src="<%=basePath%>resource/validate/jquery.validate.js?version=${version}"></script>
  19 +<script type="text/javascript" src="<%=basePath%>resource/validate/validate-extends.js?version=${version}"></script>
20 <!-- validate 验证中英文 --> 20 <!-- validate 验证中英文 -->
21 <script type="text/javascript" 21 <script type="text/javascript"
22 src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js?version=${version}"></script> 22 src="<%=basePath %>resource/validate/jquery.validate-${pageContext.response.locale}.js?version=${version}"></script>
@@ -29,11 +29,11 @@ @@ -29,11 +29,11 @@
29 <link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css?version=${version}"> 29 <link rel="stylesheet" href="<%=basePath%>resource/easyui/uimaker/easyui.css?version=${version}">
30 30
31 <style type="text/css"> 31 <style type="text/css">
32 -.required_span {  
33 - color: red;  
34 - margin-left: 10px;  
35 - font-size: 20px;  
36 -} 32 + .required_span {
  33 + color: red;
  34 + margin-left: 10px;
  35 + font-size: 20px;
  36 + }
37 </style> 37 </style>
38 </head> 38 </head>
39 <body> 39 <body>
@@ -45,38 +45,28 @@ @@ -45,38 +45,28 @@
45 <tbody> 45 <tbody>
46 <tr> 46 <tr>
47 <td><spring:message code="manifest.company" /><span class="required_span">*</span></td> 47 <td><spring:message code="manifest.company" /><span class="required_span">*</span></td>
48 - <td colspan="5">  
49 - <input type="text" name="name" id="name" maxlength="70" lay-verify="required"  
50 - value="${consignee.name}" autocomplete="off" class="layui-input" required  
51 - oninput="onInputChange(event,'name','oninput')" lay-verify="required"  
52 - onpropertychange="onInputChange(event,'name','onpropertychange')">  
53 - </td> 48 + <td colspan="5"><input type="text" name="name" id="name" maxlength="70"
  49 + value="${consignee.name}" autocomplete="off" class="layui-input" required lay-verify="required"
  50 + oninput="onInputChange(event,'name','oninput')"
  51 + onpropertychange="onInputChange(event,'name','onpropertychange')"></td>
54 </tr> 52 </tr>
55 53
56 <tr> 54 <tr>
57 <td><spring:message code="manifest.shr.name" /><span class="required_span">*</span></td> 55 <td><spring:message code="manifest.shr.name" /><span class="required_span">*</span></td>
58 - <td>  
59 - <input type="text" name="code" id="code" value="${consignee.code}"  
60 - maxlength="70" autocomplete="off" class="layui-input" required lay-verify="required" 56 + <td><input type="text" id="code" name="code" value="${consignee.code}" maxlength="70"
  57 + autocomplete="off" class="layui-input" required lay-verify="required"
61 oninput="onInputChange(event,'code','oninput')" 58 oninput="onInputChange(event,'code','oninput')"
62 - onpropertychange="onInputChange(event,'code','onpropertychange')">  
63 - </td>  
64 - 59 + onpropertychange="onInputChange(event,'code','onpropertychange')"></td>
65 <td><spring:message code="manifest.telephone" /></td> 60 <td><spring:message code="manifest.telephone" /></td>
66 - <td>  
67 - <input type="text" name="tel" id="tel" value="${consignee.tel}"  
68 - autocomplete="off" class="layui-input" maxlength="50"  
69 - oninput="onInputChange(event,'tel','oninput')"  
70 - onpropertychange="onInputChange(event,'tel','onpropertychange')">  
71 - </td>  
72 - 61 + <td><input type="text" name="tel" id="tel"
  62 + oninput="onInputChange(event,'tel','oninput')"
  63 + onpropertychange="onInputChange(event,'tel','onpropertychange')"
  64 + value="${consignee.tel}" autocomplete="off" class="layui-input" maxlength="50"></td>
73 <td><spring:message code="manifest.fax" /></td> 65 <td><spring:message code="manifest.fax" /></td>
74 - <td>  
75 - <input type="text" name="fax" id="fax" value="${consignee.fax}"  
76 - oninput="onInputChange(event,'fax','oninput')"  
77 - onpropertychange="onInputChange(event,'fax','onpropertychange')"  
78 - autocomplete="off" class="layui-input" maxlength="50">  
79 - </td> 66 + <td><input type="text" name="fax" id="fax" value="${consignee.fax}"
  67 + autocomplete="off" class="layui-input" maxlength="50"
  68 + oninput="onInputChange(event,'fax','oninput')"
  69 + onpropertychange="onInputChange(event,'fax','onpropertychange')"></td>
80 </tr> 70 </tr>
81 71
82 <tr> 72 <tr>
@@ -84,65 +74,46 @@ @@ -84,65 +74,46 @@
84 <td> 74 <td>
85 <input required lay-verify="required" class="layui-input" 75 <input required lay-verify="required" class="layui-input"
86 id="country" name="country" maxlength="2" type="text" 76 id="country" name="country" maxlength="2" type="text"
87 - <c:if test="${empty consignee.country}">value=""</c:if> 77 + <c:if test="${empty consignee.country}">value="CN"</c:if>
88 <c:if test="${not empty consignee.country}">value="${consignee.country}"</c:if> 78 <c:if test="${not empty consignee.country}">value="${consignee.country}"</c:if>
89 oninput="onInputChange(event,'country','oninput')" 79 oninput="onInputChange(event,'country','oninput')"
90 - onpropertychange="onInputChange(event,'country','onpropertychange')"> 80 + onpropertychange="onInputChange(event,'country','onpropertychange')">
91 </td> 81 </td>
92 -  
93 <td><spring:message code="manifest.city" /><span class="required_span">*</span></td> 82 <td><spring:message code="manifest.city" /><span class="required_span">*</span></td>
94 <td> 83 <td>
95 - <input required type="text" name="city" id="city" value="${consignee.city}"  
96 - autocomplete="off" class="layui-input" required lay-verify="required" maxlength="70"  
97 - oninput="onInputChange(event,'city','oninput')"  
98 - onpropertychange="onInputChange(event,'city','onpropertychange')"> 84 + <input type="text" name="city" id="city" value="${consignee.city}"
  85 + autocomplete="off" class="layui-input" required maxlength="35" lay-verify="required"
  86 + oninput="onInputChange(event,'city','oninput')"
  87 + onpropertychange="onInputChange(event,'city','onpropertychange')">
99 </td> 88 </td>
100 -  
101 <td><spring:message code="manifest.zip.code" /></td> 89 <td><spring:message code="manifest.zip.code" /></td>
102 - <td>  
103 - <input type="text" name="zipcode" id="zipcode" value="${consignee.zipcode}"  
104 - oninput="onInputChange(event,'zipcode','oninput')"  
105 - onpropertychange="onInputChange(event,'zipcode','onpropertychange')"  
106 - autocomplete="off" class="layui-input" maxlength="9">  
107 - </td> 90 + <td><input type="text" name="zipcode" id="zipcode" value="${consignee.zipcode}"
  91 + oninput="onInputChange(event,'zipcode','oninput')"
  92 + onpropertychange="onInputChange(event,'zipcode','onpropertychange')"
  93 + autocomplete="off" class="layui-input" maxlength="9"></td>
108 </tr> 94 </tr>
109 - 95 +
110 <tr> 96 <tr>
111 <td><spring:message code="manifest.address" /><span class="required_span">*</span></td> 97 <td><spring:message code="manifest.address" /><span class="required_span">*</span></td>
112 - <td colspan="2">  
113 - <input required type="text" name="address" id="address" value="${consignee.address}"  
114 - autocomplete="off" class="layui-input" maxlength="70" lay-verify="required" 98 + <td colspan="2"><input id="address" required type="text" name="address" lay-verify="required"
  99 + value="${consignee.address}" autocomplete="off" class="layui-input" maxlength="70"
115 oninput="onInputChange(event,'address','oninput')" 100 oninput="onInputChange(event,'address','oninput')"
116 - onpropertychange="onInputChange(event,'address','onpropertychange')">  
117 - </td>  
118 - 101 + onpropertychange="onInputChange(event,'address','onpropertychange')"></td>
119 <td><spring:message code="manifest.shr.cneaeo" /></td> 102 <td><spring:message code="manifest.shr.cneaeo" /></td>
120 - <td colspan="2">  
121 - <input type="text" name="aeo" id="cneaeo" 103 + <td colspan="2"><input type="text" name="aeo" id="aeo"
122 value="${consignee.aeo}" autocomplete="off" class="layui-input" maxlength="20" 104 value="${consignee.aeo}" autocomplete="off" class="layui-input" maxlength="20"
123 - oninput="onInputChange(event,'cneaeo','oninput')"  
124 - onpropertychange="onInputChange(event,'cneaeo','onpropertychange')">  
125 - </td> 105 + oninput="onInputChange(event,'aeo','oninput')"
  106 + onpropertychange="onInputChange(event,'aeo','onpropertychange')"></td>
126 </tr> 107 </tr>
127 108
128 - <%-- <tr>  
129 - <td><spring:message code="manifest.enterprise.code" /><span class="required_span">*</span></td>  
130 - <td>  
131 - <input required id="cnecusid" type="text" name="cusid" value="${consignee.cusid}"  
132 - autocomplete="off" class="layui-input" maxlength="128" lay-verify="required"  
133 - oninput="onInputChange(event,'cnecusid','oninput')"  
134 - onpropertychange="onInputChange(event,'cnecusid','onpropertychange')">  
135 - </td>  
136 - </tr> --%>  
137 -  
138 <tr> 109 <tr>
139 <td colspan="6"> 110 <td colspan="6">
140 <div class="layui-row"> 111 <div class="layui-row">
141 <div class="layui-col-md2"> 112 <div class="layui-col-md2">
142 - <select id="cne_cusid" required lay-verify="required"> 113 + <select id="co_cusid" required lay-verify="required">
143 <c:if test="${not empty consignee.cusid}"> 114 <c:if test="${not empty consignee.cusid}">
144 - <c:set var="tempCneType" value='${fn:split(consignee.cusid,"+")[0]}' />  
145 - <option value="${tempCneType}">${tempCneType}</option> 115 + <c:set var="tempShpType" value='${fn:split(consignee.cusid,"+")[0]}' />
  116 + <option value="${tempShpType}">${tempShpType}</option>
146 </c:if> 117 </c:if>
147 118
148 <c:if test="${empty consignee.cusid}"> 119 <c:if test="${empty consignee.cusid}">
@@ -154,19 +125,20 @@ @@ -154,19 +125,20 @@
154 <span style="color: black; font-size: 16px;">+</span> 125 <span style="color: black; font-size: 16px;">+</span>
155 </div> 126 </div>
156 <div class="layui-col-md5"> 127 <div class="layui-col-md5">
157 - <input id="cnecusid" type="text" maxlength="100" class="layui-input" required lay-verify="required" 128 + <input id="cusid" type="text" maxlength="100" class="layui-input" required lay-verify="required"
158 <c:if test="${not empty consignee.cusid}"> 129 <c:if test="${not empty consignee.cusid}">
159 - <c:set var="tempCneValue" value='${fn:split(consignee.cusid,"+")[1]}' />  
160 - value="${tempCneValue}" 130 + <c:set var="tempShpValue" value='${fn:split(consignee.cusid,"+")[1]}' />
  131 + value="${tempShpValue}"
161 </c:if> 132 </c:if>
162 133
163 placeholder="<spring:message code='manifest.enterprise.code' />" 134 placeholder="<spring:message code='manifest.enterprise.code' />"
164 - oninput="onInputChange(event,'cnecusid','oninput')"  
165 - onpropertychange="onInputChange(event,'cnecusid','onpropertychange')"> 135 + oninput="onInputChange(event,'cusid','oninput')"
  136 + onpropertychange="onInputChange(event,'cusid','onpropertychange')">
166 </div> 137 </div>
167 </div> 138 </div>
168 </td> 139 </td>
169 </tr> 140 </tr>
  141 +
170 </tbody> 142 </tbody>
171 </table> 143 </table>
172 144
@@ -181,7 +153,7 @@ @@ -181,7 +153,7 @@
181 </div> 153 </div>
182 154
183 <script> 155 <script>
184 - var api = "<%=basePath %>enterprise/search"; 156 + var api = "<%=basePath %>enterprise/search";
185 $('#country').combogrid({ 157 $('#country').combogrid({
186 panelWidth:260, 158 panelWidth:260,
187 url: api, 159 url: api,
@@ -196,7 +168,7 @@ @@ -196,7 +168,7 @@
196 $('#country').combogrid('setValue',upper); 168 $('#country').combogrid('setValue',upper);
197 parm.start = upper; 169 parm.start = upper;
198 170
199 - onGetData('cne_cusid','country'); 171 + onGetData('co_cusid','country');
200 return true; 172 return true;
201 } 173 }
202 return false; 174 return false;
@@ -205,7 +177,7 @@ @@ -205,7 +177,7 @@
205 //当用户选择一个列表项时触发。 177 //当用户选择一个列表项时触发。
206 $('#country').combogrid('setValue',rowData.country_code); 178 $('#country').combogrid('setValue',rowData.country_code);
207 179
208 - onGetData('cne_cusid','country'); 180 + onGetData('co_cusid','country');
209 }, 181 },
210 columns:[[ 182 columns:[[
211 {field:'name_cn',title:'名称',width:106}, 183 {field:'name_cn',title:'名称',width:106},
@@ -214,18 +186,18 @@ @@ -214,18 +186,18 @@
214 }); 186 });
215 187
216 function onGetData(selectId,inputId) { 188 function onGetData(selectId,inputId) {
217 - var cneType = "";  
218 - var cne_cusid = "${consignee.cusid}";  
219 - if(notEmpty(cne_cusid)){  
220 - cneType = cne_cusid.split("+")[0]; 189 + var shpType = "";
  190 + var shp_cusid = "${consignee.cusid}";
  191 + if(notEmpty(shp_cusid)){
  192 + shpType = shp_cusid.split("+")[0];
221 } 193 }
222 194
223 var select = $("#"+selectId); 195 var select = $("#"+selectId);
224 select.html(""); 196 select.html("");
225 select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>"); 197 select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>");
226 198
227 - var countryCode = $('#'+inputId).combobox('getValue');  
228 - 199 + var countryCode = $('#'+inputId).combobox('getValue');
  200 +
229 $.ajax({ 201 $.ajax({
230 url:"<%=basePath%>/enterprise/list?countryCode="+countryCode, 202 url:"<%=basePath%>/enterprise/list?countryCode="+countryCode,
231 success:function(data){ 203 success:function(data){
@@ -233,7 +205,7 @@ @@ -233,7 +205,7 @@
233 if(data.data){ 205 if(data.data){
234 for(var i = 0; i < data.data.length; i++){ 206 for(var i = 0; i < data.data.length; i++){
235 var type = data.data[i].enterprise_type; 207 var type = data.data[i].enterprise_type;
236 - if(notEmpty(cneType)&&type&&(type==cneType)){ 208 + if(notEmpty(shpType)&&type&&(type==shpType)){
237 select.append("<option selected value='"+type+"'>"+type+"</option>"); 209 select.append("<option selected value='"+type+"'>"+type+"</option>");
238 }else{ 210 }else{
239 select.append("<option value='"+type+"'>"+type+"</option>"); 211 select.append("<option value='"+type+"'>"+type+"</option>");
@@ -248,19 +220,29 @@ @@ -248,19 +220,29 @@
248 } 220 }
249 }); 221 });
250 } 222 }
251 - 223 +
252 var layer; 224 var layer;
253 layui.use('layer', function() { 225 layui.use('layer', function() {
254 layer = layui.layer; 226 layer = layui.layer;
255 }); 227 });
256 228
257 - $(window).load(function() {  
258 - });  
259 -  
260 layui.use('form', function() { 229 layui.use('form', function() {
261 var form = layui.form; 230 var form = layui.form;
262 231
263 form.on('submit(formDemo)', function(data){ 232 form.on('submit(formDemo)', function(data){
  233 + var phone = data.field.tel;
  234 + var fax = data.field.fax;
  235 + if(isEmpty(phone)&&isEmpty(fax)){
  236 + layer.msg("电话和传真必须填写一项!");
  237 + return false;
  238 + }
  239 +
  240 + var country = data.field.country;
  241 + if(isEmpty(country)){
  242 + layer.msg("请选择国家");
  243 + return false;
  244 + }
  245 +
264 save(data.field); 246 save(data.field);
265 return false; 247 return false;
266 }); 248 });
@@ -274,15 +256,12 @@ @@ -274,15 +256,12 @@
274 if (data.id) { 256 if (data.id) {
275 params += "&id=" + data.id; 257 params += "&id=" + data.id;
276 } 258 }
277 - if (data.cusid) {  
278 - params += "&cusid=" + data.cusid;  
279 - }  
280 259
281 - var cusid_type = getSelectedValue("cne_cusid");  
282 - var cusid = $("#cnecusid").val(); 260 + var shp_cusid_type = getSelectedValue("co_cusid");
  261 + var sh_cusid = $("#cusid").val();
283 262
284 - if(notEmpty(cusid_type)&&notEmpty(cusid)){  
285 - cusid = cusid_type+"+"+cusid; 263 + if(notEmpty(shp_cusid_type)&&notEmpty(sh_cusid)){
  264 + cusid = shp_cusid_type+"+"+sh_cusid;
286 params+="&cusid="+encodeURIComponent(cusid); 265 params+="&cusid="+encodeURIComponent(cusid);
287 } 266 }
288 267
@@ -304,15 +283,15 @@ @@ -304,15 +283,15 @@
304 if (data.country) { 283 if (data.country) {
305 params += "&country=" + data.country; 284 params += "&country=" + data.country;
306 } 285 }
307 - if (data.provincecode) {  
308 - params += "&provincecode=" + data.provincecode;  
309 - }  
310 if (data.tel) { 286 if (data.tel) {
311 params += "&tel=" + data.tel; 287 params += "&tel=" + data.tel;
312 } 288 }
313 if (data.fax) { 289 if (data.fax) {
314 params += "&fax=" + data.fax; 290 params += "&fax=" + data.fax;
315 } 291 }
  292 + if (data.provincecode) {
  293 + params += "&provincecode=" + data.provincecode;
  294 + }
316 295
317 $.post(url, params, function(response, status) { 296 $.post(url, params, function(response, status) {
318 if (response.status == 200) { 297 if (response.status == 200) {
@@ -236,6 +236,13 @@ @@ -236,6 +236,13 @@
236 layer.msg("电话和传真必须填写一项!"); 236 layer.msg("电话和传真必须填写一项!");
237 return false; 237 return false;
238 } 238 }
  239 +
  240 + var country = data.field.co_country;
  241 + if(isEmpty(country)){
  242 + layer.msg("请选择国家");
  243 + return false;
  244 + }
  245 +
239 save(data.field); 246 save(data.field);
240 return false; 247 return false;
241 }); 248 });
@@ -524,13 +524,17 @@ @@ -524,13 +524,17 @@
524 </tr> 524 </tr>
525 525
526 <tr> 526 <tr>
527 - <td colspan="6"> 527 + <td colspan="2">
528 <div class="opt-buttons" style="padding-top: 20px;" id="divsubmit"> 528 <div class="opt-buttons" style="padding-top: 20px;" id="divsubmit">
529 <button type="submit" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " 529 <button type="submit" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "
530 data-options="selected:true"> 530 data-options="selected:true">
531 <span class="l-btn-left"><span class="l-btn-text"><spring:message 531 <span class="l-btn-left"><span class="l-btn-text"><spring:message
532 code="opt.temsave" /></span></span> 532 code="opt.temsave" /></span></span>
533 </button> 533 </button>
  534 + </div>
  535 + </td>
  536 + <td colspan="4" align="right">
  537 + <div class="opt-buttons" style="padding-top: 20px;text-align: right;" id="divsubmit">
534 <a onclick="savesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " 538 <a onclick="savesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "
535 data-options="selected:true"> 539 data-options="selected:true">
536 <span class="l-btn-left"><span class="l-btn-text"><spring:message 540 <span class="l-btn-left"><span class="l-btn-text"><spring:message
@@ -813,7 +817,13 @@ $(function(){ @@ -813,7 +817,13 @@ $(function(){
813 $('#co_country').combogrid('setValue',upper); 817 $('#co_country').combogrid('setValue',upper);
814 parm.start = upper; 818 parm.start = upper;
815 819
816 - onGetData('co_cusid','co_country'); 820 + var defaultValue = "";
  821 + var cusid = "${manifest.shpcusid}";
  822 + if(notEmpty(cusid)){
  823 + defaultValue = cusid.split("+")[0];
  824 + }
  825 + onGetData(true,defaultValue,upper);
  826 +
817 return true; 827 return true;
818 } 828 }
819 return false; 829 return false;
@@ -822,7 +832,7 @@ $(function(){ @@ -822,7 +832,7 @@ $(function(){
822 //当用户选择一个列表项时触发。 832 //当用户选择一个列表项时触发。
823 $('#co_country').combogrid('setValue',rowData.country_code); 833 $('#co_country').combogrid('setValue',rowData.country_code);
824 834
825 - onGetData('co_cusid','co_country'); 835 + onGetData(true,"",rowData.country_code);
826 }, 836 },
827 columns:[[ 837 columns:[[
828 {field:'name_cn',title:'名称',width:106}, 838 {field:'name_cn',title:'名称',width:106},
@@ -844,7 +854,12 @@ $(function(){ @@ -844,7 +854,12 @@ $(function(){
844 $('#sh_country').combogrid('setValue',upper); 854 $('#sh_country').combogrid('setValue',upper);
845 parm.start = upper; 855 parm.start = upper;
846 856
847 - onGetData('sh_cusid','sh_country') 857 + var defaultValue = "";
  858 + var cusid = "${manifest.cnecusid}";
  859 + if(notEmpty(cusid)){
  860 + defaultValue = cusid.split("+")[0];
  861 + }
  862 + onGetData(false,defaultValue,upper);
848 return true; 863 return true;
849 } 864 }
850 return false; 865 return false;
@@ -852,7 +867,8 @@ $(function(){ @@ -852,7 +867,8 @@ $(function(){
852 onSelect: function(row,rowData){ 867 onSelect: function(row,rowData){
853 //当用户选择一个列表项时触发。 868 //当用户选择一个列表项时触发。
854 $('#sh_country').val(rowData.country_code); 869 $('#sh_country').val(rowData.country_code);
855 - onGetData('sh_cusid','sh_country') 870 + onGetData(false,"",rowData.country_code);
  871 +
856 }, 872 },
857 columns:[[ 873 columns:[[
858 {field:'name_cn',title:'名称',width:106}, 874 {field:'name_cn',title:'名称',width:106},
@@ -860,63 +876,39 @@ $(function(){ @@ -860,63 +876,39 @@ $(function(){
860 ]] 876 ]]
861 }); 877 });
862 878
863 - function onGetData(selectId,inputId) {  
864 - console.log("onGetData()");  
865 - var cneType = "";  
866 - var shpType = "";  
867 - if(selectId=="co_cusid"){  
868 - //发货的  
869 - var shp_cusid = "${manifest.shpcusid}";  
870 - if(notEmpty(shp_cusid)){  
871 - shpType = shp_cusid.split("+")[0];  
872 - }  
873 - }  
874 -  
875 - if(selectId=="sh_cusid"){  
876 - //收货的  
877 - var cnecusid = "${manifest.cnecusid}";  
878 - if(notEmpty(cnecusid)){  
879 - cneType = cnecusid.split("+")[0];  
880 - }  
881 - }  
882 -  
883 - var select = $("#"+selectId);  
884 - select.html("");  
885 - select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>");  
886 -  
887 - var countryCode = $('#'+inputId).combobox('getValue');  
888 - 879 + function onGetData(isConsignor,defaultValue,country_code) {
889 $.ajax({ 880 $.ajax({
890 - url:"<%=basePath%>/enterprise/list?countryCode="+countryCode, 881 + url:"<%=basePath%>/enterprise/list?countryCode="+country_code,
891 success:function(data){ 882 success:function(data){
892 if(data.status == 200){ 883 if(data.status == 200){
893 if(data.data){ 884 if(data.data){
894 - for(var i = 0; i < data.data.length; i++){  
895 - var type = data.data[i].enterprise_type;  
896 -  
897 - if(selectId=="co_cusid"){  
898 - if(notEmpty(shpType)&&type&&(type==shpType)){  
899 - select.append("<option selected value='"+type+"'>"+type+"</option>");  
900 - }else{  
901 - select.append("<option value='"+type+"'>"+type+"</option>");  
902 - }  
903 - }else if(selectId=="sh_cusid"){  
904 - if(notEmpty(cneType)&&type&&(type==cneType)){  
905 - select.append("<option selected value='"+type+"'>"+type+"</option>");  
906 - }else{  
907 - select.append("<option value='"+type+"'>"+type+"</option>");  
908 - }  
909 - }else{  
910 - select.append("<option value='"+type+"'>"+type+"</option>");  
911 - }  
912 -  
913 - } 885 + setEnterpriseType(isConsignor,defaultValue,data.data);
914 } 886 }
915 } 887 }
916 } 888 }
917 }); 889 });
918 } 890 }
919 891
  892 + function setEnterpriseType(isConsignor,defaultValue,array){
  893 + if(isEmpty(defaultValue)){
  894 + defaultValue = "";
  895 + }
  896 +
  897 + var selectId = isConsignor==true?"co_cusid":"sh_cusid";
  898 + var select = $("#"+selectId);
  899 + select.html("");
  900 + select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>");
  901 +
  902 + for(var i = 0; i < array.length; i++){
  903 + var type = array[i].enterprise_type;
  904 + if(type==defaultValue){
  905 + select.append("<option selected value='"+type+"'>"+type+"</option>");
  906 + }else{
  907 + select.append("<option value='"+type+"'>"+type+"</option>");
  908 + }
  909 + }
  910 + }
  911 +
920 function onReceivConsignor(consignor){ 912 function onReceivConsignor(consignor){
921 if(consignor){ 913 if(consignor){
922 $("#co_company").val(consignor.co_company?consignor.co_company.toUpperCase():""); 914 $("#co_company").val(consignor.co_company?consignor.co_company.toUpperCase():"");
@@ -939,19 +931,17 @@ $(function(){ @@ -939,19 +931,17 @@ $(function(){
939 $("#co_zipcode").val(consignor.co_zipcode?consignor.co_zipcode:""); 931 $("#co_zipcode").val(consignor.co_zipcode?consignor.co_zipcode:"");
940 $("#shpaeo").val(consignor.shpaeo?consignor.shpaeo:""); 932 $("#shpaeo").val(consignor.shpaeo?consignor.shpaeo:"");
941 933
  934 + var defaultValue = "";
942 if(notEmpty(consignor.shpcusid)){ 935 if(notEmpty(consignor.shpcusid)){
943 - var temp_1 = consignor.shpcusid.split("+")[0];  
944 - var temp_2 = consignor.shpcusid.split("+")[1];  
945 - if(notEmpty(temp_1)){  
946 - var select = $("#co_cusid");  
947 - select.html("");  
948 - select.append("<option value='"+temp_1.toUpperCase()+"'>"+temp_1.toUpperCase()+"</option>");  
949 - } 936 + defaultValue = consignor.shpcusid.split("+")[0];
950 937
  938 + var temp_2 = consignor.shpcusid.split("+")[1];
951 if(notEmpty(temp_2)){ 939 if(notEmpty(temp_2)){
952 $("#shpcusid").val(temp_2.toUpperCase()); 940 $("#shpcusid").val(temp_2.toUpperCase());
953 } 941 }
954 } 942 }
  943 +
  944 + onGetData(true,defaultValue,country);
955 } 945 }
956 } 946 }
957 947
@@ -992,20 +982,17 @@ $(function(){ @@ -992,20 +982,17 @@ $(function(){
992 $("#sh_zipcode").val(consignee.zipcode?consignee.zipcode:""); 982 $("#sh_zipcode").val(consignee.zipcode?consignee.zipcode:"");
993 $("#cneaeo").val(consignee.aeo?consignee.aeo:""); 983 $("#cneaeo").val(consignee.aeo?consignee.aeo:"");
994 984
  985 + var defaultValue = "";
995 if(notEmpty(consignee.cusid)){ 986 if(notEmpty(consignee.cusid)){
996 - var temp_1 = consignee.cusid.split("+")[0]; 987 + var defaultValue = consignee.cusid.split("+")[0];
997 var temp_2 = consignee.cusid.split("+")[1]; 988 var temp_2 = consignee.cusid.split("+")[1];
998 989
999 - if(notEmpty(temp_1)){  
1000 - var select = $("#sh_cusid");  
1001 - select.html("");  
1002 - select.append("<option value='"+temp_1.toUpperCase()+"'>"+temp_1.toUpperCase()+"</option>");  
1003 - }  
1004 -  
1005 if(notEmpty(temp_2)){ 990 if(notEmpty(temp_2)){
1006 $("#cnecusid").val(temp_2.toUpperCase()); 991 $("#cnecusid").val(temp_2.toUpperCase());
1007 } 992 }
1008 } 993 }
  994 +
  995 + onGetData(false,defaultValue,country);
1009 } 996 }
1010 997
1011 function showConsigneeDialog() { 998 function showConsigneeDialog() {
@@ -153,8 +153,8 @@ @@ -153,8 +153,8 @@
153 {field:'waybillnosecondary',title:'<spring:message code="manifest.odd.number"/>'}, 153 {field:'waybillnosecondary',title:'<spring:message code="manifest.odd.number"/>'},
154 {field:'originatingstation',title:'<spring:message code="manifest.starting.point"/>'}, 154 {field:'originatingstation',title:'<spring:message code="manifest.starting.point"/>'},
155 {field:'destinationstation',title:'<spring:message code="manifest.destination"/>'}, 155 {field:'destinationstation',title:'<spring:message code="manifest.destination"/>'},
156 - {field:'prepareweight',title:'<spring:message code="manifest.pre.weight"/>'},  
157 {field:'preparepiece',title:'<spring:message code="manifest.number.of.fittings"/>'}, 156 {field:'preparepiece',title:'<spring:message code="manifest.number.of.fittings"/>'},
  157 + {field:'prepareweight',title:'<spring:message code="manifest.pre.weight"/>'},
158 {field:'response_text',width:160,title:'<spring:message code="manifest.response_text"/>', 158 {field:'response_text',width:160,title:'<spring:message code="manifest.response_text"/>',
159 formatter:function(value, row, index){ 159 formatter:function(value, row, index){
160 var res = ''; 160 var res = '';
@@ -345,7 +345,7 @@ @@ -345,7 +345,7 @@
345 {field:'hawbNo',title:'<spring:message code="bill.hawbNo"/>',width:100}, 345 {field:'hawbNo',title:'<spring:message code="bill.hawbNo"/>',width:100},
346 {field:'totalPieces',title:'<spring:message code="bill.pieces"/>',width:100}, 346 {field:'totalPieces',title:'<spring:message code="bill.pieces"/>',width:100},
347 {field:'grossWeight',title:'<spring:message code="bill.weightcharge"/>',width:100}, 347 {field:'grossWeight',title:'<spring:message code="bill.weightcharge"/>',width:100},
348 - {field:'goodsName',title:'<spring:message code="bill.productname"/>',width:100}, 348 + {field:'productname',title:'<spring:message code="bill.productname"/>',width:100},
349 {field:'departureStation',title:'<spring:message code="bill.orilocation"/>',width:100}, 349 {field:'departureStation',title:'<spring:message code="bill.orilocation"/>',width:100},
350 {field:'destinationStation',title:'<spring:message code="bill.destination"/>',width:100}, 350 {field:'destinationStation',title:'<spring:message code="bill.destination"/>',width:100},
351 ]], 351 ]],
@@ -203,11 +203,18 @@ @@ -203,11 +203,18 @@
203 <tr> 203 <tr>
204 <td class="kv-label"><spring:message code="delivery.productname" /><span 204 <td class="kv-label"><spring:message code="delivery.productname" /><span
205 class="required_span">*</span></td> 205 class="required_span">*</span></td>
206 - <td class="kv-content" colspan="5"> 206 + <td class="kv-content" colspan="3">
207 <input required id="productname" name="productname" maxlength="200" type="text" style="width: 96%;" 207 <input required id="productname" name="productname" maxlength="200" type="text" style="width: 96%;"
208 oninput="onInputChange(event,'productname','oninput')" value="${pre.productname}" 208 oninput="onInputChange(event,'productname','oninput')" value="${pre.productname}"
209 onpropertychange="onInputChange(event,'productname','onpropertychange')"/> 209 onpropertychange="onInputChange(event,'productname','onpropertychange')"/>
210 </td> 210 </td>
  211 +
  212 + <td class="kv-label"><spring:message code="delivery.special.cargo.code" /></td>
  213 + <td class="kv-content">
  214 + <input id="specialgoodscode" name="specialgoodscode" maxlength="20" type="text"
  215 + oninput="onInputChange(event,'specialgoodscode','oninput')" value="${pre.specialgoodscode}"
  216 + onpropertychange="onInputChange(event,'specialgoodscode','onpropertychange')"/>
  217 + </td>
211 </tr> 218 </tr>
212 <!-- 货物信息 end --> 219 <!-- 货物信息 end -->
213 220
@@ -497,18 +504,13 @@ @@ -497,18 +504,13 @@
497 </tr> 504 </tr>
498 505
499 <tr> 506 <tr>
500 - <td colspan="6"> 507 + <td colspan="2">
501 <div class="opt-buttons" style="padding-top: 20px;" id="divsubmit"> 508 <div class="opt-buttons" style="padding-top: 20px;" id="divsubmit">
502 <button type="submit" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " 509 <button type="submit" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "
503 data-options="selected:true"> 510 data-options="selected:true">
504 <span class="l-btn-left"><span class="l-btn-text"><spring:message 511 <span class="l-btn-left"><span class="l-btn-text"><spring:message
505 code="opt.temsave" /></span></span> 512 code="opt.temsave" /></span></span>
506 </button> 513 </button>
507 - <a onclick="presavesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "  
508 - data-options="selected:true">  
509 - <span class="l-btn-left"><span class="l-btn-text"><spring:message  
510 - code="opt.saveandsend" /></span></span>  
511 - </a>  
512 <%-- <a onclick="presendDelivery()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true"> 514 <%-- <a onclick="presendDelivery()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected " data-options="selected:true">
513 <span class="l-btn-left"><span class="l-btn-text"><spring:message code="manifest.delivery"/></span></span> 515 <span class="l-btn-left"><span class="l-btn-text"><spring:message code="manifest.delivery"/></span></span>
514 </a> --%> 516 </a> --%>
@@ -517,6 +519,16 @@ @@ -517,6 +519,16 @@
517 <!-- </button> --> 519 <!-- </button> -->
518 </div> 520 </div>
519 </td> 521 </td>
  522 +
  523 + <td colspan="4" align="right">
  524 + <div class="opt-buttons" style="padding-top: 20px;text-align: right;" id="divsubmit">
  525 + <a onclick="presavesend()" class="easyui-linkbutton l-btn l-btn-small l-btn-selected "
  526 + data-options="selected:true">
  527 + <span class="l-btn-left"><span class="l-btn-text"><spring:message
  528 + code="opt.saveandsend" /></span></span>
  529 + </a>
  530 + </div>
  531 + </td>
520 </tr> 532 </tr>
521 <!-- 交运信息 end --> 533 <!-- 交运信息 end -->
522 534
@@ -868,7 +880,12 @@ @@ -868,7 +880,12 @@
868 $('#co_country').combogrid('setValue',upper); 880 $('#co_country').combogrid('setValue',upper);
869 parm.start = upper; 881 parm.start = upper;
870 882
871 - onGetData('co_cusid','co_country') 883 + var defaultValue = "";
  884 + var cusid = "${pre.shpcusid}";
  885 + if(notEmpty(cusid)){
  886 + defaultValue = cusid.split("+")[0];
  887 + }
  888 + onGetData(true,defaultValue,upper);
872 return true; 889 return true;
873 } 890 }
874 return false; 891 return false;
@@ -876,7 +893,7 @@ @@ -876,7 +893,7 @@
876 onSelect: function(row,rowData){ 893 onSelect: function(row,rowData){
877 //当用户选择一个列表项时触发。 894 //当用户选择一个列表项时触发。
878 $('#co_country').combogrid('setValue',rowData.country_code); 895 $('#co_country').combogrid('setValue',rowData.country_code);
879 - onGetData('co_cusid','co_country') 896 + onGetData(true,"",rowData.country_code);
880 }, 897 },
881 columns:[[ 898 columns:[[
882 {field:'name_cn',title:'名称',width:106}, 899 {field:'name_cn',title:'名称',width:106},
@@ -898,7 +915,12 @@ @@ -898,7 +915,12 @@
898 $('#sh_country').combogrid('setValue',upper); 915 $('#sh_country').combogrid('setValue',upper);
899 parm.start = upper; 916 parm.start = upper;
900 917
901 - onGetData('sh_cusid','sh_country') 918 + var defaultValue = "";
  919 + var cusid = "${pre.cnecusid}";
  920 + if(notEmpty(cusid)){
  921 + defaultValue = cusid.split("+")[0];
  922 + }
  923 + onGetData(false,defaultValue,upper);
902 return true; 924 return true;
903 } 925 }
904 return false; 926 return false;
@@ -906,7 +928,7 @@ @@ -906,7 +928,7 @@
906 onSelect: function(row,rowData){ 928 onSelect: function(row,rowData){
907 //当用户选择一个列表项时触发。 929 //当用户选择一个列表项时触发。
908 $('#sh_country').val(rowData.country_code); 930 $('#sh_country').val(rowData.country_code);
909 - onGetData('sh_cusid','sh_country') 931 + onGetData(false,"",rowData.country_code);
910 }, 932 },
911 columns:[[ 933 columns:[[
912 {field:'name_cn',title:'名称',width:106}, 934 {field:'name_cn',title:'名称',width:106},
@@ -914,61 +936,38 @@ @@ -914,61 +936,38 @@
914 ]] 936 ]]
915 }); 937 });
916 938
917 - function onGetData(selectId,inputId) {  
918 - var cneType = "";  
919 - var shpType = "";  
920 - if(selectId=="co_cusid"){  
921 - //发货的  
922 - var shp_cusid = "${pre.shpcusid}";  
923 - console.log("shp_cusid-->"+shp_cusid);  
924 - if(notEmpty(shp_cusid)){  
925 - shpType = shp_cusid.split("+")[0];  
926 - }  
927 - }  
928 -  
929 - if(selectId=="sh_cusid"){  
930 - //收货的  
931 - var cnecusid = "${pre.cnecusid}";  
932 - console.log("cnecusid-->"+cnecusid);  
933 - if(notEmpty(cnecusid)){  
934 - cneType = cnecusid.split("+")[0];  
935 - } 939 + function onGetData(isConsignor,defaultValue,country_code) {
  940 + $.ajax({
  941 + url:"<%=basePath%>/enterprise/list?countryCode="+country_code,
  942 + success:function(data){
  943 + if(data.status == 200){
  944 + if(data.data){
  945 + setEnterpriseType(isConsignor,defaultValue,data.data);
  946 + }
  947 + }
  948 + }
  949 + });
  950 + }
  951 +
  952 + function setEnterpriseType(isConsignor,defaultValue,array){
  953 + if(isEmpty(defaultValue)){
  954 + defaultValue = "";
936 } 955 }
937 956
  957 + var selectId = isConsignor==true?"co_cusid":"sh_cusid";
938 var select = $("#"+selectId); 958 var select = $("#"+selectId);
939 select.html(""); 959 select.html("");
940 select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>"); 960 select.append("<option value=''><spring:message code='manifest.enterprise.code.type' /></option>");
941 961
942 - var countryCode = $('#'+inputId).combobox('getValue');  
943 -  
944 - $.ajax({  
945 - url:"<%=basePath%>/enterprise/list?countryCode="+ countryCode,  
946 - success : function(data) {  
947 - if (data.status == 200) {  
948 - if (data.data) {  
949 - for (var i = 0; i < data.data.length; i++) {  
950 - var type = data.data[i].enterprise_type;  
951 - if(selectId=="co_cusid"){  
952 - if(notEmpty(shpType)&&type&&(type==shpType)){  
953 - select.append("<option selected value='"+type+"'>"+type+"</option>");  
954 - }else{  
955 - select.append("<option value='"+type+"'>"+type+"</option>");  
956 - }  
957 - }else if(selectId=="sh_cusid"){  
958 - if(notEmpty(cneType)&&type&&(type==cneType)){  
959 - select.append("<option selected value='"+type+"'>"+type+"</option>");  
960 - }else{  
961 - select.append("<option value='"+type+"'>"+type+"</option>");  
962 - }  
963 - }else{  
964 - select.append("<option value='"+type+"'>"+type+"</option>");  
965 - }  
966 - }  
967 - } 962 + for(var i = 0; i < array.length; i++){
  963 + var type = array[i].enterprise_type;
  964 + if(type==defaultValue){
  965 + select.append("<option selected value='"+type+"'>"+type+"</option>");
  966 + }else{
  967 + select.append("<option value='"+type+"'>"+type+"</option>");
968 } 968 }
969 - }  
970 - });  
971 - } 969 + }
  970 + }
972 971
973 function onReceivConsignor(consignor){ 972 function onReceivConsignor(consignor){
974 if(consignor){ 973 if(consignor){
@@ -994,19 +993,17 @@ @@ -994,19 +993,17 @@
994 $("#co_zipcode").val(consignor.co_zipcode?consignor.co_zipcode:""); 993 $("#co_zipcode").val(consignor.co_zipcode?consignor.co_zipcode:"");
995 $("#shpaeo").val(consignor.shpaeo?consignor.shpaeo:""); 994 $("#shpaeo").val(consignor.shpaeo?consignor.shpaeo:"");
996 995
  996 + var defaultValue = "";
997 if(notEmpty(consignor.shpcusid)){ 997 if(notEmpty(consignor.shpcusid)){
998 - var temp_1 = consignor.shpcusid.split("+")[0];  
999 - var temp_2 = consignor.shpcusid.split("+")[1];  
1000 - if(notEmpty(temp_1)){  
1001 - var select = $("#co_cusid");  
1002 - select.html("");  
1003 - select.append("<option value='"+temp_1.toUpperCase()+"'>"+temp_1.toUpperCase()+"</option>");  
1004 - } 998 + defaultValue = consignor.shpcusid.split("+")[0];
1005 999
  1000 + var temp_2 = consignor.shpcusid.split("+")[1];
1006 if(notEmpty(temp_2)){ 1001 if(notEmpty(temp_2)){
1007 $("#shpcusid").val(temp_2.toUpperCase()); 1002 $("#shpcusid").val(temp_2.toUpperCase());
1008 } 1003 }
1009 } 1004 }
  1005 +
  1006 + onGetData(true,defaultValue,country);
1010 } 1007 }
1011 } 1008 }
1012 1009
@@ -1049,20 +1046,17 @@ @@ -1049,20 +1046,17 @@
1049 $("#sh_zipcode").val(consignee.zipcode?consignee.zipcode:""); 1046 $("#sh_zipcode").val(consignee.zipcode?consignee.zipcode:"");
1050 $("#cneaeo").val(consignee.aeo?consignee.aeo:""); 1047 $("#cneaeo").val(consignee.aeo?consignee.aeo:"");
1051 1048
  1049 + var defaultValue = "";
1052 if(notEmpty(consignee.cusid)){ 1050 if(notEmpty(consignee.cusid)){
1053 - var temp_1 = consignee.cusid.split("+")[0]; 1051 + var defaultValue = consignee.cusid.split("+")[0];
1054 var temp_2 = consignee.cusid.split("+")[1]; 1052 var temp_2 = consignee.cusid.split("+")[1];
1055 1053
1056 - if(notEmpty(temp_1)){  
1057 - var select = $("#sh_cusid");  
1058 - select.html("");  
1059 - select.append("<option value='"+temp_1.toUpperCase()+"'>"+temp_1.toUpperCase()+"</option>");  
1060 - }  
1061 -  
1062 if(notEmpty(temp_2)){ 1054 if(notEmpty(temp_2)){
1063 $("#cnecusid").val(temp_2.toUpperCase()); 1055 $("#cnecusid").val(temp_2.toUpperCase());
1064 } 1056 }
1065 } 1057 }
  1058 +
  1059 + onGetData(false,defaultValue,country);
1066 } 1060 }
1067 1061
1068 function showConsigneeDialog() { 1062 function showConsigneeDialog() {
@@ -268,12 +268,14 @@ function onInputChange(event, id, method) { @@ -268,12 +268,14 @@ function onInputChange(event, id, method) {
268 } 268 }
269 269
270 if (id && id == "totalpiece") { 270 if (id && id == "totalpiece") {
  271 + upper = upper.replace(/[^\d\.]/g,'')
271 $("#de_number").val(upper); 272 $("#de_number").val(upper);
272 $("#preparepiece").val(upper);// 分单 273 $("#preparepiece").val(upper);// 分单
273 $("#preparetotalpiece").val(upper);// 主单 274 $("#preparetotalpiece").val(upper);// 主单
274 } 275 }
275 276
276 if (id && id == "totalweight") { 277 if (id && id == "totalweight") {
  278 + upper = upper.replace(/[^\d\.]/g,'')
277 $("#de_weight").val(upper); 279 $("#de_weight").val(upper);
278 $("#de_chweight").val(upper); 280 $("#de_chweight").val(upper);
279 $("#prepareweight").val(upper);// 分单 281 $("#prepareweight").val(upper);// 分单