diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java index ae4fdb073..11442d52e 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/controller/admin/manage/pack/PackController.java @@ -10,6 +10,7 @@ import com.cf.imes.module.executor.controller.admin.manage.pack.vo.OrderPackResp import com.cf.imes.module.executor.controller.admin.manage.pack.vo.OrderPartsReqVO; import com.cf.imes.module.executor.controller.admin.manage.pack.vo.OrderPartsRespVO; import com.cf.imes.module.executor.controller.admin.manage.pack.vo.OtherPackReqVO; +import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackDetailsReqVO; import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackPageReqVO; import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackReqVO; import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackRespVO; @@ -19,7 +20,9 @@ import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PlateDetailsR import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PrintOrderPackReqVO; import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PrintOrderPackRespVO; import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.OrderPackageVO; +import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO; import com.cf.imes.module.executor.service.manage.pack.PackService; +import com.cf.imes.module.executor.service.manage.query.ProductionStatusService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -51,8 +54,8 @@ public class PackController { @Resource private PackService packService; - - + @Resource + private ProductionStatusService productionStatusService; @GetMapping("/page") @Operation(summary = "打包分页查询") @@ -95,6 +98,15 @@ public class PackController { } + @GetMapping("/queryPackageDetails") + @Operation(summary = "查询包裹的详细信息") + @PreAuthorize("@ss.hasAnyPermissions('manage:pack:pack-details','manage:pack:query')") + public CommonResult> queryPackageDetails(@Valid PackDetailsReqVO reqVO){ + + return CommonResult.success(productionStatusService.queryPackageDetails(reqVO)); + + } + @GetMapping("/getPageOrderPack") @Operation(summary = "查看生产订单对应的包裹信息-分页") diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java index 2f601d747..bcb209d33 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/dal/mysql/plate/PlateMapper.java @@ -316,4 +316,6 @@ public interface PlateMapper extends BaseMapperX { List selectOrderNoPackPlateList(@Param("orderId") Long orderId, @Param("organId") Long organId); List selectOrderPlateList(@Param("orderIds") List orderIds, @Param("organId") Long organId); + + IPage selectPackPlateList(@Param("page") IPage page, @Param("packageId") Long packageId, @Param("organId") Long organId); } \ No newline at end of file diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/query/ProductionStatusService.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/query/ProductionStatusService.java new file mode 100644 index 000000000..519d39122 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/query/ProductionStatusService.java @@ -0,0 +1,12 @@ +package com.cf.imes.module.executor.service.manage.query; + + +import com.cf.imes.framework.common.pojo.PageResult; +import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackDetailsReqVO; +import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO; + +public interface ProductionStatusService { + + // 查看包裹详情 + PageResult queryPackageDetails(PackDetailsReqVO reqVO); +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/query/ProductionStatusServiceImpl.java b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/query/ProductionStatusServiceImpl.java new file mode 100644 index 000000000..edab099d7 --- /dev/null +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/java/com/cf/imes/module/executor/service/manage/query/ProductionStatusServiceImpl.java @@ -0,0 +1,76 @@ +package com.cf.imes.module.executor.service.manage.query; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; +import com.cf.imes.framework.common.enums.OrderPackageTypeEnum; +import com.cf.imes.framework.common.pojo.PageResult; +import com.cf.imes.module.executor.controller.admin.manage.pack.vo.GroupNameList; +import com.cf.imes.module.executor.controller.admin.manage.pack.vo.PackDetailsReqVO; +import com.cf.imes.module.executor.controller.admin.manage.query.vo.pack.PackageDetailsRespVO; +import com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper; +import com.cf.imes.module.executor.dal.mysql.plate.PlateMapper; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId; + + +@Service +@Validated +public class ProductionStatusServiceImpl implements ProductionStatusService { + @Resource + private OrderPartsMapper orderPartsMapper; + + @Resource + private PlateMapper orderPlateMapper; + + // 查看包裹详情 + @Override + public PageResult queryPackageDetails(PackDetailsReqVO reqVO) { + + PageDTO page = new PageDTO<>(reqVO.getPageNo(), reqVO.getPageSize()); + + // 查看配件包裹 + if(reqVO.getType().equals(OrderPackageTypeEnum.PARTS.getType()) || reqVO.getType().equals(OrderPackageTypeEnum.OTHER_ACCESSORIES.getType())){ + + + // 查看配件包裹 + IPage packageDetailsRespVOS = orderPartsMapper.selectParts(page,reqVO.getPackageId(),getUserOrganId()); + if (CollUtil.isEmpty(packageDetailsRespVOS.getRecords())) { + return new PageResult<>(); + } + + return new PageResult<>(packageDetailsRespVOS.getRecords(), packageDetailsRespVOS.getTotal()); + + } + + + // 查看板材包裹 + IPage packageDetailsRespVOS = orderPlateMapper.selectPackPlateList(page,reqVO.getPackageId(),getUserOrganId()); + + if (CollUtil.isEmpty(packageDetailsRespVOS.getRecords())) { + return new PageResult<>(); + } + + for (PackageDetailsRespVO plateDetailsRespVO : packageDetailsRespVOS.getRecords()) { + String name = ""; + + if(!plateDetailsRespVO.getProcessGroupNameList().isEmpty()) { + for (GroupNameList groupNameList : plateDetailsRespVO.getProcessGroupNameList()) { + // 去除最后的逗号 + name += groupNameList.getName() + ","; + } + name = name.substring(0, name.length() - 1); + } + + plateDetailsRespVO.setProcessGroup(name); + } + + + return new PageResult<>(packageDetailsRespVOS.getRecords(), packageDetailsRespVOS.getTotal()); + + } +} diff --git a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml index 0d2edb38e..097c02945 100644 --- a/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml +++ b/cf-module-prod-executor/cf-module-prod-executor-biz/src/main/resources/mapper/plate/PlateMapper.xml @@ -984,6 +984,44 @@ #{orderIds} + + +