Explorar el Código

Merge remote-tracking branch 'origin/master'

lxb hace 1 año
padre
commit
cc41cc9ad2

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

@@ -52,4 +52,6 @@ public interface ToolStorgeMapper extends SuperMapper<ToolStorge> {
     List<ToolStorge> getStorge(Map<String,Object> params);
 
     List<ToolStorgePageDTO> getPointStorge();
+
+    List<ToolStorgePageDTO> getDeviceStorge(Long deviceId);
 }

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

@@ -85,4 +85,6 @@ public interface ToolStorgeService extends SuperCacheService<ToolStorge> {
     List<ToolStorgePageDTO> getPointStorge();
 
     R saveStorge(ToolCheckDTO list);
+
+    List<ToolStorgePageDTO> getDeviceStorge(Long deviceId);
 }

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

@@ -219,6 +219,11 @@ public class ToolStorgeServiceImpl extends SuperCacheServiceImpl<ToolStorgeMappe
         return R.success();
     }
 
+    @Override
+    public List<ToolStorgePageDTO> getDeviceStorge(Long deviceId) {
+        return baseMapper.getDeviceStorge(deviceId);
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R<ToolStorge> update(ToolStorgeUpdateDTO data) {

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/job/TaskExecuteJob.java

@@ -111,7 +111,7 @@ public class TaskExecuteJob {
     /**
      * 中央刀库任务调度
      */
-    @Scheduled(cron = "0/1 * * * * *")
+    //@Scheduled(cron = "0/1 * * * * *")
     void toolTaskExecuteJob() throws Exception {
         BaseContextHandler.setTenant("0000");
 

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/ToolTaskServiceImpl.java

@@ -79,7 +79,7 @@ public class ToolTaskServiceImpl extends SuperCacheServiceImpl<ToolTaskMapper, T
         List<ToolStorge> storgeId=new ArrayList<>();
         toolCheckDTO.getStorgeId().stream().forEach(vo->{
             Map<String,Object> params=new HashMap<>();
-            params.put("storgeId",vo);
+            params.put("storgeId",vo.getId());
             List<ToolStorge> toolStorge=toolStorgeMapper.getStorge(params);
             storgeId.addAll(toolStorge);
         });
@@ -87,7 +87,7 @@ public class ToolTaskServiceImpl extends SuperCacheServiceImpl<ToolTaskMapper, T
 
         applyChangeToolDto.setModel("1");
         applyChangeToolDto.setApplyChangeToolDetailDtoList(applyChangeToolDetailDtoList);
-        toolTaskNodeService.applyChangeTool(applyChangeToolDto);
+        //toolTaskNodeService.applyChangeTool(applyChangeToolDto);
 
     }
 

+ 21 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/centralToolMagezine/ToolStorgeMapper.xml

@@ -197,4 +197,25 @@
                  left join imcs_tool_management tm on ts.tool_management_id=tm.id
         where tm.tool_type="4"
     </select>
+
+    <select id="getDeviceStorge" parameterType="Long" resultType="com.github.zuihou.business.centralToolMagazine.dto.ToolStorgePageDTO">
+        SELECT
+            ts.id,
+            ts.`name`,
+            ts.`no`,
+            th.handle_name as handleName,
+            ct.cutting_tool_name as cuttingToolName,
+            ct.cutter_code as cutterCode,
+            ct.tool_life_span as toolLifeSpan,
+            ct.tool_rated_usage_count as toolRatedUsageCount,
+            ct.tool_used_count as toolUsedCount
+        FROM
+            imcs_tool_management tm
+                left join imcs_tool_storge ts on tm.id=ts.tool_management_id
+                left join imcs_tool_handle th on ts.tool_handle_id=th.id
+                left join imcs_cutting_tool ct on th.tool_id=ct.id
+        WHERE
+            tm.device_id = #{deviceId}
+          AND tm.tool_type = '1'
+    </select>
 </mapper>

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

@@ -121,4 +121,10 @@ public class ToolStorgeController extends SuperCacheController<ToolStorgeService
         return baseService.saveStorge(list);
     }
 
+
+    @ApiOperation(value = "查询设备库位", notes = "查询设备库位")
+    @PostMapping("/getDeviceStorge")
+    public R<List<ToolStorgePageDTO>> getDeviceStorge(@RequestBody ToolCheckDTO toolCheckDTO) {
+        return R.success(baseService.getDeviceStorge(toolCheckDTO.getDeviceId()));
+    }
 }

+ 13 - 2
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/StationUserController.java

@@ -9,6 +9,7 @@ import com.github.zuihou.authority.entity.common.DictionaryItem;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperController;
 import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
+import com.github.zuihou.business.productionResourceCenter.dao.StationUserMapper;
 import com.github.zuihou.business.productionResourceCenter.dto.StationUserPageDTO;
 import com.github.zuihou.business.productionResourceCenter.dto.StationUserSaveDTO;
 import com.github.zuihou.business.productionResourceCenter.dto.StationUserUpdateDTO;
@@ -53,6 +54,8 @@ public class StationUserController extends SuperController<StationUserService, L
     @Autowired
     private StationUserLoginInfoMapper stationUserLoginInfoMapper;
     @Autowired
+    private StationUserMapper stationUserMapper;
+    @Autowired
     private ProductionresourceBizMapper productionresourceBizMapper;
 
 
@@ -137,15 +140,23 @@ public class StationUserController extends SuperController<StationUserService, L
     @ApiOperation(value = "查询上下料用户", notes = "查询上下料用户")
     @GetMapping("/getStation")
     public R getStationByUser(@RequestParam(value="userId",required = false) String userId) {
-        LbqWrapper<StationUserLoginInfo> wrapper = Wraps.<StationUserLoginInfo>lbQ();
+        /*LbqWrapper<StationUserLoginInfo> wrapper = Wraps.<StationUserLoginInfo>lbQ();
         if(userId!= null){
             wrapper.eq(StationUserLoginInfo::getUserId, userId);
         }
         StationUserLoginInfo stationUserLoginInfo = stationUserLoginInfoMapper.selectOne(wrapper);
         if(BeanUtil.isEmpty(stationUserLoginInfo)){
             return fail("当前登录用户非上下料用户");
+        }*/
+        LbqWrapper<StationUser> wrapper = Wraps.<StationUser>lbQ();
+        if(userId!= null){
+            wrapper.eq(StationUser::getUserId, userId);
+        }
+        StationUser stationUser = stationUserMapper.selectOne(wrapper);
+        if(BeanUtil.isEmpty(stationUser)){
+            return fail("当前登录用户非上下料用户");
         }
-        com.github.zuihou.business.productionResourceCenter.entity.Productionresource productionresource =  productionresourceBizMapper.selectById(stationUserLoginInfo.getStationId());
+        com.github.zuihou.business.productionResourceCenter.entity.Productionresource productionresource =  productionresourceBizMapper.selectById(stationUser.getStationId());
         List<Productionresource> productionresources = new ArrayList<>();
         productionresources.add(productionresource);
         return success(productionresources);

+ 1 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/centralToolMagazine/dto/ToolCheckDTO.java

@@ -23,7 +23,7 @@ public class ToolCheckDTO {
     private Boolean isFree;
 
     //换出来的刀库库位ID
-    private List<Long> storgeId;
+    private List<ToolStorgePageDTO> storgeId;
 
     List<ToolStorgePageDTO> toolStorgelist;
 }

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

@@ -97,12 +97,16 @@ public class ToolStorgePageDTO implements Serializable {
     private Long toolHandleId;
 
     private String managementType;
-
+    private String handleName;
     private String toolCode;
     private String handleCode;
     private String cuttingToolCategory;
     private Long toolId;
-
+    private String cuttingToolName;
+    private String cutterCode;
     private String pointId;
+    private String toolLifeSpan;
+    private String toolRatedUsageCount;
+    private String toolUsedCount;
 
 }