This commit is contained in:
mashuai 2025-08-19 14:10:26 +08:00
parent 62bfb600d4
commit ff6de21cfb
2 changed files with 14 additions and 2 deletions

View File

@ -208,10 +208,13 @@ public class SelectController {
@PostMapping("/getUseTypeTree")
public AjaxResult getUseTypeTree(@RequestBody BackApplyInfo bean) {
BmUnit queryUnitInfo = bmUnitMapper.selectBmUnitByUnitId(bean.getUnitId());
if (queryUnitInfo != null && queryUnitInfo.getTypeId() == null) {
if (queryUnitInfo == null) {
throw new ServiceException("单位不存在");
}
if (queryUnitInfo.getTypeId() == null) {
throw new ServiceException("单位类型为空");
}
if (queryUnitInfo != null && queryUnitInfo.getTypeId() == 1731L) {
if (queryUnitInfo.getTypeId() == 1731L) {
// 获取班组在用量
return service.getBzUseTypeTree(bean);
}

View File

@ -380,6 +380,15 @@ public class SelectServiceImpl implements SelectService {
List<TypeTreeNode> listL21 = new ArrayList<>();
try {
// 先查第四层类型
SelectDto dto = new SelectDto();
dto.setUnitId(bean.getUnitId().intValue());
dto.setProjectId(bean.getProId().toString());
List<AgreementVo> newList = mapper.getAgreementInfoByIdBack(dto);
if (CollectionUtils.isNotEmpty(newList)) {
bean.setAgreementId(newList.get(0).getAgreementId().longValue());
} else {
return AjaxResult.success(groupList);
}
listL4 = mapper.getBzUseTypeTreeL4(bean);
if (CollectionUtils.isNotEmpty(listL4)) {
List<Long> list4ParentIds = listL4.stream().map(TypeTreeNode::getParentId).collect(Collectors.toList());