301bac2f 张雷

水质分析BUG修改

1 个父辈 4d6c01ca
......@@ -343,7 +343,7 @@
IFNULL( a.totalCount, 0 ) AS totalCount
FROM
sys_factory_info sfi
LEFT JOIN alarm_level_standard_config alsc ON alsc.alarm_standard_level_code = sfi.out_level
LEFT JOIN alarm_level_standard_config alsc ON alsc.id = sfi.out_level
LEFT JOIN sys_depart d ON sfi.depart_id = d.id
LEFT JOIN (
SELECT
......
......@@ -17,18 +17,18 @@ import java.util.concurrent.atomic.AtomicReference;
@Service
public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
private static String REPOART_ID_HY = "9bffaf9187093d6e6a4390e8c56acca8";
private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," +
" 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," +
" 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," +
" 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344";
// private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," +
// " 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," +
// " 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," +
// " 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344";
@Autowired
private WaterAnalysisNewMapper waterAnalysisNewMapper;
@Override
public Map<String, Object> queryTotalBySummary(String time) {
Map<String, Object> result = Maps.newHashMap();
// String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facs = waterAnalysisNewMapper.queryTotalBySummary(time,FACTORYIDS);
Long facCount = waterAnalysisNewMapper.queryTotalCount(FACTORYIDS);
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facs = waterAnalysisNewMapper.queryTotalBySummary(time,departIds);
Long facCount = waterAnalysisNewMapper.queryTotalCount(departIds);
Long summaryCount = facCount;
Long noSummaryCount = 0L;
StringBuilder facInfo = new StringBuilder();
......@@ -67,10 +67,10 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
@Override
public List<Map<String, Object>> queryFacListWaterQCL(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> result = Lists.newArrayList();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", FACTORYIDS, time);
List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,FACTORYIDS,dataViewName);
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time);
List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName);
if (list != null) {
for (Map<String, Object> map : list) {
Double jsCODAvgSum = Double.parseDouble(map.get("jscod").toString());
......@@ -110,9 +110,9 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
@Override
public Map<String, Object> queryWaterQCL(String time) {
Map<String, Object> result = Maps.newHashMap();
// String factoryIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", FACTORYIDS, time);
result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, FACTORYIDS);
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time);
result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds);
if(result==null){
result = new HashMap<>();
result.put("COD", 0.00);
......@@ -124,7 +124,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
}
@Override
public List<Map<String, Object>> queryCSAnalysis(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
//获取负荷比例
List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion");
Double low = 0.0;
......@@ -143,7 +143,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
Double finalUp = up;
data.forEach(v -> {
String code = (String) v.get("id");
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, FACTORYIDS);
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds);
if (datan != null && datan.size() > 0) {
DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics();
//取最大值
......@@ -168,18 +168,18 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
@Override
public List<Map<String, Object>> queryNoSummaryList(String time) {
Map<String, Map<String, Object>> tmpMap = Maps.newHashMap();
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facs = new ArrayList<>();
facs = waterAnalysisNewMapper.queryNewFacList(time,FACTORYIDS);
facs = waterAnalysisNewMapper.queryNewFacList(time,departIds);
return facs;
}
@Override
public Map<String, Object> queryNewSummaryCount(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
Map<String, Object> csbzCharData = Maps.newHashMap();
//上个月DateUtils.getLastMonthOfMonth(time)
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryNewSummaryCount(time,FACTORYIDS);
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryNewSummaryCount(time,departIds);
List<String> names = Lists.newArrayList();
List<Long> data = Lists.newArrayList();
List<Long> max = Lists.newArrayList();
......@@ -307,8 +307,8 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
}
@Override
public List<Map<String, Object>> queryFacListBySummary(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryFacListBySummary(time, DateUtils.getDayCountOfMonth(time),FACTORYIDS);
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryFacListBySummary(time, DateUtils.getDayCountOfMonth(time),departIds);
maps.forEach(v -> {
Double db = Double.parseDouble(String.valueOf(v.get("db")));
if (db < 90) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!