Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

liuwenbin 7 years ago
parent
commit
a62d303619
42 changed files with 2187 additions and 416 deletions
  1. 22 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientReservation.java
  2. 6 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java
  3. 65 6
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/BookingController.java
  4. 21 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/DeviceStaticController.java
  5. 0 9
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/PrescriptionStaticController.java
  6. 172 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/WeChatStaticController.java
  7. 80 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java
  8. 0 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyDeviceController.java
  9. 81 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyPatientDeviceController.java
  10. 98 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/DeviceHealthIndexVO.java
  11. 98 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/PatientDeviceVO.java
  12. 21 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/PatientReservation.java
  13. 126 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/wechat/WechatSignVO.java
  14. 45 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/wechat/WechatTotalVO.java
  15. 14 5
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/GuahaoXMService.java
  16. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/IGuahaoService.java
  17. 16 3
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/JwSmjkService.java
  18. 23 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java
  19. 32 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java
  20. 2 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/user/UserService.java
  21. 126 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/wechat/WechatService.java
  22. 3 3
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp
  23. 6 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list.jsp
  24. 6 17
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list_js.jsp
  25. 43 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_device.jsp
  26. 209 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_device_js.jsp
  27. 68 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_wechat.jsp
  28. 249 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/static/static_wechat_js.jsp
  29. 2 0
      patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js
  30. 32 2
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/HospitalMapping.java
  31. 184 58
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/WlyyCharge.java
  32. 26 1
      patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java
  33. 116 116
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java
  34. 90 90
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/StartListener.java
  35. 70 70
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/ActiveMQConfig.java
  36. 8 6
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java
  37. 9 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanDao.java
  38. 3 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticlePatientService.java
  39. 7 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  40. 4 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/RemindFocusWechatTask.java
  41. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java
  42. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdMessageController.java

+ 22 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/PatientReservation.java

@ -79,8 +79,13 @@ public class PatientReservation extends IdEntity {
	private Integer signType;
	// 行政团队
	private Long adminTeamCode;
	//关联电话记录Code
	//关联电话记录Code(通过客服系统预约才有值)
	private String callCode;
	//客服系统客服code(通过客服系统预约才有值)
	private String userCode;
	//客服系统客服name(通过客服系统预约才有值)
	private String userName;
	public String getCode() {
		return code;
@ -329,4 +334,20 @@ public class PatientReservation extends IdEntity {
	public void setCallCode(String callCode) {
		this.callCode = callCode;
	}
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
}

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

@ -30,13 +30,19 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/login/**",
                "/yueren/**",
                "/customer/**",
                "/third/**",
                "/admin/hos/doctor/importFromExcel",
                "/admin/hos/doctor/importData",
                "/admin/team/importData",
                "/admin/hos/importData",
                "/admin/hos/doctor/toExcel",
                "/admin/device/toExcel",
                "/admin/patientDevice/toExcel",
                "/admin/healthIndex/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/**"

File diff suppressed because it is too large
+ 65 - 6
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/BookingController.java


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

@ -0,0 +1,21 @@
package com.yihu.wlyy.controller.manager.datastatic;
import com.yihu.wlyy.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
 * 设备统计报表导出
 * @author huangwenjie
 * @date 2017/12/12 10:26
 */
@Controller
@RequestMapping(value = "/admin/static/device/")
public class DeviceStaticController extends BaseController {
	
	//页面跳转(主页面)
	@RequestMapping(value = "initial")
	public String listInit() {
		return "static/static_device";
	}
}

+ 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;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
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.service.prescription.PrescriptionService;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -21,7 +15,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
/**
@ -77,8 +70,6 @@ public class PrescriptionStaticController extends BaseController {
			@RequestParam(value = "endDate",required = false)String endDate,
			HttpServletResponse response){
		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);
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "prescriptionDataList.xls"));

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

@ -0,0 +1,172 @@
package com.yihu.wlyy.controller.manager.datastatic;
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.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;
/**
 * 微信报表导出
 * @author huangwenjie
 * @date 2017/12/11 08:58
 */
@Controller
@RequestMapping(value = "/admin/static/wechat")
public class WeChatStaticController extends BaseController {
	
	@Autowired
	private WechatService wechatService;
	
	//页面跳转(主页面)
	@RequestMapping(value = "initial")
	public String listInit() {
		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.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){
		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);
	}
}

+ 80 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java

@ -2,7 +2,11 @@ package com.yihu.wlyy.controller.manager.device;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.device.entity.DeviceHealthIndex;
import com.yihu.wlyy.device.entity.DeviceHealthIndexVO;
import com.yihu.wlyy.device.entity.PatientDeviceVO;
import com.yihu.wlyy.service.manager.device.DeviceHealthIndexService;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
@ -11,6 +15,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/**
 * Created by Administrator on 2016/12/5.
 */
@ -40,6 +49,77 @@ public class DeviceHealthIndexController extends BaseController{
            return error(-1,"操作失败!");
        }
    }
    
    //导出报表
    @RequestMapping(value="toExcel",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,
            HttpServletResponse response){
        try {
            List<DeviceHealthIndexVO> wlyyDevices = healthIndexService.exportDeviceHealthIndexList(town,hospital);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "deviceHealthIndexDataList.xls"));
            OutputStream os = response.getOutputStream();
            this.write(os,wlyyDevices);
        }catch (Exception ex){
            error(ex);
        }
    }
    
    
    public void addHeader(WritableSheet ws) throws WriteException {
        
        String[] header = {"居民姓名","手机号","身份证","设备码","设备名称","签约医生", "地址"};
        int i = 0;
        for (String h : header) {
            addCell(ws, 0, i, h);//表名,行,列,header
            i++;
        }
    }
    
    public void write(WritableWorkbook wwb, List ls) throws Exception {
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet",1);
            addHeader(ws);
            int i = 1;
            for (DeviceHealthIndexVO m : (List<DeviceHealthIndexVO>) ls) {
                addCell(ws, i, 0, m.getName(),"");
                addCell(ws, i, 1, m.getMobile(),"");
                addCell(ws, i, 2, m.getIdcard(),"");
                addCell(ws, i, 3, m.getDevice_sn(),"");
                addCell(ws, i, 4, m.getDevice_name(),"");
                addCell(ws, i, 5, m.getDoctor_name(),"");
                addCell(ws, i, 6, m.getAddress(),"");
                i++;
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    public void write(OutputStream os, List ls) throws Exception{
        write(Workbook.createWorkbook(os), ls);
    }
    //添加单元格内容
    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);
    }

+ 0 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyDeviceController.java

@ -151,8 +151,6 @@ public class WlyyDeviceController extends BaseController {
            @RequestParam(value = "linkman",required = false) String linkman,
            HttpServletResponse response){
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            JavaType javaType = objectMapper.getTypeFactory().constructParametricType(ArrayList.class, WlyyDevice.class);
            List<WlyyDevice> wlyyDevices = deviceService.exporthDeviceList(deviceName,deviceCode,orgName,linkman);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "deviceDataList.xls"));

+ 81 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyPatientDeviceController.java

@ -1,8 +1,11 @@
package com.yihu.wlyy.controller.manager.device;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.device.entity.PatientDeviceVO;
import com.yihu.wlyy.entity.WlyyPatientDevice;
import com.yihu.wlyy.service.manager.device.WlyyPatientDeviceService;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
@ -11,6 +14,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
/**
 * Created by yww on 2016/12/7.
 */
@ -60,4 +68,77 @@ public class WlyyPatientDeviceController extends BaseController {
        }
    }
    
    //导出报表
    @RequestMapping(value="toExcel",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,
            HttpServletResponse response){
        try {
            List<PatientDeviceVO> wlyyDevices = patientDeviceService.exportPatientDeviceList(town,hospital);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "patientDeviceDataList.xls"));
            OutputStream os = response.getOutputStream();
            this.write(os,wlyyDevices);
        }catch (Exception ex){
            error(ex);
        }
    }
    
    
    public void addHeader(WritableSheet ws) throws WriteException {
        
        String[] header = {"居民姓名","手机号","身份证","设备码", "设备类型","签约医生", "居民住址", "openid", "是否绑定微信号"};
        int i = 0;
        for (String h : header) {
            addCell(ws, 0, i, h);//表名,行,列,header
            i++;
        }
    }
    
    public void write(WritableWorkbook wwb, List ls) throws Exception {
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet",1);
            addHeader(ws);
            int i = 1;
            for (PatientDeviceVO m : (List<PatientDeviceVO>) ls) {
                addCell(ws, i, 0, m.getName(),"");
                addCell(ws, i, 1, m.getMobile(),"");
                addCell(ws, i, 2, m.getIdcard(),"");
                addCell(ws, i, 3, m.getDevice_sn(),"");
                addCell(ws, i, 4, m.getDevice_name(),"");
                addCell(ws, i, 5, m.getDoctor_name(),"");
                addCell(ws, i, 6, m.getAddress(),"");
                addCell(ws, i, 7, m.getOpenid(),"");
                addCell(ws, i, 8, m.getIsopenid(),"");
                i++;
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    public void write(OutputStream os, List ls) throws Exception{
        write(Workbook.createWorkbook(os), ls);
    }
    //添加单元格内容
    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);
    }
}

+ 98 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/DeviceHealthIndexVO.java

@ -0,0 +1,98 @@
package com.yihu.wlyy.device.entity;
/**
 * @author huangwenjie
 * @date 2017/12/12 10:10
 */
public class DeviceHealthIndexVO {
	private String patient;
	private String name;
	private String mobile;
	private String idcard;
	private String device_sn;
	private String device_name;
	private String record_date;
	private String statusName;
	private String doctor_name;
	private String address;
	
	public String getPatient() {
		return patient;
	}
	
	public void setPatient(String patient) {
		this.patient = patient;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getMobile() {
		return mobile;
	}
	
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String getIdcard() {
		return idcard;
	}
	
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	
	public String getDevice_sn() {
		return device_sn;
	}
	
	public void setDevice_sn(String device_sn) {
		this.device_sn = device_sn;
	}
	
	public String getRecord_date() {
		return record_date;
	}
	
	public void setRecord_date(String record_date) {
		this.record_date = record_date;
	}
	
	public String getStatusName() {
		return statusName;
	}
	
	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}
	
	public String getDoctor_name() {
		return doctor_name;
	}
	
	public void setDoctor_name(String doctor_name) {
		this.doctor_name = doctor_name;
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getDevice_name() {
		return device_name;
	}
	
	public void setDevice_name(String device_name) {
		this.device_name = device_name;
	}
}

+ 98 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/PatientDeviceVO.java

@ -0,0 +1,98 @@
package com.yihu.wlyy.device.entity;
/**
 * @author huangwenjie
 * @date 2017/12/12 09:47
 */
public class PatientDeviceVO {
	private String patient;
	private String name;
	private String mobile;
	private String idcard;
	private String device_sn;
	private String device_name;
	private String address;
	private String openid;
	private String isopenid;
	private String doctor_name;
	
	public String getPatient() {
		return patient;
	}
	
	public void setPatient(String patient) {
		this.patient = patient;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getMobile() {
		return mobile;
	}
	
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String getIdcard() {
		return idcard;
	}
	
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	
	public String getDevice_sn() {
		return device_sn;
	}
	
	public void setDevice_sn(String device_sn) {
		this.device_sn = device_sn;
	}
	
	public String getDevice_name() {
		return device_name;
	}
	
	public void setDevice_name(String device_name) {
		this.device_name = device_name;
	}
	
	public String getAddress() {
		return address;
	}
	
	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getOpenid() {
		return openid;
	}
	
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	public String getIsopenid() {
		return isopenid;
	}
	
	public void setIsopenid(String isopenid) {
		this.isopenid = isopenid;
	}
	
	public String getDoctor_name() {
		return doctor_name;
	}
	
	public void setDoctor_name(String doctor_name) {
		this.doctor_name = doctor_name;
	}
}

+ 21 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/PatientReservation.java

@ -79,8 +79,12 @@ public class PatientReservation extends IdEntity {
	// 行政团队
	private Long adminTeamCode;
	//关联电话记录Code
	//关联电话记录Code(通过客服系统预约才有值)
	private String callCode;
	//客服系统客服code(通过客服系统预约才有值)
	private String userCode;
	//客服系统客服name(通过客服系统预约才有值)
	private String userName;
	public String getCode() {
		return code;
@ -329,4 +333,20 @@ public class PatientReservation extends IdEntity {
	public void setCallCode(String callCode) {
		this.callCode = callCode;
	}
	public String getUserCode() {
		return userCode;
	}
	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
}

+ 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;
	}
}

+ 14 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/GuahaoXMService.java

@ -5,8 +5,10 @@ import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.entity.PatientReservation;
import com.yihu.wlyy.entity.SignFamily;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.repository.PatientReservationDao;
import com.yihu.wlyy.repository.SignFamilyDao;
import com.yihu.wlyy.repository.UserDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.service.common.ConsultService;
import com.yihu.wlyy.service.common.PatientService;
@ -63,12 +65,15 @@ public class GuahaoXMService implements IGuahaoService {
    @Autowired
    private ConsultService consultService;
    @Autowired
    private UserDao userDao;
    private ObjectMapper objectMapper = new ObjectMapper();
    /**
     * 解析挂号后
     */
    private String CreateOrderAfter(String response, String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String sectionType, String startTime, String endTime, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode,String callCode) throws Exception {
    private String CreateOrderAfter(String userCode,String response, String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String sectionType, String startTime, String endTime, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode,String callCode) throws Exception {
        String code = "";
        if (response.startsWith("error") || response.startsWith("System-Error")) {
            throw new Exception(response);
@ -102,6 +107,10 @@ public class GuahaoXMService implements IGuahaoService {
        reservation.setDoctorName(doctorName);
        //关联通话记录
        reservation.setCallCode(callCode);
        reservation.setUserCode(userCode);
        User u  = userDao.findByCode(userCode);
        reservation.setUserName(u.getName());
        if(doctor!=null){
            reservation.setDoctorJob(doctor.getTitle());
            reservation.setDoctorPhoto(doctor.getPhoto());
@ -595,7 +604,7 @@ public class GuahaoXMService implements IGuahaoService {
    /**
     * 创建挂号单
     */
    public String CreateOrder(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone,String callCode) throws Exception {
    public String CreateOrder(String userCode,String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone,String callCode) throws Exception {
        String re = "";
        Patient p = patientService.findByCode(patient);
@ -656,7 +665,7 @@ public class GuahaoXMService implements IGuahaoService {
            verificationXml(response,"获取医生排班表失败!",ORDER_CREATE,content,method,msgBody,res);
            //保存http日志
            logService.saveHttpLog(true,ORDER_CREATE,content,method,null,msgBody,res,null,logService.archiveType);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, null, null,callCode);
            re = CreateOrderAfter(userCode,response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, null, null,callCode);
        } else {
            throw new Exception("该排班信息错误或者不存在!");
        }
@ -1164,7 +1173,7 @@ public class GuahaoXMService implements IGuahaoService {
    /**
     * 转诊预约挂号
     */
    public String CreateOrderByDoctor(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode,String callCode) throws Exception {
    public String CreateOrderByDoctor(String userCode,String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone, String dname, String dcode,String callCode) throws Exception {
        String re = "";
        Patient p = patientService.findByCode(patient);
@ -1180,7 +1189,7 @@ public class GuahaoXMService implements IGuahaoService {
            String response = jwSmjkService.webRegisterByFamily(cardNo, patientName, clinicCard, sectionType, startTime, hospitalId, hosDeptId, hosDeptName, doctorId, doctorName,patientPhone);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode,callCode);
            re = CreateOrderAfter(userCode,response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode,callCode);
        } else {
            throw new Exception("该排班信息错误或者不存在!");
        }

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/IGuahaoService.java

@ -36,7 +36,7 @@ public interface IGuahaoService {
	/**
	 * 创建挂号单
	 */
	public String CreateOrder(String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone,String callCode) throws Exception;
	public String CreateOrder(String userCode,String hospitalId, String hospitalName, String hosDeptId, String hosDeptName, String doctorId, String doctorName, String arrangeDate, String patient, String patientName, String cardNo, String clinicCard, String patientPhone,String callCode) throws Exception;
	/**
	 * 获取医生信息

+ 16 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/jw/JwSmjkService.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.service.jw;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
@ -7,7 +9,9 @@ import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.annotation.AccessType;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -24,6 +28,8 @@ public class JwSmjkService {
    //基卫服务地址
    @Value("${sign.check_upload}")
    private String jwUrl;
    @Autowired
    private PatientDao patientDao;
//    private ObjectMapper objectMapper = new ObjectMapper();
@ -362,14 +368,21 @@ public class JwSmjkService {
    /**
     * 根据患者医保卡获取近三个月的预约记录
     * @param patient
     * @param keyword
     * @return
     * @throws Exception
     */
    public String GetRegList(String patient) throws Exception{
    public String GetRegList(String keyword) throws Exception{
        Patient p = patientDao.findByIdcard(keyword);
        if(p==null){
            p = patientDao.findBySsc(keyword);
        }
        if(p==null){
            return null;
        }
        String url = jwUrl + "/third/guahao/GetRegList";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("patient", patient));
        params.add(new BasicNameValuePair("patient", p.getCode()));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        return response;

+ 23 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java

@ -1,6 +1,8 @@
package com.yihu.wlyy.service.manager.device;
import com.yihu.wlyy.device.entity.DeviceHealthIndex;
import com.yihu.wlyy.device.entity.DeviceHealthIndexVO;
import com.yihu.wlyy.device.entity.PatientDeviceVO;
import com.yihu.wlyy.device.repository.DeviceHealthIndexDao;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.repository.PatientDao;
@ -12,6 +14,8 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.*;
@ -25,6 +29,8 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
    private DeviceHealthIndexDao healthIndexDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
@ -83,5 +89,21 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        }
       return patientDao.findByCode(patientCode);
    }
	
	public List<DeviceHealthIndexVO> exportDeviceHealthIndexList(String town, String hospital) {
        List<DeviceHealthIndexVO> list = new ArrayList<>();
        String sql  = "SELECT " +
                "s.patient," +
                "s.`name`," +
                "s.mobile," +
                "CONCAT(LEFT (s.idcard,6),'**********',RIGHT (s.idcard,2)) idcard," +
                "d.device_sn," +
                "d.device_name," +
                "s.doctor_name," +
                "p.address FROM wlyy_sign_family s,wlyy_patient_device d,wlyy_patient p WHERE s.patient=d.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0 AND s.patient=p.CODE AND s.patient NOT IN (" +
                "SELECT s.patient FROM wlyy_sign_family s,(" +
                "SELECT `user`,device_sn,type,max(record_date) record_date FROM device.wlyy_patient_health_index WHERE device_sn IS NOT NULL AND del=1 GROUP BY `user`,device_sn,type) d WHERE s.patient=d.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0) ORDER BY patient";
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexVO.class));
        return list ;
	}
}

+ 32 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java

@ -1,18 +1,24 @@
package com.yihu.wlyy.service.manager.device;
import com.yihu.wlyy.device.entity.PatientDeviceVO;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.entity.WlyyPatientDevice;
import com.yihu.wlyy.entity.wechat.WechatTotalVO;
import com.yihu.wlyy.repository.PatientDao;
import com.yihu.wlyy.repository.WlyyPatientDeviceDao;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
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;
/**
@ -23,6 +29,8 @@ import java.util.List;
public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,WlyyPatientDeviceDao>  {
    @Autowired
    private PatientDao patientDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    public Page<WlyyPatientDevice> searchList(String deviceName,String categoryCode,String deviceSn,String userName,Integer page,Integer pageSize) throws Exception{
@ -70,4 +78,28 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
        }
        return patientDao.findByCode(patientCode);
    }
    
    /**
     * 根据社区查找居民设备绑定详情
     * @param town
     * @param hospital
     * @return
     */
	public List<PatientDeviceVO> exportPatientDeviceList(String town, String hospital) {
        List<PatientDeviceVO> list = new ArrayList<>();
        String sql  = "SELECT s.patient," +
                "s.`name`," +
                "s.mobile," +
                "CONCAT(LEFT (s.idcard,6),'**********',RIGHT (s.idcard,2)) idcard," +
                "d.device_sn," +
                "d.device_name," +
                "s.doctor_name," +
                "p.address," +
                "p.openid," +
                "CASE WHEN p.openid IS NULL THEN '未绑定' ELSE '已绑定' END isopenid " +
                "FROM wlyy_sign_family s,wlyy_patient_device d,wlyy_patient p " +
                "WHERE s.patient=d.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0 AND s.patient=p.CODE ORDER BY patient";
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientDeviceVO.class));
        return list ;
	}
}

+ 2 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/user/UserService.java

@ -196,7 +196,8 @@ public class UserService extends BaseJpaService<User,UserDao> {
            String[] codes = code.split(",");
            List<ManageDictEntry> manageDictEntries = manageDictEntryDao.findByDictIdAndCodes(dictId, codes);
            if (null != manageDictEntries && manageDictEntries.size() > 0) {
                return "http://localhost:8180/admin/main";
                return manageDictEntries.get(0).getValue();
//                return "http://localhost:8180/admin/main";
            }
        }
        return null;

+ 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.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," +
					"CONCAT(LEFT (a.idcard,6),'**********',RIGHT (a.idcard,2)) 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," +
					"CONCAT(LEFT (a.idcard,6),'**********',RIGHT (a.idcard,2)) idcard," +
					"b.doctor_name," +
					"b.doctor_health_name," +
					"b.hospital_name," +
					"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 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 count desc) 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 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 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";
		
		list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WechatTotalVO.class));
		return list ;
	}
}

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

@ -132,9 +132,9 @@
							<sec:authorize url="/admin/static/wechat/initial">
								<li><a href="javascript:locationMenu('staticWechat');">微信统计报表</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/static/sign/initial">
								<li><a href="javascript:locationMenu('staticSign');">签约统计报表</a></li>
							</sec:authorize>
							<%--<sec:authorize url="/admin/static/sign/initial">--%>
								<%--<li><a href="javascript:locationMenu('staticSign');">签约统计报表</a></li>--%>
							<%--</sec:authorize>--%>
							<sec:authorize url="/admin/static/device/initial">
								<li><a href="javascript:locationMenu('staticDevice');">设备统计报表</a></li>
							</sec:authorize>

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

@ -53,6 +53,12 @@
                </div>
            </div>
        </div>
        <div class="m-form-group f-mt10">
            <div class="m-form-group f-mt10">
            </div>
        </div>
    </div>
    <!-- 列表 -->
    <div id="div_prescription_list">

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

@ -138,10 +138,6 @@
                        valueField: 'statusId',
                    });
                    //查询
                    me.$btnSearch.on('click',function () {
                        me.reloadGrid(me);
                    });
                },
                //初始化市区下拉框
@ -224,19 +220,12 @@
                            {display: '配送方式', name: 'pay', align: "center"},
                            {display: '时间', name: 'create_time', width: '12%', align: "center"},
                            {
                                display: '操作', name: 'operator', width: '10%', align: "center", isSort: false,
                                <%--render: function (row) {--%>
                                <%--var html = '';--%>
                                <%--html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "sign:info:view", row.id) + '">明细</a>';--%>
                                <%--//html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "patient:info:edit", row.id) + '">编辑</a>';--%>
                                <%--//html += '<a  style="margin-left:10px;" title="删除" href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}','{2}'])", "patient:info:del", row.id,row.code) + '">删除</a>';--%>
                                <%--if (row.adminTeamId) {--%>
                                <%--<sec:authorize url="/admin/sign/memberList">--%>
                                <%--html += '<a style="margin-left:10px;" href="' + ctx + '/admin/team/signTeamInfo/' + row.adminTeamId + '" target="centerFrame">行政团队</a>';--%>
                                <%--</sec:authorize>--%>
                                <%--}--%>
                                <%--return html;--%>
                                <%--}--%>
                                display: '操作', name: 'operator', width: '15%', align: "center", isSort: false,
                                render: function (row) {
                                    var html = '';
                                    html += '<a  href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "patient:info:view", row.id) + '">查看</a>';
                                    return html;
                                }
                            }
                        ],
                    }));

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

@ -0,0 +1,43 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>机构管理</title>
</head>
<body>
<div >
    <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="height:auto;width:auto;border:#dde7f1 1px solid;">
            <div class="m-form-group f-mt10" id="we_export_div">
                <div class="m-form-control f-ml15" style="display: none">
                    <input type="text" id="inp_device_name" placeholder="请选择城市" class="f-ml10"/></div>
                <br>
            </div>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_categoryCode" placeholder="请选择市区" class="f-ml10"/>
            </div>
            <br>
            <div class="m-form-control f-ml15">
                <input type="text" id="inp_hos" placeholder="请选择机构" class="f-ml10"/>
            </div>
            <br>
            <div id="export_patient_device_list" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                <span>导出居民设备绑定明细</span>
                <br>
            </div>
            <div id="export_patient_healthindex_list" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                <span>导出居民设备体征上传明细</span>
                <br>
            </div>
            <br>
        </div>
    </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="static_device_js.jsp" %>
</html>

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

@ -0,0 +1,209 @@
<%--
  Created by IntelliJ IDEA.
  User: Mewtwo
  Date: 2017/12/8
  Time: 11:29
  To change this template use File | Settings | File Templates.
--%>
<%@ 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 retrieve = null;
            var inpStarDate = null,inpEndDate = null;
            retrieve = {
                url: {
                    //接口链接
                    /*
                    * 省,市,区
                    * */
                    district: '/common/district',
                    /*
                    *获取医院列表
                    * */
                    hospitalsByType: '/admin/hos/hospitalsByType',
                },
                $inpDeviceName: $('#inp_device_name'),//城市
                $inpCategoryCode: $('#inp_categoryCode'),//区
                $inpHos: $('#inp_hos'),//机构
                dnc: null,
                ccc: null,
                hc: null,
                $btnDeviceList: $('#export_patient_device_list'),
                $btnHealthindexList: $('#export_patient_healthindex_list'),
                init: function () {
                    this.initComboBox();
                    this.bindEvents();
                },
                //初始化市区下拉框
                initComboBox: function () {
                    this.dnc = this.$inpDeviceName.ligerComboBox({
                        width: 150,
                        data: [
                            {text: '厦门市', statusId: '350200'}
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    this.dnc.selectValue('350200');//默认选中厦门市
                    this.setCityFun(this);
                    this.initInpCat( [], this);
                    this.initHc( [], this);
                },
                //区
                initInpCat: function ( d, me) {
                    me.ccc = me.$inpCategoryCode.ligerComboBox({
                        width: 250,
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
                //机构
                initHc: function ( d, me) {
                    me.hc = me.$inpHos.ligerComboBox({
                        width: 250,
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
                setCityFun: function (me) {
                    var v = me.dnc.getValue();
                    if (v != '') {
                        me.rAjax( me.url.district, {
                            type: 3,
                            code: v
                        }, function (data) {
                            var d = [];
                            for (var i = 0; i < data.list.length; i++) {
                                d.push({
                                    text: data.list[i].name,
                                    statusId: data.list[i].code
                                });
                            }
                            //区
                            me.initInpCat( d, me);
                        })
                    } else {
                        me.initInpCat( [], me);
                        me.initHc( [], me);
                    }
                },
                setAreaFun: function (me) {
                    var v = me.ccc.getValue();
                    if (v != '') {
                        me.rAjax( me.url.hospitalsByType, {
                            type: 2,
                            code: v
                        }, function (data) {
                            var d = [];
                            for (var i = 0; i < data.list.length; i++) {
                                d.push({
                                    text: data.list[i].name,
                                    statusId: data.list[i].code
                                });
                            }
                            //机构
                            me.initHc( d, me);
                        })
                    } else {
                        me.initHc( [], me);
                    }
                },
                bindEvents: function () {
                    var me = this;
                    //城市下拉
                    me.$inpDeviceName.on( 'change', function () {
                        me.setCityFun(me);
                    });
                    //区下拉
                    me.$inpCategoryCode.on( 'change', function () {
                        me.setAreaFun(me);
                        me.hc.setValue('');
                    });
                    //机构
                    me.$inpHos.on( 'change', function () {
                    });
                    //居民设备绑定详情导出
                    me.$btnDeviceList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/patientDevice/toExcel');
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        town.attr('value',$("#inp_categoryCode").val());
                        //社区医院
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',$("#inp_hos_val").val());
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
                        attention.attr('value',$("#inp_att_val").val());
                        myform.append(town);
                        myform.append(hospital);
                        myform.append(attention);
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                    //居民提振数据详情导出
                    me.$btnHealthindexList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/healthIndex/toExcel');
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        town.attr('value',$("#inp_categoryCode").val());
                        //社区医院
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',$("#inp_hos_val").val());
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
                        attention.attr('value',$("#inp_att_val").val());
                        myform.append(town);
                        myform.append(hospital);
                        myform.append(attention);
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                },
                rAjax: function ( url, d, cb) {
                    $.ajax({
                        url: ctx + url,
                        data: d,
                        type: 'POST',
                        dataType: 'json',
                        success: function (data) {
                            if (data.status == 200) {
                                cb && cb.call( this, data);
                            } else {
                                $.Notice.error(data.msg);
                            }
                        }
                    });
                }
            };
            retrieve.init();
        });
    })( jQuery, window);
</script>

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

@ -0,0 +1,68 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <%@ include file="../head/page_head.jsp"%>
    <title>机构管理</title>
</head>
<body>
<div >
        <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="height:auto;width:auto;border:#dde7f1 1px solid;">
                <div class="m-form-group f-mt10" id="we_export_div">
                    <div class="m-form-control f-ml15" style="display: none">
                        <input type="text" id="inp_device_name" placeholder="请选择城市" class="f-ml10"/></div>
                    <br>
                    </div>
                    <div class="m-form-control f-ml15">
                    <input type="text" id="inp_categoryCode" placeholder="请选择市区" class="f-ml10"/>
                    </div>
                    <br>
                    <div class="m-form-control f-ml15">
                    <input type="text" id="inp_hos" placeholder="请选择机构" class="f-ml10"/>
                    </div>
                    <br>
                    <div class="m-form-control f-ml15">
                    <input type="text" id="inp_att" placeholder="请选择关注状态" class="f-ml10"/>
                    </div>
                    <br>
                    <div id="export_list" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                        <span>导出</span>
                        <br>
                    </div>
                    <br>
                </div>
            </div>
        </div>
        <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="height:auto;width:auto;border:#dde7f1 1px solid;">
                <div class="m-form-group f-mt10">
                    <br>
                    <div id="export_hosipital_total" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                        <span>导出</span><br>
                    </div>
                </div>
            </div>
        </div>
        <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="height:auto;width:auto;border:#dde7f1 1px solid;">
                <div class="m-form-group f-mt10">
                    <br>
                    <div id="export_town_total" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
                        <span>导出</span><br>
                    </div>
                </div>
            </div>
        </div>
</div>
</body>
<%@ include file="../head/page_foot.jsp"%>
<%@ include file="static_wechat_js.jsp" %>
</html>

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

@ -0,0 +1,249 @@
<%--
  Created by IntelliJ IDEA.
  User: Mewtwo
  Date: 2017/12/8
  Time: 11:29
  To change this template use File | Settings | File Templates.
--%>
<%@ 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 retrieve = null;
            var inpStarDate = null,inpEndDate = null;
            retrieve = {
                url: {
                    //接口链接
                    /*
                    * 省,市,区
                    * */
                    district: '/common/district',
                    /*
                    *获取医院列表
                    * */
                    hospitalsByType: '/admin/hos/hospitalsByType',
                },
                $inpDeviceName: $('#inp_device_name'),//城市
                $inpCategoryCode: $('#inp_categoryCode'),//区
                $inpHos: $('#inp_hos'),//机构
                $inpStatus:$('#inp_status'),//状态
                $inpStarDate: $('#inp_star_date'),
                $inpEndDate: $('#inp_end_date'),
                dnc: null,
                ccc: null,
                hc: null,
                $btnExportList: $('#export_list'),
                $btnExportHosipitalList: $('#export_hosipital_total'),
                $btnExportTownList: $('#export_town_total'),
                init: function () {
                    this.initComboBox();
                    inpStarDate = this.$inpStarDate.ligerDateEditor({
                        format: "yyyy-MM-dd",
                        showTime: false,
                        labelWidth: 100,
                        labelAlign: 'center',
                        cancelable: true
                    });
                    inpEndDate = this.$inpEndDate.ligerDateEditor({
                        format: "yyyy-MM-dd",
                        showTime: false,
                        labelWidth: 100,
                        labelAlign: 'center',
                        cancelable: true
                    });
                    //状态拉框
                    retrieve.statusBox = $("#inp_att").ligerComboBox({
                        width: 150,
                        data: [
                            {text: '已关注', statusId: '1'},
                            {text: '未关注', statusId: '0'},
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    this.bindEvents();
                },
                //初始化市区下拉框
                initComboBox: function () {
                    this.dnc = this.$inpDeviceName.ligerComboBox({
                        width: 150,
                        data: [
                            {text: '厦门市', statusId: '350200'}
                        ],
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                    this.dnc.selectValue('350200');//默认选中厦门市
                    this.setCityFun(this);
                    this.initInpCat( [], this);
                    this.initHc( [], this);
                },
                //区
                initInpCat: function ( d, me) {
                    me.ccc = me.$inpCategoryCode.ligerComboBox({
                        width: 250,
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
                //机构
                initHc: function ( d, me) {
                    me.hc = me.$inpHos.ligerComboBox({
                        width: 250,
                        data: d,
                        initIsTriggerEvent: false,
                        valueField: 'statusId',
                    });
                },
                setCityFun: function (me) {
                    var v = me.dnc.getValue();
                    if (v != '') {
                        me.rAjax( me.url.district, {
                            type: 3,
                            code: v
                        }, function (data) {
                            var d = [];
                            for (var i = 0; i < data.list.length; i++) {
                                d.push({
                                    text: data.list[i].name,
                                    statusId: data.list[i].code
                                });
                            }
                            //区
                            me.initInpCat( d, me);
                        })
                    } else {
                        me.initInpCat( [], me);
                        me.initHc( [], me);
                    }
                },
                setAreaFun: function (me) {
                    var v = me.ccc.getValue();
                    if (v != '') {
                        me.rAjax( me.url.hospitalsByType, {
                            type: 2,
                            code: v
                        }, function (data) {
                            var d = [];
                            for (var i = 0; i < data.list.length; i++) {
                                d.push({
                                    text: data.list[i].name,
                                    statusId: data.list[i].code
                                });
                            }
                            //机构
                            me.initHc( d, me);
                        })
                    } else {
                        me.initHc( [], me);
                    }
                },
                bindEvents: function () {
                    var me = this;
                    //城市下拉
                    me.$inpDeviceName.on( 'change', function () {
                        me.setCityFun(me);
                    });
                    //区下拉
                    me.$inpCategoryCode.on( 'change', function () {
                        me.setAreaFun(me);
                        me.hc.setValue('');
                    });
                    //机构
                    me.$inpHos.on( 'change', function () {
                    });
                    //关注量详情导出
                    me.$btnExportList.on('click',function () {
                        //定义一个form表单
                        var myform = $("<form></form>");
                        myform.attr('method','post')
                        myform.attr('action',ctx + '/admin/static/wechat/listToExcel');
                        //区
                        var town = $("<input type='hidden' name='town' />")
                        town.attr('value',$("#inp_categoryCode").val());
                        //社区医院
                        var hospital = $("<input type='hidden' name='hospital' />")
                        hospital.attr('value',$("#inp_hos_val").val());
                        //关注状态
                        var attention = $("<input type='hidden' name='attention' />")
                        attention.attr('value',$("#inp_att_val").val());
                        myform.append(town);
                        myform.append(hospital);
                        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/hosipitaTotalToExcel');
                        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/townTotalToExcel');
                        myform.appendTo('body').submit(); //must add this line for higher html spec
                    });
                },
                rAjax: function ( url, d, cb) {
                    $.ajax({
                        url: ctx + url,
                        data: d,
                        type: 'POST',
                        dataType: 'json',
                        success: function (data) {
                            if (data.status == 200) {
                                cb && cb.call( this, data);
                            } else {
                                $.Notice.error(data.msg);
                            }
                        }
                    });
                },
                formatDate:function (date) {//格式化日期
                    var myyear = date.getFullYear();
                    var mymonth = date.getMonth()+1;
                    var myweekday = date.getDate();
                    if(mymonth < 10){
                        mymonth = "0" + mymonth;
                    }
                    if(myweekday < 10){
                        myweekday = "0" + myweekday;
                    }
                    return (myyear+"-"+mymonth + "-" + myweekday);
                }
            };
            win.reloadMasterUpdateGrid = function () {
                retrieve.reloadGrid(retrieve);
            };
            retrieve.init();
        });
    })( jQuery, window);
</script>

+ 2 - 0
patient-co-manage/wlyy-manage/src/main/webapp/static/js/menu.js

@ -24,6 +24,8 @@ var menu = {
    //数据统计
    "static": "/admin/static/center",//数据统计
    "staticPrescription": "/admin/static/prescription/initial",//长处方数据统计
    "staticWechat": "/admin/static/wechat/initial",//微信统计报表
    "staticDevice": "/admin/static/device/initial",//设备统计报表
    //安全管理
    "user": "/admin/user/initial",//人员管理界面

+ 32 - 2
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/HospitalMapping.java

@ -13,15 +13,21 @@ import javax.persistence.Table;
@Entity
@Table(name = "wlyy_hospital_mapping")
public class HospitalMapping extends IdEntity {
	
	// 本地机构代码
	private String code;
	// 机构名称
	private String name;	
	private String name;
	// 对接机构
	private String type;
	// 映射机构代码
	private String mappingCode;
	// 易联众appid
	private String appId;
	// 易联众app secret
	private String appSecret;
	//机构编码号(来自基卫)
	private String sbCode;
	// 基卫授权码
	private String licence;
@ -64,4 +70,28 @@ public class HospitalMapping extends IdEntity {
	public void setLicence(String licence) {
		this.licence = licence;
	}
	
	public String getAppId() {
		return appId;
	}
	
	public void setAppId(String appId) {
		this.appId = appId;
	}
	
	public String getAppSecret() {
		return appSecret;
	}
	
	public void setAppSecret(String appSecret) {
		this.appSecret = appSecret;
	}
	
	public String getSbCode() {
		return sbCode;
	}
	
	public void setSbCode(String sbCode) {
		this.sbCode = sbCode;
	}
}

+ 184 - 58
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/entity/WlyyCharge.java

@ -14,7 +14,7 @@ import java.util.Date;
@Entity
@Table(name = "wlyy_charge")
public class WlyyCharge extends IdEntity {
	
	private String code;   //  接入应用支付业务流水号
	private String chargeType;   //交易类型  1签约 2续签
	private String chargeRelation;   //交易关联代码
@ -22,6 +22,7 @@ public class WlyyCharge extends IdEntity {
	private String patient;   //  用户
	private String openid;   //  用戶微信openid
	private String ssc;   // 医保卡号
	private String principalSsc;   // 实际签约卡号
	private String name;   //  姓名
	private String idType;   //  证件类型
	private String idNo;   //  证件号码
@ -43,231 +44,356 @@ public class WlyyCharge extends IdEntity {
	private String medOrgNo;   //  医疗机构编码
	private String medOrgName;   //  医疗机构名称
	private String billNo;   //  待结算费用单据号
	private Date updateTime;//修改时间
	
	private String miCollectDate;//收费日期
	private String miCollectTime;//收费时间
	private String miSettleNo;//医保收费单据号 (医保签约号)
	private String miCollectStatus;//扣费状态
	private String miRegisterStatus;//登记状态
	private String cadresPay;//政府补贴支付
	private String miTotalFee;//本次报销总额
	private String healthCarePay;//保健基金支付
	private String heathPay;//健康账户支付
	private String accountPay;//医保账户支付
	private String selfPay;//个人现金支付
	private String civilPay;//民政补助金额
	
	public String getPrincipalSsc() {
		return principalSsc;
	}
	
	public void setPrincipalSsc(String principalSsc) {
		this.principalSsc = principalSsc;
	}
	
	public String getMiCollectDate() {
		return miCollectDate;
	}
	
	public void setMiCollectDate(String miCollectDate) {
		this.miCollectDate = miCollectDate;
	}
	
	public String getMiCollectTime() {
		return miCollectTime;
	}
	
	public void setMiCollectTime(String miCollectTime) {
		this.miCollectTime = miCollectTime;
	}
	
	public String getMiSettleNo() {
		return miSettleNo;
	}
	
	public void setMiSettleNo(String miSettleNo) {
		this.miSettleNo = miSettleNo;
	}
	
	public String getMiCollectStatus() {
		return miCollectStatus;
	}
	
	public void setMiCollectStatus(String miCollectStatus) {
		this.miCollectStatus = miCollectStatus;
	}
	
	public String getMiRegisterStatus() {
		return miRegisterStatus;
	}
	
	public void setMiRegisterStatus(String miRegisterStatus) {
		this.miRegisterStatus = miRegisterStatus;
	}
	
	public String getCadresPay() {
		return cadresPay;
	}
	
	public void setCadresPay(String cadresPay) {
		this.cadresPay = cadresPay;
	}
	
	public String getMiTotalFee() {
		return miTotalFee;
	}
	
	public void setMiTotalFee(String miTotalFee) {
		this.miTotalFee = miTotalFee;
	}
	
	public String getHealthCarePay() {
		return healthCarePay;
	}
	
	public void setHealthCarePay(String healthCarePay) {
		this.healthCarePay = healthCarePay;
	}
	
	public String getHeathPay() {
		return heathPay;
	}
	
	public void setHeathPay(String heathPay) {
		this.heathPay = heathPay;
	}
	
	public String getAccountPay() {
		return accountPay;
	}
	
	public void setAccountPay(String accountPay) {
		this.accountPay = accountPay;
	}
	
	public String getSelfPay() {
		return selfPay;
	}
	
	public void setSelfPay(String selfPay) {
		this.selfPay = selfPay;
	}
	
	public String getCivilPay() {
		return civilPay;
	}
	
	public void setCivilPay(String civilPay) {
		this.civilPay = civilPay;
	}
	
	public String getChargeType() {
		return chargeType;
	}
	
	public void setChargeType(String chargeType) {
		this.chargeType = chargeType;
	}
	
	public String getChargeRelation() {
		return chargeRelation;
	}
	
	public void setChargeRelation(String chargeRelation) {
		this.chargeRelation = chargeRelation;
	}
	
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreateTime() {
		return createTime;
	}
	
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	public String getPatient() {
		return patient;
	}
	
	public void setPatient(String patient) {
		this.patient = patient;
	}
	
	public String getOpenid() {
		return openid;
	}
	
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	public String getSsc() {
		return ssc;
	}
	
	public void setSsc(String ssc) {
		this.ssc = ssc;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getIdType() {
		return idType;
	}
	
	public void setIdType(String idType) {
		this.idType = idType;
	}
	
	public String getIdNo() {
		return idNo;
	}
	
	public void setIdNo(String idNo) {
		this.idNo = idNo;
	}
	
	public String getHospital() {
		return hospital;
	}
	
	public void setHospital(String hospital) {
		this.hospital = hospital;
	}
	
	public String getHospitalName() {
		return hospitalName;
	}
	
	public void setHospitalName(String hospitalName) {
		this.hospitalName = hospitalName;
	}
	
	public Integer getTotalAmount() {
		return totalAmount;
	}
	
	public void setTotalAmount(Integer totalAmount) {
		this.totalAmount = totalAmount;
	}
	
	public Integer getSelfpayAmount() {
		return selfpayAmount;
	}
	
	public void setSelfpayAmount(Integer selfpayAmount) {
		this.selfpayAmount = selfpayAmount;
	}
	
	public Integer getInsuranceAmount() {
		return insuranceAmount;
	}
	
	public void setInsuranceAmount(Integer insuranceAmount) {
		this.insuranceAmount = insuranceAmount;
	}
	
	public String getNeedUpload() {
		return needUpload;
	}
	
	public void setNeedUpload(String needUpload) {
		this.needUpload = needUpload;
	}
	
	public String getUploadLog() {
		return uploadLog;
	}
	
	public void setUploadLog(String uploadLog) {
		this.uploadLog = uploadLog;
	}
	
	public String getMiRegisterNo() {
		return miRegisterNo;
	}
	
	public void setMiRegisterNo(String miRegisterNo) {
		this.miRegisterNo = miRegisterNo;
	}
	
	public String getFeeDetail() {
		return feeDetail;
	}
	
	public void setFeeDetail(String feeDetail) {
		this.feeDetail = feeDetail;
	}
	
	public String getChannel() {
		return channel;
	}
	
	public void setChannel(String channel) {
		this.channel = channel;
	}
	
	public String getMerchName() {
		return merchName;
	}
	
	public void setMerchName(String merchName) {
		this.merchName = merchName;
	}
	
	public String getSubject() {
		return subject;
	}
	
	public void setSubject(String subject) {
		this.subject = subject;
	}
	
	public String getTradeStatus() {
		return tradeStatus;
	}
	
	public void setTradeStatus(String tradeStatus) {
		this.tradeStatus = tradeStatus;
	}
	
	public String getChargeNo() {
		return chargeNo;
	}
	
	public void setChargeNo(String chargeNo) {
		this.chargeNo = chargeNo;
	}
	
	public String getChargeTime() {
		return chargeTime;
	}
	
	public void setChargeTime(String chargeTime) {
		this.chargeTime = chargeTime;
	}
	
	public String getMedOrgNo() {
		return medOrgNo;
	}
	
	public void setMedOrgNo(String medOrgNo) {
		this.medOrgNo = medOrgNo;
	}
	
	public String getMedOrgName() {
		return medOrgName;
	}
	
	public void setMedOrgName(String medOrgName) {
		this.medOrgName = medOrgName;
	}
	
	public String getBillNo() {
		return billNo;
	}
	
	public void setBillNo(String billNo) {
		this.billNo = billNo;
	}
	
	public Date getUpdateTime() {
		return updateTime;
	}
	
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
}

+ 26 - 1
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/ChargeZYService.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.common.util.StringUtil;
import com.yihu.wlyy.sign.dao.*;
import com.yihu.wlyy.sign.entity.*;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -112,7 +113,7 @@ public class ChargeZYService {
            String idcard = sign.getIdcard();
            String year = sign.getSignYear();
            String operator = sign.getSignDoctorCode();
            String operator = sign.getDoctor();
            String signCode = sign.getCode();
            String[] hm = null;
@ -187,6 +188,30 @@ public class ChargeZYService {
                    System.out.print("operator:"+operator+","+hm[0]);
                }
                params.put("CHARGE_OPERATOR", operator);  //收费医生
    
                //缴费明细---2017.12.12---黄文杰
                Map<String, String> INSUR_FEE_INFO = new HashMap<>();
                HospitalMapping hospitalMapping = hospitalMappingDao.getMappingCode(sign.getHospital(), "1");  //转换成基卫机构代码
                INSUR_FEE_INFO.put("qyjg00",hospitalMapping.getSbCode());//签约机构
                INSUR_FEE_INFO.put("qyys00",sign.getDoctorName());//签约医生
                INSUR_FEE_INFO.put("btlx00",sign.getExpensesType());//补贴类型
                INSUR_FEE_INFO.put("djjg00",hospitalMapping.getSbCode());//登记机构
                INSUR_FEE_INFO.put("djr000",sign.getDoctorName());//登记人
                INSUR_FEE_INFO.put("djsj00",DateUtil.dateToStrShort(sign.getBegin()));//登记时间
                INSUR_FEE_INFO.put("qyzt00",charge.getMiRegisterStatus());//登记状态
                INSUR_FEE_INFO.put("kfjg00",hospitalMapping.getSbCode());//扣费机构
                INSUR_FEE_INFO.put("kfrxm0",sign.getDoctorName());//扣费人
                INSUR_FEE_INFO.put("kfsj00",charge.getChargeTime());//扣费时间
                INSUR_FEE_INFO.put("kfzt00",charge.getMiCollectStatus());//扣费状态
                INSUR_FEE_INFO.put("kfdjh0",charge.getMiSettleNo());//扣费单据号
                INSUR_FEE_INFO.put("zje000",String.valueOf(charge.getMiTotalFee()));//扣费总额
                INSUR_FEE_INFO.put("zfbtzf",charge.getCadresPay());//政府补贴支付
                INSUR_FEE_INFO.put("tcjjzf",charge.getHealthCarePay());//医保统筹支付
                INSUR_FEE_INFO.put("jkzhzf",charge.getHeathPay());//健康账户支付
                INSUR_FEE_INFO.put("zhzfe0",charge.getAccountPay());//医保账户支付
                INSUR_FEE_INFO.put("xjzfe0",charge.getSelfPay());//个人现金自付
                INSUR_FEE_INFO.put("INSUR_FEE_INFO",JSONObject.fromObject(INSUR_FEE_INFO).toString());
                
                String response = zysoftService.uploadChargeInfo(params, hm[0], hm[1], operator);
                Map<String, String> map = zysoftService.getJwOne(response);

+ 116 - 116
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java

@ -1,116 +1,116 @@
package com.yihu.wlyy.activemq;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.consult.ConsultService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ImUtill;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.util.List;
/**
 * Created by chenweida on 2017/9/9.
 * 健康教育文章监听
 */
@Component
public class HealthArtListener implements MessageListener {
    private Logger logger = LoggerFactory.getLogger(HealthArtListener.class);
    @Autowired
    private WeiXinOpenIdUtils weiXinOpenIdUtils;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private PatientService patientService;
    @Autowired
    private ConsultService consultService;
    @Autowired
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Override
    public void onMessage(Message message) {
        try {
            TextMessage textMessage = (TextMessage) message;
            HealthEduArticlePatient healthEduArticlePatient = (HealthEduArticlePatient)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticlePatient.class);
//            logger.info(jo.toString());
            sendWxTemplateAndIM(healthEduArticlePatient);
            //返回服务器表示消息消费成功
            message.acknowledge();
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
    //发送到IM和微信消息模板
    private void sendWxTemplateAndIM(HealthEduArticlePatient one) {
        String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
//        healthEduArticlePatients.stream().forEach(one -> {
            Patient patient = patientService.findByCode(one.getPatient());
            try {
                //卫纪委发送不推IM
                if (1 == one.getSendType()) {
                    consultService.sendMucMessageBySingnType(one.getSendCode(), one.getSendName(), patient.getCode(), "{\"title\":\"" + one.getAttachedTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getAttachedPic() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
                    if (StringUtils.isNotBlank(one.getAttachedMessage())) {
                        //发送备注
                        consultService.sendMucMessageBySingnType(one.getSendCode(), one.getSendName(), patient.getCode(), one.getAttachedMessage(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
                    }
                }
                // 推送消息给微信端
                org.json.JSONObject json = new org.json.JSONObject();
                json.put("first", patient.getName() + ",您好! " + one.getSendName() + (one.getSendType()==2 ? "卫计委":"医生") +"给您发来了一篇患教文章");
                json.put("toUser", patient.getCode());
                json.put("article", one.getArticleId() + "");
                json.put("title", one.getAttachedTitle());
                json.put("doctorName", one.getSendName()+(one.getSendType()==2 ? "卫计委":"医生"));
                json.put("represented", patient.getCode());//被代理人
                json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
                json.put("remark", org.springframework.util.StringUtils.isEmpty(one.getAttachedMessage()) ? "  " : one.getAttachedMessage());
                json.put("articleUrl",one.getArticleUrl());
                if (StringUtils.isNotBlank(patient.getOpenid())) {
                    pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9,
                            patient.getOpenid(),
                            patient.getName(),
                            json);
                }
                //发送代理人
                JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), patient.getOpenid());
                if (jsonArray != null && jsonArray.length() > 0) {
                    for (int i = 0; i < jsonArray.length(); i++) {
                        org.json.JSONObject j = jsonArray.getJSONObject(i);
                        Patient member = (Patient) j.get("member");
                        json.remove("toUser");
                        json.put("toUser", member.getCode());
                        json.remove("first");
                        try {
                            json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.isNull("relation") ? 1 : j.getInt("relation"), patient.getName()));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (StringUtils.isNotBlank(member.getOpenid())) {
                            pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
                        }
                    }
                }
            } catch (Exception e) {
                logger.error("patient:" + patient.getCode() + "," + e.getMessage());
            }
//        });
    }
}
//package com.yihu.wlyy.activemq;
//
//import com.yihu.es.entity.HealthEduArticlePatient;
//import com.yihu.wlyy.entity.patient.Patient;
//import com.yihu.wlyy.service.app.consult.ConsultService;
//import com.yihu.wlyy.service.common.account.PatientService;
//import com.yihu.wlyy.task.PushMsgTask;
//import com.yihu.wlyy.util.DateUtil;
//import com.yihu.wlyy.util.ImUtill;
//import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
//import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
//import net.sf.json.JSONObject;
//import org.apache.commons.lang3.StringUtils;
//import org.json.JSONArray;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import javax.jms.JMSException;
//import javax.jms.Message;
//import javax.jms.MessageListener;
//import javax.jms.TextMessage;
//import java.util.List;
//
///**
// * Created by chenweida on 2017/9/9.
// * 健康教育文章监听
// */
//@Component
//public class HealthArtListener implements MessageListener {
//    private Logger logger = LoggerFactory.getLogger(HealthArtListener.class);
//
//    @Autowired
//    private WeiXinOpenIdUtils weiXinOpenIdUtils;
//    @Autowired
//    private PushMsgTask pushMsgTask;
//    @Autowired
//    private PatientService patientService;
//    @Autowired
//    private ConsultService consultService;
//    @Autowired
//    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
//
//    @Override
//    public void onMessage(Message message) {
//        try {
//            TextMessage textMessage = (TextMessage) message;
//            HealthEduArticlePatient healthEduArticlePatient = (HealthEduArticlePatient)JSONObject.toBean(JSONObject.fromObject(textMessage.getText()),HealthEduArticlePatient.class);
////            logger.info(jo.toString());
//            sendWxTemplateAndIM(healthEduArticlePatient);
//            //返回服务器表示消息消费成功
//            message.acknowledge();
//        } catch (JMSException e) {
//            e.printStackTrace();
//        }
//    }
//
//
//    //发送到IM和微信消息模板
//    private void sendWxTemplateAndIM(HealthEduArticlePatient one) {
//        String endMsg = "";//"为了您的健康," + doctor.getName() + "医生给您发送了一篇患教文章,请仔细查阅,如有问题,可随时咨询医生。";
//
////        healthEduArticlePatients.stream().forEach(one -> {
//            Patient patient = patientService.findByCode(one.getPatient());
//            try {
//                //卫纪委发送不推IM
//                if (1 == one.getSendType()) {
//                    consultService.sendMucMessageBySingnType(one.getSendCode(), one.getSendName(), patient.getCode(), "{\"title\":\"" + one.getAttachedTitle() + "\",\"type\":0,\"id\":\"" + one.getId() + "\",\"img\":\"" + one.getAttachedPic() + "\",\"content\":\"为了您的健康,我给您发送了一篇文章,请咨询查阅,如有问题,可随时与我沟通\"}", "4", patient.getName());
//                    if (StringUtils.isNotBlank(one.getAttachedMessage())) {
//                        //发送备注
//                        consultService.sendMucMessageBySingnType(one.getSendCode(), one.getSendName(), patient.getCode(), one.getAttachedMessage(), ImUtill.CONTENT_TYPE_TEXT, patient.getName());
//                    }
//                }
//                // 推送消息给微信端
//                org.json.JSONObject json = new org.json.JSONObject();
//                json.put("first", patient.getName() + ",您好! " + one.getSendName() + (one.getSendType()==2 ? "卫计委":"医生") +"给您发来了一篇患教文章");
//                json.put("toUser", patient.getCode());
//                json.put("article", one.getArticleId() + "");
//                json.put("title", one.getAttachedTitle());
//                json.put("doctorName", one.getSendName()+(one.getSendType()==2 ? "卫计委":"医生"));
//                json.put("represented", patient.getCode());//被代理人
//                json.put("date", DateUtil.dateToStrLong(DateUtil.getNowDate()));
//                json.put("remark", org.springframework.util.StringUtils.isEmpty(one.getAttachedMessage()) ? "  " : one.getAttachedMessage());
//                json.put("articleUrl",one.getArticleUrl());
//                if (StringUtils.isNotBlank(patient.getOpenid())) {
//                    pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9,
//                            patient.getOpenid(),
//                            patient.getName(),
//                            json);
//                }
//                //发送代理人
//                JSONArray jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient.getCode(), patient.getOpenid());
//                if (jsonArray != null && jsonArray.length() > 0) {
//                    for (int i = 0; i < jsonArray.length(); i++) {
//                        org.json.JSONObject j = jsonArray.getJSONObject(i);
//                        Patient member = (Patient) j.get("member");
//                        json.remove("toUser");
//                        json.put("toUser", member.getCode());
//                        json.remove("first");
//                        try {
//                            json.put("first", weiXinOpenIdUtils.getTitleMes(patient, j.isNull("relation") ? 1 : j.getInt("relation"), patient.getName()));
//                        } catch (Exception e) {
//                            e.printStackTrace();
//                        }
//                        if (StringUtils.isNotBlank(member.getOpenid())) {
//                            pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 9, member.getOpenid(), patient.getName(), json);
//                        }
//                    }
//                }
//            } catch (Exception e) {
//                logger.error("patient:" + patient.getCode() + "," + e.getMessage());
//            }
////        });
//    }
//}

+ 90 - 90
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/StartListener.java

@ -1,90 +1,90 @@
package com.yihu.wlyy.activemq;
import com.yihu.wlyy.util.SpringUtil;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.jms.MessageListener;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2017/9/9.
 */
@Component
public class StartListener {
    private static Map<String, DefaultMessageListenerContainer> holder = new HashMap<String, DefaultMessageListenerContainer>();
    private Logger logger = LoggerFactory.getLogger(StartListener.class);
    @Value("${activemq.queue.healtHarticleQueue}")
    private String healtHarticleQueue;
    @Value("${activemq.consumers.count}")
    private Integer count;
    @Autowired
    private HealthArtListener healthArtListener;
    @Autowired
    private CachingConnectionFactory cachingConnectionFactory;
    @PostConstruct
    public void startListener() {
        startHealthArticQueueListener();
    }
    /**
     * 启动健康教育消费
     */
    private void startHealthArticQueueListener() {
        try {
            //启动监听
            startReceiverByQueueName(healthArtListener, healtHarticleQueue);
            logger.info("start HealthArtListener success");
        } catch (Exception e) {
            logger.error("start HealthArtListener error");
        }
    }
    /**
     * 启动
     *
     * @param receiver
     * @param queueName
     */
    private void startReceiverByQueueName(MessageListener receiver, String queueName) {
        if (holder.get(queueName) != null) {
            return;
        }
        ActiveMQQueue destination = new ActiveMQQueue(queueName);
        DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
        // 监听容器属性的配置
        listenerContainer.setConnectionFactory(cachingConnectionFactory);
        // 设置目的地
        listenerContainer.setDestination(destination);
        // 设置监听器
        listenerContainer.setMessageListener(receiver);
        // 设置消费者集群数
        int consumers = count;
        listenerContainer.setConcurrentConsumers(2);
        listenerContainer.setMaxConcurrentConsumers(consumers);
        // 设置监听队列还是主题 默认是队列
        listenerContainer.setPubSubNoLocal(false);
        // listenerContainer.setAcceptMessagesWhileStopping(true);
        // 设置应答模式 默认是4
        listenerContainer.setSessionAcknowledgeMode(ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
        // 设置是否启动事物 默认不开启
        listenerContainer.setSessionTransacted(false);
        // 将监听容器保存在holder中
        holder.put(queueName, listenerContainer);
        listenerContainer.initialize();
        // 启动监听
        listenerContainer.start();
    }
}
//package com.yihu.wlyy.activemq;
//
//import com.yihu.wlyy.util.SpringUtil;
//import org.apache.activemq.ActiveMQSession;
//import org.apache.activemq.command.ActiveMQQueue;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.jms.connection.CachingConnectionFactory;
//import org.springframework.jms.listener.DefaultMessageListenerContainer;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.PostConstruct;
//import javax.jms.MessageListener;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * Created by chenweida on 2017/9/9.
// */
//@Component
//public class StartListener {
//    private static Map<String, DefaultMessageListenerContainer> holder = new HashMap<String, DefaultMessageListenerContainer>();
//    private Logger logger = LoggerFactory.getLogger(StartListener.class);
//
//    @Value("${activemq.queue.healtHarticleQueue}")
//    private String healtHarticleQueue;
//    @Value("${activemq.consumers.count}")
//    private Integer count;
//    @Autowired
//    private HealthArtListener healthArtListener;
//    @Autowired
//    private CachingConnectionFactory cachingConnectionFactory;
//
//    @PostConstruct
//    public void startListener() {
//        startHealthArticQueueListener();
//    }
//
//    /**
//     * 启动健康教育消费
//     */
//    private void startHealthArticQueueListener() {
//        try {
//            //启动监听
//            startReceiverByQueueName(healthArtListener, healtHarticleQueue);
//            logger.info("start HealthArtListener success");
//        } catch (Exception e) {
//            logger.error("start HealthArtListener error");
//        }
//    }
//
//    /**
//     * 启动
//     *
//     * @param receiver
//     * @param queueName
//     */
//    private void startReceiverByQueueName(MessageListener receiver, String queueName) {
//        if (holder.get(queueName) != null) {
//            return;
//        }
//        ActiveMQQueue destination = new ActiveMQQueue(queueName);
//
//        DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
//        // 监听容器属性的配置
//        listenerContainer.setConnectionFactory(cachingConnectionFactory);
//        // 设置目的地
//        listenerContainer.setDestination(destination);
//        // 设置监听器
//        listenerContainer.setMessageListener(receiver);
//        // 设置消费者集群数
//        int consumers = count;
//        listenerContainer.setConcurrentConsumers(2);
//        listenerContainer.setMaxConcurrentConsumers(consumers);
//        // 设置监听队列还是主题 默认是队列
//        listenerContainer.setPubSubNoLocal(false);
//        // listenerContainer.setAcceptMessagesWhileStopping(true);
//        // 设置应答模式 默认是4
//        listenerContainer.setSessionAcknowledgeMode(ActiveMQSession.INDIVIDUAL_ACKNOWLEDGE);
//        // 设置是否启动事物 默认不开启
//        listenerContainer.setSessionTransacted(false);
//        // 将监听容器保存在holder中
//        holder.put(queueName, listenerContainer);
//        listenerContainer.initialize();
//        // 启动监听
//        listenerContainer.start();
//    }
//}

+ 70 - 70
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/config/ActiveMQConfig.java

@ -1,70 +1,70 @@
package com.yihu.wlyy.config;
import com.yihu.wlyy.activemq.HealthArtListener;
import com.yihu.wlyy.util.SpringUtil;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.command.ActiveMQQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.connection.CachingConnectionFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import javax.annotation.PostConstruct;
import javax.jms.MessageListener;
import java.util.HashMap;
import java.util.Map;
/**
 * Created by chenweida on 2017/9/9.
 * 生产者配置
 */
@EnableJms
@Configuration
public class ActiveMQConfig {
   @Value("${activemq.username}")
    private String username;
    @Value("${activemq.password}")
    private String password;
    @Value("${activemq.url}")
    private String url;
    @Bean
    public ActiveMQConnectionFactory activeMQConnectionFactory() {
        ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(username, password, url);
        //设置异步发送
        activeMQConnectionFactory.setUseAsyncSend(true);
        return activeMQConnectionFactory;
    }
    /**
     * 缓存session链接
     *
     * @return
     */
    @Bean
    @Primary
    public CachingConnectionFactory CachingConnectionFactory() {
        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
        //目标ConnectionFactory对应真实的可以产生JMS Connection的ConnectionFactory
        cachingConnectionFactory.setTargetConnectionFactory(activeMQConnectionFactory());
        //Session缓存数量,这里属性也可以直接在这里配置
        cachingConnectionFactory.setSessionCacheSize(100);
        return cachingConnectionFactory;
    }
    @Bean
    public JmsTemplate jmsTemplate() {
        JmsTemplate jmsTemplate = new JmsTemplate();
        jmsTemplate.setConnectionFactory(CachingConnectionFactory());
        return jmsTemplate;
    }
}
//package com.yihu.wlyy.config;
//
//import com.yihu.wlyy.activemq.HealthArtListener;
//import com.yihu.wlyy.util.SpringUtil;
//import org.apache.activemq.ActiveMQConnectionFactory;
//import org.apache.activemq.ActiveMQSession;
//import org.apache.activemq.command.ActiveMQQueue;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//import org.springframework.jms.annotation.EnableJms;
//import org.springframework.jms.connection.CachingConnectionFactory;
//import org.springframework.jms.core.JmsTemplate;
//import org.springframework.jms.listener.DefaultMessageListenerContainer;
//
//import javax.annotation.PostConstruct;
//import javax.jms.MessageListener;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * Created by chenweida on 2017/9/9.
// * 生产者配置
// */
//@EnableJms
//@Configuration
//public class ActiveMQConfig {
//   @Value("${activemq.username}")
//    private String username;
//    @Value("${activemq.password}")
//    private String password;
//    @Value("${activemq.url}")
//    private String url;
//
//    @Bean
//    public ActiveMQConnectionFactory activeMQConnectionFactory() {
//        ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory(username, password, url);
//        //设置异步发送
//        activeMQConnectionFactory.setUseAsyncSend(true);
//        return activeMQConnectionFactory;
//    }
//
//    /**
//     * 缓存session链接
//     *
//     * @return
//     */
//    @Bean
//    @Primary
//    public CachingConnectionFactory CachingConnectionFactory() {
//        CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory();
//        //目标ConnectionFactory对应真实的可以产生JMS Connection的ConnectionFactory
//        cachingConnectionFactory.setTargetConnectionFactory(activeMQConnectionFactory());
//        //Session缓存数量,这里属性也可以直接在这里配置
//        cachingConnectionFactory.setSessionCacheSize(100);
//        return cachingConnectionFactory;
//    }
//
//    @Bean
//    public JmsTemplate jmsTemplate() {
//        JmsTemplate jmsTemplate = new JmsTemplate();
//        jmsTemplate.setConnectionFactory(CachingConnectionFactory());
//
//        return jmsTemplate;
//    }
//
//}

+ 8 - 6
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -966,10 +966,11 @@ public class JwPrescriptionService {
                                followupResultMap.put("CONTROL_CONSTITUTOR",CONTROL_CONSTITUTOR);//基卫控制目标操作者
                            }
                            
                        }else{
                            logger.info("随访记录上传失败,控制目标操作者CODE为空: 操作者为" + followupResultMap.containsKey("CONTROL_CONSTITUTOR"));
                            continue;
                        }
//                        else{
//                            logger.info("随访记录上传失败,控制目标操作者CODE为空: 操作者为" + followupResultMap.containsKey("CONTROL_CONSTITUTOR"));
//                            continue;
//                        }
                    }
@ -1080,7 +1081,8 @@ public class JwPrescriptionService {
                        continue;
                    }
                } catch (Exception e) {
                    logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err"+e.getMessage());
                    e.printStackTrace();
                    logger.info("随访记录上传失败,随访主表ID:" + followup.getId().toString()+",err"+e.toString());
                    continue;
                }
            }
@ -1092,8 +1094,8 @@ public class JwPrescriptionService {
     */
    public String getSickArchiveFlag(String idcard)  throws Exception {
        String re = "0";//0 未建档,非0为档案号
        String url = jwUrl + "/third/sign/uploadEhrSickChroDaysFollowUpRecord";
        
        String url = jwUrl + "/third/archives/getSickArchiveRecord";
    
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("idcard", idcard));
        String response = httpClientUtil.post(url, params, "UTF-8");

+ 9 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PrenatalInspectorPlanDao.java

@ -16,12 +16,17 @@ public interface PrenatalInspectorPlanDao extends PagingAndSortingRepository<Pre
    @Query("select a from PrenatalInspectorPlan a where a.inspectionCode = ?1 and a.status = '0' and a.del='1' order by a.inspectionTime asc")
    List<PrenatalInspectorPlan> findByCode(String inspectionCode);
    //查询最近15天数据
    @Query(value = "SELECT a.* FROM wlyy_prenatal_inspector_plan a WHERE a.patient = ?1 AND a. STATUS = '0' AND a.del = '1' " +
            " AND DATE_ADD(CURDATE(),INTERVAL -14 DAY) <= a.inspection_time " +
            " AND a.inspection_time <= CURDATE() ORDER BY a.inspection_time DESC ",nativeQuery = true)
    //查询当前时间14天前之后所有产检计划
    @Query(value = "select a.* from wlyy_prenatal_inspector_plan a where a.patient = ?1 and a.status = '0' and a.del='1' " +
            " AND a.inspection_time >= DATE_ADD(CURDATE(),INTERVAL -14 DAY) order by a.inspection_time asc",nativeQuery = true)
    List<PrenatalInspectorPlan> findByPatient(String patient);
    //查询当前时间14天前之后所有产检计划中距当前时间最近的记录
    @Query(value = "SELECT a.id,a.inspection_time FROM wlyy_prenatal_inspector_plan a WHERE a.patient = ?1 " +
            " AND a. STATUS = '0' AND a.del = '1' AND a.inspection_time >= DATE_ADD(CURDATE(),INTERVAL -14 DAY) " +
            " ORDER BY ABS(DATEDIFF(NOW(),inspection_time)) ASC LIMIT 0,1 ",nativeQuery = true)
    PrenatalInspectorPlan findByPatientlateliest(String patient);
    //应产检时间前14天后14天待产检计划(不包括应产检当天)
    @Query(value = "SELECT a.* FROM wlyy_prenatal_inspector_plan a, (SELECT t.* from wlyy_prenatal_inspector_plan t where t.id = ?1 )b  " +
            " WHERE a.inspection_time >= DATE_ADD(b.inspection_time,INTERVAL -14 DAY) and a.inspection_time <= DATE_ADD(b.inspection_time,INTERVAL 14 DAY) " +

+ 3 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticlePatientService.java

@ -96,7 +96,7 @@ public class HealthEduArticlePatientService extends BaseService {
     * @param pagesize 分页大小
     * @return
     */
    public List<HealthEduArticlePatient> findByPatient(String patient,int wheaType, long id, int pagesize) {
    public List<HealthEduArticlePatient> findByPatient(String patient,int wheaType, int pageIndex, int pagesize) {
        if (pagesize <= 0) {
            pagesize = 10;
        }
@ -120,17 +120,11 @@ public class HealthEduArticlePatientService extends BaseService {
                "      a.article = b.code" +
                " and ( a.send_type =1 or a.send_type is null or a.send_type = '') "+  //添加类型判断是集美的推送还是三师原来的推送
                " and a.patient = ?" +
                (id > 0 ? " and a.id < ? " : "") +
                (wheaType > 0 ? " and a.wheaType = ? " : "") +
                " order by a.id desc limit 0," + pagesize;
                " order by a.id desc limit "+pageIndex+"," + pagesize;
        Object params[] = null;
        if(wheaType>-1&&id>0){
            params = new Object[]{patient,id,wheaType};
        }else if(wheaType>-1&&id<0){
        if(wheaType>-1){
            params = new Object[]{patient,wheaType};
        }
        else if(wheaType<0&&id>0){
            params = new Object[]{patient,id};
        }else{
            params = new Object[]{patient};
        }

+ 7 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -167,9 +167,10 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            plans = new ArrayList<>();
                            PrenatalInspectorPlan plan = null;
                            for (PrenatalInspectorPlanLibrary library : libraries) {
                                //                                    只取最近15天数据
                                //                                    只取当前时间14天前之后的数据
                                Date inspectorDate = DateUtil.getPrenatalInspectorDate(dueDay, -library.getEndDay().intValue());
                                if (DateUtil.getDays(date, inspectorDate) <= 15 && DateUtil.getDays(date, inspectorDate) >= 0) {
//                                if (DateUtil.getDays(date, inspectorDate) <= 15 && DateUtil.getDays(date, inspectorDate) >= 0) {
                                if (inspectorDate.getTime() >= DateUtil.getPreDays(date,-14).getTime()) {
                                    plan = new PrenatalInspectorPlan();
                                    plan.setInspectionPhase(library.getInspectionPhase());
                                    plan.setStatus("0");
@ -200,7 +201,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                        }
                        planJson.put("plans", plans);//待产检列表
                        if (plans != null && plans.size()>0) {
                            PrenatalInspectorPlan prenatalInspectorPlan = plans.get(0);
                            PrenatalInspectorPlan prenatalInspectorPlan = prenatalInspectorPlanDao.findByPatientlateliest(patientCode);
                            JSONObject status = getPrenatalStatus(prenatalInspectorPlan.getId());
                            planJson.put("inspectStatus", status);//最近一条状态
                        }
@ -265,9 +266,9 @@ public class PrenatalInspectorPreCardService extends BaseService {
                                plans = new ArrayList<>();
                                PrenatalInspectorPlan plan = null;
                                for (PrenatalInspectorPlanLibrary library : libraries) {
//                                    只取最近15天数据
//                                    只取当前时间14天前之后的数据
                                    Date inspectorDate = DateUtil.getPrenatalInspectorDate(dueday, -library.getEndDay().intValue());
                                    if (DateUtil.getDays(date, inspectorDate) <= 15 && DateUtil.getDays(date, inspectorDate) >= 0) {
                                    if (inspectorDate.getTime() >= DateUtil.getPreDays(date,-14).getTime()) {
                                        plan = new PrenatalInspectorPlan();
                                        plan.setInspectionPhase(library.getInspectionPhase());
                                        plan.setStatus("0");
@ -298,7 +299,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
                            }
                            planJson.put("plans", plans);//待产检列表
                            if (plans != null && plans.size()>0) {
                                PrenatalInspectorPlan prenatalInspectorPlan = plans.get(0);
                                PrenatalInspectorPlan prenatalInspectorPlan = prenatalInspectorPlanDao.findByPatientlateliest(patientCode);
                                JSONObject status = getPrenatalStatus(prenatalInspectorPlan.getId());
                                planJson.put("inspectStatus", status);//最近一条状态
                            }

+ 4 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/RemindFocusWechatTask.java

@ -39,7 +39,10 @@ public class RemindFocusWechatTask implements Runnable {
    public void run() {
        for (Map<String, Object> p : patients) {
            try {
                if (p.get("mobile") == null || StringUtils.isEmpty(p.get("mobile").toString())||Integer.parseInt(p.get("status").toString())!=1) {
//                if (p.get("mobile") == null || StringUtils.isEmpty(p.get("mobile").toString())||Integer.parseInt(p.get("status").toString())!=1) {
//                    continue;
//                }
                if (p.get("mobile") == null || StringUtils.isEmpty(p.get("mobile").toString())) {
                    continue;
                }
                String msg = "尊敬的" + p.get("name").toString() + "," + doctor.getName() + "医生提醒您:" +

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -64,11 +64,11 @@ public class HealthEduArticleController extends BaseController {
    @RequestMapping(value = "list")
    @ResponseBody
    @ApiOperation("查询文章列表")
    public String list(@RequestParam("id") long id, @RequestParam("pagesize") int pagesize, @RequestParam(required = true, value = "wheaType") int wheaType) {
    public String list(@RequestParam("page") int pageIndex, @RequestParam("pagesize") int pagesize, @RequestParam(required = true, value = "wheaType") int wheaType) {
        try {
//            List<HealthEduArticlePatient> list = healthEduArticlePatientService.findByPatient(getUID(), wheaType, id, pagesize);
//            增加判断是当前居民还是被代理人的文章列表
            List<HealthEduArticlePatient> list = healthEduArticlePatientService.findByPatient(getRepUID(), wheaType, id, pagesize);
            List<HealthEduArticlePatient> list = healthEduArticlePatientService.findByPatient(getRepUID(), wheaType, pageIndex, pagesize);
            JSONArray jsonArray = new JSONArray();
            Map<String, Doctor> docMap = new HashMap<>();
            if (list != null) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdMessageController.java

@ -64,7 +64,7 @@ public class ThirdMessageController extends BaseController {
            @RequestParam(value = "medicalNo", required = true) String medicalNo,
            @ApiParam(name = "medicalOrg", defaultValue = "201712111825")
            @RequestParam(value = "medicalOrg", required = true) String medicalOrg,
            @ApiParam(name = "medicalTime", defaultValue = "2017-12-11 20:30")
            @ApiParam(name = "medicalTime", defaultValue = "2017-12-11 20:30:00")
            @RequestParam(value = "medicalTime", required = true) String medicalTime) {
        try {
            JSONObject response = thirdMessageService.physicalExamination(idCard, medicalNo, medicalOrg, medicalTime);