Forráskód Böngészése

1、增加活动查询

zhoux 1 éve
szülő
commit
26fed12594

+ 10 - 0
src/main/java/com/dk/oauth/controller/ActivityController.java

@@ -26,4 +26,14 @@ public class ActivityController {
     public ResponseResultVO<?> selectByCond(@RequestBody Activity activity) {
         return activityService.selectByCond(activity);
     }
+
+    /**
+     * @desc : 查询广告明细信息
+     * @author : 周兴
+     * @date : 2024/5/7 13:32
+     */
+    @PostMapping({"/select_activity_items"})
+    public ResponseResultVO<?> selectActivityItems(@RequestBody Activity activity) {
+        return activityService.selectActivityItems(activity);
+    }
 }

+ 16 - 0
src/main/java/com/dk/oauth/entity/Activity.java

@@ -73,6 +73,14 @@ public class Activity extends PageInfo<ActivityResponse> implements Serializable
     private String activityType;
 
     /**
+     * 活动分类
+     */
+    @Excel(name = "活动分类")
+    @ApiModelProperty(value = "活动分类")
+    @TableField(typeHandler = StringListTypeHandler.class)
+    private List<String> activityTypeList;
+
+    /**
      * 活动状态
      */
     @Excel(name = "活动状态")
@@ -84,6 +92,14 @@ public class Activity extends PageInfo<ActivityResponse> implements Serializable
      */
     @Excel(name = "活动状态")
     @ApiModelProperty(value = "活动状态")
+    @TableField(typeHandler = StringListTypeHandler.class)
+    private List<String> activityStatusList;
+
+    /**
+     * 活动状态
+     */
+    @Excel(name = "活动状态")
+    @ApiModelProperty(value = "活动状态")
     private String activityStatusName;
 
 

+ 13 - 0
src/main/java/com/dk/oauth/entity/CompanyResponse.java

@@ -1,7 +1,12 @@
 package com.dk.oauth.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.dk.common.infrastructure.handler.TimestampTypeHandler;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
+import java.time.LocalDate;
+
 /**
  * @author : 周兴
  * @desc : CompanyResponse
@@ -23,4 +28,12 @@ public class CompanyResponse {
     private String svcPort;
 
     private String gradeCode;
+
+    private Integer maxStaffNum;
+
+    private Integer curStaffNum;
+
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @TableField(typeHandler = TimestampTypeHandler.class)
+    private LocalDate endDate;
 }

+ 1 - 1
src/main/java/com/dk/oauth/feign/service/OrgFeign.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
  * @desc : MdmServerFeign
  * @date : 2024-038-10 10:56
  */
-@FeignClient(name = Constant.MDM_PREFIX + Constant.SERVER + "-dkic-b1" , path = Constant.MST_ORG, contextId = "org")
+@FeignClient(name = Constant.MDM_PREFIX + Constant.SERVER + "-dkic-b1-zx" , path = Constant.MST_ORG, contextId = "org")
 public interface OrgFeign {
     /**
      * @desc : 注册商户时候插入部门--顶级

+ 2 - 2
src/main/java/com/dk/oauth/feign/service/StaffFeign.java

@@ -16,7 +16,7 @@ import java.util.Map;
  * @desc : MdmServerFeign
  * @date : 2024-038-10 10:56
  */
-@FeignClient(name = Constant.MDM_PREFIX + Constant.SERVER + "-dkic-b1", path = Constant.MST_STAFF, contextId = "staff")
+@FeignClient(name = Constant.MDM_PREFIX + Constant.SERVER + "-dkic-b1-zx", path = Constant.MST_STAFF, contextId = "staff")
 public interface StaffFeign {
     /**
      * @desc : 体验产品
@@ -32,7 +32,7 @@ public interface StaffFeign {
      * @author : 姜永辉
      * @date : 2023-11-02 16:27
      */
-    @PostMapping({"//" + Constant.MDM_PREFIX + Constant.SERVER + "-$CLUSTER_ID"   + Constant.MST_STAFF + "/insert_feign_company_data"})
+    @PostMapping({"//" + Constant.MDM_PREFIX + Constant.SERVER + "-$CLUSTER_ID" + "-zx"   + Constant.MST_STAFF + "/insert_feign_company_data"})
     ResponseResultVO  insertFeignCompanyData(@RequestBody Map<String, List<Map<String, Object>>> map);
 
     /**

+ 7 - 0
src/main/java/com/dk/oauth/mapper/ActivityMapper.java

@@ -5,6 +5,7 @@ import com.dk.oauth.entity.Activity;
 import com.dk.oauth.entity.ActivityResponse;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author : 周兴
@@ -21,5 +22,11 @@ public interface ActivityMapper extends BaseMapper<Activity> {
      */
     List<ActivityResponse> selectByCond(Activity t);
 
+    /**
+     * @desc : 查询活动明细
+     * @author : 周兴
+     * @date : 2024-05-16 15:21
+     */
+    List<Map<String,Object>> selectActivityItems(Activity t);
 
 }

+ 1 - 1
src/main/java/com/dk/oauth/service/IActivityService.java

@@ -14,5 +14,5 @@ public interface IActivityService extends IService<Activity> {
 
     ResponseResultVO selectByCond(Activity activity);
 
-
+    ResponseResultVO selectActivityItems(Activity activity);
 }

+ 9 - 0
src/main/java/com/dk/oauth/service/impl/ActivityServiceImpl.java

@@ -30,4 +30,13 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
     public ResponseResultVO selectByCond(Activity activity) {
         return ResponseResultUtil.success(activityMapper.selectByCond(activity));
     }
+
+    /**
+     * @desc : 查询广告明细
+     * @author : 周兴
+     * @date : 2024/5/16 13:32
+     */
+    public ResponseResultVO selectActivityItems(Activity activity) {
+        return ResponseResultUtil.success(activityMapper.selectActivityItems(activity));
+    }
 }

+ 44 - 1
src/main/resources/mapper/ActivityMapper.xml

@@ -45,7 +45,7 @@
         ON t.activity_status = tdk.kind_code
         WHERE t.flg_valid
         AND now() &gt;= t.begin_date
-        AND (t.end_date IS NULL OR t.end_date &gt;= now())
+        AND (t.end_date IS NULL OR t.end_date + '1 day'::INTERVAL &gt;= now())
         AND (t.cp_ids IS NULL OR #{cpId} = ANY(t.cp_ids))
         <if test="appCode != null and appCode != ''">
             And t.app_code = #{appCode}
@@ -56,7 +56,50 @@
         <if test="flgBanner != null ">
             And t.flg_banner = #{flgBanner}
         </if>
+        <if test="activityTypeList != null ">
+            AND t.activity_type = ANY(#{activityTypeList,typeHandler=StringListTypeHandler})
+        </if>
         ORDER BY t.display_no
     </select>
+
+    <!--查询活动明细-->
+    <select id="selectActivityItems"  resultType="java.util.Map">
+        SELECT
+            ti.item_id AS "itemId",
+            ti.activity_id AS "activityId",
+            ti.activity_item_name AS "activityItemName",
+            ti.activity_item_describe  AS "activityItemDescribe",
+            ti.std_price  AS "stdPrice",
+            ti.sale_price  AS "salePrice",
+            ti.valid_long  AS "validLong",
+            ti.extra_long AS "extraLong"
+        FROM
+            dkic_a.t_mst_activity_item ti
+                INNER JOIN dkic_a.t_mst_activity T ON ti.activity_id = T.activity_id
+        WHERE
+            T.flg_valid
+          AND ti.flg_valid
+          AND now( ) >= T.begin_date
+          AND ( T.end_date IS NULL OR T.end_date + '1 day' :: INTERVAL >= now( ) )
+          AND ( T.cp_ids IS NULL OR 1 = ANY ( T.cp_ids ) )
+        <if test="appCode != null and appCode != ''">
+            And t.app_code = #{appCode}
+        </if>
+        <if test="activityStatus != null and activityStatus != ''">
+            And t.activity_status = #{activityStatus}
+        </if>
+        <if test="flgBanner != null ">
+            And t.flg_banner = #{flgBanner}
+        </if>
+        <if test="flgBanner != null ">
+            And t.flg_banner = #{flgBanner}
+        </if>
+        <if test="activityTypeList != null ">
+            AND t.activity_type = ANY(#{activityTypeList,typeHandler=StringListTypeHandler})
+        </if>
+        ORDER BY
+            T.display_no,
+            ti.item_id
+    </select>
 </mapper>
 

+ 7 - 2
src/main/resources/mapper/CompanyMapper.xml

@@ -17,7 +17,9 @@
         <result column="svc_code" property="svcCode"/>
         <result column="svc_ip" property="svcIp"/>
         <result column="svc_port" property="svcPort"/>
-        <result column="grade_code" property="gradeCode"/>
+        <result column="end_date" property="endDate"/>
+        <result column="max_staff_num" property="maxStaffNum"/>
+        <result column="cur_staff_num" property="curStaffNum"/>
     </resultMap>
 
     <resultMap type="com.dk.oauth.entity.MenuFrequency" id="ResultMenuMap">
@@ -63,13 +65,16 @@
                tac.cp_name,
                tac.svc_code ,
                tac.grade_code,
+               tac.end_date,
+               tac.max_staff_num,
+               tac.cur_staff_num,
                tss.svc_ip,
                tss.svc_port
         FROM dkic_a.t_a_company tac
         LEFT JOIN dkic_a.t_s_service tss
         ON tac.svc_code = tss.svc_code
         AND tss.flg_valid
-        where tac.cp_id = #{id} and (tac.end_date is null or tac.end_date > now()) and tac.flg_valid
+        where tac.cp_id = #{id} and (tac.end_date is null or tac.end_date +  '1 day'::INTERVAL > now()) and tac.flg_valid
     </select>