wangjun 4 anos atrás
pai
commit
704e1604fd

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

@ -5096,7 +5096,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @query_status 0:图文复诊候诊 1:图文复诊抢单列表
     * @dept 部门
     */
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup) {
    public List<Map<String, Object>> findWaitingRoomOutpatientByDoctor(String doctor, Integer type, Integer query_status, String dept,String sex,String keyword,String ageGroup,String patient) {
        String sql = "SELECT " +
                "room.outpatient_id AS \"id\"," +
@ -5177,6 +5177,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }if(StringUtils.isNoneBlank(keyword)){
            sql += " AND outpatient.patient_name like '%" + keyword + "%' ";
        }
        if(StringUtils.isNoneBlank(patient)){
            sql += " AND (outpatient.patient= '" + patient + "' or outpatient.consumer ='"+patient+"') ";
        }
        if(StringUtils.isNoneBlank(ageGroup)){
            String[] age = ageGroup.split(",");
            Calendar nowBegin = Calendar.getInstance();
@ -9864,13 +9867,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient,String isSelectDrug) {
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient,String isSelectDrug,boolean consumerflag) {
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            return PageEnvelop.getError("找不到该患者",-1);
        }
        StringBuffer sql = new StringBuffer(" SELECT DISTINCT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name  FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        StringBuffer countSql = new StringBuffer("select COUNT(DISTINCT b.id) count FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        /*if (consumerflag){
            sql.append(" WHERE o.consumer = '");
            countSql.append(" WHERE o.consumer = '");
        }else{
            sql.append(" WHERE o.patient = '");
            countSql.append(" WHERE o.patient = '");
        }*/
        sql.append(patient).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        countSql.append(patient).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        if (StringUtils.isNoneBlank(isSelectDrug)){
@ -10436,6 +10446,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
                logger.info("作废处方开始" + prescriptionDO.getCheckStatus());
                WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId, 1);
@ -10467,13 +10478,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
                try {
                    net.sf.json.JSONObject jsonObject = entranceService.BS10112(jsonData.toJSONString(), demoFlag);
                    wlyyHttpLogDO.setResponse(jsonObject.toString());
                }catch (Exception e){
                    e.printStackTrace();
                    return "作废失败";
                }
                wlyyHttpLogDO.setRequest(jsonData.toJSONString());
                wlyyHttpLogDO.setName("作废处方");
                wlyyHttpLogDO.setCreateTime(new Date());
                wlyyHttpLogDO.setCode(outpatientDO.getId());
                wlyyHttpLogDao.save(wlyyHttpLogDO);
            }
            prescriptionDO.setStatus(-4);
            prescriptionDO.setDisableTime(new Date());
            prescriptionDO.setCheckStatus(5);
            prescriptionDO.setCheckReason("已作废");
            prescriptionDao.save(prescriptionDO);

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

@ -752,6 +752,9 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            orderRefundDao.save(orderRefundDO);
            updatePayStatusByRefund(orderNo);
        }
        if (businessOrderDO!=null){
            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
        }
        return map;
    }

+ 5 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java

@ -182,16 +182,21 @@ public class EnterpriseService {
            WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId,baseDoctorDO.getMobile());
            if(user!=null){
                res =sendTWMes(enterpriseId,user.getUserid(),title,description,url);
                logger.info("开始保存日志");
                logger.info("url==="+url);
                try {
                    if (StringUtils.isNoneBlank(url)){
                        logger.info("进入保存接口");
                        String outPatientId = url.substring(url.lastIndexOf("=")+1,url.length());
                        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                        wlyyHttpLogDO.setDoctor(doctor);
                        wlyyHttpLogDO.setRequest(url);
                        wlyyHttpLogDO.setName(title);
                        wlyyHttpLogDO.setCode(outPatientId);
                        wlyyHttpLogDO.setCreateTime(new Date());
                        wlyyHttpLogDO.setRequest("enterpriseId:"+enterpriseId+",doctor:"+doctor+",url:"+url);
                        wlyyHttpLogDO.setResponse(res);
                        logger.info(res);
                        wlyyHttpLogDao.save(wlyyHttpLogDO);
                    }
                }catch (Exception e){

+ 3 - 3
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -4044,7 +4044,7 @@ public class StatisticsEsService {
            }else {
                JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);//新增量
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                object.put("noReceiveData",array1);//未接诊
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");//已接诊
                object.put("haveReceiveData",array2);//已接诊
@ -4069,7 +4069,7 @@ public class StatisticsEsService {
            }else {
                JSONArray array = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);//新增量
                JSONArray array1 = weekTotalStatistics8(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                JSONArray array1 = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");//未接诊
                object.put("noReceiveData",array1);;//未接诊
                JSONArray array2 = weekTotalStatistics8(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");//已接诊
                object.put("haveReceiveData",array2);//已接诊
@ -4094,7 +4094,7 @@ public class StatisticsEsService {
            }else {
                JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,null);
                object.put("totalData",array);
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index,lowCode,SaveModel.timeLevel_ZL,"0");
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"0");
                object.put("noReceiveData",array1);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,lowCode,SaveModel.timeLevel_ZL,"1");
                object.put("haveReceiveData",array2);

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

@ -4012,7 +4012,7 @@ public class ImService {
	public List<Map<String,Object>>  findConsultRecordByDoctorNew(String doctor, String id,
															   String type, Integer status,
															   int page,int pagesize,
															   String title,String start_time,String end_time) {
															   String title,String start_time,String end_time,String patient) {
		String  sql = "";
		sql = "SELECT " +
				"a.id AS \"id\"," +
@ -4063,6 +4063,9 @@ public class ImService {
		if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
			sql += " AND op.doctor='" + doctor + "' ";
		}
        if (org.apache.commons.lang.StringUtils.isNotBlank(patient)) {
            sql += " AND (op.consumer='" + patient + "' or op.patient ='"+patient + "')";
        }
		if (!StringUtils.isEmpty(title)) {
			title = "%" + title + "%";
@ -4506,8 +4509,8 @@ public class ImService {
				"  t.idcard as \"idcard\"," +
				"  t.mobile as \"mobile\"," +
				"  op.doctor as \"doctor\"" +
				" from wlyy_outpatient op left join base_patient t " +
				" on t.id = op.consumer where t.del ='1' and op.status!= -1";
				" from base_patient t  left join  wlyy_outpatient op " +
				" on (t.id = op.consumer or t.id = op.patient) where t.del ='1' and op.status!= -1";
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(doctor)){
			sql+=" and op.doctor = '"+doctor+"'";
		}
@ -4529,7 +4532,7 @@ public class ImService {
				sql +=" AND op.outpatient_type in (1,2,3) ";
			}
		}
		sql+=" order by op.create_time  ";
		sql+=" order by op.create_time  desc ";
		logger.info("findRecordByDoctorSQL==="+sql);
		List<Map<String,Object>>  list = hibenateUtils.createSQLQuery(sql,page,pagesize);
		for (Map<String,Object> map:list){
@ -4555,7 +4558,7 @@ public class ImService {
					"  t.mobile as \"mobile\"," +
					"  op.doctor as \"doctor\"" +
					" from wlyy_outpatient op left join  base_patient t " +
					" on t.id = op.consumer where t.del ='1' and op.status!= -1";
					" on (t.id = op.consumer or t.id = op.patient) where t.del ='1' and op.status!= -1";
			if (org.apache.commons.lang3.StringUtils.isNoneBlank(doctor)){
				sql+=" and op.doctor = '"+doctor+"'";
			}

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

@ -277,6 +277,16 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    private String diagnosisName;
    private String diagnosisSubName;
    private Date disableTime;
    @Column(name = "disable_time")
    public Date getDisableTime() {
        return disableTime;
    }
    public void setDisableTime(Date disableTime) {
        this.disableTime = disableTime;
    }
    /**
     * 处方审方唯一标识
     */

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/RemindDoctorService.java

@ -39,7 +39,7 @@ public class RemindDoctorService {
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Value("${wechat.id}")
    @Value("${wechat.ids}")
    private String wechatId;
    @Autowired
    private PrescriptionService prescriptionService;

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

@ -134,9 +134,11 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "sex",required = false) String sex,
			@ApiParam(name = "keyWord", value = "姓名关键字")
			@RequestParam(value = "keyWord",required = false) String keyWord,
			@ApiParam(name = "patient", value = "患者id")
			@RequestParam(value = "patient",required = false) String patient,
			@ApiParam(name = "ageGroup", value = "年龄段")
			@RequestParam(value = "ageGroup",required = false) String ageGroup){
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept,sex,keyWord,ageGroup));
		return success("请求成功",prescriptionService.findWaitingRoomOutpatientByDoctor(doctor,type,query_status,dept,sex,keyWord,ageGroup,patient));
	}
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.findWaitingRoomPatient)
@ -713,6 +715,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "doctor",required = false) String doctor,
			@ApiParam(name = "title", value = "咨询标题关键字")
			@RequestParam(value = "title",required = false) String title,
			@ApiParam(name = "patient", value = "患者id")
			@RequestParam(value = "patient",required = false) String patient,
			@ApiParam(name = "id", value = "咨询ID")
			@RequestParam(value = "id",required = false) String id,
			@ApiParam(name = "type", value = "咨询类型")
@ -728,7 +732,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "pagesize", value = "分页大小")
			@RequestParam(value = "pagesize",required = false) int pagesize
	)throws Exception{
		List<Map<String,Object>>  data = imService.findConsultRecordByDoctorNew(doctor, id,type,status, page,pagesize, title,start_time,end_time);
		List<Map<String,Object>>  data = imService.findConsultRecordByDoctorNew(doctor, id,type,status, page,pagesize, title,start_time,end_time,patient);
		if (data != null) {
			for(Map<String,Object> consult :data){

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

@ -2109,10 +2109,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                  @ApiParam(name = "size", value = "页面大小")
                                                  @RequestParam(value = "size",required = false,defaultValue = "10") Integer size)throws Exception {
        try {
            boolean consumerflag = false ;
            if (!StringUtils.isNoneBlank(patient)){
                patient=getUID();
                consumerflag=true;
            }
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size,patient,isSelectDrug);
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size,patient,isSelectDrug,consumerflag);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
        }