Browse Source

Merge branch 'master' of gitee.com:ccsens_s/ccsenscloud

master
zhangye 5 years ago
parent
commit
9b5da0b65d
  1. 2
      health/src/main/java/com/ccsens/health/bean/vo/UserVo.java
  2. 2
      health/src/main/java/com/ccsens/health/service/AsyncService.java
  3. 2
      health/src/main/java/com/ccsens/health/service/IAsyncService.java
  4. 4
      health/src/main/java/com/ccsens/health/service/IJourneyService.java
  5. 6
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  6. 34
      health/src/main/java/com/ccsens/health/service/UserService.java
  7. 4
      health/src/main/java/com/ccsens/health/service/WeiXinService.java
  8. 4
      health/src/main/resources/application.yml
  9. 1
      tall/src/main/java/com/ccsens/tall/service/UserService.java
  10. 4
      tall/src/main/resources/application.yml
  11. 2
      util/src/main/java/com/ccsens/util/CodeEnum.java

2
health/src/main/java/com/ccsens/health/bean/vo/UserVo.java

@ -19,8 +19,6 @@ public class UserVo {
// private byte schoolMember = HealthConstant.SCHOOL_MEMBER_NO;
// @ApiModelProperty("是否实名认证 1:是 0:否")
// private byte realName = HealthConstant.REAL_NAME_NO;
@ApiModelProperty("用户身份")
private MemberVo.MemberJudge judge;
@ApiModelProperty("成员id")
private Long id;
@ApiModelProperty("姓名")

2
health/src/main/java/com/ccsens/health/service/AsyncService.java

@ -21,7 +21,7 @@ public class AsyncService implements IAsyncService {
@Override
public long updateBackNum() {
public Long updateBackNum() {
return journeyService.updateBackNum();
}

2
health/src/main/java/com/ccsens/health/service/IAsyncService.java

@ -15,6 +15,6 @@ public interface IAsyncService {
* 更新返校行程总人数
* @return
*/
long updateBackNum();
Long updateBackNum();
}

4
health/src/main/java/com/ccsens/health/service/IJourneyService.java

@ -25,13 +25,13 @@ public interface IJourneyService {
* 查询填写返校行程的总用户数
* @return
*/
long countBackNum();
Long countBackNum();
/**
* 更新返校行程总人数
* @return
*/
long updateBackNum();
Long updateBackNum();
/**
* 统计全校成员返校情况

6
health/src/main/java/com/ccsens/health/service/JourneyService.java

@ -77,17 +77,17 @@ public class JourneyService implements IJourneyService{
}
@Override
public long countBackNum() {
public Long countBackNum() {
Object o = redisUtil.get(HealthConstant.BACK_SCHOOL_TOTAL_REDIS);
log.info("查询返校总人数:{}", o);
if (o == null) {
return updateBackNum();
}
return (Integer)o;
return (long)(Integer)o;
}
@Override
public long updateBackNum() {
public Long updateBackNum() {
long total = journeyDao.countByType(HealthConstant.JOURNEY_BACK_SCHOOL);
redisUtil.set(HealthConstant.BACK_SCHOOL_TOTAL_REDIS, total, HealthConstant.REDIS_TIME);
log.info("填写返校行程的总人数:{}", total);

34
health/src/main/java/com/ccsens/health/service/UserService.java

@ -110,14 +110,18 @@ public class UserService implements IUserService{
//获取个人信息和tall的userId
UserDto.UserInfo userInfo = params.getParam();
Long userId = params.getUserId();
//判断是否绑定企业微信
EmployeeExample newExample = new EmployeeExample();
newExample.createCriteria().andTallUserIdEqualTo(userId);
long bindQyCount = employeeDao.countByExample(newExample);
//检查是否认证过
RealNameAuthExample userIdExample = new RealNameAuthExample();
userIdExample.createCriteria().andUserIdEqualTo(userId);
List<RealNameAuth> userIdAuth = realNameAuthDao.selectByExample(userIdExample);
if (CollectionUtil.isNotEmpty(userIdAuth)) {
log.info("userId:{}已经实名认证了。", userId);
throw new BaseException(CodeEnum.ALREADY_REAL_AUTH);
}
//检查是否认证过
RealNameAuthExample realNameAuthExample = new RealNameAuthExample();
realNameAuthExample.createCriteria().andUserIdEqualTo(userId);
realNameAuthExample.createCriteria().andNoEqualTo(userInfo.getNo()).andNameEqualTo(userInfo.getName());
List<RealNameAuth> realNameAuthList = realNameAuthDao.selectByExample(realNameAuthExample);
if(CollectionUtil.isNotEmpty(realNameAuthList)){
//判断是否为同一个user_id
@ -127,22 +131,22 @@ public class UserService implements IUserService{
throw new BaseException(CodeEnum.ALREADY_REAL_AUTH);
} else {
// 判断哪个userid和企业微信绑定
//判断是否绑定企业微信
EmployeeExample newExample = new EmployeeExample();
newExample.createCriteria().andTallUserIdEqualTo(userId);
long bindQyCount = employeeDao.countByExample(newExample);
// 授权帐号是否绑定企业
EmployeeExample oldExample = new EmployeeExample();
oldExample.createCriteria().andTallUserIdEqualTo(auth.getUserId());
long authCount = employeeDao.countByExample(oldExample);
boolean hasBind = bindQyCount > 0 && authCount <= 0 || bindQyCount <= 0 && authCount > 0;
if (!hasBind) {
throw new BaseException(CodeEnum.ALREADY_REAL_AUTH);
//更新返校行程,健康打卡,
if (bindQyCount > 0) {
bindUser(auth.getUserId(), userId);
} else {
//更新返校行程,健康打卡,
if (bindQyCount > 0) {
bindUser(auth.getUserId(), userId);
} else {
bindUser(userId, auth.getUserId());
}
throw new BaseException(CodeEnum.ACCOUNT_BIND);
bindUser(userId, auth.getUserId());
}
throw new BaseException(CodeEnum.ACCOUNT_BIND);
}
}

4
health/src/main/java/com/ccsens/health/service/WeiXinService.java

@ -90,12 +90,12 @@ public class WeiXinService implements IWeiXinService {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
Employee employee = employees.get(0);
if (employee.getTallUserId() == null || employee.getTallUserId() == 0) {
// if (employee.getTallUserId() == null || employee.getTallUserId() == 0) {
Employee bindEmployee = new Employee();
bindEmployee.setId(employee.getId());
bindEmployee.setTallUserId(bind.getTallUserId());
employeeDao.updateByPrimaryKeySelective(bindEmployee);
}
// }
return employee;
}

4
health/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: common, util-dev
active: test
include: common, util-test

1
tall/src/main/java/com/ccsens/tall/service/UserService.java

@ -499,6 +499,7 @@ public class UserService implements IUserService {
user.setGender(data.getByteValue("gender"));
user.setAvatarUrl(data.getString("avatar"));
}
user.setRecStatus((byte)0);
}
}

4
tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: util-dev,common
active: test
include: util-test,common

2
util/src/main/java/com/ccsens/util/CodeEnum.java

@ -105,7 +105,7 @@ public enum CodeEnum {
LOCATION_LONG(87,"对不起,您的距离太远了,请靠近目的地后重试。",true),
NO_IMPORT_DATA(88,"没有有效的数据,请检查您的导入文件。",true),
FILL_ERROR(89,"您的信息填写有误,请检查您的信息。",true),
ACCOUNT_BIND(90,"您的帐号已经绑定了,请关注。",true),
ACCOUNT_BIND(90,"您的帐号已经绑定了,请重新进入小程序。",true),
;
public CodeEnum addMsg(String msg){

Loading…
Cancel
Save