mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 优化计算订单日报
This commit is contained in:
@@ -9,8 +9,6 @@ import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.common.util.file.AliyunOssUploadUtils;
|
||||
import com.jsowell.common.util.file.FileUtils;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||
import com.jsowell.pile.vo.uniapp.PileConnectorVO;
|
||||
import com.jsowell.service.PileService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -28,9 +26,6 @@ public class JumpController extends BaseController {
|
||||
@Autowired
|
||||
private PileService pileService;
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
/**
|
||||
* 查询充电桩详情
|
||||
* http://localhost:8080/app-xcx-h5/pile/pileDetail/{pileSn}
|
||||
@@ -99,73 +94,4 @@ public class JumpController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 临时刷数据接口
|
||||
* http://localhost:8080/app-xcx-h5/tempUpdateVirtualAmount
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("tempUpdateVirtualAmount")
|
||||
public RestApiResponse<?> tempUpdateVirtualAmount(HttpServletRequest request, @RequestBody QueryOrderDTO dto) {
|
||||
logger.info("临时刷数据接口 param:{}", dto);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String s = orderBasicInfoService.tempUpdateVirtualAmount(dto);
|
||||
response = new RestApiResponse<>(s);
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时刷数据接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时刷数据接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临时订单退款
|
||||
* http://localhost:8080/app-xcx-h5/tempOrderRefund
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("tempOrderRefund")
|
||||
public RestApiResponse<?> tempOrderRefund() {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
orderBasicInfoService.tempOrderRefund();
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时订单退款接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时订单退款接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退款接口
|
||||
* http://localhost:8080/app-xcx-h5/batchRefund
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/batchRefund")
|
||||
public RestApiResponse<?> batchRefund(@RequestBody QueryOrderDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
orderBasicInfoService.batchRefund(dto);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时订单退款接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时订单退款接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.jsowell.api.uniapp;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.annotation.Anonymous;
|
||||
import com.jsowell.common.core.controller.BaseController;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.response.RestApiResponse;
|
||||
import com.jsowell.pile.dto.QueryOrderDTO;
|
||||
import com.jsowell.pile.service.IOrderBasicInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 用于临时接口
|
||||
*/
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/temp")
|
||||
public class TempController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IOrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
/**
|
||||
* 临时刷数据接口
|
||||
* http://localhost:8080/temp/tempUpdateVirtualAmount
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("tempUpdateVirtualAmount")
|
||||
public RestApiResponse<?> tempUpdateVirtualAmount(HttpServletRequest request, @RequestBody QueryOrderDTO dto) {
|
||||
logger.info("临时刷数据接口 param:{}", dto);
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
String s = orderBasicInfoService.tempUpdateVirtualAmount(dto);
|
||||
response = new RestApiResponse<>(s);
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时刷数据接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时刷数据接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临时订单退款
|
||||
* http://localhost:8080/temp/tempOrderRefund
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("tempOrderRefund")
|
||||
public RestApiResponse<?> tempOrderRefund() {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
orderBasicInfoService.tempOrderRefund();
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时订单退款接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时订单退款接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退款接口
|
||||
* http://localhost:8080/temp/batchRefund
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/batchRefund")
|
||||
public RestApiResponse<?> batchRefund(@RequestBody QueryOrderDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
orderBasicInfoService.batchRefund(dto);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时订单退款接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时订单退款接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 临时接口,计算站点订单报表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/tempGenerateDailyOrderReports")
|
||||
public RestApiResponse<?> tempGenerateDailyOrderReports(@RequestBody QueryOrderDTO dto) {
|
||||
RestApiResponse<?> response = null;
|
||||
try {
|
||||
|
||||
String startTime = dto.getStartTime();
|
||||
String endTime = dto.getEndTime();
|
||||
|
||||
orderBasicInfoService.generateDailyOrderReports(dto.getStationId(), startTime, endTime);
|
||||
response = new RestApiResponse<>();
|
||||
} catch (BusinessException e) {
|
||||
logger.warn("临时订单退款接口 warn", e);
|
||||
response = new RestApiResponse<>(e.getCode(), e.getMessage());
|
||||
} catch (Exception e) {
|
||||
logger.error("临时订单退款接口 error", e);
|
||||
response = new RestApiResponse<>(ReturnCodeEnum.CODE_WEIXIN_REFUND_ERROR);
|
||||
}
|
||||
logger.info("临时刷数据接口 result:{}", JSONObject.toJSONString(response));
|
||||
return response;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user