...
|
...
|
@@ -1310,96 +1310,96 @@ public class ManifestController extends BasicController { |
|
|
String de_packing = manifest.getDe_packing();
|
|
|
// 操作代理 。。。。。。。。。
|
|
|
String de_remarks = manifest.getDe_remarks();
|
|
|
// 货主信息
|
|
|
if(StringUtils.isBlank(de_trstation) && StringUtils.isBlank(de_packing) && StringUtils.isBlank(de_remarks)){
|
|
|
|
|
|
model.setStatus(205);
|
|
|
model.setMsg("货主信息三选一,不能为空");
|
|
|
// 判断主单是否存在
|
|
|
ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
|
|
|
if (wbm != null) {
|
|
|
model.setStatus(201);
|
|
|
model.setMsg("主单号已存在!");
|
|
|
} else {
|
|
|
// 货主信息
|
|
|
if(StringUtils.isBlank(de_trstation) && StringUtils.isBlank(de_packing) && StringUtils.isBlank(de_remarks)){
|
|
|
|
|
|
return model;
|
|
|
model.setStatus(205);
|
|
|
model.setMsg("货主信息三选一,不能为空");
|
|
|
|
|
|
}else {
|
|
|
if (StringUtils.isNotBlank(de_trstation)){
|
|
|
String s = de_trstation.replace(",", ",");
|
|
|
String[] split = s.split(",");
|
|
|
Long id = hzInfoService.selectForShortType(split[0], split[1]);
|
|
|
if (id != null){
|
|
|
HZWAYBLLINFOEntity hzwaybllinfoEntity = new HZWAYBLLINFOEntity();
|
|
|
hzwaybllinfoEntity.setHzinfor_id(String.valueOf(id));
|
|
|
hzwaybllinfoEntity.setWaybill_id(manifest.getWaybillnomaster());
|
|
|
if (hzWaybillService.awbHzid(hzwaybllinfoEntity) != 0){
|
|
|
model.setStatus(209);
|
|
|
model.setMsg("发货人不能重复录入");
|
|
|
return model;
|
|
|
return model;
|
|
|
|
|
|
}else {
|
|
|
if (StringUtils.isNotBlank(de_trstation)){
|
|
|
String s = de_trstation.replace(",", ",");
|
|
|
String[] split = s.split(",");
|
|
|
Long id = hzInfoService.selectForShortType(split[0], split[1]);
|
|
|
if (id != null){
|
|
|
HZWAYBLLINFOEntity hzwaybllinfoEntity = new HZWAYBLLINFOEntity();
|
|
|
hzwaybllinfoEntity.setHzinfor_id(String.valueOf(id));
|
|
|
hzwaybllinfoEntity.setWaybill_id(manifest.getWaybillnomaster());
|
|
|
if (hzWaybillService.awbHzid(hzwaybllinfoEntity) != 0){
|
|
|
model.setStatus(209);
|
|
|
model.setMsg("发货人不能重复录入");
|
|
|
return model;
|
|
|
}else {
|
|
|
hzWaybillService.save(hzwaybllinfoEntity);
|
|
|
}
|
|
|
}else {
|
|
|
hzWaybillService.save(hzwaybllinfoEntity);
|
|
|
model.setStatus(206);
|
|
|
model.setMsg("发货人,简称和类型有误!");
|
|
|
hzWaybillService.deleteAlls(manifest.getWaybillnomaster());
|
|
|
return model;
|
|
|
}
|
|
|
}else {
|
|
|
model.setStatus(206);
|
|
|
model.setMsg("发货人,简称和类型有误!");
|
|
|
hzWaybillService.deleteAlls(manifest.getWaybillnomaster());
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(de_packing)){
|
|
|
String s = de_packing.replace(",", ",");
|
|
|
String[] split = s.split(",");
|
|
|
Long id = hzInfoService.selectForShortType(split[0], split[1]);
|
|
|
if (id != null){
|
|
|
HZWAYBLLINFOEntity hzwaybllinfoEntity = new HZWAYBLLINFOEntity();
|
|
|
hzwaybllinfoEntity.setHzinfor_id(String.valueOf(id));
|
|
|
hzwaybllinfoEntity.setWaybill_id(manifest.getWaybillnomaster());
|
|
|
|
|
|
if (hzWaybillService.awbHzid(hzwaybllinfoEntity) != 0 ){
|
|
|
model.setStatus(210);
|
|
|
model.setMsg("订舱代理不能重复录入");
|
|
|
if (StringUtils.isNotBlank(de_packing)){
|
|
|
String s = de_packing.replace(",", ",");
|
|
|
String[] split = s.split(",");
|
|
|
Long id = hzInfoService.selectForShortType(split[0], split[1]);
|
|
|
if (id != null){
|
|
|
HZWAYBLLINFOEntity hzwaybllinfoEntity = new HZWAYBLLINFOEntity();
|
|
|
hzwaybllinfoEntity.setHzinfor_id(String.valueOf(id));
|
|
|
hzwaybllinfoEntity.setWaybill_id(manifest.getWaybillnomaster());
|
|
|
|
|
|
if (hzWaybillService.awbHzid(hzwaybllinfoEntity) != 0 ){
|
|
|
model.setStatus(210);
|
|
|
model.setMsg("订舱代理不能重复录入");
|
|
|
hzWaybillService.deleteAlls(manifest.getWaybillnomaster());
|
|
|
|
|
|
return model;
|
|
|
}else {
|
|
|
hzWaybillService.save(hzwaybllinfoEntity);
|
|
|
}
|
|
|
}else {
|
|
|
model.setStatus(207);
|
|
|
model.setMsg("订舱代理,简称和类型有误!");
|
|
|
hzWaybillService.deleteAlls(manifest.getWaybillnomaster());
|
|
|
|
|
|
return model;
|
|
|
}else {
|
|
|
hzWaybillService.save(hzwaybllinfoEntity);
|
|
|
}
|
|
|
}else {
|
|
|
model.setStatus(207);
|
|
|
model.setMsg("订舱代理,简称和类型有误!");
|
|
|
hzWaybillService.deleteAlls(manifest.getWaybillnomaster());
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(de_remarks)){
|
|
|
String s = de_remarks.replace(",", ",");
|
|
|
String[] split = s.split(",");
|
|
|
Long id = hzInfoService.selectForShortType(split[0], split[1]);
|
|
|
if (id != null){
|
|
|
HZWAYBLLINFOEntity hzwaybllinfoEntity = new HZWAYBLLINFOEntity();
|
|
|
hzwaybllinfoEntity.setHzinfor_id(String.valueOf(id));
|
|
|
hzwaybllinfoEntity.setWaybill_id(manifest.getWaybillnomaster());
|
|
|
if (hzWaybillService.awbHzid(hzwaybllinfoEntity) != 0){
|
|
|
model.setStatus(211);
|
|
|
model.setMsg("操作代理不能重复录入");
|
|
|
return model;
|
|
|
if (StringUtils.isNotBlank(de_remarks)){
|
|
|
String s = de_remarks.replace(",", ",");
|
|
|
String[] split = s.split(",");
|
|
|
Long id = hzInfoService.selectForShortType(split[0], split[1]);
|
|
|
if (id != null){
|
|
|
HZWAYBLLINFOEntity hzwaybllinfoEntity = new HZWAYBLLINFOEntity();
|
|
|
hzwaybllinfoEntity.setHzinfor_id(String.valueOf(id));
|
|
|
hzwaybllinfoEntity.setWaybill_id(manifest.getWaybillnomaster());
|
|
|
if (hzWaybillService.awbHzid(hzwaybllinfoEntity) != 0){
|
|
|
model.setStatus(211);
|
|
|
model.setMsg("操作代理不能重复录入");
|
|
|
return model;
|
|
|
}else {
|
|
|
hzWaybillService.save(hzwaybllinfoEntity);
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
hzWaybillService.save(hzwaybllinfoEntity);
|
|
|
model.setStatus(208);
|
|
|
model.setMsg("操作代理,简称和类型有误!");
|
|
|
return model;
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
model.setStatus(208);
|
|
|
model.setMsg("操作代理,简称和类型有误!");
|
|
|
return model;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 判断主单是否存在
|
|
|
ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
|
|
|
if (wbm != null) {
|
|
|
model.setStatus(201);
|
|
|
model.setMsg("主单号已存在!");
|
|
|
} else {
|
|
|
WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;
|
|
|
|
|
|
String stowagedate = request.getParameter("stowagedate");
|
...
|
...
|
|