Ver código fonte

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

liubing 4 anos atrás
pai
commit
cd47f59474

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

@ -81,4 +81,10 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("update WlyyOutpatientDO p set p.hisStatus=?2 where p.id=?1")
    @Query("update WlyyOutpatientDO p set p.hisStatus=?2 where p.id=?1")
    void updateHisStatusById(String id,Integer hisStatus);
    void updateHisStatusById(String id,Integer hisStatus);
    @Transactional
    @Modifying
    @Query("update WlyyOutpatientDO p set p.channelId=?2 where p.id=?1")
    void updateChannelId(String id,String channelId);
}
}

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

@ -19,6 +19,10 @@ public interface WlyyInspectionDao extends PagingAndSortingRepository<WlyyInspec
    List<WlyyInspectionDO> findByPrescriptionId(String prescriptionId,Integer del);
    List<WlyyInspectionDO> findByPrescriptionId(String prescriptionId,Integer del);
    @Query("select a from WlyyInspectionDO a where a.prescriptionId = ?1 and a.code=?2 and a.del=?3 ")
    List<WlyyInspectionDO> findByPrescriptionIdAndCode(String prescriptionId,String code,Integer del);
    @Modifying
    @Modifying
    @Query("update WlyyInspectionDO p set p.del=0 where p.id=?1")
    @Query("update WlyyInspectionDO p set p.del=0 where p.id=?1")
    void deleteById(String id);
    void deleteById(String id);

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

@ -11267,13 +11267,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param idcard 身份证
     * @param idcard 身份证
     * @param payStatus 支付状态
     * @param payStatus 支付状态
     * @param medicare 社保卡
     * @param medicare 社保卡
     * @param createTime 创建时间
     * @param appointmentTime 预约时间
     * @param appointmentTimeStart
     * @param appointmentTimeStart
     * @param appointmentTimeEnd
     * @param appointmentTimeEnd
     * @param page
     * @param page
     * @param pageSize
     * @param pageSize
     * @param size
     * @return
     * @return
     */
     */
    public Envelop getNatAppointmentList(String realOrder, String name, String hospitalFlag, String mobile, String idcard, String payStatus, String medicare, String createTimeStart, String createTimeEnd, String appointmentTimeStart, String appointmentTimeEnd, Integer isSuccess, Integer page, Integer pageSize,String orderNo) {
    public Envelop getNatAppointmentList(String realOrder, String name, String hospitalFlag, String mobile, String idcard, String payStatus, String medicare, String createTimeStart, String createTimeEnd, String appointmentTimeStart, String appointmentTimeEnd, Integer isSuccess, Integer page, Integer pageSize,String orderNo) {
@ -11393,4 +11390,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public  BaseDoctorDO findByIdCard(String idCard){
    public  BaseDoctorDO findByIdCard(String idCard){
        return  baseDoctorDao.findByIdcardAndDel(idCard);
        return  baseDoctorDao.findByIdcardAndDel(idCard);
    }
    }
    public  void updateChannelId(String id,String channelId){
        outpatientDao.updateChannelId(id,channelId);
    }
}
}

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

@ -1902,6 +1902,7 @@ public class YkyyEntranceService {
        String admNo= null;
        String admNo= null;
        String registNo=null;
        String registNo=null;
        String deptNo = null;
        String deptNo = null;
        String prescriptionId=null;
        if (inspectionDOS!=null&&inspectionDOS.size()!=0){
        if (inspectionDOS!=null&&inspectionDOS.size()!=0){
            WlyyInspectionDO inspectionDO = inspectionDOS.get(0);
            WlyyInspectionDO inspectionDO = inspectionDOS.get(0);
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(inspectionDO.getOutpatientId());
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(inspectionDO.getOutpatientId());
@ -1910,6 +1911,7 @@ public class YkyyEntranceService {
            registNo = prescriptionDO.getRealOrder();
            registNo = prescriptionDO.getRealOrder();
            doctor=outpatientDO.getDoctor();
            doctor=outpatientDO.getDoctor();
            patient=outpatientDO.getPatient();
            patient=outpatientDO.getPatient();
            prescriptionId=prescriptionDO.getId();
        }
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
@ -1940,7 +1942,22 @@ public class YkyyEntranceService {
        System.out.println(message.get("code")+"-----"+message.get("msg"));
        System.out.println(message.get("code")+"-----"+message.get("msg"));
        if ("-1".equalsIgnoreCase(message.get("code").toString())){
        if ("-1".equalsIgnoreCase(message.get("code").toString())){
           logger.info("同步检查检验失败,错误信息为:"+message.get("msg").toString());
           logger.info("同步检查检验失败,错误信息为:"+message.get("msg").toString());
        }else {
            String msg = message.get("msg").toString();
            JSONObject object = JSONObject.parseObject(msg);
            JSONArray array = object.getJSONArray("detailModelList");
            for (int i=0;i<array.size();i++){
                JSONObject jsonObject = array.getJSONObject(i);
                String xmid = jsonObject.getString("xmid");
                String yjxh = jsonObject.getString("yjxh");
                List<WlyyInspectionDO> inspectionDOList = wlyyInspectionDao.findByPrescriptionIdAndCode(prescriptionId,xmid,1);
                for (WlyyInspectionDO inspectionDO:inspectionDOList){
                    inspectionDO.setHisCode(yjxh);
                    wlyyInspectionDao.save(inspectionDO);
                }
            }
        }
        }
        System.out.println(message.get("code")+"-----"+message.get("msg"));
        System.out.println(message.get("code")+"-----"+message.get("msg"));
    }
    }

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

@ -134,6 +134,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private BaseSmsTemplateDao smsTemplateDao;
    private BaseSmsTemplateDao smsTemplateDao;
    @Autowired
    @Autowired
    private YkyySMSService ykyySMSService;
    private YkyySMSService ykyySMSService;
    @Autowired
    private WlyyInspectionDao inspectionDao;
@ -880,6 +882,16 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        wlyyPrescriptionDO.setPayStatus(1);
                        wlyyPrescriptionDO.setPayStatus(1);
                        wlyyPrescriptionDO.setPayTime(new Date());
                        wlyyPrescriptionDO.setPayTime(new Date());
                        prescriptionDao.save(wlyyPrescriptionDO);
                        prescriptionDao.save(wlyyPrescriptionDO);
                        List<WlyyInspectionDO> inspectionDOList = inspectionDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOList){
                            String updateMsYj01 = "update V_MS_YJ01 t set t.HLWJF=1 where t.yjxh='"+wlyyInspectionDO.getHisCode()+"'";
                            try {
                                ykyyEntranceService.updateHisStatus(updateMsYj01);
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                        prescriptionLogService.addPrescriptionLog(wlyyPrescriptionDO.getId(),30,1,wlyyPrescriptionDO.getPatientCode(),wlyyPrescriptionDO.getPatientName(),"",new Date());
                        prescriptionLogService.addPrescriptionLog(wlyyPrescriptionDO.getId(),30,1,wlyyPrescriptionDO.getPatientCode(),wlyyPrescriptionDO.getPatientName(),"",new Date());
                        try {
                        try {
                            String sql = " update v_ms_dd01 SET FKZT=1 where CFSB = '"+wlyyPrescriptionDO.getRealOrder()+"'";
                            String sql = " update v_ms_dd01 SET FKZT=1 where CFSB = '"+wlyyPrescriptionDO.getRealOrder()+"'";

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyInspectionDO.java

@ -56,6 +56,8 @@ public class WlyyInspectionDO extends UuidIdentityEntity {
    private Integer del;//1可用 0删除
    private Integer del;//1可用 0删除
    private String totalUnit;//单位
    private String totalUnit;//单位
    private String hisCode;
    public String getTotalUnit() {
    public String getTotalUnit() {
        return totalUnit;
        return totalUnit;
    }
    }
@ -306,4 +308,12 @@ public class WlyyInspectionDO extends UuidIdentityEntity {
    public void setDel(Integer del) {
    public void setDel(Integer del) {
        this.del = del;
        this.del = del;
    }
    }
    public String getHisCode() {
        return hisCode;
    }
    public void setHisCode(String hisCode) {
        this.hisCode = hisCode;
    }
}
}

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

@ -274,6 +274,11 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
     * 处方号
     * 处方号
     */
     */
    private String chargeType;
    private String chargeType;
    /**
     * 云信房间号
     */
    private String channelId;
    @Column(name = "charge_type")
    @Column(name = "charge_type")
    public String getChargeType() {
    public String getChargeType() {
        return chargeType;
        return chargeType;
@ -729,4 +734,13 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    public void setRealOrder(String realOrder) {
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
        this.realOrder = realOrder;
    }
    }
    @Column(name = "channel_id")
    public String getChannelId() {
        return channelId;
    }
    public void setChannelId(String channelId) {
        this.channelId = channelId;
    }
}
}

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

@ -38,6 +38,8 @@ public class BaseHospitalRequestMapping {
        public static final String PREFIX  = "/prescription";
        public static final String PREFIX  = "/prescription";
        public static final String findDoctorByIdCard = "/findDoctorByIdCard";
        public static final String findDoctorByIdCard = "/findDoctorByIdCard";
        public static final String updateChannelId = "/updateChannelId";
        //=====================start=======================================
        //=====================start=======================================
        /**
        /**
         * 获取门诊记录
         * 获取门诊记录

+ 1 - 5
svr/svr-internet-hospital/pom.xml

@ -235,11 +235,7 @@
            <version>2.4</version>
            <version>2.4</version>
        </dependency>
        </dependency>
        <dependency>
            <groupId>xom</groupId>
            <artifactId>xom</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <groupId>com.yihu.jw</groupId>

+ 72 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -22,6 +22,7 @@ import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.dao.consult.KnowledgeArticleUserDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
@ -53,6 +54,7 @@ import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -195,6 +197,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private SystemMessageService systemMessageService;
    private SystemMessageService systemMessageService;
    @Autowired
    @Autowired
    private ConsultDao consultDao;
    private ConsultDao consultDao;
    @Autowired
    FileUploadService fileUploadService;
    @Autowired
    private FileUtil fileUtil;
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -1602,4 +1610,68 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @RequestParam(value = "idCard", required = false)String idCard) {
                                      @RequestParam(value = "idCard", required = false)String idCard) {
        return success(prescriptionService.findByIdCard(idCard));
        return success(prescriptionService.findByIdCard(idCard));
    }
    }
    @PostMapping(value = "updateChannelId")
    @ApiOperation(value = "保存云信channelId", notes = "保存云信channelId")
    public Envelop updateChannelId(@ApiParam(name = "id", value = "outpatientId")
                                      @RequestParam(value = "id", required = false)String id,
                                      @ApiParam(name = "channelId", value = "渠道id")
                                      @RequestParam(value = "channelId", required = false)String channelId) {
        prescriptionService.updateChannelId(id,channelId);
        return success("保存成功");
    }
    @PostMapping(value = "uploadFileToWx")
    @ApiOperation(value = "上传语音文件或者视频")
    public Envelop append(
            @ApiParam(name = "type", value = "追问内容类型:1文字,2图片,3语音  ... (im消息类型)")
            @RequestParam(value = "type",required = true) Integer type,
            @ApiParam(name = "times", value = "")
            @RequestParam(value = "times",required = false) Integer times) throws Exception {
        JSONObject object = new JSONObject();
        //处理语音文件
        if(!org.springframework.util.StringUtils.isEmpty(wxId)){
//			imService.getInputStream("1",wechat_appid);
            if(3 == type){//语音文件
                String voicepath = imService.fetchWxVoices(wxId);
                logger.info("voice_path:"+voicepath);
                JSONObject obj = new JSONObject();
                String voiceurl = "";
                // 将临时语音拷贝到正式存储路径下
                if (org.apache.commons.lang3.StringUtils.isNotEmpty(voicepath)) {
                    if("xm_ihealth_wx".equals(wxId)){
                        logger.info("voice_wx_type:"+wxId);
                        voiceurl = fileUploadService.uploadWxVoice(voicepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
                    }else {
                        voiceurl = fileUtil.copyTempVoice(voicepath,fastdfs_file_url);
                    }
                    obj.put("path", voiceurl);
                    obj.put("times", times);
                }
                object.put("path",voiceurl);
            }else if(2 == type){//图片文件
                String imagepath = imService.fetchWxImages(wxId);
                logger.info("image_path:"+imagepath);
                JSONObject obj = new JSONObject();
                String imgeUrl = "";
                // 将临时语音拷贝到正式存储路径下
                if (org.apache.commons.lang3.StringUtils.isNotEmpty(imagepath)) {
                    if("xm_ihealth_wx".equals(wxId)){
                        logger.info("imge_wx_type:"+wxId);
                        imgeUrl = fileUploadService.uploadWxImage(imagepath);
//					uploadVO.setFullUri(map.get("accessory").toString());
                    }else{
                        imgeUrl = fileUtil.copyTempVoice(imagepath,fastdfs_file_url);
                    }
                    object.put("path",imgeUrl);
                }
            }else{}
        }
        return success(object);
    }
}
}

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

@ -455,9 +455,9 @@ spring:
    host: 192.168.33.198 # Redis server host.
    host: 192.168.33.198 # Redis server host.
    port: 6380 # Redis server port.
    port: 6380 # Redis server port.
fastDFS:
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
  fastdfs_file_url: http://192.168.33.198:8888/
fast-dfs:
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
  tracker-server: 192.168.33.198:22122 #服务器地址
wechat:
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  flag: false #演示环境  true走Mysql数据库  false走Oracle