|
@@ -2,8 +2,6 @@ package cn.com.ty.lift.business.maintenance.controller;
|
|
|
|
|
|
import cn.com.ty.lift.business.maintenance.dao.entity.model.request.PropertyMaintenanceVO;
|
|
|
import cn.com.ty.lift.business.maintenance.dao.entity.model.response.PropertyMtResponse;
|
|
|
-import cn.com.ty.lift.business.maintenance.dao.mapper.MaintenancePlanMapper;
|
|
|
-import cn.com.ty.lift.business.maintenance.dao.mapper.MaintenanceRecordMapper;
|
|
|
import cn.com.ty.lift.business.maintenance.dao.mapper.PropertyMaintenanceMapper;
|
|
|
import cn.com.ty.lift.common.constants.ApiConstants;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
@@ -18,8 +16,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@AllArgsConstructor
|
|
|
@RequestMapping("property")
|
|
|
public class PropertyMaintenanceController {
|
|
|
- private final MaintenancePlanMapper maintenancePlanMapper;
|
|
|
- private final MaintenanceRecordMapper maintenanceRecordMapper;
|
|
|
private final PropertyMaintenanceMapper propertyMaintenanceMapper;
|
|
|
|
|
|
@PostMapping("maintenance")
|
|
@@ -31,22 +27,18 @@ public class PropertyMaintenanceController {
|
|
|
|
|
|
public Page<PropertyMtResponse> propertyMtResponsePage(Page<PropertyMtResponse> propertyMtResponsePage, PropertyMaintenanceVO propertyMaintenanceVO) {
|
|
|
Page<PropertyMtResponse> page;
|
|
|
+ Integer maintenanceStatus = ApiConstants.Maintenance.WAITING_MAINTENANCE;
|
|
|
switch (propertyMaintenanceVO.getType()) {
|
|
|
case 1:
|
|
|
- page = propertyMaintenanceMapper
|
|
|
- .queryMaintenancePlanEveryDay(propertyMtResponsePage, ApiConstants.Maintenance.STATUS_UNFINISHED, propertyMaintenanceVO.getPlanDate(), propertyMaintenanceVO.getUserId());
|
|
|
break;
|
|
|
case 2:
|
|
|
- page = propertyMaintenanceMapper
|
|
|
- .queryMaintenanceRecordEveryDay(propertyMtResponsePage, propertyMaintenanceVO.getPlanDate(), propertyMaintenanceVO.getUserId());
|
|
|
+ maintenanceStatus = ApiConstants.Maintenance.MAINTENANCE_DOING;
|
|
|
break;
|
|
|
case 3:
|
|
|
- page = propertyMaintenanceMapper
|
|
|
- .queryMaintenancePlanEveryDay(propertyMtResponsePage, ApiConstants.Maintenance.STATUS_COMPLETED, propertyMaintenanceVO.getPlanDate(), propertyMaintenanceVO.getUserId());
|
|
|
+ maintenanceStatus = ApiConstants.Maintenance.COMPLETE;
|
|
|
break;
|
|
|
case 4:
|
|
|
- page = propertyMaintenanceMapper
|
|
|
- .queryMaintenancePlanEveryDay(propertyMtResponsePage, ApiConstants.Maintenance.STATUS_EXCEED, propertyMaintenanceVO.getPlanDate(), propertyMaintenanceVO.getUserId());
|
|
|
+ maintenanceStatus = ApiConstants.Maintenance.OVERDUE;
|
|
|
break;
|
|
|
case 5:
|
|
|
//todo
|
|
@@ -55,6 +47,12 @@ public class PropertyMaintenanceController {
|
|
|
default:
|
|
|
page = new Page<>();
|
|
|
}
|
|
|
+ page = propertyMaintenanceMapper
|
|
|
+ .queryMaintenancePlanEveryDay(
|
|
|
+ propertyMtResponsePage,
|
|
|
+ maintenanceStatus,
|
|
|
+ propertyMaintenanceVO.getPlanDate(),
|
|
|
+ propertyMaintenanceVO.getUserId());
|
|
|
return page;
|
|
|
}
|
|
|
}
|