Переглянути джерело

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

wangzhinan 1 рік тому
батько
коміт
c614a7d641

+ 1 - 2
business/base-service/src/main/java/com/yihu/jw/dailyReport/service/DailyReportUploadService.java

@ -22,7 +22,6 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.file.FileUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.WxPushLogDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
@ -343,7 +342,7 @@ public class DailyReportUploadService {
            }
        }
        report_date = DateUtil.getStringDateShort();
//        report_date = DateUtil.getStringDateShort();
        week_name = DateUtil.getWeekStr(report_date);
        BaseDailyReportUploadDO dailyReportUploadDO = dailyReportUploadDao.findByDoctorIdAndReportDate(doctorId,report_date);

+ 75 - 0
business/base-service/src/main/java/com/yihu/jw/device/dao/PatientDeviceDao.java

@ -0,0 +1,75 @@
package com.yihu.jw.device.dao;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface PatientDeviceDao extends JpaRepository<DevicePatientDevice, Long>, JpaSpecificationExecutor<DevicePatientDevice> {
    @Query("select a from DevicePatientDevice a where a.user = ?1 ")
    Iterable<DevicePatientDevice> findByUser(String user);
    @Query("select a from DevicePatientDevice a where a.del = 0 ")
    List<DevicePatientDevice> findByAll();
    @Query("select a from DevicePatientDevice a where a.user = ?1 ")
    List<DevicePatientDevice> findByPatient(String user);
    @Query("select a from DevicePatientDevice a where a.user = ?1 and a.del=0 and a.deviceName like '%药盒%'")
    List<DevicePatientDevice> findByPatientAndDel(String user);
    @Query("select a from DevicePatientDevice a where a.user = ?1 and a.deviceSn=?2 ")
    List<DevicePatientDevice> findByPatientAndDeviceSn(String user, String deviceSn);
    List<DevicePatientDevice> findByUser(String user, Pageable pageRequest);
    List<DevicePatientDevice> findByUserAndDoctor(String user, String doctor, Pageable pageRequest);
    List<DevicePatientDevice> findByDeviceSnAndCategoryCode(String deviceSn, String categoryCode);
    DevicePatientDevice findByDeviceSnAndCategoryCodeAndUserType(String deviceSn, String categoryCode, String userType);
    DevicePatientDevice findByDeviceIdAndDeviceSnAndUserType(Long deviceId, String deviceSn, String userType);
    DevicePatientDevice findByDeviceSnAndUserType(String deviceSn, String userType);
    @Query("select pd from DevicePatientDevice pd where pd.deviceSn = ?1 and pd.del=0")
    List<DevicePatientDevice> findByDeviceSn(String deviceSn);
    //更换患者绑定的血糖仪
    @Modifying
    @Query("update DevicePatientDevice t set t.deviceSn = ?3 , t.userType = ?4,t.sim=?5,t.hospital=?6,t.hospitalName=?7,t.checkDoctorName=?8 where t.user = ?1 and t.deviceSn = ?2 ")
    int updatePatientDevice(String user, String deviceSN, String newDeviceSN, String userType, String sim, String hospital, String hospitalName, String checkDoctorName);
    //管理员解绑居民设备
    @Modifying
    @Query("update DevicePatientDevice t set t.del = 1  where t.deviceSn = ?1 and t.del =0  ")
    int updatePatientDevice(String deviceSN);
    @Query("select a from DevicePatientDevice a")
    List<DevicePatientDevice> findAll();
    @Query("select a from DevicePatientDevice a group by a.user")
    List<DevicePatientDevice> findAllGroupUser();
    @Query("select a from DevicePatientDevice a where a.categoryCode = ?1 and a.del=0 group by a.user")
    List<DevicePatientDevice> findAllByCategoryCode(String categoryCode);
    @Modifying
    @Query("delete DevicePatientDevice a where a.deviceSn = ?1")
    int deleteByDeviceSn(String deviceSN);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.del=0")
    List<DevicePatientDevice> findAllByUser(String user);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.categoryCode =?2 and a.del=0")
    List<DevicePatientDevice> findAllByUserAndCategoryCode(String user,String categoryCode);
    @Query("select a from DevicePatientDevice a where a.user=?1 and a.categoryCode =?2 and a.del=0")
    List<DevicePatientDevice> findByUserAndCategoryCode(String user,String categoryCode);
}

+ 12 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/SpecialistPatientRelationDO.java

@ -104,6 +104,18 @@ public class SpecialistPatientRelationDO extends UuidIdentityEntity implements S
    @Column(name = "relation_type")
    private String relationType;//relation_type
    @Column(name = "event_type")
    private String eventType;
    public String getEventType() {
        return eventType;
    }
    public void setEventType(String eventType) {
        this.eventType = eventType;
    }
    public String getIsdeal() {
        return isdeal;
    }

+ 46 - 46
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationPlanTemplateDO.java

@ -33,52 +33,52 @@ public class RehabilitationPlanTemplateDO extends UuidIdentityEntityWithOperator
    }
    /**
     * 新增字段
     */
    @Column(name = "disease_id")
    private String diseaseId;//病种code
    @Column(name = "disease_name")
    private String diseaseName;
    @Column(name = "status")
    private String status;
    @Column(name = "type")
    private String type;
    public String getDiseaseId() {
        return diseaseId;
    }
    public void setDiseaseId(String diseaseId) {
        this.diseaseId = diseaseId;
    }
    public String getDiseaseName() {
        return diseaseName;
    }
    public void setDiseaseName(String diseaseName) {
        this.diseaseName = diseaseName;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
//    /**
//     * 新增字段
//     */
//    @Column(name = "disease_id")
//    private String diseaseId;//病种code
//
//    @Column(name = "disease_name")
//    private String diseaseName;
//selectAllCompleteServiceItemsByPatient
//    @Column(name = "status")
//    private String status;
//
//    @Column(name = "type")
//    private String type;
//    public String getDiseaseId() {
//        return diseaseId;
//    }
//
//    public void setDiseaseId(String diseaseId) {
//        this.diseaseId = diseaseId;
//    }
//
//    public String getDiseaseName() {
//        return diseaseName;
//    }
//
//    public void setDiseaseName(String diseaseName) {
//        this.diseaseName = diseaseName;
//    }
//
//    public String getStatus() {
//        return status;
//    }
//
//    public void setStatus(String status) {
//        this.status = status;
//    }
//
//    public String getType() {
//        return type;
//    }
//
//    public void setType(String type) {
//        this.type = type;
//    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;

+ 111 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/config/WebConfig.java

@ -0,0 +1,111 @@
//package com.yihu.jw.gateway.config;
//
//import com.yihu.jw.gateway.filter.CorsInterceptor;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.format.FormatterRegistry;
//import org.springframework.http.converter.HttpMessageConverter;
//import org.springframework.validation.MessageCodesResolver;
//import org.springframework.validation.Validator;
//import org.springframework.web.method.support.HandlerMethodArgumentResolver;
//import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
//import org.springframework.web.servlet.HandlerExceptionResolver;
//import org.springframework.web.servlet.config.annotation.*;
//
//import java.util.List;
//
///**
// * Created by yeshijie on 2024/1/31.
// */
//@Configuration
//public class WebConfig implements WebMvcConfigurer{
//
//    @Override
//    public void configurePathMatch(PathMatchConfigurer configurer) {
//
//    }
//
//    @Override
//    public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
//
//    }
//
//    @Override
//    public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
//
//    }
//
//    @Override
//    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
//
//    }
//
//    @Override
//    public void addFormatters(FormatterRegistry registry) {
//
//    }
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new CorsInterceptor()).addPathPatterns("/**");
//    }
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//
//    }
//
//    @Override
//    public void addCorsMappings(CorsRegistry registry) {
//
//    }
//
//    @Override
//    public void addViewControllers(ViewControllerRegistry registry) {
//
//    }
//
//    @Override
//    public void configureViewResolvers(ViewResolverRegistry registry) {
//
//    }
//
//    @Override
//    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
//
//    }
//
//    @Override
//    public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
//
//    }
//
//    @Override
//    public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//
//    }
//
//    @Override
//    public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
//
//    }
//
//    @Override
//    public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
//
//    }
//
//    @Override
//    public void extendHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) {
//
//    }
//
//    @Override
//    public Validator getValidator() {
//        return null;
//    }
//
//    @Override
//    public MessageCodesResolver getMessageCodesResolver() {
//        return null;
//    }
//}

+ 31 - 0
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/CorsInterceptor.java

@ -0,0 +1,31 @@
//package com.yihu.jw.gateway.filter;
//
//import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
///**
// * Created by yeshijie on 2024/1/31.
// */
//public class CorsInterceptor extends HandlerInterceptorAdapter{
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
//                             Object handler) throws Exception {
//        // 允许跨域 https://yyfbxt.szhz.hangzhou.gov.cn:8068/
//        response.addHeader("Access-Control-Allow-Origin", "*");
//        // 允许前端携带cookie:启用此项后,上面的域名不能为'*',必须指定具体的域名
//        // response.addHeader("Access-Control-Allow-Credentials", "true");
//        // 允许跨域的方法
//        response.addHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT,PATCH, HEAD");
//        // 允许跨域的头
//        response.addHeader("Access-Control-Allow-Headers", "Content-Type, X-Requested-With");
//        // 跨域的有效期,在有效期内,无需检查跨域问题
//        response.addHeader("Access-Control-Max-Age", "3600");
//
//        // 该字段可选。CORS请求时,XMLHttpRequest对象的getResponseHeader()方法只能拿到6个基本字段:Cache-Control、Content-Language、Content-Type、Expires、Last-Modified、Pragma。如果想拿到其他字段,就必须在Access-Control-Expose-Headers里面指定。
//        // response.addHeader("Access-Control-Expose-Headers", "XXX");
//
//        return super.preHandle(request, response, handler);
//    }
//}

+ 4 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/controller/DeviceUploadController.java

@ -7,7 +7,10 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;

+ 22 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/iot/service/IotDeviceService.java

@ -48,6 +48,28 @@ public class IotDeviceService {
    private static String iotHospital = "350211A1049";
    private static String iotHospitalName = "厦门医学院附属海沧医院";
    //设备状态信息上传
    @Transactional
    public String uploadDeviceThird(String jsonData,String type){
        Map<String,String> header = new HashMap<>();
//        String jsonData = "{\"deviceSn\":\"xty_hcyy\",\"deviceModel\":\"测试\",\"name\":\"血糖仪TEST\",\"hospital\":\""+iotHospital+"\"," +
//                "\"hospitalName\":\""+iotHospitalName+"\",\"categoryCode\":\"2\",\"categoryName\":\" 血糖仪\",\"commonName\":\" 血糖仪\"," +
//                "\"combinationMethod\":\"1\",\"networkTransmission\":\" 11\",\"deviceUse\":\"2\",\"dropLocation\":\"2\",\"dataAcquisition\":" +
//                "\"IoT_equipment_blood_glucose_mete\",\"companyName\":\"血糖仪厂商名称\",\"companyType\":\"3\"}";
        Map<String,String> params = new HashMap<>();
        params.put("jsonData",jsonData);
        header.put("accesstoken",getAccessToken());
        String content = "";
        if("uploadDeviceInfo".equals(type)){
            content = "设备状态信息上传";
        }else if("uploadDeviceData".equals(type)){
            content = "设备业务数据信息上传";
        }else if("deviceRegistration".equals(type)){
            content = "设备相关基础信息注册";
        }
        String response = sdkRunnerService.post("wlw/"+type,content,params,header,true,true);
        return response;
    }
    //设备状态信息上传
    @Transactional

+ 43 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/third/IotDeviceThirdController.java

@ -0,0 +1,43 @@
package com.yihu.jw.hospital.module.third;
import com.yihu.jw.hospital.module.iot.service.IotDeviceService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by yeshijie on 2024/2/19.
 */
@RestController
@RequestMapping(value ="/open/gc/iotDevice")
@Api(value = "物联网设备-对外", description = "物联网设备-对外", tags = {"物联网设备-对外"})
public class IotDeviceThirdController extends EnvelopRestEndpoint {
    @Autowired
    private IotDeviceService iotDeviceService;
    @PostMapping(value = "/uploadDeviceThird")
    @ApiOperation(value = "设备状态信息上传物联网平台")
    public Envelop uploadDeviceThird(String jsonData,String type) {
        try {
            if(StringUtils.isBlank(type)){
                return Envelop.getError("参数错误,type不能为空");
            }
            if(jsonData==null){
                return Envelop.getError("参数错误,jsonData不能为空");
            }
            return success(iotDeviceService.uploadDeviceThird(jsonData,type));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("上传失败");
        }
    }
}

BIN
svr/svr-visit-behind/src/main/resources/libzoecrypto.so


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

@ -78,20 +78,15 @@ public class RehabilitationManageController {
    @GetMapping(value = SpecialistMapping.rehabilitation.calendarPlanDetail)
    @ApiOperation(value = "康复管理-康复计划按日历展示")
    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康复指导,6康复随访,7康复复诊)", required = false)
                                          @RequestParam(value = "searchTask", required = false)Integer searchTask,
                                          @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false)
                                          @RequestParam(value = "status", required = false)Integer status,
                                          @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false)
                                          @RequestParam(value = "doctorCode", required = false)String doctorCode,
                                          @ApiParam(name="taskExecutor",value = "任务执行人:0全部;1我的任务:2他人任务",required = false)
                                          @RequestParam(value = "taskExecutor",required = false,defaultValue = "0")String taskExecutor){
    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康复指导,6康复随访,7康复复诊)", required = false) @RequestParam(value = "searchTask", required = false)Integer searchTask,
            @ApiParam(name = "status", value = "任务状态(0未完成,1已完成,2已预约)", required = false) @RequestParam(value = "status", required = false)Integer status,
            @ApiParam(name = "doctorCode", value = "医生code(专科医生、家庭医生)", required = false) @RequestParam(value = "doctorCode", required = false)String doctorCode,
            @ApiParam(name="taskExecutor",value = "任务执行人:0全部;1我的任务:2他人任务",required = false) @RequestParam(value = "taskExecutor",required = false,defaultValue = "0")String taskExecutor
    ){
        try {
            return rehabilitationManageService.calendarPlanDetail(executeStartTime,executeEndTime,planId,searchTask,status,doctorCode,taskExecutor);
        }catch (Exception e){

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

@ -38,4 +38,5 @@ public interface SpecialistPatientRelationDao extends PagingAndSortingRepository
    @Query("select p from SpecialistPatientRelationDO p where p.teamCode=?1 and p.patient=?2 and p.status>=0 and p.status >=0 and p.signStatus=1")
    List<SpecialistPatientRelationDO> findListByTeamAndPatient(Integer teamCode,String patient);
}

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

@ -1427,12 +1427,29 @@ public class RehabilitationManageService {
        Integer allCount = rehabilitationDetailDao.findAllByPlanId(planId);//计划总服务项目数
        Integer finishedCount = rehabilitationDetailDao.findByStatusAndPlanId(1, planId);
        PatientRehabilitationPlanDO p = patientRehabilitationPlanDao.findById(planId);
        SpecialistPatientRelationDO specialistPatientRelationDO;
        String eventType;
        if (StringUtils.isBlank(p.getEventType())) {
            eventType = "2";
        } else {
            eventType = p.getEventType();
        }
        SpecialistPatientRelationDO specialistPatientRelationDO = null;
        List<SpecialistPatientRelationDO> list;
        if (p.getTeamCode() != null) {
            specialistPatientRelationDO = specialistPatientRelationDao.findByTeamCodeAndPatient(p.getTeamCode(), p.getPatient());
            list = findRelation(String.valueOf(p.getTeamCode()), null, p.getPatient(), eventType);
//            specialistPatientRelationDO = specialistPatientRelationDao.findByTeamCodeAndPatient(p.getTeamCode(), p.getPatient());
        } else {
            specialistPatientRelationDO = specialistPatientRelationDao.findByDoctorAndPatient(p.getCreateUser(), p.getPatient());
            list = findRelation(null, p.getCreateUser(), p.getPatient(), eventType);
//            specialistPatientRelationDO = specialistPatientRelationDao.findByDoctorAndPatient(p.getCreateUser(), p.getPatient());
        }
        if (!list.isEmpty()) {
            specialistPatientRelationDO = list.get(0);
        }
        resultMap.put("allCount", allCount);
        resultMap.put("finishedCount", finishedCount);
        resultMap.put("specialistPatientRelationDO", specialistPatientRelationDO);
@ -1602,4 +1619,27 @@ public class RehabilitationManageService {
    public String getCode() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
    public List<SpecialistPatientRelationDO> findRelation(String teamCode, String doctor, String patient, String eventType) {
        String sql = " select * from wlyy_specialist_patient_relation p where p.status>=0 and p.sign_status=1 " +
                " and p.patient ='" + patient + "' ";
        if (StringUtils.isNotBlank(teamCode)) {
            sql += " and p.team_code='" + teamCode + "' ";
        }
        if (StringUtils.isNotBlank(doctor)) {
            sql += " AND p.doctor='" + doctor + "'";
        }
        if ("2".equals(eventType)) {
            sql += " and  (p.event_type='2'  or p.event_type is null or p.event_type='' ) ";
        } else {
            sql += " and  p.event_type='1'  ";
        }
        System.out.println("sql==>" + sql);
        List<SpecialistPatientRelationDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SpecialistPatientRelationDO.class));
        System.out.println("数据==>" + JSON.toJSONString(list));
        return list;
    }
}