Jelajahi Sumber

管理端,统计报表,微信报表

huangwenjie 7 tahun lalu
induk
melakukan
5dec0c89dd

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java

@ -37,6 +37,9 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/admin/hos/doctor/toExcel",
                "/admin/device/toExcel",
                "/admin/static/prescription/toExcel",
                "/admin/static/wechat/listToExcel",
                "/admin/static/wechat/hosipitaTotalToExcel",
                "/admin/static/wechat/townTotalToExcel",
                "/admin/basedata/importData",
                "/admin/wlyyUserRole/importData",
                "/WEB—INF/views/**"

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

@ -55,7 +55,7 @@ public class WeChatStaticController extends BaseController {
		}
	}
	
	//导出详情报表
	//导出社区报表
	@RequestMapping(value="hosipitaTotalToExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
	public void hosipitaTotalData(
			HttpServletResponse response){
@ -64,13 +64,13 @@ public class WeChatStaticController extends BaseController {
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "hosipitaTotalData.xls"));
			OutputStream os = response.getOutputStream();
			this.listWrite(os,datalist);
			this.totalWrite(os,datalist);
		}catch (Exception ex){
			error(ex);
		}
	}
	
	//导出社区/行政区报表
	//导出行政区报表
	@RequestMapping(value="townTotalToExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
	public void townTotalData(
			HttpServletResponse response){

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

@ -42,7 +42,7 @@ public class WechatService extends BaseService {
					"t.NAME as patientname," +
					"a.mobile," +
					"t.openid_time," +
					"a.idcard," +
					"CONCAT(LEFT (a.idcard,6),'**********',RIGHT (a.idcard,2)) idcard," +
					"a.doctor_name," +
					"a.doctor_health_name," +
					"t.sick_village_name," +
@ -58,12 +58,11 @@ public class WechatService extends BaseService {
					"a.code as patientcode ," +
					"a.NAME as patientname ," +
					"a.openid_time," +
					"a.idcard," +
					"CONCAT(LEFT (a.idcard,6),'**********',RIGHT (a.idcard,2)) 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 (" +
@ -91,10 +90,10 @@ public class WechatService extends BaseService {
				"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," +
				"AND p.openid_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY sf.hospital ORDER BY count desc) 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";
				"AND a.expenses_time<= '"+ DateUtil.dateToStrShort(new Date())+"' AND a.sign_year='2017' GROUP BY a.hospital ORDER BY count desc) a2 WHERE a1.hospital=a2.hospital";
	
		list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WechatTotalVO.class));
		return list ;
@ -108,14 +107,16 @@ public class WechatService extends BaseService {
	public List<WechatTotalVO> townTotalData() {
		List<WechatTotalVO> list = new ArrayList<>();
		String sql  = "SELECT " +
				"a1.town_name," +
				"(a1.count/a2.count)," +
				"a1.count,a2.countfrom (" +
				"a1.town_name as name," +
				"(a1.count/a2.count) as attRate," +
				"a1.count as attNumber," +
				"a2.count as signNumber " +
				"from (" +
				"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,(" +
				"AND p.openid_time< '"+ DateUtil.dateToStrShort(new Date())+"' AND sf.sign_year='2017' GROUP BY h.town ORDER BY count desc) 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";

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

@ -17,7 +17,6 @@
            var inpStarDate = null,inpEndDate = null;
            retrieve = {
                $element: $('#we_export_div'),
                url: {
                    //接口链接
                    /*
@ -170,7 +169,6 @@
                    });
                    //机构
                    me.$inpHos.on( 'change', function () {
                        me.setJgFun(me);
                        me.tc.setValue('');
                    });
                    //关注量详情导出
@ -178,21 +176,15 @@
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/wechat/toExcel');
                        me.$element.attrScan();
                        var values = me.$element.Fields.getValues();
                        values.city = me.dnc.getValue();
                        values.town = me.ccc.getValue();
                        values.hospital = me.hc.getValue();
                        myform.attr('action',ctx + '/admin/static/wechat/listToExcel');
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        town.attr('value',values.town);
                        town.attr('value',$("#inp_categoryCode").val());
                        //社区医院
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',values.hospital);
                        hospital.attr('value',$("#inp_hos_val").val());
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
@ -210,7 +202,7 @@
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/wechat/toExcel');
                        myform.attr('action',ctx + '/admin/static/wechat/hosipitaTotalToExcel');
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
@ -219,7 +211,7 @@
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/wechat/toExcel');
                        myform.attr('action',ctx + '/admin/static/wechat/townTotalToExcel');
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                },