数据BUG修改
正在显示
6 个修改的文件
包含
51 行增加
和
8 行删除
... | @@ -53,6 +53,8 @@ public class ScybReportHandle implements ICustomHandle{ | ... | @@ -53,6 +53,8 @@ public class ScybReportHandle implements ICustomHandle{ |
53 | dataFieldDict.put("time", "时间"); | 53 | dataFieldDict.put("time", "时间"); |
54 | dataFieldDict.put("paramDepart", "参数机构"); | 54 | dataFieldDict.put("paramDepart", "参数机构"); |
55 | dataFieldDict.put("depart_id", "厂站编码"); | 55 | dataFieldDict.put("depart_id", "厂站编码"); |
56 | dataFieldDict.put("yddf", "电费"); | ||
57 | dataFieldDict.put("wxfy", "设备维修费"); | ||
56 | //获取填报数据 | 58 | //获取填报数据 |
57 | String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"", departIds, month); | 59 | String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"", departIds, month); |
58 | //结果集 | 60 | //结果集 | ... | ... |
... | @@ -837,10 +837,15 @@ | ... | @@ -837,10 +837,15 @@ |
837 | v4.dhcmbzyy, | 837 | v4.dhcmbzyy, |
838 | v4.bnyhmb, | 838 | v4.bnyhmb, |
839 | v4.bnsjyh, | 839 | v4.bnsjyh, |
840 | v4.yhcyqyy | 840 | v4.yhcyqyy, |
841 | c.cost AS yddf, | ||
842 | r.total_cost AS wxfy | ||
841 | FROM | 843 | FROM |
842 | sys_depart d | 844 | sys_depart d |
843 | LEFT JOIN ( SELECT * FROM ${dataViewName4411} v WHERE v.time = #{month} ) v4 ON v4.depart_id = d.id | 845 | LEFT JOIN ( SELECT * FROM ${dataViewName4411} v WHERE v.time = #{month} ) v4 ON v4.depart_id = d.id |
846 | LEFT JOIN ( SELECT cost,depart_id FROM report_electric_cost WHERE month = #{month} ) c ON c.depart_id = d.id | ||
847 | LEFT JOIN ( SELECT ROUND(SUM(total_cost),2) AS total_cost,depart_id FROM equipment_repair | ||
848 | WHERE LEFT(repair_date,7) = #{month} GROUP BY LEFT(repair_date,7),depart_id ) r ON r.depart_id = d.id | ||
844 | WHERE | 849 | WHERE |
845 | d.id IN | 850 | d.id IN |
846 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | 851 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ... | ... |
... | @@ -175,6 +175,13 @@ public class FReportHeaderConfigController { | ... | @@ -175,6 +175,13 @@ public class FReportHeaderConfigController { |
175 | list = fReportHeaderConfigService.list(queryWrapper); | 175 | list = fReportHeaderConfigService.list(queryWrapper); |
176 | if(list.size() == 0){ | 176 | if(list.size() == 0){ |
177 | List<FReportItem> itemList = fReportItemService.getListByReportId(fReportHeaderConfig.getReportId()); | 177 | List<FReportItem> itemList = fReportItemService.getListByReportId(fReportHeaderConfig.getReportId()); |
178 | FReportHeaderConfig timeHeader = new FReportHeaderConfig(); | ||
179 | timeHeader.setReportId(fReportHeaderConfig.getReportId()); | ||
180 | timeHeader.setDepartId(fReportHeaderConfig.getDepartId()); | ||
181 | timeHeader.setItemCode("time"); | ||
182 | timeHeader.setItemName("时间"); | ||
183 | timeHeader.setSortNum(0); | ||
184 | list.add(timeHeader); | ||
178 | for (FReportItem reportItem : itemList) { | 185 | for (FReportItem reportItem : itemList) { |
179 | FReportHeaderConfig config = new FReportHeaderConfig(); | 186 | FReportHeaderConfig config = new FReportHeaderConfig(); |
180 | config.setReportId(fReportHeaderConfig.getReportId()); | 187 | config.setReportId(fReportHeaderConfig.getReportId()); | ... | ... |
... | @@ -3,14 +3,11 @@ package com.skua.modules.equipment.controller; | ... | @@ -3,14 +3,11 @@ package com.skua.modules.equipment.controller; |
3 | import java.io.*; | 3 | import java.io.*; |
4 | import java.time.LocalDate; | 4 | import java.time.LocalDate; |
5 | import java.time.format.DateTimeFormatter; | 5 | import java.time.format.DateTimeFormatter; |
6 | import java.util.ArrayList; | 6 | import java.util.*; |
7 | import java.util.Date; | ||
8 | import java.util.HashMap; | ||
9 | import java.util.LinkedHashMap; | ||
10 | import java.util.List; | ||
11 | import java.util.Map; | ||
12 | import javax.servlet.http.HttpServletRequest; | 7 | import javax.servlet.http.HttpServletRequest; |
13 | import javax.servlet.http.HttpServletResponse; | 8 | import javax.servlet.http.HttpServletResponse; |
9 | |||
10 | import com.skua.core.context.BaseContextHandler; | ||
14 | import org.apache.commons.lang.StringUtils; | 11 | import org.apache.commons.lang.StringUtils; |
15 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; | 12 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
16 | import org.apache.poi.ss.usermodel.Sheet; | 13 | import org.apache.poi.ss.usermodel.Sheet; |
... | @@ -268,7 +265,7 @@ public class EquipmentController { | ... | @@ -268,7 +265,7 @@ public class EquipmentController { |
268 | @AutoLog(value = "设备台账-设备使用状态统计") | 265 | @AutoLog(value = "设备台账-设备使用状态统计") |
269 | @ApiOperation(value = "设备台账-设备使用状态统计", notes = "设备台账-设备使用状态统计") | 266 | @ApiOperation(value = "设备台账-设备使用状态统计", notes = "设备台账-设备使用状态统计") |
270 | @GetMapping(value = "/equipmentStatus") | 267 | @GetMapping(value = "/equipmentStatus") |
271 | public Result<Object> equipmentStatusCtrl(String isSpecial) throws Exception { | 268 | public Result<Object> equipmentStatusCtrl(String isSpecial,String departId) throws Exception { |
272 | Result<Object> result = new Result<>(); | 269 | Result<Object> result = new Result<>(); |
273 | // equipmentStatus: 设备类型value:key的转换 | 270 | // equipmentStatus: 设备类型value:key的转换 |
274 | Map<String, String> equipmentStatusVal2KeyMap = EquipmentUtils.convertFunc("equipmentStatus", false); | 271 | Map<String, String> equipmentStatusVal2KeyMap = EquipmentUtils.convertFunc("equipmentStatus", false); |
... | @@ -284,10 +281,21 @@ public class EquipmentController { | ... | @@ -284,10 +281,21 @@ public class EquipmentController { |
284 | flag = true; | 281 | flag = true; |
285 | equipmentInfo.setIsSpecial(isSpecial); | 282 | equipmentInfo.setIsSpecial(isSpecial); |
286 | } | 283 | } |
284 | if(ConvertUtils.isNotEmpty(departId)){ | ||
285 | equipmentInfo.setDepartId(departId); | ||
286 | }else{ | ||
287 | |||
288 | } | ||
287 | equipment.setEquipmentInfo(equipmentInfo); | 289 | equipment.setEquipmentInfo(equipmentInfo); |
288 | String sql = JoinSqlUtils.multiJoinSqlQuery(equipment); | 290 | String sql = JoinSqlUtils.multiJoinSqlQuery(equipment); |
289 | sql = "select res.EquipmentInfo_equipmentStatus, count(*) as total from (" + sql + ") as res"; | 291 | sql = "select res.EquipmentInfo_equipmentStatus, count(*) as total from (" + sql + ") as res"; |
290 | QueryWrapper<?> queryWrapper = new QueryWrapper<>(); | 292 | QueryWrapper<?> queryWrapper = new QueryWrapper<>(); |
293 | if(ConvertUtils.isNotEmpty(departId)){ | ||
294 | queryWrapper.eq("EquipmentInfo_departId", departId); | ||
295 | }else{ | ||
296 | String departs = BaseContextHandler.getDeparts(); | ||
297 | queryWrapper.in("EquipmentInfo_departId", Arrays.asList(departs.split(","))); | ||
298 | } | ||
291 | queryWrapper.eq(flag, "EquipmentInfo_isSpecial", isSpecial) | 299 | queryWrapper.eq(flag, "EquipmentInfo_isSpecial", isSpecial) |
292 | .groupBy("EquipmentInfo_equipmentStatus");//EquipmentInfo_isSpecial | 300 | .groupBy("EquipmentInfo_equipmentStatus");//EquipmentInfo_isSpecial |
293 | List<Map<String, Object>> countMapList = iCommonSqlService.queryWrapperForList(sql, queryWrapper); | 301 | List<Map<String, Object>> countMapList = iCommonSqlService.queryWrapperForList(sql, queryWrapper); |
... | @@ -359,6 +367,16 @@ public class EquipmentController { | ... | @@ -359,6 +367,16 @@ public class EquipmentController { |
359 | return result; | 367 | return result; |
360 | } | 368 | } |
361 | 369 | ||
370 | @AutoLog(value = "设备台账-重建二维码") | ||
371 | @ApiOperation(value = "设备台账-重建二维码", notes = "设备台账-重建二维码") | ||
372 | @GetMapping(value = "/reCreateQrCode") | ||
373 | public Result<String> reCreateQrCode(String id) { | ||
374 | Result<String> result = new Result<>(); | ||
375 | String qrCodePath = equipmentInfoService.reCreateQrCode(id); | ||
376 | result.setResult(qrCodePath); | ||
377 | result.setSuccess(true); | ||
378 | return result; | ||
379 | } | ||
362 | 380 | ||
363 | @CustomExceptionAnno(description = "设备台账-批量添加运行点") | 381 | @CustomExceptionAnno(description = "设备台账-批量添加运行点") |
364 | @AutoLog(value = "设备台账-批量添加运行点") | 382 | @AutoLog(value = "设备台账-批量添加运行点") | ... | ... |
... | @@ -82,4 +82,6 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> { | ... | @@ -82,4 +82,6 @@ public interface IEquipmentInfoService extends IService<EquipmentInfo> { |
82 | List<Map<String, Object>> getEquipmentLifeTree(String id, String eventType); | 82 | List<Map<String, Object>> getEquipmentLifeTree(String id, String eventType); |
83 | 83 | ||
84 | void importExcel(MultipartFile file, String departId) throws Exception; | 84 | void importExcel(MultipartFile file, String departId) throws Exception; |
85 | |||
86 | String reCreateQrCode(String id); | ||
85 | } | 87 | } | ... | ... |
... | @@ -331,4 +331,13 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E | ... | @@ -331,4 +331,13 @@ public class EquipmentInfoServiceImpl extends ServiceImpl<EquipmentInfoMapper, E |
331 | } | 331 | } |
332 | } | 332 | } |
333 | 333 | ||
334 | @Override | ||
335 | public String reCreateQrCode(String id) { | ||
336 | EquipmentInfo equipmentInfo = equipmentInfoMapper.selectById(id); | ||
337 | String qrCodePath = createQrCode(equipmentInfo.getId()); | ||
338 | equipmentInfo.setQrCode(qrCodePath); | ||
339 | equipmentInfoMapper.updateById(equipmentInfo); | ||
340 | return qrCodePath; | ||
341 | } | ||
342 | |||
334 | } | 343 | } | ... | ... |
-
请 注册 或 登录 后发表评论