Commit 1da88042 authored by honghy's avatar honghy Committed by wux

bug 206 PDA装柜扫描性能不达标

parent ef46f842
...@@ -189,6 +189,139 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO> ...@@ -189,6 +189,139 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
List<BoxPreloadGoodsBackVO> orderPreloaded(@Param("query") PreloadedReq query); List<BoxPreloadGoodsBackVO> orderPreloaded(@Param("query") PreloadedReq query);
/**
* PDA扫码专用查询
*/
@ResultType(BoxPreloadGoodsBackVO.class)
@Select({
"<script>",
"select ebpg.shipment_id, ",
"ebpg.id, ",
"ebpg.sec_id, ",
"ebpg.order_id, ",
"ebpg.order_item_id, ",
"ebpg.tidan_num, ",
"eo.order_id, ",
"eo.order_no, ",
"eo.transport_id, ",
"(select min(owi.`in_time`) from ecw_order_warehouse_in owi where owi.deleted = 0 and owi.order_id = eo.order_id ) as rucang_time,",
"eo.product_record, ",
"eo.customs_type, ",
"eo.adjust_to_dest_warehouse_id, ",
"eo.warehouse_type, ",
"eo.line_id, ",
"eo.is_external_warehouse, ",
"eo.cost ->> '$.totalWorth' as total_worth, ",
"eo.air_shipment, ",
"eo.status, ",
"eo.abnormal_state, ",
"eo.in_warehouse_state, ",
"eo.shipment_state, ",
"eo.pick_state, ",
"eo.audit_type, ",
"eo.audit_result, ",
"eo.guan_lian_order_status, ",
"eo.unload_time, ",
"eo.container_number, ",
"eo.exception_reason, ",
"eo.package_type as advance_type, ",
"eoi.prod_title_zh, ",
"eoi.prod_title_en, ",
"eoi.box_gauge, ",
"eoi.num, ",
"eoi.quantity, ",
"eoi.worth, ",
"eoi.brand_type, ",
"eoi.brand, ",
"eoi.sea_freight_currency, ",
"eoi.clearance_freight_currency, ",
"eoi.prod_attr_ids, ",
"eoi.warehouse_in_prod_attr_ids, ",
"eoi.fee_type, ",
"if(#{query.lang} = 0, ew_start.title_zh, ew_start.title_en) as start_warehouse_name, ",
"if(#{query.lang} = 0, ew_dest.title_zh, ew_dest.title_en) as dest_warehouse_name, ",
"eoi.unit, ",
"eoi.volume, ",
"eoi.warehouse_in_info, ",
"eoi.weight,",
"eoi.charge_weight, ",
"eoi.charge_volume, ",
"eoi.charge_quantity, ",
"eoi.material,",
"eoi.sea_freight_volume, ",
"eoi.clearance_freight_volume, ",
"IF(#{query.lang} = 0, pd.title_zh, pd.title_en) as brand_name, ",
"ewl.dest_warehouse_id, ",
"ewl.start_warehouse_id,",
"(select count(0) from ecw_order_guanlian t LEFT JOIN ecw_order t1 on t.order_id=t1.order_id LEFT JOIN ecw_order t2 on t.relate_order_id=t2.order_id where (t.order_id = eo.order_id or t.relate_order_id = eo.order_id) and t1.deleted=0 and t2.deleted=0 and t.deleted=0 ) as guanLianOrderCount, ",
"(select count(0) from ecw_order_warehouse_in owi where owi.order_item_id = eoi.order_item_id and owi.deleted = 0 and JSON_LENGTH(owi.order_warehouse_in_details) > 0) as mixCount",
"FROM ecw_box_preload_goods ebpg ",
"INNER JOIN ecw_box_preload_section ebps ON ebpg.sec_id = ebps.id ",
"INNER JOIN ecw_order eo ON eo.order_id = ebpg.order_id ",
"INNER JOIN ecw_order_item eoi ON ebpg.order_item_id = eoi.order_item_id ",
"INNER JOIN ecw_warehouse_line ewl ON eo.line_id = ewl.id ",
"INNER JOIN ecw_warehouse ew_start ON ewl.start_warehouse_id = ew_start.id ",
"INNER JOIN ecw_warehouse ew_dest ON ewl.dest_warehouse_id = ew_dest.id ",
"LEFT JOIN ecw_product_brank pd on eoi.brand = pd.id ",
"WHERE eo.deleted=0 ",
"and eoi.deleted=0 ",
"<when test = 'query.isDel == null'>",
"and ebpg.deleted=0 ",
"</when>",
"<when test = 'query.shipmentId != null'>",
"AND ebpg.shipment_id = #{query.shipmentId}",
"</when>",
"<when test = 'query.isCover != null'>",
"AND ebpg.`is_cover` = #{query.isCover}",
"</when>",
"<when test = 'query.isRemove != null'>",
"AND ebpg.`is_remove` = #{query.isRemove}",
"</when>",
"<when test = 'query.rucangTimeStart != null'>",
"AND eo.`rucang_time` &gt;= #{query.rucangTimeStart}",
"</when>",
"<when test = 'query.rucangTimeEnd != null'>",
"AND eo.`rucang_time` &lt;= #{query.rucangTimeEnd}",
"</when>",
"<when test = 'query.productRecord != null'>",
"AND eo.`product_record` = #{query.productRecord}",
"</when>",
"<when test = 'query.orderId != null'>",
"AND eo.`order_id` = #{query.orderId}",
"</when>",
"<when test = 'query.orderNo != null and query.orderNo != \"\" '>",
"AND eo.`order_no` like concat('%',concat(#{query.orderNo},'%'))",
"</when>",
"<when test = 'query.customsType != null '>",
"AND eo.`customs_type` = #{query.customsType}",
"</when>",
"<when test = 'query.weightRatioMin != null '>",
"AND eo.`weight_ratio` &gt;= #{query.weightRatioMin}",
"</when>",
"<when test = 'query.weightRatioMax != null '>",
"AND eo.`weight_ratio` &lt;= #{query.weightRatioMax} ",
"</when>",
"<when test = 'query.startWarehouseId != null'>",
"AND ewl.`start_warehouse_id` = #{query.startWarehouseId}",
"</when>",
"<when test = 'query.destWarehouseIdList != null and query.destWarehouseIdList.size() > 0'>",
"AND ewl.`dest_warehouse_id` in ",
"<foreach item='id' index='index' collection='query.destWarehouseIdList' open='(' separator=',' close=')'>#{id}</foreach>",
"</when>",
"<when test = 'query.itemName != null and query.itemName != \"\" '>",
"AND (eoi.`prod_title_zh` like concat('%',concat(#{query.itemName},'%')) or eoi.`prod_title_en` like concat('%',concat(#{query.itemName},'%')) )",
"</when>",
"<when test = 'query.shipmentIdList != null and query.shipmentIdList.size() > 0'>",
"AND ebpg.`shipment_id` in ",
"<foreach item='id' index='index' collection='query.shipmentIdList' open='(' separator=',' close=')'>#{id}</foreach>",
"</when>",
"order by ebpg.create_time",
"</script>"
})
List<BoxPreloadGoodsBackVO> orderPreloadedV2(@Param("query") PreloadedReq query);
// 从orderPreloaded copy过来的,主要是想要属性都保持一致。 // 从orderPreloaded copy过来的,主要是想要属性都保持一致。
@ResultType(BoxPreloadGoodsBackVO.class) @ResultType(BoxPreloadGoodsBackVO.class)
......
...@@ -284,6 +284,14 @@ public interface BoxService extends IService<BoxDO> { ...@@ -284,6 +284,14 @@ public interface BoxService extends IService<BoxDO> {
*/ */
BoxCabinetLoadVO getBoxCabinetDetail(Long shipmentId); BoxCabinetLoadVO getBoxCabinetDetail(Long shipmentId);
/**
* 获取装柜详情(PDA扫描专用)
*
* @param shipmentId ID
* @return
*/
BoxCabinetLoadVO getBoxCabinetDetailV2(Long shipmentId);
/** /**
* 获取卸柜详情 * 获取卸柜详情
* *
......
...@@ -2830,6 +2830,84 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2830,6 +2830,84 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
return boxCabinetLoadVO; return boxCabinetLoadVO;
} }
/**
* 获取装柜详情(PDA扫描专用)
* @param shipmentId ID
* @return
*/
@Override
public BoxCabinetLoadVO getBoxCabinetDetailV2(Long shipmentId) {
List<BoxLoadSectionBackVO> boxLoadDetailBackVO = boxPreloadGoodsService.loadSecGoodsListV2(shipmentId);
/*查询所有库区库域信息 20250116 影响性能屏蔽
List<WarehouseAreaDO> areaList = warehouseAreaService.list(new LambdaQueryWrapper<>());
List<WarehouseAreaPositionDO> positionList = warehouseAreaPositionService.list(new LambdaQueryWrapper<>());
for (BoxLoadSectionBackVO sectionBackVO : boxLoadDetailBackVO) {
List<BoxLoadOrderVO> orderList = sectionBackVO.getSectionOrderList();
if (CollectionUtil.isEmpty(orderList)) continue;
for (BoxLoadOrderVO orderVO : orderList) {
Long orderId = orderVO.getOrderId();
List<OrderLocationDO> orderLocationLists = orderLocationService.getOrderLocationListByOrderId(orderId);
//按照订单纬度返回信息,分组
Map<String, List<OrderLocationDO>> positionMap = orderLocationLists.stream()
.collect(Collectors.groupingBy(
t -> t.getOrderId() + "_" +
// t.getOrderItemId() + "_" +
t.getWareId() + "_" + t.getAreaId() + "_" + t.getLocationId()));
List<OrderLocationDO> locationList = new ArrayList<>();
for (Map.Entry<String, List<OrderLocationDO>> entry : positionMap.entrySet()) {
List<OrderLocationDO> orderLocationDOList = entry.getValue();
locationList.add(orderLocationDOList.get(0));
}
String positionNo = matchLocation(areaList, positionList, locationList);
orderVO.setPositionNo(positionNo);
orderVO.setOrderLocationList(OrderLocationConvert.INSTANCE.convertList(locationList));
List<BoxPreloadGoodsBackVO> orderGoodsItemList = orderVO.getGoodsList();
for (BoxPreloadGoodsBackVO itemVO : orderGoodsItemList) {
matchItemLocation(areaList, positionList, locationList, itemVO);
}
}
}
*/
BoxCabinetLoadVO boxCabinetLoadVO = new BoxCabinetLoadVO();
boxCabinetLoadVO.setLoadDetail(boxLoadDetailBackVO);
BoxBaseBackVO boxBaseBackVO = getBaseBoxInfo(shipmentId);
boxCabinetLoadVO.setBoxInfo(boxBaseBackVO);
BoxCabinetDO boxCabinetDO = getBoxCabinetDO(shipmentId);
if (boxCabinetDO != null) {
BoxCabinetBackVO boxCabinetBackVO = BoxCabinetConvert.INSTANCE.convert(boxCabinetDO);
boxCabinetBackVO.setOperator(getUserName(boxCabinetDO.getCreator()));
boxCabinetLoadVO.setCabinetInfo(boxCabinetBackVO);
}
BoxApprovalDO cabinetSplitApproval = boxApprovalService.getOne(new LambdaQueryWrapperX<BoxApprovalDO>()
.eq(BoxApprovalDO::getShipmentId, shipmentId)
.eq(BoxApprovalDO::getApprovalType, BoxApprovalTypeEnum.SPLIT_ORDER.getType())
.orderByDesc(BoxApprovalDO::getId)
.last("limit 1")
);
if (cabinetSplitApproval != null) {
boxCabinetLoadVO.setCabinetSplitInfo(BoxApprovalConvert.INSTANCE.convert(cabinetSplitApproval));
}
if (TransportTypeEnum.AIR.getType().equals(boxBaseBackVO.getTransportType())) {
for (BoxLoadSectionBackVO backVO : boxLoadDetailBackVO) {
List<BoxLoadOrderVO> loadOrderList = backVO.getSectionOrderList();
if (CollectionUtil.isNotEmpty(loadOrderList)) {
loadOrderList.sort(Comparator.comparing(BoxLoadOrderVO::getPkgNum, Comparator.nullsLast(String::compareTo)));
}
}
}
return boxCabinetLoadVO;
}
@Override @Override
public BoxCabinetLoadVO getBoxCabinetUnloadDetail(Long shipmentId) { public BoxCabinetLoadVO getBoxCabinetUnloadDetail(Long shipmentId) {
List<BoxLoadSectionBackVO> boxLoadDetailBackVO = boxPreloadGoodsService.boxGoodsDetail(shipmentId); List<BoxLoadSectionBackVO> boxLoadDetailBackVO = boxPreloadGoodsService.boxGoodsDetail(shipmentId);
......
package cn.iocoder.yudao.module.shipment.service.boxPreloadGoods; package cn.iocoder.yudao.module.shipment.service.boxPreloadGoods;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.vo.order.OrderPreloadReq; import cn.iocoder.yudao.module.order.vo.order.OrderPreloadReq;
import cn.iocoder.yudao.module.order.vo.orderLocation.OrderLocationCreateReqVO;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPreloadGoodsDO; import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxPreloadGoodsDO;
import cn.iocoder.yudao.module.shipment.vo.box.BoxGoodsStatistics; import cn.iocoder.yudao.module.shipment.vo.box.BoxGoodsStatistics;
import cn.iocoder.yudao.module.shipment.vo.box.PreloadResultVO; import cn.iocoder.yudao.module.shipment.vo.box.PreloadResultVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.*; import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.*;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxLoadDetailBackVO; import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxLoadDetailBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxLoadSectionBackVO; import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxLoadSectionBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxPreloadSectionBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxPreloadSectionDetailVO; import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxPreloadSectionDetailVO;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* 预装货物 Service 接口 * 预装货物 Service 接口
* *
...@@ -101,6 +103,13 @@ public interface BoxPreloadGoodsService extends IService<BoxPreloadGoodsDO> { ...@@ -101,6 +103,13 @@ public interface BoxPreloadGoodsService extends IService<BoxPreloadGoodsDO> {
*/ */
List<BoxLoadSectionBackVO> loadSecGoodsList(Long shipmentId); List<BoxLoadSectionBackVO> loadSecGoodsList(Long shipmentId);
/**
* 获得装柜部分列表(PDA扫描专用)
* @param shipmentId 出货单ID
* @return
*/
List<BoxLoadSectionBackVO> loadSecGoodsListV2(Long shipmentId);
/** /**
* 修改isRemove * 修改isRemove
* @param shipmentId * @param shipmentId
......
...@@ -1579,6 +1579,201 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -1579,6 +1579,201 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
return dataList; return dataList;
} }
/**
* 获得装柜部分列表(PDA扫描专用)
*/
@Override
public List<BoxLoadSectionBackVO> loadSecGoodsListV2(Long shipmentId) {
List<BoxPreloadSectionDO> sectionList = getSectionListByShipmentId(shipmentId);
List<BoxLoadSectionBackVO> dataList = new ArrayList<>();
BoxCustomsDO boxCustomsDO = boxCustomsService.selectOne(new LambdaQueryWrapperX<BoxCustomsDO>()
.eq(BoxCustomsDO::getShipmentId, shipmentId)
.orderByDesc(BaseDO::getCreateTime)
.last(" limit 1"));
//查询装柜的,要剔除已经移除的
PreloadedReq query = new PreloadedReq();
query.setLang(I18nMessage.getLang());
query.setIsDel(null);
query.setShipmentId(shipmentId);
//设置为不能移除的
query.setIsRemove(0);
query.setIsCover(null);
List<BoxPreloadGoodsBackVO> goodsItemList = boxPreloadGoodsMapper.orderPreloadedV2(query);
//获取这个预装单的所有已装标签
BoxLoadInfoQueryVO boxLoadInfoQueryVO = new BoxLoadInfoQueryVO();
boxLoadInfoQueryVO.setShipmentId(shipmentId);
List<BoxLoadInfoDO> loadInfoList = boxLoadInfoService.getBoxLoadInfoList(boxLoadInfoQueryVO);
// 获取订单明细
List<OrderItemDO> orderItemDOList = convertOrderItemList(goodsItemList);
// 所有部分统计信息
BoxGoodsStatistics boxGoodsStatistics = calculationStatistics(orderItemDOList);
long unloadSize = loadInfoList.stream()
.filter(t -> t.getIsUnload() == 1)
.count();
boxGoodsStatistics.setUnloadNum(unloadSize);
boxGoodsStatistics.setLoadNum(loadInfoList.size());
//统计合包箱数量
calculateBoxMergeSum(shipmentId, boxGoodsStatistics);
Map<Long, List<BoxPreloadGoodsBackVO>> sectionGoodsMap = goodsItemList.stream()
.collect(Collectors.groupingBy(BoxPreloadGoodsBackVO::getSecId));
//找出异常中的订单->未处理的
// List<OrderExceptionDO> exceptionList = orderExceptionService.list(new LambdaQueryWrapperX<OrderExceptionDO>()
// .ne(OrderExceptionDO::getOrderExceptionStatus, 2)
// );
// Map<Long, List<OrderExceptionDO>> orderExceptionMap = exceptionList.stream()
// .collect(Collectors.groupingBy(OrderExceptionDO::getOrderId));
//按照订单分组
Map<Long, List<BoxLoadInfoDO>> orderLoadsMap = loadInfoList.stream()
.collect(Collectors.groupingBy(BoxLoadInfoDO::getOrderId));
for (BoxPreloadSectionDO sectionDO : sectionList) {
Long secId = sectionDO.getId();
BoxLoadDetailBackVO boxLoadDetailBackVO = new BoxLoadDetailBackVO();
if (boxCustomsDO != null) {
boxLoadDetailBackVO.setBoxCustomsBackVO(BoxCustomsConvert.INSTANCE.convert(boxCustomsDO));
}
if (secId != null && secId != 0L) {
List<BoxPreloadGoodsBackVO> sectionGoodsList = sectionGoodsMap.get(secId);
if (sectionGoodsList != null) {
List<OrderItemDO> secOrderItemDOList = new ArrayList<>();
for (BoxPreloadGoodsBackVO item : sectionGoodsList) {
OrderItemDO orderItemDO = new OrderItemDO();
BeanUtils.copyProperties(item, orderItemDO);
secOrderItemDOList.add(orderItemDO);
}
BoxGoodsStatistics secBoxGoodsStatistics = calculationStatistics(secOrderItemDOList);
long secUnloadNum = loadInfoList.stream()
.filter(t -> t.getIsUnload() == 1)
.count();
Set<Long> secOrderIdSet = secOrderItemDOList.stream()
.map(OrderItemDO::getOrderId)
.collect(Collectors.toSet());
List<BoxLoadInfoDO> secLoadInfoList = loadInfoList.stream()
.filter(t -> secOrderIdSet.contains(t.getOrderId()))
.collect(Collectors.toList());
secBoxGoodsStatistics.setUnloadNum(secUnloadNum);
secBoxGoodsStatistics.setLoadNum(secLoadInfoList.size());
//统计合包箱数量
calculateBoxMergeSum(shipmentId, secBoxGoodsStatistics);
boxLoadDetailBackVO.setSecStatistics(secBoxGoodsStatistics);
}
} else {
boxLoadDetailBackVO.setTotalStatistics(boxGoodsStatistics);
boxLoadDetailBackVO.setSecStatistics(boxGoodsStatistics);
}
List<BoxLoadOrderVO> loadOrderList = new ArrayList<>();
boxLoadDetailBackVO.setSectionOrderList(loadOrderList);
//计算明细
List<BoxPreloadGoodsBackVO> sectionGoodsList = sectionGoodsMap.get(secId);
if (CollectionUtil.isEmpty(sectionGoodsList)) continue;
//按照订单分组
Map<Long, List<BoxPreloadGoodsBackVO>> orderItemsMap = sectionGoodsList.stream()
.collect(Collectors.groupingBy(BoxPreloadGoodsBackVO::getOrderId));
for (Map.Entry<Long, List<BoxPreloadGoodsBackVO>> entry : orderItemsMap.entrySet()) {
Long orderId = entry.getKey();
List<BoxPreloadGoodsBackVO> goodsList = entry.getValue();
BoxPreloadGoodsBackVO boxPreloadGoodsDO = goodsList.get(0);
BoxLoadOrderVO orderVO = new BoxLoadOrderVO();
BeanUtils.copyProperties(boxPreloadGoodsDO, orderVO);
orderVO.setShipmentId(shipmentId);
loadOrderList.add(orderVO);
orderVO.setMultiSpecification(boxService.getMultiSpecification(goodsList));
// orderVO.setExceptionList(OrderExceptionConvert.INSTANCE.convertList(orderExceptionMap.get(orderId)));
setSectionText(secId, sectionList, orderVO);
orderVO.setGoodsList(goodsList);
orderVO.setOrderId(orderId);
orderVO.setAdjustToDestWarehouseId(boxPreloadGoodsDO.getAdjustToDestWarehouseId());
orderVO.setWarehouseType(boxPreloadGoodsDO.getWarehouseType());
orderVO.setOrderNo(boxPreloadGoodsDO.getOrderNo());
orderVO.setUnit(boxPreloadGoodsDO.getUnit());
orderVO.setCustomsType(boxPreloadGoodsDO.getCustomsType());
orderVO.setDestWarehouseName(boxPreloadGoodsDO.getDestWarehouseName());
orderVO.setTotalWorth(boxPreloadGoodsDO.getTotalWorth());
orderVO.setIsExternalWarehouse(boxPreloadGoodsDO.getIsExternalWarehouse());
orderVO.setTidanNum(boxPreloadGoodsDO.getTidanNum());
orderVO.setPreloadId(boxPreloadGoodsDO.getId());
// 设置混箱状态
Integer mixStatus = goodsList.stream().anyMatch(t -> t.getMixStatus() == 1) ? 1 : 0;
orderVO.setMixStatus(mixStatus);
// 设置包装类型
String units = goodsList.stream()
.map(boxPreloadGoodsBackVO -> boxPreloadGoodsBackVO.getUnits())
.filter(StringUtils::isNotEmpty)
.flatMap(t -> Arrays.stream(t.split(",")))
.distinct()
.collect(Collectors.joining(","));
orderVO.setUnits(units);
// 是否有关联单
boolean hasRelationOrder = goodsList.stream().anyMatch(t -> t.getGuanLianOrderCount() > 0);
orderVO.setHasRelationOrder(hasRelationOrder);
List<OrderItemDO> orderStaticsList = new ArrayList<>();
for (BoxPreloadGoodsBackVO item : goodsList) {
OrderItemDO orderItemDO = new OrderItemDO();
BeanUtils.copyProperties(item, orderItemDO);
orderStaticsList.add(orderItemDO);
}
BoxGoodsStatistics orderGoodsStatistics = calculationStatistics(orderStaticsList);
//计划总箱数
long numSum = orderGoodsStatistics.getNum();
orderVO.setNum(numSum);
//计划总体积
BigDecimal volumeSum = orderGoodsStatistics.getVolume();
orderVO.setVolume(volumeSum);
//计划总重量
BigDecimal weightSum = orderGoodsStatistics.getWeight();
orderVO.setWeight(weightSum);
orderVO.setChargeVolume(orderGoodsStatistics.getChargeVolume());
orderVO.setChargeWeight(orderGoodsStatistics.getChargeWeight());
//已装数量
List<BoxLoadInfoDO> installList = orderLoadsMap.get(orderId);
orderVO.setInstallNum(CollectionUtil.isNotEmpty(installList) ? installList.size() : 0);
orderVO.setUnloadNum(0);
if (installList != null) {
List<BoxLoadInfoDO> unloadList = installList.stream()
.filter(t -> t.getIsUnload() == 1)
.collect(Collectors.toList());
orderVO.setUnloadNum(unloadList.size());
}
}
loadOrderList.sort((o1, o2) -> {
if (o1.getTidanNum().compareTo(o2.getTidanNum()) == 0) {
return o1.getPreloadId().compareTo(o2.getPreloadId());
}
return o1.getTidanNum().compareTo(o2.getTidanNum());
});
dataList.add(createBoxSecDetail(boxLoadDetailBackVO, shipmentId, sectionDO));
}
return dataList;
}
@Override @Override
public Set<Long> getShipOrderIdList(Long shipmentId) { public Set<Long> getShipOrderIdList(Long shipmentId) {
//1.获取出货单下的所有订单ID //1.获取出货单下的所有订单ID
......
...@@ -90,6 +90,13 @@ public class MyBoxController { ...@@ -90,6 +90,13 @@ public class MyBoxController {
return success(boxService.getBoxCabinetDetail(shipmentId)); return success(boxService.getBoxCabinetDetail(shipmentId));
} }
@GetMapping("/cabinetDetailV2")
@ApiImplicitParam(name = "shipmentId", value = "ID", required = true, example = "1", dataTypeClass = Long.class)
@ApiOperation("获得装柜详情(PDA扫描)")
public CommonResult<BoxCabinetLoadVO> getBoxCabinetDetailV2(@RequestParam("shipmentId") Long shipmentId) {
return success(boxService.getBoxCabinetDetailV2(shipmentId));
}
@GetMapping("/cabinetUnloadDetail") @GetMapping("/cabinetUnloadDetail")
@ApiImplicitParam(name = "shipmentId", value = "ID", required = true, example = "1", dataTypeClass = Long.class) @ApiImplicitParam(name = "shipmentId", value = "ID", required = true, example = "1", dataTypeClass = Long.class)
@ApiOperation("获得卸柜详情") @ApiOperation("获得卸柜详情")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment