mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、打包明细和包裹明细增加成倍数量和成倍序号;2、新增微信小程序基于短编号获取订单下板件和配件详情接口;3、分堆打包关联接口修正逻辑:部件和加工组由交集改为并集;
This commit is contained in:
@@ -24,6 +24,7 @@ chenfeng:
|
||||
ignore-token-urls:
|
||||
- /admin-api/executor/plate/wechat/miniprogram/cadview/info/*
|
||||
- /admin-api/executor/plate/wechat/miniprogram/cadview/order/info/*
|
||||
- /admin-api/executor/plate/wechat/miniprogram/cadview/order/details/*
|
||||
accessLogEnable: false
|
||||
access-log-ignore-urls:
|
||||
- /report/template
|
||||
|
||||
+6
@@ -111,4 +111,10 @@ public class OrderPartsRespVO {
|
||||
|
||||
@Schema(description = "打包数量")
|
||||
private BigDecimal packNum;
|
||||
|
||||
@Schema(description = "成倍数量")
|
||||
private Integer multiNum;
|
||||
|
||||
@Schema(description = "成倍序号")
|
||||
private Integer multiSort;
|
||||
}
|
||||
|
||||
+6
@@ -165,4 +165,10 @@ public class PlateDetailsRespVO {
|
||||
|
||||
@Schema(description = "分堆状态,true:已分堆")
|
||||
private Boolean heapSplitStatus;
|
||||
|
||||
@Schema(description = "成倍数量")
|
||||
private Integer multiNum;
|
||||
|
||||
@Schema(description = "成倍序号")
|
||||
private Integer multiSort;
|
||||
}
|
||||
|
||||
+6
@@ -179,4 +179,10 @@ public class PackageDetailsRespVO {
|
||||
|
||||
@Schema(description = "下封边厚度")
|
||||
private BigDecimal sealDown;
|
||||
|
||||
@Schema(description = "成倍数量")
|
||||
private Integer multiNum;
|
||||
|
||||
@Schema(description = "成倍序号")
|
||||
private Integer multiSort;
|
||||
}
|
||||
|
||||
+4
@@ -35,4 +35,8 @@ public class OrderDetailComponentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "是否删除", example = "false")
|
||||
private boolean deleted;
|
||||
|
||||
@Schema(description = "柜体编号", example = "[1,2]")
|
||||
@Size(max = 200, message = "{order.detail.component.list.query.bodyIds.max}")
|
||||
private Set<Long> bodyIds;
|
||||
}
|
||||
|
||||
+4
-4
@@ -175,10 +175,10 @@ public class PlateController {
|
||||
return success(plateService.getOrderInfoByPlateNo(plateNo));
|
||||
}
|
||||
|
||||
@PostMapping("/wechat/miniprogram/cadview/order/info/{plateNo:[A-Fa-f0-9]{6}[A-Za-z0-9]{11}}")
|
||||
@Operation(summary = "微信小程序根据板编号获取单板所属订单信息")
|
||||
@PostMapping("/wechat/miniprogram/cadview/order/details/{plateNo:[A-Fa-f0-9]{6}[A-Za-z0-9]{11}}")
|
||||
@Operation(summary = "微信小程序根据板编号获取订单详情")
|
||||
@Parameter(name = "plateNo", description = "板编号", required = true)
|
||||
public CommonResult<OrderWechatMiniProgramCadInfoRespVO> getOrderDetailsByPlateNo(@PathVariable String plateNo) {
|
||||
return success(plateService.getOrderInfoByPlateNo(plateNo));
|
||||
public CommonResult<OrdersViewCadViewInfoRespVO> getOrderDetailsByPlateNo(@PathVariable String plateNo, @Valid @RequestBody OrderWechatMiniProgramDetailReqVO reqVO) {
|
||||
return success(plateService.getOrderDetailsByPlateNo(plateNo, reqVO));
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/4/8 18:11
|
||||
*/
|
||||
@Schema(description = "管理后台 - 微信小程序 - 订单详情视图查询 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrderWechatMiniProgramDetailReqVO {
|
||||
@Schema(description = "部件编号", example = "[1,2]")
|
||||
@Size(max = 200, message = "{order.detail.component.list.query.componentIds.max}")
|
||||
private Set<Long> componentIds;
|
||||
|
||||
@Schema(description = "柜体编号", example = "[1,2]")
|
||||
@Size(max = 200, message = "{order.detail.component.list.query.bodyIds.max}")
|
||||
private Set<Long> bodyIds;
|
||||
}
|
||||
+4
-4
@@ -263,18 +263,18 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
*
|
||||
* @param componentIds
|
||||
* @param orderIds
|
||||
* @param groupId
|
||||
* @param groupIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectComponentCorrelationPlateIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupId") Long groupId);
|
||||
List<Long> selectComponentCorrelationPlateIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupIds") List<Long> groupIds);
|
||||
|
||||
/**
|
||||
* 查询部件关联的部件ID列表
|
||||
*
|
||||
* @param componentIds
|
||||
* @param orderIds
|
||||
* @param groupId
|
||||
* @param groupIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupId") Long groupId);
|
||||
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupIds") List<Long> groupIds);
|
||||
}
|
||||
+10
-8
@@ -1008,29 +1008,31 @@ public class PackServiceImpl implements PackService {
|
||||
// 没有归属部件返回自己本身
|
||||
List<Long> self = List.of(id);
|
||||
|
||||
OrderItemDO itemDO;
|
||||
List<OrderItemDO> itemDOS;
|
||||
if (com.cf.imes.module.executor.enums.OrderItemTypeEnum.PLATE_ITEM.getStatus().equals(itemType)) {
|
||||
// 板件
|
||||
PlateDO plate = plateService.getPlateByNo(id, ArrayUtil.toArray(orderIds, Long.class));
|
||||
AssertUtils.notEmpty(plate, PLATE_NOT_EXISTS);
|
||||
// 查询关联部件id
|
||||
itemDO = orderItemService.getPlateItemCompId(plate.getId());
|
||||
itemDOS = orderItemService.getPlateItemCompId(plate.getId());
|
||||
} else {
|
||||
// 配件
|
||||
OrderPartsDO part = orderPartsService.getPart(id);
|
||||
AssertUtils.notEmpty(part, ORDER_PARTS_NOT_EXISTS);
|
||||
// 查询关联部件id
|
||||
itemDO = orderItemService.getPartItemCompId(id);
|
||||
itemDOS = orderItemService.getPartItemCompId(id);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNull(itemDO)) {
|
||||
if (ObjectUtil.isEmpty(itemDOS)) {
|
||||
// 没查到返回自己本身
|
||||
return self;
|
||||
}
|
||||
|
||||
List<Long> componentIdList;
|
||||
Long compId = itemDO.getCompId();
|
||||
Long groupId = reqVO.isRelateGroup() ? itemDO.getGroupId() : null;
|
||||
Long compId = itemDOS.get(0).getCompId();
|
||||
// 需要关联加工组时,记录所有groupId不为空和0的记录
|
||||
List<Long> groupIds = reqVO.isRelateGroup() ?
|
||||
itemDOS.stream().filter(Objects::nonNull).map(OrderItemDO::getGroupId).filter(f -> ObjectUtil.isNotNull(f) && f != 0).distinct().toList() : null;
|
||||
if (PackScanComponentCorrelationTypeEnum.SELF.getType().equals(type)) {
|
||||
// 本身不查部件树
|
||||
componentIdList = null;
|
||||
@@ -1043,12 +1045,12 @@ public class PackServiceImpl implements PackService {
|
||||
}
|
||||
|
||||
// 没有归属部件且没有归属加工组返回自己本身
|
||||
if (CollUtil.isEmpty(componentIdList) && ObjectUtil.isNull(groupId)) {
|
||||
if (CollUtil.isEmpty(componentIdList) && CollUtil.isEmpty(groupIds)) {
|
||||
return self;
|
||||
}
|
||||
|
||||
// 是否勾选了加工组
|
||||
List<Long> componentIdsCorrelationItemIds = orderItemService.getComponentIdsCorrelationItemIds(orderIds, componentIdList, groupId);
|
||||
List<Long> componentIdsCorrelationItemIds = orderItemService.getComponentIdsCorrelationItemIds(orderIds, componentIdList, groupIds);
|
||||
if (CollUtil.isEmpty(componentIdsCorrelationItemIds)) {
|
||||
return self;
|
||||
}
|
||||
|
||||
+8
@@ -103,4 +103,12 @@ public interface OrderComponentService {
|
||||
* @return
|
||||
*/
|
||||
List<Long> getChildComponentIdsOnMyParent(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单下板件+配件详情
|
||||
*
|
||||
* @param pageReqVO 房间id列表+部件id列表
|
||||
* @return
|
||||
*/
|
||||
OrdersViewCadViewInfoRespVO getOrderViewCadInfo(OrderDetailComponentPageReqVO pageReqVO);
|
||||
}
|
||||
+104
-2
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.service.ordercomponent;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -50,6 +51,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Deque;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -58,6 +60,7 @@ import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_BODY_NOT_EXISTS;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_COMPONENT_DELETE_PLATE_IN_PLAN;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_COMPONENT_NOT_EXIST;
|
||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_COMPONENT_NO_NEED_TO_RESTORE;
|
||||
@@ -353,7 +356,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
List<OrdersViewPartsPageDO> partRecords = viewPartsPage.getRecords();
|
||||
|
||||
List<OrderViewPartPageRespVO> partResult = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(plateRecords)) {
|
||||
if (CollUtil.isNotEmpty(partRecords)) {
|
||||
partResult = partRecords.stream().map(item -> {
|
||||
OrderViewPartPageRespVO vo = new OrderViewPartPageRespVO();
|
||||
BeanUtil.copyProperties(item, vo);
|
||||
@@ -700,6 +703,10 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
List<Long> result = new ArrayList<>();
|
||||
OrderComponentDO componentDO = orderComponentMapper.selectById(id);
|
||||
if (ObjectUtil.isNotNull(componentDO)) {
|
||||
OrderComponentDO parentComponentDO = orderComponentMapper.selectById(componentDO.getPid());
|
||||
if (ObjectUtil.isNull(parentComponentDO)) {
|
||||
return result;
|
||||
}
|
||||
// 查询顶级下所有部件
|
||||
List<OrderComponentDO> componentListOnTop = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.eq(OrderComponentDO::getTopId, componentDO.getTopId())
|
||||
@@ -707,8 +714,103 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getPid)
|
||||
);
|
||||
|
||||
return getChildrenIds(componentDO, componentListOnTop).stream().toList();
|
||||
return getChildrenIds(parentComponentDO, componentListOnTop).stream().toList();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrdersViewCadViewInfoRespVO getOrderViewCadInfo(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
OrdersViewCadViewInfoRespVO ordersViewCadViewInfoRespVO = new OrdersViewCadViewInfoRespVO();
|
||||
Long orderId = pageReqVO.getOrderId();
|
||||
|
||||
boolean useBodyKey = true;
|
||||
// cad图纸id对应map
|
||||
Map<Long, Long> cadViewFileIdMap = new HashMap<>();
|
||||
Set<Long> bodyIds = pageReqVO.getBodyIds();
|
||||
if(CollUtil.isNotEmpty(bodyIds)) {
|
||||
List<OrderBodyDO> orderBodyDOList = orderBodyMapper.selectByIds(bodyIds);
|
||||
if (CollUtil.isEmpty(orderBodyDOList)) {
|
||||
throw new ServiceException(ORDER_BODY_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 整理出body_id和cad图纸id的关系
|
||||
cadViewFileIdMap = orderBodyDOList.stream()
|
||||
.filter(item -> item.getCadViewFileId() != null)
|
||||
.collect(Collectors.toMap(OrderBodyDO::getId, OrderBodyDO::getCadViewFileId));
|
||||
}
|
||||
|
||||
|
||||
Set<Long> componentIds = pageReqVO.getComponentIds();
|
||||
// 要查询的部件id列表
|
||||
Set<Long> queryComponentIds = new HashSet<>();
|
||||
if(CollUtil.isNotEmpty(componentIds)) {
|
||||
// 1、查询顶级
|
||||
List<OrderComponentDO> componentDOS = orderComponentMapper.selectByIds(componentIds);
|
||||
if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) {
|
||||
throw new ServiceException(ORDER_COMPONENT_NOT_EXIST);
|
||||
}
|
||||
List<Long> topIds = componentDOS.stream()
|
||||
.map(OrderComponentDO::getTopId)
|
||||
.toList();
|
||||
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.in(OrderComponentDO::getTopId, topIds)
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid));
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
for (OrderComponentDO co : componentDOS) {
|
||||
queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS));
|
||||
}
|
||||
} else {
|
||||
return ordersViewCadViewInfoRespVO;
|
||||
}
|
||||
// 有柜体图纸对应关系就不用部件的了
|
||||
if (MapUtil.isEmpty(cadViewFileIdMap)) {
|
||||
useBodyKey = false;
|
||||
// 整理出id和cadViewFileId的对应关系
|
||||
cadViewFileIdMap = orderComponentDOS.stream()
|
||||
.filter(item -> item.getCadViewFileId() != null)
|
||||
.collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId));
|
||||
}
|
||||
}
|
||||
|
||||
// 查询所有板件的视图所需信息
|
||||
PageDTO<OrdersViewPlatesPageDO> page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, List.of(orderId), bodyIds,
|
||||
null, queryComponentIds, true);
|
||||
List<OrdersViewPlatesPageDO> plateRecords = viewPlatesPage.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> plateResult = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(plateRecords)) {
|
||||
for (OrdersViewPlatesPageDO plateRecord : plateRecords) {
|
||||
OrderViewPlatePageRespVO vo = new OrderViewPlatePageRespVO();
|
||||
BeanUtil.copyProperties(plateRecord, vo);
|
||||
vo.setCadViewFileId(cadViewFileIdMap.get(useBodyKey ? plateRecord.getBodyId() : plateRecord.getCompId()));
|
||||
plateResult.add(vo);
|
||||
}
|
||||
}
|
||||
|
||||
// 查询所有配件的视图所需信息
|
||||
PageDTO<OrdersViewPartsPageDO> page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrdersViewPartsPageDO> viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, List.of(orderId), bodyIds,
|
||||
null, queryComponentIds, null, true);
|
||||
List<OrdersViewPartsPageDO> partRecords = viewPartsPage.getRecords();
|
||||
|
||||
List<OrderViewPartPageRespVO> partResult = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(partRecords)) {
|
||||
for (OrdersViewPartsPageDO partRecord : partRecords) {
|
||||
OrderViewPartPageRespVO vo = new OrderViewPartPageRespVO();
|
||||
BeanUtil.copyProperties(partRecord, vo);
|
||||
vo.setCadViewFileId(cadViewFileIdMap.get(useBodyKey ? partRecord.getBodyId() : partRecord.getCompId()));
|
||||
partResult.add(vo);
|
||||
}
|
||||
}
|
||||
|
||||
ordersViewCadViewInfoRespVO.setPlates(plateResult);
|
||||
ordersViewCadViewInfoRespVO.setParts(partResult);
|
||||
return ordersViewCadViewInfoRespVO;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -18,7 +18,7 @@ public interface OrderItemService {
|
||||
* @param plateId
|
||||
* @return
|
||||
*/
|
||||
OrderItemDO getPlateItemCompId(Long plateId);
|
||||
List<OrderItemDO> getPlateItemCompId(Long plateId);
|
||||
|
||||
/**
|
||||
* 查询配件订单明细关联的部件id
|
||||
@@ -26,7 +26,7 @@ public interface OrderItemService {
|
||||
* @param partId
|
||||
* @return
|
||||
*/
|
||||
OrderItemDO getPartItemCompId(Long partId);
|
||||
List<OrderItemDO> getPartItemCompId(Long partId);
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -34,5 +34,5 @@ public interface OrderItemService {
|
||||
* @param orderIds
|
||||
* @return
|
||||
*/
|
||||
List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds, Long groupId);
|
||||
List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds, List<Long> groupIds);
|
||||
}
|
||||
+8
-8
@@ -22,36 +22,36 @@ public class OrderItemServiceImpl implements OrderItemService {
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
@Override
|
||||
public OrderItemDO getPlateItemCompId(Long id) {
|
||||
public List<OrderItemDO> getPlateItemCompId(Long id) {
|
||||
List<OrderItemDO> plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPlateId, id)
|
||||
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId));
|
||||
if (CollUtil.isNotEmpty(plateItemDOS)) {
|
||||
return plateItemDOS.get(0);
|
||||
return plateItemDOS;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderItemDO getPartItemCompId(Long partId) {
|
||||
public List<OrderItemDO> getPartItemCompId(Long partId) {
|
||||
List<OrderItemDO> partItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||
.eq(OrderItemDO::getPartsId, partId)
|
||||
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId));
|
||||
if (CollUtil.isNotEmpty(partItemDOS)) {
|
||||
return partItemDOS.get(0);
|
||||
return partItemDOS;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds, Long groupId) {
|
||||
public List<Long> getComponentIdsCorrelationItemIds(List<Long> orderIds, List<Long> componentIds, List<Long> groupIds) {
|
||||
List<Long> resultList = new ArrayList<>();
|
||||
if (CollUtil.isEmpty(componentIds)) {
|
||||
if (CollUtil.isEmpty(componentIds) && CollUtil.isEmpty(groupIds)) {
|
||||
return resultList;
|
||||
}
|
||||
// 查询关联的板件和配件id
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPlateIds(orderIds, componentIds, groupId));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPartsIds(orderIds, componentIds, groupId));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPlateIds(orderIds, componentIds, groupIds));
|
||||
resultList.addAll(orderItemMapper.selectComponentCorrelationPartsIds(orderIds, componentIds, groupIds));
|
||||
return resultList;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -162,4 +162,13 @@ public interface PlateService {
|
||||
* @return
|
||||
*/
|
||||
OrderWechatMiniProgramCadInfoRespVO getOrderInfoByPlateNo(String plateNo);
|
||||
|
||||
/**
|
||||
* 根据板编号获取订单详情
|
||||
*
|
||||
* @param plateNo
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
OrdersViewCadViewInfoRespVO getOrderDetailsByPlateNo(String plateNo, OrderWechatMiniProgramDetailReqVO reqVO);
|
||||
}
|
||||
+27
@@ -23,11 +23,13 @@ import com.cf.imes.framework.id.core.util.SnowflakeIdWorker3rd;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.query.QueryWrapperX;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.module.executor.controller.admin.goods.vo.GoodsSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCadViewPlatePageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderPlanPlateNumAndAreaRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrderRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.order.OrdersViewCadViewInfoRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetailComponentPageReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.OrderGoodsResp;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
import com.cf.imes.module.executor.controller.admin.plate.vo.*;
|
||||
@@ -1081,4 +1083,29 @@ public class PlateServiceImpl implements PlateService {
|
||||
result.setOrderComponentList(orderComponentService.getOrderComponentListOnOrders(List.of(orderId), organIdLong));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrdersViewCadViewInfoRespVO getOrderDetailsByPlateNo(String plateNo, OrderWechatMiniProgramDetailReqVO reqVO) {
|
||||
// 1、解析组织id,查询板件信息
|
||||
Integer organId = Integer.parseInt(plateNo.substring(0, 6), 16);
|
||||
Long organIdLong = organId.longValue();
|
||||
organApi.validOrgan(organId.longValue()).checkError();
|
||||
|
||||
OrganContextHolder.setIgnore(false);
|
||||
OrganContextHolder.setOrganId(organIdLong);
|
||||
|
||||
PlateDO plateDO = plateMapper.selectOne(new LambdaQueryWrapper<PlateDO>()
|
||||
.eq(PlateDO::getOrganId, organIdLong)
|
||||
.eq(PlateDO::getPlateNo, plateNo.substring(6)));
|
||||
|
||||
if (ObjectUtil.isNull(plateDO)) {
|
||||
throw new ServiceException(PLATE_NOT_EXISTS);
|
||||
}
|
||||
|
||||
OrderDetailComponentPageReqVO detailReqVO = new OrderDetailComponentPageReqVO();
|
||||
detailReqVO.setOrderId(plateDO.getOrderId());
|
||||
detailReqVO.setComponentIds(reqVO.getComponentIds());
|
||||
detailReqVO.setBodyIds(reqVO.getBodyIds());
|
||||
return orderComponentService.getOrderViewCadInfo(detailReqVO);
|
||||
}
|
||||
}
|
||||
+1
@@ -188,6 +188,7 @@ chenfeng:
|
||||
- /rpc-api/**
|
||||
- /admin-api/executor/plate/wechat/miniprogram/cadview/info/*
|
||||
- /admin-api/executor/plate/wechat/miniprogram/cadview/order/info/*
|
||||
- /admin-api/executor/plate/wechat/miniprogram/cadview/order/details/*
|
||||
ignore-tables:
|
||||
|
||||
env: # 多环境的配置项
|
||||
|
||||
+37
-16
@@ -703,20 +703,30 @@
|
||||
AND op.order_id = oi.order_id
|
||||
AND op.deleted = 0
|
||||
WHERE oi.plate_id != 0
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
and oi.comp_id in
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="orderIds != null and orderIds.size() > 0">
|
||||
AND oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND oi.group_id = #{groupId}
|
||||
<if test="(componentIds != null and componentIds.size() > 0) or (groupIds != null and groupIds.size() > 0)">
|
||||
AND (
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
oi.comp_id IN
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="componentIds != null and componentIds.size() > 0 and groupIds != null and groupIds.size() > 0">
|
||||
OR
|
||||
</if>
|
||||
<if test="groupIds != null and groupIds.size() > 0">
|
||||
oi.group_id IN
|
||||
<foreach item="groupId" collection="groupIds" open="(" separator="," close=")">
|
||||
#{groupId}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@@ -724,20 +734,31 @@
|
||||
SELECT oi.parts_id
|
||||
FROM order_item oi
|
||||
WHERE oi.parts_id != 0
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
AND oi.comp_id IN
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="orderIds != null and orderIds.size() > 0">
|
||||
AND oi.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND oi.group_id = #{groupId}
|
||||
<if test="(componentIds != null and componentIds.size() > 0) or (groupIds != null and groupIds.size() > 0)">
|
||||
AND (
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
oi.comp_id IN
|
||||
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||
#{componentId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="componentIds != null and componentIds.size() > 0 and groupIds != null and groupIds.size() > 0">
|
||||
OR
|
||||
</if>
|
||||
<if test="groupIds != null and groupIds.size() > 0">
|
||||
oi.group_id IN
|
||||
<foreach item="groupId" collection="groupIds" open="(" separator="," close=")">
|
||||
#{groupId}
|
||||
</foreach>
|
||||
</if>
|
||||
)
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
|
||||
+23
-9
@@ -289,6 +289,9 @@
|
||||
<result property="subparts" column="subparts"/>
|
||||
<result property="componentName" column="componentName"/>
|
||||
<result property="packNum" column="packNum"/>
|
||||
|
||||
<result property="multiNum" column="multiNum"/>
|
||||
<result property="multiSort" column="multiSort"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPackedParts"
|
||||
@@ -301,10 +304,12 @@
|
||||
t.body_id AS bodyId,
|
||||
t.group_names AS groupName,
|
||||
t.component_names AS componentName,
|
||||
t.pack_num AS packNum,
|
||||
t.pack_num AS packNum,
|
||||
t.package_id AS packageId,
|
||||
t.multiNum AS multiNum,
|
||||
t.multiSort AS multiSort,
|
||||
op.id AS partsId,
|
||||
op.order_id AS orderId,
|
||||
op.order_id AS orderId,
|
||||
op.name,
|
||||
op.model,
|
||||
op.spec,
|
||||
@@ -327,10 +332,12 @@
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.pack_num) AS pack_num
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.pack_num) AS pack_num,
|
||||
MIN(ob.multi_num) AS multiNum,
|
||||
MIN(ob.sort) AS multiSort
|
||||
FROM order_item oi
|
||||
LEFT JOIN order_group og
|
||||
ON oi.organ_id = og.organ_id
|
||||
@@ -387,6 +394,9 @@
|
||||
<result property="heapSplitStatus" column="heapSplitStatus"/>
|
||||
<result property="heapNum" column="heapNum"/>
|
||||
|
||||
<result property="multiNum" column="multiNum"/>
|
||||
<result property="multiSort" column="multiSort"/>
|
||||
|
||||
</resultMap>
|
||||
<select id="selectOrdersPartsList"
|
||||
parameterType="java.lang.Long"
|
||||
@@ -399,6 +409,8 @@
|
||||
t.group_names AS processGroup,
|
||||
t.component_names AS componentName,
|
||||
t.num AS num,
|
||||
t.multiNum AS multiNum,
|
||||
t.multiSort AS multiSort,
|
||||
op.id AS partsId,
|
||||
op.order_id AS orderId,
|
||||
op.name,
|
||||
@@ -422,10 +434,12 @@
|
||||
oi.room_id,
|
||||
oi.body_id,
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.num - oi.pack_num) AS num
|
||||
MIN(ob.name) AS body_name,
|
||||
SUM(oi.num - oi.pack_num) AS num,
|
||||
MIN(ob.multi_num) AS multiNum,
|
||||
MIN(ob.sort) AS multiSort
|
||||
FROM order_item oi
|
||||
LEFT JOIN order_group og
|
||||
ON oi.organ_id = og.organ_id
|
||||
|
||||
+15
-4
@@ -635,11 +635,10 @@
|
||||
|
||||
select distinct op.id as plateId,
|
||||
op.order_id as orderId,
|
||||
o.id as packId,
|
||||
o.package_no as packNo
|
||||
from order_plate op
|
||||
left join order_item oi on op.organ_id = oi.organ_id and op.order_id = oi.order_id and op.id = oi.plate_id
|
||||
left join order_package o on oi.organ_id = o.organ_id and oi.order_id = o.order_id and oi.package_id = o.id
|
||||
left join order_package o on oi.organ_id = o.organ_id and oi.order_id = o.order_id and oi.package_id = o.package_no
|
||||
|
||||
where op.organ_id = #{organId}
|
||||
and op.deleted = false
|
||||
@@ -790,6 +789,8 @@
|
||||
<result property="sealDown" column="sealDown"/>
|
||||
|
||||
<result property="heapSplitStatus" column="heapSplitStatus"/>
|
||||
<result property="multiNum" column="multiNum"/>
|
||||
<result property="multiSort" column="multiSort"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
@@ -847,6 +848,8 @@
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.multi_num AS multiNum,
|
||||
t.multi_sort AS multiSort,
|
||||
op.id AS plateId,
|
||||
op.plate_no AS plateNo,
|
||||
op.custom_plate_no AS customPlateNo,
|
||||
@@ -889,7 +892,9 @@
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,-- 聚合加工组
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name
|
||||
MIN(ob.name) AS body_name,
|
||||
MIN(ob.multi_num) AS multi_num,
|
||||
MIN(ob.sort) AS multi_sort
|
||||
FROM order_item oi
|
||||
LEFT JOIN order_group og
|
||||
ON oi.organ_id = og.organ_id
|
||||
@@ -926,6 +931,8 @@
|
||||
t.body_name AS bodyName,
|
||||
t.room_id AS roomId,
|
||||
t.body_id AS bodyId,
|
||||
t.multi_num AS multiNum,
|
||||
t.multi_sort AS multiSort,
|
||||
op.id AS plateId,
|
||||
op.plate_no AS plateNo,
|
||||
op.custom_plate_no AS customPlateNo,
|
||||
@@ -969,7 +976,9 @@
|
||||
GROUP_CONCAT(og.name SEPARATOR ',') AS group_names,-- 聚合加工组
|
||||
MIN(oc.name) AS component_names,
|
||||
MIN(ob.room_name) AS room_name,
|
||||
MIN(ob.name) AS body_name
|
||||
MIN(ob.name) AS body_name,
|
||||
MIN(ob.multi_num) AS multi_num,
|
||||
MIN(ob.sort) AS multi_sort
|
||||
FROM order_item oi
|
||||
LEFT JOIN order_group og
|
||||
ON oi.organ_id = og.organ_id
|
||||
@@ -1221,6 +1230,8 @@
|
||||
<result property="sealUp" column="sealUp"/>
|
||||
<result property="sealDown" column="sealDown"/>
|
||||
|
||||
<result property="multiNum" column="multiNum"/>
|
||||
<result property="multiSort" column="multiSort"/>
|
||||
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user