Selaa lähdekoodia

Merge remote-tracking branch 'center/beta_house_1.0' into beta_house_1.0

zdm 6 vuotta sitten
vanhempi
commit
c0016791d5

+ 4 - 2
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/FacilityUsedRecordController.java

@ -79,7 +79,9 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
            @RequestBody FacilityUsedRecord facilityUsedRecord) throws IOException, ManageException {
        facilityUsedRecord.setUserId(facilityUsedRecord.getCreateUser());
        facilityUsedRecord = facilityUsedRecordService.save(facilityUsedRecord);
        userService.updateFacilityUse(facilityUsedRecord.getCreateUser());
        if (facilityUsedRecord.getCreateUser() != null) {
            userService.updateFacilityUse(facilityUsedRecord.getCreateUser());
        }
        return success(facilityUsedRecord);
    }
@ -229,7 +231,7 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
            }
            //根据设施编码获取 设施状态
            Facility facility = facilityService.findByCode(facilityCode);
            if (facility!=null) {
            if (facility != null) {
                record.setFacilitieStatus(facility.getStatus());
            }
        }

+ 0 - 7
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/interceptor/ActivatedInterceptor.java

@ -110,21 +110,14 @@ public class ActivatedInterceptor {
        String userId = request.getHeader("userId");
        System.out.println(userId);
        if (userId == null) {
            response.setStatus(402);
            return joinPoint.proceed();
//            return failed("用户未登录,请登录!",-10000);
        }
        User user = userService.findById(userId);
        if (user == null) {
            response.setStatus(402);
            return joinPoint.proceed();
//            return failed("用户不存在,请重新登录!",-10000);
        } else if (HouseUserContant.activated_lock.equals(user.getActivated())) {
            response.setStatus(103);
//           return failed("用户已被冻结,请联系管理员!",-10000);
        } else if (HouseUserContant.activated_offline.equals(user.getActivated())) {
            response.setStatus(402);
//            return failed("用户已离线,请重新登录!",-10000);
        }
        return joinPoint.proceed();

+ 7 - 4
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/job/ActivatedUserUpdateTask.java

@ -18,7 +18,7 @@ import java.util.*;
/**
 * Task - 定时检查集群状态,提高解析任务容错率
 * Task - 定时更新在线用户状态
 * Created by progr1mmer on 2017/12/15.
 */
@Component
@ -34,10 +34,13 @@ public class ActivatedUserUpdateTask {
        List<String> keys = new ArrayList<>();
        String pattern = "healthyHouse:*:activated";
        Set<String> keys1 = redisClient.keys(pattern);
        List<Serializable> ids = redisClient.multiGet(keys1);
        try {
            if (ids!=null && ids.size()>0) {
                userService.updateUserOffLine(ids);
            if (keys1 !=null && keys1.size()>0){
                List<Serializable> ids = redisClient.multiGet(keys1);
                if (ids!=null && ids.size()>0) {
                    userService.updateUserOffLine(ids);
                }
            }
        } catch (ManageException e) {
            e.printStackTrace();