Commit 0f8573e7 authored by zhengyi's avatar zhengyi

Merge branch 'test' into release

parents 43732161 48c7f5ff
......@@ -15,7 +15,7 @@ alter table ecw_order_item
alter table ecw_order_item
add COLUMN `check_brand` bigint DEFAULT NULL COMMENT '到仓品牌';
alter table ecw_order_item
add COLUMN `check_brand_type` tinyint NOT NULL DEFAULT '0' COMMENT '到仓:0 无牌 1 有牌 2 中性';
add COLUMN `check_brand_type` tinyint DEFAULT 0 COMMENT '到仓:0 无牌 1 有牌 2 中性';
alter table ecw_order_item
add COLUMN `warehouse_check_info` json DEFAULT NULL COMMENT '到仓信息json';
......
-- 补充菜单脚本
INSERT INTO `system_menu` (`name`, `permission`, `menu_type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `is_show_in_menu_bar`, `name_en`, `keepalive`, `redirect`, `badge_field`) VALUES ('到仓修改', '', 2, 20, 1559, 'warehousingTo-update', '#', 'ecw/order/warehousingTo', 0, '2702', '2024-11-03 18:52:39', '2702', '2024-11-03 18:59:08', b'0', b'0', '到仓修改', b'0', NULL, NULL);
-- 补充到仓产品信息
alter table ecw_order_item
add COLUMN `check_prod_id` bigint DEFAULT NULL COMMENT '到仓商品ID';
alter table ecw_order_item
add COLUMN `check_prod_type` int DEFAULT NULL COMMENT '到仓产品类型';
alter table ecw_order_item
add COLUMN `check_prod_title_zh` varchar(255) DEFAULT NULL COMMENT '到仓产品中文标题';
alter table ecw_order_item
add COLUMN `check_prod_title_en` varchar(255) DEFAULT NULL COMMENT '到仓产品英文标题';
......@@ -417,6 +417,18 @@ public class OrderItemDO extends BaseDO {
@ApiModelProperty(value = "是否处理了渠道特性异常")
private Boolean handlerChannelAttrException;
@ApiModelProperty(value = "到仓商品ID")
private Long checkProdId;
@ApiModelProperty(value = "到仓产品类型")
private Integer checkProdType;
@ApiModelProperty(value = "到仓产品中文标题")
private String checkProdTitleZh;
@ApiModelProperty(value = "到仓产品英文标题")
private String checkProdTitleEn;
@ApiModelProperty(value = "到仓材质")
private String checkMaterial;
......
......@@ -4057,6 +4057,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
if (orderItemCheckWarehouseVOMap.containsKey(orderItemDO.getOrderItemId())) {
OrderItemCheckWarehouseVO warehouseCheckDO = orderItemCheckWarehouseVOMap.get(orderItemDO.getOrderItemId());
WarehouseCheckInfoVO warehouseCheckInfoVO = warehouseCheckDO.getWarehouseCheckInfoVO();
orderItemDO.setCheckProdId(warehouseCheckDO.getProdId());
orderItemDO.setCheckProdType(warehouseCheckDO.getProdType());
orderItemDO.setCheckProdTitleZh(warehouseCheckDO.getProdTitleZh());
orderItemDO.setCheckProdTitleEn(warehouseCheckDO.getProdTitleEn());
orderItemDO.setCheckBrand(warehouseCheckDO.getCheckBrand());
orderItemDO.setCheckBrandType(warehouseCheckDO.getCheckBrandType());
orderItemDO.setCheckMaterial(warehouseCheckDO.getCheckMaterial());
......
......@@ -50,4 +50,9 @@ public interface OrderWarehouseCheckService extends IService<OrderWarehouseCheck
* @param updates 更新详情
*/
void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO);
/**
* 所有符合条件的订单全部强制到仓
*/
void allForce();
}
......@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaDO;
import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaPositionDO;
......@@ -13,12 +14,15 @@ import cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseAreaPosit
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseIn.OrderWarehouseInDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.OrderMapper;
import cn.iocoder.yudao.module.order.dal.mysql.orderWarehouseCheck.OrderWarehouseCheckMapper;
import cn.iocoder.yudao.module.order.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.order.service.order.OrderBusinessService;
import cn.iocoder.yudao.module.order.service.order.OrderItemService;
import cn.iocoder.yudao.module.order.service.order.OrderLocationService;
import cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService;
import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.order.WarehouseCheckInfoVO;
import cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO;
import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemCheckWarehouseVO;
......@@ -29,7 +33,9 @@ import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckU
import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
......@@ -54,6 +60,9 @@ public class OrderWarehouseCheckServiceImpl
@Autowired
private OrderBusinessService orderBusinessService;
@Autowired
private OrderMapper orderMapper;
@Autowired
private OrderWarehouseInService orderWarehouseInService;
@Autowired
......@@ -119,6 +128,7 @@ public class OrderWarehouseCheckServiceImpl
for (OrderWarehouseInDO inDo : orderWarehouseInService.selectList(OrderWarehouseInDO::getOrderId, orderId)) {
OrderWarehouseCheckDO checkDo = new OrderWarehouseCheckDO();
BeanUtils.copyProperties(inDo, checkDo);
checkDo.setId(null);
checkDo.setWarehouseInId(inDo.getId());
checkDo.setSource(3);
checkDo.setCheckTime(now);
......@@ -166,6 +176,22 @@ public class OrderWarehouseCheckServiceImpl
check(orderId);
}
@Override
public void allForce() {
OrderQueryVO queryVO = new OrderQueryVO();
queryVO.setInWarehouseState(218);
long allCount = orderMapper.orderCount(queryVO);
int size = 1000;
int start = 0;
while (start <= allCount) {
List<OrderBackPageVO> list = orderMapper.orderList(start, size, queryVO);
if(CollectionUtil.isNotEmpty(list)) {
list.stream().map(OrderBackPageVO::getOrderId).forEach(this::check);
}
start += size;
}
}
@Override
public void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO) {
Map<Long, OrderWarehouseCheckDO> mappings = listByOrderItemId(checkUpdateReqVO.getOrderItemId()).stream()
......@@ -194,6 +220,18 @@ public class OrderWarehouseCheckServiceImpl
Map<Long, OrderItemCheckWarehouseVO> orderItemCheckWarehouseVOMap = new HashMap<>();
OrderItemCheckWarehouseVO orderItemCheckWarehouseVO = new OrderItemCheckWarehouseVO();
BeanUtils.copyProperties(orderItemDO, orderItemCheckWarehouseVO);
if (Objects.nonNull(checkUpdateReqVO.getProdId())) {
orderItemCheckWarehouseVO.setProdId(checkUpdateReqVO.getProdId());
}
if (Objects.nonNull(checkUpdateReqVO.getProdType())) {
orderItemCheckWarehouseVO.setProdType(checkUpdateReqVO.getProdType());
}
if (StringUtils.isNotBlank(checkUpdateReqVO.getProdTitleZh())) {
orderItemCheckWarehouseVO.setProdTitleZh(checkUpdateReqVO.getProdTitleZh());
}
if (StringUtils.isNotBlank(checkUpdateReqVO.getProdTitleZh())) {
orderItemCheckWarehouseVO.setProdTitleEn(checkUpdateReqVO.getProdTitleEn());
}
orderItemCheckWarehouseVO.setCheckBrand(orderItemDO.getBrand());
orderItemCheckWarehouseVO.setCheckBrandType(orderItemDO.getFeeType());
orderItemCheckWarehouseVO.setCheckMaterial(orderItemDO.getMaterial());
......
......@@ -440,6 +440,18 @@ public class OrderItemBackVO {
@ApiModelProperty(value = "入仓记录备注,多个用逗号分隔")
private String warehouseRecordRemark ;
@ApiModelProperty(value = "到仓商品ID")
private Long checkProdId;
@ApiModelProperty(value = "到仓产品类型")
private Integer checkProdType;
@ApiModelProperty(value = "到仓产品中文标题")
private String checkProdTitleZh;
@ApiModelProperty(value = "到仓产品英文标题")
private String checkProdTitleEn;
@ApiModelProperty(value = "到仓材质")
private String checkMaterial;
......
......@@ -293,6 +293,18 @@ public class OrderItemBaseVO {
@ApiModelProperty(value = "是否处理了渠道特性异常")
private Boolean handlerChannelAttrException;
@ApiModelProperty(value = "到仓商品ID")
private Long checkProdId;
@ApiModelProperty(value = "到仓产品类型")
private Integer checkProdType;
@ApiModelProperty(value = "到仓产品中文标题")
private String checkProdTitleZh;
@ApiModelProperty(value = "到仓产品英文标题")
private String checkProdTitleEn;
@ApiModelProperty(value = "到仓材质")
private String checkMaterial;
......@@ -304,6 +316,7 @@ public class OrderItemBaseVO {
@ApiModelProperty(value = "到仓:0 无牌 1 有牌 2 中性")
private Integer checkBrandType;
/**
* 到仓信息json
*/
......
package cn.iocoder.yudao.module.order.controller.admin.orderWarehouseCheck;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO;
import cn.iocoder.yudao.module.order.service.order.OrderQueryService;
import cn.iocoder.yudao.module.order.service.orderWarehouseCheck.OrderWarehouseCheckService;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Collections;
......@@ -31,6 +28,8 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
public class OrderWarehouseCheckController {
@Autowired
private OrderWarehouseCheckService service;
@Autowired
private OrderQueryService orderQueryService;
@GetMapping("/query")
@ApiOperation("到仓查询")
......@@ -39,18 +38,18 @@ public class OrderWarehouseCheckController {
return success(service.listByOrderItemId(orderItemId));
}
@PostMapping("/force")
@PostMapping("/force/{orderId}")
@ApiOperation("强制到仓")
@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<Boolean> force(@RequestParam("orderId") Long orderId) {
public CommonResult<Boolean> force(@PathVariable("orderId") Long orderId) {
service.force(orderId);
return success(true);
}
@PostMapping("/revoke")
@PostMapping("/revoke/{orderId}")
@ApiOperation("撤销到仓")
@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<Boolean> revoke(@RequestParam("orderId") Long orderId) {
public CommonResult<Boolean> revoke(@PathVariable("orderId") Long orderId) {
service.revoke(orderId);
return success(true);
}
......@@ -61,4 +60,12 @@ public class OrderWarehouseCheckController {
service.update(req);
return success(true);
}
@PutMapping("/all/force")
@ApiOperation("全部强制到仓(紧刷新数据处理)")
public CommonResult<Boolean> allForce() {
service.allForce();
return success(true);
}
}
......@@ -65,6 +65,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"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,",
......@@ -83,6 +84,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"eo.audit_type, ",
"eo.audit_result, ",
"eo.guan_lian_order_status, ",
"eo.container_number, ",
"eo.exception_reason, ",
"eo.package_type as advance_type, ",
"eoi.prod_title_zh, ",
......@@ -113,7 +115,8 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"IF(#{query.lang} = 0, pd.title_zh, pd.title_en) as brand_name, ",
"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 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 ",
"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 ",
......@@ -182,6 +185,126 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
List<BoxPreloadGoodsBackVO> orderPreloaded(@Param("query") PreloadedReq query);
// 从orderPreloaded copy过来的,主要是想要属性都保持一致。
@ResultType(BoxPreloadGoodsBackVO.class)
@Select({
"<script>",
"select ",
"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.audit_type, ",
"eo.audit_result, ",
"eo.guan_lian_order_status, ",
"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, ",
// "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 ",
// "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 ",
"FROM ecw_order eo ",
// "INNER JOIN ecw_order_item eoi ON ebpg.order_item_id = eoi.order_item_id ",
"INNER JOIN ecw_order_item eoi ON eoi.order_id = eo.order_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.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.orderIdList != null and query.orderIdList.size() > 0'>",
"AND eo.`order_id` in ",
"<foreach item='id' index='index' collection='query.orderIdList' open='(' separator=',' close=')'>#{id}</foreach>",
"</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",
"order by eo.order_id desc",
"</script>"
})
List<BoxPreloadGoodsBackVO> getGuanLianGoodItemList(@Param("query") PreloadedReq query);
@Select("SELECT GROUP_CONCAT(DISTINCT customs_type) customs_type from ecw_order eo where EXISTS (SELECT order_id from ecw_box_preload_goods ebpg where shipment_id=#{shipmentId} and deleted=0 and is_remove=0 and eo.order_id=ebpg.order_id)")
Map<String, String> getShipmentCustomTypes(@Param("shipmentId") Long shipmentId);
......
......@@ -32,6 +32,7 @@ import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxLoadOrderVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxPreloadGoodsBackVO;
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.boxTally.BoxGuanlianOrderBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxOrderLocationUpdateReq;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO;
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
......@@ -253,6 +254,13 @@ public interface BoxService extends IService<BoxDO> {
*/
List<BoxTallyBackVO> tallyList(Long shipmentId);
/**
* 理货列表页面,点击关联单(传订单号),获取跟理货列表展示订单信息一样的列
* @param orderId
* @return
*/
List<BoxGuanlianOrderBackVO> getGuanLianOrderList(Long orderId);
/**
* 批量修改储位
......
......@@ -56,6 +56,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControl.OrderCargoControlDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderGuanlian.OrderGuanlianDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplit.OrderSplitDO;
......@@ -182,6 +183,7 @@ import cn.iocoder.yudao.module.shipment.vo.boxSettlement.BoxSettlementBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxShipConfig.BoxShipConfigBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxShipping.BoxShippingBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTakeoff.BoxTakeoffBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxGuanlianOrderBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxOrderLocationUpdateReq;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyVO;
......@@ -224,9 +226,7 @@ import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_IS_APPROVAL_IN_PROCESS;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_LINE_CHANNEL_NOT_NULL;
import static cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum.WAREHOUSE_ADJUST;
import static cn.iocoder.yudao.module.shipment.enums.BoxAirStatusEnum.TO_WAREHOUSED;
import static cn.iocoder.yudao.module.shipment.enums.BoxStatusEnum.UNLOADED;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*;
......@@ -280,6 +280,9 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
@Lazy
private BoxPreloadGoodsService boxPreloadGoodsService;
@Resource
private OrderGuanlianService orderGuanlianService;
@Resource
private BoxAirShipmentService boxAirShipmentService;
......@@ -2187,6 +2190,15 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
boxTallyBackVO.setMultiSpecification(getMultiSpecification(orderGoodsItemList));
boxTallyBackVO.setTidanNum(boxPreloadGoodsDO.getTidanNum());
boxTallyBackVO.setNum(orderDO.getSumNum());
// 设置混箱状态
Integer mixStatus = orderGoodsItemList.stream().anyMatch(t -> t.getMixStatus() == 1) ? 1 : 0;
boxTallyBackVO.setMixStatus(mixStatus);
// 设置报关方式
boxTallyBackVO.setCustomsType(boxPreloadGoodsDO.getCustomsType());
// 是否有关联单
boolean hasRelationOrder = orderGoodsItemList.stream().anyMatch(t -> t.getGuanLianOrderCount() > 0);
boxTallyBackVO.setHasRelationOrder(hasRelationOrder);
Long installNum = boxOrderCheckInfoService.selectCount(new LambdaQueryWrapperX<BoxOrderCheckInfoDO>()
.eq(BoxOrderCheckInfoDO::getShipmentId, shipmentId)
......@@ -2218,6 +2230,86 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
return boxTallyBackVOS;
}
@Override
public List<BoxGuanlianOrderBackVO> getGuanLianOrderList(Long orderId) {
List<BoxGuanlianOrderBackVO> boxGuanlianBackVOS = new ArrayList<>();
// 通过orderId查询关联订单
List<OrderGuanlianDO> guanlianList = orderGuanlianService.getGuanlianListByOrderId(orderId);
if (CollectionUtils.isEmpty(guanlianList)) {
return boxGuanlianBackVOS;
}
List<Long> orderIdList1 = guanlianList.stream().map(OrderGuanlianDO::getOrderId).collect(Collectors.toList());
List<Long> orderIdList2 = guanlianList.stream().map(OrderGuanlianDO::getRelateOrderId).collect(Collectors.toList());
// 合并
orderIdList1.addAll(orderIdList2);
// 去除orderId
orderIdList1.remove(orderId);
// 去重
orderIdList1 = orderIdList1.stream().distinct().collect(Collectors.toList());
// 根据orderIdLists查询关联订单
List<BoxPreloadGoodsBackVO> goodsItemList = boxPreloadGoodsService.getGuanLianGoodItemList(orderIdList1);
//以订单ID分组
Map<Long, List<BoxPreloadGoodsBackVO>> orderMap = goodsItemList.stream()
.collect(Collectors.groupingBy(BoxPreloadGoodsBackVO::getOrderId));
// 查询所有库区库域信息
List<WarehouseAreaDO> areaList = warehouseAreaService.list(new LambdaQueryWrapper<>());
List<WarehouseAreaPositionDO> positionList = warehouseAreaPositionService.list(new LambdaQueryWrapper<>());
for (Map.Entry<Long, List<BoxPreloadGoodsBackVO>> entry : orderMap.entrySet()) {
Long orderIdTmp = entry.getKey();
OrderDO orderDO = orderService.selectOne(OrderDO::getOrderId, orderIdTmp);
List<BoxPreloadGoodsBackVO> orderGoodsItemList = entry.getValue();
BoxGuanlianOrderBackVO boxGuanlianOrderBackVO = new BoxGuanlianOrderBackVO();
BoxPreloadGoodsBackVO boxPreloadGoodsDO = orderGoodsItemList.get(0);
boxGuanlianOrderBackVO.setAdvanceType(boxPreloadGoodsDO.getAdvanceType());
boxGuanlianOrderBackVO.setOrderId(boxPreloadGoodsDO.getOrderId());
boxGuanlianOrderBackVO.setId(boxPreloadGoodsDO.getOrderId());
boxGuanlianOrderBackVO.setOrderNo(boxPreloadGoodsDO.getOrderNo());
boxGuanlianOrderBackVO.setOrderItemList(orderGoodsItemList);
boxGuanlianOrderBackVO.setMultiSpecification(getMultiSpecification(orderGoodsItemList));
boxGuanlianOrderBackVO.setTidanNum(boxPreloadGoodsDO.getTidanNum());
boxGuanlianOrderBackVO.setNum(orderDO.getSumNum());
// 设置混箱状态
Integer mixStatus = orderGoodsItemList.stream().anyMatch(t -> t.getMixStatus() == 1) ? 1 : 0;
boxGuanlianOrderBackVO.setMixStatus(mixStatus);
// 设置报关方式
boxGuanlianOrderBackVO.setCustomsType(boxPreloadGoodsDO.getCustomsType());
// 是否有关联单
boolean hasRelationOrder = orderGoodsItemList.stream().anyMatch(t -> t.getGuanLianOrderCount() > 0);
boxGuanlianOrderBackVO.setHasRelationOrder(hasRelationOrder);
// Long installNum = boxOrderCheckInfoService.selectCount(new LambdaQueryWrapperX<BoxOrderCheckInfoDO>()
// .eq(BoxOrderCheckInfoDO::getShipmentId, shipmentId)
// .eq(BoxOrderCheckInfoDO::getOrderId, orderIdTmp)
// .eq(BoxOrderCheckInfoDO::getType, 0)
// );
// boxGuanlianOrderBackVO.setInstallNum(installNum == null ? 0 : installNum.intValue());
//设置储位
List<OrderLocationDO> orderLocationList = orderLocationService.getOrderLocationListByOrderId(orderIdTmp);
for (BoxPreloadGoodsBackVO itemVO : orderGoodsItemList) {
matchItemLocation(areaList, positionList, orderLocationList, itemVO);
}
String positionNo = matchLocation(areaList, positionList, orderLocationList);
boxGuanlianOrderBackVO.setPositionNo(positionNo);
boxGuanlianBackVOS.add(boxGuanlianOrderBackVO);
}
boxGuanlianBackVOS.sort(Comparator.comparing(BoxGuanlianOrderBackVO::getOrderId));
return boxGuanlianBackVOS;
}
@Transactional(rollbackFor = Exception.class)
@Override
public void updateTallyStatus(Long shipmentId, Collection<Long> orderIdList) {
......
......@@ -175,6 +175,13 @@ public interface BoxPreloadGoodsService extends IService<BoxPreloadGoodsDO> {
*/
List<BoxPreloadGoodsBackVO> getShipGoodItemList(Long shipmentId);
/**
* 根据订单号获取同装柜商品项一样的信息
* @param orderIdList
* @return
*/
List<BoxPreloadGoodsBackVO> getGuanLianGoodItemList(List<Long> orderIdList);
/**
* 把订单从预装单中移出
* @param shipmentId 出货单ID
......
......@@ -3060,6 +3060,14 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
return boxPreloadGoodsMapper.orderPreloaded(query);
}
@Override
public List<BoxPreloadGoodsBackVO> getGuanLianGoodItemList(List<Long> orderIdList) {
PreloadedReq query = new PreloadedReq();
query.setOrderIdList(orderIdList);
query.setLang(I18nMessage.getLang());
return boxPreloadGoodsMapper.getGuanLianGoodItemList(query);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void remove(Long shipmentId, Collection<Long> orderIdList, Integer deleteType, boolean hasExit) {
......
......@@ -151,9 +151,12 @@ public class BoxPreloadGoodsBackVO {
@ApiModelProperty(value = "件数")
private Integer num;
@ApiModelProperty(value = "单位")
@ApiModelProperty(value = "包装类型(配置的)")
private String unit;
@ApiModelProperty(value = "包装类型(入仓汇总的,逗号分隔)")
private String units;
@ApiModelProperty(value = "体积")
private BigDecimal volume;
......@@ -228,7 +231,16 @@ public class BoxPreloadGoodsBackVO {
return rucangTime;
}
public String getBoxGauge() {
// get units
public String getUnits() {
if(getWarehouseInInfoVO() != null) {
units = getWarehouseInInfoVO().getUnits();
}
return units;
}
public String getBoxGauge() {
if(getWarehouseInInfoVO() != null) {
boxGauge = getWarehouseInInfoVO().getBoxGauge();
}
......@@ -306,6 +318,12 @@ public class BoxPreloadGoodsBackVO {
private Integer lang;
/**
* 关联订单数量
*/
@ApiModelProperty(value = "关联订单数量")
private Long guanLianOrderCount;
public void setGuanLianOrderStatus(String guanLianOrderStatus) {
this.guanLianOrderStatus = guanLianOrderStatus;
if (StringUtils.isNotBlank(guanLianOrderStatus)) {
......@@ -438,4 +456,10 @@ public class BoxPreloadGoodsBackVO {
}
return mixStatus;
}
/**
* 货柜自编号
*/
@ApiModelProperty(value = "货柜自编号")
private String containerNumber;
}
......@@ -72,6 +72,7 @@ public class PreloadedReq {
private Integer smartInstall;
private Long orderId;
private List<Long> orderIdList;
private Integer isDel;
}
package cn.iocoder.yudao.module.shipment.vo.boxTally;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxPreloadGoodsBackVO;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 理货页面关联订单信息 Response VO
* @author wlh
*/
@Data
@ApiModel("管理后台 - 理货页面关联订单信息 Response VO")
public class BoxGuanlianOrderBackVO {
@ExcelProperty("")
@ApiModelProperty(value = "", required = true)
private Long id;
@ExcelProperty("订单ID")
@ApiModelProperty(value = "订单ID")
private Long orderId;
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "是否多规格")
private Boolean multiSpecification;
@ApiModelProperty(value = "储位")
private String positionNo;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
private Integer tidanNum;
@ApiModelProperty(value = "垫付类型(多个):10内陆运输费,20打木架/托,30纸箱打包")
private String advanceType;
@ApiModelProperty(value = "订单商品项")
private List<BoxPreloadGoodsBackVO> orderItemList;
@ApiModelProperty(value = "计划件数")
private Integer num;
@ApiModelProperty(value = "实际件数")
private Integer installNum;
/**
* 报关类别:我司全代:1,自单代报:2,混合报关:3
*/
private Integer customsType;
@ApiModelProperty(value = "混箱状态, 1-混箱")
private Integer mixStatus = 0;
@ApiModelProperty(value = "是否有关联单")
private Boolean hasRelationOrder = false;
}
......@@ -68,5 +68,17 @@ public class BoxTallyBackVO {
@ApiModelProperty(value = "实际件数")
private Integer installNum;
/**
* 报关类别:我司全代:1,自单代报:2,混合报关:3
*/
private Integer customsType;
@ApiModelProperty(value = "混箱状态, 1-混箱")
private Integer mixStatus = 0;
@ApiModelProperty(value = "是否有关联单")
private Boolean hasRelationOrder = false;
}
### tallyList
POST {{baseUrl}}/shipment/box/tallyList?shipmentId=2525
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
### tallyListGuanlianOrder
POST {{baseUrl}}/shipment/box/tallyListGuanlianOrder?orderId=3400
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
......@@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO;
import cn.iocoder.yudao.module.order.vo.orderSplit.OrderSplitBackVO;
import cn.iocoder.yudao.module.shipment.convert.BoxConvert;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxGuanlianOrderBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxOrderLocationUpdateReq;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO;
import cn.iocoder.yudao.module.system.api.file.FileMakeApi;
......@@ -208,6 +209,13 @@ public class BoxController {
return success(boxService.tallyList(shipmentId));
}
@PostMapping("/tallyListGuanlianOrder")
@ApiImplicitParams({@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class)})
@ApiOperation("理货-订单号-查看关联单, use this")
public CommonResult<List<BoxGuanlianOrderBackVO>> tallyListGuanLianOrderList(@RequestParam("orderId") Long orderId) {
return success(boxService.getGuanLianOrderList(orderId));
}
@PostMapping("/batchOrderLocationUpdate")
@ApiOperation("批量修改储位, use this")
public CommonResult<Boolean> batchOrderLocationUpdate(@RequestBody BoxOrderLocationUpdateReq req) {
......
......@@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.shipment.vo.boxOrderExit.BoxOrderExitCreateReqVO;
import cn.iocoder.yudao.module.shipment.vo.boxOrderExit.BoxOrderExitUpdateReqVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxLoadOrderVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadSection.BoxLoadSectionBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxGuanlianOrderBackVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
......@@ -103,6 +104,13 @@ public class MyBoxController {
return success(boxService.pdaTallyList(shipmentId));
}
@PostMapping("/tallyListGuanlianOrder")
@ApiImplicitParams({@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class)})
@ApiOperation("理货-订单号-查看关联单, use this")
public CommonResult<List<BoxGuanlianOrderBackVO>> tallyListGuanLianOrderList(@RequestParam("orderId") Long orderId) {
return success(boxService.getGuanLianOrderList(orderId));
}
@GetMapping("/cabinetExitDetail")
@ApiImplicitParam(name = "shipmentId", value = "ID", required = true, example = "1", dataTypeClass = Long.class)
@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