Prechádzať zdrojové kódy

pc管理端长处方数据统计添加查看长处方状态的功能

humingfen 7 rokov pred
rodič
commit
30c211be9b

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

@ -1,19 +1,24 @@
package com.yihu.wlyy.controller.manager.datastatic;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.service.prescription.PrescriptionService;
import io.swagger.annotations.ApiOperation;
import com.yihu.wlyy.util.HttpClientUtil;
import io.swagger.annotations.ApiParam;
import jxl.Workbook;
import jxl.write.*;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
/**
@ -24,9 +29,13 @@ import java.util.List;
@Controller
@RequestMapping(value="/admin/static/prescription")
public class PrescriptionStaticController extends BaseController {
	
	@Value("${reservation.zyurl}")
	private String baseUrl;
	@Autowired
	private PrescriptionService prescriptionService;
	@Autowired
	private HttpClientUtil httpClientUtil;
	
	//长处方统计管理*******************************
	@RequestMapping(value = "initial", method = RequestMethod.GET)
@ -170,4 +179,33 @@ public class PrescriptionStaticController extends BaseController {
		}
		ws.addCell(label);
	}
	//获取长处方状态
	@RequestMapping(value = "getDataStatus/{prescription_code}",method = RequestMethod.GET)
	public String DataStatus(@PathVariable(value = "prescription_code") String prescription_code){
		return "prescription/prescription_status";
	}
	@RequestMapping(value = "getDataStatus")
	@ResponseBody
	public String getDataStatus(
			@ApiParam(name = "prescriptionCode", value = "长处方单号")
			@RequestParam(value = "prescriptionCode") String prescriptionCode){
		try {
			String url = baseUrl + "/third/prescription/getDataStatus";
			List<NameValuePair> params = new ArrayList<>();
			params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
			params.add(new BasicNameValuePair("type", "2"));
			String response = httpClientUtil.post(url, params, "UTF-8");
//            String response = "{\"status\":200,\"msg\":\"查询成功!\",\"data\":\"{\\\"CODE\\\":\\\"1\\\",\\\"returnData\\\":[[{\\\"RECIPE_NO\\\":43861978,\\\"RECIPE_STATUS_CODE\\\":5,\\\"RECIPE_STATUS_NAME\\\":\\\"已执行\\\",\\\"CHARGE_STATUS_CODE\\\":5,\\\"CHARGE_STATUS_NAME\\\":\\\"已扣费\\\"}]],\\\"byRefParaData\\\":[]}\"}";
            JSONObject res = JSONObject.parseObject(response);
			//从JSONObject对象里取出key是data的对象
			JSONObject data = res.getJSONObject("data").getJSONArray("returnData").getJSONArray(0).getJSONObject(0);
			return write(200,"success","data",data);
		}catch (Exception e){
			error(e);
			return error(-1,"操作失败!");
		}
	}
}

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/hos/hospital_list_js.jsp

@ -191,7 +191,7 @@
									method: "post",
									dataType: "json",
									success: function (result) {
										debugger
										// debugger
										if (result.status == '200') {
											window.reloadMasterGrid(result.msg);
										} else {

+ 12 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list_js.jsp

@ -225,6 +225,8 @@
                                    var html = '';
                                    html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "prescription:info:view", row.prescription_code) + '">续方详情</a>';
                                    html += '<a  style="margin-left:10px;" href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "prescription:order:view", row.prescription_code) + '">订单跟踪</a>';
                                    html += '<a  style="margin-left:10px;" href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "prescription:status:view", row.prescription_code) + '">长处方状态</a>';
                                    // html += '<a  style="margin-left:10px;" href="' + ctx + '/admin/static/prescription/getDataStatus/' + row.prescription_code +  '" target="centerFrame">长处方状态</a>';
                                    return html;
                                }
                            }
@ -322,6 +324,16 @@
                        })
                    });
                    $.subscribe('prescription:status:view', function (event, code) {
                        var title = '长处方状态';
                        me.prescriptionOrderDialog = $.ligerDialog.open({
                            height: 500,
                            width: 700,
                            title: title,
                            url: ctx + '/admin/static/prescription/getDataStatus/' + code
                        })
                    });
                    //城市下拉
                    me.$inpDeviceName.on( 'change', function () {
                        me.setCityFun(me);

+ 45 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_status.jsp

@ -0,0 +1,45 @@
<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html>
<html lang="en">
<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_status_info_form" data-role-form class="m-form-inline f-mt20 f-ml30" data-role-form style="overflow-y: scroll;height: 450px">
    <input type="hidden" id="prescriptionCode" value='${prescription_code}' data-attr-scan="id"/>
    <div id="div_base_info">
        <div class="m-form-group" style="">
            <label class="label_title" style="width:220px">基卫处方状态码</label>
            <div class="l-text-wrapper m-form-control">
                <input type="text"  id="inp_recipe_status_code" class="f-w240" data-attr-scan="recipe_status_code"/>
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title" style="width:220px">基卫方状态说明</label>
            <div class="l-text-wrapper m-form-control">
                <input type="text"  id="inp_recipe_status_name" class="f-w240" data-attr-scan="recipe_status_name"/>
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title" style="width:220px">基卫处方状态扣费状态码</label>
            <div class="l-text-wrapper m-form-control">
                <input type="text"  id="inp_charge_status_code" class="f-w240" data-attr-scan="charge_status_code"/>
            </div>
        </div>
        <div class="m-form-group" style="">
            <label class="label_title" style="width:220px">基卫处方状态扣费说明</label>
            <div class="l-text-wrapper m-form-control">
                <input type="text"  id="inp_charge_status_name" class="f-w240" data-attr-scan="charge_status_name"/>
            </div>
        </div>
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="prescription_status_js.jsp" %>
</html>

+ 68 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_status_js.jsp

@ -0,0 +1,68 @@
<%@ 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 statusInfo = null;
            var prescriptionCode = $("#prescriptionCode").val();
            /* *************************** 函数定义 ******************************* */
            function pageInit() {
                statusInfo.init();
                statusInfo.initForm();
            }
            /* *************************** 模块初始化 ***************************** */
            statusInfo = {
                //变量
                $form: $("#div_status_info_form"),
                /*$recipe_status_code: $("#inp_recipe_status_code"),
                $recipe_status_name: $("#inp_recipe_status_name"),
                $charge_status_code: $("#inp_charge_status_code"),
                $charge_status_name: $("#inp_charge_status_name"),*/
                init: function () {
                    this.$form.attrScan();
                    $("#inp_recipe_status_code").ligerTextBox({width: 240});
                    $("#inp_recipe_status_name").ligerTextBox({width: 240});
                    $("#inp_charge_status_code").ligerTextBox({width: 240});
                    $("#inp_charge_status_name").ligerTextBox({width: 240});
                    this.$form.show();
                },
                initForm: function () {
                    if (isNoEmpty(prescriptionCode) && prescriptionCode != 0) {
                        $.ajax({
                            url: ctx + "/admin/static/prescription/getDataStatus",
                            method: "post",
                            dataType: "json",
                            async: "false",
                            data: {prescriptionCode: prescriptionCode},
                            success: function (result) {
                                if (result.status == '200') {
                                    var data = result.data;
                                    //填值
                                    statusInfo.$form.Fields.fillValues({
                                        recipe_status_code: data.RECIPE_STATUS_CODE,
                                        recipe_status_name: data.RECIPE_STATUS_NAME,
                                        charge_status_code: data.CHARGE_STATUS_CODE,
                                        charge_status_name: data.CHARGE_STATUS_NAME,
                                    });
                                } else {
                                    $.Notice.error(result.msg);
                                }
                            },
                            error: function (data) {
                                $.Notice.error("系统异常,请联系管理员!");
                            }
                        })
                    }
                },
            }
            /* *************************** 页面初始化 **************************** */
            pageInit();
        })
    })(jQuery, window);
</script>