|
|
@@ -138,22 +138,25 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate)
|
|
|
throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- orgActivity.setDeletedSign(0);
|
|
|
- if (!StringUtils.isBlank(startDateFormattedDate)) {
|
|
|
- orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(endDateFormattedDate)) {
|
|
|
- orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(orgActivity.getId())) {
|
|
|
- orgActivity.setId(UUID.randomUUID().toString());
|
|
|
- orgActivity.setUid(TokenManager.getUserId());
|
|
|
- orgActivityService.insert(orgActivity);
|
|
|
- } else {
|
|
|
- orgActivityService.updateOrgActivity(orgActivity);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ orgActivity.setDeletedSign(0);
|
|
|
+ if (!StringUtils.isBlank(startDateFormattedDate)) {
|
|
|
+ orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(endDateFormattedDate)) {
|
|
|
+ orgActivity.setEndDate(DateUtils.parseDate(endDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(orgActivity.getId())) {
|
|
|
+ orgActivity.setId(UUID.randomUUID().toString());
|
|
|
+ orgActivity.setUid(TokenManager.getUserId());
|
|
|
+ orgActivityService.insert(orgActivity);
|
|
|
+ } else {
|
|
|
+ orgActivityService.updateOrgActivity(orgActivity);
|
|
|
+ }
|
|
|
+ res.setData(orgActivity);
|
|
|
}
|
|
|
- res.setData(orgActivity);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -166,12 +169,12 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteActivity", method = RequestMethod.POST)
|
|
|
public Result deleteActivity(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- orgActivityService.batchDeleteByPrimaryKey(id);
|
|
|
- orgActivityCostService.batchDeleteByAid(id);
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ orgActivityService.batchDeleteByPrimaryKey(id);
|
|
|
+ orgActivityCostService.batchDeleteByAid(id);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -210,25 +213,28 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/activityCost", method = RequestMethod.POST)
|
|
|
public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (!StringUtils.isBlank(signDateFormattedDate)) {
|
|
|
- orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(orgActivityCost.getId())) {
|
|
|
- if (null != orgActivityCostService.selectOrgActivityCostByUidAndAid(orgActivityCost.getAid(),
|
|
|
- TokenManager.getUserId())){
|
|
|
- res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "该研究项目费用详情已录入!"));
|
|
|
- return res;
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (!StringUtils.isBlank(signDateFormattedDate)) {
|
|
|
+ orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(orgActivityCost.getId())) {
|
|
|
+ if (null != orgActivityCostService.selectOrgActivityCostByUidAndAid(orgActivityCost.getAid(),
|
|
|
+ TokenManager.getUserId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "该研究项目费用详情已录入!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
|
|
|
+ orgActivityCost.setStartDate(ac.getStartDate());
|
|
|
+ orgActivityCost.setEndDate(ac.getEndDate());
|
|
|
+ orgActivityCost.setId(UUID.randomUUID().toString());
|
|
|
+ orgActivityCost.setUid(TokenManager.getUserId());
|
|
|
+ orgActivityCost.setDeletedSign(0);
|
|
|
+ orgActivityCostService.insert(orgActivityCost);
|
|
|
+ } else {
|
|
|
+ orgActivityCostService.updateByPrimaryKeySelective(orgActivityCost);
|
|
|
}
|
|
|
-
|
|
|
- OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(orgActivityCost.getAid());
|
|
|
- orgActivityCost.setStartDate(ac.getStartDate());
|
|
|
- orgActivityCost.setEndDate(ac.getEndDate());
|
|
|
- orgActivityCost.setId(UUID.randomUUID().toString());
|
|
|
- orgActivityCost.setUid(TokenManager.getUserId());
|
|
|
- orgActivityCost.setDeletedSign(0);
|
|
|
- orgActivityCostService.insert(orgActivityCost);
|
|
|
- } else {
|
|
|
- orgActivityCostService.updateByPrimaryKeySelective(orgActivityCost);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -242,11 +248,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteActivityCost", method = RequestMethod.POST)
|
|
|
public Result deleteActivityCost(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgActivityCostService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgActivityCostService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -283,18 +289,21 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/developStandard", method = RequestMethod.POST)
|
|
|
public Result developStandard(OrgStandard orgStandard) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgStandard.getId())) {
|
|
|
- orgStandard.setId(UUID.randomUUID().toString());
|
|
|
- orgStandard.setUid(TokenManager.getUserId());
|
|
|
- orgStandard.setDeletedSign(0);
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgStandard.setCreateTime(now.getTime());
|
|
|
- orgStandardService.insert(orgStandard);
|
|
|
- } else {
|
|
|
- orgStandardService.updateByPrimaryKeySelective(orgStandard);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (StringUtils.isBlank(orgStandard.getId())) {
|
|
|
+ orgStandard.setId(UUID.randomUUID().toString());
|
|
|
+ orgStandard.setUid(TokenManager.getUserId());
|
|
|
+ orgStandard.setDeletedSign(0);
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ orgStandard.setCreateTime(now.getTime());
|
|
|
+ orgStandardService.insert(orgStandard);
|
|
|
+ } else {
|
|
|
+ orgStandardService.updateByPrimaryKeySelective(orgStandard);
|
|
|
+ }
|
|
|
+ res.setData(orgStandard);
|
|
|
}
|
|
|
- res.setData(orgStandard);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -308,11 +317,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteStandard", method = RequestMethod.POST)
|
|
|
public Result deleteStandard(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgStandardService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgStandardService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -326,20 +335,23 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate)
|
|
|
throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
|
|
|
- orgIntellectualProperty
|
|
|
- .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(orgIntellectualProperty.getId())) {
|
|
|
- orgIntellectualProperty.setId(UUID.randomUUID().toString());
|
|
|
- orgIntellectualProperty.setUid(TokenManager.getUserId());
|
|
|
- orgIntellectualProperty.setEvaluationCategory(
|
|
|
- (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
|
|
|
- orgIntellectualProperty.setDeletedSign(0);
|
|
|
- res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
|
|
|
- } else {
|
|
|
- orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
- res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (!StringUtils.isBlank(authorizationDateFormattedDate)) {
|
|
|
+ orgIntellectualProperty
|
|
|
+ .setAuthorizationDate(DateUtils.parseDate(authorizationDateFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(orgIntellectualProperty.getId())) {
|
|
|
+ orgIntellectualProperty.setId(UUID.randomUUID().toString());
|
|
|
+ orgIntellectualProperty.setUid(TokenManager.getUserId());
|
|
|
+ orgIntellectualProperty.setEvaluationCategory(
|
|
|
+ (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
|
|
|
+ orgIntellectualProperty.setDeletedSign(0);
|
|
|
+ res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
|
|
|
+ } else {
|
|
|
+ orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
+ res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -379,11 +391,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteIntellectual", method = RequestMethod.POST)
|
|
|
public Result deleteIntellectual(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgIntellectualPropertyService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgIntellectualPropertyService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -421,19 +433,22 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/techProduct", method = RequestMethod.POST)
|
|
|
public Result techProduct(OrgTechProduct orgTechProduct) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgTechProduct.getId())) {
|
|
|
- orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
- orgTechProduct.setUid(TokenManager.getUserId());
|
|
|
- orgTechProduct.setDeletedSign(0);
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgTechProduct.setCreateTime(now.getTime());
|
|
|
- orgTechProduct.setYear(Calendar.getInstance().get(Calendar.YEAR) - 1);
|
|
|
- orgTechProductService.insert(orgTechProduct);
|
|
|
- } else {
|
|
|
- orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (StringUtils.isBlank(orgTechProduct.getId())) {
|
|
|
+ orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
+ orgTechProduct.setUid(TokenManager.getUserId());
|
|
|
+ orgTechProduct.setDeletedSign(0);
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ orgTechProduct.setCreateTime(now.getTime());
|
|
|
+ orgTechProduct.setYear(Calendar.getInstance().get(Calendar.YEAR) - 1);
|
|
|
+ orgTechProductService.insert(orgTechProduct);
|
|
|
+ } else {
|
|
|
+ orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
|
|
|
+ }
|
|
|
+ res.setData(orgTechProduct);
|
|
|
}
|
|
|
- res.setData(orgTechProduct);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -446,11 +461,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteTechProduct", method = RequestMethod.POST)
|
|
|
public Result deleteTechProduct(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgTechProductService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgTechProductService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -483,18 +498,21 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
|
|
|
public Result disposeRatepay(OrgRatepay orgRatepay) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgRatepay.getId())) {
|
|
|
- if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())) {
|
|
|
- orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
- orgRatepay.setUid(TokenManager.getUserId());
|
|
|
- orgRatepay.setDeletedSign(0);
|
|
|
- orgRatepayService.insert(orgRatepay);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (StringUtils.isBlank(orgRatepay.getId())) {
|
|
|
+ if (null == orgRatepayService.selectRatepayByUidAndYear(TokenManager.getUserId(), orgRatepay.getYear())) {
|
|
|
+ orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
+ orgRatepay.setUid(TokenManager.getUserId());
|
|
|
+ orgRatepay.setDeletedSign(0);
|
|
|
+ orgRatepayService.insert(orgRatepay);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度纳税申报表已录入!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
} else {
|
|
|
- res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度纳税申报表已录入!"));
|
|
|
- return res;
|
|
|
+ orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
|
|
|
}
|
|
|
- } else {
|
|
|
- orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -508,11 +526,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteRatepay", method = RequestMethod.POST)
|
|
|
public Result deleteRatepay(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgRatepayService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgRatepayService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -548,18 +566,21 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
|
|
|
public Result disposeFinance(OrgFinance orgFinance) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgFinance.getId())) {
|
|
|
- if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())) {
|
|
|
- orgFinance.setId(UUID.randomUUID().toString());
|
|
|
- orgFinance.setUid(TokenManager.getUserId());
|
|
|
- orgFinance.setDeletedSign(0);
|
|
|
- orgFinanceService.insert(orgFinance);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (StringUtils.isBlank(orgFinance.getId())) {
|
|
|
+ if (null == orgFinanceService.selectFinanceByUidAndYear(TokenManager.getUserId(), orgFinance.getYear())) {
|
|
|
+ orgFinance.setId(UUID.randomUUID().toString());
|
|
|
+ orgFinance.setUid(TokenManager.getUserId());
|
|
|
+ orgFinance.setDeletedSign(0);
|
|
|
+ orgFinanceService.insert(orgFinance);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度财务报表已录入!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
} else {
|
|
|
- res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度财务报表已录入!"));
|
|
|
- return res;
|
|
|
+ orgFinanceService.updateByPrimaryKeySelective(orgFinance);
|
|
|
}
|
|
|
- } else {
|
|
|
- orgFinanceService.updateByPrimaryKeySelective(orgFinance);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -573,11 +594,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteFinance", method = RequestMethod.POST)
|
|
|
public Result deleteFinance(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgFinanceService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgFinanceService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -645,13 +666,16 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
|
|
|
public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(achievement.getId())) {
|
|
|
- achievement.setId(UUID.randomUUID().toString());
|
|
|
- achievement.setUid(TokenManager.getUserId());
|
|
|
- achievement.setDeletedSign(0);
|
|
|
- orgTechAchievementService.inset(achievement);
|
|
|
- } else {
|
|
|
- orgTechAchievementService.updateByPrimaryKeySelective(achievement);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (StringUtils.isBlank(achievement.getId())) {
|
|
|
+ achievement.setId(UUID.randomUUID().toString());
|
|
|
+ achievement.setUid(TokenManager.getUserId());
|
|
|
+ achievement.setDeletedSign(0);
|
|
|
+ orgTechAchievementService.insert(achievement);
|
|
|
+ } else {
|
|
|
+ orgTechAchievementService.updateByPrimaryKeySelective(achievement);
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -665,11 +689,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteAchievement", method = RequestMethod.POST)
|
|
|
public Result deleteAchievement(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgTechAchievementService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgTechAchievementService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -706,16 +730,19 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
|
|
|
public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
|
|
|
- honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(honor.getId())) {
|
|
|
- honor.setId(UUID.randomUUID().toString());
|
|
|
- honor.setUid(TokenManager.getUserId());
|
|
|
- honor.setDeletedSign(0);
|
|
|
- orgHonorDatumService.inset(honor);
|
|
|
- } else {
|
|
|
- orgHonorDatumService.updateByPrimaryKeySelective(honor);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
|
|
|
+ honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(honor.getId())) {
|
|
|
+ honor.setId(UUID.randomUUID().toString());
|
|
|
+ honor.setUid(TokenManager.getUserId());
|
|
|
+ honor.setDeletedSign(0);
|
|
|
+ orgHonorDatumService.insert(honor);
|
|
|
+ } else {
|
|
|
+ orgHonorDatumService.updateByPrimaryKeySelective(honor);
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -729,11 +756,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/deleteHonor", method = RequestMethod.POST)
|
|
|
public Result deleteHonor(@RequestParam(name = "ids[]", required = true) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
- List<String> id = new ArrayList<String>();
|
|
|
- for (String s : ids) {
|
|
|
- id.add(s);
|
|
|
- }
|
|
|
- res.setData(orgHonorDatumService.batchDeleteByPrimaryKey(id));
|
|
|
+ List<String> id = new ArrayList<String>();
|
|
|
+ for (String s : ids) {
|
|
|
+ id.add(s);
|
|
|
+ }
|
|
|
+ res.setData(orgHonorDatumService.batchDeleteByPrimaryKey(id));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -761,16 +788,19 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
|
|
|
public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
|
|
|
- orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(orgTechCenter.getId())) {
|
|
|
- orgTechCenter.setId(UUID.randomUUID().toString());
|
|
|
- orgTechCenter.setUid(TokenManager.getUserId());
|
|
|
- orgTechCenter.setDeletedSign(0);
|
|
|
- orgTechCenterService.insert(orgTechCenter);
|
|
|
- } else {
|
|
|
- orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
|
|
|
+ orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(orgTechCenter.getId())) {
|
|
|
+ orgTechCenter.setId(UUID.randomUUID().toString());
|
|
|
+ orgTechCenter.setUid(TokenManager.getUserId());
|
|
|
+ orgTechCenter.setDeletedSign(0);
|
|
|
+ orgTechCenterService.insert(orgTechCenter);
|
|
|
+ } else {
|
|
|
+ orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -783,7 +813,6 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/centerDetail", method = RequestMethod.POST)
|
|
|
public Result centerDetail(String pageNo, String pageSize, String cid) {
|
|
|
Result res = new Result();
|
|
|
- if (res.getError().isEmpty()) {
|
|
|
Integer pNo = 1;
|
|
|
Integer pSize = 10;
|
|
|
if (StringUtils.isNumeric(pageSize)) {
|
|
|
@@ -793,7 +822,6 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
pNo = Integer.parseInt(pageNo);
|
|
|
}
|
|
|
res.setData(orgTechCenterDetailService.listOrgTechCenterDetail(pNo, pSize, cid));
|
|
|
- }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -810,19 +838,19 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
public Result disposeCenterDetail(OrgTechCenterDetail orgTechCenterDetail, String projectTimeFormattedDate,
|
|
|
String termTimeFormattedDate) throws ParseException {
|
|
|
Result res = new Result();
|
|
|
- if (!StringUtils.isBlank(projectTimeFormattedDate)) {
|
|
|
- orgTechCenterDetail.setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (!StringUtils.isBlank(termTimeFormattedDate)) {
|
|
|
- orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(orgTechCenterDetail.getId())) {
|
|
|
- orgTechCenterDetail.setId(UUID.randomUUID().toString());
|
|
|
- orgTechCenterDetail.setDeletedSign(0);
|
|
|
- orgTechCenterDetailService.inset(orgTechCenterDetail);
|
|
|
- } else {
|
|
|
- orgTechCenterDetailService.updateByPrimaryKeySelective(orgTechCenterDetail);
|
|
|
- }
|
|
|
+ if (!StringUtils.isBlank(projectTimeFormattedDate)) {
|
|
|
+ orgTechCenterDetail.setProjectTime(DateUtils.parseDate(projectTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (!StringUtils.isBlank(termTimeFormattedDate)) {
|
|
|
+ orgTechCenterDetail.setTermTime(DateUtils.parseDate(termTimeFormattedDate, "yyyy-MM-dd"));
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(orgTechCenterDetail.getId())) {
|
|
|
+ orgTechCenterDetail.setId(UUID.randomUUID().toString());
|
|
|
+ orgTechCenterDetail.setDeletedSign(0);
|
|
|
+ orgTechCenterDetailService.inset(orgTechCenterDetail);
|
|
|
+ } else {
|
|
|
+ orgTechCenterDetailService.updateByPrimaryKeySelective(orgTechCenterDetail);
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -865,16 +893,19 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/listCognizance", method = RequestMethod.POST)
|
|
|
public Result listCognizance(String locationProvince, String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
- Integer pNo = 1;
|
|
|
- Integer pSize = 10;
|
|
|
- if (StringUtils.isNumeric(pageSize)) {
|
|
|
- pSize = Integer.parseInt(pageSize);
|
|
|
- }
|
|
|
- if (StringUtils.isNumeric(pageNo)) {
|
|
|
- pNo = Integer.parseInt(pageNo);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ Integer pNo = 1;
|
|
|
+ Integer pSize = 10;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId(), locationProvince, pNo, pSize));
|
|
|
}
|
|
|
-
|
|
|
- res.setData(orgCognizanceService.listCognizance(TokenManager.getUserId(), locationProvince, pNo, pSize));
|
|
|
+
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -886,13 +917,14 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/applyCognizance", method = RequestMethod.POST)
|
|
|
public Result applyCognizance(Integer contacts, String comment, Integer year, Integer state) {
|
|
|
Result res = new Result();
|
|
|
- if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, TokenManager.getUserId())){
|
|
|
- res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (null != orgCognizanceService.selectCognizanceByUidAndYear(year, TokenManager.getUserId())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度高企认定已申请!"));
|
|
|
+ }
|
|
|
+ String aid = TokenManager.getToken().getAid();
|
|
|
+ orgCognizanceService.insertCognizance(contacts, comment, year, state, aid, TokenManager.getUserId());
|
|
|
}
|
|
|
- String aid = TokenManager.getToken().getAid();
|
|
|
- orgCognizanceService.insertCognizance(contacts, comment, year, state, aid, TokenManager.getUserId());
|
|
|
-
|
|
|
-
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -906,7 +938,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/cognizanceDetail", method = RequestMethod.POST)
|
|
|
public Result cognizanceDetail(String cid, Integer year) {
|
|
|
Result res = new Result();
|
|
|
- res.setData(handleCognizanceDetail(TokenManager.getUserId(), cid, year));
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ res.setData(handleCognizanceDetail(TokenManager.getUserId(), cid, year));
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -919,8 +954,11 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/cognizanceLog", method = RequestMethod.POST)
|
|
|
public Result cognizanceLog(String cid) {
|
|
|
Result res = new Result();
|
|
|
- List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
|
|
|
- res.setData(list);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ List<OrgCognizanceLog> list = orgCognizanceLogService.selectOrgCognizanceLogByCid(cid);
|
|
|
+ res.setData(list);
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -930,7 +968,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeCognizanceDetail", method = RequestMethod.POST)
|
|
|
public Result disposeCognizanceDetail(OrgCognizance cog){
|
|
|
Result res = new Result();
|
|
|
- orgCognizanceService.updateByPrimaryKeySelective(cog);
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ orgCognizanceService.updateByPrimaryKeySelective(cog);
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -967,7 +1008,10 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/annualReportDetail", method = RequestMethod.POST)
|
|
|
public Result annualReportDetail(Integer year) {
|
|
|
Result res = new Result();
|
|
|
- res.setData(handleAnnualReport(TokenManager.getUserId(), year));
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ res.setData(handleAnnualReport(TokenManager.getUserId(), year));
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -980,26 +1024,29 @@ public class CognizanceApiController extends BaseApiController {
|
|
|
@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
|
|
|
public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgAnnualReport.getId())) {
|
|
|
- if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
|
|
|
- TokenManager.getUserId())) {
|
|
|
- res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
|
|
|
- return res;
|
|
|
- }
|
|
|
- orgAnnualReport.setId(UUID.randomUUID().toString());
|
|
|
- orgAnnualReport.setUid(TokenManager.getUserId());
|
|
|
+ res = checkCertify(res);
|
|
|
+ if (res.getError().isEmpty()) {
|
|
|
+ if (StringUtils.isBlank(orgAnnualReport.getId())) {
|
|
|
+ if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
|
|
|
+ TokenManager.getUserId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ orgAnnualReport.setId(UUID.randomUUID().toString());
|
|
|
+ orgAnnualReport.setUid(TokenManager.getUserId());
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.MILLISECOND, 0);
|
|
|
+ orgAnnualReport.setCreateTime(now.getTime());
|
|
|
+ orgAnnualReport.setLastUpdateTime(orgAnnualReport.getCreateTime());
|
|
|
+ orgAnnualReport.setDeletedSign(0);
|
|
|
+ orgAnnualReportService.insert(orgAnnualReport);
|
|
|
+
|
|
|
+ } else {
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgAnnualReport.setCreateTime(now.getTime());
|
|
|
- orgAnnualReport.setLastUpdateTime(orgAnnualReport.getCreateTime());
|
|
|
- orgAnnualReport.setDeletedSign(0);
|
|
|
- orgAnnualReportService.insert(orgAnnualReport);
|
|
|
-
|
|
|
- } else {
|
|
|
- Calendar now = Calendar.getInstance();
|
|
|
- now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgAnnualReport.setLastUpdateTime(now.getTime());
|
|
|
- orgAnnualReportService.updateByPrimaryKeySelective(orgAnnualReport);
|
|
|
+ orgAnnualReport.setLastUpdateTime(now.getTime());
|
|
|
+ orgAnnualReportService.updateByPrimaryKeySelective(orgAnnualReport);
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|