|
|
@@ -1,6 +1,7 @@
|
|
|
package com.goafanti.patent.service.impl;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
@@ -8,6 +9,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -58,7 +60,6 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
OrgIntellectualPropertyMapper orgIntellectualPropertyMapper;
|
|
|
@Autowired
|
|
|
NoticeMapper noticeMapper;
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
public PatentInfo insert(PatentInfo patentInfo) {
|
|
|
@@ -459,6 +460,30 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
return patentInfoMapper.selectPatentInfoDetail(id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public int batchCirculation(String[] ids, String recordTimeFormattedDate, PatentLog pl) {
|
|
|
+ Date recordTime = null;
|
|
|
+ try {
|
|
|
+ recordTime = DateUtils.parseDate(recordTimeFormattedDate, AFTConstants.YYYYMMDDHHMMSS);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
+ pl.setRecordTime(recordTime);
|
|
|
+ List<PatentLog> p = new ArrayList<PatentLog>();
|
|
|
+ List<PatentInfo> list = patentInfoMapper.selectByPrimaryKeys(ids);
|
|
|
+ if (null != list && list.size() > 0){
|
|
|
+ for (PatentInfo patentInfo : list){
|
|
|
+ PatentLog patentLog = new PatentLog();
|
|
|
+ patentLog.setId(UUID.randomUUID().toString());
|
|
|
+ patentLog.setPid(patentInfo.getId());
|
|
|
+ patentLog.setOperator(TokenManager.getAdminId());;
|
|
|
+ BeanUtils.copyProperties(pl, patentLog);
|
|
|
+ p.add(patentLog);
|
|
|
+ createNotice(patentInfo, patentLog);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return patentLogMapper.batchInsert(p);
|
|
|
+ }
|
|
|
+
|
|
|
private void createNotice(PatentInfo p, PatentLog l) {
|
|
|
PatentInfo info = patentInfoMapper.selectByPrimaryKey(p.getId());
|
|
|
|
|
|
@@ -468,15 +493,15 @@ public class PatentInfoServiceImpl extends BaseMybatisDao<PatentInfoMapper> impl
|
|
|
n.setId(UUID.randomUUID().toString());
|
|
|
n.setCreateTime(now.getTime());
|
|
|
n.setReaded(NoticeReadStatus.UNREAD.getCode());
|
|
|
-
|
|
|
+
|
|
|
User u = userMapper.selectByPrimaryKey(p.getUid());
|
|
|
- if (null != u){
|
|
|
+ if (null != u) {
|
|
|
n.setPid(u.getAid());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
n.setUid(p.getUid());
|
|
|
n.setRid(p.getId());
|
|
|
-
|
|
|
+
|
|
|
n.setAid(l.getPrincipal());
|
|
|
n.setContent("编号" + info.getSerialNumber() + " " + PatentInfoStatus.getStatus(l.getState()).getDesc());
|
|
|
n.setNoticeType(NoticeStatus.PATENTINFO.getCode());
|