123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- package com.hssx.cloudmodel.controller;
- import com.hssx.cloudmodel.entity.Part;
- import com.hssx.cloudmodel.entity.vo.UserVO;
- import com.hssx.cloudmodel.service.PartService;
- import com.hssx.cloudmodel.util.HttpRespMsg;
- import io.swagger.annotations.ApiOperation;
- import org.apache.poi.ss.usermodel.Cell;
- import org.apache.poi.xssf.usermodel.XSSFCell;
- import org.apache.poi.xssf.usermodel.XSSFRow;
- import org.apache.poi.xssf.usermodel.XSSFSheet;
- import org.apache.poi.xssf.usermodel.XSSFWorkbook;
- import org.springframework.beans.factory.annotation.Autowired;
- 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.HttpServletResponse;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.InputStream;
- import java.io.OutputStream;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Date;
- import java.util.List;
- /**
- * @author 吴涛涛
- * @since 2019-08-13
- */
- @Controller
- @RequestMapping("/part")
- public class PartController {
- @Autowired
- PartService partService;
- /**
- * 批量零件 Excel 导入
- * file excel文件 token 用户身份凭证 mouldId 模具id
- *
- * @param file
- * @throws Exception
- */
- @ApiOperation("零件的excel导入")
- @RequestMapping(value = "/importAppLogin")
- @ResponseBody
- public HttpRespMsg importAppLogin(
- @RequestParam(value = "file", required = false) MultipartFile file,
- UserVO userVO) {
- HttpRespMsg msg = new HttpRespMsg();
- msg = partService.importPartExcel(file, userVO);
- return msg;
- }
- /**
- * 单个零件添加
- * file excel文件 token 用户身份凭证 mouldId 模具id
- * @throws Exception
- */
- @ApiOperation("零件的excel导入")
- @RequestMapping(value = "/importAppLogin")
- @ResponseBody
- public HttpRespMsg addOrUpdate(
- Part part,
- UserVO userVO) {
- HttpRespMsg msg = new HttpRespMsg();
- msg = partService.add(part,
- userVO);
- return msg;
- }
- }
|