|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.github.zuihou.authority.dao.common.DictionaryMapper;
|
|
|
import com.github.zuihou.authority.service.auth.UserService;
|
|
|
import com.github.zuihou.base.R;
|
|
|
import com.github.zuihou.base.service.SuperCacheServiceImpl;
|
|
@@ -86,6 +87,9 @@ public class ToolManagementServiceImpl extends SuperCacheServiceImpl<ToolManagem
|
|
|
@Autowired
|
|
|
private ToolTaskMapper toolTaskMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DictionaryMapper dictionaryMapper;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
protected String getRegion() {
|
|
@@ -193,8 +197,8 @@ public class ToolManagementServiceImpl extends SuperCacheServiceImpl<ToolManagem
|
|
|
List<BomProcedure> bomProcedures = bomProcedureMapper.selectList(Wraps.<BomProcedure>lbQ()
|
|
|
.eq(BomProcedure::getBomId, bomId).eq(BomProcedure::getType,"设备序"));
|
|
|
|
|
|
- //产品所需所有刀具集合
|
|
|
- List<Long> toolId=new ArrayList<>();
|
|
|
+ //产品所需所有的类别集合
|
|
|
+ List<String> toolId=new ArrayList<>();
|
|
|
|
|
|
//所有可执行设备资源
|
|
|
List<BomProcedureProductionresource> resourceList=new ArrayList<>();
|
|
@@ -208,8 +212,8 @@ public class ToolManagementServiceImpl extends SuperCacheServiceImpl<ToolManagem
|
|
|
resourceList.addAll(resourcelist);
|
|
|
|
|
|
List<BBomProcedureTool> toolList = bomProcedureToolService.list(Wraps.<BBomProcedureTool>lbQ().eq(BBomProcedureTool::getProcedureId,vo.getId()));
|
|
|
- List<Long> toolIdList = toolList.stream()
|
|
|
- .map(BBomProcedureTool::getToolId)
|
|
|
+ List<String> toolIdList = toolList.stream()
|
|
|
+ .map(BBomProcedureTool::getCuttingToolCategory)
|
|
|
.collect(Collectors.toList());
|
|
|
toolId.addAll(toolIdList);
|
|
|
});
|
|
@@ -235,17 +239,17 @@ public class ToolManagementServiceImpl extends SuperCacheServiceImpl<ToolManagem
|
|
|
//Integer freeCount=0;
|
|
|
//if(!realToolId.containsAll(toolId)){
|
|
|
//需要的类别
|
|
|
- List<String> toolCategory = cuttingToolMapper.getToolCategory(toolId);
|
|
|
+ //List<String> toolCategory = cuttingToolMapper.getToolCategory(toolId);
|
|
|
|
|
|
//机床现有的类别
|
|
|
List<String> realToolCategory = cuttingToolMapper.getToolCategory(realToolId);
|
|
|
|
|
|
//比较 刀具类别 是否存在
|
|
|
- if(!realToolCategory.containsAll(toolCategory)){
|
|
|
- List<String> differenceCategory = toolCategory.stream()
|
|
|
+ if(!realToolCategory.containsAll(toolId)){
|
|
|
+ List<String> differenceCategory = toolId.stream()
|
|
|
.filter(id -> !realToolCategory.contains(id))
|
|
|
.collect(Collectors.toList());
|
|
|
-
|
|
|
+ List<String> dicName = dictionaryMapper.getDicName(toolId);
|
|
|
/*List<Long> differenceTool = toolId.stream()
|
|
|
.filter(id -> !realToolId.contains(id))
|
|
|
.collect(Collectors.toList());
|
|
@@ -261,7 +265,7 @@ public class ToolManagementServiceImpl extends SuperCacheServiceImpl<ToolManagem
|
|
|
toolCheckDTO.setIsFree(isFree);
|
|
|
toolCheckDTO.setHasCuttingToolsFlag(CollectionUtil.isEmpty(differenceCategory) ? "是" : "否" );
|
|
|
toolCheckDTO.setMsg(CollectionUtil.isNotEmpty(differenceCategory) ?
|
|
|
- "缺少:"+differenceCategory.stream().collect(Collectors.joining(","))+(isFree ? ",机床刀库空闲个数大于缺刀个数":""):"");
|
|
|
+ "缺少:"+dicName.stream().collect(Collectors.joining(","))+(isFree ? ",机床刀库空闲个数大于缺刀个数":""):"");
|
|
|
toolCheckDTO.setPlanId(item);
|
|
|
returnList.add(toolCheckDTO);
|
|
|
}
|