Browse Source

外网总库

Trick 5 years ago
parent
commit
c85829fe89

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

@ -2713,16 +2713,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("registerCount",0);
            }
            //医生问诊量
            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorAndStatus(doctor,"2");
            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){
                rs.put("outpatientCount",wlyyOutpatientDOs.size());
            }else{
                rs.put("outpatientCount",0);
            }
            //协同门诊量
            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2");
            rs.put("coordinationCout",coordinationCout);
//            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorAndStatus(doctor,"2");
//            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){
//                rs.put("outpatientCount",wlyyOutpatientDOs.size());
//            }else{
//                rs.put("outpatientCount",0);
//            }
//
//            //协同门诊量
//            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2");
//            rs.put("coordinationCout",coordinationCout);
    
@ -4892,7 +4892,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql +=" AND h.dept_name like:keyWord";
            params.put("keyWord","%"+keyWord+"%");
        }
        logger.info(sql);
        return hibenateUtils.createSQLQuery(sql,params,page,pagesize);
    }
}

+ 42 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -23,6 +23,8 @@ import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -471,16 +473,46 @@ public class XzzxEntranceService {
    }
//=====================微信模板消息推送===================================
//    public String sendMes(String wxId,String patient,String first,String noticeContent,String remark){
//        JSONObject params = new JSONObject();
//        params.put("transType","sms.hospital.notice");
//        params.put("merchId","3501000014");
//        List<BasePatientWechatDo> BasePatientWechatDo = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patient);
//        JSONObject p = new JSONObject();
//        p.put("openId",);
//        p.put("",);
//        params.put("param",p);
//    }
    public String sendMes(String wxId,String patient,String cardNo,String first,String noticeContent,String remark,String redirectUrl){
        JSONObject params = new JSONObject();
        params.put("transType","sms.hospital.notice");
        params.put("merchId","3501000014");
        JSONObject p = new JSONObject();
        String openId = "";
        if(StringUtils.isNotBlank(patient)){
            List<BasePatientWechatDo> paientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patient);
            if(paientWechatDos!=null&&paientWechatDos.size()>0){
                openId = paientWechatDos.get(0).getOpenid();
                p.put("openId",openId);
            }
        }else {
            p.put("cardNo",cardNo);
        }
        p.put("first",first);
        p.put("noticeTime", DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss"));
        p.put("noticeContent",noticeContent);
        if(StringUtils.isNotBlank(redirectUrl)){
            p.put("redirectUrl",redirectUrl);
        }
        p.put("remark",remark);
        params.put("param",p);
        logger.info("params :"+params.toString());
        if(StringUtils.isNotBlank(openId)||StringUtils.isNotBlank(cardNo)){
            String rs = HttpUtil.sendPost(sendMessageUrl,params.toJSONString());
            logger.info("rs :"+rs);
            JSONObject rsJson = JSON.parseObject(rs);
            String resCode = rsJson.getString("resCode");
            if("000".equals(resCode)){
                return "1";
            }
            return "0";
        }else {
            return "-1";
        }
    }
//=====================微信模板消息推送接口================================

+ 78 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/file_upload/FileUploadEndpoint.java

@ -0,0 +1,78 @@
package com.yihu.jw.entrance.file_upload;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.Map;
/**
 * 文件上传公共类
 */
@RestController
@RequestMapping(BaseRequestMapping.FileUpload.PREFIX)
@Api(tags = "文件上传相关操作", description = "文件上传相关操作")
public class FileUploadEndpoint extends EnvelopRestEndpoint {
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Autowired
    FileUploadService fileUploadService;
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM_IMG)
    @ApiOperation(value = "文件流上传图片", notes = "文件流上传图片")
    public ObjEnvelop<UploadVO> uploadImg(@ApiParam(value = "文件", required = true)
                                       @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
        // 得到文件的完整名称  xxx.txt
        String originalFilename = file.getOriginalFilename();
        InputStream inputStream = file.getInputStream();
        UploadVO uploadVO = fileUploadService.uploadImg(inputStream,originalFilename,file.getSize(),fastdfs_file_url);
        return success("上传成功", uploadVO);
    }
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM_ATTACHMENT)
    @ApiOperation(value = "文件流上传附件", notes = "文件流上传附件")
    public ObjEnvelop<UploadVO> uploadAttachment(@ApiParam(value = "文件", required = true)
                                       @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
        String originalFilename = file.getOriginalFilename();
        InputStream inputStream = file.getInputStream();
        UploadVO uploadVO = fileUploadService.uploadAttachment(inputStream,originalFilename,file.getSize(),fastdfs_file_url);
        return success("上传成功", uploadVO);
    }
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM)
    @ApiOperation(value = "文件流上传文件", notes = "文件流上传文件")
    public ObjEnvelop<UploadVO> uploadStream(@ApiParam(value = "文件", required = true)
                                                 @RequestParam(value = "file", required = true) MultipartFile file) throws Exception{
        UploadVO uploadVO = new UploadVO();
        // 得到文件的完整名称  xxx.txt
        String originalFilename = file.getOriginalFilename();
        InputStream inputStream = file.getInputStream();
        uploadVO = fileUploadService.uploadStream(inputStream,originalFilename,fastdfs_file_url);
        return success("上传成功", uploadVO);
    }
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STRING)
    @ApiOperation(value = "base64上传图片",notes = "base64上传图片")
    public ObjEnvelop<UploadVO> uploadImages(@ApiParam(name = "jsonData", value = "头像转化后的输入流")
                                             @RequestParam(value = "jsonData", required = true) String jsonData) throws Exception {
        UploadVO uploadVO = fileUploadService.uploadImages(jsonData,fastdfs_file_url);
        return success("上传成功", uploadVO);
    }
}

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

@ -1,13 +1,20 @@
package com.yihu.jw.hospital.endpoint.file_upload;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@ -24,12 +31,19 @@ import java.util.Map;
@Api(tags = "文件上传相关操作", description = "文件上传相关操作")
public class FileUploadEndpoint extends EnvelopRestEndpoint {
    private static final Logger logger = LoggerFactory.getLogger(EnvelopRestEndpoint.class);
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @Autowired
    FileUploadService fileUploadService;
    @Value("${testPattern.sign}")
    private String isClose;
    @Value("${testPattern.remote_inner_url}")
    private String remote_inner_url;
    @Autowired
    private ObjectMapper objectMapper;
    @PostMapping(value = BaseRequestMapping.FileUpload.UPLOAD_STREAM_IMG)
    @ApiOperation(value = "文件流上传图片", notes = "文件流上传图片")
@ -61,6 +75,13 @@ public class FileUploadEndpoint extends EnvelopRestEndpoint {
        if (isClose.equalsIgnoreCase("1")){
            Map<String, Object> map = fileUploadService.uploadImg(file);
            uploadVO.setFullUri(map.get("accessory").toString());
        }else if(isClose.equals("2")){
            //内网上传
            String rs = fileUploadService.request(remote_inner_url,file,null);
            logger.info(rs);
            JSONObject json = JSON.parseObject(rs);
            uploadVO = objectMapper.readValue(json.getJSONObject("obj").toJSONString(),UploadVO.class);
        }else {
            // 得到文件的完整名称  xxx.txt
            String originalFilename = file.getOriginalFilename();

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

@ -11,6 +11,7 @@ import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.WorkTimeService;
import com.yihu.jw.hospital.prescription.service.entrance.DoctorPreSignService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
@ -74,6 +75,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -596,6 +600,25 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        return success(prescriptionService.test2(no));
    }
    @PostMapping(value = "/sendMes")
    @ApiOperation(value = "心脏模板消息推送", notes = "心脏模板消息推送")
    public Envelop sendMes(@ApiParam(name = "wxId", value = "wxId")
                           @RequestParam(value = "wxId", required = true)String wxId,
                           @ApiParam(name = "patient", value = "居民ID")
                           @RequestParam(value = "patient", required = false)String patient,
                           @ApiParam(name = "cardNo", value = "卡号")
                           @RequestParam(value = "cardNo", required = false)String cardNo,
                           @ApiParam(name = "first", value = "头部")
                           @RequestParam(value = "first", required = true)String first,
                           @ApiParam(name = "noticeContent", value = "内容")
                           @RequestParam(value = "noticeContent", required = true)String noticeContent,
                           @ApiParam(name = "remark", value = "备注")
                           @RequestParam(value = "remark", required = true)String remark,
                           @ApiParam(name = "redirectUrl", value = "跳转链接")
                           @RequestParam(value = "redirectUrl", required = true)String redirectUrl) {
        return success(xzzxEntranceService.sendMes(wxId,patient,cardNo,first,noticeContent,remark,redirectUrl));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findPatientInfo)
    @ApiOperation(value = "获取居民信息接口", notes = "获取居民信息接口")

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

@ -214,9 +214,10 @@ FileTempPath:
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
---
@ -285,9 +286,10 @@ FileTempPath:
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
---
@ -362,9 +364,10 @@ es:
  tHost: 172.26.0.55:9300
  clusterName: jkzl
  securityUser: elastic:changeme
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
---
@ -438,9 +441,10 @@ es:
  clusterName: jkzl
  securityUser: elastic:elastic
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
@ -509,9 +513,10 @@ es:
  tHost: 192.168.103.153:9300
  clusterName: jkzl
  securityUser: lion:jkzlehr
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
---
@ -580,9 +585,11 @@ es:
  clusterName: jkzl
  securityUser: lion:jkzlehr
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  sign: 2
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://ehr.yihu.com/wlyy/
---
@ -640,9 +647,11 @@ FileTempPath:
  image_path : /var/local/upload/images
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
#是否开启i健康接口 0关闭,1开启
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 1
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
es: