Explorar el Código

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

trick9191 hace 7 años
padre
commit
b964657a91
Se han modificado 22 ficheros con 283 adiciones y 107 borrados
  1. 3 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/demographic/FamilyInfo.java
  2. 4 3
      patient-co-customization/patient-co-modern-medicine/src/main/resources/application.yml
  3. 15 11
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java
  4. 2 1
      patient-co-service/wlyy_service/src/main/resources/application.yml
  5. 3 1
      patient-co-service/wlyy_service/src/main/resources/system.properties
  6. 12 4
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java
  7. 1 1
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  8. 50 12
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  9. 65 25
      patient-co/patient-co-wlyy-job/src/main/resources/application.yml
  10. 1 1
      patient-co/patient-co-wlyy-job/src/main/resources/system.properties
  11. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java
  12. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/GateWayInterceptor.java
  13. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/PatientInterceptor.java
  14. 4 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  15. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  16. 34 32
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java
  17. 4 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java
  18. 47 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java
  19. 5 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignFamilyServiceService.java
  20. 18 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java
  21. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java
  22. 3 3
      patient-co/patient-co-wlyy/src/main/resources/application.yml

+ 3 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/demographic/FamilyInfo.java

@ -69,6 +69,9 @@ public class FamilyInfo implements java.io.Serializable {
        this.mzdzm = mzdzm;
    }
    public FamilyInfo() {
    }
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)

+ 4 - 3
patient-co-customization/patient-co-modern-medicine/src/main/resources/application.yml

@ -72,9 +72,10 @@ spring:
        username: root
        password: 123456
      wlyy:
        url: jdbc:mysql://172.19.103.77/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
        username: root
        password: 123456
        url: jdbc:mysql://172.17.110.160/wlyy?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
        username: ssgg
        password: ssgg
wechat:

+ 15 - 11
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -34,21 +34,25 @@ public class CustomerService{
		//查询签约信息
		SignFamily signInfo = contractService.findSignInfo(patient.getCode());
		if(signInfo!=null){
			signInfo.setStatusName("已签约");
		}
		//查询家庭成员的每个签约信息    以及签约医生
		List doctors = new ArrayList<Doctor>();
		for(Map<String, Object> familyMember:familyMembers) {
			//查找签约的医生信息
			String doctor = (String) familyMember.get("doctor");//医生code
			if(StringUtils.isNotBlank(doctor)){
				Doctor doctorInfo = hosDoctorService.getDoctorByCode(doctor);
				if(null!=doctorInfo){
					doctors.add(doctorInfo);
				}
		if(signInfo!=null){
			signInfo.setStatusName("已签约");
			//查找全科医生
			String doctorCode = signInfo.getDoctor();
			if(StringUtils.isNotBlank(doctorCode)){
				Doctor doctor = hosDoctorService.getDoctorByCode(doctorCode);
				doctors.add(doctor);
			}
			//查找健康管理师
			String doctorHealthCode = signInfo.getDoctorHealth();
			if(StringUtils.isNotBlank(doctorHealthCode)){
				Doctor doctor = hosDoctorService.getDoctorByCode(doctorHealthCode);
				doctors.add(doctor);
			}
		}
		resp.put("signInfo",signInfo);
		resp.put("doctors",doctors);

+ 2 - 1
patient-co-service/wlyy_service/src/main/resources/application.yml

@ -75,7 +75,8 @@ spring:
spring:
  profiles: test
  datasource:
    url: jdbc:mysql://172.17.110.160:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
#    url: jdbc:mysql://172.17.110.160:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    url: jdbc:mysql://172.19.103.85:3306/wlyy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
    username: ssgg
    password: ssgg
    driverClassName: com.mysql.jdbc.Driver

+ 3 - 1
patient-co-service/wlyy_service/src/main/resources/system.properties

@ -15,4 +15,6 @@ ca_namespace = http://platfomservice.xmca.com/
#gateway_licence = 5YGl5bq45LmL7Lev
#gateway_public_key = PublicGov.key
#jw_hospital = 350211B1004
#jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
#jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
#ca_url = http://117.29.183.114:8081/XMCAService?wsdl
#ca_namespace = http://platfomservice.xmca.com/

+ 12 - 4
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
/**
 * Created by Trick on 2017/8/7.
@ -14,20 +15,27 @@ import org.springframework.stereotype.Component;
@Component
public class RedisThread implements Runnable {
    @Value("${spring.redis.host}")
    @Value("${channel.redis.host}")
    private String url;
    @Value("${channel.redis.port}")
    private Integer port;
    @Value("${channel.redis.password}")
    private String password;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private PrescriptionService prescriptionService;
    @Override
    public void run() {
        String key = SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title");
        Jedis jedis = new Jedis(url,port);
        if(StringUtils.isNotBlank(password)){
            jedis.auth(password);
        }
        while (true){
//            redisTemplate.watch(key);
            String message = redisTemplate.opsForList().rightPop(key);
//            redisTemplate.unwatch();
            String message = jedis.rpop(key);
            if(StringUtils.isEmpty(message)){
                try{
                    Thread.sleep(1000L);//如果没有读取到记录,等待1秒

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

@ -111,7 +111,7 @@ public class PrescriptionService extends BaseService {
                try {
//                    String dispensaryCode = prescriptionDispensaryCodeDao.getCodeByPrescriptionCodeAndType(code,1);
                    StringBuffer url = new StringBuffer();
                    url.append("/wx/prescription/html/code-detail.html?prescriptionCode=").append(code);
                    url.append("prescription/html/code-detail.html?prescriptionCode=").append(code);
                    url.append("&openid=").append(patient.getOpenid());
                    url.append("&toUser=").append(patient.getCode());
                    url.append("&toName=").append(patient.getName());

+ 50 - 12
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -51,6 +51,10 @@ public class PushMsgTask {
    private String template_doctor_change;
    @Value("${wechat.message.template_doctor_survey}")
    private String template_doctor_survey;
    @Value("${wechat.message.template_doctor_audit}")
    private String template_doctor_audit;//审核结果通知
    @Value("${wechat.message.template_doctor_service}")
    private String template_doctor_service;//服务结果通知
    /**
     * 添加一条推送消息
@ -115,6 +119,7 @@ public class PushMsgTask {
            }
        }
    }
    @PostConstruct
    private void run() {
        new Thread(new ConsumerTask(httpUtil)).start();
@ -187,8 +192,8 @@ public class PushMsgTask {
    /**
     * 发送微信模板消息
     *
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更
     *             18 产检提醒和产检就诊提醒
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更(信息变更通知)
     *             18 产检提醒和产检就诊提醒 19:续方审核结果通知(0.不通过 1.通过 2。调整处方并通过) 20:服务结果通知 11.代办事项通知
     * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
     *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
     *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
@ -199,6 +204,8 @@ public class PushMsgTask {
     *             type==10时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
     *             <p>
     *             type==11时:{"first":"消息主题","name":"患教标题","doctorName":"医生名","date":"发送时间","remark":"消息备注"}
     *             type==19时:{"first":"消息主题","keyword1":"审核结果","keyword2":"审核医生","remark":"消息备注"}
     *             type==20时:{"first":"消息主题","keyword1":"服务项目","keyword2":"操作医生","keyword3":"服务时间","remark":"消息备注"}
     * @return
     */
//    private boolean sendWeixinMessage(String access_token, int type, String openid, String name, JSONObject json) {
@ -279,9 +286,9 @@ public class PushMsgTask {
                m.put("keyword3", keyword3);
            } else if (type == 1 || type == 2) {
                if (type == 1) {
                    temp_id =template_sign_success;
                    temp_id = template_sign_success;
                } else {
                    temp_id =template_sign_failed;
                    temp_id = template_sign_failed;
                }
                String isRenew = "0";
                if (json.has("isRenew")) {
@ -367,7 +374,7 @@ public class PushMsgTask {
                m.put("keyword4", keyword4);
            } else if (type == 6) {
                temp.setUrl(url + "wdyy/html/detail-appointment.html?openid=" + openid + "&orgCode=" + json.get("orgCode") + "&id=" + json.getString("id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                temp_id =template_appoint_success;
                temp_id = template_appoint_success;
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
@ -387,7 +394,7 @@ public class PushMsgTask {
                m.put("planstarttime", keyword4);
            } else if (type == 7) {
                temp.setUrl(url + "wdyy/html/my-appointment.html?openid=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                temp_id =template_appoint_failed;
                temp_id = template_appoint_failed;
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
@ -450,7 +457,11 @@ public class PushMsgTask {
                keyword5.setValue(json.getString("remark"));
                m.put("remark", keyword5);
            } else if (type == 10) {
                temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                if (json.has("url")) {
                    temp.setUrl(url + json.getString("url"));
                }else {
                    temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented"));
                }
                temp.setTemplate_id(template_doctor_change);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
@ -467,10 +478,13 @@ public class PushMsgTask {
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
            } else if (type == 11) {
                String xinurl = url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented");
                if (json.has("url")) {
                    temp.setUrl(url + json.getString("url"));
                } else {
                    String xinurl = url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name + "&represented=" + json.getString("represented");
//                temp.setUrl(url + "survey/html/survey_info.html?openid=" + openid + "&state=" + openid + "&survey_id=" + json.getString("survey_id") + "&toUser=" + json.getString("toUser") + "&toName=" + name);
                temp.setUrl(xinurl);
//                temp.setTemplate_id("fgYiMntj1amEkE8_GLUPmAIyssUAroJrNSHqvydt-PQ");
                    temp.setUrl(xinurl);
                }
                temp.setTemplate_id(template_doctor_survey);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
@ -482,8 +496,6 @@ public class PushMsgTask {
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
                logger.info("type=====>openId " + openid);
                System.out.println("url=======type =11 =====================>" + xinurl);
                logger.error("url=======type =11 =====================>" + xinurl);
            } else if (type == 12) {
                temp.setUrl(url + "jtgx/html/application-msg-list.html?openid=" + openid + "&member=" + json.getString("member") + "&toUser=" + json.getString("member") + "&toName=" + name);
@ -584,6 +596,32 @@ public class PushMsgTask {
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            } else if (type == 19) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id(template_doctor_audit);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
            } else if (type == 20) {
                temp.setUrl(url + json.getString("url"));
                temp.setTemplate_id(template_doctor_service);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
                WechatTemplateData keyword3 = new WechatTemplateData();
                keyword3.setColor("#000000");
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
            }
            temp.setData(m);

+ 65 - 25
patient-co/patient-co-wlyy-job/src/main/resources/application.yml

@ -95,6 +95,12 @@ spring:
    port: 6379 # Redis server port.
#    password: jkzl_ehr
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
server:
  server_url: http://ehr.yihu.com/wlyy/
@ -134,6 +140,10 @@ wechat:
   template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
   #审核结果通知
   template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
   #服务结果通知
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
@ -190,6 +200,12 @@ spring:
    port: 6380 # Redis server port.
    password: jkzl_ehr
channel:
  redis:
    host: 10.95.22.142 # Redis server host.
    port: 6380 # Redis server port.
    password: jkzlehr
server:
  server_url: http://www.xmtyw.cn/wlyy/
@ -229,6 +245,10 @@ wechat:
   template_doctor_change:  dtzSHImbPKfwcrjWlJEjAw3lGlvrLjsobSOE8g4adZA
   #问卷调查
   template_doctor_survey:  8ZWKJmoJ7VR7Uk4YS7aa0Z94QzCkxsyTW6R4CHhUJII
   #审核结果通知
   template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
   #服务结果通知
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
yihu:
  yihu_OpenPlatform_url: http://api.yihu.com.cn/OpenPlatform/cgiBin/1.0/
@ -284,6 +304,12 @@ spring:
    port: 6379 # Redis server port.
#    password: jkzl_ehr
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password:
server:
  server_url: http://weixin.xmtyw.cn/wlyy-dev/
@ -323,6 +349,10 @@ wechat:
   template_doctor_change:  TNIDMjduVKgVL4-k71umYLpHROvFB8K6mmm8aZC_EH8
   #问卷调查
   template_doctor_survey:  IjQvzBy0PLeft2kN9mdBhACXPE9I_jyJywJ6B-JRxsY
   #审核结果通知
   template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
   #服务结果通知
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
@ -378,7 +408,13 @@ spring:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
#    password: jkzl_ehr
    password:
channel:
  redis:
    host: 172.19.103.88 # Redis server host.
    port: 6379 # Redis server port.
    password: jkzl_ehr
server:
  server_url: http://ehr.yihu.com/wlyy/
@ -395,30 +431,34 @@ wechat:
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
   #咨询回复
   template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
   #签约成功
   template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
   #签约失败
   template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
   #健康指导提醒
   template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
   #解约提醒
   template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
   #预约成功
   template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
   #预约取消
   template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
   #缴费提醒
   template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
   #健康教育
   template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
   #医生变更
   template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA
    #咨询回复
    template_consult_notice: dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18
    #签约成功
    template_sign_success: VYGj8OUKj6FH4i4_nZS2UAHurJxQHx-7_OBPILIdB8s
    #签约失败
    template_sign_failed: m221Jrkm0UUY00ExTCpQNTB8t_1U_V4LR9Bg8BgH9-o
    #健康指导提醒
    template_health_notice: 5Nts8lA_at9Cd1JuTK-qDxx95lchpcmUfPTEwYDgXYQ
    #解约提醒
    template_termination:  qZm1NwSueAsbHaOf9DrnLoSj0X5gZuh9W7aDYzLWNds
    #预约成功
    template_appoint_success:  vU5x2tGyk1zUngBrEqMfnFqqMa6M8J98w8k5MCSUYM
    #预约取消
    template_appoint_failed:  r-bVEKgXVyl8O96saoJXlLd7DX1zW7fXA4a0PZHxiQM
    #缴费提醒
    template_expenses_remind:  pZby4Mz3H5angmjGTuvXzo9lwlaVfEiqORwI8soI-5E
    #健康教育
    template_healthy_article: aO_qqk5nAXaGXhsikPVLNelqzwlrp1LTPfIQ1qRMpxo
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

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

@ -104,6 +104,6 @@ returnUrl=wlyy.onepay.returnUrl
#长处方
#redist订阅消息主题
#开方成功/开方失败消息主题
redisAddPrescription=redisAddPrescription
redis_prescription_title=redisPrescription
#是否需要药师审方
pharmacistExaminationType=false

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/DoctorInterceptor.java

@ -37,7 +37,7 @@ public class DoctorInterceptor extends BaseInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        boolean flag = true;
        if(Flag.close.equals(status)){
        if(Flag.close.getValue().equals(status)){
            return true;
        }

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/GateWayInterceptor.java

@ -63,7 +63,9 @@ public class GateWayInterceptor implements HandlerInterceptor {
     */
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if(Flag.close.getValue().equals(status)){
            return true;
        }
        boolean flag = true;
        String accesstoken = request.getHeader("accesstoken");
        String ip = NetworkUtil.getIpAddress(request);

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/PatientInterceptor.java

@ -35,7 +35,11 @@ public class PatientInterceptor extends BaseInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        boolean flag = true;
        if(Flag.close.getValue().equals(status)){
            return true;
        }
        try {
            request.setCharacterEncoding("UTF-8");
            response.setHeader("Content-type", "text/html;charset=UTF-8");
            request.setAttribute("log-start", new Date().getTime());

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -879,6 +879,7 @@ public class ConsultTeamService extends ConsultService {
            ct.setCzrq(new Date());
            ct.setDel("1");
            ct.setStatus(0);
            ct.setEvaluate(0);
            // 医生未读数量为1
            ct.setDoctorRead(1);
            // 添加咨询记录
@ -1058,10 +1059,10 @@ public class ConsultTeamService extends ConsultService {
        message.setRead(1);//设置未读
        message.setOver("1");
        message.setReceiver(prescription.getDoctor());
        message.setSender("system");
        message.setSender(prescription.getPatient());
        message.setCode(getCode());
        message.setSenderName("系统");
        message.setTitle("续方申请");
        message.setSenderName(prescription.getPatientName());
        message.setTitle(prescription.getPatientName()+"申请续方");
        message.setContent("您有一条新的续方申请待处理!");
        message.setType(6);//续方咨询待审核提醒
        message.setReadonly(1);//是否只读消息

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

@ -439,7 +439,7 @@ public class MessageService extends BaseService {
     */
    public List<Message> getSystemMessage(String doctor, Integer page, Integer pagesize) throws Exception {
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "czrq");
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.getSystemMessage(doctor, pageRequest);
@ -451,7 +451,7 @@ public class MessageService extends BaseService {
     */
    public List<Message> getPrescriptionMessage(String doctor,Integer type, Integer page, Integer pagesize) throws Exception {
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "czrq");
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.getPrescriptionMessage(doctor,type, pageRequest);

+ 34 - 32
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -575,36 +575,7 @@ public class PatientPrescriptionPayService extends BaseService {
    public Map charge(int type, String addressJson, String orgCode, String prescriptionCode, int totalAmount, String people, String accessToken, String returnUrl) throws Exception {
        Map resultMap = new HashMap();
        //获取机构映射
        HospitalMapping hos = mappingDao.findByCode(orgCode);
        if (hos == null) {
            throw new Exception("no hospital mapping!");
        }
        Hospital hospital = hospitalDao.findByCode(orgCode);
        //        患者签约信息
        String orgName = hos.getName();
        String appId = hos.getAppId();
        String appSecret = hos.getAppSecret();
        String signAddress = hospital.getAddress();
        LOGGER.info("APPID============> " + appId);
        LOGGER.info("APPSECRET============> " + appSecret);
        Patient patient = patientDao.findByCode(people);
        //微信登录患者信息
        String userName = patient.getName();
        String openid = patient.getOpenid();
        String userProvince = patient.getProvince();
        String userProvinceName = patient.getProvinceName();
        String userCity = patient.getCity();
        String userCityName = patient.getCityName();
        String userTown = patient.getTown();
        String userTownName = patient.getTownName();
        String userStreet = patient.getStreet();
        String userStreetName = patient.getStreetName();
        String userAddress = patient.getAddress();
        String userSsc = patient.getSsc();
        String userIdcard = patient.getIdcard();
        Prescription prescription = null;
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        Date now = new Date();
        Boolean isSuccess = true;
@ -616,6 +587,37 @@ public class PatientPrescriptionPayService extends BaseService {
        String channel = "WX_MMP";   //  医保支付渠道
        String subject = "续方订单支付";   //  订单名称
        try {
            //获取机构映射
            HospitalMapping hos = mappingDao.findByCode(orgCode);
            if (hos == null) {
                throw new Exception("no hospital mapping!");
            }
            Hospital hospital = hospitalDao.findByCode(orgCode);
            //        患者签约信息
            String orgName = hos.getName();
            String appId = hos.getAppId();
            String appSecret = hos.getAppSecret();
            String signAddress = hospital.getAddress();
            LOGGER.info("APPID============> " + appId);
            LOGGER.info("APPSECRET============> " + appSecret);
            Patient patient = patientDao.findByCode(people);
            //微信登录患者信息
            String userName = patient.getName();
            String openid = patient.getOpenid();
            String userProvince = patient.getProvince();
            String userProvinceName = patient.getProvinceName();
            String userCity = patient.getCity();
            String userCityName = patient.getCityName();
            String userTown = patient.getTown();
            String userTownName = patient.getTownName();
            String userStreet = patient.getStreet();
            String userStreetName = patient.getStreetName();
            String userAddress = patient.getAddress();
            String userSsc = patient.getSsc();
            String userIdcard = patient.getIdcard();
//       ***************************  测通流程 ***************************************
        OnepayDefaultClient onepayClient = new OnepayDefaultClient(config.getOnepayApi(), appId, appSecret, signType, encryptType);
@ -626,7 +628,7 @@ public class PatientPrescriptionPayService extends BaseService {
            expressage.setCode(getCode());
        }
        expressage.setPrescriptionCode(prescriptionCode);
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        prescription = prescriptionDao.findByCode(prescriptionCode);
        // 续方居民信息
        String paySsc = prescription.getSsc();
        String payPatientCode = prescription.getPatient();
@ -774,7 +776,7 @@ public class PatientPrescriptionPayService extends BaseService {
        prescriptionPay.setCreateTime(now);
        prescriptionPay.setCzrq(now);
        try {
//        try {
//             ***************************  测通流程 ***************************************
            LOGGER.info("================================>" + "Before get BindCard");

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -259,6 +259,10 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            throw new Exception("编码已使用!");
        } else if (status == -3) {
            throw new Exception("编码类型错误!");
        } else if (status == -4) {
            throw new Exception("未到达服务站!");
        } else if (status == -5) {
            throw new Exception("不可配送!");
        }
        return prescriptionDispensaryCode;

+ 47 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -107,6 +107,23 @@ public class PrescriptionExpressageService {
            returnStatus = -2;
            return returnStatus;
        }
//        if (prescriptionDispensaryCode.getIsUse() == 1) {
//            //判断编码是否使用过
//            PrescriptionLog prescriptionLog = new PrescriptionLog();
//            prescriptionLog.setCode(UUID.randomUUID().toString());
//            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
//            prescriptionLog.setCreateTime(new Date());
//            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
//            prescriptionLog.setFlag(1);
//            prescriptionLog.setUserCode(userCode);
//            prescriptionLog.setUserType(2);
//            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
//            prescriptionLog.setRemark("编码重复扫描");
//            prescriptionLogDao.save(prescriptionLog);
//            returnStatus = -2;
//            return returnStatus;
//        }
        switch (prescriptionDispensaryCode.getType()) {
            case 1: {
                //判断是1 居民取药码
@ -154,6 +171,20 @@ public class PrescriptionExpressageService {
        //修改处方状态为完成
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        if(prescription.getStatus()<=65){
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("该状态不可取药");
            prescriptionLogDao.save(prescriptionLog);
            return -4;
        }
        Date finshTime = new Date();
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        prescription.setFinishTime(finshTime);
@ -193,8 +224,23 @@ public class PrescriptionExpressageService {
        //获取配送的医生信息
        Doctor doctor = doctorDao.findByCode(userCode);
        //修改处方状态为配送中
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        if(prescription.getStatus()<=50){
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("该状态不可配送");
            prescriptionLogDao.save(prescriptionLog);
            return -5;
        }
        //修改处方状态为配送中
        Date expressageing = new Date();
        prescription.setExpressageTime(expressageing);
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());

+ 5 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignFamilyServiceService.java

@ -205,7 +205,11 @@ public class SignFamilyServiceService {
        }
        List<Service> ss = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper(Service.class));
        return ss.get(0);
        if (ss.size() > 0) {
            return ss.get(0);
        } else {
            return null;
        }
    }
    private SignFamily getSignFamily(String patient) {

+ 18 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/pc/prescription/PrescriptionExpressagePCService.java

@ -320,6 +320,13 @@ public class PrescriptionExpressagePCService extends BaseService {
        //修改取药码code为已经使用
        prescriptionDispensaryCode.setIsUse(1);
        //更新配送信息
        PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
        prescriptionExpressage.setHospitalDoctor(doctorDao.findByCode(userCode).getName());
        prescriptionExpressage.setHospitalDoctorCode(userCode);
        prescriptionExpressage.setFetchingMedicineTime(new Date());
        prescriptionExpressageDao.save(prescriptionExpressage);
    }
@ -332,7 +339,8 @@ public class PrescriptionExpressagePCService extends BaseService {
     */
    public void dispensaryCode_2(String userCode,String patientCode, PrescriptionDispensaryCode prescriptionDispensaryCode) throws Exception {
        //获取配送的医生信息
        Doctor doctor = doctorDao.findByCode(userCode);
        PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
        Doctor doctor = doctorDao.findByCode(prescriptionExpressage.getExpressageCode());
        //修改处方状态为配送中
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
@ -350,7 +358,7 @@ public class PrescriptionExpressagePCService extends BaseService {
        prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
        prescriptionLog.setCreateTime(new Date());
        prescriptionLog.setFlag(1);
        prescriptionLog.setUserCode(userCode);
        prescriptionLog.setUserCode(doctor.getCode());
        prescriptionLog.setUserName(doctor.getName());
        prescriptionLog.setUserType(2);
        prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
@ -366,5 +374,13 @@ public class PrescriptionExpressagePCService extends BaseService {
        prescriptionNoticesService.sendMessages(patientCode, doctor.getName(), DateUtil.dateToStrLong(expressageing), 3, 0, url);
        //更新配送信息
        prescriptionExpressage.setHospitalDoctor(doctorDao.findByCode(userCode).getName());
        prescriptionExpressage.setHospitalDoctorCode(userCode);
        prescriptionExpressage.setFetchingMedicineTime(new Date());
        prescriptionExpressage.setExpressageTime(new Date());
        prescriptionExpressageDao.save(prescriptionExpressage);
    }
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -260,7 +260,7 @@ public class ManagerUtilController extends BaseController {
            jo.put("doctor_online", SystemData.doctorTokens.size());
            jo.put("pc_online", SystemData.doctorPCTokens.size());
            jo.put("patient_online", SystemData.patientTokens.size());
            return write(200, "启动成功");
            return write(200, "启动成功","data",jo);
        } catch (Exception e) {
            return error(-1, "启动失败");
        }
@ -292,7 +292,7 @@ public class ManagerUtilController extends BaseController {
            DoctorInterceptor.status = open;
            PatientInterceptor.status = open;
            GateWayInterceptor.status = open;
            return write(200, "关闭成功");
            return write(200, "开启成功");
        } catch (Exception e) {
            return error(-1, "启动失败");
        }

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

@ -84,11 +84,11 @@ security:
##拦截器开关
interceptor:
  doctor:
    status: 0 ###  1开启 0 关闭
    status: 1 ###  1开启 0 关闭
  patient:
    status: 0 ###  1开启 0 关闭
    status: 1 ###  1开启 0 关闭
  accesstoken:
    status: 0 ###  1开启 0 关闭
    status: 1 ###  1开启 0 关闭
    time: 2 ##对外接的accesstoken生命周期 2小时
---