|
@@ -164,14 +164,20 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
|
|
|
//返回维保计划列表
|
|
|
List<MaintenancePlan> planList = new ArrayList<>();
|
|
|
int times = getTimes(interval, beginTime, endTime);
|
|
|
+ int length = maintenanceType.length;
|
|
|
for (int i = 0; i <= times; i++) {
|
|
|
MaintenancePlan entry = new MaintenancePlan();
|
|
|
entry.setWorkerId(plan.getWorkerId());
|
|
|
entry.setLiftId(plan.getLiftId());
|
|
|
entry.setProjectId(plan.getProjectId());
|
|
|
entry.setMtCompanyId(plan.getMtCompanyId());
|
|
|
+ int mod = periods % length;
|
|
|
//设置维保类型
|
|
|
- entry.setType(maintenanceType[periods - 1]);
|
|
|
+ if (mod == 0) {
|
|
|
+ entry.setType(maintenanceType[length - 1]);
|
|
|
+ } else {
|
|
|
+ entry.setType(maintenanceType[mod - 1]);
|
|
|
+ }
|
|
|
if (i == 0) {
|
|
|
entry.setPlanDate(beginTime);
|
|
|
} else {
|
|
@@ -182,9 +188,6 @@ public class MaintenancePlanService extends ServiceImpl<MaintenancePlanMapper, M
|
|
|
}
|
|
|
System.out.printf("i:%s,期数:%s,类型:%s,计划时间:%s,%s", (i + 1), periods, entry.getType(), entry.getPlanDate(), "\n");
|
|
|
periods++;
|
|
|
- if (periods == 25) {
|
|
|
- periods = 1;
|
|
|
- }
|
|
|
planList.add(entry);
|
|
|
}
|
|
|
return planList;
|