@ -1,26 +1,20 @@
package com.ruoyi.tcZz.controller ;
package com.ruoyi.tcZz.controller ;
import java.util.List ;
import javax.servlet.http.HttpServletResponse ;
import com.ruoyi.tcZz.domain.TcFb ;
import com.ruoyi.tcZz.domain.TcSgjipTop5 ;
import com.ruoyi.tcZz.domain.TcWljg ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.ApiOperation ;
import org.springframework.security.access.prepost.PreAuthorize ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.web.bind.annotation.* ;
import com.ruoyi.common.annotation.Log ;
import com.ruoyi.common.core.controller.BaseController ;
import com.ruoyi.common.core.controller.BaseController ;
import com.ruoyi.common.core.domain.AjaxResult ;
import com.ruoyi.common.core.domain.AjaxResult ;
import com.ruoyi.common.enums.BusinessType ;
import com.ruoyi.common.core.page.TableDataInfo ;
import com.ruoyi.common.utils.poi.ExcelUtil ;
import com.ruoyi.tcZz.domain.TcFbqk ;
import com.ruoyi.tcZz.domain.TcFbqk ;
import com.ruoyi.tcZz.service.ITcFbqkService ;
import com.ruoyi.tcZz.service.ITcFbqkService ;
import com.ruoyi.common.utils.poi.ExcelUtil ;
import io.swagger.annotations.Api ;
import com.ruoyi.common.core.page.TableDataInfo ;
import io.swagger.annotations.ApiOperation ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.web.bind.annotation.* ;
import org.springframework.web.multipart.MultipartFile ;
import org.springframework.web.multipart.MultipartFile ;
import javax.servlet.http.HttpServletResponse ;
import java.util.List ;
/ * *
/ * *
* 分 布 情 况 tc_fbqkController
* 分 布 情 况 tc_fbqkController
*
*
@ -30,18 +24,16 @@ import org.springframework.web.multipart.MultipartFile;
@RestController
@RestController
@Api ( tags = "分布情况" )
@Api ( tags = "分布情况" )
@RequestMapping ( "/tcZz/networkSecurity/fbqk" )
@RequestMapping ( "/tcZz/networkSecurity/fbqk" )
public class TcFbqkController extends BaseController
public class TcFbqkController extends BaseController {
{
@Autowired
@Autowired
private ITcFbqkService tcFbqkService ;
private ITcFbqkService tcFbqkService ;
/ * *
/ * *
* 查 询 分 布 情 况 tc_fbqk 列 表
* 查 询 分 布 情 况 tc_fbqk 列 表
* /
* /
@ApiOperation ( value = "查询分布情况列表" , response = TcFbqk . class )
@ApiOperation ( value = "查询分布情况列表" , response = TcFbqk . class )
@GetMapping ( "/list" )
@GetMapping ( "/list" )
public TableDataInfo list ( TcFbqk tcFbqk )
public TableDataInfo list ( TcFbqk tcFbqk ) {
{
startPage ( ) ;
startPage ( ) ;
List < TcFbqk > list = tcFbqkService . selectTcFbqkList ( tcFbqk ) ;
List < TcFbqk > list = tcFbqkService . selectTcFbqkList ( tcFbqk ) ;
return getDataTable ( list ) ;
return getDataTable ( list ) ;
@ -52,8 +44,7 @@ public class TcFbqkController extends BaseController
* /
* /
@ApiOperation ( value = "导出分布情况列表" )
@ApiOperation ( value = "导出分布情况列表" )
@PostMapping ( "/export" )
@PostMapping ( "/export" )
public void export ( HttpServletResponse response , TcFbqk tcFbqk )
public void export ( HttpServletResponse response , TcFbqk tcFbqk ) {
{
List < TcFbqk > list = tcFbqkService . selectTcFbqkList ( tcFbqk ) ;
List < TcFbqk > list = tcFbqkService . selectTcFbqkList ( tcFbqk ) ;
ExcelUtil < TcFbqk > util = new ExcelUtil < TcFbqk > ( TcFbqk . class ) ;
ExcelUtil < TcFbqk > util = new ExcelUtil < TcFbqk > ( TcFbqk . class ) ;
util . exportExcel ( response , list , "分布情况 tc_fbqk数据" ) ;
util . exportExcel ( response , list , "分布情况 tc_fbqk数据" ) ;
@ -64,8 +55,7 @@ public class TcFbqkController extends BaseController
* /
* /
@ApiOperation ( value = "获取分布情况详细信息" )
@ApiOperation ( value = "获取分布情况详细信息" )
@GetMapping ( value = "/{id}" )
@GetMapping ( value = "/{id}" )
public AjaxResult getInfo ( @PathVariable ( "id" ) Long id )
public AjaxResult getInfo ( @PathVariable ( "id" ) Long id ) {
{
return success ( tcFbqkService . selectTcFbqkById ( id ) ) ;
return success ( tcFbqkService . selectTcFbqkById ( id ) ) ;
}
}
@ -74,18 +64,17 @@ public class TcFbqkController extends BaseController
* /
* /
@ApiOperation ( value = "新增分布情况" )
@ApiOperation ( value = "新增分布情况" )
@PostMapping
@PostMapping
public AjaxResult add ( @RequestBody TcFbqk tcFbqk )
public AjaxResult add ( @RequestBody TcFbqk tcFbqk ) {
{
//根据City_name判断如果已存在, 则调修改
//根据City_name判断如果已存在, 则调修改
TcFbqk newtcFbqk = new TcFbqk ( ) ;
TcFbqk newtcFbqk = new TcFbqk ( ) ;
newtcFbqk . setCityName ( tcFbqk . getCityName ( ) ) ;
newtcFbqk . setCityName ( tcFbqk . getCityName ( ) ) ;
List < TcFbqk > list = tcFbqkService . selectTcFbqkList ( newtcFbqk ) ;
List < TcFbqk > list = tcFbqkService . selectTcFbqkList ( newtcFbqk ) ;
if ( ! list . isEmpty ( ) ) {
if ( ! list . isEmpty ( ) ) {
for ( TcFbqk a : list ) {
for ( TcFbqk a : list ) {
tcFbqk . setId ( a . getId ( ) ) ;
tcFbqk . setId ( a . getId ( ) ) ;
tcFbqkService . updateTcFbqk ( tcFbqk ) ;
tcFbqkService . updateTcFbqk ( tcFbqk ) ;
}
}
} else {
} else {
tcFbqkService . insertTcFbqk ( tcFbqk ) ;
tcFbqkService . insertTcFbqk ( tcFbqk ) ;
}
}
return AjaxResult . success ( ) ;
return AjaxResult . success ( ) ;
@ -96,8 +85,7 @@ public class TcFbqkController extends BaseController
* /
* /
@ApiOperation ( value = "修改分布情况" )
@ApiOperation ( value = "修改分布情况" )
@PutMapping
@PutMapping
public AjaxResult edit ( @RequestBody TcFbqk tcFbqk )
public AjaxResult edit ( @RequestBody TcFbqk tcFbqk ) {
{
return toAjax ( tcFbqkService . updateTcFbqk ( tcFbqk ) ) ;
return toAjax ( tcFbqkService . updateTcFbqk ( tcFbqk ) ) ;
}
}
@ -105,9 +93,8 @@ public class TcFbqkController extends BaseController
* 删 除 分 布 情 况 tc_fbqk
* 删 除 分 布 情 况 tc_fbqk
* /
* /
@ApiOperation ( value = "删除分布情况" )
@ApiOperation ( value = "删除分布情况" )
@DeleteMapping ( "/{ids}" )
@DeleteMapping ( "/{ids}" )
public AjaxResult remove ( @PathVariable Long [ ] ids )
public AjaxResult remove ( @PathVariable Long [ ] ids ) {
{
return toAjax ( tcFbqkService . deleteTcFbqkByIds ( ids ) ) ;
return toAjax ( tcFbqkService . deleteTcFbqkByIds ( ids ) ) ;
}
}
@ -134,14 +121,13 @@ public class TcFbqkController extends BaseController
@ApiOperation ( "批量启用禁用" )
@ApiOperation ( "批量启用禁用" )
@GetMapping ( "/isStatus" )
@GetMapping ( "/isStatus" )
public AjaxResult isStatus ( @RequestParam ( "isStatus" ) Integer isStatus , @RequestParam ( "ids" ) List < String > ids ) {
public AjaxResult isStatus ( @RequestParam ( "isStatus" ) Integer isStatus , @RequestParam ( "ids" ) List < String > ids ) {
tcFbqkService . updateByisStatus ( isStatus , ids ) ;
tcFbqkService . updateByisStatus ( isStatus , ids ) ;
return AjaxResult . success ( ) ;
return AjaxResult . success ( ) ;
}
}
@ApiOperation ( "通用下载excel模板" )
@ApiOperation ( "通用下载excel模板" )
@PostMapping ( "/importTemplate" )
@PostMapping ( "/importTemplate" )
public void importTemplate ( HttpServletResponse response )
public void importTemplate ( HttpServletResponse response ) {
{
ExcelUtil < TcFbqk > util = new ExcelUtil < TcFbqk > ( TcFbqk . class ) ;
ExcelUtil < TcFbqk > util = new ExcelUtil < TcFbqk > ( TcFbqk . class ) ;
util . importTemplateExcel ( response , " 分布情况" ) ;
util . importTemplateExcel ( response , " 分布情况" ) ;
}
}