dc76ad09 张雷

feat(report): 新增运营周报展示功能

- 新增 reportWeekShowNew 方法,用于运营周报的展示
- 在 IFCustomReportDatasetService 接口中添加 reportWeekShowNew 方法
- 在 ReportDataController 中添加 reportWeekShowNew 接口
- 新增 DepartEquipRemarkVO 类用于维修情况备注
- 在 WeekReportRemarkMapper 中添加 getWxList 和 getGxList 方法
- 在 WeekReportRemarkServiceImpl 中实现 getWxList 和 getGxList 方法
- 修改 FCustomReportDatasetMapper 中的 getWeekReportData 方法,增加 departIds 参数
- 更新 FCustomReportDatasetMapper.xml 中的 SQL 查询,支持按部门 ID 查询
1 个父辈 8a8794c0
...@@ -106,7 +106,7 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData ...@@ -106,7 +106,7 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
106 106
107 List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate, 107 List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate,
108 @Param(value="dataViewName3a24") String dataViewName3a24, 108 @Param(value="dataViewName3a24") String dataViewName3a24,
109 @Param(value="dataViewName2119") String dataViewName2119); 109 @Param(value="dataViewName2119") String dataViewName2119, @Param(value="departIds") String departIds);
110 110
111 List<JnhbReportData> getJnhbReport(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3, 111 List<JnhbReportData> getJnhbReport(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3,
112 @Param(value="dataViewName4") String dataViewName4, 112 @Param(value="dataViewName4") String dataViewName4,
......
...@@ -255,6 +255,12 @@ ...@@ -255,6 +255,12 @@
255 where v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} GROUP BY v.depart_id) v2 on v2.depart_id = d.id 255 where v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} GROUP BY v.depart_id) v2 on v2.depart_id = d.id
256 WHERE 256 WHERE
257 d.depart_type = 1 257 d.depart_type = 1
258 <if test="departIds != null and departIds !=''">
259 and d.id in
260 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
261 '${item}'
262 </foreach>
263 </if>
258 ORDER BY 264 ORDER BY
259 d.depart_order 265 d.depart_order
260 </select> 266 </select>
......
...@@ -162,4 +162,6 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData ...@@ -162,4 +162,6 @@ public interface IFCustomReportDatasetService extends IService<FCustomReportData
162 String startTime, String endTime, String departId); 162 String startTime, String endTime, String departId);
163 163
164 List<ResultNumberVO> statisticsByXjl(String departIds, String startDate, String endDate); 164 List<ResultNumberVO> statisticsByXjl(String departIds, String startDate, String endDate);
165
166 Map<String, Object> reportWeekShowNew(String departId, String dataTime, String week);
165 } 167 }
......
1 package com.skua.modules.custom.service.impl; 1 package com.skua.modules.custom.service.impl;
2 2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3 import com.skua.common.constant.ReportConstant; 4 import com.skua.common.constant.ReportConstant;
4 import com.skua.common.report.ReportViewUtil; 5 import com.skua.common.report.ReportViewUtil;
6 import com.skua.core.context.BaseContextHandler;
5 import com.skua.core.context.SpringContextUtils; 7 import com.skua.core.context.SpringContextUtils;
6 import com.skua.core.util.ConvertUtils; 8 import com.skua.core.util.ConvertUtils;
7 import com.skua.modules.common.mapper.CommonSqlMapper; 9 import com.skua.modules.common.mapper.CommonSqlMapper;
...@@ -9,6 +11,7 @@ import com.skua.modules.common.vo.DateVO; ...@@ -9,6 +11,7 @@ import com.skua.modules.common.vo.DateVO;
9 import com.skua.modules.custom.entity.FCustomReportDataset; 11 import com.skua.modules.custom.entity.FCustomReportDataset;
10 import com.skua.modules.custom.mapper.FCustomReportDatasetMapper; 12 import com.skua.modules.custom.mapper.FCustomReportDatasetMapper;
11 import com.skua.modules.custom.service.IFCustomReportDatasetService; 13 import com.skua.modules.custom.service.IFCustomReportDatasetService;
14 import com.skua.modules.custom.vo.DepartEquipRemarkVO;
12 import com.skua.modules.custom.vo.DepartWeekReportVO; 15 import com.skua.modules.custom.vo.DepartWeekReportVO;
13 import com.skua.modules.custom.vo.FCustomReportDatasetVO; 16 import com.skua.modules.custom.vo.FCustomReportDatasetVO;
14 import java.text.DecimalFormat; 17 import java.text.DecimalFormat;
...@@ -17,12 +20,18 @@ import java.time.format.DateTimeFormatter; ...@@ -17,12 +20,18 @@ import java.time.format.DateTimeFormatter;
17 import java.time.temporal.TemporalAdjusters; 20 import java.time.temporal.TemporalAdjusters;
18 import java.time.temporal.WeekFields; 21 import java.time.temporal.WeekFields;
19 import java.util.*; 22 import java.util.*;
23
24 import com.skua.modules.report.entity.WeekReportRemark;
25 import com.skua.modules.report.service.IWeekReportRemarkService;
20 import com.skua.modules.report.vo.*; 26 import com.skua.modules.report.vo.*;
21 import com.skua.modules.report.vo.largeScreen.*; 27 import com.skua.modules.report.vo.largeScreen.*;
28 import com.skua.modules.system.entity.SysDepart;
29 import com.skua.modules.system.service.ISysDepartService;
22 import com.skua.tool.util.DateUtils; 30 import com.skua.tool.util.DateUtils;
23 import com.skua.tool.util.JSUtils; 31 import com.skua.tool.util.JSUtils;
24 import io.micrometer.core.instrument.util.TimeUtils; 32 import io.micrometer.core.instrument.util.TimeUtils;
25 import org.apache.commons.lang.StringUtils; 33 import org.apache.commons.lang.StringUtils;
34 import org.springframework.beans.factory.annotation.Autowired;
26 import org.springframework.jdbc.core.BeanPropertyRowMapper; 35 import org.springframework.jdbc.core.BeanPropertyRowMapper;
27 import org.springframework.jdbc.core.JdbcTemplate; 36 import org.springframework.jdbc.core.JdbcTemplate;
28 import org.springframework.stereotype.Service; 37 import org.springframework.stereotype.Service;
...@@ -39,6 +48,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -39,6 +48,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
39 private FCustomReportDatasetMapper mapper; 48 private FCustomReportDatasetMapper mapper;
40 @Resource 49 @Resource
41 private CommonSqlMapper commonSqlMapper; 50 private CommonSqlMapper commonSqlMapper;
51 @Autowired
52 private ISysDepartService departService;
53 @Autowired
54 private IWeekReportRemarkService weekReportRemarkService;
42 private static DecimalFormat df = new DecimalFormat("#.##"); 55 private static DecimalFormat df = new DecimalFormat("#.##");
43 56
44 /* (non-Javadoc) 57 /* (non-Javadoc)
...@@ -538,6 +551,135 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -538,6 +551,135 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
538 return reduceStatisticsList; 551 return reduceStatisticsList;
539 } 552 }
540 553
554 @Override
555 public Map<String, Object> reportWeekShowNew(String departId, String dataTime, String week) {
556 String yearMonthWeek = dataTime+"-"+week;
557 String jtCode = "af880d6a13404a67825e94bc0f2f3808";
558 String qyCode = "1818215543140909056,1892199890272477184,1892199062790823936";
559 Map<String, Object> map = new HashMap<>();
560 List<Map<String, Object>> areaList = new ArrayList<>();
561 Map<String,String> weekMap = getWeekDate(dataTime,week);
562 String startDate = weekMap.get("start");
563 String endDate = weekMap.get("end");
564 map.put("start",startDate);
565 map.put("end",endDate);
566 String departs = "";
567 if(jtCode.equals(departId)){
568 departs = qyCode;
569 }else{
570 departs = departId;
571 }
572 SysDepart dataDepart = departService.getById(departId);
573 map.put("departId", departId);
574 map.put("departName", dataDepart.getDepartName());
575 QueryWrapper<SysDepart> queryWrapper = new QueryWrapper<>();
576 queryWrapper.in("id", Arrays.asList(departs.split(",")));
577 queryWrapper.orderByAsc("depart_order");
578 List<SysDepart> departList = departService.list(queryWrapper);
579 for (SysDepart depart : departList) {
580 Map<String, Object> departMap = new HashMap<>();
581 departMap.put("departId", depart.getId());
582 departMap.put("departName", depart.getDepartName());
583 List<DepartWeekReportVO> list = new ArrayList<>();
584 List<DepartWeekReportVO> hbList = new ArrayList<>();
585 String departIds = departService.getChildDepartId(depart.getId());
586 String startDateHb = getBeforeDate(startDate,7);
587 String endDateHb = getBeforeDate(endDate,7);
588 String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj + "," + ReportConstant.fieldWnl;
589 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, departIds, startDate, endDate);
590 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departIds, startDate, endDate);
591 list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119, departIds);
592 String dataViewName3a24Hb = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, departIds, startDateHb, endDateHb);
593 String dataViewName2119Hb = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departIds, startDateHb, endDateHb);
594 hbList = mapper.getWeekReportData(startDateHb, endDateHb, dataViewName3a24Hb, dataViewName2119Hb, departIds);
595 Map<String, Object> totalMap = getTotalData(list);
596 Map<String, Object> totalMapHb = getTotalData(hbList);
597 departMap.put("start", startDate);//开始时间
598 departMap.put("end", endDate);//结束时间
599 String zclsl = totalMap.getOrDefault("zclsl","0").toString();
600 departMap.put("zclsl", zclsl);//处理水量合计
601
602 String rjclsl = totalMap.getOrDefault("rjclsl","0").toString();
603 departMap.put("rjclsl", rjclsl);//日均处理水量
604 String rjclslHb = totalMapHb.getOrDefault("rjclsl","0").toString();
605 String rjclslStr = "";//文字描述
606 String dsdhStr = "";//文字描述
607 //较上周增减量 rjclsl - rjclslHb
608 if(Double.parseDouble(rjclsl)-Double.parseDouble(rjclslHb) > 0){
609 rjclslStr = "+"+df.format(Double.parseDouble(rjclsl)-Double.parseDouble(rjclslHb))+"万吨/日";
610 }else if(Double.parseDouble(rjclsl)-Double.parseDouble(rjclslHb) < 0){
611 rjclslStr = df.format(Double.parseDouble(rjclsl)-Double.parseDouble(rjclslHb))+"万吨/日";
612 }else{
613 rjclslStr = "持平";
614 }
615 departMap.put("rjclsl_hb", rjclslStr);
616 String dsdh = totalMap.getOrDefault("dsdh","0").toString();
617 departMap.put("dsdh", dsdh);//吨水电耗
618 String dsdhHb = totalMapHb.getOrDefault("dsdh","0").toString();
619 //吨水电耗较上周增减量 dsdh - dsdhHb
620 if(Double.parseDouble(dsdh)-Double.parseDouble(dsdhHb) > 0){
621 dsdhStr = "+"+df.format(Double.parseDouble(dsdh)-Double.parseDouble(dsdhHb))+"Kwh/吨";
622 }else if(Double.parseDouble(dsdh)-Double.parseDouble(dsdhHb) < 0){
623 dsdhStr = df.format(Double.parseDouble(dsdh)-Double.parseDouble(dsdhHb))+"Kwh/吨";
624 }else{
625 dsdhStr = "持平";
626 }
627 departMap.put("dsdh_hb", dsdhStr);
628 String cnl = totalMap.getOrDefault("cnl","0").toString();
629 departMap.put("cnl", cnl);//产泥量
630 departMap.put("list", list);
631
632 WeekReportRemark weekReportRemark = weekReportRemarkService.getInfoByDepartId(yearMonthWeek,depart.getId());
633 if(weekReportRemark != null){
634 departMap.put("scqk", weekReportRemark.getCraftRemark());//生产情况
635 departMap.put("aqgz", weekReportRemark.getSafeRemark());//安全工作
636 }else{
637 departMap.put("scqk", "本周暂无情况");//生产情况
638 departMap.put("aqgz", "本周暂无情况");//安全工作
639 }
640 departMap.put("wxqk", getWxAndGxRemark(startDate,endDate,departIds));//
641 areaList.add(departMap);
642 }
643 map.put("list",areaList);
644 map.put("data","");
645 if(jtCode.equals(departId)){
646 WeekReportRemark weekReportRemark = weekReportRemarkService.getInfoByDepartId(yearMonthWeek,departId);
647 if(weekReportRemark != null){
648 map.put("data",weekReportRemark.getManageRemark());
649 }
650 }
651 return map;
652 }
653
654 //更新维护备注
655 private String getWxAndGxRemark(String startDate, String endDate, String departIds) {
656 String conclusion = "";
657 //维保记录(大修和基建)
658 List<DepartEquipRemarkVO> wxList = weekReportRemarkService.getWxList(startDate, endDate, departIds);
659 if(wxList.size()>0){
660 for (int i = 0; i < wxList.size(); i++) {
661 DepartEquipRemarkVO wxVO = wxList.get(i);
662 if("jjwx".equals(wxVO.getMaintenanceType())){
663 conclusion += "("+(i+1)+")"+wxVO.getDepartName() + wxVO.getRecordTime() + "进行"+wxVO.getPlanName()+"基建维修,";
664 }else{
665 conclusion += "("+(i+1)+")"+wxVO.getDepartName() + wxVO.getRecordTime() + "对"+wxVO.getEquipmentName()+"设备进行大修技改,";
666 }
667 }
668 }
669 int numStart = wxList.size();
670 //设备购置记录(更新)
671 List<DepartEquipRemarkVO> gxList = weekReportRemarkService.getGxList(startDate, endDate, departIds);
672 if(gxList.size()>0){
673 for (int i = 0; i < gxList.size(); i++) {
674 DepartEquipRemarkVO gxVO = gxList.get(i);
675 int num = numStart + i;
676 conclusion += "("+num+")"+gxVO.getDepartName() + gxVO.getRecordTime() + "购置"+gxVO.getEquipmentName()+",";
677 }
678 }
679 if(ConvertUtils.isEmpty(conclusion)){conclusion = "本周暂无情况";}
680 return conclusion;
681 }
682
541 /**转换为Map<部门编号,JnhbReportData> */ 683 /**转换为Map<部门编号,JnhbReportData> */
542 private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData> 684 private Map<String,JnhbReportData> convertJnhbReportDataMap(List<JnhbReportData> dataList){// Map<部门编号,JnhbReportData>
543 Map<String,JnhbReportData> dataMap = new HashMap<>(); 685 Map<String,JnhbReportData> dataMap = new HashMap<>();
...@@ -649,10 +791,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa ...@@ -649,10 +791,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
649 String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj + "," + ReportConstant.fieldWnl; 791 String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj + "," + ReportConstant.fieldWnl;
650 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate); 792 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
651 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, "", startDate, endDate); 793 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, "", startDate, endDate);
652 list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119); 794 list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119,null);
653 String dataViewName3a24Hb = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDateHb, endDateHb); 795 String dataViewName3a24Hb = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDateHb, endDateHb);
654 String dataViewName2119Hb = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, "", startDateHb, endDateHb); 796 String dataViewName2119Hb = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, "", startDateHb, endDateHb);
655 hbList = mapper.getWeekReportData(startDateHb, endDateHb, dataViewName3a24Hb, dataViewName2119Hb); 797 hbList = mapper.getWeekReportData(startDateHb, endDateHb, dataViewName3a24Hb, dataViewName2119Hb,null);
656 Map<String, Object> totalMap = getTotalData(list); 798 Map<String, Object> totalMap = getTotalData(list);
657 Map<String, Object> totalMapHb = getTotalData(hbList); 799 Map<String, Object> totalMapHb = getTotalData(hbList);
658 map.put("start", startDate);//开始时间 800 map.put("start", startDate);//开始时间
......
1 package com.skua.modules.custom.vo;
2
3 import io.swagger.annotations.ApiModel;
4 import io.swagger.annotations.ApiModelProperty;
5 import lombok.Data;
6
7 /**
8 * 维修情况备注
9 */
10 @Data
11 @ApiModel(value="维修情况备注", description="维修情况备注")
12 public class DepartEquipRemarkVO {
13 /**厂区名称*/
14 @ApiModelProperty(value = "厂区名称")
15 private String departName;
16 /**设计规模*/
17 @ApiModelProperty(value = "记录时间")
18 private String recordTime;
19 /**实际水量*/
20 @ApiModelProperty(value = "设备名称")
21 private String equipmentName;
22 /**污泥量*/
23 @ApiModelProperty(value = "计划名称")
24 private String planName;
25 /**吨水电耗*/
26 @ApiModelProperty(value = "计划类型")
27 private String maintenanceType;
28 }
...@@ -5,6 +5,7 @@ import com.skua.common.report.ReportViewUtil; ...@@ -5,6 +5,7 @@ import com.skua.common.report.ReportViewUtil;
5 import com.skua.core.api.vo.Result; 5 import com.skua.core.api.vo.Result;
6 import com.skua.core.context.BaseContextHandler; 6 import com.skua.core.context.BaseContextHandler;
7 import com.skua.core.context.SpringContextUtils; 7 import com.skua.core.context.SpringContextUtils;
8 import com.skua.core.util.ConvertUtils;
8 import com.skua.modules.dataAnalysis.vo.ProcessProgressVO; 9 import com.skua.modules.dataAnalysis.vo.ProcessProgressVO;
9 import com.skua.modules.dataAnalysis.vo.SafeProgressVO; 10 import com.skua.modules.dataAnalysis.vo.SafeProgressVO;
10 import com.skua.modules.dataAnalysis.vo.WorkProgressVO; 11 import com.skua.modules.dataAnalysis.vo.WorkProgressVO;
...@@ -361,7 +362,11 @@ public class WorkAnalysisController { ...@@ -361,7 +362,11 @@ public class WorkAnalysisController {
361 sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id "; 362 sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id ";
362 363
363 //生产运营月报表:月收费水量、月药费 364 //生产运营月报表:月收费水量、月药费
364 String view4411Sql = ReportViewUtil.buildView(ReportConstant.view4411,"yyf,ysfsl",departIds,startTime,endTime); 365 String yyTime = "2000-01";
366 if(ConvertUtils.isNotEmpty(startTime)){
367 yyTime = startTime.substring(0,7);
368 }
369 String view4411Sql = ReportViewUtil.buildViewLike(ReportConstant.view4411,"yyf,ysfsl", departIds, yyTime);
365 sql += " left join (select eee.depart_id ,count(1) 'count' from (select left(ee.time,7) time , ee.depart_id from "+view4411Sql+ " ee where 1=1 and ee.yyf is not null and ee.yyf <> '' and ee.ysfsl is not null and ee.ysfsl <> '' group by ee.depart_id ,left(ee.time,7) )eee group by eee.depart_id )fff on fff.depart_id = d.id "; 370 sql += " left join (select eee.depart_id ,count(1) 'count' from (select left(ee.time,7) time , ee.depart_id from "+view4411Sql+ " ee where 1=1 and ee.yyf is not null and ee.yyf <> '' and ee.ysfsl is not null and ee.ysfsl <> '' group by ee.depart_id ,left(ee.time,7) )eee group by eee.depart_id )fff on fff.depart_id = d.id ";
366 sql += " "; 371 sql += " ";
367 //目标年报 :年度目标报表改成生产经营报表的统计 372 //目标年报 :年度目标报表改成生产经营报表的统计
......
...@@ -175,6 +175,16 @@ public class ReportDataController { ...@@ -175,6 +175,16 @@ public class ReportDataController {
175 return result; 175 return result;
176 } 176 }
177 177
178 @AutoLog(value = "运营周报word展示_NEW")
179 @ApiOperation(value = "运营周报word展示_NEW", notes = "运营周报word展示_NEW")
180 @GetMapping(value = "/reportWeekShowNew")
181 public Result<Map<String,Object>> reportWeekShowNew(String time,String week,String departId) {
182 Result<Map<String,Object>> result = new Result<>();
183 Map<String,Object> map = fCustomReportDatasetService.reportWeekShowNew(departId, time, week);
184 result.setResult(map);
185 return result;
186 }
187
178 @AutoLog(value = "能源节约与生态环境保护统计表展示") 188 @AutoLog(value = "能源节约与生态环境保护统计表展示")
179 @ApiOperation(value = "能源节约与生态环境保护统计表展示", notes = "能源节约与生态环境保护统计表展示") 189 @ApiOperation(value = "能源节约与生态环境保护统计表展示", notes = "能源节约与生态环境保护统计表展示")
180 @GetMapping(value = "/jnhbReportShow") 190 @GetMapping(value = "/jnhbReportShow")
......
...@@ -84,7 +84,7 @@ public class WeekReportRemarkController { ...@@ -84,7 +84,7 @@ public class WeekReportRemarkController {
84 @GetMapping(value = "/getInfo") 84 @GetMapping(value = "/getInfo")
85 public Result<WeekReportRemark> getInfo(WeekReportRemark weekReportRemark) { 85 public Result<WeekReportRemark> getInfo(WeekReportRemark weekReportRemark) {
86 Result<WeekReportRemark> result = new Result<WeekReportRemark>(); 86 Result<WeekReportRemark> result = new Result<WeekReportRemark>();
87 WeekReportRemark remark = weekReportRemarkService.getInfo(weekReportRemark); 87 WeekReportRemark remark = weekReportRemarkService.getInfoByDepartId(weekReportRemark.getMonthWeek(),weekReportRemark.getDepartId());
88 result.setSuccess(true); 88 result.setSuccess(true);
89 result.setResult(remark); 89 result.setResult(remark);
90 return result; 90 return result;
...@@ -95,7 +95,7 @@ public class WeekReportRemarkController { ...@@ -95,7 +95,7 @@ public class WeekReportRemarkController {
95 @PostMapping(value = "/save") 95 @PostMapping(value = "/save")
96 public Result<WeekReportRemark> save(@RequestBody WeekReportRemark weekReportRemark) { 96 public Result<WeekReportRemark> save(@RequestBody WeekReportRemark weekReportRemark) {
97 Result<WeekReportRemark> result = new Result<WeekReportRemark>(); 97 Result<WeekReportRemark> result = new Result<WeekReportRemark>();
98 WeekReportRemark remark = weekReportRemarkService.getInfo(weekReportRemark); 98 WeekReportRemark remark = weekReportRemarkService.getInfoByDepartId(weekReportRemark.getMonthWeek(),weekReportRemark.getDepartId());
99 if(remark!=null){ 99 if(remark!=null){
100 weekReportRemark.setId(remark.getId()); 100 weekReportRemark.setId(remark.getId());
101 weekReportRemarkService.updateById(weekReportRemark); 101 weekReportRemarkService.updateById(weekReportRemark);
......
...@@ -2,6 +2,7 @@ package com.skua.modules.report.mapper; ...@@ -2,6 +2,7 @@ package com.skua.modules.report.mapper;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
5 import com.skua.modules.custom.vo.DepartEquipRemarkVO;
5 import org.apache.ibatis.annotations.Param; 6 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.report.entity.WeekReportRemark; 7 import com.skua.modules.report.entity.WeekReportRemark;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 8 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -12,4 +13,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -12,4 +13,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
12 public interface WeekReportRemarkMapper extends BaseMapper<WeekReportRemark> { 13 public interface WeekReportRemarkMapper extends BaseMapper<WeekReportRemark> {
13 14
14 WeekReportRemark getInfo(@Param("monthWeek") String monthWeek); 15 WeekReportRemark getInfo(@Param("monthWeek") String monthWeek);
16
17 WeekReportRemark getInfoByDepartId(@Param("yearMonthWeek") String yearMonthWeek, @Param("departId") String departId);
18
19 List<DepartEquipRemarkVO> getWxList(@Param("startDate") String startDate, @Param("endDate") String endDate,
20 @Param("departIds") String departIds);
21
22 List<DepartEquipRemarkVO> getGxList(@Param("startDate") String startDate, @Param("endDate") String endDate,
23 @Param("departIds") String departIds);
15 } 24 }
......
...@@ -6,4 +6,39 @@ ...@@ -6,4 +6,39 @@
6 select * from week_report_remark where month_week = #{monthWeek} limit 1 6 select * from week_report_remark where month_week = #{monthWeek} limit 1
7 </select> 7 </select>
8 8
9 <select id="getInfoByDepartId" resultType="com.skua.modules.report.entity.WeekReportRemark">
10 select * from week_report_remark where month_week = #{yearMonthWeek} and depart_id = #{departId} limit 1
11 </select>
12
13 <select id="getWxList" resultType="com.skua.modules.custom.vo.DepartEquipRemarkVO">
14 select d.depart_name,t.real_start_time as record_time,e.equipment_name,p.plan_name,p.maintenance_type from sys_depart d
15 left join equipment_maintain_task t on t.depart_id = d.id
16 left join equipment_info e on t.equipment_id = e.id
17 left join equipment_maintain_plan p on t.plan_id = p.id
18 where t.results_enforcement = '4'
19 <if test="departIds != null and departIds !=''">
20 and d.id in
21 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
22 '${item}'
23 </foreach>
24 </if>
25 and p.maintenance_type in('jjwx','dxjg')
26 and t.real_start_time BETWEEN #{startDate} and #{endDate}
27 ORDER BY d.id,t.real_start_time
28 </select>
29
30 <select id="getGxList" resultType="com.skua.modules.custom.vo.DepartEquipRemarkVO">
31 select d.depart_name,e.intake_date as record_time,e.equipment_name from equipment_info e
32 left join sys_depart d on e.depart_id = d.id
33 where 1=1
34 <if test="departIds != null and departIds !=''">
35 and d.id in
36 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
37 '${item}'
38 </foreach>
39 </if>
40 and e.intake_date between #{startDate} and #{endDate}
41 </select>
42
43
9 </mapper> 44 </mapper>
......
1 package com.skua.modules.report.service; 1 package com.skua.modules.report.service;
2 2
3 import com.skua.modules.custom.vo.DepartEquipRemarkVO;
3 import com.skua.modules.report.entity.WeekReportRemark; 4 import com.skua.modules.report.entity.WeekReportRemark;
4 import com.baomidou.mybatisplus.extension.service.IService; 5 import com.baomidou.mybatisplus.extension.service.IService;
5 6
7 import java.util.List;
8
6 /** 9 /**
7 * 运营周报补充填报 10 * 运营周报补充填报
8 */ 11 */
9 public interface IWeekReportRemarkService extends IService<WeekReportRemark> { 12 public interface IWeekReportRemarkService extends IService<WeekReportRemark> {
10 13
11 WeekReportRemark getInfo(WeekReportRemark weekReportRemark); 14 WeekReportRemark getInfo(WeekReportRemark weekReportRemark);
15
16 WeekReportRemark getInfoByDepartId(String yearMonthWeek, String departId);
17
18 List<DepartEquipRemarkVO> getWxList(String startDate, String endDate, String departIds);
19
20 List<DepartEquipRemarkVO> getGxList(String startDate, String endDate, String departIds);
12 } 21 }
......
1 package com.skua.modules.report.service.impl; 1 package com.skua.modules.report.service.impl;
2 2
3 import com.skua.modules.custom.vo.DepartEquipRemarkVO;
3 import com.skua.modules.report.entity.WeekReportRemark; 4 import com.skua.modules.report.entity.WeekReportRemark;
4 import com.skua.modules.report.mapper.ReportTargetConfigSubMapper; 5 import com.skua.modules.report.mapper.ReportTargetConfigSubMapper;
5 import com.skua.modules.report.mapper.WeekReportRemarkMapper; 6 import com.skua.modules.report.mapper.WeekReportRemarkMapper;
...@@ -9,6 +10,10 @@ import org.springframework.stereotype.Service; ...@@ -9,6 +10,10 @@ import org.springframework.stereotype.Service;
9 10
10 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
11 12
13 import java.util.ArrayList;
14 import java.util.Collections;
15 import java.util.List;
16
12 /** 17 /**
13 * 运营周报补充填报 18 * 运营周报补充填报
14 */ 19 */
...@@ -26,4 +31,25 @@ public class WeekReportRemarkServiceImpl extends ServiceImpl<WeekReportRemarkMap ...@@ -26,4 +31,25 @@ public class WeekReportRemarkServiceImpl extends ServiceImpl<WeekReportRemarkMap
26 } 31 }
27 return remark; 32 return remark;
28 } 33 }
34
35 @Override
36 public WeekReportRemark getInfoByDepartId(String yearMonthWeek, String departId) {
37 WeekReportRemark remark = new WeekReportRemark();
38 remark = weekReportRemarkMapper.getInfoByDepartId(yearMonthWeek, departId);
39 return remark;
40 }
41
42 @Override
43 public List<DepartEquipRemarkVO> getWxList(String startDate, String endDate, String departIds) {
44 List<DepartEquipRemarkVO> list = new ArrayList<>();
45 list = weekReportRemarkMapper.getWxList(startDate+" 00:00:00", endDate+" 23:59:59", departIds);
46 return list;
47 }
48
49 @Override
50 public List<DepartEquipRemarkVO> getGxList(String startDate, String endDate, String departIds) {
51 List<DepartEquipRemarkVO> list = new ArrayList<>();
52 list = weekReportRemarkMapper.getGxList(startDate, endDate, departIds);
53 return list;
54 }
29 } 55 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!