MaterialInputController.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.jsh.erp.controller;
  2. import com.jsh.erp.base.AjaxResult;
  3. import com.jsh.erp.datasource.dto.MaterialDTO;
  4. import com.jsh.erp.datasource.dto.MaterialInputDto;
  5. import com.jsh.erp.service.MaterialInputService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import org.springframework.web.bind.annotation.*;
  9. import javax.annotation.Resource;
  10. import javax.servlet.http.HttpServletRequest;
  11. @RestController
  12. @RequestMapping(value = "/materialInput")
  13. @Api(tags = {"商品录入管理"})
  14. public class MaterialInputController {
  15. @Resource
  16. private MaterialInputService materialInputService;
  17. /**
  18. * 查询任务详情
  19. * @param number
  20. * @return
  21. */
  22. @ApiOperation("商品录入详情")
  23. @GetMapping("/detail/{number}")
  24. public AjaxResult detailByNumber(@PathVariable("number") String number) {
  25. return AjaxResult.success(materialInputService.getDetailByNumber(number));
  26. }
  27. @PostMapping(value = "/update")
  28. @ApiOperation(value = "修改货物录入信息")
  29. public AjaxResult updateResource(@RequestBody MaterialInputDto materialInputDto) {
  30. boolean b = materialInputService.updateMaterialInput(materialInputDto);
  31. if (!b){
  32. return AjaxResult.error("修改货物录入信息失败");
  33. }
  34. return AjaxResult.success();
  35. }
  36. }