|
|
|
@ -1,43 +1,31 @@
|
|
|
|
|
package com.ruoyi.programManagement.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.programManagement.entity.SzsAdministrativeDivision;
|
|
|
|
|
import com.ruoyi.programManagement.entity.request.BAdministrativeTreeRequest;
|
|
|
|
|
import com.ruoyi.programManagement.service.ISzsAdministrativeDivisionService;
|
|
|
|
|
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.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.programManagement.service.ISzsAdministrativeDivisionService;
|
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 省-工业企业风险评估上报系统_行政区划字典Controller
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
* @date 2023-10-17
|
|
|
|
|
*/
|
|
|
|
|
@Api(tags = "省-工业企业风险评估上报系统_行政区划")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/pharmaceuticals/administrative")
|
|
|
|
|
public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
public class SzsAdministrativeDivisionController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private ISzsAdministrativeDivisionService szsAdministrativeDivisionService;
|
|
|
|
|
|
|
|
|
@ -46,8 +34,7 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
|
|
public TableDataInfo list(SzsAdministrativeDivision szsAdministrativeDivision)
|
|
|
|
|
{
|
|
|
|
|
public TableDataInfo list(SzsAdministrativeDivision szsAdministrativeDivision) {
|
|
|
|
|
startPage();
|
|
|
|
|
List<SzsAdministrativeDivision> list = szsAdministrativeDivisionService.selectSzsAdministrativeDivisionList(szsAdministrativeDivision);
|
|
|
|
|
return getDataTable(list);
|
|
|
|
@ -58,8 +45,7 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@PostMapping("/export")
|
|
|
|
|
public void export(HttpServletResponse response, SzsAdministrativeDivision szsAdministrativeDivision)
|
|
|
|
|
{
|
|
|
|
|
public void export(HttpServletResponse response, SzsAdministrativeDivision szsAdministrativeDivision) {
|
|
|
|
|
List<SzsAdministrativeDivision> list = szsAdministrativeDivisionService.selectSzsAdministrativeDivisionList(szsAdministrativeDivision);
|
|
|
|
|
ExcelUtil<SzsAdministrativeDivision> util = new ExcelUtil<SzsAdministrativeDivision>(SzsAdministrativeDivision.class);
|
|
|
|
|
util.exportExcel(response, list, "省-工业企业风险评估上报系统_行政区划字典数据");
|
|
|
|
@ -70,8 +56,7 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/{ID}")
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("ID") String ID)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult getInfo(@PathVariable("ID") String ID) {
|
|
|
|
|
return success(szsAdministrativeDivisionService.selectSzsAdministrativeDivisionByID(ID));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -79,8 +64,7 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
* 新增省-工业企业风险评估上报系统_行政区划字典
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping
|
|
|
|
|
public AjaxResult add(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult add(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision) {
|
|
|
|
|
return toAjax(szsAdministrativeDivisionService.insertSzsAdministrativeDivision(szsAdministrativeDivision));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -89,8 +73,7 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@PutMapping
|
|
|
|
|
public AjaxResult edit(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision)
|
|
|
|
|
{
|
|
|
|
|
public AjaxResult edit(@RequestBody SzsAdministrativeDivision szsAdministrativeDivision) {
|
|
|
|
|
return toAjax(szsAdministrativeDivisionService.updateSzsAdministrativeDivision(szsAdministrativeDivision));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -98,14 +81,12 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
* 删除省-工业企业风险评估上报系统_行政区划字典
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/{IDs}")
|
|
|
|
|
public AjaxResult remove(@PathVariable String[] IDs)
|
|
|
|
|
{
|
|
|
|
|
@DeleteMapping("/{IDs}")
|
|
|
|
|
public AjaxResult remove(@PathVariable String[] IDs) {
|
|
|
|
|
return toAjax(szsAdministrativeDivisionService.deleteSzsAdministrativeDivisionByIDs(IDs));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 行政区划树结构
|
|
|
|
|
*/
|
|
|
|
@ -118,7 +99,7 @@ public class SzsAdministrativeDivisionController extends BaseController
|
|
|
|
|
for (BAdministrativeTreeRequest item1 : list) {
|
|
|
|
|
BAdministrativeTreeRequest parentDto = new BAdministrativeTreeRequest(item1.getCounty(), item1.getSubdistrict(), item1.getInstitutionName());
|
|
|
|
|
for (BAdministrativeTreeRequest item2 : listsub) {
|
|
|
|
|
if (item2.getCounty()!=null && !item2.getCounty().equals("")){
|
|
|
|
|
if (item2.getCounty() != null && !item2.getCounty().equals("")) {
|
|
|
|
|
if (item2.getCounty().equals(item1.getSubdistrict())) {
|
|
|
|
|
BAdministrativeTreeRequest childDto = new BAdministrativeTreeRequest(item2.getCounty(), item2.getSubdistrict(), item2.getInstitutionName());
|
|
|
|
|
parentDto.addChild(childDto);
|
|
|
|
|