|
|
@@ -82,14 +82,14 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
- public Pagination<CognizanceBo> listCognizance(String contractId, String uid, String unitName, Integer locationProvince, Integer pageNo,
|
|
|
- Integer pageSize) {
|
|
|
+ public Pagination<CognizanceBo> listCognizance(String contractId, String uid, String unitName,
|
|
|
+ Integer locationProvince, Integer pageNo, Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
|
|
if (TokenManager.getToken() instanceof Admin && !TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
params.put("principal", TokenManager.getAdminId());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!StringUtils.isBlank(contractId)) {
|
|
|
params.put("contractId", contractId);
|
|
|
}
|
|
|
@@ -222,7 +222,8 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
|
|
|
@Override
|
|
|
public void updateCognizance(OrgCognizance cog, OrgCognizanceLog log, Date recordTime, String aid) {
|
|
|
- if (null != log.getState() && null != recordTime && null != cog.getUid() && null != log.getPrincipal()) {
|
|
|
+ if (null != log.getState() && null != recordTime && StringUtils.isNotBlank(cog.getUid())
|
|
|
+ && StringUtils.isNotBlank(log.getPrincipal())) {
|
|
|
log.setRecordTime(recordTime);
|
|
|
cog.setTechPrincipal(log.getPrincipal());
|
|
|
OrganizationIdentity o = organizationIdentityMapper.selectOrgIdentityByUserId(cog.getUid());
|
|
|
@@ -233,11 +234,12 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
cog.setAcceptDate(recordTime);
|
|
|
} else if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.ISSUING) {
|
|
|
cog.setIssuingDate(recordTime);
|
|
|
- o.setCertificateNumber(null == cog.getCertificateNumber() ? "" : cog.getCertificateNumber());
|
|
|
+ o.setCertificateNumber(StringUtils.isBlank(cog.getCertificateNumber()) ? "" : cog.getCertificateNumber());
|
|
|
o.setIssuingDate(recordTime);
|
|
|
o.setCogContacts(null == cog.getContacts() ? null : cog.getContacts());
|
|
|
+ organizationIdentityMapper.updateByPrimaryKeySelective(o);
|
|
|
}
|
|
|
- organizationIdentityMapper.updateByPrimaryKeySelective(o);
|
|
|
+
|
|
|
if (OrgCognizanceStatus.getStatus(cog.getState()) == OrgCognizanceStatus.CIRCULATION) {
|
|
|
cog.setState(OrgCognizanceStatus.DELIVERD.getCode());
|
|
|
}
|
|
|
@@ -441,7 +443,7 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
oc.setRecordTime(now.getTime());
|
|
|
-
|
|
|
+
|
|
|
OrgCognizanceLog ocl = new OrgCognizanceLog();
|
|
|
ocl.setId(UUID.randomUUID().toString());
|
|
|
ocl.setCid(oc.getId());
|
|
|
@@ -449,10 +451,10 @@ public class OrgCognizanceServiceImpl extends BaseMybatisDao<OrgCognizanceMapper
|
|
|
ocl.setOperator(TokenManager.getAdminId());
|
|
|
ocl.setRecordTime(now.getTime());
|
|
|
ocl.setState(OrgCognizanceStatus.CREATE.getCode());
|
|
|
-
|
|
|
+
|
|
|
orgCognizanceMapper.insert(oc);
|
|
|
orgCognizanceLogMapper.insert(ocl);
|
|
|
-
|
|
|
+
|
|
|
c.setCognizanceStatus(ContractBusinessStatus.CREATE.getCode());
|
|
|
contractMapper.updateByPrimaryKeySelective(c);
|
|
|
}
|