fix-维修月度分析
This commit is contained in:
@@ -113,4 +113,60 @@ public class MerchantMonthlyMaintenanceAnalysis {
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceCostModelAndCompany(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维保单车成本格子图")
|
||||
@RequestMapping(value = "/cost/lattice", method = RequestMethod.POST)
|
||||
public CommonResult<MonthlyMaintenanceAnalysisCostResponse> indexDateCost(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
||||
request.setMerId(systemAdmin.getMerId());
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceAnalysisCostLattice(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维保成本top5和维保成本top公司柱状图")
|
||||
@RequestMapping(value = "/cost/modelandcompany/histogram", method = RequestMethod.POST)
|
||||
public CommonResult<TopChartResponse> costModelAndCompanyHistogram(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
||||
request.setMerId(systemAdmin.getMerId());
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getModelAndCompanyHistogram(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维修利润按车型和公司饼图")
|
||||
@RequestMapping(value = "/profit/modelandcompany", method = RequestMethod.POST)
|
||||
public CommonResult<ModelAndCompanyPieResponse> profitModelAndCompany(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
||||
request.setMerId(systemAdmin.getMerId());
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceProfitModelAndCompany(request));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "维保单车利润格子图")
|
||||
@RequestMapping(value = "/profit/lattice", method = RequestMethod.POST)
|
||||
public CommonResult<MonthlyMaintenanceAnalysisProfitResponse> indexDateProfit(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
||||
request.setMerId(systemAdmin.getMerId());
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceAnalysisProfitLattice(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维保利润top5车型和维保利润top5公司")
|
||||
@RequestMapping(value = "/profit/modelandcompany/histogram", method = RequestMethod.POST)
|
||||
public CommonResult<TopChartResponse> profitModelAndCompanyHistogram(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
SystemAdmin systemAdmin = SecurityUtil.getLoginUserVo().getUser();
|
||||
request.setMerId(systemAdmin.getMerId());
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getProfitModelAndCompanyHistogram(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,4 +120,65 @@ public class PlatformMonthlyMaintenanceAnalysis {
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceCostModelAndCompany(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维保单车成本格子图")
|
||||
@RequestMapping(value = "/cost/lattice", method = RequestMethod.POST)
|
||||
public CommonResult<MonthlyMaintenanceAnalysisCostResponse> indexDateCost(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getMerId() == null) {
|
||||
return CommonResult.success(new MonthlyMaintenanceAnalysisCostResponse());
|
||||
}
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceAnalysisCostLattice(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维保成本top5和维保成本top公司柱状图")
|
||||
@RequestMapping(value = "/cost/modelandcompany/histogram", method = RequestMethod.POST)
|
||||
public CommonResult<TopChartResponse> costModelAndCompanyHistogram(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getMerId() == null) {
|
||||
return CommonResult.success(new TopChartResponse());
|
||||
}
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getModelAndCompanyHistogram(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维修利润按车型和公司饼图")
|
||||
@RequestMapping(value = "/profit/modelandcompany", method = RequestMethod.POST)
|
||||
public CommonResult<ModelAndCompanyPieResponse> profitModelAndCompany(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getMerId() == null) {
|
||||
return CommonResult.success(new ModelAndCompanyPieResponse());
|
||||
}
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceProfitModelAndCompany(request));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "维保单车成本格子图")
|
||||
@RequestMapping(value = "/profit/lattice", method = RequestMethod.POST)
|
||||
public CommonResult<MonthlyMaintenanceAnalysisProfitResponse> indexDateProfit(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getMerId() == null) {
|
||||
return CommonResult.success(new MonthlyMaintenanceAnalysisProfitResponse());
|
||||
}
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getMonthlyMaintenanceAnalysisProfitLattice(request));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "维保利润top5车型和维保利润top5公司")
|
||||
@RequestMapping(value = "/profit/modelandcompany/histogram", method = RequestMethod.POST)
|
||||
public CommonResult<TopChartResponse> profitModelAndCompanyHistogram(@RequestBody MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getMerId() == null) {
|
||||
return CommonResult.success(new TopChartResponse());
|
||||
}
|
||||
if (StrUtil.isBlank(request.getDateLimit())) {
|
||||
request.setDateLimit("preMonth");
|
||||
}
|
||||
return CommonResult.success(homeService.getProfitModelAndCompanyHistogram(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,14 @@ public interface HomeService {
|
||||
TopChartResponse getMonthlyMaintenanceModelAndCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
ModelAndCompanyPieResponse getMonthlyMaintenanceCostModelAndCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
MonthlyMaintenanceAnalysisCostResponse getMonthlyMaintenanceAnalysisCostLattice(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
TopChartResponse getModelAndCompanyHistogram(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
ModelAndCompanyPieResponse getMonthlyMaintenanceProfitModelAndCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
TopChartResponse getProfitModelAndCompanyHistogram(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
MonthlyMaintenanceAnalysisProfitResponse getMonthlyMaintenanceAnalysisProfitLattice(MonthlyMaintenanceAnalysis request);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public class HomeServiceImpl implements HomeService {
|
||||
@Override
|
||||
public LinkedHashMap<String, BusinessAnalysis> getLineChart(BusinessAnalysisRequest request) {
|
||||
QueryWrapper<BusinessAnalysis> qw = new QueryWrapper<>();
|
||||
qw.select("date_sn,DATE_FORMAT(date_sn, '%m') AS date_key,IFNULL(SUM(total_turnover),0) as total_turnover,IFNULL(SUM(costs),0) as costs,IFNULL(SUM(profit),0) as profit,mer_id");
|
||||
qw.select("DATE_FORMAT(date_sn, '%m') AS date_key,IFNULL(SUM(total_turnover),0) as total_turnover,IFNULL(SUM(costs),0) as costs,IFNULL(SUM(profit),0) as profit,mer_id");
|
||||
qw.between("date_sn", DateUtil.beginOfYear(new Date()), DateUtil.endOfYear(new Date()));
|
||||
if (request.getMerId() != null) {
|
||||
qw.eq("mer_id", request.getMerId());
|
||||
@@ -330,10 +330,9 @@ public class HomeServiceImpl implements HomeService {
|
||||
//维保单车产值
|
||||
BusinessAnalysisVo avg = carReservationOrderService.getAverage(request);
|
||||
//维保单车产值按车型
|
||||
BusinessAnalysisVo avgModel = carReservationOrderService.getAverageModel(request);
|
||||
List<BusinessAnalysisVo> avgModel = carReservationOrderService.getAverageModel(request);
|
||||
//维保单车产值按公司
|
||||
BusinessAnalysisVo avgCompany = carReservationOrderService.getAverageCompany(request);
|
||||
|
||||
List<BusinessAnalysisVo> avgCompany = carReservationOrderService.getAverageCompany(request);
|
||||
|
||||
response.setAverage(avg);
|
||||
response.setAverageModel(avgModel);
|
||||
@@ -351,6 +350,59 @@ public class HomeServiceImpl implements HomeService {
|
||||
return carReservationOrderService.queryCostModelAndCompany(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MonthlyMaintenanceAnalysisCostResponse getMonthlyMaintenanceAnalysisCostLattice(MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getType() == null || request.getType() < 1 || request.getType() > 3) {
|
||||
throw new LxkException("维修类型不能为空");
|
||||
}
|
||||
MonthlyMaintenanceAnalysisCostResponse response = new MonthlyMaintenanceAnalysisCostResponse();
|
||||
//维保单车产值
|
||||
BusinessAnalysisVo avg = carReservationOrderService.getCostAverage(request);
|
||||
//维保单车产值按车型
|
||||
List<BusinessAnalysisVo> avgModel = carReservationOrderService.getCostAverageModel(request);
|
||||
//维保单车产值按公司
|
||||
List<BusinessAnalysisVo> avgCompany = carReservationOrderService.getCostAverageCompany(request);
|
||||
|
||||
response.setAverage(avg);
|
||||
response.setAverageModel(avgModel);
|
||||
response.setAverageModel(avgCompany);
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TopChartResponse getModelAndCompanyHistogram(MonthlyMaintenanceAnalysis request) {
|
||||
return carReservationOrderService.getModelAndCompanyHistogram(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndCompanyPieResponse getMonthlyMaintenanceProfitModelAndCompany(MonthlyMaintenanceAnalysis request) {
|
||||
return carReservationOrderService.getProfitModelAndCompany(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TopChartResponse getProfitModelAndCompanyHistogram(MonthlyMaintenanceAnalysis request) {
|
||||
return carReservationOrderService.queryProfitModelAndCompanyHistogram(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MonthlyMaintenanceAnalysisProfitResponse getMonthlyMaintenanceAnalysisProfitLattice(MonthlyMaintenanceAnalysis request) {
|
||||
if (request.getType() == null || request.getType() < 1 || request.getType() > 3) {
|
||||
throw new LxkException("维修类型不能为空");
|
||||
}
|
||||
MonthlyMaintenanceAnalysisProfitResponse response = new MonthlyMaintenanceAnalysisProfitResponse();
|
||||
//维保单车产值
|
||||
BusinessAnalysisVo avg = carReservationOrderService.getProfitAverage(request);
|
||||
//维保单车产值按车型
|
||||
List<BusinessAnalysisVo> avgModel = carReservationOrderService.getProfitAverageModel(request);
|
||||
//维保单车产值按公司
|
||||
List<BusinessAnalysisVo> avgCompany = carReservationOrderService.getProfitAverageCompany(request);
|
||||
|
||||
response.setAverage(avg);
|
||||
response.setModel(avgModel);
|
||||
response.setCompany(avgCompany);
|
||||
return response;
|
||||
}
|
||||
|
||||
public BrokenLineResponse boardInfo(String dateLat, Integer merId) {
|
||||
//工单数据
|
||||
Integer totalRepairOrderNum = carReservationOrderService.getTotalRepairOrderNum(dateLat, merId);
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -20,8 +21,8 @@ public class MonthlyMaintenanceAnalysisAvgResponse implements Serializable {
|
||||
private BusinessAnalysisVo average;
|
||||
|
||||
@ApiModelProperty(value = "按照车型")
|
||||
private BusinessAnalysisVo averageModel;
|
||||
private List<BusinessAnalysisVo> averageModel;
|
||||
|
||||
@ApiModelProperty(value = "按照所属公司")
|
||||
private BusinessAnalysisVo averageCompany;
|
||||
private List<BusinessAnalysisVo> averageCompany;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zbkj.common.response;
|
||||
|
||||
import com.zbkj.common.vo.BusinessAnalysisVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MonthlyMaintenanceAnalysisCostResponse", description = "MonthlyMaintenanceAnalysisCostResponse")
|
||||
public class MonthlyMaintenanceAnalysisCostResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "平均单车")
|
||||
private BusinessAnalysisVo average;
|
||||
|
||||
@ApiModelProperty(value = "按照车型分")
|
||||
private List<BusinessAnalysisVo> averageModel;
|
||||
|
||||
@ApiModelProperty(value = "按照所属公司分")
|
||||
private List<BusinessAnalysisVo> averageCompany;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zbkj.common.response;
|
||||
|
||||
import com.zbkj.common.vo.BusinessAnalysisVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "MonthlyMaintenanceAnalysisProfitResponse", description = "MonthlyMaintenanceAnalysisProfitResponse")
|
||||
public class MonthlyMaintenanceAnalysisProfitResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "平均单车利润")
|
||||
private BusinessAnalysisVo average;
|
||||
|
||||
@ApiModelProperty(value = "按照车型分")
|
||||
private List<BusinessAnalysisVo> model;
|
||||
|
||||
@ApiModelProperty(value = "按照所属公司分")
|
||||
private List<BusinessAnalysisVo> company;
|
||||
}
|
||||
@@ -19,4 +19,10 @@ public class BusinessAnalysisVo implements Serializable {
|
||||
@ApiModelProperty(value = "环比")
|
||||
private BigDecimal linkRelativeRatio;
|
||||
|
||||
@ApiModelProperty(value = "按车型分为车型id,按公司分为车商id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ import com.zbkj.common.request.MonthlyMaintenanceAnalysis;
|
||||
import com.zbkj.common.request.PageParamRequest;
|
||||
import com.zbkj.common.request.accessory.OrderReceiveRequest;
|
||||
import com.zbkj.common.request.car.*;
|
||||
import com.zbkj.common.response.ModelAndCompanyPieResponse;
|
||||
import com.zbkj.common.response.PieChartResponse;
|
||||
import com.zbkj.common.response.TopChartResponse;
|
||||
import com.zbkj.common.response.*;
|
||||
import com.zbkj.common.response.car.*;
|
||||
import com.zbkj.common.vo.BusinessAnalysisVo;
|
||||
|
||||
@@ -411,11 +409,29 @@ public interface CarReservationOrderService extends IService<CarReservationOrder
|
||||
|
||||
BusinessAnalysisVo getAverage(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
BusinessAnalysisVo getAverageModel(MonthlyMaintenanceAnalysis request);
|
||||
List<BusinessAnalysisVo> getAverageModel(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
BusinessAnalysisVo getAverageCompany(MonthlyMaintenanceAnalysis request);
|
||||
List<BusinessAnalysisVo> getAverageCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
TopChartResponse queryModelAndCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
ModelAndCompanyPieResponse queryCostModelAndCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
TopChartResponse getModelAndCompanyHistogram(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
ModelAndCompanyPieResponse getProfitModelAndCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
TopChartResponse queryProfitModelAndCompanyHistogram(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
BusinessAnalysisVo getProfitAverage(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
List<BusinessAnalysisVo> getProfitAverageCompany(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
List<BusinessAnalysisVo> getProfitAverageModel(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
BusinessAnalysisVo getCostAverage(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
List<BusinessAnalysisVo> getCostAverageModel(MonthlyMaintenanceAnalysis request);
|
||||
|
||||
List<BusinessAnalysisVo> getCostAverageCompany(MonthlyMaintenanceAnalysis request);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user