Parcourir la source

居民健康管理平台支付日志添加状态筛选条件

humingfen il y a 7 ans
Parent
commit
48bd7225c8

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

@ -38,10 +38,11 @@ public class PayLogController extends BaseController {
            @RequestParam(value = "params",required = false) String params,
            @RequestParam(value = "startDate",required = false) String startDate,
            @RequestParam(value = "endDate",required = false) String endDate,
            @RequestParam(value = "status",required = false) String status,
            @RequestParam(value = "page",required = false) Integer page,
            @RequestParam(value = "rows",required = false) Integer pageSize){
        try{
            Page<PayLog> payLogs = payLogService.searchList(params,startDate, endDate, page, pageSize);
            Page<PayLog> payLogs = payLogService.searchList(params,startDate, endDate, status, page, pageSize);
            return write(200,"操作成功",page,pageSize,payLogs);
        }catch (Exception ex){
            error(ex);

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

@ -27,7 +27,7 @@ public class PayLogService extends BaseJpaService<PayLog,PayLogDao> {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public Page<PayLog> searchList(String params, String startDate, String endDate, Integer page, Integer pageSize) throws Exception{
    public Page<PayLog> searchList(String params, String startDate, String endDate, String status, Integer page, Integer pageSize) throws Exception{
        List<PayLog> payLogList = new ArrayList<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if(page == null){
@ -49,7 +49,9 @@ public class PayLogService extends BaseJpaService<PayLog,PayLogDao> {
        if(!StringUtils.isEmpty(endDate)){
            filters.append("and create_time < '"+endDate+"' ");
        }
        if(!StringUtils.isEmpty(status)){
            filters.append("and status = '"+status+"' ");
        }
        payLogList = jdbcTemplate.query(sql+filters.toString()+" order by p.create_time desc"+" limit "+(page-1)*pageSize+","+pageSize, new BeanPropertyRowMapper<>(PayLog.class));
        if(payLogList.size()<=0){
            return new PageImpl<PayLog>(new ArrayList<>(), pageRequest, 0);

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

@ -26,6 +26,9 @@
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_endDate" placeholder="请输入查询结束日期" class="f-ml10" data-attr-scan="endDate"/>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_status" placeholder="请输入状态" class="f-ml10" data-attr-scan="status"/>
            </div>
            <sec:authorize url="/admin/paylog/list">
                <div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                    <span>查询</span>

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

@ -40,6 +40,7 @@
                $params: $("#inp_params"),//参数
                $startDate: $("#inp_startDate"),
                $endDate: $("#inp_endDate"),
                $status: $("#inp_status"),
                init: function () {
                    this.$element.show();
                    this.$element.attrScan();
@ -59,6 +60,17 @@
                        labelAlign: 'center',
                        cancelable: true
                    });
                    this.statusBox = this.$status.ligerComboBox({
                        width: 150,
                        data: [
                            {text: '失败', statusId: '0'},
                            {text: '成功', statusId: '1'},
                            {text: '已重试', statusId: '2'}
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    $("#inp_startDate").val(date);
                    this.bindEvents();
                },
@ -144,6 +156,7 @@
                reloadGrid: function (msg) {
                    retrieve.$element.attrScan();
                    var values = retrieve.$element.Fields.getValues();
                    values.status = retrieve.statusBox.getValue();
                    reloadGrid.call(this, values);
                },
            };