Sfoglia il codice sorgente

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

yeshijie 7 anni fa
parent
commit
0408021489
33 ha cambiato i file con 701 aggiunte e 216 eliminazioni
  1. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  2. 7 6
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  3. 3 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java
  4. 50 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyPatientDeviceController.java
  5. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/DeviceHealthIndexVO.java
  6. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/PatientDeviceVO.java
  7. 146 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/WlyyPatientDeviceVO.java
  8. 21 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/doctor/DoctorService.java
  9. 4 5
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java
  10. 130 7
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java
  11. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java
  12. 10 3
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list.jsp
  13. 14 6
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list_js.jsp
  14. 9 9
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/GuahaoController.java
  15. 30 51
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/guahao/GuahaoService.java
  16. 16 0
      patient-co-service/wlyy_service/src/main/resources/application.yml
  17. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java
  18. 12 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  19. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/ServiceStatisticsService.java
  20. 20 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  21. 13 9
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  22. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java
  23. 2 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  24. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java
  25. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java
  26. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  27. 36 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  28. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java
  29. 21 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  30. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/service/EduArticleService.java
  31. 128 82
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java
  32. 8 0
      patient-co/patient-co-wlyy/src/main/resources/system.properties
  33. 3 3
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu.txt

BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class


+ 7 - 6
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -162,6 +162,7 @@ public class ArticleApi {
					jsonObj.put("browseNumber", StringUtil.getJSONValue(vbo.getBrowseNumber()));
					jsonObj.put("pointNumber", StringUtil.getJSONValue(vbo.getPointNumber()));
					jsonObj.put("commentNumber", StringUtil.getJSONValue(vbo.getCommentNumber()));
					jsonObj.put("pushNumber", StringUtil.getJSONValue(vbo.getPushNumber()));
					jsonObj.put("shareNumber", StringUtil.getJSONValue(vbo.getShareNumber()));
					jsonObj.put("collectionNumber", StringUtil.getJSONValue(vbo.getCollectionNumber()));
					jsonObj.put("articleContent",StringUtil.getJSONValue(vbo.getArticleContent()));
@ -249,12 +250,12 @@ public class ArticleApi {
						jsonObj.put("collectionNumberCount", collectionNumberCount);
						//判断该用户是否有收藏过该文章
						ArticleCollection vo1 = new ArticleCollection();
						vo1.setArticleId(articleId);
						vo1.setUserType(userType);
						vo1.setUserId(userId);
						int size = subDao.getArticleCollection(vo1);
						if(size>0){
//						ArticleCollection vo1 = new ArticleCollection();
//						vo1.setArticleId(articleId);
//						vo1.setUserType(userType);
//						vo1.setUserId(userId);
//						int size = subDao.getArticleCollection(vo1);
						if(collectionNumberCount>0){
							jsonObj.put("isCollection", 1);
						}else{
							jsonObj.put("isCollection", 0);

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

@ -2,8 +2,7 @@ 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.device.entity.DeviceHealthIndexExportVO;
import com.yihu.wlyy.service.manager.device.DeviceHealthIndexService;
import jxl.Workbook;
import jxl.write.*;
@ -57,7 +56,7 @@ public class DeviceHealthIndexController extends BaseController{
            @RequestParam(value = "hospital",required = false)String hospital,
            HttpServletResponse response){
        try {
            List<DeviceHealthIndexVO> wlyyDevices = healthIndexService.exportDeviceHealthIndexList(town,hospital);
            List<DeviceHealthIndexExportVO> wlyyDevices = healthIndexService.exportDeviceHealthIndexList(town,hospital);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "deviceHealthIndexDataList.xls"));
            OutputStream os = response.getOutputStream();
@ -84,7 +83,7 @@ public class DeviceHealthIndexController extends BaseController{
            ws = wwb.createSheet("sheet",1);
            addHeader(ws);
            int i = 1;
            for (DeviceHealthIndexVO m : (List<DeviceHealthIndexVO>) ls) {
            for (DeviceHealthIndexExportVO m : (List<DeviceHealthIndexExportVO>) ls) {
                addCell(ws, i, 0, m.getName(),"");
                addCell(ws, i, 1, m.getMobile(),"");
                addCell(ws, i, 2, m.getIdcard(),"");

+ 50 - 4
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.device.entity.PatientDeviceExportVO;
import com.yihu.wlyy.device.entity.WlyyPatientDeviceVO;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.entity.WlyyPatientDevice;
import com.yihu.wlyy.service.doctor.DoctorService;
import com.yihu.wlyy.service.manager.device.WlyyPatientDeviceService;
import jxl.Workbook;
import jxl.write.*;
@ -27,9 +30,24 @@ import java.util.List;
public class WlyyPatientDeviceController extends BaseController {
    @Autowired
    private WlyyPatientDeviceService patientDeviceService;
    @Autowired
    private DoctorService doctorService;
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    public String listPageInit(){
    
        String currentid = getUID();
    
        Doctor doctor = doctorService.findDoctorByCode(currentid);
    
        String hospitalCode = "";
        
        if(doctor != null){
            hospitalCode = doctor.getHospital();
        }
        
        request.setAttribute("hospitalCode",hospitalCode);
        
        return "device/patientDevice_list";
    }
@ -40,6 +58,34 @@ public class WlyyPatientDeviceController extends BaseController {
            @RequestParam(value = "categoryCode",required = false) String categoryCode,
            @RequestParam(value = "deviceSn",required = false) String deviceSn,
            @RequestParam(value = "userName",required = false) String userName,
            @RequestParam(value = "doctorName",required = false) String doctorName,
            @RequestParam(value = "hospitalCode",required = false) String hospitalCode,
            @RequestParam(value = "hospitalName",required = false) String hospitalName,
            @RequestParam(value = "page") Integer page,
            @RequestParam(value = "rows") Integer pageSize){
        try {
            
            
            
            List<WlyyPatientDeviceVO> patientDevices = patientDeviceService.searchListNew(deviceName,categoryCode, deviceSn, userName, doctorName,hospitalName,hospitalCode,page, pageSize);
            Long totalcount = patientDeviceService.getCountSearchListNew(deviceName,categoryCode, deviceSn, userName, doctorName,hospitalName,hospitalCode);
            return write(200,"操作成功",page,pageSize,totalcount,patientDevices);
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    
    @RequestMapping(value = "listbak",method = RequestMethod.POST)
    @ResponseBody
    public String searchListbak(
            @RequestParam(value = "deviceName",required = false) String deviceName,
            @RequestParam(value = "categoryCode",required = false) String categoryCode,
            @RequestParam(value = "deviceSn",required = false) String deviceSn,
            @RequestParam(value = "userName",required = false) String userName,
            @RequestParam(value = "doctorName",required = false) String doctorName,
            @RequestParam(value = "hospital",required = false) String hospital,
            @RequestParam(value = "page") Integer page,
            @RequestParam(value = "rows") Integer pageSize){
        try {
@ -49,7 +95,7 @@ public class WlyyPatientDeviceController extends BaseController {
            error(ex);
            return error(-1,"操作失败!");
        }
        
    }
    //设备解绑(记录删除)
@ -76,7 +122,7 @@ public class WlyyPatientDeviceController extends BaseController {
            @RequestParam(value = "hospital",required = false)String hospital,
            HttpServletResponse response){
        try {
            List<PatientDeviceVO> wlyyDevices = patientDeviceService.exportPatientDeviceList(town,hospital);
            List<PatientDeviceExportVO> wlyyDevices = patientDeviceService.exportPatientDeviceList(town,hospital);
            response.setContentType("octets/stream");
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "patientDeviceDataList.xls"));
            OutputStream os = response.getOutputStream();
@ -103,7 +149,7 @@ public class WlyyPatientDeviceController extends BaseController {
            ws = wwb.createSheet("sheet",1);
            addHeader(ws);
            int i = 1;
            for (PatientDeviceVO m : (List<PatientDeviceVO>) ls) {
            for (PatientDeviceExportVO m : (List<PatientDeviceExportVO>) ls) {
                addCell(ws, i, 0, m.getName(),"");
                addCell(ws, i, 1, m.getMobile(),"");
                addCell(ws, i, 2, m.getIdcard(),"");

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

@ -4,7 +4,7 @@ package com.yihu.wlyy.device.entity;
 * @author huangwenjie
 * @date 2017/12/12 10:10
 */
public class DeviceHealthIndexVO {
public class DeviceHealthIndexExportVO {
	private String patient;
	private String name;
	private String mobile;

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

@ -4,7 +4,7 @@ package com.yihu.wlyy.device.entity;
 * @author huangwenjie
 * @date 2017/12/12 09:47
 */
public class PatientDeviceVO {
public class PatientDeviceExportVO {
	private String patient;
	private String name;
	private String mobile;

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

@ -0,0 +1,146 @@
package com.yihu.wlyy.device.entity;
import java.util.Date;
/**
 * 居民体征设备
 * @author huangwenjie
 * @date 2018/1/24 09:17
 */
public class WlyyPatientDeviceVO {
	private Integer id;
	private Integer deviceId;
	private String user;
	private String userName;
	private String categoryCode;
	private String deviceName;
	private String deviceSn;
	private String sim;
	private String userType;
	private String userIdcard;
	private Date czrq;
	private String doctor;
	private String doctorName;
	private String hospital;
	private String hospitalName;
	
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	public Integer getDeviceId() {
		return deviceId;
	}
	
	public void setDeviceId(Integer deviceId) {
		this.deviceId = deviceId;
	}
	
	public String getUser() {
		return user;
	}
	
	public void setUser(String user) {
		this.user = user;
	}
	
	public String getUserName() {
		return userName;
	}
	
	public void setUserName(String userName) {
		this.userName = userName;
	}
	
	public String getCategoryCode() {
		return categoryCode;
	}
	
	public void setCategoryCode(String categoryCode) {
		this.categoryCode = categoryCode;
	}
	
	public String getDeviceName() {
		return deviceName;
	}
	
	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}
	
	public String getDeviceSn() {
		return deviceSn;
	}
	
	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}
	
	public String getSim() {
		return sim;
	}
	
	public void setSim(String sim) {
		this.sim = sim;
	}
	
	public String getUserType() {
		return userType;
	}
	
	public void setUserType(String userType) {
		this.userType = userType;
	}
	
	public String getUserIdcard() {
		return userIdcard;
	}
	
	public void setUserIdcard(String userIdcard) {
		this.userIdcard = userIdcard;
	}
	
	public Date getCzrq() {
		return czrq;
	}
	
	public void setCzrq(Date czrq) {
		this.czrq = czrq;
	}
	
	public String getDoctor() {
		return doctor;
	}
	
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	
	public String getDoctorName() {
		return doctorName;
	}
	
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	
	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;
	}
}

+ 21 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/doctor/DoctorService.java

@ -0,0 +1,21 @@
package com.yihu.wlyy.service.doctor;
import com.yihu.wlyy.entity.Doctor;
import com.yihu.wlyy.repository.DoctorDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author huangwenjie
 * @date 2018/1/24 16:20
 */
@Service
public class DoctorService {
	
	@Autowired
	private DoctorDao doctorDao;
	
	public Doctor findDoctorByCode(String code) {
		return doctorDao.findByCode(code);
	}
}

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

@ -1,8 +1,7 @@
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.entity.DeviceHealthIndexExportVO;
import com.yihu.wlyy.device.repository.DeviceHealthIndexDao;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.repository.PatientDao;
@ -94,8 +93,8 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
       return patientDao.findByCode(patientCode);
    }
	
	public List<DeviceHealthIndexVO> exportDeviceHealthIndexList(String town, String hospital) {
        List<DeviceHealthIndexVO> list = new ArrayList<>();
	public List<DeviceHealthIndexExportVO> exportDeviceHealthIndexList(String town, String hospital) {
        List<DeviceHealthIndexExportVO> list = new ArrayList<>();
        String sql  = "SELECT " +
                "s.patient," +
                "s.`name`," +
@ -107,7 +106,7 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
                "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));
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexExportVO.class));
        return list ;
	}
}

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

@ -1,12 +1,11 @@
package com.yihu.wlyy.service.manager.device;
import com.yihu.wlyy.device.entity.PatientDeviceVO;
import com.yihu.wlyy.device.entity.PatientDeviceExportVO;
import com.yihu.wlyy.device.entity.WlyyPatientDeviceVO;
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;
@ -18,7 +17,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -89,8 +87,8 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
     * @param hospital
     * @return
     */
	public List<PatientDeviceVO> exportPatientDeviceList(String town, String hospital) {
        List<PatientDeviceVO> list = new ArrayList<>();
	public List<PatientDeviceExportVO> exportPatientDeviceList(String town, String hospital) {
        List<PatientDeviceExportVO> list = new ArrayList<>();
        String sql  = "SELECT s.patient," +
                "s.`name`," +
                "s.mobile," +
@ -103,7 +101,132 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
                "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));
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientDeviceExportVO.class));
        return list ;
	}
    
    /*=
     * 根据社区或者医生名称查找居民设备绑定详情
     *
     * @param deviceName
     * @param categoryCode
     * @param deviceSn
     * @param userName
     * @param doctorName
     * @param hospital
     * @param page
     * @param pageSize
     * @return
     * @throws Exception
     */
	public List<WlyyPatientDeviceVO> searchListNew(String deviceName,
                                                   String categoryCode,
                                                   String deviceSn,
                                                   String userName,
                                                   String doctorName,
                                                   String hospitalName,
                                                   String hospitalCode,
                                                   Integer page, Integer pageSize) throws Exception{
        
        List<WlyyPatientDeviceVO> list = new ArrayList<>();
        String sql  = "SELECT s.patient," +
                "d.id as id," +
                "d.device_id as deviceId," +
                "d.user as user," +
                "p.name as userName," +
                "d.category_code as categoryCode," +
                "d.device_name as deviceName," +
                "d.device_sn as deviceSn," +
                "d.sim as sim," +
                "d.user_type as userType," +
                "s.mobile," +
                "CONCAT(LEFT (s.idcard,6),'**********',RIGHT (s.idcard,2)) userIdcard," +
                "s.doctor_name as doctorName," +
                "s.doctor as doctor," +
                "d.czrq as czrq," +
                "s.hospital_name as hospitalName," +
                "s.hospital as hospital " +
                "FROM " +
                "wlyy_sign_family s," +
                "wlyy_patient_device d," +
                "wlyy_patient p " +
                "WHERE s.patient=d.`user` ";
        if(StringUtils.isNotBlank(hospitalName)){
            sql = sql + "AND s.hospital_name like '%"+hospitalName+"%' ";
        }
        
        if(StringUtils.isNotBlank(hospitalCode)){
            sql = sql + "AND s.hospital = '"+hospitalCode+"' ";
        }
        
        if(StringUtils.isNotBlank(doctorName)){
            sql = sql + "AND s.doctor_name like '%"+doctorName+"%' ";
        }
        
        if(StringUtils.isNotBlank(userName)){
            sql = sql + "AND p.name like '%"+userName+"%' ";
        }
        
        if(StringUtils.isNotBlank(deviceSn)){
            sql = sql + "AND d.device_sn like '%"+deviceSn+"%' ";
        }
        
        if(StringUtils.isNotBlank(categoryCode)){
            sql = sql + "AND d.category_code like '%"+categoryCode+"%' ";
        }
        
        if(StringUtils.isNotBlank(deviceName)){
            sql = sql + "AND d.device_name like '%"+deviceName+"%' ";
        }
        
        sql = sql +"AND s.`status`> 0 AND s.patient=p.CODE " +
                "ORDER BY czrq DESC ";
        
        sql = sql+" limit " + (page-1)*pageSize+", "+pageSize;
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WlyyPatientDeviceVO.class));
        return list ;
	}
    
    public Long getCountSearchListNew(String deviceName, String categoryCode, String deviceSn, String userName, String doctorName, String hospitalName,String hospitalCode) {
    
        String sql  = "SELECT count(d.id)" +
                "FROM " +
                "wlyy_sign_family s," +
                "wlyy_patient_device d," +
                "wlyy_patient p " +
                "WHERE s.patient=d.`user` ";
        if(StringUtils.isNotBlank(hospitalName)){
            sql = sql + "AND s.hospital like '%"+hospitalName+"%' ";
        }
    
        if(StringUtils.isNotBlank(hospitalCode)){
            sql = sql + "AND s.hospital = '"+hospitalCode+"' ";
        }
    
        if(StringUtils.isNotBlank(doctorName)){
            sql = sql + "AND s.doctor_name like '%"+userName+"%' ";
        }
    
        if(StringUtils.isNotBlank(userName)){
            sql = sql + "AND p.name like '%"+doctorName+"%' ";
        }
    
        if(StringUtils.isNotBlank(deviceSn)){
            sql = sql + "AND d.device_sn like '%"+deviceSn+"%' ";
        }
    
        if(StringUtils.isNotBlank(categoryCode)){
            sql = sql + "AND d.category_code like '%"+categoryCode+"%' ";
        }
    
        if(StringUtils.isNotBlank(deviceName)){
            sql = sql + "AND d.device_name like '%"+deviceName+"%' ";
        }
    
        sql = sql +"AND s.`status`> 0 AND s.patient=p.CODE ";
    
        Long total = jdbcTemplate.queryForObject(sql, Long.class);
    
        return total ;
    }
}

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

@ -167,7 +167,7 @@ public class PrescriptionService {
		
		if(ispage){
			page = page-1;
			prescriptionsql = prescriptionsql +" limit " + page*pageSize+", "+(page+1)*pageSize;
			prescriptionsql = prescriptionsql +" limit " + page*pageSize+", "+pageSize;
		}
		
		list =  jdbcTemplate.query(prescriptionsql,new BeanPropertyRowMapper(PrescriptionVO.class));

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

@ -17,6 +17,10 @@
	<!-- 检索条件 -->
	<div class="m-retrieve-area f-h50 f-dn f-pr m-form-inline" data-role-form style='display: block;'>
		<div class="m-form-group f-mt10">
			<div class="m-form-control f-ml15">
				<input type="hidden" id="inp_hospital_code"value='${hospitalCode}' data-attr-scan="hospitalCode">
				<input type="text" id="inp_hospital_name" placeholder="请输入机构名称" class="f-ml10" data-attr-scan="hospitalName"/>
			</div>
			<div class="m-form-control f-ml15">
				<input type="text" id="inp_device_name" placeholder="请输入设备名称" class="f-ml10" data-attr-scan="deviceName"/>
			</div>
@ -29,10 +33,13 @@
			<div class="m-form-control f-ml15">
				<input type="text" id="inp_user_name" placeholder="请输入居民姓名" class="f-ml10" data-attr-scan="userName"/>
			</div>
			<sec:authorize url="/admin/patientDevice/list">
			<div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
				<span>查询</span>
			<div class="m-form-control f-ml15">
				<input type="text" id="inp_doctor_name" placeholder="请输入医生姓名" class="f-ml10" data-attr-scan="doctorName"/>
			</div>
			<sec:authorize url="/admin/patientDevice/list">
				<div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >
					<span>查询</span>
				</div>
			</sec:authorize>
		</div>
	</div>

+ 14 - 6
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list_js.jsp

@ -34,12 +34,18 @@
				$categoryCode: $("#inp_categoryCode"),//设备类型
				$deviceCode: $("#inp_device_code"),
				$userName: $("#inp_user_name"),//人员姓名
                $doctorName: $("#inp_doctor_name"),//医生姓名
                $hosiptalName: $("#inp_hospital_name"),//社区名称
                $hosiptalCode: $("#hospitalCode"),//社区CODE
				init: function () {
					this.$element.show();
					this.$element.attrScan();
					window.form = this.$element;
					this.$deviceName.ligerTextBox({width: 200});
					this.$deviceCode.ligerTextBox({width: 200});
					this.$deviceName.ligerTextBox({width: 150});
					this.$deviceCode.ligerTextBox({width: 150});
					this.$userName.ligerTextBox({width: 150});
					this.$hosiptalName.ligerTextBox({width: 150});
					this.$doctorName.ligerTextBox({width: 150});
					this.typeBox = this.$categoryCode.ligerComboBox({
						width: 150,
						data: [
@ -74,7 +80,7 @@
							{display: 'ID', name: 'id', hide: true},
							{display: '设备名称', name: 'deviceName', width: '15%', align: "left"},
							{
								display: '设备类型', name: 'categoryCode', width: '10%', align: "left",
								display: '类型', name: 'categoryCode', width: '5%', align: "left",
								render: function (row) {
									if (row.categoryCode == 1) {
										return "血糖仪"
@ -85,9 +91,11 @@
									return ""
								}
							},
							{display: '设备SN码', name: 'deviceSn', width: '10%', align: "left"},
							{display: '设备sim码', name: 'sim', width: '10%', align: "left"},
							{display: '居民姓名', name: 'userName', width: '10%', align: "center"},
							{display: 'SN码', name: 'deviceSn', width: '10%', align: "left"},
							{display: 'SIM码', name: 'sim', width: '5%', align: "left"},
                            {display: '社区', name: 'hospitalName', width: '10%', align: "left"},
                            {display: '医生', name: 'doctorName', width: '5%', align: "left"},
							{display: '居民姓名', name: 'userName', width: '5%', align: "center"},
							{
								display: '绑定按键', name: 'userType', width: '10%', align: "center",
								render: function (row) {

+ 9 - 9
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/GuahaoController.java

@ -285,9 +285,9 @@ public class GuahaoController {
	@RequestMapping(value = "/imm/GetOrgNumberList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:获取免疫接种号源")
	public Result GetOrgNumberList(@ApiParam(name="orgId",value="机构编码",defaultValue = "")
	public Result GetOrgNumberList(@ApiParam(name="orgId",value="机构编码",defaultValue = "350206")
	                               @RequestParam String orgId,
	                               @ApiParam(name="ScheduleId",value="排班ID",defaultValue = "")
	                               @ApiParam(name="ScheduleId",value="排班ID",defaultValue = "350211B10402017080901")
	                               @RequestParam String ScheduleId)
	{
		try {
@ -304,16 +304,16 @@ public class GuahaoController {
	@RequestMapping(value = "/imm/GetOrgScheduleList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:获取免疫接种排班信息")
	public Result GetOrgScheduleList(@ApiParam(name="OrgCode",value="机构编码",defaultValue = "")
	public Result GetOrgScheduleList(@ApiParam(name="OrgCode",value="机构编码",defaultValue = "350211B1040")
	                               @RequestParam String OrgCode,
	                               @ApiParam(name="strStart",value="开始日期",defaultValue = "")
	                               @RequestParam String strStart,
	                               @ApiParam(name="strEnd",value="结束日期",defaultValue = "")
	                               @RequestParam String strEnd)
	                               @ApiParam(name="StartTime",value="开始日期",defaultValue = "2017-08-09")
	                               @RequestParam String StartTime,
	                               @ApiParam(name="EndTime",value="结束日期",defaultValue = "2017-08-10")
	                               @RequestParam String EndTime)
	{
		try {
			
			String data = guahaoService.GetOrgScheduleList(OrgCode,strStart,strEnd);
			String data = guahaoService.GetOrgScheduleList(OrgCode,StartTime,EndTime);
			
			return Result.success("获取免疫接种排班信息!",data);
		} catch (Exception ex) {
@ -325,7 +325,7 @@ public class GuahaoController {
	@RequestMapping(value = "/imm/GetOrgScheduleAndNumberList",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:获取免疫接种排班信息和号源信息")
	public Result GetOrgScheduleAndNumberList(@ApiParam(name="OrgCode",value="条形编码",defaultValue = "")
	public Result GetOrgScheduleAndNumberList(@ApiParam(name="OrgCode",value="机构编码",defaultValue = "")
	                                          @RequestParam String OrgCode)
	{
		try {

+ 30 - 51
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/guahao/GuahaoService.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.service.guahao;
import cn.com.zoe.crypto.jna.CryptoKey;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -85,6 +86,12 @@ public class GuahaoService {
    
    @Value("${zyapi.openCrypto}")
    private Boolean openCrypto;
    
    @Value("${imm.url}")
    private String immUrl;
    
    @Value("${imm.credential}")
    private String immcredential;
    /**
     * 解析挂号后
@ -1179,10 +1186,11 @@ public class GuahaoService {
        String re = "";
    
        ZysoftApi api = ZysoftApi.getSingleton();
        CryptoKey key = api.buildCryptoKey();
        if(!params.containsKey("Credential")&&!params.containsKey("Key")) {
            //strCredential和strKey设置
            params.put("Credential", api.getCryptoCredential());
            params.put("Key", api.getCryptoKey());
            params.put("Credential", api.encodeParam(key,immcredential));
            params.put("Key", key.getKey());
        }
        
        String msgBody = net.sf.json.JSONObject.fromObject(params).toString();
@ -1194,14 +1202,15 @@ public class GuahaoService {
        
        int times = 0;
        try {
            re = api.post("imm/"+apistr, params, null,false);
//            re = api.post("jhmy/"+apistr, params, null,false);
            re = api.post(immUrl+"/"+apistr, params, null,false);
    
            //---结果验证,并保存日志 ---START
            if (StringUtils.isEmpty(re)) {
                // 请求失败
                //保存http日志
                logService.saveHttpLog(isSuccess,apistr,content,method,apistr,net.sf.json.JSONObject.fromObject(params).toString(),re,error);
                throw new Exception(error);
                logService.saveHttpLog(isSuccess,apistr,content,method,apistr,net.sf.json.JSONObject.fromObject(params).toString(),re,"接口返回的结果为空");
                throw new Exception("接口返回的结果为空");
            } else if (StringUtils.startsWith(re, "System-Error")) {
                // 调用失败
                //保存http日志
@ -1288,8 +1297,14 @@ public class GuahaoService {
        params.put("BarCode", credential);
        result = immPostSecond("GetChildrenInfo","计免预约-获取儿童信息成功",params);
    
        if (StringUtils.startsWith(result, "OK")) {
            // 调用失败
            //保存http日志
            result = result.substring(result.indexOf(":") + 1, result.length());
        }
    
        com.alibaba.fastjson.JSONObject data = com.alibaba.fastjson.JSONObject.parseObject(result);
        
    
        if(data.containsKey("OK")){
            result = data.getString("OK");
        }
@ -1308,51 +1323,15 @@ public class GuahaoService {
        String condition = "<root><zone>350203</zone><zone>350206</zone><zone>350205</zone><zone>350211</zone><zone>350212</zone><zone>350213</zone></root>";
        String[] values = SOAPUtil.getCredential(condition, true);
//        System.out.println(condition);
        params.put("Condition", values[0]);
        params.put("Credential", values[1]);
        params.put("Key", values[2]);
    
        ZysoftApi api =  ZysoftApi.getSingleton();
        CryptoKey key = api.buildCryptoKey();
        params.put("Condition", api.encodeParam(key,condition));
        params.put("Credential", api.encodeParam(key,immcredential));
        params.put("Key", key.getKey());
        return immPostSecond("GetOrgImmuneList","计免预约-获取免疫接种机构列表",params);
    }
    public static byte[] encrypt(byte[] data, PublicKey publicKey) throws Exception{
        Cipher cipher=Cipher.getInstance("RSA");//java默认"RSA"="RSA/ECB/PKCS1Padding"
        cipher.init(Cipher.ENCRYPT_MODE, publicKey);
        int inputLen = data.length;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int offSet = 0;
        byte[] cache;
        int i = 0;
        // 对数据分段加密
        while (inputLen - offSet > 0) {
            if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
                cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);
            } else {
                cache = cipher.doFinal(data, offSet, inputLen - offSet);
            }
            out.write(cache, 0, cache.length);
            i++;
            offSet = i * MAX_ENCRYPT_BLOCK;
        }
        byte[] encryptedData = out.toByteArray();
        out.close();
        return encryptedData;
    }
    public PublicKey immPublicKeyget(String filename) throws Exception {
        File f = new File(filename);
        FileInputStream fis = new FileInputStream(f);
        DataInputStream dis = new DataInputStream(fis);
        byte[] keyBytes = new byte[(int)f.length()];
        dis.readFully(keyBytes);
        dis.close();
        X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
        KeyFactory kf = KeyFactory.getInstance("RSA");
        return kf.generatePublic(spec);
    }
    
    
    
    /**
     * 获取免疫接种号源
     * @param orgId 机构编码
@ -1362,7 +1341,7 @@ public class GuahaoService {
    public String GetOrgNumberList(String orgId, String scheduleId) throws Exception  {
        String result = "";
        Map<String,String> params = new HashMap<>();
        params.put("orgId", orgId);
        params.put("OrgId", orgId);
        params.put("ScheduleId", scheduleId);
        return immPostSecond("GetOrgNumberList","计免预约-获取免疫接种号源",params);
    }
@ -1379,8 +1358,8 @@ public class GuahaoService {
        String result = "";
        Map<String,String> params = new HashMap<>();
        params.put("OrgCode", orgCode);
        params.put("strStart", strStart);
        params.put("strEnd", strEnd);
        params.put("StartTime", strStart);
        params.put("EndTime", strEnd);
        return immPostSecond("GetOrgScheduleList","计免预约-获取免疫接种排班信息",params);
    }
    

+ 16 - 0
patient-co-service/wlyy_service/src/main/resources/application.yml

@ -75,6 +75,10 @@ spring:
im:
  data_base_name: im_new
imm:
  url: imm
  credential: <root><org code="jkzl" /><visitor type="0" code="jkzl" key="jkzl" /></root>
zyapi:
  openCrypto: false
#    i健康项目地址
@ -99,6 +103,10 @@ spring:
im:
  data_base_name: im_new
imm:
  url: imm
  credential: <root><org code="jkzl" /><visitor type="0" code="jkzl" key="jkzl" /></root>
zyapi:
  openCrypto: false
#    i健康项目地址
@ -122,6 +130,10 @@ spring:
im:
  data_base_name: im_new
imm:
  url: imm
  credential: <root><org code="jkzl" /><visitor type="0" code="jkzl" key="jkzl" /></root>
zyapi:
  openCrypto: false
#    i健康项目地址
@ -145,6 +157,10 @@ spring:
im:
  data_base_name: im
imm:
    url: jhmy
    credential: <root><org code="jtqy" /><visitor type="0" code="jtqy" key="jtqy" /></root>
zyapi:
  openCrypto: true
#    i健康项目地址

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java

@ -58,8 +58,8 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +
            " AND b.del = 1 AND b.creater = ?1  AND b.teamId = ?2 AND b.title LIKE ?3 order by b.useTimes desc ,b.createTime desc ")
    List<DoctorTeamGuidanceTemplate> countTeamListByTile(String doctor, int teamId, String title);
            " AND b.del = 1 AND b.teamId = ?1 AND b.title LIKE ?2 order by b.useTimes desc ,b.createTime desc ")
    List<DoctorTeamGuidanceTemplate> countTeamListByTile(int teamId, String title);
    // 根据模板文章标题模糊搜索团队指导模板
    @Query("SELECT b FROM DoctorTeamGuidanceDetail a, DoctorTeamGuidanceTemplate b WHERE a.code = b.teamTemplateCode  " +

+ 12 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -1052,13 +1052,15 @@ public class SignWebService extends BaseService {
        String reservation_sql = "select w.code,w.id, w.doctor_name,w.doctor_code,w.doctor_job,w.doctor,w.dname,w.org_code,w.status,w.start_time as czrq,3 as type from wlyy_patient_reservation  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        //获取健康教育
//        String article_sql = "select w.id,w.article,w2.title,w2.summary,w.czrq,w.doctor,w.doctor_name,w.is_read,4 as type from wlyy_health_edu_article_patient  w,wlyy_health_edu_article w2 where w.article = w2.code and  (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
        Date startTime = DateUtil.getBeginDayOfYear();
        Date endTime = DateUtil.getEndDayOfYear();
        String startDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTime);
        String endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(endTime);
        String start = elasticsearchUtil.changeTime(startDate);
        String end = elasticsearchUtil.changeTime(endDate);
        String article_sql = "SELECT id,articleId as article,articleTitle as title,createTime as czrq,doctorCode as doctor,doctorName as doctor_name,isRead as is_read,articleContent as content FROM "+esIndex+" where userType='1' and patientCode='"+patient+"' and (doctorCode='"+doctorHealth+"' or doctorCode='"+doctor+"') and createTime>='"+start+"' and createTime<='"+end+"'";
//        Date startTime = DateUtil.getBeginDayOfYear();
//        Date endTime = DateUtil.getEndDayOfYear();
        String yearBegin = DateUtil.dateToStrShort(signFamily.getBegin()) + " 00:00:00";
        String yearEnd = DateUtil.dateToStrShort(signFamily.getEnd()) + " 23:59:59";
//        String startDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(startTime);
//        String endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(endTime);
        String start = elasticsearchUtil.changeTime(yearBegin);
        String end = elasticsearchUtil.changeTime(yearEnd);
        String article_sql = "SELECT id,articleId as article,articleTitle as title,createTime as czrq,doctorCode as doctor,doctorName as doctor_name,isRead as is_read,articleContent as content FROM "+esIndex+" where userType='1' and patientCode='"+patient+"' and (doctorCode='"+doctorHealth+"' or doctorCode='"+doctor+"') and createTime>='"+start+"' and createTime<'"+end+"'";
        //获取健康指导
        String guidance_sql = "select w.id,w.doctor,w.content,w.czrq,w.read_status,5 as type  from wlyy_patient_health_guidance  w where (w.doctor = ? or w.doctor =?) and w.patient =? and YEAR(w.czrq) = ? ";
@ -1076,10 +1078,12 @@ public class SignWebService extends BaseService {
//        List<HealthEduArticleES> esList = elasticsearchUtil.excute(article_sql, HealthEduArticleES.class, esIndex, esType);
        List<Map<String, Object>> articleResult = elasticsearchUtil.excuteDataModel(article_sql);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String str = null;
        for(Map<String, Object> map :articleResult){
            map.put("type","4");
            map.put("czrq",map.get("czrq")!=null?simpleDateFormat.format(new Date(((Long)map.get("czrq")).longValue())):"");
            map.put("summary",map.get("content")!=null?(map.get("content").toString().length()>40?map.get("content").toString().substring(0,40):map.get("content").toString()):"");
            str = map.get("content")!=null?map.get("content").toString().replaceAll("</?[^>]+>", ""):null;
            map.put("summary",str!=null?(str.length()>40?str.substring(0,40):str):"");
        }
        //健康指导量
        List<Map<String, Object>> guidanceResult = jdbcTemplate.queryForList(guidance_sql, new Object[]{doctorHealth, doctor, patient, year});

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/ServiceStatisticsService.java

@ -99,7 +99,7 @@ public class ServiceStatisticsService extends BaseService {
        JSONObject guidance = getGuidanceStatistics(patient, teamCode, yearBegin, yearEnd, monthBegin);
        result.put("guidance", guidance);
        JSONObject article = getArticleStatistics(patient, teamCode, yearBegin, yearEnd, monthBegin);
        JSONObject article = getArticleStatistics(patient, teamCode, DateUtil.dateToStrShort(signFamily.getBegin()), DateUtil.dateToStrShort(signFamily.getEnd()), DateUtil.dateToStrShort(today.getTime()));
        result.put("article", article);
        return result;
@ -176,8 +176,8 @@ public class ServiceStatisticsService extends BaseService {
        //数据转移至Es
        String sqlHistory="select count(*) AS h from " + esType + " where patientCode='" + patient + "' and adminTeamCode = '"+teamCode+"'";
        String sqlYear = "select count(*) AS y from "+esType+" where patientCode='" + patient + "' and adminTeamCode = '"+teamCode+"' and czrq >= "+changeDate(yearBegin)+" and czrq <= "+changeDate(yearEnd);
        String sqlMonth = "select count(*) AS m from "+esType+" where patientCode='" + patient + "' and adminTeamCode = '"+teamCode+"' and czrq >= "+changeDate(monthBegin);
        String sqlYear = "select count(*) AS y from "+esType+" where patientCode='" + patient + "' and adminTeamCode = '"+teamCode+"' and createTime >= '"+changeDate(yearBegin)+"' and createTime <= '"+changeDate(yearEnd)+"'";
        String sqlMonth = "select count(*) AS m from "+esType+" where patientCode='" + patient + "' and adminTeamCode = '"+teamCode+"' and createTime >= '"+changeDate(monthBegin)+"'";
        result.put("history", elasticsearchUtil.excuteForLong(sqlHistory,esType,esIndex));
        result.put("year", elasticsearchUtil.excuteForLong(sqlYear,esType,esIndex));

+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -5122,4 +5122,24 @@ public class StatisticsESService {
        return new JSONArray(resultList);
    }
    /**
     * 查询截止某个日期累计量
     *
     * @param endDate     截止日期
     * @param area        区域或机构代码
     * @param level       级别
     * @param level2_type level2_type的类型
     * @return
     */
    public long getArticleTotal(String endDate, String area, int level, String index, String level2_type) throws Exception {
        SaveModel saveModel = null;
        if (StringUtils.isNotEmpty(level2_type)) {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel1(endDate, area, level, index, SaveModel.timeLevel_DDL, level2_type);
        } else {
            saveModel = elasticsearchUtil.findOneDateQuotaLevel0(endDate, area, level, index, SaveModel.timeLevel_DDL);
        }
        return saveModel.getResult2().longValue();
    }
}

+ 13 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -114,7 +114,7 @@ public class JMJkEduArticleService extends BaseService {
//        }
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  doctorCode='" + sendCode + "' and userType = 2");
                " where  doctorCode='" + sendCode + "' and userType = 2 and currentUserRoleCode='"+currentUserRole+"' and sendType="+sendType);
//        if(sendType==1){
//
//            sql2.append(" and sendType='"+sendType+"' ");
@ -155,7 +155,7 @@ public class JMJkEduArticleService extends BaseService {
        for (HealthEduArticleES one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"","");
//            if (result.get(one.getArticleId()) != null) {
//                heapm = result.get(one.getArticleId());
//
@ -254,7 +254,7 @@ public class JMJkEduArticleService extends BaseService {
                                                              String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  doctorCode='" + sendCode + "' and userType = 2" );
                " where  doctorCode='" + sendCode + "' and userType = 2 and currentUserRoleCode='"+currentUserRole+"' and sendType="+sendType );
//        if(sendType==1){
//
//            sql2.append(" and sendType='"+sendType+"' ");
@ -383,7 +383,7 @@ public class JMJkEduArticleService extends BaseService {
            roleVo.setCode(ones.getCode());
            roleVoLists.add(roleVo);
        }
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"","");
        Date createTime = new Date();
        for (String patient : patientSet) {
@ -416,6 +416,10 @@ public class JMJkEduArticleService extends BaseService {
            }else{
                List<Object> results = teamDao.findAdminTeamByPatientSignTeam(patient, new PageRequest(0, 1));
                //没有签约的团队的患者不推送
                if(results.size()<=0){
                    continue;
                }
                Object[] result = (Object[]) results.get(0);
                healthEduArticleES.setAdminTeamName(result[1].toString());
                healthEduArticleES.setAdminTeamCode(Long.parseLong(result[0].toString()));
@ -464,7 +468,7 @@ public class JMJkEduArticleService extends BaseService {
        return healthEduArticleESList;
    }
    public JSONObject pushArticleConfirm(String articleId, String labelUnit, String labelSex, String labelServe, String labelDisease, String labelHealth,String userCode,String currentUserRole, String currentUserRoleLevel) throws Exception {
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"","");
        Set<String> patientSet = new HashSet<>();
        initPatient(patientSet, labelUnit, labelSex, labelServe, labelDisease, labelHealth,userCode,currentUserRole,currentUserRoleLevel);
        long num = patientSet.size();
@ -697,7 +701,7 @@ public class JMJkEduArticleService extends BaseService {
    }
    public JSONObject pushArticleConfirm(String userCode,String[] groups,String group,String labelType,long teamCode,String[] patients,String articleId) throws Exception{
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"","");
        Set<String> patientSet = new HashSet<>();
        initPatients(userCode,groups,group,labelType,teamCode,patients,patientSet);
        long num = patientSet.size();
@ -862,7 +866,7 @@ public class JMJkEduArticleService extends BaseService {
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        for (HealthEduArticleES one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"","");
            heapm = new HealthEduArticlePatientModel();
            heapm.setSendName(one.getSendName());
            heapm.setSendCode(one.getDoctorCode());
@ -915,7 +919,7 @@ public class JMJkEduArticleService extends BaseService {
                            String opertorRoleLevel,Integer userScope,String articleId,Integer roleType) throws Exception {
        if(!StringUtils.isEmpty(articleId)){
            JSONObject obj = thirdJkEduArticleService.getArticalById(articleId,null);
            JSONObject obj = thirdJkEduArticleService.getArticalById(articleId,null,"");
            if(!StringUtils.isEmpty(image)&&!(obj.get("articleCover")+"").equals(image)){
                image = commonUtil.copyTempImage(image);
            };
@ -1124,7 +1128,7 @@ public class JMJkEduArticleService extends BaseService {
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        for (HealthEduArticleES one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"","");
            heapm = new HealthEduArticlePatientModel();
            heapm.setSendName(one.getSendName());
            heapm.setSendCode(one.getDoctorCode());

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -66,7 +66,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param content
     * @param images
     */
    public void saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images) throws Exception {
    public String saveTeamGuidance(String doctor, String title, JSONArray teams, String content, String images) throws Exception {
        String templateCode = getCode();
        Date nowDate = new Date();
        String image = "";
@ -113,6 +113,7 @@ public class DoctorTeamGuidanceService extends BaseService {
        doctorTeamGuidanceDetailDao.save(doctorTeamGuidanceDetail);
        return templateCode;
    }
    /**
@ -316,7 +317,7 @@ public class DoctorTeamGuidanceService extends BaseService {
                map.put("teamId", teamId);
                if (StringUtils.isNotEmpty(filter)){
                    List<DoctorTeamGuidanceTemplate> guidances = doctorTeamGuidanceTemplateDao.countTeamListByTile(doctorCode,Integer.valueOf(teamId.toString()),"%"+filter+"%");
                    List<DoctorTeamGuidanceTemplate> guidances = doctorTeamGuidanceTemplateDao.countTeamListByTile(Integer.valueOf(teamId.toString()),"%"+filter+"%");
                    map.put("amount", guidances.size());
                }else {
                    List<DoctorTeamGuidanceTemplate> listGuidances = doctorTeamGuidanceTemplateDao.countGuidanceByTeamId(Integer.valueOf(teamId.toString()));

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java

@ -368,13 +368,14 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param articleId 文章id
     * @return
     */
    public JSONObject getArticalById(String articleId,String userId) throws Exception {
    public JSONObject getArticalById(String articleId,String userId,String userType) throws Exception {
        JSONObject re = new JSONObject();
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("userId", userId);
            param.put("userType", userType);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalById, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorFamilyContractController.java

@ -958,6 +958,8 @@ public class DoctorFamilyContractController extends WeixinBaseController {
                json.put("diseaseLevel", temp.getDiseaseCondition());
                // 设置患者身份证号
                json.put("idCard", temp.getIdcard());
                //1.4.2新增医疗保险号
                json.put("medicareNumber", temp.getMedicareNumber()==null?"":temp.getMedicareNumber());
                // 设置患者出生年月
                json.put("birthday", DateUtil.dateToStr(temp.getBirthday(), DateUtil.YYYY_MM_DD));
                // 设置患者手机号码

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempController.java

@ -75,7 +75,7 @@ public class DoctorGuidanceTempController extends BaseController {
            DoctorGuidanceTemp temp = guidanceTempService.add(getUID(), content, modelName, imagesUrl);
            if (temp != null) {
                return write(200, "添加成功");
                return write(200, "添加成功","modelCode",temp.getCode());
            } else {
                return write(-1, "添加失败");
            }

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -128,8 +128,8 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
//            前端参数校验
            String doctor = getUID();
            JSONArray teams = new JSONArray(teamInfo);
            doctorTeamGuidanceService.saveTeamGuidance(doctor, title, teams, content, images);
            return write(200, "保存团队模板成功!");
            String guidanceCode = doctorTeamGuidanceService.saveTeamGuidance(doctor, title, teams, content, images);
            return write(200, "保存团队模板成功!","guidanceCode",guidanceCode);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
        }

+ 36 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -2128,4 +2128,40 @@ public class EsStatisticsController extends BaseController {
            return error(-1, "查询失败");
        }
    }
    /**
     * 健康文章算到达量
     *
     * @param endDate     结束时间 1
     * @param area        父code
     * @param level       等级  1 团队,2 机构,3 区,4 市
     * @param index       指标代码 3 4 5 27
     * @param level2_type 指标代码 例如性别 1 男 2 女  不传就返回男和女的总和
     * @return
     */
    @RequestMapping("/article_total")
    @ResponseBody
    public String getArticleTotal(
//            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = false) String level2_type) {
        try {
            //新版与旧版统计适配
            level = elasticsearchUtil.changeLevel(level);
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
            for (String idx : indexes) {
                result.put("index_" + idx, statisticsESService.getArticleTotal(endDate, area, level, idx, level2_type));
            }
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java

@ -250,7 +250,7 @@ public class GcEduArticleService {
        //通过文章id 获取文章详情
        JSONObject article = healthEducationArticleService.getArticalById(articleId,"");
        JSONObject article = healthEducationArticleService.getArticalById(articleId,"","");
        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");

+ 21 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -121,7 +121,13 @@ public class ThirdJkEduArticleController extends BaseController {
                                 @ApiParam(name = "userType", value = "用户类型:1医生,2居民",defaultValue = "1")
                                 @RequestParam(value = "userType", required = false) String userType){
        try {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getUID());
            String uid = "";
            if("2".equals(userType)){
                uid = getRepUID();
            }else{
                uid = getUID();
            }
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,uid,userType);
            if("2".equals(userType)){
                jmJkEduArticleService.readPatientArticle(getRepUID(),articleId);
@ -143,7 +149,13 @@ public class ThirdJkEduArticleController extends BaseController {
                                          @RequestParam(value = "userType", required = true) Integer userType
                                          ){
        try {
            thirdJkEduArticleService.cancelArticleCollection(articleId,getRepUID(),userType);
            String uid = "";
            if("2".equals(userType)){
                uid = getRepUID();
            }else{
                uid = getUID();
            }
            thirdJkEduArticleService.cancelArticleCollection(articleId,uid,userType);
//            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return success("取消成功!");
        }catch (Exception e){
@ -164,7 +176,13 @@ public class ThirdJkEduArticleController extends BaseController {
                                        @ApiParam(name = "userType", value = "用户类型:1医生,2居民",defaultValue = "1")
                                            @RequestParam(value = "userType", required = true) Integer userType){
        try {
            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getRepUID(),userType);
            String uid = "";
            if("2".equals(userType)){
                uid = getRepUID();
            }else{
                uid = getUID();
            }
            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,uid,userType);
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
            return success("收藏成功!");

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/service/EduArticleService.java

@ -1145,7 +1145,7 @@ public class EduArticleService {
            } else {
                healthEduArticleES.setCurrentUserRoleLevel("4");
            }
            healthEduArticleES.setCreateTime(new Date());
            healthEduArticleES.setCreateTime(healthEduArticlePatientTemps.get(0).getCzrq());
            healthEduArticleESSaveList.add(healthEduArticleES);
        });

+ 128 - 82
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -91,7 +91,9 @@ public class WeiXinEventProcess {
            result = tempStr.replace("<ArticleCount>5</ArticleCount>", "<ArticleCount>4</ArticleCount>");
        }
        if (message.get("EventKey").equals("jiankangdangan")) {
            result = clickEventProcessMenu(message);
            result = clickEventProcessMenu(message,"jiankangdangan");
        }else if (message.get("EventKey").equals("fuyoubaojian")){
            result = clickEventProcessMenu(message,"fuyoubaojian");
        }
        return result;
    }
@ -194,105 +196,149 @@ public class WeiXinEventProcess {
     * 菜单点击消息发送
     *
     * @param message
     * @param key 微信菜单点击事件key值
     * @return
     * @throws Exception
     */
    private String clickEventProcessMenu(Map<String, String> message) throws Exception {
    private String clickEventProcessMenu(Map<String, String> message,String key) throws Exception {
        String result = "";
        // 配置信息
        Properties systemConf = SystemConf.getInstance().getSystemProperties();
        // 图文信息
        List<Map<String, String>> articles = new ArrayList<>();
        //就诊记录
        Map<String, String> articleVisit = new HashMap<>();
        String visit = systemConf.getProperty("patient_visit_url");
        // 图文消息图片URL
        String visit_pic = systemConf.getProperty("patient_visit_pic");
        // URL设置服务器URL、AppId
        visit = visit.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        visit_pic = visit_pic.replace("{server}", serverUrl);
        articleVisit.put("Url", visit);
        articleVisit.put("Title", "就诊记录");
        articleVisit.put("Description", "就诊记录");
        articleVisit.put("PicUrl", visit_pic);
        articles.add(articleVisit);
        if("jiankangdangan".equals(key)){
            //就诊记录
            Map<String, String> articleVisit = new HashMap<>();
            String visit = systemConf.getProperty("patient_visit_url");
            // 图文消息图片URL
            String visit_pic = systemConf.getProperty("patient_visit_pic");
            // URL设置服务器URL、AppId
            visit = visit.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            visit_pic = visit_pic.replace("{server}", serverUrl);
        //#检查检验
        Map<String, String> articleInspect = new HashMap<>();
        // 图文URL
        String inspect = systemConf.getProperty("patient_inspect_url");
        // 图文消息图片URL
        String inspect_pic = systemConf.getProperty("patient_inspect_pic");
        // URL设置服务器URL、AppId
        inspect = inspect.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        inspect_pic = inspect_pic.replace("{server}", serverUrl);
            articleVisit.put("Url", visit);
            articleVisit.put("Title", "就诊记录");
            articleVisit.put("Description", "就诊记录");
            articleVisit.put("PicUrl", visit_pic);
            articles.add(articleVisit);
        articleInspect.put("Url", inspect);
        articleInspect.put("Title", "检查检验");
        articleInspect.put("Description", "检查检验");
        articleInspect.put("PicUrl", inspect_pic);
        articles.add(articleInspect);
            //#检查检验
            Map<String, String> articleInspect = new HashMap<>();
            // 图文URL
            String inspect = systemConf.getProperty("patient_inspect_url");
            // 图文消息图片URL
            String inspect_pic = systemConf.getProperty("patient_inspect_pic");
            // URL设置服务器URL、AppId
            inspect = inspect.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            inspect_pic = inspect_pic.replace("{server}", serverUrl);
        Map<String, String> articleExamination = new HashMap<>();
        // 图文URL
        String examination = systemConf.getProperty("patient_examination_url");
        // 图文消息图片URL
        String examination_pic = systemConf.getProperty("patient_examination_pic");
        // URL设置服务器URL、AppId
        examination = examination.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        examination_pic = examination_pic.replace("{server}", serverUrl);
            articleInspect.put("Url", inspect);
            articleInspect.put("Title", "检查检验");
            articleInspect.put("Description", "检查检验");
            articleInspect.put("PicUrl", inspect_pic);
            articles.add(articleInspect);
        articleExamination.put("Url", examination);
        articleExamination.put("Title", "社区体检");
        articleExamination.put("Description", "社区体检");
        articleExamination.put("PicUrl", examination_pic);
        articles.add(articleExamination);
            Map<String, String> articleExamination = new HashMap<>();
            // 图文URL
            String examination = systemConf.getProperty("patient_examination_url");
            // 图文消息图片URL
            String examination_pic = systemConf.getProperty("patient_examination_pic");
            // URL设置服务器URL、AppId
            examination = examination.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            examination_pic = examination_pic.replace("{server}", serverUrl);
//        新增处方记录图文消息
        Map<String, String> articlePrescription = new HashMap<>();
        // 图文URL
        String prescription = systemConf.getProperty("patient_prescription_url");
        // 图文消息图片URL
        String prescription_pic = systemConf.getProperty("patient_prescription_pic");
        // URL设置服务器URL、AppId
        prescription = prescription.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        prescription_pic = prescription_pic.replace("{server}", serverUrl);
            articleExamination.put("Url", examination);
            articleExamination.put("Title", "社区体检");
            articleExamination.put("Description", "社区体检");
            articleExamination.put("PicUrl", examination_pic);
            articles.add(articleExamination);
        articlePrescription.put("Url", prescription);
        articlePrescription.put("Title", "处方记录");
        articlePrescription.put("Description", "处方记录");
        articlePrescription.put("PicUrl", prescription_pic);
        articles.add(articlePrescription);
            //        新增处方记录图文消息
            Map<String, String> articlePrescription = new HashMap<>();
            // 图文URL
            String prescription = systemConf.getProperty("patient_prescription_url");
            // 图文消息图片URL
            String prescription_pic = systemConf.getProperty("patient_prescription_pic");
            // URL设置服务器URL、AppId
            prescription = prescription.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            prescription_pic = prescription_pic.replace("{server}", serverUrl);
//        新增居民取药码图文消息 by wjj 2017.08.25
        Map<String, String> articlePatientQRCode = new HashMap<>();
        // 图文URL
        String patientQRCode = systemConf.getProperty("patient_QRCode_url");
        // 图文消息图片URL
        String patientQRCode_pic = systemConf.getProperty("patient_QRCode_pic");
        // URL设置服务器URL、AppId
        patientQRCode = patientQRCode.replace("{server}", wechat_base_url)
                .replace("{appId}", appId);
        //图片地址
        patientQRCode_pic = patientQRCode_pic.replace("{server}", serverUrl);
            articlePrescription.put("Url", prescription);
            articlePrescription.put("Title", "处方记录");
            articlePrescription.put("Description", "处方记录");
            articlePrescription.put("PicUrl", prescription_pic);
            articles.add(articlePrescription);
            //        新增居民取药码图文消息 by wjj 2017.08.25
            Map<String, String> articlePatientQRCode = new HashMap<>();
            // 图文URL
            String patientQRCode = systemConf.getProperty("patient_QRCode_url");
            // 图文消息图片URL
            String patientQRCode_pic = systemConf.getProperty("patient_QRCode_pic");
            // URL设置服务器URL、AppId
            patientQRCode = patientQRCode.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            patientQRCode_pic = patientQRCode_pic.replace("{server}", serverUrl);
        articlePatientQRCode.put("Url", patientQRCode);
        articlePatientQRCode.put("Title", "我的取药码");
        articlePatientQRCode.put("Description", "我的取药码");
        articlePatientQRCode.put("PicUrl", patientQRCode_pic);
        articles.add(articlePatientQRCode);
            articlePatientQRCode.put("Url", patientQRCode);
            articlePatientQRCode.put("Title", "我的取药码");
            articlePatientQRCode.put("Description", "我的取药码");
            articlePatientQRCode.put("PicUrl", patientQRCode_pic);
            articles.add(articlePatientQRCode);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }else if ("fuyoubaojian".equals(key)){
            //        新增产检计划图文消息
            Map<String, String> articlePrenata = new HashMap<>();
            // 图文URL
            String prenata = systemConf.getProperty("patient_prenata_url");
            // 图文消息图片URL
            String prenata_pic = systemConf.getProperty("patient_prenata_pic");
            // URL设置服务器URL、AppId
            prenata = prenata.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            prenata_pic = prenata_pic.replace("{server}", serverUrl);
            articlePrenata.put("Url", prenata);
            articlePrenata.put("Title", "产检计划");
            articlePrenata.put("Description", "产检计划");
            articlePrenata.put("PicUrl", prenata_pic);
            articles.add(articlePrenata);
            //        新增免疫计划图文消息
            Map<String, String> articleImmune = new HashMap<>();
            // 图文URL
            String immune = systemConf.getProperty("patient_immune_url");
            // 图文消息图片URL
            String immune_pic = systemConf.getProperty("patient_immune_pic");
            // URL设置服务器URL、AppId
            immune = immune.replace("{server}", wechat_base_url)
                    .replace("{appId}", appId);
            //图片地址
            immune_pic = immune_pic.replace("{server}", serverUrl);
            articleImmune.put("Url", immune);
            articleImmune.put("Title", "免疫计划");
            articleImmune.put("Description", "免疫计划");
            articleImmune.put("PicUrl", immune_pic);
            articles.add(articleImmune);
            // 构建回复消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }
        // 构建回复消息XML
        result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        return result;
    }

+ 8 - 0
patient-co/patient-co-wlyy/src/main/resources/system.properties

@ -28,6 +28,10 @@ patient_examination_url=https://open.weixin.qq.com/connect/oauth2/authorize?appi
patient_prescription_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fprescription%2fhtml%2fprescription_records.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民取药码
patient_QRCode_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2fprescription%2fhtml%2fmy-medicine-code.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民产检计划
patient_prenata_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2ffybj%2fhtml%2fyunjianjihua.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民免疫计划
patient_immune_url=https://open.weixin.qq.com/connect/oauth2/authorize?appid={appId}&amp;redirect_uri={server}%2fwx%2fhtml%2ffybj%2fhtml%2fmianyijihua.html&amp;response_type=code&amp;scope=snsapi_base&amp;state=STATE#wechat_redirect
#居民wifi图片地址
patient_wifi_pic_url = {server}/images/wifi.png
#居民wifi链接
@ -42,6 +46,10 @@ patient_examination_pic={server}/images/examination.png
patient_prescription_pic={server}/images/prescriptionRecords.png
#居民取药码
patient_QRCode_pic={server}/images/patientQRCode.png
#居民产检计划
patient_prenata_pic={server}/images/patientPrenata.png
#居民免疫计划
patient_immune_pic={server}/images/patientImmune.png
patient_operatinginstrutions_pic_url={server}/images/operatinginstructions.png
patient_booking_pic_url={server}/images/booking.png

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu.txt

@ -50,9 +50,9 @@
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                  },
        {
            "type":"view",
            "name":"孕检计划",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2ffybj%2fhtml%2fyunjianjihua.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
            "type":"click",
            "name":"妇幼保健",
            "key":"fuyoubaojian"
        }
	  ]
   },