mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
新增 查询充电报告接口
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.jsowell.pile.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电池报告DTO
|
||||
*
|
||||
* @author Lemon
|
||||
* @Date 2025/9/11 10:44:48
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class BatteryChargeReportDTO {
|
||||
private String orderCode;
|
||||
|
||||
/**
|
||||
* 报告类型
|
||||
* 1-web; 2-pdf
|
||||
*/
|
||||
private String reportType;
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.jsowell.pile.mapper;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
|
||||
import com.jsowell.pile.dto.BatteryChargeReportDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.jsowell.pile.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.jsowell.pile.domain.ChargeAlgorithmRecord;
|
||||
import com.jsowell.pile.dto.BatteryChargeReportDTO;
|
||||
import com.jsowell.pile.vo.uniapp.customer.ChargeAlgorithmRecordVO;
|
||||
|
||||
/**
|
||||
@@ -83,4 +84,11 @@ public interface ChargeAlgorithmRecordService {
|
||||
* @return
|
||||
*/
|
||||
ChargeAlgorithmRecord queryRecordByTaskId(String taskId);
|
||||
|
||||
/**
|
||||
* 通过参数获取报告地址
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
String getUrlByParams(BatteryChargeReportDTO dto);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@ package com.jsowell.pile.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.util.DateUtils;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.dto.BatteryChargeReportDTO;
|
||||
import com.jsowell.pile.service.ChargeAlgorithmRecordService;
|
||||
import com.jsowell.pile.vo.uniapp.customer.ChargeAlgorithmRecordVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -115,6 +118,25 @@ public class ChargeAlgorithmRecordServiceImpl implements ChargeAlgorithmRecordSe
|
||||
return chargeAlgorithmRecordMapper.queryRecordByTaskId(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过参数获取报告URL
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getUrlByParams(BatteryChargeReportDTO dto) {
|
||||
ChargeAlgorithmRecord record = queryRecordByOrderCode(dto.getOrderCode());
|
||||
String reportType = dto.getReportType();
|
||||
if (StringUtils.equals(Constants.ONE, reportType)) {
|
||||
// 1-web 端
|
||||
return record.getWebUrl();
|
||||
}else if (StringUtils.equals(Constants.TWO, reportType)) {
|
||||
// 2-pdf 端
|
||||
return record.getPdfUrl();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过订单号查询充电电池算法报告
|
||||
* @param orderCode
|
||||
|
||||
Reference in New Issue
Block a user