Browse Source

居民健康管理服务平台支付日志管理添加查看操作

humingfen 7 years ago
parent
commit
7f924dbb33

+ 19 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/PayLogController.java

@ -26,6 +26,12 @@ public class PayLogController extends BaseController {
        return "static/pay_log_list";
    }
    @RequestMapping(value = "infoInit", method = RequestMethod.GET)
    public String initInfoPage(@RequestParam(value = "id") Integer id){
        request.setAttribute("id",id);
        return "static/pay_log_modify";
    }
    @RequestMapping(value ="list",method = RequestMethod.POST)
    @ResponseBody
    public String searchList(
@ -42,4 +48,17 @@ public class PayLogController extends BaseController {
            return error(-1,"操作失败!");
        }
    }
    //根据id获取
    @RequestMapping(value = "findById")
    @ResponseBody
    public String findById(@RequestParam(value = "id") Long id) {
        try {
            PayLog payLog = payLogService.findById(id);
            return write(200, "操作成功!", "data", payLog);
        } catch (Exception e) {
            error(e);
            return error(-1, "操作失败!");
        }
    }
}

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/httplog/PayLogService.java

@ -58,4 +58,7 @@ public class PayLogService extends BaseJpaService<PayLog,PayLogDao> {
        return new PageImpl<PayLog>(payLogList,pageRequest,count);
    }
    public PayLog findById(Long id) {
        return payLogDao.findOne(id);
    }
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -317,7 +317,7 @@ reservation:
  zyurl: http://59.61.92.90:8072/wlyy_service
#健康活动url
healthbank:
  url: http://172.19.103.33:8660/svr-wlyy-health-bank/svr-health-bank/
  url: http://192.168.120.167:8661/svr-wlyy-health-bank/svr-health-bank/
wechat:
  appId: wxad04e9c4c5255acf
  appSecret: ae77c48ccf1af5d07069f5153d1ac8d3

+ 22 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/pay_log_list_js.jsp

@ -108,17 +108,38 @@
                                    }
                                    if (row.status == 1) {
                                        return "成功"
                                    }
                                    }ia
                                    if (row.status == 2) {
                                        return "已重试"
                                    }
                                }
                            },
                            {display: '创建时间', name: 'createTime', width: '10%', align: "left"},
                            {
                                display: '操作', name: 'operator', width: '5%', render: function (row) {
                                    var html = '';
                                    html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "static:paylog:view", row.id) + '">查看</a>';
                                    return html;
                                }
                            }
                        ],
                    }));
                    // 自适应宽度
                    this.grid.adjustToWidth();
                    this.bindEvents();
                },
                bindEvents: function () {
                    $.subscribe('static:paylog:view', function (event, id) {
                        var title = '支付日志详情';
                        $.ligerDialog.open({
                            height: 750,
                            width: 650,
                            title: title,
                            urlParms: {"id": id},
                            url: ctx + '/admin/paylog/infoInit',
                        })
                    });
                },
                reloadGrid: function (msg) {
                    retrieve.$element.attrScan();

+ 102 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/pay_log_modify.jsp

@ -0,0 +1,102 @@
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/7/18 0018
  Time: 下午 8:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>支付日志详情</title>
    <style type="text/css">
        .m-form-group label.label_title{width: 100px}
    </style>
</head>
<body>
<div id="div_paylog_info_form" data-role-form class="m-form-inline f-mt20 f-ml30" data-role-form>
    <input type="hidden" id="inp_id" value='${id}' data-attr-scan="id"/>
    <div class="m-form-group" style="padding:10 0 10 0">
        <label class="label_title" style="width:120px">接口类型</label>
        <div class="l-text-wrapper m-form-control ">
            <input type="text"  id="inp_type" class="f-w240 validate-special-char"   data-attr-scan="type"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">业务内容</label>
        <div class="l-text-wrapper m-form-control ">
            <input type="text"  id="inp_content" class="f-w240 validate-special-char"   data-attr-scan="content"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">调用接口</label>
        <div class="l-text-wrapper m-form-control ">
            <input type="text"  id="inp_api" class="ajax f-w240 validate-special-char"  data-attr-scan="api"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">调用方式</label>
        <div class="l-text-wrapper m-form-control">
            <input type="text"  id="inp_method" class="useTitle ajax f-w240 validate-special-char"  data-attr-scan="method"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">调用头部信息</label>
        <div class="l-text-wrapper m-form-control ">
            <input type="text"  id="inp_header" class="f-w240 validate-special-char" data-attr-scan="header"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">调用参数</label>
        <div class="l-text-wrapper m-form-control ">
            <textarea type="text"  id="inp_params" data_type='select' class="f-w240 validate-special-char"  data-attr-scan="params"></textarea>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">返回结果</label>
        <div class="l-text-wrapper m-form-control">
            <textarea type="text"  id="inp_response" class="f-w240 validate-special-char" data-attr-scan="response"></textarea>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">错误信息</label>
        <div class="l-text-wrapper m-form-control">
            <textarea type="text"  id="inp_error" class="f-w240 validate-special-char"   data-attr-scan="error"></textarea>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">状态</label>
        <div class="l-text-wrapper m-form-control">
            <input type="text"  id="inp_status" class="f-w240 validate-special-char"   data-attr-scan="status"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">重试次数</label>
        <div class="l-text-wrapper m-form-control">
            <input type="text"  id="inp_retryTimes" class="f-w240 validate-special-char"   data-attr-scan="retryTimes"/>
        </div>
    </div>
    <div class="m-form-group">
        <label class="label_title" style="width:120px">创建时间</label>
        <div class="l-text-wrapper m-form-control">
            <input type="text"  id="inp_createTime" class="f-w240 validate-special-char"   data-attr-scan="createTime"/>
        </div>
    </div>
    <%--<div class="m-form-group f-pa" id="btn_save_close" style="right: 10px;bottom: 0;">
        <div class="m-form-control">
            <input type="button" value="保存" id="btn_save" class="l-button u-btn u-btn-primary u-btn-large f-ib f-vam" />
            <div id="btn_cancel" class="l-button u-btn u-btn-cancel u-btn-large f-ib f-vam" >
                <span>关闭</span>
            </div>
        </div>
    </div>--%>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="pay_log_modify_js.jsp" %>
<%--<script src="${ctx}/static/js/device/device_modify.js"></script>--%>
</html>

+ 123 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/pay_log_modify_js.jsp

@ -0,0 +1,123 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<script>
    (function ($, win) {
        $(function () {
            /* ************************** 变量定义 ******************************** */
            var Util = $.Util;
            var menuInfo = null;
            var id = $("#inp_id").val();
            // 表单校验工具类
            var jValidation = $.jValidation;
            /* *************************** 函数定义 ******************************* */
            function pageInit() {
                menuInfo.init();
            }
            /* *************************** 模块初始化 ***************************** */
            menuInfo = {
                $form: $("#div_paylog_info_form"),
                $type: $("#inp_type"),
                $content: $("#inp_content"),
                $api: $("#inp_api"),
                $method: $("#inp_method"),
                $params: $("#inp_params"),
                $header: $("#inp_header"),
                $response: $("#inp_response"),
                $error: $("#inp_error"),
                $status: $("#inp_status"),
                $retryTimes: $("#inp_retryTimes"),
                $createTime: $("#inp_createTime"),
                init: function () {
                    _this = this;
                    this.$form.attrScan();
                    var onlyRead = false; //是否只读
                    this.$form.ligerForm({
                        validate: true
                    });
                    _this.typeBox = _this.$type.ligerComboBox({
                        width: 240,
                        data: [
                            {text: '家庭签约支付', id: '0'},
                            {text: '续方支付', id: '1'},
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'id',
                    });
                    _this.$content.ligerTextBox({width: 240});
                    _this.$api.ligerTextBox({width: 240});
                    _this.$method.ligerTextBox({width: 240});
                    _this.$params.ligerTextBox({width: 430, height: 150});
                    _this.$header.ligerTextBox({width: 240});
                    _this.$response.ligerTextBox({width: 430, height: 150});
                    _this.$retryTimes.ligerTextBox({width: 240});
                    _this.$error.ligerTextBox({width: 430, height: 150});
                    _this.statusBox = _this.$status.ligerComboBox({
                        width: 180,
                        data: [
                            {text: '失败', statusId: '0'},
                            {text: '成功', statusId: '1'},
                            {text: '已重试', statusId: '2'}
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    _this.$createTime.ligerTextBox({width: 240});
                    if (isNoEmpty(id) && id != 0) {
                        $.ajax({
                            url: ctx + '/admin/paylog/findById',
                            method: "post",
                            dataType: "json",
                            async: false,
                            data: {id: id},
                            success: function (result) {
                                if (result.status == '200') {
                                    //通过id查信息
                                    var data = result.data;
                                    _this.$form.Fields.fillValues({
                                        //位置:显示内容
                                        content: data.content,
                                        api: data.api,
                                        method: data.method,
                                        params: data.params,
                                        header: data.header,
                                        response: data.response,
                                        error: data.error,
                                        status: data.status,
                                        retryTimes: data.retryTimes,
                                        createTime: data.creatTime,
                                    });
                                    //填值
                                    _this.typeBox.setValue(data.type);
                                    _this.statusBox.setValue(data.status);
                                    // _this.$form.addClass("m-form-readonly");
                                } else {
                                    $.Notice.error(result.msg);
                                }
                            },
                            error: function (data) {
                                $.Notice.error("系统异常,请联系管理员!");
                            }
                        });
                    }
                    $("#btn_cancel").click(function () {
                        parent.window.closePayLogInfoDialog();
                    });
                }
            };
            /* *************************** 页面初始化 **************************** */
            pageInit();
        });
    })(jQuery, window);
</script>