From b03c196109e521efda923ac7b96eda7d8768f682 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 22 Aug 2023 17:12:15 +0800 Subject: [PATCH 1/3] update --- .../jsowell/api/uniapp/Jump2Controller.java | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java new file mode 100644 index 000000000..f55d27594 --- /dev/null +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java @@ -0,0 +1,123 @@ +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.core.domain.AjaxResult; +import com.jsowell.common.enums.ykc.ReturnCodeEnum; +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.service.IPileBasicInfoService; +import com.jsowell.pile.vo.uniapp.GroundLockInfoVO; +import com.jsowell.pile.vo.uniapp.PileConnectorVO; +import com.jsowell.service.PileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; + + +@Anonymous +@RestController +@RequestMapping("/app-xcx-h5/xixiao") +public class Jump2Controller extends BaseController { + + @Autowired + private PileService pileService; + + @Autowired + private IPileBasicInfoService pileBasicInfoService; + + /** + * 查询充电桩详情 + * http://localhost:8080/app-xcx-h5/pile/pileDetail/{pileSn} + */ + @GetMapping("/pile/pileDetail/{pileSn}") + public RestApiResponse getPileDetail(HttpServletRequest request, @PathVariable("pileSn") String pileSn) { + logger.info("app-xcx-h5查询充电桩详情 param:{}", pileSn); + logger.info("User-Agent:{}", request.getHeader("user-agent")); + RestApiResponse response = null; + try { + PileConnectorVO vo = pileService.getPileDetailByPileSn(pileSn); + response = new RestApiResponse<>(vo); + } catch (BusinessException e) { + logger.warn("app-xcx-h5查询充电桩详情 warn", e); + response = new RestApiResponse<>(e.getCode(), e.getMessage()); + } catch (Exception e) { + logger.error("app-xcx-h5查询充电桩详情 error", e); + response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR); + } + logger.info("app-xcx-h5查询充电桩详情 result:{}", JSONObject.toJSONString(response)); + return response; + } + + /** + * 查询充电枪口详情 + * http://localhost:8080/app-xcx-h5/pile/connectorDetail/{pileConnectorCode} + */ + @GetMapping("/pile/connectorDetail/{pileConnectorCode}") + public RestApiResponse getConnectorDetail(HttpServletRequest request, @PathVariable("pileConnectorCode") String pileConnectorCode) { + logger.info("app-xcx-h5查询充电枪口详情 param:{}", pileConnectorCode); + logger.info("User-Agent:{}", request.getHeader("user-agent")); + RestApiResponse response = null; + try { + PileConnectorVO vo = pileService.getConnectorDetail(pileConnectorCode); + response = new RestApiResponse<>(vo); + } catch (BusinessException e) { + logger.warn("app-xcx-h5查询充电枪口详情 warn param:{}", pileConnectorCode, e); + response = new RestApiResponse<>(e.getCode(), e.getMessage()); + } catch (Exception e) { + logger.error("app-xcx-h5查询充电枪口详情 error param:{}", pileConnectorCode, e); + response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR); + } + logger.info("app-xcx-h5查询充电枪口详情 param:{} result:{}", pileConnectorCode, JSONObject.toJSONString(response)); + return response; + } + + /** + * 上传到阿里云oss + * http://localhost:8080/app-xcx-h5/uploadOSS + * @param file + * @return + */ + @CrossOrigin + @PostMapping("/uploadOSS") + public AjaxResult uploadFileOSS(MultipartFile file) { + try { + String url = AliyunOssUploadUtils.uploadFile(file); + AjaxResult ajax = AjaxResult.success(); + ajax.put("url", url); + ajax.put("fileName", FileUtils.getName(url)); + ajax.put("newFileName", FileUtils.getName(url)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + }catch (Exception e){ + return AjaxResult.error(e.getMessage()); + } + } + + /** + * 获取地锁列表信息 + * http://localhost:8080/app-xcx-h5/getGroundLockInfo/{stationId} + * @param stationId + * @return + */ + @GetMapping("/getGroundLockInfo/{stationId}") + public RestApiResponse getGroundLockInfo(@PathVariable("stationId") String stationId) { + logger.info("获取地锁列表信息 params:{}", stationId); + RestApiResponse response = null; + try { + List list = pileBasicInfoService.getGroundLockInfo(stationId); + response = new RestApiResponse<>(list); + } catch (Exception e) { + logger.error("获取地锁列表信息 error, ", e); + response = new RestApiResponse<>(e); + } + logger.info("获取地锁列表信息 result:{}", response); + return response; + } +} From b211475239e47993926e52a4459fc976073a0f26 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 22 Aug 2023 17:12:46 +0800 Subject: [PATCH 2/3] update --- .../jsowell/api/uniapp/Jump2Controller.java | 123 ------------------ 1 file changed, 123 deletions(-) delete mode 100644 jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java deleted file mode 100644 index f55d27594..000000000 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/Jump2Controller.java +++ /dev/null @@ -1,123 +0,0 @@ -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.core.domain.AjaxResult; -import com.jsowell.common.enums.ykc.ReturnCodeEnum; -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.service.IPileBasicInfoService; -import com.jsowell.pile.vo.uniapp.GroundLockInfoVO; -import com.jsowell.pile.vo.uniapp.PileConnectorVO; -import com.jsowell.service.PileService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - - -@Anonymous -@RestController -@RequestMapping("/app-xcx-h5/xixiao") -public class Jump2Controller extends BaseController { - - @Autowired - private PileService pileService; - - @Autowired - private IPileBasicInfoService pileBasicInfoService; - - /** - * 查询充电桩详情 - * http://localhost:8080/app-xcx-h5/pile/pileDetail/{pileSn} - */ - @GetMapping("/pile/pileDetail/{pileSn}") - public RestApiResponse getPileDetail(HttpServletRequest request, @PathVariable("pileSn") String pileSn) { - logger.info("app-xcx-h5查询充电桩详情 param:{}", pileSn); - logger.info("User-Agent:{}", request.getHeader("user-agent")); - RestApiResponse response = null; - try { - PileConnectorVO vo = pileService.getPileDetailByPileSn(pileSn); - response = new RestApiResponse<>(vo); - } catch (BusinessException e) { - logger.warn("app-xcx-h5查询充电桩详情 warn", e); - response = new RestApiResponse<>(e.getCode(), e.getMessage()); - } catch (Exception e) { - logger.error("app-xcx-h5查询充电桩详情 error", e); - response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR); - } - logger.info("app-xcx-h5查询充电桩详情 result:{}", JSONObject.toJSONString(response)); - return response; - } - - /** - * 查询充电枪口详情 - * http://localhost:8080/app-xcx-h5/pile/connectorDetail/{pileConnectorCode} - */ - @GetMapping("/pile/connectorDetail/{pileConnectorCode}") - public RestApiResponse getConnectorDetail(HttpServletRequest request, @PathVariable("pileConnectorCode") String pileConnectorCode) { - logger.info("app-xcx-h5查询充电枪口详情 param:{}", pileConnectorCode); - logger.info("User-Agent:{}", request.getHeader("user-agent")); - RestApiResponse response = null; - try { - PileConnectorVO vo = pileService.getConnectorDetail(pileConnectorCode); - response = new RestApiResponse<>(vo); - } catch (BusinessException e) { - logger.warn("app-xcx-h5查询充电枪口详情 warn param:{}", pileConnectorCode, e); - response = new RestApiResponse<>(e.getCode(), e.getMessage()); - } catch (Exception e) { - logger.error("app-xcx-h5查询充电枪口详情 error param:{}", pileConnectorCode, e); - response = new RestApiResponse<>(ReturnCodeEnum.CODE_GET_PILE_DETAIL_ERROR); - } - logger.info("app-xcx-h5查询充电枪口详情 param:{} result:{}", pileConnectorCode, JSONObject.toJSONString(response)); - return response; - } - - /** - * 上传到阿里云oss - * http://localhost:8080/app-xcx-h5/uploadOSS - * @param file - * @return - */ - @CrossOrigin - @PostMapping("/uploadOSS") - public AjaxResult uploadFileOSS(MultipartFile file) { - try { - String url = AliyunOssUploadUtils.uploadFile(file); - AjaxResult ajax = AjaxResult.success(); - ajax.put("url", url); - ajax.put("fileName", FileUtils.getName(url)); - ajax.put("newFileName", FileUtils.getName(url)); - ajax.put("originalFilename", file.getOriginalFilename()); - return ajax; - }catch (Exception e){ - return AjaxResult.error(e.getMessage()); - } - } - - /** - * 获取地锁列表信息 - * http://localhost:8080/app-xcx-h5/getGroundLockInfo/{stationId} - * @param stationId - * @return - */ - @GetMapping("/getGroundLockInfo/{stationId}") - public RestApiResponse getGroundLockInfo(@PathVariable("stationId") String stationId) { - logger.info("获取地锁列表信息 params:{}", stationId); - RestApiResponse response = null; - try { - List list = pileBasicInfoService.getGroundLockInfo(stationId); - response = new RestApiResponse<>(list); - } catch (Exception e) { - logger.error("获取地锁列表信息 error, ", e); - response = new RestApiResponse<>(e); - } - logger.info("获取地锁列表信息 result:{}", response); - return response; - } -} From 1797066dd6618ed15d67dd24907a74d9b5f88530 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Tue, 22 Aug 2023 17:14:52 +0800 Subject: [PATCH 3/3] update --- .../src/main/java/com/jsowell/api/uniapp/TempController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/TempController.java b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/TempController.java index 68c976d13..1f4df09fd 100644 --- a/jsowell-admin/src/main/java/com/jsowell/api/uniapp/TempController.java +++ b/jsowell-admin/src/main/java/com/jsowell/api/uniapp/TempController.java @@ -223,7 +223,8 @@ public class TempController extends BaseController { List dateList = DateUtils.getAllDatesInTheDateRange(startTime, endTime); for (String tradeDate : dateList) { - orderBasicInfoService.tempOrderSplittingOperations(dto.getMerchantId(), tradeDate); + orderBasicInfoService.orderSplittingOperations(dto.getMerchantId(), tradeDate); + // orderBasicInfoService.tempOrderSplittingOperations(dto.getMerchantId(), tradeDate); // orderBasicInfoService.orderSplittingOperations(dto.getMerchantId(), tradeDate); }