Просмотр исходного кода

Merge branch 'dev' of yeshijie/patient-co-management into dev

yeshijie 7 лет назад
Родитель
Сommit
b64f8c5003

+ 112 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/common/util/CommonUtil.java

@ -0,0 +1,112 @@
package com.yihu.wlyy.service.common.util;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import java.io.*;
@Component
public class CommonUtil {
    public  String getIdcardEncode(String idcard) {
        if (idcard != null) {
            if (idcard.length() == 18) {
                return idcard.substring(0, 9) + "*******" + idcard.substring(16, 18);
            } else if (idcard.length() == 15) {
                return idcard.substring(0, 8) + "***" + idcard.substring(11, 15);
            }
        }
        return idcard;
    }
    /**
     * 对象转数组
     *
     * @param obj
     * @return
     */
    public  byte[] toByteArray(Object obj) {
        byte[] bytes = null;
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            ObjectOutputStream oos = new ObjectOutputStream(bos);
            oos.writeObject(obj);
            oos.flush();
            bytes = bos.toByteArray();
            oos.close();
            bos.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return bytes;
    }
    /**
     * 数组转对象
     *
     * @param bytes
     * @return
     */
    public  Object toObject(byte[] bytes) {
        Object obj = null;
        try {
            ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
            ObjectInputStream ois = new ObjectInputStream(bis);
            obj = ois.readObject();
            ois.close();
            bis.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }
        return obj;
    }
    /**
     * double*100转int
     * @param d
     * @return
     */
    public static Integer doubleToInt(Double d){
        if(d==null){
            return 0;
        }
        return new Double(d*100).intValue();
    }
    /**
     * 校验健康指标是否正常
     *
     * @param curValue    当前值
     * @param standardMax 最大标准值
     * @param standardMin 最小标准值
     * @return 0正常,1高,-1低
     */
    public  double checkHealthIndex(double curValue, double standardMax, double standardMin) {
        if (curValue <= 0) {
            return 0;
        }
        if (standardMax > 0 && curValue > standardMax) {
            return curValue;
        }
        // 低于标准值,暂不推
        // if (standardMin > 0 && curValue < standardMin) {
        // return -curValue;
        // }
        return 0;
    }
    public  String getSubString(String content,int min,int max){
        if(StringUtils.isBlank(content)){
            return "";
        }else if(content.length()<=max){
            return content;
        }else{
            return content.substring(min,max);
        }
    }
}

Разница между файлами не показана из-за своего большого размера
+ 7 - 7
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java


+ 7 - 6
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftBaseService.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.service.service;
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;
@ -10,7 +12,6 @@ import com.yihu.wlyy.service.dao.ZyPushLogDao;
import com.yihu.wlyy.service.entity.HospitalMapping;
import com.yihu.wlyy.service.entity.ZyPushLog;
import com.zoe.phip.ssp.sdk.ApiException;
import net.sf.json.JSONObject;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -75,7 +76,7 @@ public class ZysoftBaseService {
        log.setError(error);
        log.setMethod(method);
        log.setRequest(request);
        log.setResponse(JSONObject.fromObject(re).toString());
        log.setResponse(JSONObject.toJSONString(re,SerializerFeature.WriteMapNullValue));
        log.setRetryTimes(0);
        log.setStatus(status);
        log.setType(type);
@ -116,8 +117,8 @@ public class ZysoftBaseService {
        Map<String,String> paramsList = new HashMap<>();
        String msgBody = JSONObject.fromObject(params).toString();
        String msgHeader = JSONObject.fromObject(headers).toString();
        String msgBody = JSONObject.toJSONString(params, SerializerFeature.WriteMapNullValue);
        String msgHeader = JSONObject.toJSONString(headers, SerializerFeature.WriteMapNullValue);
        paramsList.put("msgHeader",msgHeader);
        paramsList.put("msgBody",msgBody);
@ -190,8 +191,8 @@ public class ZysoftBaseService {
        headers.put("INTERFACE",api);
        Map<String,String> paramsList = new HashMap<>();
        String msgBody = params==null?jsonParams.toString():JSONObject.fromObject(params).toString();
        String msgHeader = JSONObject.fromObject(headers).toString();
        String msgBody = params==null?JSONObject.toJSONString(jsonParams, SerializerFeature.WriteMapNullValue):JSONObject.toJSONString(params, SerializerFeature.WriteMapNullValue);
        String msgHeader = JSONObject.toJSONString(headers, SerializerFeature.WriteMapNullValue);
        paramsList.put("msgHeader",msgHeader);
        paramsList.put("msgBody",msgBody);

Разница между файлами не показана из-за своего большого размера
+ 26 - 27
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java


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

@ -1132,7 +1132,8 @@ public class ConsultTeamService extends ConsultService {
            prescriptionInfo.setNum(CommonUtil.doubleToInt(info.getDouble("num")));//药品数目
            prescriptionInfo.setPrice(CommonUtil.doubleToInt(info.getDouble("price")));//药品单价
            prescriptionInfo.setIsRefrigerate(0);//是否冷藏 1是 0否
            prescriptionInfo.setJwSubCode("");//智业子处方号
            prescriptionInfo.setJwSubCode(info.getString("jwSubCode"));//智业子处方号
            prescriptionInfo.setSubjectClass(info.getString("subjectClass"));//科目编码
            prescriptionInfo.setDrugNumUnit(info.getString("drugNumUnit"));//数量单位编码
            prescriptionInfo.setDrugNumUnitName(info.getString("drugNumUnitName"));//数量单位名称
            prescriptionInfo.setCost(CommonUtil.doubleToInt(info.getDouble("cost")));//金额