| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.catalog.service.catalogService; |
| | | import org.springblade.modules.deploy.service.IDeployService; |
| | | import org.springblade.modules.equipment.vo.EquipmentVOS; |
| | | import org.springblade.modules.equipment.wrapper.EqWrapper; |
| | |
| | | |
| | | private final IEquipmentService equipmentService; |
| | | private final IDeployService iDeployService; |
| | | private final catalogService catalogService; |
| | | |
| | | /** |
| | | * 详情 |
| | |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入equipment") |
| | | public R<IPage<EquipmentVO>> page(EquipmentVO equipment, Query query) { |
| | | IPage<EquipmentVO> pages = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); |
| | | public R<IPage<EquipmentVO>> page(EquipmentVO equipment, Query query,String pid, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | IPage<EquipmentVO> pages; |
| | | if (pid==null){ |
| | | pages = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); |
| | | } |
| | | else { |
| | | String s = catalogService.selectCatalogEqNUmber(pid); |
| | | if(s==null){ |
| | | pages = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); |
| | | }else{ |
| | | String[] split = s.split(","); |
| | | String strArrays=""; |
| | | for(int i=0;i<split.length;i++){ |
| | | strArrays+="'"+split[i]+"',"; |
| | | } |
| | | String substring = strArrays.substring(0,strArrays.length()-1); |
| | | equipment.setDeviceNumber(substring); |
| | | pages = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); |
| | | } |
| | | |
| | | } |
| | | |
| | | return R.data(pages); |
| | | } |
| | | |