Преглед на файлове

码活动列表分页查询添加申请表的申请状态关联
提交码活动申请表时,同步修改码活动是否有申请单的状态

v_HuilingDeng преди 3 години
родител
ревизия
f37eaa3836

+ 2 - 10
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/mapper/BaseActiveMapper.java

@@ -2,6 +2,7 @@ package com.abi.qms.platform.dao.mapper;
 
 import com.abi.qms.platform.dao.entity.BaseActive;
 import com.abi.qms.platform.dao.vo.result.ActivePackageVO;
+import com.abi.qms.platform.dao.vo.result.ListActiveVO;
 import com.abi.qms.platform.dao.vo.result.PackageActiveVO;
 import com.abi.qms.platform.dto.req.ListActiveReq;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -17,16 +18,7 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface BaseActiveMapper extends BaseMapper<BaseActive> {
 
-    IPage<BaseActive> listActivePage(IPage page, @Param("param") ListActiveReq param);
-
-
-    /**
-     * 通过码活动id查询关联码包列表
-     * @param page
-     * @param activeId
-     * @return
-     */
-    IPage<ActivePackageVO> listPackageById(IPage page, @Param("id") Long activeId);
+    IPage<ListActiveVO> listActivePage(IPage page, @Param("param") ListActiveReq param);
 
     /**
      * 通过码包ID查询对应一个活动

+ 54 - 0
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dao/vo/result/ListActiveVO.java

@@ -0,0 +1,54 @@
+package com.abi.qms.platform.dao.vo.result;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author Eurus
+ * @date 2021/6/1 11:05
+ * @Description:
+ */
+@Data
+@ApiModel
+public class ListActiveVO implements Serializable {
+
+    @ApiModelProperty(value = "码活动id")
+    private Long id;
+
+    @ApiModelProperty(value = "活动名称")
+    private String activeName;
+
+    @ApiModelProperty(value = "活动类型 1-utc 2-bof 3-品质信息")
+    private Integer activeType;
+
+    @ApiModelProperty(value = "码活动审核状态 1-待审核 2-通过 9-驳回")
+    private Integer auditStatus;
+
+    @ApiModelProperty(value = "申请单审核状态 1-待审核 2-通过 9-驳回")
+    private Integer applyAuditStatus;
+
+    @ApiModelProperty(value = "申请时间")
+    private LocalDateTime applyTime;
+
+    @ApiModelProperty(value = "申请人姓名")
+    private String applyUserName;
+
+    @ApiModelProperty(value = "活动开始日期")
+    private LocalDateTime beginTime;
+
+    @ApiModelProperty(value = "活动结束日期")
+    private LocalDateTime endTime;
+
+    @ApiModelProperty(value = "活动域名")
+    private String activeUrl;
+
+    @ApiModelProperty(value = "是否有效")
+    private Integer valid;
+
+    @ApiModelProperty(value = "有修改活动申请单 1-是 0-不是")
+    private Integer isModifyApply;
+}

+ 8 - 5
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/dto/res/ListActiveRes.java

@@ -34,7 +34,7 @@ public class ListActiveRes extends PageResp implements Serializable {
     @ApiModel(value = "ListActiveRes_Active")
     public static class ActiveBean implements Serializable {
 
-        @ApiModelProperty(value = "id")
+        @ApiModelProperty(value = "码活动id")
         private Long id;
 
         @ApiModelProperty(value = "活动名称")
@@ -43,22 +43,22 @@ public class ListActiveRes extends PageResp implements Serializable {
         @ApiModelProperty(value = "活动类型 1-utc 2-bof 3-品质信息")
         private Integer activeType;
 
-        @ApiModelProperty(value = "活动状态 1-待审核 2-通过 9-驳回")
+        @ApiModelProperty(value = "活动审核状态 1-待审核 2-通过 9-驳回")
         private Integer auditStatus;
 
+        @ApiModelProperty(value = "申请单审核状态 1-待审核 2-通过 9-驳回")
+        private Integer applyAuditStatus;
+
         @ApiModelProperty(value = "申请时间")
-        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
         private LocalDateTime applyTime;
 
         @ApiModelProperty(value = "申请人姓名")
         private String applyUserName;
 
         @ApiModelProperty(value = "活动开始日期")
-        @JsonFormat(pattern = "yyyy-MM-dd")
         private LocalDateTime beginTime;
 
         @ApiModelProperty(value = "活动结束日期")
-        @JsonFormat(pattern = "yyyy-MM-dd")
         private LocalDateTime endTime;
 
         @ApiModelProperty(value = "活动域名")
@@ -67,5 +67,8 @@ public class ListActiveRes extends PageResp implements Serializable {
         @ApiModelProperty(value = "是否有效")
         private Integer valid;
 
+        @ApiModelProperty(value = "有修改活动申请单 1-是 0-不是")
+        private Integer isModifyApply;
+
     }
 }

+ 9 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/ActiveServiceImpl.java

@@ -9,6 +9,7 @@ import com.abi.qms.platform.dao.enums.ValidEnum;
 import com.abi.qms.platform.dao.mapper.*;
 import com.abi.qms.platform.dao.vo.result.ActiveModifyApplyPackageVO;
 import com.abi.qms.platform.dao.vo.result.ActivePackageVO;
+import com.abi.qms.platform.dao.vo.result.ListActiveVO;
 import com.abi.qms.platform.dao.vo.result.PackageActiveSearchVO;
 import com.abi.qms.platform.dto.req.*;
 import com.abi.qms.platform.dto.res.*;
@@ -178,6 +179,12 @@ public class ActiveServiceImpl implements ActiveService {
         baseActiveModifyApply.setCreateBy(userId);
         baseActiveModifyApplyMapper.insert(baseActiveModifyApply);
 
+        //修改码活动是否有申请单
+        UpdateWrapper<BaseActive> activeUpdateWrapper = new UpdateWrapper<>();
+        activeUpdateWrapper.set("is_modify_apply", 1)
+                .eq("id", req.getActiveId());
+        baseActiveMapper.update(null, activeUpdateWrapper);
+
         //批量插入 活动编辑申请码包关联子表
         batchInsertActiveModifyApplyPackageMappiing(baseActiveModifyApply.getId(), req.getActiveId(), req.getQrPackageIdAddList(), req.getQrPackageIdDeleteList());
     }
@@ -189,8 +196,8 @@ public class ActiveServiceImpl implements ActiveService {
     public ListActiveRes listActive(ListActiveReq req){
 
         //分页查询
-        IPage<BaseActive> iPage = baseActiveMapper.listActivePage(PageUtil.createPage(req), req);
-        List<BaseActive> activeList = iPage.getRecords();
+        IPage<ListActiveVO> iPage = baseActiveMapper.listActivePage(PageUtil.createPage(req), req);
+        List<ListActiveVO> activeList = iPage.getRecords();
         //封装出参
         ListActiveRes res = new ListActiveRes();
         //放入分页信息

+ 10 - 9
abi-cloud-qr-platform-server/src/main/resources/dao/mapper/BaseActiveMapper.xml

@@ -30,25 +30,26 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, active_code, active_name, active_type, audit_status, apply_time, apply_user_id, apply_user_name, audit_user_id, audit_user_name, begin_time, end_time, brand_code, sub_brand_code, active_url, create_time, create_by, update_time, update_by, is_delete, valid, is_modify_apply
+        id, active_code, active_name, active_name, audit_status, apply_time, apply_user_id, apply_user_name, audit_user_id, audit_user_name, begin_time, end_time, brand_code, sub_brand_code, active_url, create_time, create_by, update_time, update_by, is_delete, valid, is_modify_apply
     </sql>
 
-    <select id="listActivePage" resultMap="BaseResultMap">
-        select <include refid="Base_Column_List"/>
-        from base_active
+    <select id="listActivePage" resultType="com.abi.qms.platform.dao.vo.result.ListActiveVO">
+        select active.id, active.active_name, active.active_name, active.audit_status, active.apply_time, active.apply_user_name, active.begin_time, active.end_time, active.active_url, active.valid, active.is_modify_apply, apply.audit_status as apply_audit_status
+        from base_active active
+        left join base_active_modify_apply apply on active.id = apply.active_id and apply.is_delete = 0
         <where>
-            is_delete = 0
+            active.is_delete = 0
             <if test="param.activeName != null and param.activeName != ''">
-                AND active_name like concat('%',#{param.activeName},'%')
+                AND active.active_name like concat('%',#{param.activeName},'%')
             </if>
             <if test="param.activeType != null">
-                AND active_type = #{param.activeType}
+                AND active.active_type = #{param.activeType}
             </if>
             <if test="param.auditStatus != null ">
-                AND audit_status = #{param.auditStatus}
+                AND active.audit_status = #{param.auditStatus}
             </if>
         </where>
-        order by apply_time
+        order by active.apply_time
     </select>
 
     <select id="getPackageActive" resultType="com.abi.qms.platform.dao.vo.result.PackageActiveVO">