Browse Source

微信统计报表

huangwenjie 7 years ago
parent
commit
77168dbff6

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

@ -1,17 +1,11 @@
package com.yihu.wlyy.controller.manager.datastatic;
package com.yihu.wlyy.controller.manager.datastatic;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.device.entity.WlyyDevice;
import com.yihu.wlyy.entity.SignFamily;
import com.yihu.wlyy.entity.prescription.Prescription;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.service.prescription.PrescriptionService;
import com.yihu.wlyy.service.prescription.PrescriptionService;
import jxl.Workbook;
import jxl.Workbook;
import jxl.write.*;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod;
@ -21,7 +15,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
/**
/**
@ -77,8 +70,6 @@ public class PrescriptionStaticController extends BaseController {
			@RequestParam(value = "endDate",required = false)String endDate,
			@RequestParam(value = "endDate",required = false)String endDate,
			HttpServletResponse response){
			HttpServletResponse response){
		try {
		try {
			ObjectMapper objectMapper = new ObjectMapper();
			JavaType javaType = objectMapper.getTypeFactory().constructParametricType(ArrayList.class, WlyyDevice.class);
			List<PrescriptionVO> datalist = prescriptionService.getPrescriptionList(hospital,disease,dispensarytype,status,beginDate,endDate,0,0,false);
			List<PrescriptionVO> datalist = prescriptionService.getPrescriptionList(hospital,disease,dispensarytype,status,beginDate,endDate,0,0,false);
			response.setContentType("octets/stream");
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "prescriptionDataList.xls"));
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "prescriptionDataList.xls"));

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

@ -1,8 +1,23 @@
package com.yihu.wlyy.controller.manager.datastatic;
package com.yihu.wlyy.controller.manager.datastatic;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.entity.wechat.WechatSignVO;
import com.yihu.wlyy.entity.wechat.WechatTotalVO;
import com.yihu.wlyy.service.wechat.WechatService;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
/**
/**
 * 微信报表导出
 * 微信报表导出
@ -13,9 +28,145 @@ import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = "/admin/static/wechat")
@RequestMapping(value = "/admin/static/wechat")
public class WeChatStaticController extends BaseController {
public class WeChatStaticController extends BaseController {
	
	
	@Autowired
	private WechatService wechatService;
	
	//页面跳转(主页面)
	//页面跳转(主页面)
	@RequestMapping(value = "initial")
	@RequestMapping(value = "initial")
	public String listInit() {
	public String listInit() {
		return "static/static_wechat";
		return "static/static_wechat";
	}
	}
	
	//导出详情报表报表
	@RequestMapping(value="listToExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
	public void exportList(
			@RequestParam(value = "town",required = false)String town,
			@RequestParam(value = "hospital",required = false)String hospital,
			@RequestParam(value = "attention",required = false)String attention,
			HttpServletResponse response){
		try {
			List<WechatSignVO> datalist = wechatService.geSignWechatDataList(hospital,attention);
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "signWechatDataList.xls"));
			OutputStream os = response.getOutputStream();
			this.listWrite(os,datalist);
		}catch (Exception ex){
			error(ex);
		}
	}
	
	//导出详情报表
	@RequestMapping(value="hosipitaTotalToExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
	public void hosipitaTotalData(
			HttpServletResponse response){
		try {
			List<WechatTotalVO> datalist = wechatService.hosipitaTotalData();
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "hosipitaTotalData.xls"));
			OutputStream os = response.getOutputStream();
			this.listWrite(os,datalist);
		}catch (Exception ex){
			error(ex);
		}
	}
	
	//导出社区/行政区报表
	@RequestMapping(value="townTotalToExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
	public void townTotalData(
			HttpServletResponse response){
		try {
			List<WechatTotalVO> datalist = wechatService.townTotalData();
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "townTotalData.xls"));
			OutputStream os = response.getOutputStream();
			this.totalWrite(os,datalist);
		}catch (Exception ex){
			error(ex);
		}
	}
	
	public void totalWrite(OutputStream os, List ls) throws Exception{
		WritableWorkbook wwb = Workbook.createWorkbook(os);
		try {
			WritableSheet ws;
			ws = wwb.createSheet("sheet",1);
			
			String[] header = {"机构/行政区","关注率(关注数/签约数)","关注数","签约数"};
			int k = 0;
			for (String h : header) {
				addCell(ws, 0, k, h);//表名,行,列,header
				k++;
			}
			
			int i = 1;
			for (WechatTotalVO m : (List<WechatTotalVO>) ls) {
				addCell(ws, i, 0, m.getName(),"");
				addCell(ws, i, 1,String.valueOf(m.getAttRate()),"");
				addCell(ws, i, 2, String.valueOf(m.getAttNumber()),"");
				addCell(ws, i, 3, String.valueOf(m.getSignNumber()),"");
				i++;
			}
			wwb.write();
			wwb.close();
		} catch (IOException e) {
			e.printStackTrace();
			if (wwb != null) wwb.close();
			throw e;
		}
	}
	
	
	public void listWrite(OutputStream os, List ls) throws Exception{
		WritableWorkbook wwb = Workbook.createWorkbook(os);
		try {
			WritableSheet ws;
			ws = wwb.createSheet("sheet",1);
			
			String[] header = {"居民openid","居民姓名","手机号码","openid更新时间", "身份证号","全科医生", "健管师", "社区医院", "居委会","住址","街道","openid重复数"};
			int k = 0;
			for (String h : header) {
				addCell(ws, 0, k, h);//表名,行,列,header
				k++;
			}
			
			int i = 1;
			for (WechatSignVO m : (List<WechatSignVO>) ls) {
				addCell(ws, i, 0, m.getOpenid(),"");
				addCell(ws, i, 1, m.getPatientname(),"");
				addCell(ws, i, 2, m.getMobile(),"");
				addCell(ws, i, 3, m.getOpenid_time(),"");
				addCell(ws, i, 4, m.getIdcard(),"");
				addCell(ws, i, 5, m.getDoctor_name(),"");
				addCell(ws, i, 6, m.getDoctor_name(),"");
				addCell(ws, i, 7, m.getDoctor_health_name(),"");
				addCell(ws, i, 8, m.getHospital_name(),"");
				addCell(ws, i, 9, m.getSick_village_name(),"");
				addCell(ws, i, 10, m.getAddress(),"");
				addCell(ws, i, 11, m.getStreet_name(),"");
				addCell(ws, i, 12, m.getTcount(),"");
				i++;
			}
			wwb.write();
			wwb.close();
		} catch (IOException e) {
			e.printStackTrace();
			if (wwb != null) wwb.close();
			throw e;
		}
	}
	//添加单元格内容
	public void addCell(WritableSheet ws, int row, int column,  String data) throws WriteException {
		Label label = new Label(column ,row, data);
		ws.addCell(label);
	}
	//添加单元格内容
	public void addCell(WritableSheet ws, int row, int column, String data, String memo) throws WriteException {
		Label label = new Label(column ,row, data);
		if(!org.springframework.util.StringUtils.isEmpty(memo)){
			WritableCellFeatures cellFeatures = new WritableCellFeatures();
			cellFeatures.setComment(memo);
			label.setCellFeatures(cellFeatures);
		}
		ws.addCell(label);
	}
}
}

+ 126 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/wechat/WechatSignVO.java

@ -0,0 +1,126 @@
package com.yihu.wlyy.entity.wechat;
/**
 * @author huangwenjie
 * @date 2017/12/11 21:18
 */
public class WechatSignVO {
	
	private String openid;
	private String patientcode;
	private String patientname;
	private String mobile;
	private String openid_time;
	private String idcard;
	private String doctor_name;
	private String doctor_health_name;
	private String sick_village_name;
	private String address;
	private String street_name;
	private String hospital_name;
	private String tcount;
	
	public String getOpenid() {
		return openid;
	}
	
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	public String getPatientcode() {
		return patientcode;
	}
	
	public void setPatientcode(String patientcode) {
		this.patientcode = patientcode;
	}
	
	public String getPatientname() {
		return patientname;
	}
	
	public void setPatientname(String patientname) {
		this.patientname = patientname;
	}
	
	public String getMobile() {
		return mobile;
	}
	
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String getOpenid_time() {
		return openid_time;
	}
	
	public void setOpenid_time(String openid_time) {
		this.openid_time = openid_time;
	}
	
	public String getIdcard() {
		return idcard;
	}
	
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	
	public String getDoctor_name() {
		return doctor_name;
	}
	
	public void setDoctor_name(String doctor_name) {
		this.doctor_name = doctor_name;
	}
	
	public String getDoctor_health_name() {
		return doctor_health_name;
	}
	
	public void setDoctor_health_name(String doctor_health_name) {
		this.doctor_health_name = doctor_health_name;
	}
	
	public String getSick_village_name() {
		return sick_village_name;
	}
	
	public void setSick_village_name(String sick_village_name) {
		this.sick_village_name = sick_village_name;
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getStreet_name() {
		return street_name;
	}
	
	public void setStreet_name(String street_name) {
		this.street_name = street_name;
	}
	
	public String getTcount() {
		return tcount;
	}
	
	public void setTcount(String tcount) {
		this.tcount = tcount;
	}
	
	public String getHospital_name() {
		return hospital_name;
	}
	
	public void setHospital_name(String hospital_name) {
		this.hospital_name = hospital_name;
	}
}

+ 45 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/wechat/WechatTotalVO.java

@ -0,0 +1,45 @@
package com.yihu.wlyy.entity.wechat;
/**
 * @author huangwenjie
 * @date 2017/12/11 22:14
 */
public class WechatTotalVO {
	
	private String name;
	private Double attRate;
	private Integer attNumber;
	private Integer signNumber;
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public Double getAttRate() {
		return attRate;
	}
	
	public void setAttRate(Double attRate) {
		this.attRate = attRate;
	}
	
	public Integer getAttNumber() {
		return attNumber;
	}
	
	public void setAttNumber(Integer attNumber) {
		this.attNumber = attNumber;
	}
	
	public Integer getSignNumber() {
		return signNumber;
	}
	
	public void setSignNumber(Integer signNumber) {
		this.signNumber = signNumber;
	}
}

+ 126 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/wechat/WechatService.java

@ -0,0 +1,126 @@
package com.yihu.wlyy.service.wechat;
import com.yihu.wlyy.entity.prescription.PrescriptionVO;
import com.yihu.wlyy.entity.wechat.WechatSignVO;
import com.yihu.wlyy.entity.wechat.WechatTotalVO;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 微信相关业务层方法
 * @author huangwenjie
 * @date 2017/12/11 21:16
 */
@Service
public class WechatService extends BaseService {
	
	@Autowired
	JdbcTemplate jdbcTemplate;
	
	/**
	 * 根据社区和关注状态查找微信关注量详情
	 * @param hospital
	 * @param attention
	 * @return
	 */
	public List<WechatSignVO> geSignWechatDataList(String hospital,String attention) {
		
		List<WechatSignVO> list = new ArrayList<>();
		String sql  = "";
		if("1".equals(attention)){
			sql = "SELECT m.*,n.tcount FROM (" +
					"SELECT t.openid," +
					"t.CODE as patientcode," +
					"t.NAME as patientname," +
					"a.mobile," +
					"t.openid_time," +
					"a.idcard," +
					"a.doctor_name," +
					"a.doctor_health_name," +
					"t.sick_village_name," +
					"t.address," +
					"a.hospital_name,"+
					"t.street_name FROM (" +
					"SELECT b.patient,b.mobile,b.idcard,b.doctor_name,b.doctor_health_name,b.hospital_name FROM wlyy_sign_family b WHERE b.hospital='"+hospital+"' AND b.sign_year=2017 AND b.STATUS=1 AND b.expenses_status=1) a,wlyy_patient t WHERE t.CODE=a.patient) m," +
					"(SELECT t.openid,count(t.openid) tcount FROM wlyy_patient t WHERE t.`code` IN (" +
					"SELECT patient FROM wlyy_sign_family s WHERE s.hospital='"+hospital+"' AND s.sign_year=2017 AND s.expenses_status=1 AND s.STATUS=1) GROUP BY t.openid) n WHERE m.openid=n.openid";
		}else if("0".equals(attention)){
			sql = "SELECT m.*FROM (" +
					"SELECT a.mobile," +
					"a.code as patientcode ," +
					"a.NAME as patientname ," +
					"a.openid_time," +
					"a.idcard," +
					"b.doctor_name," +
					"b.doctor_health_name," +
					"b.hospital_name," +
					"a.address," +
					"a.address," +
					"a.sick_village_name," +
					"a.street_name FROM (" +
					"SELECT t.CODE,t.NAME,t.address,t.sick_village_name,t.street_name,idcard,mobile,openid_time FROM wlyy_patient t WHERE t.`code` IN (" +
					"SELECT patient FROM wlyy_sign_family s WHERE s.hospital='"+hospital+"' AND s.sign_year=2017 AND s.expenses_status=1 AND s.STATUS=1 AND s.expenses_time IS NOT NULL) AND t.openid IS NULL) a,wlyy_sign_family b WHERE b.hospital='"+hospital+"' AND b.sign_year=2017 AND b.STATUS=1 AND b.expenses_status=1 AND a.CODE=b.patient AND b.expenses_time IS NOT NULL) m";
		}
		
		list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WechatSignVO.class));
		return list ;
	}
	
	/**
	 *获取社区关注率
	 *@author huangwenjie
	 *@date 2017/12/11 22:17
	 */
	public List<WechatTotalVO> hosipitaTotalData() {
		List<WechatTotalVO> list = new ArrayList<>();
		String sql  = "SELECT " +
				"a1.hospital_name as name," +
				"(a1.count/a2.count) as attRate," +
				"a1.count as attNumber," +
				"a2.count as signNumber from (" +
				"SELECT sf.hospital hospital,sf.hospital_name hospital_name,count(sf.id) count " +
				"FROM wlyy_patient p,wlyy_sign_family sf WHERE p.idcard=sf.idcard AND sf.type=2 " +
				"AND sf.STATUS> 0 AND LENGTH(sf.hospital)=10 " +
				"AND sf.admin_team_code IS NOT NULL AND p.openid IS NOT NULL " +
				"AND p.openid_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY sf.hospital ORDER BY countdesc) a1," +
				"(SELECT a.hospital hospital,count(a.id) count,a.hospital_name hospital_name " +
				"FROM wlyy_sign_family a WHERE STATUS IN (1,2) AND a.type=2 AND expenses_status=1 " +
				"AND a.expenses_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND a.sign_year='2017' GROUP BY a.hospital ORDER BY countdesc) a2 WHERE a1.hospital=a2.hospital";
	
		list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WechatTotalVO.class));
		return list ;
	}
	
	/**
	 *获取行政区关注率
	 *@author huangwenjie
	 *@date 2017/12/11 22:18
	 */
	public List<WechatTotalVO> townTotalData() {
		List<WechatTotalVO> list = new ArrayList<>();
		String sql  = "SELECT " +
				"a1.town_name," +
				"(a1.count/a2.count)," +
				"a1.count,a2.countfrom (" +
				"SELECT count(sf.id) count,h.town_name town_name,h.town town " +
				"FROM wlyy_patient p,wlyy_sign_family sf,dm_hospital h WHERE p.idcard=sf.idcard " +
				"AND sf.type=2 AND sf.STATUS> 0 AND LENGTH(sf.hospital)=10 AND sf.hospital=h.CODE " +
				"AND sf.admin_team_code IS NOT NULL AND p.openid IS NOT NULL " +
				"AND p.openid_time< '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY h.town ORDER BY countdesc) a1,(" +
				"SELECT count(a.id) count,h.town_name town_name,h.town town FROM wlyy_sign_family a,dm_hospital h" +
				" WHERE STATUS IN (1,2) AND a.type=2 AND expenses_status=1 AND a.hospital=h.CODE " +
				"AND a.expenses_time< '"+ DateUtil.dateToStrShort(new Date())+"' AND a.sign_year='2017' GROUP BY h.town) a2 WHERE a1.town=a2.town";
		
		list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WechatTotalVO.class));
		return list ;
	}
}

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

@ -12,7 +12,7 @@
        <div style="font-family:微软雅黑;font-size:Small;display:block;clear:left;padding:0;margin:0;margin-left: 5px">
        <div style="font-family:微软雅黑;font-size:Small;display:block;clear:left;padding:0;margin:0;margin-left: 5px">
            <div style="position:relative;display:inline;left:10px;top:8px;white-space:nowrap;text-align:center;background-color:#ffffff;font-weight:bold">微信关注量详情</div>
            <div style="position:relative;display:inline;left:10px;top:8px;white-space:nowrap;text-align:center;background-color:#ffffff;font-weight:bold">微信关注量详情</div>
            <div style="height:auto;width:auto;border:#dde7f1 1px solid;">
            <div style="height:auto;width:auto;border:#dde7f1 1px solid;">
                <div class="m-form-group f-mt10">
                <div class="m-form-group f-mt10" id="we_export_div">
                    <div class="m-form-control f-ml15" style="display: none">
                    <div class="m-form-control f-ml15" style="display: none">
                        <input type="text" id="inp_device_name" placeholder="请选择城市" class="f-ml10"/></div>
                        <input type="text" id="inp_device_name" placeholder="请选择城市" class="f-ml10"/></div>
                    <br>
                    <br>

+ 38 - 28
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_wechat_js.jsp

@ -17,6 +17,7 @@
            var inpStarDate = null,inpEndDate = null;
            var inpStarDate = null,inpEndDate = null;
            retrieve = {
            retrieve = {
                $element: $('#we_export_div'),
                url: {
                url: {
                    //接口链接
                    //接口链接
                    /*
                    /*
@ -60,6 +61,19 @@
                        labelAlign: 'center',
                        labelAlign: 'center',
                        cancelable: true
                        cancelable: true
                    });
                    });
                    //状态拉框
                    retrieve.statusBox = $("#inp_att").ligerComboBox({
                        width: 150,
                        data: [
                            {text: '已关注', statusId: '1'},
                            {text: '未关注', statusId: '0'},
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    this.bindEvents();
                    this.bindEvents();
                },
                },
@ -159,33 +173,18 @@
                        me.setJgFun(me);
                        me.setJgFun(me);
                        me.tc.setValue('');
                        me.tc.setValue('');
                    });
                    });
                    //导出
                    //关注量详情导出
                    me.$btnExportList.on('click',function () {
                    me.$btnExportList.on('click',function () {
                        //定义一个form表单
                        //定义一个form表单
                        var myform = $("<form></form>");
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('method','post')
//                        myform.attr('action',ctx + '/admin/static/prescription/toExcel');
                        myform.attr('action',ctx + '/admin/static/wechat/toExcel');
                        me.$element.attrScan();
                        me.$element.attrScan();
                        var values = me.$element.Fields.getValues();
                        var values = me.$element.Fields.getValues();
                        values.beginDate = values.beginDate + ' 00:00:00';
                        values.endDate = values.endDate + ' 23:59:59';
                        values.city = me.dnc.getValue();
                        values.city = me.dnc.getValue();
                        values.town = me.ccc.getValue();
                        values.town = me.ccc.getValue();
                        values.hospital = me.hc.getValue();
                        values.hospital = me.hc.getValue();
                        values.teamCode = me.tc.getValue();
                        //疾病
                        var disease = $("<input type='hidden' name='disease' />")
                        disease.attr('value',$("#inp_disease_val").val());
                        //取药方式
                        var dispensarytype = $("<input type='hidden' name='dispensarytype' />")
                        dispensarytype.attr('value',$("#inp_dispensarytype_val").val());
                        //状态
                        var status = $("<input type='hidden' name='status' />")
                        status.attr('value',$("#inp_status_val").val());
                        //区
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        var town = $("<input type='hidden' name='town' />")
@ -195,21 +194,32 @@
                        var hospital = $("<input type='hidden' name='hospital' />")
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',values.hospital);
                        hospital.attr('value',values.hospital);
                        //开始时间
                        var beginDate = $("<input type='hidden' name='beginDate' />")
                        beginDate.attr('value',values.beginDate);
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
                        attention.attr('value',$("#inp_att_val").val());
                        //结束时间
                        var endDate = $("<input type='hidden' name='endDate' />")
                        endDate.attr('value',values.endDate);
                        myform.append(disease);
                        myform.append(dispensarytype);
                        myform.append(status);
                        myform.append(town);
                        myform.append(town);
                        myform.append(hospital);
                        myform.append(hospital);
                        myform.append(beginDate);
                        myform.append(endDate);
                        myform.append(attention);
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                    //社区微信关注率导出
                    me.$btnExportHosipitalList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/wechat/toExcel');
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                    //行政区微信关注率
                    me.$btnExportTownList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/wechat/toExcel');
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                    });
                },
                },