|
@@ -35,7 +35,7 @@ public class PlatformCalendarService {
|
|
|
*/
|
|
|
public RestResponse taskNum(PlatformCalendarRequest platformCalendarRequest) {
|
|
|
Map<Integer, Map<Integer, Long>> dayToLiftDataToNum = CommonUtil.initCalendarMapData(
|
|
|
- platformCalendarRequest.getRequestDateStr(), CommonConstants.PlatformCalendarConstants.REQUEST_DATE_FORMAT);
|
|
|
+ platformCalendarRequest.getRequestDateStr(), CommonConstants.PlatformCalendarConstants.TRANS_DATE_FORMAT);
|
|
|
//获取日期数 -> 电梯信息 (不同电梯状态 -> 电梯数据)
|
|
|
Map<Integer, Map<Integer, List<CalendarLiftDataModel>>> dayToCalendarLift = getDayToCalendarLift(
|
|
|
platformCalendarRequest);
|
|
@@ -46,7 +46,9 @@ public class PlatformCalendarService {
|
|
|
Map<Integer, Long> statusToLiftNum = new HashMap<>();
|
|
|
dayToCalendarLiftMap.forEach((status, calendarLiftList) -> {
|
|
|
if (calendarLiftList != null) {
|
|
|
- statusToLiftNum.put(status, calendarLiftList.stream().count());
|
|
|
+ if (status != 0) {
|
|
|
+ statusToLiftNum.put(status, calendarLiftList.stream().count());
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
dayToLiftDataToNum.put(day, statusToLiftNum);
|
|
@@ -72,7 +74,9 @@ public class PlatformCalendarService {
|
|
|
platformCalendarRequest.getRequestDateDayStr(), CommonConstants.PlatformCalendarConstants.TRANS_DATE_FORMAT));
|
|
|
if (statusToLiftData != null && statusToLiftData.size() > 0) {
|
|
|
statusToLiftData.forEach((status, calendarLiftList) -> {
|
|
|
- calendarLiftDataModelList.addAll(calendarLiftDataModelList);
|
|
|
+ if(status != 0) {
|
|
|
+ calendarLiftDataModelList.addAll(calendarLiftList);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
//去除id相同的电梯数据
|
|
@@ -86,7 +90,8 @@ public class PlatformCalendarService {
|
|
|
* @description 获取日期对应的电梯数据 天 -> 电梯数据(电梯状态 -> 电梯数据)
|
|
|
* @date 2020/2/21 11:12 上午
|
|
|
*/
|
|
|
- private Map<Integer, Map<Integer, List<CalendarLiftDataModel>>> getDayToCalendarLift(PlatformCalendarRequest platformCalendarRequest) {
|
|
|
+ private Map<Integer, Map<Integer, List<CalendarLiftDataModel>>> getDayToCalendarLift(
|
|
|
+ PlatformCalendarRequest platformCalendarRequest) {
|
|
|
//时间转化
|
|
|
CommonUtil.setMonthDate(platformCalendarRequest);
|
|
|
Map<Integer, Map<Integer, List<CalendarLiftDataModel>>> dayToCalendarLift = new HashMap<>();
|
|
@@ -191,41 +196,48 @@ public class PlatformCalendarService {
|
|
|
* @description 封装维保的电梯信息
|
|
|
* @date 2020/2/21 2:55 下午
|
|
|
*/
|
|
|
- private void addMaintenanceStatusLift(Map<Long, List<MtRecordDataModel>> liftIdToMtRecord, Map<Long, List<MtPlanDataModel>> liftIdToMtPlan, List<CalendarLiftDataModel> calendarLiftDataModelList, Long liftId) {
|
|
|
- //获取保养记录数据
|
|
|
- List<MtRecordDataModel> mtRecordDataModelList = liftIdToMtRecord.get(liftId);
|
|
|
- //获取保养计划数据
|
|
|
- List<MtPlanDataModel> mtPlanDataModelList = liftIdToMtPlan.get(liftId);
|
|
|
- if (mtRecordDataModelList != null && mtRecordDataModelList.size() > 0) {
|
|
|
- MtRecordDataModel mtRecordDataModel = mtRecordDataModelList.get(0);
|
|
|
- CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
- mtRecordDataModel.getLiftId(), mtRecordDataModel.getProjectName(),
|
|
|
- mtRecordDataModel.getRegistrationCode(), mtRecordDataModel.getLiftCode(),
|
|
|
- mtRecordDataModel.getWorkerName());
|
|
|
- //默认是维保已完成
|
|
|
- calendarLiftDataModel.setMaintenanceStatus(3);
|
|
|
- if (StringUtils.isNotBlank(mtRecordDataModel.getStatus())) {
|
|
|
- switch (mtRecordDataModel.getStatus()) {
|
|
|
- case "-2":
|
|
|
- case "-1":
|
|
|
- case "0":
|
|
|
- calendarLiftDataModel.setMaintenanceStatus(1);
|
|
|
- break;
|
|
|
- case "1":
|
|
|
- calendarLiftDataModel.setMaintenanceStatus(2);
|
|
|
- break;
|
|
|
+ private void addMaintenanceStatusLift(Map<Long, List<MtRecordDataModel>> liftIdToMtRecord,
|
|
|
+ Map<Long, List<MtPlanDataModel>> liftIdToMtPlan,
|
|
|
+ List<CalendarLiftDataModel> calendarLiftDataModelList,
|
|
|
+ Long liftId) {
|
|
|
+ if (liftIdToMtRecord != null) {
|
|
|
+ //获取保养记录数据
|
|
|
+ List<MtRecordDataModel> mtRecordDataModelList = liftIdToMtRecord.get(liftId);
|
|
|
+ if (mtRecordDataModelList != null && mtRecordDataModelList.size() > 0) {
|
|
|
+ MtRecordDataModel mtRecordDataModel = mtRecordDataModelList.get(0);
|
|
|
+ CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
+ mtRecordDataModel.getLiftId(), mtRecordDataModel.getProjectName(),
|
|
|
+ mtRecordDataModel.getRegistrationCode(), mtRecordDataModel.getLiftCode(),
|
|
|
+ mtRecordDataModel.getWorkerName());
|
|
|
+ //默认是维保已完成
|
|
|
+ calendarLiftDataModel.setMaintenanceStatus(3);
|
|
|
+ if (StringUtils.isNotBlank(mtRecordDataModel.getStatus())) {
|
|
|
+ switch (mtRecordDataModel.getStatus()) {
|
|
|
+ case "-2":
|
|
|
+ case "-1":
|
|
|
+ case "0":
|
|
|
+ calendarLiftDataModel.setMaintenanceStatus(1);
|
|
|
+ break;
|
|
|
+ case "1":
|
|
|
+ calendarLiftDataModel.setMaintenanceStatus(2);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ calendarLiftDataModelList.add(calendarLiftDataModel);
|
|
|
+ }
|
|
|
+ } else if (liftIdToMtPlan != null) {
|
|
|
+ //获取保养计划数据
|
|
|
+ List<MtPlanDataModel> mtPlanDataModelList = liftIdToMtPlan.get(liftId);
|
|
|
+ if (mtPlanDataModelList != null && mtPlanDataModelList.size() > 0) {
|
|
|
+ //有计划 则说明有待保养的电梯
|
|
|
+ MtPlanDataModel mtPlanDataModel = mtPlanDataModelList.get(0);
|
|
|
+ CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
+ mtPlanDataModel.getLiftId(), mtPlanDataModel.getProjectName(),
|
|
|
+ mtPlanDataModel.getRegistrationCode(), mtPlanDataModel.getLiftCode(),
|
|
|
+ mtPlanDataModel.getWorkerName());
|
|
|
+ calendarLiftDataModel.setMaintenanceStatus(1);
|
|
|
+ calendarLiftDataModelList.add(calendarLiftDataModel);
|
|
|
}
|
|
|
- calendarLiftDataModelList.add(calendarLiftDataModel);
|
|
|
- } else if (mtPlanDataModelList != null && mtPlanDataModelList.size() > 0) {
|
|
|
- //有计划 则说明有待保养的电梯
|
|
|
- MtPlanDataModel mtPlanDataModel = mtPlanDataModelList.get(0);
|
|
|
- CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
- mtPlanDataModel.getLiftId(), mtPlanDataModel.getProjectName(),
|
|
|
- mtPlanDataModel.getRegistrationCode(), mtPlanDataModel.getLiftCode(),
|
|
|
- mtPlanDataModel.getWorkerName());
|
|
|
- calendarLiftDataModel.setMaintenanceStatus(1);
|
|
|
- calendarLiftDataModelList.add(calendarLiftDataModel);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -237,27 +249,29 @@ public class PlatformCalendarService {
|
|
|
*/
|
|
|
private void addEmergencyStatusLift(Map<Long, List<EmergencyRecordDataModel>> liftIdToEmergencyRecord,
|
|
|
List<CalendarLiftDataModel> calendarLiftDataModelList, Long liftId) {
|
|
|
- //获取急修记录数
|
|
|
- List<EmergencyRecordDataModel> emergencyRecordDataModelList = liftIdToEmergencyRecord.get(liftId);
|
|
|
- if (emergencyRecordDataModelList != null && emergencyRecordDataModelList.size() > 0) {
|
|
|
- EmergencyRecordDataModel emergencyRecordDataModel = emergencyRecordDataModelList.get(0);
|
|
|
- CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
- emergencyRecordDataModel.getLiftId(), emergencyRecordDataModel.getProjectName(),
|
|
|
- emergencyRecordDataModel.getRegistrationCode(), emergencyRecordDataModel.getLiftCode(),
|
|
|
- emergencyRecordDataModel.getWorkerName());
|
|
|
- //急修默认状态是 待急修
|
|
|
- calendarLiftDataModel.setEmergencyStatus(4);
|
|
|
- if (emergencyRecordDataModel.getStatus() != null) {
|
|
|
- switch (emergencyRecordDataModel.getStatus()) {
|
|
|
- case 1:
|
|
|
- case 3:
|
|
|
- calendarLiftDataModel.setEmergencyStatus(5);
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- calendarLiftDataModel.setEmergencyStatus(6);
|
|
|
+ if (liftIdToEmergencyRecord != null) {
|
|
|
+ //获取急修记录数
|
|
|
+ List<EmergencyRecordDataModel> emergencyRecordDataModelList = liftIdToEmergencyRecord.get(liftId);
|
|
|
+ if (emergencyRecordDataModelList != null && emergencyRecordDataModelList.size() > 0) {
|
|
|
+ EmergencyRecordDataModel emergencyRecordDataModel = emergencyRecordDataModelList.get(0);
|
|
|
+ CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
+ emergencyRecordDataModel.getLiftId(), emergencyRecordDataModel.getProjectName(),
|
|
|
+ emergencyRecordDataModel.getRegistrationCode(), emergencyRecordDataModel.getLiftCode(),
|
|
|
+ emergencyRecordDataModel.getWorkerName());
|
|
|
+ //急修默认状态是 待急修
|
|
|
+ calendarLiftDataModel.setEmergencyStatus(4);
|
|
|
+ if (emergencyRecordDataModel.getStatus() != null) {
|
|
|
+ switch (emergencyRecordDataModel.getStatus()) {
|
|
|
+ case 1:
|
|
|
+ case 3:
|
|
|
+ calendarLiftDataModel.setEmergencyStatus(5);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ calendarLiftDataModel.setEmergencyStatus(6);
|
|
|
+ }
|
|
|
}
|
|
|
+ calendarLiftDataModelList.add(calendarLiftDataModel);
|
|
|
}
|
|
|
- calendarLiftDataModelList.add(calendarLiftDataModel);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -269,23 +283,25 @@ public class PlatformCalendarService {
|
|
|
*/
|
|
|
private void addAnnualInspectionLift(Map<Long, List<AnnualInspectionDataModel>> liftIdToAnnualInspection,
|
|
|
List<CalendarLiftDataModel> calendarLiftDataModelList, Long liftId) {
|
|
|
- //获取年检记录
|
|
|
- List<AnnualInspectionDataModel> annualInspectionDataModelList = liftIdToAnnualInspection.get(liftId);
|
|
|
- if (annualInspectionDataModelList != null && annualInspectionDataModelList.size() > 0) {
|
|
|
- AnnualInspectionDataModel annualInspectionDataModel = annualInspectionDataModelList.get(0);
|
|
|
- CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
- annualInspectionDataModel.getLiftId(), annualInspectionDataModel.getProjectName(),
|
|
|
- annualInspectionDataModel.getRegistrationCode(), annualInspectionDataModel.getLiftCode(),
|
|
|
- annualInspectionDataModel.getWorkerName());
|
|
|
- //年检默认状态 默认 计划年检
|
|
|
- calendarLiftDataModel.setAnnualInspectionStatus(7);
|
|
|
- if (annualInspectionDataModel.getStatus() != null) {
|
|
|
- if (annualInspectionDataModel.getStatus() == 1) {
|
|
|
- calendarLiftDataModel.setAnnualInspectionStatus(9);
|
|
|
- } else {
|
|
|
- if (annualInspectionDataModel.getStepStatus() != null &&
|
|
|
- annualInspectionDataModel.getStepStatus() != 1) {
|
|
|
- calendarLiftDataModel.setAnnualInspectionStatus(8);
|
|
|
+ if (liftIdToAnnualInspection != null) {
|
|
|
+ //获取年检记录
|
|
|
+ List<AnnualInspectionDataModel> annualInspectionDataModelList = liftIdToAnnualInspection.get(liftId);
|
|
|
+ if (annualInspectionDataModelList != null && annualInspectionDataModelList.size() > 0) {
|
|
|
+ AnnualInspectionDataModel annualInspectionDataModel = annualInspectionDataModelList.get(0);
|
|
|
+ CalendarLiftDataModel calendarLiftDataModel = new CalendarLiftDataModel(
|
|
|
+ annualInspectionDataModel.getLiftId(), annualInspectionDataModel.getProjectName(),
|
|
|
+ annualInspectionDataModel.getRegistrationCode(), annualInspectionDataModel.getLiftCode(),
|
|
|
+ annualInspectionDataModel.getWorkerName());
|
|
|
+ //年检默认状态 默认 计划年检
|
|
|
+ calendarLiftDataModel.setAnnualInspectionStatus(7);
|
|
|
+ if (annualInspectionDataModel.getStatus() != null) {
|
|
|
+ if (annualInspectionDataModel.getStatus() == 1) {
|
|
|
+ calendarLiftDataModel.setAnnualInspectionStatus(9);
|
|
|
+ } else {
|
|
|
+ if (annualInspectionDataModel.getStepStatus() != null &&
|
|
|
+ annualInspectionDataModel.getStepStatus() != 1) {
|
|
|
+ calendarLiftDataModel.setAnnualInspectionStatus(8);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|