12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package com.hssx.cloudmodel.controller;
- import com.hssx.cloudmodel.entity.MouldMaintain;
- import com.hssx.cloudmodel.entity.vo.MouldVO;
- import com.hssx.cloudmodel.entity.vo.UserVO;
- import com.hssx.cloudmodel.service.MouldMaintainService;
- import com.hssx.cloudmodel.util.HttpRespMsg;
- import com.hssx.cloudmodel.util.PageUtil;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.multipart.MultipartFile;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- /**
- * <p>
- * 前端控制器
- * </p>
- *
- * @author 吴涛涛
- * @since 2019-08-13
- */
- @Controller
- @RequestMapping("/mouldmaintain")
- public class MouldMaintainController {
- @Autowired
- private MouldMaintainService mouldMaintainService;
- @Value("${upload.path}")
- private String path;
- /**
- *
- * 模具保养
- * file 文件,token 用户身份凭证 ,mouldId 模具id,maintainType 保养类型 0-动作 1-易损件
- * 方式 :ways
- * (0-喷漆 1-检查 )==》对应maintainType 保养类型 选择了0-动作
- * (2-易损件) ==》对应maintainType 保养类型 选择了1-动作 (此时ways传易损件的id)
- * @return
- */
- @ApiOperation("模具保养")
- @RequestMapping("/maintain")
- @ResponseBody
- public HttpRespMsg maintain(@RequestParam(required = false) MultipartFile file, MouldMaintain mouldMaintain,String token){
- HttpRespMsg msg = new HttpRespMsg();
- msg = mouldMaintainService.addMaintain(file,path,mouldMaintain,token);
- return msg;
- }
- /**
- * 保养列表
- * token 用户身份凭证,pageNum 当前页码,pageSize 每页条数
- * @return
- */
- @ApiOperation("保养列表")
- @RequestMapping("/list")
- @ResponseBody
- public HttpRespMsg uploadFile(String token, PageUtil page) throws Exception {
- HttpRespMsg msg = new HttpRespMsg();
- msg = mouldMaintainService.getList(token,page);
- return msg;
- }
- }
|