不良信息提交
parent
56a0ee0935
commit
1642e226ac
@ -0,0 +1,126 @@
|
||||
package com.glxp.api.controller.anno;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.stat.AnncmntManuCertEntity;
|
||||
import com.glxp.api.entity.stat.AnncmntManuEntity;
|
||||
import com.glxp.api.req.anno.AnncmntDevEntityRequest;
|
||||
import com.glxp.api.req.anno.AnncmntManuCertEntityRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.stat.AnncmntManuCertService;
|
||||
import com.glxp.api.service.stat.AnncmntManuService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/anno/anncmnt/manu/cert")
|
||||
public class AnncmntManuCertController extends BaseController {
|
||||
|
||||
private final AnncmntManuCertService anncmntManuCertService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(AnncmntManuCertEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
IPage page = new Page(request.getPage(),request.getLimit());
|
||||
IPage<AnncmntManuCertEntity> pages = anncmntManuCertService.page(page, getQueryWrapper(request));
|
||||
PageSimpleResponse<AnncmntManuCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(pages.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody AnncmntManuCertEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
boolean b = anncmntManuCertService.save(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid AnncmntManuCertEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
AnncmntManuCertEntity originEntity = anncmntManuCertService.getById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntManuCertService.updateById(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntManuCertService.removeById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
public static QueryWrapper<AnncmntManuCertEntity> getQueryWrapper(AnncmntManuCertEntityRequest request) {
|
||||
AnncmntManuCertEntity entity = new AnncmntManuCertEntity();
|
||||
BeanCopyUtils.copy(request, entity);
|
||||
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
package com.glxp.api.controller.anno;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.anno.AnncmntDevEntity;
|
||||
import com.glxp.api.entity.stat.AnncmntManuEntity;
|
||||
import com.glxp.api.req.anno.AnncmntDevEntityRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.anno.AnncmntDevService;
|
||||
import com.glxp.api.service.stat.AnncmntManuService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/anno/anncmnt/manu")
|
||||
public class AnncmntManuController extends BaseController {
|
||||
|
||||
private final AnncmntManuService anncmntManuService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(AnncmntDevEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
IPage page = new Page(request.getPage(),request.getLimit());
|
||||
IPage<AnncmntManuEntity> pages = anncmntManuService.page(page, getQueryWrapper(request));
|
||||
PageSimpleResponse<AnncmntManuEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(pages.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody AnncmntManuEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
boolean b = anncmntManuService.save(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid AnncmntManuEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
AnncmntManuEntity originEntity = anncmntManuService.getById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntManuService.updateById(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntManuService.removeById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
public static QueryWrapper<AnncmntManuEntity> getQueryWrapper(AnncmntDevEntityRequest request) {
|
||||
AnncmntManuEntity entity = new AnncmntManuEntity();
|
||||
BeanCopyUtils.copy(request, entity);
|
||||
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package com.glxp.api.controller.anno;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.stat.AnncmntManuCertEntity;
|
||||
import com.glxp.api.entity.stat.AnncmntProductBatchEntity;
|
||||
import com.glxp.api.req.anno.AnncmntManuCertEntityRequest;
|
||||
import com.glxp.api.req.anno.AnncmntProductBatchEntityRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.stat.AnncmntManuCertService;
|
||||
import com.glxp.api.service.stat.AnncmntProductBatchService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/anno/anncmnt/product/batch")
|
||||
public class AnncmntProductBatchController extends BaseController {
|
||||
|
||||
private final AnncmntProductBatchService anncmntProductBatchService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(AnncmntProductBatchEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
IPage page = new Page(request.getPage(),request.getLimit());
|
||||
IPage<AnncmntProductBatchEntity> pages = anncmntProductBatchService.page(page, getQueryWrapper(request));
|
||||
PageSimpleResponse<AnncmntProductBatchEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(pages.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody AnncmntProductBatchEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
boolean b = anncmntProductBatchService.save(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid AnncmntProductBatchEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
AnncmntProductBatchEntity originEntity = anncmntProductBatchService.getById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntProductBatchService.updateById(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntProductBatchService.removeById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
public static QueryWrapper<AnncmntProductBatchEntity> getQueryWrapper(AnncmntProductBatchEntityRequest request) {
|
||||
AnncmntProductBatchEntity entity = new AnncmntProductBatchEntity();
|
||||
BeanCopyUtils.copy(request, entity);
|
||||
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,126 @@
|
||||
package com.glxp.api.controller.anno;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.entity.stat.AnncmntManuEntity;
|
||||
import com.glxp.api.entity.stat.AnncmntProductEntity;
|
||||
import com.glxp.api.req.anno.AnncmntDevEntityRequest;
|
||||
import com.glxp.api.req.anno.AnncmntProductEntityRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.stat.AnncmntManuService;
|
||||
import com.glxp.api.service.stat.AnncmntProductService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/anno/anncmnt/product")
|
||||
public class AnncmntProductController extends BaseController {
|
||||
|
||||
private final AnncmntProductService anncmntProductService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(AnncmntProductEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
IPage page = new Page(request.getPage(),request.getLimit());
|
||||
IPage<AnncmntProductEntity> pages = anncmntProductService.page(page, getQueryWrapper(request));
|
||||
PageSimpleResponse<AnncmntProductEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(pages.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody AnncmntProductEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
boolean b = anncmntProductService.save(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid AnncmntProductEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
AnncmntProductEntity originEntity = anncmntProductService.getById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntProductService.updateById(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntProductService.removeById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
public static QueryWrapper<AnncmntProductEntity> getQueryWrapper(AnncmntProductEntityRequest request) {
|
||||
AnncmntProductEntity entity = new AnncmntProductEntity();
|
||||
BeanCopyUtils.copy(request, entity);
|
||||
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package com.glxp.api.controller.anno;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.dto.DictDto;
|
||||
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
||||
import com.glxp.api.entity.stat.AnncmntYlqxzcrEntity;
|
||||
import com.glxp.api.req.anno.AnncmntYlqxzcrEntityRequest;
|
||||
import com.glxp.api.req.auth.FilterInvWarehouseRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.stat.AnncmntYlqxzcrService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/anno/anncmnt/ylqxzcr")
|
||||
public class AnncmntYlqxzcrController extends BaseController {
|
||||
|
||||
private final AnncmntYlqxzcrService anncmntYlqxzcrService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(AnncmntYlqxzcrEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
IPage page = new Page(request.getPage(),request.getLimit());
|
||||
IPage<AnncmntYlqxzcrEntity> pages = anncmntYlqxzcrService.page(page, getQueryWrapper(request));
|
||||
PageSimpleResponse<AnncmntYlqxzcrEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(pages.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody AnncmntYlqxzcrEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setUdpateTime(new Date());
|
||||
boolean b = anncmntYlqxzcrService.save(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid AnncmntYlqxzcrEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
AnncmntYlqxzcrEntity originEntity = anncmntYlqxzcrService.getById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
entity.setUdpateTime(new Date());
|
||||
boolean b = anncmntYlqxzcrService.updateById(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntYlqxzcrService.removeById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
public static QueryWrapper<AnncmntYlqxzcrEntity> getQueryWrapper(AnncmntYlqxzcrEntityRequest request) {
|
||||
AnncmntYlqxzcrEntity entity = new AnncmntYlqxzcrEntity();
|
||||
BeanCopyUtils.copy(request, entity);
|
||||
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("getList")
|
||||
public BaseResponse getList(AnncmntYlqxzcrEntityRequest request) {
|
||||
List<AnncmntYlqxzcrEntity> list = anncmntYlqxzcrService.list();
|
||||
List<DictDto> reList = list.stream().map(s-> {
|
||||
DictDto dictDto = new DictDto(s.getCreditCode(),s.getName());
|
||||
return dictDto;
|
||||
}).collect(Collectors.toList());
|
||||
return ResultVOUtils.success(reList);
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package com.glxp.api.controller.anno;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.annotation.Log;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BusinessType;
|
||||
import com.glxp.api.controller.BaseController;
|
||||
import com.glxp.api.dto.DictDto;
|
||||
import com.glxp.api.entity.stat.AnncmntYlqxzcrEntity;
|
||||
import com.glxp.api.entity.stat.AnncmntYlqxzczhEntity;
|
||||
import com.glxp.api.req.anno.AnncmntYlqxzcrEntityRequest;
|
||||
import com.glxp.api.req.anno.AnncmntYlqxzczhEntityRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.stat.AnncmntYlqxzcrService;
|
||||
import com.glxp.api.service.stat.AnncmntYlqxzczhService;
|
||||
import com.glxp.api.util.BeanCopyUtils;
|
||||
import com.glxp.api.util.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
*/
|
||||
@ApiIgnore
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/anno/anncmnt/ylqxzczh")
|
||||
public class AnncmntYlqxzczhController extends BaseController {
|
||||
|
||||
private final AnncmntYlqxzczhService anncmntYlqxzczhService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list(AnncmntYlqxzczhEntityRequest request, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
IPage page = new Page(request.getPage(),request.getLimit());
|
||||
IPage<AnncmntYlqxzczhEntity> pages = anncmntYlqxzczhService.page(page, getQueryWrapper(request));
|
||||
PageSimpleResponse<AnncmntYlqxzczhEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pages.getTotal());
|
||||
pageSimpleResponse.setList(pages.getRecords());
|
||||
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/save")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||
public BaseResponse save(@RequestBody AnncmntYlqxzczhEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setUdpateTime(new Date());
|
||||
boolean b = anncmntYlqxzczhService.save(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/edit")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.UPDATE)
|
||||
public BaseResponse edit(@RequestBody @Valid AnncmntYlqxzczhEntity entity,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (entity.getId() == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
AnncmntYlqxzczhEntity originEntity = anncmntYlqxzczhService.getById(entity.getId());
|
||||
if (originEntity == null) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
entity.setUdpateTime(new Date());
|
||||
boolean b = anncmntYlqxzczhService.updateById(entity);
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("修改成功!");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/delete")
|
||||
@Log(title = "器械公告管理", businessType = BusinessType.DELETE)
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
if (StringUtils.isEmpty(deleteRequest.getId())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
boolean b = anncmntYlqxzczhService.removeById(deleteRequest.getId());
|
||||
|
||||
if (!b) {
|
||||
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
public static QueryWrapper<AnncmntYlqxzczhEntity> getQueryWrapper(AnncmntYlqxzczhEntityRequest request) {
|
||||
AnncmntYlqxzczhEntity entity = new AnncmntYlqxzczhEntity();
|
||||
BeanCopyUtils.copy(request, entity);
|
||||
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
@GetMapping("getList")
|
||||
public BaseResponse getList(AnncmntYlqxzcrEntityRequest request) {
|
||||
List<AnncmntYlqxzczhEntity> list = anncmntYlqxzczhService.list();
|
||||
List<DictDto> reList = list.stream().map(s-> {
|
||||
DictDto dictDto = new DictDto(s.getRegCreditCode(),s.getRegCompanyName());
|
||||
return dictDto;
|
||||
}).collect(Collectors.toList());
|
||||
return ResultVOUtils.success(reList);
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.glxp.api.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DictDto {
|
||||
|
||||
private String code;
|
||||
private String label;
|
||||
|
||||
public DictDto(String code, String label) {
|
||||
this.code = code;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public DictDto(Integer code, String label) {
|
||||
this.code = code.toString();
|
||||
this.label = label;
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.glxp.api.req.anno;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AnncmntProductBatchEntityRequest extends ListPageRequest {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 产品Id外键
|
||||
*/
|
||||
private String productIdFk;
|
||||
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private Integer batchNo;
|
||||
|
||||
/**
|
||||
* 生产日期
|
||||
*/
|
||||
private String productionDate;
|
||||
|
||||
/**
|
||||
* 失效日期
|
||||
*/
|
||||
private String expireDate;
|
||||
|
||||
/**
|
||||
* 批次状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 异常类型
|
||||
*/
|
||||
private String errType;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String errMsg;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date udpateTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 暂停使用时间
|
||||
*/
|
||||
private Date pauseStartTime;
|
||||
|
||||
/**
|
||||
* 恢复使用时间
|
||||
*/
|
||||
private Date pauseEndTime;
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.glxp.api.req.anno;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AnncmntProductEntityRequest extends ListPageRequest {
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 产品通用名称
|
||||
*/
|
||||
private String productName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String ggxh;
|
||||
|
||||
/**
|
||||
* di/产品标识
|
||||
*/
|
||||
private String nameCode;
|
||||
|
||||
/**
|
||||
* 医疗器械注册备案人
|
||||
*/
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
/**
|
||||
* 注册人统一社会信用号
|
||||
*/
|
||||
private String regCreditCode;
|
||||
|
||||
/**
|
||||
* 生产企业
|
||||
*/
|
||||
private String manuName;
|
||||
|
||||
/**
|
||||
* 生产企业统一社会信用代码
|
||||
*/
|
||||
private String manuCreditCode;
|
||||
|
||||
/**
|
||||
* 产品状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 异常类型
|
||||
*/
|
||||
private String errType;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String errMsg;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private Date updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date udpateTime;
|
||||
|
||||
/**
|
||||
* 暂停使用时间
|
||||
*/
|
||||
private Date pauseStartTime;
|
||||
|
||||
/**
|
||||
* 恢复使用时间
|
||||
*/
|
||||
private Date pauseEndTime;
|
||||
}
|
Loading…
Reference in New Issue