Commit 26e466b4 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'master-fix' into release

parents 291fcdf6 c9591451
......@@ -489,6 +489,31 @@ public class OrderItemDO extends BaseDO {
@TableField(exist = false)
private BigDecimal totalOnePrice;
@ApiModelProperty(value = "混箱的入仓纪录数")
@TableField(exist = false)
private Integer mixCount = 0;
@ApiModelProperty(value = "混箱状态, 1-混箱")
@TableField(exist = false)
private Integer mixStatus = 0;
public Integer getMixStatus() {
// 当混箱的入仓纪录数大于0时,就认为是混箱
return mixCount > 0 ? 1 : 0;
}
@ApiModelProperty(value = "包装类型(入仓汇总的,逗号分隔)")
@TableField(exist = false)
private String units;
/**
* 关联订单数量
*/
@ApiModelProperty(value = "关联订单数量")
@TableField(exist = false)
private Integer guanLianOrderCount;
// public void setOriginalSeaFreight(BigDecimal originalSeaFreight) {
// this.originalSeaFreight = originalSeaFreight;
// if (Objects.nonNull(originalSeaFreight) && originalSeaFreight.compareTo(BigDecimal.ZERO) == 0){
......@@ -509,6 +534,22 @@ public class OrderItemDO extends BaseDO {
// return JSONObject.parseObject(this.warehouseInInfo, WarehouseInInfoVO.class);
// }
public WarehouseInInfoVO getWarehouseInInfoVO() {
if(warehouseInInfoVO != null) return warehouseInInfoVO;
if(StringUtils.isNotEmpty(this.warehouseInInfo)) {
warehouseInInfoVO = JSONObject.parseObject(this.warehouseInInfo,
WarehouseInInfoVO.class);
}
return warehouseInInfoVO;
}
public String getUnits() {
if(getWarehouseInInfoVO() != null) {
units = getWarehouseInInfoVO().getUnits();
}
return units;
}
public void setWarehouseInInfo(String warehouseInInfo) {
this.warehouseInInfo = warehouseInInfo;
......
......@@ -225,4 +225,22 @@ public interface OrderItemMapper extends AbstractMapper<OrderItemDO> {
})
List<OrderItemBackVO> orderItemList(@Param("lang") Integer lang, @Param("list") List<Long> list);
@ResultType(OrderItemDO.class)
@Select({
"<script>",
"select ",
"oi.*, ",
"IF(#{lang} = 0, pd.title_zh, pd.title_en) as brand_name, ",
"(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 = oi.order_id or t.relate_order_id = oi.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_order_item oi",
"left join ecw_product_brank pd",
"on pd.id = oi.brand",
"where oi.deleted = 0 and ",
"oi.warehouse_in_info is not null and warehouse_in_info ->> '$.cartonsNum' > 0 ",
"and oi.order_id in ",
"<foreach item='item' index='index' collection='list' open='(' separator=',' close=')'>#{item}</foreach>",
"</script>"
})
List<OrderItemDO> getWarehouseInOrderItemListByOrderIds(List<Long> orderIdList);
}
......@@ -115,4 +115,6 @@ public interface OrderItemService extends IService<OrderItemDO> {
* @return
*/
List<OrderItemDO> getOrderItemListByOrderIdList(List<Long> orderIdList);
List<OrderItemDO> getWarehouseInOrderItemListByOrderIds(List<Long> orderIdList);
}
......@@ -232,4 +232,9 @@ public class OrderItemServiceImpl extends AbstractService<OrderItemMapper, Order
.in(OrderItemDO::getOrderId, orderIdList)
);
}
@Override
public List<OrderItemDO> getWarehouseInOrderItemListByOrderIds(List<Long> orderIdList) {
return orderItemMapper.getWarehouseInOrderItemListByOrderIds(orderIdList);
}
}
......@@ -247,7 +247,8 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"ewl.dest_warehouse_id, ",
// "IFNULL((select a.pkg_id from ecw_box_pkg_order a where a.deleted=0 and a.order_item_id=ebpg.order_item_id limit 1),0) as pkgId, ",
// "(select t1.pkg_num from ecw_box_pkg_order t INNER JOIN ecw_box_merge_pkg t1 on t.pkg_id=t1.id where t.deleted=0 and t1.deleted=0 and t.order_id=ebpg.order_id limit 1) as pkgNum, ",
"(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=3398 or t.relate_order_id = 3398) and t1.deleted=0 and t2.deleted=0 and t.deleted=0 ) as guanLianOrderCount ",
"(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 ",
......
......@@ -584,10 +584,11 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
private void getUnOrderInfoPageResult(PageResult<BoxMergePkgWebVO> pageResult, IPage<BoxMergePkgWebVO> boxMergePkgWebVOIPage, Long shipmentId) {
if (CollectionUtil.isNotEmpty(boxMergePkgWebVOIPage.getRecords())) {
List<Long> orderIdList = boxMergePkgWebVOIPage.getRecords().stream().map(o -> o.getOrderId()).collect(Collectors.toList());
List<OrderItemDO> AllOrderItemDOS = orderItemService.selectList(new LambdaQueryWrapperX<OrderItemDO>()
.in(OrderItemDO::getOrderId, orderIdList)
.isNotNull(OrderItemDO::getWarehouseInInfo)
);
// List<OrderItemDO> AllOrderItemDOS = orderItemService.selectList(new LambdaQueryWrapperX<OrderItemDO>()
// .in(OrderItemDO::getOrderId, orderIdList)
// .isNotNull(OrderItemDO::getWarehouseInInfo)
// );
List<OrderItemDO> AllOrderItemDOS = orderItemService.getWarehouseInOrderItemListByOrderIds(orderIdList);
boxMergePkgWebVOIPage.getRecords().stream().forEach(item -> {
// List<OrderItemDO> orderItemDOS = orderItemService.selectList(new LambdaQueryWrapperX<OrderItemDO>()
// .eq(OrderItemDO::getOrderId, item.getOrderId())
......@@ -595,6 +596,22 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
// );
List<OrderItemDO> orderItemDOS = AllOrderItemDOS.stream().filter(all -> all.getOrderId() == item.getOrderId() || all.getOrderId().equals(item.getOrderId())).collect(Collectors.toList());
// 设置混箱状态
Integer mixStatus = orderItemDOS.stream().anyMatch(t -> t.getMixStatus() == 1) ? 1 : 0;
item.setMixStatus(mixStatus);
// 设置包装类型
String units = orderItemDOS.stream()
.map(OrderItemDO::getUnits)
.filter(StringUtils::isNotEmpty)
.flatMap(t -> Arrays.stream(t.split(",")))
.distinct()
.collect(Collectors.joining(","));
item.setUnits(units);
// 是否有关联单
boolean hasRelationOrder = AllOrderItemDOS.stream().anyMatch(t -> t.getGuanLianOrderCount() > 0);
item.setHasRelationOrder(hasRelationOrder);
List<BoxOrderCheckInfoDO> installBox = boxMergePkgMapper.getInstallBoxByShipmentId(shipmentId, item.getOrderId());
......
......@@ -1874,7 +1874,6 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
.distinct()
.collect(Collectors.joining(","));
orderVO.setUnits(units);
orderVO.setUnits(boxPreloadGoodsDO.getUnits());
// 是否有关联单
boolean hasRelationOrder = goodsList.stream().anyMatch(t -> t.getGuanLianOrderCount() > 0);
......
......@@ -52,4 +52,13 @@ public class BoxMergePkgWebVO {
@ApiModelProperty(value = "单证报关 1 我司全代 2自单代报 3混合报关")
private String customsType;
@ApiModelProperty(value = "混箱状态, 1-混箱")
private Integer mixStatus = 0;
@ApiModelProperty(value = "包装类型(入仓汇总的,逗号分隔)")
private String units;
@ApiModelProperty(value = "是否有关联单")
private Boolean hasRelationOrder = false;
}
......@@ -331,7 +331,7 @@ public class BoxPreloadGoodsBackVO {
* 关联订单数量
*/
@ApiModelProperty(value = "关联订单数量")
private Long guanLianOrderCount;
private Integer guanLianOrderCount;
public void setGuanLianOrderStatus(String guanLianOrderStatus) {
this.guanLianOrderStatus = guanLianOrderStatus;
......
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