|
|
@@ -13,11 +13,12 @@ import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.excel.utils.DateUtil;
|
|
|
import com.sckw.mongo.model.SckwLogisticsOrder;
|
|
|
import com.sckw.mongo.model.TableTops;
|
|
|
-import com.sckw.order.api.dubbo.TradeOrderInfoService;
|
|
|
import com.sckw.report.service.param.ConsignOrderQuery;
|
|
|
import com.sckw.report.service.vo.ConsignOrderExcelVo;
|
|
|
import com.sckw.report.service.vo.ConsignOrderVo;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
+import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -53,8 +54,6 @@ public class KwConsignService {
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
RemoteSystemService remoteSystemService;
|
|
|
|
|
|
- @DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
- TradeOrderInfoService tradeOrderInfoService;
|
|
|
|
|
|
/**
|
|
|
* 托运订单列表查询
|
|
|
@@ -76,10 +75,22 @@ public class KwConsignService {
|
|
|
// } else {
|
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
|
// }
|
|
|
- if (unitType.equals(NumberConstant.ONE)) {
|
|
|
- criteria.and("checkTopEntId").is(LoginUserHolder.getEntId());
|
|
|
+ List<Long> entIds = new ArrayList<>();
|
|
|
+ entIds.add(LoginUserHolder.getEntId());
|
|
|
+ Long entId = LoginUserHolder.getEntId();
|
|
|
+// Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(entIds);
|
|
|
+ if (unitType.equals(String.valueOf(NumberConstant.ONE))) {
|
|
|
+ //托运
|
|
|
+// criteria.and("checkTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
+ criteria.orOperator(
|
|
|
+ Criteria.where("checkTopEntId").is(entId),
|
|
|
+ Criteria.where("checkEntId").is(entId));
|
|
|
} else {
|
|
|
- criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
+ //承运企业主键ID
|
|
|
+// criteria.and("carrierTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
+ criteria.orOperator(
|
|
|
+ Criteria.where("carrierTopEntId").is(entId),
|
|
|
+ Criteria.where("carrierEntId").is(entId));
|
|
|
}
|
|
|
//装卸货地址
|
|
|
String loadCode = query.getLoadAddressCode();
|
|
|
@@ -102,12 +113,12 @@ public class KwConsignService {
|
|
|
case 3 -> criteria.and("unloadCityCode").is(unloadCode);
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(query.getLoadAddress())) {
|
|
|
- criteria.and("loadDetailAddress").is(query.getLoadAddress());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(query.getUnloadAddress())) {
|
|
|
- criteria.and("unloadDetailAddress").is(query.getUnloadAddress());
|
|
|
- }
|
|
|
+// if (StringUtils.isNotBlank(query.getLoadAddress())) {
|
|
|
+// criteria.and("loadDetailAddress").is(query.getLoadAddress());
|
|
|
+// }
|
|
|
+// if (StringUtils.isNotBlank(query.getUnloadAddress())) {
|
|
|
+// criteria.and("unloadDetailAddress").is(query.getUnloadAddress());
|
|
|
+// }
|
|
|
if (StringUtils.isNotBlank(query.getStatus())) {
|
|
|
criteria.and("status").is(query.getStatus());
|
|
|
}
|
|
|
@@ -170,6 +181,19 @@ public class KwConsignService {
|
|
|
* @param returnList
|
|
|
*/
|
|
|
public void packageReturnList(List<SckwLogisticsOrder> list, List<ConsignOrderVo> returnList) {
|
|
|
+ /**计量单位*/
|
|
|
+// Map<String, String> unitTypeDictData = getDictData(DictTypeEnum.UNIT_TYPE.getType());
|
|
|
+ /**运价方式*/
|
|
|
+ Map<String, String> priceDictData = getDictData(DictTypeEnum.PRICE_TYPE.getType());
|
|
|
+ /**计费方式*/
|
|
|
+ Map<String, String> chargingDictData = getDictData(DictTypeEnum.CHARGING_TYPE.getType());
|
|
|
+ /**结算周期*/
|
|
|
+ Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
|
|
|
+ /**签约方式*/
|
|
|
+ Map<String, String> signingWay = getDictData(DictTypeEnum.SIGNING_TYPE.getType());
|
|
|
+ /**合理损耗*/
|
|
|
+// Map<String, String> taxRateTypeDictData = getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
|
|
|
+
|
|
|
for (SckwLogisticsOrder logisticsOrder : list) {
|
|
|
ConsignOrderVo vo = new ConsignOrderVo();
|
|
|
vo.setAccountsCycle(logisticsOrder.getSettlementCycle() == null ?
|
|
|
@@ -219,8 +243,11 @@ public class KwConsignService {
|
|
|
vo.setReceiveGoodsUnitEntId(logisticsOrder.getReceiveGoodsUnitEntId());
|
|
|
vo.setReceiveGoodsUnit(logisticsOrder.getReceiveGoodsUnit());
|
|
|
vo.setGoodsPrice(logisticsOrder.getGoodsPrice());
|
|
|
- vo.setGoodsPriceUnit(logisticsOrder.getGoodsPriceUnit());
|
|
|
+// vo.setGoodsPriceUnit(logisticsOrder.getGoodsPriceUnit());
|
|
|
+ vo.setGoodsPriceUnit(priceDictData.get(logisticsOrder.getGoodsPriceUnit()));
|
|
|
vo.setSigningLabel(signingWay.get(logisticsOrder.getContractSigningWay()));
|
|
|
+// vo.setSigningLabel(logisticsOrder.getContractSigningWay() == null ? null :
|
|
|
+// (logisticsOrder.getContractSigningWay().equals("1")?"线上签约":"线下签约"));
|
|
|
vo.setLossUnit(logisticsOrder.getLossUnit());
|
|
|
vo.setStatusLabel(LogisticsOrderEnum.getDestination(logisticsOrder.getStatus()));
|
|
|
vo.setAccountsCycleLabel(logisticsOrder.getSettlementCycle() == null ?
|
|
|
@@ -231,30 +258,14 @@ public class KwConsignService {
|
|
|
}
|
|
|
|
|
|
public Map<String, String> getDictData(String type) {
|
|
|
- tradeOrderInfoService.getOrderDetailById(5456465L);
|
|
|
Map<String, String> maps = new HashMap<>(NumberConstant.SIXTEEN);
|
|
|
-// List<SysDictResDto> list = remoteSystemService.queryDictByType(type);
|
|
|
-// if (CollectionUtils.isNotEmpty(list)) {
|
|
|
-// maps = list.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (key1, key2) -> key2));
|
|
|
-// }
|
|
|
+ List<SysDictResDto> list = remoteSystemService.queryDictByType(type);
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ maps = list.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (key1, key2) -> key2));
|
|
|
+ }
|
|
|
return maps;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- /**计量单位*/
|
|
|
-// Map<String, String> unitTypeDictData = getDictData(DictTypeEnum.UNIT_TYPE.getType());
|
|
|
- /**运价方式*/
|
|
|
- Map<String, String> priceDictData = getDictData(DictTypeEnum.PRICE_TYPE.getType());
|
|
|
- /**计费方式*/
|
|
|
- Map<String, String> chargingDictData = getDictData(DictTypeEnum.CHARGING_TYPE.getType());
|
|
|
- /**结算周期*/
|
|
|
- Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
|
|
|
- /**签约方式*/
|
|
|
- Map<String, String> signingWay = getDictData(DictTypeEnum.SIGNING_WAY.getType());
|
|
|
- /**合理损耗*/
|
|
|
- Map<String, String> taxRateTypeDictData = getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
|
|
|
-
|
|
|
/**
|
|
|
* 托运订单导出
|
|
|
*
|
|
|
@@ -275,10 +286,15 @@ public class KwConsignService {
|
|
|
// } else {
|
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
|
// }
|
|
|
+ List<Long> entIds = new ArrayList<>();
|
|
|
+ entIds.add(LoginUserHolder.getEntId());
|
|
|
+ Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(entIds);
|
|
|
if (unitType.equals(NumberConstant.ONE)) {
|
|
|
- criteria.and("checkTopEntId").is(LoginUserHolder.getEntId());
|
|
|
+ //托运
|
|
|
+ criteria.and("checkTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
} else {
|
|
|
- criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
+ //承运企业主键ID
|
|
|
+ criteria.and("carrierTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
}
|
|
|
criteria.and("delFlag").is(String.valueOf(NumberConstant.ZERO));
|
|
|
List<String> stringList = StringUtils.splitStrToList(query.getIds(), StringConstant.COMMA, String.class);
|
|
|
@@ -391,10 +407,22 @@ public class KwConsignService {
|
|
|
// } else {
|
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
|
// }
|
|
|
- if (unitType.equals(NumberConstant.ONE)) {
|
|
|
- criteria.and("checkTopEntId").is(LoginUserHolder.getEntId());
|
|
|
+ List<Long> entIds = new ArrayList<>();
|
|
|
+ entIds.add(LoginUserHolder.getEntId());
|
|
|
+ Long entId = LoginUserHolder.getEntId();
|
|
|
+// Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(entIds);
|
|
|
+ if (unitType.equals(String.valueOf(NumberConstant.ONE))) {
|
|
|
+ //托运
|
|
|
+// criteria.and("checkTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
+ criteria.orOperator(
|
|
|
+ Criteria.where("checkTopEntId").is(entId),
|
|
|
+ Criteria.where("checkEntId").is(entId));
|
|
|
} else {
|
|
|
- criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
+ //承运企业主键ID
|
|
|
+// criteria.and("carrierTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
+ criteria.orOperator(
|
|
|
+ Criteria.where("carrierTopEntId").is(entId),
|
|
|
+ Criteria.where("carrierEntId").is(entId));
|
|
|
}
|
|
|
//装卸货地址
|
|
|
String loadCode = param.getLoadAddressCode();
|
|
|
@@ -417,12 +445,12 @@ public class KwConsignService {
|
|
|
case 3 -> criteria.and("unloadCityCode").is(unloadCode);
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(param.getLoadAddress())) {
|
|
|
- criteria.and("loadDetailAddress").is(param.getLoadAddress());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(param.getUnloadAddress())) {
|
|
|
- criteria.and("unloadDetailAddress").is(param.getUnloadAddress());
|
|
|
- }
|
|
|
+// if (StringUtils.isNotBlank(param.getLoadAddress())) {
|
|
|
+// criteria.and("loadDetailAddress").is(param.getLoadAddress());
|
|
|
+// }
|
|
|
+// if (StringUtils.isNotBlank(param.getUnloadAddress())) {
|
|
|
+// criteria.and("unloadDetailAddress").is(param.getUnloadAddress());
|
|
|
+// }
|
|
|
if (StringUtils.isNotBlank(param.getStatus())) {
|
|
|
criteria.and("status").is(param.getStatus());
|
|
|
}
|