Kaynağa Gözat

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
mengkang 5 yıl önce
ebeveyn
işleme
6aa83f49db
18 değiştirilmiş dosya ile 514 ekleme ve 77 silme
  1. 17 0
      business/base-service/src/main/java/com/yihu/jw/hospital/consult/dao/WlyyConsultAdviceDao.java
  2. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java
  3. 22 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionEmrDao.java
  4. 16 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java
  5. 53 5
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 2 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/XzyyPrescriptionService.java
  7. 38 0
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  8. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  9. 57 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyConsultAdvice.java
  10. 122 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionEmrDO.java
  11. 11 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  12. 2 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/sync/BaseSyncDataEndpoint.java
  13. 54 54
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java
  14. 5 0
      svr/svr-base/src/main/resources/application.yml
  15. 33 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  16. 41 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  17. 7 3
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/controller/CreditsDetailController.java
  18. 31 7
      svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java

+ 17 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/consult/dao/WlyyConsultAdviceDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.hospital.consult.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyConsultAdvice;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 咨询建议Dao
 * @author huangwenjie
 * @date 2020/5/27 17:29
 */
public interface WlyyConsultAdviceDao  extends PagingAndSortingRepository<WlyyConsultAdvice, String>, JpaSpecificationExecutor<WlyyConsultAdvice> {
	
	List<WlyyConsultAdvice> getByConsult(String consult);
}

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

@ -34,6 +34,8 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    List<WlyyPrescriptionDO> findById(String id);
    WlyyPrescriptionDO findByRealOrder(String realOrder);
    
    WlyyPrescriptionDO findByAdmNoAndRealOrder(String admno,String realOrder);
    List<WlyyPrescriptionDO> findByDoctorAndCreateTimeAndRemark(String doctor,Date createTime,String remark);

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

@ -0,0 +1,22 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.Date;
import java.util.List;
/**
 * Created by wangzhinan on 2019/5/17.
 */
public interface PrescriptionEmrDao extends PagingAndSortingRepository<WlyyPrescriptionEmrDO, String>, JpaSpecificationExecutor<WlyyPrescriptionEmrDO> {
    @Query("select a from WlyyPrescriptionEmrDO a where a.prescriptionId = ?1 and a.del=1 ")
    List<WlyyPrescriptionEmrDO> findByPrescriptionId(String prescriptionId);
}

+ 16 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -209,7 +210,7 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(sfexpress_obj.getOutpatientId());
        BaseOrgDO hospital = baseOrgDao.findByCode(outpatientDO.getHospital());
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
    
        JSONObject params = SFUtils.postSFOrderServiceV2(sfexpress_obj,hospital,basePatientDO);
        String re = this.SFExpressPostV2(params);
        //xml验证
@ -217,10 +218,23 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        verificationResponV2(re);
        JSONObject respone = JSONObject.parseObject(re);
//        String re = "{\"success\":true,\"message\":null,\"code\":\"SUCCESS\",\"result\":{\"successResult\":[{\"mailNo\":\"SF1023527844982\",\"bspOrderNo\":\"2c9081aa724b941501724eb3d0e40036\"}]}}";
//        JSONObject respone = JSONObject.parseObject(re);
        String mailno = "";//顺丰运单号
        
        JSONArray successResult =  respone.getJSONObject("result").getJSONArray("successResult");
        
        if(!successResult.isEmpty()){
            JSONObject object = successResult.getJSONObject(0);
            mailno = object.getString("mailNo");
        }
    
        logger.info("顺丰快递下订单:mailno"+mailno);
    
        mailno = respone.getJSONObject("result").getJSONArray("successResult").getJSONObject(0).getString("mailNo");
        
//        mailno = respone.getJSONObject("result").getJSONArray("successResult").getJSONObject(0).getString("mailNo");
        
        sfexpress_obj.setMailno(mailno);
        return sfexpress_obj;
    }

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

@ -28,6 +28,7 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.consult.dao.WlyyConsultAdviceDao;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao;
@ -182,6 +183,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PrescriptionCheckDao prescriptionCheckDao;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    @Autowired
    private PrescriptionEmrDao prescriptionEmrDao;
    @Autowired
    private WlyyConsultAdviceDao wlyyConsultAdviceDao;
    @Value("${demo.flag}")
@ -4231,13 +4236,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public Object getSFExpressInfo(String admNo,String realOrder,String wxId)throws Exception {
    
        //根据门诊唯一号取就诊记录
        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
//        List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByAdmNo(admNo);
        
        WlyyPrescriptionDO wlyyPrescriptionDOS = prescriptionDao.findByAdmNoAndRealOrder(admNo,realOrder);
        
        Object result = "";
    
        System.out.println("获取顺丰物流面单信息:wlyyOutpatientDOs.isEmpty()="+wlyyOutpatientDOs.isEmpty());
        if(!wlyyOutpatientDOs.isEmpty() && wlyyOutpatientDOs.size()>0){
            List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId",wlyyOutpatientDOs.get(0).getId());
        System.out.println("获取顺丰物流面单信息:wlyyPrescriptionDOS != null="+wlyyPrescriptionDOS != null);
        if(wlyyPrescriptionDOS != null){
            List<WlyyPrescriptionExpressageDO> expressageDOList = sfexpressService.findByField("outpatientId",wlyyPrescriptionDOS.getOutpatientId());
            WlyyPrescriptionExpressageDO sfexpress_obj = null;
            System.out.println("获取顺丰物流面单信息:CollectionUtils.isEmpty(expressageDOList)="+CollectionUtils.isEmpty(expressageDOList));
            if(CollectionUtils.isEmpty(expressageDOList)){
@ -4246,7 +4253,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                System.out.println("获取顺丰物流面单信息:1");
                sfexpress_obj = expressageDOList.get(0);
                System.out.println("获取顺丰物流面单信息:2");
                BasePatientDO basePatientDO = basePatientDao.findById(wlyyOutpatientDOs.get(0).getPatient());
                BasePatientDO basePatientDO = basePatientDao.findById(wlyyPrescriptionDOS.getPatientCode());
                //如果该处方的快递单号已生成,则说明已经下单成功,不需要重复下单,直接返回面单信息
                System.out.println("获取顺丰物流面单信息:3");
                if(org.apache.commons.lang.StringUtils.isNotBlank(sfexpress_obj.getMailno())){
@ -5641,5 +5648,46 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 创建电子病历
     * @param wlyyPrescriptionEmrDO
     * @return
     */
    public WlyyPrescriptionEmrDO saveEmr(WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO){
        wlyyPrescriptionEmrDO.setCreateTime(new Date());
        wlyyPrescriptionEmrDO.setUpdateTime(new Date());
        wlyyPrescriptionEmrDO.setDel(1);
        return prescriptionEmrDao.save(wlyyPrescriptionEmrDO);
    }
    /**
     * 查询电子病历
     * @param prescriptionId
     * @return
     */
    public List<WlyyPrescriptionEmrDO> findByPrescriptionId(String  prescriptionId){
        return prescriptionEmrDao.findByPrescriptionId(prescriptionId);
    }
    
    
    /**
     * 保存排班规则
     * @param workRoleJsons
     * @return
     */
    public Boolean sendOutPatientSuggest(String advicesJson){
        List<WlyyConsultAdvice> advices = (List<WlyyConsultAdvice>) com.alibaba.fastjson.JSONArray.parseArray(advicesJson, WlyyConsultAdvice.class);
        wlyyConsultAdviceDao.save(advices);
        return true;
    }
    
    /**
     * 获取咨询建议
     * @param consultcode
     * @return
     */
    public List<WlyyConsultAdvice> getConsultSuggest(String consultcode) {
        return wlyyConsultAdviceDao.getByConsult(consultcode);
    }
}

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

@ -116,8 +116,9 @@ public class XzyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                return res;
            }
        }
        String doctorFlag =  doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();
        JSONArray response =  xzzxEntranceService.registeredOperate(doctorMappingDO.getMappingCode(),outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType());
        JSONArray response =  xzzxEntranceService.registeredOperate(doctorFlag,outpatientDO.getDept(),patientMappingDO.getMappingCode(),doctorDO.getChargeType());
        JSONObject res = response.getJSONObject(0);
        logger.info("挂号结果 res: " + response.toString());
        String rsCode = res.getString("registerNo");

+ 38 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1659,6 +1659,10 @@ public class ImService {
		
		//获取药品
		List<WlyyPrescriptionInfoVO> infoVOs = wlyyPrescriptionVO.getInfoVOs();
		JSONObject object = new JSONObject();
		object.put("info",infoVOs);
		object.put("outpatientid",wlyyPrescriptionVO.getOutpatientId());
		object.put("prescriptionid",wlyyPrescriptionVO.getId());
		if(!infoVOs.isEmpty()){
			String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyPrescriptionVO.getPatientCode()+"_"+wlyyPrescriptionVO.getOutpatientId()+"_9", "27", JSON.toJSONString(infoVOs),"1");
		}
@ -1690,6 +1694,20 @@ public class ImService {
		}
	}
	
	/**
	 * 发送咨询建议
	 * @param jsonObject
	 * @param doctor
	 * @param doctorName
	 * @param outpatientId
	 * @param patient
	 * @return
	 * @throws Exception
	 */
	public String sendOutPatientSuggestMsg(String msg,String doctor,String doctorName,String sessionid) throws Exception {
		return imUtil.sendImMsg(doctor, doctorName, sessionid, "34",msg,"1");
	}
	
	
	/**
	 * 发送处方驳回消息
@ -1711,6 +1729,26 @@ public class ImService {
		}
	}
	
	/**
	 * 发送处方支付消息
	 * @param jsonObject
	 * @param doctor
	 * @param doctorName
	 * @param outpatientId
	 * @param patient
	 * @return
	 * @throws Exception
	 */
	public String sendOutPatientPayMsg(com.alibaba.fastjson.JSONObject jsonObject,String doctor,String doctorName,String outpatientId,String patient,String outpatientType) throws Exception {
		if("1".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_9", "35",jsonObject.toString(),"1");
		}else if("2".equals(outpatientType)){
			return imUtil.sendImMsg(doctor, doctorName, patient+"_"+outpatientId+"_12", "35",jsonObject.toString(),"1");
		}else{
			return null;
		}
	}
	
	/**
	 * 查询医生所有的咨询记录
	 * @param doctor 医生标识

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,7 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
    /*@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
/*    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 57 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyConsultAdvice.java

@ -0,0 +1,57 @@
package com.yihu.jw.entity.hospital.prescription;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * 咨询建议
 * @author huangwenjie
 * @date 2020/5/27 17:23
 */
@Entity
@Table(name = "wlyy_consult_advice")
public class WlyyConsultAdvice extends UuidIdentityEntity {
	
	private String adviceKey;
	private String adviceValue;
	private String adviceType;
	private String consult;
	
	
	@Column(name = "advice_key")
	public String getAdviceKey() {
		return adviceKey;
	}
	
	public void setAdviceKey(String adviceKey) {
		this.adviceKey = adviceKey;
	}
	
	@Column(name = "advice_value")
	public String getAdviceValue() {
		return adviceValue;
	}
	
	public void setAdviceValue(String adviceValue) {
		this.adviceValue = adviceValue;
	}
	@Column(name = "advice_type")
	public String getAdviceType() {
		return adviceType;
	}
	
	public void setAdviceType(String adviceType) {
		this.adviceType = adviceType;
	}
	
	public String getConsult() {
		return consult;
	}
	
	public void setConsult(String consult) {
		this.consult = consult;
	}
}

+ 122 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionEmrDO.java

@ -0,0 +1,122 @@
package com.yihu.jw.entity.hospital.prescription;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
* 在线处方电子病历
*
* @author
*
*/
@Entity
@Table(name = "wlyy_prescription_emr")
public class WlyyPrescriptionEmrDO extends UuidIdentityEntityWithOperator {
    /**
     * 处方id
     */
    private String prescriptionId;
    /**
     * 主诉
     */
    private String complaint;
    /**
     * 现病史
     */
    private String medicalHistory;
    /**
     * 即往史
     */
    private String pastHistory;
    /**
     * 体格检查
     */
    private String physicalExamination;
    /**
     *辅助检查
     */
    private String assistExamination;
    /**
     * 标识是否删除
     */
    private Integer del;
    @Column(name = "complaint")
    public String getComplaint() {
        return complaint;
    }
    public void setComplaint(String complaint) {
        this.complaint = complaint;
    }
    @Column(name = "medical_history")
    public String getMedicalHistory() {
        return medicalHistory;
    }
    public void setMedicalHistory(String medicalHistory) {
        this.medicalHistory = medicalHistory;
    }
    @Column(name = "past_history")
    public String getPastHistory() {
        return pastHistory;
    }
    public void setPastHistory(String pastHistory) {
        this.pastHistory = pastHistory;
    }
    @Column(name = "physical_examination")
    public String getPhysicalExamination() {
        return physicalExamination;
    }
    public void setPhysicalExamination(String physicalExamination) {
        this.physicalExamination = physicalExamination;
    }
    @Column(name = "assist_examination")
    public String getAssistExamination() {
        return assistExamination;
    }
    public void setAssistExamination(String assistExamination) {
        this.assistExamination = assistExamination;
    }
    @Column(name = "prescription_id")
    public String getPrescriptionId() {
        return prescriptionId;
    }
    public void setPrescriptionId(String prescriptionId) {
        this.prescriptionId = prescriptionId;
    }
    @Column(name = "del")
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

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

@ -408,6 +408,11 @@ public class BaseHospitalRequestMapping {
        public static final String selectExpireTime = "/selectExpireTime";
        public static final String saveEmr="/saveEmr";
        public static final String findEmrByPrescriptionId="/findEmrByPrescriptionId";
    }
@ -920,6 +925,12 @@ public class BaseHospitalRequestMapping {
    
        //医生端:发起/断开 会话小程序视频邀请
        public static final String videoInviteMiniProgram="videoInviteMiniProgram";
    
        //医生端:发送咨询建议
        public static final String sendOutPatientSuggest = "sendOutPatientSuggest";
        
        //医生端:获取咨询建议
        public static final String getConsultSuggest = "getConsultSuggest";
    }

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/sync/BaseSyncDataEndpoint.java

@ -31,6 +31,8 @@ public class BaseSyncDataEndpoint  extends EnvelopRestEndpoint {
    private BaseSyncDataService baseSyncDataService;
    @Value("${wechat.id}")
    private String wxId;

+ 54 - 54
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java

@ -224,9 +224,9 @@ public class WechatService {
    //====================图文素材管理============================
    public MixEnvelop findWechatCombo(String saasId){
        String sql ="SELECT t.id,t.`name`," +
                "t.app_origin_id AS appOriginId," +
                "t.public_type AS publicType " +
        String sql ="SELECT t.id AS \"id\",t.name as \"name\"," +
                "t.app_origin_id AS \"appOriginId\"," +
                "t.public_type AS \"publicType\" " +
                "from wx_wechat t";
        if(StringUtils.isNotBlank(saasId)){
            sql += " JOIN wx_wechat_saas s ON s.wechat_id = t.id " +
@ -252,7 +252,7 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " g.id,g.wechat_id AS wechatId,g.scene " +
                " g.id as \"id\",g.wechat_id AS \"wechatId\",g.scene AS \"scene\" " +
                " FROM " +
                " wx_graphic_scene g " +
                " WHERE " +
@ -325,7 +325,7 @@ public class WechatService {
    public MixEnvelop findImg(String wechatId,String title,String scene,Integer page,Integer size){
        String sqlTotal = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_graphic_message m ";
                if(StringUtils.isNotBlank(scene)){
@ -347,13 +347,13 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " m.id, " +
                " m.wechat_id AS wechatId, " +
                " m.title, " +
                " m.description, " +
                " m.url, " +
                " m.pic_url AS picUrl, " +
                " m.`status` " +
                " m.id as \"id\", " +
                " m.wechat_id AS \"wechatId\", " +
                " m.title as \"title\", " +
                " m.description \"description\", " +
                " m.url as \"url\", " +
                " m.pic_url AS \"picUrl\", " +
                " m.status AS \"status\" " +
                " FROM " +
                " wx_graphic_message m ";
        if(StringUtils.isNotBlank(scene)){
@ -460,7 +460,7 @@ public class WechatService {
    public MixEnvelop findWxReplyScene(String wechatId,String msgType,String event,String content,Integer status,Integer page,Integer size){
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_reply_scene s " +
                " WHERE " +
@ -485,15 +485,15 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " s.id," +
                " s.wechat_id AS wechatId," +
                " s.scene, " +
                " s.`status`, " +
                " s.id, " +
                " s.content, " +
                " s.app_origin_id AS appOriginId, " +
                " s.`event`, " +
                " s.msg_type AS msgType" +
                " s.id AS \"id\"," +
                " s.wechat_id AS \"wechatId\"," +
                " s.scene AS \"scene\", " +
                " s.status as \"status\", " +
                " s.id as \"id\", " +
                " s.content as \"content\", " +
                " s.app_origin_id AS \"appOriginId\", " +
                " s.event as \"event\", " +
                " s.msg_type AS \"msgType\"" +
                " FROM " +
                " wx_reply_scene s " +
                " WHERE " +
@ -560,7 +560,7 @@ public class WechatService {
    public MixEnvelop findWxtemp(String wechatId,Integer status,String name,String key,Integer page,Integer size){
        String totalSql = "SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_template t" +
                " WHERE t.wechat_id= '"+wechatId+"' ";
@ -580,13 +580,13 @@ public class WechatService {
        }
        String sql = "SELECT " +
                " t.id, " +
                " t.title, " +
                " t.wechat_id AS wechatId, " +
                " t.template_id AS templateId, " +
                " t.template_name AS templateName, " +
                " t.content, " +
                " t.`status` " +
                " t.id as \"id\", " +
                " t.title AS \"title\", " +
                " t.wechat_id AS \"wechatId\", " +
                " t.template_id AS \"templateId\", " +
                " t.template_name AS \"templateName\", " +
                " t.content as \"content\", " +
                " t.status as \"status\" " +
                " FROM " +
                " wx_template t" +
                " WHERE t.wechat_id= '"+wechatId+"' ";
@ -621,7 +621,7 @@ public class WechatService {
    public MixEnvelop findWxTempConfigList(String wechatId,String templateId,String scene,Integer page,Integer size){
        String totalSql ="SELECT " +
                " COUNT(1) AS total " +
                " COUNT(1) AS \"total\" " +
                " FROM " +
                " wx_template_config g " +
                " WHERE " +
@ -639,29 +639,29 @@ public class WechatService {
        }
        String sql ="SELECT " +
                " g.id, " +
                " g.wechat_id AS wechatId, " +
                " g.template_id AS templateId, " +
                " g.template_name AS template_name, " +
                " g.scene, " +
                " g.scene_description AS sceneDescription, " +
                " g.`first`, " +
                " g.url, " +
                " g.remark, " +
                " g.keyword1, " +
                " g.keyword2, " +
                " g.keyword3, " +
                " g.keyword4, " +
                " g.keyword5, " +
                " g.keyword6, " +
                " g.keyword7, " +
                " g.create_time AS createTime, " +
                " g.create_user AS createUser, " +
                " g.create_user_name AS createUserName, " +
                " g.update_time AS updateTime, " +
                " g.update_user AS updateUser, " +
                " g.update_user_name AS updateUserName, " +
                " g.status " +
                " g.id as \"id\", " +
                " g.wechat_id AS \"wechatId\", " +
                " g.template_id AS \"templateId\", " +
                " g.template_name AS \"template_name\", " +
                " g.scene AS \"scene\", " +
                " g.scene_description AS \"sceneDescription\", " +
                " g.first AS \"first\", " +
                " g.url AS \"url\", " +
                " g.remark AS \"remark\", " +
                " g.keyword1 AS \"keyword1\", " +
                " g.keyword2 AS \"keyword2\", " +
                " g.keyword3 AS \"keyword3\", " +
                " g.keyword4 AS \"keyword4\", " +
                " g.keyword5 AS \"keyword5\", " +
                " g.keyword6 AS \"keyword6\", " +
                " g.keyword7 AS \"keyword7\", " +
                " g.create_time AS \"createTime\", " +
                " g.create_user AS \"createUser\", " +
                " g.create_user_name AS \"createUserName\", " +
                " g.update_time AS \"updateTime\", " +
                " g.update_user AS \"updateUser\", " +
                " g.update_user_name AS \"updateUserName\", " +
                " g.status AS \"status\"" +
                " FROM " +
                " wx_template_config g " +
                " WHERE " +

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

@ -2,6 +2,11 @@
server:
  port: ${server.svr-base-port}
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver

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

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
@ -716,5 +717,37 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		wxTemplateService.sendWeTempMesMiniProgram(sender_id,sender_name,reciver_id,reciver_name,session_id);
		return success("操作成功");
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.sendOutPatientSuggest)
	@ApiOperation(value = "医生端:发送咨询建议消息", notes = "医生端:发送咨询建议消息")
	public Envelop sendOutPatientSuggest(@ApiParam(name = "adviceJson", value = "咨询建议JSON")
	                                     @RequestParam(value = "adviceJson", required = true)String adviceJson,
	                                     @ApiParam(name = "session_id", value = "咨询sessionid")
	                                     @RequestParam(value = "session_id", required = true)String session_id,
	                                     @ApiParam(name = "doctor", value = "医生CODE")
	                                         @RequestParam(value = "doctor", required = true)String doctor,
	                                     @ApiParam(name = "doctorName", value = "")
	                                         @RequestParam(value = "doctorName", required = true)String doctorName
                                      
	)throws Exception  {
		try {
			prescriptionService.sendOutPatientSuggest(adviceJson);
			String immsg = imService.sendOutPatientSuggestMsg(adviceJson,doctor,doctorName,session_id);
			System.out.println("发送咨询建议消息成功:"+immsg);
		}catch (Exception e){
			System.out.println("发送咨询建议消息失败:"+e.getMessage());
//            e.printStackTrace();
		}
		return success("操作成功");
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.getConsultSuggest)
	@ApiOperation(value = "医生端:发送咨询建议消息", notes = "医生端:发送咨询建议消息")
	public Envelop getConsultSuggest(@ApiParam(name = "consultcode", value = "咨询CODE")
	                                     @RequestParam(value = "consultcode", required = true)String consultcode
	
	)throws Exception  {
		return success("操作成功",prescriptionService.getConsultSuggest(consultcode));
	}
}

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

@ -1,13 +1,11 @@
package com.yihu.jw.hospital.endpoint.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeExcelReader;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionCheckDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.service.InspectionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
@ -1404,5 +1402,44 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 创建电子病历
     * @param emrJson
     * @return
     * @throws Exception
     */
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveEmr)
    @ApiOperation("创建电子病历")
    public ObjEnvelop saveEmr(
            @ApiParam(name = "emrJson", value = "emrJson", required = true)
            @RequestParam(required = true)String emrJson) throws Exception {
        try {
            WlyyPrescriptionEmrDO emrDO = objectMapper.readValue(emrJson,WlyyPrescriptionEmrDO.class);
            return ObjEnvelop.getSuccess("ok",prescriptionService.saveEmr(emrDO));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 查询电子病历
     * @param prescriptionId
     * @return
     * @throws Exception
     */
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.findEmrByPrescriptionId)
    @ApiOperation("查询电子病历")
    public ObjEnvelop findByPrescriptionId(
            @ApiParam(name = "prescriptionId", value = "prescriptionId", required = true)
            @RequestParam(required = true)String prescriptionId) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",prescriptionService.findByPrescriptionId(prescriptionId));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
}

+ 7 - 3
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/controller/CreditsDetailController.java

@ -274,7 +274,7 @@ public class CreditsDetailController extends EnvelopRestEndpoint {
                                                                 @ApiParam(name = "doctorId",value = "医生code")
                                                                     @RequestParam(value = "doctorId",required = false)String doctorId){
        try {
            return service.doctorDescreaseIntegrate(ruleId,patientId,doctorId,hospital,hospitalName,integrate,reason,null);
            return service.doctorDescreaseIntegrate(ruleId,patientId,doctorId,hospital,hospitalName,integrate,reason,null,null,null);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -309,9 +309,13 @@ public class CreditsDetailController extends EnvelopRestEndpoint {
                                                                 @ApiParam(name = "reason",value = "增加的原因")
                                                                 @RequestParam(value = "reason",required = false)String reason,
                                                                 @ApiParam(name = "doctorId",value = "医生code")
                                                                 @RequestParam(value = "doctorId",required = false)String doctorId){
                                                                 @RequestParam(value = "doctorId",required = false)String doctorId,
                                                                 @ApiParam(name = "name",value = "名字")
                                                                 @RequestParam(value = "name",required = false)String name,
                                                                 @ApiParam(name = "idcard",value = "身份证")
                                                                 @RequestParam(value = "idcard",required = false)String idcard){
        try {
            return service.doctorDescreaseIntegrate(ruleId,patientId,doctorId,hospital,hospitalName,integrate,reason,"add");
            return service.doctorDescreaseIntegrate(ruleId,patientId,doctorId,hospital,hospitalName,integrate,reason,"add",name,idcard);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 31 - 7
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/CreditsDetailService.java

@ -988,13 +988,37 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
    }
    public MixEnvelop doctorDescreaseIntegrate(String ruleId,String patientId,String doctorId,String hospital,String hospitalName,Integer integrate,String reason,String type) throws Exception {
       MixEnvelop envelop = new MixEnvelop<>();
       envelop.setObj(true);
       TaskDO taskDO =  taskDao.selectByTaskRuleId(ruleId);
       String sql = "select * from wlyy_health_bank_account where status = 1 and patient_id = '"+patientId+"'";
       List<AccountDO> accountDOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(AccountDO.class));
       AccountDO accountDO = accountDOs.get(0);
    public MixEnvelop doctorDescreaseIntegrate(String ruleId,String patientId,String doctorId,String hospital,String hospitalName,Integer integrate,String reason,String type,String name,String idcard) throws Exception {
        MixEnvelop envelop = new MixEnvelop<>();
        envelop.setObj(true);
        TaskDO taskDO =  taskDao.selectByTaskRuleId(ruleId);
        String sql = "select * from wlyy_health_bank_account where status = 1 and patient_id = '"+patientId+"'";
        List<AccountDO> accountDOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(AccountDO.class));
        AccountDO accountDO = null;
        if("add".equals(type)&&(accountDOs==null||accountDOs.size()==0)){
            //新建账户
            accountDO = new AccountDO();
            accountDO.setTotal(0);
            accountDO.setId(getCode());
            accountDO.setPatientId(patientId);
            accountDO.setAccountName(name);
            accountDO.setHospital(hospital);
            accountDO.setHospitalName(hospitalName);
            if(idcard.length()>=4){// 判断是否长度大于等于4
                String cardNumber=idcard.substring(idcard.length()- 4,idcard.length());//截取两个数字之间的部分
                int random = (int)((Math.random()*9+1)*100000);
                accountDO.setCardNumber(cardNumber+Integer.toString(random));
            }
            accountDO.setPassword("123456");
            accountDO.setSaasId("dev");
            accountDO.setStatus(1);
            accountDO.setCreateTime(new Date());
            accountDO.setUpdateTime(new Date());
            accountDO = accountDao.save(accountDO);
        }else{
            accountDO = accountDOs.get(0);
        }
       if (taskDO == null){
           TaskRuleDO taskRuleDO =  taskRuleDao.findByCode(ruleId);
           TaskDO  taskDO1 = new TaskDO();