Browse Source

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

mengkang 5 years ago
parent
commit
71437ba5e5
19 changed files with 652 additions and 32 deletions
  1. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/PatientMappingDao.java
  2. 21 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java
  3. 6 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageDao.java
  4. 206 15
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 39 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  6. 136 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  7. 69 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionCheckDO.java
  8. 10 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  9. 1 1
      gateway/ag-basic/src/main/resources/application.yml
  10. 1 1
      gateway/ag-basic/src/main/resources/bootstrap.yml
  11. 1 1
      server/svr-authentication/src/main/resources/bootstrap.yml
  12. 1 1
      server/svr-configuration/src/main/resources/bootstrap.yml
  13. 5 5
      svr/svr-base/src/main/resources/application.yml
  14. 1 1
      svr/svr-base/src/main/resources/bootstrap.yml
  15. 5 1
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java
  16. 4 3
      svr/svr-internet-hospital-entrance/src/main/resources/application.yml
  17. 10 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java
  18. 109 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  19. 25 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/PatientMappingDao.java

@ -13,4 +13,6 @@ public interface PatientMappingDao extends PagingAndSortingRepository<PatientMap
    PatientMappingDO findByMappingCodeAndSource(String mappingCode,String source);
    PatientMappingDO findByPatient(String patient);
    PatientMappingDO findByMappingCode(String mappingCode);
}

+ 21 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionCheckDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionCheckDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
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 wangzhinan on 2020/5/18
 */
public interface PrescriptionCheckDao extends PagingAndSortingRepository<WlyyPrescriptionCheckDO, String>, JpaSpecificationExecutor<WlyyPrescriptionCheckDO> {
    @Query("select a from WlyyPrescriptionCheckDO a where a.prescriptionId = ?1 order by a.createTime desc ")
    List<WlyyPrescriptionCheckDO> findByPrescriptionId(String prescriptionId);
}

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageDao.java

@ -2,9 +2,11 @@ package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
@ -16,4 +18,8 @@ public interface PrescriptionExpressageDao extends PagingAndSortingRepository<Wl
    WlyyPrescriptionExpressageDO findByPrescriptionExpressMailno(String mailno);
    List<WlyyPrescriptionExpressageDO> findByOutpatientId(String outpatientId);
    @Modifying
    @Query("update WlyyPrescriptionExpressageDO p set p.mailno=?2  where p.id=?1")
    void updateMailNoById(String id, String mailno);
}

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

@ -54,6 +54,7 @@ import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
@ -179,6 +180,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private YkyyService ykyyService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private PrescriptionCheckDao prescriptionCheckDao;
    @Value("${demo.flag}")
@ -2292,7 +2295,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public MixEnvelop findExpressageList(String status, String oneselfPickupFlg, String nameKey, String startTime, String endTime, Integer page, Integer size) {
    public MixEnvelop findExpressageList(String status, String oneselfPickupFlg, String nameKey, String startTime, String endTime, Integer page, Integer size,String wxId) {
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " FROM " +
@ -2305,18 +2308,28 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            totalSql += " AND p.status in(" + status + ")";
        }
        if (StringUtils.isNotBlank(oneselfPickupFlg)) {
            totalSql += " AND e.oneself_pickup_flg =" + oneselfPickupFlg;
            totalSql += " AND e.oneself_pickup_flg = " + oneselfPickupFlg;
        }
        if (StringUtils.isNotBlank(nameKey)) {
            totalSql += " AND e.name like '%" + nameKey + "%'";
        }
        if (StringUtils.isNotBlank(startTime)) {
            totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotBlank(endTime)) {
            totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
            }
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
@ -2347,14 +2360,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql += " AND e.name like '%" + nameKey + "%'";
        }
        if (StringUtils.isNotBlank(startTime)) {
            sql += " AND e.create_time >='" + startTime + " 00:00:00'";
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time >='" + startTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotBlank(endTime)) {
            sql += " AND e.create_time <='" + endTime + " 23:59:59'";
        }
            if("xm_ykyy_wx".equals(wxId)){
                totalSql +=" and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')";
            }else {
                totalSql += " AND e.create_time <='" + endTime + " 23:59:59'";
            }
        sql += " LIMIT " + (page - 1) * size + "," + size + "";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        }
 /*       sql += " LIMIT " + (page - 1) * size + "," + size + "";*/
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql,page,size);
        for (Map<String,Object> map:list){
            List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(map.get("prescriptionId").toString());
            map.put("info",wlyyPrescriptionInfoDOS);
        }
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
@ -4176,7 +4202,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param realOrder 处方号
     * @return
     */
    public Object getSFExpressInfo(String admNo,String realOrder)throws Exception {
    public Object getSFExpressInfo(String admNo,String realOrder,String wxId)throws Exception {
    
        //根据门诊唯一号取就诊记录
        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
@ -4214,12 +4240,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    sfJsonObject.put("mailno", sfexpress_obj.getMailno());
                    sfJsonObject.put("mailtype", "标准快递");
                    sfJsonObject.put("destcode", "592");
                    sfJsonObject.put("j_name", "厦门大学附属中山医院");
                    if(wxId.equalsIgnoreCase("xm_zsyy_wx")){
                        sfJsonObject.put("j_name", "厦门大学附属中山医院");
                        sfJsonObject.put("j_phone", "4003008888");
                        sfJsonObject.put("j_townName", "思明区");
                        sfJsonObject.put("j_address", "湖滨南路201-209号");
                    }else if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
                        sfJsonObject.put("j_name", "厦门大学附属中山医院");
                        sfJsonObject.put("j_phone", "4003008888");
                        sfJsonObject.put("j_townName", "思明区");
                        sfJsonObject.put("j_address", "湖滨南路201-209号");
                    }
                    sfJsonObject.put("j_provinceName", "福建省");
                    sfJsonObject.put("j_cityName", "厦门市");
                    sfJsonObject.put("j_townName", "思明区");
                    sfJsonObject.put("j_address", "湖滨南路201-209号");
                    sfJsonObject.put("j_phone", "4003008888");
                    sfJsonObject.put("d_name", sfexpress_obj.getName());
                    sfJsonObject.put("d_provinceName", sfexpress_obj.getProvinceName());
                    sfJsonObject.put("d_cityName", sfexpress_obj.getCityName());
@ -5171,4 +5205,161 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        logger.info(sql);
        return hibenateUtils.createSQLQuery(sql,params,page,pagesize);
    }
    public List<Map<String,Object>> selectByCondition(String hospital, String dept, String status, String startTime, String endTime, String nameInfo, Integer page, Integer pagesize, String wxId){
        List<Map<String,Object>> maps = new ArrayList<>();
        String sql = "SELECT\n" +
                "\tp.doctor as \"doctor\",\n" +
                "\tp.id as \"id\",\n" +
                "\tp.doctor_name as \"doctorName\",\n" +
                "\tp.dept as \"dept\",\n" +
                "\tp.dept_name as \"deptName\",\n" +
                "\tp.hospital as \"hospital\",\n" +
                "\tp.hospital_name as \"hospitalName\",\n" +
                "\tp.patient_code as \"patientCode\",\n" +
                "\tp.patient_name as \"patientName\",\n" +
                "\tp.idcard as \"idcard\",\n" +
                "\tp.ssc as \"ssc\",\n";
        if("xm_ykyy_wx".equals(wxId)){
            sql = sql + "to_char(p.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"createTime\",";
        }else{
            sql = sql + "date_format(p.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"createTime\",";
        }
                sql +="\tp.`status` as \"status\"\n" +
                "FROM\n" +
                "\twlyy_prescription P\n" +
                "WHERE\n" +
                "\t1 = 1  ";
        Map<String,Object> params = new HashedMap();
        if (StringUtils.isNoneBlank(hospital)){
            sql +=" and p.hospital =:hospital";
            params.put("hospital",hospital);
        }
        if (StringUtils.isNoneBlank(dept)){
            sql +=" and p.dept =:dept";
            params.put("dept",dept);
        }
        if (StringUtils.isNoneBlank(status)){
            sql +=" and p.status =:status";
            params.put("status",status);
        }
        if (StringUtils.isNoneBlank(startTime)){
            sql +=" and p.create_time >=:startTime";
            params.put("startTime",DateUtil.stringToDate(startTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(endTime)){
            sql +=" and p.create_time <=:endTime";
            params.put("endTime",DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(nameInfo)){
            sql +=" and (p.patient_name like '%"+nameInfo+"%' or p.doctor_name like '%"+nameInfo+"%')";
        }
        sql +=" order by p.create_time desc";
        List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql,params,page,pagesize);
        String sqlTotal = "select COUNT(1) AS \"total\" from wlyy_prescription p where 1=1  ";
        Map<String,Object> params1 = new HashedMap();
        if (StringUtils.isNoneBlank(hospital)){
            sqlTotal +=" and p.hospital =:hospital";
            params1.put("hospital",hospital);
        }
        if (StringUtils.isNoneBlank(dept)){
            sqlTotal +=" and p.dept =:dept";
            params1.put("dept",dept);
        }
        if (StringUtils.isNoneBlank(status)){
            sqlTotal +=" and p.status =:status";
            params1.put("status",status);
        }
        if (StringUtils.isNoneBlank(startTime)){
            sqlTotal +=" and p.create_time >=:startTime";
            params1.put("startTime",DateUtil.stringToDate(startTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(endTime)){
            sqlTotal +=" and p.create_time <=:endTime";
            params1.put("endTime",DateUtil.stringToDate(endTime,"yyyy-MM-dd HH:mm:ss"));
        }
        if (StringUtils.isNoneBlank(nameInfo)){
            sqlTotal +=" and (p.patient_name like '%"+nameInfo+"%' or p.doctor_name like '%"+nameInfo+"%')";
        }
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params1);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        Map<String,Object> map = new HashedMap();
        map.put("count",count);
        map.put("list",mapList);
        maps.add(map);
        return maps;
    }
    /**
     * 修改处方状态
     * @param prescriptionId
     * @param status
     */
    public void updateStatus(String prescriptionId,Integer status){
        prescriptionDao.updateStatus(prescriptionId,status,new Date());
    }
    /**
     *  更改订单号
     *
     * @param id
     * @param mailNo
     */
    public void updateMailNoById(String id,String mailNo){
        prescriptionExpressageDao.updateMailNoById(id,mailNo);
    }
    /**
     * 审方
     * @param operate
     * @param operateName
     * @param reason
     * @param status
     * @param prescriptionId
     * @return
     */
    public WlyyPrescriptionCheckDO saveCheck(String operate,String operateName,String reason,Integer status,String prescriptionId){
        WlyyPrescriptionCheckDO prescriptionCheckDO = new WlyyPrescriptionCheckDO();
        prescriptionCheckDO.setCreateTime(new Date());
        prescriptionCheckDO.setOperate(operate);
        prescriptionCheckDO.setOperateName(operateName);
        prescriptionCheckDO.setUpdateTime(new Date());
        prescriptionCheckDO.setCreateUser(operate);
        prescriptionCheckDO.setCreateUserName(operateName);
        prescriptionCheckDO.setReason(reason);
        prescriptionCheckDO.setStatus(status);
        prescriptionCheckDO = prescriptionCheckDao.save(prescriptionCheckDO);
        if (status==4){
            prescriptionDao.updateStatus(prescriptionId,12);
        }else{
            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
            wlyyPrescriptionDO.setMkTime(new Date());
            wlyyPrescriptionDO.setMkFailReason(reason);
            wlyyPrescriptionDO.setStatus(11);
            prescriptionDao.save(wlyyPrescriptionDO);
        }
        return prescriptionCheckDO;
    }
    /**
     * 查询审批记录
     * @param prescriptionId
     * @return
     */
    public List<WlyyPrescriptionCheckDO> findPrescriptionCheck(String prescriptionId){
        return  prescriptionCheckDao.findByPrescriptionId(prescriptionId);
    }
}

+ 39 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -108,6 +108,45 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    }
    /**
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patient,String realOrder,String admNo,boolean demoFlag)throws Exception{
        String patNo =patientMappingService.findHisPatNoByPatient(patient);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        //BS16017(String REGISTER_SN,String realOrder,String PAT_NO,String ADM_NO,boolean demoFlag) throws Exception {
        logger.info("findOriginPrescriptionList: registerSn:"+registerSn+" patient"+patient+" patNo:"+patNo+" realOrder:"+realOrder+" admNo:"+admNo);
        return ykyyEntranceService.findV_MSDD01And02(admNo);
    }
    /**
     * 获取居民就诊记录接口
     * @param patient
     * @return
     * @throws Exception
     */
    public  WlyyOutpatientVO findOutpatientInfo(String patient,String conNo, boolean demoFlag)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        logger.info("findOutpatientList patNo "+patNo);
        List<WlyyOutpatientVO> wlyyOutpatientVOS = ykyyEntranceService.BS30025(patNo,conNo,null,null,demoFlag);
        if (wlyyOutpatientVOS!=null&&wlyyOutpatientVOS.size()!=0){
            WlyyOutpatientVO outpatientVO = wlyyOutpatientVOS.get(0);
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex()+"");
            outpatientVO.setBirthday(patientDO.getBirthday());
            return outpatientVO;
        }
       return null;
    }
    /**
     * 发起图文和视频复诊
     *

+ 136 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -34,6 +34,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.util.common.IdCardUtil;
@ -46,6 +47,7 @@ import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +55,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.security.acl.LastOwnerException;
import java.util.*;
/**
@ -201,6 +204,7 @@ public class YkyyEntranceService {
        return "success";
    }
    /**
     * 患者门诊就诊记录
     * 使用时间查询的话,很可能会超时。时间没有索引,所以超时时间需要加长
@ -334,6 +338,138 @@ public class YkyyEntranceService {
        return new JSONArray();
    }
    /**
     * HIS处方记录
     * @throws Exception
     */
    public List<WlyyPrescriptionVO> findV_MSDD01And02(String admNo) throws Exception{
        List<WlyyPrescriptionVO> wlyyPrescriptionVOList = new ArrayList<>();
        //处方数据
        String msd01 = "SELECT\n" +
                "\td.CFSB AS \"cfsb\",\n" +
                "\td.CFHM AS \"cfhm\",\n" +
                "\td.FKZT as \"fkzt\",\n" +
                "\td.CFLX as \"cflx\",\n" +
                "\td.KFRQ as \"kfrq\",\n" +
                "\td.SCDDH as \"scddh\",\n" +
                "\td.BRID as \"brid\",\n" +
                "\td.BRXM as \"brxm\",\n" +
                "\td.KSDM as \"ksdm\",\n" +
                "\td.YSDM as \"ysdm\",\n" +
                "\td.JZXH as \"jzxh\",\n" +
                "\td.GUID as \"guid\",\n" +
                "\td.JZKH as \"jzkh\"\n" +
                "FROM\n" +
                "\tV_MS_DD01 d\n" +
                "WHERE\n" +
                "\td.JZXH = '"+admNo+"'";
        Map<String,Object> params = new HashedMap();
        params.put("sql",msd01);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array =rs.getJSONArray("detailModelList");
            logger.info("precription:"+rs.getJSONArray("detailModelList"));
            for (int j=0;j<array.size();j++){
                WlyyPrescriptionVO wlyyPrescriptionVO = new WlyyPrescriptionVO();
                JSONObject object = array.getJSONObject(j);
                wlyyPrescriptionVO.setType(object.getInteger("cflx"));
                wlyyPrescriptionVO.setOrderNo(object.getString("scddh"));
                wlyyPrescriptionVO.setPayStatus(object.getInteger("fkzt"));
                wlyyPrescriptionVO.setPatientName(object.getString("brxm"));
                String brid = object.getString("brid");
                if (StringUtils.isNoneBlank(brid)){
                    PatientMappingDO mappingDO = patientMappingDao.findByMappingCode(brid);
                    if (mappingDO!=null){
                        wlyyPrescriptionVO.setPatientCode(mappingDO.getPatient());
                    }
                }
                wlyyPrescriptionVO.setSsc(object.getString("jzkh"));
                wlyyPrescriptionVO.setOrderId(object.getString("guid"));
                wlyyPrescriptionVO.setAdmNo(object.getString("jzxh"));
                wlyyPrescriptionVO.setRealOrder(object.getString("cfsb"));
                wlyyPrescriptionVO.setDept(object.getString("ksdm"));
                wlyyPrescriptionVO.setOriginRealOrder(object.getString("cfhm"));
                String msd02 = "SELECT\n" +
                        "\td.CFSB AS \"cfsb\",\n" +
                        "\td.YPXH as \"ypxh\",\n" +
                        "\td.YPCD as \"ypcd\",\n" +
                        "\td.YPSL as \"ypsl\",\n" +
                        "\td.YPDJ as \"ypdj\",\n" +
                        "\td.HJJE as \"hjje\",\n" +
                        "\td.YFDW as \"yfdw\",\n" +
                        "\td.MRCS as \"mrcs\",\n" +
                        "\td.YFBZ as \"yfbz\",\n" +
                        "\td.YPYF as \"ypyf\",\n" +
                        "\td.GYTJ as \"gytj\",\n" +
                        "\td.YCJL as \"ycjl\",\n" +
                        "\td.SBXH as \"sbxh\",\n" +
                        "\td.YFGG as \"yfgg\"\n" +
                        "FROM\n" +
                        "\tV_MS_DD02 d\n" +
                        "WHERE\n" +
                        "\td.cfsb = '"+wlyyPrescriptionVO.getRealOrder()+"'";
                Map<String,Object> params1 = new HashedMap();
                params1.put("sql",msd02);
                HttpResponse response1 = HttpUtils.doGet(url,params1);
                String content1 = response1.getContent();
                logger.info("response:"+content);
                JSONObject rs1 = JSON.parseObject(content1);
                Integer status1 = rs1.getInteger("status");
                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
                if(status1!=null&&status1 == 200){
                    JSONArray array1 =  rs1.getJSONArray("detailModelList");
                    logger.info("info"+rs1.getJSONArray("detailModelList"));
                    for (int i =0;i<array1.size();i++){
                        JSONObject object1 = array1.getJSONObject(i);
                        WlyyPrescriptionInfoVO prescriptionInfoVO = new WlyyPrescriptionInfoVO();
                        prescriptionInfoVO.setDrugNo(object1.getString("ypxh"));
                        prescriptionInfoVO.setDrugPlace(object1.getString("ypcd"));
                        prescriptionInfoVO.setQuantity(object1.getString("ypsl"));
                        prescriptionInfoVO.setPackRetprice(object1.getDouble("ypdj"));
                        prescriptionInfoVO.setPackUnitName(object1.getString("yfdw"));
                        prescriptionInfoVO.setDosage(object1.getString("mrcs"));
                        prescriptionInfoVO.setPackQuantity(object1.getInteger("yfbz"));
                        prescriptionInfoVO.setUsageCode(object1.getString("ypyf"));
                        prescriptionInfoVO.setYpyf(object1.getInteger("ypyf"));
                        prescriptionInfoVO.setHisCode(object1.getInteger("sbxh"));
                        prescriptionInfoVO.setSpecification(object1.getString("yfgg"));
                        wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
                    }
                }
                wlyyPrescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                List<WlyyPrescriptionDiagnosisVO> diagnosisVOS = new ArrayList<>();
                String mz = "SELECT ICD AS \"icd\",MSZD AS \"mszd\",JZXH AS \"jzxh\" FROM v_hlwys_mz_jbzd WHERE jzxh = '"+admNo+"'";
                Map<String,Object> params2 = new HashedMap();
                params2.put("sql",mz);
                HttpResponse response2 = HttpUtils.doGet(url,params2);
                String content2 = response2.getContent();
                logger.info("response:"+content2);
                JSONObject rs2 = JSON.parseObject(content2);
                Integer status2 = rs2.getInteger("status");
                if(status2!=null&&status2 == 200){
                    JSONArray array2 = rs2.getJSONArray("detailModelList");
                    for (int i=0;i<array2.size();i++){
                        JSONObject object2 = array2.getJSONObject(i);
                        WlyyPrescriptionDiagnosisVO diagnosisVO = new WlyyPrescriptionDiagnosisVO();
                        diagnosisVO.setCode(object2.getString("icd"));
                        diagnosisVO.setName(object2.getString("mszd"));
                        diagnosisVOS.add(diagnosisVO);
                    }
                }
                wlyyPrescriptionVO.setDiagnosisVOs(diagnosisVOS);
                wlyyPrescriptionVOList.add(wlyyPrescriptionVO);
            }
        }
        return wlyyPrescriptionVOList;
    }
    public String updateYkyyDoctor()throws Exception{
        String sql ="select y.code AS \"code\",y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard is not null";
        Map<String,Object> params = new HashedMap();

+ 69 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionCheckDO.java

@ -0,0 +1,69 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 在线处方审核
*
* @author wangzhinan 20200518
*
*/
@Entity
@Table(name = "wlyy_prescription_check")
public class WlyyPrescriptionCheckDO extends UuidIdentityEntityWithOperator {
    private String prescriptionId;
    private Integer status;
    private String reason;
    private String operate;
    private String operateName;
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getOperate() {
        return operate;
    }
    public void setOperate(String operate) {
        this.operate = operate;
    }
    public String getOperateName() {
        return operateName;
    }
    public void setOperateName(String operateName) {
        this.operateName = operateName;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}

+ 10 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -387,6 +387,16 @@ public class BaseHospitalRequestMapping {
        public static final String selectOrderStatus="/selectOrderStatus";
        public static final String selectPrescriptionList = "/selectPrescriptionList";
        public static final String updateStatus  = "/updateStatus";
        public static final String updateMailNoById = "/updateMailNoById";
        public static final  String prescriptionCheck = "/prescriptionCheck";
        public static final  String prescriptionCheckList = "/prescriptionCheckList";
    }

+ 1 - 1
gateway/ag-basic/src/main/resources/application.yml

@ -182,7 +182,7 @@ spring:
spring:
  profiles: iotprod
  datasource:
     url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     url: jdbc:mysql://10.90.32.2:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true&useSSL=false
     username: wlyy
     password: jkzlehr@123
  redis:

+ 1 - 1
gateway/ag-basic/src/main/resources/bootstrap.yml

@ -95,5 +95,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.174:1221}
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      label: ${wlyy.spring.config.label:master}

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

@ -97,5 +97,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.174:1221}
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      label: ${wlyy.spring.config.label:master}

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

@ -137,6 +137,6 @@ spring:
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      server:
        git:
          uri: ${wlyy.spring.config.git.uri:http://192.168.120.216:10010/jkzl/config.git}
          uri: ${wlyy.spring.config.git.uri:http://127.0.0.1:10010/jkzl/config.git}
          basedir: /usr/local/wlyy2.0-config
        default-label: ${wlyy.spring.config.git.label:master}

+ 5 - 5
svr/svr-base/src/main/resources/application.yml

@ -292,7 +292,7 @@ testPattern:
spring:
  profiles: iotprod
  datasource:
    url: jdbc:mysql://59.61.92.90:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    url: jdbc:mysql://10.90.32.2:20002/iot-base?useUnicode:true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: wlyy
    password: jkzlehr@123
#    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
@ -300,10 +300,10 @@ spring:
#    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 59.61.92.90:20010,59.61.92.90:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 10.90.32.2:20010,10.90.32.2:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://59.61.92.90:20009,http://59.61.92.90:20011
      uris: http://10.90.32.2:20009,http://10.90.32.2:20011
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
@ -311,8 +311,8 @@ spring:
    user: admin
    password: admin
  redis:
    host: 59.61.92.90 # Redis server host.
    port: 9054  # Redis server port.
    host: 10.90.32.2 # Redis server host.
    port: 20008  # Redis server port.
    password: jkzlehr
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/

+ 1 - 1
svr/svr-base/src/main/resources/bootstrap.yml

@ -63,5 +63,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.109:1221}
      uri: ${wlyy.spring.config.uri:http://192.168.120.216:1221}
      label: ${wlyy.spring.config.label:master}

File diff suppressed because it is too large
+ 5 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java


+ 4 - 3
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -156,7 +156,8 @@ testPattern:
  sign: 0
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
---
@ -239,7 +240,7 @@ testPattern:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
---
#心脏中心前置机配置
@ -273,4 +274,4 @@ testPattern:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段

+ 10 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/file_upload/FileUploadEndpoint.java

@ -13,6 +13,7 @@ import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -70,7 +71,9 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM)
    @ApiOperation(value = "文件流上传文件", notes = "文件流上传文件")
    public ObjEnvelop<UploadVO> uploadStream(@ApiParam(value = "文件", required = true)
                                                 @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
                                                 @RequestParam(value = "file", required = true) MultipartFile file,
                                             @ApiParam(value = "文件", required = true)
                                             @RequestParam(value = "filename", required = false) String filename) throws Exception{
        UploadVO uploadVO = new UploadVO();
        if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
@ -85,6 +88,12 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
        }else {
            // 得到文件的完整名称  xxx.txt
            String originalFilename = file.getOriginalFilename();
            
            //判断文件名称是否有包含后缀,及前端是否有传后缀名称,有的话拼接图片后缀
            if(originalFilename.lastIndexOf(".") == 0 && StringUtils.isNotEmpty(filename)){
                originalFilename = originalFilename +"."+filename;
            }
            
            InputStream inputStream = file.getInputStream();
            uploadVO = fileUploadService.uploadStream(inputStream,originalFilename,fastdfs_file_url);
        }

+ 109 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -402,7 +402,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "page", required = false)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = false)Integer size) {
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size);
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size,wxId);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.setMailno)
@ -427,7 +427,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                    @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                                    @RequestParam(value = "endTime", required = false)String endTime,
                                    HttpServletResponse response) throws Exception{
        MixEnvelop expressages = prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,1,10000);
        MixEnvelop expressages = prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,1,10000,wxId);
        List<Map<String,Object>> list = expressages.getDetailModelList();
        response.setContentType("octets/stream");
        response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
@ -1192,4 +1192,111 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.selectPrescriptionList)
    @ApiOperation(value = "查询处方列表")
    public ListEnvelop findPrescriptionList(@ApiParam(name = "hospital", value = "医院code")
                                                  @RequestParam(value = "hospital",required = false)String hospital,
                                                  @ApiParam(name = "dept", value = "科室code")
                                                  @RequestParam(value = "dept",required = false)String dept,
                                                  @ApiParam(name = "status", value = "状态")
                                                  @RequestParam(value = "status",required = false)String status,
                                                  @ApiParam(name = "startTime", value = "开始时间")
                                                  @RequestParam(value = "startTime",required = false)String startTime,
                                                  @ApiParam(name = "endTime", value = "结束时间")
                                                  @RequestParam(value = "endTime",required = false)String endTime,
                                                  @ApiParam(name = "nameinfo", value = "医生名字/患者名字")
                                                  @RequestParam(value = "nameinfo",required = false)String nameinfo,
                                                  @ApiParam(name = "page", value = "第几页")
                                                  @RequestParam(value = "page",required = false)Integer page,
                                                  @ApiParam(name = "pagesize", value = "每页大小")
                                                  @RequestParam(value = "pagesize",required = false)Integer pagesize) {
        return success(prescriptionService.selectByCondition(hospital,dept,status,startTime,endTime,nameinfo,page,pagesize,wxId));
    }
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.updateStatus)
    @ApiOperation("完成自取")
    public ObjEnvelop updateStatus(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId,
            @ApiParam(name = "status", value = "status", required = true)
            @RequestParam(required = true)Integer status) throws Exception {
        try {
            prescriptionService.updateStatus(prescriptionId,status);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 更改单号
     * @param id
     * @param mailNo
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.updateMailNoById)
    @ApiOperation("更改单号")
    public ObjEnvelop updateMailNoById(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(required = true)String id,
            @ApiParam(name = "mailNo", value = "mailNo", required = true)
            @RequestParam(required = true)String mailNo) throws Exception {
        try {
            prescriptionService.updateMailNoById(id,mailNo);
            return ObjEnvelop.getSuccess("ok",null);
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 处方-- 审方
     *
     * @param operate
     * @param operateName
     * @param reason
     * @param status
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.prescriptionCheck)
    @ApiOperation("处方-审方")
    public ObjEnvelop prescriptionCheck(
            @ApiParam(name = "operate", value = "operate", required = true)
            @RequestParam(required = true)String operate,
            @ApiParam(name = "operateName", value = "operateName", required = true)
            @RequestParam(required = true)String operateName,
            @ApiParam(name = "reason", value = "reason", required = true)
            @RequestParam(required = true)String reason,
            @ApiParam(name = "status", value = "status", required = true)
            @RequestParam(required = true)Integer status,
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            //String operate,String operateName,String reason,Integer status,String prescriptionId
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveCheck(operate,operateName,reason,status,prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.prescriptionCheckList)
    @ApiOperation("查询审核历史记录")
    public ObjEnvelop prescriptionCheckList(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.findPrescriptionCheck(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 25 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -67,6 +67,31 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(vos);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOutpatientInfo)
    @ApiOperation(value = " 查询单条门诊就诊记录")
    public ObjEnvelop findOutpatientInfo(@ApiParam(name = "patient", value = "居民id")
                                         @RequestParam(value = "patient",required = false) String patient,
                                         @ApiParam(name = "conNo", value = "就诊次数")
                                         @RequestParam(value = "conNo",required = false) String conNo)throws Exception{
        WlyyOutpatientVO obj = prescriptionService.findOutpatientInfo(patient,conNo,demoFlag);
        return success(obj);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescriptionList)
    @ApiOperation(value = "门诊下所有处方信息")
    public ListEnvelop findOriginPrescriptionList(
            @ApiParam(name = "registerSn", value = "流水号")
            @RequestParam(value = "registerSn",required = false) String registerSn,
            @ApiParam(name = "patNo", value = "病人id")
            @RequestParam(value = "patNo",required = false) String patNo,
            @ApiParam(name = "admNo", value = "住院唯一号")
            @RequestParam(value = "admNo",required = false) String admNo,
            @ApiParam(name = "realOrder", value = "处方号")
            @RequestParam(value = "realOrder",required = false) String realOrder) throws Exception {
        List<WlyyPrescriptionVO> obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        return success(obj);
    }
    @PostMapping(value = BaseHospitalRequestMapping.YkyyPrescription.appointmentRevisit)
    @ApiOperation(value = "居民发起复诊", notes = "居民发起复诊")