From 34d830c3354098ded90e0d4e65509bf8e611056a Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Wed, 15 Mar 2023 16:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96-=E8=BF=94=E5=9B=9E=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E5=88=97=E8=A1=A8=203.15?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ZyProductPlanAutoController.java | 32 ++++++------------- .../service/IZyProductPlanAutoService.java | 4 ++- .../impl/IZyProductPlanAutoServiceImpl.java | 21 ++++++------ 3 files changed, 22 insertions(+), 35 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanAutoController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanAutoController.java index 092fa021..942d9ef3 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanAutoController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanAutoController.java @@ -1,36 +1,22 @@ package org.jeecg.modules.productplan.controller; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyProductPlan; -import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.productplan.service.IZyProductPlanAutoService; import org.jeecg.modules.productplan.service.IZyProductPlanService; -import org.jeecg.modules.system.entity.SysDepart; -import org.jeecg.modules.system.entity.SysUser; -import org.jeecg.modules.system.service.ISysDepartService; -import org.jeecg.modules.system.service.ISysUserService; -import org.jeecg.modules.workproduct.entity.ZyProduct; -import org.jeecg.modules.workproduct.service.IZyProductService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; import java.util.List; +import java.util.Map; /** * @Description: 生产计划自动化 @@ -50,15 +36,15 @@ public class ZyProductPlanAutoController extends JeecgController productPlanAuto4Mock(List workOrderIds) { - iZyProductPlanAutoService.doAuto(workOrderIds); - return Result.OK(); + List>> list = iZyProductPlanAutoService.doAuto(workOrderIds); + return Result.OK(list); } @ApiOperation(value = "生产计划自动化", notes = "生产计划自动化") @GetMapping(value = "/productPlanAuto") public Result productPlanAuto() { - iZyProductPlanAutoService.doAuto(null); - return Result.OK(); + List>> list = iZyProductPlanAutoService.doAuto(null); + return Result.OK(list); } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanAutoService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanAutoService.java index d8963946..ccf7f440 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanAutoService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanAutoService.java @@ -1,12 +1,14 @@ package org.jeecg.modules.productplan.service; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo; import org.jeecg.modules.workorder.entity.WorkOrder; import javax.servlet.http.HttpServletRequest; import java.util.List; +import java.util.Map; /** * @Description: 生产计划 @@ -16,7 +18,7 @@ import java.util.List; */ public interface IZyProductPlanAutoService extends IService { - void doAuto(List workOrderList); + List>> doAuto(List workOrderList); boolean filling4Auto(String planId); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java index a854b4f2..3d62fd3e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java @@ -13,13 +13,8 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcessAccessories; import org.jeecg.modules.productplan.entity.ZyPlanProcessFabric; import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.enums.ProductPlanStatusEnum; -import org.jeecg.modules.productplan.mapper.ZyPlanProcessAccessoriesMapper; -import org.jeecg.modules.productplan.mapper.ZyPlanProcessFabricMapper; import org.jeecg.modules.productplan.mapper.ZyProductPlanMapper; import org.jeecg.modules.productplan.service.*; -import org.jeecg.modules.productprocessaccessories.service.IProductProcessAccessoriesService; -import org.jeecg.modules.productprocessfabric.entity.ProductProcessFabric; -import org.jeecg.modules.productprocessfabric.service.IProductProcessFabricService; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.service.ISysDepartService; @@ -36,8 +31,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; -import javax.servlet.http.HttpServletRequest; -import java.time.LocalDateTime; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -259,7 +252,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl workOrderList4Mock) { + public List>> doAuto(List workOrderList4Mock) { //1,获取未排产工单 List workOrderList; @@ -274,12 +267,12 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl workOrderList = iWorkOrderService.list(new LambdaQueryWrapper() // .eq(WorkOrder::getWorkOrderStatus, WorkOrderStatusEnum.UNAUDITED.getCode())); - if (ObjectUtils.isEmpty(workOrderList)) return; + if (ObjectUtils.isEmpty(workOrderList)) return Collections.EMPTY_LIST; //2,保存生产计划 // List productPlanList = this.saveProductPlan(workOrderList); List productPlanList = this.saveProductPlan4Mock(workOrderList); - if (ObjectUtils.isEmpty(productPlanList)) return; + if (ObjectUtils.isEmpty(productPlanList)) return Collections.EMPTY_LIST; //3,同步计划生产工序、同步生产计划工序面料、同步生产计划辅料 productPlanList.stream().forEach(f -> { @@ -291,6 +284,7 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl>> returnList = new LinkedList<>(); productPlanList.stream().forEach(k -> { //TODO 数据不完整,测试时注释 // boolean b = this.filling4Auto(k.getId()); @@ -304,14 +298,19 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl> map = new HashMap<>(); + map.put(k.getProductCode(), planProcessList); + //测试需要返回生产计划工序 + returnList.add(map); }); + return returnList; } /** * 匹配设备&工具&工人 *

* 匹配车间工位设备与工序设备,工位设备包含工序设备即匹配成功,匹配失败做异常处理 - * 匹配车间工位工具与工序设备,工位设备包含工序设备即匹配成功,匹配失败做异常处理 + * 匹配车间工位工具与工序工具,工位设备包含工序设备即匹配成功,匹配失败做异常处理 * * @param planId */