kangwei:备统计分析功能调试
设备统计详情接口 设备完好率详情接口 维护维修费用 维护维修费用详情接口
正在显示
11 个修改的文件
包含
268 行增加
和
51 行删除
... | @@ -364,18 +364,19 @@ public class JSUtils { | ... | @@ -364,18 +364,19 @@ public class JSUtils { |
364 | public static String quoteEach(String str,String splitStr) { | 364 | public static String quoteEach(String str,String splitStr) { |
365 | if( str != null && str.length() > 0 ){ | 365 | if( str != null && str.length() > 0 ){ |
366 | String[] items = str.split(splitStr); | 366 | String[] items = str.split(splitStr); |
367 | StringBuilder sb = new StringBuilder(); | 367 | String result = ""; |
368 | for (int i = 0; i < items.length; i++) { | 368 | for (int i = 0; i < items.length; i++) { |
369 | if (i > 0) { | 369 | if(StringUtils.isNotEmpty(items[i])){ |
370 | sb.append(", "); | 370 | if(result.length()>0) result +=","; |
371 | result += "'"+items[i]+"'"; | ||
371 | } | 372 | } |
372 | sb.append('\'').append(items[i]).append('\''); | ||
373 | } | 373 | } |
374 | return sb.toString(); | 374 | return result; |
375 | } | 375 | } |
376 | return str; | 376 | return str; |
377 | } | 377 | } |
378 | 378 | ||
379 | |||
379 | /*** | 380 | /*** |
380 | * 计算时间的前几个月的月份 | 381 | * 计算时间的前几个月的月份 |
381 | * @param month | 382 | * @param month |
... | @@ -395,7 +396,15 @@ public class JSUtils { | ... | @@ -395,7 +396,15 @@ public class JSUtils { |
395 | } | 396 | } |
396 | 397 | ||
397 | public static void main(String[] args) { | 398 | public static void main(String[] args) { |
398 | System.out.println(getMonthBytime(-12,"2024-12")); | 399 | //System.out.println(getMonthBytime(-12,"2024-12")); |
400 | String str = "11,22,33,44"; | ||
401 | System.out.println(quoteEach(str,",") ); | ||
402 | str = ",11,,33,44"; | ||
403 | System.out.println(quoteEach(str,",") ); | ||
404 | str = ",11,22,33,44,,"; | ||
405 | System.out.println(quoteEach(str,",") ); | ||
406 | str = "11,,,44"; | ||
407 | System.out.println(quoteEach(str,",") ); | ||
399 | } | 408 | } |
400 | 409 | ||
401 | /* ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript"); | 410 | /* ScriptEngine se = new ScriptEngineManager().getEngineByName("JavaScript"); | ... | ... |
1 | package com.skua.modules.material.controller; | 1 | package com.skua.modules.material.controller; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | ||
4 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | import com.skua.core.api.vo.Result; | 6 | import com.skua.core.api.vo.Result; |
7 | import com.skua.core.aspect.AutoLogAspect; | ||
8 | import com.skua.core.aspect.annotation.AutoLog; | 8 | import com.skua.core.aspect.annotation.AutoLog; |
9 | import com.skua.core.context.BaseContextHandler; | 9 | import com.skua.core.context.BaseContextHandler; |
10 | import com.skua.core.context.SpringContextUtils; | 10 | import com.skua.core.context.SpringContextUtils; |
11 | import com.skua.core.query.QueryGenerator; | 11 | import com.skua.core.query.QueryGenerator; |
12 | import com.skua.core.util.ConvertUtils; | 12 | import com.skua.core.util.ConvertUtils; |
13 | import com.skua.core.util.DateUtils; | 13 | import com.skua.core.util.DateUtils; |
14 | import com.skua.modules.erp.entity.ApproveRecord; | 14 | import com.skua.modules.common.service.ICommonSqlService; |
15 | import com.skua.modules.erp.entity.ErpSettlement; | ||
16 | import com.skua.modules.erp.vo.PurchaseContractVO; | ||
17 | import com.skua.modules.material.entity.MaterialInfo; | 15 | import com.skua.modules.material.entity.MaterialInfo; |
18 | import com.skua.modules.material.entity.MaterialInfoHandleRecord; | 16 | import com.skua.modules.material.entity.MaterialInfoHandleRecord; |
19 | import com.skua.modules.material.entity.MaterialInformation; | ||
20 | import com.skua.modules.material.service.IMaterialInfoHandleRecordService; | 17 | import com.skua.modules.material.service.IMaterialInfoHandleRecordService; |
21 | import com.skua.modules.material.service.IMaterialInfoService; | 18 | import com.skua.modules.material.service.IMaterialInfoService; |
22 | import com.skua.modules.material.vo.MaterialInfoStatisticsVO; | 19 | import com.skua.modules.material.vo.MaterialInfoStatisticsVO; |
... | @@ -39,13 +36,10 @@ import org.springframework.web.bind.annotation.*; | ... | @@ -39,13 +36,10 @@ import org.springframework.web.bind.annotation.*; |
39 | import org.springframework.web.multipart.MultipartFile; | 36 | import org.springframework.web.multipart.MultipartFile; |
40 | import org.springframework.web.multipart.MultipartHttpServletRequest; | 37 | import org.springframework.web.multipart.MultipartHttpServletRequest; |
41 | import org.springframework.web.servlet.ModelAndView; | 38 | import org.springframework.web.servlet.ModelAndView; |
42 | |||
43 | import javax.annotation.Resource; | 39 | import javax.annotation.Resource; |
44 | import javax.servlet.http.HttpServletRequest; | 40 | import javax.servlet.http.HttpServletRequest; |
45 | import javax.servlet.http.HttpServletResponse; | 41 | import javax.servlet.http.HttpServletResponse; |
46 | import java.io.IOException; | 42 | import java.io.IOException; |
47 | import java.io.UnsupportedEncodingException; | ||
48 | import java.net.URLDecoder; | ||
49 | import java.util.*; | 43 | import java.util.*; |
50 | 44 | ||
51 | /** | 45 | /** |
... | @@ -66,6 +60,8 @@ public class MaterialInfoController { | ... | @@ -66,6 +60,8 @@ public class MaterialInfoController { |
66 | private IMaterialInfoHandleRecordService materialInfoHandleRecordService; | 60 | private IMaterialInfoHandleRecordService materialInfoHandleRecordService; |
67 | @Resource | 61 | @Resource |
68 | private ISysDepartService departService; | 62 | private ISysDepartService departService; |
63 | @Autowired | ||
64 | private ICommonSqlService commonSqlService; | ||
69 | 65 | ||
70 | /** | 66 | /** |
71 | * 分页列表查询 | 67 | * 分页列表查询 |
... | @@ -106,6 +102,8 @@ public class MaterialInfoController { | ... | @@ -106,6 +102,8 @@ public class MaterialInfoController { |
106 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | 102 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
107 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | 103 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
108 | HttpServletRequest req) { | 104 | HttpServletRequest req) { |
105 | |||
106 | |||
109 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | 107 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); |
110 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | 108 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); |
111 | QueryWrapper<MaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap()); | 109 | QueryWrapper<MaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap()); |
... | @@ -117,6 +115,33 @@ public class MaterialInfoController { | ... | @@ -117,6 +115,33 @@ public class MaterialInfoController { |
117 | return result; | 115 | return result; |
118 | } | 116 | } |
119 | 117 | ||
118 | @AutoLog(value = "厂区资料管理-上级制度") | ||
119 | @ApiOperation(value = "厂区资料管理-上级制度", notes = "厂区资料管理-上级制度") | ||
120 | @GetMapping(value = "/superiorList") | ||
121 | public Result<IPage<MaterialInfo>> querySuperiorList(MaterialInfo materialInfo, | ||
122 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
123 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, | ||
124 | HttpServletRequest req) { | ||
125 | Result<IPage<MaterialInfo>> result = new Result<IPage<MaterialInfo>>(); | ||
126 | Page<MaterialInfo> page = new Page<MaterialInfo>(pageNo, pageSize); | ||
127 | QueryWrapper<MaterialInfo> queryWrapper = QueryGenerator.initQueryWrapper(materialInfo, req.getParameterMap()); | ||
128 | |||
129 | String sql = "SELECT CONCAT(a.parent_id ,',' ,b.parent_id) FROM sys_depart a"; | ||
130 | sql += "LEFT JOIN sys_depart b ON a.parent_id = b.id WHERE a.id = '"+BaseContextHandler.getRealDepartId()+"'"; | ||
131 | String departIds = commonSqlService.queryForString( sql ); | ||
132 | departIds = JSUtils.quoteEach(departIds,","); | ||
133 | if(StringUtils.isNotEmpty(departIds)){ | ||
134 | queryWrapper.in("depart_id", departIds); | ||
135 | } | ||
136 | // QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo); | ||
137 | queryWrapper.orderByDesc("create_time"); | ||
138 | IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper); | ||
139 | result.setSuccess(true); | ||
140 | result.setResult(pageList); | ||
141 | return result; | ||
142 | } | ||
143 | |||
144 | |||
120 | @AutoLog(value = "厂区资料管理-待审核列表") | 145 | @AutoLog(value = "厂区资料管理-待审核列表") |
121 | @ApiOperation(value = "厂区资料管理-待审核列表", notes = "厂区资料管理-待审核列表") | 146 | @ApiOperation(value = "厂区资料管理-待审核列表", notes = "厂区资料管理-待审核列表") |
122 | @GetMapping(value = "/unAuditList") | 147 | @GetMapping(value = "/unAuditList") | ... | ... |
... | @@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | ... | @@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
5 | import com.skua.core.api.vo.Result; | 5 | import com.skua.core.api.vo.Result; |
6 | import com.skua.core.aspect.annotation.AutoLog; | 6 | import com.skua.core.aspect.annotation.AutoLog; |
7 | import com.skua.core.context.BaseContextHandler; | ||
7 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; | 8 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; |
8 | import com.skua.modules.equipment.service.IProductionEquipmentService; | 9 | import com.skua.modules.equipment.service.IProductionEquipmentService; |
9 | import com.skua.modules.equipment.vo.*; | 10 | import com.skua.modules.equipment.vo.*; |
11 | import com.skua.modules.system.service.ISysDepartService; | ||
12 | import com.skua.tool.util.JSUtils; | ||
10 | import io.swagger.annotations.Api; | 13 | import io.swagger.annotations.Api; |
11 | import io.swagger.annotations.ApiOperation; | 14 | import io.swagger.annotations.ApiOperation; |
12 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
16 | import org.apache.commons.lang3.StringUtils; | ||
13 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
14 | import org.springframework.web.bind.annotation.GetMapping; | 18 | import org.springframework.web.bind.annotation.GetMapping; |
15 | import org.springframework.web.bind.annotation.RequestMapping; | 19 | import org.springframework.web.bind.annotation.RequestMapping; |
... | @@ -26,12 +30,15 @@ import java.util.Map; | ... | @@ -26,12 +30,15 @@ import java.util.Map; |
26 | public class EquipmentCenterController { | 30 | public class EquipmentCenterController { |
27 | @Autowired | 31 | @Autowired |
28 | private IProductionEquipmentService iProductionEquipmentService; | 32 | private IProductionEquipmentService iProductionEquipmentService; |
33 | @Autowired | ||
34 | private ISysDepartService departService; | ||
29 | 35 | ||
30 | @AutoLog(value = "设备中心-顶部总览") | 36 | @AutoLog(value = "设备中心-顶部总览") |
31 | @ApiOperation(value = "设备中心-顶部总览", notes = "设备中心-顶部总览") | 37 | @ApiOperation(value = "设备中心-顶部总览", notes = "设备中心-顶部总览") |
32 | @GetMapping(value = "/topOverview") | 38 | @GetMapping(value = "/topOverview") |
33 | public Result<ProductionEquipmentVO> topOverview(ReportStatisticsDTO reportStatisticsDTO) { | 39 | public Result<ProductionEquipmentVO> topOverview(ReportStatisticsDTO reportStatisticsDTO) { |
34 | Result<ProductionEquipmentVO> result = new Result<ProductionEquipmentVO>(); | 40 | Result<ProductionEquipmentVO> result = new Result<ProductionEquipmentVO>(); |
41 | setDepartIds(reportStatisticsDTO); | ||
35 | ProductionEquipmentVO productionEquipmentVO = iProductionEquipmentService.getProductionEquipmentVO(reportStatisticsDTO); | 42 | ProductionEquipmentVO productionEquipmentVO = iProductionEquipmentService.getProductionEquipmentVO(reportStatisticsDTO); |
36 | result.setResult(productionEquipmentVO); | 43 | result.setResult(productionEquipmentVO); |
37 | return result; | 44 | return result; |
... | @@ -42,6 +49,7 @@ public class EquipmentCenterController { | ... | @@ -42,6 +49,7 @@ public class EquipmentCenterController { |
42 | @GetMapping(value = "/equipmentStatistics") | 49 | @GetMapping(value = "/equipmentStatistics") |
43 | public Result<FaultStatisticsVO> equipmentStatistics(ReportStatisticsDTO reportStatisticsDTO) { | 50 | public Result<FaultStatisticsVO> equipmentStatistics(ReportStatisticsDTO reportStatisticsDTO) { |
44 | Result<FaultStatisticsVO> result = new Result<>(); | 51 | Result<FaultStatisticsVO> result = new Result<>(); |
52 | setDepartIds(reportStatisticsDTO); | ||
45 | FaultStatisticsVO equipmentStatistics = iProductionEquipmentService.getEquipmentStatistics(reportStatisticsDTO); | 53 | FaultStatisticsVO equipmentStatistics = iProductionEquipmentService.getEquipmentStatistics(reportStatisticsDTO); |
46 | result.setResult(equipmentStatistics); | 54 | result.setResult(equipmentStatistics); |
47 | result.setSuccess(true); | 55 | result.setSuccess(true); |
... | @@ -56,17 +64,34 @@ public class EquipmentCenterController { | ... | @@ -56,17 +64,34 @@ public class EquipmentCenterController { |
56 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | 64 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
57 | Result<IPage<EquipmentNewMaintenancePlanVO>> result = new Result<IPage<EquipmentNewMaintenancePlanVO>>(); | 65 | Result<IPage<EquipmentNewMaintenancePlanVO>> result = new Result<IPage<EquipmentNewMaintenancePlanVO>>(); |
58 | Page<EquipmentNewMaintenancePlanVO> pageList = new Page<EquipmentNewMaintenancePlanVO>(pageNo, pageSize); | 66 | Page<EquipmentNewMaintenancePlanVO> pageList = new Page<EquipmentNewMaintenancePlanVO>(pageNo, pageSize); |
67 | setDepartIds(reportStatisticsDTO); | ||
59 | pageList = iProductionEquipmentService.getEquipmentStatisticsDetails(pageList, reportStatisticsDTO); | 68 | pageList = iProductionEquipmentService.getEquipmentStatisticsDetails(pageList, reportStatisticsDTO); |
60 | result.setSuccess(true); | 69 | result.setSuccess(true); |
61 | result.setResult(pageList); | 70 | result.setResult(pageList); |
62 | return result; | 71 | return result; |
63 | } | 72 | } |
64 | 73 | ||
74 | @AutoLog(value = "设备中心-设备统计详情(新)") | ||
75 | @ApiOperation(value = "设备中心-设备统计详情(新)", notes = "设备中心-设备统计详情(新)") | ||
76 | @GetMapping(value = "/equipmentStatisticsDetailsNew") | ||
77 | public Result<IPage<EquipmentStatisticsCountVO>> equipmentStatisticsDetailsNew(ReportStatisticsDTO reportStatisticsDTO, | ||
78 | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, | ||
79 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||
80 | Result<IPage<EquipmentStatisticsCountVO>> result = new Result<IPage<EquipmentStatisticsCountVO>>(); | ||
81 | Page<EquipmentStatisticsCountVO> page = new Page<EquipmentStatisticsCountVO>(pageNo, pageSize); | ||
82 | setDepartIds(reportStatisticsDTO);//设置departIds | ||
83 | IPage<EquipmentStatisticsCountVO> pageList =iProductionEquipmentService.getEquipmentStatisticsDetailsNew(page, reportStatisticsDTO); | ||
84 | result.setSuccess(true); | ||
85 | result.setResult(pageList); | ||
86 | return result; | ||
87 | } | ||
88 | |||
65 | @AutoLog(value = "设备中心-设备状态") | 89 | @AutoLog(value = "设备中心-设备状态") |
66 | @ApiOperation(value = "设备中心-设备状态", notes = "设备中心-设备状态") | 90 | @ApiOperation(value = "设备中心-设备状态", notes = "设备中心-设备状态") |
67 | @GetMapping(value = "/equipmentState") | 91 | @GetMapping(value = "/equipmentState") |
68 | public Result<List<TOPTenVO>> equipmentState(ReportStatisticsDTO reportStatisticsDTO) { | 92 | public Result<List<TOPTenVO>> equipmentState(ReportStatisticsDTO reportStatisticsDTO) { |
69 | Result<List<TOPTenVO>> result = new Result<>(); | 93 | Result<List<TOPTenVO>> result = new Result<>(); |
94 | setDepartIds(reportStatisticsDTO); | ||
70 | List<TOPTenVO> equipmentState = iProductionEquipmentService.getEquipmentState(reportStatisticsDTO); | 95 | List<TOPTenVO> equipmentState = iProductionEquipmentService.getEquipmentState(reportStatisticsDTO); |
71 | result.setSuccess(true); | 96 | result.setSuccess(true); |
72 | result.setResult(equipmentState); | 97 | result.setResult(equipmentState); |
... | @@ -81,6 +106,7 @@ public class EquipmentCenterController { | ... | @@ -81,6 +106,7 @@ public class EquipmentCenterController { |
81 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | 106 | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { |
82 | Result<IPage<EquipmentNewMaintenancePlanVO>> result = new Result<IPage<EquipmentNewMaintenancePlanVO>>(); | 107 | Result<IPage<EquipmentNewMaintenancePlanVO>> result = new Result<IPage<EquipmentNewMaintenancePlanVO>>(); |
83 | Page<EquipmentNewMaintenancePlanVO> pageList = new Page<EquipmentNewMaintenancePlanVO>(pageNo, pageSize); | 108 | Page<EquipmentNewMaintenancePlanVO> pageList = new Page<EquipmentNewMaintenancePlanVO>(pageNo, pageSize); |
109 | setDepartIds(reportStatisticsDTO); | ||
84 | pageList = iProductionEquipmentService.getEquipmentStateDetails(pageList, reportStatisticsDTO); | 110 | pageList = iProductionEquipmentService.getEquipmentStateDetails(pageList, reportStatisticsDTO); |
85 | result.setSuccess(true); | 111 | result.setSuccess(true); |
86 | result.setResult(pageList); | 112 | result.setResult(pageList); |
... | @@ -92,6 +118,7 @@ public class EquipmentCenterController { | ... | @@ -92,6 +118,7 @@ public class EquipmentCenterController { |
92 | @GetMapping(value = "/equipmentIntactRate") | 118 | @GetMapping(value = "/equipmentIntactRate") |
93 | public Result<List<ContrastVO>> equipmentIntactRate(ReportStatisticsDTO reportStatisticsDTO) { | 119 | public Result<List<ContrastVO>> equipmentIntactRate(ReportStatisticsDTO reportStatisticsDTO) { |
94 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); | 120 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); |
121 | setDepartIds(reportStatisticsDTO); | ||
95 | List<ContrastVO> equipmentIntactRate = iProductionEquipmentService.getEquipmentIntactRate(reportStatisticsDTO); | 122 | List<ContrastVO> equipmentIntactRate = iProductionEquipmentService.getEquipmentIntactRate(reportStatisticsDTO); |
96 | result.setSuccess(true); | 123 | result.setSuccess(true); |
97 | result.setResult(equipmentIntactRate); | 124 | result.setResult(equipmentIntactRate); |
... | @@ -103,17 +130,30 @@ public class EquipmentCenterController { | ... | @@ -103,17 +130,30 @@ public class EquipmentCenterController { |
103 | @GetMapping(value = "/equipmentIntactRateDetails") | 130 | @GetMapping(value = "/equipmentIntactRateDetails") |
104 | public Result<List<Map>> equipmentIntactRateDetails(ReportStatisticsDTO reportStatisticsDTO) { | 131 | public Result<List<Map>> equipmentIntactRateDetails(ReportStatisticsDTO reportStatisticsDTO) { |
105 | Result<List<Map>> result = new Result<List<Map>>(); | 132 | Result<List<Map>> result = new Result<List<Map>>(); |
133 | setDepartIds(reportStatisticsDTO); | ||
106 | List<Map> equipmentIntactRateDetails = iProductionEquipmentService.getEquipmentIntactRateDetails(reportStatisticsDTO); | 134 | List<Map> equipmentIntactRateDetails = iProductionEquipmentService.getEquipmentIntactRateDetails(reportStatisticsDTO); |
107 | result.setResult(equipmentIntactRateDetails); | 135 | result.setResult(equipmentIntactRateDetails); |
108 | result.setSuccess(true); | 136 | result.setSuccess(true); |
109 | return result; | 137 | return result; |
110 | } | 138 | } |
111 | 139 | ||
140 | @AutoLog(value = "设备中心-设备完好率详情(新)") | ||
141 | @ApiOperation(value = "设备中心-设备完好率详情(新)", notes = "设备中心-设备完好率详情(新)") | ||
142 | @GetMapping(value = "/equipmentIntactRateDetailsNew") | ||
143 | public Result<List<Map>> equipmentIntactRateDetailsNew(ReportStatisticsDTO reportStatisticsDTO) { | ||
144 | Result<List<Map>> result = new Result<List<Map>>(); | ||
145 | setDepartIds(reportStatisticsDTO); | ||
146 | List<Map> equipmentIntactRateDetails = iProductionEquipmentService.getEquipmentIntactRateDetailsNew(reportStatisticsDTO); | ||
147 | result.setResult(equipmentIntactRateDetails); | ||
148 | result.setSuccess(true); | ||
149 | return result; | ||
150 | } | ||
112 | @AutoLog(value = "设备中心-MTTR&MTBF") | 151 | @AutoLog(value = "设备中心-MTTR&MTBF") |
113 | @ApiOperation(value = "设备中心-MTTR&MTBF", notes = "设备中心-MTTR&MTBF") | 152 | @ApiOperation(value = "设备中心-MTTR&MTBF", notes = "设备中心-MTTR&MTBF") |
114 | @GetMapping(value = "/equipmentMF") | 153 | @GetMapping(value = "/equipmentMF") |
115 | public Result<List<ContrastVO>> equipmentMF(ReportStatisticsDTO reportStatisticsDTO) { | 154 | public Result<List<ContrastVO>> equipmentMF(ReportStatisticsDTO reportStatisticsDTO) { |
116 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); | 155 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); |
156 | setDepartIds(reportStatisticsDTO); | ||
117 | List<ContrastVO> equipmentMF = iProductionEquipmentService.getEquipmentMF(reportStatisticsDTO); | 157 | List<ContrastVO> equipmentMF = iProductionEquipmentService.getEquipmentMF(reportStatisticsDTO); |
118 | result.setResult(equipmentMF); | 158 | result.setResult(equipmentMF); |
119 | result.setSuccess(true); | 159 | result.setSuccess(true); |
... | @@ -125,6 +165,7 @@ public class EquipmentCenterController { | ... | @@ -125,6 +165,7 @@ public class EquipmentCenterController { |
125 | @GetMapping(value = "/equipmentMFDetails") | 165 | @GetMapping(value = "/equipmentMFDetails") |
126 | public Result<List<Map>> equipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO) { | 166 | public Result<List<Map>> equipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO) { |
127 | Result<List<Map>> result = new Result<List<Map>>(); | 167 | Result<List<Map>> result = new Result<List<Map>>(); |
168 | setDepartIds(reportStatisticsDTO); | ||
128 | List<Map> equipmentMFDetails = iProductionEquipmentService.getEquipmentMFDetails(reportStatisticsDTO); | 169 | List<Map> equipmentMFDetails = iProductionEquipmentService.getEquipmentMFDetails(reportStatisticsDTO); |
129 | result.setResult(equipmentMFDetails); | 170 | result.setResult(equipmentMFDetails); |
130 | result.setSuccess(true); | 171 | result.setSuccess(true); |
... | @@ -136,6 +177,7 @@ public class EquipmentCenterController { | ... | @@ -136,6 +177,7 @@ public class EquipmentCenterController { |
136 | @GetMapping(value = "/maintainCompleteRate") | 177 | @GetMapping(value = "/maintainCompleteRate") |
137 | public Result<List<ContrastVO>> maintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO) { | 178 | public Result<List<ContrastVO>> maintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO) { |
138 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); | 179 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); |
180 | setDepartIds(reportStatisticsDTO); | ||
139 | List<ContrastVO> maintainCompleteRate = iProductionEquipmentService.getMaintainCompleteRate(reportStatisticsDTO); | 181 | List<ContrastVO> maintainCompleteRate = iProductionEquipmentService.getMaintainCompleteRate(reportStatisticsDTO); |
140 | result.setResult(maintainCompleteRate); | 182 | result.setResult(maintainCompleteRate); |
141 | result.setSuccess(true); | 183 | result.setSuccess(true); |
... | @@ -147,6 +189,7 @@ public class EquipmentCenterController { | ... | @@ -147,6 +189,7 @@ public class EquipmentCenterController { |
147 | @GetMapping(value = "/maintainCompleteRateDetails") | 189 | @GetMapping(value = "/maintainCompleteRateDetails") |
148 | public Result<List<Map>> maintainCompleteRateDetails(ReportStatisticsDTO reportStatisticsDTO) { | 190 | public Result<List<Map>> maintainCompleteRateDetails(ReportStatisticsDTO reportStatisticsDTO) { |
149 | Result<List<Map>> result = new Result<>(); | 191 | Result<List<Map>> result = new Result<>(); |
192 | setDepartIds(reportStatisticsDTO); | ||
150 | List<Map> maintainCompleteRateDetails = iProductionEquipmentService.getMaintainCompleteRateDetails(reportStatisticsDTO); | 193 | List<Map> maintainCompleteRateDetails = iProductionEquipmentService.getMaintainCompleteRateDetails(reportStatisticsDTO); |
151 | result.setResult(maintainCompleteRateDetails); | 194 | result.setResult(maintainCompleteRateDetails); |
152 | result.setSuccess(true); | 195 | result.setSuccess(true); |
... | @@ -158,6 +201,7 @@ public class EquipmentCenterController { | ... | @@ -158,6 +201,7 @@ public class EquipmentCenterController { |
158 | @GetMapping(value = "/maintainRepairCost") | 201 | @GetMapping(value = "/maintainRepairCost") |
159 | public Result<List<ContrastVO>> maintainRepairCost(ReportStatisticsDTO reportStatisticsDTO) { | 202 | public Result<List<ContrastVO>> maintainRepairCost(ReportStatisticsDTO reportStatisticsDTO) { |
160 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); | 203 | Result<List<ContrastVO>> result = new Result<List<ContrastVO>>(); |
204 | setDepartIds(reportStatisticsDTO); | ||
161 | List<ContrastVO> maintainCompleteRate = iProductionEquipmentService.getContrastCost(reportStatisticsDTO); | 205 | List<ContrastVO> maintainCompleteRate = iProductionEquipmentService.getContrastCost(reportStatisticsDTO); |
162 | result.setResult(maintainCompleteRate); | 206 | result.setResult(maintainCompleteRate); |
163 | result.setSuccess(true); | 207 | result.setSuccess(true); |
... | @@ -169,9 +213,24 @@ public class EquipmentCenterController { | ... | @@ -169,9 +213,24 @@ public class EquipmentCenterController { |
169 | @GetMapping(value = "/maintainRepairCostDetails") | 213 | @GetMapping(value = "/maintainRepairCostDetails") |
170 | public Result<List<Map>> maintainRepairCostDetails(ReportStatisticsDTO reportStatisticsDTO) { | 214 | public Result<List<Map>> maintainRepairCostDetails(ReportStatisticsDTO reportStatisticsDTO) { |
171 | Result<List<Map>> result = new Result<>(); | 215 | Result<List<Map>> result = new Result<>(); |
216 | setDepartIds(reportStatisticsDTO); | ||
172 | List<Map> contrastCostDetails = iProductionEquipmentService.getContrastCostDetails(reportStatisticsDTO); | 217 | List<Map> contrastCostDetails = iProductionEquipmentService.getContrastCostDetails(reportStatisticsDTO); |
173 | result.setResult(contrastCostDetails); | 218 | result.setResult(contrastCostDetails); |
174 | result.setSuccess(true); | 219 | result.setSuccess(true); |
175 | return result; | 220 | return result; |
176 | } | 221 | } |
222 | |||
223 | /*** | ||
224 | * 设置查询条件的departIds属性 | ||
225 | * @param reportStatisticsDTO | ||
226 | */ | ||
227 | private void setDepartIds(ReportStatisticsDTO reportStatisticsDTO){ | ||
228 | String departIds = null; | ||
229 | if (StringUtils.isNotEmpty(reportStatisticsDTO.getFactoryId())) { | ||
230 | departIds = departService.getChildDepartId(reportStatisticsDTO.getFactoryId()); | ||
231 | }else{ | ||
232 | departIds = BaseContextHandler.getDeparts(); | ||
233 | } | ||
234 | reportStatisticsDTO.setDepartIds(JSUtils.quoteEach(departIds,",")); | ||
235 | } | ||
177 | } | 236 | } | ... | ... |
1 | package com.skua.modules.equipment.dto; | 1 | package com.skua.modules.equipment.dto; |
2 | 2 | ||
3 | import com.skua.modules.equipment.vo.IndexVO; | 3 | import com.skua.modules.equipment.vo.IndexVO; |
4 | import com.skua.tool.util.DateUtils; | ||
4 | import io.swagger.annotations.ApiModelProperty; | 5 | import io.swagger.annotations.ApiModelProperty; |
5 | import lombok.Data; | 6 | import lombok.Data; |
7 | import org.apache.commons.lang3.StringUtils; | ||
6 | 8 | ||
7 | import java.util.List; | 9 | import java.util.List; |
8 | 10 | ||
... | @@ -46,7 +48,22 @@ public class ReportStatisticsDTO { | ... | @@ -46,7 +48,22 @@ public class ReportStatisticsDTO { |
46 | List<IndexVO> outOfGinseng; | 48 | List<IndexVO> outOfGinseng; |
47 | @ApiModelProperty(value = "时间") | 49 | @ApiModelProperty(value = "时间") |
48 | private String time; | 50 | private String time; |
51 | |||
52 | @ApiModelProperty(value = "部门集合") | ||
53 | private String departIds; | ||
49 | @ApiModelProperty(value = "1总公司2分公司3厂站") | 54 | @ApiModelProperty(value = "1总公司2分公司3厂站") |
50 | private Integer isCompany; | 55 | private Integer isCompany; |
51 | 56 | ||
57 | |||
58 | public String getTime() { | ||
59 | if(StringUtils.isEmpty(time)){//判断time如果为空,获取starttime的年份数据,否则获取当前年 | ||
60 | if( StringUtils.isNotEmpty(startTime) ){ | ||
61 | time = DateUtils.getDateYear(startTime)+""; | ||
62 | }else{ | ||
63 | time = DateUtils.getCurrentYear()+""; | ||
64 | } | ||
65 | |||
66 | } | ||
67 | return time; | ||
68 | } | ||
52 | } | 69 | } | ... | ... |
1 | package com.skua.modules.equipment.mapper; | 1 | package com.skua.modules.equipment.mapper; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
3 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; | 5 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; |
4 | import com.skua.modules.equipment.entity.SysUser; | 6 | import com.skua.modules.equipment.entity.SysUser; |
7 | import com.skua.modules.equipment.pojo.Equipment; | ||
5 | import com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO; | 8 | import com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO; |
9 | import com.skua.modules.equipment.vo.EquipmentStatisticsCountVO; | ||
6 | import com.skua.modules.equipment.vo.ProportionStatisticsVO; | 10 | import com.skua.modules.equipment.vo.ProportionStatisticsVO; |
7 | import org.apache.ibatis.annotations.Mapper; | 11 | import org.apache.ibatis.annotations.Mapper; |
8 | import org.apache.ibatis.annotations.Param; | 12 | import org.apache.ibatis.annotations.Param; |
... | @@ -34,7 +38,8 @@ public interface ProductionEquipmentMapper { | ... | @@ -34,7 +38,8 @@ public interface ProductionEquipmentMapper { |
34 | 38 | ||
35 | //获取维修费用 | 39 | //获取维修费用 |
36 | Double getRepairCost(@Param("startTime") String startTime, @Param("endTime") String endTime); | 40 | Double getRepairCost(@Param("startTime") String startTime, @Param("endTime") String endTime); |
37 | 41 | //获取维修费用 2024-1227 获取维修费用:来源维修表 | |
42 | // Double getRepairNewCost( @Param("departIds") String departIds, @Param("startTime") String startTime, @Param("endTime") String endTime); | ||
38 | //获取维护任务数量 status 1:已完成 0:未完成 | 43 | //获取维护任务数量 status 1:已完成 0:未完成 |
39 | Integer getTaskNum(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("status") Integer status); | 44 | Integer getTaskNum(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("status") Integer status); |
40 | 45 | ||
... | @@ -56,6 +61,8 @@ public interface ProductionEquipmentMapper { | ... | @@ -56,6 +61,8 @@ public interface ProductionEquipmentMapper { |
56 | 61 | ||
57 | //厂获取生产设备总台数详情 | 62 | //厂获取生产设备总台数详情 |
58 | List<EquipmentNewMaintenancePlanVO> getEquipmentStatisticsDetailsFactory(ReportStatisticsDTO reportStatisticsDTO); | 63 | List<EquipmentNewMaintenancePlanVO> getEquipmentStatisticsDetailsFactory(ReportStatisticsDTO reportStatisticsDTO); |
64 | //厂获取生产设备总台数详情(新) | ||
65 | IPage<EquipmentStatisticsCountVO> getEquipmentStatisticsDetailsNew(Page<EquipmentStatisticsCountVO> page, @Param("param") ReportStatisticsDTO reportStatisticsDTO); | ||
59 | 66 | ||
60 | //总公司获取等级分类 | 67 | //总公司获取等级分类 |
61 | List<Map> getLevelByHeadquarters(ReportStatisticsDTO reportStatisticsDTO); | 68 | List<Map> getLevelByHeadquarters(ReportStatisticsDTO reportStatisticsDTO); |
... | @@ -141,10 +148,10 @@ public interface ProductionEquipmentMapper { | ... | @@ -141,10 +148,10 @@ public interface ProductionEquipmentMapper { |
141 | List<Map> getOneYearCompleteYearOnYearRate(); | 148 | List<Map> getOneYearCompleteYearOnYearRate(); |
142 | 149 | ||
143 | //半年维修维护费用对比 | 150 | //半年维修维护费用对比 |
144 | List<Map> getHalfIntactContrastCost(); | 151 | List<Map> getHalfIntactContrastCost(@Param("departIds") String departIds); |
145 | 152 | ||
146 | //一年维修维护费用对比 | 153 | //一年维修维护费用对比 |
147 | List<Map> getOneYearContrastCost(); | 154 | List<Map> getOneYearContrastCost(@Param("departIds") String departIds); |
148 | 155 | ||
149 | //总公司获取停机时间 | 156 | //总公司获取停机时间 |
150 | List<Map> getDownTimeByMonthHeadquarters(ReportStatisticsDTO reportStatisticsDTO); | 157 | List<Map> getDownTimeByMonthHeadquarters(ReportStatisticsDTO reportStatisticsDTO); |
... | @@ -180,4 +187,8 @@ public interface ProductionEquipmentMapper { | ... | @@ -180,4 +187,8 @@ public interface ProductionEquipmentMapper { |
180 | List<Map>getRepairCostByHeadquarters(ReportStatisticsDTO reportStatisticsDTO); | 187 | List<Map>getRepairCostByHeadquarters(ReportStatisticsDTO reportStatisticsDTO); |
181 | List<Map>getRepairCostByBranchOffice(ReportStatisticsDTO reportStatisticsDTO); | 188 | List<Map>getRepairCostByBranchOffice(ReportStatisticsDTO reportStatisticsDTO); |
182 | List<Map>getRepairCostByFactory(ReportStatisticsDTO reportStatisticsDTO); | 189 | List<Map>getRepairCostByFactory(ReportStatisticsDTO reportStatisticsDTO); |
190 | //设备中心-维护维修费用详情 | ||
191 | List<Map> getContrastCostDetails(ReportStatisticsDTO reportStatisticsDTO); | ||
192 | //设备完好率详情(新) | ||
193 | List<Map> getEquipmentIntactRateDetailsNew(ReportStatisticsDTO reportStatisticsDTO); | ||
183 | } | 194 | } | ... | ... |
... | @@ -107,39 +107,60 @@ | ... | @@ -107,39 +107,60 @@ |
107 | and #{endTime} | 107 | and #{endTime} |
108 | </if> | 108 | </if> |
109 | </select> | 109 | </select> |
110 | |||
111 | <select id="getEquipmentStatisticsDetailsNew" resultType="com.skua.modules.equipment.vo.EquipmentStatisticsCountVO"> | ||
112 | select d.depart_name , d.id 'depart_id', | ||
113 | ifnull(ccc.category_value1 , 0 ) category_value1, | ||
114 | ifnull(ccc.category_value2 , 0 ) category_value2, | ||
115 | ifnull(ccc.category_value3 , 0 ) category_value3 | ||
116 | from sys_depart d | ||
117 | left join ( | ||
118 | select bbb.depart_id, | ||
119 | ifnull((CASE WHEN equipment_level = '2421538a0286b491ffb863db92fe6cbf' THEN bbb.hour END),0) 'category_value1', | ||
120 | ifnull((CASE WHEN equipment_level = '6bf727eb7e7cca6a95c694dab0036b2c' THEN bbb.hour END),0) 'category_value2', | ||
121 | ifnull((CASE WHEN equipment_level = 'a64bfc58110d2c105a6026e8bd02c232' THEN bbb.hour END),0) 'category_value3' | ||
122 | |||
123 | from ( | ||
124 | select ei.depart_id , ei.equipment_level , ifnull(COUNT( ei.id ),0) AS'hour' from equipment_info ei | ||
125 | where 1=1 | ||
126 | <if test="param.startTime != null "> | ||
127 | and ei.create_time >= #{param.startTime} | ||
128 | </if> | ||
129 | <if test="param.endTime != null "> | ||
130 | and ei.create_time <= #{param.endTime} | ||
131 | </if> | ||
132 | <if test="param.departIds != null "> | ||
133 | and ei.depart_id in(${param.departIds}) | ||
134 | </if> | ||
135 | group by ei.depart_id , ei.equipment_level | ||
136 | )bbb group by bbb.depart_id | ||
137 | )ccc on ccc.depart_id = d.id | ||
138 | where d.depart_type = 1 | ||
139 | <if test="param.departIds != null "> | ||
140 | and d.id in (${param.departIds}) | ||
141 | </if> | ||
142 | order by ccc.category_value1 desc | ||
143 | </select> | ||
144 | |||
145 | |||
146 | |||
110 | <select id="getLevelByTime" resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO" | 147 | <select id="getLevelByTime" resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO" |
111 | parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO"> | 148 | parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO"> |
112 | SELECT | 149 | select aaa.item_text as category, ifnull(COUNT( ei.id ),0) AS'hour' from equipment_info ei |
113 | t1.des as category, | 150 | left join ( |
114 | t1.equipmentNum as hour, | 151 | select t.item_value , t.item_text from sys_dict_item t where t.dict_id in (select id from sys_dict where dict_code = 'equipment-equipment_level') |
115 | CONCAT( ROUND( IFNULL( t1.equipmentNum, 0 ) / t2.equipmentTotal, 3 )* 100, '%' ) AS proportion | 152 | ) aaa on aaa.item_value = ei.equipment_level |
116 | FROM | 153 | where 1=1 |
117 | ( | 154 | <if test="startTime != null "> |
118 | SELECT | 155 | and ei.create_time >= #{startTime} |
119 | sdi.item_text AS des, | ||
120 | COUNT( ei.id ) AS equipmentNum | ||
121 | FROM | ||
122 | equipment_info ei | ||
123 | LEFT JOIN sys_dict_item sdi ON sdi.item_value = ei.equipment_level | ||
124 | WHERE | ||
125 | sdi.dict_id = '77c2f3bd6d16dec67f2ea11d84b6000e' | ||
126 | <if test="endTime !=null and endTime !=''"> | ||
127 | AND ei.create_time <= #{endTime} | ||
128 | </if> | 156 | </if> |
129 | GROUP BY | 157 | <if test="endTime != null "> |
130 | ei.equipment_level | 158 | and ei.create_time <= #{endTime} |
131 | ) t1,( | ||
132 | SELECT | ||
133 | count( 1 ) AS equipmentTotal | ||
134 | FROM | ||
135 | equipment_info | ||
136 | WHERE | ||
137 | 1=1 | ||
138 | |||
139 | <if test="endTime !=null and endTime !=''"> | ||
140 | AND create_time <= #{endTime} | ||
141 | </if> | 159 | </if> |
142 | ) t2 | 160 | <if test="departIds != null "> |
161 | and ei.depart_id in(${departIds}) | ||
162 | </if> | ||
163 | group by ei.equipment_level | ||
143 | </select> | 164 | </select> |
144 | <select id="getTypeByTime" parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO" | 165 | <select id="getTypeByTime" parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO" |
145 | resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO"> | 166 | resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO"> |
... | @@ -793,7 +814,7 @@ | ... | @@ -793,7 +814,7 @@ |
793 | FROM | 814 | FROM |
794 | equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id | 815 | equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id |
795 | WHERE | 816 | WHERE |
796 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 | 817 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 and emt.depart_id in(${departIds}) |
797 | ) AS maintainCost, | 818 | ) AS maintainCost, |
798 | ( | 819 | ( |
799 | SELECT | 820 | SELECT |
... | @@ -802,7 +823,7 @@ | ... | @@ -802,7 +823,7 @@ |
802 | equipment_repair er | 823 | equipment_repair er |
803 | WHERE | 824 | WHERE |
804 | LEFT ( er.create_time, 7 ) = t.MONTH | 825 | LEFT ( er.create_time, 7 ) = t.MONTH |
805 | AND er.del_flag = 1 | 826 | AND er.del_flag = 1 and er.depart_id in(${departIds}) |
806 | ) AS repairCost | 827 | ) AS repairCost |
807 | FROM | 828 | FROM |
808 | ( | 829 | ( |
... | @@ -824,7 +845,7 @@ | ... | @@ -824,7 +845,7 @@ |
824 | FROM | 845 | FROM |
825 | equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id | 846 | equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id |
826 | WHERE | 847 | WHERE |
827 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 | 848 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 and emt.depart_id in(${departIds}) |
828 | ) AS maintainCost, | 849 | ) AS maintainCost, |
829 | ( | 850 | ( |
830 | SELECT | 851 | SELECT |
... | @@ -833,7 +854,7 @@ | ... | @@ -833,7 +854,7 @@ |
833 | equipment_repair er | 854 | equipment_repair er |
834 | WHERE | 855 | WHERE |
835 | LEFT ( er.create_time, 7 ) = t.MONTH | 856 | LEFT ( er.create_time, 7 ) = t.MONTH |
836 | AND er.del_flag = 1 | 857 | AND er.del_flag = 1 and er.depart_id in(${departIds}) |
837 | ) AS repairCost | 858 | ) AS repairCost |
838 | FROM | 859 | FROM |
839 | ( | 860 | ( |
... | @@ -847,6 +868,45 @@ | ... | @@ -847,6 +868,45 @@ |
847 | MONTH DESC | 868 | MONTH DESC |
848 | ) AS t | 869 | ) AS t |
849 | </select> | 870 | </select> |
871 | <!--维护维修费用详情 --> | ||
872 | <select id="getContrastCostDetails" resultType="java.util.Map"> | ||
873 | select d.id depart_id , d.depart_name ,ifnull(aaa.maintainCost,0) maintainCost,ifnull(bbb.repairCost,0) repairCost from sys_depart d | ||
874 | left join ( | ||
875 | SELECT emt.depart_id , IFNULL(sum(etc.material_cost+etc.maintenance_cost+etc.labor_cost+etc.machinery_cost+etc.service_cost+etc.wastage_cost+etc.other_cost),0) maintainCost | ||
876 | FROM equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id | ||
877 | WHERE emt.del_flag = 0 and emt.maintain_time >= #{startTime} and emt.maintain_time <= #{endTime} | ||
878 | group by emt.depart_id | ||
879 | ) aaa on aaa.depart_id = d.id | ||
880 | left join ( | ||
881 | SELECT er.depart_id, IFNULL(SUM(er.total_cost),0) repairCost | ||
882 | FROM equipment_repair er | ||
883 | WHERE er.del_flag = 1 and er.create_time >= #{startTime} and er.create_time <= #{endTime} | ||
884 | group by er.depart_id | ||
885 | )bbb on bbb.depart_id = d.id | ||
886 | where d.depart_type = 1 | ||
887 | and d.id in (${departIds}) | ||
888 | </select> | ||
889 | |||
890 | <!-- 设备完好率详情(新)--> | ||
891 | <select id="getEquipmentIntactRateDetailsNew" resultType="java.util.Map"> | ||
892 | select d.id depart_id , d.depart_name ,round(ifnull(aaa.intact,0),2) 'intact', round(ifnull(bbb.percentage,0),2) 'percentage' from sys_depart d | ||
893 | left join ( | ||
894 | SELECT er.depart_id ,ifnull(( COUNT(id)*30 - IFNULL( SUM( UNIX_TIMESTAMP( reality_maintenance_end_time )- UNIX_TIMESTAMP( repair_date ) )/ 60 / 60 / 24, 0 ) ) *100/ (COUNT(id)*30) , 0) 'intact' | ||
895 | FROM equipment_repair er | ||
896 | WHERE er.del_flag = 1 and er.create_time >= #{startTime} and er.create_time <= #{endTime} | ||
897 | group by er.depart_id | ||
898 | ) aaa on aaa.depart_id = d.id | ||
899 | left join ( | ||
900 | SELECT er.depart_id , ifnull(( COUNT(id)*30 - IFNULL( SUM( UNIX_TIMESTAMP( reality_maintenance_end_time )- UNIX_TIMESTAMP( repair_date ) )/ 60 / 60 / 24, 0 ) ) *100/ (COUNT(id)*30) , 0) 'percentage' | ||
901 | FROM equipment_repair er | ||
902 | WHERE er.del_flag = 1 and er.create_time >= #{startTime} and er.create_time <= #{endTime} | ||
903 | group by er.depart_id | ||
904 | )bbb on bbb.depart_id = d.id | ||
905 | where d.depart_type = 1 and d.id in (${departIds}) | ||
906 | order by aaa.intact desc | ||
907 | </select> | ||
908 | |||
909 | |||
850 | <select id="getDownTimeByMonthHeadquarters" resultType="java.util.Map" | 910 | <select id="getDownTimeByMonthHeadquarters" resultType="java.util.Map" |
851 | parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO"> | 911 | parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO"> |
852 | SELECT sd1.depart_name AS departName,sd1.id as departId, | 912 | SELECT sd1.depart_name AS departName,sd1.id as departId, |
... | @@ -1117,6 +1177,8 @@ | ... | @@ -1117,6 +1177,8 @@ |
1117 | GROUP BY | 1177 | GROUP BY |
1118 | sd1.id | 1178 | sd1.id |
1119 | </select> | 1179 | </select> |
1180 | |||
1181 | |||
1120 | <select id="getMaintainCostByHeadquarters" parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO" | 1182 | <select id="getMaintainCostByHeadquarters" parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO" |
1121 | resultType="java.util.Map"> | 1183 | resultType="java.util.Map"> |
1122 | SELECT | 1184 | SELECT | ... | ... |
1 | package com.skua.modules.equipment.service; | 1 | package com.skua.modules.equipment.service; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | ||
3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
4 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; | 5 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; |
5 | import com.skua.modules.equipment.vo.*; | 6 | import com.skua.modules.equipment.vo.*; |
... | @@ -19,6 +20,7 @@ import java.util.Map; | ... | @@ -19,6 +20,7 @@ import java.util.Map; |
19 | *</pre> | 20 | *</pre> |
20 | ***************************/ | 21 | ***************************/ |
21 | public interface IProductionEquipmentService { | 22 | public interface IProductionEquipmentService { |
23 | //设备中心-顶部总览 | ||
22 | ProductionEquipmentVO getProductionEquipmentVO(ReportStatisticsDTO reportStatisticsDTO); | 24 | ProductionEquipmentVO getProductionEquipmentVO(ReportStatisticsDTO reportStatisticsDTO); |
23 | 25 | ||
24 | //设备统计 | 26 | //设备统计 |
... | @@ -27,6 +29,9 @@ public interface IProductionEquipmentService { | ... | @@ -27,6 +29,9 @@ public interface IProductionEquipmentService { |
27 | //设备统计详情 | 29 | //设备统计详情 |
28 | Page<EquipmentNewMaintenancePlanVO> getEquipmentStatisticsDetails(Page<EquipmentNewMaintenancePlanVO> pageList, ReportStatisticsDTO reportStatisticsDTO); | 30 | Page<EquipmentNewMaintenancePlanVO> getEquipmentStatisticsDetails(Page<EquipmentNewMaintenancePlanVO> pageList, ReportStatisticsDTO reportStatisticsDTO); |
29 | 31 | ||
32 | //设备统计详情(new) | ||
33 | IPage<EquipmentStatisticsCountVO> getEquipmentStatisticsDetailsNew(Page<EquipmentStatisticsCountVO> pageList, ReportStatisticsDTO reportStatisticsDTO); | ||
34 | |||
30 | //获取设备状态 | 35 | //获取设备状态 |
31 | List<TOPTenVO> getEquipmentState(ReportStatisticsDTO reportStatisticsDTO); | 36 | List<TOPTenVO> getEquipmentState(ReportStatisticsDTO reportStatisticsDTO); |
32 | 37 | ||
... | @@ -38,6 +43,8 @@ public interface IProductionEquipmentService { | ... | @@ -38,6 +43,8 @@ public interface IProductionEquipmentService { |
38 | 43 | ||
39 | //设备完好率详情 | 44 | //设备完好率详情 |
40 | List<Map> getEquipmentIntactRateDetails(ReportStatisticsDTO reportStatisticsDTO); | 45 | List<Map> getEquipmentIntactRateDetails(ReportStatisticsDTO reportStatisticsDTO); |
46 | List<Map> getEquipmentIntactRateDetailsNew(ReportStatisticsDTO reportStatisticsDTO); | ||
47 | |||
41 | 48 | ||
42 | //MF | 49 | //MF |
43 | List<ContrastVO> getEquipmentMF(ReportStatisticsDTO reportStatisticsDTO); | 50 | List<ContrastVO> getEquipmentMF(ReportStatisticsDTO reportStatisticsDTO); | ... | ... |
此文件的差异被折叠,
点击展开。
此文件的差异被折叠,
点击展开。
sk-module-equipment/src/main/java/com/skua/modules/equipment/vo/EquipmentStatisticsCountVO.java
0 → 100644
1 | package com.skua.modules.equipment.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | |||
7 | /** | ||
8 | * @auther kangwei | ||
9 | * @create 2024-12-27-15:32 | ||
10 | */ | ||
11 | |||
12 | @Data | ||
13 | @ApiModel(value = "设备统计数量对象", description = "设备统计数量对象") | ||
14 | public class EquipmentStatisticsCountVO { | ||
15 | |||
16 | @ApiModelProperty(value = "厂站名称") | ||
17 | private String departName; | ||
18 | @ApiModelProperty(value = "厂站编号") | ||
19 | private String departId; | ||
20 | |||
21 | @ApiModelProperty(value = "分类1数量") | ||
22 | private String categoryValue1; | ||
23 | @ApiModelProperty(value = "分类2数量") | ||
24 | private String categoryValue2; | ||
25 | @ApiModelProperty(value = "分类3数量") | ||
26 | private String categoryValue3; | ||
27 | } |
... | @@ -20,7 +20,7 @@ public class ProportionStatisticsVO { | ... | @@ -20,7 +20,7 @@ public class ProportionStatisticsVO { |
20 | //类别 | 20 | //类别 |
21 | private String category; | 21 | private String category; |
22 | //占比 | 22 | //占比 |
23 | private String proportion; | 23 | private String proportion = "0%"; |
24 | // 小时 | 24 | // 小时 |
25 | private String hour; | 25 | private String hour; |
26 | //设备中心的设备统计用 | 26 | //设备中心的设备统计用 | ... | ... |
-
请 注册 或 登录 后发表评论