|
|
@ -8,6 +8,8 @@ import com.hnac.hzims.equipment.entity.EmInfoEntity; |
|
|
|
import com.hnac.hzims.equipment.service.IEmInfoService; |
|
|
|
import com.hnac.hzims.equipment.service.IEmInfoService; |
|
|
|
import com.hnac.hzims.equipment.vo.EmInfoAddVo; |
|
|
|
import com.hnac.hzims.equipment.vo.EmInfoAddVo; |
|
|
|
import com.hnac.hzims.equipment.vo.EmInfoVO; |
|
|
|
import com.hnac.hzims.equipment.vo.EmInfoVO; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -21,6 +23,7 @@ import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -29,6 +32,7 @@ import springfox.documentation.annotations.ApiIgnore; |
|
|
|
import javax.validation.Valid; |
|
|
|
import javax.validation.Valid; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设备控制器 |
|
|
|
* 设备控制器 |
|
|
@ -42,6 +46,7 @@ import java.util.Map; |
|
|
|
public class EmInfoController extends BladeController { |
|
|
|
public class EmInfoController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
private final IEmInfoService em_infoService; |
|
|
|
private final IEmInfoService em_infoService; |
|
|
|
|
|
|
|
private final IStationClient stationClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 详情 |
|
|
|
* 详情 |
|
|
@ -80,6 +85,20 @@ public class EmInfoController extends BladeController { |
|
|
|
QueryWrapper<EmInfoEntity> queryWrapper = Condition.getQueryWrapper(em_info, EmInfoEntity.class); |
|
|
|
QueryWrapper<EmInfoEntity> queryWrapper = Condition.getQueryWrapper(em_info, EmInfoEntity.class); |
|
|
|
queryWrapper.lambda().eq(EmInfoEntity::getGpid, 0); |
|
|
|
queryWrapper.lambda().eq(EmInfoEntity::getGpid, 0); |
|
|
|
IPage<EmInfoEntity> pages = em_infoService.page(Condition.getPage(query), queryWrapper); |
|
|
|
IPage<EmInfoEntity> pages = em_infoService.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(pages.getRecords())) { |
|
|
|
|
|
|
|
pages.getRecords().forEach(emInfoEntity -> { |
|
|
|
|
|
|
|
if(Func.isNotEmpty(emInfoEntity.getDepartment())) { |
|
|
|
|
|
|
|
StationEntity request = new StationEntity(); |
|
|
|
|
|
|
|
request.setRefDept(emInfoEntity.getDepartment()); |
|
|
|
|
|
|
|
R<StationEntity> result = stationClient.getOne(request); |
|
|
|
|
|
|
|
if(result.isSuccess() && ObjectUtil.isNotEmpty(result.getData())) { |
|
|
|
|
|
|
|
emInfoEntity.setStationCode(result.getData().getCode()); |
|
|
|
|
|
|
|
emInfoEntity.setStationType(result.getData().getType()); |
|
|
|
|
|
|
|
emInfoEntity.setStationName(result.getData().getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
return R.data(pages); |
|
|
|
return R.data(pages); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|