|
|
@ -16,6 +16,7 @@ import com.epmet.resi.partymember.dto.IcPartyPlaceDTO; |
|
|
|
import com.epmet.resi.partymember.dto.IcPartyPlaceTreeResultDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partymember.IcPartyInventoryDTO; |
|
|
|
import com.epmet.resi.partymember.dto.partymember.result.IcPartyInventoryListResultDTO; |
|
|
|
import jodd.util.StringUtil; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -98,15 +99,24 @@ public class IcPartyPlaceServiceImpl extends BaseServiceImpl<IcPartyPlaceDao, Ic |
|
|
|
public List<IcPartyPlaceTreeResultDTO> getPageList(Map<String, Object> params) { |
|
|
|
List<IcPartyPlaceTreeResultDTO> resultDTOS = new ArrayList<>(); |
|
|
|
|
|
|
|
String parentId = "0"; |
|
|
|
|
|
|
|
if (params.get("parentId") != null){ |
|
|
|
parentId = (String) params.get("parentId"); |
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<IcPartyPlaceEntity> queryWrapperP = new LambdaQueryWrapper<>(); |
|
|
|
// queryWrapperP.eq(IcPartyPlaceEntity::getParentId,0).orderByAsc(IcPartyPlaceEntity::getSort);
|
|
|
|
queryWrapperP.eq(IcPartyPlaceEntity::getParentId,0); |
|
|
|
queryWrapperP.eq(IcPartyPlaceEntity::getParentId,parentId); |
|
|
|
if (params.get("type") !=null){ |
|
|
|
queryWrapperP.eq(IcPartyPlaceEntity::getType,params.get("type")); |
|
|
|
} |
|
|
|
queryWrapperP.orderByAsc(IcPartyPlaceEntity::getSort); |
|
|
|
List<IcPartyPlaceEntity> entityPList = baseDao.selectList(queryWrapperP); |
|
|
|
if (entityPList.size() > 0){ |
|
|
|
return ConvertUtils.sourceToTarget(entityPList, IcPartyPlaceTreeResultDTO.class); |
|
|
|
} |
|
|
|
/*if (entityPList.size() > 0){ |
|
|
|
resultDTOS = ConvertUtils.sourceToTarget(entityPList,IcPartyPlaceTreeResultDTO.class); |
|
|
|
resultDTOS.forEach(result->{ |
|
|
|
|
|
|
@ -114,26 +124,33 @@ public class IcPartyPlaceServiceImpl extends BaseServiceImpl<IcPartyPlaceDao, Ic |
|
|
|
queryWrapper.eq(IcPartyPlaceEntity::getParentId,result.getId()).orderByAsc(IcPartyPlaceEntity::getSort);; |
|
|
|
List<IcPartyPlaceEntity> entityList = baseDao.selectList(queryWrapper); |
|
|
|
if (entityList.size() > 0){ |
|
|
|
result.setChildren(ConvertUtils.sourceToTarget(entityList, IcPartyPlaceDTO.class)); |
|
|
|
result.setChildren(ConvertUtils.sourceToTarget(entityList, IcPartyPlaceTreeResultDTO.class)); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
return resultDTOS; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<IcPartyPlaceTreeResultDTO> selectPartyPlaceList(Integer type) { |
|
|
|
public List<IcPartyPlaceTreeResultDTO> selectPartyPlaceList(Integer type,String parentId) { |
|
|
|
List<IcPartyPlaceTreeResultDTO> resultDTOS = new ArrayList<>(); |
|
|
|
|
|
|
|
if (StringUtil.isBlank(parentId)){ |
|
|
|
parentId = "0"; |
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<IcPartyPlaceEntity> queryWrapperP = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapperP.eq(IcPartyPlaceEntity::getParentId,0); |
|
|
|
queryWrapperP.eq(IcPartyPlaceEntity::getParentId,"0"); |
|
|
|
if (type !=null){ |
|
|
|
queryWrapperP.eq(IcPartyPlaceEntity::getType,type); |
|
|
|
} |
|
|
|
queryWrapperP.orderByAsc(IcPartyPlaceEntity::getSort); |
|
|
|
|
|
|
|
List<IcPartyPlaceEntity> entityPList = baseDao.selectList(queryWrapperP); |
|
|
|
entityPList.forEach(entity->{ |
|
|
|
entity.setDescription(""); |
|
|
|
}); |
|
|
|
if (entityPList.size() > 0){ |
|
|
|
resultDTOS = ConvertUtils.sourceToTarget(entityPList,IcPartyPlaceTreeResultDTO.class); |
|
|
|
resultDTOS.forEach(result->{ |
|
|
@ -141,13 +158,35 @@ public class IcPartyPlaceServiceImpl extends BaseServiceImpl<IcPartyPlaceDao, Ic |
|
|
|
LambdaQueryWrapper<IcPartyPlaceEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(IcPartyPlaceEntity::getParentId,result.getId()).orderByAsc(IcPartyPlaceEntity::getSort);; |
|
|
|
List<IcPartyPlaceEntity> entityList = baseDao.selectList(queryWrapper); |
|
|
|
if (entityList.size() > 0){ |
|
|
|
result.setChildren(ConvertUtils.sourceToTarget(entityList, IcPartyPlaceDTO.class)); |
|
|
|
if (entityList.size()>0){ |
|
|
|
List<IcPartyPlaceTreeResultDTO> entityListDtos = ConvertUtils.sourceToTarget(entityList,IcPartyPlaceTreeResultDTO.class); |
|
|
|
entityListDtos.forEach(result2->{ |
|
|
|
result2.setDescription(""); |
|
|
|
LambdaQueryWrapper<IcPartyPlaceEntity> queryWrapper2 = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper2.eq(IcPartyPlaceEntity::getParentId,result2.getId()).orderByAsc(IcPartyPlaceEntity::getSort);; |
|
|
|
List<IcPartyPlaceEntity> entityList2 = baseDao.selectList(queryWrapper2); |
|
|
|
entityList2.forEach(entity2->{ |
|
|
|
entity2.setDescription(""); |
|
|
|
}); |
|
|
|
if (entityList2.size() > 0){ |
|
|
|
result2.setChildren(ConvertUtils.sourceToTarget(entityList2, IcPartyPlaceTreeResultDTO.class)); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (entityListDtos.size() > 0){ |
|
|
|
result.setChildren(entityListDtos); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return resultDTOS; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public IcPartyPlaceTreeResultDTO selectPartyPlaceDetail(String placeId) { |
|
|
|
|
|
|
|
IcPartyPlaceEntity entity = baseDao.selectById(placeId); |
|
|
|
|
|
|
|
return ConvertUtils.sourceToTarget(entity,IcPartyPlaceTreeResultDTO.class); |
|
|
|
} |
|
|
|
|
|
|
|
} |