|
|
@@ -288,7 +288,7 @@ public class KwtAcceptCarriageOrderImportService {
|
|
|
/**根据合同计算当前单据状态*/
|
|
|
/**判断生成物流订单应生成哪一种单据状态*/
|
|
|
String contractNo = excelImport.getContract().trim();
|
|
|
- ContractLogisticsOrderResDto commonInfoResDto = remoteContractService.getContractByContractNo(contractNo,acceptCarriageEnterprise.getId(),consignEnterprise.getId());
|
|
|
+ ContractLogisticsOrderResDto commonInfoResDto = remoteContractService.getContractByContractNo(contractNo, acceptCarriageEnterprise.getId(), consignEnterprise.getId());
|
|
|
/**状态判断
|
|
|
* 是否是已签约合同
|
|
|
* */
|
|
|
@@ -562,7 +562,7 @@ public class KwtAcceptCarriageOrderImportService {
|
|
|
EntAddressResDto entAddressResDto = unloadAddressMap.get(unloadAddressName);
|
|
|
EntAddressResDto entAddressResDto1 = allAddressResMap.get(unloadAddressName);
|
|
|
if (entAddressResDto == null) {
|
|
|
- if (entAddressResDto1.getName().equals(loadAddressName)) {
|
|
|
+ if (entAddressResDto1.getName().equals(unloadAddressName)) {
|
|
|
unloadAddress.setName(entAddressResDto1.getName());
|
|
|
unloadAddress.setContacts(entAddressResDto1.getContacts());
|
|
|
unloadAddress.setPhone(entAddressResDto1.getPhone());
|
|
|
@@ -573,7 +573,7 @@ public class KwtAcceptCarriageOrderImportService {
|
|
|
unloadAddress.setLng(entAddressResDto1.getLng());
|
|
|
}
|
|
|
} else {
|
|
|
- if (entAddressResDto.getName().equals(loadAddressName)) {
|
|
|
+ if (entAddressResDto.getName().equals(unloadAddressName)) {
|
|
|
unloadAddress.setName(entAddressResDto.getName());
|
|
|
unloadAddress.setContacts(entAddressResDto.getContacts());
|
|
|
unloadAddress.setPhone(entAddressResDto.getPhone());
|
|
|
@@ -728,8 +728,8 @@ public class KwtAcceptCarriageOrderImportService {
|
|
|
throw new RuntimeException("第" + number + "行商品分类信息不存在");
|
|
|
}
|
|
|
String contractNo = excelImport.getContract().trim();
|
|
|
- ContractLogisticsOrderResDto commonInfoResDto = remoteContractService.getContractByContractNo(contractNo,acceptCarriageEnterprise.getId(),consignEnterprise.getId());
|
|
|
- if (commonInfoResDto == null ) {
|
|
|
+ ContractLogisticsOrderResDto commonInfoResDto = remoteContractService.getContractByContractNo(contractNo, acceptCarriageEnterprise.getId(), consignEnterprise.getId());
|
|
|
+ if (commonInfoResDto == null || (commonInfoResDto.getId() == null)) {
|
|
|
throw new RuntimeException("第" + number + "行合同信息不存在");
|
|
|
}
|
|
|
if (commonInfoResDto.getConsignEntName() == null) {
|
|
|
@@ -795,6 +795,12 @@ public class KwtAcceptCarriageOrderImportService {
|
|
|
loadAddress.addAll(allAddress);
|
|
|
unloadAddress.addAll(allAddress);
|
|
|
}
|
|
|
+ if (loadAddress.size() < 1) {
|
|
|
+ throw new RuntimeException("第" + number + "行承运企业在系统中并未维护该装货地址");
|
|
|
+ }
|
|
|
+ if (unloadAddress.size() < 1) {
|
|
|
+ throw new RuntimeException("第" + number + "行承运企业在系统中并未维护该卸货地址");
|
|
|
+ }
|
|
|
if (loadAddress.size() > 0) {
|
|
|
loadAddress = loadAddress.stream().distinct().collect(Collectors.toList());
|
|
|
if (!loadAddress.contains(loadAddressName)) {
|
|
|
@@ -828,7 +834,7 @@ public class KwtAcceptCarriageOrderImportService {
|
|
|
Map<Long, EntCacheResDto> map = remoteSystemService.queryEntTreeByIds(Collections.singletonList(LoginUserHolder.getEntId()));
|
|
|
if (map != null) {
|
|
|
Long loginEntId = map.get(LoginUserHolder.getEntId()).getId();
|
|
|
- if (entIds.size() != 1 || (entIds.get(0) != loginEntId)) {
|
|
|
+ if (entIds.size() != 1 || (!entIds.get(0).equals( loginEntId))) {
|
|
|
throw new RuntimeException("存在有承运单位与登录账号不属于同单位!");
|
|
|
}
|
|
|
} else {
|