Commit 27fd3143 authored by Administrator's avatar Administrator

Merge branch 'release' into 'jd_dev'

Release最新代码合并入捷道研发分支20241106

See merge request !32
parents b4073356 1d7bf23c
...@@ -15,7 +15,7 @@ alter table ecw_order_item ...@@ -15,7 +15,7 @@ alter table ecw_order_item
alter table ecw_order_item alter table ecw_order_item
add COLUMN `check_brand` bigint DEFAULT NULL COMMENT '到仓品牌'; add COLUMN `check_brand` bigint DEFAULT NULL COMMENT '到仓品牌';
alter table ecw_order_item 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 alter table ecw_order_item
add COLUMN `warehouse_check_info` json DEFAULT NULL COMMENT '到仓信息json'; 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 '到仓产品英文标题';
...@@ -20,7 +20,7 @@ public interface CustomerCompetitorService extends IService<CustomerCompetitorDO ...@@ -20,7 +20,7 @@ public interface CustomerCompetitorService extends IService<CustomerCompetitorDO
* @param createReqVO 创建信息 * @param createReqVO 创建信息
* @return 编号 * @return 编号
*/ */
Long createCompetitor(@Valid CustomerCompetitorCreateReqVO createReqVO); CustomerCompetitorDO createCompetitor(@Valid CustomerCompetitorCreateReqVO createReqVO);
/** /**
* 更新客户竞争对手 * 更新客户竞争对手
......
...@@ -27,7 +27,7 @@ public class CustomerCompetitorServiceImpl extends AbstractService<CustomerCompe ...@@ -27,7 +27,7 @@ public class CustomerCompetitorServiceImpl extends AbstractService<CustomerCompe
private CustomerCompetitorMapper competitorMapper; private CustomerCompetitorMapper competitorMapper;
@Override @Override
public Long createCompetitor(CustomerCompetitorCreateReqVO createReqVO) { public CustomerCompetitorDO createCompetitor(CustomerCompetitorCreateReqVO createReqVO) {
// 校验存在 // 校验存在
Long count = competitorMapper.selectCount("name", createReqVO.getName()); Long count = competitorMapper.selectCount("name", createReqVO.getName());
...@@ -39,7 +39,7 @@ public class CustomerCompetitorServiceImpl extends AbstractService<CustomerCompe ...@@ -39,7 +39,7 @@ public class CustomerCompetitorServiceImpl extends AbstractService<CustomerCompe
CustomerCompetitorDO competitor = CustomerCompetitorConvert.INSTANCE.convert(createReqVO); CustomerCompetitorDO competitor = CustomerCompetitorConvert.INSTANCE.convert(createReqVO);
competitorMapper.insert(competitor); competitorMapper.insert(competitor);
// 返回 // 返回
return competitor.getId(); return competitor;
} }
@Override @Override
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
AND a.customer_id = #{query.customerId} AND a.customer_id = #{query.customerId}
</if> </if>
<if test="query.offerIds != null and query.offerIds.size() > 0"> <if test="query.offerIds != null and query.offerIds.size() > 0">
AND FIND_IN_SET(a.offer_id, #{query.offerIds}) AND a.offer_id in
<foreach item='item' index="index" collection='query.offerIds' open='(' separator=',' close=')'>#{item}</foreach>
</if> </if>
<if test="query.followType != null"> <if test="query.followType != null">
...@@ -39,23 +40,28 @@ ...@@ -39,23 +40,28 @@
</if> </if>
<if test="query.followTypes != null and query.followTypes.size() > 0"> <if test="query.followTypes != null and query.followTypes.size() > 0">
AND FIND_IN_SET(a.follow_type, #{query.followTypes}) AND a.follow_type in
<foreach item='item' index="index" collection='query.followTypes' open='(' separator=',' close=')'>#{item}</foreach>
</if> </if>
<if test="query.followMethods != null and query.followMethods.size()>0"> <if test="query.followMethods != null and query.followMethods.size()>0">
AND FIND_IN_SET(a.follow_method, #{query.followMethods}) AND a.follow_method in
<foreach item='item' index="index" collection='query.followMethods' open='(' separator=',' close=')'>#{item}</foreach>
</if> </if>
<if test="query.resultTypes != null and query.resultTypes.size()>0"> <if test="query.resultTypes != null and query.resultTypes.size()>0">
AND FIND_IN_SET(a.result_type, #{query.resultTypes}) AND a.result_type in
<foreach item='item' index="index" collection='query.resultTypes' open='(' separator=',' close=')'>#{item}</foreach>
</if> </if>
<if test="query.statuses != null and query.statuses.size()>0"> <if test="query.statuses != null and query.statuses.size()>0">
AND FIND_IN_SET(a.status, #{query.statuses}) AND a.status in
<foreach item='item' index="index" collection='query.statuses' open='(' separator=',' close=')'>#{item}</foreach>
</if> </if>
<if test="query.followUserIds!= null and query.followUserIds.size() > 0"> <if test="query.followUserIds!= null and query.followUserIds.size() > 0">
AND FIND_IN_SET(a.follow_user_id, #{query.followUserIds}) AND a.follow_user_id in
<foreach item='item' index="index" collection='query.followUserIds' open='(' separator=',' close=')'>#{item}</foreach>
</if> </if>
<if test="query.beginFollowTime != null and query.endFollowTime != null"> <if test="query.beginFollowTime != null and query.endFollowTime != null">
......
...@@ -34,7 +34,7 @@ public class CustomerCompetitorController { ...@@ -34,7 +34,7 @@ public class CustomerCompetitorController {
@PostMapping("/create") @PostMapping("/create")
@ApiOperation("创建客户竞争对手") @ApiOperation("创建客户竞争对手")
// @PreAuthorize("@ss.hasPermission('customer:competitor:create')") // @PreAuthorize("@ss.hasPermission('customer:competitor:create')")
public CommonResult<Long> createCompetitor(@Valid @RequestBody CustomerCompetitorCreateReqVO createReqVO) { public CommonResult<CustomerCompetitorDO> createCompetitor(@Valid @RequestBody CustomerCompetitorCreateReqVO createReqVO) {
return success(competitorService.createCompetitor(createReqVO)); return success(competitorService.createCompetitor(createReqVO));
} }
......
...@@ -7,7 +7,7 @@ tenant-id: {{adminTenentId}} ...@@ -7,7 +7,7 @@ tenant-id: {{adminTenentId}}
Content-Type: application/json Content-Type: application/json
### 客户跟进 ### 客户跟进
GET {{baseUrl}}/customer/followup/page?pageNo=1&pageSize=10&total=0&customerId=51966 GET {{baseUrl}}/customer/followup/page?pageNo=1&pageSize=10&followMethods[0]=1&followMethods[1]=2&beginCreateTime=&endCreateTime=1714485925000
Authorization: Bearer {{token}} Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}} tenant-id: {{adminTenentId}}
Content-Type: application/json Content-Type: application/json
\ No newline at end of file
...@@ -417,6 +417,18 @@ public class OrderItemDO extends BaseDO { ...@@ -417,6 +417,18 @@ public class OrderItemDO extends BaseDO {
@ApiModelProperty(value = "是否处理了渠道特性异常") @ApiModelProperty(value = "是否处理了渠道特性异常")
private Boolean handlerChannelAttrException; 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 = "到仓材质") @ApiModelProperty(value = "到仓材质")
private String checkMaterial; private String checkMaterial;
......
...@@ -430,4 +430,5 @@ public interface ErrorCodeConstants { ...@@ -430,4 +430,5 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_NOT_IS_OVERSEAS_WAREHOUSE_ORDER = new ErrorCode(1004001170, "order.not.is.overseas.warehouse.order"); ErrorCode ORDER_NOT_IS_OVERSEAS_WAREHOUSE_ORDER = new ErrorCode(1004001170, "order.not.is.overseas.warehouse.order");
ErrorCode ORDER_APPROVAL_IS_NOT_EXISTS = new ErrorCode(1004001171, "order.approval.is.not.exists"); ErrorCode ORDER_APPROVAL_IS_NOT_EXISTS = new ErrorCode(1004001171, "order.approval.is.not.exists");
ErrorCode FEE_APPLICATION_NOT_IS_ZERO = new ErrorCode(1004001172, "fee.application.not.is.zero"); ErrorCode FEE_APPLICATION_NOT_IS_ZERO = new ErrorCode(1004001172, "fee.application.not.is.zero");
ErrorCode GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS = new ErrorCode(1004001173, "guan.lian.order.is.approval.in.process");
} }
...@@ -4057,6 +4057,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -4057,6 +4057,10 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
if (orderItemCheckWarehouseVOMap.containsKey(orderItemDO.getOrderItemId())) { if (orderItemCheckWarehouseVOMap.containsKey(orderItemDO.getOrderItemId())) {
OrderItemCheckWarehouseVO warehouseCheckDO = orderItemCheckWarehouseVOMap.get(orderItemDO.getOrderItemId()); OrderItemCheckWarehouseVO warehouseCheckDO = orderItemCheckWarehouseVOMap.get(orderItemDO.getOrderItemId());
WarehouseCheckInfoVO warehouseCheckInfoVO = warehouseCheckDO.getWarehouseCheckInfoVO(); 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.setCheckBrand(warehouseCheckDO.getCheckBrand());
orderItemDO.setCheckBrandType(warehouseCheckDO.getCheckBrandType()); orderItemDO.setCheckBrandType(warehouseCheckDO.getCheckBrandType());
orderItemDO.setCheckMaterial(warehouseCheckDO.getCheckMaterial()); orderItemDO.setCheckMaterial(warehouseCheckDO.getCheckMaterial());
......
...@@ -50,4 +50,9 @@ public interface OrderWarehouseCheckService extends IService<OrderWarehouseCheck ...@@ -50,4 +50,9 @@ public interface OrderWarehouseCheckService extends IService<OrderWarehouseCheck
* @param updates 更新详情 * @param updates 更新详情
*/ */
void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO); void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO);
/**
* 所有符合条件的订单全部强制到仓
*/
void allForce();
} }
...@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; ...@@ -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.ServiceException;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; 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.service.AbstractService;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; 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.WarehouseAreaDO;
import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaPositionDO; import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseAreaPositionDO;
...@@ -13,12 +14,15 @@ import cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseAreaPosit ...@@ -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.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderWarehouseCheck.OrderWarehouseCheckDO; 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.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.dal.mysql.orderWarehouseCheck.OrderWarehouseCheckMapper;
import cn.iocoder.yudao.module.order.enums.ErrorCodeConstants; 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.OrderBusinessService;
import cn.iocoder.yudao.module.order.service.order.OrderItemService; 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.order.OrderLocationService;
import cn.iocoder.yudao.module.order.service.orderWarehouseIn.OrderWarehouseInService; 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.WarehouseCheckInfoVO;
import cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO; import cn.iocoder.yudao.module.order.vo.order.WarehouseInInfoVO;
import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemCheckWarehouseVO; import cn.iocoder.yudao.module.order.vo.orderItem.OrderItemCheckWarehouseVO;
...@@ -29,7 +33,9 @@ import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckU ...@@ -29,7 +33,9 @@ import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckU
import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO; import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
...@@ -54,6 +60,9 @@ public class OrderWarehouseCheckServiceImpl ...@@ -54,6 +60,9 @@ public class OrderWarehouseCheckServiceImpl
@Autowired @Autowired
private OrderBusinessService orderBusinessService; private OrderBusinessService orderBusinessService;
@Autowired
private OrderMapper orderMapper;
@Autowired @Autowired
private OrderWarehouseInService orderWarehouseInService; private OrderWarehouseInService orderWarehouseInService;
@Autowired @Autowired
...@@ -119,6 +128,7 @@ public class OrderWarehouseCheckServiceImpl ...@@ -119,6 +128,7 @@ public class OrderWarehouseCheckServiceImpl
for (OrderWarehouseInDO inDo : orderWarehouseInService.selectList(OrderWarehouseInDO::getOrderId, orderId)) { for (OrderWarehouseInDO inDo : orderWarehouseInService.selectList(OrderWarehouseInDO::getOrderId, orderId)) {
OrderWarehouseCheckDO checkDo = new OrderWarehouseCheckDO(); OrderWarehouseCheckDO checkDo = new OrderWarehouseCheckDO();
BeanUtils.copyProperties(inDo, checkDo); BeanUtils.copyProperties(inDo, checkDo);
checkDo.setId(null);
checkDo.setWarehouseInId(inDo.getId()); checkDo.setWarehouseInId(inDo.getId());
checkDo.setSource(3); checkDo.setSource(3);
checkDo.setCheckTime(now); checkDo.setCheckTime(now);
...@@ -166,10 +176,26 @@ public class OrderWarehouseCheckServiceImpl ...@@ -166,10 +176,26 @@ public class OrderWarehouseCheckServiceImpl
check(orderId); 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 @Override
public void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO) { public void update(OrderWarehouseCheckUpdateReqVO checkUpdateReqVO) {
Map<Long, OrderWarehouseCheckDO> mappings = listByOrderItemId(checkUpdateReqVO.getOrderItemId()).stream() Map<Long, OrderWarehouseCheckDO> mappings = listByOrderItemId(checkUpdateReqVO.getOrderItemId()).stream()
.collect(Collectors.toMap(OrderWarehouseCheckDO::getOrderItemId, Function.identity())); .collect(Collectors.toMap(OrderWarehouseCheckDO::getId, Function.identity()));
ServiceException exception = ServiceExceptionUtil.exception(ErrorCodeConstants.ORDER_WAREHOUSE_CHECK_NOT_EXISTS); ServiceException exception = ServiceExceptionUtil.exception(ErrorCodeConstants.ORDER_WAREHOUSE_CHECK_NOT_EXISTS);
List<OrderWarehouseCheckDO> newWarehouseCheckDOList = new ArrayList<>(); List<OrderWarehouseCheckDO> newWarehouseCheckDOList = new ArrayList<>();
Date now = DateUtil.date(); Date now = DateUtil.date();
...@@ -194,6 +220,18 @@ public class OrderWarehouseCheckServiceImpl ...@@ -194,6 +220,18 @@ public class OrderWarehouseCheckServiceImpl
Map<Long, OrderItemCheckWarehouseVO> orderItemCheckWarehouseVOMap = new HashMap<>(); Map<Long, OrderItemCheckWarehouseVO> orderItemCheckWarehouseVOMap = new HashMap<>();
OrderItemCheckWarehouseVO orderItemCheckWarehouseVO = new OrderItemCheckWarehouseVO(); OrderItemCheckWarehouseVO orderItemCheckWarehouseVO = new OrderItemCheckWarehouseVO();
BeanUtils.copyProperties(orderItemDO, 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.setCheckBrand(orderItemDO.getBrand());
orderItemCheckWarehouseVO.setCheckBrandType(orderItemDO.getFeeType()); orderItemCheckWarehouseVO.setCheckBrandType(orderItemDO.getFeeType());
orderItemCheckWarehouseVO.setCheckMaterial(orderItemDO.getMaterial()); orderItemCheckWarehouseVO.setCheckMaterial(orderItemDO.getMaterial());
......
...@@ -440,6 +440,18 @@ public class OrderItemBackVO { ...@@ -440,6 +440,18 @@ public class OrderItemBackVO {
@ApiModelProperty(value = "入仓记录备注,多个用逗号分隔") @ApiModelProperty(value = "入仓记录备注,多个用逗号分隔")
private String warehouseRecordRemark ; 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 = "到仓材质") @ApiModelProperty(value = "到仓材质")
private String checkMaterial; private String checkMaterial;
......
...@@ -293,6 +293,18 @@ public class OrderItemBaseVO { ...@@ -293,6 +293,18 @@ public class OrderItemBaseVO {
@ApiModelProperty(value = "是否处理了渠道特性异常") @ApiModelProperty(value = "是否处理了渠道特性异常")
private Boolean handlerChannelAttrException; 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 = "到仓材质") @ApiModelProperty(value = "到仓材质")
private String checkMaterial; private String checkMaterial;
...@@ -304,6 +316,7 @@ public class OrderItemBaseVO { ...@@ -304,6 +316,7 @@ public class OrderItemBaseVO {
@ApiModelProperty(value = "到仓:0 无牌 1 有牌 2 中性") @ApiModelProperty(value = "到仓:0 无牌 1 有牌 2 中性")
private Integer checkBrandType; private Integer checkBrandType;
/** /**
* 到仓信息json * 到仓信息json
*/ */
......
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
...@@ -68,5 +69,6 @@ public class OrderWarehouseCheckUpdateReqVO { ...@@ -68,5 +69,6 @@ public class OrderWarehouseCheckUpdateReqVO {
private String material; private String material;
@ApiModelProperty(value = "到仓修改详情", required = true) @ApiModelProperty(value = "到仓修改详情", required = true)
@NotEmpty(message = "品名到仓修改记录详情不能未空")
private List<OrderWarehouseCheckUpdateItemVO> updates; private List<OrderWarehouseCheckUpdateItemVO> updates;
} }
package cn.iocoder.yudao.module.order.controller.admin.orderWarehouseCheck; package cn.iocoder.yudao.module.order.controller.admin.orderWarehouseCheck;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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.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.service.orderWarehouseCheck.OrderWarehouseCheckService;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO; import cn.iocoder.yudao.module.order.vo.orderWarehouseCheck.OrderWarehouseCheckUpdateReqVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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 javax.validation.Valid; import javax.validation.Valid;
import java.util.Collections; import java.util.Collections;
...@@ -31,6 +28,8 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; ...@@ -31,6 +28,8 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
public class OrderWarehouseCheckController { public class OrderWarehouseCheckController {
@Autowired @Autowired
private OrderWarehouseCheckService service; private OrderWarehouseCheckService service;
@Autowired
private OrderQueryService orderQueryService;
@GetMapping("/query") @GetMapping("/query")
@ApiOperation("到仓查询") @ApiOperation("到仓查询")
...@@ -39,18 +38,18 @@ public class OrderWarehouseCheckController { ...@@ -39,18 +38,18 @@ public class OrderWarehouseCheckController {
return success(service.listByOrderItemId(orderItemId)); return success(service.listByOrderItemId(orderItemId));
} }
@PostMapping("/force") @PostMapping("/force/{orderId}")
@ApiOperation("强制到仓") @ApiOperation("强制到仓")
@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class) @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); service.force(orderId);
return success(true); return success(true);
} }
@PostMapping("/revoke") @PostMapping("/revoke/{orderId}")
@ApiOperation("撤销到仓") @ApiOperation("撤销到仓")
@ApiImplicitParam(name = "orderId", value = "订单id", required = true, example = "1024", dataTypeClass = Long.class) @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); service.revoke(orderId);
return success(true); return success(true);
} }
...@@ -61,4 +60,12 @@ public class OrderWarehouseCheckController { ...@@ -61,4 +60,12 @@ public class OrderWarehouseCheckController {
service.update(req); service.update(req);
return success(true); return success(true);
} }
@PutMapping("/all/force")
@ApiOperation("全部强制到仓(紧刷新数据处理)")
public CommonResult<Boolean> allForce() {
service.allForce();
return success(true);
}
} }
...@@ -121,19 +121,19 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -121,19 +121,19 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND t.`type_id` = #{query.typeId}", "AND t.`type_id` = #{query.typeId}",
"</when>",*/ "</when>",*/
"<when test=\"query.typeId != null and query.typeId.size()>0\">" + "<when test='query.typeId != null and query.typeId.size()>0'>",
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()==1 \">" + " <when test=' query.typeId.size()==1 '>",
" AND t.`type_id` =\n" + " AND t.`type_id` = ",
" <foreach item='typeId' index='index' collection='query.typeId' >\n" + " <foreach item='typeId' index='index' collection='query.typeId' >",
" #{typeId}" + " #{typeId}",
" </foreach>" + " </foreach>" ,
" </when>" + " </when>",
" <when test=\"query.typeId != null and query.typeId != '' and query.typeId.size()>1 \">" + " <when test=' query.typeId.size()>1 '>",
" AND t.`type_id` in " + " AND t.`type_id` in ",
" <foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>" + " <foreach item='typeId' index='index' collection='query.typeId' open='(' separator=',' close=')'>" ,
" #{typeId}" + " #{typeId}" ,
" </foreach>" + " </foreach>" ,
" </when>" + " </when>" ,
"</when>", "</when>",
"<when test = 'query.status != null'>", "<when test = 'query.status != null'>",
...@@ -143,7 +143,19 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -143,7 +143,19 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"<when test = 'query.auditStatus != null'>", "<when test = 'query.auditStatus != null'>",
"AND t.`audit_status` = #{query.auditStatus}", "AND t.`audit_status` = #{query.auditStatus}",
"</when>", "</when>",
"<when test='query.auditStatusList != null and query.auditStatusList.size()>0 '>" ,
"<when test='query.auditStatusList.size()==1 '>",
"<foreach item='auditStatus' index='index' collection='query.auditStatusList' >",
"AND t.`audit_status` = #{auditStatus}",
"</foreach>",
"</when>",
"<when test='query.auditStatusList.size()>1 '>",
" AND t.`audit_status` in ",
" <foreach item='auditStatus' index='index' collection='query.auditStatusList' open='(' separator=',' close=')'>",
"#{auditStatus}",
"</foreach>" ,
"</when>" ,
"</when>",
"<when test = 'query.packaging != null'>", "<when test = 'query.packaging != null'>",
"AND t.`packaging` = #{query.packaging}", "AND t.`packaging` = #{query.packaging}",
"</when>", "</when>",
...@@ -152,36 +164,34 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -152,36 +164,34 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND (t.`title_zh` like concat('%',concat(#{query.titleZh},'%')) or t.`title_en` like concat('%',concat(#{query.titleZh},'%')))", "AND (t.`title_zh` like concat('%',concat(#{query.titleZh},'%')) or t.`title_en` like concat('%',concat(#{query.titleZh},'%')))",
"</when>", "</when>",
// "<when test = 'query.attrId != null and query.attrId != \"\" '>", "<when test='query.attrId != null and query.attrId.size()>0'>" ,
"<when test=\"query.attrId != null and query.attrId.size()>0\">" ,
"<when test=\"query.attrId != null and query.attrId != '' and query.attrId.size()==1 \">" + "<when test=' query.attrId.size()==1 '>" ,
"<foreach item='attrId' index=\"index\" collection='query.attrId' >" + "<foreach item='attrId' index='index' collection='query.attrId' >" ,
"AND t.`attr_id` = #{attrId}" + "AND t.`attr_id` = #{attrId}" ,
"</foreach>" + "</foreach>",
"</when>", "</when>",
"<when test=\"query.attrId != null and query.attrId != '' and query.attrId.size()>1 \">" + "<when test='and query.attrId.size()>1 '>" ,
"AND (1!=1 " + "AND (1!=1 " ,
" <foreach item='attrId' index='index' collection='query.attrId'>" + " <foreach item='attrId' index='index' collection='query.attrId'>" ,
" OR FIND_IN_SET(t.`attr_id`, #{attrId})"+ " OR FIND_IN_SET(t.`attr_id`, #{attrId})",
"</foreach>" + "</foreach>" ,
" )" + " )" ,
"</when>", "</when>",
// "AND FIND_IN_SET(t.`attr_id`, #{query.attrId})",
"</when>", "</when>",
"<when test=\"query.materialTypes != null and query.materialTypes.size()>0\">" , "<when test='query.materialTypes != null and query.materialTypes.size()>0'>" ,
"<when test=\"query.materialTypes != null and query.materialTypes.size()==1 \">" + "<when test= 'query.materialTypes != null and query.materialTypes.size()==1 '>" ,
"<foreach item='materialType' index=\"index\" collection='query.materialTypes' >" + "<foreach item='materialType' index=\"index\" collection='query.materialTypes' >" ,
"AND t.`material_type` = #{materialType}" + "AND t.`material_type` = #{materialType}" ,
"</foreach>" + "</foreach>" ,
"</when>", "</when>",
"<when test=\"query.materialTypes != null and query.materialTypes.size()>1 \">" + "<when test= 'query.materialTypes != null and query.materialTypes.size()>1 '>",
" AND t.`material_type` in " + " AND t.`material_type` in " ,
" <foreach item='materialType' index='index' collection='query.materialTypes' open='(' separator=',' close=')'>" + "<foreach item='materialType' index='index' collection='query.materialTypes' open='(' separator=',' close=')'>",
" #{materialType}" + " #{materialType}" ,
" </foreach>" + " </foreach>" ,
"</when>" + "</when>" ,
"</when>", "</when>",
" <when test='query.beginCreateTime != null' >", " <when test='query.beginCreateTime != null' >",
...@@ -191,23 +201,23 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -191,23 +201,23 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
"AND <![CDATA[ t.create_time <= #{query.endCreateTime} ]]> ", "AND <![CDATA[ t.create_time <= #{query.endCreateTime} ]]> ",
"</when>", "</when>",
"<when test=\"query.creator != null and query.creator != '' \">" + "<when test='query.creator != null and query.creator != \"\" '>" +
"AND c.`nickname` like concat('%',concat(#{query.creator},'%'))", "AND c.`nickname` like concat('%',concat(#{query.creator},'%'))",
"</when>", "</when>",
"<when test=\"query.titleZhKey != null and query.titleZhKey != '' \">" + "<when test='query.titleZhKey != null and query.titleZhKey != \"\" '>" +
"AND t.`title_zh` like concat('%',concat(#{query.titleZhKey},'%'))", "AND t.`title_zh` like concat('%',concat(#{query.titleZhKey},'%'))",
"</when>", "</when>",
"<when test=\"query.notTitleZhKey != null and query.notTitleZhKey != '' \">" + "<when test='query.notTitleZhKey != null and query.notTitleZhKey != \"\" '>" +
"AND t.`title_zh` not like concat('%',concat(#{query.notTitleZhKey},'%'))", "AND t.`title_zh` not like concat('%',concat(#{query.notTitleZhKey},'%'))",
"</when>", "</when>",
"<when test=\"query.eqTitleZhKey != null and query.eqTitleZhKey != '' \">" + "<when test='query.eqTitleZhKey != null and query.eqTitleZhKey != \"\" '>" +
"AND t.`title_zh` = #{query.eqTitleZhKey} ", "AND t.`title_zh` = #{query.eqTitleZhKey} ",
"</when>", "</when>",
"<when test=\"query.notEqTitleZhKey != null and query.notEqTitleZhKey != '' \">" + "<when test='query.notEqTitleZhKey != null and query.notEqTitleZhKey != \"\" '>" +
"AND t.`title_zh` != #{query.notEqTitleZhKey} ", "AND t.`title_zh` != #{query.notEqTitleZhKey} ",
"</when>", "</when>",
......
...@@ -85,6 +85,12 @@ public class ProductReqDTO extends PageParam { ...@@ -85,6 +85,12 @@ public class ProductReqDTO extends PageParam {
@ApiModelProperty(value = "审核状态") @ApiModelProperty(value = "审核状态")
private Integer auditStatus; private Integer auditStatus;
@ApiModelProperty(value = "审核状态集合")
private List<Integer> auditStatusList;
@ApiModelProperty(value = "是否展示 默认为展示") @ApiModelProperty(value = "是否展示 默认为展示")
private Integer status; private Integer status;
......
...@@ -65,6 +65,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO> ...@@ -65,6 +65,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"ebpg.order_id, ", "ebpg.order_id, ",
"ebpg.order_item_id, ", "ebpg.order_item_id, ",
"ebpg.tidan_num, ", "ebpg.tidan_num, ",
"eo.order_id, ",
"eo.order_no, ", "eo.order_no, ",
"eo.transport_id, ", "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,", "(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> ...@@ -83,6 +84,7 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"eo.audit_type, ", "eo.audit_type, ",
"eo.audit_result, ", "eo.audit_result, ",
"eo.guan_lian_order_status, ", "eo.guan_lian_order_status, ",
"eo.container_number, ",
"eo.exception_reason, ", "eo.exception_reason, ",
"eo.package_type as advance_type, ", "eo.package_type as advance_type, ",
"eoi.prod_title_zh, ", "eoi.prod_title_zh, ",
...@@ -113,7 +115,8 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO> ...@@ -113,7 +115,8 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
"IF(#{query.lang} = 0, pd.title_zh, pd.title_en) as brand_name, ", "IF(#{query.lang} = 0, pd.title_zh, pd.title_en) as brand_name, ",
"ewl.dest_warehouse_id, ", "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, ", "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 ", "FROM ecw_box_preload_goods ebpg ",
"INNER JOIN ecw_box_preload_section ebps ON ebpg.sec_id = ebps.id ", "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 eo ON eo.order_id = ebpg.order_id ",
...@@ -182,6 +185,126 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO> ...@@ -182,6 +185,126 @@ public interface BoxPreloadGoodsMapper extends AbstractMapper<BoxPreloadGoodsDO>
List<BoxPreloadGoodsBackVO> orderPreloaded(@Param("query") PreloadedReq query); 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)") @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); Map<String, String> getShipmentCustomTypes(@Param("shipmentId") Long shipmentId);
......
...@@ -32,6 +32,7 @@ import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxLoadOrderVO; ...@@ -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.boxPreloadGoods.BoxPreloadGoodsBackVO;
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.boxTally.BoxGuanlianOrderBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxOrderLocationUpdateReq; 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.BoxTallyBackVO;
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum; import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
...@@ -253,6 +254,13 @@ public interface BoxService extends IService<BoxDO> { ...@@ -253,6 +254,13 @@ public interface BoxService extends IService<BoxDO> {
*/ */
List<BoxTallyBackVO> tallyList(Long shipmentId); 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; ...@@ -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.orderCargoControl.OrderCargoControlDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO; 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.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.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplit.OrderSplitDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderSplit.OrderSplitDO;
...@@ -182,6 +183,7 @@ import cn.iocoder.yudao.module.shipment.vo.boxSettlement.BoxSettlementBackVO; ...@@ -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.boxShipConfig.BoxShipConfigBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxShipping.BoxShippingBackVO; 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.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.BoxOrderLocationUpdateReq;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO; import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyVO; import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyVO;
...@@ -224,9 +226,7 @@ import java.util.*; ...@@ -224,9 +226,7 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; 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.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.BoxAirStatusEnum.TO_WAREHOUSED;
import static cn.iocoder.yudao.module.shipment.enums.BoxStatusEnum.UNLOADED; import static cn.iocoder.yudao.module.shipment.enums.BoxStatusEnum.UNLOADED;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*;
...@@ -280,6 +280,9 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -280,6 +280,9 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
@Lazy @Lazy
private BoxPreloadGoodsService boxPreloadGoodsService; private BoxPreloadGoodsService boxPreloadGoodsService;
@Resource
private OrderGuanlianService orderGuanlianService;
@Resource @Resource
private BoxAirShipmentService boxAirShipmentService; private BoxAirShipmentService boxAirShipmentService;
...@@ -2187,6 +2190,15 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2187,6 +2190,15 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
boxTallyBackVO.setMultiSpecification(getMultiSpecification(orderGoodsItemList)); boxTallyBackVO.setMultiSpecification(getMultiSpecification(orderGoodsItemList));
boxTallyBackVO.setTidanNum(boxPreloadGoodsDO.getTidanNum()); boxTallyBackVO.setTidanNum(boxPreloadGoodsDO.getTidanNum());
boxTallyBackVO.setNum(orderDO.getSumNum()); 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>() Long installNum = boxOrderCheckInfoService.selectCount(new LambdaQueryWrapperX<BoxOrderCheckInfoDO>()
.eq(BoxOrderCheckInfoDO::getShipmentId, shipmentId) .eq(BoxOrderCheckInfoDO::getShipmentId, shipmentId)
...@@ -2218,6 +2230,86 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -2218,6 +2230,86 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
return boxTallyBackVOS; 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) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void updateTallyStatus(Long shipmentId, Collection<Long> orderIdList) { public void updateTallyStatus(Long shipmentId, Collection<Long> orderIdList) {
......
...@@ -175,6 +175,13 @@ public interface BoxPreloadGoodsService extends IService<BoxPreloadGoodsDO> { ...@@ -175,6 +175,13 @@ public interface BoxPreloadGoodsService extends IService<BoxPreloadGoodsDO> {
*/ */
List<BoxPreloadGoodsBackVO> getShipGoodItemList(Long shipmentId); List<BoxPreloadGoodsBackVO> getShipGoodItemList(Long shipmentId);
/**
* 根据订单号获取同装柜商品项一样的信息
* @param orderIdList
* @return
*/
List<BoxPreloadGoodsBackVO> getGuanLianGoodItemList(List<Long> orderIdList);
/** /**
* 把订单从预装单中移出 * 把订单从预装单中移出
* @param shipmentId 出货单ID * @param shipmentId 出货单ID
......
package cn.iocoder.yudao.module.shipment.service.boxPreloadGoods; package cn.iocoder.yudao.module.shipment.service.boxPreloadGoods;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderApprovalTypeCheckEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderApprovalTypeCheckEvent;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
...@@ -30,6 +31,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO; ...@@ -30,6 +31,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.enums.OrderStatusEnum; import cn.iocoder.yudao.module.order.enums.OrderStatusEnum;
import cn.iocoder.yudao.module.order.service.order.*; import cn.iocoder.yudao.module.order.service.order.*;
import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService; import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService;
import cn.iocoder.yudao.module.order.vo.order.GuanLianOrderStatusVO;
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.order.OrderPreloadVO; import cn.iocoder.yudao.module.order.vo.order.OrderPreloadVO;
import cn.iocoder.yudao.module.order.vo.orderGuanlian.OrderTree; import cn.iocoder.yudao.module.order.vo.orderGuanlian.OrderTree;
...@@ -68,6 +70,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo ...@@ -68,6 +70,7 @@ import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataExpo
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO; import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
import cn.iocoder.yudao.module.system.service.dict.DictDataService; import cn.iocoder.yudao.module.system.service.dict.DictDataService;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -88,8 +91,7 @@ import java.util.stream.Collectors; ...@@ -88,8 +91,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_HAS_PROCESSING_APPROVAL; import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_IS_APPROVAL_IN_PROCESS;
import static cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum.ORDER_UPDATE; import static cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum.ORDER_UPDATE;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*;
...@@ -200,6 +202,24 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -200,6 +202,24 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
if (approvalTypeCheckEvent.getResult()) { if (approvalTypeCheckEvent.getResult()) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS); throw exception(ORDER_IS_APPROVAL_IN_PROCESS);
} }
// 2024-11-5 注意:此处要关注关联订单,关联订单也是一并修改成不受费用申请和特价影响
if (StringUtils.isNotBlank(orderDO.getGuanLianOrderStatus())){
List<GuanLianOrderStatusVO> guanLianOrderStatusVOList = JSONObject.parseArray(orderDO.getGuanLianOrderStatus(), GuanLianOrderStatusVO.class);
if (CollectionUtil.isNotEmpty(guanLianOrderStatusVOList) && guanLianOrderStatusVOList.size() > 0){
List<GuanLianOrderStatusVO> approvalGuanLianOrderList = guanLianOrderStatusVOList.stream().filter(vo -> vo.getType() == 2).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(approvalGuanLianOrderList)){
String orderNoStr = approvalGuanLianOrderList.stream().filter(o -> {
OrderApprovalTypeCheckEvent guanLianApprovalTypeCheckEvent = new OrderApprovalTypeCheckEvent(o.getOrderId(), null, null, Arrays.asList(1,2,3,4,5,12,31,32) , false);
applicationContext.publishEvent(guanLianApprovalTypeCheckEvent);
return guanLianApprovalTypeCheckEvent.getResult();
}).map(GuanLianOrderStatusVO::getOrderNo).collect(Collectors.joining(StrUtil.COMMA));
if (StringUtils.isNotBlank(orderNoStr)){
throw exception(GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS, orderNoStr);
}
}
}
}
//如果都符合,下面展示互斥和关联订单的弹窗 //如果都符合,下面展示互斥和关联订单的弹窗
Integer relationStatus = createReqVO.getRelationStatus(); Integer relationStatus = createReqVO.getRelationStatus();
//校验是否是互斥订单 //校验是否是互斥订单
...@@ -257,9 +277,9 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -257,9 +277,9 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
.filter(t -> t.getAbnormalState() != 0) .filter(t -> t.getAbnormalState() != 0)
.collect(Collectors.toList()); .collect(Collectors.toList());
List<OrderDO> auditList = orderList.stream() // List<OrderDO> auditList = orderList.stream()
.filter(t -> t.getAuditType() != 0) // .filter(t -> t.getAuditType() != 0)
.collect(Collectors.toList()); // .collect(Collectors.toList());
boolean isSuit = true; boolean isSuit = true;
if (CollectionUtil.isNotEmpty(notMatchStatusList)) { if (CollectionUtil.isNotEmpty(notMatchStatusList)) {
...@@ -286,17 +306,17 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -286,17 +306,17 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
sb.append("订单:").append(orderNos).append("存在异常"); sb.append("订单:").append(orderNos).append("存在异常");
} }
if (CollectionUtil.isNotEmpty(auditList)) { // if (CollectionUtil.isNotEmpty(auditList)) {
isSuit = false; // isSuit = false;
if (hasRelationOrder) { // if (hasRelationOrder) {
sb.append("<br>"); // sb.append("<br>");
} // }
List<String> orderNoList = auditList.stream() // List<String> orderNoList = auditList.stream()
.map(OrderDO::getOrderNo) // .map(OrderDO::getOrderNo)
.collect(Collectors.toList()); // .collect(Collectors.toList());
String orderNos = Joiner.on(",").join(orderNoList); // String orderNos = Joiner.on(",").join(orderNoList);
sb.append("订单:").append(orderNos).append("审核中"); // sb.append("订单:").append(orderNos).append("审核中");
} // }
if (!isSuit) { if (!isSuit) {
throw new ServiceException(500, sb.toString()); throw new ServiceException(500, sb.toString());
...@@ -433,11 +453,6 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -433,11 +453,6 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
.eq(BoxPreloadGoodsDO::getIsRemove, 0) .eq(BoxPreloadGoodsDO::getIsRemove, 0)
); );
OrderDO orderDO = orderService.getById(orderId); OrderDO orderDO = orderService.getById(orderId);
OrderApprovalTypeCheckEvent approvalTypeCheckEvent = new OrderApprovalTypeCheckEvent(orderDO.getOrderId(), null, null, Arrays.asList(1,2,3,4,5,12,31,32) , false);
applicationContext.publishEvent(approvalTypeCheckEvent);
if (approvalTypeCheckEvent.getResult()) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS);
}
//校验是否符合预装。 //校验是否符合预装。
checkInstallAvailable(boxDO, secId, loadList, orderDO, orderItemIdList); checkInstallAvailable(boxDO, secId, loadList, orderDO, orderItemIdList);
...@@ -767,10 +782,28 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -767,10 +782,28 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
OrderDO orderDO, OrderDO orderDO,
List<Long> orderItemIdList) { List<Long> orderItemIdList) {
//订单校验是否在审核中 //订单校验是否在审核中
Integer auditType = orderDO.getAuditType(); OrderApprovalTypeCheckEvent approvalTypeCheckEvent = new OrderApprovalTypeCheckEvent(orderDO.getOrderId(), null, null, Arrays.asList(1,2,3,4,5,12,31,32) , false);
if (auditType != 0) { applicationContext.publishEvent(approvalTypeCheckEvent);
throw exception(ORDER_HAS_PROCESSING_APPROVAL, orderDO.getOrderNo()); if (approvalTypeCheckEvent.getResult()) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS);
} }
// 2024-11-5 注意:此处要关注关联订单,关联订单也是一并修改成不受费用申请和特价影响
// if (StringUtils.isNotBlank(orderDO.getGuanLianOrderStatus())){
// List<GuanLianOrderStatusVO> guanLianOrderStatusVOList = JSONObject.parseArray(orderDO.getGuanLianOrderStatus(), GuanLianOrderStatusVO.class);
// if (CollectionUtil.isNotEmpty(guanLianOrderStatusVOList) && guanLianOrderStatusVOList.size() > 0){
// List<GuanLianOrderStatusVO> approvalGuanLianOrderList = guanLianOrderStatusVOList.stream().filter(vo -> vo.getType() == 2).collect(Collectors.toList());
// if (CollectionUtil.isNotEmpty(approvalGuanLianOrderList)){
// String orderNoStr = approvalGuanLianOrderList.stream().filter(o -> {
// OrderApprovalTypeCheckEvent guanLianApprovalTypeCheckEvent = new OrderApprovalTypeCheckEvent(o.getOrderId(), null, null, Arrays.asList(1,2,3,4,5,12,31,32) , false);
// applicationContext.publishEvent(guanLianApprovalTypeCheckEvent);
// return guanLianApprovalTypeCheckEvent.getResult();
// }).map(GuanLianOrderStatusVO::getOrderNo).collect(Collectors.joining(StrUtil.COMMA));
// if (StringUtils.isNotBlank(orderNoStr)){
// throw exception(GUAN_LIAN_ORDER_IS_APPROVAL_IN_PROCESS, orderNoStr);
// }
// }
// }
// }
checkInstallItem(loadList, orderItemIdList, Collections.singletonList(orderDO)); checkInstallItem(loadList, orderItemIdList, Collections.singletonList(orderDO));
...@@ -3060,6 +3093,14 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM ...@@ -3060,6 +3093,14 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
return boxPreloadGoodsMapper.orderPreloaded(query); 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 @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void remove(Long shipmentId, Collection<Long> orderIdList, Integer deleteType, boolean hasExit) { public void remove(Long shipmentId, Collection<Long> orderIdList, Integer deleteType, boolean hasExit) {
......
...@@ -151,9 +151,12 @@ public class BoxPreloadGoodsBackVO { ...@@ -151,9 +151,12 @@ public class BoxPreloadGoodsBackVO {
@ApiModelProperty(value = "件数") @ApiModelProperty(value = "件数")
private Integer num; private Integer num;
@ApiModelProperty(value = "单位") @ApiModelProperty(value = "包装类型(配置的)")
private String unit; private String unit;
@ApiModelProperty(value = "包装类型(入仓汇总的,逗号分隔)")
private String units;
@ApiModelProperty(value = "体积") @ApiModelProperty(value = "体积")
private BigDecimal volume; private BigDecimal volume;
...@@ -228,6 +231,15 @@ public class BoxPreloadGoodsBackVO { ...@@ -228,6 +231,15 @@ public class BoxPreloadGoodsBackVO {
return rucangTime; return rucangTime;
} }
// get units
public String getUnits() {
if(getWarehouseInInfoVO() != null) {
units = getWarehouseInInfoVO().getUnits();
}
return units;
}
public String getBoxGauge() { public String getBoxGauge() {
if(getWarehouseInInfoVO() != null) { if(getWarehouseInInfoVO() != null) {
boxGauge = getWarehouseInInfoVO().getBoxGauge(); boxGauge = getWarehouseInInfoVO().getBoxGauge();
...@@ -306,6 +318,12 @@ public class BoxPreloadGoodsBackVO { ...@@ -306,6 +318,12 @@ public class BoxPreloadGoodsBackVO {
private Integer lang; private Integer lang;
/**
* 关联订单数量
*/
@ApiModelProperty(value = "关联订单数量")
private Long guanLianOrderCount;
public void setGuanLianOrderStatus(String guanLianOrderStatus) { public void setGuanLianOrderStatus(String guanLianOrderStatus) {
this.guanLianOrderStatus = guanLianOrderStatus; this.guanLianOrderStatus = guanLianOrderStatus;
if (StringUtils.isNotBlank(guanLianOrderStatus)) { if (StringUtils.isNotBlank(guanLianOrderStatus)) {
...@@ -438,4 +456,10 @@ public class BoxPreloadGoodsBackVO { ...@@ -438,4 +456,10 @@ public class BoxPreloadGoodsBackVO {
} }
return mixStatus; return mixStatus;
} }
/**
* 货柜自编号
*/
@ApiModelProperty(value = "货柜自编号")
private String containerNumber;
} }
...@@ -72,6 +72,7 @@ public class PreloadedReq { ...@@ -72,6 +72,7 @@ public class PreloadedReq {
private Integer smartInstall; private Integer smartInstall;
private Long orderId; private Long orderId;
private List<Long> orderIdList;
private Integer isDel; 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 { ...@@ -68,5 +68,17 @@ public class BoxTallyBackVO {
@ApiModelProperty(value = "实际件数") @ApiModelProperty(value = "实际件数")
private Integer installNum; 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; ...@@ -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.order.vo.orderSplit.OrderSplitBackVO;
import cn.iocoder.yudao.module.shipment.convert.BoxConvert; import cn.iocoder.yudao.module.shipment.convert.BoxConvert;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO; 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.BoxOrderLocationUpdateReq;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO; import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO;
import cn.iocoder.yudao.module.system.api.file.FileMakeApi; import cn.iocoder.yudao.module.system.api.file.FileMakeApi;
...@@ -208,6 +209,13 @@ public class BoxController { ...@@ -208,6 +209,13 @@ public class BoxController {
return success(boxService.tallyList(shipmentId)); 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") @PostMapping("/batchOrderLocationUpdate")
@ApiOperation("批量修改储位, use this") @ApiOperation("批量修改储位, use this")
public CommonResult<Boolean> batchOrderLocationUpdate(@RequestBody BoxOrderLocationUpdateReq req) { public CommonResult<Boolean> batchOrderLocationUpdate(@RequestBody BoxOrderLocationUpdateReq req) {
......
...@@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.shipment.vo.boxOrderExit.BoxOrderExitCreateReqVO; ...@@ -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.boxOrderExit.BoxOrderExitUpdateReqVO;
import cn.iocoder.yudao.module.shipment.vo.boxPreloadGoods.BoxLoadOrderVO; 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.boxPreloadSection.BoxLoadSectionBackVO;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxGuanlianOrderBackVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
...@@ -103,6 +104,13 @@ public class MyBoxController { ...@@ -103,6 +104,13 @@ public class MyBoxController {
return success(boxService.pdaTallyList(shipmentId)); 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") @GetMapping("/cabinetExitDetail")
@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("获得退场详情")
......
...@@ -308,3 +308,4 @@ currency.id.not.null= ...@@ -308,3 +308,4 @@ currency.id.not.null=
order.approval.is.not.exists= order.approval.is.not.exists=
fee.application.not.is.zero= fee.application.not.is.zero=
guan.lian.order.is.approval.in.process=
\ No newline at end of file
...@@ -1122,3 +1122,4 @@ currency.id.not.null=The country ID cannot be empty ...@@ -1122,3 +1122,4 @@ currency.id.not.null=The country ID cannot be empty
order.approval.is.not.exists=Order approval type does not exist order.approval.is.not.exists=Order approval type does not exist
fee.application.not.is.zero=The expense application amount is not 0, and cannot be directly deleted fee.application.not.is.zero=The expense application amount is not 0, and cannot be directly deleted
guan.lian.order.is.approval.in.process=Related order [{}] has approval in progress
\ No newline at end of file
...@@ -1122,3 +1122,4 @@ currency.id.not.null=\u56fd\u5bb6id\u4e0d\u80fd\u4e3a\u7a7a ...@@ -1122,3 +1122,4 @@ currency.id.not.null=\u56fd\u5bb6id\u4e0d\u80fd\u4e3a\u7a7a
order.approval.is.not.exists=\u8ba2\u5355\u5ba1\u6279\u7c7b\u578b\u4e0d\u5b58\u5728 order.approval.is.not.exists=\u8ba2\u5355\u5ba1\u6279\u7c7b\u578b\u4e0d\u5b58\u5728
fee.application.not.is.zero=\u8d39\u7528\u7533\u8bf7\u91d1\u989d\u4e0d\u4e3a0\uff0c\u4e0d\u80fd\u8fdb\u884c\u76f4\u63a5\u5220\u9664 fee.application.not.is.zero=\u8d39\u7528\u7533\u8bf7\u91d1\u989d\u4e0d\u4e3a0\uff0c\u4e0d\u80fd\u8fdb\u884c\u76f4\u63a5\u5220\u9664
guan.lian.order.is.approval.in.process=\u5173\u8054\u8ba2\u5355\u3010{}\u3011\u6709\u5ba1\u6279\u6b63\u5728\u8fdb\u884c\u4e2d
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