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

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

yeshijie 6 роки тому
батько
коміт
8b102de3ba

+ 48 - 33
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/LoginController.java

@ -4,9 +4,11 @@ import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.healthyhouse.cache.WlyyRedisVerifyCodeService;
import com.yihu.jw.healthyhouse.model.user.User;
import com.yihu.jw.healthyhouse.service.user.LoginService;
import com.yihu.jw.healthyhouse.service.user.UserService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.wlyy.HouseUserContant;
import com.yihu.jw.util.security.RandomValidateCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -37,6 +39,8 @@ public class LoginController extends EnvelopRestEndpoint {
    private RestTemplate restTemplate;
    @Autowired
    private WlyyRedisVerifyCodeService wlyyRedisVerifyCodeService;
    @Autowired
    private UserService userService;
    /******************************************    用户相关    **********************************/
@ -47,17 +51,22 @@ public class LoginController extends EnvelopRestEndpoint {
            @ApiParam(name = "msgType", value = "消息类型(login:登录验证,checkPhone:验证安全手机,resetPhone:重设安全手机", required = true)@RequestParam(required = true, name = "msgType") String msgType,
            @ApiParam(name = "username", value = "手机账号", required = true)@RequestParam(required = true, name = "username") String username ) throws  Exception{
        if (StringUtils.isEmpty(clientId)) {
            throw new InvalidRequestException("clientId");
            failed("clientId 为空!");
        }
        if (StringUtils.isEmpty(username)){
            throw new InvalidRequestException("username");
            failed("username 为空!");
        }
        //验证用户是否被冻结
        User user = userService.findByCode(username);
        if (HouseUserContant.activated_lock.equals(user)) {
            failed("该用户已被冻结,无法发送验证码!");
        }
        //验证请求间隔超时,防止频繁获取验证码
//        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(clientId, username)) {
//            throw new IllegalAccessException("SMS request frequency is too fast");
//        }
        //发送短信获取验证码
        ResponseEntity<HashMap> result = loginService.sendDemoSms(clientId,msgType,username);
        ResponseEntity<HashMap> result = loginService.sendSms(clientId,msgType,username);
        return result;
    }
@ -70,15 +79,15 @@ public class LoginController extends EnvelopRestEndpoint {
            @ApiParam(name = "username", value = "登录账号", required = true)@RequestParam(required = true, name = "username") String username,
            @ApiParam(name = "captcha", value = "短信验证码", required = true)@RequestParam(required = true, name = "captcha") String captcha) throws ManageException, ParseException {
        if (wlyyRedisVerifyCodeService.verification(clientId, username, captcha)) {
            return ObjEnvelop.getSuccess("验证码正确");
            return success("验证码正确");
        } else {
            return ObjEnvelop.getError("验证码错误");
            return failed("验证码错误");
        }
    }
    @PostMapping("/mobile/login")
    @ApiOperation(value = "【普通用户】-手机登录注册")
    public ObjEnvelop<User> mobileLogin(
    public Envelop mobileLogin(
            HttpServletRequest request,
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "username", value = "账号", required = true)@RequestParam(required = true, name = "username") String username,
@ -92,26 +101,22 @@ public class LoginController extends EnvelopRestEndpoint {
            return success(user);
        } else {
            return ObjEnvelop.getError("验证码错误");
            return failed("验证码错误");
        }
    }
    @PostMapping("/ijk/login")
    @ApiOperation(value = "【普通用户】-i健康用户登陆")
    public ObjEnvelop ijkLogin(
    public Envelop ijkLogin(
            HttpServletRequest request,
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "username", value = "账号", required = true)@RequestParam(required = true, name = "username") String username,
            @ApiParam(name = "password", value = "密码", required = true)@RequestParam(required = true, name = "password") String password) throws ManageException {
        User user = loginService.iJklogin(request,clientId,username, password);
        if (user !=null) {
            ObjEnvelop envelop = new ObjEnvelop();
            envelop.setStatus(200);
            envelop.setMessage("登录成功");
            envelop.setObj(user);
            return envelop;
            return success("登录成功",user);
        }else {
            return ObjEnvelop.getError("登录失败");
            return failed("登录失败");
        }
    }
@ -122,10 +127,10 @@ public class LoginController extends EnvelopRestEndpoint {
            @ApiParam(name = "userCode", value = "用户code", required = true)@RequestParam(required = true, name = "userCode") String userCode) {
        try {
            //修改用户状态  离线
           return ObjEnvelop.getSuccess("登出成功");
           return success("登出成功");
        } catch (Exception e) {
            e.printStackTrace();
            return ObjEnvelop.getError("登出成功:" + e.getMessage(), -1);
            return failed("登出失败");
        }
    }
@ -134,32 +139,42 @@ public class LoginController extends EnvelopRestEndpoint {
    @PostMapping("/mobile/manage/login")
    @ApiOperation(value = "【管理员】-手机验证登录")
    public ObjEnvelop administratorMobileLogin(
    public Envelop administratorMobileLogin(
            HttpServletRequest request,
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "username", value = "账号", required = true)@RequestParam(required = true, name = "username") String username,
            @ApiParam(name = "captcha", value = "短信验证码", required = true)@RequestParam(required = true, name = "captcha") String captcha) throws ManageException, ParseException {
            @ApiParam(name = "captcha", value = "短信验证码", required = true)@RequestParam(required = true, name = "captcha") String captcha) throws ParseException {
        if (wlyyRedisVerifyCodeService.verification(clientId, username, captcha)) {
            User user = loginService.managerPhoneLogin(request,username);
            return ObjEnvelop.getSuccess("登录成功",user);
            User user = null;
            try {
                user = loginService.managerPhoneLogin(request,username);
            } catch (ManageException e) {
                return failed(e.getMessage());
            }
            return success("登录成功",user);
        } else {
            return ObjEnvelop.getError("验证码错误");
            return failed("验证码错误");
        }
    }
    @PostMapping("/manage/login")
    @ApiOperation(value = "【管理员】-用户账号登陆")
    public ObjEnvelop administratorLogin(
    public Envelop administratorLogin(
            HttpServletRequest request,
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "username", value = "账号", required = true)@RequestParam(required = true, name = "username") String username,
            @ApiParam(name = "password", value = "密码", required = true)@RequestParam(required = true, name = "password") String password) throws ManageException {
        User user = loginService.managerLogin(request,clientId,username, password);
        if (user !=null) {
            return ObjEnvelop.getSuccess("登录成功",user);
        }else {
            return ObjEnvelop.getError("登录失败");
            @ApiParam(name = "password", value = "密码", required = true)@RequestParam(required = true, name = "password") String password) {
        try {
            User user = loginService.managerLogin(request,clientId,username, password);
            if (user !=null) {
                return success("登录成功",user);
            }else {
                return failed("登录失败");
            }
        } catch (ManageException e) {
           return failed(e.getMessage());
        }
    }
    @GetMapping(value = "/getRandomImageCode")
@ -172,9 +187,9 @@ public class LoginController extends EnvelopRestEndpoint {
            response.setDateHeader("Expire", 0);
            RandomValidateCode randomValidateCode = new RandomValidateCode();
            randomValidateCode.getRandcode(request, response);//输出验证码图片方法
            return ObjEnvelop.getSuccess("获取验证码成功");
            return success("获取验证码成功");
        } catch (Exception e) {
           return ObjEnvelop.getError("获取验证码失败");
            return failed("获取验证码失败");
        }
    }
@ -183,14 +198,14 @@ public class LoginController extends EnvelopRestEndpoint {
    public Envelop checkImageCode(@ApiParam(name = "code",value = "输入的验证码")@RequestParam(value = "code",required = true)String code,
                                     HttpServletRequest request){
        if (StringUtils.isEmpty(code)){
            return ObjEnvelop.getError("请输入验证码!");
            return failed("请输入验证码!");
        }
        String codeRescource = String.valueOf(request.getSession().getAttribute(RandomValidateCode.RANDOMCODEKEY));
        if (code.toLowerCase().equals(codeRescource.toLowerCase())){
            request.getSession().removeAttribute(RandomValidateCode.RANDOMCODEKEY);
            return ObjEnvelop.getSuccess("验证码正确!");
            return success("验证码正确!");
        }else {
            return ObjEnvelop.getError("验证码错误!");
            return failed("验证码错误!");
        }
    }

+ 4 - 4
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/facilities/FacilitiesController.java

@ -287,7 +287,7 @@ public class FacilitiesController extends EnvelopRestEndpoint {
    @PostMapping(value = "/batchImport")
    @ApiOperation(value = "设施列表导入(经纬度重复的不导入)")
    public ObjEnvelop importData(
    public Envelop importData(
            @ApiParam(name = "file", value = "文件", required = true)
            @RequestPart(value = "file") MultipartFile file,
            HttpServletRequest request) throws IOException, ManageException {
@ -298,13 +298,13 @@ public class FacilitiesController extends EnvelopRestEndpoint {
            List<FacilityMsg> dataList = excelReader.getCorrectLs();
            if (dataList.size() > 0) {
                Map<String, Object> result = facilityService.batchInsertFacility(dataList);
                return ObjEnvelop.getSuccess("导入成功!", result);
                return success("导入成功!", result);
            }
        } catch (Exception e) {
            throw new ManageException("导入设施列表异常!", e);
        }
        return ObjEnvelop.getError("导入失败");
        return failed("导入失败");
    }
    @ApiOperation(value = "获取设施列表--不分页(app)", responseContainer = "List")
@ -358,7 +358,7 @@ public class FacilitiesController extends EnvelopRestEndpoint {
        String filters = "createTime>=" + todayStart + ";createTime<=" + todayEnd;
        long countCreatedFacilitieToday = facilityService.getCount(filters);
        map.put("countCreatedFacilitieToday", countCreatedFacilitieToday);
        return ObjEnvelop.getSuccess("获取成功", map);
        return success("获取成功", map);
    }

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

@ -77,6 +77,7 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
    public ObjEnvelop<FacilityUsedRecord> createFacilityUsedRecord(
            @ApiParam(name = "facilityUsedRecord", value = "用户使用导航记录JSON结构")
            @RequestBody FacilityUsedRecord facilityUsedRecord) throws IOException, ManageException {
        facilityUsedRecord.setUserId(facilityUsedRecord.getCreateUser());
        facilityUsedRecord = facilityUsedRecordService.save(facilityUsedRecord);
        userService.updateFacilityUse(facilityUsedRecord.getCreateUser());
        return success(facilityUsedRecord);
@ -140,6 +141,7 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
                facilityUsedRecord.setFacilitieLatitudes(facility.getLatitude());
                facilityUsedRecord.setFacilitieAddr(facility.getAddress());
                facilityUsedRecord.setCreateUser(userId);
                facilityUsedRecord.setUserId(userId);
                facilityUsedRecord.setFacilitieId(facility.getId());
                long count = facilityUsedRecordService.countByFacilitieCodeAndUserId(facility.getCode(), userId);
                facilityUsedRecord.setNum((int) count);
@ -179,6 +181,9 @@ public class FacilityUsedRecordController extends EnvelopRestEndpoint {
    public ObjEnvelop facilityUsedRecordDetail(
            @ApiParam(name = "id", value = "使用记录ID", defaultValue = "")
            @RequestParam(value = "id") String id) throws Exception {
        if (id == null ){
            throw new ManageException("使用记录ID为空!");
        }
        Map<String, Object> usedRecordDetail = facilityUsedRecordService.getUsedRecordDetail(id);
        return success(usedRecordDetail);
    }

+ 38 - 19
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/controller/user/UserController.java

@ -77,7 +77,7 @@ public class UserController  extends EnvelopRestEndpoint {
    public ObjEnvelop userDetail(
            @ApiParam(name = "userId", value = "用户id", required = true)@RequestParam(required = true, name = "userId") String userId ) {
        User user = userService.findById(userId);
        return ObjEnvelop.getSuccess("获取成功",user);
        return success("获取成功",user);
    }
@ -85,7 +85,7 @@ public class UserController  extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取用户统计信息")
    public ObjEnvelop usedFacilityCount() {
        Map<String, Long> userStatistics = userService.findUserStatistics();
        return ObjEnvelop.getSuccess("获取成功",userStatistics);
        return success("获取成功",userStatistics);
    }
    @ApiOperation(value = "新增/更新(idy已存在)用户信息")
@ -110,7 +110,7 @@ public class UserController  extends EnvelopRestEndpoint {
            @ApiParam(name = "operator", value = "操作者ID", required = true)@RequestParam(required = true, name = "operator") String operator ) throws ManageException {
        userService.updateStatus(userId,operator, HouseUserContant.activated_lock,reason);
        return ObjEnvelop.getSuccess("冻结成功");
        return success("冻结成功");
    }
@ -120,7 +120,7 @@ public class UserController  extends EnvelopRestEndpoint {
            @ApiParam(name = "userId", value = "用户id", required = true)@RequestParam(required = true, name = "userId") String userId ,
            @ApiParam(name = "operator", value = "操作者ID", required = true)@RequestParam(required = true, name = "operator") String operator ) throws ManageException {
        userService.updateStatus(userId,operator, HouseUserContant.activated_active,null);
        return ObjEnvelop.getSuccess("激活成功");
        return success("激活成功");
    }
    @PostMapping("/updatePwd")
@ -131,34 +131,53 @@ public class UserController  extends EnvelopRestEndpoint {
            @ApiParam(name = "newPwd", value = "新密码", required = true)@RequestParam(required = true, name = "newPwd") String newPwd ) throws ManageException {
        userService.updatePwd(userId,oldPwd,newPwd);
        return ObjEnvelop.getSuccess("更新密码成功");
        return success("更新密码成功");
    }
    @PostMapping("/updatePhone")
    @ApiOperation(value = "更新安全手机号码")
    @ApiOperation(value = "【app端普通用户】更新安全手机号码")
    public Envelop updatePhone(
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "userId", value = "用户Id", required = true)@RequestParam(required = true, name = "userId") String userId ,
            @ApiParam(name = "oldPhone", value = "旧安全手机号", required = true)@RequestParam(required = true, name = "oldPhone") String oldPhone ,
            @ApiParam(name = "newPhone", value = "新安全手机号", required = true)@RequestParam(required = true, name = "newPhone") String newPhone ,
            @ApiParam(name = "captcha", value = "短信验证码", required = true)@RequestParam(required = true, name = "captcha") String captcha ) throws ManageException {
        //验证码
        if (wlyyRedisVerifyCodeService.verification(clientId, newPhone, captcha)) {
        if (wlyyRedisVerifyCodeService.verification(clientId, oldPhone, captcha)) {
            userService.updateSecurePhone(userId,newPhone);
            return ObjEnvelop.getSuccess("更新安全手机号码成功");
            return success("更新安全手机号码成功");
        } else {
            return failed("验证码错误");
        }
    }
    @PostMapping("/updateAdminPhone")
    @ApiOperation(value = "【web端管理员】更新安全手机号码")
    public Envelop updateAdminPhone(
            @ApiParam(name = "clientId", value = "应用id", required = true)@RequestParam(required = true, name = "clientId") String clientId,
            @ApiParam(name = "userId", value = "用户Id", required = true)@RequestParam(required = true, name = "userId") String userId ,
            @ApiParam(name = "newPhone", value = "新安全手机号", required = true)@RequestParam(required = true, name = "newPhone") String newPhone ,
            @ApiParam(name = "captcha", value = "短信验证码", required = true)@RequestParam(required = true, name = "captcha") String captcha ) throws ManageException {
        //验证码
        if (wlyyRedisVerifyCodeService.verification(clientId, newPhone, captcha)) {
            userService.updateAdministorSecurePhone(userId,newPhone);
            return success("更新安全手机号码成功");
        } else {
            return ObjEnvelop.getError("验证码错误");
            return failed("验证码错误");
        }
    }
    @PostMapping("/checkIdCardNo")
    @ApiOperation(value = "用户身份证号码认证")
    @ApiOperation(value = "用户实名认证")
    public Envelop checkIdCardNo(
            @ApiParam(name = "userId", value = "用户Id", required = true)@RequestParam(required = true, name = "userId") String userId ,
            @ApiParam(name = "name", value = "用户姓名", required = true)@RequestParam(required = true, name = "name") String name ,
            @ApiParam(name = "idCardNo", value = "身份证号码", required = true)@RequestParam(required = true, name = "idCardNo") String idCardNo ) throws ManageException {
        userService.checkIdCardNo(userId, idCardNo);
        return ObjEnvelop.getSuccess("身份证认证完成!");
        userService.checkIdCardNo(userId,name,idCardNo);
        return success("用户实名认证完成!");
    }
    @GetMapping("/existence")
@ -168,9 +187,9 @@ public class UserController  extends EnvelopRestEndpoint {
        boolean b = userService.checkManageUser(telephone);
        if (b) {
            return ObjEnvelop.getSuccess("该管理员账号存在!",b);
            return success("该管理员账号存在!",b);
        }else {
            return ObjEnvelop.getSuccess("该管理员账号不存在!",b);
            return success("该管理员账号不存在!",b);
        }
    }
@ -181,15 +200,15 @@ public class UserController  extends EnvelopRestEndpoint {
        User user = userService.findByLoginCodeAndUserType(loginName, LoginInfo.USER_TYPE_SUPER_AdminManager);
        if (user != null) {
            return ObjEnvelop.getSuccess("该管理员账号存在!",user);
            return success("该管理员账号存在!",user);
        }else {
            return ObjEnvelop.getSuccess("该管理员账号不存在!",user);
            return success("该管理员账号不存在!",user);
        }
    }
    @PostMapping(value = "/resetPassWord")
    @ApiOperation(value = "重设密码", notes = "根基传入的用户id和新的密码重设用户的密码")
    public ObjEnvelop resetPassWord(
    public Envelop resetPassWord(
            @ApiParam(name = "userId", value = "用户ID", defaultValue = "")
            @RequestParam(value = "userId") String userId,
            @ApiParam(name = "password", value = "密码", defaultValue = "")
@ -197,9 +216,9 @@ public class UserController  extends EnvelopRestEndpoint {
        try {
            String resetPwd = userService.resetPwd(userId, password);
            return ObjEnvelop.getSuccess("重设密码成功",password);
            return success("重设密码成功",password);
        } catch (ManageException e) {
            return ObjEnvelop.getError(e.getMessage());
            return failed(e.getMessage());
        }
    }

+ 1 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/user/FacilityUsedRecordDao.java

@ -14,7 +14,7 @@ public interface FacilityUsedRecordDao extends JpaRepository<FacilityUsedRecord,
    FacilityUsedRecord findById(String id);
    Long countByUserId(String userId);
    Long countAllByUserIdIsNotNull();
    Long countAllByCreateUserIsNotNull();
    long countByFacilitieCodeAndCreateUser(String facilitieCode,String createUser);
}

+ 3 - 2
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/dao/user/UserDao.java

@ -33,12 +33,13 @@ public interface UserDao extends PagingAndSortingRepository<User, String>, JpaSp
    @Query("select sum (u.facilityUsedCount) from User u")
    Long sumFacilityUseCout();
    Long countAllByActivated(Integer activated);
    Long countAllByActivatedAndUserType(Integer activated,String userType);
    Long countAllByUserType(String userType);
    Long countAllByCreateTimeBetween(Date start,Date end);
    Long countAllByUserTypeAndCreateTimeBetween(String userType,Date start,Date end);
    User findByLoginCodeAndUserType(String loginCode,String userType);
    User findByTelephoneAndUserType(String telephone,String userType);
}

+ 1 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/user/FacilityUsedRecordService.java

@ -58,7 +58,7 @@ public class FacilityUsedRecordService extends BaseJpaService<FacilityUsedRecord
    }
    public Long countAll() {
        return facilityUsedRecordDao.countAllByUserIdIsNotNull();
        return facilityUsedRecordDao.countAllByCreateUserIsNotNull();
    }
    //根据用户id及设施编码统计历史导航记录总数

+ 13 - 1
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/user/LoginService.java

@ -1,6 +1,7 @@
package com.yihu.jw.healthyhouse.service.user;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.sun.org.apache.bcel.internal.generic.I2F;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.healthyhouse.cache.WlyyRedisVerifyCodeService;
import com.yihu.jw.healthyhouse.constant.LoginInfo;
@ -64,6 +65,10 @@ public class LoginService  extends BaseJpaService {
            user.setPassword(LoginInfo.DEFAULT_PASSWORD);
            user.setUserType(LoginInfo.USER_TYPE_PATIENT);
        }
        if (HouseUserContant.activated_lock.equals(user)) {
            throw new ManageException("该用户已被冻结!");
        }
        //已注册用户更改用户状态
        user.setActivated(HouseUserContant.activated_active);
        request.getSession().setAttribute(LoginInfo.IS_LOGIN, true);
@ -265,10 +270,13 @@ public class LoginService  extends BaseJpaService {
    @Transactional(noRollbackForClassName = "ManageException")
    public User managerPhoneLogin(HttpServletRequest request, String loginCode) throws ManageException {
        //判断管理员用户信息是否存在
        User user = userService.findByLoginCodeAndUserType(loginCode, LoginInfo.USER_TYPE_SUPER_AdminManager);
        User user = userService.findByTelephoneAndUserType(loginCode, LoginInfo.USER_TYPE_SUPER_AdminManager);
        if (user == null) {
            throw new ManageException("该管理员账号不存在!");
        } else {
            if (HouseUserContant.activated_lock.equals(user)) {
                throw new ManageException("该用户已被冻结!");
            }
            //已注册用户更改用户状态
            user.setActivated(HouseUserContant.activated_active);
            request.getSession().setAttribute(LoginInfo.IS_LOGIN, true);
@ -300,6 +308,10 @@ public class LoginService  extends BaseJpaService {
            String message = "该管理员账号不存在!";
            throw new ManageException(message);
        } else {
            if (HouseUserContant.activated_lock.equals(user)) {
                throw new ManageException("该用户已被冻结!");
            }
            if (!user.getPassword().equals(MD5.GetMD5Code(password + user.getSalt()))) {
                String message = "密码错误";
                throw new ManageException(message);

+ 34 - 5
svr/svr-healthy-house/src/main/java/com/yihu/jw/healthyhouse/service/user/UserService.java

@ -59,6 +59,9 @@ public class UserService extends BaseJpaService<User, UserDao> {
        return userDao.findByLoginCodeAndUserType(loginCode,userType);
    }
    public User findByTelephoneAndUserType(String telephone,String userType) {
        return userDao.findByTelephoneAndUserType(telephone,userType);
    }
    /**
     * 分页获取用户列表
@ -249,19 +252,42 @@ public class UserService extends BaseJpaService<User, UserDao> {
    }
    /**
     * 普通用户密保手机修改
     * @param userId    普通用户id
     * @param phone     手机号
     * @throws ManageException
     */
    @Transactional
    public void updateSecurePhone(String userId, String phone) throws ManageException {
        User user = findById(userId);
        if (user==null) {
            throw new ManageException("该账号不存在");
        }
        user.setLoginCode(phone);
        user.setTelephone(phone);
        userDao.save(user);
    }
    /**
     * 修改管理员密保手机
     * @param userId    用户id
     * @param phone     密保手机
     * @throws ManageException
     */
    @Transactional
    public void updateAdministorSecurePhone(String userId, String phone) throws ManageException {
        User user = findById(userId);
        if (user==null) {
            throw new ManageException("该账号不存在");
        }
        user.setTelephone(phone);
        userDao.save(user);
    }
    /**
     * 获取 用户统计信息
     * 获取 健康小屋用户统计信息
     *
     * @return
     */
@ -272,9 +298,9 @@ public class UserService extends BaseJpaService<User, UserDao> {
        //今日新增数
        Date start = DateUtil.getDateStart();
        Date end = DateUtil.getDateEnd();
        Long newCount = userDao.countAllByCreateTimeBetween(start, end);
        Long newCount = userDao.countAllByUserTypeAndCreateTimeBetween(LoginInfo.USER_TYPE_PATIENT,start, end);
        //在线用户数
        Long activeCount = userDao.countAllByActivated(HouseUserContant.activated_active);
        Long activeCount = userDao.countAllByActivatedAndUserType(HouseUserContant.activated_active,LoginInfo.USER_TYPE_PATIENT);
        //用户设施使用总次数
        Long usePricilityCount = facilityUsedRecordService.countAll();
        result.put("totalCount",totalCount);
@ -285,12 +311,13 @@ public class UserService extends BaseJpaService<User, UserDao> {
    }
    /**
     *  用户身份证认证
     *  用户实名认证
     * @param userId    用户ID
     * @param name  用户姓名
     * @param idCardNo  身份证
     * @throws ManageException
     */
    public void checkIdCardNo(String userId, String idCardNo) throws ManageException {
    public void checkIdCardNo(String userId,String name, String idCardNo) throws ManageException {
        User user1 = findById(userId);
        if (user1==null) {
            throw new ManageException("该账号不存在");
@ -300,6 +327,8 @@ public class UserService extends BaseJpaService<User, UserDao> {
        }
        // 更新身份证验证字段
        user1.setRealnameAuthentication(UserConstant.AUTHORIZED);
        user1.setIdCardNo(idCardNo);
        user1.setName(name);
        userDao.save(user1);
    }

+ 1 - 1
svr/svr-healthy-house/src/main/resources/application.yml

@ -80,7 +80,7 @@ fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
# 短信发送地址
jw:
  smsUrl: http://svr-base-hzy:10020/sms_gateway/send
  smsUrl: http://svr-base:10020/sms_gateway/send
---
spring: