|
|
@@ -11,15 +11,19 @@ import java.util.UUID;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.goafanti.common.constant.AFTConstants;
|
|
|
+import com.goafanti.common.dao.NoticeMapper;
|
|
|
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.enums.NoticeStatus;
|
|
|
import com.goafanti.common.enums.PatentInfoStatus;
|
|
|
import com.goafanti.common.enums.TechProjectStatus;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
+import com.goafanti.common.model.Notice;
|
|
|
import com.goafanti.common.model.OrgIntellectualProperty;
|
|
|
import com.goafanti.common.model.PatentCost;
|
|
|
import com.goafanti.common.model.PatentInfo;
|
|
|
@@ -50,6 +54,8 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
PatentLogMapper patentLogMapper;
|
|
|
@Autowired
|
|
|
OrgIntellectualPropertyMapper orgIntellectualPropertyMapper;
|
|
|
+ @Autowired
|
|
|
+ NoticeMapper noticeMapper;
|
|
|
|
|
|
@Override
|
|
|
public PatentInfo insert(PatentInfo patentInfo) {
|
|
|
@@ -116,11 +122,10 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
Date cEnd = null;
|
|
|
Date pStart = null;
|
|
|
Date pEnd = null;
|
|
|
-
|
|
|
- if (!TokenManager.hasRole("999999")) {
|
|
|
+
|
|
|
+ if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
params.put("principal", TokenManager.getAdminId());
|
|
|
}
|
|
|
-
|
|
|
|
|
|
if (cDate != null && cDate.length > 0) {
|
|
|
try {
|
|
|
@@ -137,7 +142,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
: DateUtils.addDays(DateUtils.parseDate(pDate[1], "yyyy-MM-dd"), 1);
|
|
|
} catch (ParseException e) {
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (cStart != null) {
|
|
|
@@ -209,10 +214,10 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
|
|
- if (!TokenManager.hasRole("999999")) {
|
|
|
+ if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
params.put("principal", TokenManager.getAdminId());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (locationProvince != null && locationProvince != "") {
|
|
|
params.put("locationProvince", locationProvince);
|
|
|
}
|
|
|
@@ -234,12 +239,11 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
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 (!TokenManager.hasRole("999999")) {
|
|
|
+
|
|
|
+ if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
params.put("principal", TokenManager.getAdminId());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (authorizedDate != null) {
|
|
|
params.put("authorizedDate", authorizedDate);
|
|
|
}
|
|
|
@@ -325,7 +329,7 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
log.setPid(patentInfo.getId());
|
|
|
log.setRecordTime(patentInfo.getCreateTime());
|
|
|
log.setState(PatentInfoStatus.CREATE.getCode());
|
|
|
- log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin? TokenManager.getAdminId() : "");
|
|
|
+ log.setPrincipal(null == aid && TokenManager.getToken() instanceof Admin ? TokenManager.getAdminId() : "");
|
|
|
if (TokenManager.getToken() instanceof Admin) {
|
|
|
log.setOperator(TokenManager.getAdminId());
|
|
|
}
|
|
|
@@ -355,6 +359,20 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
}
|
|
|
p.setPrincipal(log.getPrincipal());
|
|
|
patentLogMapper.insert(log);
|
|
|
+
|
|
|
+ PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
|
|
|
+
|
|
|
+ Notice n = new Notice();
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ n.setId(UUID.randomUUID().toString());
|
|
|
+ n.setCreateTime(now.getTime());
|
|
|
+ n.setReaded(0);
|
|
|
+ n.setAid(log.getPrincipal());
|
|
|
+ n.setContent("编号" + info.getSerialNumber() + " " + PatentInfoStatus.getStatus(log.getState()).getDesc());
|
|
|
+ n.setNoticeType(NoticeStatus.PATENTINFO.getCode());
|
|
|
+ noticeMapper.insert(n);
|
|
|
+
|
|
|
}
|
|
|
patentInfoMapper.updateByPrimaryKeySelective(p);
|
|
|
if (PatentInfoStatus.getStatus(p.getPatentState()) == PatentInfoStatus.AUTHORIZE) {
|
|
|
@@ -405,9 +423,9 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
patentInfo.setPatentState(PatentInfoStatus.REVIEWREPLY.getCode());
|
|
|
} else if (patentState == PatentInfoStatus.CORRECTIONNOTICE.getCode()) {
|
|
|
patentInfo.setPatentState(PatentInfoStatus.CORRECTIONREPLY.getCode());
|
|
|
- }
|
|
|
+ }
|
|
|
patentInfoMapper.updateByPrimaryKeySelective(patentInfo);
|
|
|
-
|
|
|
+
|
|
|
PatentLog patentLog = new PatentLog();
|
|
|
PatentInfo p = patentInfoMapper.selectByPrimaryKey(pid);
|
|
|
patentLog.setId(UUID.randomUUID().toString());
|
|
|
@@ -415,11 +433,11 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
patentLog.setState(p.getPatentState());
|
|
|
patentLog.setOperator(TokenManager.getAdminId());
|
|
|
patentLog.setPrincipal(p.getPrincipal());
|
|
|
-
|
|
|
+
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
patentLog.setRecordTime(now.getTime());
|
|
|
-
|
|
|
+
|
|
|
patentLogMapper.insert(patentLog);
|
|
|
}
|
|
|
|