浏览代码

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

LiTaohong 6 年之前
父节点
当前提交
c49f662a2e
共有 27 个文件被更改,包括 715 次插入85 次删除
  1. 16 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyChargeDictDao.java
  2. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java
  3. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionExpressageLogDao.java
  4. 116 17
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 97 37
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  6. 2 0
      business/base-service/src/mqConfig/esbmq-config.xml
  7. 1 1
      business/base-service/src/mqConfig/mqdata/BS10111.json
  8. 16 8
      business/base-service/src/mqConfig/mqdata/BS16017.json
  9. 14 7
      business/base-service/src/mqConfig/mqdata/BS16017_03.json
  10. 1 0
      business/base-service/src/mqConfig/mqdata/BS20011.json
  11. 1 0
      business/base-service/src/mqConfig/mqdata/BS20019.json
  12. 1 0
      business/base-service/src/mqConfig/mqdata/BS25017.json
  13. 1 0
      business/base-service/src/mqConfig/mqdata/BS55010.json
  14. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHospitalDeptDO.java
  15. 66 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/WlyyChargeDictDO.java
  16. 14 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionInfoDO.java
  17. 95 0
      common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotDeviceBaiyiDO.java
  18. 10 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  19. 11 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java
  20. 22 3
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java
  21. 1 1
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java
  22. 14 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/JpaConfig.java
  23. 35 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  24. 5 0
      svr/svr-internet-hospital/src/main/resources/application.yml
  25. 147 8
      svr/svr-iot-sunnuo/src/main/java/com/yihu/iot/datainput/controller/IotAnalyzerController.java
  26. 12 0
      svr/svr-iot-sunnuo/src/main/java/com/yihu/iot/datainput/dao/IotDeviceBaiyiDao.java
  27. 12 0
      svr/svr-iot-sunnuo/src/main/java/com/yihu/iot/datainput/service/IotAnalyzerService.java

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

@ -0,0 +1,16 @@
package com.yihu.jw.hospital.dict;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import javax.transaction.Transactional;
/**
 * Created by zdm on 2019/5/28.
 */
@Transactional
public interface WlyyChargeDictDao extends PagingAndSortingRepository<WlyyChargeDictDO, String>, JpaSpecificationExecutor<WlyyChargeDictDO> {
}

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

@ -28,4 +28,6 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    void updateStatus(String id, Integer status, Date date);
    List<WlyyPrescriptionDO> findByOutpatientId(String outpatientId);
    List<WlyyPrescriptionDO> findById(String id);
}

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

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionExpressageLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -12,5 +13,6 @@ import java.util.List;
public interface PrescriptionExpressageLogDao extends PagingAndSortingRepository<WlyyPrescriptionExpressageLogDO, String>, JpaSpecificationExecutor<WlyyPrescriptionExpressageLogDO> {
    List<WlyyPrescriptionExpressageLogDO> queryByOutpatientId(String outpatientId);
    List<WlyyPrescriptionExpressageLogDO> queryByOutpatientIdOrderByCreateTimeDesc(String outpatientId);
}

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

@ -31,10 +31,14 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import jxl.*;
import jxl.write.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.ss.usermodel.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -42,6 +46,9 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.Boolean;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -126,15 +133,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 原处方记录列表
     * @param registerSn
     * @param patNo
     * @param admNo
     * @param demoFlag
     * @return
     * @throws Exception
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patNo,String admNo,boolean demoFlag)throws Exception{
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patient,String admNo,boolean demoFlag)throws Exception{
        String patNo =patientMappingService.findHisPatNoByPatient(patient);
        return entranceService.BS16017(registerSn,patNo,admNo,null,demoFlag);
    }
@ -194,7 +196,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " o.origin_register_no AS originRegisterNo, " +
                " o.hospital," +
                " o.hospital_name AS hospitalName," +
                " o.winNo," +
                " o.win_no AS winNo," +
                " o.type," +
                " o.dept AS dept, " +
                " o.dept_name AS deptName, " +
@ -237,7 +239,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param outpatientId
     * @return
     */
    public com.alibaba.fastjson.JSONObject findReOutpatientInfo(String outpatientId){
    public com.alibaba.fastjson.JSONObject findReOutpatientInfo(String outpatientId,String prescriptionId){
        com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject();
        //复诊信息
@ -257,7 +259,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("mobile",basePatientDO.getMobile());
        //获取处方信息
        List<WlyyPrescriptionDO> prescriptionDOs = prescriptionDao.findByOutpatientId(outpatientId);
        List<WlyyPrescriptionDO> prescriptionDOs = null;
        if(StringUtils.isNotBlank(prescriptionId)){
            prescriptionDOs = prescriptionDao.findById(prescriptionId);
        }else{
            prescriptionDOs = prescriptionDao.findByOutpatientId(outpatientId);
        }
        List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>();
        if(prescriptionDOs!=null&&prescriptionDOs.size()>0){
            convertToModels(prescriptionDOs,prescriptionVOs,WlyyPrescriptionVO.class);
@ -283,9 +291,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        //物流配送新
        List<WlyyPrescriptionExpressageLogDO>  expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientId(outpatientId);
        List<WlyyPrescriptionExpressageLogDO>  expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
        List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
        if(expressageLogDOs!=null&&expressageLogVOs.size()>0){
        if(expressageLogDOs!=null&&expressageLogDOs.size()>0){
            rs.put("expressageLogs",convertToModels(expressageLogDOs,expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
        }else{
            rs.put("expressageLogs",null);
@ -580,12 +588,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public boolean updatePrescriptionByHisStatu(String admNo,String realOrder,String status)throws Exception {
        String sql = "";
        //status 处方流程状态 ,11 药师审核失败 / 调整中,12  药师审核完成,已完成:100 已完成
        //status 处方流程状态 ,13  开方失败/调整中,20 诊断完成/开方成功/待支付,已完成:100 已完成
        //pay_status`:处方结算状态,0为未结算,1为结算成功,默认为0',
        String outPatientSql="";
        if ("1".equals(status)) {
            sql = "UPDATE base.wlyy_prescription p SET p.`status`='11' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
            sql = "UPDATE base.wlyy_prescription p SET p.`status`='13' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
        } else if ("2".equals(status)) {
            sql = "UPDATE base.wlyy_prescription p SET p.`status`='12' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
            sql = "UPDATE base.wlyy_prescription p SET p.`status`='20' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
            //变更门诊状态
            outPatientSql="UPDATE base.wlyy_outpatient p SET p.`status`='2' WHERE p.adm_no='" + admNo + "'";
            jdbcTemplate.execute(outPatientSql);
        } else if ("3".equals(status)) {
            sql = "UPDATE base.wlyy_prescription p SET p.`status`='100',p.pay_status='1' WHERE p.adm_no='" + admNo + "' AND p.real_order='" + realOrder + "' ";
        }
@ -932,7 +944,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " o.id AS outpatientId, " +
                " o.icd10_name AS icd10Name, " +
                " p.`status`, " +
                " p.id AS prescriptionId " +
                " p.id AS prescriptionId ," +
                " e.id AS expressageId" +
                " FROM " +
                " wlyy_outpatient o " +
                " JOIN wlyy_prescription p ON p.outpatient_id = o.id " +
@ -961,4 +974,90 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
    }
    public Boolean setMailno(String mailno, String expressageId){
        WlyyPrescriptionExpressageDO expressageDO =  prescriptionExpressageDao.findOne(expressageId);
        expressageDO.setMailno(mailno);
        prescriptionExpressageDao.save(expressageDO);
        return true;
    }
    public void pushListWrite(OutputStream os, List<Map<String,Object>> ls) throws Exception{
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet",1);
            String[] header = {"订单日期","收货人","诊断结果","配送方式", "订单状态"};
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
                k++;
            }
            int i = 1;
            for (Map<String,Object> m : ls) {
                addCell(ws, i, 0, DateUtil.dateToStr((Date)m.get("createTime"),"yyyy-MM-dd HH:mm:ss"),"");
                addCell(ws, i, 1, (String)m.get("name"),"");
                addCell(ws, i, 2, (String)m.get("icd10Name"),"");
                addCell(ws, i, 3, getOneselfPickupFlgString((Integer)m.get("oneselfPickupFlg")),"");
                addCell(ws, i, 4, getStatusName((Integer)m.get("status")),"");
                i++;
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    /**
     *
     * @return
     */
    public String getOneselfPickupFlgString(Integer oneselfPickupFlg){
        if(1 == oneselfPickupFlg){
            return "自取";
        }else if(0 == oneselfPickupFlg){
            return "快递";
        }else{
            return "其他";
        }
    }
    /**
     *
     * @param status
     * @return
     */
    public String getStatusName(Integer status){
        if(31==status){
            return "待配送";
        }else if(32==status){
            return "配送中";
        }else if(100==status){
            return "已完成";
        }else{
            return "其他";
        }
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column,  String data) throws WriteException {
        Label label = new Label(column ,row, data);
        ws.addCell(label);
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column, String data, String memo) throws WriteException {
        Label label = new Label(column ,row, data);
        if(!org.springframework.util.StringUtils.isEmpty(memo)){
            WritableCellFeatures cellFeatures = new WritableCellFeatures();
            cellFeatures.setComment(memo);
            label.setCellFeatures(cellFeatures);
        }
        ws.addCell(label);
    }
}

+ 97 - 37
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -6,8 +6,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.dict.service.DictHospitalDeptService;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.mapping.HospitalDeptMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.mapping.dao.HospitalDeptMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
@ -79,6 +81,8 @@ public class EntranceService {
    private DictHospitalDeptDao dictHospitalDeptDao;
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private WlyyChargeDictDao wlyyChargeDictDao;
    /**
     * 获取本地示例返参
@ -362,9 +366,9 @@ public class EntranceService {
        String patientName=null != jsonObjectBody.get("UOM") ? jsonObjectBody.get("UOM").toString() : "";
        PatientMappingDO patientMappingDo=new PatientMappingDO();
        if(StringUtils.isNotBlank(patNo)){
            patientMappingDo=  patientMappingDao.findByMappingCodeAndSource(patNo,"1");
            patNo=StringUtils.isBlank(patientMappingDo.getPatient())?patNo:patientMappingDo.getPatient();
            patientName=StringUtils.isBlank(patientMappingDo.getPatientName())?patientName:patientMappingDo.getPatientName();
            patientMappingDo=  patientMappingDao.findByMappingCodeAndSource(patNo.trim(),"1");
            patNo=null==patientMappingDo?null:patientMappingDo.getPatient();
            patientName=null==patientMappingDo?null:patientMappingDo.getPatientName();
        }
        wlyyPrescriptionVO.setPatientCode(patNo);
@ -406,7 +410,7 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public  List<WlyyOutpatientVO> BS30025(String PAT_NO,String admNo,String registerSn,String startTime,String endTime,boolean demoFlag) throws Exception {
    public  List<WlyyOutpatientVO> BS30025(String PAT_NO,String conNo,String admNo,String registerSn,String startTime,String endTime,boolean demoFlag) throws Exception {
        String fid = BS30025;
        String resp = "";
        if (demoFlag) {
@ -422,6 +426,9 @@ public class EntranceService {
            if (StringUtils.isNotBlank(PAT_NO)) {
                sbs.append("<query compy=\"=\" item=\"PAT_NO\" splice=\"and\" value=\"'" + PAT_NO + "'\"/>");
            }
            if (StringUtils.isNotBlank(conNo)) {
                sbs.append("<query compy=\"=\" item=\"CON_NO\" splice=\"and\" value=\"'" + conNo + "'\"/>");
            }
            if (StringUtils.isNotBlank(admNo)) {
                sbs.append("<query compy=\"=\" item=\"ADM_NO\" splice=\"and\" value=\"'" + admNo + "'\"/>");
            }
@ -456,9 +463,9 @@ public class EntranceService {
                String patientName=null != jsonObjectMgsInfo.get("PAT_NAME") ? jsonObjectMgsInfo.get("PAT_NAME").toString() : "";
                PatientMappingDO patientMappingDo=new PatientMappingDO();
                if(StringUtils.isNotBlank(patNo)){
                    patientMappingDo=  patientMappingDao.findByMappingCodeAndSource(patNo,"1");
                    patNo=StringUtils.isBlank(patientMappingDo.getPatient())?patNo:patientMappingDo.getPatient();
                    patientName=StringUtils.isBlank(patientMappingDo.getPatientName())?patientName:patientMappingDo.getPatientName();
                    patientMappingDo=  patientMappingDao.findByMappingCodeAndSource(patNo.trim(),"1");
                    patNo=null==patientMappingDo?null:patientMappingDo.getPatient();
                    patientName=null==patientMappingDo?null:patientMappingDo.getPatientName();
                }
                wlyyOutpatientVO.setPatient(patNo);
                wlyyOutpatientVO.setPatientName(patientName);
@ -811,22 +818,21 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray MS02013(boolean demoFlag) throws Exception {
    public net.sf.json.JSONArray MS02013(String code) throws Exception {
        String fid=MS02013;
        String resp="";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>"+mqUser+"</UserName><Password>"+mqPwd+"</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
           //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg/><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        StringBuffer sbs= new StringBuffer();
        //AccessControl :用户、密码、服务id
        sbs.append("<ESBEntry><AccessControl><Fid>"+fid+"</Fid><UserName>JKZL</UserName><Password>123456</Password></AccessControl>");
        //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
        sbs.append("<MessageHeader><Fid>"+fid+"</Fid><MsgDate>"+ DateUtil.dateToStr(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS)+"</MsgDate><SourceSysCode>S60</SourceSysCode><TargetSysCode>S01</TargetSysCode></MessageHeader>");
        //查询信息拼接
        sbs.append("<MsgInfo><endNum>20000</endNum><Msg/>");
        if(StringUtils.isNotBlank(code)){
            sbs.append("<query compy=\"=\" item=\"code\" splice=\"and\" value=\"'"+code+"'\"/>");
        }
        sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
        String resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid );
        resp= MqSdkUtil.xml2jsonArrayRootRow(resp);
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
@ -1065,12 +1071,6 @@ public class EntranceService {
                sbs.append("<query compy=\"=\" item=\"times\" splice=\"and\" value=\"'" + conNo + "'\"/>");
            }
             sbs.append("<order item=\"apply_date\" sort=\"desc\"/>");
            //<ESBEntry><AccessControl><Fid>BS25017</Fid><UserName>JKZL</UserName><Password>123456</Password></AccessControl>
            // <MessageHeader><Fid>BS25017</Fid><MsgDate>2019-06-03 13:52:39</MsgDate><SourceSysCode>S47</SourceSysCode><TargetSysCode>S01</TargetSysCode></MessageHeader>
            // <MsgInfo><endNum>20000</endNum><Msg/>
            // <query compy="=" item="inpatient_no" splice="and" value="'P10728535-0'"/>
            // <query compy="=" item="times" splice="and" value="'62'"/>
            // <order item="apply_date" sort="desc"/><startNum>1</startNum></MsgInfo></ESBEntry>
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
@ -1124,6 +1124,7 @@ public class EntranceService {
    public JSONArray BS20019(String patNo,String  conNo,boolean demoFlag) throws Exception {
        String fid="BS20019";
        String resp="";
        net.sf.json.JSONArray jsonArrayLast=new net.sf.json.JSONArray();
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
@ -1131,8 +1132,6 @@ public class EntranceService {
            JSONArray jsonArray= BS20010(patNo,conNo,demoFlag);
            for(Object object:jsonArray){
                net.sf.json.JSONObject jsonObjectBody=(net.sf.json.JSONObject)object;
                jsonObjectBody= (net.sf.json.JSONObject)jsonObjectBody.get("body");
                jsonObjectBody=null==jsonObjectBody?jsonObjectBody:(net.sf.json.JSONObject)jsonObjectBody.get("row");
                if(null!=jsonObjectBody){
                    String applyno=null==jsonObjectBody.get("applyno")?"":jsonObjectBody.get("applyno").toString();
                    if(StringUtils.isNotBlank(applyno)){
@ -1150,15 +1149,15 @@ public class EntranceService {
                        sbs.append("</MsgInfo></ESBEntry>");
                        resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
                        resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
                        ConvertUtil.convertListEnvelopInBodyRow(resp);
                        net.sf.json.JSONArray jsonArray1= ConvertUtil.convertListEnvelopInBodyRow(resp);
                        jsonArrayLast.add(jsonArray1);
                    }
                }
                return null;
            }
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return jsonArrayLast;
    }
    /**
@ -1172,6 +1171,7 @@ public class EntranceService {
    public JSONArray BS20011(String patNo,String  conNo,boolean demoFlag) throws Exception {
        String fid="BS20011";
        String resp="";
        net.sf.json.JSONArray jsonArrayLast=new net.sf.json.JSONArray();
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
@ -1192,20 +1192,18 @@ public class EntranceService {
                        //查询信息拼接
                        sbs.append("<MsgInfo><endNum>20000</endNum><Msg/>");
                        if (StringUtils.isNotBlank(applyno)) {
                            //TODO 是ApplyNo?
                            sbs.append("<query compy=\"=\" item=\"applyno\" splice=\"and\" value=\"'" + applyno + "'\"/>");
                        }
                        sbs.append("<order item=\"ResultTime\" sort=\"desc\"/>");
                        sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
                        resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
                        resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
                        ConvertUtil.convertListEnvelopInBodyRow(resp);
                        net.sf.json.JSONArray jsonArray1= ConvertUtil.convertListEnvelopInBodyRow(resp);
                        jsonArrayLast.add(jsonArray1);
                    }
                }
                return null;
            }
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
        return jsonArrayLast;
    }
    /**
@ -1244,4 +1242,66 @@ public class EntranceService {
    }
    public List<WlyyChargeDictDO> BS55010(String windowsNo,String code,String chargeType,boolean demoFlag) throws Exception {
        String fid="BS55010";
        String resp="";
        Map<String,Object> map=new HashMap<>();
        List<WlyyChargeDictDO> wlyyChargeDictDOS=new ArrayList<>();
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>"+mqUser+"</UserName><Password>"+mqPwd+"</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+targetSysCode+"</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg/>");
            if (StringUtils.isNotBlank(windowsNo)) {
                sbs.append("<query compy=\"=\" item=\"windows_no\" splice=\"and\" value=\"'"+windowsNo+"'\"/>");
            }
            if (StringUtils.isNotBlank(chargeType)) {
                sbs.append("<query compy=\"=\" item=\"charge_type\" splice=\"and\" value=\"'"+chargeType+"'\"/>");
            }
            if (StringUtils.isNotBlank(code)) {
                sbs.append("<query compy=\"=\" item=\"code\" splice=\"and\" value=\"'"+code+"'\"/>");
            }
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        net.sf.json.JSONArray jsonArray= ConvertUtil.convertListEnvelopInBodyRow(resp);
        for(Object object:jsonArray){
            net.sf.json.JSONObject jsonObjectBody=(net.sf.json.JSONObject)object;
            String chareName="";
            if(null!=jsonObjectBody){
                String chareCode=null==jsonObjectBody.get("charge_type")?"":jsonObjectBody.get("charge_type").toString();
                String winNo=null==jsonObjectBody.get("windows_no")?"":jsonObjectBody.get("windows_no").toString();
                //WlyyChargeDictDO
                if(!map.containsKey(chareCode+"_"+winNo)){
                    //查询号别
                    net.sf.json.JSONArray chares= MS02013(chareCode);
                    for(Object object1:chares) {
                        net.sf.json.JSONObject jsonObjectBody1 = (net.sf.json.JSONObject) object1;
                        chareName=null==jsonObjectBody1.get("name")?"":jsonObjectBody1.get("name").toString();
                        System.out.println(chareCode+chareName);
                        WlyyChargeDictDO wlyyChargeDictDO=new WlyyChargeDictDO();
                        wlyyChargeDictDO.setChargeType(chareCode);
                        wlyyChargeDictDO.setChargeName(chareName);
                        wlyyChargeDictDO.setDeptTypeCode(winNo);
                        Double free=null==jsonObjectBody.get("req_fee")?0:Double.parseDouble(jsonObjectBody.get("req_fee").toString());
                        wlyyChargeDictDO.setReqFee(free);
                        wlyyChargeDictDO.setCreateTime(new Date());
                        map.put(chareCode+"_"+winNo,chareName);
                        wlyyChargeDictDO=wlyyChargeDictDao.save(wlyyChargeDictDO);
                        wlyyChargeDictDOS.add(wlyyChargeDictDO);
                    }
                }
            }
        }
        return wlyyChargeDictDOS;
    }
}

+ 2 - 0
business/base-service/src/mqConfig/esbmq-config.xml

@ -55,6 +55,8 @@
				<BS20018_1>EwellQ.S60.BS20018.GET</BS20018_1>
				<BS20011_0>EwellQ.S60.BS20011.PUT</BS20011_0>
				<BS20011_1>EwellQ.S60.BS20011.GET</BS20011_1>
				<BS55010_0>EwellQ.S60.BS55010.PUT</BS55010_0>
				<BS55010_1>EwellQ.S60.BS55010.GET</BS55010_1>
			</QUEUES>
		</QMGR.S60>
	</MQCONFIG>

+ 1 - 1
business/base-service/src/mqConfig/mqdata/BS10111.json

@ -1 +1 @@
{"code":"1","MsgInfo":[{"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47147412"}}]}
{"code":"1","MsgInfo":[{"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47310714","@times":"66"}}]}

+ 16 - 8
business/base-service/src/mqConfig/mqdata/BS16017.json

@ -48,7 +48,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -100,7 +101,8 @@
					"diag_five": [],
					"real_order": "401934082",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		},
@ -152,7 +154,8 @@
					"diag_five": [],
					"real_order": "401934081",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		},
@ -204,7 +207,8 @@
					"diag_five": [],
					"real_order": "401934082",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		},
@ -256,7 +260,8 @@
					"diag_five": [],
					"real_order": "401934082",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		},
@ -308,7 +313,8 @@
					"diag_five": [],
					"real_order": "401934082",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		},
@ -360,7 +366,8 @@
					"diag_five": [],
					"real_order": "401934082",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		},
@ -412,7 +419,8 @@
					"diag_five": [],
					"real_order": "401934082",
					"drug_win": "1",
					"frequency": "无组"
					"frequency": "无组",
					"SETTLE_FLAG": "1"
				}
			}
		}]

+ 14 - 7
business/base-service/src/mqConfig/mqdata/BS16017_03.json

@ -48,7 +48,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -100,7 +101,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -152,7 +154,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -204,7 +207,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -256,7 +260,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -308,7 +313,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	},
@ -360,7 +366,8 @@
				"diag_five": [],
				"real_order": "401934082",
				"drug_win": "1",
				"frequency": "无组"
				"frequency": "无组",
				"SETTLE_FLAG": "1"
			}
		}
	}]

文件差异内容过多而无法显示
+ 1 - 0
business/base-service/src/mqConfig/mqdata/BS20011.json


文件差异内容过多而无法显示
+ 1 - 0
business/base-service/src/mqConfig/mqdata/BS20019.json


文件差异内容过多而无法显示
+ 1 - 0
business/base-service/src/mqConfig/mqdata/BS25017.json


文件差异内容过多而无法显示
+ 1 - 0
business/base-service/src/mqConfig/mqdata/BS55010.json


+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHospitalDeptDO.java

@ -44,7 +44,6 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
    /**
     * 6总部7金榜8夏禾
     */
    @Autowired
    private String deptTypeCode;
@ -80,6 +79,7 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
        this.createTime = createTime;
    }
    @Column(name = "dept_type_code")
    public String getDeptTypeCode() {
        return deptTypeCode;
    }

+ 66 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/WlyyChargeDictDO.java

@ -0,0 +1,66 @@
package com.yihu.jw.entity.hospital.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by zdm on 2019/5/28.
 */
@Entity
@Table(name = "wlyy_charge_dict")
public class WlyyChargeDictDO extends UuidIdentityEntity {
    /**号别code*/
    private String chargeType;
    /**号别名称*/
    private String chargeName;
    /**诊查费,单位元*/
    private double reqFee;
    /**创建时间*/
    private Date createTime;
    /**6总部7金榜8夏禾*/
    private String deptTypeCode;
    public String getChargeType() {
        return chargeType;
    }
    public void setChargeType(String chargeType) {
        this.chargeType = chargeType;
    }
    public String getChargeName() {
        return chargeName;
    }
    public void setChargeName(String chargeName) {
        this.chargeName = chargeName;
    }
    public double getReqFee() {
        return reqFee;
    }
    public void setReqFee(double reqFee) {
        this.reqFee = reqFee;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getDeptTypeCode() {
        return deptTypeCode;
    }
    public void setDeptTypeCode(String deptTypeCode) {
        this.deptTypeCode = deptTypeCode;
    }
}

+ 14 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionInfoDO.java

@ -82,6 +82,11 @@ public class WlyyPrescriptionInfoDO extends UuidIdentityEntity {
     */
    private String groupNo;
    /**
     * 规格
     */
    private String specification;
    /**
     * 1可用 0删除
     */
@ -194,6 +199,15 @@ public class WlyyPrescriptionInfoDO extends UuidIdentityEntity {
        this.groupNo = groupNo;
    }
    @Column(name = "specification")
    public String getSpecification() {
        return specification;
    }
    public void setSpecification(String specification) {
        this.specification = specification;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;

+ 95 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotDeviceBaiyiDO.java

@ -0,0 +1,95 @@
package com.yihu.jw.entity.iot.device;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * @author zdm on 2019/6/11.
 */
@Entity
@Table(name = "iot_device_baiyi")
public class IotDeviceBaiyiDO extends UuidIdentityEntityWithOperator implements Serializable {
    /** 15位设备唯一序号*/
    @Column(name = "imei")
    private String imei;
    /** 发生时间*/
    @Column(name = "time_begin")
    private String timeBegin;
    /**心率/舒张压*/
    @Column(name = "value1")
    private Integer value1;
    /** 心率阈值上限/舒张压报警下限*/
    @Column(name = "value2")
    private Integer value2;
    /** 心率阈值下限/收缩压*/
    @Column(name = "value3")
    private Integer value3;
    /** 测量数据种类名称/收缩压报警上限*/
    @Column(name = "value4")
    private Integer value4;
    /** 类型:1血压、5心率*/
    @Column(name = "type")
    private Integer type;
    public String getImei() {
        return imei;
    }
    public void setImei(String imei) {
        this.imei = imei;
    }
    public String getTimeBegin() {
        return timeBegin;
    }
    public void setTimeBegin(String timeBegin) {
        this.timeBegin = timeBegin;
    }
    public Integer getValue1() {
        return value1;
    }
    public void setValue1(Integer value1) {
        this.value1 = value1;
    }
    public Integer getValue2() {
        return value2;
    }
    public void setValue2(Integer value2) {
        this.value2 = value2;
    }
    public Integer getValue3() {
        return value3;
    }
    public void setValue3(Integer value3) {
        this.value3 = value3;
    }
    public Integer getValue4() {
        return value4;
    }
    public void setValue4(Integer value4) {
        this.value4 = value4;
    }
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
}

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

@ -108,6 +108,16 @@ public class BaseHospitalRequestMapping {
         * 获取订单列表
         */
        public static final String findExpressageList="/findExpressageList";
        /**
         * 设置订单
         */
        public static final String setMailno="/setMailno";
        /**
         * 订单导出
         */
        public static final String pushListWrite="/pushListWrite";
        //=================end=======================================
        /**

+ 11 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java

@ -99,6 +99,9 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
     */
    @ApiModelProperty(value = "库房号", example = "模块1")
    private String groupNo;
    @ApiModelProperty(value = "规格", example = "模块1")
    private String specification;
    /**
     * 1可用 0删除
     */
@ -205,4 +208,12 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
    public void setGroupNo(String groupNo) {
        this.groupNo = groupNo;
    }
    public String getSpecification() {
        return specification;
    }
    public void setSpecification(String specification) {
        this.specification = specification;
    }
}

+ 22 - 3
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -2,6 +2,7 @@ package com.yihu.jw.entrance.controller;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.mapping.HospitalDeptMappingDO;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
@ -78,6 +79,8 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @ApiOperation(value = " 查询某个时间段的患者门诊就诊记录 V1.00")
    public ListEnvelop BS30025(@ApiParam(name = "patNo", value = "居民id")
                               @RequestParam(value = "patNo", required = false) String patNo,
                               @ApiParam(name = "conNo", value = "就诊次数")
                               @RequestParam(value = "conNo", required = false) String conNo,
                               @ApiParam(name = "admNo", value = "就诊唯一号")
                               @RequestParam(value = "admNo", required = false) String admNo,
                               @ApiParam(name = "registerSn", value = "流水号(处方号)")
@ -86,7 +89,7 @@ public class MqSdkController extends EnvelopRestEndpoint {
                               @RequestParam(value = "startTime", required = false) String startTime,
                               @ApiParam(name = "endTime", value = "结束时间")
                               @RequestParam(value = "endTime", required = false) String endTime) throws Exception {
        List<WlyyOutpatientVO> obj = entranceService.BS30025(patNo,admNo,registerSn, startTime, endTime, demoFlag);
        List<WlyyOutpatientVO> obj = entranceService.BS30025(patNo,conNo,admNo,registerSn, startTime, endTime, demoFlag);
        return success(obj);
    }
@ -180,8 +183,11 @@ public class MqSdkController extends EnvelopRestEndpoint {
    @GetMapping(value = "/MS02013")
    @ApiOperation(value = "号别字典接口   ")
    public ListEnvelop MS02013() throws Exception {
        JSONArray obj = entranceService.MS02013(demoFlag);
    public ListEnvelop MS02013(
            @ApiParam(name = "code", value = "号别字典")
            @RequestParam(value = "code", required = false) String code
    ) throws Exception {
        JSONArray obj = entranceService.MS02013(code);
        return success(obj);
    }
@ -310,4 +316,17 @@ public class MqSdkController extends EnvelopRestEndpoint {
        return success(obj);
    }
    @GetMapping(value = "/BS55010")
    @ApiOperation(value = "医生号别及诊查费")
    public ListEnvelop BS55010(@ApiParam(name = "windowsNo", value = "分部号")
                               @RequestParam(value = "windowsNo", required = false) String windowsNo,
                               @ApiParam(name = "chargeType", value = "号别")
                               @RequestParam(value = "chargeType", required = false) String chargeType,
                               @ApiParam(name = "code", value = "医生编码")
                               @RequestParam(value = "code", required = false) String code) throws Exception {
        List<WlyyChargeDictDO> obj = entranceService.BS55010(windowsNo, code,chargeType, demoFlag);
        return success(obj);
    }
}

+ 1 - 1
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/PrescriptionUpdateController.java

@ -29,7 +29,7 @@ public class PrescriptionUpdateController extends EnvelopRestEndpoint {
    @GetMapping(value = "/preUpdate")
    @ApiOperation(value = "药房配药his提示处方变更")
    public ObjEnvelop prescriptionUpdate(
            @ApiParam(name = "admNo", value = "卡号", required = true)
            @ApiParam(name = "admNo", value = "门诊就诊唯一号", required = true)
            @RequestParam(value = "admNo") String admNo,
            @ApiParam(name = "realOrder", value = "处方号", required = true)
            @RequestParam(value = "realOrder") String realOrder,

+ 14 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/config/JpaConfig.java

@ -0,0 +1,14 @@
package com.yihu.jw.hospital.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.jpa.JpaTransactionManager;
@Configuration
public class JpaConfig {
    @Bean
    public JpaTransactionManager transactionManager(){
        return new JpaTransactionManager();
    }
}

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

@ -19,6 +19,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
@ -127,8 +129,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findReOutpatientInfo)
    @ApiOperation(value = "查询复诊记录,处方,居民信息,物流(单条)", notes = "查询复诊记录,处方,居民信息,物流(单条)")
    public ObjEnvelop findReOutpatientInfo(@ApiParam(name = "outpatientId", value = "复诊ID")
                                           @RequestParam(value = "outpatientId", required = true) String outpatientId)throws Exception{
        com.alibaba.fastjson.JSONObject obj =  prescriptionService.findReOutpatientInfo(outpatientId);
                                           @RequestParam(value = "outpatientId", required = true) String outpatientId,
                                           @ApiParam(name = "prescriptionId", value = "处方ID")
                                           @RequestParam(value = "prescriptionId", required = false) String prescriptionId)throws Exception{
        com.alibaba.fastjson.JSONObject obj =  prescriptionService.findReOutpatientInfo(outpatientId,prescriptionId);
        return success(obj);
    }
@ -269,6 +273,35 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return prescriptionService.findExpressageList(status,oneselfPickupFlg,nameKey,startTime,endTime,page,size);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.setMailno)
    @ApiOperation(value = "设置订单编号", notes = "设置订单编号")
    public ObjEnvelop setMailno(@ApiParam(name = "mailno", value = "订单号")
                                @RequestParam(value = "mailno", required = false)String mailno,
                                @ApiParam(name = "expressageId", value = "订单id")
                                @RequestParam(value = "expressageId", required = false)String expressageId) {
        return success(prescriptionService.setMailno(mailno,expressageId));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushListWrite)
    @ApiOperation(value = "订单导出", notes = "订单导出")
    public void pushListWrite(@ApiParam(name = "status", value = "流程状态,多状态用‘,’分割")
                                    @RequestParam(value = "status", required = false)String status,
                                    @ApiParam(name = "oneselfPickupFlg", value = "是否自取 1是 0否")
                                    @RequestParam(value = "oneselfPickupFlg", required = false)String oneselfPickupFlg,
                                    @ApiParam(name = "nameKey", value = "配送员名称")
                                    @RequestParam(value = "nameKey", required = false)String nameKey,
                                    @ApiParam(name = "startTime", value = "开始时间,yyyy-MM-dd")
                                    @RequestParam(value = "startTime", required = false)String startTime,
                                    @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);
        List<Map<String,Object>> list = expressages.getDetailModelList();
        response.setContentType("octets/stream");
        response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
        OutputStream os = response.getOutputStream();
        prescriptionService.pushListWrite(os,list);
    }
    //===========

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

@ -72,6 +72,11 @@ fast-dfs:
configDefault: # 默认配置
  saasId: xmjkzl_saasId
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
  profiles: jwdev

+ 147 - 8
svr/svr-iot-sunnuo/src/main/java/com/yihu/iot/datainput/controller/IotAnalyzerController.java

@ -3,24 +3,19 @@ package com.yihu.iot.datainput.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.iot.datainput.dao.IotDeviceBaiyiDao;
import com.yihu.iot.datainput.service.DataInputService;
import com.yihu.iot.datainput.util.ConstantUtils;
import com.yihu.jw.entity.iot.device.IotDeviceBaiyiDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -43,6 +38,8 @@ public class IotAnalyzerController extends EnvelopRestEndpoint {
    @Autowired
    ObjectMapper objectMapper;
    @Autowired
    private IotDeviceBaiyiDao iotDeviceBaiyiDao;
    /**
     * 基于奕拓小屋上传的体征数据,进行解析入库
@ -160,4 +157,146 @@ public class IotAnalyzerController extends EnvelopRestEndpoint {
            return strResult;
        }
    }
    @PostMapping(value = "/heartRate" /*,consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE*/)
    @ApiOperation(value = "柏颐心率数据接收", notes = "柏颐心率数据接收")
    public String heartRate(
            @ApiParam(name = "imei", value = "15位设备唯一序号")
            @RequestParam(value = "imei",required = true)String imei,
            @ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS")
            @RequestParam(value = "time_begin",required = true)String time_begin,
            @ApiParam(name = "heartrate", value = "心率")
            @RequestParam(value = "heartrate",required = true)int heartrate,
            @ApiParam(name = "theshold_heartrate_h", value = "心率阈值上限")
            @RequestParam(value = "theshold_heartrate_h",required = true)int theshold_heartrate_h,
            @ApiParam(name = "theshold_heartrate_l", value = "心率阈值下限")
            @RequestParam(value = "theshold_heartrate_l",required = true)int theshold_heartrate_l) throws Exception{
        String strResult = "";
        Map res = new HashMap();
        IotDeviceBaiyiDO iotDeviceBaiyiDO=new IotDeviceBaiyiDO();
        iotDeviceBaiyiDO.setImei(imei);
        iotDeviceBaiyiDO.setType(1);
        iotDeviceBaiyiDO.setTimeBegin(time_begin);
        iotDeviceBaiyiDO.setValue1(heartrate);
        iotDeviceBaiyiDO.setValue2(theshold_heartrate_h);
        iotDeviceBaiyiDO.setValue3(theshold_heartrate_l);
        iotDeviceBaiyiDao.save(iotDeviceBaiyiDO);
        try {
            String info  = "imei="+imei+";time_begin="+time_begin+";heartrate="+heartrate+";theshold_heartrate_h="+theshold_heartrate_h+";theshold_heartrate_l="+theshold_heartrate_l;
            logger.info("info="+info);
            return BaiyiDataParam(iotDeviceBaiyiDO);
        } catch (Exception e) {
            e.printStackTrace();
            res.put("statusCode", "03");
            res.put("desc", "服务异常,体征信息上传失败。");
            strResult = objectMapper.writeValueAsString(res);
            logger.error(strResult);
            return strResult;
        }
    }
    @PostMapping(value = "/bloodPressure" /*,consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE*/)
    @ApiOperation(value = "柏颐血压数据接收", notes = "柏颐血压数据接收")
    public String bloodPressure(
            @ApiParam(name = "imei", value = "15位设备唯一序号", required = true)
            @RequestParam(value = "imei",required = true)String imei,
            @ApiParam(name = "time_begin", value = "发生时间YYYY-MM-DD HH:mm:SS", required = true)
            @RequestParam(value = "time_begin",required = true)String time_begin,
            @ApiParam(name = "dbp", value = "舒张压", required = true)
            @RequestParam(value = "dbp",required = true)int dbp,
            @ApiParam(name = "dbp_l", value = "舒张压报警下限", required = true)
            @RequestParam(value = "dbp_l",required = true)int dbp_l,
            @ApiParam(name = "sbp", value = "收缩压", required = true)
            @RequestParam(value = "sbp",required = true)int sbp,
            @ApiParam(name = "sbp_h", value = "收缩压报警上限", required = true)
            @RequestParam(value = "sbp_h",required = true)int sbp_h) throws Exception{
        String strResult = "";
        Map res = new HashMap();
        IotDeviceBaiyiDO iotDeviceBaiyiDO=new IotDeviceBaiyiDO();
        iotDeviceBaiyiDO.setImei(imei);
        iotDeviceBaiyiDO.setTimeBegin(time_begin);
        iotDeviceBaiyiDO.setType(2);
        iotDeviceBaiyiDO.setValue1(dbp);
        iotDeviceBaiyiDO.setValue2(dbp_l);
        iotDeviceBaiyiDO.setValue3(sbp);
        iotDeviceBaiyiDO.setValue4(sbp_h);
        iotDeviceBaiyiDao.save(iotDeviceBaiyiDO);
        try {
            String info= "imei="+imei+";time_begin="+time_begin+";dbp="+dbp+";dbp_l="+dbp_l+";sbp="+sbp+";sbp_h="+sbp_h;
            logger.info("info="+info);
            return BaiyiDataParam(iotDeviceBaiyiDO);
        } catch (Exception e) {
            e.printStackTrace();
            res.put("statusCode", "03");
            res.put("desc", "服务异常,体征信息上传失败。");
            strResult = objectMapper.writeValueAsString(res);
            logger.error(strResult);
            return strResult;
        }
    }
    /**
     * 封装数据上传至i健康
     * @param iotDeviceBaiyiDO 设备数据实体
     * @return
     * @throws Exception
     */
    public String BaiyiDataParam(IotDeviceBaiyiDO iotDeviceBaiyiDO)throws Exception {
        JSONArray jsonArray = new JSONArray();
        JSONObject params = new JSONObject();
        JSONObject data = new JSONObject();
        Map res = new HashMap();
        // 增加判断,当测量值小于1时,定义为异常值,不进行数据的存储。
        if (iotDeviceBaiyiDO.getValue1() < 1) {
            res.put("statusCode", "00");
            res.put("desc", iotDeviceBaiyiDO.getImei() + "体征数据异常(小于正常值)。");
            return objectMapper.writeValueAsString(res);
        } else {
            if (2 == iotDeviceBaiyiDO.getType()) {
                //血压测量数据
                data.put("data", iotDeviceBaiyiDO.getValue3() + "," + iotDeviceBaiyiDO.getValue1());
                //单位
                data.put("unit", "mmHg");
            } else {
                //心率测量数据
                data.put("data", iotDeviceBaiyiDO.getValue1());
                //单位
                data.put("unit", "bpm");
            }
        }
        //按键号
        data.put("button", "-1");
        //设备唯一码
        data.put("deviceSn", iotDeviceBaiyiDO.getImei());
        //设备类型1:血压 5:心率
        data.put("deviceType", "4");
        data.put("measurementType",iotDeviceBaiyiDO.getType());
        //厂商代码
        data.put("manufacturerCode", "baiyi");
        //厂商名称
        data.put("manufacturerName", "柏颐设备");
        //发送时间yyyy-MM-dd HH:mm:ss
        data.put("sendTime", iotDeviceBaiyiDO.getTimeBegin());
        data.put("state", 0);
        //单位mmol/L,mmHg
        data.put("unit", "");
        //体征上传时间yyyy-MM-dd HH:mm:ss
        data.put("uploadTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        jsonArray.add(data);
        params.put("data", jsonArray);
        //体征信息上传成功后,同步到厦门I健康
        data.put("id", "");
        boolean synFlag = dataInputService.synXMIjk(data);
        if (synFlag) {
            res.put("statusCode", "00");
            res.put("desc", iotDeviceBaiyiDO.getImei() + "体征信息上传厦门I健康成功。");
        } else {
            res.put("statusCode", "02");
            res.put("desc", iotDeviceBaiyiDO.getImei() + "体征信息上传厦门I健康失败。");
        }
        String strResult = objectMapper.writeValueAsString(res);
        logger.info(strResult);
        return strResult;
    }
}

+ 12 - 0
svr/svr-iot-sunnuo/src/main/java/com/yihu/iot/datainput/dao/IotDeviceBaiyiDao.java

@ -0,0 +1,12 @@
package com.yihu.iot.datainput.dao;
import com.yihu.jw.entity.iot.device.IotDeviceBaiyiDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author zdm on 2019/6/11.
 */
public interface IotDeviceBaiyiDao extends PagingAndSortingRepository<IotDeviceBaiyiDO,String>,JpaSpecificationExecutor<IotDeviceBaiyiDO> {
}

+ 12 - 0
svr/svr-iot-sunnuo/src/main/java/com/yihu/iot/datainput/service/IotAnalyzerService.java

@ -0,0 +1,12 @@
package com.yihu.iot.datainput.service;
import org.springframework.stereotype.Service;
/**
 * Created by zdm on 2019/6/11.
 */
@Service
public class IotAnalyzerService {
}