1、工作台逾期订单恢复为平铺;2、新功能部件、分堆打包、cad三维看图等接口权限梳理;3、装配设置顶级部件关联item明细表,修复明细项删除后部件可见;

This commit is contained in:
gaoqr
2026-04-20 18:01:29 +08:00
parent 6558a11228
commit a11ec028fd
13 changed files with 83 additions and 62 deletions
@@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@@ -40,24 +41,28 @@ public class AssemblyListController {
@PostMapping("/list")
@Operation(summary = "装配清单-获取部件列表")
@PreAuthorize("@ss.hasPermission('production:assemblyList:query')")
public CommonResult<List<OrderComponentRespVO>> getComponentList(@RequestBody AssemblyListComponentPageReqVO reqVO) {
return CommonResult.success(assemblyListService.getComponentList(reqVO));
}
@PostMapping("/list/view/plate/page")
@Operation(summary = "装配清单-获取订单部件下的板件视图分页列表数据")
@PreAuthorize("@ss.hasPermission('production:assemblyList:query')")
public CommonResult<PageResult<OrderViewPlatePageRespVO>> getComponentViewPlatesPage(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
return success(assemblyListService.getViewComponentPlatePage(pageReqVO));
}
@PostMapping("/list/view/part/page")
@Operation(summary = "装配清单-获取订单部件下的配件视图分页列表数据")
@PreAuthorize("@ss.hasPermission('production:assemblyList:query')")
public CommonResult<PageResult<OrderViewPartPageRespVO>> getComponentViewPartsPage(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
return success(assemblyListService.getViewComponentPartPage(pageReqVO));
}
@PostMapping("/list/view/cadinfo")
@Operation(summary = "装配清单-获取订单部件下的所有板件+配件视图列表数据")
@PreAuthorize("@ss.hasPermission('production:assemblyList:query')")
public CommonResult<OrdersViewCadViewInfoRespVO> getComponentViewPlates(@Valid @RequestBody AssemblyListComponentPageReqVO pageReqVO) {
return success(assemblyListService.getViewComponentPlatesCadInfo(pageReqVO));
}
@@ -65,6 +70,7 @@ public class AssemblyListController {
@PostMapping("/process/{id}")
@Operation(summary = "装配清单-加工部件")
@Parameter(name = "id", description = "部件编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('production:assemblyList:process')")
public CommonResult<Boolean> processComponent(@PathVariable Long id) {
assemblyListService.processComponent(id);
return CommonResult.success(true);
@@ -73,6 +79,7 @@ public class AssemblyListController {
@PostMapping("/restore/{id}")
@Operation(summary = "装配清单-恢复未加工")
@Parameter(name = "id", description = "部件编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('production:assemblyList:process')")
public CommonResult<Boolean> restoreComponent(@PathVariable Long id) {
assemblyListService.restoreComponent(id);
return CommonResult.success(true);
@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -37,6 +38,7 @@ public class HeapSplitController {
@PostMapping("")
@Operation(summary = "保存分堆")
@PreAuthorize("@ss.hasPermission('manage:heapsplit:query')")
public CommonResult<Boolean> saveHeapsplit(@Valid @RequestBody HeapSplitSaveReqVO reqVO) {
heapSplitService.saveHeapsplit(reqVO);
return success(true);
@@ -45,6 +47,7 @@ public class HeapSplitController {
@PostMapping("/details")
@Operation(summary = "查询分堆详情")
@Parameter(name = "orderIds", description = "订单ID列表", required = true)
@PreAuthorize("@ss.hasPermission('manage:heapsplit:save')")
public CommonResult<OrdersHeapSplitDetailRespVO> getOrdersHeapSplitDetail(@RequestBody @NotEmpty(message = "订单ID不能为空") List<Long> orderIds) {
return success(heapSplitService.getOrdersHeapSplitedDetail(orderIds));
}
@@ -44,6 +44,7 @@ public class PackController {
@PostMapping("/unpack/details")
@Operation(summary = "获取订单列表下未打包明细")
@Parameter(name = "orderIds", description = "订单ID列表", required = true)
@PreAuthorize("@ss.hasAnyPermissions('manage:pack:pack')")
public CommonResult<OrdersUnpackDetailRespVO> getOrdersUnpackDetail(@RequestBody @NotEmpty(message = "订单ID不能为空") List<Long> orderIds) {
return success(packService.getOrdersUnpackDetails(orderIds));
}
@@ -124,6 +125,7 @@ public class PackController {
@PostMapping("/scan/correlation")
@Operation(summary = "查询扫描类型相关的板件+配件id")
@PreAuthorize("@ss.hasPermission('manage:pack:query')")
public CommonResult<List<Long>> getComponentCorrelation(@Valid @RequestBody PackScanComponentCorrelationReqVO reqVO) {
return success(packService.getComponentCorrelation(reqVO));
}
@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@@ -47,20 +48,16 @@ public class OrderComponentController {
@Resource
private AssemblyListService assemblyListService;
@PostMapping("/detail/list")
@Operation(summary = "查询订单详情部件列表")
public CommonResult<List<OrderComponentRespVO>> getOrderComponentList(@Valid @RequestBody OrderDetailComponentListReqVO reqVO) {
return success(orderComponentService.getOrderComponentList(reqVO));
}
@PostMapping("/top/list")
@Operation(summary = "查询订单顶级部件列表")
@PreAuthorize("@ss.hasPermission('production:assemblyList:query')")
public CommonResult<List<OrderComponentRespVO>> getOrderTopComponentList(@Valid @RequestBody OrdersTopComponentListReqVO reqVO) {
return success(assemblyListService.getOrderTopComponentList(reqVO));
}
@PostMapping("/view/list")
@Operation(summary = "查询订单详情cad视图部件列表")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<List<OrderComponentRespVO>> getOrderViewComponentList(@Valid @RequestBody OrderDetailComponentListReqVO reqVO) {
return success(orderComponentService.getComponentListOnTopId(reqVO));
}
@@ -68,30 +65,35 @@ public class OrderComponentController {
@GetMapping("/view/{id}/list")
@Operation(summary = "查询指定顶级部件下部件列表")
@Parameter(name = "id", description = "部件编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:query')")
public CommonResult<List<OrderComponentRespVO>> getChildViewComponentList(@PathVariable Long id) {
return success(orderComponentService.getChildComponentListOnTopId(id));
}
@PostMapping("/view/plate/page")
@Operation(summary = "获取部件下的板件视图分页列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<PageResult<OrderViewPlatePageRespVO>> getComponentViewPlatesPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
return success(orderComponentService.getViewComponentPlatesPage(pageReqVO));
}
@PostMapping("/view/part/page")
@Operation(summary = "获取部件下的配件视图分页列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<PageResult<OrderViewPartPageRespVO>> getComponentViewPartsPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
return success(orderComponentService.getViewComponentPartsPage(pageReqVO));
}
@PostMapping("/view/cadinfo")
@Operation(summary = "获取部件下的所有板件+配件视图列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<OrdersViewCadViewInfoRespVO> getComponentViewPlates(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
return success(orderComponentService.getViewComponentCadInfo(pageReqVO));
}
@DeleteMapping("/{orderId}/{id}")
@Operation(summary = "删除订单部件")
@PreAuthorize("@ss.hasPermission('production:manager-list:deleteComponent')")
public CommonResult<Boolean> deleteOrderComponent(@PathVariable("orderId") Long orderId, @PathVariable("id") Long id) {
orderComponentService.deleteOrderComponent(orderId, id);
return success(true);
@@ -99,6 +101,7 @@ public class OrderComponentController {
@PutMapping("/{orderId}/{id}")
@Operation(summary = "恢复订单部件")
@PreAuthorize("@ss.hasPermission('production:manager-list:restoreComponent')")
public CommonResult<Boolean> restoreOrderComponent(@PathVariable("orderId") Long orderId, @PathVariable("id") Long id) {
orderComponentService.restoreOrderComponent(orderId, id);
return success(true);
@@ -139,24 +139,28 @@ public class PlateController {
@PostMapping("/body/view/plate/page")
@Operation(summary = "获取柜体下的板件视图分页列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<PageResult<OrderViewPlatePageRespVO>> getBodyViewPlatesPage(@Validated(OrderCadViewPageGroup.class) @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
return success(plateService.getBodyViewPlatesPage(orderCadViewPlatePageReqVO));
}
@PostMapping("/body/view/part/page")
@Operation(summary = "获取柜体下的配件视图分页列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<PageResult<OrderViewPartPageRespVO>> getBodyViewPartsPage(@Validated(OrderCadViewPageGroup.class) @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
return success(plateService.getBodyViewPartsPage(orderCadViewPlatePageReqVO));
}
@PostMapping("/body/view/cadinfo")
@Operation(summary = "获取板件对应柜体下的所有板件+配件视图列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<OrdersViewCadViewInfoRespVO> getBodyViewCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
return success(plateService.getBodyViewCadInfo(orderCadViewPlatePageReqVO));
}
@PostMapping("/body/view/part/cadinfo")
@Operation(summary = "获取板件对应柜体下的所有配件视图列表数据")
@PreAuthorize("@ss.hasPermission('production:manager-list:detail')")
public CommonResult<OrdersViewCadViewInfoRespVO> getBodyViewPartCadInfo(@Validated @RequestBody OrderCadViewPlatePageReqVO orderCadViewPlatePageReqVO) {
return success(plateService.getBodyViewPartCadInfo(orderCadViewPlatePageReqVO));
}
@@ -180,13 +180,11 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
* @param today
* @param organId
* @param page
* @param orderIds 父级订单数组
* @return
*/
IPage<OrderOverdueRespVO> selectOrderOverdue(@Param("today") LocalDate today,
@Param("organId") Long organId,
@Param("page") IPage<OrderOverdueRespVO> page,
@Param("orderIds") Long... orderIds);
@Param("page") IPage<OrderOverdueRespVO> page);
/**
* 订单数量统计
@@ -35,6 +35,15 @@ public interface OrderComponentMapper extends BaseMapperX<OrderComponentDO> {
*/
List<OrderComponentDO> getTopComponentListIn(@Param("ids") List<Long> ids, boolean deleted);
/**
* 查询订单顶级部件,关联order_item,如果被移除了就不展示了
*
* @param orderIds
* @param name
* @return
*/
List<OrderComponentDO> getOrderTopComponentList(@Param("orderIds")List<Long> orderIds, @Param("name") String name);
/**
* 查询订单topid下的所有大于level层级的部件列表
* @param orderId
@@ -835,15 +835,15 @@ public class AssemblyListServiceImpl implements AssemblyListService {
return BeanUtil.copyToList(result, OrderComponentRespVO.class);
}
/**
* 整理状态对应的树数据
*
* @param reqVO
* @return
*/
private List<TopComponentState> buildTopComponentStates(OrdersTopComponentListReqVO reqVO) {
List<OrderComponentDO> topComponents = orderComponentMapper.selectList(
new LambdaQueryWrapperX<OrderComponentDO>()
.in(OrderComponentDO::getOrderId, reqVO.getOrderIds())
.eq(OrderComponentDO::getPid, OrderComponentDO.PARENT_ID_ROOT)
.likeIfPresent(OrderComponentDO::getName, reqVO.getName())
);
// 查询顶级部件
List<OrderComponentDO> topComponents = orderComponentMapper.getOrderTopComponentList(reqVO.getOrderIds(), reqVO.getName());
if (CollUtil.isEmpty(topComponents)) {
return Collections.emptyList();
@@ -904,6 +904,12 @@ public class AssemblyListServiceImpl implements AssemblyListService {
return result;
}
/**
* 解析树数据
*
* @param node
* @return
*/
private ProcessStats analyzeTree(OrderComponentTreeCompareVO node) {
ProcessStats stats = new ProcessStats();
@@ -941,6 +947,13 @@ public class AssemblyListServiceImpl implements AssemblyListService {
return stats;
}
/**
* 过滤规则,是否匹配状态
*
* @param state
* @param statusSet
* @return
*/
private boolean matchAnyStatus(TopComponentState state,
Set<OrderComponentProcessStatusEnum> statusSet) {
@@ -775,38 +775,11 @@ public class OrderServiceImpl implements OrderService {
@Override
public PageResult<OrderOverdueRespVO> getOrderOverdue(PageParam pageParam) {
Long organId = OrganContextHolder.getOrganId();
LocalDate todayDate = LocalDate.now();
PageDTO<OrderOverdueRespVO> page = new PageDTO<>(pageParam.getPageNo(), pageParam.getPageSize());
// 查询超时单
IPage<OrderOverdueRespVO> orderOverdueVOS = orderMapper.selectOrderOverdue(todayDate, organId, page);
List<OrderOverdueRespVO> records = orderOverdueVOS.getRecords();
long total = orderOverdueVOS.getTotal();
// 查询子单
if (CollUtil.isNotEmpty(records)) {
// 主单id列表
Long[] mainOrderIds = records.stream().map(OrderOverdueRespVO::getId).toArray(Long[]::new);
PageDTO<OrderOverdueRespVO> childPage = new PageDTO<>(pageParam.getPageNo(), PageParam.PAGE_SIZE_NONE);
IPage<OrderOverdueRespVO> childOrderOverdueVOS = orderMapper.selectOrderOverdue(todayDate, organId, childPage, mainOrderIds);
List<OrderOverdueRespVO> childList = childOrderOverdueVOS.getRecords();
if (CollUtil.isNotEmpty(childList)) {
// 按 parentId 分组
Map<Long, List<OrderOverdueRespVO>> childMap = childList.stream()
.collect(Collectors.groupingBy(OrderOverdueRespVO::getParentId));
// 回填 child
for (OrderOverdueRespVO order : records) {
order.setChild(childMap.getOrDefault(order.getId(), null));
}
}
return new PageResult<>(records, total);
}
return new PageResult<>(orderOverdueVOS.getRecords(), total);
IPage<OrderOverdueRespVO> orderOverdueVOS = orderMapper.selectOrderOverdue(todayDate, OrganContextHolder.getOrganId(), page);
return new PageResult<>(orderOverdueVOS.getRecords(), orderOverdueVOS.getTotal());
}
@Override
@@ -30,7 +30,6 @@ import com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPage
import com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO;
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
import com.cf.imes.module.executor.dal.dataobject.orderBody.OrderBodyDO;
import com.cf.imes.module.executor.dal.mysql.goods.GoodsMapper;
import com.cf.imes.module.executor.dal.mysql.order.OrderMapper;
import com.cf.imes.module.executor.dal.mysql.orderBody.OrderBodyMapper;
import com.cf.imes.module.executor.dal.mysql.orderItem.OrderItemMapper;
@@ -87,9 +86,6 @@ public class OrderComponentServiceImpl implements OrderComponentService {
@Resource
private PlateMapper plateMapper;
@Resource
private GoodsMapper goodsMapper;
@Resource
private OrderBodyMapper orderBodyMapper;
@@ -153,17 +153,6 @@
and o.deleted = 0
and o.status != 4
and #{today} >= DATE(o.delivery_date)
<choose>
<when test="orderIds != null and orderIds.length > 0">
AND parent_id IN
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
#{orderId}
</foreach>
</when>
<otherwise>
AND parent_id = 0
</otherwise>
</choose>
</select>
<select id="selectOrderCountProducePeriod" resultType="com.cf.imes.module.executor.controller.admin.order.vo.order.OrderCountProducePeriodRespVO">
@@ -33,6 +33,22 @@
and p.deleted = #{deleted}
</select>
<select id="getOrderTopComponentList" resultType="com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO">
select distinct oc.id, oc.name
from order_component oc
join order_item oi on oc.id = oi.comp_id
and oi.order_id = oc.order_id
and oi.organ_id = oc.organ_id
where oc.order_id in
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
#{orderId}
</foreach>
and oc.pid = 0
<if test="name != null and name != ''">
and oc.name like CONCAT('%', #{name}, '%')
</if>
</select>
<select id="getComponentListOnTopLevel"
resultType="com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO">
select * from order_component oc
@@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@@ -40,6 +41,7 @@ public class AssemblyConfigController {
@PostMapping("/order/import")
@Operation(summary = "导入装配顺序")
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:import')")
public CommonResult<Boolean> importAssemblyConfigFromOrders(@RequestBody @Valid AssemblyConfigImportReqVO reqVO) {
assemblyConfigService.importAssemblyConfigFromOrders(reqVO);
return CommonResult.success(true);
@@ -47,6 +49,7 @@ public class AssemblyConfigController {
@GetMapping("/list")
@Operation(summary = "查询组织装配设置列表")
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:query')")
public CommonResult<List<AssemblyConfigListRespVO>> getAssemblyConfigList() {
return CommonResult.success(assemblyConfigService.getOrgAssemblyConfigList());
}
@@ -54,6 +57,7 @@ public class AssemblyConfigController {
@GetMapping("/{configId}")
@Operation(summary = "查询装配设置")
@Parameter(name = "configId", description = "装配设置编号", required = true)
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:query')")
public CommonResult<AssemblyConfigRespVO> getAssemblyConfig(@PathVariable Long configId) {
return CommonResult.success(assemblyConfigService.getAssemblyConfig(configId));
}
@@ -61,6 +65,7 @@ public class AssemblyConfigController {
@PostMapping("/{configId}")
@Operation(summary = "待选部件转加工部件")
@Parameter(name = "configId", description = "装配设置编号", required = true)
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:save')")
public CommonResult<Boolean> doConfig(@PathVariable Long configId) {
assemblyConfigService.doConfig(configId);
return CommonResult.success(true);
@@ -69,6 +74,7 @@ public class AssemblyConfigController {
@PostMapping("/new/{configId}")
@Operation(summary = "新增加工部件")
@Parameter(name = "configId", description = "装配设置编号", required = true)
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:save')")
public CommonResult<Boolean> newConfig(@PathVariable Long configId) {
assemblyConfigService.newConfig(configId);
return CommonResult.success(true);
@@ -77,6 +83,7 @@ public class AssemblyConfigController {
@DeleteMapping("/{configId}")
@Operation(summary = "删除已配置的加工部件,恢复到待选")
@Parameter(name = "configId", description = "装配设置编号", required = true)
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:delete')")
public CommonResult<Boolean> removeConfigured(@PathVariable Long configId) {
assemblyConfigService.delete(configId);
return CommonResult.success(true);
@@ -84,6 +91,7 @@ public class AssemblyConfigController {
@PostMapping("/save")
@Operation(summary = "保存装配设置")
@PreAuthorize("@ss.hasPermission('systemconfig:assemblyconfig:save')")
public CommonResult<Boolean> saveAssemblyConfig(@RequestBody AssemblyConfigSaveReqVO reqVO) {
assemblyConfigService.saveConfig(reqVO);
return CommonResult.success(true);