|
@@ -0,0 +1,169 @@
|
|
|
+package com.qmth.sop.server.api;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.qmth.boot.api.annotation.Aac;
|
|
|
+import com.qmth.boot.api.constant.ApiConstant;
|
|
|
+import com.qmth.sop.business.bean.result.CrmAnalyseResult;
|
|
|
+import com.qmth.sop.business.bean.result.TBCrmResult;
|
|
|
+import com.qmth.sop.business.service.CrmAnalyseService;
|
|
|
+import com.qmth.sop.common.contant.SystemConstant;
|
|
|
+import com.qmth.sop.common.enums.ProductTypeEnum;
|
|
|
+import com.qmth.sop.common.util.Result;
|
|
|
+import com.qmth.sop.common.util.ResultUtil;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.validation.constraints.Max;
|
|
|
+import javax.validation.constraints.Min;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 派单分析 控制器
|
|
|
+ *
|
|
|
+ * @author: shudonghui
|
|
|
+ * @date: 2023-08-14 15:55:18
|
|
|
+ * @version: 1.0
|
|
|
+ * @email: shudonghui@qmth.com.cn
|
|
|
+ * @Company: www.qmth.com.cn
|
|
|
+ */
|
|
|
+@Api(tags = "派单分析 Controller")
|
|
|
+@RestController
|
|
|
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_CRM + "/analyse")
|
|
|
+public class CrmAnalyseController {
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ CrmAnalyseService crmAnalyseService;
|
|
|
+
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "客户类型分布接口")
|
|
|
+ @RequestMapping(value = "/custom/type", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "客户类型分布", response = Map.class)})
|
|
|
+ public Result customType(@ApiParam(value = "年度", required = true) @RequestParam String year) {
|
|
|
+ Map<String, Object> map = crmAnalyseService.countCustomType(year);
|
|
|
+
|
|
|
+ return ResultUtil.ok(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "客户类型分布下钻接口")
|
|
|
+ @RequestMapping(value = "/custom/type/detail", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "客户类型分布下钻", response = TBCrmResult.class)})
|
|
|
+ public Result customTypeDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+ IPage<TBCrmResult> resultIPage = crmAnalyseService.customTypeDetail(new Page<>(pageNumber, pageSize), year, type);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "月度派单分布及对比接口")
|
|
|
+ @RequestMapping(value = "/monthly", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "月度派单分布及对比接口", response = Map.class)})
|
|
|
+ public Result monthly(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type) {
|
|
|
+ Map<String, List<Map<String,String>>> map = crmAnalyseService.monthly(year, type);
|
|
|
+ return ResultUtil.ok(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "月度派单分布下钻接口")
|
|
|
+ @RequestMapping(value = "/monthly/detail", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "月度派单分布下钻", response = TBCrmResult.class)})
|
|
|
+ public Result monthlyDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "月份", required = true) @RequestParam String month,
|
|
|
+ @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+ IPage<TBCrmResult> resultIPage = crmAnalyseService.monthlyDetail(new Page<>(pageNumber, pageSize), year,month, type);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
+ }
|
|
|
+
|
|
|
+ //供应商派单分布
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "供应商派单分布接口")
|
|
|
+ @RequestMapping(value = "/supplier", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "供应商派单分布", response = CrmAnalyseResult.class)})
|
|
|
+ public Result supplier(@ApiParam(value = "年度", required = true) @RequestParam String year) {
|
|
|
+ List<CrmAnalyseResult> list = crmAnalyseService.supplier(year);
|
|
|
+ return ResultUtil.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "供应商派单分布下钻接口")
|
|
|
+ @RequestMapping(value = "/supplier/detail", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "供应商派单分布下钻", response = TBCrmResult.class)})
|
|
|
+ public Result supplierDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "供应商", required = true) @RequestParam Long supplierId,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+ IPage<TBCrmResult> resultIPage = crmAnalyseService.supplierDetail(new Page<>(pageNumber, pageSize), year,supplierId);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
+ }
|
|
|
+ //大区在执行派单排名
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "大区在执行派单排名接口")
|
|
|
+ @RequestMapping(value = "/region", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "大区在执行派单排名", response = CrmAnalyseResult.class)})
|
|
|
+ public Result region(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type) {
|
|
|
+ Map<String, List<CrmAnalyseResult>> map = crmAnalyseService.region(year,type);
|
|
|
+ return ResultUtil.ok(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //大区在执行派单排名
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "大区在执行派单排名下钻接口")
|
|
|
+ @RequestMapping(value = "/region/detail", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "大区在执行派单排名下钻", response = CrmAnalyseResult.class)})
|
|
|
+ public Result regionDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "大区", required = true) @RequestParam Long regionId,
|
|
|
+ @ApiParam(value = "客户类型", required = true) @RequestParam ProductTypeEnum type,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+ IPage<TBCrmResult> resultIPage = crmAnalyseService.regionDetail(new Page<>(pageNumber, pageSize), year,regionId,type);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //项目派单完成率
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "项目派单完成率接口")
|
|
|
+ @RequestMapping(value = "/project", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "项目派单完成率", response = CrmAnalyseResult.class)})
|
|
|
+ public Result project(@ApiParam(value = "年度", required = true) @RequestParam String year) {
|
|
|
+ List<CrmAnalyseResult> list = crmAnalyseService.project(year);
|
|
|
+ return ResultUtil.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ //项目派单完成率详细
|
|
|
+ @Aac(auth = false)
|
|
|
+ @ApiOperation(value = "项目派单完成率详细接口")
|
|
|
+ @RequestMapping(value = "/project/detail", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "项目派单完成率详细", response = CrmAnalyseResult.class)})
|
|
|
+ public Result projectDetail(@ApiParam(value = "年度", required = true) @RequestParam String year,
|
|
|
+ @ApiParam(value = "服务单元", required = true) @RequestParam Long serviceId,
|
|
|
+ @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
+ @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
|
+ IPage<TBCrmResult> resultIPage = crmAnalyseService.projectDetail(new Page<>(pageNumber, pageSize), year,serviceId);
|
|
|
+
|
|
|
+ return ResultUtil.ok(resultIPage);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|