Commit a45a73ba authored by 赵啸非's avatar 赵啸非

重构部分功能模块

parent f20a4409
Pipeline #2349 failed with stages
......@@ -26,4 +26,6 @@ public final class Constant {
public final static String PARAMS_BLANK_COUNT = "blank_count";
public final static String PARAMS_RECOMMEND_COUNT = "recommend_count";
}
......@@ -18,6 +18,7 @@ import com.deepoove.poi.template.MetaTemplate;
import com.deepoove.poi.util.RegexUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.util.StringUtils;
......@@ -26,6 +27,7 @@ import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.ComponentEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.formdesign.*;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.pdu.gen.component.ComponentCons;
import com.mortals.xhx.common.utils.ExportDocUtil;
......@@ -68,7 +70,6 @@ import java.util.stream.Collectors;
@Service("matterDatumService")
public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumDao, MatterDatumEntity, Long> implements MatterDatumService {
private static int RECOMMEND_COUNT = 5;
@Value("${upload.path}")
private String filePath;
......@@ -435,7 +436,7 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
recommendCount += this.count(new MatterDatumQuery().matterId(matterEntity.getId()).isRecommend(YesNoEnum.YES.getValue()), context);
}
if (matterDatumEntity.getIsRecommend() == YesNoEnum.NO.getValue()) {
if (recommendCount >= RECOMMEND_COUNT) {
if (recommendCount >= GlobalSysInfo.getParamIntValue(Constant.PARAMS_RECOMMEND_COUNT, 5)) {
throw new AppException("超过推荐个数!");
}
matterDatumEntity.setIsRecommend(YesNoEnum.YES.getValue());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment