java110 3 jaren geleden
bovenliggende
commit
3527422838

+ 53 - 31
java110-bean/src/main/java/com/java110/dto/communityPublicity/CommunityPublicityDto.java

@@ -1,6 +1,7 @@
 package com.java110.dto.communityPublicity;
 
 import com.java110.dto.PageDto;
+
 import java.io.Serializable;
 import java.util.Date;
 
@@ -15,16 +16,16 @@ import java.util.Date;
 public class CommunityPublicityDto extends PageDto implements Serializable {
 
     private String createUserId;
-private String pubId;
-private String context;
-private String collectCount;
-private String pubType;
-private String likeCount;
-private String createUserName;
-private String title;
-private String communityId;
-private String readCount;
-private String headerImg;
+    private String pubId;
+    private String context;
+    private String collectCount;
+    private String pubType;
+    private String likeCount;
+    private String createUserName;
+    private String title;
+    private String communityId;
+    private String readCount;
+    private String headerImg;
 
 
     private Date createTime;
@@ -35,67 +36,88 @@ private String headerImg;
     public String getCreateUserId() {
         return createUserId;
     }
-public void setCreateUserId(String createUserId) {
+
+    public void setCreateUserId(String createUserId) {
         this.createUserId = createUserId;
     }
-public String getPubId() {
+
+    public String getPubId() {
         return pubId;
     }
-public void setPubId(String pubId) {
+
+    public void setPubId(String pubId) {
         this.pubId = pubId;
     }
-public String getContext() {
+
+    public String getContext() {
         return context;
     }
-public void setContext(String context) {
+
+    public void setContext(String context) {
         this.context = context;
     }
-public String getCollectCount() {
+
+    public String getCollectCount() {
         return collectCount;
     }
-public void setCollectCount(String collectCount) {
+
+    public void setCollectCount(String collectCount) {
         this.collectCount = collectCount;
     }
-public String getPubType() {
+
+    public String getPubType() {
         return pubType;
     }
-public void setPubType(String pubType) {
+
+    public void setPubType(String pubType) {
         this.pubType = pubType;
     }
-public String getLikeCount() {
+
+    public String getLikeCount() {
         return likeCount;
     }
-public void setLikeCount(String likeCount) {
+
+    public void setLikeCount(String likeCount) {
         this.likeCount = likeCount;
     }
-public String getCreateUserName() {
+
+    public String getCreateUserName() {
         return createUserName;
     }
-public void setCreateUserName(String createUserName) {
+
+    public void setCreateUserName(String createUserName) {
         this.createUserName = createUserName;
     }
-public String getTitle() {
+
+    public String getTitle() {
         return title;
     }
-public void setTitle(String title) {
+
+    public void setTitle(String title) {
         this.title = title;
     }
-public String getCommunityId() {
+
+    public String getCommunityId() {
         return communityId;
     }
-public void setCommunityId(String communityId) {
+
+    public void setCommunityId(String communityId) {
         this.communityId = communityId;
     }
-public String getReadCount() {
+
+    public String getReadCount() {
         return readCount;
     }
-public void setReadCount(String readCount) {
+
+    public void setReadCount(String readCount) {
         this.readCount = readCount;
     }
-public String getHeaderImg() {
+
+    public String getHeaderImg() {
         return headerImg;
     }
-public void setHeaderImg(String headerImg) {
+
+    public void setHeaderImg(String headerImg) {
         this.headerImg = headerImg;
     }
 

+ 131 - 131
java110-db/src/main/resources/mapper/common/CommunityPublicityV1ServiceDaoImplMapper.xml

@@ -5,156 +5,156 @@
 <mapper namespace="communityPublicityV1ServiceDaoImpl">
 
 
-
-
-
     <!-- 保存小区公示信息 add by wuxw 2018-07-03 -->
     <insert id="saveCommunityPublicityInfo" parameterType="Map">
         insert into community_publicity(
-create_user_id,pub_id,context,collect_count,pub_type,like_count,create_user_name,title,community_id,read_count,header_img
-) values (
-#{createUserId},#{pubId},#{context},#{collectCount},#{pubType},#{likeCount},#{createUserName},#{title},#{communityId},#{readCount},#{headerImg}
-)
+        create_user_id,pub_id,context,collect_count,pub_type,like_count,create_user_name,title,community_id,read_count,header_img
+        ) values (
+        #{createUserId},#{pubId},#{context},#{collectCount},#{pubType},#{likeCount},#{createUserName},#{title},#{communityId},#{readCount},#{headerImg}
+        )
     </insert>
 
 
-
     <!-- 查询小区公示信息 add by wuxw 2018-07-03 -->
     <select id="getCommunityPublicityInfo" parameterType="Map" resultType="Map">
-        select  t.create_user_id,t.create_user_id createUserId,t.pub_id,t.pub_id pubId,t.context,t.collect_count,t.collect_count collectCount,t.pub_type,t.pub_type pubType,t.like_count,t.like_count likeCount,t.create_user_name,t.create_user_name createUserName,t.status_cd,t.status_cd statusCd,t.title,t.community_id,t.community_id communityId,t.read_count,t.read_count readCount,t.header_img,t.header_img headerImg 
-from community_publicity t 
-where 1 =1 
-<if test="createUserId !=null and createUserId != ''">
-   and t.create_user_id= #{createUserId}
-</if> 
-<if test="pubId !=null and pubId != ''">
-   and t.pub_id= #{pubId}
-</if> 
-<if test="context !=null and context != ''">
-   and t.context= #{context}
-</if> 
-<if test="collectCount !=null and collectCount != ''">
-   and t.collect_count= #{collectCount}
-</if> 
-<if test="pubType !=null and pubType != ''">
-   and t.pub_type= #{pubType}
-</if> 
-<if test="likeCount !=null and likeCount != ''">
-   and t.like_count= #{likeCount}
-</if> 
-<if test="createUserName !=null and createUserName != ''">
-   and t.create_user_name= #{createUserName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="title !=null and title != ''">
-   and t.title= #{title}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="readCount !=null and readCount != ''">
-   and t.read_count= #{readCount}
-</if> 
-<if test="headerImg !=null and headerImg != ''">
-   and t.header_img= #{headerImg}
-</if> 
-order by t.create_time desc
-<if test="page != -1 and page != null ">
-   limit #{page}, #{row}
-</if> 
+        select t.create_user_id,t.create_user_id createUserId,t.pub_id,t.pub_id
+        pubId,t.context,t.collect_count,t.collect_count collectCount,t.pub_type,t.pub_type
+        pubType,t.like_count,t.like_count likeCount,t.create_user_name,t.create_user_name
+        createUserName,t.status_cd,t.status_cd statusCd,t.title,t.community_id,t.community_id
+        communityId,t.read_count,t.read_count readCount,t.header_img,t.header_img headerImg,
+        t.create_time createTime
+        from community_publicity t
+        where 1 =1
+        <if test="createUserId !=null and createUserId != ''">
+            and t.create_user_id= #{createUserId}
+        </if>
+        <if test="pubId !=null and pubId != ''">
+            and t.pub_id= #{pubId}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="collectCount !=null and collectCount != ''">
+            and t.collect_count= #{collectCount}
+        </if>
+        <if test="pubType !=null and pubType != ''">
+            and t.pub_type= #{pubType}
+        </if>
+        <if test="likeCount !=null and likeCount != ''">
+            and t.like_count= #{likeCount}
+        </if>
+        <if test="createUserName !=null and createUserName != ''">
+            and t.create_user_name= #{createUserName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="title !=null and title != ''">
+            and t.title= #{title}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="readCount !=null and readCount != ''">
+            and t.read_count= #{readCount}
+        </if>
+        <if test="headerImg !=null and headerImg != ''">
+            and t.header_img= #{headerImg}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
 
     </select>
 
 
-
-
     <!-- 修改小区公示信息 add by wuxw 2018-07-03 -->
     <update id="updateCommunityPublicityInfo" parameterType="Map">
-        update  community_publicity t set t.status_cd = #{statusCd}
-<if test="newBId != null and newBId != ''">
-,t.b_id = #{newBId}
-</if> 
-<if test="createUserId !=null and createUserId != ''">
-, t.create_user_id= #{createUserId}
-</if> 
-<if test="context !=null and context != ''">
-, t.context= #{context}
-</if> 
-<if test="collectCount !=null and collectCount != ''">
-, t.collect_count= #{collectCount}
-</if> 
-<if test="pubType !=null and pubType != ''">
-, t.pub_type= #{pubType}
-</if> 
-<if test="likeCount !=null and likeCount != ''">
-, t.like_count= #{likeCount}
-</if> 
-<if test="createUserName !=null and createUserName != ''">
-, t.create_user_name= #{createUserName}
-</if> 
-<if test="title !=null and title != ''">
-, t.title= #{title}
-</if> 
-<if test="communityId !=null and communityId != ''">
-, t.community_id= #{communityId}
-</if> 
-<if test="readCount !=null and readCount != ''">
-, t.read_count= #{readCount}
-</if> 
-<if test="headerImg !=null and headerImg != ''">
-, t.header_img= #{headerImg}
-</if> 
- where 1=1 <if test="pubId !=null and pubId != ''">
-and t.pub_id= #{pubId}
-</if> 
+        update community_publicity t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="createUserId !=null and createUserId != ''">
+            , t.create_user_id= #{createUserId}
+        </if>
+        <if test="context !=null and context != ''">
+            , t.context= #{context}
+        </if>
+        <if test="collectCount !=null and collectCount != ''">
+            , t.collect_count= #{collectCount}
+        </if>
+        <if test="pubType !=null and pubType != ''">
+            , t.pub_type= #{pubType}
+        </if>
+        <if test="likeCount !=null and likeCount != ''">
+            , t.like_count= #{likeCount}
+        </if>
+        <if test="createUserName !=null and createUserName != ''">
+            , t.create_user_name= #{createUserName}
+        </if>
+        <if test="title !=null and title != ''">
+            , t.title= #{title}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        <if test="readCount !=null and readCount != ''">
+            , t.read_count= #{readCount}
+        </if>
+        <if test="headerImg !=null and headerImg != ''">
+            , t.header_img= #{headerImg}
+        </if>
+        where 1=1
+        <if test="pubId !=null and pubId != ''">
+            and t.pub_id= #{pubId}
+        </if>
 
     </update>
 
     <!-- 查询小区公示数量 add by wuxw 2018-07-03 -->
-     <select id="queryCommunityPublicitysCount" parameterType="Map" resultType="Map">
-        select  count(1) count 
-from community_publicity t 
-where 1 =1 
-<if test="createUserId !=null and createUserId != ''">
-   and t.create_user_id= #{createUserId}
-</if> 
-<if test="pubId !=null and pubId != ''">
-   and t.pub_id= #{pubId}
-</if> 
-<if test="context !=null and context != ''">
-   and t.context= #{context}
-</if> 
-<if test="collectCount !=null and collectCount != ''">
-   and t.collect_count= #{collectCount}
-</if> 
-<if test="pubType !=null and pubType != ''">
-   and t.pub_type= #{pubType}
-</if> 
-<if test="likeCount !=null and likeCount != ''">
-   and t.like_count= #{likeCount}
-</if> 
-<if test="createUserName !=null and createUserName != ''">
-   and t.create_user_name= #{createUserName}
-</if> 
-<if test="statusCd !=null and statusCd != ''">
-   and t.status_cd= #{statusCd}
-</if> 
-<if test="title !=null and title != ''">
-   and t.title= #{title}
-</if> 
-<if test="communityId !=null and communityId != ''">
-   and t.community_id= #{communityId}
-</if> 
-<if test="readCount !=null and readCount != ''">
-   and t.read_count= #{readCount}
-</if> 
-<if test="headerImg !=null and headerImg != ''">
-   and t.header_img= #{headerImg}
-</if> 
+    <select id="queryCommunityPublicitysCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from community_publicity t
+        where 1 =1
+        <if test="createUserId !=null and createUserId != ''">
+            and t.create_user_id= #{createUserId}
+        </if>
+        <if test="pubId !=null and pubId != ''">
+            and t.pub_id= #{pubId}
+        </if>
+        <if test="context !=null and context != ''">
+            and t.context= #{context}
+        </if>
+        <if test="collectCount !=null and collectCount != ''">
+            and t.collect_count= #{collectCount}
+        </if>
+        <if test="pubType !=null and pubType != ''">
+            and t.pub_type= #{pubType}
+        </if>
+        <if test="likeCount !=null and likeCount != ''">
+            and t.like_count= #{likeCount}
+        </if>
+        <if test="createUserName !=null and createUserName != ''">
+            and t.create_user_name= #{createUserName}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="title !=null and title != ''">
+            and t.title= #{title}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="readCount !=null and readCount != ''">
+            and t.read_count= #{readCount}
+        </if>
+        <if test="headerImg !=null and headerImg != ''">
+            and t.header_img= #{headerImg}
+        </if>
 
 
-     </select>
+    </select>
 
 </mapper>

+ 19 - 0
service-common/src/main/java/com/java110/common/cmd/publicity/ListCommunityPublicityCmd.java

@@ -20,7 +20,11 @@ import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.attendanceClassesStaff.AttendanceClassesStaffDto;
+import com.java110.dto.file.FileRelDto;
 import com.java110.intf.common.ICommunityPublicityV1InnerServiceSMO;
+import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
@@ -71,6 +75,8 @@ public class ListCommunityPublicityCmd extends Cmd {
 
         if (count > 0) {
             communityPublicityDtos = communityPublicityV1InnerServiceSMOImpl.queryCommunityPublicitys(communityPublicityDto);
+            //todo 刷入图片地址
+            freshImgUrl(communityPublicityDtos);
         } else {
             communityPublicityDtos = new ArrayList<>();
         }
@@ -81,4 +87,17 @@ public class ListCommunityPublicityCmd extends Cmd {
 
         cmdDataFlowContext.setResponseEntity(responseEntity);
     }
+
+    /**
+     * 刷入图片地址
+     * @param communityPublicityDtos
+     */
+    private void freshImgUrl(List<CommunityPublicityDto> communityPublicityDtos) {
+        String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN, "IMG_PATH");
+        for (CommunityPublicityDto communityPublicityDto : communityPublicityDtos) {
+            if (!communityPublicityDto.getHeaderImg().startsWith("http")) {
+                communityPublicityDto.setHeaderImg(imgUrl + communityPublicityDto.getHeaderImg());
+            }
+        }
+    }
 }