作者 shenhailong

远程登录 添加分单录入

@@ -1280,7 +1280,7 @@ public class ManifestController extends BasicController { @@ -1280,7 +1280,7 @@ public class ManifestController extends BasicController {
1280 1280
1281 }else { 1281 }else {
1282 // 判断 主分单 1282 // 判断 主分单
1283 - if(StringUtils.isBlank(manifest.getDe_number())){ 1283 + if(StringUtils.isBlank(manifest.getDe_volume())){
1284 // 查看主单号 1284 // 查看主单号
1285 if (manifest.getWaybillnomaster().contains("-")) { 1285 if (manifest.getWaybillnomaster().contains("-")) {
1286 1286
@@ -1292,7 +1292,6 @@ public class ManifestController extends BasicController { @@ -1292,7 +1292,6 @@ public class ManifestController extends BasicController {
1292 manifest.setWaybillnomaster(waybill.toString()); 1292 manifest.setWaybillnomaster(waybill.toString());
1293 1293
1294 } 1294 }
1295 -  
1296 manifest.setDe_size(""); 1295 manifest.setDe_size("");
1297 1296
1298 String flightno = manifest.getFlightno(); 1297 String flightno = manifest.getFlightno();
@@ -1310,7 +1309,7 @@ public class ManifestController extends BasicController { @@ -1310,7 +1309,7 @@ public class ManifestController extends BasicController {
1310 ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster()); 1309 ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
1311 if (wbm != null) { 1310 if (wbm != null) {
1312 model.setStatus(201); 1311 model.setStatus(201);
1313 - model.setMsg("该订单号已存在!"); 1312 + model.setMsg("单号已存在!");
1314 } else { 1313 } else {
1315 WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE; 1314 WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;
1316 1315
@@ -1329,10 +1328,20 @@ public class ManifestController extends BasicController { @@ -1329,10 +1328,20 @@ public class ManifestController extends BasicController {
1329 model.setMsg(HttpJsonMsg.SUCCESS); 1328 model.setMsg(HttpJsonMsg.SUCCESS);
1330 } 1329 }
1331 }else { 1330 }else {
1332 -  
1333 PreparesecondaryEntity pe = new PreparesecondaryEntity(); 1331 PreparesecondaryEntity pe = new PreparesecondaryEntity();
1334 1332
1335 - pe.setWaybillnomaster(manifest.getWaybillnomaster()); 1333 + // 查看主单号
  1334 + if (manifest.getWaybillnomaster().contains("-")) {
  1335 +
  1336 + } else {
  1337 + StringBuilder stringBuilder = new StringBuilder(manifest.getWaybillnomaster());
  1338 +
  1339 + StringBuilder waybill = stringBuilder.insert(3, "-");
  1340 +
  1341 + pe.setWaybillnomaster(waybill.toString());
  1342 +
  1343 + }
  1344 +
1336 pe.setWaybillnosecondary(manifest.getDe_volume()); 1345 pe.setWaybillnosecondary(manifest.getDe_volume());
1337 pe.setDe_type(manifest.getDe_type()); 1346 pe.setDe_type(manifest.getDe_type());
1338 pe.setDelivery_station(manifest.getDelivery_station()); 1347 pe.setDelivery_station(manifest.getDelivery_station());
@@ -1380,11 +1389,20 @@ public class ManifestController extends BasicController { @@ -1380,11 +1389,20 @@ public class ManifestController extends BasicController {
1380 pe.setUSER_ID(manifest.getUSER_ID()); 1389 pe.setUSER_ID(manifest.getUSER_ID());
1381 pe.setReach_station(manifest.getReach_station()); 1390 pe.setReach_station(manifest.getReach_station());
1382 1391
  1392 + int i = preparesecondaryServer.findAwbAwbH(pe.getWaybillnomaster(), pe.getWaybillnosecondary());
  1393 +
  1394 + if (i > 0){
  1395 +
  1396 + model.setData(204);
  1397 + model.setMsg("分单号存在");
  1398 +
  1399 + }else {
1383 preparesecondaryServer.save(pe); 1400 preparesecondaryServer.save(pe);
1384 model.setData(manifest); 1401 model.setData(manifest);
1385 model.setStatus(200); 1402 model.setStatus(200);
1386 model.setMsg(HttpJsonMsg.SUCCESS); 1403 model.setMsg(HttpJsonMsg.SUCCESS);
1387 } 1404 }
  1405 + }
1388 1406
1389 } 1407 }
1390 }else{ 1408 }else{
@@ -46,4 +46,7 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{ @@ -46,4 +46,7 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{
46 46
47 @Query(value = "SELECT WAYBILLNOSECONDARY FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1", nativeQuery = true) 47 @Query(value = "SELECT WAYBILLNOSECONDARY FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1", nativeQuery = true)
48 String findWaybill(String wbm); 48 String findWaybill(String wbm);
  49 +
  50 + @Query(value = "select count(id) from PREPARESECONDARY where WAYBILLNOMASTER = ?1 and WAYBILLNOSECONDARY=?2", nativeQuery = true)
  51 + int findAwbAwbH(String awb, String awbh);
49 } 52 }
1 package com.agent.service.agent; 1 package com.agent.service.agent;
2 2
  3 +import java.util.HashMap;
3 import java.util.List; 4 import java.util.List;
  5 +import java.util.Map;
4 6
5 import javax.annotation.Resource; 7 import javax.annotation.Resource;
6 8
@@ -99,4 +101,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity @@ -99,4 +101,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity
99 return preparesecondaryRepository.findWaybill(wbm); 101 return preparesecondaryRepository.findWaybill(wbm);
100 } 102 }
101 103
  104 +
  105 + public int findAwbAwbH(String awb, String awbh){
  106 +
  107 + return preparesecondaryRepository.findAwbAwbH(awb, awbh);
  108 + }
  109 +
102 } 110 }