Commit a0c72061 authored by kongfm's avatar kongfm

更新FLC相关代码

parent 675a52c3
......@@ -20,4 +20,6 @@ public interface IUnitInfoService {
UnitInfoDto approve(UnitInfoApproveDto approveDto);
UnitInfoDto getDtoById(Long sequenceNbr);
UnitInfoDto getDtoByOrgId(Long sequenceNbr);
}
......@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.tzs.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
......@@ -43,6 +45,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
......@@ -75,6 +78,9 @@ public class UnitInfoController extends BaseController {
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
/**
* 获取组织机构树
*
......@@ -375,6 +381,25 @@ public class UnitInfoController extends BaseController {
}
/**
* 根据当前登录人获取企业信息
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserUnit")
@ApiOperation(httpMethod = "GET",value = "根据当前登录人获取企业信息", notes = "根据当前登录人获取企业信息")
public ResponseModel<UnitInfoDto> getUserUnit() {
AgencyUserModel user = Privilege.agencyUserClient.getme().getResult();
List<CompanyModel> companys = user.getCompanys();
UnitInfoDto result = new UnitInfoDto();
for(CompanyModel c : companys) {
OrgUsr temp = iOrgUsrService.getOne(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getAmosOrgId,c.getSequenceNbr()));
if(temp != null) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.getDtoByOrgId(temp.getSequenceNbr()));
}
}
return ResponseHelper.buildResponse(result);
}
......
......@@ -384,4 +384,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
sourceFileService.saveAttachments(sourceUnit.getSequenceNbr(),attachmentMap);
return filePath;
}
@Override
public UnitInfoDto getDtoByOrgId(Long sequenceNbr) {
UnitInfo unitInfo = this.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrgUserId,sequenceNbr));
if(unitInfo == null) {
return new UnitInfoDto();
}
return unitInfoToDto(unitInfo);
}
}
\ 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