作者 shenhailong

远程登录 添加分单录入

... ... @@ -1280,7 +1280,7 @@ public class ManifestController extends BasicController {
}else {
// 判断 主分单
if(StringUtils.isBlank(manifest.getDe_number())){
if(StringUtils.isBlank(manifest.getDe_volume())){
// 查看主单号
if (manifest.getWaybillnomaster().contains("-")) {
... ... @@ -1292,7 +1292,6 @@ public class ManifestController extends BasicController {
manifest.setWaybillnomaster(waybill.toString());
}
manifest.setDe_size("");
String flightno = manifest.getFlightno();
... ... @@ -1310,7 +1309,7 @@ public class ManifestController extends BasicController {
ManifestEntity wbm = manifestService.findWbm(manifest.getWaybillnomaster());
if (wbm != null) {
model.setStatus(201);
model.setMsg("该订单号已存在!");
model.setMsg("单号已存在!");
} else {
WaybillReceiptType type = WaybillReceiptType.TEMP_SAVE;
... ... @@ -1329,10 +1328,20 @@ public class ManifestController extends BasicController {
model.setMsg(HttpJsonMsg.SUCCESS);
}
}else {
PreparesecondaryEntity pe = new PreparesecondaryEntity();
pe.setWaybillnomaster(manifest.getWaybillnomaster());
// 查看主单号
if (manifest.getWaybillnomaster().contains("-")) {
} else {
StringBuilder stringBuilder = new StringBuilder(manifest.getWaybillnomaster());
StringBuilder waybill = stringBuilder.insert(3, "-");
pe.setWaybillnomaster(waybill.toString());
}
pe.setWaybillnosecondary(manifest.getDe_volume());
pe.setDe_type(manifest.getDe_type());
pe.setDelivery_station(manifest.getDelivery_station());
... ... @@ -1380,10 +1389,19 @@ public class ManifestController extends BasicController {
pe.setUSER_ID(manifest.getUSER_ID());
pe.setReach_station(manifest.getReach_station());
preparesecondaryServer.save(pe);
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
int i = preparesecondaryServer.findAwbAwbH(pe.getWaybillnomaster(), pe.getWaybillnosecondary());
if (i > 0){
model.setData(204);
model.setMsg("分单号存在");
}else {
preparesecondaryServer.save(pe);
model.setData(manifest);
model.setStatus(200);
model.setMsg(HttpJsonMsg.SUCCESS);
}
}
}
... ...
... ... @@ -46,4 +46,7 @@ JpaSpecificationExecutor<PreparesecondaryEntity>{
@Query(value = "SELECT WAYBILLNOSECONDARY FROM PREPARESECONDARY WHERE WAYBILLNOMASTER = ?1", nativeQuery = true)
String findWaybill(String wbm);
@Query(value = "select count(id) from PREPARESECONDARY where WAYBILLNOMASTER = ?1 and WAYBILLNOSECONDARY=?2", nativeQuery = true)
int findAwbAwbH(String awb, String awbh);
}
... ...
package com.agent.service.agent;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
... ... @@ -99,4 +101,10 @@ public class PreparesecondaryService extends BasicService<PreparesecondaryEntity
return preparesecondaryRepository.findWaybill(wbm);
}
public int findAwbAwbH(String awb, String awbh){
return preparesecondaryRepository.findAwbAwbH(awb, awbh);
}
}
... ...