瀏覽代碼

fix:对刀仪对刀逻辑优化

wang.sq@aliyun.com 2 月之前
父節點
當前提交
c97a0b7bc0

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/cutterdata/service/CutterTestDataService.java

@@ -1,6 +1,7 @@
 package com.github.zuihou.business.cutterdata.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperService;
 import com.github.zuihou.business.cutterdata.entity.CutterTestDataEntity;
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
@@ -34,7 +35,7 @@ public interface CutterTestDataService extends SuperService<CutterTestDataEntity
 
     IPage<CutterTestDataEntity> pageList(IPage page, LbqWrapper<CutterTestDataEntity> wrapper);
 
-    CuttingTool getCutterByRfid();
+    R<CuttingTool> getCutterByRfid();
 
     List<CutterTestDataEntity> getStockInfosByResourceId(List<Long> resourceids);
 

+ 4 - 3
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/cutterdata/service/impl/CutterTestDataServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.authority.entity.common.DictionaryItem;
 import com.github.zuihou.authority.service.common.DictionaryItemService;
+import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.cutterdata.dao.CutterTestDataMapper;
 import com.github.zuihou.business.cutterdata.entity.CutterTestDataEntity;
@@ -334,7 +335,7 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
 
     // 读取rfid 刀柄号,根据刀柄好查询刀具基础信息
     @Override
-    public CuttingTool getCutterByRfid() {
+    public R<CuttingTool> getCutterByRfid() {
 
         // 判断网络通讯是否正常
         //        if (!InetAddress.getByName(CutterSharedIp).isReachable(300)) {
@@ -386,10 +387,10 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
             this.findCutterTestData(one);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new BizException(e.getMessage());
+            return  R.result(-1, one,e.getMessage()+";刀具号:"+ one.getCuttingToolNo());
         }
 
-        return one;
+        return R.success(one);
     }
 
     @Override

+ 4 - 2
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/cutterdata/CutterTestDataController.java

@@ -1,5 +1,6 @@
 package com.github.zuihou.business.controller.cutterdata;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.zuihou.base.R;
@@ -15,6 +16,7 @@ import com.github.zuihou.business.productionReadyCenter.service.CuttingToolServi
 import com.github.zuihou.common.util.DateUtil;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
+import com.github.zuihou.exception.BizException;
 import com.github.zuihou.log.annotation.SysLog;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -75,8 +77,8 @@ public class CutterTestDataController  extends SuperController<CutterTestDataSer
     @ApiOperation(value = "定时查询rfid,根据rfid查询组刀对照的表", notes = "定时查询rfid,根据rfid查询组刀对照的表")
     @PostMapping("/getCutterByRfid")
     public R<CuttingTool> getCutterByRfid(@RequestBody AuthUser authUser) {
-        CuttingTool cuttingTool =  cutterTestDataService.getCutterByRfid();
-        return success(cuttingTool);
+
+        return cutterTestDataService.getCutterByRfid();
     }
 
 

+ 4 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/ProductionresourceBizController.java

@@ -67,7 +67,10 @@ public class ProductionresourceBizController extends SuperController<Productionr
         QueryWrap<Productionresource> wrap = handlerWrapper(null, params);
         LbqWrapper<Productionresource> wrapper = wrap.lambda();
         Productionresource productionresource = BeanUtil.toBean(data, Productionresource.class);
-        wrapper.like(Productionresource::getName,productionresource.getName()).eq(Productionresource::getOnlineStatus,productionresource.getOnlineStatus()).eq(Productionresource::getCode, productionresource.getCode()).orderByDesc(Productionresource::getId);
+        wrapper.like(Productionresource::getName,productionresource.getName())
+                .eq(Productionresource::getOnlineStatus,productionresource.getOnlineStatus())
+                .eq(Productionresource::getCode, productionresource.getCode())
+                .orderByAsc(Productionresource::getCode);
         baseService.getPageList(page, wrapper);
     }