|
|
|
package com.ruoyi.programManagement.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.programManagement.entity.BPlanEnterprise;
|
|
|
|
import com.ruoyi.programManagement.entity.request.checkResultRequest;
|
|
|
|
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.io.Serializable;
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询所有数据
|
|
|
|
*
|
|
|
|
* @return 所有数据
|
|
|
|
*/
|
|
|
|
@GetMapping
|
|
|
|
@ApiOperation(value = "查询计划企业表", response = BPlanEnterprise.class)
|
|
|
|
public AjaxResult page() {
|
|
|
|
return success(bPlanEnterpriseService.page());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 通过主键查询单条数据
|
|
|
|
*
|
|
|
|
* @param id 主键
|
|
|
|
* @return 单条数据
|
|
|
|
*/
|
|
|
|
@GetMapping("{id}")
|
|
|
|
@ApiOperation(value = "通过主键查询单条计划企业表", response = BPlanEnterprise.class)
|
|
|
|
public AjaxResult getById(@PathVariable Serializable id) {
|
|
|
|
return success(bPlanEnterpriseService.getById(id));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增数据
|
|
|
|
*
|
|
|
|
* @param bPlanEnterprise 实体对象
|
|
|
|
* @return 新增结果
|
|
|
|
*/
|
|
|
|
@PostMapping
|
|
|
|
@ApiOperation(value = "新增计划企业表", response = BPlanEnterprise.class)
|
|
|
|
public AjaxResult insert(@RequestBody BPlanEnterprise bPlanEnterprise) {
|
|
|
|
bPlanEnterprise.setCreateId(getDeptId());
|
|
|
|
return success(bPlanEnterpriseService.save(bPlanEnterprise));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改数据
|
|
|
|
*
|
|
|
|
* @param bPlanEnterprise 实体对象
|
|
|
|
* @return 修改结果
|
|
|
|
*/
|
|
|
|
@PutMapping
|
|
|
|
@ApiOperation(value = "修改计划企业表")
|
|
|
|
public AjaxResult update(@RequestBody BPlanEnterprise bPlanEnterprise) {
|
|
|
|
bPlanEnterprise.setUpdateId(getDeptId());
|
|
|
|
return success(bPlanEnterpriseService.updateById(bPlanEnterprise));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除数据
|
|
|
|
*
|
|
|
|
* @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 = "执法结果-企业详情")
|
|
|
|
public AjaxResult getZhifa(@Valid checkResultRequest req) {
|
|
|
|
return success(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(response, list, "导出计划管理");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|