作者 shenhailong

修改安检货物类型 修改excel分到不能导入情况

... ... @@ -2529,7 +2529,7 @@ public class ManifestController extends BasicController {
String substring1 = s1.substring(3);
wbm = substring + "-" + substring1;
}
//如果分单不给
// 如果分单不为空
if (StringUtils.isBlank(arr.get(2))) {
// 查询主单号是否存在
ManifestEntity wbm1 = manifestService.findWbm(wbm);
... ... @@ -2663,7 +2663,6 @@ public class ManifestController extends BasicController {
manifestService.save(manifestEntity);
model.setStatus(200);
return model;
}else {
model.setStatus(201);
... ... @@ -2687,6 +2686,8 @@ public class ManifestController extends BasicController {
seconday.setPreparemasterid(wbm1.getId());
// 主单号
seconday.setWaybillnomaster(wbm);
// 分单号
seconday.setWaybillnosecondary(arr.get(2));
// 航班号
seconday.setFlightno(arr.get(3).substring(2));
// 航班日期
... ... @@ -2747,7 +2748,6 @@ public class ManifestController extends BasicController {
seconday.setCreateDate(new Date());
preparesecondaryServer.save(seconday);
model.setStatus(200);
return model;
} else {
model.setStatus(201);
model.setMsg(waybill + "分单号已存在");
... ... @@ -2759,7 +2759,7 @@ public class ManifestController extends BasicController {
break;
}
}
return model;
} catch (Exception e) {
model.setStatus(500);
model.setMsg("网络异常");
... ...
... ... @@ -158,6 +158,9 @@ public class SecurityDeclarationController {
String two = request.getParameter("two");
String three = request.getParameter("three");
String four = request.getParameter("four");
String type = cargoType(one, two, three, four);
//航空货物托运人名称
String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
//航空货运销售代理人名称
... ... @@ -176,35 +179,21 @@ public class SecurityDeclarationController {
if (request.getParameter("sd_transportation_prove") != null){
transportationProve = request.getParameter("sd_transportation_prove");
}
//货物性质是否多选
List<String> list = new ArrayList();
if (!StringUtils.isBlank(one)){
list.add(one);
}
if (!StringUtils.isBlank(two)){
list.add(two);
}
if (!StringUtils.isBlank(three)){
list.add(three);
}
if (!StringUtils.isBlank(four)){
list.add(four);
}
//查询是否存在
if (securityDeclarationService.findWaybill(waybill) == 0){
//货物性质(类型)添加
for (String type: list){
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
}
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
if(!StringUtils.isBlank(cargoName)){
//货物品名
String cName = cargoName.replaceAll(",", ",");
String[] split = cName.split(",");
for (int i=0; i<split.length; i++){
for (int i = 0; i < split.length; i++){
if (!StringUtils.isBlank(split[i]) || !"".equals(split[i])){
SDCargoNameEntity sdCargoNameEntity = new SDCargoNameEntity();
sdCargoNameEntity.setSd_waybill(waybill);
... ... @@ -249,11 +238,7 @@ public class SecurityDeclarationController {
//品名
sdVo.setSd_cargo_name(cargoName);
//货物类型
String cargoType = "";
for (String s: list){
cargoType+=s+",";
}
sdVo.setSd_cargo_type(cargoType);
sdVo.setSd_cargo_type(type);
//预配信息
ManifestEntity wbm = manifestService.findWbm(waybill);
... ... @@ -322,6 +307,9 @@ public class SecurityDeclarationController {
String two = request.getParameter("two");
String three = request.getParameter("three");
String four = request.getParameter("four");
String type = cargoType(one, two, three, four);
//航空货物托运人名称
String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
//航空货运销售代理人名称
... ... @@ -346,32 +334,15 @@ public class SecurityDeclarationController {
}
//货物性质是否多选
List<String> list = new ArrayList();
if (!StringUtils.isBlank(one)){
list.add(one);
}
if (!StringUtils.isBlank(two)){
list.add(two);
}
if (!StringUtils.isBlank(three)){
list.add(three);
}
if (!StringUtils.isBlank(four)){
list.add(four);
}
//查询是否存在
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);
}
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
//货物品名
String cName = cargoName.replaceAll(",", ",");
... ... @@ -423,11 +394,8 @@ public class SecurityDeclarationController {
//品名
sdVo.setSd_cargo_name(cargoName);
//货物类型
String cargoType = "";
for (String s: list){
cargoType+=s+",";
}
sdVo.setSd_cargo_type(cargoType);
sdVo.setSd_cargo_type(type);
//添加预配信息
manifestEntity.setWaybillnomaster(waybill);
... ... @@ -596,6 +564,9 @@ public class SecurityDeclarationController {
String two = request.getParameter("two");
String three = request.getParameter("three");
String four = request.getParameter("four");
String type = cargoType(one, two, three, four);
//航空货物托运人名称
String cargoShipperName = request.getParameter("sd_cargo_shipper_name");
//航空货运销售代理人名称
... ... @@ -620,29 +591,15 @@ public class SecurityDeclarationController {
}
List<String> list = new ArrayList();
if (!StringUtils.isBlank(one)){
list.add(one);
}
if (!StringUtils.isBlank(two)){
list.add(two);
}
if (!StringUtils.isBlank(three)){
list.add(three);
}
if (!StringUtils.isBlank(four)){
list.add(four);
}
//先删除货物性质(类型
if (sdCargoTypeService.deleteAlls(waybill)>0){
//货物性质(类型)添加
for (String type: list){
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
}
SDCargoTypeEntity sdCargoTypeEntity = new SDCargoTypeEntity();
sdCargoTypeEntity.setSd_waybill(waybill);
sdCargoTypeEntity.setSd_cargo_type(type);
sdCargoTypeService.save(sdCargoTypeEntity);
}
if (sdCargoNameService.deleteAlls(waybill)>0){
... ... @@ -697,16 +654,10 @@ public class SecurityDeclarationController {
//品名
sdVo.setSd_cargo_name(request.getParameter("sd_cargo_name").replaceAll(",", ","));
//货物类型
String cargoType = "";
for (String s: list){
cargoType+=s+",";
}
sdVo.setSd_cargo_type(cargoType);
sdVo.setSd_cargo_type(type);
// ManifestEntity wbm = manifestService.findWbm(waybill);
ManifestEntity manifestEntity = new ManifestEntity();
//修改预配信息
// manifestEntity.setId(wbm.getId());
manifestEntity.setWaybillnomaster(waybill);
manifestEntity.setFlightdate(flightdate);
manifestEntity.setFlightno(flightno);
... ... @@ -714,9 +665,6 @@ public class SecurityDeclarationController {
manifestEntity.setTotalpiece(totalpiece);
manifestEntity.setTotalweight(totalweight);
manifestEntity.setDestinationstation(destinationstation);
// if (manifestService.deleteOne(waybill)>0){
// manifestService.save(manifestEntity);
// }
manifestService.update(manifestEntity);
//预配信息
... ... @@ -804,4 +752,26 @@ public class SecurityDeclarationController {
return "declaration/print";
}
public String cargoType(String one, String two, String three, String four){
String type = "";
//货物性质
if (!StringUtils.isBlank(one)){
type = one;
}
if (!StringUtils.isBlank(two)){
type = two;
}
if (!StringUtils.isBlank(three)){
type = three;
}
if (!StringUtils.isBlank(four)){
type = four;
}
return type;
}
}
... ...
... ... @@ -29,7 +29,7 @@
<!-- rememberMe管理器 -->
<bean id="rememberMeManager" class="org.apache.shiro.web.mgt.CookieRememberMeManager">
<property name="cipherKey"
value="#{T(org.apache.shiro.codec.Base64).decode('4AvVhmFLUs0KTA3Kprsdag==')}" />
value="#{T(org.apache.shiro.codec.Base64).decode('MDBlZGQyMzhlM2ZjNDYxNDllNmY0ZGE2NTcxODhmYmI==')}" />
<property name="cookie" ref="rememberMeCookie" />
</bean>
... ...
... ... @@ -268,23 +268,7 @@
}
}
//发送交运报文
function sendDelivery(){
var id3 = $("#waybillnomaster").val($("#waybill").val());
var data = $("#form").serialize();
$.post("<%=basePath%>manifest/sendDelivery",data,function (data) {
if (data.status == 200) {
// layer.confirm("<spring:message code="opt.savesuccess"/>", {btn: ['<spring:message code="opt.confirm"/>', '<spring:message code="opt.cancel"/>']}, function () {
<%-- window.location.href = "<%=basePath %>manifest/list" ; --%>
$("#xmlContent").val(data.data);
$("#DialogShunt").window('open');
window.location.href = "<%=basePath%>manifest/list";
// })
} else {
layer.open({content: data.msg});
}
})
}
... ...