update 年度数据锁定 不能锁定当前年份
This commit is contained in:
+4
-1
@@ -2,6 +2,7 @@ package com.jero.project.service;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.jero.common.common.RoleCommon;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.service.ProjectDetailService;
|
||||
@@ -106,7 +107,9 @@ public class AnnualDataLockingService extends ServiceImpl<AnnualDataLockingMappe
|
||||
|
||||
public void add(AnnualDataLocking annualDataLocking) {
|
||||
String year = annualDataLocking.getYear();
|
||||
|
||||
if (String.valueOf(DateUtil.thisYear()).equals(year)){
|
||||
throw new JeroBootException("不能锁定当前年份");
|
||||
}
|
||||
AnnualDataLocking one = lambdaQuery().eq(AnnualDataLocking::getYear, year).one();
|
||||
if (one != null){
|
||||
throw new JeroBootException(year+"年年度数据已经锁定");
|
||||
|
||||
Reference in New Issue
Block a user