kangwei:设备月报完善搜索接口
设备统计及分析--- 设备状态接口
正在显示
15 个修改的文件
包含
187 行增加
和
30 行删除
... | @@ -21,6 +21,7 @@ import java.util.Date; | ... | @@ -21,6 +21,7 @@ import java.util.Date; |
21 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 21 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
22 | import com.baomidou.mybatisplus.core.metadata.IPage; | 22 | import com.baomidou.mybatisplus.core.metadata.IPage; |
23 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 23 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
24 | import com.skua.modules.safe.service.IDangerLevelManageService; | ||
24 | import com.skua.modules.safe.vo.DangerLevelManageVO; | 25 | import com.skua.modules.safe.vo.DangerLevelManageVO; |
25 | import lombok.extern.slf4j.Slf4j; | 26 | import lombok.extern.slf4j.Slf4j; |
26 | 27 | ||
... | @@ -57,6 +58,8 @@ public class DangerInspectionRecordController { | ... | @@ -57,6 +58,8 @@ public class DangerInspectionRecordController { |
57 | 58 | ||
58 | @Autowired | 59 | @Autowired |
59 | private IDangerInspectionRecordService inspectionRecordService ;//巡检对象 | 60 | private IDangerInspectionRecordService inspectionRecordService ;//巡检对象 |
61 | @Autowired | ||
62 | private IDangerLevelManageService dangerLevelManageService; | ||
60 | /** | 63 | /** |
61 | * <pre> | 64 | * <pre> |
62 | * 分页列表查询 | 65 | * 分页列表查询 |
... | @@ -99,6 +102,10 @@ public class DangerInspectionRecordController { | ... | @@ -99,6 +102,10 @@ public class DangerInspectionRecordController { |
99 | if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){ | 102 | if(StringUtils.isNotBlank(dangerInspectionRecord.getEndTime())){ |
100 | queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ; | 103 | queryWrapper.le("report_date", dangerInspectionRecord.getEndTime() ) ; |
101 | } | 104 | } |
105 | //风险区域位置、风险等级(搜索条件也加) | ||
106 | if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerLevel())){ | ||
107 | queryWrapper.eq("danger_level", dangerInspectionRecord.getDangerLevel() ) ; | ||
108 | } | ||
102 | queryWrapper.orderByAsc("depart_id"); | 109 | queryWrapper.orderByAsc("depart_id"); |
103 | queryWrapper.orderByAsc("equipInfoId"); | 110 | queryWrapper.orderByAsc("equipInfoId"); |
104 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); | 111 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); |
... | @@ -114,6 +121,11 @@ public class DangerInspectionRecordController { | ... | @@ -114,6 +121,11 @@ public class DangerInspectionRecordController { |
114 | public Result<DangerInspectionRecord> add(@RequestBody DangerInspectionRecord dangerInspectionRecord) { | 121 | public Result<DangerInspectionRecord> add(@RequestBody DangerInspectionRecord dangerInspectionRecord) { |
115 | Result<DangerInspectionRecord> result = new Result<DangerInspectionRecord>(); | 122 | Result<DangerInspectionRecord> result = new Result<DangerInspectionRecord>(); |
116 | try { | 123 | try { |
124 | DangerLevelManage dangerLevelManage = dangerLevelManageService.queryById(dangerInspectionRecord.getDangerId()); | ||
125 | if(dangerLevelManage != null ){ | ||
126 | dangerInspectionRecord.setDangerName(dangerLevelManage.getDangerName() ); | ||
127 | dangerInspectionRecord.setDangerLevel(dangerLevelManage.getDangerLevel() ) ; | ||
128 | } | ||
117 | dangerInspectionRecordService.save(dangerInspectionRecord); | 129 | dangerInspectionRecordService.save(dangerInspectionRecord); |
118 | result.success("添加成功!"); | 130 | result.success("添加成功!"); |
119 | } catch (Exception e) { | 131 | } catch (Exception e) { |
... | @@ -140,6 +152,12 @@ public class DangerInspectionRecordController { | ... | @@ -140,6 +152,12 @@ public class DangerInspectionRecordController { |
140 | if(dangerInspectionRecordEntity==null) { | 152 | if(dangerInspectionRecordEntity==null) { |
141 | result.error500("未找到对应实体"); | 153 | result.error500("未找到对应实体"); |
142 | }else { | 154 | }else { |
155 | |||
156 | DangerLevelManage dangerLevelManage = dangerLevelManageService.queryById(dangerInspectionRecord.getDangerId()); | ||
157 | if(dangerLevelManage != null ){ | ||
158 | dangerInspectionRecord.setDangerName(dangerLevelManage.getDangerName() ); | ||
159 | dangerInspectionRecord.setDangerLevel(dangerLevelManage.getDangerLevel() ) ; | ||
160 | } | ||
143 | boolean ok = dangerInspectionRecordService.updateById(dangerInspectionRecord); | 161 | boolean ok = dangerInspectionRecordService.updateById(dangerInspectionRecord); |
144 | //TODO 返回false说明什么? | 162 | //TODO 返回false说明什么? |
145 | if(ok) { | 163 | if(ok) { | ... | ... |
... | @@ -77,7 +77,10 @@ public class APPDangerInspectionRecordController { | ... | @@ -77,7 +77,10 @@ public class APPDangerInspectionRecordController { |
77 | if(StringUtils.isNotBlank(dangerInspectionRecord.getStatus())){ | 77 | if(StringUtils.isNotBlank(dangerInspectionRecord.getStatus())){ |
78 | queryWrapper.eq("status", dangerInspectionRecord.getStatus() ) ; | 78 | queryWrapper.eq("status", dangerInspectionRecord.getStatus() ) ; |
79 | } | 79 | } |
80 | 80 | //风险区域位置、风险等级(搜索条件也加) | |
81 | if(StringUtils.isNotBlank(dangerInspectionRecord.getDangerLevel())){ | ||
82 | queryWrapper.eq("danger_level", dangerInspectionRecord.getDangerLevel() ) ; | ||
83 | } | ||
81 | queryWrapper.orderByDesc("report_date"); | 84 | queryWrapper.orderByDesc("report_date"); |
82 | // queryWrapper.eq("report_user", BaseContextHandler.getUserId()); | 85 | // queryWrapper.eq("report_user", BaseContextHandler.getUserId()); |
83 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); | 86 | IPage<DangerInspectionRecord> pageList = dangerInspectionRecordService.page(page, queryWrapper); | ... | ... |
... | @@ -37,12 +37,12 @@ public class DangerInspectionRecord { | ... | @@ -37,12 +37,12 @@ public class DangerInspectionRecord { |
37 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") | 37 | @Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name") |
38 | private String departId; | 38 | private String departId; |
39 | /**风险等级编号*/ | 39 | /**风险等级编号*/ |
40 | @Excel(name = "风险等级编号", width = 15) | 40 | @Excel(name = "风险区域名称编号", width = 15) |
41 | @ApiModelProperty(value = "风险等级编号") | 41 | @ApiModelProperty(value = "风险区域名称编号") |
42 | private String dangerId; | 42 | private String dangerId; |
43 | /**风险等级编号*/ | 43 | /**风险等级编号*/ |
44 | @Excel(name = "风险等级名称", width = 15) | 44 | @Excel(name = "风险区域名称", width = 15) |
45 | @ApiModelProperty(value = "风险等级名称") | 45 | @ApiModelProperty(value = "风险区域名称") |
46 | private String dangerName; | 46 | private String dangerName; |
47 | 47 | ||
48 | @Excel(name = "关联设备", width = 15) | 48 | @Excel(name = "关联设备", width = 15) |
... | @@ -114,7 +114,8 @@ public class DangerInspectionRecord { | ... | @@ -114,7 +114,8 @@ public class DangerInspectionRecord { |
114 | @ApiModelProperty(value = "条件:结束时间") | 114 | @ApiModelProperty(value = "条件:结束时间") |
115 | private String endTime; | 115 | private String endTime; |
116 | 116 | ||
117 | 117 | @ApiModelProperty(value = "风险等级") | |
118 | 118 | @Dict(dicCode = "dangerLevel") | |
119 | private String dangerLevel; | ||
119 | 120 | ||
120 | } | 121 | } | ... | ... |
... | @@ -46,6 +46,9 @@ public class DangerInspectionRecordVO { | ... | @@ -46,6 +46,9 @@ public class DangerInspectionRecordVO { |
46 | @ApiModelProperty(value = "风险等级名称") | 46 | @ApiModelProperty(value = "风险等级名称") |
47 | private String dangerName; | 47 | private String dangerName; |
48 | 48 | ||
49 | @ApiModelProperty(value = "风险等级") | ||
50 | private String dangerLevel; | ||
51 | |||
49 | @ApiModelProperty(value = "巡检状态(1:开始,2:结束)") | 52 | @ApiModelProperty(value = "巡检状态(1:开始,2:结束)") |
50 | private String status; | 53 | private String status; |
51 | 54 | ... | ... |
... | @@ -179,7 +179,7 @@ public class EquipmentStatisticsController { | ... | @@ -179,7 +179,7 @@ public class EquipmentStatisticsController { |
179 | } | 179 | } |
180 | 180 | ||
181 | 181 | ||
182 | @ApiOperation(value = "A类设备运行-设备运行时长列表", notes = "A类设备运行-设备运行时长列表") | 182 | @ApiOperation(value = "A类设备运行-设备运行时长--详情列表", notes = "A类设备运行-设备运行时长--详情列表") |
183 | @GetMapping(value = "/equipmentOperationRecordList") | 183 | @GetMapping(value = "/equipmentOperationRecordList") |
184 | public Result<List<Map<String, Object>>> equipmentOperationRecordDetail(String departId,String equipmentId, String startTime, String endTime) { | 184 | public Result<List<Map<String, Object>>> equipmentOperationRecordDetail(String departId,String equipmentId, String startTime, String endTime) { |
185 | Result<List<Map<String, Object>>> result = new Result<>(); | 185 | Result<List<Map<String, Object>>> result = new Result<>(); | ... | ... |
... | @@ -55,7 +55,7 @@ public class EquipmentRepairReportController { | ... | @@ -55,7 +55,7 @@ public class EquipmentRepairReportController { |
55 | } | 55 | } |
56 | 56 | ||
57 | @AutoLog(value = "维修维护报表-维修工单列表") | 57 | @AutoLog(value = "维修维护报表-维修工单列表") |
58 | @ApiOperation(value = "维修维护报表-维修工单列表", notes = "维修维护报表-维修工单列表") | 58 | @ApiOperation(value = "维修维护报表-维护工单列表", notes = "维修维护报表-维护工单列表") |
59 | @GetMapping(value = "/maintainTaskList") | 59 | @GetMapping(value = "/maintainTaskList") |
60 | public Result<IPage<EquipmentMaintainTaskForm>> maintainTaskList(EquipmentMaintainTaskForm maintainTaskForm, | 60 | public Result<IPage<EquipmentMaintainTaskForm>> maintainTaskList(EquipmentMaintainTaskForm maintainTaskForm, |
61 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 61 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ... | ... |
sk-module-equipment/src/main/java/com/skua/modules/equipment/mapper/EquipmentMaintainTaskMapper.java
... | @@ -76,4 +76,6 @@ public interface EquipmentMaintainTaskMapper extends BaseMapper<EquipmentMaintai | ... | @@ -76,4 +76,6 @@ public interface EquipmentMaintainTaskMapper extends BaseMapper<EquipmentMaintai |
76 | * @return | 76 | * @return |
77 | */ | 77 | */ |
78 | List<EquipmentMaintainTaskForm> queryMaintainTaskFormByList(EquipmentMaintainTaskForm maintainTaskForm); | 78 | List<EquipmentMaintainTaskForm> queryMaintainTaskFormByList(EquipmentMaintainTaskForm maintainTaskForm); |
79 | |||
80 | IPage<EquipmentMaintainTaskForm> queryMaintainTaskFormByPage(Page<EquipmentMaintainTaskForm> page, @Param("param") EquipmentMaintainTaskForm maintainTaskForm); | ||
79 | } | 81 | } | ... | ... |
... | @@ -50,6 +50,8 @@ public interface EquipmentRepairMapper extends BaseMapper<EquipmentRepair> { | ... | @@ -50,6 +50,8 @@ public interface EquipmentRepairMapper extends BaseMapper<EquipmentRepair> { |
50 | */ | 50 | */ |
51 | List<Map<String, Object>> queryStatistics(@Param(value = "equipmentRepairVO")EquipmentRepairVO equipmentRepairVO); | 51 | List<Map<String, Object>> queryStatistics(@Param(value = "equipmentRepairVO")EquipmentRepairVO equipmentRepairVO); |
52 | 52 | ||
53 | |||
54 | List<EquipmentRepairForm> queryRepairFormByPage(Page<EquipmentRepairForm> page,@Param("param") EquipmentRepairForm equipmentRepairForm); | ||
53 | /** | 55 | /** |
54 | * 维修维护报表-维修工单列表 | 56 | * 维修维护报表-维修工单列表 |
55 | * @param equipmentRepairForm | 57 | * @param equipmentRepairForm | ... | ... |
... | @@ -201,10 +201,51 @@ | ... | @@ -201,10 +201,51 @@ |
201 | </select> | 201 | </select> |
202 | 202 | ||
203 | <!-- 维修维护报表-维修工单列表 --> | 203 | <!-- 维修维护报表-维修工单列表 --> |
204 | |||
205 | <select id="queryMaintainTaskFormByPage" resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskForm"> | ||
206 | select aaa.* from ( | ||
207 | select t.depart_id, d.depart_name, ei.equipment_name, ec.id 'equipment_category_id', ec.des 'equipment_category', emp.maintenance_type, di.item_text 'maintenance_type_name', t.maintain_plan_name , | ||
208 | DATE_FORMAT(emp.start_time,'%Y-%m-%d') start_time ,DATE_FORMAT(emp.end_time,'%Y-%m-%d') end_time,u.realname 'maintenanceUser' , ems.maintenance_content | ||
209 | from equipment_maintain_task t | ||
210 | left join sys_depart d on d.id = t.depart_id | ||
211 | left join equipment_maintain_plan emp on t.plan_id = emp.id | ||
212 | left join sys_dict_item di on di.item_value = emp.maintenance_type | ||
213 | left join sys_user u on u.id = t.maintainer_id | ||
214 | LEFT JOIN equipment_maintain_plan_standard eps ON eps.plan_id = emp.id | ||
215 | LEFT JOIN equipment_maintain_standard ems ON ems.id = eps.standard_id | ||
216 | left join equipment_info ei on ei.id = t.equipment_id | ||
217 | left join equipment_category ec on ei.equipment_type = ec.id | ||
218 | )aaa | ||
219 | <where> | ||
220 | <if test=" param.departId != null and param.departId !=''"> | ||
221 | and aaa.depart_id = #{param.departId} | ||
222 | </if> | ||
223 | <if test=" param.departIds != null and param.departIds !=''"> | ||
224 | and aaa.depart_id in(${param.departIds}) | ||
225 | </if> | ||
226 | <if test=" param.equipmentCategory != null and param.equipmentCategory !=''"> | ||
227 | and aaa.equipment_category_id = #{param.equipmentCategory} | ||
228 | </if> | ||
229 | <if test=" param.maintenanceType != null and param.maintenanceType !=''"> | ||
230 | and aaa.maintenance_type = #{param.maintenanceType} | ||
231 | </if> | ||
232 | <if test=" param.startTime != null and param.startTime !=''"> | ||
233 | and DATE_FORMAT(aaa.start_time,'%Y-%m-%d') >= #{param.startTime} | ||
234 | </if> | ||
235 | <if test=" param.endTime != null and param.endTime !=''"> | ||
236 | and DATE_FORMAT(aaa.end_time,'%Y-%m-%d') <= #{param.endTime} | ||
237 | </if> | ||
238 | </where> | ||
239 | |||
240 | order by aaa.end_time desc | ||
241 | </select> | ||
242 | |||
243 | |||
204 | <select id="queryMaintainTaskFormByList" resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskForm"> | 244 | <select id="queryMaintainTaskFormByList" resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskForm"> |
205 | select aaa.* from ( | 245 | select aaa.* from ( |
206 | select t.depart_id, ei.equipment_name, ec.id 'equipment_category_id', ec.des 'equipment_category', emp.maintenance_type, di.item_text 'maintenance_type_name', t.maintain_plan_name , emp.start_time ,emp.end_time,u.realname 'maintenanceUser' , ems.maintenance_content | 246 | select t.depart_id, d.depart_name, ei.equipment_name, ec.id 'equipment_category_id', ec.des 'equipment_category', emp.maintenance_type, di.item_text 'maintenance_type_name', t.maintain_plan_name , DATE_FORMAT(emp.start_time,'%Y-%m-%d') start_time ,DATE_FORMAT(emp.end_time,'%Y-%m-%d') end_time,u.realname 'maintenanceUser' , ems.maintenance_content |
207 | from equipment_maintain_task t | 247 | from equipment_maintain_task t |
248 | left join sys_depart d on d.id = t.depart_id | ||
208 | left join equipment_maintain_plan emp on t.plan_id = emp.id | 249 | left join equipment_maintain_plan emp on t.plan_id = emp.id |
209 | left join sys_dict_item di on di.item_value = emp.maintenance_type | 250 | left join sys_dict_item di on di.item_value = emp.maintenance_type |
210 | left join sys_user u on u.id = t.maintainer_id | 251 | left join sys_user u on u.id = t.maintainer_id |
... | @@ -226,11 +267,11 @@ | ... | @@ -226,11 +267,11 @@ |
226 | <if test="maintenanceType != null and maintenanceType !=''"> | 267 | <if test="maintenanceType != null and maintenanceType !=''"> |
227 | and aaa.maintenance_type = #{maintenanceType} | 268 | and aaa.maintenance_type = #{maintenanceType} |
228 | </if> | 269 | </if> |
229 | <if test="startTime != null and startTime !=''"> | 270 | <if test=" param.startTime != null and param.startTime !=''"> |
230 | and aaa.start_time >= #{startTime} | 271 | and DATE_FORMAT(aaa.start_time,'%Y-%m-%d') >= #{param.startTime} |
231 | </if> | 272 | </if> |
232 | <if test="endTime != null and endTime !=''"> | 273 | <if test=" param.endTime != null and param.endTime !=''"> |
233 | and aaa.end_time <= #{endTime} | 274 | and DATE_FORMAT(aaa.end_time,'%Y-%m-%d') <= #{param.endTime} |
234 | </if> | 275 | </if> |
235 | </where> | 276 | </where> |
236 | 277 | ... | ... |
... | @@ -115,19 +115,84 @@ | ... | @@ -115,19 +115,84 @@ |
115 | group by a.finish_flag | 115 | group by a.finish_flag |
116 | </select> | 116 | </select> |
117 | 117 | ||
118 | <!-- 维修维护报表-维修工单列表 --> | ||
119 | <select id="queryRepairFormByPage" resultType="com.skua.modules.equipment.vo.EquipmentRepairForm"> | ||
120 | select aaa.* from ( | ||
121 | select | ||
122 | er.depart_id ,d.depart_name,ei.id 'infoId',er.finish_flag, | ||
123 | ei.equipment_name , ei.equipment_type 'equipment_category_id', ec.des 'equipment_category', di.item_text 'maintenance_type', | ||
124 | ifnull(u.realname,'-') 'maintenance_user', | ||
125 | er.repair_date,er.fault_reason,er.is_stop,er.reality_maintenance_start_time,er.reality_maintenance_end_time, | ||
126 | ifnull(EXTRACT(HOUR FROM (er.reality_maintenance_end_time - er.repair_date)),0) AS stopTime, | ||
127 | ifnull(er.fault_library_id,'-') 'repair_content' | ||
128 | from equipment_repair er | ||
129 | left join sys_depart d on er.depart_id = d.id | ||
130 | left join equipment_info ei on ei.id = er.info_id | ||
131 | left join equipment_category ec on ei.equipment_type = ec.id | ||
132 | left join sys_user u on er.maintenance_user = u.id | ||
133 | left join sys_dict_item di on di.item_value = er.maintenance_type | ||
134 | )aaa | ||
135 | <where> | ||
136 | <if test="param.departId != null and param.departId !=''"> | ||
137 | and aaa.depart_id = #{param.departId} | ||
138 | </if> | ||
139 | <if test="param.departIds != null and param.departIds !=''"> | ||
140 | and aaa.depart_id in(${param.departIds}) | ||
141 | </if> | ||
142 | <!--<if test="param.startTime != null and param.startTime !=''"> | ||
143 | and aaa.repair_date >= #{param.startTime} | ||
144 | </if> | ||
145 | <if test="param.departIds != null and param.departIds !=''"> | ||
146 | and aaa.repair_date <= #{param.endTime} | ||
147 | </if>--> | ||
118 | 148 | ||
149 | <if test="param.finishFlag != null and param.finishFlag !=''"> | ||
150 | and aaa.finish_flag in (${param.finishFlag}) | ||
151 | </if> | ||
119 | 152 | ||
120 | <!-- 维修维护报表-维修工单列表 --> | 153 | <if test="param.repairDate != null and param.repairDate !=''"> |
121 | <select id="queryRepairFormList" resultType="com.skua.modules.equipment.vo.EquipmentMaintainTaskForm"> | 154 | and DATE_FORMAT(aaa.repair_date,'%Y-%m-%d') = #{param.repairDate} |
155 | </if> | ||
156 | |||
157 | <if test="param.realityMaintenanceEndTime != null and param.realityMaintenanceEndTime !=''"> | ||
158 | and aaa.reality_maintenance_end_time = #{param.realityMaintenanceEndTime} | ||
159 | </if> | ||
160 | <if test="param.repairDate_begin != null and param.repairDate_begin !=''"> | ||
161 | and DATE_FORMAT(aaa.repair_date,'%Y-%m-%d') >= #{param.repairDate_begin} | ||
162 | </if> | ||
163 | <if test="param.repairDate_end != null and param.repairDate_end !=''"> | ||
164 | and DATE_FORMAT(aaa.repair_date,'%Y-%m-%d') <= #{param.repairDate_end} | ||
165 | </if> | ||
166 | |||
167 | |||
168 | <if test=" param.realityMaintenanceEndTime_begin != null and param.realityMaintenanceEndTime_begin !=''"> | ||
169 | and DATE_FORMAT(aaa.reality_maintenance_end_time,'%Y-%m-%d') >= #{param.realityMaintenanceEndTime_begin} | ||
170 | </if> | ||
171 | <if test=" param.realityMaintenanceEndTime_end != null and param.realityMaintenanceEndTime_end !=''"> | ||
172 | and DATE_FORMAT(aaa.reality_maintenance_end_time,'%Y-%m-%d') <= #{param.realityMaintenanceEndTime_end} | ||
173 | </if> | ||
174 | |||
175 | <if test="param.equipmentCategory != null and param.equipmentCategory !=''"> | ||
176 | and aaa.equipment_category_id = #{param.equipmentCategory} | ||
177 | </if> | ||
178 | <if test="param.maintenanceType != null and param.maintenanceType !=''"> | ||
179 | and aaa.maintenance_type = #{param.maintenanceType} | ||
180 | </if> | ||
181 | </where> | ||
182 | |||
183 | order by aaa.repair_date desc | ||
184 | </select> | ||
185 | <select id="queryRepairFormList" resultType="com.skua.modules.equipment.vo.EquipmentRepairForm"> | ||
122 | select aaa.* from ( | 186 | select aaa.* from ( |
123 | select | 187 | select |
124 | er.depart_id , | 188 | er.depart_id ,d.depart_name,ei.id 'infoId',er.finish_flag, |
125 | ei.equipment_name , ec.des 'equipment_category', di.item_text 'maintenance_type', | 189 | ei.equipment_name , ei.equipment_type 'equipment_category_id', ec.des 'equipment_category', di.item_text 'maintenance_type', |
126 | ifnull(u.realname,'-') 'maintenance_user', | 190 | ifnull(u.realname,'-') 'maintenance_user', |
127 | er.repair_date,er.fault_reason,er.is_stop,er.reality_maintenance_start_time,er.reality_maintenance_end_time, | 191 | er.repair_date,er.fault_reason,er.is_stop,er.reality_maintenance_start_time,er.reality_maintenance_end_time, |
128 | ifnull(EXTRACT(HOUR FROM (er.reality_maintenance_end_time - er.repair_date)),0) AS stopTime, | 192 | ifnull(EXTRACT(HOUR FROM (er.reality_maintenance_end_time - er.repair_date)),0) AS stopTime, |
129 | ifnull(er.fault_library_id,'-') 'repair_content' | 193 | ifnull(er.fault_library_id,'-') 'repair_content' |
130 | from equipment_repair er | 194 | from equipment_repair er |
195 | left join sys_depart d on er.depart_id = d.id | ||
131 | left join equipment_info ei on ei.id = er.info_id | 196 | left join equipment_info ei on ei.id = er.info_id |
132 | left join equipment_category ec on ei.equipment_type = ec.id | 197 | left join equipment_category ec on ei.equipment_type = ec.id |
133 | left join sys_user u on er.maintenance_user = u.id | 198 | left join sys_user u on er.maintenance_user = u.id | ... | ... |
... | @@ -365,9 +365,7 @@ public class EquipmentMaintainTaskServiceImpl extends ServiceImpl<EquipmentMaint | ... | @@ -365,9 +365,7 @@ public class EquipmentMaintainTaskServiceImpl extends ServiceImpl<EquipmentMaint |
365 | * @return | 365 | * @return |
366 | */ | 366 | */ |
367 | public IPage<EquipmentMaintainTaskForm> queryMaintainTaskFormByPage(Page<EquipmentMaintainTaskForm> page, EquipmentMaintainTaskForm maintainTaskForm){ | 367 | public IPage<EquipmentMaintainTaskForm> queryMaintainTaskFormByPage(Page<EquipmentMaintainTaskForm> page, EquipmentMaintainTaskForm maintainTaskForm){ |
368 | List<EquipmentMaintainTaskForm> dataList = this.baseMapper.queryMaintainTaskFormByList(maintainTaskForm); | 368 | return this.baseMapper.queryMaintainTaskFormByPage(page,maintainTaskForm); |
369 | page.setRecords(dataList); | ||
370 | return page; | ||
371 | } | 369 | } |
372 | /** | 370 | /** |
373 | * 列表 | 371 | * 列表 | ... | ... |
... | @@ -303,7 +303,7 @@ public class EquipmentRepairServiceImpl extends ServiceImpl<EquipmentRepairMappe | ... | @@ -303,7 +303,7 @@ public class EquipmentRepairServiceImpl extends ServiceImpl<EquipmentRepairMappe |
303 | */ | 303 | */ |
304 | public IPage<EquipmentRepairForm> queryRepairFormByPage(Page<EquipmentRepairForm> page, EquipmentRepairForm equipmentRepairForm){ | 304 | public IPage<EquipmentRepairForm> queryRepairFormByPage(Page<EquipmentRepairForm> page, EquipmentRepairForm equipmentRepairForm){ |
305 | 305 | ||
306 | List<EquipmentRepairForm> dataList = this.baseMapper.queryRepairFormList(equipmentRepairForm); | 306 | List<EquipmentRepairForm> dataList = this.baseMapper.queryRepairFormByPage(page,equipmentRepairForm); |
307 | page.setRecords(dataList); | 307 | page.setRecords(dataList); |
308 | return page; | 308 | return page; |
309 | } | 309 | } | ... | ... |
... | @@ -14,6 +14,7 @@ import com.skua.modules.equipment.vo.*; | ... | @@ -14,6 +14,7 @@ import com.skua.modules.equipment.vo.*; |
14 | import com.skua.tool.util.DateUtils; | 14 | import com.skua.tool.util.DateUtils; |
15 | import com.skua.tool.util.JSUtils; | 15 | import com.skua.tool.util.JSUtils; |
16 | import io.swagger.annotations.ApiModelProperty; | 16 | import io.swagger.annotations.ApiModelProperty; |
17 | import org.apache.commons.lang3.StringUtils; | ||
17 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
18 | import org.springframework.stereotype.Service; | 19 | import org.springframework.stereotype.Service; |
19 | import org.springframework.transaction.annotation.Transactional; | 20 | import org.springframework.transaction.annotation.Transactional; |
... | @@ -39,6 +40,8 @@ import java.util.*; | ... | @@ -39,6 +40,8 @@ import java.util.*; |
39 | public class ProductionEquipmentServiceImpl implements IProductionEquipmentService { | 40 | public class ProductionEquipmentServiceImpl implements IProductionEquipmentService { |
40 | @Autowired | 41 | @Autowired |
41 | private ProductionEquipmentMapper productionEquipmentMapper; | 42 | private ProductionEquipmentMapper productionEquipmentMapper; |
43 | @Autowired | ||
44 | private ICommonSqlService commonSqlService; | ||
42 | 45 | ||
43 | private static final String MONTH_START = "-01 00:00:00"; | 46 | private static final String MONTH_START = "-01 00:00:00"; |
44 | private static final String MONTH_END = "-31 23:59:59"; | 47 | private static final String MONTH_END = "-31 23:59:59"; |
... | @@ -436,7 +439,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -436,7 +439,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
436 | @Override | 439 | @Override |
437 | public List<TOPTenVO> getEquipmentState(ReportStatisticsDTO reportStatisticsDTO) { | 440 | public List<TOPTenVO> getEquipmentState(ReportStatisticsDTO reportStatisticsDTO) { |
438 | List<TOPTenVO> list = new ArrayList<>(); | 441 | List<TOPTenVO> list = new ArrayList<>(); |
439 | TOPTenVO topTenVO = new TOPTenVO(); | 442 | /* TOPTenVO topTenVO = new TOPTenVO(); |
440 | reportStatisticsDTO.setEquipmentType("wxdd"); | 443 | reportStatisticsDTO.setEquipmentType("wxdd"); |
441 | Integer equipmentStatus = productionEquipmentMapper.getEquipmentStatus(reportStatisticsDTO); | 444 | Integer equipmentStatus = productionEquipmentMapper.getEquipmentStatus(reportStatisticsDTO); |
442 | topTenVO.setFactoryName("待修"); | 445 | topTenVO.setFactoryName("待修"); |
... | @@ -447,7 +450,22 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -447,7 +450,22 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
447 | Integer equipmentStatus1 = productionEquipmentMapper.getEquipmentStatus(reportStatisticsDTO); | 450 | Integer equipmentStatus1 = productionEquipmentMapper.getEquipmentStatus(reportStatisticsDTO); |
448 | topTenVO1.setFactoryName("在修"); | 451 | topTenVO1.setFactoryName("在修"); |
449 | topTenVO1.setNum(equipmentStatus1.toString()); | 452 | topTenVO1.setNum(equipmentStatus1.toString()); |
450 | list.add(topTenVO1); | 453 | list.add(topTenVO1);*/ |
454 | |||
455 | String sql = "select count(1) from equipment_repair where del_flag = 1 AND finish_flag = 'djx' AND create_time >='"+reportStatisticsDTO.getStartTime()+"' AND create_time >='"+reportStatisticsDTO.getEndTime()+"'"; | ||
456 | if(StringUtils.isNotEmpty(reportStatisticsDTO.getDepartIds() )){ | ||
457 | sql += " and depart_id in("+JSUtils.quoteEach(reportStatisticsDTO.getDepartIds(),",")+") "; | ||
458 | } | ||
459 | String dx_num = commonSqlService.queryForString(sql);//待修 | ||
460 | |||
461 | sql = "select count(1) from equipment_repair where del_flag = 1 AND finish_flag in ('sbzx','wwwx') AND create_time >='"+reportStatisticsDTO.getStartTime()+"' AND create_time >='"+reportStatisticsDTO.getEndTime()+"'"; | ||
462 | if(StringUtils.isNotEmpty(reportStatisticsDTO.getDepartIds() )){ | ||
463 | sql += " and depart_id in("+JSUtils.quoteEach(reportStatisticsDTO.getDepartIds(),",")+") "; | ||
464 | } | ||
465 | String zx_num = commonSqlService.queryForString(sql);//在修 | ||
466 | |||
467 | list.add(new TOPTenVO("待修",dx_num)); | ||
468 | list.add(new TOPTenVO("在修",zx_num)); | ||
451 | return list; | 469 | return list; |
452 | } | 470 | } |
453 | 471 | ... | ... |
1 | package com.skua.modules.equipment.vo; | 1 | package com.skua.modules.equipment.vo; |
2 | 2 | ||
3 | import com.fasterxml.jackson.annotation.JsonFormat; | 3 | import com.fasterxml.jackson.annotation.JsonFormat; |
4 | import com.skua.core.aspect.annotation.Dict; | ||
4 | import io.swagger.annotations.ApiModel; | 5 | import io.swagger.annotations.ApiModel; |
5 | import io.swagger.annotations.ApiModelProperty; | 6 | import io.swagger.annotations.ApiModelProperty; |
6 | import lombok.Data; | 7 | import lombok.Data; |
... | @@ -45,6 +46,7 @@ public class EquipmentMaintainTaskForm { | ... | @@ -45,6 +46,7 @@ public class EquipmentMaintainTaskForm { |
45 | 46 | ||
46 | @Excel(name = "维护保养类型", width = 15) | 47 | @Excel(name = "维护保养类型", width = 15) |
47 | @ApiModelProperty(value = "维护保养类型") | 48 | @ApiModelProperty(value = "维护保养类型") |
49 | @Dict(dicCode = "maintenance_type") | ||
48 | private String maintenanceType; | 50 | private String maintenanceType; |
49 | 51 | ||
50 | @Excel(name = "设备分类名称", width = 15) | 52 | @Excel(name = "设备分类名称", width = 15) |
... | @@ -60,14 +62,10 @@ public class EquipmentMaintainTaskForm { | ... | @@ -60,14 +62,10 @@ public class EquipmentMaintainTaskForm { |
60 | private String maintenanceContent; | 62 | private String maintenanceContent; |
61 | 63 | ||
62 | @ApiModelProperty(value = "计划开始时间") | 64 | @ApiModelProperty(value = "计划开始时间") |
63 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") | 65 | private String startTime; |
64 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
65 | private Date startTime; | ||
66 | 66 | ||
67 | @ApiModelProperty(value = "计划结束时间") | 67 | @ApiModelProperty(value = "计划结束时间") |
68 | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") | 68 | private String endTime; |
69 | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||
70 | private Date endTime; | ||
71 | 69 | ||
72 | @Excel(name = "停机时间(H)", width = 15) | 70 | @Excel(name = "停机时间(H)", width = 15) |
73 | @ApiModelProperty(value = "停机时间") | 71 | @ApiModelProperty(value = "停机时间") | ... | ... |
... | @@ -21,4 +21,12 @@ public class TOPTenVO { | ... | @@ -21,4 +21,12 @@ public class TOPTenVO { |
21 | @ApiModelProperty(value = "对应值") | 21 | @ApiModelProperty(value = "对应值") |
22 | private String num; | 22 | private String num; |
23 | private String typeId; | 23 | private String typeId; |
24 | |||
25 | public TOPTenVO() { | ||
26 | } | ||
27 | |||
28 | public TOPTenVO(String factoryName, String num) { | ||
29 | this.factoryName = factoryName; | ||
30 | this.num = num; | ||
31 | } | ||
24 | } | 32 | } | ... | ... |
-
请 注册 或 登录 后发表评论