|
@@ -30,7 +30,7 @@ import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 前端控制器
|
|
|
+ * 前端控制器
|
|
|
* </p>
|
|
|
*
|
|
|
* @author 吴涛涛
|
|
@@ -48,13 +48,14 @@ public class MouldFileController {
|
|
|
private MouldFileService mouldFileService;
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 模具文档的上传
|
|
|
* 参数: token 用户身份凭证,
|
|
|
* mouldId 模具id ,
|
|
|
* blongType 文档类型(0-模具文档 1-零件文档 2-试模验收 3-保养方案 4-模具更新 5-模具报废),
|
|
|
* 注:blongType 为 1 时需要多传 partId 零件id
|
|
|
- * blongType 为3 以下的file和dwgType参数均不需要传递
|
|
|
+ * blongType 为3 以下的file和dwgType参数均不需要传递
|
|
|
* file 文件信息,dwgType 图档类型0-2D,1-3D(上传零件文档和模具文档时传该参数)
|
|
|
*
|
|
|
* @return
|
|
@@ -62,13 +63,18 @@ public class MouldFileController {
|
|
|
@ApiOperation("模具文档的上传")
|
|
|
@RequestMapping("/uploadFile")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg uploadFile(@RequestParam(required = false) MultipartFile file,@RequestParam(required = false) MultipartFile file2,@RequestParam(required = false, defaultValue = "0") Integer blongType,
|
|
|
+ public HttpRespMsg uploadFile(@RequestParam(required = false) MultipartFile file, @RequestParam(required = false) MultipartFile file2, @RequestParam(required = false) Integer blongType,
|
|
|
HttpServletResponse response, HttpServletRequest request, UserVO userVO) throws Exception {
|
|
|
-// System.out.println("开始上传文件" + "file+" + file.getOriginalFilename());
|
|
|
+// System.out.println("开始上传文件" + "file+" + file.getOriginalFilename());
|
|
|
+ System.out.println("blongType" + blongType);
|
|
|
+ if (null == blongType) {
|
|
|
+ blongType = 0;
|
|
|
+ }
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
- msg = mouldFileService.addFile(userVO,blongType, file,file2, path);
|
|
|
+ msg = mouldFileService.addFile(userVO, blongType, file, file2, path);
|
|
|
return msg;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 零件文档的批量上传(文件命名规则:零件编号+2D/3D 如 LJ001+2D.dwg)
|
|
|
* 参数: token 用户身份凭证,
|
|
@@ -79,9 +85,9 @@ public class MouldFileController {
|
|
|
@ApiOperation("零件文档的批量上传")
|
|
|
@RequestMapping("/uploadPartFileList")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg uploadFile(@RequestParam("file") MultipartFile[] files,UserVO userVO) throws Exception {
|
|
|
+ public HttpRespMsg uploadFile(@RequestParam("file") MultipartFile[] files, UserVO userVO) throws Exception {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
- msg = mouldFileService.addPartFile(userVO,path, files);
|
|
|
+ msg = mouldFileService.addPartFile(userVO, path, files);
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -89,10 +95,10 @@ public class MouldFileController {
|
|
|
@ApiOperation("模具文档的审核")
|
|
|
@RequestMapping("/check")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg check(@RequestParam Integer mouldFileId,@RequestParam Integer isPass,
|
|
|
- HttpServletResponse response, HttpServletRequest request, UserVO userVO) throws Exception {
|
|
|
+ public HttpRespMsg check(@RequestParam Integer mouldFileId, @RequestParam Integer isPass,
|
|
|
+ HttpServletResponse response, HttpServletRequest request, UserVO userVO) throws Exception {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
- msg = mouldFileService.check(mouldFileId,isPass, userVO);
|
|
|
+ msg = mouldFileService.check(mouldFileId, isPass, userVO);
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -105,8 +111,8 @@ public class MouldFileController {
|
|
|
@ApiOperation("模具文档的列表")
|
|
|
@RequestMapping("/list")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg list(@RequestParam Integer mouldId, @RequestParam Integer blongType, UserVO userVO){
|
|
|
- HttpRespMsg msg = mouldFileService.getFileList(mouldId,blongType, userVO);
|
|
|
+ public HttpRespMsg list(@RequestParam Integer mouldId, @RequestParam Integer blongType, UserVO userVO) {
|
|
|
+ HttpRespMsg msg = mouldFileService.getFileList(mouldId, blongType, userVO);
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -119,8 +125,8 @@ public class MouldFileController {
|
|
|
@ApiOperation("模具所有类型的文档列表")
|
|
|
@RequestMapping("/allList")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg allList(@RequestParam Integer mouldId, UserVO userVO){
|
|
|
- HttpRespMsg msg = mouldFileService.getAllFileList(mouldId,userVO);
|
|
|
+ public HttpRespMsg allList(@RequestParam Integer mouldId, UserVO userVO) {
|
|
|
+ HttpRespMsg msg = mouldFileService.getAllFileList(mouldId, userVO);
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -133,8 +139,8 @@ public class MouldFileController {
|
|
|
@ApiOperation("模具所有类型文档的下载")
|
|
|
@RequestMapping("/dowloadFile")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg dowloadFile(MouldFile mouldFile, String token){
|
|
|
- HttpRespMsg msg = mouldFileService.dowloadFile(mouldFile,token);
|
|
|
+ public HttpRespMsg dowloadFile(MouldFile mouldFile, String token) {
|
|
|
+ HttpRespMsg msg = mouldFileService.dowloadFile(mouldFile, token);
|
|
|
return msg;
|
|
|
}
|
|
|
|
|
@@ -147,7 +153,7 @@ public class MouldFileController {
|
|
|
@ApiOperation("项目文档的删除")
|
|
|
@RequestMapping("/delFile")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg delFile(MouldFile mouldFile){
|
|
|
+ public HttpRespMsg delFile(MouldFile mouldFile) {
|
|
|
HttpRespMsg msg = mouldFileService.delFile(mouldFile);
|
|
|
return msg;
|
|
|
}
|
|
@@ -161,11 +167,12 @@ public class MouldFileController {
|
|
|
@ApiOperation("文档批量下载列表")
|
|
|
@RequestMapping("/fileList")
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg fileList(UserVO userVO, PageUtil page){
|
|
|
+ public HttpRespMsg fileList(UserVO userVO, PageUtil page) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
msg = mouldFileService.getListByUserAndProjectId(userVO, page);
|
|
|
return msg;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 文档勾选批量下载
|
|
|
* 参数: ids 模具ids 如“1,2,3”
|
|
@@ -173,12 +180,12 @@ public class MouldFileController {
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation("文档勾选批量下载")
|
|
|
- @RequestMapping(value = "/downloadfileList",method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "/downloadfileList", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg downloadfileList(UserVO userVO,HttpServletRequest request, HttpServletResponse response){
|
|
|
+ public HttpRespMsg downloadfileList(UserVO userVO, HttpServletRequest request, HttpServletResponse response) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
try {
|
|
|
- msg = mouldFileService.dowloadFileList(userVO,request,response,downloadPath,path);
|
|
|
+ msg = mouldFileService.dowloadFileList(userVO, request, response, downloadPath, path);
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -192,12 +199,12 @@ public class MouldFileController {
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation("文档下载日志的excel导出")
|
|
|
- @RequestMapping(value = "/downloadFileListExcel",method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "/downloadFileListExcel", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
|
- public HttpRespMsg downloadFileListExcel(UserVO userVO, HttpServletResponse response){
|
|
|
+ public HttpRespMsg downloadFileListExcel(UserVO userVO, HttpServletResponse response) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
try {
|
|
|
- msg = mouldFileService.downloadFileListExcel(userVO,response);
|
|
|
+ msg = mouldFileService.downloadFileListExcel(userVO, response);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|