From d2263e86d837ef331d77fd39dccd79f100041e76 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期一, 14 四月 2025 16:28:49 +0800 Subject: [PATCH] 获取轮灌组时,项目ID不为必须条件 --- pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java | 195 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 195 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java new file mode 100644 index 0000000..dda7296 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/clientCard/ClientCardCtrl.java @@ -0,0 +1,195 @@ +package com.dy.pipIrrSell.clientCard; + +import com.dy.common.aop.SsoAop; +import com.dy.common.webUtil.BaseResponse; +import com.dy.common.webUtil.BaseResponseUtils; +import com.dy.common.webUtil.QueryResultVo; +import com.dy.common.webUtil.ResultCodeMsg; +import com.dy.pipIrrGlobal.pojoBa.BaClient; +import com.dy.pipIrrGlobal.voSe.VoCardInfo; +import com.dy.pipIrrGlobal.voSe.VoCards; +import com.dy.pipIrrGlobal.voSe.VoCards2; +import com.dy.pipIrrSell.clientCard.qo.QoCards; +import com.dy.pipIrrSell.clientCard.qo.QoCards2; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @author ZhuBaoMin + * @date 2023-12-27 19:36 + * @LastEditTime 2023-12-27 19:36 + * @Description + */ + +@Slf4j +@Tag(name = "鍐滄埛姘村崱", description = "鍐滄埛姘村崱") +@RestController +@RequestMapping(path="clientcard") +@RequiredArgsConstructor +public class ClientCardCtrl { + private final ClientCardSv clientCardSv; + + /** + * 鑾峰彇鎸囧畾鐢ㄦ埛鍚嶄笅鍏ㄩ儴姘村崱锛堢墿鐞嗗崱+铏氭嫙鍗★級 + * @param clientId + * @return + */ + @Operation(summary = "鑾峰緱鍏ㄩ儴姘村崱", description = "杩斿洖鍏ㄩ儴姘村崱鏁版嵁") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛啘鎴锋暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BaClient.class))} + ) + }) + @GetMapping(path = "clientcard/{clientId}") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoCardInfo>>> get(@PathVariable("clientId") Long clientId){ + try { + List<VoCardInfo> list = clientCardSv.getCardInfoByClientId(clientId); + return BaseResponseUtils.buildSuccess(list); + } catch (Exception e) { + log.error("鏌ヨ鍐滄埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鏍规嵁姘村崱缂栧彿鑾峰彇鎿嶄綔璁板綍鍙婁綑棰� + * @param cardNum 姘村崱缂栧彿 + * @return 姘村崱鎿嶄綔璁板綍鍙婁綑棰� + */ + @Operation(summary = "鑾峰緱姘村崱鎿嶄綔璁板綍鍙婁綑棰�", description = "杩斿洖姘村崱鎿嶄綔璁板綍鍙婁綑棰�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛啘鎴锋暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BaClient.class))} + ) + }) + @GetMapping(path = "/getoperaterecords") + @SsoAop() + public BaseResponse<List<Map<String, Object>>> getOperateRecordsAndMoney(@RequestParam("cardNum") Long cardNum){ + try { + Map map = clientCardSv.getOperateRecordsAndMoney(cardNum); + return BaseResponseUtils.buildSuccess(map); + } catch (Exception e) { + log.error("鏌ヨ鎿嶄綔璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鏍规嵁姘村崱缂栧彿鑾峰彇鍗$墖鐘舵�� + * @param cardNum + * @return + */ + @Operation(summary = "鏍规嵁姘村崱缂栧彿鑾峰彇鍗$墖鐘舵��", description = "鏍规嵁姘村崱缂栧彿鑾峰彇鍗$墖鐘舵��") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛啘鎴锋暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BaClient.class))} + ) + }) + @GetMapping(path = "/cardstate") + @SsoAop() + public BaseResponse<String> getCardStateByCardNum(@RequestParam("cardNum") Long cardNum){ + try { + String stateName = clientCardSv.getCardStateByCardNum(cardNum); + return BaseResponseUtils.buildSuccess(stateName); + } catch (Exception e) { + log.error("鏌ヨ鎿嶄綔璁板綍寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鏍规嵁鎸囧畾鏉′欢鑾峰彇姘村崱鍒楄〃锛屽簲鐢ㄧ▼搴忎娇鐢� + * @param vo + * @return + */ + @Operation(summary = "鑾峰緱涓�椤垫按鍗¤褰�", description = "杩斿洖涓�椤垫按鍗℃暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛啘鎴锋暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BaClient.class))} + ) + }) + @GetMapping(path = "getcards") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoCards>>> getcards(QoCards vo){ + try { + QueryResultVo<List<VoCards>> res = clientCardSv.getCards(vo); + return BaseResponseUtils.buildSuccess(res); + } catch (Exception e) { + log.error("鏌ヨ鍐滄埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鑾峰緱涓�椤靛凡鎸傚け锛屾湭琛ュ崱鐨勬按鍗¤褰� + * @param vo + * @return + */ + @Operation(summary = "鑾峰緱涓�椤靛凡鎸傚け锛屾湭琛ュ崱鐨勬按鍗¤褰�", description = "杩斿洖涓�椤靛凡鎸傚け锛屾湭琛ュ崱鐨勬按鍗℃暟鎹�") + @ApiResponses(value = { + @ApiResponse( + responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE, + description = "杩斿洖涓�椤靛啘鎴锋暟鎹紙BaseResponse.content:QueryResultVo[{}]锛�", + content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE, + schema = @Schema(implementation = BaClient.class))} + ) + }) + @GetMapping(path = "getUnreplaced") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoCards>>> getUnreplaced(QoCards vo){ + try { + QueryResultVo<List<VoCards>> res = clientCardSv.getUnreplaced(vo); + return BaseResponseUtils.buildSuccess(res); + + } catch (Exception e) { + log.error("鏌ヨ鍐滄埛寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } + + /** + * 鏍规嵁鍐滄埛濮撳悕銆佺數璇濇煡璇㈡甯哥姸鎬佺殑姘村崱鍒楄〃 + * @param vo + * @return + */ + @GetMapping(path = "getCardsByClientNameAndPhone") + @SsoAop() + public BaseResponse<QueryResultVo<List<VoCards2>>> getCardsByClientNameAndPhone(QoCards2 vo){ + try { + QueryResultVo<List<VoCards2>> res = clientCardSv.getCardsByClientNameAndPhone(vo); + return BaseResponseUtils.buildSuccess(res); + //if(res.itemTotal != null && res.itemTotal > 0) { + // return BaseResponseUtils.buildSuccess(res); + //}else { + // return BaseResponseUtils.buildFail(SellResultCode.THE_CARD_NOT_EXIST.getMessage()); + //} + } catch (Exception e) { + log.error("鏌ヨ姘村崱寮傚父", e); + return BaseResponseUtils.buildException(e.getMessage()) ; + } + } +} -- Gitblit v1.8.0