|
|
@@ -91,6 +91,153 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
private AftFileService aftFileService;
|
|
|
@Resource
|
|
|
private OrgRatepayService orgRatepayService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专利列表
|
|
|
+ *
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/patentList", method = RequestMethod.GET)
|
|
|
+ public Result patentList(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,
|
|
|
+ String author, String pageNo, String pageSize) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (!checkAdminLogin(res)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince,
|
|
|
+ unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo,
|
|
|
+ pSize));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增专利申请
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/apply", method = RequestMethod.POST)
|
|
|
+ public Result manageApplyPatent(@Valid InputPatentInfo patentInfo, BindingResult bindingResult) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (!checkAdminLogin(res)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(patentInfo.getUid())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ User curUser = userService.selectByPrimaryKey(patentInfo.getUid());
|
|
|
+ if (!checkCertify(res, curUser)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ String aid = curUser.getAid();
|
|
|
+ PatentInfo pi = new PatentInfo();
|
|
|
+ BeanUtils.copyProperties(patentInfo, pi);
|
|
|
+ res.setData(patentInfoService.savePatentInfo(pi, aid));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专利详情
|
|
|
+ *
|
|
|
+ * @param pid
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/detail", method = RequestMethod.GET)
|
|
|
+ public Result patentDetail(String pid) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (!checkAdminLogin(res)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(pid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
|
|
|
+ } else {
|
|
|
+ res.setData(patentInfoService.selectPatentInfoDetail(pid));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 管理端logs
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/logs", method = RequestMethod.GET)
|
|
|
+ public Result patentProcess(String pid) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (!checkAdminLogin(res)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(pid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "专利ID"));
|
|
|
+ } else {
|
|
|
+ res.setData(patentLogService.selectProcessByPid(pid));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 专利详情修改保存
|
|
|
+ *
|
|
|
+ * @throws ParseException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
+ public Result managePatentInfo(@Valid InputPatentInfo patentInfo, BindingResult bindingResult,
|
|
|
+ String recordTimeFormattedDate) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!checkAdminLogin(res)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(patentInfo.getId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ PatentInfo p = patentInfoService.selectByPrimaryKey(patentInfo.getId());
|
|
|
+ if (null == p) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ Date recordTime = null;
|
|
|
+ if (!StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
+ try {
|
|
|
+ recordTime = DateUtils.parseDate(recordTimeFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ PatentInfo pi = new PatentInfo();
|
|
|
+ PatentLog pl = new PatentLog();
|
|
|
+ pi.setId(patentInfo.getId());
|
|
|
+ BeanUtils.copyProperties(patentInfo, pi);
|
|
|
+ BeanUtils.copyProperties(patentInfo, pl);
|
|
|
+ patentInfoService.updatePatentInfo(pi, pl, recordTime);
|
|
|
+ res.setData(1);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 专利状态流转下拉
|
|
|
@@ -347,150 +494,15 @@ public class AdminPatentApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 管理端logs
|
|
|
- */
|
|
|
- @RequestMapping(value = "/logs", method = RequestMethod.GET)
|
|
|
- public Result patentProcess(String pid) {
|
|
|
- Result res = new Result();
|
|
|
- if (!checkAdminLogin(res)) {
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(pid)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "专利ID"));
|
|
|
- } else {
|
|
|
- res.setData(patentLogService.selectProcessByPid(pid));
|
|
|
- }
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增专利申请
|
|
|
- */
|
|
|
- @RequestMapping(value = "/apply", method = RequestMethod.POST)
|
|
|
- public Result manageApplyPatent(@Valid InputPatentInfo patentInfo, BindingResult bindingResult) {
|
|
|
- Result res = new Result();
|
|
|
- if (bindingResult.hasErrors()) {
|
|
|
- res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
- PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (!checkAdminLogin(res)) {
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isBlank(patentInfo.getUid())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- User curUser = userService.selectByPrimaryKey(patentInfo.getUid());
|
|
|
- if (!checkCertify(res, curUser)) {
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- String aid = curUser.getAid();
|
|
|
- PatentInfo pi = new PatentInfo();
|
|
|
- BeanUtils.copyProperties(patentInfo, pi);
|
|
|
- res.setData(patentInfoService.savePatentInfo(pi, aid));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 专利详情修改保存
|
|
|
- *
|
|
|
- * @throws ParseException
|
|
|
- */
|
|
|
- @RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
- public Result managePatentInfo(@Valid InputPatentInfo patentInfo, BindingResult bindingResult,
|
|
|
- String recordTimeFormattedDate) {
|
|
|
- Result res = new Result();
|
|
|
- if (bindingResult.hasErrors()) {
|
|
|
- res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
- PatentInfoFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- if (!checkAdminLogin(res)) {
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- if (StringUtils.isBlank(patentInfo.getId())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- PatentInfo p = patentInfoService.selectByPrimaryKey(patentInfo.getId());
|
|
|
- if (null == p) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到专利申请", "专利记录ID"));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- Date recordTime = null;
|
|
|
- if (!StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
- try {
|
|
|
- recordTime = DateUtils.parseDate(recordTimeFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
- } catch (ParseException e) {
|
|
|
- }
|
|
|
- }
|
|
|
- PatentInfo pi = new PatentInfo();
|
|
|
- PatentLog pl = new PatentLog();
|
|
|
- pi.setId(patentInfo.getId());
|
|
|
- BeanUtils.copyProperties(patentInfo, pi);
|
|
|
- BeanUtils.copyProperties(patentInfo, pl);
|
|
|
- patentInfoService.updatePatentInfo(pi, pl, recordTime);
|
|
|
- res.setData(1);
|
|
|
- return res;
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- /**
|
|
|
- * 专利列表
|
|
|
- *
|
|
|
- * @throws ParseException
|
|
|
- */
|
|
|
- @RequestMapping(value = "/patentList", method = RequestMethod.GET)
|
|
|
- public Result patentList(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,
|
|
|
- String author, String pageNo, String pageSize) {
|
|
|
- Result res = new Result();
|
|
|
- if (!checkAdminLogin(res)) {
|
|
|
- return res;
|
|
|
- }
|
|
|
- Integer pNo = 1;
|
|
|
- Integer pSize = 10;
|
|
|
- if (StringUtils.isNumeric(pageSize)) {
|
|
|
- pSize = Integer.parseInt(pageSize);
|
|
|
- }
|
|
|
- if (StringUtils.isNumeric(pageNo)) {
|
|
|
- pNo = Integer.parseInt(pageNo);
|
|
|
- }
|
|
|
- res.setData(patentInfoService.getManagePatentList(serialNumber, patentNumber, office, locationProvince,
|
|
|
- unitName, patentCatagory, patentName, patentState, createTime, patentApplicationDate, author, pNo,
|
|
|
- pSize));
|
|
|
- return res;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
- /**
|
|
|
- * 专利详情
|
|
|
- *
|
|
|
- * @param pid
|
|
|
- * @return
|
|
|
- */
|
|
|
- @RequestMapping(value = "/detail", method = RequestMethod.GET)
|
|
|
- public Result patentDetail(String pid) {
|
|
|
- Result res = new Result();
|
|
|
- if (!checkAdminLogin(res)) {
|
|
|
- return res;
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(pid)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "公司"));
|
|
|
- } else {
|
|
|
- res.setData(patentInfoService.selectPatentInfoDetail(pid));
|
|
|
- }
|
|
|
- return res;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 待缴费专利管理列表
|