|
|
@@ -156,9 +156,9 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/patentList", method = RequestMethod.GET)
|
|
|
- public Result patentList(String contractId, Integer serialNumber, String patentNumber, String office, String locationProvince,
|
|
|
- String unitName, Integer patentCatagory, String patentName, Integer patentState, String uid,
|
|
|
- @RequestParam(name = "createTime[]", required = false) String[] createTime,
|
|
|
+ public Result patentList(String contractId, Integer serialNumber, String patentNumber, String office,
|
|
|
+ String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
+ String uid, @RequestParam(name = "createTime[]", required = false) String[] createTime,
|
|
|
@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
|
|
|
String author, String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
@@ -167,13 +167,13 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
if (StringUtils.isNumeric(pageSize)) {
|
|
|
pSize = Integer.parseInt(pageSize);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isNumeric(pageNo)) {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
- res.setData(patentInfoService.getManagePatentList(contractId, serialNumber, patentNumber, office, locationProvince,
|
|
|
- unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, uid, pNo,
|
|
|
- pSize));
|
|
|
+ res.setData(patentInfoService.getManagePatentList(contractId, serialNumber, patentNumber, office,
|
|
|
+ locationProvince, unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate,
|
|
|
+ author, uid, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -193,12 +193,12 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- if (StringUtils.isBlank(patentInfo.getSalesman())){
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(patentInfo.getSalesman())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到营销员", "营销员"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
String salesman = patentInfo.getSalesman();
|
|
|
|
|
|
User curUser = userService.selectByPrimaryKey(patentInfo.getUid());
|
|
|
@@ -473,15 +473,15 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
String fileName = "";
|
|
|
AftFile af = aftFileService.selectAftFileBySign(sign);
|
|
|
if (null == af) {
|
|
|
- res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "找不到", "文件"));
|
|
|
+ res.getError().add(buildError(ErrorConstants.FILE_NON_EXISTENT, "", "找不到文件!"));
|
|
|
} else {
|
|
|
String path = af.getFilePath();
|
|
|
String suffix = path.substring(path.lastIndexOf("."));
|
|
|
- fileName = "专利代理委托书模版" + suffix;
|
|
|
+ fileName = AttachmentType.PATENT_TEMPLATE.getDesc() + suffix;
|
|
|
downloadFile(response, fileName, path);
|
|
|
}
|
|
|
} else {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利代理委托书标示"));
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -532,23 +532,21 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
List<MultipartFile> files = getFiles(req);
|
|
|
MultipartFile mf = files.get(0);
|
|
|
String suffix = mf.getOriginalFilename().substring(mf.getOriginalFilename().lastIndexOf("."));
|
|
|
- System.err.println("suffix" + " " + suffix);
|
|
|
if (suffix.equals(".doc") || suffix.equals(".docx")) {
|
|
|
- if ("patent_prory_statement".equals(sign)) {
|
|
|
- fileName = "patent_prory_statement" + suffix;
|
|
|
+ AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
+ if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT) {
|
|
|
+ fileName = sign + suffix;
|
|
|
} else {
|
|
|
- fileName = System.nanoTime() + "";
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
+ return res;
|
|
|
}
|
|
|
String name = handleFile(res, req, fileName, files, mf);
|
|
|
res.setData(name);
|
|
|
- System.out.println(name);
|
|
|
- if (res.getData() != "" && res.getData() != null && null == aftFileService.selectAftFileBySign(sign)) {
|
|
|
+ if (!StringUtils.isBlank(name) && null == aftFileService.selectAftFileBySign(sign)) {
|
|
|
AftFile f = new AftFile();
|
|
|
f.setId(UUID.randomUUID().toString());
|
|
|
- if ("patent_prory_statement".equals(sign)) {
|
|
|
- f.setFileName("专利代理委托书模版");
|
|
|
- f.setSign(sign);
|
|
|
- }
|
|
|
+ f.setFileName(AttachmentType.PATENT_TEMPLATE.getDesc());
|
|
|
+ f.setSign(sign);
|
|
|
f.setFilePath("/admin/" + fileName);
|
|
|
f.setDeleletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
aftFileService.insert(f);
|
|
|
@@ -819,8 +817,9 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
*/
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@RequestMapping(value = "/exportComposite", method = RequestMethod.GET)
|
|
|
- public Result exportComposite(String contractId, @RequestParam(name = "serialNumber", required = false) String serialNumber,
|
|
|
- String patentNumber, String office, String locationProvince, String unitName, String uid,
|
|
|
+ public Result exportComposite(String contractId,
|
|
|
+ @RequestParam(name = "serialNumber", required = false) String serialNumber, String patentNumber,
|
|
|
+ String office, String locationProvince, String unitName, String uid,
|
|
|
@RequestParam(name = "patentCatagory", required = false) String patentCatagory, String patentName,
|
|
|
@RequestParam(name = "patentState", required = false) String patentState,
|
|
|
@RequestParam(name = "createTime[]", required = false) String[] createTime,
|
|
|
@@ -832,8 +831,9 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
Integer pc = (!StringUtils.isNumeric(patentCatagory) ? null : Integer.parseInt(patentCatagory));
|
|
|
Integer ps = (!StringUtils.isNumeric(patentState) ? null : Integer.parseInt(patentState));
|
|
|
String lp = ("undefined".equals(locationProvince)) ? null : locationProvince;
|
|
|
- List<PatentManageListBo> composites = (List<PatentManageListBo>) getManagePatentList(contractId, sn, patentNumber, office,
|
|
|
- lp, unitName, pc, patentName, ps, createTime, patentApplicationDate, author, uid, 1, 1000).getList();
|
|
|
+ List<PatentManageListBo> composites = (List<PatentManageListBo>) getManagePatentList(contractId, sn,
|
|
|
+ patentNumber, office, lp, unitName, pc, patentName, ps, createTime, patentApplicationDate, author, uid,
|
|
|
+ 1, 1000).getList();
|
|
|
if (res.getError().isEmpty()) {
|
|
|
exportComosites(response, composites);
|
|
|
} else {
|
|
|
@@ -1139,12 +1139,13 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
// 管理端申请专利列表(专利综合管理)
|
|
|
- private Pagination<PatentManageListBo> getManagePatentList(String contractId, Integer serialNumber, String patentNumber, String office,
|
|
|
- String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
- String[] createTime, String[] patentApplicationDate, String author, String uid, Integer pNo, Integer pSize)
|
|
|
- throws ParseException {
|
|
|
- return patentInfoService.getManagePatentList(contractId, serialNumber, patentNumber, office, locationProvince, unitName,
|
|
|
- patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, uid, pNo, pSize);
|
|
|
+ private Pagination<PatentManageListBo> getManagePatentList(String contractId, Integer serialNumber,
|
|
|
+ String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
|
|
|
+ String patentName, Integer patentState, String[] createTime, String[] patentApplicationDate, String author,
|
|
|
+ String uid, Integer pNo, Integer pSize) throws ParseException {
|
|
|
+ return patentInfoService.getManagePatentList(contractId, serialNumber, patentNumber, office, locationProvince,
|
|
|
+ unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, uid, pNo,
|
|
|
+ pSize);
|
|
|
}
|
|
|
|
|
|
// 缴费截止日期
|