From f119894e61a56d584c140b40baa6a4420dc8e8d6 Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期一, 15 一月 2024 20:21:21 +0800 Subject: [PATCH] 上传配方 --- jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java index 44858ae..f74c05a 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java @@ -1,10 +1,15 @@ package com.jcdm.main.om.productionOrde.controller; +import java.util.Date; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; +import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; import com.jcdm.main.webservice.service.ReceivingServices; +import org.apache.commons.lang3.StringUtils; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -22,6 +27,8 @@ import com.jcdm.common.utils.poi.ExcelUtil; import com.jcdm.common.core.page.TableDataInfo; +import static org.apache.commons.lang3.SystemUtils.getUserName; + /** * 鐢熶骇宸ュ崟Controller * @@ -34,6 +41,9 @@ { @Autowired private IOmProductionOrdeInfoService omProductionOrdeInfoService; + + @Autowired + private IBsOrderSchedulingService bsOrderSchedulingService; /** * 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 @@ -82,6 +92,32 @@ } /** + * 鏂板鐢熶骇宸ュ崟 + */ + @PostMapping("/orderSchedulingForBoxCode") + public AjaxResult addOrderSchedulingForBoxCode(@RequestBody OmProductionOrdeInfo omProductionOrdeInfo) + { + Integer startCode = Integer.parseInt(omProductionOrdeInfo.getStartCode());//寮�濮嬬紪鍙� + Integer planQty = Math.toIntExact(omProductionOrdeInfo.getPlanQty());//璁″垝鏁伴噺 + String dateTimeRule = omProductionOrdeInfo.getDateTimeRule(); + + for(int i=0;i<planQty;i++){ + BsOrderScheduling bsOrderScheduling = new BsOrderScheduling(); + bsOrderScheduling.setOrderNo(omProductionOrdeInfo.getWorkOrderNo()); + bsOrderScheduling.setModel(omProductionOrdeInfo.getTypeZ()); + bsOrderScheduling.setEngineNo(omProductionOrdeInfo.getTypeZ() + " "+dateTimeRule+ StringUtils.leftPad(String.valueOf(startCode),3, "0")); + bsOrderScheduling.setProductionStatus("1"); + bsOrderScheduling.setOperator(getUserName()); +// bsOrderScheduling.setOperateTime(String.valueOf(new Date())); + bsOrderSchedulingService.insertBsOrderScheduling(bsOrderScheduling); + startCode ++; + } + + omProductionOrdeInfo.setOrderStatus("2");//鏇存柊宸ュ崟鐘舵�� + return toAjax(omProductionOrdeInfoService.updateOmProductionOrdeInfo(omProductionOrdeInfo)); + } + + /** * 淇敼鐢熶骇宸ュ崟 */ @PreAuthorize("@ss.hasPermi('om:productionOrde:edit')") -- Gitblit v1.9.3