|
|
@@ -10,8 +10,11 @@ import java.util.UUID;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.validation.Valid;
|
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@@ -21,6 +24,17 @@ import com.goafanti.admin.service.AftFileService;
|
|
|
import com.goafanti.cognizance.bo.ActivityNumberBo;
|
|
|
import com.goafanti.cognizance.bo.AnnualReportBo;
|
|
|
import com.goafanti.cognizance.bo.CognizanceDetailBo;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgActivity;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgActivityCost;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgAnnualReport;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgFinance;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgHumanResource;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgIntellectualProperty;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgRatepay;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgStandard;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgTechAchievement;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgTechCenter;
|
|
|
+import com.goafanti.cognizance.bo.InputOrgTechProduct;
|
|
|
import com.goafanti.cognizance.service.OrgActivityCostService;
|
|
|
import com.goafanti.cognizance.service.OrgActivityService;
|
|
|
import com.goafanti.cognizance.service.OrgAnnualReportService;
|
|
|
@@ -38,6 +52,20 @@ import com.goafanti.common.bo.Result;
|
|
|
import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
+import com.goafanti.common.enums.OrgActivityFields;
|
|
|
+import com.goafanti.common.enums.OrgAnnualReportFields;
|
|
|
+import com.goafanti.common.enums.OrgFinanceFields;
|
|
|
+import com.goafanti.common.enums.OrgHonorDatumFields;
|
|
|
+import com.goafanti.common.enums.OrgHumanResourceFields;
|
|
|
+import com.goafanti.common.enums.OrgIntellectualPropertyFields;
|
|
|
+import com.goafanti.common.enums.OrgRatepayFields;
|
|
|
+import com.goafanti.common.enums.OrgStandardFields;
|
|
|
+import com.goafanti.common.enums.OrgTechAchievementFields;
|
|
|
+import com.goafanti.common.enums.OrgTechCenterFields;
|
|
|
+import com.goafanti.common.enums.OrgTechProductFields;
|
|
|
+import com.goafanti.common.enums.OrganizationIdentityFields;
|
|
|
+import com.goafanti.common.enums.UserAbilityFields;
|
|
|
+import com.goafanti.common.enums.UserIdentityFields;
|
|
|
import com.goafanti.common.model.AftFile;
|
|
|
import com.goafanti.common.model.OrgActivity;
|
|
|
import com.goafanti.common.model.OrgActivityCost;
|
|
|
@@ -64,6 +92,9 @@ import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.patent.service.AdminService;
|
|
|
+import com.goafanti.user.bo.InputOrganizationIdentity;
|
|
|
+import com.goafanti.user.bo.InputUserAbility;
|
|
|
+import com.goafanti.user.bo.InputUserIdentity;
|
|
|
import com.goafanti.user.bo.OrgListBo;
|
|
|
import com.goafanti.user.bo.UserListBo;
|
|
|
import com.goafanti.user.service.OrgHumanResourceService;
|
|
|
@@ -225,8 +256,16 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "updateUserDetail", method = RequestMethod.POST)
|
|
|
- public Result updateUserDetail(UserIdentity userIdentity, String paymentDateFormattedDate) {
|
|
|
+ public Result updateUserDetail(@Valid InputUserIdentity userIdentity, BindingResult bindingResult,
|
|
|
+ String paymentDateFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ UserIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -235,19 +274,24 @@ public class AdminApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
if (!StringUtils.isBlank(paymentDateFormattedDate)) {
|
|
|
try {
|
|
|
userIdentity.setPaymentDate(DateUtils.parseDate(paymentDateFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
} catch (ParseException e) {
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(userIdentity.getId())) {
|
|
|
- userIdentity.setId(UUID.randomUUID().toString());
|
|
|
- userIdentity.setAuditStatus(null == userIdentity.getAuditStatus() ? 0 : userIdentity.getAuditStatus());
|
|
|
- userIdentity.setProcess(null == userIdentity.getProcess() ? 0 : userIdentity.getProcess());
|
|
|
- res.setData(userIdentityService.insert(userIdentity));
|
|
|
+
|
|
|
+ UserIdentity ui = new UserIdentity();
|
|
|
+ BeanUtils.copyProperties(userIdentity, ui);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(ui.getId())) {
|
|
|
+ ui.setId(UUID.randomUUID().toString());
|
|
|
+ ui.setAuditStatus(null == userIdentity.getAuditStatus() ? 0 : userIdentity.getAuditStatus());
|
|
|
+ ui.setProcess(null == userIdentity.getProcess() ? 0 : userIdentity.getProcess());
|
|
|
+ res.setData(userIdentityService.insert(ui));
|
|
|
} else {
|
|
|
- res.setData(userIdentityService.updateUserDetail(userIdentity));
|
|
|
+ res.setData(userIdentityService.updateUserDetail(ui));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -313,8 +357,16 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateOrgDetail", method = RequestMethod.POST)
|
|
|
- public Result updateOrgDetail(OrganizationIdentity orgIdentity, String paymentDateFormattedDate) {
|
|
|
+ public Result updateOrgDetail(@Valid InputOrganizationIdentity orgIdentity, BindingResult bindingResult,
|
|
|
+ String paymentDateFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrganizationIdentityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -329,16 +381,20 @@ public class AdminApiController extends CertifyApiController {
|
|
|
} catch (ParseException e) {
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgIdentity.getId())) {
|
|
|
- orgIdentity.setId(UUID.randomUUID().toString());
|
|
|
- orgIdentity.setIdentityType(null == orgIdentity.getIdentityType() ? 0 : orgIdentity.getIdentityType());
|
|
|
- orgIdentity.setAuditStatus(null == orgIdentity.getAuditStatus() ? 0 : orgIdentity.getAuditStatus());
|
|
|
- orgIdentity.setProcess(null == orgIdentity.getProcess() ? 0 : orgIdentity.getProcess());
|
|
|
- orgIdentity.setListed(null == orgIdentity.getListed() ? 0 : orgIdentity.getListed());
|
|
|
- orgIdentity.setListedType(null == orgIdentity.getListedType() ? 0 : orgIdentity.getListedType());
|
|
|
- res.setData(organizationIdentityService.insert(orgIdentity));
|
|
|
+
|
|
|
+ OrganizationIdentity oi = new OrganizationIdentity();
|
|
|
+ BeanUtils.copyProperties(orgIdentity, oi);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(oi.getId())) {
|
|
|
+ oi.setId(UUID.randomUUID().toString());
|
|
|
+ oi.setIdentityType(null == oi.getIdentityType() ? 0 : oi.getIdentityType());
|
|
|
+ oi.setAuditStatus(null == oi.getAuditStatus() ? 0 : oi.getAuditStatus());
|
|
|
+ oi.setProcess(null == oi.getProcess() ? 0 : oi.getProcess());
|
|
|
+ oi.setListed(null == oi.getListed() ? 0 : oi.getListed());
|
|
|
+ oi.setListedType(null == oi.getListedType() ? 0 : oi.getListedType());
|
|
|
+ res.setData(organizationIdentityService.insert(oi));
|
|
|
} else {
|
|
|
- res.setData(organizationIdentityService.updateOrgDetail(orgIdentity));
|
|
|
+ res.setData(organizationIdentityService.updateOrgDetail(oi));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -384,8 +440,14 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/updateOrgHumanResource", method = RequestMethod.POST)
|
|
|
- public Result updateOrgHumanResource(OrgHumanResource orgHumanResource) {
|
|
|
+ public Result updateOrgHumanResource(@Valid InputOrgHumanResource orgHumanResource, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgHumanResourceFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -394,20 +456,28 @@ public class AdminApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (null == orgHumanResource.getYear()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
if (!checkCertify(res, orgHumanResource.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgHumanResource.getId())) {
|
|
|
- if (null != orgHumanResourceService.selectOrgHumanResourceByUidAndYear(orgHumanResource.getYear(),
|
|
|
- orgHumanResource.getUid())) {
|
|
|
+
|
|
|
+ OrgHumanResource ohr = new OrgHumanResource();
|
|
|
+ BeanUtils.copyProperties(orgHumanResource, ohr);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(ohr.getId())) {
|
|
|
+ if (null != orgHumanResourceService.selectOrgHumanResourceByUidAndYear(ohr.getYear(), ohr.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度人力资源情况已录入!"));
|
|
|
return res;
|
|
|
}
|
|
|
- orgHumanResource.setId(UUID.randomUUID().toString());
|
|
|
- orgHumanResource.setDeletedSign(0);
|
|
|
- orgHumanResourceService.insert(orgHumanResource);
|
|
|
+ ohr.setId(UUID.randomUUID().toString());
|
|
|
+ ohr.setDeletedSign(0);
|
|
|
+ orgHumanResourceService.insert(ohr);
|
|
|
} else {
|
|
|
- orgHumanResourceService.updateByPrimaryKeySelective(orgHumanResource);
|
|
|
+ orgHumanResourceService.updateByPrimaryKeySelective(ohr);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -454,8 +524,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/developStandard", method = RequestMethod.POST)
|
|
|
- public Result developStandard(OrgStandard orgStandard) {
|
|
|
+ public Result developStandard(@Valid InputOrgStandard orgStandard, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgStandardFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -466,15 +543,19 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkCertify(res, orgStandard.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgStandard.getId())) {
|
|
|
- orgStandard.setId(UUID.randomUUID().toString());
|
|
|
- orgStandard.setDeletedSign(0);
|
|
|
+
|
|
|
+ OrgStandard os = new OrgStandard();
|
|
|
+ BeanUtils.copyProperties(orgStandard, os);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(os.getId())) {
|
|
|
+ os.setId(UUID.randomUUID().toString());
|
|
|
+ os.setDeletedSign(0);
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgStandard.setCreateTime(now.getTime());
|
|
|
- orgStandardService.insert(orgStandard);
|
|
|
+ os.setCreateTime(now.getTime());
|
|
|
+ orgStandardService.insert(os);
|
|
|
} else {
|
|
|
- orgStandardService.updateByPrimaryKeySelective(orgStandard);
|
|
|
+ orgStandardService.updateByPrimaryKeySelective(os);
|
|
|
}
|
|
|
res.setData(orgStandard);
|
|
|
return res;
|
|
|
@@ -487,9 +568,16 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/intellectual", method = RequestMethod.POST)
|
|
|
- public Result intellectual(OrgIntellectualProperty orgIntellectualProperty, String authorizationDateFormattedDate,
|
|
|
- String uid) {
|
|
|
+ public Result intellectual(@Valid InputOrgIntellectualProperty orgIntellectualProperty, BindingResult bindingResult,
|
|
|
+ String authorizationDateFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgIntellectualPropertyFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -507,16 +595,17 @@ public class AdminApiController extends CertifyApiController {
|
|
|
} catch (ParseException e) {
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgIntellectualProperty.getId())) {
|
|
|
- orgIntellectualProperty.setId(UUID.randomUUID().toString());
|
|
|
- orgIntellectualProperty.setUid(uid);
|
|
|
- orgIntellectualProperty.setEvaluationCategory(
|
|
|
- (orgIntellectualProperty.getCatagory() >= 2 && orgIntellectualProperty.getCatagory() <= 4) ? 1 : 0);
|
|
|
- orgIntellectualProperty.setDeletedSign(0);
|
|
|
- res.setData(orgIntellectualPropertyService.insert(orgIntellectualProperty));
|
|
|
+ OrgIntellectualProperty oip = new OrgIntellectualProperty();
|
|
|
+ BeanUtils.copyProperties(orgIntellectualProperty, oip);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(oip.getId())) {
|
|
|
+ oip.setId(UUID.randomUUID().toString());
|
|
|
+ oip.setEvaluationCategory((oip.getCatagory() >= 2 && oip.getCatagory() <= 4) ? 1 : 0);
|
|
|
+ oip.setDeletedSign(0);
|
|
|
+ res.setData(orgIntellectualPropertyService.insert(oip));
|
|
|
} else {
|
|
|
- orgIntellectualProperty.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
- res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(orgIntellectualProperty));
|
|
|
+ oip.setEvaluationCategory(orgIntellectualProperty.getCatagory() <= 2 ? 1 : 0);
|
|
|
+ res.setData(orgIntellectualPropertyService.updateByPrimaryKeySelective(oip));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -633,8 +722,16 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/activity", method = RequestMethod.POST)
|
|
|
- public Result activity(OrgActivity orgActivity, String startDateFormattedDate, String endDateFormattedDate) {
|
|
|
+ public Result activity(@Valid InputOrgActivity orgActivity, BindingResult bindingResult,
|
|
|
+ String startDateFormattedDate, String endDateFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -646,7 +743,7 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkCertify(res, orgActivity.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- orgActivity.setDeletedSign(0);
|
|
|
+
|
|
|
if (!StringUtils.isBlank(startDateFormattedDate)) {
|
|
|
try {
|
|
|
orgActivity.setStartDate(DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
@@ -660,11 +757,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
} catch (ParseException e) {
|
|
|
}
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgActivity.getId())) {
|
|
|
- orgActivity.setId(UUID.randomUUID().toString());
|
|
|
- orgActivityService.insert(orgActivity);
|
|
|
+
|
|
|
+ OrgActivity oa = new OrgActivity();
|
|
|
+ BeanUtils.copyProperties(orgActivity, oa);
|
|
|
+ oa.setDeletedSign(0);
|
|
|
+ if (StringUtils.isBlank(oa.getId())) {
|
|
|
+ oa.setId(UUID.randomUUID().toString());
|
|
|
+ orgActivityService.insert(oa);
|
|
|
} else {
|
|
|
- orgActivityService.updateOrgActivity(orgActivity);
|
|
|
+ orgActivityService.updateOrgActivity(oa);
|
|
|
}
|
|
|
res.setData(orgActivity);
|
|
|
return res;
|
|
|
@@ -712,8 +813,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/activityCost", method = RequestMethod.POST)
|
|
|
- public Result activityCost(OrgActivityCost orgActivityCost, String signDateFormattedDate) throws ParseException {
|
|
|
+ public Result activityCost(@Valid InputOrgActivityCost orgActivityCost, BindingResult bindingResult, String signDateFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgActivityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -727,23 +835,29 @@ public class AdminApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
if (StringUtils.isBlank(signDateFormattedDate)) {
|
|
|
- orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
+ try {
|
|
|
+ orgActivityCost.setSignDate(DateUtils.parseDate(signDateFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ OrgActivityCost oac = new OrgActivityCost();
|
|
|
+ BeanUtils.copyProperties(orgActivityCost, oac);
|
|
|
|
|
|
- if (StringUtils.isBlank(orgActivityCost.getId())) {
|
|
|
- if (null != orgActivityCostService.selectOrgActivityCostByUidAndAid(orgActivityCost.getAid(),
|
|
|
- orgActivityCost.getUid())) {
|
|
|
+ if (StringUtils.isBlank(oac.getId())) {
|
|
|
+ if (null != orgActivityCostService.selectOrgActivityCostByUidAndAid(oac.getAid(),
|
|
|
+ oac.getUid())) {
|
|
|
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.setDeletedSign(0);
|
|
|
- orgActivityCostService.insert(orgActivityCost);
|
|
|
+ OrgActivity ac = orgActivityService.selectOrgActivityByPrimaryKey(oac.getAid());
|
|
|
+ oac.setStartDate(null == ac.getStartDate() ? null : ac.getStartDate());
|
|
|
+ oac.setEndDate(null == ac.getEndDate() ? null : ac.getEndDate());
|
|
|
+ oac.setId(UUID.randomUUID().toString());
|
|
|
+ oac.setDeletedSign(0);
|
|
|
+ orgActivityCostService.insert(oac);
|
|
|
} else {
|
|
|
- orgActivityCostService.updateByPrimaryKeySelective(orgActivityCost);
|
|
|
+ orgActivityCostService.updateByPrimaryKeySelective(oac);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -755,8 +869,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/techProduct", method = RequestMethod.POST)
|
|
|
- public Result techProduct(OrgTechProduct orgTechProduct) {
|
|
|
+ public Result techProduct(@Valid InputOrgTechProduct orgTechProduct, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgTechProductFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -768,16 +889,20 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkCertify(res, orgTechProduct.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgTechProduct.getId())) {
|
|
|
- orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
- orgTechProduct.setDeletedSign(0);
|
|
|
+
|
|
|
+ OrgTechProduct otp = new OrgTechProduct();
|
|
|
+ BeanUtils.copyProperties(orgTechProduct, otp);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(otp.getId())) {
|
|
|
+ otp.setId(UUID.randomUUID().toString());
|
|
|
+ otp.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);
|
|
|
+ otp.setCreateTime(now.getTime());
|
|
|
+ otp.setYear(Calendar.getInstance().get(Calendar.YEAR) - 1);
|
|
|
+ orgTechProductService.insert(otp);
|
|
|
} else {
|
|
|
- orgTechProductService.updateByPrimaryKeySelective(orgTechProduct);
|
|
|
+ orgTechProductService.updateByPrimaryKeySelective(otp);
|
|
|
}
|
|
|
res.setData(orgTechProduct);
|
|
|
return res;
|
|
|
@@ -819,8 +944,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* 企业纳税申报信息录入+修改
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeRatepay", method = RequestMethod.POST)
|
|
|
- public Result disposeRatepay(OrgRatepay orgRatepay) {
|
|
|
+ public Result disposeRatepay(@Valid InputOrgRatepay orgRatepay, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgRatepayFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -828,21 +960,30 @@ public class AdminApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (null == orgRatepay.getYear()){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
if (!checkCertify(res, orgRatepay.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgRatepay.getId())) {
|
|
|
- if (null == orgRatepayService.selectRatepayByUidAndYear(orgRatepay.getUid(), orgRatepay.getYear())) {
|
|
|
- orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
- orgRatepay.setDeletedSign(0);
|
|
|
- orgRatepayService.insert(orgRatepay);
|
|
|
+
|
|
|
+ OrgRatepay rate = new OrgRatepay();
|
|
|
+ BeanUtils.copyProperties(orgRatepay, rate);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(rate.getId())) {
|
|
|
+ if (null == orgRatepayService.selectRatepayByUidAndYear(rate.getUid(), rate.getYear())) {
|
|
|
+ rate.setId(UUID.randomUUID().toString());
|
|
|
+ rate.setDeletedSign(0);
|
|
|
+ orgRatepayService.insert(rate);
|
|
|
} else {
|
|
|
res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度纳税申报表已录入!"));
|
|
|
return res;
|
|
|
}
|
|
|
} else {
|
|
|
- orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
|
|
|
+ orgRatepayService.updateByPrimaryKeySelective(rate);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -885,30 +1026,47 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeFinance", method = RequestMethod.POST)
|
|
|
- public Result disposeFinance(OrgFinance orgFinance) {
|
|
|
+ public Result disposeFinance(@Valid InputOrgFinance orgFinance, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgFinanceFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
if (StringUtils.isBlank(orgFinance.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (null == orgFinance.getYear()){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到年份", "年份"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
|
|
|
if (!checkCertify(res, orgFinance.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgFinance.getId())) {
|
|
|
- if (null == orgFinanceService.selectFinanceByUidAndYear(orgFinance.getUid(), orgFinance.getYear())) {
|
|
|
- orgFinance.setId(UUID.randomUUID().toString());
|
|
|
- orgFinance.setDeletedSign(0);
|
|
|
- orgFinanceService.insert(orgFinance);
|
|
|
+
|
|
|
+ OrgFinance of = new OrgFinance();
|
|
|
+ BeanUtils.copyProperties(orgFinance, of);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(of.getId())) {
|
|
|
+ if (null == orgFinanceService.selectFinanceByUidAndYear(of.getUid(), of.getYear())) {
|
|
|
+ of.setId(UUID.randomUUID().toString());
|
|
|
+ of.setDeletedSign(0);
|
|
|
+ orgFinanceService.insert(of);
|
|
|
} else {
|
|
|
res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度财务报表已录入!"));
|
|
|
return res;
|
|
|
}
|
|
|
} else {
|
|
|
- orgFinanceService.updateByPrimaryKeySelective(orgFinance);
|
|
|
+ orgFinanceService.updateByPrimaryKeySelective(of);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -977,8 +1135,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeAchievement", method = RequestMethod.POST)
|
|
|
- public Result disposeAchievement(OrgTechAchievement achievement) throws ParseException {
|
|
|
+ public Result disposeAchievement(@Valid InputOrgTechAchievement achievement, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgTechAchievementFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -990,12 +1155,16 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkCertify(res, achievement.getUid()).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(achievement.getId())) {
|
|
|
- achievement.setId(UUID.randomUUID().toString());
|
|
|
- achievement.setDeletedSign(0);
|
|
|
- orgTechAchievementService.insert(achievement);
|
|
|
+
|
|
|
+ OrgTechAchievement ota = new OrgTechAchievement();
|
|
|
+ BeanUtils.copyProperties(achievement, ota);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(ota.getId())) {
|
|
|
+ ota.setId(UUID.randomUUID().toString());
|
|
|
+ ota.setDeletedSign(0);
|
|
|
+ orgTechAchievementService.insert(ota);
|
|
|
} else {
|
|
|
- orgTechAchievementService.updateByPrimaryKeySelective(achievement);
|
|
|
+ orgTechAchievementService.updateByPrimaryKeySelective(ota);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1039,8 +1208,15 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeHonor", method = RequestMethod.POST)
|
|
|
- public Result disposeHonor(OrgHonorDatum honor, String issuingTimeFormattedDate) throws ParseException {
|
|
|
+ public Result disposeHonor(OrgHonorDatum honor, BindingResult bindingResult, String issuingTimeFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgHonorDatumFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1053,14 +1229,21 @@ public class AdminApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
if (!StringUtils.isBlank(issuingTimeFormattedDate)) {
|
|
|
- honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
+ try {
|
|
|
+ honor.setIssuingTime(DateUtils.parseDate(issuingTimeFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
}
|
|
|
- if (StringUtils.isBlank(honor.getId())) {
|
|
|
- honor.setId(UUID.randomUUID().toString());
|
|
|
- honor.setDeletedSign(0);
|
|
|
- orgHonorDatumService.insert(honor);
|
|
|
+
|
|
|
+ OrgHonorDatum ohd = new OrgHonorDatum();
|
|
|
+ BeanUtils.copyProperties(honor, ohd);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(ohd.getId())) {
|
|
|
+ ohd.setId(UUID.randomUUID().toString());
|
|
|
+ ohd.setDeletedSign(0);
|
|
|
+ orgHonorDatumService.insert(ohd);
|
|
|
} else {
|
|
|
- orgHonorDatumService.updateByPrimaryKeySelective(honor);
|
|
|
+ orgHonorDatumService.updateByPrimaryKeySelective(ohd);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1076,7 +1259,7 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1094,13 +1277,20 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @throws ParseException
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeCenter", method = RequestMethod.POST)
|
|
|
- public Result disposeCenter(OrgTechCenter orgTechCenter, String foundingTimeFormattedDate) throws ParseException {
|
|
|
+ public Result disposeCenter(@Valid InputOrgTechCenter orgTechCenter, BindingResult bindingResult, String foundingTimeFormattedDate) {
|
|
|
Result res = new Result();
|
|
|
- if (!checkAdminLogin(res)) {
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgTechCenterFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isBlank(orgTechCenter.getUid())){
|
|
|
+ if (!checkAdminLogin(res)) {
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(orgTechCenter.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1108,14 +1298,21 @@ public class AdminApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
if (!StringUtils.isBlank(foundingTimeFormattedDate)) {
|
|
|
- orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
+ try {
|
|
|
+ orgTechCenter.setFoundingTime(DateUtils.parseDate(foundingTimeFormattedDate, AFTConstants.YYYYMMDD));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgTechCenter.getId())) {
|
|
|
- orgTechCenter.setId(UUID.randomUUID().toString());
|
|
|
- orgTechCenter.setDeletedSign(0);
|
|
|
- orgTechCenterService.insert(orgTechCenter);
|
|
|
+
|
|
|
+ OrgTechCenter otc = new OrgTechCenter();
|
|
|
+ BeanUtils.copyProperties(orgTechCenter, otc);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(otc.getId())) {
|
|
|
+ otc.setId(UUID.randomUUID().toString());
|
|
|
+ otc.setDeletedSign(0);
|
|
|
+ orgTechCenterService.insert(otc);
|
|
|
} else {
|
|
|
- orgTechCenterService.updateByPrimaryKeySelective(orgTechCenter);
|
|
|
+ orgTechCenterService.updateByPrimaryKeySelective(otc);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1131,7 +1328,7 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1151,11 +1348,11 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!checkCertify(res, uid).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1211,8 +1408,8 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
- if (StringUtils.isBlank(cid)){
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(cid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "高企ID"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1234,11 +1431,11 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(uid)){
|
|
|
+ if (StringUtils.isBlank(uid)) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!checkCertify(res, uid).getError().isEmpty()) {
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1258,7 +1455,7 @@ public class AdminApiController extends CertifyApiController {
|
|
|
if (!checkAdminLogin(res)) {
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(cog.getUid())){
|
|
|
+ if (StringUtils.isBlank(cog.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1321,17 +1518,28 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeAble", method = RequestMethod.POST)
|
|
|
- public Result disposeAble(UserAbility u) {
|
|
|
+ public Result disposeAble(@Valid InputUserAbility u, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
+
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ UserAbilityFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isBlank(u.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(u.getId())) {
|
|
|
- u.setId(UUID.randomUUID().toString());
|
|
|
- userAbilityService.insert(u);
|
|
|
+
|
|
|
+ UserAbility user = new UserAbility();
|
|
|
+ BeanUtils.copyProperties(u, user);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(user.getId())) {
|
|
|
+ user.setId(UUID.randomUUID().toString());
|
|
|
+ userAbilityService.insert(user);
|
|
|
} else {
|
|
|
- userAbilityService.updateByPrimaryKeySelective(u);
|
|
|
+ userAbilityService.updateByPrimaryKeySelective(user);
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -1384,32 +1592,47 @@ public class AdminApiController extends CertifyApiController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/disposeAnnualReport", method = RequestMethod.POST)
|
|
|
- public Result disposeAnnualReport(OrgAnnualReport orgAnnualReport) {
|
|
|
+ public Result disposeAnnualReport(@Valid InputOrgAnnualReport orgAnnualReport, BindingResult bindingResult) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isBlank(orgAnnualReport.getUid())
|
|
|
- || !checkCertify(res, orgAnnualReport.getUid()).getError().isEmpty()) {
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ OrgAnnualReportFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(orgAnnualReport.getUid())){
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到用户", "用户"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!checkCertify(res, orgAnnualReport.getUid()).getError().isEmpty()) {
|
|
|
res.getError().add(buildError(ErrorConstants.NON_CERTIFIED, "未通过实名认证,无法操作!"));
|
|
|
return res;
|
|
|
}
|
|
|
- if (StringUtils.isBlank(orgAnnualReport.getId())) {
|
|
|
- if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(orgAnnualReport.getYear(),
|
|
|
- orgAnnualReport.getUid())) {
|
|
|
+
|
|
|
+ OrgAnnualReport oar = new OrgAnnualReport();
|
|
|
+ BeanUtils.copyProperties(orgAnnualReport, oar);
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(oar.getId())) {
|
|
|
+ if (null != orgAnnualReportService.selectAnnualReportByYearAndUid(oar.getYear(),
|
|
|
+ oar.getUid())) {
|
|
|
res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年企业年报已录入!"));
|
|
|
return res;
|
|
|
} else {
|
|
|
- orgAnnualReport.setId(UUID.randomUUID().toString());
|
|
|
+ oar.setId(UUID.randomUUID().toString());
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgAnnualReport.setCreateTime(now.getTime());
|
|
|
- orgAnnualReport.setLastUpdateTime(orgAnnualReport.getCreateTime());
|
|
|
- orgAnnualReport.setDeletedSign(0);
|
|
|
- orgAnnualReportService.insert(orgAnnualReport);
|
|
|
+ oar.setCreateTime(now.getTime());
|
|
|
+ oar.setLastUpdateTime(oar.getCreateTime());
|
|
|
+ oar.setDeletedSign(0);
|
|
|
+ orgAnnualReportService.insert(oar);
|
|
|
}
|
|
|
} else {
|
|
|
Calendar now = Calendar.getInstance();
|
|
|
now.set(Calendar.MILLISECOND, 0);
|
|
|
- orgAnnualReport.setLastUpdateTime(now.getTime());
|
|
|
- orgAnnualReportService.updateByPrimaryKeySelective(orgAnnualReport);
|
|
|
+ oar.setLastUpdateTime(now.getTime());
|
|
|
+ orgAnnualReportService.updateByPrimaryKeySelective(oar);
|
|
|
}
|
|
|
return res;
|
|
|
}
|