Browse Source

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

# Conflicts:
#	patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java
humingfen 7 năm trước cách đây
mục cha
commit
d027923275
72 tập tin đã thay đổi với 2529 bổ sung155 xóa
  1. 11 2
      common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java
  2. 10 10
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SocialSecurityInfo.java
  3. 87 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/template/DoctorGuidanceTempLabel.java
  4. 19 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/template/DoctorTeamGuidanceTemplate.java
  5. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class
  6. BIN
      edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class
  7. 4 1
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  8. 3 0
      edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java
  9. 0 0
      error
  10. 2 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java
  11. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/BaseController.java
  12. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/LoginController.java
  13. 115 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/IotDeviceController.java
  14. 1 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/filter/SessionOutTimeFilter.java
  15. 141 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java
  16. 17 2
      patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  17. 4 1
      patient-co/patient-co-doctor-assistant/src/main/resources/application-dev.yml
  18. 4 0
      patient-co/patient-co-doctor-assistant/src/main/resources/application-devtest.yml
  19. 4 0
      patient-co/patient-co-doctor-assistant/src/main/resources/application-local.yml
  20. 4 0
      patient-co/patient-co-doctor-assistant/src/main/resources/application-localtest.yml
  21. 4 0
      patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml
  22. 4 0
      patient-co/patient-co-doctor-assistant/src/main/resources/application-test.yml
  23. 10 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java
  24. 74 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/consult/ParticipantsCleanJob.java
  25. 20 5
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java
  26. 3 0
      patient-co/patient-co-wlyy-job/src/main/resources/system.properties
  27. 15 10
      patient-co/patient-co-wlyy/pom.xml
  28. 55 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/SQLTimeAdivce.java
  29. 0 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/WlyyJpa.java
  30. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamMemberDao.java
  31. 16 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  32. 38 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempLabelDao.java
  33. 9 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorTeamGuidanceTemplateDao.java
  34. 32 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java
  35. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java
  36. 43 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  37. 20 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  38. 18 17
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheduling/DoctorWorkTimeService.java
  39. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java
  40. 8 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/area/AreaService.java
  41. 157 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  42. 80 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempLableService.java
  43. 72 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java
  44. 46 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  45. 192 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/YLZUserService.java
  46. 38 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java
  47. 24 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/IdCardUtil.java
  48. 6 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/MessageType.java
  49. 41 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/http/HttpResponse.java
  50. 449 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/http/HttpUtils.java
  51. 54 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/http/IPInfoUtils.java
  52. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  53. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  54. 98 39
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java
  55. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java
  56. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java
  57. 12 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  58. 47 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  59. 2 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java
  60. 132 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempLabelController.java
  61. 65 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  62. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java
  63. 6 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  64. 76 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdCheckUserController.java
  65. 36 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/AppletsController.java
  66. 9 0
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  67. 14 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  68. 11 1
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  69. 11 1
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  70. 11 1
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  71. 13 1
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml
  72. 10 0
      patient-co/patient-co-wlyy/src/main/resources/application.yml

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 11 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java


+ 10 - 10
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/SocialSecurityInfo.java

@ -11,17 +11,17 @@ import javax.persistence.*;
@Table(name = "sb_info")
public class SocialSecurityInfo {
    private String id;
    private String xming0;
    private String xbie00;
    private String csrqi0;
    private String id; //主键   必填
    private String xming0;//名字 必填
    private String xbie00;//性别  1男 2女 必填
    private String csrqi0;//出生日志 yyyyMMdd 必填
    private String zjlxbh;
    private String sfzh18;
    private String grsfen;
    private String id0000;
    private String gzztai;
    private String cardno;
    private String card16;
    private String sfzh18;//身份证号
    private String grsfen; // 必填
    private String id0000;//保险号
    private String gzztai; //必填
    private String cardno;//社保卡号
    private String card16;//必填
    private String zhgxsj;
    private String bjlxbh;

+ 87 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/template/DoctorGuidanceTempLabel.java

@ -0,0 +1,87 @@
package com.yihu.wlyy.entity.template;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by 刘文彬 on 2018/5/17.
 */
@Entity
@Table(name = "wlyy_doctor_guidance_temp_label")
public class DoctorGuidanceTempLabel extends IdEntity {
    private String code;//业务编码
    private String name;//标签名称
    private Date createTime;// 创建时间
    private String doctorCode;//创建人code
    private Integer del;//作废标识1、正常 ,0、作废
    private Integer teamId;//医生团队Id
    @Column(name = "code", length = 50)
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "name", length = 100)
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "create_time")
    @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;
    }
    @Column(name = "doctor_code", length = 50)
    public String getDoctorCode() {
        return doctorCode;
    }
    public void setDoctorCode(String doctorCode) {
        this.doctorCode = doctorCode;
    }
    @Column(name = "del", length = 2)
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
    @Column(name = "team_id", length = 11)
    public Integer getTeamId() {
        return teamId;
    }
    public void setTeamId(Integer teamId) {
        this.teamId = teamId;
    }
    public DoctorGuidanceTempLabel(String code, String name) {
        this.code = code;
        this.name = name;
    }
    public DoctorGuidanceTempLabel() {
    }
}

+ 19 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/template/DoctorTeamGuidanceTemplate.java

@ -33,6 +33,9 @@ public class DoctorTeamGuidanceTemplate extends IdEntity {
    private Date czrq;
    //        团队内的团队模板状态  0删除  1正常
    private int del;
    private String labelCode;//指导标签code
    private String labelName;//指导标签name
    public String getTeamName() {
        return teamName;
@ -109,4 +112,20 @@ public class DoctorTeamGuidanceTemplate extends IdEntity {
    public void setDel(int del) {
        this.del = del;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
}

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


BIN
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class


+ 4 - 1
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -553,6 +553,7 @@ public class ArticleApi {
		Timestamp nowTime = DateOper.getNowDateTime();//插入和更新时间一样
		orgArticleVo.setUpdateTime(nowTime);
		Integer isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证
		if(StringUtil.isEmpty(articleId)) {
			String userCode = StringUtil.isEmpty(json.get("userCode")) ? null : json.getString("userCode");
			String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName");//组织名称
@ -564,7 +565,6 @@ public class ArticleApi {
			String articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//类型
			String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode");//操作人角色code
			String opertorRoleLevel = StringUtil.isEmpty(json.get("opertorRoleLevel")) ? null : json.getString("opertorRoleLevel");//操作人角色级别
			Integer isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证
			String authentication = StringUtil.isEmpty(json.get("authentication")) ? null : json.getString("authentication");//认证单位
			String authenticationId = StringUtil.isEmpty(json.get("authenticationId")) ? null : json.getString("authenticationId");//认证单位ID
			articleId = StringUtil.createUUID();
@ -603,9 +603,12 @@ public class ArticleApi {
//			statistic.setArticleId(articleId);
//			dao.insertArticleInitStatistic(statistic);
			dao.insertArticleStatistic(articleId);
			System.out.println("saveArticle===============");
			return dao.saveArticle(orgArticleVo).toString();
		}else{
			orgArticleVo.setIsAuthentication(isAuthentication);
			orgArticleVo.setArticleId(articleId);
			System.out.println("updateArticle==============="+orgArticleVo);
			return dao.updateArticle(orgArticleVo).toString();
		}
	}

+ 3 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -460,6 +460,7 @@ public class ArticleDao {
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			json.put("Code", 10000);
			json.put("Message", "添加成功");
			json.put("Data", orgArticleVo.getArticleId());
			return json;
		} catch (Exception e) {
			return new JSONObject(StringUtil.jsonResult(-1, Utils.getException(e)));
@ -528,6 +529,8 @@ public class ArticleDao {
			JSONObject json = new JSONObject();
			json.put("Code", 10000);
			json.put("Message", "更新成功");
			json.put("Data", vo.getArticleId());
			System.out.println("json:----->"+json);
			return json;
		} catch (JSONException | SQLException e) {
			// TODO Auto-generated catch block

+ 0 - 0
error


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

@ -29,6 +29,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/common/**",
                "/login/**",
                "/yueren/**",
                "/svr-iot/**",
                "/customer/**",
                "/third/**",
                "/admin/hos/doctor/importFromExcel",
@ -62,6 +63,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                .accessDecisionManager(accessDecisionManager())
                .expressionHandler(webSecurityExpressionHandler())
                .antMatchers("/yueren/**").permitAll()
                .antMatchers("/svr-iot/device/**").permitAll()//物联网平台没有做登录(这里添加免登录验证)
//                .antMatchers("/admin/main").permitAll()
//                .antMatchers("/login/**").permitAll()
//                .antMatchers("/admin/**").authenticated()

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/BaseController.java

@ -630,7 +630,7 @@ public class BaseController {
            // 总条数
            map.put("totalCount", total);
            // 总页数
            map.put("totalPage", 1);
            map.put("totalPage", Math.ceil((double)total/(rows)));
            // 结果集
            map.put("detailModelList", list);
            return mapper.writeValueAsString(map);

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/LoginController.java

@ -111,7 +111,7 @@ public class LoginController extends BaseController {
            req.getSession().setAttribute("token", featureUrlList);
            //根据用户类型,获取跳转的url
            String url = userService.getValueByDictId(curUser.getType() + "");
//            resp.sendRedirect(req.getContextPath()+"/admin/main");
            resp.sendRedirect(req.getContextPath()+"/admin/main");
            resp.sendRedirect(url);
        }
    }

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

@ -0,0 +1,115 @@
package com.yihu.wlyy.controller.manager.device;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.device.entity.DeviceHealthIndexVO;
import com.yihu.wlyy.device.entity.WlyyDevice;
import com.yihu.wlyy.device.entity.WlyyPatientDeviceVO;
import com.yihu.wlyy.service.doctor.DoctorService;
import com.yihu.wlyy.service.manager.device.DeviceHealthIndexService;
import com.yihu.wlyy.service.manager.device.WlyyDeviceService;
import com.yihu.wlyy.service.manager.device.WlyyPatientDeviceService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 提供物联网查询
 * @author yeshijie on 2018/5/24.
 */
@RestController
@RequestMapping(value = "/svr-iot/device/",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class IotDeviceController extends BaseController {
    @Autowired
    private WlyyDeviceService deviceService;
    @Autowired
    private DeviceHealthIndexService healthIndexService;
    @Autowired
    private WlyyPatientDeviceService patientDeviceService;
    @Autowired
    private DoctorService doctorService;
    //列表查询
    @RequestMapping(value="deviceList",method = RequestMethod.GET)
    @ApiOperation("设备管理")
    public String searchList(
            @RequestParam(value = "deviceName",required = false)String deviceName,
            @RequestParam(value = "deviceCode",required = false) String deviceCode,
            @RequestParam(value = "orgName",required = false)String orgName,
            @RequestParam(value = "linkman",required = false) String linkman,
            @RequestParam(value = "page",required = false)Integer page,
            @RequestParam(value = "pageSize",required = false)Integer pageSize){
        try {
            Page<WlyyDevice> wlyyDevices = deviceService.searchDeviceList(deviceName,deviceCode,orgName,linkman, page, pageSize);
            return write(200,"操作成功",page,pageSize,wlyyDevices);
        }catch (Exception ex){
            error(ex);
            return error(-1, "操作失败!");
        }
    }
    @RequestMapping(value = "findDeviceById",method = RequestMethod.GET)
    @ApiOperation("根据设备id查找设备管理")
    public String getDevice(@RequestParam(value = "id") Integer id){
        try {
            WlyyDevice device = deviceService.findById(id);
            return  write(200,"操作成功","data",device);
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value ="healthlist",method = RequestMethod.GET)
    @ApiOperation("体征数据查询")
    public String searchList(
            @RequestParam(value = "deviceSn",required = false) String deviceSn,
            @RequestParam(value = "date",required = false) String date,
            @RequestParam(value = "idcard",required = false) String idcard,
            @RequestParam(value = "userName",required = false) String userName,
            @RequestParam(value = "indexType",required = false) String indexType,
            @RequestParam(value = "indexTypeMin1",required = false) Double indexTypeMin1,
            @RequestParam(value = "indexTypeMax1",required = false) Double indexTypeMax1,
            @RequestParam(value = "indexTypeMin2",required = false) Double indexTypeMin2,
            @RequestParam(value = "indexTypeMax2",required = false) Double indexTypeMax2,
            @RequestParam(value = "doctorName",required = false) String doctorName,
            @RequestParam(value = "page",required = false) Integer page,
            @RequestParam(value = "pageSize",required = false) Integer pageSize){
        try{
            Page<DeviceHealthIndexVO> deviceHealthIndexes = healthIndexService.searchList2(deviceSn,date, idcard, userName, indexType,page, pageSize,indexTypeMin1, indexTypeMax1, indexTypeMin2,indexTypeMax2,doctorName);
            return write(200,"操作成功",page,pageSize,deviceHealthIndexes);
        }catch (Exception ex){
            error(ex);
            return error(-1,"操作失败!");
        }
    }
    @RequestMapping(value = "patientDeviceList",method = RequestMethod.GET)
    @ApiOperation("居民设备查询")
    public String searchList(
            @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 = "hospitalName",required = false) String hospitalName,
            @RequestParam(value = "page") Integer page,
            @RequestParam(value = "pageSize") Integer pageSize){
        try {
            String hospitalCode = "";
            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,"操作失败!");
        }
    }
}

+ 1 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/filter/SessionOutTimeFilter.java

@ -24,6 +24,7 @@ public class SessionOutTimeFilter extends OncePerRequestFilter {
                || path.indexOf("/yueren") != -1
                || path.indexOf("/out") != -1
                || path.indexOf("/error") != -1
                || path.indexOf("/svr-iot") != -1
                || path.indexOf(httpServletRequest.getContextPath() + "/static") != -1
                || path.indexOf("swagger") != -1
                || path.indexOf(httpServletRequest.getContextPath() + "/v2/api-docs") != -1) {

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

@ -65,7 +65,7 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
        User loginUser = (User) request.getSession().getAttribute("userInfo");
        Pageable pageRequest = new PageRequest(page - 1,pageSize);
        Pageable pageRequest = new PageRequest(page-1,pageSize);
        StringBuilder filter = new StringBuilder();
@ -185,6 +185,145 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        return new PageImpl<DeviceHealthIndexVO>(listTemp,pageRequest,count);
    }
    /**
     * 无需登录
     * @param deviceSn
     * @param date
     * @param idcard
     * @param userName
     * @param indexType
     * @param page
     * @param pageSize
     * @param indexTypeMin1
     * @param indexTypeMax1
     * @param indexTypeMin2
     * @param indexTypeMax2
     * @param doctorName
     * @return
     * @throws Exception
     */
    public Page<DeviceHealthIndexVO> searchList2(String deviceSn,String date,String idcard,String userName,String indexType,Integer page,Integer pageSize,
                                                Double indexTypeMin1,Double indexTypeMax1,Double indexTypeMin2,Double indexTypeMax2,String doctorName)throws Exception{
        if (page == null){
            page = 1;
        }
        if(pageSize == null){
            pageSize = 15;
        }
        Pageable pageRequest = new PageRequest(page-1,pageSize);
        StringBuilder filter = new StringBuilder();
        String sql =" SELECT i.* ,s.name userName FROM device.wlyy_patient_health_index i , wlyy.wlyy_sign_family s WHERE s. STATUS > 0  and i.user=s.patient ";
        String countSql =" SELECT count(1) as num FROM device.wlyy_patient_health_index i, wlyy.wlyy_sign_family s WHERE s. STATUS > 0  and i.user=s.patient ";
        //根据患者名称过滤
        if(!StringUtils.isEmpty(userName)){
            filter.append(" AND s.NAME LIKE '%"+userName+"%' ");
        }
        //根据健管师或医生名称过滤
        if(!StringUtils.isEmpty(doctorName)){
            filter.append(" and (s.doctor_name like '%"+doctorName+"%' or s.doctor_health_name like '%"+doctorName+"%') ");
        }
        if(!StringUtils.isEmpty(deviceSn)){
            filter.append(" and i.device_sn='"+deviceSn+"' ");
        }
        if(!StringUtils.isEmpty(idcard)){
            filter.append(" and i.idcard='"+idcard+"' ");
        }
        //体征数据创建时间
        if(!StringUtils.isEmpty(date)){
            Date startTimeTemp  =  DateTimeUtil.simpleDateParse(date);
            Calendar calendar = new GregorianCalendar();
            calendar.setTime(startTimeTemp);
            calendar.set(Calendar.HOUR,23);
            calendar.set(Calendar.MINUTE,59);
            calendar.set(Calendar.SECOND,59);
            calendar.set(Calendar.MILLISECOND,999);
            Date endTimeTemp = calendar.getTime();
            filter.append(" and i.czrq>='" + DateTimeUtil.simpleDateTimeFormat(startTimeTemp)+"'");
            filter.append(" and i.czrq<='" + DateTimeUtil.simpleDateTimeFormat(endTimeTemp)+"'");
        }
        //指标类型
        if(!StringUtils.isEmpty(indexType)){
            filter.append(" and i.type="+indexType);
        }
        //体征数据
//        if("1".equals(indexType)||"2".equals(indexType)||"4".equals(indexType)){
        if(indexTypeMin1!=null){
            filter.append(" and value1>="+indexTypeMin1);
        }
        if(indexTypeMax1!=null){
            filter.append(" and value1<="+indexTypeMax1);
        }
        if(indexTypeMin2!=null){
            filter.append(" and value2>="+indexTypeMin2);
        }
        if(indexTypeMax2!=null){
            filter.append(" and value2<="+indexTypeMax2);
        }
//        }else{
//            if(indexTypeMin1!=null){
//                filter.append(" and value3>="+indexTypeMin1);
//            }
//            if(indexTypeMax1!=null){
//                filter.append(" and value3<="+indexTypeMax1);
//            }
//            if(indexTypeMin2!=null){
//                filter.append(" and value4>="+indexTypeMin2);
//            }
//            if(indexTypeMax2!=null){
//                filter.append(" and value4<="+indexTypeMax2);
//            }
//        }
        String f = filter.toString();
//        System.out.println("sql:"+sql+f+" order by i.czrq desc "+" limit "+(page-1)+","+pageSize);
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql+f+" order by i.czrq desc "+" limit "+(page-1)*pageSize+","+pageSize);
        if(resultList.size()<=0){
            return new PageImpl<DeviceHealthIndexVO>(new ArrayList<>(), pageRequest, 0);
        }
        long count = 0;
        String regex = "(\\w{3})(\\w+)(\\w{3})";
        List<DeviceHealthIndexVO> listTemp = new ArrayList<>();
        if(resultList !=null && resultList.size()>0){
//            count = getCount(filter.toString());
            count = jdbcTemplate.queryForObject(countSql+filter.toString(),Long.class);
            for (Map<String, Object> info : resultList){
                DeviceHealthIndexVO bean = new DeviceHealthIndexVO();
                bean.setId(Long.getLong(info.get("id")+""));
                bean.setCzrq(info.get("czrq")!=null?(Date)info.get("czrq"):null);
                bean.setDel(info.get("del")!=null?info.get("del")+"":null);
                bean.setDeviceSn(info.get("device_sn")!=null?info.get("device_sn")+"":null);
                bean.setIdcard(info.get("idcard")!=null?info.get("idcard")+"":null);
                bean.setIntervene(info.get("intervene")!=null?info.get("intervene")+"":null);
                bean.setRecordDate(info.get("record_date")!=null?(Date)info.get("record_date"):null);
                bean.setSortDate(info.get("sort_date")!=null?(Date)info.get("sort_date"):null);
                bean.setStatus(info.get("status")!=null?(Integer)info.get("status"):null);
                bean.setType(info.get("type")!=null?(Integer)info.get("type"):0);
                bean.setUser(info.get("user")!=null?info.get("user")+"":null);
                bean.setUserName(info.get("userName")!=null?info.get("userName")+"":null);
                bean.setValue1(info.get("value1")!=null?info.get("value1")+"":null);
                bean.setValue2(info.get("value2")!=null?info.get("value2")+"":null);
                bean.setValue3(info.get("value3")!=null?info.get("value3")+"":null);
                bean.setValue4(info.get("value4")!=null?info.get("value4")+"":null);
                bean.setValue5(info.get("value5")!=null?info.get("value5")+"":null);
                bean.setValue6(info.get("value6")!=null?info.get("value6")+"":null);
                bean.setValue7(info.get("value7")!=null?info.get("value7")+"":null);
//                BeanUtils.copyProperties(info, bean);
//                Patient patient = findPatient(bean.getUser());
//                bean.setUserName(patient== null?"":patient.getName());
                if(StringUtils.isNotBlank(bean.getIdcard())){
                    bean.setIdcard(bean.getIdcard().replaceAll(regex, "$1****$3"));
                }
                bean.setHealthStandard(gethealthStandard(bean.getType(),bean.getUser()).toString());
                listTemp.add(bean);
            }
        }
        return new PageImpl<DeviceHealthIndexVO>(listTemp,pageRequest,count);
    }
    public List<DeviceHealthIndexVO> getExcelByFilter(String deviceSn,String date,String idcard,
                                                String userName,String indexType,Double indexTypeMin1,Double indexTypeMax1,Double indexTypeMin2,Double indexTypeMax2,String doctorName)throws Exception{
@ -336,7 +475,7 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexExportVO.class));
        return list ;
    }
	}
    public JSONObject gethealthStandard(Integer type, String patientCode) {
        //血糖校验

+ 17 - 2
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -52,6 +52,10 @@ public class PushMsgTask {
    private String template_service_remind;
    @Value("${wechat.message.template_callserver_remind}")
    private String template_callserver_remind;
    @Value("${wechat.message.template_article_check_result}")
    private String template_article_check_result;
    @Value("${wechat.message.template_article_authen}")
    private String template_article_authen;
    @Value("${pushMes.method}")
    private String putMesMethod;
    @Value("${pushMes.redis_prescription_title}")
@ -209,7 +213,7 @@ public class PushMsgTask {
    /**
     * 直接发送微信模板消息
     *
     * @param type 1:处方待处理提醒  2:服务状态提醒  3:居民体征异常提醒  4:咨询请求通知  5:签约申请通知  6:随访提醒  7:处理结果通知 8 咨询回复提醒 9 代办事项提醒
     * @param type 1:处方待处理提醒  2:服务状态提醒  3:居民体征异常提醒  4:咨询请求通知  5:签约申请通知  6:随访提醒  7:处理结果通知 8 咨询回复提醒 9 代办事项提醒 12 文章审核结果提醒
     * @return
     */
    public boolean sendWeixinMessage(String access_token, int type, String openid, String url, JSONObject data) {
@ -253,7 +257,12 @@ public class PushMsgTask {
     */
    public String typeMsg(int type, String openid, String url, JSONObject data) {
        try {
            url = server_url + "wx_doctor/html/" + url;
            if(StringUtils.isNotEmpty(url)){
                url = server_url + "wx_doctor/html/" + url;
            }else{
                url="";
            }
            String temp_id = getTemplateId(type);
            JSONObject temp = new JSONObject();
            temp.put("touser", openid);
@ -340,6 +349,12 @@ public class PushMsgTask {
            case 11:
                templateId = template_callserver_remind;
                break;
            case 12:
                templateId = template_article_check_result;
                break;
            case 13:
                templateId = template_article_authen;
                break;
        }
        return templateId;
    }

+ 4 - 1
patient-co/patient-co-doctor-assistant/src/main/resources/application-dev.yml

@ -54,7 +54,10 @@ wechat:
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
   #健康文章审核提醒
   template_article_check_result: qiYuHVB20unKW2Yd9qIB7rVZyWfeSGR2WmkSXzCtFuQ
   #健康文章认证处理提醒
   template_article_authen: X3m6jEg9hNGJqn4dnfPpnetxQh63ktu0SRvTRFxcqhI
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_appId: 9000276

+ 4 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-devtest.yml

@ -54,6 +54,10 @@ wechat:
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
   #健康文章审核提醒
   template_article_check_result: qiYuHVB20unKW2Yd9qIB7rVZyWfeSGR2WmkSXzCtFuQ
   #健康文章认证处理提醒
   template_article_authen: X3m6jEg9hNGJqn4dnfPpnetxQh63ktu0SRvTRFxcqhI
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 4 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-local.yml

@ -54,6 +54,10 @@ wechat:
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
   #健康文章审核提醒
   template_article_check_result: qiYuHVB20unKW2Yd9qIB7rVZyWfeSGR2WmkSXzCtFuQ
   #健康文章认证处理提醒
   template_article_authen: X3m6jEg9hNGJqn4dnfPpnetxQh63ktu0SRvTRFxcqhI
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 4 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-localtest.yml

@ -54,6 +54,10 @@ wechat:
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
   #健康文章审核提醒
   template_article_check_result: qiYuHVB20unKW2Yd9qIB7rVZyWfeSGR2WmkSXzCtFuQ
   #健康文章认证处理提醒
   template_article_authen: X3m6jEg9hNGJqn4dnfPpnetxQh63ktu0SRvTRFxcqhI
yihu:

+ 4 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-prod.yml

@ -53,6 +53,10 @@ wechat:
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
   #健康文章审核提醒
   template_article_check_result: qiYuHVB20unKW2Yd9qIB7rVZyWfeSGR2WmkSXzCtFuQ
   #健康文章认证处理提醒
   template_article_authen: X3m6jEg9hNGJqn4dnfPpnetxQh63ktu0SRvTRFxcqhI
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/

+ 4 - 0
patient-co/patient-co-doctor-assistant/src/main/resources/application-test.yml

@ -53,6 +53,10 @@ wechat:
   template_service_remind:  v2iqCHvqNLiU0PBBMIEPkB40xi8eUtdpsjwyxw-euo4
   #协同服务提醒
   template_callserver_remind: Fsnt5YUDBCNOREMKifZbr51XhNRyop6VAEV8mIuFYuc
   #健康文章审核提醒
   template_article_check_result: qiYuHVB20unKW2Yd9qIB7rVZyWfeSGR2WmkSXzCtFuQ
   #健康文章认证处理提醒
   template_article_authen: X3m6jEg9hNGJqn4dnfPpnetxQh63ktu0SRvTRFxcqhI
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 10 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.event;
import com.yihu.wlyy.job.*;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.FinishConsultJob;
import com.yihu.wlyy.job.consult.ParticipantsCleanJob;
import com.yihu.wlyy.redis.RedisThread;
import com.yihu.wlyy.util.SystemConf;
import org.slf4j.Logger;
@ -187,6 +188,15 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            } else {
                logger.info("patient_followup_syb_job  job exist");
            }
            //同步imgroup成员,每天凌晨3点30分执行一次
            if (!quartzHelper.isExistJob("participants_clean_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("participants_clean_job");
                quartzHelper.addJob(ParticipantsCleanJob.class, trigger, "participants_clean_job", new HashMap<String, Object>());
                logger.info("participants_clean_job  job success");
            } else {
                logger.info("participants_clean_job  job exist");
            }
    
            //居民随访信息上传基卫,每天凌晨4点执行一次
            if (!quartzHelper.isExistJob("patient_followup_upload_job")) {

+ 74 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/consult/ParticipantsCleanJob.java

@ -0,0 +1,74 @@
package com.yihu.wlyy.job.consult;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamMemberDao;
import com.yihu.wlyy.util.ImUtill;
import org.json.JSONObject;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
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.jdbc.core.JdbcTemplate;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.util.List;
import java.util.Map;
/**
 * 每天同步一次im group团队成员
 * @author yeshijie on 2018/5/18.
 */
public class ParticipantsCleanJob implements Job {
    private static Logger logger = LoggerFactory.getLogger(ParticipantsCleanJob.class);
    @Value("${im.data_base_name}")
    private String imDb;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private ImUtill imUtill;
    @Autowired
    private DoctorAdminTeamMemberDao doctorAdminTeamMemberDao;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try{
            logger.info("ParticipantsCleanJob start.....");
            SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
            //查询会话列表找出type=3的group会话
            StringBuffer sql1 = new StringBuffer();
            sql1.append("SELECT s.id,name FROM ").append(imDb).append(".sessions s ").append("WHERE s.type= 3 ");
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql1.toString());
            list.stream().forEach(one->{
                String sessionId = one.get("id").toString();
                String sessionName = one.get("name").toString();
                //删除不在团队的成员
                StringBuffer sql2 = new StringBuffer();
                sql2.append("delete from ").append(imDb).append(".participants WHERE session_id = '")
                        .append(sessionId).append("' and participant_id not in (")
                        .append("SELECT doctor_code from wlyy_admin_team_member WHERE team_id = ")
                        .append(sessionId).append(" and available =1)");
                jdbcTemplate.execute(sql2.toString());
                //新增团队成员直接调用im接口
                List<Doctor> doctors = doctorAdminTeamMemberDao.findAllMembers(Long.parseLong(sessionId));
                if(doctors!=null&&doctors.size()>0){
                    JSONObject participants = new JSONObject();
                    doctors.forEach(doctor -> {
                        participants.put(doctor.getCode(),0);
                    });
                    imUtill.createSession(participants,"3",sessionName,sessionId);
                }
            });
            logger.info("ParticipantsCleanJob end.....");
        }catch (Exception e){
            e.printStackTrace();
            logger.error("ParticipantsCleanJob error....."+e.getMessage());
        }
    }
}

+ 20 - 5
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -1,16 +1,12 @@
package com.yihu.wlyy.web.quota;
import com.yihu.wlyy.job.*;
import com.yihu.wlyy.job.consult.ConsultCleanerJob;
import com.yihu.wlyy.job.consult.EvaluateScoreJob;
import com.yihu.wlyy.job.consult.FamousConsultTimesJob;
import com.yihu.wlyy.job.consult.FinishConsultJob;
import com.yihu.wlyy.job.consult.*;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.statistics.StatisticsService;
import com.yihu.wlyy.service.quota.JobService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -430,6 +426,25 @@ public class JobController extends BaseController {
        }
    }
    /**
     * 每天同步一次im group团队成员
     * @author ysj
     * @date 2018/5/18 14:16
     */
    @RequestMapping(value = "/executeParticipantsCleanJob", method = RequestMethod.POST)
    @ApiOperation("每天同步一次im group团队成员")
    public String executeParticipantsCleanJob() {
        try {
            quartzHelper.startNow(ParticipantsCleanJob.class, UUID.randomUUID().toString(), null);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    /**
     * 产检提醒
     * @author ysj

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

@ -104,6 +104,9 @@ doctor_feldsher_template_job=0 */30 * * * ?
# 病患者定标情况同步JOB (每天2点一次)
patient_disease_contion_syn_job=0 0 2 * * ?
# 同步im group成员JOB (每天3点30一次)
participants_clean_job=0 30 3 * * ?
#查询家庭签约支付结果,补更新医保签约号,3分钟跑一次
sign_family_pay_result_migisterno_job=0 0/3 * * * ?

+ 15 - 10
patient-co/patient-co-wlyy/pom.xml

@ -426,16 +426,16 @@
            <version>2.4.1.0</version>
        </dependency>
        <!--elasticsearch start-->
  <!--      <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>2.4.4</version>
        </dependency>
        <dependency>
            <groupId>io.searchbox</groupId>
            <artifactId>jest</artifactId>
            <version>2.4.0</version>
        </dependency>-->
        <!--      <dependency>
                  <groupId>org.elasticsearch</groupId>
                  <artifactId>elasticsearch</artifactId>
                  <version>2.4.4</version>
              </dependency>
              <dependency>
                  <groupId>io.searchbox</groupId>
                  <artifactId>jest</artifactId>
                  <version>2.4.0</version>
              </dependency>-->
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
@ -488,6 +488,11 @@
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.ylz</groupId>
            <artifactId>ehc-empi-java-sdk</artifactId>
            <version>20180528</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>wlyy</finalName>

+ 55 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/SQLTimeAdivce.java

@ -0,0 +1,55 @@
//package com.yihu.wlyy.aop;
//
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * Created by chenweida on 2018/5/21 0021.
// * 数据库sql的拦截
// */
//@Aspect
//@Component
//public class SQLTimeAdivce {
//    public SQLTimeAdivce() {
//    }
//
//    private Logger logger = LoggerFactory.getLogger(SQLTimeAdivce.class);
//
//    @Around("execution(* org.springframework.jdbc.core.JdbcTemplate.batchUpdate*(..)) " +
//            "|| execution(* org.springframework.jdbc.core.JdbcTemplate.query*(..)) " +
//            "|| execution(* org.springframework.jdbc.core.JdbcTemplate.execute*(..)) " +
//            "|| this(org.springframework.data.repository.Repository) " +
//            "|| this(org.springframework.data.jpa.repository.JpaSpecificationExecutor)")
//    public Object process(ProceedingJoinPoint point) throws Throwable {
//        HttpServletRequest request = null;
//        if (RequestContextHolder.getRequestAttributes() != null) {
//            request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//            logger.info("uri:" + request.getRequestURI());
//        }
//        //访问目标方法的参数:
//        Object[] args = point.getArgs();
//        String sql = null;
//        //第一个参数是sql
//        if (args != null && args.length > 0 && args[0].getClass() == String.class) {
//            sql = args[0].toString();
//            //第一个参数是sql数组
//        }
//        //用改变后的参数执行目标方法
//        Long startTime = System.currentTimeMillis();
//        Object returnValue = point.proceed(args);
//        Long endTime = System.currentTimeMillis();
//
//        logger.info("sql:" + sql);
//        logger.info("sql-time:" + (endTime - startTime));
//        return returnValue;
//
//    }
//}

+ 0 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/jpa/WlyyJpa.java

@ -51,13 +51,10 @@ public class WlyyJpa {
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);
        emfb.setJpaProperties(hibernateProperties.hibProperties());
        return emfb;
    }
    @Bean(name = "wlyyTransactionManager")
    @Primary
    JpaTransactionManager transactionManagerSecondary(

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/doctor/DoctorAdminTeamMemberDao.java

@ -28,6 +28,10 @@ public interface DoctorAdminTeamMemberDao extends
            "AND t.id = m.teamId AND t.available = true AND m.available = true")
    List<AdminTeam> findDoctorTeams(@Param(value = "doctorCode") String doctorCode);
    @Query("SELECT t FROM  AdminTeam t WHERE t.leaderCode = :doctorCode " +
            " AND t.available = true ")
    List<AdminTeam> findDoctorLeaderTeam(@Param(value = "doctorCode") String doctorCode);
    @Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = :teamId AND t.id = m.teamId " +
            "AND m.doctorCode = d.code AND t.available = true AND m.available = true ORDER BY d.level")
    List<Doctor> findAllMembers(@Param(value = "teamId") long teamId);

+ 16 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -36,6 +36,10 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0,a.over='0' where a.id = ?1")
    int read(long msgid);
    @Modifying
    @Query("update Message a set a.read = 0,a.over='0' where a.code = ?1")
    int read(String msgCode);
    @Query("SELECT a FROM Message a WHERE a.sender=?1 AND a.receiver = ?2 and a.signStatus = ?3 and a.read=1 ORDER BY czrq DESC")
    List<Message> findUnreadSign(String sender, String receiver, String signStatus);
@ -56,13 +60,13 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101) and (a.del = '1' or a.del is null) ")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15) and (a.del = '1' or a.del is null) ")
    List<Message> getSystemMessage(String doctor, Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")
@ -106,4 +110,14 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("from Message a where a.type = 12 and a.del='1' and a.over='1' and relationCode = ?1  ")
    List<Message> findByCallServiceRelationCode(String relationCode);
    @Query(" select a from Message a where a.type=?2 and a.del='1' and a.read=1 and a.receiver=?1 and a.over='1' order by a.createTime desc ")
    List<Message> findEduArticle(String receiver,Integer type);
    @Query(" select a from Message a where a.type=?2 and a.del='1'  and a.receiver=?1 ")
    List<Message> findEduArticle(String receiver,Integer type, Pageable pageRequest);
    @Modifying
    @Query("delete from Message a   where a.receiver = ?1 and a.data = ?2 and a.type in (14,15) ")
    int setMessageDel(String doctor, String articleCode);
}

+ 38 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempLabelDao.java

@ -0,0 +1,38 @@
package com.yihu.wlyy.repository.template;
import com.yihu.wlyy.entity.template.DoctorGuidanceTempLabel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/5/18.
 */
public interface DoctorGuidanceTempLabelDao extends PagingAndSortingRepository<DoctorGuidanceTempLabel, Long> {
    @Query("select t from DoctorGuidanceTempLabel t where t.teamId = ?1 and t.del=1")
    Page<DoctorGuidanceTempLabel> findByTeamId(Integer teamId, Pageable pageRequest);
    @Query("select t from DoctorGuidanceTempLabel t where t.teamId = ?1 and t.del=1 order by t.createTime desc ")
    List<DoctorGuidanceTempLabel> findByTeamId(Integer teamId);
    @Query("select t from DoctorGuidanceTempLabel t where t.teamId=?1 and  t.name = ?2 and t.del=1 ")
    DoctorGuidanceTempLabel findByNameWithDel(Integer teamId,String name);
    @Query("select t from DoctorGuidanceTempLabel t where t.code = ?1 ")
    DoctorGuidanceTempLabel findByCode(String code);
    @Modifying
    @Query(value = "update DoctorGuidanceTempLabel p set p.del=?1 where p.code=?2 ")
    int updateDel(int del,String code);
    @Modifying
    @Query(value = "update DoctorGuidanceTempLabel p set p.name=?1 where p.code=?2 ")
    int updateName(String name,String code);
}

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

@ -71,4 +71,13 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
            " AND b.del = 1 AND b.teamId = ?1 AND b.title LIKE ?2 ")
    List<DoctorTeamGuidanceTemplate> getListByTile(int teamId, String title, Pageable pageRequest);
    // 根据模板文章标题模糊搜索团队指导模板(不分页)
    @Query("SELECT b FROM DoctorTeamGuidanceTemplate b WHERE   " +
            " b.del = 1 AND b.teamId = ?1 AND b.title LIKE ?2 ")
    List<DoctorTeamGuidanceTemplate> getListByTile(int teamId, String title);
    //    根据团队ID获取团队内的模板列表(带分页和创建时间倒序)
    @Query("select t from DoctorTeamGuidanceTemplate t where t.del = 1 and t.teamId = ?1 and t.labelCode= ?2")
    List<DoctorTeamGuidanceTemplate> findGuidanceByTeamIdAndLabelCode(int teamId,String labelCode, Pageable request);
}

+ 32 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -1620,4 +1620,36 @@ public class DoctorInfoService extends BaseService {
        }
        return jdbcTemplate.queryForList(sql);
    }
    /**
     * 获取同级的文章审核管理员(普通医生)
     * @param operatorRoleCode
     * @return
     */
    public List<Map<String,Object>> getDoctorManager(String operatorRoleCode){
        String sql = "select d.code,d.name,d.openid from wlyy_doctor d " +
//                " join wlyy_user_role h on d.code=h.user " +
                " join manage_role_user ru on d.code=ru.user_code " +
                " join manage_role_feature rf on ru.role_id=rf.role_id " +
                " join manage_feature f on rf.feature_id=f.id " +
                " where f.code='Manage_Article_Authentication' " +
                " and d.hospital='"+operatorRoleCode+"'";
        return jdbcTemplate.queryForList(sql);
    }
    /**
     * 获取同级的文章审核管理员(管理员)
     * @param operatorRoleCode
     * @return
     */
    public List<Map<String,Object>> getDoctorManager2(String operatorRoleCode){
        String sql = "select d.code,d.name,d.openid from wlyy_doctor d " +
                " join wlyy_user_role h on d.code=h.user " +
                " join manage_role_user ru on d.code=ru.user_code " +
                " join manage_role_feature rf on ru.role_id=rf.role_id " +
                " join manage_feature f on rf.feature_id=f.id " +
                " where f.code='Manage_Article_Authentication' " +
                " and h.role='"+operatorRoleCode+"'";
        return jdbcTemplate.queryForList(sql);
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -1751,7 +1751,7 @@ public class PatientInfoService extends BaseService {
       /* String sql = "SELECT p.code,p.name,CASE p.sex WHEN 1 THEN '男' WHEN 2 THEN '女' END sex,p.idcard,f.doctor_name" +
                " FROM wlyy_patient p  LEFT JOIN wlyy_sign_family f ON p.code = f.patient" +
                " WHERE f.status = 1 AND p.name LIKE '%"+keyWord+"%' OR p.idcard LIKE '%"+keyWord+"%' and f.hospital = '"+hospital+"'"+" limit ?,?";*/
       String sql ="SELECT f.patient as code,f.name,f.idcard,f.doctor_name FROM wlyy_sign_family f where f.status > 0 AND f.hospital = '"+hospital+"' AND f.name LIKE '%"+keyWord+"%' OR f.idcard LIKE '%"+keyWord+"%' limit ?,?";
        String sql ="SELECT f.patient as code,f.name,f.idcard,f.doctor_name FROM wlyy_sign_family f where f.status > 0 AND f.hospital = '"+hospital+"' AND f.name LIKE '%"+keyWord+"%' OR f.idcard LIKE '%"+keyWord+"%' limit ?,?";
        patientList = jdbcTemplate.queryForList(sql ,new Object[]{start,pageSize});
        String patientDeviceSql = "SELECT user as patientCode FROM wlyy_patient_device WHERE device_sn='"+deviceSn+"'";

+ 43 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -100,7 +100,7 @@ public class MessageService extends BaseService {
    /**
     * 查询医生未读消息和最后消息
     */
    public JSONObject findDoctorAllMessage(String doctor) throws Exception {
    public JSONObject findDoctorAllMessage(String doctor,Integer type) throws Exception {
        // 签约未读消息总数
        int sign = messageDao.amountUnreadByReceiver(doctor);
        JSONObject signJson = new JSONObject();
@ -191,6 +191,22 @@ public class MessageService extends BaseService {
            callServiceMesJson.put("amount", 0);
        }
        //文章审核消息
        List<Message> articleMes = messageDao.findEduArticle(doctor,type);
        JSONObject articleMesJson = new JSONObject();
        if (articleMes != null && articleMes.size() > 0) {
            articleMesJson.put("amount", articleMes.size());
            JSONObject articleJson = new JSONObject();
            articleJson.put("title", "文章审核消息");
            articleJson.put("type", articleMes.get(0).getType());
            articleJson.put("msg", "你有"+articleMes.size()+"个文章审核消息");
            articleJson.put("msgTime", DateUtil.dateToStrLong(articleMes.get(0).getCreateTime()));
            articleMesJson.put("lastMessage", articleJson);
        }else{
            articleMesJson.put("amount", 0);
        }
        JSONObject json = new JSONObject();
        json.put("imMsgCount", getImMsgAmount(doctor));//IM消息数量
        json.put("sign", signJson);//签约数
@ -198,7 +214,7 @@ public class MessageService extends BaseService {
        json.put("system", systemJson);//系统消息
        json.put("prescription", prescriptionJson);//续方消息
        json.put("callService", callServiceMesJson);//协同服务消息
        json.put("articleCheck", articleMesJson);//健康文章审核消息
        return json;
    }
@ -485,6 +501,22 @@ public class MessageService extends BaseService {
        return messageDao.getPrescriptionMessage(doctor,type, pageRequest);
    }
    /**
     * 获取新增健康文章审核消息
     * @param receiver
     * @param page
     * @param pagesize
     * @return
     * @throws Exception
     */
    public List<Message> getEduArticleMessage(String receiver ,Integer type,Integer page, Integer pagesize) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.findEduArticle(receiver,type,pageRequest);
    }
    /**
     * 设置某类消息已读
     *
@ -624,4 +656,13 @@ public class MessageService extends BaseService {
        messageDao.save(mess);
        return "1";
    }
    @Transactional
    public boolean setMessageDel(String receive,String articleId){
        if(messageDao.setMessageDel(receive,articleId)>0){
            return true;
        }else {
            return false;
        }
    }
}

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

@ -470,7 +470,26 @@ public class PrenatalInspectorPreCardService extends BaseService {
                data = json.getJSONObject("data").getJSONArray("DATA");
            }
            if (data != null && data.size() > 0) {
                return data;
                //排序 智业接口返回的记录没有按检查时间排序
                List<JSONObject> list = new ArrayList<JSONObject>(data.size());
                for (int i=0;i<data.size();i++){
                    list.add(data.getJSONObject(i));
                }
                Collections.sort(list, new Comparator<JSONObject>() {
                    @Override
                    public int compare(JSONObject o1, JSONObject o2) {
                        String time1 = o1.getString("EXAM_TIME");//检查时间
                        String time2 = o2.getString("EXAM_TIME");
                        return time2.compareTo(time1);
                    }
                });
                JSONArray ja = new JSONArray();
                list.forEach(one->{
                    ja.add(one);
                });
                return ja;
            }
            return re;
        } catch (Exception e) {

+ 18 - 17
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheduling/DoctorWorkTimeService.java

@ -757,35 +757,36 @@ public class DoctorWorkTimeService extends BaseService {
            //健管师推荐开启,只判断健管师的时间
            if ("1".equals(re.getString("familyTopicSwitch"))){
                json = doctorWork(doctorHealth,week,calendar);
                if("0".equals(json.getString("status"))){
                    json.put("status","2");
                    json.put("msg","全科医生和健管师当前都不在工作时间");
                }
            }else {//健管师推荐关闭,则两个都要判断
                JSONObject doctorJson = doctorWork(doctor,week,calendar);
                JSONObject doctorHealthJson = doctorWork(doctorHealth,week,calendar);
                String doctorStatus = doctorJson.getString("status");
                String doctorHealthStatus = doctorHealthJson.getString("status");
                //两个都不接受咨询时,无法咨询
                if ("0".equals(doctorStatus) && "0".equals(doctorHealthStatus)){
                    json.put("status", "0");
                    json.put("msg", "医生不接受咨询");
                }
                //两个其中有一个可以咨询时都可以咨询
                if ("1".equals(doctorStatus) || "1".equals(doctorHealthStatus)){
//                if ("0".equals(doctorStatus) && "0".equals(doctorHealthStatus)){
//                    json.put("status", "0");
//                    json.put("msg", "医生不接受咨询");
//                }else
                if ("1".equals(doctorStatus) && "1".equals(doctorHealthStatus)){
                    //两个其中有一个可以咨询时都可以咨询
                    json.put("status", "1");
                    json.put("msg", "医生当前接受咨询");
                }
                //如果全科和健管师都不在时间范围
                if ("2".equals(doctorStatus) && "2".equals(doctorHealthStatus)){
                    json.put("status","2");
                    json.put("msg","全科医生和健管师当前都不在工作时间");
                }
                //健管师在工作时间,全科不在
                if ("2".equals(doctorStatus) || "0".equals(doctorStatus)){
                }else if (!"1".equals(doctorStatus) && "1".equals(doctorHealthStatus)){
                    //健管师在工作时间,全科不在 21 01
                    json.put("status","3");
                    json.put("msg","全科医生当前不在工作时间");
                }
                //全科在工作时间,健管师不在
                if ("0".equals(doctorHealthStatus) || "2".equals(doctorHealthStatus)){
                }else if ("1".equals(doctorStatus) && !"1".equals(doctorHealthStatus)){
                    //全科在工作时间,健管师不在 10 12
                    json.put("status","4");
                    json.put("msg","健管师当前不在工作时间");
                }else{
                    //如果全科和健管师都不在时间范围 22,02,20,00
                    json.put("status","2");
                    json.put("msg","全科医生和健管师当前都不在工作时间");
                }
            }
        }

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java

@ -161,9 +161,9 @@ public class RoleService extends TokenService {
                List<Map<String, Object>> list = doctorInfoService.getDoctorManagerRole(user,"Manage_Article_Authentication");
                if(list.size()>0&&!StringUtils.isEmpty(list.get(0).get("code"))){
                    map.put("authOperate", "1");
                    map.put("doctorAuthOperate", "1");
                }else{
                    map.put("authOperate", "0");
                    map.put("doctorAuthOperate", "0");
                }
                re.add(map);
            }

+ 8 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/area/AreaService.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
@ -21,6 +22,8 @@ public class AreaService extends BaseService {
    TownDao townDao;
    @Autowired
    HospitalDao hospitalDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 查询城市城镇
@ -28,11 +31,13 @@ public class AreaService extends BaseService {
     * @param city
     * @return
     */
    public List<Town> getCityTowns(String city){
    public List<Town> getCityTowns(String city) {
        return townDao.findByCityCode(city);
    }
    public List<Hospital> getTownHospitals(String town){
     return hospitalDao.findByTownCode10(town);
    public List<Hospital> getTownHospitals(String town) {
        String sql = " select * from dm_hospital where town = ?";
        jdbcTemplate.queryForList(sql, town);
        return hospitalDao.findByTownCode10(town);
    }
}

+ 157 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -10,25 +10,31 @@ import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.DoctorRole;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorAdminTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.app.scheduling.DoctorWorkTimeService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.RoleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.third.gateway.service.GcLabelService;
import com.yihu.wlyy.web.third.gateway.vo.DictModel;
import com.yihu.wlyy.web.third.gateway.vo.HealthEduArticlePatientModel;
import io.searchbox.client.JestClient;
import io.searchbox.core.*;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
@ -89,6 +95,20 @@ public class JMJkEduArticleService extends BaseService {
    private DoctorRoleDao doctorRoleDao;
    @Autowired
    DoctorAdminTeamDao teamDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private MessageService messageService;
    @Autowired
    private DoctorWorkTimeService doctorWorkTimeService;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Value("${doctorAssistant.api}")
    private String doctorAssistant;
    @Value("${doctorAssistant.target_url}")
    private String targetUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     *
@ -1116,6 +1136,7 @@ public class JMJkEduArticleService extends BaseService {
     * @param content
     * @throws Exception
     */
    @Transactional
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String image,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String opertorRoleLevel,Integer userScope,String articleId,Integer roleType) throws Exception {
@ -1136,17 +1157,85 @@ public class JMJkEduArticleService extends BaseService {
        }
        Integer isAuthentication = 0;
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
//        Doctor doctor = doctorDao.findByCode(userCode);
        if(roleType==2){
        Doctor doctor = doctorDao.findByCode(userCode);
//        if(roleType==2){
//            List<RoleWithAuthorityCheck> list = doctorDao.findEduAuthority(userCode,operatorRoleCode);
            List<Map<String, Object>> list = doctorInfoService.getDoctorManagerRole(userCode,"Manage_Article_Authentication");
            if(list.size()>0&&!StringUtils.isEmpty(list.get(0).get("code"))){
            List<Map<String, Object>> list2 = doctorInfoService.getDoctorManagerRole(userCode,"Manage_Article_Authentication");
            if(list2.size()>0&&!StringUtils.isEmpty(list2.get(0).get("code"))){
                isAuthentication = 1;
            }
        }
        thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
//        }
        String  b = thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
                secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,
                userScope,isAuthentication,articleId,roleType);
        //如果文章需要审核且文章保存数据库成功,推送消息通知给审核的管理员
        if(isAuthentication==0&&!StringUtils.isEmpty(b)){
//            if(!StringUtils.isEmpty(articleId)){
//
//                messageDao.setMessageDel(userCode,articleId);
//            }
            List<Map<String,Object>> list = null;
            if(roleType==1){
                list = doctorInfoService.getDoctorManager(operatorRoleCode);
            }else if(roleType==2){
                list = doctorInfoService.getDoctorManager2(operatorRoleCode);
            }
            for(Map<String,Object> one:list){
                if(!StringUtils.isEmpty(articleId)){
                    messageDao.setMessageDel(one.get("code")+"",articleId);
                }
                Message message = new Message();
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setTitle("新增文章审核消息");
                message.setContent(doctor.getName()+"医生提交了文章审核,请您前往电脑端处理");
                message.setRead(1);//设置未读
                message.setReceiver(one.get("code")+"");//设置接受医生的code()
                message.setSender(userCode);//设置发送的医生
                message.setSenderName(doctor.getName());
                message.setCode(getCode());
                message.setSenderPhoto(doctor.getPhoto());
                message.setType(14);//新增健康文章审核信息
                message.setReadonly(1);//是否只读消息
                message.setSex(doctor.getSex());
                message.setOver("1");//未处理
                message.setDel("1");
                message.setData(b);
                message.setRelationCode("0");
                messageDao.save(message);
                if(messageService.getMessageNoticeSettingByMessageType(one.get("code")+"","1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                    // 发送消息给医生
                    org.json.JSONObject jsonObject = doctorWorkTimeService.isDoctorWorking(one.get("code")+"");
                    if (jsonObject.getString("status").equals("1")) {
                        //如果在工作时间内就推送
                        pushMsgTask.put(one.get("code")+"", MessageType.MESSAGE_TYPE_AUTHEN_HEALTH_EDU_ARTICLE.D_EDU_02.name(), MessageType.MESSAGE_TYPE_AUTHEN_HEALTH_EDU_ARTICLE.新增文章认证消息.name(), doctor.getName() + "医生提交了文章认证,您可以点击前往", doctor.getCode());
                    }
                    //新增发送医生助手模板消息
                    if (org.apache.commons.lang3.StringUtils.isNotEmpty(one.get("openid")+"")){
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        List<NameValuePair> params = new ArrayList<>();
                        params.add(new BasicNameValuePair("type", "13"));
                        params.add(new BasicNameValuePair("openId", one.get("openid")+""));
                        params.add(new BasicNameValuePair("url", ""));
                        params.add(new BasicNameValuePair("first", "您好,您有新的文章认证申请"));
                        params.add(new BasicNameValuePair("remark", "您可以登录厦门i健康PC端审核文章,感谢您的使用"));
//                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
//                        String date = format.format(new Date());
                        String keywords = doctor.getName() + ",健康文章";
                        params.add(new BasicNameValuePair("keywords", doctor.getName()));
                        params.add(new BasicNameValuePair("keywords", "健康文章"));
                        httpClientUtil.post(url, params, "UTF-8");
                    }
                }
            }
        }
    }
    /**
@ -1246,12 +1335,68 @@ public class JMJkEduArticleService extends BaseService {
        }
    }
    @Transient
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
    @Transactional
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName,String reasonContent,String sender) throws Exception{
        String[] str = articleId.split(",");
        Doctor doctor = doctorDao.findByCode(sender);
        for(String one: str){
            thirdJkEduArticleService.authenticationArticle(one,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            boolean b = thirdJkEduArticleService.authenticationArticle(one,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            messageDao.setMessageDel(sender,articleId);
            if(b){
                Message message = new Message();
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setTitle("新增文章审核消息");
                if("2".equals(isAuthentication)){
                    message.setContent("健康文章审核不通过,原因:"+reasonContent);
                }else if("1".equals(isAuthentication)){
                    message.setContent("健康文章审核通过。");
                }else {
                    message.setContent("健康文章取消认证。");
                }
                JSONObject article = thirdJkEduArticleService.getArticalById(one,"","");
                Doctor receiveDoctor = doctorDao.findByCode(article.getString("operatorId"));
                message.setRead(1);//设置未读
                message.setReceiver(article.getString("operatorId"));//设置接受医生的code()
                message.setSender(sender);//设置发送的医生
                message.setSenderName(doctor.getName());
                message.setCode(getCode());
                message.setSenderPhoto(doctor.getPhoto());
                message.setType(15);//新增健康文章审核结果信息
                message.setReadonly(1);//是否只读消息
                message.setSex(doctor.getSex());
                message.setOver("1");//未处理
                message.setDel("1");
                message.setData(article.get("articleId")+"");
                message.setRelationCode(isAuthentication);
                messageDao.save(message);
                if(messageService.getMessageNoticeSettingByMessageType(receiveDoctor.getCode(),"1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                    // 发送消息给医生
                    org.json.JSONObject jsonObject = doctorWorkTimeService.isDoctorWorking(receiveDoctor.getCode());
                    if (jsonObject.getString("status").equals("1")) {
                        //如果在工作时间内就推送
                        pushMsgTask.put(receiveDoctor.getCode(), MessageType.MESSAGE_TYPE_SAVE_HEALTH_EDU_ARTICLE.D_EDU_01.name(), MessageType.MESSAGE_TYPE_SAVE_HEALTH_EDU_ARTICLE.新增文章审核消息.name(), doctor.getName() + "医生提交了文章审核,您可以点击前往", doctor.getCode());
                    }
                    //新增发送医生助手模板消息
                    if (org.apache.commons.lang3.StringUtils.isNotEmpty(receiveDoctor.getOpenid())){
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        List<NameValuePair> params = new ArrayList<>();
                        params.add(new BasicNameValuePair("type", "12"));
                        params.add(new BasicNameValuePair("openId", receiveDoctor.getOpenid()));
                        params.add(new BasicNameValuePair("url", ""));
                        params.add(new BasicNameValuePair("first", receiveDoctor.getName() + "医生您好,您提交的健康文章已审核"));
                        params.add(new BasicNameValuePair("remark", "您可以登录厦门i健康app查看结果,感谢您的使用"));
                        SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                        String date = format.format(new Date());
                        String keywords = date + "," + doctor.getName();
                        params.add(new BasicNameValuePair("keywords", date));
                        params.add(new BasicNameValuePair("keywords", doctor.getName()));
                        httpClientUtil.post(url, params, "UTF-8");
                    }
                }
            }
        }
    }

+ 80 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempLableService.java

@ -0,0 +1,80 @@
package com.yihu.wlyy.service.template;
import com.yihu.wlyy.entity.template.DoctorGuidanceTempLabel;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempLabelDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/5/18.
 */
@Service
public class DoctorGuidanceTempLableService extends BaseService {
    @Autowired
    private DoctorGuidanceTempLabelDao doctorGuidanceTempLableDao;
    /**
     * 保存
     * @param doctorCode
     * @param name
     */
    @Transactional
    public DoctorGuidanceTempLabel save(String doctorCode, String name, Integer teamId)throws Exception{
        DoctorGuidanceTempLabel one = new DoctorGuidanceTempLabel();
        one.setCode(getCode());
        one.setCreateTime(new Date());
        one.setDoctorCode(doctorCode);
        one.setName(name);
        one.setTeamId(teamId);
        one.setDel(1);
        return doctorGuidanceTempLableDao.save(one);
    }
    public List<DoctorGuidanceTempLabel> findByDoctorCode(Integer teamId, int pageSize, int pageNo) throws Exception{
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        pageNo=pageNo-1;
        PageRequest pageRequest = new PageRequest(pageNo, pageSize,sort);
        Page<DoctorGuidanceTempLabel> page =  doctorGuidanceTempLableDao.findByTeamId(teamId,pageRequest);
        List<DoctorGuidanceTempLabel> newList = new ArrayList<>();
        newList.add(0,new DoctorGuidanceTempLabel("","未分组"));
        newList.addAll(page.getContent());
        return newList;
    }
    public List<DoctorGuidanceTempLabel> findByDoctorCode(Integer teamId) throws Exception{
        List<DoctorGuidanceTempLabel> list =  doctorGuidanceTempLableDao.findByTeamId(teamId);
        List<DoctorGuidanceTempLabel> newList = new ArrayList<>();
        newList.add(0,new DoctorGuidanceTempLabel("","未分组"));
        newList.addAll(list);
        return newList;
    }
    @Transactional
    public boolean delete(String code) throws Exception{
        int temp = doctorGuidanceTempLableDao.updateDel(0,code);
        if(temp>0){
            return true;
        }
        return false;
    }
    @Transactional
    public boolean updateName(String code,String name) throws Exception{
        int temp = doctorGuidanceTempLableDao.updateName(name,code);
        if(temp>0){
            return true;
        }
        return false;
    }
}

+ 72 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
import com.yihu.wlyy.entity.template.DoctorGuidanceTempLabel;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceDetail;
import com.yihu.wlyy.entity.template.DoctorTeamGuidanceTemplate;
import com.yihu.wlyy.logs.BusinessLogs;
@ -12,13 +13,13 @@ import com.yihu.wlyy.repository.doctor.DoctorAdminTeamMemberDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempLabelDao;
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceDetailDao;
import com.yihu.wlyy.repository.template.DoctorTeamGuidanceTemplateDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.consult.ConsultService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.util.CommonUtil;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -57,6 +58,8 @@ public class DoctorTeamGuidanceService extends BaseService {
    DoctorGuidanceTempDao guidanceTempDao;
    @Autowired
    private CommonUtil CommonUtil;
    @Autowired
    private DoctorGuidanceTempLabelDao doctorGuidanceTempLableDao;
    /**
     * 新增团队指导模板
@ -66,7 +69,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param content
     * @param images
     */
    public String 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,String labelCode) throws Exception {
        String templateCode = getCode();
        Date nowDate = new Date();
        String image = "";
@ -75,7 +78,12 @@ public class DoctorTeamGuidanceService extends BaseService {
            image = CommonUtil.copyTempImage(images);
            System.out.println("images =====>" + image);
        }
        //指导标签
        DoctorGuidanceTempLabel doctorGuidanceTempLable =  doctorGuidanceTempLableDao.findByCode(labelCode);
        String labelName = "未分组";
        if(doctorGuidanceTempLable!=null){
            labelName = doctorGuidanceTempLable.getName();
        }
        for (Object team : teams) {
            JSONObject teamJson = new JSONObject(team.toString());
            int teamId = teamJson.getInt("teamId");
@ -93,7 +101,8 @@ public class DoctorTeamGuidanceService extends BaseService {
                doctorTeamGuidanceTemplate.setTitle(title);
                doctorTeamGuidanceTemplate.setTeamTemplateCode(templateCode);
                doctorTeamGuidanceTemplate.setUseTimes(0);
                doctorTeamGuidanceTemplate.setLabelCode(labelCode);
                doctorTeamGuidanceTemplate.setLabelName(labelName);
                doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
            } else {
                throw new Exception(teamName + ":团队标题重复!");
@ -332,6 +341,42 @@ public class DoctorTeamGuidanceService extends BaseService {
        return teamList;
    }
    /**
     * 获取此医生所在的团队列表。
     *
     * @param doctorCode
     * @param filter 搜索关键字
     * @return
     */
    public List findDoctorLeaderTeam(String doctorCode,String filter) throws Exception{
        List teamList = null;
        try {
            List<AdminTeam> doctorTeams = memberDao.findDoctorLeaderTeam(doctorCode);
            teamList = new ArrayList();
            for (AdminTeam AdminTeam : doctorTeams){
                Map map = new HashMap();
                String teamName = AdminTeam.getName();
                Long teamId = AdminTeam.getId();
                map.put("teamName", teamName);
                map.put("teamId", teamId);
                if (StringUtils.isNotEmpty(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()));
                    map.put("amount", listGuidances.size());
                }
                teamList.add(map);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return teamList;
    }
    /**
     * 根据团队模板编码获取单个 有效的 模板详情
     *
@ -468,4 +513,27 @@ public class DoctorTeamGuidanceService extends BaseService {
        return imagePath;
    }
    public List<DoctorTeamGuidanceTemplate> getGuidanceByTeamIdAndLabelCode( Integer teamId,String labelCode, int pageNo, int pageSize) throws Exception {
        Sort sort = new Sort(Sort.Direction.DESC, "useTimes","createTime");
        pageNo = pageNo -1;
        PageRequest request = new PageRequest(pageNo, pageSize, sort);
        List<DoctorTeamGuidanceTemplate> list = doctorTeamGuidanceTemplateDao.findGuidanceByTeamIdAndLabelCode(teamId,labelCode,request);
        return list;
    }
    public Map<String,List<DoctorTeamGuidanceTemplate>> getTeamGuidanceListByLabelWithFilter(Integer teamId ,String filter) throws Exception {
        List<DoctorTeamGuidanceTemplate>  listGuidances = doctorTeamGuidanceTemplateDao.getListByTile(teamId,"%"+filter+"%");
        Map<String,List<DoctorTeamGuidanceTemplate>> map= new HashMap<>();
        for(DoctorTeamGuidanceTemplate one:listGuidances){
            if(map.containsKey(one.getLabelName()!=null?one.getLabelName():"未分组")){
                List<DoctorTeamGuidanceTemplate> temp = map.get(one.getLabelName()!=null?one.getLabelName():"未分组");
                temp.add(one);
            }else{
                map.put(one.getLabelName()!=null?one.getLabelName():"未分组",new ArrayList<>(Arrays.asList(one)));
            }
        }
        return map;
    }
}

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

@ -11,6 +11,7 @@ import com.yihu.wlyy.entity.organization.HospitalMapping;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.doctor.DoctorRoleDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -29,6 +30,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import springfox.documentation.spring.web.json.Json;
@ -72,6 +74,8 @@ public class ThirdJkEduArticleService extends BaseService {
    private DoctorRoleDao doctorRoleDao;
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private MessageDao messageDao;
    //    private String baseUrl = "http://service.yihu.com:8085/WsPlatform/rest";
//    private String baseUrl = "http://172.17.110.230:83/WsPlatform/rest";
@ -394,6 +398,42 @@ public class ThirdJkEduArticleService extends BaseService {
        }
    }
    /**
     * 获取文章详情
     *
     * @param articleId 文章id
     * @return
     */
    @Transactional
    public JSONObject getArticalById(String articleId,String userId,String userType,String messageCode) 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);
            if("1".equals(userType)&&!org.apache.commons.lang.StringUtils.isEmpty(messageCode)){
                messageDao.read(messageCode);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return re;
        }
        if ("10000".equals(json.getString("Code"))) {
            JSONArray result = json.getJSONArray("Result");
            if (result.size() > 0) {
                return result.getJSONObject(0);
            }
            return re;
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 添加文章
     * @param userCode 医生code
@ -409,7 +449,7 @@ public class ThirdJkEduArticleService extends BaseService {
     * @return
     * @throws Exception
     */
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
    public String saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
                                 String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,
                                 String operatorRoleCode,String opertorRoleLevel,Integer userScope,Integer isAuthentication,String articleId,Integer roleType) throws Exception {
@ -475,11 +515,12 @@ public class ThirdJkEduArticleService extends BaseService {
//            }
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticle, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return json.get("Data")+"";
        } else {
            throw new Exception(json.getString("Message"));
        }
@ -646,7 +687,7 @@ public class ThirdJkEduArticleService extends BaseService {
     * 认证文章
     * @return
     */
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
    public boolean authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{
        String response = "";
        JSONObject json = null;
@ -665,6 +706,8 @@ public class ThirdJkEduArticleService extends BaseService {
        }
        if (!"10000".equals(json.getString("Code"))) {
            throw new Exception(json.getString("Message"));
        }else{
            return true;
        }
    }

+ 192 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/YLZUserService.java

@ -0,0 +1,192 @@
package com.yihu.wlyy.service.third.ylz;
import com.yihu.wlyy.entity.patient.SocialSecurityInfo;
import com.yihu.wlyy.repository.patient.SocialSecurityInfoDao;
import com.yihu.wlyy.util.IdCardUtil;
import com.ylzinfo.ehc.empi.sdk.EhcEmpiClient;
import com.ylzinfo.ehc.empi.sdk.domain.ResponseParams;
import com.ylzinfo.ehc.empi.sdk.dto.request.AuthorizationTokenRequest;
import com.ylzinfo.ehc.empi.sdk.dto.request.UserInfoRequest;
import com.ylzinfo.ehc.empi.sdk.dto.response.AuthorizationTokenResponse;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by chenweida on 2018/5/16 0016.
 */
@Service
public class YLZUserService {
    Logger logger = LoggerFactory.getLogger("elasticsearch_logger");
    //网关地址
    @Value("${ylz.gateway.url}")
    private String gatewayURL;
    //1.统一实名身份认证授权
    @Value("${ylz.empi_uimc_authorization.method}")
    private String empiUimcAuthorization;
    //2.统一实名用户信息获取
    @Value("${ylz.empi_uimc_query.method}")
    private String empiUimcQuery;
    @Value("${ylz.appId}")
    private String appId;
    private String termId = "01";
    @Value("${ylz.appSecret}")
    private String appSecret;
    @Value("${ylz.redirectUrl}")
    private String redirectUrl;
    @Value("${server.server_url}")
    private String server_url;
    @Autowired
    private SocialSecurityInfoDao socialSecurityInfoDao;
    private String signType = "MD5";
    private String encryptType = "AES";
    private final String responseType = "token";
    private final String version = "1.0";
    public AuthorizationTokenResponse getAccessToken(String openId) {
        try {
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
            logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
            try {
                Map params = new HashMap();
                params.put("response_type", responseType);
                params.put("redirect_url", redirectUrl);
                params.put("auth_type", "IXM");
                params.put("domain_cust_id", "openId");
                logger.info(net.sf.json.JSONObject.fromObject(params).toString());
                //params 为自行解析回调参数。 key值参考文档
                ResponseParams<AuthorizationTokenResponse> response = empiClient.checkResponseParams(params, AuthorizationTokenResponse.class);
                if (empiClient.isSuccessful(response)) {
                    AuthorizationTokenResponse authorizationTokenResponse = response.getBizContent();
                    logger.info(net.sf.json.JSONObject.fromObject(authorizationTokenResponse).toString());
                    return authorizationTokenResponse;
                } else {
                    logger.error(new StringBuffer("调用易联众接口失败: " + empiUimcAuthorization + "," + net.sf.json.JSONObject.fromObject(response)).toString());
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Exception e) {
            logger.error(e.getMessage());
            return null;
        }
        return null;
    }
    /**
     * 此方式仅应用到注册回调
     */
    public UserInfoResponse getUserByToken(String token) {
        EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
        try {
            logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
            UserInfoRequest params = new UserInfoRequest();
            params.setAccessToken(token);
            logger.info(net.sf.json.JSONObject.fromObject(params).toString());
            ResponseParams<UserInfoResponse> response = empiClient.queryUserInfo(params);
            if (empiClient.isSuccessful(response)) {
                UserInfoResponse userInfoResponse = response.getBizContent();
                logger.info(net.sf.json.JSONObject.fromObject(userInfoResponse).toString());
                return userInfoResponse;
            } else {
                logger.error(new StringBuffer("调用易联众接口失败: " + empiUimcAuthorization + "," + net.sf.json.JSONObject.fromObject(response)).toString());
            }
            return null;
        } catch (Exception e) {
            logger.error(e.getMessage());
            return null;
        }
    }
    public String securityURL(String openId) {
        String url = "";
        try {
            EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
            try {
                logger.info(net.sf.json.JSONObject.fromObject(empiClient).toString());
                AuthorizationTokenRequest params = new AuthorizationTokenRequest();
                params.setRedirectUrl(server_url + redirectUrl);
                params.setAuthType("IXM");
                params.setDomainCustId(openId);
                params.setResponseType(responseType);
                url = empiClient.createUrl("gatewayPage", "empi.uimc.authorization", params);
                logger.info(url);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return url;
    }
    @Transactional
    public  Map<String, String> synchronousBSInfo(String params) {
        logger.info(params);
        EhcEmpiClient empiClient = new EhcEmpiClient(gatewayURL, appId, appSecret, termId, version, signType, encryptType);
        try {
            //获取get params 入参 转换 并解密验签
            ResponseParams<AuthorizationTokenResponse> response = empiClient.checkURLResponseParams(params, AuthorizationTokenResponse.class);
            UserInfoResponse userInfoResponse = getUserByToken(response.getBizContent().getAccessToken());
            List<UserInfoResponse.CardInfo> cards = userInfoResponse.getCardInfo();
            UserInfoResponse.CardInfo ssc = null;
            for (UserInfoResponse.CardInfo card : cards) {
                //如果患者有正常状态的社保卡
                if ("01".equals(card.getCardType()) && "normal".equals(card.getState().toLowerCase())) {
                    ssc = card;
                    break;
                }
            }
            //同步社保卡号
            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(userInfoResponse.getIdNo());
            //如果我们表没有记录那就新增一条记录
            if(socialSecurityInfo==null){
                socialSecurityInfo=new SocialSecurityInfo();
                socialSecurityInfo.setXming0(userInfoResponse.getName());
                socialSecurityInfo.setXbie00(IdCardUtil.getSexForIdcard(userInfoResponse.getIdNo()));
                socialSecurityInfo.setCsrqi0(IdCardUtil.getBirthdayForIdcardStr(userInfoResponse.getIdNo()));
                socialSecurityInfo.setSfzh18(userInfoResponse.getIdNo());
                socialSecurityInfo.setGrsfen("8");
                socialSecurityInfo.setId0000(userInfoResponse.getIdNo());
                socialSecurityInfo.setGzztai("01");
                socialSecurityInfo.setCardno(ssc.getCardNo());
                socialSecurityInfo.setCard16(userInfoResponse.getIdNo().substring(0,16));
                socialSecurityInfoDao.save(socialSecurityInfo);
            }
            //如果医保卡不一致更新{
            if(!socialSecurityInfo.getCardno().equals(ssc.getCardNo())){
                socialSecurityInfo.setCardno(ssc.getCardNo());
            }
            Map<String, String> checkReturnModel=new HashMap<>();
            checkReturnModel.put("name",userInfoResponse.getName());
            checkReturnModel.put("mobile",userInfoResponse.getTelephone());
            checkReturnModel.put("idCard",userInfoResponse.getIdNo());
            checkReturnModel.put("ssc",ssc.getCardNo());
            return checkReturnModel;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}

+ 38 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java

@ -0,0 +1,38 @@
package com.yihu.wlyy.service.weixin.applets;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
/**
 * Created by Trick on 2018/5/23.
 */
@Service
@Transactional
public class AppletsService {
    private String appid = "wx47ecd9a6372e7c96";
    private String appSecret ="9df49ebba7d5cdf8b9a77213bbf36807";
    public Map<String,Object> checkApplets(String code) throws Exception{
        HttpUtils httpUtils = new HttpUtils();
        Map<String,Object> param = new HashedMap();
        param.put("appid",appid);
        param.put("secret",appSecret);
        param.put("js_code",code);
        param.put("grant_type","authorization_code");
        HttpResponse response = httpUtils.doGet("https://api.weixin.qq.com/sns/jscode2session",param);
        JSONObject rs = new JSONObject(response.getContent());
        Map<String,Object> res = new HashedMap();
        res.put("openid",rs.getString("openid"));
        res.put("sessionKey",rs.getString("session_key"));
        return res;
    }
}

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/IdCardUtil.java

@ -122,6 +122,30 @@ public class IdCardUtil {
        return b;
    }
    /**
     * 身份证提取出身日期
     *
     * @param card
     * @return
     * @throws Exception
     */
    public static String getBirthdayForIdcardStr(String card)
            throws Exception {
        if (card.length() == 18) {
            String year = card.substring(6).substring(0, 4);// 得到年份
            String yue = card.substring(10).substring(0, 2);// 得到月份
            String ri = card.substring(12).substring(0, 2);// 得到日
            // String day=CardCode.substring(12).substring(0,2);//得到日
            return year + yue + ri;
        } else if (card.length() == 15) {
            String uyear = "19" + card.substring(6, 8);// 年份
            String uyue = card.substring(8, 10);// 月份
            String uri = card.substring(10, 12);// 得到日
            return uyear + uyue + uri;
        }
        return null;
    }
    /**
     * 根据身份证的号码算出当前身份证持有者的性别
     * 1 女 2 男 3未知

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/MessageType.java

@ -177,6 +177,12 @@ public class MessageType {
		D_P_WRD, 续方消息, 待取药
	}
	public static enum MESSAGE_TYPE_SAVE_HEALTH_EDU_ARTICLE{
		D_EDU_01,新增文章审核消息
	}
	public static enum MESSAGE_TYPE_AUTHEN_HEALTH_EDU_ARTICLE{
		D_EDU_02,新增文章认证消息
	}
}

+ 41 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/http/HttpResponse.java

@ -0,0 +1,41 @@
package com.yihu.wlyy.util.http;
/**
 * Utils - Http请求辅助类,简化页面页面判断逻辑
 * Created by progr1mmer on 2018/1/16.
 */
public class HttpResponse {
    private int status;
    private String content;
    public HttpResponse(int status, String content) {
        this.status = status;
        this.content = content;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public boolean isSuccessFlg() {
        return status == 200;
    }
    public String getErrorMsg() {
        return content;
    }
}

+ 449 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/http/HttpUtils.java

@ -0,0 +1,449 @@
package com.yihu.wlyy.util.http;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.*;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.util.StringUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Utils - HTTP请求辅助工具类
 * Created by progr1mmer on 2017/9/27.
 */
public class HttpUtils {
    public static HttpResponse doGet(String url, Map<String, Object> params) throws Exception {
        return doGet(url, params, null);
    }
    public static HttpResponse doGet(String url, Map<String, Object> params, Map<String, String> headers) throws Exception {
        return doGet(url, params, headers, null, null);
    }
    public static HttpResponse doGet(String url, Map<String, Object> params, Map<String, String> headers, String username, String password) throws Exception {
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
        if (params != null) {
            for (String key : params.keySet()) {
                Object value = params.get(key);
                if (value != null) {
                    nameValuePairList.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
                }
            }
        }
        String paramStr = EntityUtils.toString(new UrlEncodedFormEntity(nameValuePairList, "UTF-8"));
        HttpGet httpGet = new HttpGet(url + "?" + paramStr);
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpGet.addHeader(key, headers.get(key));
            }
        }
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpGet);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" GET: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    public static HttpResponse doPost(String url, Map<String, Object> params) throws Exception {
        return doPost(url, params, null);
    }
    public static HttpResponse doPost(String url, Map<String, Object> params, Map<String, String> headers) throws Exception{
        return doPost(url, params, headers, null, null);
    }
    public static HttpResponse doPost(String url, Map<String, Object> params, Map<String, String> headers, String username, String password) throws Exception{
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        HttpPost httpPost = new HttpPost(url);
        List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
        if (params != null) {
            for (String key : params.keySet()) {
                Object value = params.get(key);
                if (value != null) {
                    nameValuePairList.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
                }
            }
        }
        httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairList, "UTF-8"));
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpPost.addHeader(key, headers.get(key));
            }
        }
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpPost);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
        if(status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" POST: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    public static HttpResponse doJsonPost(String url, String jsonData, Map<String, String> headers, String username, String password) throws Exception{
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        HttpPost httpPost = new HttpPost(url);
        httpPost.setHeader("Content-Type", "application/json;charset=UTF-8");
        httpPost.setEntity(new StringEntity(jsonData, "UTF-8"));
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpPost.addHeader(key, headers.get(key));
            }
        }
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpPost);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if(status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" POST: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    public static HttpResponse doPut(String url, Map<String, Object> params) throws Exception {
        return doPut(url, params, null);
    }
    public static HttpResponse doPut(String url, Map<String, Object> params, Map<String, String> headers) throws Exception {
        return doPut(url, params, headers, null, null);
    }
    public static HttpResponse doPut(String url, Map<String, Object> params, Map<String, String> headers, String username, String password) throws Exception {
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        HttpPut httpPut = new HttpPut(url);
        List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
        if (params != null) {
            for (String key : params.keySet()) {
                Object value = params.get(key);
                if (value != null) {
                    nameValuePairList.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
                }
            }
        }
        httpPut.setEntity(new UrlEncodedFormEntity(nameValuePairList, "UTF-8"));
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpPut.addHeader(key, headers.get(key));
            }
        }
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpPut);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" PUT: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    public static HttpResponse doJsonPut(String url, String jsonData, Map<String, String> headers, String username, String password) throws Exception {
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        HttpPut httpPut = new HttpPut(url);
        httpPut.setHeader("Content-Type", "application/json;charset=UTF-8");
        httpPut.setEntity(new StringEntity(jsonData, "UTF-8"));
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpPut.addHeader(key, headers.get(key));
            }
        }
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpPut);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" PUT: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    public static HttpResponse doDelete(String url, Map<String, Object> params) throws Exception {
        return doDelete(url, params, null);
    }
    public static HttpResponse doDelete(String url, Map<String, Object> params, Map<String, String> headers) throws Exception {
        return doDelete(url, params, headers, null, null);
    }
    public static HttpResponse doDelete(String url, Map<String, Object> params, Map<String, String> headers, String username, String password) throws Exception {
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
        if (params != null) {
            for (String key : params.keySet()) {
                Object value = params.get(key);
                if (value != null) {
                    nameValuePairList.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
                }
            }
        }
        String paramStr = EntityUtils.toString(new UrlEncodedFormEntity(nameValuePairList, "UTF-8"));
        HttpDelete httpDelete = new HttpDelete(url + "?" + paramStr);
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpDelete.addHeader(key, headers.get(key));
            }
        }
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpDelete);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" DELETE: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    public static HttpResponse doUpload(String url, Map<String, Object> params, File file) throws Exception {
        return doUpload(url, params, null, file, null, null);
    }
    public static HttpResponse doUpload(String url, Map<String, Object> params, Map<String, String> headers, File file) throws Exception {
        return doUpload(url, params, headers, file, null, null);
    }
    public static HttpResponse doUpload(String url, Map<String, Object> params, Map<String, String> headers, File file, String username, String password) throws Exception {
        String response;
        int status;
        CloseableHttpClient httpClient = null;
        CloseableHttpResponse closeableHttpResponse = null;
        HttpPost httpPost = new HttpPost(url);
        MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
        FileBody fileBody = new FileBody(file);
        multipartEntityBuilder.addPart("file", fileBody);
        if (params != null) {
            for (String key : params.keySet()) {
                Object value = params.get(key);
                if (value != null) {
                    multipartEntityBuilder.addTextBody(key, String.valueOf(params.get(key)), ContentType.TEXT_PLAIN);
                }
            }
        }
        if (headers != null) {
            for (String key : headers.keySet()) {
                httpPost.addHeader(key, headers.get(key));
            }
        }
        HttpEntity reqEntity = multipartEntityBuilder.build();
        httpPost.setEntity(reqEntity);
        try {
            if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) {
                UsernamePasswordCredentials usernamePasswordCredentials = new UsernamePasswordCredentials(username, password);
                CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
                credentialsProvider.setCredentials(AuthScope.ANY, usernamePasswordCredentials);
                httpClient = HttpClients.custom().setDefaultCredentialsProvider(credentialsProvider).build();
            } else {
                httpClient = HttpClients.createDefault();
            }
            closeableHttpResponse = httpClient.execute(httpPost);
            HttpEntity resEntity = closeableHttpResponse.getEntity();
            status = closeableHttpResponse.getStatusLine().getStatusCode();
            response = getRespString(resEntity);
        } finally {
            try {
                if (closeableHttpResponse != null) {
                    closeableHttpResponse.close();
                }
                if (httpClient != null) {
                    httpClient.close();
                }
            }catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (status != HttpStatus.SC_OK) {
//            LogService.getLogger().error(" POST UPLOAD: " + url + " " + status);
        }
        HttpResponse httpResponse = new HttpResponse(status, response);
        return httpResponse;
    }
    private static String getRespString(HttpEntity entity) throws Exception {
        if (entity == null) {
            return null;
        }
        InputStream is = entity.getContent();
        BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
        StringBuilder stringBuilder = new StringBuilder();
        String line;
        while ((line = reader.readLine()) != null) {
            stringBuilder.append(line);
        }
        return stringBuilder.toString();
    }
}

+ 54 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/http/IPInfoUtils.java

@ -0,0 +1,54 @@
package com.yihu.wlyy.util.http;
import javax.servlet.http.HttpServletRequest;
/**
 * Utils - ip信息辅助工具类
 * Created by progr1mmer on 2018/1/18.
 */
public class IPInfoUtils {
    private static final long A1 = getIpNum("10.0.0.0");
    private static final long A2 = getIpNum("10.255.255.255");
    private static final long B1 = getIpNum("172.16.0.0");
    private static final long B2 = getIpNum("172.31.255.255");
    private static final long C1 = getIpNum("192.168.0.0");
    private static final long C2 = getIpNum("192.168.255.255");
    private static final long D1 = getIpNum("10.44.0.0");
    private static final long D2 = getIpNum("10.69.0.255");
    private static long getIpNum(String ipAddress) {
        String [] ip = ipAddress.split("\\.");
        long a = Integer.parseInt(ip[0]);
        long b = Integer.parseInt(ip[1]);
        long c = Integer.parseInt(ip[2]);
        long d = Integer.parseInt(ip[3]);
        return a * 256 * 256 * 256 + b * 256 * 256 + c * 256 + d;
    }
    public static boolean isInnerIP(String ip){
        long n = getIpNum(ip);
        return (n >= A1 && n <= A2) || (n >= B1 && n <= B2) || (n >= C1 && n <= C2) || (n >= D1 && n <= D2);
    }
    public static String getIPAddress(HttpServletRequest request) {
        String ip = request.getHeader("x-forwarded-for");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("WL-Proxy-Client-IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_CLIENT_IP");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
        }
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getRemoteAddr();
        }
        return ip;
    }
}

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

@ -51,7 +51,7 @@ public class BaseController {
            JSONObject json = new JSONObject(userAgent);
            return json.getString("uid");
//            return "xh1D2017031502222";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
//            return "test00000000005";// wjw00000001000e6badcfa163e424589/wjw00000001000e6badcfa163e424525
        } catch (Exception e) {
            return null;
        }
@ -220,7 +220,7 @@ public class BaseController {
                userAgent = request.getHeader("User-Agent");
            }
            JSONObject json = new JSONObject(userAgent);
            return json.getJSONObject("currentUserRole").getString("level");
            return json.getJSONObject("currentUserRole").get("level")+"";
        } catch (Exception e) {
            return null;
        }

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -203,9 +203,9 @@ public class LoginController extends BaseController {
                        one.put("level","4");
                        if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                            one.put("authOperate", "1");
                            one.put("doctorAuthOperate", "1");
                        }else{
                            one.put("authOperate", "0");
                            one.put("doctorAuthOperate", "0");
                        }
                        map.put("currentUserRole", one);
                    }
@ -313,9 +313,9 @@ public class LoginController extends BaseController {
                         one.put("areas", "");
                         one.put("level","4");
                        if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                            one.put("authOperate", "1");
                            one.put("doctorAuthOperate", "1");
                        }else{
                            one.put("authOperate", "0");
                            one.put("doctorAuthOperate", "0");
                        }
                        map.put("currentUserRole", one);
                    }

+ 98 - 39
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -15,14 +15,13 @@ import com.yihu.wlyy.service.common.account.AccessTokenService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.service.common.login.LoginLogService;
import com.yihu.wlyy.service.third.ylz.YLZUserService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.MD5;
import com.yihu.wlyy.util.RSAUtils;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.WeixinBaseController;
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
import com.yihu.wlyy.wechat.util.WeiXinTagUtil;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
@ -34,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.*;
@ -73,6 +73,8 @@ public class WechatController extends WeixinBaseController {
    private WeiXinTagUtil weiXinTagUtil;
    @Autowired
    private RSAUtils rsaUtils;
    @Autowired
    private YLZUserService ylzUserService;
    /**
@ -132,7 +134,7 @@ public class WechatController extends WeixinBaseController {
            // 解密身份证号
            //idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
            rsaUtils.setBaseService(patientService);
            idcard =rsaUtils.decryptString(idcard);
            idcard = rsaUtils.decryptString(idcard);
            idcard = URLDecoder.decode(idcard, "UTF-8");
            idcard = StringUtils.reverse(idcard);
@ -188,7 +190,7 @@ public class WechatController extends WeixinBaseController {
    @ResponseBody
    public String regist(@RequestParam(value = "name", required = true) String name,
                         @RequestParam(value = "idcard", required = true) String idcard,
                         @RequestParam(value = "ssc", required = false) String ssc,
                         @RequestParam(value = "ssc", required = true) String ssc,
                         @RequestParam(value = "mobile", required = true) String mobile,
                         @RequestParam(value = "captcha", required = true) String captcha,
                         @RequestParam(value = "openid", required = true) String openid,
@ -200,9 +202,9 @@ public class WechatController extends WeixinBaseController {
            if (StringUtils.isEmpty(idcard)) {
                return error(-1, "身份证号不允许为空!");
            }
//            if (StringUtils.isEmpty(ssc)) {
//                return error(-1, "社保卡号不允许为空!");
//            }
            if (StringUtils.isEmpty(ssc)) {
                return error(-1, "社保卡号不允许为空!");
            }
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "手机号不允许为空!");
            }
@ -240,24 +242,80 @@ public class WechatController extends WeixinBaseController {
            } else {
                return error(-1, "请输入正确的身份证号!");
            }
//            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
            //==========================同步易联众的医保卡号=============================
            //判断此人有没有厦门社保卡 没有补给注册
            //判断身份证号与姓名是否一致
            //判断身份证和社保卡是否一致  统一只存英文字母开头的医保卡
//            if (!org.springframework.util.StringUtils.isEmpty(token)) {
//                UserInfoResponse userInfoResponse = ylzUserService.getUserByToken(token);
//                if (userInfoResponse.getCardInfo() != null && userInfoResponse.getCardInfo().size() > 0) {
//                    List<UserInfoResponse.CardInfo> cards = userInfoResponse.getCardInfo();
//                    Boolean hasCard = false;
//                    UserInfoResponse.CardInfo cardInfo = null;
//                    for (UserInfoResponse.CardInfo card : cards) {
//                        //如果患者有正常状态的社保卡
//                        if ("01".equals(card.getCardType()) && "normal".equals("state")) {
//                            hasCard = true;
//                            cardInfo = card;
//                            break;
//                        }
//                    }
//
//            if (socialSecurityInfo != null) {
//                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
//                    return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
//                }
//                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0) {
//                    if (ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
//                    if (!hasCard) {
//                        return error(-1, "医保卡不存在,必须使用正常状态的厦门医保卡");
//                    }
//                    if (name.compareTo(userInfoResponse.getName() == null ? "" : userInfoResponse.getName()) != 0) {
//                        return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
//                    }
//                    if (ssc.compareTo(cardInfo.getCardNo() == null ? "" : cardInfo.getCardNo()) != 0) {
//                        return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
//                    } else {
//                        ssc = socialSecurityInfo.getCardno();//统一只存英文字母开头的医保卡
//                        ssc = cardInfo.getCardNo();//统一只存英文字母开头的医保卡
//                    }
//                    SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
//                    //如果我们表没有记录那就新增一条记录
//                    if(socialSecurityInfo==null){
//                        socialSecurityInfo=new SocialSecurityInfo();
//                        socialSecurityInfo.setXming0(name);
//                        socialSecurityInfo.setXbie00(IdCardUtil.getSexForIdcard(idcard));
//                        socialSecurityInfo.setCsrqi0(IdCardUtil.getBirthdayForIdcardStr(idcard));
//                        socialSecurityInfo.setSfzh18(idcard);
//                        socialSecurityInfo.setGrsfen("8");
//                        socialSecurityInfo.setId0000(idcard);
//                        socialSecurityInfo.setGzztai("01");
//                        socialSecurityInfo.setCardno(ssc);
//                        socialSecurityInfoDao.save(socialSecurityInfo);
//                    }
//                    //如果医保卡不一致更新{
//                    if(!socialSecurityInfo.getCardno().equals(ssc)){
//                        socialSecurityInfo.setCardno(ssc);
//                    }
//
//
//                }
//            } else {
//                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
//
//            }
            //==============================旧版验证=========================
            SocialSecurityInfo socialSecurityInfo = socialSecurityInfoDao.findBySfzh18Max(idcard);
            if (socialSecurityInfo != null) {
                if (name.compareTo(socialSecurityInfo.getXming0() == null ? "" : socialSecurityInfo.getXming0()) != 0) {
                    return error(-1, "身份证号与姓名不一致<br/>请检查后重新输入");
                }
                if (ssc.compareTo(socialSecurityInfo.getCardno() == null ? "" : socialSecurityInfo.getCardno()) != 0) {
                    if (ssc.compareTo(socialSecurityInfo.getCard16() == null ? "" : socialSecurityInfo.getCard16()) != 0) {
                        return error(-1, "身份证号与医保卡号不一致,请检查后重新输入");
                    } else {
                        ssc = socialSecurityInfo.getCardno();//统一只存英文字母开头的医保卡
                    }
                }
            } else {
                return error(-1, "对不起,暂不支持16年6月份之后办理的医保卡注册");
            }
            //==========================旧版验证=============================
            Patient patient = patientDao.findByIdcard(idcard);
            if (patient == null) {
@ -278,7 +336,7 @@ public class WechatController extends WeixinBaseController {
            password = StringUtils.reverse(password);
            patient.setPassword(MD5.GetMD5Code(password + salt));
            patient.setSsc(ssc);
            if(!"undefined".equals(openid)&&StringUtils.isNotBlank(openid)){
            if (!"undefined".equals(openid) && StringUtils.isNotBlank(openid)) {
                patient.setOpenid(openid);
                patient.setOpenidTime(new Date());
            }
@ -287,7 +345,7 @@ public class WechatController extends WeixinBaseController {
//                patient.setOpenidTime(new Date());
//            }
            JSONObject json = patientService.register(idcard, ssc, name, mobile, MD5.GetMD5Code(password + salt)
                    ,salt,openid,3);
                    , salt, openid, 3);
            if (json != null) {
                try {
                    Patient p = patientDao.findByIdcard(idcard);
@ -307,6 +365,7 @@ public class WechatController extends WeixinBaseController {
        }
    }
    /**
     * 患者微信登录接口
     *
@ -384,22 +443,22 @@ public class WechatController extends WeixinBaseController {
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                        //patient.setOpenid(openid);
                        //1.判斷居民OPenid是不是空
                        if(StringUtils.isNotBlank(p.getOpenid())){
                        if (StringUtils.isNotBlank(p.getOpenid())) {
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            if(!p.getOpenid().equals(openid)){
                            if (!p.getOpenid().equals(openid)) {
                                //判断登录的openids是否被大于10人登录
                                if(!patientService.checkOpenidCount(openid)){
                                    errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                if (!patientService.checkOpenidCount(openid)) {
                                    errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                    return error(-2, errorMessage);
                                }
                            }
                            patientService.updatePatient(p, openid);
                        }else{
                        } else {
                            // 判断登录的openids是否被大于10人登录
                            if(!patientService.checkOpenidCount(openid)){
                                errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                            if (!patientService.checkOpenidCount(openid)) {
                                errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                return error(-2, errorMessage);
                            }else{
                            } else {
                                //未达到上限更新用户openid
                                patientService.updatePatient(p, openid);
                            }
@ -422,7 +481,7 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setLoginType("1");
                    loginLogService.saveLog(loginLog);
                    //判断是否打过标签
                   //if (!(Patient.isWchatTage.yes.getValue() == p.getIsWxtag())) {
                    //if (!(Patient.isWchatTage.yes.getValue() == p.getIsWxtag())) {
                    //清空患者的微信标签
                    weiXinTagUtil.deleteTagWithOpenid(p.getOpenid());
@ -510,22 +569,22 @@ public class WechatController extends WeixinBaseController {
                    if (StringUtils.isNotBlank(openid) && !"undefined".equals(openid)) {//undefined不更新数据库
                        //patient.setOpenid(openid);
                        //1.判斷居民OPenid是不是空
                        if(StringUtils.isNotBlank(p.getOpenid())){
                        if (StringUtils.isNotBlank(p.getOpenid())) {
                            //如果OPenid与原来用户不相等,则判断登录的openids是否被大于10人登录
                            if(!p.getOpenid().equals(openid)){
                            if (!p.getOpenid().equals(openid)) {
                                //判断登录的openids是否被大于10人登录
                                if(!patientService.checkOpenidCount(openid)){
                                    errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                if (!patientService.checkOpenidCount(openid)) {
                                    errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                    return error(-2, errorMessage);
                                }
                            }
                            patientService.updatePatient(p, openid);
                        }else{
                        } else {
                            // 判断登录的openids是否被大于10人登录
                            if(!patientService.checkOpenidCount(openid)){
                                errorMessage ="您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                            if (!patientService.checkOpenidCount(openid)) {
                                errorMessage = "您已超过系统允许登录的最大居民账号数量,当前不再允许使用该微信登录新的居民账号,请使用其他微信号进行登录";
                                return error(-2, errorMessage);
                            }else{
                            } else {
                                //未达到上限更新用户openid
                                patientService.updatePatient(p, openid);
                            }

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java

@ -33,9 +33,10 @@ public class ImMessageController extends BaseController {
    @RequestMapping(value = "messages",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    @ApiOperation("查询医生未读消息和最后消息")
    public String messages() {
    public String messages(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                               @RequestParam(value = "type", required = false,defaultValue = "15") Integer type) {
        try {
            JSONObject json = messageService.findDoctorAllMessage(getUID());
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type);
            return write(200, "获取消息总数成功!", "data", json);
        } catch (Exception e) {
            error(e);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -146,9 +146,9 @@ public class DoctorController extends BaseController {
                one.put("level","4");
                if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                    one.put("authOperate", "1");
                    one.put("doctorAuthOperate", "1");
                }else{
                    one.put("authOperate", "0");
                    one.put("doctorAuthOperate", "0");
                }
                map.put("currentUserRole", one);
            }

+ 12 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -3,6 +3,8 @@ package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.health.HealthEduArticleLabelService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.util.ElasticsearchUtil;
@ -18,6 +20,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@ -42,6 +45,8 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private HealthEduArticleLabelService healthEduArticleLabelService;
    @Autowired
    private DoctorInfoService doctorInfoService;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加、编辑文章")
@ -240,7 +245,7 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    @ApiOperation("文章认证")
    public  String authenticationArticle(@ApiParam(name = "articleId", value = "文章id,多个文章‘,’隔开")
                                         @RequestParam(value = "articleId", required = true) String articleId,
                                         @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证")
                                         @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证,2(认证但未通过)")
                                         @RequestParam(value = "isAuthentication", required = true) String isAuthentication,
                                         @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                         @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
@ -249,13 +254,15 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                         @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                         @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                         @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                                         @RequestParam(value = "secondLevelCategoryName", required = false) String secondLevelCategoryName){
                                         @RequestParam(value = "secondLevelCategoryName", required = false) String secondLevelCategoryName,
                                         @ApiParam(name = "reasonContent", value = "原因内容")
                                         @RequestParam(value = "reasonContent", required = false) String reasonContent){
        try{
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            return success("认证成功!");
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName,reasonContent,getUID());
            return success("操作成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"认证失败!");
            return error(-1,"操作失败!");
        }
    }

+ 47 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
@ -33,13 +34,16 @@ public class DoctorMessageController extends BaseController {
    @Autowired
    private MessageService messageService;
    private ObjectMapper objectMapper = new ObjectMapper();
    @Autowired
    private MessageDao messageDao;
    @RequestMapping(value = "messages")
    @ResponseBody
    @ApiOperation("查询医生未读消息和最后消息")
    public String messages() {
    public String messages(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                               @RequestParam(value = "type", required = false) Integer type) {
        try {
            JSONObject json = messageService.findDoctorAllMessage(getUID());
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type);
            return write(200, "获取消息总数成功!", "data", json);
        } catch (Exception e) {
            error(e);
@ -206,6 +210,30 @@ public class DoctorMessageController extends BaseController {
        }
    }
    /**
     * 文章审核
     * @param page
     * @param pagesize
     * @return
     */
    @RequestMapping(value = "getEduArticleMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取文章审核消息")
    public String getEduArticleMessage(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                                           @RequestParam(value = "type", required = false) Integer type,
                                        @ApiParam(value = "第几页", defaultValue = "1")
                                       @RequestParam Integer page,
                                       @ApiParam(value = "每页几行", defaultValue = "10")
                                       @RequestParam Integer pagesize){
        try{
            List<Message> list = messageService.getEduArticleMessage(getUID(),type,page,pagesize);
            return write(200,"获取消息成功!", "list", list);
        }catch (Exception e){
            error(e);
            return error(-1, "获取消息失败!");
        }
    }
    @RequestMapping(value = "getHealthIndexMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取超标指标消息--根据患者分组")
@ -400,4 +428,21 @@ public class DoctorMessageController extends BaseController {
            return error(-1, "设置失败");
        }
    }
    @RequestMapping(value = "delectArticleMessage", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("删除健康文章已处理的消息")
    public String delectArticleMessage(@ApiParam(name = "articleId", value = "健康文章的code")
                                           @RequestParam(value = "articleId", required = true) String articleId) throws Exception {
        try {
            if(messageService.setMessageDel(getUID(),articleId)){
                return write(200, "删除成功");
            }
            return error(-1,"删除失败");
        } catch (Exception ex) {
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }
}

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -530,8 +530,8 @@ public class PatientInfoController extends BaseController {
    @ApiOperation("在绑定设备的时候查找患者(带签约信息)")
    public String getPatientSignByNameOrIdCard(@ApiParam(value = "关键搜索词", name = "keyWord") @RequestParam(value = "keyWord",required = true)String keyWord,
                                               @ApiParam(value = "设备sn码", name = "deviceSn") @RequestParam(value = "deviceSn",required = true)String deviceSn,
                                                @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
                                                @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize){
                                               @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
                                               @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize){
        if (StringUtils.isBlank(pageSize)) {
            pageSize = "10";
        }
@ -545,5 +545,4 @@ public class PatientInfoController extends BaseController {
            return error( -1, "查询失败!");
        }
    }
}

+ 132 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempLabelController.java

@ -0,0 +1,132 @@
package com.yihu.wlyy.web.doctor.template;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.template.DoctorGuidanceTempLabel;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempLabelDao;
import com.yihu.wlyy.service.template.DoctorGuidanceTempLableService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/5/18.
 */
@RestController
@RequestMapping(value = "/doctor/guidance_temp/lable")
@Api(description = "医生健康指导模板标签")
public class DoctorGuidanceTempLabelController extends BaseController {
    @Autowired
    private DoctorGuidanceTempLableService doctorGuidanceTempLableService;
    @Autowired
    private DoctorGuidanceTempLabelDao doctorGuidanceTempLableDao;
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ApiOperation(value = "添加指导模板标签")
    @ObserverRequired
    public String save(@ApiParam(name = "name", value = "标签名称", required = true)
                        @RequestParam(value = "name", required = true) String name,
                        @ApiParam(name = "teamId", value = "医生团队id", required = true)
                        @RequestParam(value = "teamId", required = true) Integer teamId){
        try{
            DoctorGuidanceTempLabel doctorGuidanceTempLabel = doctorGuidanceTempLableDao.findByNameWithDel(teamId,name);
            if(doctorGuidanceTempLabel!=null){
                return error(-1,"标签名称已存在!");
            }
            DoctorGuidanceTempLabel doctorGuidanceTempLable = doctorGuidanceTempLableService.save(getUID(),name,teamId);
            if(doctorGuidanceTempLable!=null){
                return write(200,"保存标签成功!","data",doctorGuidanceTempLable);
            }
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"保存标签失败!");
        }
        return error(-1,"保存标签失败!");
    }
    @RequestMapping(value = "/findAllList", method = RequestMethod.GET)
    @ApiOperation(value = "根据团队id获取标签")
    @ObserverRequired
    public String findAllList(@ApiParam(name = "teamId", value = "医生团队id", required = true)
                               @RequestParam(value = "teamId", required = true) Integer teamId){
        try{
            List<DoctorGuidanceTempLabel> list = doctorGuidanceTempLableService.findByDoctorCode(teamId);
            if (list == null || list.size() < 1) {
                return write(200, "查询成功!");
            } else {
                return write(200, "查询成功!", "data", list);
            }
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "/findAllListByPage", method = RequestMethod.GET)
    @ApiOperation(value = "根据团队id获取标签(分页)")
    @ObserverRequired
    public String findAllListByPage(@ApiParam(name = "pageSize", value = "每页总数", required = true)
                              @RequestParam(value = "pageSize", required = true,defaultValue = "10") int pageSize,
                              @ApiParam(name = "pageNo", value = "当前页", required = true)
                              @RequestParam(value = "pageNo", required = true,defaultValue = "1") int pageNo,
                              @ApiParam(name = "teamId", value = "医生团队id", required = true)
                              @RequestParam(value = "teamId", required = true) Integer teamId){
        try{
            List<DoctorGuidanceTempLabel> list = doctorGuidanceTempLableService.findByDoctorCode(teamId, pageSize, pageNo);
            if (list == null || list.size() < 1) {
                return write(200, "查询成功!");
            } else {
                return write(200, "查询成功!", "data", list);
            }
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "/deleteLabel", method = RequestMethod.POST)
    @ApiOperation(value = "删除健康指导模板标签")
    @ObserverRequired
    public String deleteLabel(@ApiParam(name = "code", value = "标签code", required = true)
                              @RequestParam(value = "code", required = true) String code){
        try {
            boolean b = doctorGuidanceTempLableService.delete(code);
            if(b){
                return success("删除成功!");
            }
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"删除成功!");
        }
        return error(-1,"删除成功!");
    }
    @RequestMapping(value = "/updateLabel", method = RequestMethod.POST)
    @ApiOperation(value = "修改健康指导模板标签")
    @ObserverRequired
    public String updateLabel(@ApiParam(name = "code", value = "标签code", required = true)
                              @RequestParam(value = "code", required = true) String code,
                              @ApiParam(name = "name", value = "标签名称", required = true)
                              @RequestParam(value = "name", required = true) String name){
        try {
            boolean b = doctorGuidanceTempLableService.updateName(code,name);
            if(b){
                return success("修改成功!");
            }
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"修改失败!");
        }
        return error(-1,"修改失败!");
    }
}

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

@ -56,6 +56,25 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
        }
    }
    /**
     * 获取医生所属的所有团队
     *
     * @return
     */
    @RequestMapping(value = "/findDoctorLeaderTeam", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取团队长所属的团队长团队")
    public String findDoctorLeaderTeam(@RequestParam(required = false, defaultValue = "") @ApiParam(value = "搜索关键字") String filter) {
        try {
            String doctorCode = getUID();
            List teamList = doctorTeamGuidanceService.findDoctorLeaderTeam(doctorCode,filter);
            return write(200, "获取医生所属团队成功!", "teamList", teamList);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
        }
    }
    /**
     * 根据医生所属的单个团队获取团队模板列表
     *
@ -122,13 +141,15 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            @ApiParam(value = "模板内容")
            @RequestParam String content,
            @ApiParam(value = "图片路径")
            @RequestParam(required = false) String images
            @RequestParam(required = false) String images,
            @ApiParam(value = "指导标签")
            @RequestParam(required = false,defaultValue = "") String labelCode
    ) {
        try {
//            前端参数校验
            String doctor = getUID();
            JSONArray teams = new JSONArray(teamInfo);
            String guidanceCode = doctorTeamGuidanceService.saveTeamGuidance(doctor, title, teams, content, images);
            String guidanceCode = doctorTeamGuidanceService.saveTeamGuidance(doctor, title, teams, content, images,labelCode);
            return write(200, "保存团队模板成功!","guidanceCode",guidanceCode);
        } catch (Exception e) {
            return invalidUserException(e, -1, e.getMessage());
@ -251,4 +272,46 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
        }
    }
    /**
     * 根据医生所属的单个团队获取团队模板标签列表
     *
     * @param teamId
     * @return
     */
    @RequestMapping(value = "/getTeamGuidanceLabelList", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("根据单个团队标签获取团队模板列表")
    public String getTeamGuidanceListByLabel(
            @RequestParam(required = true)
            @ApiParam(value = "团队ID") Integer teamId,
            @RequestParam(required = false)
            @ApiParam(value = "团队模板标签code") String labelCode,
            @RequestParam(value = "pageNo", required = true,defaultValue = "1") int pageNo,
            @RequestParam(value = "pageSize", required = true,defaultValue = "10") int pageSize) {
        try {
            List<DoctorTeamGuidanceTemplate> list = doctorTeamGuidanceService.getGuidanceByTeamIdAndLabelCode(teamId,labelCode, pageNo , pageSize);
            return write(200, "获取团队模板列表成功!", "data", list);
        } catch (Exception e) {
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "/getTeamGuidanceListByLabelWithFilter", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("根据单个团队标签过滤条件获取团队模板列表")
    public String getTeamGuidanceListByLabelWithFilter(@RequestParam(value = "teamId",required = true)
                                                        @ApiParam(value = "团队ID") Integer teamId,
                                                       @RequestParam(value = "filter",required = true)
                                                       @ApiParam(value = "过滤条件") String filter){
        try{
            Map<String,List<DoctorTeamGuidanceTemplate>> map = doctorTeamGuidanceService.getTeamGuidanceListByLabelWithFilter(teamId ,filter);
            return write(200, "查询成功!","data",map);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/FamilyContractController.java

@ -425,7 +425,7 @@ public class FamilyContractController extends BaseController {
    public String sign(@RequestParam(required = false)String doctor,
                       @RequestParam(required = false)String patient,
                       @RequestParam(required = false)String countryCode,
                       @RequestParam(required = false)String medicareNumber) {
                       @RequestParam(required = true)String medicareNumber) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "签约医生不能为空");
@ -468,7 +468,7 @@ public class FamilyContractController extends BaseController {
                            @RequestParam(required = false) String patient,
                            @RequestParam(required = false) String reason,
                            @RequestParam(required = false) String countryCode,
                            @RequestParam(required = false) String medicareNumber) {
                            @RequestParam(required = true) String medicareNumber) {
        try {
            if (StringUtils.isEmpty(doctor)) {
                return error(-1, "签约医生不能为空");

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

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.third.jkEduArticle;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
@ -117,9 +118,11 @@ public class ThirdJkEduArticleController extends BaseController {
    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
    @ApiOperation("获取文章详情")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                 @RequestParam(value = "articleId", required = true) String articleId,
                                 @RequestParam(value = "articleId", required = true,defaultValue = "1") String articleId,
                                 @ApiParam(name = "userType", value = "用户类型:1医生,2居民",defaultValue = "1")
                                 @RequestParam(value = "userType", required = false) String userType){
                                 @RequestParam(value = "userType", required = false,defaultValue = "1") String userType,
                                 @ApiParam(name = "messageCode", value = "消息code")
                                 @RequestParam(value = "messageCode", required = false) String messageCode){
        try {
            String uid = "";
            if("2".equals(userType)){
@ -127,7 +130,7 @@ public class ThirdJkEduArticleController extends BaseController {
            }else{
                uid = getUID();
            }
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,uid,userType);
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,uid,userType,messageCode);
            if("2".equals(userType)){
                jmJkEduArticleService.readPatientArticle(getRepUID(),articleId);

+ 76 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdCheckUserController.java

@ -0,0 +1,76 @@
package com.yihu.wlyy.web.third.ylzpay;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.third.ylz.YLZUserService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.WeixinBaseController;
import com.ylzinfo.ehc.empi.sdk.dto.response.UserInfoResponse;
import com.ylzinfo.onepay.sdk.exception.PayException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONObject;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
 *
 */
@RestController
@RequestMapping(value = "/check")
@Api(description = "易联众验证相关的服务")
public class ThirdCheckUserController extends WeixinBaseController {
    private static final Logger LOGGER = LoggerFactory.getLogger("elasticsearch_logger");
    @Autowired
    ObjectMapper objectMapper;
    @Autowired
    private YLZUserService checkService;
    /**
     * 加密URL给前端
     *
     * @throws IOException
     * @throws PayException
     */
    @RequestMapping(value = "/securityURL", method = RequestMethod.POST)
    public String securityURL(
            @ApiParam(name = "openId", value = "openId", required = true) @RequestParam(value = "openId", required = true) String openId) {
        try {
            String url = checkService.securityURL(openId);
            return write(200, "获取成功!", "data", url);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "失败!");
        }
    }
    /**
     * 根据易联众返回的tokan 同步sb_info表
     *
     * @return
     */
    @RequestMapping(value = "/synchronousBSInfo", method = RequestMethod.POST)
    public String synchronousBSInfo(
            @ApiParam(name = "params", value = "params", required = true) @RequestParam(value = "params", required = true) String params) {
        try {
            Map<String, String> userInfoResponse = checkService.synchronousBSInfo(params);
            return write(200, "获取成功!", "data", userInfoResponse);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "失败!");
        }
    }
}

+ 36 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/AppletsController.java

@ -0,0 +1,36 @@
package com.yihu.wlyy.web.wx;
import com.yihu.wlyy.service.weixin.applets.AppletsService;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
 * Created by Trick on 2018/5/23.
 */
@RestController
@RequestMapping(value = "/wx/Applets", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "微信小程序相关接口")
public class AppletsController extends WeixinBaseController {
    @Autowired
    private AppletsService appletsService;
    @ApiOperation(value = "微信小程序登录信息")
    @RequestMapping(value = "/checkApplets", method = RequestMethod.GET)
    public String checkApplets(@ApiParam(name = "code", value = "小程序登录时获取的Code", required = true) @RequestParam(value = "code", required = true)String code){
        try {
            return write(200, "创建成功", "data", appletsService.checkApplets(code));
        }catch (Exception e){
            error(e);
            return error(-1, "失败");
        }
    }
}

+ 9 - 0
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -160,3 +160,12 @@ neiwang:
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
ylz:
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  gateway:
    url: http://www.mstpay.com:1300/huangsb

+ 14 - 0
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -141,12 +141,14 @@ es:
jkEdu:
  web:
#    articleBaseUrl: http://yihu.com:9088/
#    articleBaseUrl: http://172.19.103.78:9092/
    articleBaseUrl: http://172.19.103.87:9088/
#消息队列
activemq:
  username: admin
  password: admin
#  url: tcp://172.19.103.78:61616
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
@ -160,3 +162,15 @@ neiwang:
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
ylz:
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  gateway:
    url: http://www.mstpay.com:1300/huangsb

+ 11 - 1
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -143,4 +143,14 @@ neiwang:
#系统中使用的双层对称加密使用到的KEY
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway

+ 11 - 1
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -144,4 +144,14 @@ neiwang:
#系统中使用的双层对称加密使用到的KEY
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway

+ 11 - 1
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -165,4 +165,14 @@ springfox:
#系统中使用的双层对称加密使用到的KEY
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
ylz:
  appId: aaa
  appSecret:  aaa
  redirectUrl:  aaa
  termId: aaa
  gateway:
    url: http://120.42.37.94:1301/ehc-empi-web/gateway

+ 13 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -131,12 +131,14 @@ es:
#集美宣教居民端健康文章
jkEdu:
  web:
#    articleBaseUrl: http://172.19.103.78:9092/
    articleBaseUrl: http://172.19.103.87:9088/
#消息队列
activemq:
  username: admin
  password: admin
#  url: tcp://172.19.103.78:61616
  url: tcp://172.19.103.87:61616
  queue:
    healtHarticleQueue: healthArticleChannel_test  #健康文章推送
@ -149,4 +151,14 @@ neiwang:
#系统中使用的双层对称加密使用到的KEY
Riva:
  RIVAED_KEY1: LUZ7TN3KOT8AWCD3ZA4NBMI5VNF7E50F6XYEP2WZM68JQYY5JE02L4L5FS9R4NGUGMHSCAPW9AL
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
  RIVAED_KEY2: C3SHUI8OWBOA4ZASS7FEYJ6RIVXA9SW6U5OA56ERUYZTRFHCRZO8AHT4TTW2MAGT80MGXN
ylz:
  appId: 1BQ08T2R60006501A8C00000BE73319D
  appSecret:  1BQ08T2QV0006501A8C0000032313A0A
  redirectUrl:  wx/html/home/html/regist-info.html
  termId: 01
  gateway:
    url: http://www.mstpay.com:1300/huangsb

+ 10 - 0
patient-co/patient-co-wlyy/src/main/resources/application.yml

@ -42,6 +42,9 @@ spring:
      min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
      time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  aop:
    proxy-target-class: true
    # REDIS
  redis:
    database: 0 # Database index used by the connection factory.
@ -92,3 +95,10 @@ interceptor:
putMesType:
  #推送到redis消息类型
  wechat: wechat
ylz:
  empi_uimc_authorization:
    method: empi.uimc.authorization  ##认证授权获取token
  empi_uimc_query:
    method: empi.uimc.query  ##用户信息获取