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

重构部分功能模块

parent 2a958fdc
Pipeline #2319 failed with stages
......@@ -142,9 +142,6 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
if (StringUtils.isEmpty(entity.getTemplatePath())) {
throw new AppException("样表模板地址不能为空");
}
entity.setTotal(0);
entity.setSort(0);
entity.setIsRecommend(0);
//生成样表预览图片
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
String samplePath = rootPath + entity.getSamplePath();
......@@ -168,12 +165,6 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
super.saveBefore(entity, context);
}
@Override
protected void updateBefore(MatterDatumEntity entity, Context context) throws AppException {
entity.setIsRecommend(null);
this.validData(entity, context);
}
@Override
public int remove(Long id, Context context) throws AppException {
this.removeBefore(id, context);
......
......@@ -117,7 +117,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
throw new AppException("数据已更改,请重试");
}
String msg = "推荐成功!";
int recommendCount = this.count(new MatterQuery().siteId(matterEntity.getSiteId()).isRecommend(YesNoEnum.YES.getValue()), null);
int recommendCount = this.count(new MatterQuery().siteId(matterEntity.getSiteId()).isRecommend(YesNoEnum.YES.getValue()), context);
if (matterEntity.getIsRecommend() == YesNoEnum.NO.getValue()) {
if (recommendCount >= RECOMMEND_COUNT) {
throw new AppException("超过推荐个数!");
......
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