ソースを参照

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 5 年 前
コミット
471ae8a8e0
15 ファイル変更1321 行追加707 行削除
  1. 1 0
      business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java
  2. 18 2
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java
  3. 10 5
      business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java
  4. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyChargeDictDao.java
  5. 73 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 704 634
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  7. 389 56
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java
  8. 65 0
      business/base-service/src/main/java/com/yihu/jw/utils/ImgUtils.java
  9. 42 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java
  10. 1 1
      server/svr-authentication/src/main/resources/bootstrap.yml
  11. 10 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  12. 1 1
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  13. 3 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java
  14. 1 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/internet/InternetController.java
  15. 1 1
      svr/svr-internet-hospital/src/main/resources/application.yml

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java

@ -24,6 +24,7 @@ import java.util.List;
@Transactional
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
    @Query("from BaseDoctorDO d where d.id = ?1 AND d.del ='1'")
    BaseDoctorDO findById(String id);
    @Modifying

+ 18 - 2
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -115,7 +115,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
     * @param doctorId
     * @return
     */
    public List<Map<String, Object>> queryById(String doctorId) {
    public Object queryById(String doctorId) {
        Map<String,Object> params = new HashedMap();
        String sql ="SELECT " +
                " a.NAME AS \"name\", " +
@ -145,7 +145,23 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        params.put("typeCode",6);
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
        return  list;
        StringBuilder disease = new StringBuilder();
        StringBuilder code = new StringBuilder();
        if (null != list && list.size() > 0){
            for (int i=0;i<list.size();i++){
                if (i == 0 ){
                    disease.append(list.get(i).get("diseaseName"));
                    code.append(list.get(i).get("diseaseCode"));
                }else {
                    disease.append(","+list.get(i).get("diseaseName"));
                    code.append(","+list.get(i).get("diseaseCode"));
                }
            }
            list.get(0).put("diseaseName",disease);
            list.get(0).put("diseaseCode",code);
        }
        return  list.get(0);
    }

+ 10 - 5
business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java

@ -116,7 +116,7 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
        if (nowScore > oldScore){
            if (oldScore == 0){
                object.put("trend",1);
                object.put("percentage","100%");
                object.put("percentage",nowScore.toString());
            }else {
                Double difScore = nowScore - oldScore;
                String percentage = getPercentage((float) (difScore.intValue()), (float) oldScore.intValue());
@ -124,10 +124,15 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
                object.put("percentage",percentage);
            }
        }else if (nowScore < oldScore){
            Double difScore = oldScore - nowScore;
            String percentage = getPercentage((float) (difScore.intValue()), (float) oldScore.intValue());
            object.put("trend",-1);
            object.put("percentage",percentage);
            if (nowScore == 0){
                object.put("trend",-1);
                object.put("percentage",oldScore.toString());
            }else {
                Double difScore = oldScore - nowScore;
                String percentage = getPercentage((float) (difScore.intValue()), (float) oldScore.intValue());
                object.put("trend",-1);
                object.put("percentage",percentage);
            }
        }else {
            String percentage = "0%";
            object.put("trend",0);

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyChargeDictDao.java

@ -14,4 +14,6 @@ import java.util.List;
public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyChargeDictDO, String>, JpaSpecificationExecutor<WlyyChargeDictDO> {
    List<WlyyChargeDictDO>  findByDeptTypeCode(String deptTypeCode);
    WlyyChargeDictDO  findByChargeTypeAndDeptTypeCode(String chargeType,String deptTypeCode);
}

+ 73 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1337,7 +1337,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     *
     * 下诊断
     * @param outPatientId
     * @param advice
     * @param type 1带处方,2不带处方
@ -1430,6 +1430,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if(StringUtils.isNotBlank(infoJsons)){
                //药品
                List<WlyyPrescriptionInfoDO> infoDOs = (List<WlyyPrescriptionInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(infoJsons, WlyyPrescriptionInfoDO.class);
                for(WlyyPrescriptionInfoDO info:infoDOs){
                    info.setDel(1);
@ -1440,6 +1441,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                //保存药品信息
                prescriptionInfoDao.save(infoDOs);
                //计算药品费用
                prescription.setDrugFee(getInfoFee(infoDOs));
            }
            //=====================药品操作=======================================================================
@ -1465,9 +1469,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                //保存检查检验。
                wlyyInspectionDao.save(inspections);
                //计算检查检验费用
                prescription.setDrugFee(getInsFee(inspections));
            }
            //=====================检查检验=======================================================================
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            //保存费用
            prescriptionDao.save(prescription);
            //上传his开方
            return sendHisDiagnosis(jsonData,outpatientDO,prescription);
@ -1482,6 +1494,64 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 计算药品费用
     * @param infoDOs
     * @return
     */
    public Double getInfoFee(List<WlyyPrescriptionInfoDO> infoDOs){
        Double fee = 0D;
        try {
            if(infoDOs!=null&&infoDOs.size()>0){
                for(WlyyPrescriptionInfoDO info:infoDOs){
                    Integer quantity = Integer.parseInt(info.getQuantity());
                    fee += info.getPackRetprice()*quantity;
                }
            }
        }catch (Exception e){
            logger.error("getInfoFee:"+e.toString());
        }
        return fee;
    }
    /**
     * 计算检查检验费用
     * @param inspections
     * @return
     */
    public Double getInsFee(List<WlyyInspectionDO> inspections){
        Double fee = 0D;
        try {
            if(inspections!=null&&inspections.size()>0){
                for(WlyyInspectionDO ins:inspections){
                    Double chargeAmount = Double.parseDouble(ins.getChargeAmount());
                    fee += chargeAmount*ins.getQuantity();
                }
            }
        }catch (Exception e){
            logger.error("getInsFee:"+e.toString());
        }
        return fee;
    }
    /**
     * 计算挂号费用
     * @param doctor
     * @return
     */
    public Double getChargeFee(String doctor){
        Double fee = 0D;
        try{
            BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
            WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(),"6");
            return chargeDictDO.getReqFee();
        }catch (Exception e){
            logger.error("getChargeFee:"+e.toString());
        }
        return fee;
    }
    /**
     * 上传his开方
     * @param jsonData
@ -2091,7 +2161,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public Map<String,Object> findDoctorInfo(String doctor,String withWork){
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctor);
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        Map<String,Object> rs = new HashedMap();
        if(doctorDO!=null){
@ -2242,7 +2312,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public Map<String,Object> findDoctorBaseInfo(String doctor){
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctor);
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        Map<String,Object> rs = new HashedMap();
        if(doctorDO!=null){

ファイルの差分が大きいため隠しています
+ 704 - 634
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java


ファイルの差分が大きいため隠しています
+ 389 - 56
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java


+ 65 - 0
business/base-service/src/main/java/com/yihu/jw/utils/ImgUtils.java

@ -0,0 +1,65 @@
package com.yihu.jw.utils;
import sun.misc.BASE64Encoder;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
/**
 * Created by Trick on 2019/12/12.
 */
public class ImgUtils {
    public static void main(String ag[]){
        try {
            String path ="http://ehr.yihu.com/fastdfs/group1/M00/00/1F/rBoAbl3V_yyAVdkaAAJwTja8N7I527.png";
            System.out.println(getImg(path));
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    public static String getImg(String path)throws Exception{
        try{
            URL url = new URL(path);
            DataInputStream dataInputStream = new DataInputStream(url.openStream());
            return getBase64FromInputStream(dataInputStream);
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }
    private static String getBase64FromInputStream(InputStream is) throws Exception {
        // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
        byte[] data = null;
        // 读取图片字节数组
        try {
            ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
            byte[] buff = new byte[100];
            int rc = 0;
            while ((rc = is.read(buff, 0, 100)) > 0) {
                swapStream.write(buff, 0, rc);
            }
            data = swapStream.toByteArray();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    throw new Exception("输入流关闭异常");
                }
            }
        }
        //转化方法1
        BASE64Encoder encoder = new sun.misc.BASE64Encoder();
        return encoder.encodeBuffer(data).trim();
        //转化方法2
//        return new String(Base64.encodeBase64(data));
    }
}

+ 42 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -213,6 +213,21 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date dispDate;
    /**
     * 药品总价,单位元
     */
    private Double drugFee;
    /**
     * 检查检验总价,单位元
     */
    private Double inspectFee;
    /**
     * 诊查费,单位元
     */
    private Double regFee;
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
@ -512,4 +527,31 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    public void setDispDate(Date dispDate) {
        this.dispDate = dispDate;
    }
    @Column(name = "drug_fee")
    public Double getDrugFee() {
        return drugFee;
    }
    public void setDrugFee(Double drugFee) {
        this.drugFee = drugFee;
    }
    @Column(name = "inspect_fee")
    public Double getInspectFee() {
        return inspectFee;
    }
    public void setInspectFee(Double inspectFee) {
        this.inspectFee = inspectFee;
    }
    @Column(name = "reg_fee")
    public Double getRegFee() {
        return regFee;
    }
    public void setRegFee(Double regFee) {
        this.regFee = regFee;
    }
}

+ 1 - 1
server/svr-authentication/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-authentication-lyx
    name: svr-authentication
  cloud:
    config:
      failFast: true

+ 10 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -340,6 +340,16 @@ public class JobController extends BaseController {
                    res = internetService.upPrescriptionDrug(startDate,endDate,keyId);
                    logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
                    break;
                case "2.12" :
                    logger.info("START========2.12 在线诊疗服务信息-过程图片上传 ========");
                    res = internetService.upNsOnlineImg(startDate,endDate,keyId);
                    logger.info("END==========2.12 在线诊疗服务信息-过程图片上传 ========" + res);
                    break;
                case "2.13" :
                    logger.info("START========2.13 用户协议信息 ========");
                    res = internetService.upNsOrganProtocol(startDate,endDate,keyId);
                    logger.info("END==========2.13 用户协议信息 ========" + res);
                    break;
                default :
            }
            return success("success");

+ 1 - 1
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -6,7 +6,7 @@ prescriptionStatus_update_job=0 */2 * * * ?
prescription_overdue_job=0 0 1 * * ?
#每天13 点触发
data_upload_job=0 0 13 * * ?
data_upload_job=0 0 2 * * ?
#data_upload_25_job=0 0 1 * * ?
#

+ 3 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/config/DoctorServiceEndPoint.java

@ -55,9 +55,9 @@ public class DoctorServiceEndPoint extends EnvelopRestEndpoint {
    public Envelop queryById(
            @ApiParam(name = "doctorId", value = "医生id")
            @RequestParam(value = "doctorId", required = true) String doctorId)throws Exception{
        List<Map<String, Object>> list = baseDoctorService.queryById(doctorId);
        if (list != null && list.size() > 0){
            return success("查询成功",list);
        Object object = baseDoctorService.queryById(doctorId);
        if (null != object){
            return success("查询成功",object);
        }
        return failed("查询失败");
    }

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/internet/InternetController.java

@ -35,7 +35,7 @@ public class InternetController extends EnvelopRestEndpoint {
        ObjEnvelop env = new ObjEnvelop();
        Map map = new HashMap();
        try {
            String token =  internetService.upNsUserToken();
            String token =  internetService.upNsUserToken(internetService.getUrl());
            if("".equals(token)){
                return ObjEnvelop.getError("用户更新失败! ");

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/application.yml

@ -235,7 +235,7 @@ spring:
    port: 6390 # Redis server port.
    password: Kb6wKDQP1W4
fastDFS:
  fastdfs_file_url: http://192.0.33.26:8888/
  fastdfs_file_url: https://hlwyy.xmzsh.com/fastdfs/
fast-dfs:
  tracker-server: 192.0.33.26:22122 #服务器地址
wechat: