|
|
@@ -32,12 +32,11 @@ import com.goafanti.common.dao.OrganizationIdentityMapper;
|
|
|
import com.goafanti.common.dao.PatentInfoMapper;
|
|
|
import com.goafanti.common.dao.TechProjectMapper;
|
|
|
import com.goafanti.common.dao.UserMapper;
|
|
|
-import com.goafanti.common.enums.CopyrightStatus;
|
|
|
+import com.goafanti.common.enums.DeleteStatus;
|
|
|
import com.goafanti.common.enums.NoticeReadStatus;
|
|
|
import com.goafanti.common.enums.NoticeStatus;
|
|
|
import com.goafanti.common.enums.OrgCognizanceStatus;
|
|
|
import com.goafanti.common.enums.ProportionStatus;
|
|
|
-import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.Notice;
|
|
|
import com.goafanti.common.model.OrgCognizance;
|
|
|
import com.goafanti.common.model.OrgCognizanceLog;
|
|
|
@@ -244,32 +243,18 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void insertCognizance(OrgCognizance c, String aid) {
|
|
|
- c.setId(UUID.randomUUID().toString());
|
|
|
- c.setState(CopyrightStatus.CREATE.getCode());
|
|
|
- c.setDeletedSign(0);
|
|
|
- if (TokenManager.getToken() instanceof Admin) {
|
|
|
- c.setFounder(TokenManager.getAdminId());
|
|
|
- }
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- c.setRecordTime(now.getTime());
|
|
|
- orgCognizanceMapper.insert(c);
|
|
|
+ public OrgCognizance saveCognizance(OrgCognizance c, String salesman) {
|
|
|
+ c.setState(OrgCognizanceStatus.DELIVERD.getCode());
|
|
|
+ c.setFounder(salesman);
|
|
|
+ c = disposeCognizanceSave(c);
|
|
|
|
|
|
OrgCognizanceLog log = new OrgCognizanceLog();
|
|
|
log.setId(UUID.randomUUID().toString());
|
|
|
log.setCid(c.getId());
|
|
|
-
|
|
|
log.setRecordTime(c.getRecordTime());
|
|
|
log.setState(c.getState());
|
|
|
- if (TokenManager.getToken() instanceof Admin) {
|
|
|
- log.setPrincipal(TokenManager.getAdminId());
|
|
|
- } else {
|
|
|
- log.setPrincipal(aid);
|
|
|
- }
|
|
|
- if (TokenManager.getToken() instanceof Admin) {
|
|
|
- log.setOperator(TokenManager.getAdminId());
|
|
|
- }
|
|
|
+ log.setPrincipal(salesman);
|
|
|
+ log.setOperator(salesman);
|
|
|
log.setComment(c.getComment());
|
|
|
orgCognizanceLogMapper.insert(log);
|
|
|
|
|
|
@@ -285,6 +270,29 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
orgCognizanceProportionMapper.updateByPrimaryKeySelective(disposeProportion(ocp));
|
|
|
}
|
|
|
|
|
|
+ OrgCognizanceLog l = new OrgCognizanceLog();
|
|
|
+ l.setId(UUID.randomUUID().toString());
|
|
|
+ l.setCid(c.getId());
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ l.setRecordTime(now.getTime());
|
|
|
+ l.setState(c.getState());
|
|
|
+ l.setPrincipal(TokenManager.getAdminId());
|
|
|
+ l.setOperator(salesman);
|
|
|
+ orgCognizanceLogMapper.insert(l);
|
|
|
+
|
|
|
+ createNotice(c, l);
|
|
|
+ return c;
|
|
|
+ }
|
|
|
+
|
|
|
+ private OrgCognizance disposeCognizanceSave(OrgCognizance c) {
|
|
|
+ c.setId(UUID.randomUUID().toString());
|
|
|
+ c.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ c.setRecordTime(now.getTime());
|
|
|
+ orgCognizanceMapper.insert(c);
|
|
|
+ return c;
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@@ -381,4 +389,25 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
noticeMapper.insert(n);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public OrgCognizance insertCognizance(OrgCognizance c, String aid) {
|
|
|
+ c.setState(OrgCognizanceStatus.CREATE.getCode());
|
|
|
+ c = disposeCognizanceSave(c);
|
|
|
+
|
|
|
+ OrgCognizanceLog log = new OrgCognizanceLog();
|
|
|
+ log.setId(UUID.randomUUID().toString());
|
|
|
+ log.setCid(c.getId());
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ log.setRecordTime(now.getTime());
|
|
|
+ log.setState(OrgCognizanceStatus.CREATE.getCode());
|
|
|
+ log.setPrincipal(aid);
|
|
|
+ log.setComment(c.getComment());
|
|
|
+ orgCognizanceLogMapper.insert(log);
|
|
|
+
|
|
|
+ createNotice(c, log);
|
|
|
+ return c;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|