|  |  |  | 
|---|
|  |  |  | import com.dy.pipIrrTerminal.card.dto.*; | 
|---|
|  |  |  | import com.dy.pipIrrTerminal.card.qo.QoCards; | 
|---|
|  |  |  | import com.dy.pipIrrTerminal.card.qo.QoLostCards; | 
|---|
|  |  |  | import com.dy.pipIrrTerminal.card.qo.QoTransaction; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Operation; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Content; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
|---|
|  |  |  | 
|---|
|  |  |  | return BaseResponseUtils | 
|---|
|  |  |  | .buildErrorMsg(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 检查卡片地址是否已存在 | 
|---|
|  |  |  | if (cardSv.isCardAddrExists(po.getCardAddr())) { | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("该卡片地址已存在,请使用其他卡"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Map map_result = cardSv.activeOrReissueTermCard(po); | 
|---|
|  |  |  | if (map_result.get("success").equals(false)) { | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg(map_result.get("msg").toString()); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 检查卡片地址是否已存在 | 
|---|
|  |  |  | if (cardSv.isCardAddrExists(dto.getCardAddr())) { | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("该卡片地址已存在,请使用其他地址"); | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("该卡片地址已存在,请使用其他卡"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String, Object> result = cardSv.createManagementCard(dto); | 
|---|
|  |  |  | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg(result.get("msg").toString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据指定条件获取交易明细 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param vo | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @GetMapping(path = "getTransactions") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<Map> getOperates(QoTransaction vo) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(cardSv.getTransactions(vo)); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("查询交易记录异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping(path = "/getOperateRecords") | 
|---|
|  |  |  | @SsoAop() | 
|---|
|  |  |  | public BaseResponse<List<Map<String, Object>>> getOperateRecordsAndMoney(QoCards qo){ | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Long cardNum = qo.getCardNum(); | 
|---|
|  |  |  | String cardAddr = qo.getCardAddr(); | 
|---|
|  |  |  | if (cardNum == null && cardAddr == null) { | 
|---|
|  |  |  | return BaseResponseUtils.buildErrorMsg("请输入卡号或卡地址"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Map map = cardSv.getOperateRecordsAndMoney(cardNum, cardAddr); | 
|---|
|  |  |  | return BaseResponseUtils.buildSuccess(map); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("查询操作记录异常", e); | 
|---|
|  |  |  | return BaseResponseUtils.buildException(e.getMessage()) ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|