|
|
@@ -32,6 +32,7 @@ import com.goafanti.common.dao.PatentYearPaymentMapper;
|
|
|
import com.goafanti.common.dao.TOrderTaskMapper;
|
|
|
import com.goafanti.common.error.BusinessException;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
+import com.goafanti.common.model.PatentLog;
|
|
|
import com.goafanti.common.model.PatentNew;
|
|
|
import com.goafanti.common.model.PatentNewLog;
|
|
|
import com.goafanti.common.model.PatentPaymentDetails;
|
|
|
@@ -77,10 +78,25 @@ public class PatentNewServiceImpl extends BaseMybatisDao<PatentNewMapper> imple
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int updatePatenNew(PatentNew p) {
|
|
|
+ public int updatePatenNew(PatentNewBo p) {
|
|
|
+ PatentNewLog pl = new PatentNewLog();
|
|
|
+ pl.setId(p.getId());
|
|
|
+ Admin a = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
|
|
|
+ pl.setContent(a.getName() + "修改了专利内容。");
|
|
|
+ if (p.getApplyDates()!=null) {
|
|
|
+ PatentNew pn=patentNewMapper.selectByPrimaryKey(p.getId());
|
|
|
+ String date=DateUtils.formatDate(pn.getApplyDate(), AFTConstants.YYYYMMDD);
|
|
|
+ if (date.equals(p.getApplyDates())) {
|
|
|
+ p.setYears(getyear(p));
|
|
|
+ p.setType(pn.getType());
|
|
|
+ p.setTid(pn.getTid());
|
|
|
+ sumYears(p);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ patentNewLogMapper.insertSelective(pl);
|
|
|
return patentNewMapper.updateByPrimaryKeySelective(p);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<PatentNewBo> selectPatentNew(PatentNewBo p,Integer pageSize, Integer pageNo) {
|
|
|
@@ -372,12 +388,13 @@ public class PatentNewServiceImpl extends BaseMybatisDao<PatentNewMapper> imple
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- /** @param type 0 标记已通知 1批量发邮件
|
|
|
+ /** @param type 0 标记已通知 1批量发邮件 2转给营销员
|
|
|
*/
|
|
|
@Override
|
|
|
- public Object updateBatch(String ids, Integer type) {
|
|
|
+ public Object updateBatch(String ids, Integer type,String aid) {
|
|
|
String [] s=ids.split(",");
|
|
|
List<String> ls=Arrays.asList(s);
|
|
|
+ addPatentNewLog(type, ls,aid);
|
|
|
if(type==1) {
|
|
|
List<EmailBo>list =new ArrayList<EmailBo>();
|
|
|
List<PatentNew> lp=patentNewMapper.selectByids(ls);
|
|
|
@@ -392,13 +409,41 @@ public class PatentNewServiceImpl extends BaseMybatisDao<PatentNewMapper> imple
|
|
|
}
|
|
|
asyncUtils.sendList(list);
|
|
|
}
|
|
|
- patentNewMapper.updateBatch(ls);
|
|
|
+ if (type==0||type==1) {
|
|
|
+ patentNewMapper.updateBatch(ls);
|
|
|
+ }else if(type==2) {
|
|
|
+ patentNewMapper.updateBatchByid(ls, null, aid);
|
|
|
+ }
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量添加专利日志
|
|
|
+ * @param type
|
|
|
+ * @param ls
|
|
|
+ */
|
|
|
+ private void addPatentNewLog(Integer type, List<String> ls,String aid) {
|
|
|
+ List<PatentNewLog> log=new ArrayList<PatentNewLog>();
|
|
|
+ Date date=new Date();
|
|
|
+ Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
|
|
|
+ Admin s=adminMapper.selectByPrimaryKey(aid);
|
|
|
+ for (String str : ls) {
|
|
|
+ PatentNewLog pl=new PatentNewLog();
|
|
|
+ pl.setPid(Integer.valueOf(str));
|
|
|
+ pl.setCreateTime(date);
|
|
|
+ String content="[%s]批量将专利%s";
|
|
|
+ if(type==0)str=String.format(content,a.getName(),"标记已通知。");
|
|
|
+ else if(type==1)str=String.format(content,a.getName(),"发送邮件。");
|
|
|
+ else if(type==2)str=String.format(content,a.getName(),"转交给["+s.getName()+"]。");
|
|
|
+ pl.setContent(str);
|
|
|
+ log.add(pl);
|
|
|
+ }
|
|
|
+ patentNewLogMapper.insertLogBatch(log);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void updateBatchStatusByid(List<String> l2, Integer status) {
|
|
|
- patentNewMapper.updateBatchStatusByid(l2,status);
|
|
|
+ patentNewMapper.updateBatchByid(l2,status,null);
|
|
|
|
|
|
}
|
|
|
}
|