Browse Source

# 优化站点feign接口查询list接口

zhongwei
haungxing 2 years ago
parent
commit
178b8373b3
  1. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  2. 7
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java

@ -94,7 +94,7 @@ public class EmInfoController extends BladeController {
queryWrapper.lambda().eq(EmInfoEntity::getGpid, 0);
IPage<EmInfoEntity> pages = em_infoService.page(Condition.getPage(query), queryWrapper);
// 获取站点列表 - 填充站点编码、站点类型、站点名称
R<List<StationEntity>> stationListR = stationClient.getListAll();
R<List<StationEntity>> stationListR = stationClient.list(new StationEntity());
if(stationListR.isSuccess() && CollectionUtil.isNotEmpty(stationListR.getData())) {
List<StationEntity> stationList = stationListR.getData();
pages.getRecords().forEach(emInfoEntity -> {

7
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/feign/StationClient.java

@ -12,6 +12,7 @@ import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.user.entity.User;
import org.springframework.beans.factory.annotation.Value;
@ -102,8 +103,10 @@ public class StationClient implements IStationClient {
@ApiOperation("根据条件查询相关站点列表")
@ApiOperationSupport(order = 8)
public R<List<StationEntity>> list(StationEntity stationEntity) {
LambdaQueryWrapper<StationEntity> wrapper = Condition.getQueryWrapper(stationEntity,StationEntity.class);
wrapper.eq(StationEntity::getRefDept,stationEntity.getRefDept());
LambdaQueryWrapper<StationEntity> wrapper = Condition.getQueryWrapper(stationEntity).lambda();
if(Func.isNotEmpty(stationEntity.getStatus())) {
wrapper.eq(StationEntity::getStatus,stationEntity.getStatus());
}
return R.data(stationService.list(wrapper));
}

Loading…
Cancel
Save