关于前端:记录二

42次阅读

共计 5827 个字符,预计需要花费 15 分钟才能阅读完成。

 @RequestMapping("/queryEID")
    public @ResponseBody
    Map<String, Object> queryEID(String searchKey, String searchValue, Page page) {Map<String, Object> dataMap = new HashMap<String, Object>();
        // 申明会员银行卡对象列表
        List<AccountCardVO> accountCardVOs = new ArrayList<AccountCardVO>(); // 改

        try {
                // 获取两个个条件属性
                Map<String, String> params = new HashMap<String, String>();
                if(StringUtil.isNotBlank(searchKey) && "customerId".equals(searchKey)) {params.put("custId", searchValue);
                    //params.put("cardType", "003");
                    logger.info(".queryAccountCard() 中 ReqParams 的值为:request:{}",new Gson().toJson(params));
                    CustAccountCardRes custAccountCardResult = prepaidCardInfoHPClient.queryCustPrepaidCard(params);
                    logger.info(".queryAccountCard() 中 ResResult 的值为:respone:{}",new Gson().toJson(custAccountCardResult));
                    if(custAccountCardResult!=null 
                            && StringUtils.equals("OK",(String) custAccountCardResult.get_sysRet()) 
                            && StringUtils.equals(SUC_CODE_000000,(String) custAccountCardResult.get_retCode())){List<CustAccountCardVO> convertCardList = (List<CustAccountCardVO>) custAccountCardResult.getCardList();
                        for(CustAccountCardVO custAccountCard : convertCardList){if(StringUtil.isNotBlank(custAccountCard.getIndexCardId())) {logger.info("queryAccountCard IndexCardId:{}", custAccountCard.getIndexCardId());
                                Map<String, String> queryAccountParam = new HashMap<String, String>();
                                queryAccountParam.put("cardSeqId", custAccountCard.getIndexCardId());
                                Map<String, Object> accountCardResult = accountCardInfoManageHPClient.accCardInfoQuery(queryAccountParam);
                                if(accountCardResult != null 
                                        && StringUtils.equals("OK",(String) accountCardResult.get("_sysRet")) 
                                        && StringUtils.equals(SUC_CODE_000000,(String) accountCardResult.get("_retCode"))) {AccountCardVO accountCardVO = new AccountCardVO();
                                    accountCardVO.setCustomerId(custAccountCard.getCustomerId());
                                    accountCardVO.setCustomerName(customerQueryClient.queryCustInfoByCustomerId(custAccountCard.getCustomerId(),"Y").getRealName());
                                    accountCardVO.setCardIndex(custAccountCard.getIndexCardId());
                                    accountCardVO.setCardStatus(AccountCardStatusEnum.getByCode(accountCardResult.get("cardStatus").toString()).getName());
                                    accountCardVO.setBindStatus(AccountCardBindStatusEnum.getByCode(accountCardResult.get("bindStatus").toString()).getName());
                                    accountCardVO.setBindReqDatetime(accountCardResult.get("bindReqDatetime").toString());
                                    accountCardVO.setUnbindReqDatetime(accountCardResult.get("unbindReqDatetime").toString());
                                    accountCardVO.setActiveReqDatetime(accountCardResult.get("activeDatetime").toString());
                                    accountCardVO.setUnactiveReqDatetime(accountCardResult.get("unactiveDatetime").toString());
                                    accountCardVOs.add(accountCardVO);
                                }
                            }

                        }
                    }
                }else if(StringUtil.isNotBlank(searchKey) && "entityId".equals(searchKey)) {Map<String, String> queryAccountParam = new HashMap<String, String>();
                    queryAccountParam.put("entityId", searchValue);
                    Map<String, Object> accountCardResult = accountCardInfoManageHPClient.accCardInfoQuery(queryAccountParam);
                    if(accountCardResult != null 
                            && StringUtils.equals("OK",(String) accountCardResult.get("_sysRet")) 
                            && StringUtils.equals(SUC_CODE_000000,(String) accountCardResult.get("_retCode"))) {AccountCardVO accountCardVO = new AccountCardVO();
                        accountCardVO.setCustomerId(accountCardResult.get("customerId").toString());
                        accountCardVO.setCustomerName(customerQueryClient.queryCustInfoByCustomerId(accountCardResult.get("customerId").toString(),"Y").getRealName());
                        accountCardVO.setCardIndex(accountCardResult.get("cardIndex").toString());
                        accountCardVO.setCardStatus(AccountCardStatusEnum.getByCode(accountCardResult.get("cardStatus").toString()).getName());
                        accountCardVO.setBindStatus(AccountCardBindStatusEnum.getByCode(accountCardResult.get("bindStatus").toString()).getName());
                        accountCardVO.setBindReqDatetime(accountCardResult.get("bindReqDatetime").toString());
                        accountCardVO.setUnbindReqDatetime(accountCardResult.get("unbindReqDatetime").toString());
                        accountCardVO.setActiveReqDatetime(accountCardResult.get("activeDatetime").toString());
                        accountCardVO.setUnactiveReqDatetime(accountCardResult.get("unactiveDatetime").toString());
                        accountCardVOs.add(accountCardVO);
                    }
                   
                }

        } catch (Exception e) {logger.error("查问账户卡信息失败,e============" + e);
        }
        dataMap.put("list", accountCardVOs);
        dataMap.put("maxCount", total);
        return dataMap;
    }
    

++++++++++++++

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title> 大敏又要熬夜了 </title>
    <script>
        $(document).ready(function () {
            var cols = [
                {
                    title: '用户名',
                    align: 'center',
                    name: 'USER_NAME',
                    width: 100,
                    sortable: false
                }, {}];

            $('#btnEIDQuery').click(function () {if (!$('#queryCondition').val()) {alert("查问条件不能为空!");
                    return;
                }
            });

            var cfg = $('#cfg').mmGrid({cols: cols,  //cols [],Array 数据模型  表头 / 数据列
                height: 300,
                root: 'list',  //root  '', string    指定 json 对象的数组字段为数据
                autoLoad: true,  //true, false    是否表格筹备好时加载数据
                loadErrorText: 'error', //'数据加载出现异常', string    数据加载异样的提醒文字

                params: function () {if ($('#queryCondition').val() == 'customerId') {
                        return {customerId: $('#conditionValue').val(),
                            status: $('#status').val()};
                    } else {
                        return {entityId: $('#conditionValue').val(),
                            status: $('#status').val()};
                    }
                },
                //object, function(){ return {}; }
                //AJAX 申请的参数。能够是一般对象或函数。函数返回一个参数对象,每次调用 AJAX 时调用。如果返回为空则不会调用 AJAX。nowrap: true,  //false, true    表格显示的数据超出列宽时是否换行
                checkCol: true,   //false, true    表格显示 checkbox
                multiSelect: true,  //false, true    数据应用本地对象数组
                fullWidthRows: true, //false, true    true: 表格第一次加载数据时列舒展,主动充斥表格
                url: '',  //false, string    AJAX 申请数据的地址
                method: 'post',  //'post', 'get'    AJAX 提交形式
                //plugins:[]})

        }
    </script>
</head>
<body>
    <div class="query">
        <div class="input-prepend">
            <span class="add-on"> 查问条件 </span>
            <select id="queryCondition" name="queryCondition" style="width: 200px;">
                <option value="customerId">customerId</option>
                <option value="entityId">entityId</option>
            </select>
            <!-- value="${conditionValue!}" -->
            <input style="width: 200px" type="text" id="conditionValue" name="conditionValue" placeholder="请输出……">
            <button type="button" id="btnEIDQuery" name="btnEIDQuery"> 查问 </button>
        </div>
        <div class="mailbox-messages">
            <table id="cfg" class="cfg">/
                <tr>
                    <th rowspan=""colspan=""></th>
                </tr>
            </table>
            <!-- <div id="pg" style="text-align: right;"></div> -->
        </div>
    </div>

</body>

</html>

正文完
 0