|
|
@@ -1,4 +1,4 @@
|
|
|
-package com.goafanti.techservice.patent.service.impl;
|
|
|
+package com.goafanti.patent.service.impl;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
import java.util.Calendar;
|
|
|
@@ -11,92 +11,92 @@ import java.util.UUID;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.goafanti.common.dao.OrgIntellectualPropertyMapper;
|
|
|
import com.goafanti.common.dao.PatentCostMapper;
|
|
|
import com.goafanti.common.dao.PatentInfoMapper;
|
|
|
import com.goafanti.common.dao.PatentLogMapper;
|
|
|
import com.goafanti.common.dao.PatentRegistrationMapper;
|
|
|
import com.goafanti.common.dao.UserMapper;
|
|
|
+import com.goafanti.common.model.OrgIntellectualProperty;
|
|
|
import com.goafanti.common.model.PatentCost;
|
|
|
import com.goafanti.common.model.PatentInfo;
|
|
|
import com.goafanti.common.model.PatentLog;
|
|
|
import com.goafanti.common.model.PatentRegistration;
|
|
|
import com.goafanti.common.model.User;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
-import com.goafanti.techservice.patent.bo.PatentCompositeBo;
|
|
|
-import com.goafanti.techservice.patent.bo.PatentNoticeOfCorrectionBo;
|
|
|
-import com.goafanti.techservice.patent.bo.PatentPendingBo;
|
|
|
-import com.goafanti.techservice.patent.service.PatentInfoService;
|
|
|
-
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
+import com.goafanti.patent.bo.PatentCompositeBo;
|
|
|
+import com.goafanti.patent.bo.PatentNoticeOfCorrectionBo;
|
|
|
+import com.goafanti.patent.bo.PatentPendingBo;
|
|
|
+import com.goafanti.patent.service.PatentInfoService;
|
|
|
|
|
|
@Service
|
|
|
public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> implements PatentInfoService {
|
|
|
@Autowired
|
|
|
- PatentInfoMapper patentInfoMapper;
|
|
|
+ PatentInfoMapper patentInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ UserMapper userMapper;
|
|
|
@Autowired
|
|
|
- UserMapper userMapper;
|
|
|
+ PatentRegistrationMapper patentRegistrationMapper;
|
|
|
@Autowired
|
|
|
- PatentRegistrationMapper patentRegistrationMapper;
|
|
|
+ PatentCostMapper patentCostMapper;
|
|
|
@Autowired
|
|
|
- PatentCostMapper patentCostMapper;
|
|
|
+ PatentLogMapper patentLogMapper;
|
|
|
@Autowired
|
|
|
- PatentLogMapper patentLogMapper;
|
|
|
-
|
|
|
-
|
|
|
+ OrgIntellectualPropertyMapper orgIntellectualPropertyMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public PatentInfo selectPatentInfoByUserId(String uid) {
|
|
|
return patentInfoMapper.selectPatentInfoByUserId(uid);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public PatentInfo insert(PatentInfo patentInfo) {
|
|
|
patentInfoMapper.insert(patentInfo);
|
|
|
return patentInfo;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public int updateByPrimaryKeySelective(PatentInfo patentInfo) {
|
|
|
return patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public PatentInfo selectByPrimaryKey(String id) {
|
|
|
return patentInfoMapper.selectByPrimaryKey(id);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<PatentInfo> getClientApplyList(String uid, String patentNumber, String patentName,
|
|
|
Integer patentCatagory, Integer patentState, Integer pageNo, Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
- if (uid == null){
|
|
|
+
|
|
|
+ if (uid == null) {
|
|
|
return null;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
params.put("uid", uid);
|
|
|
}
|
|
|
-
|
|
|
- if (patentNumber != null && patentNumber != ""){
|
|
|
+
|
|
|
+ if (patentNumber != null && patentNumber != "") {
|
|
|
params.put("patentNumber", patentNumber);
|
|
|
}
|
|
|
-
|
|
|
- if (patentName != null && patentName != ""){
|
|
|
+
|
|
|
+ if (patentName != null && patentName != "") {
|
|
|
params.put("patentName", patentName);
|
|
|
}
|
|
|
-
|
|
|
- if (patentCatagory != null ){
|
|
|
+
|
|
|
+ if (patentCatagory != null) {
|
|
|
params.put("patentCatagory", patentCatagory);
|
|
|
}
|
|
|
-
|
|
|
- if(patentState != null){
|
|
|
+
|
|
|
+ if (patentState != null) {
|
|
|
params.put("patentState", patentState);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (pageNo == null || pageNo < 0) {
|
|
|
pageNo = 1;
|
|
|
}
|
|
|
@@ -108,89 +108,82 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
pageSize);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<PatentCompositeBo> getManagePatentList(Integer serialNumber, String patentNumber, String office,
|
|
|
String locationProvince, String unitName, Integer patentCatagory, String patentName, Integer patentState,
|
|
|
- String[] cDate, String[] pDate , String author, Integer pageNo,
|
|
|
- Integer pageSize) throws ParseException {
|
|
|
+ String[] cDate, String[] pDate, String author, Integer pageNo, Integer pageSize) throws ParseException {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
Date cStart = null;
|
|
|
Date cEnd = null;
|
|
|
Date pStart = null;
|
|
|
Date pEnd = null;
|
|
|
-
|
|
|
-
|
|
|
- if(cDate != null && cDate.length>0){
|
|
|
- cStart = DateUtils.parseDate(cDate[0], "yyyy-MM-dd");
|
|
|
- if(cDate.length == 2){
|
|
|
- cEnd = DateUtils.addDays(DateUtils.parseDate(cDate[1], "yyyy-MM-dd"), 1);
|
|
|
- }
|
|
|
- }
|
|
|
- if(pDate != null && pDate.length>0){
|
|
|
+
|
|
|
+ if (cDate != null && cDate.length > 0) {
|
|
|
+ cStart = DateUtils.parseDate(cDate[0], "yyyy-MM-dd");
|
|
|
+ if (cDate.length == 2) {
|
|
|
+ cEnd = DateUtils.addDays(DateUtils.parseDate(cDate[1], "yyyy-MM-dd"), 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (pDate != null && pDate.length > 0) {
|
|
|
pStart = DateUtils.parseDate(pDate[0], "yyyy-MM-dd");
|
|
|
- if(pDate.length == 2){
|
|
|
+ if (pDate.length == 2) {
|
|
|
pEnd = DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- if(cStart != null){
|
|
|
+
|
|
|
+ if (cStart != null) {
|
|
|
params.put("cStart", cStart);
|
|
|
}
|
|
|
-
|
|
|
- if(cEnd != null){
|
|
|
+
|
|
|
+ if (cEnd != null) {
|
|
|
params.put("cEnd", cEnd);
|
|
|
}
|
|
|
-
|
|
|
- if(pStart != null){
|
|
|
+
|
|
|
+ if (pStart != null) {
|
|
|
params.put("pStart", pStart);
|
|
|
}
|
|
|
-
|
|
|
- if(pEnd != null){
|
|
|
+
|
|
|
+ if (pEnd != null) {
|
|
|
params.put("pEnd", pEnd);
|
|
|
}
|
|
|
-
|
|
|
- if(serialNumber != null ){
|
|
|
+
|
|
|
+ if (serialNumber != null) {
|
|
|
params.put("serialNumber", serialNumber);
|
|
|
}
|
|
|
-
|
|
|
- if(patentNumber != null && patentNumber != ""){
|
|
|
+
|
|
|
+ if (patentNumber != null && patentNumber != "") {
|
|
|
params.put("patentNumber", patentNumber);
|
|
|
}
|
|
|
-
|
|
|
- if(office != null && office != ""){
|
|
|
+
|
|
|
+ if (office != null && office != "") {
|
|
|
params.put("office", office);
|
|
|
}
|
|
|
-
|
|
|
- if(locationProvince != null && locationProvince != ""){
|
|
|
+
|
|
|
+ if (locationProvince != null && locationProvince != "") {
|
|
|
params.put("locationProvince", locationProvince);
|
|
|
}
|
|
|
-
|
|
|
- if(unitName != null && unitName != ""){
|
|
|
+
|
|
|
+ if (unitName != null && unitName != "") {
|
|
|
params.put("unitName", unitName);
|
|
|
}
|
|
|
-
|
|
|
- if(patentCatagory != null){
|
|
|
+
|
|
|
+ if (patentCatagory != null) {
|
|
|
params.put("patentCatagory", patentCatagory);
|
|
|
}
|
|
|
-
|
|
|
- if(patentName != null && patentName != ""){
|
|
|
+
|
|
|
+ if (patentName != null && patentName != "") {
|
|
|
params.put("patentName", patentName);
|
|
|
}
|
|
|
-
|
|
|
- if(patentState != null){
|
|
|
+
|
|
|
+ if (patentState != null) {
|
|
|
params.put("patentState", patentState);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if(author != null && author != ""){
|
|
|
+
|
|
|
+ if (author != null && author != "") {
|
|
|
params.put("author", author);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if (pageNo == null || pageNo < 0) {
|
|
|
pageNo = 1;
|
|
|
}
|
|
|
@@ -198,20 +191,20 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
if (pageSize == null || pageSize < 0) {
|
|
|
pageSize = 15;
|
|
|
}
|
|
|
- return (Pagination<PatentCompositeBo>) findPage("findManagePatentListByPage","findManagePatentCount", params, pageNo, pageSize);
|
|
|
+ return (Pagination<PatentCompositeBo>) findPage("findManagePatentListByPage", "findManagePatentCount", params,
|
|
|
+ pageNo, pageSize);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<PatentPendingBo> getManagePendingPaymentList(String locationProvince, Integer pageNo,
|
|
|
Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
- if(locationProvince != null && locationProvince != ""){
|
|
|
+
|
|
|
+ if (locationProvince != null && locationProvince != "") {
|
|
|
params.put("locationProvince", locationProvince);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (pageNo == null || pageNo < 0) {
|
|
|
pageNo = 1;
|
|
|
}
|
|
|
@@ -219,58 +212,57 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
if (pageSize == null || pageSize < 0) {
|
|
|
pageSize = 15;
|
|
|
}
|
|
|
- return (Pagination<PatentPendingBo>) findPage("findManagePendingPaymentListByPage","findManagePendingPaymentCount", params, pageNo, pageSize);
|
|
|
+ return (Pagination<PatentPendingBo>) findPage("findManagePendingPaymentListByPage",
|
|
|
+ "findManagePendingPaymentCount", params, pageNo, pageSize);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<PatentNoticeOfCorrectionBo> getNoticeOfCorrectionList(Date authorizedDate, Integer serialNumber,
|
|
|
String patentNumber, String office, String locationProvince, String unitName, Integer patentCatagory,
|
|
|
String patentName, Integer patentState, String author, Integer pageNo, Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
- if(authorizedDate != null ){
|
|
|
+
|
|
|
+ if (authorizedDate != null) {
|
|
|
params.put("authorizedDate", authorizedDate);
|
|
|
}
|
|
|
-
|
|
|
- if(serialNumber != null){
|
|
|
+
|
|
|
+ if (serialNumber != null) {
|
|
|
params.put("serialNumber", serialNumber);
|
|
|
}
|
|
|
-
|
|
|
- if(patentNumber != null && patentNumber != ""){
|
|
|
+
|
|
|
+ if (patentNumber != null && patentNumber != "") {
|
|
|
params.put(patentNumber, patentNumber);
|
|
|
}
|
|
|
-
|
|
|
- if(office != null && office != ""){
|
|
|
+
|
|
|
+ if (office != null && office != "") {
|
|
|
params.put("office", office);
|
|
|
}
|
|
|
-
|
|
|
- if(locationProvince != null && locationProvince != ""){
|
|
|
+
|
|
|
+ if (locationProvince != null && locationProvince != "") {
|
|
|
params.put("locationProvince", locationProvince);
|
|
|
}
|
|
|
-
|
|
|
- if(unitName != null && unitName != ""){
|
|
|
+
|
|
|
+ if (unitName != null && unitName != "") {
|
|
|
params.put("unitName", unitName);
|
|
|
}
|
|
|
-
|
|
|
- if(patentCatagory != null){
|
|
|
+
|
|
|
+ if (patentCatagory != null) {
|
|
|
params.put("patentCatagory", patentCatagory);
|
|
|
}
|
|
|
-
|
|
|
- if(patentName != null && patentName != ""){
|
|
|
+
|
|
|
+ if (patentName != null && patentName != "") {
|
|
|
params.put("patentName", patentName);
|
|
|
}
|
|
|
-
|
|
|
- if(patentState != null){
|
|
|
+
|
|
|
+ if (patentState != null) {
|
|
|
params.put("patentState", patentState);
|
|
|
}
|
|
|
-
|
|
|
- if(author != null && author != ""){
|
|
|
+
|
|
|
+ if (author != null && author != "") {
|
|
|
params.put("author", patentState);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
if (pageNo == null || pageNo < 0) {
|
|
|
pageNo = 1;
|
|
|
}
|
|
|
@@ -278,16 +270,15 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
if (pageSize == null || pageSize < 0) {
|
|
|
pageSize = 15;
|
|
|
}
|
|
|
- return (Pagination<PatentNoticeOfCorrectionBo>) findPage("findNoticeOfCorrectionListByPage","findNoticeOfCorrectionCount", params, pageNo, pageSize);
|
|
|
+ return (Pagination<PatentNoticeOfCorrectionBo>) findPage("findNoticeOfCorrectionListByPage",
|
|
|
+ "findNoticeOfCorrectionCount", params, pageNo, pageSize);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public int batchDeleteByPrimaryKey(List<String> id) {
|
|
|
return patentInfoMapper.batchDeleteByPrimaryKey(id);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public PatentInfo savePatentInfo(PatentInfo patentInfo, String uid) {
|
|
|
patentInfo.setId(UUID.randomUUID().toString());
|
|
|
@@ -325,7 +316,66 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
return patentInfo;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ @Override
|
|
|
+ public void updatePatentInfo(PatentInfo patentInfo, PatentLog patentLog, Date recordTime) {
|
|
|
+ if (!StringUtils.isBlank(patentLog.getPrincipal())) {
|
|
|
+ switch (patentLog.getState()) {
|
|
|
+ case 2:
|
|
|
+ patentInfo.setCreateTime(recordTime);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ patentInfo.setPatentApplicationDate(recordTime);
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ patentInfo.setAuthorizedDate(recordTime);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ patentInfo.setPatentState(patentLog.getState());
|
|
|
+ patentInfo.setPrincipal(patentLog.getPrincipal());
|
|
|
+ patentLog.setPid(patentInfo.getId());
|
|
|
+ patentLog.setId(UUID.randomUUID().toString());
|
|
|
+ patentLog.setRecordTime(recordTime);
|
|
|
+ patentLog.setOperator(TokenManager.getAdminId());
|
|
|
+ patentLogMapper.insert(patentLog);
|
|
|
+ }
|
|
|
+ patentInfoMapper.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);
|
|
|
+ orgIntellectualPropertyMapper.insert(o);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (10 == patentInfo.getPatentState()) {
|
|
|
+ OrgIntellectualProperty o = orgIntellectualPropertyMapper
|
|
|
+ .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);
|
|
|
+ orgIntellectualPropertyMapper.updateByPrimaryKeySelective(o);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|