java110 před 4 roky
rodič
revize
f3dc0ba5f2

+ 10 - 0
java110-bean/src/main/java/com/java110/dto/advert/AdvertDto.java

@@ -35,6 +35,8 @@ public class AdvertDto extends PageDto implements Serializable {
     private String roomId;
     private String roomNum;
     private String bId;
+    private String viewType ;
+
 
     private String createTime;
 
@@ -223,4 +225,12 @@ public class AdvertDto extends PageDto implements Serializable {
     public void setbId(String bId) {
         this.bId = bId;
     }
+
+    public String getViewType() {
+        return viewType;
+    }
+
+    public void setViewType(String viewType) {
+        this.viewType = viewType;
+    }
 }

+ 9 - 0
java110-bean/src/main/java/com/java110/po/advert/AdvertPo.java

@@ -24,6 +24,7 @@ public class AdvertPo implements Serializable {
     private String startTime;
     private String endTime;
     private String createTime;
+    private String viewType;
 
 
     public String getAdvertId() {
@@ -121,4 +122,12 @@ public class AdvertPo implements Serializable {
     public void setCreateTime(String createTime) {
         this.createTime = createTime;
     }
+
+    public String getViewType() {
+        return viewType;
+    }
+
+    public void setViewType(String viewType) {
+        this.viewType = viewType;
+    }
 }

+ 11 - 0
java110-bean/src/main/java/com/java110/vo/api/advert/ApiAdvertDataVo.java

@@ -26,6 +26,9 @@ public class ApiAdvertDataVo implements Serializable {
     private String roomNum;
     private String createTime;
 
+    private String viewType;
+
+
     public String getAdvertId() {
         return advertId;
     }
@@ -185,4 +188,12 @@ public class ApiAdvertDataVo implements Serializable {
     public void setCreateTime(String createTime) {
         this.createTime = createTime;
     }
+
+    public String getViewType() {
+        return viewType;
+    }
+
+    public void setViewType(String viewType) {
+        this.viewType = viewType;
+    }
 }

+ 18 - 6
java110-db/src/main/resources/mapper/common/AdvertServiceDaoImplMapper.xml

@@ -6,9 +6,9 @@
 
     <!-- 保存广告信息信息 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessAdvertInfo" parameterType="Map">
-    insert into business_advert(classify,ad_name,location_type_cd,ad_type_cd,advert_id,operate,start_time,state,end_time,community_id,b_id,location_obj_id,seq)
+    insert into business_advert(classify,ad_name,location_type_cd,ad_type_cd,advert_id,operate,start_time,state,end_time,community_id,b_id,location_obj_id,seq,view_type)
     values
-    (#{classify},#{adName},#{locationTypeCd},#{adTypeCd},#{advertId},#{operate},#{startTime},#{state},#{endTime},#{communityId},#{bId},#{locationObjId},#{seq})
+    (#{classify},#{adName},#{locationTypeCd},#{adTypeCd},#{advertId},#{operate},#{startTime},#{state},#{endTime},#{communityId},#{bId},#{locationObjId},#{seq},#{viewType})
     </insert>
 
     <!-- 查询广告信息信息(Business) add by wuxw 2018-07-03 -->
@@ -17,7 +17,7 @@
         locationTypeCd,t.ad_type_cd,t.ad_type_cd adTypeCd,t.advert_id,t.advert_id
         advertId,t.operate,t.start_time,t.start_time startTime,t.state,t.end_time,t.end_time
         endTime,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.location_obj_id,t.location_obj_id
-        locationObjId,t.seq
+        locationObjId,t.seq,t.view_type,t.view_type viewType
         from business_advert t
         where 1 =1
         <if test="classify !=null and classify != ''">
@@ -64,9 +64,9 @@
     <!-- 保存广告信息信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveAdvertInfoInstance" parameterType="Map">
         insert into advert(
-        classify,ad_name,location_type_cd,status_cd,ad_type_cd,advert_id,start_time,state,end_time,community_id,b_id,location_obj_id,seq
+        classify,ad_name,location_type_cd,status_cd,ad_type_cd,advert_id,start_time,state,end_time,community_id,b_id,location_obj_id,seq,view_type
         ) select
-        t.classify,t.ad_name,t.location_type_cd,'0',t.ad_type_cd,t.advert_id,t.start_time,t.state,t.end_time,t.community_id,t.b_id,t.location_obj_id,t.seq
+        t.classify,t.ad_name,t.location_type_cd,'0',t.ad_type_cd,t.advert_id,t.start_time,t.state,t.end_time,t.community_id,t.b_id,t.location_obj_id,t.seq,t.view_type
         from business_advert t where 1=1
         <if test="classify !=null and classify != ''">
             and t.classify= #{classify}
@@ -143,6 +143,9 @@
         <if test="seq !=null and seq != ''">
             , t.seq= #{seq}
         </if>
+        <if test="viewType != null and viewType != ''">
+            , t.view_type = #{viewType}
+        </if>
         where 1=1
         <if test="advertId !=null and advertId != ''">
             and t.advert_id= #{advertId}
@@ -158,7 +161,7 @@
         locationTypeCd,t.status_cd,t.status_cd statusCd,t.ad_type_cd,t.ad_type_cd adTypeCd,t.advert_id,t.advert_id
         advertId,t.start_time,t.start_time startTime,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id
         communityId,t.b_id,t.b_id bId,t.location_obj_id,t.location_obj_id locationObjId,t.seq,td1.name
-        classifyName,td2.name stateName,t.create_time createTime,td3.name locationObjName
+        classifyName,td2.name stateName,t.create_time createTime,td3.name locationObjName,t.view_type,t.view_type viewType
         from advert t
         left join t_dict td1 on  t.classify = td1.status_cd and td1.table_name = 'advert' and td1.table_columns = 'classify'
         left join t_dict td2 on t.state = td2.status_cd and td2.table_name = 'advert' and td2.table_columns = 'state'
@@ -203,6 +206,9 @@
         <if test="createTime != null and createTime != ''">
             and t.create_Time = #{createTime}
         </if>
+        <if test="viewType != null and viewType != ''">
+            and t.view_type = #{viewType}
+        </if>
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
@@ -242,6 +248,9 @@
         <if test="seq !=null and seq != ''">
             , t.seq= #{seq}
         </if>
+        <if test="viewType != null and viewType != ''">
+            , t.view_type = #{viewType}
+        </if>
         where 1=1
         <if test="advertId !=null and advertId != ''">
             and t.advert_id= #{advertId}
@@ -292,5 +301,8 @@
         <if test="seq !=null and seq != ''">
             and t.seq= #{seq}
         </if>
+        <if test="viewType != null and viewType != ''">
+            and t.view_type = #{viewType}
+        </if>
     </select>
 </mapper>

+ 1 - 0
service-api/src/main/java/com/java110/api/listener/advert/SaveAdvertListener.java

@@ -47,6 +47,7 @@ public class SaveAdvertListener extends AbstractServiceApiPlusListener {
         Assert.hasKeyAndValue(reqJson, "seq", "必填,请填写播放顺序");
         Assert.hasKeyAndValue(reqJson, "startTime", "必填,请选择投放时间");
         Assert.hasKeyAndValue(reqJson, "endTime", "必填,请选择结束时间");
+        Assert.hasKeyAndValue(reqJson, "viewType", "必填,请选择类型");
         if (!hasKeyAndValue(reqJson, "photos") && !hasKeyAndValue(reqJson, "vedioName")) {
             throw new IllegalArgumentException("请求报文中没有包含视频或图片");
         }

+ 2 - 0
service-common/src/main/java/com/java110/common/listener/advert/AbstractAdvertBusinessServiceDataFlowListener.java

@@ -49,6 +49,7 @@ public abstract class AbstractAdvertBusinessServiceDataFlowListener extends Abst
         businessAdvertInfo.put("communityId", businessAdvertInfo.get("community_id"));
         businessAdvertInfo.put("locationObjId", businessAdvertInfo.get("location_obj_id"));
         businessAdvertInfo.put("seq", businessAdvertInfo.get("seq"));
+        businessAdvertInfo.put("viewType", businessAdvertInfo.get("view_type"));
         businessAdvertInfo.remove("bId");
         businessAdvertInfo.put("statusCd", statusCd);
     }
@@ -85,6 +86,7 @@ public abstract class AbstractAdvertBusinessServiceDataFlowListener extends Abst
         currentAdvertInfo.put("communityId", currentAdvertInfo.get("community_id"));
         currentAdvertInfo.put("locationObjId", currentAdvertInfo.get("location_obj_id"));
         currentAdvertInfo.put("seq", currentAdvertInfo.get("seq"));
+        currentAdvertInfo.put("viewType", currentAdvertInfo.get("view_type"));
 
 
         currentAdvertInfo.put("operate", StatusConstant.OPERATE_DEL);