Kaynağa Gözat

解决翻页total都为0的问题,提审接口返回审核id

houweiyu 4 yıl önce
ebeveyn
işleme
7a47747612

+ 22 - 0
src/main/java/fcb/project/manager/base/config/MyBatisPlusPageConfig.java

@@ -0,0 +1,22 @@
+package fcb.project.manager.base.config;
+
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2021/1/18 9:55
+ * 4
+ */
+@Configuration
+public class MyBatisPlusPageConfig {
+    /**
+     * 分页插件
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        return new PaginationInterceptor();
+    }
+
+}

+ 1 - 1
src/main/java/fcb/project/manager/base/service/impl/TmHouseServiceImpl.java

@@ -43,7 +43,7 @@ public class TmHouseServiceImpl extends ServiceImpl<TmHouseDao, TmHouse> impleme
         }
         lambdaQueryWrapper.eq(TmHouse::getType , type);
 //        lambdaQueryWrapper.eq(TmHouse::getIsDelete , DeleteStatus.NOT_DELETE.getCode());
-        IPage<TmHouse> page = new Page<>(pageNum , pageSize);
+        IPage<TmHouse> page = new Page<>(pageNum , pageSize , true);
         return  getBaseMapper().selectPage(page , lambdaQueryWrapper);
     }
 

+ 36 - 0
src/main/java/fcb/project/manager/base/utils/DataUtils.java

@@ -1,11 +1,14 @@
 package fcb.project.manager.base.utils;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.log4j.Log4j2;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import java.math.BigDecimal;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
 import java.util.*;
 
 /**
@@ -14,6 +17,7 @@ import java.util.*;
  * @desciption
  */
 @Component
+@Log4j2
 public class DataUtils {
 
     public static BigDecimal getBigDecimalObj(Object data) {
@@ -134,4 +138,36 @@ public class DataUtils {
         });
         return treemap;
     }
+
+    /**
+     *
+     * 生成MD5 32位小写字符的密码串
+     * */
+    public static String encryption(String OrderNo) {
+        String result = OrderNo+"354039456123789"+"andriod";
+        String re_md5 = new String();
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            md.update(result.getBytes());
+            byte b[] = md.digest();
+            StringBuffer buf = new StringBuffer("");
+            int i;
+            for (int offset = 0; offset < b.length; offset++) {
+                i = b[offset];
+                if (i < 0){
+                    i += 256;
+                }
+                if (i < 16){
+                    buf.append("0");
+                }
+                buf.append(Integer.toHexString(i));
+            }
+            re_md5 = buf.toString();
+        } catch (NoSuchAlgorithmException e) {
+            log.info("生成MD5密码出错了:{}" , e);
+            e.printStackTrace();
+        }
+        return re_md5.toLowerCase();
+    }
+
 }

+ 15 - 0
src/main/java/fcb/project/manager/base/utils/FcbUtils.java

@@ -0,0 +1,15 @@
+package fcb.project.manager.base.utils;
+
+import org.springframework.stereotype.Service;
+
+/**
+ * 2 * @Author: Abner
+ * 3 * @Date: 2021/1/18 9:11
+ * 4
+ */
+@Service
+public class FcbUtils {
+
+
+
+}

+ 3 - 0
src/main/java/fcb/project/manager/core/controller/ApiQueryHouseController.java

@@ -100,6 +100,9 @@ public class ApiQueryHouseController {
         return Result.success(fcbHouseInfo);
     }
 
+
+
+
     @ApiOperation(value = "测试获取fcbhouseInfo的json")
     @GetMapping(value = "/justTest")
     public void justTest(@RequestBody TmFcbHouseInfo tmFcbHouseInfo){

+ 5 - 1
src/main/java/fcb/project/manager/core/controller/HouseManagerController.java

@@ -24,6 +24,8 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * 2 * @Author: Abner
@@ -237,7 +239,9 @@ public class HouseManagerController {
                 log.info("更新房源的审批id失败");
                 throw new CommonBaseException(ResultCodeEnum.D101 , "更新房源的审批记录失败");
             }
-           return Result.success();
+            Map<String , Object> map = new HashMap<>();
+            map.put("auditId" , tmAudit.getId());
+           return Result.success(map);
         }else{
             return Result.failure("提交失败");
         }