|
|
@@ -45,6 +45,7 @@ import com.goafanti.cognizance.bo.InputOrgTechAchievement;
|
|
|
import com.goafanti.cognizance.bo.InputOrgTechCenter;
|
|
|
import com.goafanti.cognizance.bo.InputOrgTechCenterDetail;
|
|
|
import com.goafanti.cognizance.bo.InputOrgTechProduct;
|
|
|
+import com.goafanti.cognizance.bo.LatelyCogRecord;
|
|
|
import com.goafanti.cognizance.bo.OrgIntellectualPropertyDetailBo;
|
|
|
import com.goafanti.cognizance.service.OrgActivityCostService;
|
|
|
import com.goafanti.cognizance.service.OrgActivityService;
|
|
|
@@ -117,6 +118,7 @@ import com.goafanti.common.model.UserIdentity;
|
|
|
import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.PasswordUtil;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.common.utils.TimeUtils;
|
|
|
import com.goafanti.copyright.bo.CopyrightInfoDetail;
|
|
|
import com.goafanti.copyright.service.CopyrightInfoService;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
@@ -193,10 +195,10 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/confirmProportion", method = RequestMethod.POST)
|
|
|
- public Result confirmProportion(String id, String sign, Integer status) {
|
|
|
+ public Result confirmProportion(String id, String uid, String sign, Integer status) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(id)) {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到比重ID", "比重ID"));
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户ID"));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -214,14 +216,22 @@ public class AdminApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "资料完成状态"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (null == id){
|
|
|
+ OrgCognizanceProportion cp = new OrgCognizanceProportion();
|
|
|
+ cp.setId(UUID.randomUUID().toString());
|
|
|
+ cp.setUid(uid);
|
|
|
+ res.setData(orgCognizanceProportionService.insert(disposeProportionStatus(sign, status, cp)));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
OrgCognizanceProportion ocp = orgCognizanceProportionService.selectByPrimaryKey(id);
|
|
|
if (null == ocp) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "比重ID"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- return disposeProportionStatus(res, sign, status, ocp);
|
|
|
+ res.setData(orgCognizanceProportionService.updateByPrimaryKeySelective(disposeProportionStatus(sign, status, ocp)));
|
|
|
+ return res;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -2968,11 +2978,31 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkCertify(res, cog.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (null != orgCognizanceService.selectCognizanceByUidAndYear(cog.getYear(), cog.getUid())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
|
|
|
+
|
|
|
+ LatelyCogRecord lcr = orgCognizanceService.selectLatelyRecord(cog.getUid());
|
|
|
+
|
|
|
+ if (null != lcr && null != lcr.getState() && OrgCognizanceStatus.SETTLEMENT.getCode() != lcr.getState()
|
|
|
+ && OrgCognizanceStatus.FOSTER.getCode() != lcr.getState()
|
|
|
+ && OrgCognizanceStatus.CALLBACK.getCode() != lcr.getState()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "", "高企申请中!无法提交新申请!"));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ if (null != lcr && null != lcr.getState() && OrgCognizanceStatus.SETTLEMENT.getCode() == lcr.getState()) {
|
|
|
+ if (null == lcr.getIssuingDate()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "", "高企申请中!无法提交新申请!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ if (Boolean.FALSE == TimeUtils.checkCogExpire(lcr.getIssuingDate())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.STATUS_ERROR, "", "高企认定未过期,无法提交新申请!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
OrgCognizance oc = new OrgCognizance();
|
|
|
BeanUtils.copyProperties(cog, oc);
|
|
|
orgCognizanceService.insertCognizance(oc, TokenManager.getAdminId());
|
|
|
@@ -3395,8 +3425,8 @@ public class AdminApiController extends CertifyApiController {
|
|
|
}
|
|
|
return status;
|
|
|
}
|
|
|
-
|
|
|
- private Result disposeProportionStatus(Result res, String sign, Integer status, OrgCognizanceProportion ocp){
|
|
|
+
|
|
|
+ private OrgCognizanceProportion disposeProportionStatus(String sign, Integer status, OrgCognizanceProportion ocp) {
|
|
|
if (ProprotionFields.INSTITUTION.getCode().equals(sign)) {
|
|
|
if (ProportionStatus.FINISHED.getCode() == status) {
|
|
|
ocp.setInstitution(ProportionStatus.FINISHED.getCode());
|
|
|
@@ -3469,13 +3499,8 @@ public class AdminApiController extends CertifyApiController {
|
|
|
} else {
|
|
|
ocp.setAbility(ProportionStatus.UNFINISHED.getCode());
|
|
|
}
|
|
|
- } else {
|
|
|
- res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "类别标记"));
|
|
|
- return res;
|
|
|
}
|
|
|
-
|
|
|
- res.setData(orgCognizanceProportionService.updateByPrimaryKeySelective(ocp));
|
|
|
- return res;
|
|
|
+ return ocp;
|
|
|
}
|
|
|
|
|
|
/*
|