作者 申海龙

安检申报添加 修改提示信息

... ... @@ -354,88 +354,93 @@ public class SecurityDeclarationController {
//查询是否存在
if (securityDeclarationService.findWaybill(waybill) == 0 && manifestService.findWbm(waybill) == null){
//货物性质(类型)添加
for (String type: list){
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
}
//货物品名
String cName = cargoName.replaceAll(",", ",");
String[] split = cName.split(",");
for (int i=0; i<split.length; i++){
if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){
SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
sdCargoNameEntity.setSd_waybill(waybill);
sdCargoNameEntity.setSd_cargo_name(split[i]);
sdCargoNameService.save(sdCargoNameEntity);
if (securityDeclarationService.findWaybill(waybill) == 0){
if (manifestService.findWbm(waybill) == null){
//货物性质(类型)添加
for (String type: list){
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
}
}
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
ManifestEntity manifestEntity = new ManifestEntity();
//添加安检申报
SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
sd.setSd_waybill(waybill);
sd.setSd_cargo_agent_name(cargoAgentName);
sd.setSd_cargo_shipper_name(cargoShipperName);
sd.setSd_iata_number(iataNumber);
sd.setSd_transport_certificate(transportCertificate);
sd.setSd_transportation_prove(transportationProve);
sd.setSd_static("1");
if (ue != null){
if (ue.getId() != null ){
sd.setUSER_ID(ue.getId());
manifestEntity.setUSER_ID(ue.getId());
//货物品名
String cName = cargoName.replaceAll(",", ",");
String[] split = cName.split(",");
for (int i=0; i<split.length; i++){
if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){
SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
sdCargoNameEntity.setSd_waybill(waybill);
sdCargoNameEntity.setSd_cargo_name(split[i]);
sdCargoNameService.save(sdCargoNameEntity);
}
}
}
securityDeclarationService.save(sd);
// 生成报文并且发送
String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
//存放数据Vo
SDVo sdVo = new SDVo();
sdVo.setSd_waybill(waybill);
sdVo.setSd_cargo_agent_name(cargoAgentName);
sdVo.setSd_cargo_shipper_name(cargoShipperName);
sdVo.setSd_iata_number(iataNumber);
sdVo.setSd_transport_certificate(transportCertificate);
sdVo.setSd_transportation_prove(transportationProve);
//品名
sdVo.setSd_cargo_name(cargoName);
//货物类型
String cargoType = "";
for (String s: list){
cargoType+=s+",";
UserEntity ue = (UserEntity)SecurityUtils.getSubject().getSession().getAttribute("user");
ManifestEntity manifestEntity = new ManifestEntity();
//添加安检申报
SecurityDeclarationEntity sd = new SecurityDeclarationEntity();
sd.setSd_waybill(waybill);
sd.setSd_cargo_agent_name(cargoAgentName);
sd.setSd_cargo_shipper_name(cargoShipperName);
sd.setSd_iata_number(iataNumber);
sd.setSd_transport_certificate(transportCertificate);
sd.setSd_transportation_prove(transportationProve);
sd.setSd_static("1");
if (ue != null){
if (ue.getId() != null ){
sd.setUSER_ID(ue.getId());
manifestEntity.setUSER_ID(ue.getId());
}
}
securityDeclarationService.save(sd);
// 生成报文并且发送
String ndlrPath = MessageKit.getMessagePath(MessageType.NDLR);
//存放数据Vo
SDVo sdVo = new SDVo();
sdVo.setSd_waybill(waybill);
sdVo.setSd_cargo_agent_name(cargoAgentName);
sdVo.setSd_cargo_shipper_name(cargoShipperName);
sdVo.setSd_iata_number(iataNumber);
sdVo.setSd_transport_certificate(transportCertificate);
sdVo.setSd_transportation_prove(transportationProve);
//品名
sdVo.setSd_cargo_name(cargoName);
//货物类型
String cargoType = "";
for (String s: list){
cargoType+=s+",";
}
sdVo.setSd_cargo_type(cargoType);
//添加预配信息
manifestEntity.setWaybillnomaster(waybill);
manifestEntity.setFlightdate(flightdate);
manifestEntity.setFlightno(flightno);
manifestEntity.setCarrier(carrier);
manifestEntity.setTotalpiece(totalpiece);
manifestEntity.setTotalweight(totalweight);
manifestEntity.setDestinationstation(destinationstation);
manifestService.save(manifestEntity);
//生成报文
sdVo.setFlightno(flightno);
sdVo.setFlightdate(flightdate);
sdVo.setCarrier(carrier);
sdVo.setTotalpiece(totalpiece);
sdVo.setTotalweight(totalweight);
sdVo.setDestinationstation(destinationstation);
new XmlBuildTask(securityDeclarationService.sendNDLRXml(sdVo), ndlrPath).perform();
model.setStatus(200);
}else {
model.setStatus(204);
}
sdVo.setSd_cargo_type(cargoType);
//添加预配信息
manifestEntity.setWaybillnomaster(waybill);
manifestEntity.setFlightdate(flightdate);
manifestEntity.setFlightno(flightno);
manifestEntity.setCarrier(carrier);
manifestEntity.setTotalpiece(totalpiece);
manifestEntity.setTotalweight(totalweight);
manifestEntity.setDestinationstation(destinationstation);
manifestService.save(manifestEntity);
//生成报文
sdVo.setFlightno(flightno);
sdVo.setFlightdate(flightdate);
sdVo.setCarrier(carrier);
sdVo.setTotalpiece(totalpiece);
sdVo.setTotalweight(totalweight);
sdVo.setDestinationstation(destinationstation);
new XmlBuildTask(securityDeclarationService.sendNDLRXml(sdVo), ndlrPath).perform();
model.setStatus(200);
}else {
model.setStatus(203);
}
... ... @@ -744,7 +749,7 @@ public class SecurityDeclarationController {
String path = resource.getPath();
String s = path +"../../resource/img/bar_code/"+replace+".png";
//生成条形码
// BarCodeUtil.generateFile(replace, s);
BarCodeUtil.generateFile(replace, s);
model.addAttribute("path", replace);
... ...
... ... @@ -297,7 +297,9 @@
}
else if (data.status == 203){
alert("安检申报不可以重复添加");
} else {
}else if(data.status == 204){
alert("请前往预配界面添加安检申报");
} else {
layer.open({content:data.msg});
}
})
... ...
... ... @@ -217,6 +217,7 @@
function prebackout(id){
if(typeof(id) == "undefined")
return;
layer.confirm("确定要撤销吗?", function(flag){
layer.close(flag);
$.ajax({
... ...