|
@@ -17,6 +17,7 @@ import com.sckw.report.service.param.AcceptCarriageOrderQuery;
|
|
|
import com.sckw.report.service.vo.AcceptCarriageOrderExcelVo;
|
|
import com.sckw.report.service.vo.AcceptCarriageOrderExcelVo;
|
|
|
import com.sckw.report.service.vo.AcceptCarriageOrderVo;
|
|
import com.sckw.report.service.vo.AcceptCarriageOrderVo;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
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 com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
@@ -60,6 +61,7 @@ public class KwAcceptCarriageService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public HttpResult acceptCarriageOrderList(AcceptCarriageOrderQuery query, String unitType) {
|
|
public HttpResult acceptCarriageOrderList(AcceptCarriageOrderQuery query, String unitType) {
|
|
|
|
|
+ Query query1 = new Query();
|
|
|
//模糊匹配
|
|
//模糊匹配
|
|
|
//根据条件查询所有并排序,且分页
|
|
//根据条件查询所有并排序,且分页
|
|
|
//设置模糊查询匹配规则 忽略大小写
|
|
//设置模糊查询匹配规则 忽略大小写
|
|
@@ -72,10 +74,24 @@ public class KwAcceptCarriageService {
|
|
|
// } else {
|
|
// } else {
|
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
// 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.and("checkTopEntId").is(entId);
|
|
|
|
|
+// criteria.orOperator(
|
|
|
|
|
+// Criteria.where("checkTopEntId").is(entId),
|
|
|
|
|
+// Criteria.where("checkEntId").is(entId));
|
|
|
} else {
|
|
} else {
|
|
|
- criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
|
|
|
|
+ //承运企业主键ID
|
|
|
|
|
+// criteria.and("carrierTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
|
|
+ criteria.and("carrierTopEntId").is(entId);
|
|
|
|
|
+// criteria.orOperator(
|
|
|
|
|
+// Criteria.where("carrierTopEntId").is(entId),
|
|
|
|
|
+// Criteria.where("carrierEntId").is(entId));
|
|
|
}
|
|
}
|
|
|
//装卸货地址
|
|
//装卸货地址
|
|
|
String loadCode = query.getLoadAddressCode();
|
|
String loadCode = query.getLoadAddressCode();
|
|
@@ -98,12 +114,12 @@ public class KwAcceptCarriageService {
|
|
|
case 3 -> criteria.and("unloadCityCode").is(unloadCode);
|
|
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())) {
|
|
if (StringUtils.isNotBlank(query.getStatus())) {
|
|
|
if (String.valueOf(NumberConstant.EIGHT).equals(query.getStatus())) {
|
|
if (String.valueOf(NumberConstant.EIGHT).equals(query.getStatus())) {
|
|
|
List<String> status = new ArrayList<>();
|
|
List<String> status = new ArrayList<>();
|
|
@@ -152,12 +168,13 @@ public class KwAcceptCarriageService {
|
|
|
criteria.orOperator(c1, c2, c3, c4, c5);
|
|
criteria.orOperator(c1, c2, c3, c4, c5);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Query query1 = new Query(criteria);
|
|
|
|
|
|
|
+
|
|
|
//in查询
|
|
//in查询
|
|
|
List<String> stringList = StringUtils.splitStrToList(query.getIds(), StringConstant.COMMA, String.class);
|
|
List<String> stringList = StringUtils.splitStrToList(query.getIds(), StringConstant.COMMA, String.class);
|
|
|
if (CollectionUtils.isNotEmpty(stringList)) {
|
|
if (CollectionUtils.isNotEmpty(stringList)) {
|
|
|
query1.addCriteria(Criteria.where("lOrderId").in(query.getIds()));
|
|
query1.addCriteria(Criteria.where("lOrderId").in(query.getIds()));
|
|
|
}
|
|
}
|
|
|
|
|
+ query1.addCriteria(criteria);
|
|
|
// 12. 总记录数
|
|
// 12. 总记录数
|
|
|
long total = mongoTemplate.count(query1, SckwLogisticsOrder.class);
|
|
long total = mongoTemplate.count(query1, SckwLogisticsOrder.class);
|
|
|
// 10. 分页
|
|
// 10. 分页
|
|
@@ -187,10 +204,17 @@ public class KwAcceptCarriageService {
|
|
|
// } else {
|
|
// } else {
|
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
|
// }
|
|
// }
|
|
|
- if (unitType.equals(NumberConstant.ONE)) {
|
|
|
|
|
- criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ List<Long> entIds = new ArrayList<>();
|
|
|
|
|
+ entIds.add(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.and("checkTopEntId").is(LoginUserHolder.getEntId());
|
|
criteria.and("checkTopEntId").is(LoginUserHolder.getEntId());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //承运企业主键ID
|
|
|
|
|
+// criteria.and("carrierTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
|
|
+ criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
}
|
|
}
|
|
|
//装卸货地址
|
|
//装卸货地址
|
|
|
String loadCode = param.getLoadAddressCode();
|
|
String loadCode = param.getLoadAddressCode();
|
|
@@ -213,12 +237,12 @@ public class KwAcceptCarriageService {
|
|
|
case 3 -> criteria.and("unloadCityCode").is(unloadCode);
|
|
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())) {
|
|
if (StringUtils.isNotBlank(param.getStatus())) {
|
|
|
if (String.valueOf(NumberConstant.EIGHT).equals(param.getStatus())) {
|
|
if (String.valueOf(NumberConstant.EIGHT).equals(param.getStatus())) {
|
|
@@ -299,7 +323,7 @@ public class KwAcceptCarriageService {
|
|
|
* @param list
|
|
* @param list
|
|
|
* @param returnList
|
|
* @param returnList
|
|
|
*/
|
|
*/
|
|
|
- private void packageReturnAcceptCarriageOrderList(List<SckwLogisticsOrder> list, List<AcceptCarriageOrderVo> returnList) {
|
|
|
|
|
|
|
+ public void packageReturnAcceptCarriageOrderList(List<SckwLogisticsOrder> list, List<AcceptCarriageOrderVo> returnList) {
|
|
|
/**计量单位*/
|
|
/**计量单位*/
|
|
|
Map<String, String> unitTypeDictData = getDictData(DictTypeEnum.UNIT_TYPE.getType());
|
|
Map<String, String> unitTypeDictData = getDictData(DictTypeEnum.UNIT_TYPE.getType());
|
|
|
/**运价方式*/
|
|
/**运价方式*/
|
|
@@ -309,9 +333,9 @@ public class KwAcceptCarriageService {
|
|
|
/**结算周期*/
|
|
/**结算周期*/
|
|
|
Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
|
|
Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
|
|
|
/**签约方式*/
|
|
/**签约方式*/
|
|
|
- Map<String, String> signingWay = getDictData(DictTypeEnum.SIGNING_WAY.getType());
|
|
|
|
|
|
|
+ Map<String, String> signingWay = getDictData(DictTypeEnum.SIGNING_TYPE.getType());
|
|
|
/**合理损耗*/
|
|
/**合理损耗*/
|
|
|
- Map<String, String> taxRateTypeDictData = getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
|
|
|
|
|
|
|
+// Map<String, String> taxRateTypeDictData = getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
|
|
|
for (SckwLogisticsOrder logisticsOrder : list) {
|
|
for (SckwLogisticsOrder logisticsOrder : list) {
|
|
|
AcceptCarriageOrderVo vo = new AcceptCarriageOrderVo();
|
|
AcceptCarriageOrderVo vo = new AcceptCarriageOrderVo();
|
|
|
vo.setAccountsCycle(logisticsOrder.getSettlementCycle() == null ?
|
|
vo.setAccountsCycle(logisticsOrder.getSettlementCycle() == null ?
|
|
@@ -365,8 +389,10 @@ public class KwAcceptCarriageService {
|
|
|
vo.setReceiveGoodsUnitEntId(logisticsOrder.getReceiveGoodsUnitEntId());
|
|
vo.setReceiveGoodsUnitEntId(logisticsOrder.getReceiveGoodsUnitEntId());
|
|
|
vo.setReceiveGoodsUnit(logisticsOrder.getReceiveGoodsUnit());
|
|
vo.setReceiveGoodsUnit(logisticsOrder.getReceiveGoodsUnit());
|
|
|
vo.setGoodsPrice(logisticsOrder.getGoodsPrice());
|
|
vo.setGoodsPrice(logisticsOrder.getGoodsPrice());
|
|
|
- vo.setGoodsPriceUnit(logisticsOrder.getGoodsPriceUnit());
|
|
|
|
|
|
|
+ vo.setGoodsPriceUnit(priceDictData.get(logisticsOrder.getGoodsPriceUnit()));
|
|
|
vo.setSigningLabel(signingWay.get(logisticsOrder.getContractSigningWay()));
|
|
vo.setSigningLabel(signingWay.get(logisticsOrder.getContractSigningWay()));
|
|
|
|
|
+// vo.setSigningLabel(logisticsOrder.getContractSigningWay() == null ? null :
|
|
|
|
|
+// (logisticsOrder.getContractSigningWay().equals("1")?"线上签约":"线下签约"));
|
|
|
vo.setLossUnit(logisticsOrder.getLossUnit());
|
|
vo.setLossUnit(logisticsOrder.getLossUnit());
|
|
|
vo.setStatusLabel(LogisticsOrderEnum.getDestination(logisticsOrder.getStatus()));
|
|
vo.setStatusLabel(LogisticsOrderEnum.getDestination(logisticsOrder.getStatus()));
|
|
|
vo.setAccountsCycleLabel(logisticsOrder.getSettlementCycle() == null ?
|
|
vo.setAccountsCycleLabel(logisticsOrder.getSettlementCycle() == null ?
|
|
@@ -383,7 +409,7 @@ public class KwAcceptCarriageService {
|
|
|
* @param mappedResults
|
|
* @param mappedResults
|
|
|
* @param arrayList
|
|
* @param arrayList
|
|
|
*/
|
|
*/
|
|
|
- private List<TableTops> packageReturnStatistics(List<com.sckw.mongo.model.TableTops> mappedResults, List<TableTops> arrayList) {
|
|
|
|
|
|
|
+ public List<TableTops> packageReturnStatistics(List<com.sckw.mongo.model.TableTops> mappedResults, List<TableTops> arrayList) {
|
|
|
List<String> codeList = LogisticsOrderEnum.getCodeStringList();
|
|
List<String> codeList = LogisticsOrderEnum.getCodeStringList();
|
|
|
List<String> collect = mappedResults.stream().map(e -> e.getValue()).collect(Collectors.toList());
|
|
List<String> collect = mappedResults.stream().map(e -> e.getValue()).collect(Collectors.toList());
|
|
|
List<String> diffrentList = transportService.getDiffrentList(collect, codeList);
|
|
List<String> diffrentList = transportService.getDiffrentList(collect, codeList);
|
|
@@ -466,10 +492,15 @@ public class KwAcceptCarriageService {
|
|
|
// } else {
|
|
// } else {
|
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
// criteria.and("carrierEntId").is(LoginUserHolder.getEntId());
|
|
|
// }
|
|
// }
|
|
|
- if (unitType.equals(NumberConstant.ONE)) {
|
|
|
|
|
- criteria.and("carrierTopEntId").is(LoginUserHolder.getEntId());
|
|
|
|
|
|
|
+ List<Long> entIds = new ArrayList<>();
|
|
|
|
|
+ entIds.add(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());
|
|
|
} else {
|
|
} else {
|
|
|
- criteria.and("checkTopEntId").is(LoginUserHolder.getEntId());
|
|
|
|
|
|
|
+ //承运企业主键ID
|
|
|
|
|
+ criteria.and("carrierTopEntId").is(entMap.get(LoginUserHolder.getEntId()).getId());
|
|
|
}
|
|
}
|
|
|
criteria.and("delFlag").is(String.valueOf(NumberConstant.ZERO));
|
|
criteria.and("delFlag").is(String.valueOf(NumberConstant.ZERO));
|
|
|
List<String> stringList = StringUtils.splitStrToList(query.getIds(), StringConstant.COMMA, String.class);
|
|
List<String> stringList = StringUtils.splitStrToList(query.getIds(), StringConstant.COMMA, String.class);
|
|
@@ -532,7 +563,7 @@ public class KwAcceptCarriageService {
|
|
|
return returnList;
|
|
return returnList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void packageReturnList(List<SckwLogisticsOrder> list, List<AcceptCarriageOrderExcelVo> returnList) {
|
|
|
|
|
|
|
+ public void packageReturnList(List<SckwLogisticsOrder> list, List<AcceptCarriageOrderExcelVo> returnList) {
|
|
|
for (SckwLogisticsOrder logisticsOrder : list) {
|
|
for (SckwLogisticsOrder logisticsOrder : list) {
|
|
|
AcceptCarriageOrderExcelVo vo = new AcceptCarriageOrderExcelVo();
|
|
AcceptCarriageOrderExcelVo vo = new AcceptCarriageOrderExcelVo();
|
|
|
vo.setAccountsCycle(logisticsOrder.getSettlementCycle() == null ?
|
|
vo.setAccountsCycle(logisticsOrder.getSettlementCycle() == null ?
|