|
|
|
package com.ruoyi.programManagement.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
import com.ruoyi.programManagement.entity.BPlanEnterprise;
|
|
|
|
import com.ruoyi.programManagement.entity.request.checkResultRequest;
|
|
|
|
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.DeleteMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
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;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 分页条件查询所有数据
|
|
|
|
*
|
|
|
|
* @param page 分页条件
|
|
|
|
* @param bPlanEnterprise 查询条件
|
|
|
|
* @return 所有数据
|
|
|
|
*/
|
|
|
|
@GetMapping
|
|
|
|
@ApiOperation(value = "分页条件查询计划企业表", response = BPlanEnterprise.class)
|
|
|
|
public AjaxResult page(Page<BPlanEnterprise> page, BPlanEnterprise bPlanEnterprise) {
|
|
|
|
return success(bPlanEnterpriseService.page(page, new QueryWrapper<>(bPlanEnterprise)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 通过主键查询单条数据
|
|
|
|
*
|
|
|
|
* @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) {
|
|
|
|
return success(bPlanEnterpriseService.save(bPlanEnterprise));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改数据
|
|
|
|
*
|
|
|
|
* @param bPlanEnterprise 实体对象
|
|
|
|
* @return 修改结果
|
|
|
|
*/
|
|
|
|
@PutMapping
|
|
|
|
@ApiOperation(value = "修改计划企业表")
|
|
|
|
public AjaxResult update(@RequestBody BPlanEnterprise bPlanEnterprise) {
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|