|
|
@@ -526,6 +526,10 @@ public class AdminApiController extends BaseApiController {
|
|
|
if (null == orgTechProduct.getId()) {
|
|
|
orgTechProduct.setId(UUID.randomUUID().toString());
|
|
|
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);
|
|
|
@@ -564,9 +568,14 @@ public class AdminApiController extends BaseApiController {
|
|
|
public Result disposeRatepay(OrgRatepay orgRatepay) {
|
|
|
Result res = new Result();
|
|
|
if (null == orgRatepay.getId()) {
|
|
|
- orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
- orgRatepay.setDeletedSign(0);
|
|
|
- orgRatepayService.insert(orgRatepay);
|
|
|
+ if (null == orgRatepayService.selectRatepayByUidAndYear(orgRatepay.getUid(), orgRatepay.getYear())){
|
|
|
+ orgRatepay.setId(UUID.randomUUID().toString());
|
|
|
+ orgRatepay.setDeletedSign(0);
|
|
|
+ orgRatepayService.insert(orgRatepay);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度纳税申报表已录入!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
} else {
|
|
|
orgRatepayService.updateByPrimaryKeySelective(orgRatepay);
|
|
|
}
|
|
|
@@ -606,9 +615,14 @@ public class AdminApiController extends BaseApiController {
|
|
|
public Result disposeFinance(OrgFinance orgFinance) {
|
|
|
Result res = new Result();
|
|
|
if (null == orgFinance.getId()) {
|
|
|
- orgFinance.setId(UUID.randomUUID().toString());
|
|
|
- orgFinance.setDeletedSign(0);
|
|
|
- orgFinanceService.insert(orgFinance);
|
|
|
+ if (null == orgFinanceService.selectFinanceByUidAndYear(orgFinance.getUid(), orgFinance.getYear())){
|
|
|
+ orgFinance.setId(UUID.randomUUID().toString());
|
|
|
+ orgFinance.setDeletedSign(0);
|
|
|
+ orgFinanceService.insert(orgFinance);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError(ErrorConstants.DUPLICATE_DATA_ERROR, "当年度财务报表已录入!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
} else {
|
|
|
orgFinanceService.updateByPrimaryKeySelective(orgFinance);
|
|
|
}
|