瀏覽代碼

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

wujunjie 7 年之前
父節點
當前提交
e47761c528
共有 23 個文件被更改,包括 433 次插入93 次删除
  1. 44 0
      common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExplain.java
  2. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/Doctor.java
  3. 5 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/family/FamilyMemberService.java
  4. 22 5
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/common/util/WebserviceUtil.java
  5. 3 3
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/Message.java
  6. 69 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftApi.java
  7. 2 1
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/common/InitiSysProService.java
  8. 111 11
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java
  9. 26 10
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  10. 1 1
      patient-co-service/wlyy_service/src/main/resources/system.properties
  11. 5 5
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/service/JobService.java
  12. 1 1
      patient-co/patient-co-statistics/src/main/resources/application.yml
  13. 二進制
      patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/集美健康教育对外接口文档.docx
  14. 15 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java
  15. 18 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExplainDao.java
  16. 25 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java
  17. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java
  18. 40 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java
  19. 12 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/qrcode/QrCodeController.java
  20. 14 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionAdjustController.java
  21. 16 12
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java
  22. 0 12
      patient-co/patient-co-wlyy/src/main/resources/application.yml
  23. 2 1
      patient-co/patient-co-wlyy/src/main/resources/config/fdfs_client.conf

+ 44 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExplain.java

@ -0,0 +1,44 @@
package com.yihu.wlyy.entity.patient.prescription;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 续方说明表
 * Created by yeshijie on 2017/8/24.
 */
@Entity
@Table(name = "wlyy_prescription_explain")
public class PrescriptionExplain extends IdEntity {
    private String content;//续方说明
    private String del;//是否有效,1有效,0无效
    private Date createTiem;
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getDel() {
        return del;
    }
    public void setDel(String del) {
        this.del = del;
    }
    public Date getCreateTiem() {
        return createTiem;
    }
    public void setCreateTiem(Date createTiem) {
        this.createTiem = createTiem;
    }
}

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

@ -371,7 +371,7 @@ public class Doctor extends IdEntity {
		}else if(2==level){
			levelName = "全科医生";
		}else if(level==3){
			levelName = "健康管理所";
			levelName = "健康管理师";
		}else{
			levelName = "";
		}

+ 5 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/family/FamilyMemberService.java

@ -86,13 +86,15 @@ public class FamilyMemberService extends BaseService {
                SignFamily sign = contractService.findSignInfo(map.get("code").toString());
                boolean ssSign = false;
                boolean jtSign = false;
                map.put("statusName","未签约");
                map1.put("status","-1");
                map1.put("statusName","未签约");
                if(sign!=null){
                    if (sign.getType() == 1 ) {
                        ssSign = true;
                    } else if (sign.getType() == 2 ) {
                        jtSign = true;
                    }
                    map1.put("status",sign.getStatus());;
                    map1.put("statusName","已签约");
                    map1.put("expensesStatusName",sign.getExpensesStatusName());
                    String doctorCode = sign.getDoctor();
@ -132,8 +134,10 @@ public class FamilyMemberService extends BaseService {
        boolean ssSign = false;
        boolean jtSign = false;
        map.put("statusName","未签约");
        map.put("status",-1);
        if (sign != null) {
            map.put("statusName","已签约");
            map.put("status",sign.getStatus());
            String doctorCode = sign.getDoctor();
            map.put("doctor",doctorCode);
            map.put("doctorName",sign.getDoctorName());

+ 22 - 5
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/common/util/WebserviceUtil.java

@ -1,7 +1,10 @@
package com.yihu.wlyy.service.common.util;
import com.yihu.wlyy.service.controller.PrescriptionController;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.xml.namespace.QName;
import java.util.Map;
@ -13,6 +16,8 @@ import java.util.Map;
 **/
public class WebserviceUtil {
    private static Logger logger = LoggerFactory.getLogger(WebserviceUtil.class);
    /**
     * webservice 调用接口
@ -20,34 +25,46 @@ public class WebserviceUtil {
    public static String post(String urlString,String namespace,String api, Map<String,String> params) throws Exception {
        try {
            Service service = new Service();
            logger.info("ca_url:"+urlString);
            logger.info("ca_namespace:"+namespace);
            logger.info("api:"+api);
            Service service = new Service();
            logger.info("=======>通过service创建call对象");
            Call call = (Call) service.createCall();// 通过service创建call对象
            logger.info("=======>设置service所在URL");
            // 设置service所在URL
            call.setTargetEndpointAddress(new java.net.URL(urlString));
            call.setOperationName(new QName(namespace, api));
            call.setUseSOAPAction(true);
            Object[] objs = null;
            logger.info("=======>组装参数:"+params.size());
            if(params!=null && params.size()>0)
            {
                logger.info("=======>遍历参数");
                objs = new Object[params.size()];
                int i=0;
                for(String key : params.keySet())
                {
                    logger.info("=======>参数key:"+key);
                    logger.info("=======>接口参数:"+key);
                    call.addParameter(new QName(key), org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
                    logger.info("=======>参数值:"+params.get(key));
                    objs[i] = params.get(key);
                    i++;
                }
            }
            logger.info("=======>设置返回类型");
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//设置返回类型
            String  ret = (String )call.invoke(objs);
            logger.info("=======>开始请求");
            String  ret = (String)call.invoke(objs);
            logger.info("=======>请求结果:"+ret);
            logger.info("=======>请求结果.toString():"+ret.toString());
            return ret.toString();
        } catch (Exception e) {
            System.out.print("urlString:"+urlString +" "+namespace+api);
            logger.info("=======>CA请求报错:"+e.getMessage());
            e.printStackTrace();
            throw e;
        }

File diff suppressed because it is too large
+ 3 - 3
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/entity/Message.java


+ 69 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftApi.java

@ -199,4 +199,73 @@ public class ZysoftApi extends AbstractApiExecuter {
    {
        return cryptoParameter(key, param);
    }
    /**
     * CA底层Post统一接口
     */
    public String capost(Map<String,String> params, Map<String,String> headers, boolean openCrypto) throws Exception
    {
        List<RequestValue> paramsList = null;
        HeaderValue[] headersList = null;
        if(params!=null)
        {
            paramsList = new ArrayList<>();
            for(String key :params.keySet())
            {
                RequestValue obj = new RequestValue(key,params.get(key));
                paramsList.add(obj);
            }
        }
        if(headers!=null)
        {
            headersList = new HeaderValue[headers.size()];
            int i = 0;
            for(String key :headers.keySet())
            {
                headersList[i] = new HeaderValue(key,headers.get(key));
                i++;
            }
        }
        String ca_url = SystemConfig.sysPropertiesSets.get("ca_url");
        System.out.println("ca_url:"+ca_url);
        String response = doHttpPost(ca_url,licence,openCrypto,paramsList,headersList);
        System.out.print("response:"+response+"\r\n");
        response = response.replace("\r","").replace("\n","").replace("\t","").replace("\f","");
        return response;
    }
    /**
     * CA底层Get统一接口
     */
    public String caget(Map<String,String> params, Map<String,String> headers, boolean openCrypto) throws Exception
    {
        List<RequestValue> paramsList = null;
        HeaderValue[] headersList = null;
        if(params!=null)
        {
            paramsList = new ArrayList<>();
            for(String key :params.keySet())
            {
                RequestValue obj = new RequestValue(key,params.get(key));
                paramsList.add(obj);
            }
        }
        if(headers!=null)
        {
            headersList = new HeaderValue[headers.size()];
            int i = 0;
            for(String key :headers.keySet())
            {
                headersList[i] = new HeaderValue(key,headers.get(key));
                i++;
            }
        }
        String ca_url = SystemConfig.sysPropertiesSets.get("ca_url");
        String response = doHttpGet(ca_url, licence, openCrypto, paramsList, headersList);
        response = response.replace("\r","").replace("\n","").replace("\t","").replace("\f","");
        System.out.print("response:"+response+"\r\n");
        return response;
    }
}

+ 2 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/common/InitiSysProService.java

@ -32,9 +32,10 @@ public class InitiSysProService {
        List<SystemProperties> sysvalueList = systemPropertiesDao.findSystemPropertiesByClientAndSpaValue(1);
        if(!sysvalueList.isEmpty()){
            for (SystemProperties systemProperties : sysvalueList) {
                System.out.println("key:"+systemProperties.getKey());
                System.out.println("value:"+systemProperties.getValue());
                sysPropertiesSets.put(systemProperties.getKey(),systemProperties.getValue());
            }
            SystemConfig.sysPropertiesSets = sysPropertiesSets;
        }
    }

+ 111 - 11
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCAService.java

@ -1,15 +1,24 @@
package com.yihu.wlyy.service.service.prescription;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.common.SystemConfig;
import com.yihu.wlyy.service.common.http.HttpApiException;
import com.yihu.wlyy.service.common.util.StringUtil;
import com.yihu.wlyy.service.common.util.WebserviceUtil;
import com.yihu.wlyy.service.service.LogService;
import com.yihu.wlyy.service.service.ZysoftApi;
import com.yihu.wlyy.service.service.ZysoftBaseService;
import com.zoe.phip.ssp.sdk.ApiException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
/**
@ -17,7 +26,7 @@ import java.util.Map;
 * 长处方CA认证服务
 */
@Service
public class PrescriptionCAService {
public class PrescriptionCAService extends ZysoftBaseService {
    private String IS_APPLIED="XMCAF_SOFT_judgeRealNameSoftCertIsApplied"; //判断实名软证书是否已申请
    private String REQUEST_SIGN = "XMCAF_SOFT_requestRealNameSoftCertAndSign";//请求实名软证书并进行数字签名
@ -32,7 +41,7 @@ public class PrescriptionCAService {
    @Autowired
    private ObjectMapper objectMapper;
    private String getHeaderXml(String api,String srcBusinessStreamNO)
    private String getHeaderXml(String api,String srcBusinessStreamNO,String srcRequestStreamNO)
    {
        return "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
            "<root>\n" +
@ -49,12 +58,96 @@ public class PrescriptionCAService {
            "   <srcBusinessNodeName>审核</srcBusinessNodeName>\n" +
            "   <srcOperatorAccount>"+srcBusinessStreamNO+"</srcOperatorAccount>\n" +
            "   <srcBusinessStreamNO>"+srcBusinessStreamNO+"</srcBusinessStreamNO>\n" +
            "   <srcRequestStreamNO>"+srcRequestStreamNO+"</srcRequestStreamNO>\n" +
            "   <srcDataExtProperty></srcDataExtProperty>\n" +
            "</root>";
    }
    /**
     * CA认证服务二次封装
     * 生产环境 智业CA接口二次封装
     * @param api
     * @param params
     * @param srcBusinessStreamNO
     * @return
     * @throws Exception
     */
    public String postZyCaServer(String api, Map<String,String> params,String srcBusinessStreamNO,String content) throws Exception{
        String msgBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
                "<root>\n";
        if(params!=null && params.size()>0)
        {
            for(String key : params.keySet())
            {
                msgBody += "    <"+key+">"+params.get(key)+"</"+key+">\n";
            }
        }
        msgBody += "</root>";
        String srcRequestStreamNO = UUID.randomUUID().toString().replace("-", "");
        String msgHeader = getHeaderXml(api,srcBusinessStreamNO,srcRequestStreamNO);
        System.out.println("msgHerder:"+msgHeader);
        System.out.println("msgBody:"+msgBody);
        String re = "";
        Map<String,String> paramsList = new HashMap<>();
        paramsList.put("msgHeader",msgHeader);
        paramsList.put("msgBody",msgBody);
        //新增日志
        String method = "POST";
        Boolean isSuccess = true;
        String error = "";
        int times = 0;
        try {
//            re = ZysoftApi.getSingleton().post(ca_url, paramsList, null,true);
            re = ZysoftApi.getSingleton().capost(paramsList, null,true);
            System.out.println("re=====>:"+re);
//            Map<String,String> map = objectMapper.readValue(re,Map.class);
//            String code = map.get("CODE");
//
//            if(!code.equals("1"))
//            {
//                throw new HttpApiException(Integer.valueOf(code),map.get("MESSAGE"));
//            }
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,msgHeader,msgBody,re,error);
        }
        catch (Exception ex)
        {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            ex.printStackTrace(pw);
            System.out.println("error1:"+ex.getMessage());
            error = sw.toString();
            System.out.println("error2:"+error);
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,msgHeader,msgBody,re,error);
            if(ex instanceof ApiException)
            {
                ApiException apiEx = (ApiException) ex;
                System.out.println("error3:"+ex.getMessage());
                throw new HttpApiException(apiEx.errorCode(),ex.getMessage());
            }
            else{
                System.out.println("error4:"+ex.getMessage());
                throw new HttpApiException(-1,ex.getMessage());
            }
        }
        return re;
    }
    /**
     * 测试环境:CA认证服务二次封装
     */
    private String postCAServer(String api, Map<String,String> params,String srcBusinessStreamNO) throws Exception
    {
@ -73,8 +166,8 @@ public class PrescriptionCAService {
        }
        msgBody += "</root>";
        String msgHeader = getHeaderXml(api,srcBusinessStreamNO);
        String srcRequestStreamNO = UUID.randomUUID().toString().replace("-", "");
        String msgHeader = getHeaderXml(api,srcBusinessStreamNO,srcRequestStreamNO);
        Map<String,String> p = new HashMap<>();
        p.put("msgHeader",msgHeader);
@ -98,7 +191,9 @@ public class PrescriptionCAService {
            params.put("strUserIdcardNum",strUserIdcardNum);
            body = objectMapper.writeValueAsString(params);
            re = postCAServer(action, params,srcBusinessStreamNO);
//            re = postCAServer(action, params,srcBusinessStreamNO);
            //生产环境,调用智业统一平台接口,rest接口
            re = postZyCaServer(action, params,srcBusinessStreamNO,"判断是否有实名证书");
            if(StringUtil.isEmpty(re))
            {
@ -147,7 +242,10 @@ public class PrescriptionCAService {
            body = objectMapper.writeValueAsString(params);
            re = postCAServer(action, params,srcBusinessStreamNO);
            //测试环境开启下面这行代码,webservice接口
//            re = postCAServer(action, params,srcBusinessStreamNO);
            //生产环境,调用智业统一平台接口,rest接口
            re = postZyCaServer(action, params,srcBusinessStreamNO,"请求实名软证书并进行数字签名");
            if(StringUtil.isEmpty(re))
            {
@ -196,8 +294,9 @@ public class PrescriptionCAService {
            body = objectMapper.writeValueAsString(params);
            re = postCAServer(action, params,srcBusinessStreamNO);
//            re = postCAServer(action, params,srcBusinessStreamNO);
            re = postZyCaServer(action, params,srcBusinessStreamNO,"获取实名软证书的过期时间");
            if(StringUtil.isEmpty(re))
            {
                throw new Exception("返回为空!");
@ -244,7 +343,8 @@ public class PrescriptionCAService {
            params.put("strNewCalledPasswd",strNewCalledPasswd);
            body = objectMapper.writeValueAsString(params);
            re = postCAServer(action, params,srcBusinessStreamNO);
//            re = postCAServer(action, params,srcBusinessStreamNO);
            re = postZyCaServer(action, params,srcBusinessStreamNO,"修改实名软证书调用保护口令");
            if(StringUtil.isEmpty(re))
            {
@ -297,8 +397,8 @@ public class PrescriptionCAService {
            params.put("strOriginalData",strOriginalData);
            body = objectMapper.writeValueAsString(params);
            re = postCAServer(action, params,srcBusinessStreamNO);
//            re = postCAServer(action, params,srcBusinessStreamNO);
            re = postZyCaServer(action, params,srcBusinessStreamNO,"验证签名(带多服务器负载均衡)");
            if(StringUtil.isEmpty(re))
            {
                throw new Exception("返回为空!");

+ 26 - 10
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -9,10 +9,7 @@ import com.yihu.wlyy.service.common.util.CommonUtil;
import com.yihu.wlyy.service.common.util.DateUtil;
import com.yihu.wlyy.service.dao.*;
import com.yihu.wlyy.service.dao.prescription.*;
import com.yihu.wlyy.service.entity.Doctor;
import com.yihu.wlyy.service.entity.Hospital;
import com.yihu.wlyy.service.entity.Patient;
import com.yihu.wlyy.service.entity.SignFamily;
import com.yihu.wlyy.service.entity.*;
import com.yihu.wlyy.service.entity.prescription.*;
import com.yihu.wlyy.service.entity.prescription.VO.PrescriptionExpressageVO;
import com.yihu.wlyy.service.service.ZysoftBaseService;
@ -65,6 +62,8 @@ public class PrescriptionService extends ZysoftBaseService{
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PrescriptionReviewedDao prescriptionReviewedDao;
    @Autowired
    private MessageDao messageDao;
    @Value("${redisChannel.prescription}")
    private String channelTopic;
@ -175,13 +174,30 @@ public class PrescriptionService extends ZysoftBaseService{
                    //保存新的药品
                    prescriptionInfoDao.save(infoList);
                    //发送系统消息
                    Message message = new Message();
                    message.setCzrq(new Date());
                    message.setCreateTime(new Date());
                    message.setContent("您有1个续方申请已在线下调整完成,请点击进行CA认证。");
                    message.setRead(1);//设置未读
                    message.setReceiver(prescription.getDoctor());//设置接受医生的code
                    message.setSender("系统");//设置发送的用户
                    message.setSenderName("system");
                    message.setCode(getCode());
                    message.setTitle("新增系统消息");
                    message.setType(9);
                    message.setReadonly(1);//是否只读消息
                    message.setOver("1");//未处理
                    message.setRelationCode(prescription.getCode());
                    messageDao.save(message);
                    // redis 的发布 {tilte:redisAddPrescription   state: 1 ,//1:成功,2.失败 mes:'开方成功' prescription : "0001" //续方CODE  }
                    JSONObject message = new JSONObject();
                    message.put("title","adjustPrescription");
                    message.put("state",1);
                    message.put("prescription",prescription.getCode());
                    message.put("mes","调整处方完成");
                    redisTemplate.convertAndSend(channelTopic,message.toString());
                    JSONObject redisMessage = new JSONObject();
                    redisMessage.put("title","adjustPrescription");
                    redisMessage.put("state",1);
                    redisMessage.put("prescription",prescription.getCode());
                    redisMessage.put("mes","调整处方完成");
                    redisTemplate.convertAndSend(channelTopic,redisMessage.toString());
                }else {
                    //调整失败
                    prescription.setStatus(4);

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

@ -16,5 +16,5 @@ gateway_licence = 5YGl5bq45LmL7Lev
gateway_public_key = PublicGov.key
jw_hospital = 350211B1004
jw_licence = 5YGl5bq35LmL6LevMzUwMjExQjEwMDQ=
ca_url = http://117.29.183.114:8081/XMCAService?wsdl
ca_url = http://10.95.21.21:18280/base/XMCA6_UnifiedCallInterface
ca_namespace = http://platfomservice.xmca.com/

+ 5 - 5
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -164,7 +164,7 @@ public class JobService {
                params.put("yesterday", getYesterday(0 - i));
                if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                    quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
                    Thread.sleep(10000L);
                    Thread.sleep(30000L);
                }
            }
        }
@ -206,7 +206,7 @@ public class JobService {
            params.put("yesterday", yesterday);
            if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
                Thread.sleep(40000L);
                Thread.sleep(30000L);
            }
        }
@ -252,7 +252,7 @@ public class JobService {
        params.put("yesterday", yesterday);
        if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
            quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
            Thread.sleep(40000L);
            Thread.sleep(30000L);
        }
    }
@ -283,7 +283,7 @@ public class JobService {
            params.put("yesterday", getYesterday(0 - i));
            if (!StringUtils.isEmpty(quartzJobConfig.getJobClass())) {
                quartzHelper.startNow(getRightClass(quartzJobConfig), quartzJobConfig.getId() + UUID.randomUUID().toString().replace("-", ""), params);
                Thread.sleep(40000L);
                Thread.sleep(30000L);
            }
        }
    }
@ -418,7 +418,7 @@ public class JobService {
        params.put("now", yesterday);
        params.put("yesterday", day);
        quartzHelper.startNow(HealthMessageJob.class, HealthMessageJob.jobKey + UUID.randomUUID().toString().replace("-", ""), params);
        Thread.sleep(40000L);
        Thread.sleep(30000L);
    }
    public void productHealthDataByDayToDay(String start, String end) throws Exception {

+ 1 - 1
patient-co/patient-co-statistics/src/main/resources/application.yml

@ -184,7 +184,7 @@ spring:
      username: wlyy
      password: jkzlehr@123
    primaryRead:
      url: jdbc:mysql://59.61.92.90:8082/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      url: jdbc:mysql://59.61.92.90:8079/wlyy?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
      username: wlyy
      password: jkzlehr@123
    im: #im库:

二進制
patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/集美健康教育对外接口文档.docx


+ 15 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java

@ -39,11 +39,14 @@ public class PresModeAdapter {
    public JSONArray modeTopresInfo(String json){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
                throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
            }
            String dataStr = oldJson.getString("data");
            JSONObject data = JSONObject.parseObject(dataStr);
            JSONArray returnData = data.getJSONArray("returnData");
            String code = data.getString("CODE");
            if(StringUtils.isNotBlank(code)&&"1".equals(code)){
            if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
                JSONArray rs = new JSONArray();
                Iterator iterator = returnData.iterator();
                while (iterator.hasNext()){
@ -102,7 +105,7 @@ public class PresModeAdapter {
            logger.info("PresModeAdapter:modeTopresInfo:Json:"+json);
            throw e;
        }
        return null;
        return new JSONArray();
    }
    /**
@ -114,10 +117,13 @@ public class PresModeAdapter {
    public JSONArray modeToPrescription(String json){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
                throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
            }
            JSONObject data = oldJson.getJSONObject("data");
            JSONArray returnData = data.getJSONArray("returnData");
            String code = data.getString("CODE");
            if(StringUtils.isNotBlank(code)&&"1".equals(code)){
            if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
                JSONArray rs = new JSONArray();
                Iterator iterator = returnData.iterator();
                while (iterator.hasNext()){
@ -210,7 +216,7 @@ public class PresModeAdapter {
            logger.info("PresModeAdapter:modeToPrescription:Json:"+json);
            throw e;
        }
        return null;
        return new JSONArray();
    }
    /**
@ -221,10 +227,13 @@ public class PresModeAdapter {
    public JSONObject modelToSinglePrescription(String json){
        try{
            JSONObject oldJson = JSONObject.parseObject(json);
            if(oldJson.getInteger("status")!=200){
                throw new RuntimeException("智业接口失败:"+oldJson.getString("msg"));
            }
            JSONObject data = oldJson.getJSONObject("data");
            JSONArray returnData = data.getJSONArray("returnData");
            String code = data.getString("CODE");
            if(StringUtils.isNotBlank(code)&&"1".equals(code)){
            if(StringUtils.isNotBlank(code)&&"1".equals(code)&&returnData.size()>0){
                JSONArray modeArray = returnData.getJSONArray(0);
                JSONObject mode = (JSONObject) modeArray.get(0);
                JSONObject p  = new JSONObject();
@ -308,7 +317,7 @@ public class PresModeAdapter {
            logger.info("PresModeAdapter:modelToSinglePrescription:Json:"+json);
            throw e;
        }
        return null;
        return new JSONObject();
    }
}

+ 18 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionExplainDao.java

@ -0,0 +1,18 @@
package com.yihu.wlyy.repository.prescription;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExplain;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2017/8/24.
 */
public interface PrescriptionExplainDao extends PagingAndSortingRepository<PrescriptionExplain, Long>, JpaSpecificationExecutor<PrescriptionExplain> {
    @Query("select p from PrescriptionExplain p where p.del='1' ")
    List<PrescriptionExplain> findList();
}

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

@ -26,10 +26,7 @@ import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDiagnosisDao;
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
import com.yihu.wlyy.repository.prescription.PrescriptionReviewedDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
@ -150,6 +147,8 @@ public class ConsultTeamService extends ConsultService {
    private String im_list_get;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private PrescriptionExplainDao prescriptionExplainDao;
    @PostConstruct
    public void init() {
@ -199,12 +198,20 @@ public class ConsultTeamService extends ConsultService {
            return json;
        }
        //续方说明
        List<PrescriptionExplain> list = prescriptionExplainDao.findList();
        JSONArray ja = new JSONArray();
        for (PrescriptionExplain explain:list){
            ja.put(explain.getContent());
        }
        Doctor doctor = doctorDao.findByAdminTeamId(signFamily.getAdminTeamId());
        json.put("doctor",doctor.getCode());
        json.put("doctorName",doctor.getName());
        json.put("adminTeamId",signFamily.getAdminTeamId());
        json.put("hospital",doctor.getHospital());
        json.put("hospitalName",doctor.getHospitalName());
        json.put("prescriptionExplain",ja);
        return json;
    }
@ -1138,10 +1145,11 @@ public class ConsultTeamService extends ConsultService {
            prescriptionInfo.setDrugCode(info.getString("drugCode"));//药品code
            prescriptionInfo.setDrugName(info.getString("drugName"));//药品名称
            prescriptionInfo.setDrugRate(info.getString("drugRate"));//吃药频率
            prescriptionInfo.setDrugRateName(getZyCommonDictName(info.getString("drugRate")));
            prescriptionInfo.setDrugFormat(info.getString("drugFormat"));//药品规格
            prescriptionInfo.setNum(info.getInteger("num"));//药品数目
            prescriptionInfo.setPrice(CommonUtil.doubleToInt(info.getDouble("price")));//药品单价
            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
//            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
            prescriptionInfo.setJwSubCode(info.getString("jwSubCode"));//智业子处方号
            prescriptionInfo.setSubjectClass(info.getString("subjectClass"));//科目编码
            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码
@ -1199,6 +1207,18 @@ public class ConsultTeamService extends ConsultService {
    }
    public String getZyCommonDictName(String code){
        try{
            String sql  ="SELECT t.name FROM zy_common_dict t WHERE t.code=? AND t.dict_name='IV_RECIPE_FREQUENCY_DICT'";
            List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,new Object[]{code});
            if(list!=null&&list.size()>0){
                return (String)(list.get(0).get("name"));
            }
            return "";
        }catch (Exception e){
            return "";
        }
    }
    /**
     * 发送消息给IM

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java

@ -213,7 +213,7 @@ public class HealthEduArticleService extends BaseService {
        }
        int start = page * pagesize;
        String pageInfo = " limit " + start + "," + pagesize;
        String orderBy = " order by a.czrq,a.id desc";
        String orderBy = " order by a.czrq desc";
        sql.append(where).append(orderBy).append(pageInfo);
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql.toString(), params.toArray());
        return result;

+ 40 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -135,9 +135,13 @@ public class PrescriptionInfoService extends BaseService {
            if ("1".equals(type)) {
                Patient p = patientDao.findByCode(patient);
                String rp = jwPrescriptionService.getLastRecipe(p.getSsc(), null, null, null);
                String rp = jwPrescriptionService.getLastRecipe(p.getSsc(), null, startDate, endDate);
                com.alibaba.fastjson.JSONArray pres = presModeAdapter.modeToPrescription(rp);
                if(pres==null||pres.size()==0){
                    return pres;
                }
                for (int i = 0; i < pres.size(); i++) {
                    com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject) pres.get(i);
                    String rState = presCheckStateObj(r.getString("code"));
@ -179,12 +183,41 @@ public class PrescriptionInfoService extends BaseService {
                            }
                        }
                    }
                }
                //过滤病症
                if(StringUtils.isNotBlank(diagnosisCode)&&!"0".equals(diagnosisCode)){
                    Iterator iterator = pres.iterator();
                    while (iterator.hasNext()) {
                        com.alibaba.fastjson.JSONObject r = (com.alibaba.fastjson.JSONObject) iterator.next();
                        String dis = gxy;
                        if("1".equals(diagnosisCode)){
                            dis = gxy;
                        }else if("2".equals(diagnosisCode)){
                            dis = tnb;
                        }
                        com.alibaba.fastjson.JSONArray des = (com.alibaba.fastjson.JSONArray) r.getJSONArray("prescriptionDt");
                        boolean flag = false;
                        for (int i = 0; i < des.size(); i++) {
                            PrescriptionDiagnosis ds = des.getObject(i, PrescriptionDiagnosis.class);
                            //如果含有选择病症,标记为true
                            if (dis.equals(ds.getHealthProblem())) {
                                //含有选择的病症
                                flag = true;
                            }
                        }
                        //如果未含有选择的病症,则删除
                        if (!flag){
                            iterator.remove();
                        }
                    }
                }
                return pres;
            } else {
                Patient p = patientDao.findByCode(patient);
                StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS createTime,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
                StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,LEFT(p.create_time,19) AS createTime,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
                        "WHERE p.patient=?");
                List<Object> params = new ArrayList<>();
                params.add(patient);
@ -281,8 +314,7 @@ public class PrescriptionInfoService extends BaseService {
     */
    public com.alibaba.fastjson.JSONObject getPrescription(String code,String patient) {
        Patient p = patientDao.findByCode(patient);
        Prescription prescription = prescriptionDao.findByCode(code);
        String rs = jwPrescriptionService.getRecipe(prescription.getJwCode(), p.getSsc());
        String rs = jwPrescriptionService.getRecipe(code, p.getSsc());
        com.alibaba.fastjson.JSONObject r = presModeAdapter.modelToSinglePrescription(rs);
        String rState = presCheckStateObj(code);
        if ("1".equals(rState)) {
@ -379,6 +411,9 @@ public class PrescriptionInfoService extends BaseService {
        log.setRemark("患者取消");
        prescriptionLogDao.save(log);
        //修改系统的续方消息的审核状态
        messageDao.updatePreScriptionMessage(p.getConsult(), "3", 6);
        //同步智业接口
        jwPrescriptionService.fadeRecipe(code);
@ -451,7 +486,7 @@ public class PrescriptionInfoService extends BaseService {
                " p.photo, " +
                " pr.`status`, " +
                " pr.`code`, " +
                " pr.create_time AS createTime, " +
                " LEFT(pr.create_time,19) AS createTime, " +
                " pr.doctor " +
                " FROM " +
                " wlyy_prescription pr " +

+ 12 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/qrcode/QrCodeController.java

@ -32,7 +32,7 @@ public class QrCodeController extends WeixinBaseController {
    @Autowired
    private DoctorService doctorService;
    @RequestMapping(value = "/doctors",method = RequestMethod.POST)
    @RequestMapping(value = "/doctors",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String makeDoctorQrcodes(String hospital) {
        try {
@ -52,7 +52,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/doctor",method = RequestMethod.POST)
    @RequestMapping(value = "/doctor",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String makeDoctorQrcode(String doctor) {
        try {
@ -72,7 +72,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param hospital
     * @return
     */
    @RequestMapping(value = "/hospital",method = RequestMethod.POST)
    @RequestMapping(value = "/hospital",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String makeHospitalQrcode(String hospital) {
        try {
@ -92,7 +92,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param town
     * @return
     */
    @RequestMapping(value = "/town",method = RequestMethod.POST)
    @RequestMapping(value = "/town",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    public String makeTownQrcode(String town) {
        try {
@ -113,7 +113,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param hospital
     * @param response
     */
    @RequestMapping(value = "/hospital_img",method = RequestMethod.POST)
    @RequestMapping(value = "/hospital_img",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadSqQrcode(String hospital, HttpServletResponse response) {
        try {
            File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
@ -155,7 +155,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param town
     * @param response
     */
    @RequestMapping(value = "/town_img",method = RequestMethod.POST)
    @RequestMapping(value = "/town_img",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadTownQrcode(String town, HttpServletResponse response) {
        try {
            File file = new File(QrCodeController.class.getResource("/").getPath().replace("/WEB-INF/classes/", "") +
@ -197,7 +197,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param doctor
     * @param response
     */
    @RequestMapping(value = "/download",method = RequestMethod.POST)
    @RequestMapping(value = "/download",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadQrcode(String doctor, HttpServletResponse response) {
        try {
            Doctor doc = doctorService.findDoctorByCode(doctor);
@ -248,7 +248,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param doctor
     * @param response
     */
    @RequestMapping(value = "/doctor_img",method = RequestMethod.POST)
    @RequestMapping(value = "/doctor_img",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadQrcodeImage(String doctor, HttpServletResponse response) {
        try {
            System.out.println("------------------doctor:" + doctor);
@ -297,7 +297,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param hospital
     * @param response
     */
    @RequestMapping(value = "/download/doctors",method = RequestMethod.POST)
    @RequestMapping(value = "/download/doctors",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadQrcodes(String hospital, HttpServletResponse response) {
        try {
            File file = qrcodeService.downloadDoctorQrCodes(hospital, getAccessToken());
@ -332,7 +332,7 @@ public class QrCodeController extends WeixinBaseController {
     * @param area
     * @param response
     */
    @RequestMapping(value = "/download/hospitals",method = RequestMethod.POST)
    @RequestMapping(value = "/download/hospitals",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadSqQrcodes(String area, HttpServletResponse response) {
        try {
            File file = qrcodeService.downloadHospitalQrCodes(area, getAccessToken());
@ -362,12 +362,12 @@ public class QrCodeController extends WeixinBaseController {
    }
    /**
     * 下载某个城市的区的二维码图片
     * 下载某个城市的区的二维码图片 t
     *
     * @param city
     * @param response
     */
    @RequestMapping(value = "/download/towns",method = RequestMethod.POST)
    @RequestMapping(value = "/download/towns",method = {RequestMethod.GET,RequestMethod.POST})
    public void downloadTownQrcodes(String city, HttpServletResponse response) {
        try {
            File file = qrcodeService.downLoadTownQrcodes(city, getAccessToken());

+ 14 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionAdjustController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.doctor.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionAdjustService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
@ -61,6 +62,19 @@ public class PrescriptionAdjustController extends BaseController {
        }
    }
    @RequestMapping(value = "getPrescriptionStatus",method = RequestMethod.GET)
    @ApiOperation("获取续方状态")
    public String getPrescriptionStatus(@ApiParam(name = "code", value = "续方code", defaultValue = "10")
                                        @RequestParam(value = "code", required = true) String code){
        try {
            Prescription prescription = prescriptionDao.findByCode(code);
            return write(200,"success","data",prescription.getStatus());
        }catch (Exception e){
            error(e);
            return error(-1,"获取续方状态失败");
        }
    }

+ 16 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -29,6 +29,8 @@ import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -48,6 +50,7 @@ import java.util.*;
@Api(description = "预约挂号接口")
public class BookingController extends WeixinBaseController {
    private static final Logger logger = LoggerFactory.getLogger(BookingController.class);
    @Autowired
    private GuahaoXMService guahaoXM;
@ -370,18 +373,19 @@ public class BookingController extends WeixinBaseController {
                }
                //发送短信小时
                // 调用总部发送信息的接口
                //String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
                //JSONObject json = toJson(result);
//				if (json == null) {
//					// 发送失败
//					throw new Exception("短信发送失败!");
//				} else if (json.getInt("result") != 0) {
//					return json.getString("description");
//				} else {
//					//发送成功,保存到数据库
//				}
                //发送短信消息
                 //调用总部发送信息的接口
                String result = HttpClientUtil.post(SystemConf.getInstance().getSmsUrl(), buildSmsParams(msg, p.getMobile()), "GBK");
                JSONObject r = toJson(result);
				if (r == null) {
					// 发送失败
                    logger.error("短信发送失败!");
					//throw new Exception("短信发送失败!");
				} else if (r.getInt("result") != 0) {
					return r.getString("description");
				} else {
					//发送成功,保存到数据库
				}
                BusinessLogs.info(BusinessLogs.BusinessType.appointment, getUID(), p.getCode(), new JSONObject(obj));
                return write(200, "创建挂号单成功!");
            } else {

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

@ -173,9 +173,6 @@ sign:
  check_upload: http://172.19.103.88:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
@ -271,9 +268,6 @@ sign:
quartz:
  name: schedulerFactoryBeanWlyy
ylzpay:
#  onepayApi: https://xmhealth.ylzpay.com:8080/
  onepayApi: http://xmhealth.ylzpay.com:8070/
@ -372,9 +366,6 @@ sign:
  check_upload: http://172.19.103.87:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_dev
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
@ -469,9 +460,6 @@ sign:
  check_upload: http://172.19.103.88:8011/wlyy_service
quartz:
  name: schedulerFactoryBean_test_dev
express:
  sf_url: http://218.17.248.244:11080/bsp-oisp/sfexpressService
#  sf_url: https://bsp-ois.sit.sf-express.com:9443/bsp-ois/sfexpressServic

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/config/fdfs_client.conf

@ -12,4 +12,5 @@ http.secret_key = FastDFS1234567890
#tracker_server = 172.19.103.54:22122
#-------------正式环境---------------#
tracker_server = 192.168.120.153:22122
tracker_server = 192.168.120.172:22122