|
|
@@ -16,7 +16,10 @@ import org.springframework.stereotype.Service;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.ContractLogMapper;
|
|
|
import com.goafanti.common.dao.ContractMapper;
|
|
|
+import com.goafanti.common.dao.CopyrightInfoMapper;
|
|
|
import com.goafanti.common.dao.NoticeMapper;
|
|
|
+import com.goafanti.common.dao.OrgCognizanceMapper;
|
|
|
+import com.goafanti.common.dao.PatentInfoMapper;
|
|
|
import com.goafanti.common.dao.UserMapper;
|
|
|
import com.goafanti.common.enums.ContractBusinessStatus;
|
|
|
import com.goafanti.common.enums.ContractStatus;
|
|
|
@@ -47,6 +50,12 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
private UserMapper userMapper;
|
|
|
@Autowired
|
|
|
private NoticeMapper noticeMapper;
|
|
|
+ @Autowired
|
|
|
+ private PatentInfoMapper patentInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ private CopyrightInfoMapper copyrightInfoMapper;
|
|
|
+ @Autowired
|
|
|
+ private OrgCognizanceMapper orgCognizanceMapper;
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
@@ -77,7 +86,7 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
if (!StringUtils.isBlank(uid)) {
|
|
|
params.put("uid", uid);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!StringUtils.isBlank(id)) {
|
|
|
params.put("id", id);
|
|
|
}
|
|
|
@@ -226,7 +235,6 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
c.setSignDate(signDate);
|
|
|
contractMapper.updateByPrimaryKeySelective(c);
|
|
|
|
|
|
-
|
|
|
List<ContractLog> logs = new ArrayList<>();
|
|
|
List<Notice> notice = new ArrayList<>();
|
|
|
|
|
|
@@ -241,6 +249,30 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
noticeMapper.insertBatch(notice);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Integer> selectContractSerialNumber() {
|
|
|
+ String principal = null;
|
|
|
+ if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
+ principal = TokenManager.getAdminId();
|
|
|
+ }
|
|
|
+ List<ContractSerialNumber> list = contractMapper.selectContractSerialNumber(principal);
|
|
|
+ Map<String, Integer> map = new TreeMap<>();
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ for (ContractSerialNumber c : list) {
|
|
|
+ map.put(c.getContractId(), c.getSerialNumber());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int deleteByPrimaryKey(List<String> id) {
|
|
|
+ patentInfoMapper.batchDeleteByContractId(id);
|
|
|
+ copyrightInfoMapper.batchDeleteByContractId(id);
|
|
|
+ orgCognizanceMapper.batchDeleteByContractId(id);
|
|
|
+ return contractMapper.batchDeleteByPrimaryKey(id);
|
|
|
+ }
|
|
|
+
|
|
|
private Notice createNotice(Contract c, ContractLog l) {
|
|
|
Contract info = contractMapper.selectByPrimaryKey(c.getId());
|
|
|
|
|
|
@@ -265,20 +297,4 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
n.setYear(info.getCognizanceYear());
|
|
|
return n;
|
|
|
}
|
|
|
-
|
|
|
- @Override
|
|
|
- public Map<String, Integer> selectContractSerialNumber() {
|
|
|
- String principal = null;
|
|
|
- if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
- principal = TokenManager.getAdminId();
|
|
|
- }
|
|
|
- List<ContractSerialNumber> list = contractMapper.selectContractSerialNumber(principal);
|
|
|
- Map<String, Integer> map = new TreeMap<>();
|
|
|
- if (null != list && list.size() > 0) {
|
|
|
- for (ContractSerialNumber c : list) {
|
|
|
- map.put(c.getContractId(), c.getSerialNumber());
|
|
|
- }
|
|
|
- }
|
|
|
- return map;
|
|
|
- }
|
|
|
}
|