|
@@ -229,6 +229,8 @@ public class MaintenanceRecordController {
|
|
|
public RestResponse tofill(@Valid @RequestBody MaintenanceRecord entity) {
|
|
|
MaintenancePlan plan = maintenancePlanService.getById(entity.getMtPlanId());
|
|
|
Validate.notNull(plan, ValuePool.MAINTENANCE_PLAN_NOT_EXIST);
|
|
|
+ entity.setWorkerId(plan.getWorkerId());
|
|
|
+ entity.setWorkerId1(entity.getWorkerId());
|
|
|
entity.setPlanDate(plan.getPlanDate());
|
|
|
entity.setStatus("-2");
|
|
|
entity.setIsRegular(0);
|
|
@@ -247,6 +249,8 @@ public class MaintenanceRecordController {
|
|
|
public RestResponse add(@Valid @RequestBody MaintenanceRecord entity) {
|
|
|
MaintenancePlan plan = maintenancePlanService.getById(entity.getMtPlanId());
|
|
|
Validate.notNull(plan, ValuePool.MAINTENANCE_PLAN_NOT_EXIST);
|
|
|
+ entity.setWorkerId(plan.getWorkerId());
|
|
|
+ entity.setWorkerId1(entity.getWorkerId());
|
|
|
entity.setPlanDate(plan.getPlanDate());
|
|
|
/**
|
|
|
* app端添加维保单
|
|
@@ -325,6 +329,15 @@ public class MaintenanceRecordController {
|
|
|
*/
|
|
|
@PostMapping("workOrder")
|
|
|
public RestResponse workOrder(@Valid @RequestBody MaintenanceRecord entity) {
|
|
|
+ MaintenancePlan plan = maintenancePlanService.getById(entity.getMtPlanId());
|
|
|
+ Validate.notNull(plan, ValuePool.MAINTENANCE_PLAN_NOT_EXIST);
|
|
|
+ entity.setWorkerId(plan.getWorkerId());
|
|
|
+ entity.setWorkerId1(entity.getWorkerId());
|
|
|
+ entity.setPlanDate(plan.getPlanDate());
|
|
|
+ entity.setStatus("-2");
|
|
|
+ entity.setIsRegular(0);
|
|
|
+ //补录
|
|
|
+ entity.setIsRepair(1);
|
|
|
return maintenanceRecordService.tofill(entity);
|
|
|
}
|
|
|
|