|
|
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
@@ -140,7 +141,7 @@ public class PatentApiController extends BaseApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/managePatentList", method = RequestMethod.POST)
|
|
|
- public Result managePatentList(String serialNumber, String patentNumber, String office, String locationProvince,
|
|
|
+ public Result managePatentList(Integer serialNumber, String patentNumber, String office, String locationProvince,
|
|
|
String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
@RequestParam(name = "createTime[]", required = false) String[] createTime,
|
|
|
@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
|
|
|
@@ -283,7 +284,7 @@ public class PatentApiController extends BaseApiController {
|
|
|
* 补正审查通知列表
|
|
|
*/
|
|
|
@RequestMapping(value = "/noticeOfCorrectionList", method = RequestMethod.POST)
|
|
|
- public Result noticeOfCorrectionList(Date authorizedDate, String serialNumber, String patentNumber, String office,
|
|
|
+ public Result noticeOfCorrectionList(Date authorizedDate, Integer serialNumber, String patentNumber, String office,
|
|
|
String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
String author, String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
@@ -400,23 +401,84 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 下载专利代理委托书模版
|
|
|
+ * 专利综合管理导出
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/exportComposite", method = RequestMethod.POST)
|
|
|
+ public Result exportComposite(Integer serialNumber, String patentNumber, String office,
|
|
|
+ String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
+ String[] createTime, String[] patentApplicationDate, String author, HttpServletResponse response){
|
|
|
+ Result res = new Result();
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专利相关材料上传
|
|
|
+ * @param req
|
|
|
+ * @param sign 材料类型标记,其中'patent_prory_statement'为专利代理委托书标记
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value="/downLoadTemplate",method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value="/patentFile",method = RequestMethod.POST)
|
|
|
+ public Result patentFile(HttpServletRequest req ,String sign ,String oid) {
|
|
|
+ Result res = new Result();
|
|
|
+ String fileName = "";
|
|
|
+ if(StringUtils.isBlank(oid)){
|
|
|
+ fileName = "/patent" + TokenManager.getUserId()+ "_" + sign + ".doc";
|
|
|
+ }else{
|
|
|
+ if(sign.equals("patent_prory_statement") || sign.equals("patent_writing")){
|
|
|
+ fileName = "/patent" + oid + "_" + sign + ".doc";
|
|
|
+ }else{
|
|
|
+ fileName = "/patent" + oid + "_" + sign + ".jpg";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ res.setData(handleFile(res, fileName , req));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载专利代理委托书模版(用户端及管理端)
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/downloadTemplate",method = RequestMethod.GET)
|
|
|
public Result downloadPatentProryStatement(HttpServletResponse response, HttpServletRequest request){
|
|
|
Result res = new Result();
|
|
|
- /*if(null == TokenManager.getAdminToken() || null == TokenManager.getToken()){
|
|
|
- res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "权限不足,无法下载!"));
|
|
|
- return res;
|
|
|
- }*/
|
|
|
String filename =Long.toString(System.nanoTime())+".doc";
|
|
|
+ String fileSaveRootPath = uploadPrivatePath + "/patent/patent_prory_statement.doc";
|
|
|
+ return patentDownload(res,response,filename,fileSaveRootPath);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 下载专利相关材料
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/downloadFile",method = RequestMethod.GET)
|
|
|
+ public Result downloadPatentFile(HttpServletResponse response, String path , String sign ,HttpServletRequest request){
|
|
|
+ Result res = new Result();
|
|
|
+ if(StringUtils.isBlank(path)){
|
|
|
+ res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "下载文件不存在!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if(null == TokenManager.getAdminToken()){
|
|
|
+ res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "权限不足,无法下载!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ String filename = "";
|
|
|
+ if(sign.equals("patent_prory_statement") || sign.equals("patent_writing")){
|
|
|
+ filename =Long.toString(System.nanoTime())+".doc";
|
|
|
+ }else{
|
|
|
+ filename =Long.toString(System.nanoTime())+".jpg";
|
|
|
+ }
|
|
|
+ String fileSaveRootPath = uploadPrivatePath + path;
|
|
|
+ return patentDownload(res,response,filename,fileSaveRootPath);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private Result patentDownload(Result res,HttpServletResponse response,String filename,String fileSaveRootPath){
|
|
|
InputStream in = null;
|
|
|
OutputStream out = null;
|
|
|
byte[] buffer = new byte[8 * 1024];
|
|
|
- String fileSaveRootPath = "";
|
|
|
try {
|
|
|
- fileSaveRootPath = uploadPrivatePath + "/patent/patent_prory_statement.doc";
|
|
|
File file = new File(fileSaveRootPath);
|
|
|
in = new FileInputStream(file);
|
|
|
out = response.getOutputStream();
|
|
|
@@ -445,7 +507,31 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
}
|
|
|
return res;
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ private String handleFile(Result res, String fileName, HttpServletRequest req) {
|
|
|
+ List<MultipartFile> files = getFiles(req);
|
|
|
+ if (!files.isEmpty()) {
|
|
|
+ try {
|
|
|
+ MultipartFile mf = files.get(0);
|
|
|
+ mf.transferTo(toPrivateFile(fileName));
|
|
|
+ LoggerUtils.debug(getClass(), fileName + " 文件上传成功");
|
|
|
+ } catch (IllegalStateException | IOException e) {
|
|
|
+ LoggerUtils.error(getClass(), "文件上传失败", e);
|
|
|
+ res.getError().add(buildError("", "文件上传失败!"));
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError("", "文件上传失败!"));
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ return fileName;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// 专利纸件收发登记
|
|
|
private Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pNo, Integer pSize) {
|
|
|
@@ -460,7 +546,7 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
// 补正审查通知列表
|
|
|
- private Pagination<PatentNoticeOfCorrectionBo> getNoticeOfCorrectionList(Date authorizedDate, String serialNumber,
|
|
|
+ private Pagination<PatentNoticeOfCorrectionBo> getNoticeOfCorrectionList(Date authorizedDate, Integer serialNumber,
|
|
|
String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
|
|
|
String patentName, Integer patentState, String author, Integer pNo, Integer pSize) {
|
|
|
return (Pagination<PatentNoticeOfCorrectionBo>) patentInfoService.getNoticeOfCorrectionList(authorizedDate,
|
|
|
@@ -476,7 +562,7 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
|
|
|
// 管理端申请专利列表(专利综合管理)
|
|
|
- private Pagination<PatentCompositeBo> getManagePatentList(String serialNumber, String patentNumber, String office,
|
|
|
+ private Pagination<PatentCompositeBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
|
|
|
String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize)
|
|
|
throws ParseException {
|