Przeglądaj źródła

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

wangzhinan 4 lat temu
rodzic
commit
bd0f30e0e9
18 zmienionych plików z 351 dodań i 79 usunięć
  1. 204 14
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java
  2. 1 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 22 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  4. 3 0
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  5. 13 3
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java
  6. 7 6
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java
  7. 27 0
      gateway/ag-basic/src/main/java/com/yihu/jw/gateway/config/MultipartConfig.java
  8. 2 1
      gateway/ag-basic/src/main/resources/application.yml
  9. 6 6
      svr/svr-base/src/main/java/com/yihu/jw/base/config/MultipartConfig.java
  10. 2 1
      svr/svr-base/src/main/resources/application.yml
  11. 11 6
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java
  12. 1 0
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  13. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  14. 13 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java
  15. 2 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java
  16. 5 5
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java
  17. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java
  18. 27 22
      svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

+ 204 - 14
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java

@ -6,16 +6,22 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import jxl.WorkbookSettings;
import jxl.write.*;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.Map;
import java.util.*;
@Service
public class PayInfoNoticeService {
@ -25,8 +31,16 @@ public class PayInfoNoticeService {
    private HttpClientUtil httpClientUtil;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.id}")
    private String wxId;
    @Value("${wechat.flag}")
    private boolean flag;
    public String pushPrescriptionPay(String patient,String doctorName,String orderNo,String outpatientId,String prescriptionId,String total,String title,String url){
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
@ -85,14 +99,47 @@ public class PayInfoNoticeService {
    }
    //导出es查询数据
    public void exportEsPrescription(OutputStream os, com.alibaba.fastjson.JSONObject jsonObject) throws Exception{
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
    public void exportEsPrescription(OutputStream os, List<Map<String,Object>> list) throws Exception{
        WorkbookSettings settings = new WorkbookSettings();
        settings.setWriteAccess(null);
        settings.setEncoding("UTF-8");
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os,settings);
        List<Map<String,Object>> totallist = new ArrayList<>();
        if (null!=list&&list.size()>0){
            totallist =list;
        }
       /* HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet("shee1");
        //headers表示excel表中第一行的表头
        HSSFRow row = sheet.createRow(0);
        //在excel表中添加表头
        String[] header = {"医生姓名", "出诊科室", "接诊数量", "开方数量", "物流数量"};
        for(int i=0;i<header.length;i++){
            HSSFCell cell = row.createCell(i);
            HSSFRichTextString text = new HSSFRichTextString(header[i]);
            cell.setCellValue(text);
        }
        workbook.write(os);
        //接诊 +开方+物流
        com.alibaba.fastjson.JSONArray totallist = new JSONArray();
        if (null!=jsonObject){
            totallist = jsonObject.getJSONArray("outpatient");
        List<Map<String,Object>> totallist = new ArrayList<>();
        if (null!=list&&list.size()>0){
            totallist =list;
        }
        int rowNum = 1;
        if (null!=totallist&&totallist.size()>0){
            for (int n=0;n<totallist.size();n++) {
                Map<String,Object> object = totallist.get(n);
                HSSFRow row1 = sheet.createRow(rowNum);
                row1.createCell(0).setCellValue(object.get("doctorName").toString());
                row1.createCell(1).setCellValue(null==object.get("deptName")?"":object.get("deptName").toString());
                row1.createCell(2).setCellValue(null==object.get("pickNum")?"":object.get("pickNum").toString());
                row1.createCell(3).setCellValue(null==object.get("preNum")?"":object.get("preNum").toString());
                row1.createCell(4).setCellValue(null==object.get("wlNum")?"":object.get("wlNum").toString());
                rowNum++;
            }
        }
        workbook.write(os);*/
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
@ -106,16 +153,15 @@ public class PayInfoNoticeService {
            int i = 1;
            if (null!=totallist&&totallist.size()>0){
                for (int n=0;n<totallist.size();n++) {
                    JSONObject object = totallist.getJSONObject(i);
                    Map<String,Object> object = totallist.get(n);
                    addCell(ws, i, 0, object.get("doctorName").toString(), "");
                    addCell(ws, i, 1, null==object.get("dept")?"":object.get("dept").toString(),"");
                    addCell(ws, i, 1, null==object.get("out")?"":object.get("out").toString(),"");
                    addCell(ws, i, 1, null==object.get("pre")?"":object.get("pre").toString(),"");
                    addCell(ws, i, 1, null==object.get("sf")?"":object.get("sf").toString(),"");
                    addCell(ws, i, 1, null==object.get("deptName")?"":object.get("deptName").toString(),"");
                    addCell(ws, i, 2, null==object.get("pickNum")?"":object.get("pickNum").toString(),"");
                    addCell(ws, i, 3, null==object.get("preNum")?"":object.get("preNum").toString(),"");
                    addCell(ws, i, 4, null==object.get("wlNum")?"":object.get("wlNum").toString(),"");
                    i++;
                }
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
@ -140,5 +186,149 @@ public class PayInfoNoticeService {
        }
        ws.addCell(label);
    }
    public List<Map<String,Object>> dealSqlQuery(String beginTime,String endTime){
        //发起问诊量
        String sqlOutPatient="SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
                "\tt.doctor_name as \"doctorName\",\n" +
                "\tt.dept_name as \"deptName\",\n" +
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_outpatient t \n" +
                "WHERE 1=1 and t.doctor is not null\n" ;
        //接诊量
        String sqlDoctorOut = "SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
                "\tt.doctor_name as \"doctorName\",\n" +
                "\tt.dept_name as \"deptName\",\n" +
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_outpatient t \n" +
                "WHERE 1=1 and t.doctor is not null\n";
        //开具处方量
        String sqlPrescription = "SELECT\n" +
                "\tt.doctor as \"doctor\",\n" +
                "\tt.doctor_name as \"doctorName\",\n" +
                "\tt.dept_name as \"deptName\",\n" +
                "\tcount(*) as \"total\" \n" +
                "FROM\n" +
                "\t wlyy_prescription t \n" +
                "WHERE 1=1 and t.doctor is not null\n" ;
        //物流量
        String sqlWL = "SELECT\n" +
                "\to.doctor as \"doctor\",\n" +
                " o.doctor_name as \"doctorName\",\n" +
                " o.dept_name as \"deptName\",\n" +
                " count(*) as \"total\"" +
                "FROM\n" +
                " base.wlyy_prescription_expressage t\n" +
                "LEFT JOIN base.wlyy_prescription b ON b.outpatient_id = t.outpatient_id\n" +
                "LEFT JOIN base.wlyy_outpatient o ON o.id= b.outpatient_id\n" +
                "WHERE 1=1 and o.doctor is not null\n" ;
        if (StringUtils.isNotEmpty(beginTime)){
            wxId="xx";
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sqlOutPatient+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                    sqlDoctorOut+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                    sqlPrescription+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                    sqlWL+=" and t.create_time > '" + beginTime + " 00:00:00' ";
                }else {
                    sqlOutPatient+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                    sqlDoctorOut+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                    sqlPrescription+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                    sqlWL+=" and t.create_time > to_date('" + beginTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sqlOutPatient+=" and t.create_time > '" + beginTime + " 00:00:00'";
                sqlDoctorOut+=" and t.create_time > '" + beginTime + " 00:00:00'";
                sqlPrescription+=" and t.create_time > '" + beginTime + " 00:00:00'";
                sqlWL+=" and t.create_time > '" + beginTime + " 00:00:00'";
            }
        }
        if (StringUtils.isNotEmpty(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sqlOutPatient+="  and t.create_time<'" + endTime + " 23:59:59'";
                    sqlDoctorOut+="  and t.create_time<'" + endTime + " 23:59:59'";
                    sqlPrescription+="  and t.create_time<'" + endTime + " 23:59:59'";
                    sqlWL+="  and t.create_time<'" + endTime + " 23:59:59'";
                }else {
                    sqlOutPatient+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                    sqlDoctorOut+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                    sqlPrescription+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                    sqlWL+="  and t.create_time< to_date('" + endTime + " 23:59:59','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sqlOutPatient+="  and t.create_time<'" + endTime + " 23:59:59'";
                sqlDoctorOut+="  and t.create_time<'" + endTime + " 23:59:59'";
                sqlPrescription+="  and t.create_time<'" + endTime + " 23:59:59'";
                sqlWL+="  and t.create_time<'" + endTime + " 23:59:59'";
            }
        }
        sqlOutPatient+="\tAND t.patient_name NOT IN ( '王志南', '游水连', '林志芳', '郑绩', '陈晓亮', '王培坤' ) \n" +
                "\tAND t.STATUS IN ( 0,1,2,3 )\n" +
                "\tGROUP BY t.doctor_name,\n" +
                "\tt.dept_name,t.doctor";
        sqlDoctorOut+= "\tAND t.patient_name NOT IN ( '王志南', '游水连', '林志芳', '郑绩', '陈晓亮', '王培坤' ) \n" +
                "\tAND t.STATUS IN ( 1, 2, 3 )\n" +
                " and t.pay_status =1 "+
                "\tGROUP BY t.doctor_name,\n" +
                "\tt.dept_name ,t.doctor";
        sqlPrescription+="\tAND t.patient_name NOT IN ( '王志南', '游水连', '林志芳', '郑绩', '陈晓亮', '王培坤' ) \n" +
                "\tGROUP BY t.doctor_name,\n" +
                "\tt.dept_name,t.doctor";
        sqlWL+= "AND t. NAME NOT IN (\n" +
                " '王志南',\n" +
                " '游水连',\n" +
                " '林志芳',\n" +
                " '郑绩',\n" +
                " '陈晓亮',\n" +
                " '王培坤',\n" +
                " '林'\n" +
                ")\n" +
                "AND t.oneself_pickup_flg = 0\n" +
                "\n" +
                "AND b.`status`IN(20,32,100)\n" +
                "AND b.drug_fee !=0\n" +
                "AND b.real_order IS not NULL"+
                "\tGROUP BY o.doctor_name,\n" +
                "\to.dept_name,o.doctor";;
        List<Map<String,Object>> result = new ArrayList<>();
        List<Map<String,Object>> outPatient=hibenateUtils.createSQLQuery(sqlOutPatient);
        List<Map<String,Object>> docPickup=hibenateUtils.createSQLQuery(sqlDoctorOut);
        List<Map<String,Object>> prescription=hibenateUtils.createSQLQuery(sqlPrescription);
        List<Map<String,Object>> wl=hibenateUtils.createSQLQuery(sqlWL);
        if(null!=outPatient&&outPatient.size()>0){
            for (Map<String,Object> map:outPatient){
                if (docPickup!=null&&docPickup.size()>0){
                    for (Map<String,Object> pickMap:docPickup){
                        if (pickMap.get("doctor").toString().equalsIgnoreCase(map.get("doctor").toString())){
                            map.put("pickNum",null==pickMap.get("total")?"":pickMap.get("total").toString());
                        }
                    }
                }
                if (prescription!=null&&prescription.size()>0){
                    for (Map<String,Object> pre:prescription){
                        if (pre.get("doctor").toString().equalsIgnoreCase(map.get("doctor").toString())){
                            map.put("preNum",null==pre.get("total")?"":pre.get("total").toString());
                        }
                    }
                }
                if (wl!=null&&wl.size()>0){
                    for (Map<String,Object> wMap:wl){
                        if (wMap.get("doctor").toString().equalsIgnoreCase(map.get("doctor").toString())){
                            map.put("wlNum",null==wMap.get("total")?"":wMap.get("total").toString());
                        }
                    }
                }
                result.add(map);
            }
        }
     return result;
    }
}

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

@ -2256,6 +2256,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    ins.setCreateTime(new Date());
                    ins.setPrescriptionId(prescription.getId());
                    ins.setOutpatientId(outPatientId);
                    System.out.println("____outpatientId=="+outPatientId);
                }
                //保存检查检验。
                wlyyInspectionDao.save(inspections);

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

@ -52,6 +52,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.*;
/**
@ -1660,28 +1661,37 @@ public class YkyyEntranceService {
        String doctor = null;
        String patient = null;
        String admNo= null;
        String registNo=null;
        if (inspectionDOS!=null&&inspectionDOS.size()!=0){
            WlyyInspectionDO inspectionDO = inspectionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(inspectionDO.getOutpatientId());
            registNo = outpatientDO.getRegisterNo();
            doctor=outpatientDO.getDoctor();
            patient=outpatientDO.getPatient();
            admNo = outpatientDO.getAdmNo();
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
            ykEmrJcsqDO.setJzhm(wlyyInspectionDO.getOutpatientId());
            ykEmrJcsqDO.setJzxh(Integer.parseInt(admNo));
            System.out.println("jcjy=="+wlyyInspectionDO.getOutpatientId());
            ykEmrJcsqDO.setJzhm(registNo);
            if (StringUtils.isNotEmpty(admNo)){
                System.out.println("admno=="+admNo);
                ykEmrJcsqDO.setJzxh(Integer.parseInt(admNo));
            }
            ykEmrJcsqDO.setXmid(Integer.valueOf(wlyyInspectionDO.getCode()));
            ykEmrJcsqDO.setJcxm(wlyyInspectionDO.getName());
            ykEmrJcsqDO.setXmdj(Integer.parseInt(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setXmdj(new BigDecimal(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setSqsl(wlyyInspectionDO.getQuantity());
            ykEmrJcsqDO.setJclx(Integer.valueOf(wlyyInspectionDO.getCheckPart()));
            ykEmrJcsqDO.setXmdw(wlyyInspectionDO.getTotalUnit());
            ykEmrJcsqDO.setZxks(wlyyInspectionDO.getDept()==null?0:Integer.parseInt(wlyyInspectionDO.getDept()));
            ykEmrJcsqDO.setKdsj(new Date());
            ykEmrJcsqDOS.add(ykEmrJcsqDO);
        }
        //同步his
        logger.info("开始同步检查检验");
        this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
        String message = this.outPatientOrder(ykEmrJcsqDOS,false,doctor,patient);
        System.out.println(message);
    }
    /**
@ -2305,13 +2315,18 @@ public class YkyyEntranceService {
    }
    //查询诊疗项目视图
    public JSONArray findZlxm(String itemName) throws Exception{
    public JSONArray findZlxm(String itemName,String itemCode) throws Exception{
        String sql = "select t.item_code as \"code\",t.item_name as \"name\"," +
                "t.price as \"chargeAmount\",t.total_unit as \"totalUnit\"," +
                "t.zxks as \"dept\" from VEMR_ORDER_ITEM t where 1=1";
        if (StringUtils.isNotEmpty(itemName)){
            sql+=" and t.ITEM_NAME like '%"+itemName+"%'";
        }
        if (StringUtils.isNotEmpty(itemCode)){
            String[] split = itemCode.split(",|,");
            String ids = org.apache.commons.lang.StringUtils.join(split, ",");
            sql+=" and t.item_code in ("+ids+")";
        }
        System.out.println(sql);
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
@ -2400,6 +2415,7 @@ public class YkyyEntranceService {
        if(jsonArray1!=null&&jsonArray1.size()>0){
            JSONObject json = jsonArray1.getJSONObject(0);
            doctorHis=json.getString("code");
            kdks = Integer.parseInt(json.getString("dept"));
        }
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
@ -2412,7 +2428,7 @@ public class YkyyEntranceService {
                    ykEmrJcsqDO.setBrxm(brxm);
                    ykEmrJcsqDO.setBrnl(brnl);
                    ykEmrJcsqDO.setKdys(doctorHis);
                    ykEmrJcsqDO.setBrks(114);
                    ykEmrJcsqDO.setBrks(kdks);
                    ykEmrJcsqDO.setTjys(doctorHis);
            }
            String jsonString = JSONObject.toJSONString(surveys);

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -445,6 +445,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            wapName = "厦门大学附中厦门眼科中心";
        }
        if (tradeType.equalsIgnoreCase("MWEB")){
            System.out.println("------进入h5支付-----");
            JSONObject jsonObject = new JSONObject();
            JSONObject object = new JSONObject();
            object.put("type","Wap");
@ -470,6 +471,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        String returnCode = pay.get("return_code").toString();
        String resultCode = pay.get("result_code").toString();
        System.out.println("-----返回结果:"+resultCode);
        if (returnCode.equalsIgnoreCase("SUCCESS")){
            String appid = pay.get("appid").toString();
@ -503,6 +505,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    param = WeiXinPayUtils.getMapAfterUnifiedorder(param,wxWechatDO.getAppKey());
                    //微信收银台地址
                    String mwebUrl = pay.get("mweb_url").toString();
                    System.out.println("返回的webUrl"+mwebUrl);
                    param.put("mweb_url",mwebUrl);
                    pay.put("MWEB",param);
                }else {

+ 13 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java

@ -3,6 +3,7 @@ package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
/**
@ -44,11 +45,20 @@ public class YkEmrJcsqDO {
    private String jcxm;//项目名称
    private Integer qxbz;//0
    private Integer yjxh;//关联ms_yj01里面的yjxh
    private Integer xmdj;//项目单价
    private BigDecimal xmdj;//项目单价
    private String xmdw;//项目单位
    private Integer xmid;//项目id  VEMR_ORDER_ITEM_MX
    private Integer sqsl;//数量
    private Integer jzxh;//就诊序号HLWYS_MZ_JZLS的JZXH对应
    private Integer jsbz;
    @Column(name = "JSBZ")
    public Integer getJsbz() {
        return jsbz;
    }
    public void setJsbz(Integer jsbz) {
        this.jsbz = jsbz;
    }
    @Basic
    @Id
@ -236,11 +246,11 @@ public class YkEmrJcsqDO {
    }
    @Basic
    @Column(name = "XMDJ")
    public Integer getXmdj() {
    public BigDecimal getXmdj() {
        return xmdj;
    }
    public void setXmdj(Integer xmdj) {
    public void setXmdj(BigDecimal xmdj) {
        this.xmdj = xmdj;
    }
    @Basic

+ 7 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkMsYj02DO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.hospital.prescription;
import javax.persistence.*;
import javax.persistence.criteria.From;
import java.math.BigDecimal;
/*
 * 检查明细
@ -14,9 +15,9 @@ public class YkMsYj02DO {
    private Integer ylxh;//组套明细里关联VEMR_ORDER_ITEM 里面  ITEM_CODE
    private Integer xmlx;//SELECT XMLX  javax.persistence.criteria.From GY_YLSF Where FYXH =l l_fyxh   查询后结果写入
    private Integer yjzx;//明细第一条是1,其它是0
    private Integer Yldj;//单价  select * from  portal_his.gy_ylsf@YKZXTEST where fyxh = l l_fyxh
    private BigDecimal Yldj;//单价  select * from  portal_his.gy_ylsf@YKZXTEST where fyxh = l l_fyxh
    private Integer ylsl;//数量 = 取项目明细 * 医生填的数量  参考截图   fysl
    private Integer hjje;//	合计金额
    private BigDecimal hjje;//	合计金额
    private Integer fygb;//SELECT fygb From GY_YLSF Where FYXH =l l_fyxh  查询后结果写入
    private Integer zfbl;//	默认1
    private Integer zxpb;//默认0
@ -69,11 +70,11 @@ public class YkMsYj02DO {
    }
    @Basic
    @Column(name = "YLDJ")
    public Integer getYldj() {
    public BigDecimal getYldj() {
        return Yldj;
    }
    public void setYldj(Integer yldj) {
    public void setYldj(BigDecimal yldj) {
        Yldj = yldj;
    }
    @Basic
@ -87,11 +88,11 @@ public class YkMsYj02DO {
    }
    @Basic
    @Column(name = "HJJE")
    public Integer getHjje() {
    public BigDecimal getHjje() {
        return hjje;
    }
    public void setHjje(Integer hjje) {
    public void setHjje(BigDecimal hjje) {
        this.hjje = hjje;
    }
    @Basic

+ 27 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/config/MultipartConfig.java

@ -0,0 +1,27 @@
package com.yihu.jw.gateway.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
import java.io.*;
/**
 * Created by liub on 2020/9/10.
 */
@Configuration
public class MultipartConfig {
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        String location = "/data/apps/temp";
        File tmpFile = new File(location);
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();
        }
        factory.setLocation(location);
        return factory.createMultipartConfig();
    }
}

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

@ -1,6 +1,7 @@
server:
  port: ${server.ag-basic-port}
  tomcat:
    basedir: /data/apps/temp
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver

+ 6 - 6
svr/svr-base/src/main/java/com/yihu/jw/base/config/MultipartConfig.java

@ -6,22 +6,22 @@ import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
import java.io.*;
/**
 * Created by liub on 2020/9/8.
 * Created by liub on 2020/9/11.
 */
@Configuration
public class MultipartConfig {
    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        File tmpFile = new File("/data/apps/temp");
        String location = "/data/apps/temp2";
        File tmpFile = new File(location);
        if (!tmpFile.exists()) {
            tmpFile.mkdirs();
        }
        factory.setLocation("/data/apps/temp");
        factory.setLocation(location);
        return factory.createMultipartConfig();
    }
}
}

+ 2 - 1
svr/svr-base/src/main/resources/application.yml

@ -1,7 +1,8 @@
#通用的配置不用区分环境变量.
server:
  port: ${server.svr-base-port}
  tomcat:
      basedir: /data/apps/temp2
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL

+ 11 - 6
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/YkyyController.java

@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -248,7 +250,7 @@ public class YkyyController extends EnvelopRestEndpoint {
                                           @RequestParam(value = "table",required = true)String table) throws  Exception{
        List<YkEmrJcsqDO> surveys = EntityUtils.jsonToList(json, YkEmrJcsqDO.class);
        System.out.println(surveys);
        long totalprice=0l;
        BigDecimal totalprice=new BigDecimal(0);
        ListEnvelop mixEnvelop = new ListEnvelop();
        if (surveys!=null){
            for (YkEmrJcsqDO ykEmrJcsqDO:surveys){
@ -258,16 +260,18 @@ public class YkyyController extends EnvelopRestEndpoint {
                if (sqdhList!=null&&sqdhList.size()!=0){
                    sqdh = Long.parseLong(sqdhList.get(0).get("total").toString());
                    System.out.println("sqdh:"+sqdh);
                    String updatesqdh = "update portal_his.gy_identity_ms@ykzxtest set dqz=dqz+1 where bmc = 'EMR_JCSQ'";
                    String updatesqdh = "update portal_his.gy_identity_emr@ykzxtest set dqz=dqz+1 where bmc = 'EMR_JCSQ'";
                    hibenateUtils.updateBySql(updatesqdh);
                }
                ykEmrJcsqDO.setSqdh(sqdh.intValue());
                ykEmrJcsqDO.setJclx(1);
                ykEmrJcsqDO.setJjbz(0);
                ykEmrJcsqDO.setJzlx(1);
                ykEmrJcsqDO.setJczt(1);
                ykEmrJcsqDO.setZfbz(0);
                ykEmrJcsqDO.setQxbz(0);
                totalprice +=ykEmrJcsqDO.getXmdj()*ykEmrJcsqDO.getSqsl();
                ykEmrJcsqDO.setKdsj(new Date());
                ykEmrJcsqDO.setJsbz(0);
                totalprice =ykEmrJcsqDO.getXmdj().multiply(new BigDecimal(ykEmrJcsqDO.getSqsl()));
                System.out.println("totalprice"+totalprice);
                String yjxhSql =" select dqz + 1 as \"total\"  from portal_his.gy_identity_ms@ykzxtest where bmc = 'MS_YJ01'";
                List<Map<String,Object>> yjxhList = hibenateUtils.createSQLQuery(yjxhSql);
@ -337,12 +341,13 @@ public class YkyyController extends EnvelopRestEndpoint {
                        if (fyxhList.size()>0){
                            ykMsYj02DO.setXmlx(Integer.valueOf(fyxhList.get(0).get("xmlx").toString()));
                            ykMsYj02DO.setFygb(Integer.valueOf(fyxhList.get(0).get("fygb").toString()));
                            ykMsYj02DO.setYldj(Integer.valueOf(fyxhList.get(0).get("fydj").toString()));
                            ykMsYj02DO.setHjje(ykMsYj02DO.getYldj()*ykMsYj02DO.getYlsl());
                            ykMsYj02DO.setYldj(new BigDecimal(fyxhList.get(0).get("fydj").toString()));
                            ykMsYj02DO.setHjje(totalprice);
                        }
                        ykMsYj02DO.setZfbl(1);
                        ykMsYj02DO.setZxpb(0);
                        ykMsYj02DO.setZjflag(0);
                        ykMsYj02DO.setHjje(totalprice);
                        System.out.println(ykMsYj02DO);
                        ykyyEntranceService.save(ykMsYj02DO);
                    }

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

@ -214,6 +214,7 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  ids: xm_ykyy_wx
  flag: false #演示环境  true走Mysql数据库  false走Oracle
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -1056,9 +1056,11 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.findZlxm)
	@ApiOperation(value = "诊疗项目查询", notes = "诊疗项目查询")
	public ObjEnvelop findZlxm(@ApiParam(name = "itemName", value = "itemName")
								   @RequestParam(value = "itemName", required = false)String itemName)throws Exception {
								   @RequestParam(value = "itemName", required = false)String itemName,
							   @ApiParam(name = "itemCode", value = "itemCode")
							   @RequestParam(value = "itemCode", required = false)String itemCode)throws Exception {
		JSONArray array= ykyyEntranceService.findZlxm(itemName);
		JSONArray array= ykyyEntranceService.findZlxm(itemName,itemCode);
		ObjEnvelop objEnvelop = new ObjEnvelop();
		objEnvelop.setObj(array);
		return objEnvelop;

+ 13 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java

@ -10,14 +10,17 @@ import com.yihu.jw.hospital.prescription.service.PayInfoNoticeService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
@ -30,6 +33,8 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private StatisticsEsService statisticsEsService;
    @ApiOperation("获取背景板")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.getAllBackground)
@ -155,10 +160,14 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                              @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                              @RequestParam(value = "endTime", required = false)String endTime,
                              HttpServletResponse response) throws Exception{
        JSONObject jsonObject = new JSONObject();
        response.setContentType("octets/stream");
        response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
        List<Map<String,Object>> list = payInfoNoticeService.dealSqlQuery(startTime,endTime);
        OutputStream os = response.getOutputStream();
        payInfoNoticeService.exportEsPrescription(os,jsonObject);
        response.reset();
        response.setContentType("application/octet-stream; charset=utf-8");
        response.setCharacterEncoding("UTF-8");
        //response.setHeader("Content-Disposition", "attachment;filename="+new String("sss".getBytes(), "ISO8859-1"));qwe
        response.setHeader("content-disposition",
                "attachment;filename=" + URLEncoder.encode("在线诊疗统计情况.xls", "UTF-8"));
        payInfoNoticeService.exportEsPrescription(os,list);
    }
}

+ 2 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -447,8 +447,8 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
            @RequestParam(value = "diseaseCondition",required = false) Integer diseaseCondition,
            @ApiParam(name = "type", value = "1高血压 2糖尿病", defaultValue = "")
            @RequestParam(value = "type",required = false) String type,
            @ApiParam(name="deviceType",value="设备类型 1血糖仪,2血压计 5健康小屋",required = true)
            @RequestParam(value="deviceType",required = true,defaultValue = "1,2,5") String deviceType,
            @ApiParam(name="deviceType",value="设备类型 对应设备字典库的DEVICE_TYPE值",required = true)
            @RequestParam(value="deviceType",required = true) String deviceType,
            @ApiParam(name="page",value="第几页(默认第一页)",defaultValue = "1")
            @RequestParam(value="page",required = false) Integer page,
            @ApiParam(name="pageSize",value="每页几行(默认10条记录)",defaultValue = "10")

+ 5 - 5
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotHospitalService.java

@ -50,11 +50,11 @@ public class IotHospitalService extends BaseJpaService<IotHospitalDO, IotHospita
            sql += "and h.level = '" + level + "' ";
        }
        //数据权限过滤
        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
        if(!orgList.contains(userAgent.commonHospital)){
            sql += " and h.saas_id in ("+orgUserService.getUserOrg(orgList)+")";
        }
//        //数据权限过滤
//        List<String> orgList = orgUserService.getUserOrgById(userAgent.getUID());
//        if(!orgList.contains(userAgent.commonHospital)){
//            sql += " and h.saas_id in ("+orgUserService.getUserOrg(orgList)+")";
//        }
        if(page != null && pageSize != null){
            Long count = Long.valueOf(jdbcTemplate.queryForList(sql).size());

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/equipment/IotEqtDetailService.java

@ -197,7 +197,7 @@ public class IotEqtDetailService  extends BaseJpaService<IotEquipmentDetailDO, I
            locationDataVO.setLocation(geoPoint);
            locationDataVO.setDeviceTime(null);
            locationDataVO.setLabel(null);
            locationDataVO.setDiseaseCondition(0);
            locationDataVO.setDiseaseCondition(5);
            locationDataVO.setCreateTime(jsobj.get("createTime").toString());
            locationDataVO.setName((String) jsobj.get("name"));
            locationDataVO.setCode(null);

+ 27 - 22
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -104,6 +104,8 @@ public class MonitorPlatformService  {
            return envelop;
        }else {
            List<LocationDataVO> euipmentList = new ArrayList<>();
            int totalEqCount=0;
            int totalCount=0;
            //查找全部
            if(diseaseCondition!=null){
                JSONObject json = new JSONObject();
@ -113,40 +115,43 @@ public class MonitorPlatformService  {
                json.put("value",diseaseCondition);
                jsonArray.add(json);
            }
            //小屋总数
            if(deviceType.contains("5")){
               totalEqCount = iotEqtDetailService.getEquipmentCount();
            }
            String[] categoryCodes= deviceType.split(",");
            if(categoryCodes.length==1&&"5".equals(deviceType)){
                euipmentList = iotEqtDetailService.getEquipmentLocation(page,size);
                envelop.getDetailModelList().addAll(euipmentList);
                envelop.setTotalCount(iotEqtDetailService.getEquipmentCount());
            }
            else{
                if(deviceType.contains("5")){
                    euipmentList = iotEqtDetailService.getEquipmentLocation(page,size);
                    envelop.getDetailModelList().addAll(euipmentList);
                }
                if(!(deviceType.contains("1")&&deviceType.contains("2"))){
                    for (String categoryCode:categoryCodes){
                        if(!"5".equals(categoryCode)){
                            JSONObject json = new JSONObject();
                            json.put("andOr","and");
                            json.put("field","categoryCode");
                            json.put("condition","=");
                            json.put("value",Integer.parseInt(categoryCode));
                            jsonArray.add(json);
                        }
                    }
                for (String categoryCode:categoryCodes){
                     if(!"5".equals(categoryCode)){
                         JSONObject json = new JSONObject();
                         json.put("andOr","and");
                         json.put("field","categoryCode");
                         json.put("condition","=");
                         json.put("value",Integer.parseInt(categoryCode));
                         jsonArray.add(json);
                         JSONObject jsonObject = new JSONObject();
                         jsonObject.put("filter",jsonArray);
                         jsonObject.put("page",page);
                         jsonObject.put("size",size);
                         List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                         List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                         //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                         envelop.getDetailModelList().addAll(list2);
                         totalCount += iotPatientDeviceService.getESCount(jsonObject.toString());
                         jsonArray.remove(json);
                     }
                }
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("filter",jsonArray);
                jsonObject.put("page",page);
                jsonObject.put("size",size);
                List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                List<LocationDataVO> list2 = iotPatientDeviceService.addNameAndCodeToList(locationDataVOList);
                //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                envelop.getDetailModelList().addAll(list2);
                envelop.setTotalCount(iotPatientDeviceService.getESCount(jsonObject.toString()));
            }
            envelop.setTotalCount(totalCount>totalEqCount?totalCount:totalEqCount);
            return envelop;
        }
    }