作者 shenhailong

忘了

... ... @@ -34,7 +34,7 @@
<cxf.version>2.7.5</cxf.version>
<patchca.version>0.5.0</patchca.version>
<jxl.version>2.6.12</jxl.version>
<poi.version>3.6</poi.version>
<poi.version>3.9</poi.version>
<velocity.version>1.7</velocity.version>
<!-- Plugin的属性定义 -->
... ... @@ -368,7 +368,7 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
<version>3.9</version>
</dependency>
<dependency>
... ...
... ... @@ -12,6 +12,7 @@ import com.agent.util.WaybillUtils;
import com.agent.vo.ResponseModel;
import com.agent.vo.agent.CommodityVo;
import com.agent.vo.agent.ManifestVo;
import com.agent.vo.agent.SDVo;
import com.agent.xml.XmlBuildTask;
import com.agent.xml.common.XmlHead;
import com.agent.xml.common.XmlUtil;
... ... @@ -2675,6 +2676,32 @@ public class ManifestController extends BasicController {
sdCargoNameService.save(sdCargoNameEntity);
}
securityDeclarationService.save(sd);
// 生成报文并且发送
String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
//存放数据Vo
SDVo sdVo = new SDVo();
sdVo.setSd_waybill(wbm);
sdVo.setSd_cargo_agent_name(arr.get(27));
sdVo.setSd_cargo_shipper_name(arr.get(28));
sdVo.setSd_iata_number(arr.get(29));
sdVo.setSd_transport_certificate(arr.get(30));
sdVo.setSd_transportation_prove(arr.get(31));
//品名
sdVo.setSd_cargo_name(arr.get(33));
//货物类型
sdVo.setSd_cargo_type(arr.get(32));
//预配信息
sdVo.setFlightno(arr.get(3).substring(2));
sdVo.setFlightdate(parse);
sdVo.setCarrier(arr.get(3).substring(0, 2));
sdVo.setTotalpiece(arr.get(10));
sdVo.setTotalweight(arr.get(11));
sdVo.setDestinationstation(arr.get(7));
new XmlBuildTask(securityDeclarationService.sendNDLRXml(sdVo), ndlrPath).perform();
}
manifestService.save(manifestEntity);
}else {
... ...
... ... @@ -136,7 +136,13 @@ public class SecurityDeclarationService extends BasicService<SecurityManifestEnt
SecurityDeclarationXml sdXml = new SecurityDeclarationXml();
sdXml.setCargoAgentName(sdVo.getSd_cargo_agent_name());
sdXml.setCargoName(sdVo.getSd_cargo_name());
sdXml.setCargoType(sdVo.getSd_cargo_type());
if (sdVo.getSd_cargo_type().contains("C")){
sdXml.setCargoType("3");
sdXml.setRiskclassify(sdVo.getSd_cargo_type());
}else {
sdXml.setCargoType(transform(sdVo.getSd_cargo_type()));
sdXml.setRiskclassify("");
}
sdXml.setShipperName(sdVo.getSd_cargo_shipper_name());
sdXml.setIataNo(sdVo.getSd_iata_number());
sdXml.setPiece(sdVo.getTotalpiece());
... ... @@ -171,4 +177,25 @@ public class SecurityDeclarationService extends BasicService<SecurityManifestEnt
}
/**
* 数字字母转换
*/
public String transform(String number){
if (number.contains("C")){
return "3";
}else {
switch (number){
case "A":
return "1";
case "B":
return "2";
case "D":
return "4";
}
return number;
}
}
}
... ...
... ... @@ -80,7 +80,7 @@ public class ExcelUtil {
} finally {
try {
if ( wb != null) {
wb.close();
// wb.close();
}
if (input != null) {
input.close();
... ...
... ... @@ -17,6 +17,9 @@ public class SecurityDeclarationXml {
//航空货物性质 1普通货物 2特种货物 3危险品 4航空快件
@XmlElement(name = "CargoType", required = false)
private String cargoType;
//危险品分类
@XmlElement(name = "Riskclassify", required = false)
private String Riskclassify;
//航空货物托运人名称
@XmlElement(name = "ShipperName", required = false)
private String shipperName;
... ... @@ -104,6 +107,14 @@ public class SecurityDeclarationXml {
this.transportCertificate = transportCertificate;
}
public String getRiskclassify() {
return Riskclassify;
}
public void setRiskclassify(String riskclassify) {
Riskclassify = riskclassify;
}
public String getTransportationProve() {
return transportationProve;
}
... ...
... ... @@ -64,6 +64,7 @@
<%--<a href="javascript:doDelete()" class="easyui-linkbutton" style="background:red;color:#FFF;border: 1px solid red" iconCls="icon-no"><spring:message code="opt.delete" /></a> --%>
<a href="javascript:excelUpload()" class="easyui-linkbutton" style="background:#0EA14E;color:#FFF;border: 1px solid #18A197;"><spring:message code="manifest.excel"/></a>
<a href="<%=basePath %>resource/excel/excel.xls" class="easyui-linkbutton" style="background:#0EA14E;color:#FFF;border: 1px solid #18A197;">模板下载</a>
<a href="<%=basePath %>resource/excel/word.doc" class="easyui-linkbutton" style="background:#0EA14E;color:#FFF;border: 1px solid #18A197;">航空货物详情下载</a>
</table>
</form>
</div>
... ...
不能预览此文件类型
不能预览此文件类型