Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

hill9868 6 anni fa
parent
commit
fc92005177

+ 5 - 5
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientDiagnosisInformationDO.java

@ -43,7 +43,7 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
    @Column(name = "advice")
    private String advice;//医嘱小结
    @Column(name = "discharge_time")
    private Date dischargerTime;
    private Date dischargeTime;
    @Column(name = "create_time")
    protected Date createTime;//创建时间
    @Column(name = "create_user")
@ -147,12 +147,12 @@ public class PatientDiagnosisInformationDO extends UuidIdentityEntity implements
        this.advice = advice;
    }
    public Date getDischargerTime() {
        return dischargerTime;
    public Date getDischargeTime() {
        return dischargeTime;
    }
    public void setDischargerTime(Date dischargerTime) {
        this.dischargerTime = dischargerTime;
    public void setDischargeTime(Date dischargeTime) {
        this.dischargeTime = dischargeTime;
    }
    public Date getCreateTime() {

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

@ -1376,6 +1376,7 @@ public class CreditsDetailService extends BaseJpaService<CreditsDetailDO,Creditt
                    creditsDetailDO.setIntegrate(object.getDouble("integrate").intValue());
                    creditsDetailDO.setCreateTime(new Date());
                    creditsDetailDO.setUpdateTime(new Date());
                    creditsDetailDO.setHospitalName(hospitalName);
                    creditsDetailDO.setSaasId("dev");
                    creditsDetailDO.setId(getCode());
                    creditsDetailDO.setCoupon(0);

+ 3 - 3
svr/svr-wlyy-health-bank/src/main/resources/bootstrap.yml

@ -12,7 +12,7 @@ spring:
  profiles: jwdev
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
@ -20,7 +20,7 @@ spring:
  profiles: jwtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
@ -29,5 +29,5 @@ spring:
  profiles: prod
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.120.153:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:prod}

+ 2 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -168,10 +168,11 @@ public class SpecialistController extends EnvelopRestEndpoint {
    @ApiOperation(value = "搜索专科医生居民")
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true)String doctor,
                                                                @ApiParam(name = "nameKey", value = "居民姓名模糊") @RequestParam(required = false)String nameKey,
                                                                @ApiParam(name = "teamCode", value = "医生当前所在团队") @RequestParam(required = true) String teamCode,
                                                                @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                                @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size) {
        try {
            return specialistService.getDoctorPatientByName(doctor,nameKey,page,size);
            return specialistService.getDoctorPatientByName(doctor,nameKey,teamCode,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 6 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/DiagnosisInformationController.java

@ -1,5 +1,6 @@
package com.yihu.jw.controller.rehabilitation;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.specialist.rehabilitation.PatientDiagnosisInformationDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationPlanTemplateDO;
import com.yihu.jw.restmodel.web.Envelop;
@ -14,6 +15,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.sleuth.Tracer;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
/**
 * Created by humingfen on 2019/2/11.
 */
@ -32,7 +35,9 @@ public class DiagnosisInformationController extends EnvelopRestEndpoint {
    public Envelop createDiagnosisInformation(@ApiParam(name = "diagnosisInformationJson", value = "实体JSON")
                                                       @RequestParam(value = "diagnosisInformationJson")String diagnosisInformationJson){
        try {
            PatientDiagnosisInformationDO diagnosisInformationDO = toEntity(diagnosisInformationJson, PatientDiagnosisInformationDO.class);
            ObjectMapper objectMapper = new ObjectMapper();
            objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
            PatientDiagnosisInformationDO diagnosisInformationDO = objectMapper.readValue(diagnosisInformationJson, PatientDiagnosisInformationDO.class);
            return diagnosisInformationService.createDiagnosisInformation(diagnosisInformationDO);
        }catch (Exception e){
            e.printStackTrace();

+ 11 - 11
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -76,10 +76,10 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetail)
    @ApiOperation(value = "康复管理-康复计划按日历展示")
    public ObjEnvelop calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                          @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                          @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                          @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
    public ObjEnvelop calendarPlanDetail(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)")
                                          @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
                                          @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)")
                                          @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
                                          @ApiParam(name = "planId", value = "计划id", required = true)
                                          @RequestParam(value = "planId", required = true)String planId,
                                          @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)", required = false)
@ -99,17 +99,17 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetailList)
    @ApiOperation(value = "康复管理-康复计划按列表展示")
    public ObjEnvelop calendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeStartTime", required = true)String executeStartTime,
                                         @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)", required = true)
                                         @RequestParam(value = "executeEndTime", required = true)String executeEndTime,
    public ObjEnvelop calendarPlanDetailList(@ApiParam(name = "executeStartTime", value = "日历开始时间(格式:yyyy-MM-dd HH:mm:ss)")
                                         @RequestParam(value = "executeStartTime", required = false)String executeStartTime,
                                         @ApiParam(name = "executeEndTime", value = "日历结束时间(格式:yyyy-MM-dd HH:mm:ss)")
                                         @RequestParam(value = "executeEndTime", required = false)String executeEndTime,
                                         @ApiParam(name = "planId", value = "计划id", required = true)
                                         @RequestParam(value = "planId", required = true)String planId,
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)", required = false)
                                         @ApiParam(name = "searchTask", value = "快速查找任务:(1、我的任务,2、健康教育,3、健康指导,4、随访,5、复诊)")
                                         @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                         @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)")
                                         @RequestParam(value = "status", required = false)Integer status,
                                         @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                         @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)")
                                         @RequestParam(value = "doctorCode", required = false)String doctorCode){
        try {
            return rehabilitationManageService.calendarPlanDetailList(planId,searchTask,status,doctorCode,executeStartTime,executeEndTime);

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

@ -15,6 +15,6 @@ public interface PatientDiagnosisInformationDao extends PagingAndSortingReposito
    PatientDiagnosisInformationDO findByPlanId(String planId);
    @Query("select d from PatientDiagnosisInformationDO d where d.patient = ?1 order by d.dischargerTime desc")
    @Query("select d from PatientDiagnosisInformationDO d where d.patient = ?1 order by d.dischargeTime desc")
    Page<PatientDiagnosisInformationDO> findByPatient(String patient, Pageable pageRequest);
}

+ 9 - 20
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -221,8 +221,7 @@ public class SpecialistService{
                " ) lb " +
                " JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient " +
                " WHERE s.doctor in " +
                "  (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
                " WHERE s.team_code ='" +teamCode+"' "+
                " AND s.status >=0  AND s.sign_status >0"+
                " LIMIT "+(page-1)*size+","+size;
        System.out.print("日志:"+sql);
@ -244,8 +243,7 @@ public class SpecialistService{
                    "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+"' OR a.health_assistant= '"+doctor+
                    " AND a.doctor in " +
                    " (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
                    " AND a.team_code ='" +teamCode+"' "+
                    " LIMIT "+(page-1)*size+","+size;
        }
        List<PatientLabelVO> PatientLabelVOs = jdbcTemplate.query(sql,new BeanPropertyRowMapper(PatientLabelVO.class));
@ -256,24 +254,14 @@ public class SpecialistService{
        String sql = "SELECT " +
                " COUNT(1) as total " +
                " FROM " +
//                " ( " +
//                "  SELECT " +
//                "   i.label_type AS labelType, " +
//                "   i.label, " +
//                "   i.label_name AS labelName, " +
//                "   i.patient " +
//                "  FROM " +
                "   "+basedb+".wlyy_sign_patient_label_info i " +
                "  WHERE " +
                "   i.label = '"+label+"' "+
                "  AND i.label_type = '"+labelType+"' " +
                "  AND i.`status` = '1' " +
                " AND i.patient in ( " +
                " select patient from  wlyy_specialist_patient_relation  WHERE doctor in" +
                "  (SELECT m.doctor_code FROM  wlyy.wlyy_admin_team_member m where m.team_id ='" +teamCode+"') "+
               /* "*//*( doctor = '"+doctor+"' OR health_doctor = '"+doctor+"' OR health_assistant='"+doctor+ "' ) *//*" +*/
                " select patient from  wlyy_specialist_patient_relation  WHERE team_code ='" +teamCode+"' "+
                " AND STATUS >= 0 AND sign_status > 0 )";
//                +" ) lb ";
        System.out.print("日志:"+sql);
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
@ -295,7 +283,7 @@ public class SpecialistService{
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,count);
    }
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(String doctor, String nameKey, Integer page, Integer size){
    public MixEnvelop<PatientRelationVO, PatientRelationVO> getDoctorPatientByName(String doctor, String nameKey,String teamCode, Integer page, Integer size){
        String sql ="SELECT " +
                " p.code AS patient, " +
                " p.`name` AS patientName, " +
@ -319,7 +307,8 @@ public class SpecialistService{
                " AND t.`status` = '1' " +
                " ) h ON h.patient = r.patient " +
                " WHERE " +
                " r.doctor='"+doctor+"' " +
                " r.doctor IN ( SELECT m.doctor_code FROM wlyy.wlyy_admin_team_member m WHERE m.team_id ='" +teamCode+
                "' ) " +
                " AND r.status >=0  AND r.sign_status >0 " +
                " AND r.patient_name LIKE '%"+nameKey+"%' "+
                " LIMIT "+(page-1)*size+","+size;
@ -1041,7 +1030,7 @@ public class SpecialistService{
     */
    public ObjEnvelop<SpecialistPatientRelationDO> createPatientInSpeciaRelation(SpecialistPatientRelationDO specialistPatientRelationDO) throws Exception {
        if(StringUtils.isNotEmpty(specialistPatientRelationDO.getId())){
            //获取
            //获取专科相关的信息
            Map<String,Object> m=  getMessageByRelationId(specialistPatientRelationDO.getId());
            if(null!=m){
                updateMessageByRelationId(specialistPatientRelationDO.getId());
@ -1184,7 +1173,7 @@ public class SpecialistService{
     * @return
     */
    public Map<String,Object> getMessageByRelationId(String relationId){
        String sql = "select w.* from wlyy_message w where w.type='16' and  w.relation_code='" + relationId + "' ";
        String sql = "select w.* from wlyy.wlyy_message w where w.type='16' and  w.relation_code='" + relationId + "' ";
       List<Map<String,Object>> res= jdbcTemplate.queryForList(sql);
       if(null!=res&&res.size()>0){
           return res.get(0);
@ -1198,7 +1187,7 @@ public class SpecialistService{
     * @return
     */
    public void updateMessageByRelationId(String relationId){
        String sql = "update wlyy_message set has_read=0 ,over=0  where relation_code='" + relationId + "' ";
        String sql = "update wlyy.wlyy_message set has_read=0 ,over=0  where relation_code='" + relationId + "' ";
        jdbcTemplate.execute(sql);
    }
}

+ 15 - 3
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -331,7 +331,13 @@ public class RehabilitationManageService {
        String sql = " select d.* from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_hospital_service_item h on d.hospital_service_item_id = h.id "+
                " LEFT JOIN wlyy_service_item i on i.id = h.service_item_id " +
                " where d.execute_time>='"+executeStartTime+"' and d.execute_time<='"+executeEndTime+"' and d.plan_id='"+planId+"' " ;
                " where  d.plan_id='"+planId+"' " ;
        if(StringUtils.isNotBlank(executeStartTime)){
            sql += " and d.execute_time>='"+executeStartTime+"' ";
        }
        if(StringUtils.isNotBlank(executeEndTime)){
            sql += " and d.execute_time<='"+executeEndTime+"' ";
        }
        if(searchTask!=null){
            if(searchTask==1){
                sql+=" and d.doctor='"+doctorCode+"' " ;
@ -344,10 +350,10 @@ public class RehabilitationManageService {
        if(status!=null){
            sql+= " and d.status="+status;
        }
        sql += " ORDER BY d.execute_time ";
        List<Map<String,Object>> rehabilitationDetailList = jdbcTemplate.queryForList(sql);
//        List<RehabilitationDetailDO> rehabilitationDetailList = rehabilitationDetailDao.findByPlanId(DateUtil.strToDate(executeStartTime),DateUtil.strToDate(executeEndTime),planId);
        Map<String,Map<String,Object>> map = new HashMap<>();
        Map<String,Map<String,Object>> map = new LinkedHashMap<>();
        for(Map<String,Object> one:rehabilitationDetailList){
            String executeTime = DateUtil.dateToStr((Date) one.get("execute_time"),DateUtil.YYYY_MM_DD);
            Map<String,Object> m = null;
@ -433,6 +439,12 @@ public class RehabilitationManageService {
            }
            map.put(executeTime,m);
        }
        /*List list = new ArrayList();
        for(String key : map.keySet()){
            Map<String,Object> result = map.get(key);
            result.put("executeTime", key);
            list.add(result);
        }*/
        return ObjEnvelop.getSuccess(SpecialistMapping.api_success,map);
    }

+ 3 - 3
svr/svr-wlyy-specialist/src/main/resources/bootstrap.yml

@ -12,7 +12,7 @@ spring:
  profiles: jwdev
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
@ -20,7 +20,7 @@ spring:
  profiles: jwtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
@ -28,7 +28,7 @@ spring:
  profiles: jwdevtest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---