ソースを参照

Merge branch 'dev' of liuwenbin/patient-co-management into dev

trick9191 7 年 前
コミット
17c899f232

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/MvcConfig.java

@ -35,8 +35,8 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
    public void addInterceptors(InterceptorRegistry registry) {
        // 多个拦截器组成一个拦截器链
        // addPathPatterns 用于添加拦截规则
        // excludePathPatterns 用户排除拦截
        registry.addInterceptor(gateWayInterceptor).addPathPatterns("/wlyygc/**","/third/juye/kit/**").excludePathPatterns("/wlyygc/doctor/**", "/wlyygc/patient/**");
        // excludePathPatterns 用户排除拦截 ,/third/juye/kit/**
        registry.addInterceptor(gateWayInterceptor).addPathPatterns("/wlyygc/**").excludePathPatterns("/wlyygc/doctor/**", "/wlyygc/patient/**");
        registry.addInterceptor(doctorInterceptor).addPathPatterns("/doctor/**", "/statistics/province/**", "/statistics/**", "wlyygc/doctor/**");
        registry.addInterceptor(patientInterceptor).addPathPatterns("/patient/**", "/wlyygc/patient/**");

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/kit/KitDrugUseRecordDao.java

@ -20,6 +20,9 @@ public interface KitDrugUseRecordDao extends PagingAndSortingRepository<KitDrugU
    @Query(" select count(1) from KitDrugUseRecord u where u.patientCode=?1 and u.useDrugStatus=?2 and u.deviceSn=?3 and u.useTime>=?4 and u.useTime<=?5")
    int findStatisticsCount(String patientCode,Integer useDrugStatus,String deviceSn,Date monthStart,Date monthEnd);
    @Query(" select count(1) from KitDrugUseRecord u where u.patientCode=?1 and u.useDrugStatus=?2 and u.useTime>=?3 and u.useTime<=?4")
    int findStatisticsCount(String patientCode,Integer useDrugStatus,Date monthStart,Date monthEnd);
    @Query(value = " select u.* from kit_drug_use_record u where u.patient_code=?1 and u.use_drug_status=?2 and u.device_sn=?3 and u.use_time>=?4 and u.use_time<=?5 order by DATE_FORMAT(u.use_time,'%c-%d') desc,u.use_drug_status desc",nativeQuery = true)
    List<KitDrugUseRecord> findStatistics(String patientCode,Integer useDrugStatus,String deviceSn,Date monthStart,Date monthEnd);

+ 13 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/kit/KitService.java

@ -376,9 +376,19 @@ public class KitService extends BaseService {
//        Date monthEnd = new Date();
        Date monthStart = DateUtil.strToDate(month,"yyyy-MM");
        Date monthEnd = DateUtil.strToDate(DateUtil.getLastDayOfMonthThisDate(monthStart)+" 23:59:59");
        Integer onTimeCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,1,deviceSn,monthStart,monthEnd);//按时次数
        Integer overTimeCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,2,deviceSn,monthStart,monthEnd);//超时次数
        Integer leakageCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,3,deviceSn,monthStart,monthEnd);//漏用次数
        Integer onTimeCount = null;
        Integer overTimeCount = null;
        Integer leakageCount = null;
        if(StringUtils.isEmpty(deviceSn)){
            onTimeCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,1,monthStart,monthEnd);//按时次数
            overTimeCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,2,monthStart,monthEnd);//超时次数
            leakageCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,3,monthStart,monthEnd);//漏用次数
        }else{
            onTimeCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,1,deviceSn,monthStart,monthEnd);//按时次数
            overTimeCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,2,deviceSn,monthStart,monthEnd);//超时次数
            leakageCount = kitDrugUseRecordDao.findStatisticsCount(patientCode,3,deviceSn,monthStart,monthEnd);//漏用次数
        }
        Specification specification = new Specification<KitDrugUseRecord>() {
            @Override
            public Predicate toPredicate(Root<KitDrugUseRecord> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {

+ 1 - 3
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -172,7 +172,5 @@ ylz:
  gateway:
    url: http://www.mstpay.com:1300/huangsb
juye:
#  url: http://api.zayata.com/index.php?s=/Company/Device/
  url: zayata.ocip.net:30080/index.php?s=/Company/Device/
  token: YTgzYjc2YWIzZjdjOTA1MTE0ODY2YjcyOGNkYWFmZWR6YXlhdGFjb21wYW55
  url: http://zayata.oicp.net:30080/index.php?s=/Company/Device/
  companyCode: 86350206000000001