Sfoglia il codice sorgente

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

trick9191 7 anni fa
parent
commit
f8e3ccf42b

+ 100 - 76
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java

@ -221,20 +221,24 @@ public class AsyncService extends BaseService{
     * 推送信息
     */
    private void sendMessage(String content, Patient patient, PatientHealthIndex model) {
        logger.info("======start sendMessage======");
        String patientCode = patient.getCode();
        // 消息接收者
        List<String> receivers = new ArrayList<String>();
        // 查询病人家庭签约的健康管理师
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patientCode);
        logger.info("签约对象--全科医生code===="+signFamily.getDoctor());
        String healthDoctorFamily = "";
        String doctorFamily = "";
        if (signFamily != null) {
            healthDoctorFamily = signFamily.getDoctorHealth();
            doctorFamily = signFamily.getDoctor();
            logger.info("全科医生code======"+doctorFamily);
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
                // 添加到消息接收人列表
                receivers.add(healthDoctorFamily);
            } else if (StringUtils.isNotEmpty(doctorFamily)){
            }
            if (StringUtils.isNotEmpty(doctorFamily)){
                // 添加到消息接收人列表
                receivers.add(doctorFamily);
            }
@ -248,7 +252,7 @@ public class AsyncService extends BaseService{
                // 添加到消息接收人列表
                receivers.add(healthDoctorTeam);
            }
            if (StringUtils.isNotEmpty(signFamilySS.getDoctor())){
            if (StringUtils.isNotEmpty(signFamilySS.getDoctor())&& !StringUtils.equals(doctorFamily, signFamilySS.getDoctor())){
                receivers.add(signFamilySS.getDoctor());
            }
        }
@ -292,6 +296,7 @@ public class AsyncService extends BaseService{
            }
        }
        // 批量保存消息
        logger.info("消息数量---"+messages.size());
        messageDao.save(messages);
        // 推送消息给医生
        pushMsgTask.put(array);
@ -459,6 +464,73 @@ public class AsyncService extends BaseService{
        }
    }
    /**
     * 设置
     * @param patient
     * @return
     */
    public int setTrackPatientByDoctor(String patient){
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);
        if(signFamily==null){
            return -1;
        }
        Patient p = patientDao.findByCode(patient);
        if(p==null){
            return -1;
        }
        //医生是否自动追踪居民
        DoctorSwitch sw =  doctorSwitchDao.findByDoctor(signFamily.getDoctor());
        DoctorSwitch swh =  doctorSwitchDao.findByDoctor(signFamily.getDoctorHealth());
        if(sw!=null){
            if("1".equals(sw.getAlertPatientSwitch())){
                //查询是否与医生建立重点跟踪关系,诺无关系则建立
                TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(signFamily.getDoctor(),patient);
                if(trackPatient == null){
                    TrackPatient t = new TrackPatient();
                    t.setCreateTime(new Date());
                    t.setDoctorCode(signFamily.getDoctor());
                    t.setDoctorName(signFamily.getDoctorName());
                    t.setIdcard(signFamily.getIdcard());
                    t.setSsc(signFamily.getSsc());
                    t.setTeamCode(signFamily.getAdminTeamId().intValue());
                    t.setPatientCode(patient);
                    t.setPatientName(p.getName());
                    t.setDel("1");
                    trackPatientDao.save(t);
                }else{
                    trackPatient.setDel("1");
                    trackPatientDao.save(trackPatient);
                }
            }
        }
        if(swh!=null){
            if("1".equals(swh.getAlertPatientSwitch())){
                //查询是否与医生建立重点跟踪关系,诺无关系则建立
                TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(signFamily.getDoctorHealth(),patient);
                if(trackPatient == null){
                    TrackPatient t = new TrackPatient();
                    t.setCreateTime(new Date());
                    t.setDoctorCode(signFamily.getDoctorHealth());
                    t.setDoctorName(signFamily.getDoctorHealthName());
                    t.setIdcard(signFamily.getIdcard());
                    t.setSsc(signFamily.getSsc());
                    t.setTeamCode(signFamily.getAdminTeamId().intValue());
                    t.setPatientCode(patient);
                    t.setPatientName(p.getName());
                    t.setDel("1");
                    trackPatientDao.save(t);
                }else{
                    trackPatient.setDel("1");
                    trackPatientDao.save(trackPatient);
                }
            }
        }
        return 1;
    }
    /**
     * 添加积分
     * @param deviceSn
@ -482,11 +554,11 @@ public class AsyncService extends BaseService{
                flagStr="GLU_MEASURE";
            }
            int dataUoloadCount = 0;
            PatientDevice patientDevice = patientDeviceDao.findByDeviceSnAndCategoryCodeAndUserType(deviceSn,type,userType);
            boolean dataUoloadCount = true;
            if (patientDevice!=null){
                String today = DateUtil.getStringDateShort();
                String startTime = today+" 00:00:00";
                /*String startTime = today+" 00:00:00";
                String endTime = today+" 23:59:59";
                int dateType =1;
                if (deviceType==1){
@ -496,19 +568,38 @@ public class AsyncService extends BaseService{
                }
                String countSql = "SELECT count(*) num FROM device.wlyy_patient_health_index where `user`='"+patientDevice.getUser()+"' and type = "+dateType+" AND record_date >'"+startTime+"' and record_date <= '"+endTime+"'";
                Map<String,Object> countMap = jdbcTemplate.queryForMap(countSql);
                dataUoloadCount = Integer.valueOf(String.valueOf(countMap.get("num")));
                dataUoloadCount = Integer.valueOf(String.valueOf(countMap.get("num")));*/
                //判断今天是否加过体征积分
                String urlSearch = wlyyService + "healthBank/selectByDate";
                List<NameValuePair> paramsSearch1 = new ArrayList<>();
                paramsSearch1.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\"BP_MEASURE\",\"startTime\":\""+today+"\",\"endTime\":\""+today+"\",\"patientId\":\""+patientCode+"\"}"));
                String responseSearch1 = HttpClientUtil.post(urlSearch, paramsSearch1, "UTF-8");
                List<NameValuePair> paramsSearch2 = new ArrayList<>();
                paramsSearch2.add(new BasicNameValuePair("objectStr", "{\"taskCode\":\"GLU_MEASURE\",\"startTime\":\""+today+"\",\"endTime\":\""+today+"\",\"patientId\":\""+patientCode+"\"}"));
                String responseSearch2 = HttpClientUtil.post(urlSearch, paramsSearch2, "UTF-8");
                com.alibaba.fastjson.JSONObject object1 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch1);
                com.alibaba.fastjson.JSONObject object2 = com.alibaba.fastjson.JSONObject.parseObject(responseSearch2);
                if(object1!=null && object2!=null){
                    com.alibaba.fastjson.JSONObject jsonObject1 = (com.alibaba.fastjson.JSONObject) object1.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    com.alibaba.fastjson.JSONObject jsonObject2 = (com.alibaba.fastjson.JSONObject) object2.getJSONObject("data").getJSONArray("detailModelList").get(0);
                    if (jsonObject1.getJSONArray("creditsDetailDOS").size()==0 && jsonObject2.getJSONArray("creditsDetailDOS").size()==0){
                        dataUoloadCount = false;
                    }
                }
                logger.info("今日测量数量:"+dataUoloadCount);
            }
            //增加积分
            if (dataUoloadCount == 0 && "350205".equals(hospital.substring(0,6))){
            if (!dataUoloadCount && "350205".equals(hospital.substring(0,6))){
                logger.info("体征增加积分入口--------");
                String sql = "select count(*) num from device.wlyy_devices where device_code = '"+deviceSn+"'";
                Map<String,Object> deviceCountMap = jdbcTemplate.queryForMap(sql);
                if (Integer.valueOf(String.valueOf(deviceCountMap.get("num")))>0){
                    logger.info("开始体征增加积分------");
                    String url = wlyyService + "healthBank/insertCredits";
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("creditsDetail", "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+patientCode+"\",\"hospital\":\"350205\"}"));
                    String response = HttpClientUtil.post(url, params, "UTF-8");
                    logger.info("增加积分返回结果"+response);
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
                    String status = jsonObject.getString("status");
                    if (!"200".equals(status)){
@ -517,7 +608,7 @@ public class AsyncService extends BaseService{
                }
            }
            //增加活跃度
            if (dataUoloadCount == 0){
            if (!dataUoloadCount){
                String url = wlyyService + "healthBank/createActiveRecord";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("activeRecord", "{\"taskCode\":\""+flagStr+"\",\"patientId\":\""+patientCode+"\"}"));
@ -534,73 +625,6 @@ public class AsyncService extends BaseService{
        }
    }
    /**
     * 设置
     * @param patient
     * @return
     */
    public int setTrackPatientByDoctor(String patient){
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);
        if(signFamily==null){
            return -1;
        }
        Patient p = patientDao.findByCode(patient);
        if(p==null){
            return -1;
        }
        //医生是否自动追踪居民
        DoctorSwitch sw =  doctorSwitchDao.findByDoctor(signFamily.getDoctor());
        DoctorSwitch swh =  doctorSwitchDao.findByDoctor(signFamily.getDoctorHealth());
        if(sw!=null){
            if("1".equals(sw.getAlertPatientSwitch())){
                //查询是否与医生建立重点跟踪关系,诺无关系则建立
                TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(signFamily.getDoctor(),patient);
                if(trackPatient == null){
                    TrackPatient t = new TrackPatient();
                    t.setCreateTime(new Date());
                    t.setDoctorCode(signFamily.getDoctor());
                    t.setDoctorName(signFamily.getDoctorName());
                    t.setIdcard(signFamily.getIdcard());
                    t.setSsc(signFamily.getSsc());
                    t.setTeamCode(signFamily.getAdminTeamId().intValue());
                    t.setPatientCode(patient);
                    t.setPatientName(p.getName());
                    t.setDel("1");
                    trackPatientDao.save(t);
                }else{
                    trackPatient.setDel("1");
                    trackPatientDao.save(trackPatient);
                }
            }
        }
        if(swh!=null){
            if("1".equals(swh.getAlertPatientSwitch())){
                //查询是否与医生建立重点跟踪关系,诺无关系则建立
                TrackPatient trackPatient = trackPatientDao.findByDoctorCodeAndPatientCode(signFamily.getDoctorHealth(),patient);
                if(trackPatient == null){
                    TrackPatient t = new TrackPatient();
                    t.setCreateTime(new Date());
                    t.setDoctorCode(signFamily.getDoctorHealth());
                    t.setDoctorName(signFamily.getDoctorHealthName());
                    t.setIdcard(signFamily.getIdcard());
                    t.setSsc(signFamily.getSsc());
                    t.setTeamCode(signFamily.getAdminTeamId().intValue());
                    t.setPatientCode(patient);
                    t.setPatientName(p.getName());
                    t.setDel("1");
                    trackPatientDao.save(t);
                }else{
                    trackPatient.setDel("1");
                    trackPatientDao.save(trackPatient);
                }
            }
        }
        return 1;
    }
    public int cancalTrackPatientByDoctor(String patient){
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patient);
        if(signFamily==null){

+ 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);

+ 36 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java

@ -19,6 +19,7 @@ import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +44,7 @@ public class CreditLogService {
    private Logger logger = LoggerFactory.getLogger(CreditLogService.class);
    private static String URL = "health:blank:url";
    private static String STEP = "health:blank:step";
    //    private String baseUrl = "http://192.168.131.24:8088/svr-iot/";
    @Autowired
@ -715,10 +717,14 @@ public class CreditLogService {
        SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
        String imptimeBegin = sdf.format(cal.getTime());
        List<String> timeList = new ArrayList<>();
        timeList.add(imptimeBegin);
        if (sdf.format(cal.getTime()).compareTo(sdf.format(sdf.parse("2018-08-01")))>=0){
            timeList.add(imptimeBegin);
        }
        for (int i =0;i<6;i++){
            cal.add(Calendar.DATE,1);
            timeList.add(sdf.format(cal.getTime()));
            if(sdf.format(cal.getTime()).compareTo(sdf.format(sdf.parse("2018-08-01")))>=0){
                timeList.add(sdf.format(cal.getTime()));
            }
        }
        logger.info("一周的日期:"+timeList.toString());
        StringBuffer buffer = new StringBuffer();
@ -729,8 +735,14 @@ public class CreditLogService {
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        logger.info("组装的sql"+buffer);
        String step = redisTemplate.opsForValue().get(STEP);
        if (StringUtils.isEmpty(step)){
            throw new Exception("获取步数失败!");
        }
        JSONObject object1 = JSONObject.parseObject(step);
        int step1 = object1.getInteger("step1");
        String sql = "select count(1) as total from (select * FROM wlyy_patient_aim_sports where DATE_FORMAT(create_time,'%Y-%m-%d') IN "+buffer +" and patientcode = '"+patientId+"'"+
                ") pas where pas.daily_step_count > 600";
                ") pas where pas.daily_step_count > "+step1;
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
@ -753,4 +765,25 @@ public class CreditLogService {
        logger.info("一周内超过6000的次数"+count);
        return JSONObject.parseObject(response);
    }
    public JSONObject selectByDate(JSONObject object) throws Exception {
        String response = null;
        String patientId = object.getString("patientId");
        Patient patient = patientDao.findByCode(patientId);
        if (patient == null){
            throw new Exception("该居民不存在");
        }
        String url =getBaseUrl()+ "selectByDate";
        //String url = "http://192.168.5.106:10051/svr-health-bank/selectByDate";
        Map<String,String> params = new HashMap<>();
        params.put("object",object.toJSONString());
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
}

+ 22 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/kit/KitService.java

@ -369,14 +369,26 @@ public class KitService extends BaseService {
     * 本月用药情况
     * @param useDrugStatus (1、按时,2、超时,3、漏用)
     */
    public Map<String,Object> currentMonthDrugUse(String patientCode,Integer useDrugStatus,String deviceSn) throws Exception{
    public Map<String,Object> currentMonthDrugUse(String patientCode,Integer useDrugStatus,String deviceSn,String month) throws Exception{
        Map<String,Object> resultMap = new HashMap<>();
        Date monthStart = DateUtil.strToDate(DateUtil.getFristDayOfMonthThisDate(new Date()));
        Date monthEnd = new Date();
        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);//漏用次数
//        Date monthStart = DateUtil.strToDate(DateUtil.getFristDayOfMonthThisDate(new Date()));
//        Date monthEnd = new Date();
        Date monthStart = DateUtil.strToDate(month,"yyyy-MM");
        Date monthEnd = DateUtil.strToDate(DateUtil.getLastDayOfMonthThisDate(monthStart)+" 23:59:59");
        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) {
@ -404,7 +416,7 @@ public class KitService extends BaseService {
        Map<String,Map<String,Object>> map = new LinkedHashMap<>();
        for(KitDrugUseRecord one:list){
            String dateStr = DateUtil.dateToStr(one.getUseTime(),"MM-dd");
            String dateStr = DateUtil.dateToStr(one.getUseTime(),"yyyy-MM-dd");
            Map<String,Object> oneMap = null;
            if(map.containsKey(dateStr)){
                oneMap = map.get(dateStr);
@ -437,8 +449,8 @@ public class KitService extends BaseService {
        Collections.sort(resultList, new Comparator<Map<String,Object>>() {
            @Override
            public int compare(Map<String,Object> o1, Map<String,Object> o2) {
                Long day1 =  DateUtil.strToDate(o1.get("day").toString(), "MM-dd").getTime();
                Long day2 =  DateUtil.strToDate(o2.get("day").toString(), "MM-dd").getTime();
                Long day1 =  DateUtil.strToDate(o1.get("day").toString(), "yyyy-MM-dd").getTime();
                Long day2 =  DateUtil.strToDate(o2.get("day").toString(), "yyyy-MM-dd").getTime();
                if(day1-day2>0){
                    return -1;
                }else if(day1-day2<0){
@ -489,6 +501,7 @@ public class KitService extends BaseService {
            Map<String,Object> temp = new HashMap<>();
            temp.put("useTime",DateUtil.dateToStr(one.getUseTime(),"HH:mm"));
            temp.put("drugDetail",JSONArray.fromObject(one.getDrugDetail()));
            temp.put("useDrugStatus",one.getUseDrugStatus());
            resultList.add(temp);
        }
        return resultList;

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/kit/DoctorKitController.java

@ -64,9 +64,10 @@ public class DoctorKitController extends BaseController {
    public String currentMonthDrugUse(
            @ApiParam(name = "patientCode", value = "居民code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
            @ApiParam(name = "useDrugStatus", value = "居民用药记录情况(1、按时,2、超时,3、漏用)", required = false) @RequestParam(value = "useDrugStatus", required = false) Integer useDrugStatus,
            @ApiParam(name = "deviceSn", value = "药盒设备sn码", required = false) @RequestParam(value = "deviceSn", required = false) String deviceSn){
            @ApiParam(name = "deviceSn", value = "药盒设备sn码", required = false) @RequestParam(value = "deviceSn", required = false) String deviceSn,
            @ApiParam(name = "month", value = "月份 yyyy-MM", required = false) @RequestParam(value = "month", required = false) String month){
        try {
            Map<String,Object> result =  kitService.currentMonthDrugUse(patientCode,useDrugStatus,deviceSn);
            Map<String,Object> result =  kitService.currentMonthDrugUse(patientCode,useDrugStatus,deviceSn,month);
            return write(200,"获取信息成功!","data",result);
        }catch (Exception e) {
            e.printStackTrace();

+ 7 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/kit/PatientKitController.java

@ -9,6 +9,7 @@ import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -32,9 +33,13 @@ public class PatientKitController extends BaseController {
    @ApiOperation("药盒绑定 ")
    public String kitBinding(
            @ApiParam(name = "deviceSn", value = "药盒设备sn码", required = true) @RequestParam(value = "deviceSn", required = true) String deviceSn,
            @ApiParam(name = "type", value = "1、绑定,2、解绑", required = true) @RequestParam(value = "type", required = true) String type){
            @ApiParam(name = "type", value = "1、绑定,2、解绑", required = true) @RequestParam(value = "type", required = true) String type,
            @ApiParam(name = "patientCode", value = "1、绑定,2、解绑", required = false) @RequestParam(value = "patientCode", required = false) String patientCode){
        try {
            kitService.kitBinding(deviceSn,type,getUID());
            if(StringUtils.isEmpty(patientCode)){
                patientCode=getUID();
            }
            kitService.kitBinding(deviceSn,type,patientCode);
            return write(200,"绑定成功!");
        }catch (Exception e) {
            e.printStackTrace();

+ 13 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java

@ -188,6 +188,19 @@ public class AccountController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/selectByDate",method = RequestMethod.POST)
    @ApiOperation("根据时间查询积分详情")
    public String selectByDate(@ApiParam(name = "objectStr",value = "参数json字符串")@RequestParam(name = "objectStr") String objectStr){
        try {
            JSONObject object = JSONObject.parseObject(objectStr);
            JSONObject object1 = service.selectByDate(object);
            return write(200,"获取成功","data",object1);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}

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

@ -210,7 +210,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