7bfd3a2e 康伟

kangwei: 4.设备台账功能按照所属厂站、所属构筑物、设备名称的顺序排序

1、右侧坐标轴数据错误,百分比数据错误,吨水电耗与负荷率对比,吨水电耗与污染物去除率对比图,右侧单位%-2000,10000?
2、自来水使用量、万吨水消耗自来水量数据没有展示
 其中:自来水使用量数据取-能耗日报-用水量,万吨水消耗量:是自来水使用量/处理水量
3.  水质分析功能相关修改
1 个父辈 1078bdfc
......@@ -8,7 +8,7 @@ public interface ReportConstant {
//水质水量报表
public static final String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
//能源日报
public static final String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";
//上产月报
......
......@@ -90,15 +90,33 @@ public class JSUtils {
String result = null;
try{
if(obj1 != null ){
if(decimalFormat == null ) decimalFormat = "0.00";
DecimalFormat df = new DecimalFormat(decimalFormat);
result = df.format(Double.parseDouble(obj1.toString()));
if(containsDecimal(obj1)){
if(decimalFormat == null ) decimalFormat = "0.00";
DecimalFormat df = new DecimalFormat(decimalFormat);
result = df.format(Double.parseDouble(obj1.toString()));
}else{
result = obj1.toString();
}
}
}catch(Exception e){
e.printStackTrace();
}
return result;
}
/***
* 正则判断是否包含小数
* @param obj
* @return
*/
public static boolean containsDecimal(Object obj) {
if (obj == null) {
return false;
}
String str = obj.toString();
return str.matches("\\d+\\.\\d+");
}
/**
* 输入加减乘除表达式字符串,返回计算结果
*
......
......@@ -24,6 +24,7 @@ public interface ISysAlgorithmLibraryService extends IService<SysAlgorithmLibrar
*/
Map<String,Map<String,List<Map<String,Object>>>> algorithmAnalysisDayAndFill(SysAlgorithmLibraryVO sysAlgorithmLibraryVO,Map<String,Object> paramMap)throws Exception;
Map<String,Map<String,List<Map<String,Object>>>> algorithmAnalysisHour(SysAlgorithmLibraryVO sysAlgorithmLibraryVO,Map<String,Object> paramMap)throws Exception;
Map<String,Map<String,Map<String,Object>>> algorithmAnalysisRealTime(SysAlgorithmLibraryVO sysAlgorithmLibraryVO,Map<String,Object> paramMap)throws Exception;
......
......@@ -46,7 +46,7 @@ import org.springframework.web.servlet.ModelAndView;
@Api(tags="erp统购合同")
@RestController("webPurchaseContractController")
@RequestMapping("/web/erp/purchaseContract")
public class PurchaseContractController {
public class PurchaseContractController {
@Autowired
private IERPPurchaseContractService purchaseContractService;
@Autowired
......
......@@ -99,6 +99,8 @@ public class DangerInspectionRecordController {
if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){
queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ;
}
queryWrapper.orderByAsc("depart_id");
queryWrapper.orderByAsc("equipInfoId");
IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -203,7 +203,7 @@
SELECT
v.depart_id AS factoryId,
d.depart_name AS factoryName,
round( 0, 2) AS zls,
round(SUM( ifnull(v.YSL,0) ) , 2) AS zls,
round( SUM( ifnull(v.CSL/10000,0) ), 2) AS clsl,
round( 0, 4 ) AS wdzls
FROM
......
......@@ -155,15 +155,15 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
double maxValue = statistics.getMax();
//取最小值
double minValue = statistics.getMin();
long count = statistics.getCount();
Long count = statistics.getCount();
v.put("min", minValue);
v.put("max", maxValue);
v.put("minKey", finalLow);
if (count != 0) {
Integer minK = (int) Math.floor(count * finalLow / 100);
Integer maxK = (int) Math.floor(count * finalUp / 100);
v.put("minValue", datan.get(minK == 0 ? 0 : minK - 1));
v.put("maxValue", datan.get(maxK == 0 ? 0 : maxK - 1));
v.put("minValue", datan.get(minK == 0 ? 0 : minK -1));
v.put("maxValue", datan.get(maxK == 0 ? 0 : (count.intValue() -maxK-1)));
}
v.put("maxKey", finalUp);
}
......@@ -376,10 +376,15 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
if(departVO.getTotalDayNum() != null && departVO.getTotalDayNum().intValue() > 0 ){
// 达标天数 / 总天数 或 100 - 不达标天数/总天数
// System.out.println(departVO.getFactoryName()+";未达标天数:"+ (errorDay) +"; 总天数:"+departVO.getTotalDayNum());
departVO.setDb( JSUtils.format ((departVO.getTotalDayNum()-errorDay)*100/departVO.getTotalDayNum() ) );//默认百分比为100
Double d = ( departVO.getTotalDayNum()-errorDay)*100d/departVO.getTotalDayNum();
departVO.setDb( "100" );//默认百分比为100
if(d.doubleValue() == 0d){
departVO.setDb( "100" );//默认百分比为100
}else{
// departVO.setDb( JSUtils.format(d) );//默认百分比为100
}
departVO.setRemark( remark );
}
}
return departList;
}
......
......@@ -6,11 +6,15 @@ import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.DictModel;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.common.service.ICommonSqlService;
import com.skua.modules.dataAnalysis.mapper.WaterCountAnalysisNewMapper;
import com.skua.modules.dataAnalysis.service.WaterCountAnalysisNewService;
import com.skua.modules.system.datestandard.service.ISysMonitorMetricInfoService;
import com.skua.tool.util.JSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.text.DecimalFormat;
......@@ -22,6 +26,8 @@ import java.util.Map;
public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService {
@Autowired
private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
@Autowired
private ICommonSqlService commonSqlService;
@Override
public Map<String, Object> querySLDeatailList(String startTime, String endTime) {
String departIds = BaseContextHandler.getDeparts();
......@@ -82,9 +88,25 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public List<Map<String, Object>> queryZLSAnalysis(String time) {
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL", departIds, time);
String startTime = time+"-01";
String endTime = time+"-31";
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL", departIds, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"YSL", departIds, startTime,endTime);
String sql = "select d.depart_name AS factoryName,d.id AS factoryId, ifnull(eee.clsl,0) clsl,ifnull(fff.zls,0) zls , round( 0, 4 ) AS wdzls from sys_depart d ";
sql += " left join( select aaa .depart_id,round( SUM( ifnull(aaa.CSL/10000,0) ), 2) AS clsl from "+dataViewName2119+" aaa GROUP BY aaa.depart_id )eee on eee.depart_id = d.id ";
sql += " left join( select bbb.depart_id,round( SUM( ifnull(bbb.YSL,0) ), 2) AS zls from "+dataViewName3a24+" bbb GROUP BY bbb.depart_id )fff on fff.depart_id = d.id ";
sql +=" where d.depart_type =1 ";
sql += " and d.id in("+ JSUtils.quoteEach(departIds,",") +")";
sql += " order by eee.clsl desc " ;
List<Map<String, Object>> list = new ArrayList<>();
list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds);
list = commonSqlService.queryForList(sql);
if(list != null && !list.isEmpty()){
for(Map<String, Object> map : list ){
map.put("wdzls", JSUtils.divide(map.get("zls"),map.get("clsl")) );
}
}
//list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds);
return list;
}
......
......@@ -39,6 +39,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
......@@ -82,6 +83,8 @@ public class EquipmentRelationController {
.eq(StringUtils.isNotEmpty(equipmentRelation.getInfoId()), "EquipmentInfo_id", equipmentRelation.getInfoId())
.eq(StringUtils.isNotEmpty(equipmentRelation.getSparepartId()), "EquipmentSparepart_id", equipmentRelation.getSparepartId())
.queryWrapperForPage(new Page<>(pageNo, pageSize));
Map<String, String> assetTypeVal2KeyMap = EquipmentUtils.convertFunc("assetType", false);
Map<String, String> sparepartTypeVal2KeyMap = EquipmentUtils.convertFunc("sparepartType", false);
Map<String, String> equipmentTypeVal2KeyMap = EquipmentUtils.convertFunc("equipmentType", false);
......@@ -106,6 +109,11 @@ public class EquipmentRelationController {
}
return srcFieldVal;
});
// 根据姓名升序排序(使用lambda表达式)
// convertMapList.sort(Comparator.comparing(m -> (String) m.get("departId")));
pageList.setRecords(convertMapList);
result.setSuccess(true);
result.setResult(pageList);
......@@ -297,5 +305,4 @@ public class EquipmentRelationController {
}
return Result.ok("文件导入失败!");
}
}
......
......@@ -21,7 +21,7 @@
emt.real_start_time AS realStartTime,
emt.real_end_time AS realEndTime,
emt.working_hours AS workingHours,
case when (emt.real_end_time &lt;= emt.end_time and emt.working_hours &lt;= emp.limit_duration) then 1 else 2 end AS complete_tag,
case when (emt.real_end_time &lt;= emt.end_time and emt.working_hours &lt;= emp.limit_duration) then 1 else 2 end AS complete_tag,
emt.picture_url AS pictureUrl,
emt.equipment_id AS equipmentId,
emt.results_enforcement AS resultsEnforcement,
......@@ -38,7 +38,7 @@
emt. del_flag=0 and emt.start_time &lt;=now()
<if test="equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!='' and equipmentMaintainTask.getType==0">
AND (emt.maintainer_id = #{equipmentMaintainTask.planArrangerId} or (emp.plan_accepter_id= #{equipmentMaintainTask.planArrangerId}))
AND results_enforcement!='4'
AND results_enforcement!='4'
</if>
<if test="equipmentMaintainTask.getType==1 and equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!=''">
AND emt.maintainer_id = #{equipmentMaintainTask.planArrangerId}
......@@ -62,7 +62,7 @@
and emt. maintain_mode=#{equipmentMaintainTask.maintainMode}
</if>
<if test="equipmentMaintainTask.maintainLevel !=null and equipmentMaintainTask.maintainLevel !=''">
and emt. maintain_level like concat('%',#{equipmentMaintainTask.maintainLevel},'%')
and emt. maintain_level like concat('%',#{equipmentMaintainTask.maintainLevel},'%')
</if>
<if test="equipmentMaintainTask.maintainerId !=null and equipmentMaintainTask.maintainerId !=''">
and emt. maintainer_id=#{equipmentMaintainTask.maintainerId}
......@@ -90,7 +90,8 @@
and emt.working_hours &gt; emp.limit_duration
</if>
</where>
order BY emt.start_time desc
<!-- order by emt.depart_id desc , ei.equipment_name asc ,ei.structures asc -->
order BY emt.depart_id asc , ei.equipment_name asc , emt.start_time desc
</select>
<update id="updateResultsEnforcement">
update equipment_maintain_task
......@@ -158,19 +159,19 @@
INSERT INTO equipment_maintain_task_result(id, maintain_task_id, maintain_standard_id, result)
VALUES (#{id}, #{taskId}, #{standardId}, #{result})
</insert>
<select id="getTaskCalendarList" parameterType="com.skua.modules.equipment.dto.EquipmentMaintainTaskDTO" resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskCalendarVO" >
SELECT
b.*,
(select depart_name from sys_depart where id=b.depart_id) AS depart_name,
(select realname from sys_user where id=b.maintainer_id) AS maintainer_name,
a.plan_accepter_id,
a.plan_arranger_id
a.plan_arranger_id
FROM
equipment_maintain_plan a
INNER JOIN equipment_maintain_task b ON a.id = b.plan_id
WHERE
1=1
1=1
<if test="departId !=null and id !=''" >
and b.depart_id = #{departId}
</if>
......@@ -178,7 +179,7 @@
and b.maintainer_id = #{maintainerId}
</if>
<if test="resultsEnforcement !=null and resultsEnforcement !=''" >
and b.results_enforcement in
and b.results_enforcement in
<foreach item="item" index="index" collection="resultsEnforcement.split(',')" open="("
separator="," close=")">
'${item}'
......@@ -187,10 +188,10 @@
<if test="maintainPlanName !=null and maintainPlanName !=''" >
and b.maintain_plan_name like CONCAT('%', #{maintainPlanName}, '%')
</if>
and b.start_time &gt;= #{taskStartTime}
and b.start_time &lt;= #{taskEndTime}
and b.start_time &gt;= #{taskStartTime}
and b.start_time &lt;= #{taskEndTime}
ORDER BY
b.start_time
</select>
</mapper>
\ No newline at end of file
</mapper>
......
......@@ -25,7 +25,7 @@
)
AND positions = 'manager'
</select>
<select id="queryCustomPageList" parameterType="com.skua.modules.equipment.vo.EquipmentRepairVO" resultType="com.skua.modules.equipment.vo.EquipmentRepairVO">
SELECT
b.depart_name,
......@@ -41,10 +41,10 @@
WHERE
1 = 1
<if test="equipmentRepairVO.id!=null and equipmentRepairVO.id!=''">
and a.id=#{equipmentRepairVO.id}
and a.id=#{equipmentRepairVO.id}
</if>
<if test="equipmentRepairVO.departId!=null and equipmentRepairVO.departId!=''">
and a.depart_id in
and a.depart_id in
<foreach item="item" index="index" collection=" equipmentRepairVO.departId.split(',')" open="("
separator="," close=")">
'${item}'
......@@ -71,8 +71,9 @@
<if test="equipmentRepairVO.repairEndDate!=null">
and a.repair_date &lt;= #{equipmentRepairVO.repairEndDate}
</if>
order by a.depart_id desc , c.equipment_name asc ,c.structures
</select>
<select id="queryStatistics" parameterType="com.skua.modules.equipment.vo.EquipmentRepairVO" resultType="java.util.HashMap">
SELECT
a.finish_flag,count(*) as num
......@@ -86,7 +87,7 @@
and a.id=#{equipmentRepairVO.id}
</if>
<if test="equipmentRepairVO.departId!=null and equipmentRepairVO.departId!=''">
and a.depart_id in
and a.depart_id in
<foreach item="item" index="index" collection=" equipmentRepairVO.departId.split(',')" open="("
separator="," close=")">
'${item}'
......@@ -110,8 +111,8 @@
<if test="equipmentRepairVO.repairEndDate!=null">
and a.repair_date &lt;= #{equipmentRepairVO.repairEndDate}
</if>
group by a.finish_flag
</select>
</mapper>
\ No newline at end of file
</mapper>
......
......@@ -17,7 +17,7 @@
<if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%${param.sparepartName}%'</if>
<if test="param.specification != null and param.specification !=''">and es.specification like '%${param.specification}%'</if>
<if test="param.sparepartAttribute != null and param.sparepartAttribute !=''">and es.sparepart_attribute like '%${param.sparepartAttribute}%'</if>
order by es.inventory_update_time desc
order by sw.depart_id asc , es.inventory_update_time desc
</select>
<!-- 分页查询:设备关联的备品备件集合-->
......
......@@ -236,7 +236,7 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna
// {time: "2023-11", dsdh: null, fhl: null}
//查询数据
List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false);
List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false);//查询吨水电耗
List<ReportItemVO> fhlTrendList = queryFhlTrendList( factoryId, startTime, endTime);// 负荷率
//获取12个月时间集合
String dsValue = null;String fhl = null;
......@@ -443,9 +443,6 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna
sql += " )bbb ";
sql += " LEFT JOIN sys_factory_info f ON f.depart_id = bbb.depart_id ";
//查询数据
List<ReportItemVO> trendVOList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<ReportItemVO>(ReportItemVO.class));
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!