diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/ToolController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/ToolController.java index f339eb78..a166b2e8 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/ToolController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/ToolController.java @@ -2,6 +2,7 @@ package com.foreverwin.mesnac.common.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.model.Tool; import com.foreverwin.mesnac.common.service.ToolService; import com.foreverwin.modular.core.util.CommonMethods; @@ -53,6 +54,24 @@ public class ToolController { return R.ok(result); } + /** + * 查询所有数据,状态为Y的刀具 + * + * @return + */ + @ResponseBody + @GetMapping("/getToolListByStatus") + public R getToolListByStatus(Tool tool){ + String site = CommonMethods.getSite(); + tool.setSite(site); + tool.setStatus(Constants.TOOL_STATUS_Y); + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(tool); + result = toolService.list(queryWrapper); + return R.ok(result); + } + /** * 分页查询数据 * diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java index 75ba2844..38c71ce0 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/InspectionTaskServiceImpl.java @@ -85,8 +85,9 @@ public class InspectionTaskServiceImpl extends ServiceImpl @@ -65,7 +68,8 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl0){ + if (prodReadyTaskDetailList.size() > 0) { long count = prodReadyTaskDetailList.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P01)).count(); - if (count>0){ + if (count > 0) { continue; } } @@ -164,9 +168,9 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl0){ + if (prodReadyTaskDetailList.size() > 0) { long count = prodReadyTaskDetailList.stream().filter(prodReadyTaskDetail -> prodReadyTaskDetail.getInspectionItem().equals(P02)).count(); - if (count>0){ + if (count > 0) { continue; } } @@ -268,7 +272,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl> getInspectionDetailList(Map param) { String type = param.get("type"); String dispatchNo = param.get("dispatchNo"); - List> returnMap = null; + List> returnMap = new ArrayList<>(); String site = CommonMethods.getSite(); if (type.equals(P01)) { //物料接收数据 @@ -278,6 +282,18 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl map=new HashMap<>(); + map.put("RESOURCE",sfcdispatch.getResrce()); + map.put("RESOURCE_TYPE",sfcdispatch.getResourceType()); + map.put("RESULT",jsonObject.get("RESULT")); + map.put("MESSAGE",jsonObject.get("MESSAGE")); + returnMap.add(map); } return returnMap; } @@ -289,7 +305,7 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl prodReadyTaskDetailList = prodReadyTask.getProdReadyTaskDetailList(); @@ -314,70 +330,70 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl printList=new ArrayList<>(); + List printList = new ArrayList<>(); List labelPrintDtoList = new ArrayList<>(); String printData = null; - PrintLog printTag=new PrintLog(); + PrintLog printTag = new PrintLog(); String resrce = sfcDispatchDto.getResrce(); String printName = customFieldsService.getCustomFieldsValue(HandleEnum.RESOURCE.getHandle(site, resrce), CustomFieldConstant.RESRCE_CUSTOM_FIELD_PRINT_NAME); - if (StringUtil.isBlank(printName)){ + if (StringUtil.isBlank(printName)) { throw new BaseException("资源维护的打印机不能为空"); } String item = prodReadyTask.getItem(); Item selectCurrent = itemService.selectCurrent(site, item); - QueryWrapper queryWrapper=new QueryWrapper(); - queryWrapper.eq(PrintLog.SFC,prodReadyTask.getSfc()); - queryWrapper.eq(PrintLog.STEP_ID,prodReadyTask.getStepId()); - queryWrapper.eq(PrintLog.RESRCE,prodReadyTask.getResrce()); - queryWrapper.eq(PrintLog.CATEGORY,Constants.PRINT_TYPE_SFC); - queryWrapper.eq(PrintLog.CATEGORY,Constants.PRINT_TYPE_SFC); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq(PrintLog.SFC, prodReadyTask.getSfc()); + queryWrapper.eq(PrintLog.STEP_ID, prodReadyTask.getStepId()); + queryWrapper.eq(PrintLog.RESRCE, prodReadyTask.getResrce()); + queryWrapper.eq(PrintLog.CATEGORY, Constants.PRINT_TYPE_SFC); + queryWrapper.eq(PrintLog.CATEGORY, Constants.PRINT_TYPE_SFC); List printLogList = printLogService.list(queryWrapper); - if (printLogList.isEmpty()){ - //打印参数 - LabelPrintDto labelPrintDto = new LabelPrintDto(); - labelPrintDto.setPrinter(printName); - labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_SFC); - labelPrintDto.setItem(sfcDispatchDto.getItem()); - labelPrintDto.setItemDescription(selectCurrent.getDescription()); - labelPrintDto.setSfc(prodReadyTask.getSfc()); - Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, prodReadyTask.getSfc())); - String drawingRevision = customFieldsService.getCustomFieldsValue(sfcServiceById.getItemBo(), CustomFieldConstant.ITEM_DRAWING_REVISION); - labelPrintDto.setDrawingVersion(drawingRevision); - labelPrintDto.setQty(new BigDecimal(sfcServiceById.getQty())); - String workOrder = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), "WORK_ORDER"); - labelPrintDto.setWorkOrder(workOrder); - labelPrintDto.setBlankingSize(sfcDispatchDto.getBlankingSize()); - labelPrintDto.setOperation(sfcDispatchDto.getOperation()); - labelPrintDtoList.add(labelPrintDto); - printData = JSON.toJSONString(labelPrintDtoList); - //打印记录 - printTag.setHandle(UUID.randomUUID().toString()); - printTag.setPrintName(printName); - printTag.setPrintTemplate(Constants.PRINT_TYPE_SFC); - printTag.setSite(site); - printTag.setCategory(Constants.PRINT_TYPE_SFC); - printTag.setPrintParam(JSON.toJSONString(labelPrintDtoList)); - printTag.setSfc(prodReadyTask.getSfc()); - printTag.setResrce(prodReadyTask.getResrce()); - printTag.setStepId(prodReadyTask.getStepId()); - printTag.setOperation(prodReadyTask.getOperation()); - printTag.setItemBo(selectCurrent.getHandle()); - printTag.setIsPrint("false"); - printTag.setPrintNum(0); - printTag.setItem(item); - printTag.setItemDescription(selectCurrent.getDescription()); + if (printLogList.isEmpty()) { + //打印参数 + LabelPrintDto labelPrintDto = new LabelPrintDto(); + labelPrintDto.setPrinter(printName); + labelPrintDto.setPrintTemplate(Constants.PRINT_TYPE_SFC); + labelPrintDto.setItem(sfcDispatchDto.getItem()); + labelPrintDto.setItemDescription(selectCurrent.getDescription()); + labelPrintDto.setSfc(prodReadyTask.getSfc()); + Sfc sfcServiceById = sfcService.getById(HandleEnum.SFC.getHandle(site, prodReadyTask.getSfc())); + String drawingRevision = customFieldsService.getCustomFieldsValue(sfcServiceById.getItemBo(), CustomFieldConstant.ITEM_DRAWING_REVISION); + labelPrintDto.setDrawingVersion(drawingRevision); + labelPrintDto.setQty(new BigDecimal(sfcServiceById.getQty())); + String workOrder = customFieldsService.getCustomFieldsValue(sfcServiceById.getShopOrderBo(), "WORK_ORDER"); + labelPrintDto.setWorkOrder(workOrder); + labelPrintDto.setBlankingSize(sfcDispatchDto.getBlankingSize()); + labelPrintDto.setOperation(sfcDispatchDto.getOperation()); + labelPrintDtoList.add(labelPrintDto); + printData = JSON.toJSONString(labelPrintDtoList); + //打印记录 + printTag.setHandle(UUID.randomUUID().toString()); + printTag.setPrintName(printName); + printTag.setPrintTemplate(Constants.PRINT_TYPE_SFC); + printTag.setSite(site); + printTag.setCategory(Constants.PRINT_TYPE_SFC); + printTag.setPrintParam(JSON.toJSONString(labelPrintDtoList)); + printTag.setSfc(prodReadyTask.getSfc()); + printTag.setResrce(prodReadyTask.getResrce()); + printTag.setStepId(prodReadyTask.getStepId()); + printTag.setOperation(prodReadyTask.getOperation()); + printTag.setItemBo(selectCurrent.getHandle()); + printTag.setIsPrint("false"); + printTag.setPrintNum(0); + printTag.setItem(item); + printTag.setItemDescription(selectCurrent.getDescription()); - printList.add(printTag); - printLogService.savePrintLog(site,user,printTag); + printList.add(printTag); + printLogService.savePrintLog(site, user, printTag); - }else { + } else { printData = printLogList.get(0).getPrintParam(); } - String post = HttpUtil.post(printServer,printData , 30000); + String post = HttpUtil.post(printServer, printData, 30000); /** * {"msg":"打印成功","code":0} * {"msg":"打印失败","code":500} @@ -385,20 +401,20 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl { */ @TableField("MODIFIED_DATE_TIME") private LocalDateTime modifiedDateTime; - + /** + * 检验项目清单 + */ @TableField(exist = false) private List taskItemDetailList; - + /** + * 耗用备品清单 + */ @TableField(exist = false) private List spareList; - + /** + * 设备handle + */ @TableField(exist = false) private String ResourceBo; + /** + * 设备描述 + */ + @TableField(exist = false) + private String resourceDescription; + + public String getResourceDescription() { + return resourceDescription; + } + + public void setResourceDescription(String resourceDescription) { + this.resourceDescription = resourceDescription; + } public String getResourceBo() { return ResourceBo; diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java index 044fa81d..51e7db00 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/ResourceInspectTaskService.java @@ -55,4 +55,12 @@ public interface ResourceInspectTaskService extends IService taskItemDetailList = resourceInspectTaskDto.getTaskItemDetailList(); @@ -223,6 +223,30 @@ public class ResourceInspectTaskServiceImpl extends ServiceImpl resourceInspectTaskList = resourceInspectTaskMapper.findResourceInspectTaskList(resourceInspectTaskDto); + if (resourceInspectTaskList.size() == 1){ + ResourceInspectTask resourceInspectTask = new ResourceInspectTask(); + resourceInspectTask.setHandle(resourceInspectTaskList.get(0).getHandle()); + ResourceInspectTask resourceInspectTaskAll = resourceInspectTaskService.getResourceInspectTaskAll(resourceInspectTask); + resourceInspectTaskAll.setResourceDescription(resourceInspectTaskList.get(0).getResourceDescription()); + return resourceInspectTaskAll; + } + // 获取任务详情 + if (resourceInspectTaskList.size() > 1){ + throw BusinessException.build("当前设备当日点检任务不止一个!"); + } + throw BusinessException.build("未找到当日的点检任务!"); + } + /*** * 任务创建周期 */ diff --git a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml index ef13d9b1..8543588c 100644 --- a/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml +++ b/equip/src/main/resources/mapper/ResourceInspectTaskMapper.xml @@ -706,6 +706,7 @@ AND ZRIT.STATUS = #{status} +