|
|
@@ -22,6 +22,7 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
@@ -53,6 +54,7 @@ import com.goafanti.common.model.PatentRegistration;
|
|
|
import com.goafanti.common.model.User;
|
|
|
import com.goafanti.common.utils.FileUtils;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
+import com.goafanti.common.utils.SHA256Util;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
@@ -92,7 +94,10 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
private AftFileService aftFileService;
|
|
|
@Resource
|
|
|
private OrgRatepayService orgRatepayService;
|
|
|
-
|
|
|
+
|
|
|
+ @Value(value = "${aesSecretKey}")
|
|
|
+ private String secretKey = null;
|
|
|
+
|
|
|
/**
|
|
|
* 专利列表
|
|
|
*
|
|
|
@@ -118,7 +123,7 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 新增专利申请
|
|
|
*/
|
|
|
@@ -147,7 +152,7 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
res.setData(patentInfoService.savePatentInfo(pi, aid));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 专利详情
|
|
|
*
|
|
|
@@ -164,7 +169,7 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 管理端logs
|
|
|
*/
|
|
|
@@ -179,7 +184,6 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 专利详情修改保存
|
|
|
*
|
|
|
@@ -195,7 +199,6 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (StringUtils.isBlank(patentInfo.getId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
|
|
|
return res;
|
|
|
@@ -224,52 +227,51 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 专利状态流转下拉
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/patentStatus", method = RequestMethod.GET)
|
|
|
- public Result patentStatus(){
|
|
|
+ public Result patentStatus() {
|
|
|
Result res = new Result();
|
|
|
res.setData(disposePatentStatus());
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 上年度纳税申报报表是否存在
|
|
|
+ *
|
|
|
* @param uid
|
|
|
* @param sign
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/lastYearTax", method = RequestMethod.GET)
|
|
|
- public Result lastYearTax(String uid, String sign){
|
|
|
+ public Result lastYearTax(String uid, String sign) {
|
|
|
Result res = new Result();
|
|
|
-
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
if (attachmentType == AttachmentType.LAST_YEAR_RATEPAY) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
- OrgRatepay ratepay = orgRatepayService.selectRatepayByUidAndYear(uid, cal.get(Calendar.YEAR)-1);
|
|
|
-
|
|
|
- if (null == ratepay){
|
|
|
+ OrgRatepay ratepay = orgRatepayService.selectRatepayByUidAndYear(uid, cal.get(Calendar.YEAR) - 1);
|
|
|
+
|
|
|
+ if (null == ratepay) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到上年度纳税申报表", "上年度纳税申报表"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 专利相关材料上传
|
|
|
*
|
|
|
@@ -339,6 +341,39 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 预览专利相关材料
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @param sign
|
|
|
+ * @param response
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/preview", method = RequestMethod.GET)
|
|
|
+ public Result preview(String id, String sign) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ PatentInfo pi = patentInfoService.selectByPrimaryKey(id);
|
|
|
+ if (pi == null) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "专利id"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
+ if (attachmentType == AttachmentType.PATENT_PRORY_STATEMENT || attachmentType == AttachmentType.PATENT_WRITING
|
|
|
+ || attachmentType == AttachmentType.AUTHORIZATION_NOTICE
|
|
|
+ || attachmentType == AttachmentType.PATENT_CERTIFICATE) {
|
|
|
+ String time = String.valueOf(Calendar.getInstance().getTime().getTime());
|
|
|
+ String auth = SHA256Util.toHash(sign + "|" + id + "|" + secretKey, time);
|
|
|
+ res.setData("sign=" + sign + "&token=" + id + "&auth=" + auth + "&temp=" + time);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 下载模版文件(专利代理委托书)
|
|
|
*
|
|
|
* @param response
|
|
|
@@ -367,6 +402,7 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
|
|
|
/**
|
|
|
* 下载上年度纳税申报表
|
|
|
+ *
|
|
|
* @param response
|
|
|
* @param uid
|
|
|
* @param year
|
|
|
@@ -376,19 +412,19 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
@RequestMapping(value = "/downloadRatepay", method = RequestMethod.GET)
|
|
|
public Result downloadRatepay(HttpServletResponse response, String uid, String sign) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
- OrgRatepay ratepay = orgRatepayService.selectRatepayByUidAndYear(uid, cal.get(Calendar.YEAR)-1);
|
|
|
-
|
|
|
- if (null == ratepay){
|
|
|
+ OrgRatepay ratepay = orgRatepayService.selectRatepayByUidAndYear(uid, cal.get(Calendar.YEAR) - 1);
|
|
|
+
|
|
|
+ if (null == ratepay) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到上年度纳税申报表", "上年度纳税申报表"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
AttachmentType attachmentType = AttachmentType.getField(sign);
|
|
|
if (attachmentType == AttachmentType.LAST_YEAR_RATEPAY) {
|
|
|
downloadFile(response, ratepay.getTaxReturnDownloadFileName(), ratepay.getTaxReturnUrl());
|
|
|
@@ -456,7 +492,6 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 待缴费专利管理列表
|
|
|
*/
|
|
|
@@ -710,13 +745,14 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 获取资料撰写人下拉
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/getAuthor", method = RequestMethod.GET)
|
|
|
- public Result getAuthor(){
|
|
|
+ public Result getAuthor() {
|
|
|
Result res = new Result();
|
|
|
List<Admin> list = adminService.selectPatentAuthor();
|
|
|
Map<String, String> map = new TreeMap<String, String>();
|
|
|
@@ -726,13 +762,14 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
res.setData(map);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 专利负责人下拉
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/getPrincipal", method = RequestMethod.GET)
|
|
|
- public Result getPrincipal(){
|
|
|
+ public Result getPrincipal() {
|
|
|
Result res = new Result();
|
|
|
List<Admin> list = adminService.selectPatentPrincipal();
|
|
|
Map<String, String> map = new TreeMap<String, String>();
|
|
|
@@ -742,8 +779,6 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
res.setData(map);
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
// 专利申请费用管理报表
|
|
|
private void exportFees(HttpServletResponse response, List<PatentApplicationFeeBo> fees) {
|
|
|
@@ -1065,63 +1100,64 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
}
|
|
|
return fileName;
|
|
|
}
|
|
|
-
|
|
|
- private Map<String, String> disposePatentStatus(){
|
|
|
- Map<String, String> status = new TreeMap<String, String>();
|
|
|
+
|
|
|
+ private Map<String, String> disposePatentStatus() {
|
|
|
+ Map<String, String> status = new TreeMap<String, String>();
|
|
|
if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
- for (PatentInfoStatus p : PatentInfoStatus.values()){
|
|
|
+ for (PatentInfoStatus p : PatentInfoStatus.values()) {
|
|
|
status.put(p.getCode().toString(), p.getDesc());
|
|
|
status.remove(PatentInfoStatus.OTHER.getCode().toString());
|
|
|
}
|
|
|
} else {
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CREATE.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CREATE.getCode())) {
|
|
|
status.put(PatentInfoStatus.CREATE.getCode().toString(), PatentInfoStatus.CREATE.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.SIGN.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.SIGN.getCode())) {
|
|
|
status.put(PatentInfoStatus.SIGN.getCode().toString(), PatentInfoStatus.SIGN.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.DELIVERD.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.DELIVERD.getCode())) {
|
|
|
status.put(PatentInfoStatus.DELIVERD.getCode().toString(), PatentInfoStatus.DELIVERD.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CIRCULATION.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CIRCULATION.getCode())) {
|
|
|
status.put(PatentInfoStatus.CIRCULATION.getCode().toString(), PatentInfoStatus.CIRCULATION.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.COMPOSE.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.COMPOSE.getCode())) {
|
|
|
status.put(PatentInfoStatus.COMPOSE.getCode().toString(), PatentInfoStatus.COMPOSE.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.ACCEPT.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.ACCEPT.getCode())) {
|
|
|
status.put(PatentInfoStatus.ACCEPT.getCode().toString(), PatentInfoStatus.ACCEPT.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.REVIEWNOTICE.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.REVIEWNOTICE.getCode())) {
|
|
|
status.put(PatentInfoStatus.REVIEWNOTICE.getCode().toString(), PatentInfoStatus.REVIEWNOTICE.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.REVIEWREPLY.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.REVIEWREPLY.getCode())) {
|
|
|
status.put(PatentInfoStatus.REVIEWREPLY.getCode().toString(), PatentInfoStatus.REVIEWREPLY.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CORRECTIONNOTICE.getCode())){
|
|
|
- status.put(PatentInfoStatus.CORRECTIONNOTICE.getCode().toString(), PatentInfoStatus.CORRECTIONNOTICE.getDesc());
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CORRECTIONNOTICE.getCode())) {
|
|
|
+ status.put(PatentInfoStatus.CORRECTIONNOTICE.getCode().toString(),
|
|
|
+ PatentInfoStatus.CORRECTIONNOTICE.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CORRECTIONREPLY.getCode())){
|
|
|
- status.put(PatentInfoStatus.CORRECTIONREPLY.getCode().toString(), PatentInfoStatus.CORRECTIONREPLY.getDesc());
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CORRECTIONREPLY.getCode())) {
|
|
|
+ status.put(PatentInfoStatus.CORRECTIONREPLY.getCode().toString(),
|
|
|
+ PatentInfoStatus.CORRECTIONREPLY.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.AUTHORIZE.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.AUTHORIZE.getCode())) {
|
|
|
status.put(PatentInfoStatus.AUTHORIZE.getCode().toString(), PatentInfoStatus.AUTHORIZE.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.REJECT.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.REJECT.getCode())) {
|
|
|
status.put(PatentInfoStatus.REJECT.getCode().toString(), PatentInfoStatus.REJECT.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.LICENSE.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.LICENSE.getCode())) {
|
|
|
status.put(PatentInfoStatus.LICENSE.getCode().toString(), PatentInfoStatus.LICENSE.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.SETTLEMENT.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.SETTLEMENT.getCode())) {
|
|
|
status.put(PatentInfoStatus.SETTLEMENT.getCode().toString(), PatentInfoStatus.SETTLEMENT.getDesc());
|
|
|
}
|
|
|
- if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CALLBACK.getCode())){
|
|
|
+ if (TokenManager.hasPermission("PatentInfoStatus" + PatentInfoStatus.CALLBACK.getCode())) {
|
|
|
status.put(PatentInfoStatus.CALLBACK.getCode().toString(), PatentInfoStatus.CALLBACK.getDesc());
|
|
|
}
|
|
|
}
|
|
|
return status;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
}
|