bcf077ad 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 68cb9086 b0280601
......@@ -90,10 +90,21 @@ public class FactoryCenterController {
//厂区削减量统计
@ApiOperation(value="厂区削减量统计", notes="厂区削减量统计")
@GetMapping(value = "/getSzXjltj")
@GetMapping(value = "/getXjltj")
public Result<List<Map<String, Object>>> getSzXjltj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getYhtj(statisticsParam);
List<Map<String, Object>> list = factoryCenterService.getSzXjltj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
}
//厂区削减量统计
@ApiOperation(value="厂区设备统计", notes="厂区设备统计")
@GetMapping(value = "/getEquiptj")
public Result<List<Map<String, Object>>> getEquiptj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getEquiptj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
......
......@@ -31,4 +31,9 @@ public interface FactoryCenterMapper {
@Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb,
@Param("departId") String departId,
@Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb);
List<Map<String, Object>> getSzXjltj(@Param("startDate") String startDate, @Param("endDate") String endDate,
@Param("departId") String departId, @Param("view2119") String view2119);
List<Map<String, Object>> getEquiptj(@Param("departId") String departId);
}
......
......@@ -252,5 +252,45 @@
GROUP BY
LEFT ( v.time, 7 )
</select>
<select id="getSzXjltj" resultType="java.util.HashMap">
SELECT
LEFT(v2.time,7) time,
ROUND(SUM(IFNULL(JSCOD,0)) - SUM(IFNULL(CSCOD,0)),2) AS COD,
ROUND(SUM(IFNULL(JSAD,0)) - SUM(IFNULL(CSAD,0)),2) AS NH3N,
ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN,
ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP
FROM
${view2119tb} v2
WHERE
v2.time &gt;= #{startDate}
AND v2.time &lt;= #{endDate}
<if test="departId!=null and departId!=''">
AND v2.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY LEFT(v2.time,7)
</select>
<select id="getEquiptj" resultType="java.util.HashMap">
SELECT
d.id departId,
d.depart_name departName,
IFNULL( t.num, 0 ) total,
IFNULL( y.num, 0 ) one,
IFNULL( r.num, 0 ) two
FROM
sys_depart d
LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info GROUP BY depart_id ) t ON d.id = t.depart_id
LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info WHERE energy_level = 1 GROUP BY depart_id ) y ON d.id = y.depart_id
LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info WHERE energy_level = 2 GROUP BY depart_id ) r ON d.id = r.depart_id
WHERE
d.depart_type = 1
<if test="departId!=null and departId!=''">
AND d.id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</select>
</mapper>
......
......@@ -28,5 +28,9 @@ public interface IFactoryCenterService {
Map<String, Object> getMonitorThreshold(String departId);
Map<String, Object> getHourWaterData(StatisticsParam statisticsParam);
List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam);
List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam);
}
......
......@@ -531,6 +531,23 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
return map;
}
@Override
public List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam) {
List<Map<String, Object>> list = new ArrayList<>();
String startDate = statisticsParam.getStartDate();
String endDate = statisticsParam.getEndDate();
String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate);
list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119);
return list;
}
@Override
public List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam) {
List<Map<String, Object>> list = new ArrayList<>();
list = factoryCenterMapper.getEquiptj(statisticsParam.getDepartId());
return list;
}
/**
* 获取时间之间的月份
* @param start
......
package com.skua.modules.job;
import com.skua.modules.report.service.IReportDataService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 发送消息任务
*/
@Slf4j
public class NFDataSyncJob implements Job {
@Autowired
private IReportDataService reportDataService;
//水质水量报表
private static final String SZSL = "2119ecbf53a1d2d0708258ff67cfd9e1";
//化验日报
private static final String HYRB = "9bffaf9187093d6e6a4390e8c56acca8";
@Override
public void execute(JobExecutionContext jobExecutionContext) {
log.info("开始同步昨日恩菲的数据入报表");
// String yesterday = DateUtils.getYesterday();
// Map<String, String> data = new HashMap<>();
// String departId = "";
// data.put("JSZL", "");
// data.put("departId", "departId");
// data.put("reportId", SZSL);
// data.put("time",yesterday);
// reportDataService.insertOrUpdateReportData(departId, yesterday, data, SZSL);
log.info("同步昨日恩菲的数据入报表完成");
}
}
......@@ -797,7 +797,7 @@ public class SysFactoryInfoController {
if (sysFactoryInfo == null) {
result.error500("未找到对应实体");
} else {
map = sysFactoryInfoService.queryLevel(sysFactoryInfo.getInLevel(),sysFactoryInfo.getOutLevel());
map = sysFactoryInfoService.queryLevel(sysFactoryInfo.getInLevel(),sysFactoryInfo.getOutLevel(),departId);
result.setResult(map);
result.setSuccess(true);
}
......
......@@ -114,5 +114,5 @@ public interface ISysFactoryInfoService extends IService<SysFactoryInfo> {
* @param outLevel
* @return
*/
Map<String, Object> queryLevel(String inLevel, String outLevel);
Map<String, Object> queryLevel(String inLevel, String outLevel, String departId);
}
......
......@@ -678,15 +678,30 @@ public class SysFactoryInfoServiceImpl extends ServiceImpl<SysFactoryInfoMapper,
}
@Override
public Map<String, Object> queryLevel(String inLevel, String outLevel) {
public Map<String, Object> queryLevel(String inLevel, String outLevel, String departId) {
List<AlarmParamStandardConfig> inNewList = new ArrayList<>();
Map<String, Object> map = new HashMap<>();
QueryWrapper<AlarmParamStandardConfig> inQueryWrapper = new QueryWrapper<>();
inQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", inLevel);
List<AlarmParamStandardConfig> inList = alarmParamStandardConfigService.list(inQueryWrapper);
Map<String,Object> inLevelMap = new HashMap<>();
List<WaterQualityInLevel> inLevelList = sysFactoryInfoMapper.getWaterQualityInLevel(departId);
for (WaterQualityInLevel level : inLevelList) {
inLevelMap.put(level.getIndexCode(),level);
}
for (AlarmParamStandardConfig config : inList) {
String code = config.getAlarmParamCode();
if(inLevelMap.get(code) != null){
WaterQualityInLevel inLevelBean = (WaterQualityInLevel)inLevelMap.get(code);
config.setAlarmParamLowerLimit(inLevelBean.getLower());
config.setAlarmParamUpperLimit(inLevelBean.getUpper());
}
inNewList.add(config);
}
QueryWrapper<AlarmParamStandardConfig> outQueryWrapper = new QueryWrapper<>();
outQueryWrapper.eq("del_flag", 1).eq("alarm_level_standard_id", outLevel);
List<AlarmParamStandardConfig> outList = alarmParamStandardConfigService.list(outQueryWrapper);
map.put("in",inList);
map.put("in",inNewList);
map.put("out",outList);
return map;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!