MouldMaintainController.java 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package com.hssx.cloudmodel.controller;
  2. import com.hssx.cloudmodel.entity.MouldMaintain;
  3. import com.hssx.cloudmodel.entity.vo.MouldVO;
  4. import com.hssx.cloudmodel.entity.vo.UserVO;
  5. import com.hssx.cloudmodel.service.MouldMaintainService;
  6. import com.hssx.cloudmodel.util.HttpRespMsg;
  7. import com.hssx.cloudmodel.util.PageUtil;
  8. import io.swagger.annotations.ApiOperation;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.beans.factory.annotation.Value;
  11. import org.springframework.stereotype.Controller;
  12. import org.springframework.web.bind.annotation.RequestMapping;
  13. import org.springframework.web.bind.annotation.RequestParam;
  14. import org.springframework.web.bind.annotation.ResponseBody;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import org.springframework.web.multipart.MultipartFile;
  17. import javax.servlet.http.HttpServletRequest;
  18. import javax.servlet.http.HttpServletResponse;
  19. /**
  20. * <p>
  21. * 前端控制器
  22. * </p>
  23. *
  24. * @author 吴涛涛
  25. * @since 2019-08-13
  26. */
  27. @Controller
  28. @RequestMapping("/mouldmaintain")
  29. public class MouldMaintainController {
  30. @Autowired
  31. private MouldMaintainService mouldMaintainService;
  32. @Value("${upload.path}")
  33. private String path;
  34. /**
  35. *
  36. * 模具保养
  37. * file 文件,token 用户身份凭证 ,mouldId 模具id,maintainType 保养类型 0-动作 1-易损件
  38. * 方式 :ways
  39. * (0-喷漆 1-检查 )==》对应maintainType 保养类型 选择了0-动作
  40. * (2-易损件) ==》对应maintainType 保养类型 选择了1-动作 (此时ways传易损件的id)
  41. * @return
  42. */
  43. @ApiOperation("模具保养")
  44. @RequestMapping("/maintain")
  45. @ResponseBody
  46. public HttpRespMsg maintain(@RequestParam(required = false) MultipartFile file, MouldMaintain mouldMaintain,String token){
  47. HttpRespMsg msg = new HttpRespMsg();
  48. msg = mouldMaintainService.addMaintain(file,path,mouldMaintain,token);
  49. return msg;
  50. }
  51. /**
  52. * 保养列表
  53. * token 用户身份凭证,pageNum 当前页码,pageSize 每页条数
  54. * @return
  55. */
  56. @ApiOperation("保养列表")
  57. @RequestMapping("/list")
  58. @ResponseBody
  59. public HttpRespMsg uploadFile(String token, PageUtil page) throws Exception {
  60. HttpRespMsg msg = new HttpRespMsg();
  61. msg = mouldMaintainService.getList(token,page);
  62. return msg;
  63. }
  64. }