c2c1cbd9 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 413d277a c937ee54
package com.skua.modules.appdownload;
import com.skua.core.api.ISysBaseAPI;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 视频信息
*/
@Slf4j
@Api(tags="APP下载二维码")
@RestController
@RequestMapping("/app/appdownload")
public class AppDownLoadController {
@Autowired
private ISysBaseAPI iSysBaseAPI;
@AutoLog(value = "APP下载二维码")
@ApiOperation(value="APP下载二维码", notes="APP下载二维码")
@GetMapping(value = "/getAppDownLoad")
public Result<Map<String,Object>> getIOSAppDownLoad() {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = iSysBaseAPI.getIOSAppDownLoad();
result.setSuccess(true);
result.setResult(map);
return result;
}
}
......@@ -101,8 +101,7 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
Map<String, Object> getWeekReport(@Param(value="dataTime") String dataTime, @Param(value="departId") String departId,
@Param(value="week") String week,@Param(value="startDate") String startDate,@Param(value="endDate") String endDate,
@Param(value="dataViewName3a24") String dataViewName3a24,
@Param(value="dataViewName2119") String dataViewName2119,
@Param(value="dataViewName9bff") String dataViewName9bff);
@Param(value="dataViewName2119") String dataViewName2119);
List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate,
@Param(value="dataViewName3a24") String dataViewName3a24,
......
......@@ -179,18 +179,18 @@
#{dataTime} as time,
#{startDate} as startdate,
#{endDate} as enddate,
v9.JSCOD as jscod,
v9.JSAD as jsnh3n,
v9.JSPH as jsph,
v9.JSZD as jstn,
v9.JSZL as jstp,
v9.CSCOD as cscod,
v9.CSAD as csnh3n,
v9.CSPH as csph,
v9.CSTN as cstn,
v9.CSZL as cstp,
v9.JSSS as jsss,
v9.CSSS as csss,
v2.JSCOD as jscod,
v2.JSAD as jsnh3n,
v2.JSPH as jsph,
v2.JSZD as jstn,
v2.JSZL as jstp,
v2.CSCOD as cscod,
v2.CSAD as csnh3n,
v2.CSPH as csph,
v2.CSTN as cstn,
v2.CSZL as cstp,
v2.JSSS as jsss,
v2.CSSS as csss,
v3.qt5,v3.qt4,v3.qt3,v3.qt2,v3.qt1,
v3.scqk5,v3.scqk4,v3.scqk3,v3.scqk2,v3.scqk1,
v3.id,v3.zwncb,v3.tnlgyy,v3.sjtnl,
......@@ -208,14 +208,6 @@
sys_depart d
LEFT JOIN (SELECT * FROM view_30a8 WHERE depart_id = #{departId} AND time = #{dataTime} AND zs = #{week}) v3 on v3.depart_id = d.id
LEFT JOIN (SELECT
ROUND(AVG(v.JSCOD),2) JSCOD,ROUND(AVG(v.JSAD),2) JSAD,ROUND(AVG(v.JSPH),2) JSPH,
ROUND(AVG(v.JSZD),2) JSZD,ROUND(AVG(v.JSZL),2) JSZL,ROUND(AVG(v.JSSS),2) JSSS,
ROUND(AVG(v.CSCOD),2) CSCOD,ROUND(AVG(v.CSAD),2) CSAD,ROUND(AVG(v.CSPH),2) CSPH,
ROUND(AVG(v.CSTN),2) CSTN,ROUND(AVG(v.CSZL),2) CSZL,ROUND(AVG(v.CSSS),2) CSSS,
v.depart_id
FROM ${dataViewName9bff} v
WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v9 on v9.depart_id = d.id
LEFT JOIN (SELECT
SUM(IFNULL(v.DLHJ,0)) dlhj,(SUM( IFNULL(v.PAMRJ,0) ) + SUM( IFNULL(v.SCLPAMZ,0) ) +
SUM( IFNULL(v.SCLPAMF,0) ) + SUM( IFNULL(v.NACLO,0) ) + SUM( IFNULL(v.PACGT,0) ) +
SUM( IFNULL(v.PACYT,0) ) + SUM( IFNULL(v.PFS,0) ) + SUM( IFNULL(v.FHTY,0) ) +SUM( IFNULL(v.RYXNJ,0) ) +
......@@ -227,11 +219,17 @@
LEFT JOIN (SELECT
SUM(v.CSL) zclsl,
ROUND(AVG(v.CSL),2) rjclsl,
ROUND(AVG(v.JSCOD),2) JSCOD,ROUND(AVG(v.JSAD),2) JSAD,ROUND(AVG(v.JSPH),2) JSPH,
ROUND(AVG(v.JSZD),2) JSZD,ROUND(AVG(v.JSZL),2) JSZL,ROUND(AVG(v.JSSS),2) JSSS,
ROUND(AVG(v.CSCOD),2) CSCOD,ROUND(AVG(v.CSAD),2) CSAD,ROUND(AVG(v.CSPH),2) CSPH,
ROUND(AVG(v.CSTN),2) CSTN,ROUND(AVG(v.CSZL),2) CSZL,ROUND(AVG(v.CSSS),2) CSSS,
v.depart_id
FROM ${dataViewName2119} v
WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v2 on v2.depart_id = d.id
LEFT JOIN sys_factory_info f on f.depart_id = d.id
LEFT JOIN report_target_config t on t.depart_id = d.id
LEFT JOIN ( SELECT * FROM report_target_config
WHERE target_year = LEFT ( #{dataTime}, 4 ) AND depart_id = #{departId} LIMIT 1
) t on t.depart_id = d.id
WHERE
d.id = #{departId}
</select>
......
......@@ -27,7 +27,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
private static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";
private static String view9bff = "9bffaf9187093d6e6a4390e8c56acca8";
private static String view4411 = "4411ed3d78634bcdcd700f6e33724025";
@Autowired
private FCustomReportDatasetMapper mapper;
......@@ -171,10 +170,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", "", startDate, endDate);
String field9bff = "JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS";
String dataViewName9bff = ReportViewUtil.buildView(view9bff, field9bff, "", startDate, endDate);
valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119, dataViewName9bff);
String field2119 = "CSL,JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS";
String dataViewName2119 = ReportViewUtil.buildView(view2119,field2119, "", startDate, endDate);
valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119);
if(valueMap==null){
valueMap = new HashMap<>();
valueMap.put("depart_id", departId);
......@@ -403,8 +401,6 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
String dataViewName3a24 = ReportViewUtil.buildView(view3a24, field3a24, "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", "", startDate, endDate);
String field9bff = "JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS";
String dataViewName9bff = ReportViewUtil.buildView(view9bff, field9bff, "", startDate, endDate);
list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119);
map.put("start", startDate);//开始时间
map.put("end", endDate);//结束时间
......
......@@ -11,7 +11,8 @@ public interface WaterAnalysisNewMapper {
List<Map<String, Object>> queryFacList(@Param("time") String time,@Param("factoryIds") String factoryIds);
List<DictModel> queryDictItemsByCode(@Param("code") String code);
List<Map<String, Object>> queryCSList();
List<Double> queryAvgByCode(@Param("code") String code, @Param("time") String time, @Param("factoryIds") String factoryIds);
List<Double> queryAvgByCode(@Param("code") String code, @Param("time") String time,
@Param("factoryIds") String factoryIds, @Param("reportId") String reportId);
Double queryAvgSumByCode(@Param("code") String code, @Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryAllFacList(@Param("factoryIds") String factoryIds);
Double queryAvgSumByCodeAndFac(@Param("code") String code, @Param("time") String time, @Param("factoryId") String factoryId);
......
......@@ -5,7 +5,7 @@
SELECT
sd.depart_name factoryName,
sd.id factoryId,
t.item_text standard,
t.alarm_standard_level_name standard,
sfi.pro_longitude longitude,
sfi.pro_latitude latitude,
sa.area_name areaName,
......@@ -14,7 +14,7 @@
sys_depart sd
LEFT JOIN sys_factory_info sfi ON sfi.depart_id = sd.id
LEFT JOIN sys_area sa ON sa.id = sfi.pro_county
LEFT JOIN ( SELECT item_text, item_value FROM sys_dict_item WHERE dict_id = '71a36a3388da093c19733298c7fa6932' ) t ON t.item_value = sfi.out_level
LEFT JOIN alarm_level_standard_config t ON t.id = sfi.out_level
LEFT JOIN (
SELECT
t.factory_id,
......@@ -150,24 +150,25 @@
FROM
sys_metric_dict
WHERE
id in('CSCOD','CSNH3N','CSTN','CSTP','CSPH')
id in('CSCOD','CSAD','CSTN','CSZL','CSPH')
order by sort_num
</select>
<select id="queryAvgByCode" resultType="java.lang.Double">
SELECT
round(avg( index_value ),2) count
round(avg( v.item_value ),2) count
FROM
sys_data_calculation
f_report_itemv v
WHERE
LEFT ( ts, 7 ) = #{time}
AND index_tag = #{code}
AND depart_id in
v.reit_id = ( SELECT id FROM f_report_item WHERE report_id = #{reportId} AND item_code = #{code} )
AND LEFT ( v.data_time, 7 ) = #{time}
AND v.depart_id in
<foreach item="item" index="index" collection="factoryIds.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
GROUP BY
depart_id
order by count desc
v.depart_id
order by
avg(v.item_value) desc
</select>
<select id="queryAvgSumByCode" resultType="java.lang.Double">
SELECT
......
......@@ -16,7 +16,7 @@ import java.util.concurrent.atomic.AtomicReference;
@Service
public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
private static String REPOART_ID_HY = "9bffaf9187093d6e6a4390e8c56acca8";
private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
@Autowired
private WaterAnalysisNewMapper waterAnalysisNewMapper;
@Override
......@@ -65,7 +65,8 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
public List<Map<String, Object>> queryFacListWaterQCL(String time) {
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", departIds, time);
String fields = "CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD";
String dataViewName = ReportViewUtil.buildViewLike(view2119,fields, departIds, time);
List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName);
if (list != null) {
for (Map<String, Object> map : list) {
......@@ -107,7 +108,8 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
public Map<String, Object> queryWaterQCL(String time) {
Map<String, Object> result = Maps.newHashMap();
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time);
String fields = "CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD";
String dataViewName = ReportViewUtil.buildViewLike(view2119,fields, departIds, time);
result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds);
if(result==null){
result = new HashMap<>();
......@@ -120,6 +122,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
}
@Override
public List<Map<String, Object>> queryCSAnalysis(String time) {
String reportId = "2119ecbf53a1d2d0708258ff67cfd9e1";
String departIds = BaseContextHandler.getDeparts();
//获取负荷比例
List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion");
......@@ -139,7 +142,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, departIds);
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds, reportId);
if (datan != null && datan.size() > 0) {
DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics();
//取最大值
......
......@@ -43,13 +43,19 @@ public class NFDataSyncJob implements Job {
String itemValue = map.get("item_value").toString();
String itemType = map.get("item_type").toString();
Map<String, String> data = new HashMap<>();
data.put(itemCode, itemValue);
data.put("departId", departId);
data.put("time",yesterday);
if("szsl".equals(itemType)){
data.put(itemCode, itemValue);
data.put("reportId", SZSL);
reportDataService.insertOrUpdateReportData(departId, time, data, SZSL);
}else if("hyrb".equals(itemType)){
String indexs = "JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS";
if(itemCode.indexOf(indexs) > 0){
data.put(itemCode+"HY", itemValue);
}else{
data.put(itemCode, itemValue);
}
data.put("reportId", HYRB);
reportDataService.insertOrUpdateReportData(departId, time, data, HYRB);
}else {
......
......@@ -4,6 +4,7 @@ import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -30,6 +31,7 @@ public class ReportDisplay {
/**所属厂区*/
@Excel(name = "所属厂区", width = 15)
@ApiModelProperty(value = "所属厂区")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
/**报表名称*/
@Excel(name = "报表名称", width = 15)
......
......@@ -64,18 +64,18 @@
) v3 ON d.id = v3.depart_id
LEFT JOIN (
SELECT
ROUND(AVG(JSZL),2) AS JSZL,
ROUND(AVG(JSCOD),2) AS JSCOD,
ROUND(AVG(JSSS),2) AS JSSS,
ROUND(AVG(JSAD),2) AS JSAD,
ROUND(AVG(JSZD),2) AS JSZD,
ROUND(AVG(CSZL),2) AS CSZL,
ROUND(AVG(CSTN),2) AS CSTN,
ROUND(AVG(CSAD),2) AS CSAD,
ROUND(AVG(CSSS),2) AS CSSS,
ROUND(AVG(CSCOD),2) AS CSCOD,
ROUND(AVG(CSPH),2) AS CSPH,
ROUND(AVG(JSPH),2) AS JSPH,
ROUND(AVG(JSZLHY),2) AS JSZL,
ROUND(AVG(JSCODHY),2) AS JSCOD,
ROUND(AVG(JSSSHY),2) AS JSSS,
ROUND(AVG(JSADHY),2) AS JSAD,
ROUND(AVG(JSZDHY),2) AS JSZD,
ROUND(AVG(CSZLHY),2) AS CSZL,
ROUND(AVG(CSTNHY),2) AS CSTN,
ROUND(AVG(CSADHY),2) AS CSAD,
ROUND(AVG(CSSSHY),2) AS CSSS,
ROUND(AVG(CSCODHY),2) AS CSCOD,
ROUND(AVG(CSPHHY),2) AS CSPH,
ROUND(AVG(JSPHHY),2) AS JSPH,
time,
depart_id
FROM
......
......@@ -102,7 +102,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/equip/equipInfo/archivesList", "anon");
filterChainDefinitionMap.put("/sys/common/upload/**", "anon");
filterChainDefinitionMap.put("/v1/system/datestandard/sysStructDict/noPageList", "anon");
filterChainDefinitionMap.put("/v1/report/reportDisplay/**", "anon");
// filterChainDefinitionMap.put("/v1/report/reportDisplay/**", "anon");
filterChainDefinitionMap.put("/v1/sys/factoryMonitorData/**", "anon");
filterChainDefinitionMap.put("/sys/dict/getDictItems/**", "anon");
//性能监控
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!