From d20e6ee62885bfa4129d8b7ac457dd9298f5974a Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期一, 09 十月 2023 20:56:48 +0800
Subject: [PATCH] 熏蒸备案页面修改2
---
igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java | 116 ++++++++++++++++++++-------------------------------------
1 files changed, 41 insertions(+), 75 deletions(-)
diff --git a/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java b/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java
index 0c5afad..2a878c5 100644
--- a/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java
+++ b/igds-inout/src/main/java/com/ld/igds/inout/service/impl/InoutServiceImpl.java
@@ -1,8 +1,6 @@
package com.ld.igds.inout.service.impl;
import com.bstek.dorado.data.entity.EntityUtils;
-import com.ld.igds.common.CoreCommonService;
-import com.ld.igds.constant.BizType;
import com.ld.igds.constant.Constant;
import com.ld.igds.constant.RedisConst;
import com.ld.igds.data.CommonData;
@@ -15,11 +13,11 @@
import com.ld.igds.inout.mapper.InoutCheckMapper;
import com.ld.igds.inout.mapper.InoutRecordMapper;
import com.ld.igds.inout.service.InoutService;
+import com.ld.igds.models.InoutLossOver;
import com.ld.igds.models.InoutPrice;
import com.ld.igds.util.ContextUtil;
import com.ld.igds.util.DateUtil;
import com.ld.igds.util.RedisUtil;
-import com.ld.igds.websocket.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
@@ -28,9 +26,6 @@
import javax.annotation.Resource;
import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.FutureTask;
@Slf4j
@Component
@@ -42,8 +37,6 @@
private InoutCheckMapper inoutCheckMapper;
@Resource
private RedisUtil redisUtil;
- @Resource
- private CoreCommonService commonService;
@Override
public InoutData inoutProgressQuery(InoutParam param) throws Exception {
@@ -156,7 +149,7 @@
if (EntityUtils.isEntity(data)) {
newData = new InoutData();
BeanUtils.copyProperties(data, newData, new String[]{"checkItems", "files"});
- }else{
+ } else {
newData = data;
}
@@ -213,9 +206,11 @@
}
inoutMapper.updateDataByHandle(newData);
+ InoutParam param = new InoutParam();
+ param.setId(newData.getId());
//鏇存柊缂撳瓨
- updateInoutCache(newData);
+ updateInoutCache(inoutMapper.inoutQueryById(param));
return null;
}
@@ -246,9 +241,9 @@
if (null != param.getUserId()) {
param.setUserId("%" + param.getUserId() + "%");
}
-
- if(null != param.getRecordStatus() && InoutConstant.RECORD_STATUS_NORMAL.equals(param.getRecordStatus())){
- param.setRecordStatus(null);
+
+ if (null != param.getRecordStatus() && InoutConstant.RECORD_STATUS_NORMAL.equals(param.getRecordStatus())) {
+ param.setRecordStatus(null);
}
List<InoutData> records = inoutMapper.pageRecordData(page, param);
@@ -300,7 +295,7 @@
}
// 娓呴櫎缂撳瓨
- this.delFromCache(param.getDeptId(), param.getType(), param.getId());
+// this.delFromCache(param.getDeptId(), param.getType(), param.getId());
inoutMapper.toComplete(param);
@@ -516,16 +511,6 @@
inoutMapper.deleteData(param);
}
- @Override
- public void setCheckCache(InoutData data) {
-
- String cacheKey = RedisConst.buildKey(data.getCompanyId(), data.getCheckId());
-
- //鍖栭獙缁撴灉瀛樺叆缂撳瓨3澶�
- redisUtil.set(cacheKey, data.getCheckItems(), 60 * 60 * 24 * 3);
- }
-
-
/**
* 鍑哄叆搴撴祦绋婭D鍒涘缓 202001030001 202001030001
*
@@ -629,53 +614,6 @@
}
/**
- * 鎺ㄩ�佸埌澶у睆锛屽垽鏂彧鏈夊綋澶у睆鍦ㄧ嚎鏃跺�欐墠澶勭悊褰撳墠閫昏緫锛岄伩鍏嶉〉闈㈠崱椤匡紝璋冪敤瀛愪换鍔″畬鎴愭帹閫�
- *
- * @param companyId 缁勭粐缂栧彿
- * @param deptId 鍒嗗簱缂栧彿
- * @param progress 娴佽浆鑺傜偣
- */
- public void notifyToScreen(String companyId, String deptId, String progress) {
-
- // 鎺ㄩ�佸埌澶у睆
- List<InoutData> curList = this.getListInoutCache(deptId);
-
- List<InoutData> completeList = this.getCompleteListInoutCache(deptId);
-
-
- if (null == WebSocketServer.contextOnLineMap.get(BizType.SCREEN
- .getCode())) {
- WebSocketServer.contextOnLineMap.put(BizType.SCREEN.getCode(),
- false);
- }
- if (null == WebSocketServer.contextOnLineMap.get(BizType.SCREEN_INOUT
- .getCode())) {
- WebSocketServer.contextOnLineMap.put(
- BizType.SCREEN_INOUT.getCode(), false);
- }
- if (null == WebSocketServer.contextOnLineMap.get(BizType.SCREEN_CHECK
- .getCode())) {
- WebSocketServer.contextOnLineMap.put(
- BizType.SCREEN_CHECK.getCode(), false);
- }
-
- if (WebSocketServer.contextOnLineMap.get(BizType.SCREEN.getCode())
- || WebSocketServer.contextOnLineMap.get(BizType.SCREEN_INOUT
- .getCode())
- || WebSocketServer.contextOnLineMap.get(BizType.SCREEN_CHECK
- .getCode())) {
-
-
- // 鍒涘缓涓�涓瓙浠诲姟杩涜鎺ㄩ�佷俊鎭�
- FutureTask<String> futureTask = new FutureTask<>(new NotifyScreenTask(curList, completeList, deptId));
-
- ExecutorService executorService = Executors.newCachedThreadPool();
- executorService.submit(futureTask);
- executorService.shutdown();
- }
- }
-
- /**
* 鍒涘缓鍑哄叆搴搆ey
*
* @param deptId
@@ -722,10 +660,10 @@
data.setCompanyId(ContextUtil.getCompanyId());
}
if (StringUtils.isEmpty(data.getDeptId())) {
- data.setCompanyId(ContextUtil.subDeptId(null));
+ data.setDeptId(ContextUtil.subDeptId(null));
}
- inoutCheckMapper.updateSampleData(data);
+ inoutCheckMapper.updateSampleData(data);
return null;
}
@@ -758,8 +696,8 @@
@Override
public String updateCheckData(InoutData data) {
data.setUpdateTime(new Date());
-
- inoutCheckMapper.updateCheckData(data);
+
+ inoutCheckMapper.updateCheckData(data);
//鏇存柊缂撳瓨
updateInoutCache(data);
@@ -777,4 +715,32 @@
}
return inoutCheckMapper.getPrice(param);
}
+
+ @Override
+ public InoutCheckData inoutDataByCheckId(InoutCheckParam param) throws Exception {
+ List<InoutCheckData> list = inoutCheckMapper.inoutDataByCheckId(param);
+ if (null == list || list.size() == 0)
+ return null;
+ if (list.size() == 1) {
+ return list.get(0);
+ } else {
+ throw new Exception("褰撳墠鏉′欢涓嬪瓨鍦ㄥ涓弧瓒虫潯浠剁殑鏁版嵁锛岃鏍告煡锛侊紒");
+ }
+ }
+
+ @Override
+ public List<InoutLossOver> listLossOver(InoutParam param) {
+ if (StringUtils.isEmpty(param.getCompanyId())) {
+ param.setCompanyId(ContextUtil.getCompanyId());
+ }
+ List<InoutLossOver> list = inoutMapper.listLossOver(param);
+
+ return list;
+ }
+
+ @Override
+ public double sumLossOverWeight(InoutParam param) {
+ CommonData result = inoutMapper.sumLossOverWeight(param);
+ return result.getNumValue1();
+ }
}
--
Gitblit v1.9.3