diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index 8e43d45..1240eb6 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java @@ -310,25 +310,24 @@ public class BaseKnifeController extends BaseController { } - @PostMapping("/open/productionArrangements/{planSheet}") + @PostMapping("/open/productionArrangements") @ResponseBody @Transactional - public AjaxResult productionArrangements(@PathVariable String planSheet, @RequestBody List processCodeList) { - + public AjaxResult productionArrangements(@RequestBody ProductionArrangements productionArrangements) { // 检查计划单是否已存在 BaseKnife baseKnifePlan = new BaseKnife(); - baseKnifePlan.setPlanSheet(planSheet); + baseKnifePlan.setPlanSheet(productionArrangements.getPlanSheet()); if (!baseKnifeService.selectBaseKnifeList(baseKnifePlan).isEmpty()) return AjaxResult.error("该计划单已存在,请更换重试"); // 齐套性检查 - AjaxResult ajaxResult = this.checkForAlignment(processCodeList); + AjaxResult ajaxResult = this.checkForAlignment(productionArrangements.getProcessCodeList()); if (Integer.parseInt(String.valueOf(ajaxResult.get("code"))) != 200) { return AjaxResult.error(ajaxResult.get("msg").toString(), ajaxResult.get("data")); } // 验证bom工艺 - List technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(processCodeList); + List technologyBomList = baseTechnologyBomService.selectBaseTechnologyBomListByProcessCodeList(productionArrangements.getProcessCodeList()); if (technologyBomList.isEmpty() || technologyBomList.size() == 1 && technologyBomList.get(0).getKnifeCode() == null) return AjaxResult.error("未检测到工艺bom项"); @@ -337,8 +336,9 @@ public class BaseKnifeController extends BaseController { // 参数列表 Map params = new HashMap<>(); - params.put("planCode", planSheet); - params.put("processCodeList", processCodeList); + params.put("planCode", productionArrangements.getPlanSheet()); + params.put("processCodeList", productionArrangements.getProcessCodeList()); + params.put("processUnit", productionArrangements.getProcessUnit()); // 构建日志 SysOperLog operLog = new SysOperLog(); @@ -453,7 +453,7 @@ public class BaseKnifeController extends BaseController { countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); // 记录源数据然后锁定 baseKnifeOriginList.add(item); - item.setPlanSheet(planSheet); + item.setPlanSheet(productionArrangements.getPlanSheet()); item.setIsLocked(1); item.setLockedStartTime(techBom.getLockedStartTime()); item.setLockedEndTime(techBom.getLockedEndTime()); @@ -561,7 +561,7 @@ public class BaseKnifeController extends BaseController { // 生成组装任务 WmsZdTask wmsZdTask = new WmsZdTask(); wmsZdTask.setmProductId(mdItem.getItemId()); - wmsZdTask.setPlanSheet(planSheet); + wmsZdTask.setPlanSheet(productionArrangements.getPlanSheet()); wmsZdTask.setCode(generateTaskCode(techBom.getProcessCode())); wmsZdTask.setName(techBom.getProcessName()); wmsZdTask.setProductIdQty(count); @@ -579,16 +579,16 @@ public class BaseKnifeController extends BaseController { } // 添加生产准备记录 - ProductionArrangements productionArrangements = new ProductionArrangements(); - productionArrangements.setPlanSheet(planSheet); - productionArrangements.setProcessCode(processCodeList.toString()); + productionArrangements.setProcessCode(productionArrangements.getProcessCodeList().toString()); + productionArrangements.setProcessUnit(productionArrangements.getProcessUnit()); productionArrangements.setStatus(0); + productionArrangements.setCreateTime(DateUtils.getNowDate()); productionArrangementsMapper.insertProductionArrangements(productionArrangements); if (!msg.contains("缺少物料已生成组装任务!")){ // 生成出库计划单 WmsOutPlan outPlan = new WmsOutPlan(); - outPlan.setPlanCode(planSheet); + outPlan.setPlanCode(productionArrangements.getPlanSheet()); outPlan.setWmsBusinessTypeId(16L); outPlan.setPlanState("1"); outPlan.setPlanType("ZDCK"); diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java index e302a9b..30904dc 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/WmsOutTaskController.java @@ -6,8 +6,10 @@ import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.enums.BusinessType; import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.mes.md.domain.WmsOutPlan; import com.ktg.mes.md.domain.WmsOutTask; import com.ktg.mes.md.service.IWmsOutTaskService; +import com.ktg.mes.wm.domain.WmsInPlan; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -31,11 +33,10 @@ public class WmsOutTaskController extends BaseController { /** * 查询出库任务列表 */ - @GetMapping("/open/incompleteList") - public TableDataInfo openList(WmsOutTask wmsOutTask) { + @GetMapping("/open/incompleteList/{planSheet}") + public TableDataInfo openList(@PathVariable String planSheet) { startPage(); - wmsOutTask.setTaskState("0"); - List list = wmsOutTaskService.selectWmsOutTaskList(wmsOutTask); + List list = wmsOutTaskService.selectWmsOutTaskIncompleteList(planSheet); return getDataTable(list); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsOutPlanDetailEntity.java b/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsOutPlanDetailEntity.java index 0673036..8a48186 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsOutPlanDetailEntity.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/domain/WmsOutPlanDetailEntity.java @@ -111,6 +111,12 @@ public class WmsOutPlanDetailEntity extends BaseEntity { @Excel(name = "标准数量") private String standardQuantity; + /** + * 是否对刀 + */ + @Excel(name = "是否对刀") + private Integer isToolSetting; + public void setWmsOutPlanDetailEntityId(Long wmsOutPlanDetailEntityId) { this.wmsOutPlanDetailEntityId = wmsOutPlanDetailEntityId; } @@ -247,6 +253,14 @@ public class WmsOutPlanDetailEntity extends BaseEntity { return standardQuantity; } + public Integer getIsToolSetting() { + return isToolSetting; + } + + public void setIsToolSetting(Integer isToolSetting) { + this.isToolSetting = isToolSetting; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutTaskService.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutTaskService.java index 301ca95..5567b0c 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutTaskService.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/IWmsOutTaskService.java @@ -62,4 +62,6 @@ public interface IWmsOutTaskService { boolean runWmsOutTask(Long[] wmsOutTaskIds); boolean autoRunWmsOutTask(Long[] wmsOutTaskIds); + + List selectWmsOutTaskIncompleteList(String planSheet); } diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java index 09c58b8..ef71063 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/BaseKnifeServiceImpl.java @@ -110,6 +110,7 @@ public class BaseKnifeServiceImpl implements IBaseKnifeService { hashMap.put("wmStorageAreaCode", wmsOutPlanDetail.getWmStorageAreaCode()); // 库位编码 hashMap.put("wmStorageAreaName", wmsOutPlanDetail.getWmStorageAreaName()); // 库位名称 hashMap.put("detailStatus", wmsOutPlanDetail.getDetailState()); // 明细状态 + hashMap.put("isToolSetting", nowWmsOutPlanDetailEntity.getIsToolSetting()); // 明细状态 /* 实体 */ String outTime = null; if (nowWmsOutPlanDetailEntity.getCreateTime() != null) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java index 570e15f..9d2f34f 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/service/impl/WmsOutTaskServiceImpl.java @@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -207,4 +208,18 @@ public class WmsOutTaskServiceImpl implements IWmsOutTaskService { System.out.println("WCS下发任务 TODO"); return false; } + + @Override + public List selectWmsOutTaskIncompleteList(String planSheet) { + WmsOutPlan wmsOutPlan = wmsOutPlanMapper.selectWmsOutPlanByPlanCode(planSheet); + List wmsOutTaskList = new ArrayList<>(); + if (wmsOutPlan != null){ + WmsOutTask wmsOutTask = new WmsOutTask(); + wmsOutTask.setWmsOutPlanId(wmsOutPlan.getWmsOutPlanId()); + wmsOutTask.setTaskState("0"); + wmsOutTaskList = wmsOutTaskMapper.selectWmsOutTaskList(wmsOutTask); + } + + return wmsOutTaskList; + } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/ProductionArrangements.java b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/ProductionArrangements.java index f5db7ba..01ac8df 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/wm/domain/ProductionArrangements.java +++ b/ktg-mes/src/main/java/com/ktg/mes/wm/domain/ProductionArrangements.java @@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; import com.ktg.common.annotation.Excel; import com.ktg.common.core.domain.BaseEntity; +import java.util.List; + /** * 生产准备记录对象 PRODUCTION_ARRANGEMENTS * @@ -26,6 +28,12 @@ public class ProductionArrangements extends BaseEntity @Excel(name = "工序号") private String processCode; + @Excel(name = "工序号") + private List processCodeList; + + @Excel(name = "工序号") + private String processUnit; + /** 状态 */ @Excel(name = "状态") private Integer status; @@ -78,6 +86,22 @@ public class ProductionArrangements extends BaseEntity this.status = status; } + public String getProcessUnit() { + return processUnit; + } + + public void setProcessUnit(String processUnit) { + this.processUnit = processUnit; + } + + public List getProcessCodeList() { + return processCodeList; + } + + public void setProcessCodeList(List processCodeList) { + this.processCodeList = processCodeList; + } + public Integer getStatus() { return status; @@ -121,19 +145,17 @@ public class ProductionArrangements extends BaseEntity @Override public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("productionArrangementsId", getProductionArrangementsId()) - .append("planSheet", getPlanSheet()) - .append("processCode", getProcessCode()) - .append("status", getStatus()) - .append("attr1", getAttr1()) - .append("attr2", getAttr2()) - .append("attr3", getAttr3()) - .append("attr4", getAttr4()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + return "ProductionArrangements{" + + "productionArrangementsId='" + productionArrangementsId + '\'' + + ", planSheet='" + planSheet + '\'' + + ", processCode='" + processCode + '\'' + + ", processCodeList=" + processCodeList + + ", processUnit='" + processUnit + '\'' + + ", status=" + status + + ", attr1='" + attr1 + '\'' + + ", attr2='" + attr2 + '\'' + + ", attr3='" + attr3 + '\'' + + ", attr4='" + attr4 + '\'' + + '}'; } } diff --git a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanDetailEntityMapper.xml b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanDetailEntityMapper.xml index e99fdc4..9bd3a9a 100644 --- a/ktg-mes/src/main/resources/mapper/md/WmsOutPlanDetailEntityMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/WmsOutPlanDetailEntityMapper.xml @@ -27,6 +27,7 @@ + @@ -51,7 +52,8 @@ RESET_COUNT, KNIFE_UNIT, SAFE_STOCK, - STANDARD_QUANTITY + STANDARD_QUANTITY, + IS_TOOL_SETTING from WMS_OUT_PLAN_DETAIL_ENTITY @@ -78,6 +80,9 @@ and STANDARD_QUANTITY = #{standardQuantity} + and IS_TOOL_SETTING = + #{isToolSetting} + ORDER BY WMS_OUT_PLAN_DETAIL_ID DESC, CREATE_TIME DESC @@ -113,6 +118,7 @@ KNIFE_UNIT, SAFE_STOCK, STANDARD_QUANTITY, + IS_TOOL_SETTING, #{wmsOutPlanDetailId}, @@ -136,6 +142,7 @@ #{knifeUnit}, #{safeStock}, #{standardQuantity}, + #{isToolSetting}, @@ -163,6 +170,7 @@ KNIFE_UNIT = #{knifeUnit}, SAFE_STOCK = #{safeStock}, STANDARD_QUANTITY = #{standardQuantity}, + IS_TOOL_SETTING = #{isToolSetting}, where WMS_OUT_PLAN_DETAIL_ENTITY_ID = #{wmsOutPlanDetailEntityId} diff --git a/ktg-mes/src/main/resources/mapper/wm/ProductionArrangementsMapper.xml b/ktg-mes/src/main/resources/mapper/wm/ProductionArrangementsMapper.xml index 4631337..c75a7b6 100644 --- a/ktg-mes/src/main/resources/mapper/wm/ProductionArrangementsMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/ProductionArrangementsMapper.xml @@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PLAN_SHEET, PROCESS_CODE, STATUS, + PROCESS_UNIT, ATTR1, ATTR2, ATTR3, @@ -69,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{planSheet}, #{processCode}, #{status}, + #{processUnit}, #{attr1}, #{attr2}, #{attr3},