Commit 904a33e6 authored by fenghuazhong's avatar fenghuazhong

根据登录信息获取单位

parent be4daecb
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -113,4 +114,16 @@ public class AttachmentController extends BaseController { ...@@ -113,4 +114,16 @@ public class AttachmentController extends BaseController {
public ResponseModel<List<AttachmentDto>> selectForList() { public ResponseModel<List<AttachmentDto>> selectForList() {
return ResponseHelper.buildResponse(attachmentServiceImpl.queryForAttachmentList()); return ResponseHelper.buildResponse(attachmentServiceImpl.queryForAttachmentList());
} }
/**
* 根据当前登录人获取单位
*
*/
@BusinessIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unit")
@ApiOperation(httpMethod = "Get",value="单位选择查询",notes= "单位选择查询")
public ResponseModel<String> selectUnit(){
return ResponseHelper.buildResponse(attachmentServiceImpl.selectUnit());
}
} }
...@@ -3,15 +3,23 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl; ...@@ -3,15 +3,23 @@ package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum;
import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment; import com.yeejoin.amos.boot.module.ugp.api.entity.Attachment;
import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.AttachmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IAttachmentService; import com.yeejoin.amos.boot.module.ugp.api.service.IAttachmentService;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.ugp.biz.controller.ProjectController;
/** /**
* 附件表服务实现类 * 附件表服务实现类
...@@ -21,6 +29,11 @@ import java.util.List; ...@@ -21,6 +29,11 @@ import java.util.List;
*/ */
@Service @Service
public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment,AttachmentMapper> implements IAttachmentService { public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment,AttachmentMapper> implements IAttachmentService {
@Autowired
OrgServiceImpl orgServiceImpl;
@Autowired
OrgUsrServiceImpl orgUsrService;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -61,4 +74,21 @@ public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment, ...@@ -61,4 +74,21 @@ public class AttachmentServiceImpl extends BaseService<AttachmentDto,Attachment,
} }
this.save(attachment); this.save(attachment);
} }
/**
*获取登录人的单位
*
*/
@BusinessIdentify
public String selectUnit(){
//获取登录人的redis信息
ReginParams reginParams = orgServiceImpl.getReginParams();
//根据redis信息去获取登录人信息后再获取到登录人的sequenceNbr
Long companyId = reginParams.getBusinessInfo().getCompanySequenceNbr();
OrgUsr orgUsr = orgUsrService.getById(companyId);
String key = orgUsr.getOrgExpandAttr1();
return OrgEnum.map.get(key);
}
} }
\ No newline at end of file
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