|
|
@@ -33,6 +33,7 @@ import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
+import com.goafanti.common.model.OrgIntellectualProperty;
|
|
|
import com.goafanti.common.model.OrganizationIdentity;
|
|
|
import com.goafanti.common.model.PatentCost;
|
|
|
import com.goafanti.common.model.PatentInfo;
|
|
|
@@ -44,6 +45,7 @@ import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.techservice.cognizance.service.OrgIntellectualPropertyService;
|
|
|
import com.goafanti.techservice.patent.bo.PatentApplicationFeeBo;
|
|
|
import com.goafanti.techservice.patent.bo.PatentCompositeBo;
|
|
|
import com.goafanti.techservice.patent.bo.PatentNoticeOfCorrectionBo;
|
|
|
@@ -57,30 +59,30 @@ import com.goafanti.techservice.patent.service.PatentLogService;
|
|
|
import com.goafanti.techservice.patent.service.PatentRegistrationService;
|
|
|
import com.goafanti.user.service.OrganizationIdentityService;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/techservice/patent")
|
|
|
public class PatentApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
- private PatentInfoService patentInfoService;
|
|
|
+ private PatentInfoService patentInfoService;
|
|
|
+ @Resource
|
|
|
+ private PatentLogService patentLogService;
|
|
|
@Resource
|
|
|
- private PatentLogService patentLogService;
|
|
|
+ private OrganizationIdentityService organizationIdentityServivce;
|
|
|
@Resource
|
|
|
- private OrganizationIdentityService organizationIdentityServivce;
|
|
|
+ private PatentCostService patentCostService;
|
|
|
@Resource
|
|
|
- private PatentCostService patentCostService;
|
|
|
+ private PatentRegistrationService patentRegistrationService;
|
|
|
@Resource
|
|
|
- private PatentRegistrationService patentRegistrationService;
|
|
|
+ private AdminService adminService;
|
|
|
@Resource
|
|
|
- private AdminService adminService;
|
|
|
-
|
|
|
- /*@Autowired
|
|
|
- DownloadUtils downloadUtils;*/
|
|
|
-
|
|
|
+ private OrgIntellectualPropertyService orgIntellectualPropertyService;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * @Autowired DownloadUtils downloadUtils;
|
|
|
+ */
|
|
|
+
|
|
|
@Value(value = "${upload.private.path}")
|
|
|
- private String uploadPrivatePath = null;
|
|
|
+ private String uploadPrivatePath = null;
|
|
|
|
|
|
/**
|
|
|
* 用户端专利申请
|
|
|
@@ -138,12 +140,6 @@ public class PatentApiController extends BaseApiController {
|
|
|
res.setData(getClientApplyList(res, patentNumber, patentName, patentCatagory, patentState, pNo, pSize));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 用户端申请专利当前流程/管理端专利详情-专利状态流转记录
|
|
|
@@ -245,31 +241,31 @@ public class PatentApiController extends BaseApiController {
|
|
|
* 管理端专利详情修改保存
|
|
|
*/
|
|
|
@RequestMapping(value = "/managePatentInfo", method = RequestMethod.POST)
|
|
|
- public Result managePatentInfo(String patentNumber,String patentName,String patentCatagory,String patentField,
|
|
|
- String patentDes,String patentWritingUrl,String authorizationNoticeUrl,String patentCertificateUrl,
|
|
|
- String xid, PatentLog patentLog ,String recordTimeFormattedDate) {
|
|
|
+ public Result managePatentInfo(String patentNumber, String patentName, String patentCatagory, String patentField,
|
|
|
+ String patentDes, String patentWritingUrl, String authorizationNoticeUrl, String patentCertificateUrl,
|
|
|
+ String xid, PatentLog patentLog, String recordTimeFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
PatentInfo patentInfo = new PatentInfo();
|
|
|
patentInfo.setId(xid);
|
|
|
patentInfo.setPatentNumber(patentNumber);
|
|
|
- patentInfo.setPatentCatagory(StringUtils.isNumeric(patentCatagory)? Integer.parseInt(patentCatagory) : null);
|
|
|
- patentInfo.setPatentField(StringUtils.isNumeric(patentField)? Integer.parseInt(patentField) : null);;
|
|
|
+ patentInfo.setPatentCatagory(StringUtils.isNumeric(patentCatagory) ? Integer.parseInt(patentCatagory) : null);
|
|
|
+ patentInfo.setPatentField(StringUtils.isNumeric(patentField) ? Integer.parseInt(patentField) : null);
|
|
|
patentInfo.setPatentDes(patentDes);
|
|
|
patentInfo.setPatentWritingUrl(patentWritingUrl);
|
|
|
patentInfo.setAuthorizationNoticeUrl(authorizationNoticeUrl);
|
|
|
patentInfo.setPatentCertificateUrl(patentCertificateUrl);
|
|
|
- Date d ;
|
|
|
+ Date d;
|
|
|
if (!StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
try {
|
|
|
d = DateUtils.parseDate(recordTimeFormattedDate, "yyyy-MM-dd");
|
|
|
} catch (ParseException e) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "参数格式不正确", "yyyy-MM-dd"));
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_PATTERN_ERROR, "参数格式不正确", "yyyy-MM-dd"));
|
|
|
return res;
|
|
|
- }
|
|
|
- }else{
|
|
|
- d = null;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ d = null;
|
|
|
+ }
|
|
|
+
|
|
|
if (!StringUtils.isBlank(patentLog.getPrincipal())) {
|
|
|
switch (patentLog.getState()) {
|
|
|
case 1:
|
|
|
@@ -291,6 +287,42 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
patentInfo.setId(xid);
|
|
|
patentInfoService.updateByPrimaryKeySelective(patentInfo);
|
|
|
+ if (8 == patentInfo.getPatentState()) {
|
|
|
+ OrgIntellectualProperty o = new OrgIntellectualProperty();
|
|
|
+ o.setId(UUID.randomUUID().toString());
|
|
|
+ o.setUid(patentInfo.getUid());
|
|
|
+ o.setPid(patentInfo.getId());
|
|
|
+ o.setDeletedSign(0);
|
|
|
+ o.setIntellectualPropertyNumber(patentInfo.getPatentNumber());
|
|
|
+ o.setIntellectualPropertyName(patentInfo.getPatentName());
|
|
|
+ o.setCatagory(1);
|
|
|
+ o.setObtainWay(1);
|
|
|
+ o.setAuthorizationNumber(patentInfo.getPatentNumber());
|
|
|
+ o.setAuthorizationDate(patentInfo.getAuthorizedDate());
|
|
|
+ o.setEvaluationCategory((3 == patentInfo.getPatentCatagory()) ? 0 : 1);
|
|
|
+ orgIntellectualPropertyService.insert(o);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (10 == patentInfo.getPatentState()){
|
|
|
+ OrgIntellectualProperty o = orgIntellectualPropertyService.selectOrgIntellectualPropertyByPid(patentInfo.getId());
|
|
|
+ Integer i = 0;
|
|
|
+ switch (patentInfo.getPatentCatagory()){
|
|
|
+ case 0:
|
|
|
+ i = 0;
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ i = 2;
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ i = 3;
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ i = 11;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ o.setCatagory(i);
|
|
|
+ orgIntellectualPropertyService.updateByPrimaryKeySelective(o);
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -405,7 +437,8 @@ public class PatentApiController extends BaseApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/saveRecieveSend", method = RequestMethod.POST)
|
|
|
- public Result recieveSendDetail(String rid, String pid ,PatentRegistrationBo patentRegistrationBo) throws ParseException {
|
|
|
+ public Result recieveSendDetail(String rid, String pid, PatentRegistrationBo patentRegistrationBo)
|
|
|
+ throws ParseException {
|
|
|
Result res = new Result();
|
|
|
patentRegistrationService.updateByPrimaryKey(regBo2Reg(rid, pid, patentRegistrationBo));
|
|
|
return res;
|
|
|
@@ -448,13 +481,14 @@ public class PatentApiController extends BaseApiController {
|
|
|
res.setData(patentCostService.updateByPrimaryKeySelective(p));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 用户确认申报材料
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value= "/clientConfirm",method = RequestMethod.POST)
|
|
|
- public Result clientConfirmApplicationMaterials(String pid){
|
|
|
+ @RequestMapping(value = "/clientConfirm", method = RequestMethod.POST)
|
|
|
+ public Result clientConfirmApplicationMaterials(String pid) {
|
|
|
Result res = new Result();
|
|
|
PatentInfo p = new PatentInfo();
|
|
|
p.setId(pid);
|
|
|
@@ -462,26 +496,29 @@ public class PatentApiController extends BaseApiController {
|
|
|
res.setData(patentInfoService.updateByPrimaryKeySelective(p));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 专利综合管理报表导出
|
|
|
- * @throws ParseException
|
|
|
+ *
|
|
|
+ * @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/exportComposite", method = RequestMethod.GET)
|
|
|
- public Result exportComposite(@RequestParam(name = "serialNumber", required = false) String serialNumber, String patentNumber, String office,
|
|
|
- String locationProvince, String unitName, @RequestParam(name = "patentCatagory", required = false) String patentCatagory, String patentName, @RequestParam(name = "patentState", required = false) String patentState,
|
|
|
- @RequestParam(name = "createTime[]", required = false) String[] createTime, @RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
|
|
|
- String author, HttpServletResponse response) throws ParseException{
|
|
|
- Result res = new Result();
|
|
|
-
|
|
|
- Integer sn = (!StringUtils.isNumeric(serialNumber)? null : Integer.parseInt(serialNumber));
|
|
|
- Integer pc = (!StringUtils.isNumeric(patentCatagory)? null :Integer.parseInt(patentCatagory));
|
|
|
- Integer ps = (!StringUtils.isNumeric(patentState)? null : Integer.parseInt(patentState));
|
|
|
+ public Result exportComposite(@RequestParam(name = "serialNumber", required = false) String serialNumber,
|
|
|
+ String patentNumber, String office, String locationProvince, String unitName,
|
|
|
+ @RequestParam(name = "patentCatagory", required = false) String patentCatagory, String patentName,
|
|
|
+ @RequestParam(name = "patentState", required = false) String patentState,
|
|
|
+ @RequestParam(name = "createTime[]", required = false) String[] createTime,
|
|
|
+ @RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
|
|
|
+ String author, HttpServletResponse response) throws ParseException {
|
|
|
+ Result res = new Result();
|
|
|
+
|
|
|
+ Integer sn = (!StringUtils.isNumeric(serialNumber) ? null : Integer.parseInt(serialNumber));
|
|
|
+ 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;
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- List<PatentCompositeBo> composites =(List<PatentCompositeBo>)getManagePatentList( sn, patentNumber, office,
|
|
|
- lp, unitName, pc, patentName, ps,
|
|
|
- createTime, patentApplicationDate, author , 1 , 1000).getList();
|
|
|
+ List<PatentCompositeBo> composites = (List<PatentCompositeBo>) getManagePatentList(sn, patentNumber, office, lp,
|
|
|
+ unitName, pc, patentName, ps, createTime, patentApplicationDate, author, 1, 1000).getList();
|
|
|
if (res.getError().isEmpty()) {
|
|
|
exportComosites(response, composites);
|
|
|
} else {
|
|
|
@@ -490,15 +527,16 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 待缴年登印费专利管理报表导出
|
|
|
*/
|
|
|
- @RequestMapping(value = "/exportPending" , method = RequestMethod.GET)
|
|
|
- public Result exportPending(String locationProvince ,HttpServletResponse response){
|
|
|
+ @RequestMapping(value = "/exportPending", method = RequestMethod.GET)
|
|
|
+ public Result exportPending(String locationProvince, HttpServletResponse response) {
|
|
|
Result res = new Result();
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- List<PatentPendingBo> pendings =(List<PatentPendingBo>)getManagePendingPaymentList(locationProvince,1,1000).getList();
|
|
|
+ List<PatentPendingBo> pendings = (List<PatentPendingBo>) getManagePendingPaymentList(locationProvince, 1, 1000)
|
|
|
+ .getList();
|
|
|
if (res.getError().isEmpty()) {
|
|
|
exportPendings(response, pendings);
|
|
|
} else {
|
|
|
@@ -507,42 +545,42 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 专利申请费用管理报表导出
|
|
|
- * @throws ParseException
|
|
|
+ *
|
|
|
+ * @throws ParseException
|
|
|
*/
|
|
|
- @RequestMapping(value="/exportApplicationFee",method = RequestMethod.GET)
|
|
|
- public Result exportApplicationFee(@RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
|
|
|
- String locationProvince,HttpServletResponse response) throws ParseException{
|
|
|
+ @RequestMapping(value = "/exportApplicationFee", method = RequestMethod.GET)
|
|
|
+ public Result exportApplicationFee(
|
|
|
+ @RequestParam(name = "patentApplicationDate[]", required = false) String[] patentApplicationDate,
|
|
|
+ String locationProvince, HttpServletResponse response) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- List<PatentApplicationFeeBo> fees = (List<PatentApplicationFeeBo>)getApplicationFeeList(
|
|
|
- patentApplicationDate, locationProvince,1,1000).getList();
|
|
|
+ List<PatentApplicationFeeBo> fees = (List<PatentApplicationFeeBo>) getApplicationFeeList(patentApplicationDate,
|
|
|
+ locationProvince, 1, 1000).getList();
|
|
|
if (res.getError().isEmpty()) {
|
|
|
exportFees(response, fees);
|
|
|
} else {
|
|
|
DownloadUtils downloadUtils = new DownloadUtils();
|
|
|
downloadUtils.out(response, res.toString());
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- //专利申请费用管理报表
|
|
|
+
|
|
|
+ // 专利申请费用管理报表
|
|
|
private void exportFees(HttpServletResponse response, List<PatentApplicationFeeBo> fees) {
|
|
|
String sheetName = "专利申请费用管理报表";
|
|
|
- HSSFWorkbook workbook = createWorkbook(sheetName,
|
|
|
- new String[]{"编号","申请号/专利号","省份","公司名称","专利名称","缴费状态","申请费","实审费","文印费","是否请款",
|
|
|
- "是否报销","申请日","缴费截止时间"});
|
|
|
-
|
|
|
+ HSSFWorkbook workbook = createWorkbook(sheetName, new String[] { "编号", "申请号/专利号", "省份", "公司名称", "专利名称", "缴费状态",
|
|
|
+ "申请费", "实审费", "文印费", "是否请款", "是否报销", "申请日", "缴费截止时间" });
|
|
|
+
|
|
|
HSSFSheet sheet = workbook.getSheet(sheetName);
|
|
|
-
|
|
|
- for (int i = 0 ;i < fees.size();i++){
|
|
|
+
|
|
|
+ for (int i = 0; i < fees.size(); i++) {
|
|
|
PatentApplicationFeeBo obj = fees.get(i);
|
|
|
HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
|
|
|
- if (null == obj.getSerialNumber()){
|
|
|
+ if (null == obj.getSerialNumber()) {
|
|
|
row.createCell(0).setCellValue("");
|
|
|
} else {
|
|
|
row.createCell(0).setCellValue(obj.getSerialNumber());
|
|
|
@@ -551,12 +589,12 @@ public class PatentApiController extends BaseApiController {
|
|
|
row.createCell(2).setCellValue(obj.getLocationProvince());
|
|
|
row.createCell(3).setCellValue(obj.getUnitName());
|
|
|
row.createCell(4).setCellValue(obj.getPatentName());
|
|
|
- if (null != obj.getPaymentState()){
|
|
|
- switch (obj.getPaymentState()){
|
|
|
- case 0 :
|
|
|
+ if (null != obj.getPaymentState()) {
|
|
|
+ switch (obj.getPaymentState()) {
|
|
|
+ case 0:
|
|
|
row.createCell(5).setCellValue("未缴费");
|
|
|
break;
|
|
|
- case 1 :
|
|
|
+ case 1:
|
|
|
row.createCell(5).setCellValue("已缴费");
|
|
|
}
|
|
|
} else {
|
|
|
@@ -565,51 +603,52 @@ public class PatentApiController extends BaseApiController {
|
|
|
row.createCell(6).setCellValue(null == obj.getApplicationFee() ? 0 : obj.getApplicationFee());
|
|
|
row.createCell(7).setCellValue(null == obj.getTrialFee() ? 0 : obj.getTrialFee());
|
|
|
row.createCell(8).setCellValue(null == obj.getPrintingFee() ? 0 : obj.getPrintingFee());
|
|
|
-
|
|
|
- if (null != obj.getFunds()){
|
|
|
- switch (obj.getFunds()){
|
|
|
- case 0 :
|
|
|
+
|
|
|
+ if (null != obj.getFunds()) {
|
|
|
+ switch (obj.getFunds()) {
|
|
|
+ case 0:
|
|
|
row.createCell(9).setCellValue("否");
|
|
|
break;
|
|
|
- case 1 :
|
|
|
+ case 1:
|
|
|
row.createCell(9).setCellValue("是");
|
|
|
}
|
|
|
} else {
|
|
|
row.createCell(9).setCellValue("否");
|
|
|
}
|
|
|
-
|
|
|
- if (null != obj.getReimbursement()){
|
|
|
- switch (obj.getReimbursement()){
|
|
|
- case 0 :
|
|
|
+
|
|
|
+ if (null != obj.getReimbursement()) {
|
|
|
+ switch (obj.getReimbursement()) {
|
|
|
+ case 0:
|
|
|
row.createCell(10).setCellValue("否");
|
|
|
break;
|
|
|
- case 1 :
|
|
|
+ case 1:
|
|
|
row.createCell(10).setCellValue("是");
|
|
|
}
|
|
|
} else {
|
|
|
row.createCell(10).setCellValue("否");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
row.createCell(11).setCellValue(obj.getPatentApplicationDateFormattedDate());
|
|
|
- row.createCell(12).setCellValue(null == obj.getPatentApplicationDateFormattedDate() ? "" : calDeadline(obj.getPatentApplicationDateFormattedDate()));
|
|
|
-
|
|
|
+ row.createCell(12).setCellValue(null == obj.getPatentApplicationDateFormattedDate() ? ""
|
|
|
+ : calDeadline(obj.getPatentApplicationDateFormattedDate()));
|
|
|
+
|
|
|
}
|
|
|
DownloadUtils downloadUtils = new DownloadUtils();
|
|
|
downloadUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
|
|
|
}
|
|
|
-
|
|
|
- //待缴年登印费专利管理报表
|
|
|
+
|
|
|
+ // 待缴年登印费专利管理报表
|
|
|
private void exportPendings(HttpServletResponse response, List<PatentPendingBo> pendings) {
|
|
|
String sheetName = "待缴年登印费专利管理报表";
|
|
|
- HSSFWorkbook workbook = createWorkbook(sheetName,
|
|
|
- new String[]{"编号","申请号/专利号","省份","公司名称","专利类型","专利名称","专利状态","缴费状态","缴费截止日期"});
|
|
|
-
|
|
|
+ HSSFWorkbook workbook = createWorkbook(sheetName,
|
|
|
+ new String[] { "编号", "申请号/专利号", "省份", "公司名称", "专利类型", "专利名称", "专利状态", "缴费状态", "缴费截止日期" });
|
|
|
+
|
|
|
HSSFSheet sheet = workbook.getSheet(sheetName);
|
|
|
-
|
|
|
- for (int i = 0 ;i < pendings.size();i++){
|
|
|
+
|
|
|
+ for (int i = 0; i < pendings.size(); i++) {
|
|
|
PatentPendingBo obj = pendings.get(i);
|
|
|
HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
|
|
|
- if (null == obj.getSerialNumber()){
|
|
|
+ if (null == obj.getSerialNumber()) {
|
|
|
row.createCell(0).setCellValue("");
|
|
|
} else {
|
|
|
row.createCell(0).setCellValue(obj.getSerialNumber());
|
|
|
@@ -617,55 +656,54 @@ public class PatentApiController extends BaseApiController {
|
|
|
row.createCell(1).setCellValue(obj.getPatentNumber());
|
|
|
row.createCell(2).setCellValue(obj.getLocationProvince());
|
|
|
row.createCell(3).setCellValue(obj.getUnitName());
|
|
|
- if (null != obj.getPatentCatagory()){
|
|
|
- switch (obj.getPatentCatagory()){
|
|
|
- case 0:
|
|
|
- row.createCell(4).setCellValue("发明型专利");
|
|
|
- break;
|
|
|
- case 1:
|
|
|
- row.createCell(4).setCellValue("科技型专利");
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- row.createCell(4).setCellValue("外观型专利");
|
|
|
- break;
|
|
|
+ if (null != obj.getPatentCatagory()) {
|
|
|
+ switch (obj.getPatentCatagory()) {
|
|
|
+ case 0:
|
|
|
+ row.createCell(4).setCellValue("发明型专利");
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ row.createCell(4).setCellValue("科技型专利");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ row.createCell(4).setCellValue("外观型专利");
|
|
|
+ break;
|
|
|
}
|
|
|
} else {
|
|
|
row.createCell(4).setCellValue("");
|
|
|
}
|
|
|
row.createCell(5).setCellValue(obj.getPatentName());
|
|
|
row.createCell(6).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
|
|
|
- if (null != obj.getAnnualFeeState()){
|
|
|
- switch (obj.getAnnualFeeState()){
|
|
|
- case 0 :
|
|
|
+ if (null != obj.getAnnualFeeState()) {
|
|
|
+ switch (obj.getAnnualFeeState()) {
|
|
|
+ case 0:
|
|
|
row.createCell(7).setCellValue("未缴费");
|
|
|
break;
|
|
|
- case 1 :
|
|
|
+ case 1:
|
|
|
row.createCell(7).setCellValue("已缴费");
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
row.createCell(7).setCellValue("未缴费");
|
|
|
}
|
|
|
- row.createCell(8).setCellValue(null == obj.getAuthorizedDateFormattedDate() ? "" : calDeadline(obj.getAuthorizedDateFormattedDate()));
|
|
|
-
|
|
|
+ row.createCell(8).setCellValue(null == obj.getAuthorizedDateFormattedDate() ? ""
|
|
|
+ : calDeadline(obj.getAuthorizedDateFormattedDate()));
|
|
|
+
|
|
|
}
|
|
|
DownloadUtils downloadUtils = new DownloadUtils();
|
|
|
downloadUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
private void exportComosites(HttpServletResponse response, List<PatentCompositeBo> composites) {
|
|
|
String sheetName = "专利综合管理报表";
|
|
|
HSSFWorkbook workbook = createWorkbook(sheetName,
|
|
|
- new String[] { "编号", "申请号/专利号", "事务所", "省份", "公司名称", "专利名称", "专利状态", "派单日" ,
|
|
|
- "申请日" , "授权日" , "资料撰写人"});
|
|
|
+ new String[] { "编号", "申请号/专利号", "事务所", "省份", "公司名称", "专利名称", "专利状态", "派单日", "申请日", "授权日", "资料撰写人" });
|
|
|
HSSFSheet sheet = workbook.getSheet(sheetName);
|
|
|
|
|
|
// 将查询出的数据设置到sheet对应的单元格中
|
|
|
for (int i = 0; i < composites.size(); i++) {
|
|
|
PatentCompositeBo obj = composites.get(i);// 遍历每个对象
|
|
|
HSSFRow row = sheet.createRow(i + 2);// 创建所需的行数
|
|
|
- if (null == obj.getSerialNumber()){
|
|
|
+ if (null == obj.getSerialNumber()) {
|
|
|
row.createCell(0).setCellValue("");
|
|
|
} else {
|
|
|
row.createCell(0).setCellValue(obj.getSerialNumber());
|
|
|
@@ -675,7 +713,7 @@ public class PatentApiController extends BaseApiController {
|
|
|
row.createCell(3).setCellValue(obj.getLocationProvince());
|
|
|
row.createCell(4).setCellValue(obj.getUnitName());
|
|
|
row.createCell(5).setCellValue(obj.getPatentName());
|
|
|
- row.createCell(6).setCellValue(null == obj.getPatentState()? "" : switchPatState(obj.getPatentState()));
|
|
|
+ row.createCell(6).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
|
|
|
row.createCell(7).setCellValue(null == obj.getPatentState() ? "" : switchPatState(obj.getPatentState()));
|
|
|
row.createCell(8).setCellValue(obj.getCreateTimeFormattedDate());
|
|
|
row.createCell(9).setCellValue(obj.getPatentApplicationFormattedDate());
|
|
|
@@ -684,9 +722,9 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
DownloadUtils downloadUtils = new DownloadUtils();
|
|
|
downloadUtils.downloadExcel(response, sheetName + Calendar.getInstance().getTimeInMillis() + ".xls", workbook);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private HSSFWorkbook createWorkbook(String sheetName, String[] colNames) {
|
|
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
|
|
HSSFSheet sheet = workbook.createSheet(sheetName);
|
|
|
@@ -707,100 +745,103 @@ public class PatentApiController extends BaseApiController {
|
|
|
|
|
|
/**
|
|
|
* 专利相关材料上传
|
|
|
+ *
|
|
|
* @param req
|
|
|
- * @param sign 材料类型标记,其中'patent_prory_statement'为专利代理委托书标记
|
|
|
+ * @param sign
|
|
|
+ * 材料类型标记,其中'patent_prory_statement'为专利代理委托书标记
|
|
|
* @return
|
|
|
*/
|
|
|
- @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;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ @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){
|
|
|
+ @RequestMapping(value = "/downloadTemplate", method = RequestMethod.GET)
|
|
|
+ public Result downloadPatentProryStatement(HttpServletResponse response, HttpServletRequest request) {
|
|
|
Result res = new Result();
|
|
|
- String filename = "Patent" + Long.toString(System.nanoTime())+".doc";
|
|
|
+ String filename = "Patent" + Long.toString(System.nanoTime()) + ".doc";
|
|
|
String fileSaveRootPath = uploadPrivatePath + "/patent/patent_prory_statement.doc";
|
|
|
- return patentDownload(res,response,filename,fileSaveRootPath);
|
|
|
+ return patentDownload(res, response, filename, fileSaveRootPath);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 下载专利相关材料
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- @RequestMapping(value="/downloadFile",method = RequestMethod.GET)
|
|
|
- public Result downloadPatentFile(HttpServletResponse response, String path , String sign ,HttpServletRequest request){
|
|
|
+ @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)){
|
|
|
+ if (StringUtils.isBlank(path)) {
|
|
|
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";
|
|
|
+ if (sign.equals("patent_prory_statement") || sign.equals("patent_writing")) {
|
|
|
+ filename = Long.toString(System.nanoTime()) + ".doc";
|
|
|
} else {
|
|
|
- filename =Long.toString(System.nanoTime())+".jpg";
|
|
|
+ filename = Long.toString(System.nanoTime()) + ".jpg";
|
|
|
}
|
|
|
String fileSaveRootPath = uploadPrivatePath + path;
|
|
|
- return patentDownload(res,response,filename,fileSaveRootPath);
|
|
|
-
|
|
|
+ return patentDownload(res, response, filename, fileSaveRootPath);
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- private Result patentDownload(Result res,HttpServletResponse response,String filename,String fileSaveRootPath){
|
|
|
+
|
|
|
+ private Result patentDownload(Result res, HttpServletResponse response, String filename, String fileSaveRootPath) {
|
|
|
InputStream in = null;
|
|
|
OutputStream out = null;
|
|
|
byte[] buffer = new byte[8 * 1024];
|
|
|
try {
|
|
|
File file = new File(fileSaveRootPath);
|
|
|
in = new FileInputStream(file);
|
|
|
- out = response.getOutputStream();
|
|
|
- // 设置文件MIME类型
|
|
|
- response.setContentType("application/octet-stream");
|
|
|
- response.setHeader("Content-Disposition", "attachment; filename=" + filename);
|
|
|
- for (;;) {
|
|
|
- int bytes = in.read(buffer);
|
|
|
- if (bytes == -1) {
|
|
|
- break;
|
|
|
+ out = response.getOutputStream();
|
|
|
+ // 设置文件MIME类型
|
|
|
+ response.setContentType("application/octet-stream");
|
|
|
+ response.setHeader("Content-Disposition", "attachment; filename=" + filename);
|
|
|
+ for (;;) {
|
|
|
+ int bytes = in.read(buffer);
|
|
|
+ if (bytes == -1) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ out.write(buffer, 0, bytes);
|
|
|
}
|
|
|
- out.write(buffer, 0, bytes);
|
|
|
- }
|
|
|
- } catch (IOException e) {
|
|
|
- LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
|
|
|
- } finally {
|
|
|
- try {
|
|
|
- in.close();
|
|
|
- } catch (IOException e) {
|
|
|
- LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
|
|
|
- }
|
|
|
- try {
|
|
|
- out.close();
|
|
|
} catch (IOException e) {
|
|
|
LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
|
|
|
+ } finally {
|
|
|
+ try {
|
|
|
+ in.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ out.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ LoggerUtils.fmtError(getClass(), e, "IO错误:%s", e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
return res;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- private String handleFile(Result res, String fileName, HttpServletRequest req) {
|
|
|
+
|
|
|
+ private String handleFile(Result res, String fileName, HttpServletRequest req) {
|
|
|
List<MultipartFile> files = getFiles(req);
|
|
|
if (!files.isEmpty()) {
|
|
|
try {
|
|
|
@@ -818,10 +859,6 @@ public class PatentApiController extends BaseApiController {
|
|
|
}
|
|
|
return fileName;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
// 专利纸件收发登记
|
|
|
private Pagination<PatentRecieveSendBo> getRecieveSendList(Integer pNo, Integer pSize) {
|
|
|
@@ -854,8 +891,8 @@ public class PatentApiController extends BaseApiController {
|
|
|
// 管理端申请专利列表(专利综合管理)
|
|
|
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
|
|
|
- {
|
|
|
+ String[] createTime, String[] patentApplicationDate, String author, Integer pNo, Integer pSize)
|
|
|
+ throws ParseException {
|
|
|
return (Pagination<PatentCompositeBo>) patentInfoService.getManagePatentList(serialNumber, patentNumber, office,
|
|
|
locationProvince, unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate,
|
|
|
author, pNo, pSize);
|
|
|
@@ -868,48 +905,49 @@ public class PatentApiController extends BaseApiController {
|
|
|
patentName, patentCatagory, patentState, pNo, pSize);
|
|
|
}
|
|
|
|
|
|
- private PatentRegistration regBo2Reg(String rid, String pid ,PatentRegistrationBo patentRegistrationBo) throws ParseException {
|
|
|
+ private PatentRegistration regBo2Reg(String rid, String pid, PatentRegistrationBo patentRegistrationBo)
|
|
|
+ throws ParseException {
|
|
|
PatentRegistration patentRegistration = new PatentRegistration();
|
|
|
patentRegistration.setId(rid);
|
|
|
patentRegistration.setAcceptanceExpressCompany(patentRegistrationBo.getAcceptanceExpressCompany());
|
|
|
if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceIssueTime())) {
|
|
|
- patentRegistration.setAcceptanceIssueTime(
|
|
|
- DateUtils.parseDate(patentRegistrationBo.getAcceptanceIssueTime(), "yyyy-MM-dd"));
|
|
|
+ patentRegistration.setAcceptanceIssueTime(
|
|
|
+ DateUtils.parseDate(patentRegistrationBo.getAcceptanceIssueTime(), "yyyy-MM-dd"));
|
|
|
} else {
|
|
|
patentRegistration.setAcceptanceIssueTime(null);
|
|
|
}
|
|
|
if (!StringUtils.isBlank(patentRegistrationBo.getAcceptanceReceiveTime())) {
|
|
|
- patentRegistration.setAcceptanceReceiveTime(
|
|
|
- DateUtils.parseDate(patentRegistrationBo.getAcceptanceReceiveTime(), "yyyy-MM-dd"));
|
|
|
+ patentRegistration.setAcceptanceReceiveTime(
|
|
|
+ DateUtils.parseDate(patentRegistrationBo.getAcceptanceReceiveTime(), "yyyy-MM-dd"));
|
|
|
} else {
|
|
|
patentRegistration.setAcceptanceReceiveTime(null);
|
|
|
}
|
|
|
patentRegistration.setAcceptanceTrackingNumber(patentRegistrationBo.getAcceptanceTrackingNumber());
|
|
|
patentRegistration.setAuthorizationExpressCompany(patentRegistrationBo.getAuthorizationExpressCompany());
|
|
|
if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationIssueTime())) {
|
|
|
- patentRegistration.setAuthorizationIssueTime(
|
|
|
- DateUtils.parseDate(patentRegistrationBo.getAuthorizationIssueTime(), "yyyy-MM-dd"));
|
|
|
+ patentRegistration.setAuthorizationIssueTime(
|
|
|
+ DateUtils.parseDate(patentRegistrationBo.getAuthorizationIssueTime(), "yyyy-MM-dd"));
|
|
|
} else {
|
|
|
patentRegistration.setAuthorizationIssueTime(null);
|
|
|
}
|
|
|
if (!StringUtils.isBlank(patentRegistrationBo.getAuthorizationReceiveTime())) {
|
|
|
- patentRegistration.setAuthorizationReceiveTime(
|
|
|
- DateUtils.parseDate(patentRegistrationBo.getAuthorizationReceiveTime(), "yyyy-MM-dd"));
|
|
|
+ patentRegistration.setAuthorizationReceiveTime(
|
|
|
+ DateUtils.parseDate(patentRegistrationBo.getAuthorizationReceiveTime(), "yyyy-MM-dd"));
|
|
|
} else {
|
|
|
patentRegistration.setAuthorizationReceiveTime(null);
|
|
|
}
|
|
|
patentRegistration.setAuthorizationTrackingNumber(patentRegistrationBo.getAuthorizationTrackingNumber());
|
|
|
patentRegistration.setCertificateExpressCompany(patentRegistrationBo.getCertificateExpressCompany());
|
|
|
if (!StringUtils.isBlank(patentRegistrationBo.getCertificateIssueTime())) {
|
|
|
- patentRegistration.setCertificateIssueTime(
|
|
|
- DateUtils.parseDate(patentRegistrationBo.getCertificateIssueTime(), "yyyy-MM-dd"));
|
|
|
+ patentRegistration.setCertificateIssueTime(
|
|
|
+ DateUtils.parseDate(patentRegistrationBo.getCertificateIssueTime(), "yyyy-MM-dd"));
|
|
|
|
|
|
} else {
|
|
|
patentRegistration.setCertificateIssueTime(null);
|
|
|
}
|
|
|
if (!StringUtils.isBlank(patentRegistrationBo.getCertificateRecieveTime())) {
|
|
|
- patentRegistration.setCertificateRecieveTime(
|
|
|
- DateUtils.parseDate(patentRegistrationBo.getCertificateRecieveTime(), "yyyy-MM-dd"));
|
|
|
+ patentRegistration.setCertificateRecieveTime(
|
|
|
+ DateUtils.parseDate(patentRegistrationBo.getCertificateRecieveTime(), "yyyy-MM-dd"));
|
|
|
} else {
|
|
|
patentRegistration.setCertificateRecieveTime(null);
|
|
|
}
|
|
|
@@ -917,67 +955,64 @@ public class PatentApiController extends BaseApiController {
|
|
|
patentRegistration.setPid(pid);
|
|
|
return patentRegistration;
|
|
|
}
|
|
|
-
|
|
|
- //缴费截止日期
|
|
|
- private String calDeadline(String s){
|
|
|
+
|
|
|
+ // 缴费截止日期
|
|
|
+ private String calDeadline(String s) {
|
|
|
String[] arr = s.split("-");
|
|
|
String y = arr[0];
|
|
|
String m = arr[1];
|
|
|
String d = arr[2];
|
|
|
- if ("11".equals(arr[0])){
|
|
|
+ if ("11".equals(arr[0])) {
|
|
|
m = "01";
|
|
|
- y = String.valueOf(Integer.parseInt(y)+1);
|
|
|
- } else if ("12".equals(arr[0])){
|
|
|
+ y = String.valueOf(Integer.parseInt(y) + 1);
|
|
|
+ } else if ("12".equals(arr[0])) {
|
|
|
m = "02";
|
|
|
- y = String.valueOf(Integer.parseInt(y)+1);
|
|
|
+ y = String.valueOf(Integer.parseInt(y) + 1);
|
|
|
} else {
|
|
|
- m = String.valueOf(Integer.parseInt(m)+2);
|
|
|
+ m = String.valueOf(Integer.parseInt(m) + 2);
|
|
|
}
|
|
|
return y + m + d;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- //专利状态
|
|
|
- private String switchPatState(Integer s){
|
|
|
+
|
|
|
+ // 专利状态
|
|
|
+ private String switchPatState(Integer s) {
|
|
|
String state = "";
|
|
|
- switch (s){
|
|
|
+ switch (s) {
|
|
|
case 11:
|
|
|
state = "撤销";
|
|
|
break;
|
|
|
case 1:
|
|
|
state = "申请";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 2:
|
|
|
state = "撰写";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 3:
|
|
|
state = "受理";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 4:
|
|
|
state = "审查意见通知";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 5:
|
|
|
state = "审查意见已答复";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 6:
|
|
|
state = "补正通知";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 7:
|
|
|
state = "补正已答复";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 8:
|
|
|
state = "授权";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 9:
|
|
|
state = "驳回";
|
|
|
- break;
|
|
|
+ break;
|
|
|
case 10:
|
|
|
state = "发证";
|
|
|
- break;
|
|
|
+ break;
|
|
|
}
|
|
|
return state;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
}
|