From bff85d777d7eb1e362adce089a287fd9bc85c03c Mon Sep 17 00:00:00 2001
From: shishuaikang <280848880@qq.com>
Date: 星期四, 07 十二月 2023 15:11:00 +0800
Subject: [PATCH] 1.搅合站分辨率修改 2.拌和站屏管理添加材料改成input 3.巡检任务bug修改
---
hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java
index c70f37a..e52fa33 100644
--- a/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java
+++ b/hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/concret/controller/MixingPlantNewScheduled.java
@@ -1,6 +1,7 @@
package com.thhy.materials.modules.biz.concret.controller;
+import com.thhy.materials.modules.biz.concret.entity.SysSteel;
import com.thhy.materials.modules.biz.concret.entity.dto.DicetName;
import com.thhy.materials.modules.biz.concret.entity.dto.TMinxingPlant;
import com.thhy.materials.modules.biz.concret.entity.dto.WeighDto;
@@ -238,5 +239,39 @@
}
+ //苏州项目------- 地磅入库 记录,及库存修改 钢筋
+ @Scheduled(fixedRate = 2000000) // 每隔3秒执行一次任务
+ public void weighbridgeSteel() {
+ //查询搅拌 所有类型
+ List<SysSteel> steels = weighService.steelType();
+
+ List<TWeighbridge> tWeighbridges = weighMapper.weighbridgeListType();
+ for (SysSteel steel : steels){
+ for (TWeighbridge weighbridge :tWeighbridges){
+ if(steel.getSteelName().equals(weighbridge.getMatname())&&steel.getSteelModel().equals(weighbridge.getMatmodel())){
+ //净重
+ String jweight = weighbridge.getJweight();
+ HashMap<String, Object> hashMap = new HashMap<>();
+ hashMap.put("id","");
+ hashMap.put("steelId",steel.getSteelId());
+ hashMap.put("stockType",1);
+ hashMap.put("changeStock",jweight);
+ hashMap.put("companyId","031e3dd577e8ed28e96aa69b");
+ BigDecimal b1 = new BigDecimal(jweight);
+ BigDecimal b2 = new BigDecimal(steel.getStock());
+ RLock lock = redissonclient.getLock("materlock");
+ if(!lock.isLocked()) {
+ lock.lock(10, TimeUnit.SECONDS);
+ //插入记录表//苏州项目(入库计入增加)
+ weighMapper.steelRecordIn(hashMap);
+ //更改记录值
+ weighMapper.steelUp(steel.getSteelId(),b1.add(b2).doubleValue());
+ lock.unlock();
+ }
+ weighMapper.weighbridgeUpdateType(weighbridge.getWeighbridgeId());
+ }
+ }
+ }
+ }
}
--
Gitblit v1.9.3