汇总上报设置
parent
6a526991d9
commit
9ac9567b6c
@ -0,0 +1,131 @@
|
|||||||
|
package com.glxp.api.controller.stat;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
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.IoStatMonthEntity;
|
||||||
|
import com.glxp.api.entity.stat.IoStatSetEntity;
|
||||||
|
import com.glxp.api.req.stat.IoStatMonthEntityRequest;
|
||||||
|
import com.glxp.api.req.stat.IoStatSetEntityRequest;
|
||||||
|
import com.glxp.api.req.system.DeleteRequest;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.stat.IoStatMonthService;
|
||||||
|
import com.glxp.api.service.stat.IoStatSetService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ApiIgnore
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/stat/month")
|
||||||
|
public class IoStatMonthEntityController extends BaseController {
|
||||||
|
|
||||||
|
private final IoStatMonthService ioStatMonthService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public BaseResponse list(IoStatMonthEntityRequest request, BindingResult bindingResult) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
int offset = (request.getPage() - 1) * request.getLimit();
|
||||||
|
Page<IoStatMonthEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||||
|
List<IoStatMonthEntity> list = ioStatMonthService.list(getQueryWrapper(request));
|
||||||
|
PageSimpleResponse<IoStatMonthEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pages.getTotal());
|
||||||
|
pageSimpleResponse.setList(list);
|
||||||
|
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/save")
|
||||||
|
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||||
|
public BaseResponse save(@RequestBody IoStatMonthEntity entity,
|
||||||
|
BindingResult bindingResult) {
|
||||||
|
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
boolean b = ioStatMonthService.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 IoStatMonthEntity 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);
|
||||||
|
}
|
||||||
|
IoStatMonthEntity originEntity = ioStatMonthService.getById(entity.getId());
|
||||||
|
if (originEntity == null) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||||
|
}
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
boolean b = ioStatMonthService.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 = ioStatMonthService.removeById(deleteRequest.getId());
|
||||||
|
|
||||||
|
if (!b) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||||
|
}
|
||||||
|
return ResultVOUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static QueryWrapper<IoStatMonthEntity> getQueryWrapper(IoStatMonthEntityRequest request) {
|
||||||
|
IoStatMonthEntity entity = new IoStatMonthEntity();
|
||||||
|
BeanCopyUtils.copy(request, entity);
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
package com.glxp.api.controller.stat;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
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.IoStatOrderEntity;
|
||||||
|
import com.glxp.api.entity.stat.IoStatSetEntity;
|
||||||
|
import com.glxp.api.req.stat.IoStatOrderEntityRequest;
|
||||||
|
import com.glxp.api.req.stat.IoStatSetEntityRequest;
|
||||||
|
import com.glxp.api.req.system.DeleteRequest;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.stat.IoStatOrderService;
|
||||||
|
import com.glxp.api.service.stat.IoStatSetService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ApiIgnore
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/stat/order")
|
||||||
|
public class IoStatOrderEntityController extends BaseController {
|
||||||
|
|
||||||
|
private final IoStatOrderService ioStatOrderService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public BaseResponse list(IoStatOrderEntityRequest request, BindingResult bindingResult) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
int offset = (request.getPage() - 1) * request.getLimit();
|
||||||
|
Page<IoStatOrderEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||||
|
List<IoStatOrderEntity> list = ioStatOrderService.list(getQueryWrapper(request));
|
||||||
|
PageSimpleResponse<IoStatOrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pages.getTotal());
|
||||||
|
pageSimpleResponse.setList(list);
|
||||||
|
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/save")
|
||||||
|
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||||
|
public BaseResponse save(@RequestBody IoStatOrderEntity entity,
|
||||||
|
BindingResult bindingResult) {
|
||||||
|
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
boolean b = ioStatOrderService.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 IoStatOrderEntity 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);
|
||||||
|
}
|
||||||
|
IoStatOrderEntity originEntity = ioStatOrderService.getById(entity.getId());
|
||||||
|
if (originEntity == null) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||||
|
}
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
boolean b = ioStatOrderService.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 = ioStatOrderService.removeById(deleteRequest.getId());
|
||||||
|
|
||||||
|
if (!b) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||||
|
}
|
||||||
|
return ResultVOUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static QueryWrapper<IoStatOrderEntity> getQueryWrapper(IoStatOrderEntityRequest request) {
|
||||||
|
IoStatOrderEntity entity = new IoStatOrderEntity();
|
||||||
|
BeanCopyUtils.copy(request, entity);
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,134 @@
|
|||||||
|
package com.glxp.api.controller.stat;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
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.AnncmntManuEntity;
|
||||||
|
import com.glxp.api.entity.stat.IoStatSetEntity;
|
||||||
|
import com.glxp.api.req.anno.AnncmntManuEntityRequest;
|
||||||
|
import com.glxp.api.req.stat.IoStatSetEntityRequest;
|
||||||
|
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.IoStatSetService;
|
||||||
|
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("/stat/set")
|
||||||
|
public class IoStatSetController extends BaseController {
|
||||||
|
|
||||||
|
private final IoStatSetService ioStatSetService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public BaseResponse list(IoStatSetEntityRequest request, BindingResult bindingResult) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
int offset = (request.getPage() - 1) * request.getLimit();
|
||||||
|
Page<IoStatSetEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||||
|
List<IoStatSetEntity> list = ioStatSetService.list(getQueryWrapper(request));
|
||||||
|
PageSimpleResponse<IoStatSetEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pages.getTotal());
|
||||||
|
pageSimpleResponse.setList(list);
|
||||||
|
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/save")
|
||||||
|
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||||
|
public BaseResponse save(@RequestBody IoStatSetEntity entity,
|
||||||
|
BindingResult bindingResult) {
|
||||||
|
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
entity.setCreateTime(new Date());
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
boolean b = ioStatSetService.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 IoStatSetEntity 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);
|
||||||
|
}
|
||||||
|
IoStatSetEntity originEntity = ioStatSetService.getById(entity.getId());
|
||||||
|
if (originEntity == null) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||||
|
}
|
||||||
|
entity.setUpdateTime(new Date());
|
||||||
|
boolean b = ioStatSetService.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 = ioStatSetService.removeById(deleteRequest.getId());
|
||||||
|
|
||||||
|
if (!b) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||||
|
}
|
||||||
|
return ResultVOUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static QueryWrapper<IoStatSetEntity> getQueryWrapper(IoStatSetEntityRequest request) {
|
||||||
|
IoStatSetEntity entity = new IoStatSetEntity();
|
||||||
|
BeanCopyUtils.copy(request, entity);
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
package com.glxp.api.controller.stat;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
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.IoStatOrderEntity;
|
||||||
|
import com.glxp.api.entity.stat.IoStatSetDetailEntity;
|
||||||
|
import com.glxp.api.entity.stat.IoStatSetEntity;
|
||||||
|
import com.glxp.api.req.stat.IoStatOrderEntityRequest;
|
||||||
|
import com.glxp.api.req.stat.IoStatSetDetailEntityRequest;
|
||||||
|
import com.glxp.api.req.stat.IoStatSetEntityRequest;
|
||||||
|
import com.glxp.api.req.system.DeleteRequest;
|
||||||
|
import com.glxp.api.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.service.stat.IoStatSetDetailService;
|
||||||
|
import com.glxp.api.service.stat.IoStatSetService;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@ApiIgnore
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/stat/setDetail")
|
||||||
|
public class IoStatSetDetailEntityController extends BaseController {
|
||||||
|
|
||||||
|
private final IoStatSetDetailService ioStatSetDetailService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public BaseResponse list(IoStatSetDetailEntityRequest request, BindingResult bindingResult) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
int offset = (request.getPage() - 1) * request.getLimit();
|
||||||
|
Page<IoStatSetDetailEntity> pages = PageHelper.offsetPage(offset, request.getLimit());
|
||||||
|
List<IoStatSetDetailEntity> list = ioStatSetDetailService.list(getQueryWrapper(request));
|
||||||
|
PageSimpleResponse<IoStatSetDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pages.getTotal());
|
||||||
|
pageSimpleResponse.setList(list);
|
||||||
|
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/save")
|
||||||
|
@Log(title = "器械公告管理", businessType = BusinessType.INSERT)
|
||||||
|
public BaseResponse save(@RequestBody IoStatSetDetailEntity entity,
|
||||||
|
BindingResult bindingResult) {
|
||||||
|
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||||
|
}
|
||||||
|
boolean b = ioStatSetDetailService.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 IoStatSetDetailEntity 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);
|
||||||
|
}
|
||||||
|
IoStatSetDetailEntity originEntity = ioStatSetDetailService.getById(entity.getId());
|
||||||
|
if (originEntity == null) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||||
|
}
|
||||||
|
boolean b = ioStatSetDetailService.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 = ioStatSetDetailService.removeById(deleteRequest.getId());
|
||||||
|
|
||||||
|
if (!b) {
|
||||||
|
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
|
||||||
|
}
|
||||||
|
return ResultVOUtils.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static QueryWrapper<IoStatSetDetailEntity> getQueryWrapper(IoStatSetDetailEntityRequest request) {
|
||||||
|
IoStatSetDetailEntity entity = new IoStatSetDetailEntity();
|
||||||
|
BeanCopyUtils.copy(request, entity);
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper(entity);
|
||||||
|
return queryWrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,147 @@
|
|||||||
|
package com.glxp.api.req.stat;
|
||||||
|
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class IoStatMonthEntityRequest extends ListPageRequest {
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录号外键
|
||||||
|
*/
|
||||||
|
private String recordKeyFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度
|
||||||
|
*/
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 季度
|
||||||
|
*/
|
||||||
|
private Integer quarter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月份
|
||||||
|
*/
|
||||||
|
private Integer month;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物资编码主键
|
||||||
|
*/
|
||||||
|
private String relIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品DI
|
||||||
|
*/
|
||||||
|
private String nameCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
private String ggxh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次号
|
||||||
|
*/
|
||||||
|
private String batchNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 期初数量
|
||||||
|
*/
|
||||||
|
private Integer beginCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 期初价格
|
||||||
|
*/
|
||||||
|
private BigDecimal beginPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 期初金额
|
||||||
|
*/
|
||||||
|
private BigDecimal beginAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库数量
|
||||||
|
*/
|
||||||
|
private Integer inCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库价格
|
||||||
|
*/
|
||||||
|
private BigDecimal inPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库金额
|
||||||
|
*/
|
||||||
|
private BigDecimal inAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库数量
|
||||||
|
*/
|
||||||
|
private Integer outCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库价格
|
||||||
|
*/
|
||||||
|
private BigDecimal outPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库金额
|
||||||
|
*/
|
||||||
|
private BigDecimal outAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结余数量
|
||||||
|
*/
|
||||||
|
private Integer balanceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结余价格
|
||||||
|
*/
|
||||||
|
private BigDecimal balancePrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结余金额
|
||||||
|
*/
|
||||||
|
private BigDecimal balanceAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private String deptCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业ID
|
||||||
|
*/
|
||||||
|
private Long companyIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库编码
|
||||||
|
*/
|
||||||
|
private String invCode;
|
||||||
|
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
private String zczbhhzbapzbh;
|
||||||
|
private String ylqxzcrbarmc;
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.glxp.api.req.stat;
|
||||||
|
|
||||||
|
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 IoStatSetDetailEntityRequest extends ListPageRequest {
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品种名称
|
||||||
|
*/
|
||||||
|
private String cpmctymc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格型号
|
||||||
|
*/
|
||||||
|
private String ggxh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册/备案号
|
||||||
|
*/
|
||||||
|
private String zczbhhzbapzbh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 医疗器械注册人
|
||||||
|
*/
|
||||||
|
private String ylqxzcrbarmc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业类型
|
||||||
|
*/
|
||||||
|
private Byte bussinessType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册企业名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* di/产品标识
|
||||||
|
*/
|
||||||
|
private String nameCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
private String provinceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
private String cityCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区/县
|
||||||
|
*/
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
|
private String remark;
|
||||||
|
}
|
Loading…
Reference in New Issue