From 470962be1cfdbf75b734ab8f78e28a7b23a06964 Mon Sep 17 00:00:00 2001 From: tqs <56479841@qq.com> Date: 星期三, 07 九月 2022 17:55:25 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/ScaleThread.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/core/thread/ScaleThread.java b/src/main/java/com/zy/core/thread/ScaleThread.java index c5a2d4b..180396a 100644 --- a/src/main/java/com/zy/core/thread/ScaleThread.java +++ b/src/main/java/com/zy/core/thread/ScaleThread.java @@ -1,6 +1,9 @@ package com.zy.core.thread; import com.core.common.Cools; +import com.core.common.SpringUtils; +import com.zy.asrs.entity.BasDevp; +import com.zy.asrs.service.BasDevpService; import com.zy.core.Slave; import com.zy.core.ThreadHandler; import lombok.Data; @@ -43,6 +46,19 @@ String s = new String(read); if (!Cools.isEmpty(s) && s.startsWith("=")) { scale = Double.parseDouble(s.substring(1)); + + //灏嗙О閲嶉噸閲忓啓鍏ヨ澶囧熀纭�鏁版嵁涓殑gross_wt瀛楁 + if(scale > 20) { + BasDevpService basDevpService = SpringUtils.getBean(BasDevpService.class); + Integer staNo = slave.getId() == 1 ? 101 : 201; + BasDevp basDevp = basDevpService.selectById(staNo); + if(!Cools.isEmpty(basDevp)) { + basDevp.setGrossWt(scale); + if (null != basDevpService && !basDevpService.updateById(basDevp)) { + throw new Exception("鏇存柊鏁版嵁搴撴暟鎹け璐�"); + } + } + } } } Thread.sleep(100); -- Gitblit v1.9.1