|
@@ -10,6 +10,7 @@ import cn.com.ty.lift.common.base.ExportRequest;
|
|
import cn.com.ty.lift.common.verify.Val;
|
|
import cn.com.ty.lift.common.verify.Val;
|
|
import cn.com.ty.lift.common.verify.Validation;
|
|
import cn.com.ty.lift.common.verify.Validation;
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -108,6 +109,16 @@ public class MaintenanceController {
|
|
@PostMapping("batch/clean")
|
|
@PostMapping("batch/clean")
|
|
@Validation(fields = {"mtCompanyId", "liftIdList"})
|
|
@Validation(fields = {"mtCompanyId", "liftIdList"})
|
|
public RestResponse batchCleanPlan(@Val @RequestBody MaintenancePlanRequest request) {
|
|
public RestResponse batchCleanPlan(@Val @RequestBody MaintenancePlanRequest request) {
|
|
|
|
+
|
|
|
|
+ int count = maintenancePlanService.count(
|
|
|
|
+ new QueryWrapper<MaintenancePlan>().lambda()
|
|
|
|
+ .eq(MaintenancePlan::getMtCompanyId, request.getMtCompanyId())
|
|
|
|
+ .eq(MaintenancePlan::getStatus, 2)
|
|
|
|
+ .in(MaintenancePlan::getLiftId, request.getLiftList()));
|
|
|
|
+ if (count != 0) {
|
|
|
|
+ return RestResponse.fail("存在保养中的电梯,无法批量清空");
|
|
|
|
+ }
|
|
|
|
+
|
|
boolean result = maintenancePlanService.removeMaintenancePlan(request.getMtCompanyId(), request.getLiftIdList());
|
|
boolean result = maintenancePlanService.removeMaintenancePlan(request.getMtCompanyId(), request.getLiftIdList());
|
|
if (result) {
|
|
if (result) {
|
|
return RestResponse.success(null, MessageUtils.get("msg.modify.success"));
|
|
return RestResponse.success(null, MessageUtils.get("msg.modify.success"));
|