mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-12 03:09:48 +08:00
新增 查询效率分析接口
This commit is contained in:
@@ -12,10 +12,12 @@ import com.jsowell.pile.dto.business.BusinessEfficiencyQueryDTO;
|
||||
import com.jsowell.pile.dto.business.BusinessOperationAnalysisQueryDTO;
|
||||
import com.jsowell.pile.dto.business.BusinessScaleQueryDTO;
|
||||
import com.jsowell.pile.service.BusinessFinancialService;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessEfficiencyAnalysisVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessEfficiencyVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessGunEfficiencyAnalysisVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessOperationAnalysisVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessScaleVO;
|
||||
import com.jsowell.pile.vo.uniapp.business.BusinessStationRankVO;
|
||||
import com.jsowell.pile.vo.web.MerchantOrderReportVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -24,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 运营端财务信息相关Controller
|
||||
*
|
||||
@@ -178,4 +182,60 @@ public class BusinessFinancialController extends BaseController {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询效率分析(单均效率 + 枪均效率)
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 效率分析数据(含单均效率和枪均效率两个维度)
|
||||
*/
|
||||
@PostMapping("/efficiencyAnalysis")
|
||||
public RestApiResponse<?> getEfficiencyAnalysis(@RequestBody BusinessOperationAnalysisQueryDTO dto) {
|
||||
logger.info("查询效率分析 params:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
if (dto == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
BusinessEfficiencyAnalysisVO result = businessFinancialService.getEfficiencyAnalysis(dto);
|
||||
response = new RestApiResponse<>(result);
|
||||
logger.info("查询效率分析成功 startTime:{}, endTime:{}",
|
||||
dto.getStartTime(), dto.getEndTime());
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("查询效率分析业务异常 code:{}, message:{}", e.getCode(), e.getMessage(), e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("查询效率分析系统异常 params:{}", JSONObject.toJSONString(dto), e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询场站订单排行
|
||||
*
|
||||
* @param dto 查询参数
|
||||
* @return 场站订单排行列表(按订单数量降序)
|
||||
*/
|
||||
@PostMapping("/stationOrderRank")
|
||||
public RestApiResponse<?> getStationOrderRank(@RequestBody BusinessOperationAnalysisQueryDTO dto) {
|
||||
logger.info("查询场站订单排行 params:{}", JSONObject.toJSONString(dto));
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
if (dto == null) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
List<BusinessStationRankVO> result = businessFinancialService.getStationOrderRank(dto);
|
||||
response = new RestApiResponse<>(result);
|
||||
logger.info("查询场站订单排行成功 startTime:{}, endTime:{}, 站点数量:{}",
|
||||
dto.getStartTime(), dto.getEndTime(), result.size());
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("查询场站订单排行业务异常 code:{}, message:{}", e.getCode(), e.getMessage(), e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("查询场站订单排行系统异常 params:{}", JSONObject.toJSONString(dto), e);
|
||||
response = new RestApiResponse<>(e);
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user