|
@@ -90,7 +90,7 @@ public class MaintenanceRecordController {
|
|
|
IPage<MtPlanResponse> pages = maintenancePlanService.pagePlanByCondition(request);
|
|
|
Verify.notNull(pages, "维保计划不存在,请核查");
|
|
|
List<MtPlanResponse> records = pages.getRecords();
|
|
|
- if (IterUtil.isNotEmpty(records)) {
|
|
|
+ if (!records.isEmpty()) {
|
|
|
List<ProjectLiftRelevance> relevances = projectLiftRelevanceService.listByMtCompany(request.getMtCompanyId());
|
|
|
records.forEach(record -> {
|
|
|
Optional<ProjectLiftRelevance> liftRelevance = relevances
|
|
@@ -186,10 +186,9 @@ public class MaintenanceRecordController {
|
|
|
Integer liftType = request.getLiftType();
|
|
|
Long mtCompanyId = request.getMtCompanyId();
|
|
|
List<MaintenanceOption> optionList = maintenanceOptionService.listByTypeAndLiftType(type, liftType, mtCompanyId);
|
|
|
- Verify.notNull(optionList, "维保操作项不存在,请核查");
|
|
|
+ Verify.notTrue(IterUtil.isEmpty(optionList), "维保操作项不存在,请核查");
|
|
|
//按照sort groupby
|
|
|
Map<Integer, List<MaintenanceOption>> mtOptionMap = optionList.stream().collect(Collectors.groupingBy(MaintenanceOption::getSort));
|
|
|
- Verify.notNull(mtOptionMap, "维保操作项不存在,请核查");
|
|
|
List<MtOptionTree> mtOptionTrees = new ArrayList<>();
|
|
|
mtOptionMap.forEach((sort, options) -> {
|
|
|
mtOptionTrees.add(new MtOptionTree(sort, options));
|
|
@@ -240,7 +239,7 @@ public class MaintenanceRecordController {
|
|
|
* app端添加维保单
|
|
|
* -3:没有维保记录(可以补录)null -> -3
|
|
|
* -2:已补录工单,(没有维保项,可以继续填写)
|
|
|
- * -1:待审核(通过app端添加的),通过后台添加的,直接 ->3
|
|
|
+ * -1:待审核(通过app端添加的),通过后台添加的,直接 ->2
|
|
|
*/
|
|
|
if (StrUtil.isEmpty(entity.getMaintenanceOption())) {
|
|
|
entity.setStatus("-2");
|
|
@@ -251,6 +250,7 @@ public class MaintenanceRecordController {
|
|
|
//补录
|
|
|
entity.setIsRepair(1);
|
|
|
entity.setWorkDate(LocalDate.now());
|
|
|
+ entity.setHasEvaluate(0);
|
|
|
return maintenanceRecordService.tofill(entity);
|
|
|
}
|
|
|
|
|
@@ -345,14 +345,14 @@ public class MaintenanceRecordController {
|
|
|
MaintenanceRecord record = maintenanceRecordService.getById(entity.getRecordId());
|
|
|
Verify.notNull(record, "维保记录不存在,请核查");
|
|
|
//状态 -1:待审核,0:待处理,1:已签到,保养中,2:完成保养,待评价,3:完成。
|
|
|
- Verify.notTrue("2".equals(record.getStatus()), "维保记录待评价才能操作");
|
|
|
+ Verify.isTrue("2".equals(record.getStatus()), "完成维保后才能评价");
|
|
|
//来源(1 维保;2 急修)
|
|
|
entity.setSource(1);
|
|
|
entity.setLiftId(record.getLiftId());
|
|
|
entity.setPostDate(LocalDateTime.now());
|
|
|
|
|
|
- //维保记录设置完成
|
|
|
- record.setStatus("3");
|
|
|
+ //维保记录设置已评价
|
|
|
+ record.setHasEvaluate(1);
|
|
|
return maintenanceRecordService.evaluate(record, entity);
|
|
|
}
|
|
|
|