You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
197 lines
6.3 KiB
197 lines
6.3 KiB
package com.ruoyi.programManagement.controller;
|
|
|
|
|
|
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.BPlanEnterprise;
|
|
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
|
|
import com.ruoyi.programManagement.entity.request.BPlanEnterpriseRequest;
|
|
import com.ruoyi.programManagement.entity.request.PlanMxRequest;
|
|
import com.ruoyi.programManagement.entity.request.checkResultRequest;
|
|
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
|
|
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse;
|
|
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
|
|
import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper;
|
|
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.Valid;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 计划企业表(BPlanEnterprise)表控制层
|
|
*
|
|
* @author wu
|
|
* @since 2023-09-07 09:43:06
|
|
*/
|
|
@RestController
|
|
@RequestMapping("pharmaceuticals/bPlanEnterprise")
|
|
@Api(tags = "计划企业")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public class BPlanEnterpriseController extends BaseController {
|
|
/**
|
|
* 服务对象
|
|
*/
|
|
@Resource
|
|
private BPlanEnterpriseService bPlanEnterpriseService;
|
|
|
|
/**
|
|
* 计划企业表(BPlanEnterprise)表数据库访问层
|
|
*/
|
|
@Resource
|
|
private BPlanEnterpriseMapper bPlanEnterpriseMapper;
|
|
|
|
|
|
/**
|
|
* 查询计划企业列表
|
|
*/
|
|
@ApiOperation(value = "查询计划企业列表", response = BPlanEnterpriseResponse.class)
|
|
@GetMapping("/list")
|
|
public AjaxResult list(BPlanEnterprise bPlanEnterprise) {
|
|
List<BPlanEnterpriseResponse> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
|
|
return AjaxResult.success(list);
|
|
}
|
|
|
|
/**
|
|
* 查询首页
|
|
*/
|
|
@ApiOperation(value = "查询首页", response = BPlanEnterPriseTreeResponse.class)
|
|
@GetMapping("/tree")
|
|
public AjaxResult tree(BPlanEnterprisePageRequest req) {
|
|
return success(bPlanEnterpriseService.getShouyeList(req));
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
* 首页导出
|
|
*/
|
|
@ApiOperation(value = "首页导出")
|
|
@GetMapping("/exportpage")
|
|
public void exportpage(HttpServletResponse response, BPlanEnterprisePageRequest req) {
|
|
List<BPlanEnterPriseTreeResponse> list = bPlanEnterpriseService.getShouyeList(req);
|
|
ExcelUtil<BPlanEnterPriseTreeResponse> util = new ExcelUtil<BPlanEnterPriseTreeResponse>(BPlanEnterPriseTreeResponse.class);
|
|
util.exportExcel(response, list, "行政区划数据");
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* 通过主键查询单条数据
|
|
*
|
|
* @param id 主键
|
|
* @return 单条数据
|
|
*/
|
|
@GetMapping("{id}")
|
|
@ApiOperation(value = "通过主键查询单条计划企业表", response = BPlanEnterprise.class)
|
|
public AjaxResult getById(@PathVariable String id) {
|
|
return success(bPlanEnterpriseService.selectById(id));
|
|
}
|
|
|
|
/**
|
|
* 新增数据
|
|
*
|
|
* @param bPlanEnterprise 实体对象
|
|
* @return 新增结果
|
|
*/
|
|
@PostMapping
|
|
@ApiOperation(value = "新增计划企业表")
|
|
public AjaxResult insert(@RequestBody BPlanEnterpriseRequest bPlanEnterprise) {
|
|
bPlanEnterpriseService.insert(bPlanEnterprise);
|
|
return success();
|
|
}
|
|
|
|
/**
|
|
* 修改数据
|
|
*
|
|
* @param req 实体对象
|
|
* @return 修改结果
|
|
*/
|
|
@PutMapping
|
|
@ApiOperation(value = "修改计划企业表")
|
|
public AjaxResult update(@RequestBody BPlanEnterpriseRequest req) {
|
|
bPlanEnterpriseService.updatePlan(req);
|
|
return success();
|
|
}
|
|
|
|
/**
|
|
* 删除数据
|
|
*
|
|
* @param idList 主键集合
|
|
* @return 删除结果
|
|
*/
|
|
@DeleteMapping
|
|
@ApiOperation(value = "删除计划企业表")
|
|
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
|
|
return success(bPlanEnterpriseService.removeByIds(idList));
|
|
}
|
|
|
|
|
|
/**
|
|
* 执法结果-企业详情
|
|
*
|
|
* @param req 请求类
|
|
* @return
|
|
*/
|
|
@GetMapping("/getZhifa")
|
|
@ApiOperation(value = "执法结果-企业详情", response = BPlanEnterpriseZhifaResponse.class)
|
|
public TableDataInfo getZhifa(@Valid checkResultRequest req) {
|
|
startPage();
|
|
return getDataTable(bPlanEnterpriseService.getZhifa(req));
|
|
}
|
|
|
|
/**
|
|
* 导出执法结果
|
|
*/
|
|
@ApiOperation(value = "导出执法结果")
|
|
@PostMapping("/export")
|
|
public void export(HttpServletResponse response, checkResultRequest req) {
|
|
List<BPlanEnterpriseZhifaResponse> list = bPlanEnterpriseMapper.getZhifa(req);
|
|
ExcelUtil<BPlanEnterpriseZhifaResponse> util = new ExcelUtil<BPlanEnterpriseZhifaResponse>(BPlanEnterpriseZhifaResponse.class);
|
|
util.exportExcel(list, "导出执法结果");
|
|
}
|
|
|
|
/**
|
|
* 导出计划管理
|
|
*/
|
|
@ApiOperation(value = "导出计划管理")
|
|
@PostMapping("/exportplan")
|
|
public void exportplan(HttpServletResponse response, BPlanEnterprise bPlanEnterprise) {
|
|
List<BPlanEnterpriseResponse> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
|
|
ExcelUtil<BPlanEnterpriseResponse> util = new ExcelUtil<BPlanEnterpriseResponse>(BPlanEnterpriseResponse.class);
|
|
util.exportExcel(response, list, "计划管理数据");
|
|
}
|
|
|
|
/**
|
|
* 查看计划明细
|
|
*/
|
|
@ApiOperation(value = "查看计划明细")
|
|
@PostMapping("/planmx")
|
|
public AjaxResult planmx(PlanMxRequest req) {
|
|
|
|
return AjaxResult.success(bPlanEnterpriseService.getPlanMx(req));
|
|
}
|
|
|
|
|
|
/**
|
|
* 批量更新状态
|
|
*/
|
|
@ApiOperation(value = "批量更新状态")
|
|
@PostMapping("/updateIdList")
|
|
public AjaxResult updateIdList(@RequestParam("idListStr") String idListStr) {
|
|
List<String> idList = Arrays.asList(idListStr.split(","));
|
|
bPlanEnterpriseService.updateIdList(idList);
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|