From 6cc3ee53a1088abf6a8083c9e72ca9647bb6428f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 19 六月 2025 16:56:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 server/src/main/java/com/doumee/service/business/impl/InformationServiceImpl.java |   43 +++++++++++++++++++++++++++++--------------
 1 files changed, 29 insertions(+), 14 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..2a36d54 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,12 +44,12 @@
     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);
         }
@@ -84,12 +84,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);
         }
@@ -140,9 +140,9 @@
                 .eq(Information::getIsdeleted,Constants.ZERO)
                 .eq(pageWrap.getModel().getId() != null, Information::getId, pageWrap.getModel().getId())
                 .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()))
         ;
@@ -156,7 +156,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 +168,19 @@
         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