Commit 0fa71662 authored by 曹盼盼's avatar 曹盼盼

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents f147d2ee d3f6089d
package com.yeejoin.amos.boot.module.tzs.api.service; package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.tzs.api.entity.UserCheckStatus; import com.yeejoin.amos.boot.module.tzs.api.entity.UserCheckStatus;
/** /**
...@@ -8,7 +9,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.UserCheckStatus; ...@@ -8,7 +9,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.UserCheckStatus;
*/ */
public interface IUserCheckStatusService { public interface IUserCheckStatusService {
UserCheckStatus getUserCheckStatus(String useName); UserCheckStatus getUserCheckStatus(ReginParams reginParams);
UserCheckStatus updateUserCheckStatus(String useName, String status); UserCheckStatus updateUserCheckStatus(String useName, String status);
} }
...@@ -46,8 +46,7 @@ public class UserCheckStatusController extends BaseController { ...@@ -46,8 +46,7 @@ public class UserCheckStatusController extends BaseController {
if (ObjectUtils.isEmpty(reginParams)) { if (ObjectUtils.isEmpty(reginParams)) {
return null; return null;
} }
String useName = reginParams.getUserModel().getUserName(); return ResponseHelper.buildResponse(userCheckStatusService.getUserCheckStatus(reginParams));
return ResponseHelper.buildResponse(userCheckStatusService.getUserCheckStatus(useName));
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.tzs.api.dto.UserCheckStatusDto; import com.yeejoin.amos.boot.module.tzs.api.dto.UserCheckStatusDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.UserCheckStatus; import com.yeejoin.amos.boot.module.tzs.api.entity.UserCheckStatus;
import com.yeejoin.amos.boot.module.tzs.api.mapper.UserCheckStatusMapper; import com.yeejoin.amos.boot.module.tzs.api.mapper.UserCheckStatusMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IUserCheckStatusService; import com.yeejoin.amos.boot.module.tzs.api.service.IUserCheckStatusService;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* 装备分类服务实现类 * 装备分类服务实现类
* *
...@@ -24,9 +30,21 @@ public class UserCheckStatusServiceImpl extends BaseService<UserCheckStatusDto, ...@@ -24,9 +30,21 @@ public class UserCheckStatusServiceImpl extends BaseService<UserCheckStatusDto,
@Autowired @Autowired
UserCheckStatusMapper userCheckStatusMapper; UserCheckStatusMapper userCheckStatusMapper;
//使用单位sequence_nbr
private final Long USEUNITID = 1460532889249755137L;
@Override @Override
public UserCheckStatus getUserCheckStatus(String useName) { public UserCheckStatus getUserCheckStatus(ReginParams reginParams) {
UserCheckStatus userCheckStatus = userCheckStatusMapper.selectOne(new QueryWrapper<UserCheckStatus>().eq("use_name", useName)); UserCheckStatus userCheckStatus = new UserCheckStatus();
userCheckStatus.setStatus("1");
Map<Long, List<RoleModel>> orgRoles = reginParams.getUserModel().getOrgRoles();
if(!ObjectUtils.isEmpty(orgRoles)){
Set<Long> longs = orgRoles.keySet();
for (Long aLong : longs) {
for (RoleModel roleModel : orgRoles.get(aLong)) {
if(USEUNITID.equals(roleModel.getSequenceNbr())){
String useName = reginParams.getUserModel().getUserName();
userCheckStatus = userCheckStatusMapper.selectOne(new QueryWrapper<UserCheckStatus>().eq("use_name", useName));
if (ObjectUtils.isEmpty(userCheckStatus)) { if (ObjectUtils.isEmpty(userCheckStatus)) {
UserCheckStatus checkStatus = new UserCheckStatus(); UserCheckStatus checkStatus = new UserCheckStatus();
checkStatus.setUseName(useName); checkStatus.setUseName(useName);
...@@ -38,6 +56,10 @@ public class UserCheckStatusServiceImpl extends BaseService<UserCheckStatusDto, ...@@ -38,6 +56,10 @@ public class UserCheckStatusServiceImpl extends BaseService<UserCheckStatusDto,
return null; return null;
} }
} }
}
}
}
}
return userCheckStatus; return userCheckStatus;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment