20472ca1 张雷

水厂运营大屏接口开发

1 个父辈 c3ba1225
正在显示 13 个修改的文件 包含 297 行增加18 行删除
package com.skua.modules.flow.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.skua.modules.flow.core.entity.BladeFlow;
import com.skua.modules.flow.core.entity.FlowAssemblyEntity;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 流程业务类
......@@ -21,13 +15,27 @@ public interface FlowForThirdBusinessService {
* @param bladeFlow 流程类
* @return
*/
List<BladeFlow> selectClaimPage(BladeFlow bladeFlow, String userId, String roles);
List<BladeFlow> selectClaimList(BladeFlow bladeFlow, String userId, String roles);
/**
* 流程待办列表
* @param bladeFlow 流程类
* @return
*/
List<BladeFlow> selectTodoPage(BladeFlow bladeFlow, String userId);
List<BladeFlow> selectTodoList(BladeFlow bladeFlow, String userId);
/**
* 流程已发列表
* @param bladeFlow 流程类
* @return
*/
List<BladeFlow> selectSendList(BladeFlow bladeFlow, String userId);
/**
* 流程办结列表
* @param bladeFlow 流程类
* @return
*/
List<BladeFlow> selectDoneList(BladeFlow bladeFlow, String userId);
}
......
......@@ -189,7 +189,7 @@ public class ProcessStatisticsController {
List<String> roleList = sysBaseAPI.getRolesByUserId(sysUser.getId());
String roles = roleList.stream().map(s -> s.trim()).collect(Collectors.joining(","));
if(roleList.size() > 0){
claimList = flowForThirdBusinessService.selectClaimPage(bladeFlow, sysUser.getId(), roles);
claimList = flowForThirdBusinessService.selectClaimList(bladeFlow, sysUser.getId(), roles);
for (BladeFlow claim : claimList) {
ThirdProcessVO claimVO = new ThirdProcessVO();
claimVO.setMsgid(claim.getTaskId());
......@@ -204,7 +204,7 @@ public class ProcessStatisticsController {
list.add(claimVO);
}
}
todoList = flowForThirdBusinessService.selectTodoPage(bladeFlow, sysUser.getId());
todoList = flowForThirdBusinessService.selectTodoList(bladeFlow, sysUser.getId());
for (BladeFlow todo : todoList) {
ThirdProcessVO todoVO = new ThirdProcessVO();
todoVO.setMsgid(todo.getTaskId());
......
......@@ -197,7 +197,7 @@ public class SysMonitorLocationController {
String sExpress = bean.getMonitorStop();
str.append(getFields(sExpress)).append(",");
}
str.append(bean.getMonitorId()).append(",");
str.append(bean.getMonitorId()).append(",");
}
}
//查询点信息
......@@ -516,7 +516,7 @@ public class SysMonitorLocationController {
Map<String, Object> map = new HashMap<>();
// Map<String,Object> dataMap = sysMonitorLocationService.getLocationDataList(monitorLocationVO.getDepartId(),monitorLocationVO.getStructId());
List<MonitorLocationVO> list = sysMonitorLocationService.getLoctionList(monitorLocationVO.getDepartId(), monitorLocationVO.getPictureId());
if (list.size() > 0) {
if(list!=null&&list.size() > 0){
map = getLoctionGroup(list, true);
}
result.setSuccess(true);
......@@ -673,11 +673,11 @@ public class SysMonitorLocationController {
}
}
//保存设备台账信息
JSONArray materialArray = jsonObject.getJSONArray("materialData");
delLoctionCache(null,null);
result.success("添加成功!");
......
......@@ -3,8 +3,7 @@ package com.skua.modules.dataAnalysis.controller;
import com.skua.core.api.vo.Result;
import com.skua.modules.dataAnalysis.service.IFactoryCenterService;
import com.skua.modules.dataAnalysis.service.IFactoryOperateCenterService;
import com.skua.modules.dataAnalysis.vo.StatisticsParam;
import com.skua.modules.dataAnalysis.vo.WaterQualityMonitoringDetailVO;
import com.skua.modules.dataAnalysis.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......@@ -36,4 +35,64 @@ public class FactoryOperateCenterController {
return result;
}
@ApiOperation(value="厂区报表统计数据", notes="厂区报表统计数据")
@GetMapping(value = "/report")
public Result<Map<String,Object>> getReportData(String departId,String month) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = factoryOperateCenterService.getReportData(departId,month);
result.setSuccess(true);
result.setResult(map);
return result;
}
@ApiOperation(value="厂区设备报警信息", notes="厂区设备报警信息")
@GetMapping(value = "/alarm")
public Result<List<EquipAlarmVO>> getEquipAlarm(String departId, String month) {
Result<List<EquipAlarmVO>> result = new Result<List<EquipAlarmVO>>();
List<EquipAlarmVO> list = factoryOperateCenterService.getEquipAlarm(departId,month);
result.setSuccess(true);
result.setResult(list);
return result;
}
@ApiOperation(value="厂区设备预警数据", notes="厂区设备预警数据")
@GetMapping(value = "/equip/warn")
public Result<List<EquipWarnVO>> getEquipWarn(String departId, String month) {
Result<List<EquipWarnVO>> result = new Result<List<EquipWarnVO>>();
List<EquipWarnVO> list = factoryOperateCenterService.getEquipWarn(departId,month);
result.setSuccess(true);
result.setResult(list);
return result;
}
@ApiOperation(value="厂区设备运行时间", notes="厂区设备运行时间")
@GetMapping(value = "/equip/runtime")
public Result<List<EquipRunTimeVO>> getEquipRunTime(String departId, String month) {
Result<List<EquipRunTimeVO>> result = new Result<List<EquipRunTimeVO>>();
List<EquipRunTimeVO> list = factoryOperateCenterService.getEquipRunTime(departId,month);
result.setSuccess(true);
result.setResult(list);
return result;
}
@ApiOperation(value="厂区报表档案到期提醒", notes="厂区报表档案到期提醒")
@GetMapping(value = "/archives/warn")
public Result<List<ArchivesWarnVO>> getArchivesWarn(String departId,String month) {
Result<List<ArchivesWarnVO>> result = new Result<List<ArchivesWarnVO>>();
List<ArchivesWarnVO> list = factoryOperateCenterService.getArchivesWarn(departId);
result.setSuccess(true);
result.setResult(list);
return result;
}
@ApiOperation(value="厂区工单完成情况", notes="厂区工单完成情况")
@GetMapping(value = "/flow")
public Result<Map<String,Object>> getFlowData(String departId,String month) {
Result<Map<String,Object>> result = new Result<Map<String,Object>>();
Map<String,Object> map = factoryOperateCenterService.getFlowData(departId,month);
result.setSuccess(true);
result.setResult(map);
return result;
}
}
......
package com.skua.modules.dataAnalysis.mapper;
import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO;
import com.skua.modules.dataAnalysis.vo.EquipAlarmVO;
import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO;
import com.skua.modules.dataAnalysis.vo.EquipWarnVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -10,4 +14,13 @@ public interface FactoryOperateCenterMapper {
Map<String, Object> getData(@Param("month") String month, @Param("departId") String departId,
@Param("view3a24") String view3a24, @Param("view2119") String view2119);
List<EquipAlarmVO> getEquipAlarm(@Param("departId") String departId, @Param("month") String month);
List<EquipWarnVO> getEquipWarn(@Param("departId") String departId, @Param("month") String month);
List<EquipRunTimeVO> getEquipRunTime(@Param("departId") String departId, @Param("month") String month);
List<ArchivesWarnVO> getArchivesWarn(@Param("departId") String departId);
List<Map<String, Object>> getFlowData(@Param("departId") String departId, @Param("month") String month);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryCenterMapper">
<mapper namespace="com.skua.modules.dataAnalysis.mapper.FactoryOperateCenterMapper">
<select id="getData" resultType="java.util.HashMap">
SELECT
ROUND(SUM( v3.DLHJ )/10000,2) AS yzdl,
......@@ -15,6 +15,109 @@
${view3a24} v3
LEFT JOIN (select v.CSL,v.time from ${view2119} v where LEFT ( v.time, 7 ) = #{month} and v.depart_id = #{departId}) v2 ON v2.time = v3.time
where LEFT ( v3.time, 7 ) = #{month}
and v3.depart_id = #{departId}
and v3.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="getEquipAlarm" resultType="com.skua.modules.dataAnalysis.vo.EquipAlarmVO">
SELECT
a.alarm_content AS content,
a.record_time AS date_time,
a.alarm_rule_level_name AS level,
a.alarm_rule_level_name AS type
FROM
alarm_record_history a
WHERE
a.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND a.record_time LIKE CONCAT(#{month},'%')
AND a.alarm_rule_type IN ( 'B001B001', 'B001B002', 'B001B003', 'B001B004' )
ORDER BY
a.record_time
</select>
<select id="getEquipWarn" resultType="com.skua.modules.dataAnalysis.vo.EquipWarnVO">
SELECT
e.equipment_name AS equip_name,
'报废提醒' AS equip_type,
e.scrap_date AS over_time
FROM
equipment_info e
WHERE
e.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND e.scrap_date != ''
AND LEFT(e.scrap_date,11) &lt; DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 3 MONTH), '%Y-%m-%d')
</select>
<select id="getEquipRunTime" resultType="com.skua.modules.dataAnalysis.vo.EquipRunTimeVO">
SELECT
e.equipment_name AS equip_name,
c.des AS equip_type,
m.id AS run_time
FROM
sys_monitor_metric_info m
LEFT JOIN equipment_info e ON m.equipment_code = e.id
LEFT JOIN equipment_category c ON e.equipment_type = c.id
WHERE
m.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND m.metric_type = 1
AND m.equipment_code IS NOT NULL
</select>
<select id="getArchivesWarn" resultType="com.skua.modules.dataAnalysis.vo.ArchivesWarnVO">
SELECT
CONCAT( u.user_name, '人员合同' ) AS archives_name,
'人员合同' AS archives_type,
u.contract_enddate AS over_time
FROM
sys_factory_user_info u
WHERE
u.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND LEFT ( u.contract_enddate, 11 ) &lt; DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL - 3 MONTH ), '%Y-%m-%d' )
UNION ALL
SELECT
CONCAT( u.user_name, d.certifies_name ) AS archives_name,
'证件证书' AS archives_type,
d.end_time AS over_time
FROM
sys_factory_user_data d
LEFT JOIN sys_factory_user_info u ON d.base_id = u.id
WHERE
u.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND LEFT ( d.end_time, 11 ) &lt; DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL - 3 MONTH ), '%Y-%m-%d' )
</select>
<select id="getFlowData" resultType="java.util.HashMap">
SELECT
a.REV_ AS status,
COUNT(a.ASSIGNEE_) AS count
FROM
act_ru_task a
LEFT JOIN sys_user u ON a.ASSIGNEE_ = CONCAT( 'taskUser_', u.id )
LEFT JOIN sys_user_depart d ON u.id = d.user_id
WHERE
a.ASSIGNEE_ IS NOT NULL
AND d.dep_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
AND CREATE_TIME_ LIKE CONCAT(#{month},'%')
GROUP BY a.REV_
</select>
</mapper>
......
package com.skua.modules.dataAnalysis.service;
import com.skua.modules.dataAnalysis.vo.ArchivesWarnVO;
import com.skua.modules.dataAnalysis.vo.EquipAlarmVO;
import com.skua.modules.dataAnalysis.vo.EquipRunTimeVO;
import com.skua.modules.dataAnalysis.vo.EquipWarnVO;
import java.util.List;
import java.util.Map;
public interface IFactoryOperateCenterService {
Map<String, Object> getData(String departId,String month);
Map<String, Object> getReportData(String departId, String month);
List<EquipAlarmVO> getEquipAlarm(String departId, String month);
List<EquipWarnVO> getEquipWarn(String departId, String month);
List<EquipRunTimeVO> getEquipRunTime(String departId, String month);
List<ArchivesWarnVO> getArchivesWarn(String departId);
Map<String, Object> getFlowData(String departId, String month);
}
......
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ArchivesWarnVO {
@ApiModelProperty(value = "档案名称")
private String archivesName;
@ApiModelProperty(value = "档案类型")
private String archivesType;
@ApiModelProperty(value = "到期时间")
private String overTime;
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class EquipAlarmVO {
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "时间")
private String dateTime;
@ApiModelProperty(value = "级别")
private String level;
@ApiModelProperty(value = "类型")
private String type;
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class EquipRunTimeVO {
@ApiModelProperty(value = "设备名称")
private String equipName;
@ApiModelProperty(value = "设备类型")
private String equipType;
@ApiModelProperty(value = "运行时间")
private String runTime;
}
package com.skua.modules.dataAnalysis.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class EquipWarnVO {
@ApiModelProperty(value = "设备名称")
private String equipName;
@ApiModelProperty(value = "设备类型")
private String equipType;
@ApiModelProperty(value = "逾期时间")
private String overTime;
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!