|
|
@@ -90,46 +90,50 @@ public class PatentApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/clientApplyPatent", method = RequestMethod.POST)
|
|
|
public Result clientApplyPatent(PatentInfo patentInfo) {
|
|
|
Result res = new Result();
|
|
|
- patentInfo.setId(UUID.randomUUID().toString());
|
|
|
- patentInfo.setUid(TokenManager.getUserId());
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- patentInfo.setCreateTime(now.getTime());
|
|
|
- patentInfo.setDeletedSign(0);
|
|
|
- patentInfo.setConfirmState(0);
|
|
|
- patentInfo.setPatentState(1);
|
|
|
- patentInfoService.insert(patentInfo);
|
|
|
-
|
|
|
- PatentRegistration patentRegistration = new PatentRegistration();
|
|
|
- patentRegistration.setId(UUID.randomUUID().toString());
|
|
|
- patentRegistration.setPid(patentInfo.getId());
|
|
|
- patentRegistrationService.insert(patentRegistration);
|
|
|
-
|
|
|
- PatentCost patentCost = new PatentCost();
|
|
|
- patentCost.setId(UUID.randomUUID().toString());
|
|
|
- patentCost.setPid(patentInfo.getId());
|
|
|
- patentCost.setAnnualFeeState(0);
|
|
|
- patentCost.setPaymentState(0);
|
|
|
- patentCostService.insert(patentCost);
|
|
|
-
|
|
|
- PatentLog log = new PatentLog();
|
|
|
- log.setId(UUID.randomUUID().toString());
|
|
|
- log.setPid(patentInfo.getId());
|
|
|
- log.setRecordTime(patentInfo.getCreateTime());
|
|
|
- log.setState(1);
|
|
|
- log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
|
|
|
- patentLogService.insert(log);
|
|
|
- res.setData(patentInfo);
|
|
|
+ res = checkCertify(res, TokenManager.getUserId());
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ patentInfo.setId(UUID.randomUUID().toString());
|
|
|
+ patentInfo.setUid(TokenManager.getUserId());
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ patentInfo.setRecordTime(now.getTime());
|
|
|
+ patentInfo.setDeletedSign(0);
|
|
|
+ patentInfo.setConfirmState(0);
|
|
|
+ patentInfo.setPatentState(1);
|
|
|
+ patentInfoService.insert(patentInfo);
|
|
|
+
|
|
|
+ PatentRegistration patentRegistration = new PatentRegistration();
|
|
|
+ patentRegistration.setId(UUID.randomUUID().toString());
|
|
|
+ patentRegistration.setPid(patentInfo.getId());
|
|
|
+ patentRegistrationService.insert(patentRegistration);
|
|
|
+
|
|
|
+ PatentCost patentCost = new PatentCost();
|
|
|
+ patentCost.setId(UUID.randomUUID().toString());
|
|
|
+ patentCost.setPid(patentInfo.getId());
|
|
|
+ patentCost.setAnnualFeeState(0);
|
|
|
+ patentCost.setPaymentState(0);
|
|
|
+ patentCostService.insert(patentCost);
|
|
|
+
|
|
|
+ PatentLog log = new PatentLog();
|
|
|
+ log.setId(UUID.randomUUID().toString());
|
|
|
+ log.setPid(patentInfo.getId());
|
|
|
+ log.setRecordTime(patentInfo.getCreateTime());
|
|
|
+ log.setState(1);
|
|
|
+ log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
|
|
|
+ patentLogService.insert(log);
|
|
|
+ res.setData(patentInfo);
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除专利记录
|
|
|
+ *
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/deletePatent", method = RequestMethod.POST)
|
|
|
- public Result deletePatent(@RequestParam(name = "ids[]", required = true) String[] ids){
|
|
|
+ public Result deletePatent(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
List<String> id = new ArrayList<String>();
|
|
|
for (String s : ids) {
|
|
|
@@ -157,16 +161,19 @@ public class PatentApiController extends BaseApiController {
|
|
|
public Result clientApplyList(String patentNumber, String patentName, Integer patentCatagory, Integer patentState,
|
|
|
String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
- Integer pNo = 1;
|
|
|
- Integer pSize = 10;
|
|
|
+ res = checkCertify(res, TokenManager.getUserId());
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
|
|
|
- if (StringUtils.isNumeric(pageSize)) {
|
|
|
- pSize = Integer.parseInt(pageSize);
|
|
|
- }
|
|
|
- if (StringUtils.isNumeric(pageNo)) {
|
|
|
- pNo = Integer.parseInt(pageNo);
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(getClientApplyList(res, patentNumber, patentName, patentCatagory, patentState, pNo, pSize));
|
|
|
}
|
|
|
- res.setData(getClientApplyList(res, patentNumber, patentName, patentCatagory, patentState, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -205,8 +212,6 @@ public class PatentApiController extends BaseApiController {
|
|
|
patentName, patentState, createTime, patentApplicationDate, author, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 获取公司
|
|
|
@@ -244,39 +249,38 @@ public class PatentApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/manageApplyPatent", method = RequestMethod.POST)
|
|
|
public Result manageApplyPatent(PatentInfo patentInfo, String uid) {
|
|
|
Result res = new Result();
|
|
|
- if (null == uid) {
|
|
|
- res.getError().add(buildError("该公司无法提交申请!"));
|
|
|
- return res;
|
|
|
+ res = checkCertify(res, uid);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ patentInfo.setId(UUID.randomUUID().toString());
|
|
|
+ patentInfo.setUid(uid);
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ patentInfo.setRecordTime(now.getTime());
|
|
|
+ patentInfo.setDeletedSign(0);
|
|
|
+ patentInfo.setConfirmState(0);
|
|
|
+ patentInfo.setPatentState(1);
|
|
|
+ patentInfoService.insert(patentInfo);
|
|
|
+ PatentRegistration patentRegistration = new PatentRegistration();
|
|
|
+ patentRegistration.setId(UUID.randomUUID().toString());
|
|
|
+ patentRegistration.setPid(patentInfo.getId());
|
|
|
+ patentRegistrationService.insert(patentRegistration);
|
|
|
+ PatentCost patentCost = new PatentCost();
|
|
|
+ patentCost.setId(UUID.randomUUID().toString());
|
|
|
+ patentCost.setPid(patentInfo.getId());
|
|
|
+ patentCost.setAnnualFeeState(0);
|
|
|
+ patentCost.setPaymentState(0);
|
|
|
+ patentCostService.insert(patentCost);
|
|
|
+
|
|
|
+ PatentLog log = new PatentLog();
|
|
|
+ log.setId(UUID.randomUUID().toString());
|
|
|
+ log.setPid(patentInfo.getId());
|
|
|
+ log.setRecordTime(patentInfo.getCreateTime());
|
|
|
+ log.setState(1);
|
|
|
+ log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
|
|
|
+ log.setOperator(TokenManager.getAdminId());
|
|
|
+ patentLogService.insert(log);
|
|
|
+ res.setData(patentInfo);
|
|
|
}
|
|
|
- patentInfo.setId(UUID.randomUUID().toString());
|
|
|
- patentInfo.setUid(uid);
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- patentInfo.setCreateTime(now.getTime());
|
|
|
- patentInfo.setDeletedSign(0);
|
|
|
- patentInfo.setConfirmState(0);
|
|
|
- patentInfo.setPatentState(1);
|
|
|
- patentInfoService.insert(patentInfo);
|
|
|
- PatentRegistration patentRegistration = new PatentRegistration();
|
|
|
- patentRegistration.setId(UUID.randomUUID().toString());
|
|
|
- patentRegistration.setPid(patentInfo.getId());
|
|
|
- patentRegistrationService.insert(patentRegistration);
|
|
|
- PatentCost patentCost = new PatentCost();
|
|
|
- patentCost.setId(UUID.randomUUID().toString());
|
|
|
- patentCost.setPid(patentInfo.getId());
|
|
|
- patentCost.setAnnualFeeState(0);
|
|
|
- patentCost.setPaymentState(0);
|
|
|
- patentCostService.insert(patentCost);
|
|
|
-
|
|
|
- PatentLog log = new PatentLog();
|
|
|
- log.setId(UUID.randomUUID().toString());
|
|
|
- log.setPid(patentInfo.getId());
|
|
|
- log.setRecordTime(patentInfo.getCreateTime());
|
|
|
- log.setState(1);
|
|
|
- log.setPrincipal(userService.selectByPrimaryKey(TokenManager.getUserId()).getAid());
|
|
|
- log.setOperator(TokenManager.getAdminId());
|
|
|
- patentLogService.insert(log);
|
|
|
- res.setData(patentInfo);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -311,7 +315,7 @@ public class PatentApiController extends BaseApiController {
|
|
|
|
|
|
if (!StringUtils.isBlank(patentLog.getPrincipal())) {
|
|
|
switch (patentLog.getState()) {
|
|
|
- case 1:
|
|
|
+ case 2:
|
|
|
patentInfo.setCreateTime(d);
|
|
|
break;
|
|
|
case 3:
|
|
|
@@ -345,11 +349,12 @@ public class PatentApiController extends BaseApiController {
|
|
|
o.setEvaluationCategory((3 == patentInfo.getPatentCatagory()) ? 0 : 1);
|
|
|
orgIntellectualPropertyService.insert(o);
|
|
|
}
|
|
|
-
|
|
|
- if (10 == patentInfo.getPatentState()){
|
|
|
- OrgIntellectualProperty o = orgIntellectualPropertyService.selectOrgIntellectualPropertyByPid(patentInfo.getId());
|
|
|
+
|
|
|
+ if (10 == patentInfo.getPatentState()) {
|
|
|
+ OrgIntellectualProperty o = orgIntellectualPropertyService
|
|
|
+ .selectOrgIntellectualPropertyByPid(patentInfo.getId());
|
|
|
Integer i = 0;
|
|
|
- switch (patentInfo.getPatentCatagory()){
|
|
|
+ switch (patentInfo.getPatentCatagory()) {
|
|
|
case 0:
|
|
|
i = 0;
|
|
|
break;
|
|
|
@@ -797,15 +802,16 @@ public class PatentApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/patentFile", method = RequestMethod.POST)
|
|
|
public Result patentFile(HttpServletRequest req, String sign, String oid) {
|
|
|
Result res = new Result();
|
|
|
- res.setData(handleFile(res, "/cognizannce/", true, req, sign, oid));
|
|
|
+ res.setData(handleFile(res, "/cognizannce/", true, req, sign, oid));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign, String oid) {
|
|
|
+ private String handleFile(Result res, String path, boolean isPrivate, HttpServletRequest req, String sign,
|
|
|
+ String oid) {
|
|
|
List<MultipartFile> files = getFiles(req);
|
|
|
MultipartFile mf = files.get(0);
|
|
|
- String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path, StringUtils.isBlank(oid) ? TokenManager.getUserId() : oid);
|
|
|
+ String fileName = FileUtils.mosaicFileName(mf, isPrivate, sign, path,
|
|
|
+ StringUtils.isBlank(oid) ? TokenManager.getUserId() : oid);
|
|
|
if (!files.isEmpty()) {
|
|
|
try {
|
|
|
mf.transferTo(toPrivateFile(fileName));
|
|
|
@@ -824,30 +830,27 @@ public class PatentApiController extends BaseApiController {
|
|
|
|
|
|
// 专利纸件收发登记
|
|
|
private Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pNo, Integer pSize) {
|
|
|
- return patentRegistrationService.getRecieveSendList(pNo, pSize);
|
|
|
+ return patentRegistrationService.getRecieveSendList(pNo, pSize);
|
|
|
}
|
|
|
|
|
|
// 专利申请费用管理
|
|
|
private Pagination<PatentApplicationFeeBo> getApplicationFeeList(String[] patentApplicationDate,
|
|
|
String locationProvince, Integer pNo, Integer pSize) throws ParseException {
|
|
|
- return patentCostService.getApplicationFeeList(patentApplicationDate,
|
|
|
- locationProvince, pNo, pSize);
|
|
|
+ return patentCostService.getApplicationFeeList(patentApplicationDate, locationProvince, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
// 补正审查通知列表
|
|
|
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 patentInfoService.getNoticeOfCorrectionList(authorizedDate,
|
|
|
- serialNumber, patentNumber, office, locationProvince, unitName, patentCatagory, patentName, patentState,
|
|
|
- author, pNo, pSize);
|
|
|
+ return patentInfoService.getNoticeOfCorrectionList(authorizedDate, serialNumber, patentNumber, office,
|
|
|
+ locationProvince, unitName, patentCatagory, patentName, patentState, author, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
// 待缴费专利管理
|
|
|
private Pagination<PatentPendingBo> getManagePendingPaymentList(String locationProvince, Integer pNo,
|
|
|
Integer pSize) {
|
|
|
- return patentInfoService.getManagePendingPaymentList(locationProvince, pNo,
|
|
|
- pSize);
|
|
|
+ return patentInfoService.getManagePendingPaymentList(locationProvince, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
// 管理端申请专利列表(专利综合管理)
|
|
|
@@ -855,16 +858,15 @@ public class PatentApiController extends BaseApiController {
|
|
|
String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize)
|
|
|
throws ParseException {
|
|
|
- return patentInfoService.getManagePatentList(serialNumber, patentNumber, office,
|
|
|
- locationProvince, unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate,
|
|
|
- author, pNo, pSize);
|
|
|
+ return patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince, unitName,
|
|
|
+ patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
// 用户端申请专利列表
|
|
|
private Pagination<PatentInfo> getClientApplyList(Result res, String patentNumber, String patentName,
|
|
|
Integer patentCatagory, Integer patentState, Integer pNo, Integer pSize) {
|
|
|
- return patentInfoService.getClientApplyList(TokenManager.getUserId(), patentNumber,
|
|
|
- patentName, patentCatagory, patentState, pNo, pSize);
|
|
|
+ return patentInfoService.getClientApplyList(TokenManager.getUserId(), patentNumber, patentName, patentCatagory,
|
|
|
+ patentState, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
private PatentRegistration regBo2Reg(String rid, String pid, PatentRegistrationBo patentRegistrationBo)
|
|
|
@@ -977,4 +979,13 @@ public class PatentApiController extends BaseApiController {
|
|
|
return state;
|
|
|
}
|
|
|
|
|
|
+ // 判断用户是否通过认证
|
|
|
+ private Result checkCertify(Result res, String uid) {
|
|
|
+ OrganizationIdentity o = organizationIdentityServivce.selectOrgIdentityByUserId(uid);
|
|
|
+ if (null == o || 5 != o.getAuditStatus()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
}
|