瀏覽代碼

长处方统计:列表展示

huangwenjie 7 年之前
父節點
當前提交
cd9f4b36a9

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

@ -36,6 +36,7 @@ public class PrescriptionStaticController extends BaseController {
	@RequestMapping(value = "list")
	@ResponseBody
	public String searchPatientList(
			@RequestParam(value = "town",required = false)String town,
			@RequestParam(value = "hospital",required = false)String hospital,
			@RequestParam(value = "disease",required = false)String disease,
			@RequestParam(value = "dispensarytype",required = false)String dispensarytype,
@ -47,7 +48,8 @@ public class PrescriptionStaticController extends BaseController {
	){
		try {
			List<PrescriptionVO> datalist = prescriptionService.getPrescriptionList(hospital,disease,dispensarytype,status,beginDate,endDate,page,pageSize,true);
			return write(200,"操作成功",page,pageSize,datalist);
			Long totalcount = prescriptionService.getPrescriptionListCount(hospital,disease,dispensarytype,status,beginDate,endDate);
			return write(200,"操作成功",page,pageSize,totalcount,datalist);
		}catch (Exception ex){
			error(ex);
			return error(-1, "操作失败!");

+ 83 - 15
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java

@ -83,42 +83,48 @@ public class PrescriptionService extends BaseService {
					"wlyy_patient p2,(" +
				    "SELECT prescription_code," +
						"GROUP_CONCAT(health_problem_name) health_problem_name " +
						"FROM wlyy_prescription_diagnosis GROUP BY prescription_code) d " +
				    "WHERE p1.patient=p2.CODE AND p1.CODE=d.prescription_code) p ";
						"FROM wlyy_prescription_diagnosis ";
		
			//疾病
			if (StringUtils.isNotBlank(disease)) {
				prescriptionsql = prescriptionsql + " where health_problem = '" + disease+"' ";
			}
				prescriptionsql = prescriptionsql +	" GROUP BY prescription_code) d " +
				    "WHERE p1.patient=p2.CODE AND p1.CODE=d.prescription_code ";
						
//					"WHERE p.patient_name NOT IN ('谭仁祝','林美美','曾丽玉','陈新梅','罗金水','陈友财') " +
		//社区
		if (StringUtils.isNotBlank(hospital)) {
			prescriptionsql = prescriptionsql + " p1.hospital = '" + hospital+"' ";
		}
		
		//疾病
		if (StringUtils.isNotBlank(disease)) {
			prescriptionsql = prescriptionsql + " d.health_problem = '" + disease+"' ";
			prescriptionsql = prescriptionsql + " and p1.hospital = '" + hospital+"' ";
		}
		
		//取药方式
		if (StringUtils.isNotBlank(dispensarytype)) {
			prescriptionsql = prescriptionsql + " d.dispensary_type = '" + dispensarytype+"' ";
			prescriptionsql = prescriptionsql + " and p1.dispensary_type = '" + dispensarytype+"' ";
		}
		
		//状态
		if (StringUtils.isNotBlank(status)) {
			prescriptionsql = prescriptionsql + " p1.status = '" + status+"' ";
			prescriptionsql = prescriptionsql + " and p1.status = '" + status+"' ";
		}
		
		//开始时间
		if (StringUtils.isNotBlank(beginDate)) {
			prescriptionsql = prescriptionsql + " p1.create_time <= '" + beginDate+"' ";
		if (StringUtils.isNotBlank(beginDate) && !" 00:00:00".equals(beginDate)) {
			prescriptionsql = prescriptionsql + " and  p1.create_time <= '" + beginDate+"' ";
		}
		
		//结束时间
		if (StringUtils.isNotBlank(endDate)) {
			prescriptionsql = prescriptionsql + " p1.create_time >= '" + endDate+"' ";
		if (StringUtils.isNotBlank(endDate) && !" 23:59:59".equals(endDate)) {
			prescriptionsql = prescriptionsql + " and  p1.create_time >= '" + endDate+"' ";
		}
		
		prescriptionsql = prescriptionsql+ "ORDER BY p.create_time DESC";
		prescriptionsql = prescriptionsql+ ") p ORDER BY p.create_time DESC";
		
		if(ispage){
			if(1 == page){
				page = page-1;
			}
			prescriptionsql = prescriptionsql +" limit " + page+", "+pageSize;
		}
		
@ -126,4 +132,66 @@ public class PrescriptionService extends BaseService {
		
		return list ;
	}
	
	public Long getPrescriptionListCount(String hospital, String disease, String dispensarytype, String status, String beginDate, String endDate) {
		
		String prescriptionsql = "SELECT count(p.code) FROM (" +
				"SELECT " +
				"p1.CODE," +
				"p1.patient_name," +
				"p2.idcard," +
				"p2.mobile," +
				"p1.hospital_name," +
				"p1.create_time," +
				"p1.doctor_name," +
				"d.health_problem_name," +
				"CASE p1.dispensary_type " +
				"WHEN 1 THEN '自取' " +
				"WHEN 2 THEN '快递配送' " +
				"WHEN 3 THEN '健管师配送' " +
				"END pay,p1.STATUS " +
				"FROM wlyy_prescription p1," +
				"wlyy_patient p2,(" +
				"SELECT prescription_code," +
				"GROUP_CONCAT(health_problem_name) health_problem_name " +
				"FROM wlyy_prescription_diagnosis ";
		
		//疾病
		if (StringUtils.isNotBlank(disease)) {
			prescriptionsql = prescriptionsql + " where health_problem = '" + disease+"' ";
		}
		prescriptionsql = prescriptionsql +	" GROUP BY prescription_code) d " +
				"WHERE p1.patient=p2.CODE AND p1.CODE=d.prescription_code";
//					"WHERE p.patient_name NOT IN ('谭仁祝','林美美','曾丽玉','陈新梅','罗金水','陈友财') " +
		//社区
		if (StringUtils.isNotBlank(hospital)) {
			prescriptionsql = prescriptionsql + " and p1.hospital = '" + hospital+"' ";
		}
		
		//取药方式
		if (StringUtils.isNotBlank(dispensarytype)) {
			prescriptionsql = prescriptionsql + " and p1.dispensary_type = '" + dispensarytype+"' ";
		}
		
		//状态
		if (StringUtils.isNotBlank(status)) {
			prescriptionsql = prescriptionsql + " and p1.status = '" + status+"' ";
		}
		
		//开始时间
		if (StringUtils.isNotBlank(beginDate) && !" 00:00:00".equals(beginDate)) {
			prescriptionsql = prescriptionsql + " and p1.create_time <= '" + beginDate+"' ";
		}
		
		//结束时间
		if (StringUtils.isNotBlank(endDate) && !" 23:59:59".equals(endDate)) {
			prescriptionsql = prescriptionsql + " and p1.create_time >= '" + endDate+"' ";
		}
		
		prescriptionsql = prescriptionsql + ") p ";
		
		Long total = jdbcTemplate.queryForObject(prescriptionsql, Long.class);
		
		return total ;
	}
}

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

@ -56,6 +56,9 @@
                $inpCategoryCode: $('#inp_categoryCode'),//区
                $inpHos: $('#inp_hos'),//机构
                $inpTeam: $('#inp_team'),//团队
                $inpDisease:$('#inp_disease'),//病种
                $inpDispensarytype:$('#inp_dispensarytype'),//取药方式
                $inpStatus:$('#inp_status'),//状态
                dnc: null,
                ccc: null,
@ -122,7 +125,7 @@
                            {text: '支付成功/待配药', statusId: '50'},
                            {text: '配药成功/待配送', statusId: '60'},
                            {text: '配送中', statusId: '65'},
                            {text: '配送到患者手中/已完成', statusId: '配送到患者手中/已完成'},
                            {text: '配送到患者手中/已完成', statusId: '100'},
                            {text: '线下退费', statusId: '-4'},
                            {text: '支付超时', statusId: '-3'},
                            {text: '患者自己取消', statusId: '-2'},
@ -134,6 +137,10 @@
                        valueField: 'statusId',
                    });
                    //查询
                    me.$btnSearch.on('click',function () {
                        me.reloadGrid(me);
                    });
                },
                //初始化市区下拉框
@ -181,15 +188,26 @@
                },
                //获取列表
                getList: function (me) {
                    me.$element.attrScan();
                    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.town = me.ccc.getValue();
                    values.hospital = me.hc.getValue();
                    values.teamCode = me.tc.getValue();
                    console.log(values);
                    me.grid = $("#div_prescription_list").ligerGrid($.LigerGridEx.config({
                        url: ctx + me.url.list,
                        parms: {
                            "hospital": "",
                            "disease": "",
                            "dispensarytype": "",
                            "status":"",
                            "beginDate":"",
                            "endDate":"",
                            "town": values.town,
                            "hospital": values.hospital,
                            "disease": values.disease,
                            "dispensarytype": values.dispensarytype,
                            "status":values.status,
                            "beginDate":values.beginDate,
                            "endDate":values.endDate,
                        },
                        ajaxHeader: ajaxHeaderName,
                        ajaxHeaderValue: ajaxHeaderValue,
@ -313,7 +331,6 @@
                    });
                },
                reloadGrid: function (me) {
                    //如果是查询
                    me.$element.attrScan();
                    var values = me.$element.Fields.getValues();
                    values.beginDate = values.beginDate + ' 00:00:00';
@ -322,7 +339,12 @@
                    values.town = me.ccc.getValue();
                    values.hospital = me.hc.getValue();
                    values.teamCode = me.tc.getValue();
                    values.disease = $('#inp_disease_val').val();
                    values.dispensarytype = $('#inp_dispensarytype_val').val();
                    values.status = $('#inp_status_val').val();
                    console.log(values);
                    me.selReloadGrid.call(me, values);
                },
                selReloadGrid: function (params) {