From 3173a234be56b1581081a17056cd86a04d319f8b Mon Sep 17 00:00:00 2001 From: zpl Date: Tue, 3 Aug 2021 11:04:03 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/constant/Constants.java | 6 ++++++ .../common/controller/ToolController.java | 2 +- .../common/service/impl/ToolServiceImpl.java | 5 ++++- .../impl/ResourceRepairTaskServiceImpl.java | 17 ++++++++++------- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java index 4e31ad21..31e2ec81 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/constant/Constants.java @@ -161,5 +161,11 @@ public interface Constants { // 在制品标签 String PRINT_TYPE_SFC = "SFC"; + /** + * 刀具状态,Y-使用,N-报废/删除 + */ + String TOOL_STATUS_Y = "Y"; + String TOOL_STATUS_N = "N"; + } 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 e6166cce..ca5a858a 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 @@ -150,7 +150,7 @@ public class ToolController { try{ return R.ok(toolService.getOneToolByToolNo(tool)); }catch (Exception e){ - return R.failed("数据保存失败" + e.getMessage()); + return R.failed("数据查询失败" + e.getMessage()); } } diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ToolServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ToolServiceImpl.java index e1e77be6..eecaf520 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ToolServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ToolServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.foreverwin.mesnac.common.constant.Constants; import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.mapper.ToolMapper; import com.foreverwin.mesnac.common.model.Tool; @@ -59,12 +60,14 @@ public class ToolServiceImpl extends ServiceImpl implements To tool.setHandle(handle); Tool byId = toolMapper.selectById(handle); if (byId != null){ + tool.setStatus(Constants.TOOL_STATUS_Y); tool.setCreateUser(byId.getCreateUser()); tool.setCreatedDateTime(byId.getCreatedDateTime()); tool.setModifyUser(user); tool.setModifiedDateTime(LocalDateTime.now()); toolMapper.updateById(tool); - }else{ + } else{ + tool.setStatus(Constants.TOOL_STATUS_Y); tool.setCreateUser(user); tool.setCreatedDateTime(LocalDateTime.now()); toolMapper.insert(tool); diff --git a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java index 0eed958a..7cb7608f 100644 --- a/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java +++ b/equip/src/main/java/com/foreverwin/mesnac/equip/service/impl/ResourceRepairTaskServiceImpl.java @@ -86,7 +86,16 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl collection = new ArrayList<>(); for (int i = 0; i < ncSplit.length; i++) { collection.add(HandleEnum.NC_CODE.getHandle(site,ncSplit[i])); @@ -95,12 +104,6 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl nextNumber = nextNumberHelper.getNextNumber(site, Constants.RESOURCE_REPAIR_TASK, 1); resourceRepairTask.setRepairNo(nextNumber.get(0));