Kaynağa Gözat

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

liubing 4 yıl önce
ebeveyn
işleme
a331e82e94

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorHospitalDao.java

@ -21,6 +21,7 @@ public interface BaseDoctorHospitalDao extends PagingAndSortingRepository<BaseDo
    @Query(value = "select org_code as orgCode,org_name as orgName,doctor_duty_code as doctorDutyCode ,doctor_duty_name as doctorDutyName from base_doctor_hospital where doctor_code = ?1 GROUP BY orgCode ORDER BY orgName DESC",nativeQuery = true)
    List<Map<String,Object>> getOrgAndDutyByDoctorCode(String doctorCode);
    @Query("select bdo from BaseDoctorHospitalDO bdo where bdo.doctorCode = ?1 and bdo.del=1")
    List<BaseDoctorHospitalDO> findByDoctorCode(String doctorCode);
    List<BaseDoctorHospitalDO> findByOrgCode(String orgCode);

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

@ -2599,23 +2599,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    ins.setCreateTime(new Date());
                    ins.setPrescriptionId(prescription.getId());
                    ins.setOutpatientId(outPatientId);
                    if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                    /*if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        String code = ins.getCode();
                        com.alibaba.fastjson.JSONArray jsonArray = ykyyEntranceService.findZlxm("",code,"","","");
                        if (jsonArray!=null&&jsonArray.size()>0){
                            com.alibaba.fastjson.JSONObject deptobject = jsonArray.getJSONObject(0);
                            String deptNo = deptobject.getString("dept");
                            ins.setDept(deptNo);
                            ins.setDept(StringUtils.isNoneBlank(ins.getDept())?ins.getDept():deptNo);
                            String yqdm = deptobject.getString("yqdm");
                            if ("1001".equalsIgnoreCase(yqdm)){
                                ins.setOrgCode(yqdm);
                                ins.setOrgName("思北院区");
                            }else{
                                ins.setOrgCode(yqdm);
                                ins.setOrgName("五缘院区");
                            }
                            ins.setOrgCode(StringUtils.isNoneBlank(ins.getOrgCode())?ins.getOrgCode():yqdm);
                            ins.setOrgName("1001".equalsIgnoreCase(ins.getOrgCode())?"思北院区":"五缘院区");
                        }
                    }
                    }*/
                    System.out.println("____outpatientId=="+outPatientId);
                }
                //保存检查检验。
@ -2658,7 +2653,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                    }
                }
                if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                /*if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                    if (StringUtils.isNotBlank(inspectionJson)) {
                        if (StringUtils.isNotBlank(infoJsons)) {
                            List<WlyyPrescriptionInfoDO> infoDOs = (List<WlyyPrescriptionInfoDO>) com.alibaba.fastjson.JSONArray.parseArray(infoJsons, WlyyPrescriptionInfoDO.class);
@ -2673,7 +2668,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            sendWxTemplateMsg(wechatId, outpatientDO.getId(), null, "", "prescriptionPayRemind", prescription.getId());
                        }
                    }
                }
                }*/
                prescriptionDao.save(prescription);
                result.put("code", 1);
                result.put("mes", "诊断完成");
@ -8544,7 +8539,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyPrescriptionDO.setId(prescriptionId);
            wlyyPrescriptionDO.setCheckStatus(status);
            wlyyPrescriptionDO.setCheckReason(reason);
            if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            wlyyPrescriptionDO.setStatus(11);
            /*if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                wlyyPrescriptionDO.setStatus(10);
                List<WlyyPrescriptionInfoDO> list = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
@ -8552,11 +8548,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }else {
                    if(inspectionDOS!=null&&inspectionDOS.size()>0){
                        wlyyPrescriptionDO.setStatus(20);
                        wlyyPrescriptionDO.setCheckReason("只开检查检验,不开药品无需审方");
                        wlyyPrescriptionDO.setCheckStatus(2);
                    }
                }
            }else{
                wlyyPrescriptionDO.setStatus(11);
            }
            }else{*/
          /*  }*/
        }
        prescriptionDao.save(wlyyPrescriptionDO);
@ -11597,7 +11595,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        String title="";
        String isDoctor="0";//0患者 1医生
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        if("give_score".equalsIgnoreCase(templateCode)){
        if("give_score".equalsIgnoreCase(templateCode)){//评分
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
@ -11617,7 +11615,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            userId = consultTeamDo.getPatient();
            jsonObject.put("type",10);
            jsonObject.put("id",consultTeamDo.getConsult());
        }else if("video_invite".equalsIgnoreCase(templateCode)){
        }else if("video_invite".equalsIgnoreCase(templateCode)){//视频邀请
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());;
@ -11627,7 +11625,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",30);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        }else if("consult_remind".equalsIgnoreCase(templateCode)){
        }else if("consult_remind".equalsIgnoreCase(templateCode)){//医生向患者发消息提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
@ -11637,7 +11635,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",31);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        } else if("prescription_pay".equalsIgnoreCase(templateCode)){
        }else if("consult_remind_doctor".equalsIgnoreCase(templateCode)){//患者向医生发消息提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                //content = baseJpushTemplateDO.getPushContent();
                content= drugName;
                title=baseJpushTemplateDO.getPushHeader().replace("{{患者姓名}}",consultTeamDo.getName());
            }
            userId = consultTeamDo.getDoctor();
            jsonObject.put("type",33);
            jsonObject.put("id",consultTeamDo.getRelationCode());
            jsonObject.put("consultType",consultTeamDo.getType());
            jsonObject.put("patientName",consultTeamDo.getName());
            isDoctor = "1";
        }  else if("prescription_pay".equalsIgnoreCase(templateCode)){//处方支付提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
@ -11648,7 +11660,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            jsonObject.put("type",6);
            jsonObject.put("id",prescriptionId);
            jsonObject.put("outpatientId",wlyyOutpatientDO.getId());
        } else if("outpatient_pay".equalsIgnoreCase(templateCode)){
        } else if("outpatient_pay".equalsIgnoreCase(templateCode)){//诊查费支付提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
@ -11680,7 +11692,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",11);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        } else if("cancel_remind".equalsIgnoreCase(templateCode)){
        } else if("cancel_remind".equalsIgnoreCase(templateCode)){//医生取消接诊提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
@ -11706,7 +11718,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            userId = wlyyOutpatientDO.getConsumer();
            jsonObject.put("type",12);
            jsonObject.put("id",wlyyOutpatientDO.getId());
        }else if("outpatient_remind".equalsIgnoreCase(templateCode)){
        }else if("outpatient_remind".equalsIgnoreCase(templateCode)){//患者发起复诊向医生推消息
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
@ -11746,18 +11758,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            userId = wlyyOutpatientDO.getDoctor();
            jsonObject.put("id",wlyyOutpatientDO.getId());
            isDoctor="1";
        } else if("prescription_refuse".equalsIgnoreCase(templateCode)){
        } else if("prescription_refuse".equalsIgnoreCase(templateCode)){//处方审方失败提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();
                content=  content.replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName()).replace("{患者姓名}}",wlyyOutpatientDO.getPatientName());
                title=baseJpushTemplateDO.getPushHeader().replace("{{患者姓名}}",wlyyOutpatientDO.getDoctorName());
                content=  content.replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                title=baseJpushTemplateDO.getPushHeader().replace("{{患者姓名}}",wlyyOutpatientDO.getPatientName());
            }
            userId = wlyyOutpatientDO.getDoctor();
            jsonObject.put("type",8);
            jsonObject.put("id",prescriptionId);
            isDoctor="1";
        } else if("logistics_remind".equalsIgnoreCase(templateCode)){
        } else if("logistics_remind".equalsIgnoreCase(templateCode)){//物流消息提醒
            BaseJpushTemplateDO baseJpushTemplateDO = baseJpushTemplateDao.findByCode(templateCode);
            if(baseJpushTemplateDO!=null){
                content = baseJpushTemplateDO.getPushContent();

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

@ -56,6 +56,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.persistence.criteria.CriteriaBuilder;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.*;
@ -181,6 +182,50 @@ public class YkyyEntranceService {
    public void updateBySql(String sql){
        hibenateUtils.updateBySql(sql);
    }
    /**
     * 同步科室信息
     * @return
     * @throws Exception
     */
    public JSONArray findDeptByYq(String yqFlag,String deptCode,String deptName)throws Exception{
        String sql = "select code AS \"code\",name as \"name\",consultdeptflag as \"consultDeptFlag\",to_char(yjsy) as \"yjsy\" ,to_char(yqdm) as \"orgCode\" from V_HLW_KSXX where 1=1 and yjsy = 'Y'";
        if (StringUtils.isNoneBlank(yqFlag)){
            sql+=" and yqdm = '"+yqFlag+"'";
        }
        if (StringUtils.isNoneBlank(deptCode)){
            sql+=" and code = '"+deptCode+"'";
        }
        if (StringUtils.isNoneBlank(deptName)){
            sql+=" and name like  '%"+deptName+"%'";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("findDeptByYq:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array = rs.getJSONArray("detailModelList");
            logger.info("dept size:"+array.size());
            if(array!=null&&array.size()>0){
                for(int i=0;i<array.size();i++){
                    JSONObject deptjson = array.getJSONObject(i);
                    String orgCode = deptjson.getString("orgCode");
                    if ("1001".equalsIgnoreCase(orgCode)){
                        deptjson.put("orgName","思北院区");
                    }else {
                        deptjson.put("orgName","五缘院区");
                    }
                }
                return array;
            }
        }
        return  null;
    }
    /**
     * 同步科室信息
     * @return
@ -1955,6 +2000,11 @@ public class YkyyEntranceService {
            patient=outpatientDO.getPatient();
            prescriptionId=prescriptionDO.getId();
        }
        List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(doctor);
        String deptCode=null;
        if (doctorHospitalDOS!=null&&doctorHospitalDOS.size()!=0){
            deptCode = doctorHospitalDOS.get(0).getDeptCode();
        }
        for (WlyyInspectionDO wlyyInspectionDO:inspectionDOS){
            YkEmrJcsqDO ykEmrJcsqDO = new YkEmrJcsqDO();
            System.out.println("jcjy=="+wlyyInspectionDO.getOutpatientId());
@ -1969,13 +2019,15 @@ public class YkyyEntranceService {
                JSONObject deptobject = jsonArray.getJSONObject(0);
                deptNo = deptobject.getString("dept");
            }
            ykEmrJcsqDO.setZxks(deptNo==null?0:Integer.parseInt(deptNo));
            //ykEmrJcsqDO.setZxks(deptNo==null?0:Integer.parseInt(deptNo));
            ykEmrJcsqDO.setZxks(wlyyInspectionDO.getDept()==null?0:Integer.parseInt(wlyyInspectionDO.getDept()));
            ykEmrJcsqDO.setJcxm(wlyyInspectionDO.getName());
            ykEmrJcsqDO.setXmdj(new BigDecimal(wlyyInspectionDO.getChargeAmount()));
            ykEmrJcsqDO.setSqsl(wlyyInspectionDO.getQuantity());
            ykEmrJcsqDO.setJclx(Integer.valueOf(wlyyInspectionDO.getCheckPart()));
            ykEmrJcsqDO.setXmdw(wlyyInspectionDO.getTotalUnit());
            ykEmrJcsqDO.setKdsj(new Date());
            ykEmrJcsqDO.setKdks(deptCode==null?0:Integer.parseInt(deptCode));
            ykEmrJcsqDOS.add(ykEmrJcsqDO);
        }

+ 2 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -189,7 +189,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    BigDecimal d = new BigDecimal(String.valueOf(wlyyPrescriptionDO.getInspectFee()));
                    dc= d.multiply(c);
                }
                businessOrderDO.setPayPrice(bc.doubleValue()+dc.doubleValue());
                businessOrderDO.setPayPrice(bc.doubleValue());
                businessOrderDO.setDescription("处方结算");
                businessOrderDO = businessOrderDao.save(businessOrderDO);
                businessOrderDOS.add(businessOrderDO);
@ -1837,6 +1837,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if (status!=null){
            sql+=" and t.status ="+status+"";
        }
        sql+=" order by t.create_time desc ";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        /*for (Map<String,Object> map:list){
            if (map.get("createTime")!=null){

+ 5 - 2
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -472,11 +472,14 @@ public class ImService {
	public List<String> append(String consult, String content, Integer type, Integer times,String patientcode,String wechat_appid) throws Exception {
		List<ConsultTeamLogDo> logs = new ArrayList<ConsultTeamLogDo>();
		ConsultTeamDo consultModel = consultTeamDao.findByConsult(consult);
		if (consultModel == null) {
			throw new Exception("咨询记录不存在!");
		}
		try {
			prescriptionService.wxTempalteJPush("consult_remind_doctor",null,consultModel,content,"","","");
		}catch (Exception e){
			e.printStackTrace();
		}
		if (consultModel.getEndMsgId() != null) {
			throw new Exception("咨询已结束!");
		}

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/YkEmrJcsqDO.java

@ -51,6 +51,17 @@ public class YkEmrJcsqDO {
    private Integer sqsl;//数量
    private Integer jzxh;//就诊序号HLWYS_MZ_JZLS的JZXH对应
    private Integer jsbz;
    private Integer kdks;//开单科室
    @Column(name = "KDKS")
    public Integer getKdks() {
        return kdks;
    }
    public void setKdks(Integer kdks) {
        this.kdks = kdks;
    }
    @Column(name = "JSBZ")
    public Integer getJsbz() {
        return jsbz;

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

@ -566,6 +566,7 @@ public class BaseHospitalRequestMapping {
        public static final String yktPay ="/yktPay";
        public static final String getSql = "/getSql";
        public static final String findDeptByOrgCode = "/findDeptByOrgCode";
        /**
         * 获取门诊记录
         */

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

@ -299,4 +299,18 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.YkyyPrescription.findDeptByOrgCode)
    @ApiOperation(value = "查询眼科科室信息", notes = "查询眼科科室信息")
    public ListEnvelop findDeptByOrgCode(@ApiParam(name = "orgCode", value = "orgCode")
                                    @RequestParam(value = "orgCode", required = false)String orgCode,
                                        @ApiParam(name = "deptCode", value = "deptCode")
                                        @RequestParam(value = "deptCode", required = false)String deptCode,
                                        @ApiParam(name = "deptName", value = "deptName")
                                            @RequestParam(value = "deptName", required = false)String deptName)throws Exception {
        return success("ok",ykyyEntranceService.findDeptByYq(orgCode,deptCode,deptName));
    }
}

+ 4 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Map;
/**
@ -437,7 +438,9 @@ public class YkyyController extends EnvelopRestEndpoint {
            @RequestParam(value = "enterpriseId")String enterpriseId,
            @ApiParam(name = "content", value = "内容", required = true)
            @RequestParam(value = "content")String content) throws Exception{
        System.out.println("content======"+content);
        content = content.replace("#","%23");
        System.out.println("转换后content"+content);
        String response = enterpriseService.sendMKMesByDoctor(enterpriseId,doctor,content);
        System.out.println("企业模板消息"+response);
        return success(ykyyEntranceService.sendMesToYkt(doctor,patient,orderType));