wangjun 4 年 前
コミット
10cb6decb8

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

@ -12,6 +12,7 @@ import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
@ -530,6 +531,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("operator",outpatientDO.getOperator());
        rs.put("status",outpatientDO.getStatus());
        rs.put("fee",outpatientDO.getFee());
        rs.put("icd10Name",outpatientDO.getIcd10Name());
        rs.put("createTime",DateUtil.dateToStrLong(outpatientDO.getCreateTime()));
        //居民详情
        BasePatientDO basePatientDO = basePatientDao.findById(outpatientDO.getPatient());
@ -1604,6 +1606,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    }
                    chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
                }
                doctor.put("chargeTypeList",chargeDictDOLists);
            }
            if (StringUtils.isNotBlank(doctorCode)) {
@ -5918,7 +5921,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "AND room.outpatient_id=outpatient.id " +
                "AND consult.relation_code=outpatient.id " +
                "AND outpatient.pay_status=1 " +
                "AND outpatient.outpatient_type!=3 " +
                "AND outpatient.type =2 " +
                "AND outpatient.outpatient_type !=2 " +
                "AND consult.status = 0 ";
        if (StringUtils.isNoneBlank(doctor)) {
            sql = sql + "AND room.doctor='" + doctor + "' " +
@ -6804,6 +6808,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        one.setDept(outpatientDO.getDept());
        one.setDeptName(outpatientDO.getDeptName());
        one.setType(outpatientDO.getType());
        one.setOutpatientType(outpatientDO.getOutpatientType());
        WlyyOutpatientDO outpatient = outpatientDao.save(one);
        WlyyPatientRegisterTimeDO registerTimeDO = null;
@ -6821,6 +6826,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                registerTimeDO.setOutpatientId(outpatient.getId());
                registerTimeDO.setCreateTime(new Date());
                patientRegisterTimeDao.save(registerTimeDO);
            }else {
                one.setRegisterDate(new Date());
                outpatientDao.save(one);
            }
        } catch (Exception e) {
            throw new RuntimeException("号源已经被预约,请选择其他号源");
@ -8310,6 +8318,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public Boolean sendOutPatientSuggest(String advicesJson) {
        List<WlyyConsultAdvice> advices = (List<WlyyConsultAdvice>) com.alibaba.fastjson.JSONArray.parseArray(advicesJson, WlyyConsultAdvice.class);
        if (advices!=null&&advices.size()>0){
            WlyyConsultAdvice advice = advices.get(0);
            String consult =  advice.getConsult();
            String sql = "select t.relation_code as \"relationCode\" from wlyy_consult t where t.id = '"+consult+"'";
            List<Map<String,Object>> map = hibenateUtils.createSQLQuery(sql);
            if(map!=null&&map.size()>0){
                String outpatientId= map.get(0).get("relationCode").toString();
               WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
               if (wlyyOutpatientDO!=null){
                   StringBuffer content = new StringBuffer();
                   StringBuffer icd10Code = new StringBuffer();
                   for (WlyyConsultAdvice consultAdvice:advices){
                       content.append(consultAdvice.getAdviceValue()+",");
                       icd10Code.append(consultAdvice.getAdviceKey()+",");
                   }
                   if (content!=null&&content.length()>0){
                       System.out.println("content+====="+content);
                       content.deleteCharAt(content.length()-1);
                       icd10Code.deleteCharAt(icd10Code.length()-1);
                   }
                   wlyyOutpatientDO.setIcd10Name(content.toString());
                   wlyyOutpatientDO.setIcd10(icd10Code.toString());
                   outpatientDao.save(wlyyOutpatientDO);
               }
            }
        }
        wlyyConsultAdviceDao.save(advices);
        return true;
    }

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

@ -1274,7 +1274,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    System.out.println("发送企业模板消息成功");
                }
            }
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
            wlyyOutpatientDO.setPayStatus(1);
            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);

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

@ -3691,7 +3691,7 @@ public class ImService {
	public List<Map<String,Object>> doctorUpcomingList(String doctorCode, String type) {
		String sql = "";
		if("1,15,17".equals(type)) {
			sql = "SELECT " +
			/*sql = "SELECT " +
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
@ -3719,7 +3719,83 @@ public class ImService {
					"base_patient d  " +
					"WHERE a.id=b.consult " +
					"AND b.patient=d.id AND b.doctor='" + doctorCode + "' AND b.type in (" + type + ") and b.status = 0 and a.pay_status=1 " +
					"ORDER BY a.czrq desc ";
					"ORDER BY a.czrq desc ";*/
			sql = "SELECT " +
					" DISTINCT op.id AS \"outpatientId\"," +
					"op.description AS \"title\"," +
					"op.description AS \"symptoms\","+
					//添加排序的列
					"op.create_time AS \"createTime\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
				}else {
					sql = sql + "to_char(op.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
				}
			}else{
				sql = sql + "date_format(op.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql =sql +"op.status AS \"status\"," +
					"op.evaluate_status AS \"evaluate\"," +
					"op.doctor AS \"doctorCode\"," +
					"case op.type when '1' then '1'  when '3' then '15' else  '17' end \"type\"," +
					"op.general_doctor AS \"generalDoctor\"," +
					"patient.NAME AS \"patientName\"," +
					"patient.id AS \"patientId\"," +
					"patient.idcard AS \"patientIdcard\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\",";
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
				}else {
					sql = sql + "to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\",";
				}
			}else{
				sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
			}
			sql = sql +		"op.status AS \"outpatientstatus\", " +
					"p.check_status as \"checkStatus\"," +
					"p.check_reason as \"checkReason\""+
					"FROM base_patient patient," +
					"wlyy_outpatient op " +
					" left join wlyy_prescription p on p.outpatient_id = op.id "+
					"WHERE op.patient=patient.id " +
					"AND op.doctor='"+doctorCode+"' " +
					"AND op.status in ('0','1','2') and  op.pay_status=1 ";
			/*if("9".equals(type)){
				//图文复诊
				sql =sql +"AND op.type=1 AND op.outpatient_type=1 ";
			}else if("16".equals(type)){
				//视频复诊
				sql =sql +"AND op.type=2 AND op.outpatient_type=1 ";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else if("12".equals(type)){
				//视频复诊
				sql =sql +"AND op.outpatient_type=2";
				if("xm_ykyy_wx".equals(wxId)){
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else  {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}
			}else{}*/
			sql =sql +" AND op.type in ('1','2') AND op.outpatient_type = 3 ";
			sql =sql +" ORDER BY op.create_time DESC";
		}
		if("9".equals(type) || "16".equals(type)|| "12".equals(type)){
			sql = "SELECT " +

+ 8 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyChargeDictVO.java

@ -33,6 +33,14 @@ public class WlyyChargeDictVO {
    @ApiModelProperty(value = "协同费", example = "模块1")
    private double xtFee;
    public double getXtFee() {
        return xtFee;
    }
    public void setXtFee(double xtFee) {
        this.xtFee = xtFee;
    }
    public double getZjFee() {
        return zjFee;
    }

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java

@ -134,6 +134,8 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
                        " province_name AS \"provinceName\"," +
                        " city_name AS \"cityName\" ," +
                        "town_name AS \"townName\"," +
                        " photo AS \"photo\"," +
                        " brief AS \"brief\"," +
                        "address AS \"address\"\n" +
                        "FROM\n" +
                        "\tbase_org\n" +

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

@ -573,7 +573,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "doctor", value = "医生CODE")
			@RequestParam(value = "doctor",required = false) String doctor,
			@ApiParam(name = "general_doctor", value = "全科医生CODE")
			@RequestParam(value = "general_doctor",required = false) String general_doctor)throws Exception{
			@RequestParam(value = "general_doctor",required = false) String general_doctor
			)throws Exception{
		return success("请求成功",prescriptionService.getVideoPrescriptionByDoctor(doctor,general_doctor,wxId));
	}