Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

czh 2 лет назад
Родитель
Сommit
c94ccce994

+ 6 - 4
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/bannerDistrictEnum.java

@@ -8,7 +8,7 @@ import lombok.Getter;
  * @date 2023/6/15
  */
 @Getter
-public enum bannerDistrictEnum {
+public enum BannerDistrictEnum {
 
     //首页
     BANNER_ZERO(0, "首页"),
@@ -29,17 +29,19 @@ public enum bannerDistrictEnum {
 
 
 
+    
+
     private final int code;
 
     private final String name;
 
-    bannerDistrictEnum(int code, String name){
+    BannerDistrictEnum(int code, String name){
         this.code = code;
         this.name = name;
     }
 
-    public static bannerDistrictEnum getName(int code){
-        for (bannerDistrictEnum addressDefaultTypeEnum : values()) {
+    public static BannerDistrictEnum getName(int code){
+        for (BannerDistrictEnum addressDefaultTypeEnum : values()) {
             if (addressDefaultTypeEnum.getCode() == code) {
                 return addressDefaultTypeEnum;
             }

+ 10 - 0
sckw-modules/sckw-fleet/src/main/resources/mapper/KwfDriverMapper.xml

@@ -78,6 +78,11 @@
         <if test="endTime != null and endTime != '' " >
             and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
+        <if test="noReport != null and noReport != ''">
+            and dr.id not in (
+            select driver_id from kwf_truck_report where del_flag = 0 and ent_id = #{entId, jdbcType=VARCHAR}
+            )
+        </if>
         <if test="keywords != null and keywords != ''">
             and (
             dr.name like concat('%',#{keywords},'%')
@@ -189,6 +194,11 @@
         <if test="endTime != null and endTime != '' " >
             and DATE( dr.create_time ) <![CDATA[ <= ]]> #{endTime,jdbcType=TIMESTAMP}
         </if>
+        <if test="noReport != null and noReport != ''">
+            and dr.id not in (
+            select driver_id from kwf_truck_report where del_flag = 0 and ent_id = #{entId, jdbcType=VARCHAR}
+            )
+        </if>
         <choose>
             <when test="ids != null and ids != '' ">
                 and dr.id in

+ 10 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/controller/KwoBannerController.java

@@ -86,6 +86,16 @@ public class KwoBannerController {
     public HttpResult detail(@RequestBody IdsReqVo reqVo) throws SystemException {
         return HttpResult.ok(bannerService.detailServer(reqVo.getId()));
     }
+    /**
+     * @return HttpResult
+     * @desc: 获取分类
+     * @author: sky
+     * @date: 2023/9/12
+     */
+    @PostMapping("/getCategory")
+    public HttpResult getCategory() throws SystemException {
+        return HttpResult.ok(bannerService.getCategory());
+    }
 
 
 

+ 26 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerCategoryResVo.java

@@ -0,0 +1,26 @@
+package com.sckw.operation.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.sckw.core.utils.LongToStringUtils;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author sky
+ * @desc 查询返参
+ * @date 2023/7/12
+ */
+@Data
+public class BannerCategoryResVo implements Serializable {
+    /**
+     * 主键
+     */
+    private Integer code;
+
+    private String name;
+
+}

+ 21 - 2
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/service/BannerService.java

@@ -10,6 +10,7 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.SystemException;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.AddressDefaultTypeEnum;
+import com.sckw.core.model.enums.ContractStatusEnum;
 import com.sckw.core.model.page.PageHelperUtil;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.utils.BeanUtils;
@@ -28,7 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import com.sckw.operation.model.entity.KwoBanner;
-import com.sckw.core.model.enums.bannerDistrictEnum;
+import com.sckw.core.model.enums.BannerDistrictEnum;
 
 /**
  * @author sky
@@ -119,7 +120,7 @@ public class BannerService {
             }
 
             if (Objects.nonNull(item.getDistrict())) {
-                bannerQueryResVo.setDistrictName(bannerDistrictEnum.getName(item.getDistrict()).getName());
+                bannerQueryResVo.setDistrictName(BannerDistrictEnum.getName(item.getDistrict()).getName());
             }
 
             list.add(bannerQueryResVo);
@@ -218,4 +219,22 @@ public class BannerService {
         return bannerDetailResVo;
     }
 
+    /**
+     * @return HttpResult
+     * @desc: 获取分类
+     * @author: sky
+     * @date: 2023/7/12
+     */
+    public List<BannerCategoryResVo> getCategory() {
+        BannerDistrictEnum[] values =  BannerDistrictEnum.values();
+        List<BannerCategoryResVo> list = new ArrayList<>();
+        for (BannerDistrictEnum bannerDistrictEnum : values) {
+            BannerCategoryResVo bannerCategoryResVo = new BannerCategoryResVo();
+            bannerCategoryResVo.setCode(bannerDistrictEnum.getCode());
+            bannerCategoryResVo.setName(bannerDistrictEnum.getName());
+            list.add(bannerCategoryResVo);
+        }
+        return list;
+    }
+
 }