Commit 2a2d6bc1 authored by tianyiming's avatar tianyiming

查看当前各类型下业务人员列表

parent 5f727e15
......@@ -17,6 +17,6 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
List<Map<String, Object>> getUnitListByType(String type);
List<Map<String, Object>> getSecurityAdmin(String companyCode);
List<Map<String, Object>> getSecurityAdmin(String companyCode, String type);
}
......@@ -21,6 +21,7 @@
"tzs_user_info"
WHERE
unit_code = #{companyCode}
AND post_name LIKE '%安全管理员%'
AND post_name LIKE CONCAT('%',#{type},'%')
AND is_delete = 'f'
</select>
</mapper>
......@@ -80,7 +80,7 @@ public class CommonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getSecurityAdmin")
@ApiOperation(httpMethod = "GET", value = "查找当前公司下所属的安全管理员", notes = "查找当前公司下所属的安全管理员")
public ResponseModel<List<Map<String,Object>>> getSecurityAdmin() {
return ResponseHelper.buildResponse(commonService.getSecurityAdmin());
public ResponseModel<List<Map<String, Object>>> getSecurityAdmin(@RequestParam(value = "type") String type) {
return ResponseHelper.buildResponse(commonService.getSecurityAdmin(type));
}
}
......@@ -25,5 +25,5 @@ public interface ICommonService {
List<Map<String,Object>> getUnitListByType(String type);
List<Map<String,Object>> getSecurityAdmin();
List<Map<String,Object>> getSecurityAdmin(String type);
}
......@@ -15,6 +15,8 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgFactoryInfoMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -169,11 +171,21 @@ public class CommonServiceImpl implements ICommonService {
}
@Override
public List<Map<String, Object>> getSecurityAdmin() {
public List<Map<String, Object>> getSecurityAdmin(String type) {
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
CompanyBo company = reginParams.getCompany();
String companyCode = company.getCompanyCode();
return commonMapper.getSecurityAdmin(companyCode);
String postName = null;
if (type.equals("use")) {
postName = "安全管理员";
}
if (type.equals("jyjc")) {
postName = "检验检测人员";
}
if (type.equals("agw")) {
postName = "安改维负责人";
}
return ObjectUtils.isEmpty(postName) ? new ArrayList<>() : commonMapper.getSecurityAdmin(companyCode, postName);
}
/**
......
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