From 9057e04efad1b7d61c77a72e5c37a504d0aee935 Mon Sep 17 00:00:00 2001 From: doum <doum> Date: 星期五, 26 九月 2025 09:24:03 +0800 Subject: [PATCH] H5静态化 --- server/src/main/java/com/doumee/service/business/impl/InformationServiceImpl.java | 53 +++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 37 insertions(+), 16 deletions(-) diff --git a/server/src/main/java/com/doumee/service/business/impl/InformationServiceImpl.java b/server/src/main/java/com/doumee/service/business/impl/InformationServiceImpl.java index 225d9f6..3961dbe 100644 --- a/server/src/main/java/com/doumee/service/business/impl/InformationServiceImpl.java +++ b/server/src/main/java/com/doumee/service/business/impl/InformationServiceImpl.java @@ -44,15 +44,16 @@ public Integer create(Information information) { LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); if(Objects.isNull(information) - || Objects.isNull(information.getSortnum()) - || Objects.isNull(information.getReleaseDate()) +// || Objects.isNull(information.getSortnum()) +// || Objects.isNull(information.getReleaseDate()) || StringUtils.isEmpty(information.getTitle()) - || StringUtils.isEmpty(information.getContnet()) - || StringUtils.isEmpty(information.getDescribe()) - || StringUtils.isEmpty(information.getImgurl()) +// || StringUtils.isEmpty(information.getContent()) +// || StringUtils.isEmpty(information.getDetail()) +// || StringUtils.isEmpty(information.getImgurl()) ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } + information.setType(Constants.formatIntegerNum(information.getType())); information.setIsdeleted(Constants.ZERO); information.setCreateDate(new Date()); information.setCreator(user.getId()); @@ -62,7 +63,7 @@ @Override public void deleteById(Integer id) { - informationMapper.update(new UpdateWrapper<Information>().lambda().set(Information::getIsdeleted,Constants.ZERO).eq(Information::getId,id)); + informationMapper.update(new UpdateWrapper<Information>().lambda().set(Information::getIsdeleted,Constants.ONE).eq(Information::getId,id)); } @Override @@ -76,7 +77,9 @@ if (CollectionUtils.isEmpty(ids)) { return; } - informationMapper.deleteBatchIds(ids); + for (Integer id : ids) { + this.deleteById(id); + } } @Override @@ -84,12 +87,12 @@ LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); if(Objects.isNull(information) || Objects.isNull(information.getId()) - || Objects.isNull(information.getSortnum()) - || Objects.isNull(information.getReleaseDate()) +// || Objects.isNull(information.getSortnum()) +// || Objects.isNull(information.getReleaseDate()) || StringUtils.isEmpty(information.getTitle()) - || StringUtils.isEmpty(information.getContnet()) - || StringUtils.isEmpty(information.getDescribe()) - || StringUtils.isEmpty(information.getImgurl()) +// || StringUtils.isEmpty(information.getContent()) +// || StringUtils.isEmpty(information.getDetail()) +// || StringUtils.isEmpty(information.getImgurl()) ){ throw new BusinessException(ResponseStatus.BAD_REQUEST); } @@ -139,12 +142,16 @@ queryWrapper.lambda() .eq(Information::getIsdeleted,Constants.ZERO) .eq(pageWrap.getModel().getId() != null, Information::getId, pageWrap.getModel().getId()) + .eq(pageWrap.getModel().getModule() != null, Information::getModule, pageWrap.getModel().getModule()) + .eq(pageWrap.getModel().getType() != null, Information::getType, pageWrap.getModel().getType()) + .eq(pageWrap.getModel().getStatus() != null, Information::getStatus, pageWrap.getModel().getStatus()) .eq(pageWrap.getModel().getRemark() != null, Information::getRemark, pageWrap.getModel().getRemark()) - .eq(pageWrap.getModel().getTitle() != null, Information::getTitle, pageWrap.getModel().getTitle()) - .eq(pageWrap.getModel().getDescribe() != null, Information::getDescribe, pageWrap.getModel().getDescribe()) - .eq(pageWrap.getModel().getContnet() != null, Information::getContnet, pageWrap.getModel().getContnet()) + .like(pageWrap.getModel().getTitle() != null, Information::getTitle, pageWrap.getModel().getTitle()) + .like(pageWrap.getModel().getDetail() != null, Information::getDetail, pageWrap.getModel().getDetail()) + .like(pageWrap.getModel().getContent() != null, Information::getContent, pageWrap.getModel().getContent()) .ge(pageWrap.getModel().getReleaseDate() != null, Information::getReleaseDate, Utils.Date.getStart(pageWrap.getModel().getReleaseDate())) .le(pageWrap.getModel().getReleaseDate() != null, Information::getReleaseDate, Utils.Date.getEnd(pageWrap.getModel().getReleaseDate())) + .orderByDesc(Information::getSortnum) ; for(PageWrap.SortData sortData: pageWrap.getSorts()) { if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { @@ -156,7 +163,7 @@ IPage<Information> iPage = informationMapper.selectPage(page, queryWrapper); String fileDir = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.FILE_DIR).getCode(); for (Information information:iPage.getRecords()) { - if(Objects.isNull(information)&& org.apache.commons.lang3.StringUtils.isNotBlank(information.getImgurl())){ + if(!Objects.isNull(information)&& org.apache.commons.lang3.StringUtils.isNotBlank(information.getImgurl())){ information.setFullImgurl(fileDir + information.getImgurl()); } } @@ -168,4 +175,18 @@ QueryWrapper<Information> wrapper = new QueryWrapper<>(information); return informationMapper.selectCount(wrapper); } + + + + @Override + public void updateStatus(Information information){ + if(Objects.isNull(information) + || Objects.isNull(information.getStatus()) + || Objects.isNull(information.getId()) + || !(Constants.equalsInteger(information.getStatus(),Constants.ZERO) + || Constants.equalsInteger(information.getStatus(),Constants.ONE))){ + throw new BusinessException(ResponseStatus.DATA_EMPTY); + } + informationMapper.update(new UpdateWrapper<Information>().lambda().set(Information::getStatus,information.getStatus()).eq(Information::getId,information.getId())); + } } -- Gitblit v1.9.3