|
@@ -9,7 +9,6 @@ import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
|
|
|
import com.sckw.core.common.enums.NumberConstant;
|
|
import com.sckw.core.common.enums.NumberConstant;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.enums.CarWaybillEnum;
|
|
import com.sckw.core.model.enums.CarWaybillEnum;
|
|
|
-import com.sckw.core.model.enums.CooperateTypeEnum;
|
|
|
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
@@ -23,7 +22,6 @@ import com.sckw.excel.utils.ValidUtil;
|
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
|
import com.sckw.fleet.api.model.vo.RTruckVo;
|
|
import com.sckw.fleet.api.model.vo.RTruckVo;
|
|
|
import com.sckw.manage.api.RemoteManageService;
|
|
import com.sckw.manage.api.RemoteManageService;
|
|
|
-import com.sckw.manage.api.model.dto.res.FindEntCooperateResVo;
|
|
|
|
|
import com.sckw.mongo.enums.BusinessTypeEnum;
|
|
import com.sckw.mongo.enums.BusinessTypeEnum;
|
|
|
import com.sckw.mongo.model.SckwLogisticsOrder;
|
|
import com.sckw.mongo.model.SckwLogisticsOrder;
|
|
|
import com.sckw.order.api.dubbo.TradeOrderInfoService;
|
|
import com.sckw.order.api.dubbo.TradeOrderInfoService;
|
|
@@ -31,6 +29,7 @@ import com.sckw.order.api.model.CompleteLogisticsOrderParam;
|
|
|
import com.sckw.stream.model.SckwBusSum;
|
|
import com.sckw.stream.model.SckwBusSum;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.AreaTreeFrontResDto;
|
|
import com.sckw.system.api.model.dto.res.AreaTreeFrontResDto;
|
|
|
|
|
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
import com.sckw.transport.dao.*;
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.dto.*;
|
|
import com.sckw.transport.model.dto.*;
|
|
@@ -64,7 +63,7 @@ public class ConsignOrderService {
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
|
TradeOrderInfoService tradeOrderInfoService;
|
|
TradeOrderInfoService tradeOrderInfoService;
|
|
|
|
|
|
|
|
- @DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
|
|
|
|
+ @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 6000)
|
|
|
RemoteSystemService remoteSystemService;
|
|
RemoteSystemService remoteSystemService;
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
RemoteContractService remoteContractService;
|
|
RemoteContractService remoteContractService;
|
|
@@ -75,6 +74,9 @@ public class ConsignOrderService {
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
RemoteFleetService remoteFleetService;
|
|
RemoteFleetService remoteFleetService;
|
|
|
|
|
|
|
|
|
|
+ @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
|
|
|
|
|
+ RemoteFleetService fleetService;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
public MongoTemplate mongoTemplate;
|
|
public MongoTemplate mongoTemplate;
|
|
|
|
|
|
|
@@ -940,10 +942,10 @@ public class ConsignOrderService {
|
|
|
/**2023-08-16 新增校验承运企业与托运企业是否存在合作关系*/
|
|
/**2023-08-16 新增校验承运企业与托运企业是否存在合作关系*/
|
|
|
String consignCompanyId = addOrderDTO.getConsignCompanyId();
|
|
String consignCompanyId = addOrderDTO.getConsignCompanyId();
|
|
|
String acceptCompanyId = addOrderDTO.getAcceptCompanyId();
|
|
String acceptCompanyId = addOrderDTO.getAcceptCompanyId();
|
|
|
- List<FindEntCooperateResVo> entCooperate = remoteManageService.findEntCooperate(Long.parseLong(consignCompanyId), Long.parseLong(acceptCompanyId), CooperateTypeEnum.CARRIAGE.getCode());
|
|
|
|
|
- if (entCooperate == null) {
|
|
|
|
|
- return HttpResult.error("该承运企业与我方企业并无合作关系!");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// List<FindEntCooperateResVo> entCooperate = remoteManageService.findEntCooperate(Long.parseLong(consignCompanyId), Long.parseLong(acceptCompanyId), CooperateTypeEnum.CARRIAGE.getCode());
|
|
|
|
|
+// if (entCooperate == null) {
|
|
|
|
|
+// return HttpResult.error("该承运企业与我方企业并无合作关系!");
|
|
|
|
|
+// }
|
|
|
/**保存新建数据*/
|
|
/**保存新建数据*/
|
|
|
Long lOrderId = new IdWorker(NumberConstant.ONE).nextId();
|
|
Long lOrderId = new IdWorker(NumberConstant.ONE).nextId();
|
|
|
/**生成订单编号*/
|
|
/**生成订单编号*/
|
|
@@ -1180,6 +1182,11 @@ public class ConsignOrderService {
|
|
|
consignUnit.setLOrderId(lOrderId);
|
|
consignUnit.setLOrderId(lOrderId);
|
|
|
consignUnit.setUnitType(NumberConstant.ONE);
|
|
consignUnit.setUnitType(NumberConstant.ONE);
|
|
|
consignUnit.setEntId(Long.parseLong(addOrderDTO.getConsignCompanyId()));
|
|
consignUnit.setEntId(Long.parseLong(addOrderDTO.getConsignCompanyId()));
|
|
|
|
|
+ Map<Long, EntCacheResDto> dtoMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong(addOrderDTO.getConsignCompanyId())));
|
|
|
|
|
+ if (dtoMap == null || dtoMap.get(Long.parseLong(addOrderDTO.getConsignCompanyId())) == null) {
|
|
|
|
|
+ throw new BusinessException("该【" + addOrderDTO.getConsignCompany() + "】一级企业不存在!");
|
|
|
|
|
+ }
|
|
|
|
|
+ consignUnit.setTopEntId(dtoMap.get(Long.parseLong(addOrderDTO.getConsignCompanyId())).getId());
|
|
|
consignUnit.setFirmName(addOrderDTO.getConsignCompany());
|
|
consignUnit.setFirmName(addOrderDTO.getConsignCompany());
|
|
|
consignUnit.setContacts(addOrderDTO.getConsignContacts());
|
|
consignUnit.setContacts(addOrderDTO.getConsignContacts());
|
|
|
consignUnit.setPhone(addOrderDTO.getConsignContactPhone());
|
|
consignUnit.setPhone(addOrderDTO.getConsignContactPhone());
|
|
@@ -1195,6 +1202,11 @@ public class ConsignOrderService {
|
|
|
unit.setLOrderId(lOrderId);
|
|
unit.setLOrderId(lOrderId);
|
|
|
unit.setUnitType(NumberConstant.TWO);
|
|
unit.setUnitType(NumberConstant.TWO);
|
|
|
unit.setEntId(Long.parseLong(addOrderDTO.getAcceptCompanyId()));
|
|
unit.setEntId(Long.parseLong(addOrderDTO.getAcceptCompanyId()));
|
|
|
|
|
+ Map<Long, EntCacheResDto> dtoMap1 = remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong(addOrderDTO.getAcceptCompanyId())));
|
|
|
|
|
+ if (dtoMap1 == null || dtoMap1.get(Long.parseLong(addOrderDTO.getAcceptCompanyId())) == null) {
|
|
|
|
|
+ throw new BusinessException("该【" + addOrderDTO.getAcceptCompany() + "】一级企业不存在!");
|
|
|
|
|
+ }
|
|
|
|
|
+ unit.setTopEntId(dtoMap1.get(Long.parseLong(addOrderDTO.getAcceptCompanyId())).getId());
|
|
|
unit.setFirmName(addOrderDTO.getAcceptCompany());
|
|
unit.setFirmName(addOrderDTO.getAcceptCompany());
|
|
|
unit.setContacts(addOrderDTO.getAcceptContacts());
|
|
unit.setContacts(addOrderDTO.getAcceptContacts());
|
|
|
unit.setPhone(addOrderDTO.getAcceptContactPhone());
|
|
unit.setPhone(addOrderDTO.getAcceptContactPhone());
|
|
@@ -1259,10 +1271,20 @@ public class ConsignOrderService {
|
|
|
order.setContractName(infoResDto.getContactName());
|
|
order.setContractName(infoResDto.getContactName());
|
|
|
order.setContractSigningWay(String.valueOf(infoResDto.getSigningWay()));
|
|
order.setContractSigningWay(String.valueOf(infoResDto.getSigningWay()));
|
|
|
order.setCheckEntId(Long.parseLong(addOrderDTO.getConsignCompanyId()));
|
|
order.setCheckEntId(Long.parseLong(addOrderDTO.getConsignCompanyId()));
|
|
|
|
|
+ Map<Long, EntCacheResDto> dtoMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong(addOrderDTO.getConsignCompanyId())));
|
|
|
|
|
+ if (dtoMap == null || dtoMap.get(Long.parseLong(addOrderDTO.getConsignCompanyId())) == null) {
|
|
|
|
|
+ throw new BusinessException("该【" + addOrderDTO.getConsignCompany() + "】一级企业不存在!");
|
|
|
|
|
+ }
|
|
|
|
|
+ order.setCheckTopEntId(dtoMap.get(Long.parseLong(addOrderDTO.getConsignCompanyId())).getId());
|
|
|
order.setCheckFirmName(addOrderDTO.getConsignCompany());
|
|
order.setCheckFirmName(addOrderDTO.getConsignCompany());
|
|
|
order.setCheckContacts(addOrderDTO.getConsignContacts());
|
|
order.setCheckContacts(addOrderDTO.getConsignContacts());
|
|
|
order.setCheckPhone(addOrderDTO.getConsignContactPhone());
|
|
order.setCheckPhone(addOrderDTO.getConsignContactPhone());
|
|
|
order.setCarrierEntId(Long.parseLong(addOrderDTO.getAcceptCompanyId()));
|
|
order.setCarrierEntId(Long.parseLong(addOrderDTO.getAcceptCompanyId()));
|
|
|
|
|
+ Map<Long, EntCacheResDto> dtoMap1 = remoteSystemService.queryEntTreeByIds(Collections.singletonList(Long.parseLong(addOrderDTO.getAcceptCompanyId())));
|
|
|
|
|
+ if (dtoMap1 == null || dtoMap1.get(Long.parseLong(addOrderDTO.getAcceptCompanyId())) == null) {
|
|
|
|
|
+ throw new BusinessException("该【" + addOrderDTO.getAcceptCompany() + "】一级企业不存在!");
|
|
|
|
|
+ }
|
|
|
|
|
+ order.setCarrierTopEntId(dtoMap1.get(Long.parseLong(addOrderDTO.getAcceptCompanyId())).getId());
|
|
|
order.setCarrierFirmName(addOrderDTO.getAcceptCompany());
|
|
order.setCarrierFirmName(addOrderDTO.getAcceptCompany());
|
|
|
order.setCarrierContacts(addOrderDTO.getAcceptContacts());
|
|
order.setCarrierContacts(addOrderDTO.getAcceptContacts());
|
|
|
order.setCarrierPhone(addOrderDTO.getAcceptContactPhone());
|
|
order.setCarrierPhone(addOrderDTO.getAcceptContactPhone());
|