|
@@ -1,11 +1,15 @@
|
|
|
package cn.com.ty.lift.business.common;
|
|
|
|
|
|
+import cn.com.ty.lift.business.annualinspection.service.AnnualInspectionService;
|
|
|
+import cn.com.ty.lift.business.emergency.service.EmergencyRepairService;
|
|
|
import cn.com.ty.lift.business.framework.conf.SystemConfiguration;
|
|
|
import cn.com.ty.lift.business.framework.util.MessageUtils;
|
|
|
import cn.com.ty.lift.business.library.dao.entity.LiftBrand;
|
|
|
import cn.com.ty.lift.common.constants.RedisConstants;
|
|
|
import cn.com.ty.lift.common.model.AreaCode;
|
|
|
import cn.com.ty.lift.common.utils.ValuePool;
|
|
|
+import cn.com.ty.lift.common.verify.Ver;
|
|
|
+import cn.com.ty.lift.common.verify.Verifier;
|
|
|
import cn.com.ty.lift.common.verify.Verify;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
@@ -15,10 +19,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -38,6 +39,8 @@ public class CommonController {
|
|
|
|
|
|
private RedisTemplate<String, Object> redisTemplate;
|
|
|
private SystemConfiguration systemConfiguration;
|
|
|
+ private AnnualInspectionService annualInspectionService;
|
|
|
+ private EmergencyRepairService emergencyRepairService;
|
|
|
|
|
|
/**
|
|
|
* @return RestResponse 省、市、区树形结构列表
|
|
@@ -167,4 +170,15 @@ public class CommonController {
|
|
|
log.info("上传文件,新文件名:{}", fileName);
|
|
|
return fileName;
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("countDoing")
|
|
|
+ @Verifier(fields = {"mtCompanyId", "userId"})
|
|
|
+ public RestResponse countDoing(@Ver @RequestBody CommonRequest request){
|
|
|
+ long inspection = annualInspectionService.countDoingByUser(request);
|
|
|
+ long repair = emergencyRepairService.countDoingByUser(request);
|
|
|
+ CommonResponse common = new CommonResponse();
|
|
|
+ common.setInspection(inspection);
|
|
|
+ common.setRepair(repair);
|
|
|
+ return RestResponse.success(common);
|
|
|
+ }
|
|
|
}
|