Commit 7842725c authored by chenhao's avatar chenhao

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

parents 258a08e1 82c47d75
...@@ -20,4 +20,6 @@ public interface IUnitInfoService { ...@@ -20,4 +20,6 @@ public interface IUnitInfoService {
UnitInfoDto approve(UnitInfoApproveDto approveDto); UnitInfoDto approve(UnitInfoApproveDto approveDto);
UnitInfoDto getDtoById(Long sequenceNbr); UnitInfoDto getDtoById(Long sequenceNbr);
UnitInfoDto getDtoByOrgId(Long sequenceNbr);
} }
...@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -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.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
...@@ -43,6 +45,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -43,6 +45,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random; import java.util.Random;
...@@ -75,6 +78,9 @@ public class UnitInfoController extends BaseController { ...@@ -75,6 +78,9 @@ public class UnitInfoController extends BaseController {
@Autowired @Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl; private TzsAuthServiceImpl tzsAuthServiceImpl;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
/** /**
* 获取组织机构树 * 获取组织机构树
* *
...@@ -375,6 +381,25 @@ public class UnitInfoController extends BaseController { ...@@ -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 ...@@ -384,4 +384,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
sourceFileService.saveAttachments(sourceUnit.getSequenceNbr(),attachmentMap); sourceFileService.saveAttachments(sourceUnit.getSequenceNbr(),attachmentMap);
return filePath; 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