oyq28 hai 1 ano
pai
achega
0e9b99f4ea

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/centralToolMagazine/service/ToolStorgeService.java

@@ -73,4 +73,6 @@ public interface ToolStorgeService extends SuperCacheService<ToolStorge> {
 
 
     void setValidTray(Map map);
+
+    R<String> updateStrogeTool(ToolStorgeUpdateDTO model);
 }

+ 18 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/centralToolMagazine/service/impl/ToolStorgeServiceImpl.java

@@ -13,6 +13,7 @@ import com.github.zuihou.business.centralToolMagazine.dto.ToolStorgeSaveDTO;
 import com.github.zuihou.business.centralToolMagazine.dto.ToolStorgeUpdateDTO;
 import com.github.zuihou.business.centralToolMagazine.entity.ToolStorge;
 import com.github.zuihou.business.centralToolMagazine.service.ToolStorgeService;
+import com.github.zuihou.business.classSchedule.entity.ScheduleUserChange;
 import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
 import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
 import com.github.zuihou.business.edgeLibrary.entity.Storge;
@@ -21,7 +22,9 @@ import com.github.zuihou.business.operationManagementCenter.entity.TTask;
 import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
 import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureTrayMapper;
+import com.github.zuihou.business.productionReadyCenter.dao.CuttingToolMapper;
 import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureTray;
+import com.github.zuihou.business.productionReadyCenter.entity.CuttingTool;
 import com.github.zuihou.business.productionReadyCenter.entity.Plate;
 import com.github.zuihou.business.productionReadyCenter.entity.Tray;
 import com.github.zuihou.business.productionReadyCenter.service.PlateService;
@@ -77,6 +80,9 @@ import static java.util.stream.Collectors.toList;
 
 public class ToolStorgeServiceImpl extends SuperCacheServiceImpl<ToolStorgeMapper, ToolStorge> implements ToolStorgeService {
 
+    @Autowired
+    private CuttingToolMapper cuttingToolMapper;
+
     @Override
     protected String getRegion() {
         return TENANT;
@@ -132,6 +138,18 @@ public class ToolStorgeServiceImpl extends SuperCacheServiceImpl<ToolStorgeMappe
 
     }
 
+    @Override
+    public R<String> updateStrogeTool(ToolStorgeUpdateDTO model) {
+        CuttingTool cuttingTool = cuttingToolMapper.selectOne(Wraps.<CuttingTool>lbQ().eq(CuttingTool::getCutterCode, model.getCutterCode()));
+        if(Objects.isNull(cuttingTool)){
+            return R.fail("刀具不存在");
+        }
+        LambdaUpdateWrapper<ToolStorge> lambdaUpdateWrapper = new LambdaUpdateWrapper<ToolStorge>();
+        lambdaUpdateWrapper.set(ToolStorge::getToolId, cuttingTool.getId()).eq(ToolStorge::getId, model.getId());
+        baseMapper.update(null,  lambdaUpdateWrapper);
+        return R.success("ok");
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public ToolStorge update(ToolStorgeUpdateDTO data) {

+ 1 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/centralToolMagazine/ToolManagementController.java

@@ -116,7 +116,7 @@ public class ToolManagementController extends SuperCacheController<ToolManagemen
     public R getRule() {
         Object obj = redisTemplate.opsForValue().get("CHANGE_TOOL_CONFIG");
         if(obj == null){
-            return fail("");
+            return success();
         }
         return success(obj.toString());
     }

+ 6 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/centralToolMagazine/ToolStorgeController.java

@@ -103,4 +103,10 @@ public class ToolStorgeController extends SuperCacheController<ToolStorgeService
         return success();
     }
 
+    @ApiOperation(value = "修改库位", notes = "修改库位")
+    @PostMapping("/updateStrogeTool")
+    public R<String> updateStrogeTool(@RequestBody ToolStorgeUpdateDTO model) {
+        return baseService.updateStrogeTool(model);
+    }
+
 }

+ 2 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/centralToolMagazine/dto/ToolStorgeUpdateDTO.java

@@ -89,4 +89,6 @@ public class ToolStorgeUpdateDTO implements Serializable {
     @ApiModelProperty(value = "刀具ID")
     private Long toolId;
 
+    private String cutterCode;
+
 }