Bläddra i källkod

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/base/team/BaseTeamDO.java
wangzhinan 6 år sedan
förälder
incheckning
9ec3a9f4ef

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

@ -87,6 +87,7 @@ public class SpecialistMapping {
        public static final String planListByPatient = "/planListByPatient";
        public static final String patientCount = "/patientCount";
        public static final String selectByIds = "/selectByIds";
        public static final String selectByLabelAndPatient = "/selectByLabelAndPatient";
    }
    public static class serviceItem{

+ 28 - 8
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java

@ -3,15 +3,9 @@ package com.yihu.jw.controller.rehabilitation;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dao.rehabilitation.RehabilitationOperateRecordsDao;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationPlanTemplateDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationTemplateDetailDO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -27,8 +21,8 @@ import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -274,4 +268,30 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
            return Envelop.getError(e.getMessage());
        }
    }
    /**
     * 根据居民code和标签code获取康复计划
     *
     * @param patient
     * @param label
     * @return
     */
    @GetMapping(value = SpecialistMapping.rehabilitation.selectByLabelAndPatient)
    @ApiOperation(value = "根据标签获取康复计划")
    public MixEnvelop selectByLabelAndPatient(@ApiParam(name = "patient", value = "居民code")
                                                 @RequestParam(required = true)String patient,
                                                 @ApiParam(name = "label", value = "标签code")
                                                 @RequestParam(required = false)String label){
        try {
            MixEnvelop envelop = new MixEnvelop();
            List<PatientRehabilitationPlanDO> planDOS = rehabilitationPlanService.selectByLabelAndPatient(patient,label);
            envelop.setDetailModelList(planDOS);
            return envelop;
        } catch (Exception e) {
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistPatientRelationDao.java

@ -14,7 +14,7 @@ public interface SpecialistPatientRelationDao extends PagingAndSortingRepository
        JpaSpecificationExecutor<SpecialistPatientRelationDO> {
    public List<SpecialistPatientRelationDO> findByDoctorAndStatus(String doctor,String status);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2 and p.status>=0")
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and p.patient =?2 and p.status>=0 and p.signStatus=1")
    public SpecialistPatientRelationDO findByDoctorAndPatient(String doctor,String patient);
    @Query("select p from SpecialistPatientRelationDO p where p.doctor=?1 and (p.patient=?2 or p.healthAssistant=?2) and p.signStatus='1' and p.status>=0 ")

+ 3 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/PatientRehabilitationPlanDao.java

@ -37,4 +37,7 @@ public interface PatientRehabilitationPlanDao extends PagingAndSortingRepository
    @Query("select count(distinct p.patient) from PatientRehabilitationPlanDO p where p.createUser=?1  and p.status=1 ")
    Integer patientCountByUnfinish(String doctorCode);
    @Query("select p from PatientRehabilitationPlanDO p where p.disease =?1 and p.status=1 and p.patient=?2")
    List<PatientRehabilitationPlanDO> selectByDiseaseAndPatient(String disease,String patient);
}

+ 4 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -227,7 +227,7 @@ public class SpecialistService{
                "  t.label_type = '8' " +
                " AND t.`status` = '1' " +
                " ) h ON h.patient = lb.patient " +
                " WHERE s.doctor ='"+doctor+"' AND s.status >=0  AND s.sign_status >0"+
                " WHERE ( s.doctor ='"+doctor+"' OR s.health_doctor='"+doctor+"') AND s.status >=0  AND s.sign_status >0"+
                " LIMIT "+(page-1)*size+","+size;
        
        if("7".equals(labelType)){
@ -246,8 +246,8 @@ public class SpecialistService{
                    "JOIN "+basedb+".wlyy_patient_disease_server b ON a.id=b.specialist_relation_code AND b.disease=" +labelCode+" and b.del=1 "+
                    "JOIN "+basedb+".wlyy_patient c ON a.patient=c.CODE " +
                    "LEFT JOIN "+basedb+".wlyy_sign_patient_label_info d ON a.patient=d.patient AND d.label_type=8 AND d.`status`=1" +
                    " WHERE a.sign_status> 0 AND a.`status`>=0 AND a.doctor='"+doctor+"'"+
                    " LIMIT "+(page-1)*size+","+size;
                    " WHERE a.sign_status> 0 AND a.`status`>=0 AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
                    "' LIMIT "+(page-1)*size+","+size;
        }
@ -572,6 +572,7 @@ public class SpecialistService{
    public MixEnvelop findPatientSignSpecialist(String patient){
        String sql = "SELECT " +
                " r.id AS relationCode, " +
                " r.patient, " +
                " r.team_code AS teamCode," +
                " r.patient_name AS patientName, " +

+ 14 - 22
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

@ -1,24 +1,12 @@
package com.yihu.jw.service.rehabilitation;
import com.yihu.jw.dao.rehabilitation.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationDetailDao;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.jw.dao.rehabilitation.*;
import com.yihu.jw.entity.rehabilitation.RehabilitationPlanningDO;
import com.yihu.jw.dao.rehabilitation.RehabilitationPlanTemplateDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationTemplateDetailDao;
import com.yihu.jw.entity.specialist.HospitalServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationPlanTemplateDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationTemplateDetailDO;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.specialist.PatientSignInfoVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -28,13 +16,10 @@ import com.yihu.jw.service.FileUploadService;
import com.yihu.jw.service.SpecialistHospitalServiceItemService;
import com.yihu.jw.service.SpecialistService;
import com.yihu.jw.util.HttpClientUtil;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.fastdfs.FastDFSUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
@ -42,11 +27,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
@ -399,4 +379,16 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        }
        return Envelop.getError("更新失败!");
    }
    /**
     * 根据标签和居民code查找康复计划
     *
     * @param patient
     * @param label
     * @return
     */
    public List<PatientRehabilitationPlanDO> selectByLabelAndPatient(String patient,String label){
        return patientRehabilitationPlanDao.selectByDiseaseAndPatient(label,patient);
    }
}