chengf
2025-08-14 be3ee34512e5c5b4a7d91484c7256c5fd5013675
合并小程序广告+合同费用主体变更2025/08/14
1个文件已修改
19个文件已添加
2026 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/QuertAdvertDto.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvert.java 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertDto.java 216 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertHistoryDto.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertSaveDto.java 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/SmallProgramAdvertHistoryServiceDaoImplMapper.xml 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/SmallProgramAdvertServiceDaoImplMapper.xml 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/common/ISmallProgramAdvertServiceSMO.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-acct/src/main/java/com/java110/acct/cmd/account/QueryCommunityOwnerAccountCmd.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/smallProgram/DeleteSmallProgramAdvertCmd.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/smallProgram/QuerySmallProgramAdvertCmd.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/smallProgram/QuerySmallProgramAllAdvertCmd.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/smallProgram/QuerySmallProgramPageAdvertCmd.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/smallProgram/SaveSmallProgramAdvertCmd.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/cmd/smallProgram/UpdateSmallProgramAdvertCmd.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/ISmallProgramAdvertHistoryServiceDao.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/ISmallProgramAdvertServiceDao.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/impl/SmallProgramAdvertHistoryServiceDaoImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/impl/SmallProgramAdvertServiceDaoImpl.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/smo/impl/SmallProgramAdvertServiceSMOImpl.java 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/QuertAdvertDto.java
New file
@@ -0,0 +1,70 @@
package com.java110.dto.smallProgramAdvert;
import com.java110.dto.PageDto;
import java.io.Serializable;
public class QuertAdvertDto extends PageDto implements Serializable {
    private String id;
    private String advertsId;
    private String advertsName;
    private String position;
    private Integer status;
    //排序方式 asc:正序 desc:倒序
    private String sort;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getAdvertsId() {
        return advertsId;
    }
    public void setAdvertsId(String advertsId) {
        this.advertsId = advertsId;
    }
    public String getAdvertsName() {
        return advertsName;
    }
    public void setAdvertsName(String advertsName) {
        this.advertsName = advertsName;
    }
    public String getPosition() {
        return position;
    }
    public void setPosition(String position) {
        this.position = position;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getSort() {
        return sort;
    }
    public void setSort(String sort) {
        this.sort = sort;
    }
}
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvert.java
New file
@@ -0,0 +1,204 @@
package com.java110.dto.smallProgramAdvert;
import com.java110.dto.PageDto;
import java.io.Serializable;
import java.util.Date;
public class SmallProgramAdvert implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    /**
     * 广告位
     */
    private String position;
    /**
     * 广告名称
     */
    private String advertsName;
    /**
     * 图片url
     */
    private String picUrl;
    /**
     * 广告url
     */
    private String url;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 供应商名称
     */
    private String supplierName;
    /**
     * 广告说明
     */
    private String desc;
    /**
     * 上线时间
     */
    private Date onlineTime;
    /**
     * 下线时间
     */
    private Date offlineTime;
    /**
     * 1:上线2:下线3:删除4:草稿
     */
    private Integer status;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 创建者id
     */
    private String createUserId;
    /**
     * 更新这id
     */
    private String updateUserId;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getPosition() {
        return position;
    }
    public void setPosition(String position) {
        this.position = position;
    }
    public String getAdvertsName() {
        return advertsName;
    }
    public void setAdvertsName(String advertsName) {
        this.advertsName = advertsName;
    }
    public String getPicUrl() {
        return picUrl;
    }
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public Date getOnlineTime() {
        return onlineTime;
    }
    public void setOnlineTime(Date onlineTime) {
        this.onlineTime = onlineTime;
    }
    public Date getOfflineTime() {
        return offlineTime;
    }
    public void setOfflineTime(Date offlineTime) {
        this.offlineTime = offlineTime;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getCreateUserId() {
        return createUserId;
    }
    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }
    public String getUpdateUserId() {
        return updateUserId;
    }
    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }
}
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertDto.java
New file
@@ -0,0 +1,216 @@
package com.java110.dto.smallProgramAdvert;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class SmallProgramAdvertDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    private String id;
    /**
     * 广告位
     */
    private String position;
    /**
     * 广告名称
     */
    private String advertsName;
    /**
     * 图片url
     */
    private String picUrl;
    /**
     * 广告url
     */
    private String url;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 供应商名称
     */
    private String supplierName;
    /**
     * 广告说明
     */
    private String desc;
    /**
     * 上线时间
     */
    private Date onlineTime;
    /**
     * 下线时间
     */
    private Date offlineTime;
    /**
     * 1:上线2:下线3:删除4:草稿
     */
    private Integer status;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 创建者id
     */
    private String createUserId;
    /**
     * 更新这id
     */
    private String updateUserId;
    private List<SmallProgramAdvertHistoryDto> historyList;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getPosition() {
        return position;
    }
    public void setPosition(String position) {
        this.position = position;
    }
    public String getAdvertsName() {
        return advertsName;
    }
    public void setAdvertsName(String advertsName) {
        this.advertsName = advertsName;
    }
    public String getPicUrl() {
        return picUrl;
    }
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public Date getOnlineTime() {
        return onlineTime;
    }
    public void setOnlineTime(Date onlineTime) {
        this.onlineTime = onlineTime;
    }
    public Date getOfflineTime() {
        return offlineTime;
    }
    public void setOfflineTime(Date offlineTime) {
        this.offlineTime = offlineTime;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    public String getCreateUserId() {
        return createUserId;
    }
    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }
    public String getUpdateUserId() {
        return updateUserId;
    }
    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }
    public List<SmallProgramAdvertHistoryDto> getHistoryList() {
        return historyList;
    }
    public void setHistoryList(List<SmallProgramAdvertHistoryDto> historyList) {
        this.historyList = historyList;
    }
}
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertHistoryDto.java
New file
@@ -0,0 +1,88 @@
package com.java110.dto.smallProgramAdvert;
import java.io.Serializable;
import java.util.Date;
public class SmallProgramAdvertHistoryDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * id
     */
    private String id;
    /**
     * 广告id
     */
    private String advertsId;
    /**
     * 内容
     */
    private String content;
    /**
     * 操作
     */
    private String operation;
    /**
     * 操作时间
     */
    private Date operateTime;
    /**
     * 操作者id
     */
    private String operateUserId;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getAdvertsId() {
        return advertsId;
    }
    public void setAdvertsId(String advertsId) {
        this.advertsId = advertsId;
    }
    public String getContent() {
        return content;
    }
    public void setContent(String content) {
        this.content = content;
    }
    public String getOperation() {
        return operation;
    }
    public void setOperation(String operation) {
        this.operation = operation;
    }
    public Date getOperateTime() {
        return operateTime;
    }
    public void setOperateTime(Date operateTime) {
        this.operateTime = operateTime;
    }
    public String getOperateUserId() {
        return operateUserId;
    }
    public void setOperateUserId(String operateUserId) {
        this.operateUserId = operateUserId;
    }
}
java110-bean/src/main/java/com/java110/dto/smallProgramAdvert/SmallProgramAdvertSaveDto.java
New file
@@ -0,0 +1,124 @@
package com.java110.dto.smallProgramAdvert;
import java.io.Serializable;
import java.util.Date;
public class SmallProgramAdvertSaveDto implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    /**
     * 广告位
     */
    private String position;
    /**
     * 广告名称
     */
    private String advertsName;
    /**
     * 图片url
     */
    private String picUrl;
    /**
     * 广告url
     */
    private String url;
    /**
     * 排序
     */
    private Integer sort;
    /**
     * 供应商名称
     */
    private String supplierName;
    /**
     * 广告说明
     */
    private String desc;
    /**
     * 1:上线2:下线3:删除4:草稿
     */
    private Integer status;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getPosition() {
        return position;
    }
    public void setPosition(String position) {
        this.position = position;
    }
    public String getAdvertsName() {
        return advertsName;
    }
    public void setAdvertsName(String advertsName) {
        this.advertsName = advertsName;
    }
    public String getPicUrl() {
        return picUrl;
    }
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
}
java110-db/src/main/resources/mapper/common/SmallProgramAdvertHistoryServiceDaoImplMapper.xml
New file
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="smallProgramAdvertHistoryServiceDaoImpl">
    <sql id="Base_Column_List">
        id,
        adverts_id as 'advertsId',
        content,
        operation,
        operate_time as 'operateTime',
        operate_user_id as 'operateUserId'
    </sql>
    <select id="selectHistoryByAdvertsId" parameterType="Map" resultType="Map">
        select
        <include refid="Base_Column_List" />
        from business_small_program_advertisement_history
        where adverts_id = #{advertsId}
    </select>
    <insert id="saveAdvertsHistory" parameterType="Map">
        insert into business_small_program_advertisement_history
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="advertsId != null">
                adverts_id,
            </if>
            <if test="content != null">
                content,
            </if>
            <if test="operation != null">
                operation,
            </if>
            <if test="operateTime != null">
                operate_time,
            </if>
            <if test="operateUserId != null">
                operate_user_id,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=VARCHAR},
            </if>
            <if test="advertsId != null">
                #{advertsId,jdbcType=VARCHAR},
            </if>
            <if test="content != null">
                #{content,jdbcType=VARCHAR},
            </if>
            <if test="operation != null">
                #{operation,jdbcType=VARCHAR},
            </if>
            <if test="operateTime != null">
                #{operateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="operateUserId != null">
                #{operateUserId,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
</mapper>
java110-db/src/main/resources/mapper/common/SmallProgramAdvertServiceDaoImplMapper.xml
New file
@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="smallProgramAdvertServiceDaoImpl">
    <sql id="Base_Column_List">
        id,
        `position`,
        adverts_name as 'advertsName',
        pic_url as 'picUrl',
        url,
        sort,
        supplier_name as 'supplierName',
        `desc`,
        online_time as 'onlineTime',
        offline_time as 'offlineTime',
        `status`,
        create_time as 'createTime',
        update_time as 'updateTime',
        create_user_id as 'createUserId',
        update_user_id as 'updateUserId'
    </sql>
    <select id="selectSmallProgramAdvertInfo" parameterType="Map" resultType="Map">
        select
        <include refid="Base_Column_List" />
        from business_small_program_advertisement
        where id = #{id}
    </select>
    <insert id="saveSmallProgramAdvertInfo" parameterType="Map">
        insert into business_small_program_advertisement
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="position != null">
                `position`,
            </if>
            <if test="advertsName != null">
                adverts_name,
            </if>
            <if test="picUrl != null">
                pic_url,
            </if>
            <if test="url != null">
                url,
            </if>
            <if test="sort != null">
                sort,
            </if>
            <if test="supplierName != null">
                supplier_name,
            </if>
            <if test="desc != null">
                `desc`,
            </if>
            <if test="onlineTime != null">
                online_time,
            </if>
            <if test="offlineTime != null">
                offline_time,
            </if>
            <if test="status != null">
                `status`,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
            <if test="createUserId != null">
                create_user_id,
            </if>
            <if test="updateUserId != null">
                update_user_id,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=VARCHAR},
            </if>
            <if test="position != null">
                #{position,jdbcType=VARCHAR},
            </if>
            <if test="advertsName != null">
                #{advertsName,jdbcType=VARCHAR},
            </if>
            <if test="picUrl != null">
                #{picUrl,jdbcType=VARCHAR},
            </if>
            <if test="url != null">
                #{url,jdbcType=VARCHAR},
            </if>
            <if test="sort != null">
                #{sort,jdbcType=INTEGER},
            </if>
            <if test="supplierName != null">
                #{supplierName,jdbcType=VARCHAR},
            </if>
            <if test="desc != null">
                #{desc,jdbcType=VARCHAR},
            </if>
            <if test="onlineTime != null">
                #{onlineTime,jdbcType=TIMESTAMP},
            </if>
            <if test="offlineTime != null">
                #{offlineTime,jdbcType=TIMESTAMP},
            </if>
            <if test="status != null">
                #{status,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createUserId != null">
                #{createUserId,jdbcType=VARCHAR},
            </if>
            <if test="updateUserId != null">
                #{updateUserId,jdbcType=VARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateSmallProgramAdvertInfo" parameterType="Map">
        update business_small_program_advertisement
        <set>
            <if test="position != null">
                `position` = #{position,jdbcType=VARCHAR},
            </if>
            <if test="advertsName != null">
                adverts_name = #{advertsName,jdbcType=VARCHAR},
            </if>
            <if test="picUrl != null">
                pic_url = #{picUrl,jdbcType=VARCHAR},
            </if>
            <if test="url != null">
                url = #{url,jdbcType=VARCHAR},
            </if>
            <if test="sort != null">
                sort = #{sort,jdbcType=INTEGER},
            </if>
            <if test="supplierName != null">
                supplier_name = #{supplierName,jdbcType=VARCHAR},
            </if>
            <if test="desc != null">
                `desc` = #{desc,jdbcType=VARCHAR},
            </if>
            <if test="status != null">
                `status` = #{status,jdbcType=INTEGER},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=TIMESTAMP},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=TIMESTAMP},
            </if>
            <if test="createUserId != null">
                create_user_id = #{createUserId,jdbcType=VARCHAR},
            </if>
            <if test="updateUserId != null">
                update_user_id = #{updateUserId,jdbcType=VARCHAR},
            </if>
            online_time = #{onlineTime,jdbcType=TIMESTAMP},
            offline_time = #{offlineTime,jdbcType=TIMESTAMP}
        </set>
        where id = #{id}
    </update>
    <select id="querySmallProgramAdvertsCount" parameterType="Map" resultType="Map">
        select count(1) count
        from business_small_program_advertisement
        where 1 = 1
        <if test="status != null">
            and `status` = #{status}
        </if>
        <if test="advertsId !=null and advertsId != ''">
            and  id like concat('%', #{advertsId},'%')
        </if>
        <if test="advertsName !=null and advertsName != ''">
            and  adverts_name like concat('%', #{advertsName},'%')
        </if>
        <if test="position !=null and position != ''">
            and  `position` like concat('%', #{position},'%')
        </if>
    </select>
    <select id="querySmallProgramAdvertInfoList" parameterType="Map" resultType="Map">
        select
        <include refid="Base_Column_List" />
        from business_small_program_advertisement
        where 1 = 1
        <if test="status != null">
            and `status` = #{status}
        </if>
        <if test="advertsId !=null and advertsId != ''">
            and  id like concat('%', #{advertsId},'%')
        </if>
        <if test="advertsName !=null and advertsName != ''">
            and  adverts_name like concat('%', #{advertsName},'%')
        </if>
        <if test="position !=null and position != ''">
            and  `position` like concat('%', #{position},'%')
        </if>
        order by `status` asc
        <if test="sort == 'asc'">
            ,update_time asc
        </if>
        <if test="sort == 'desc'">
            ,update_time desc
        </if>
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/common/ISmallProgramAdvertServiceSMO.java
New file
@@ -0,0 +1,70 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.intf.common;
import com.java110.dto.smallProgramAdvert.QuertAdvertDto;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvert;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvertDto;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvertSaveDto;
import com.java110.vo.ResultVo;
/**
 * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
public interface ISmallProgramAdvertServiceSMO {
    /**
     * 查询小程序广告列表
     * @param quertAdvertDto 数据对象分享
     * @return AdvertDto 对象数据
     */
    ResultVo querySmallAdverts(QuertAdvertDto quertAdvertDto);
    /**
     * 查询小程序广告列表
     * @param quertAdvertDto 数据对象分享
     * @return AdvertDto 对象数据
     */
    SmallProgramAdvertDto querySmallAdvertsInfo(QuertAdvertDto quertAdvertDto);
    /**
     * 保存小程序广告
     * @param smallProgramAdvert 数据对象分享
     * @return AdvertDto 对象数据
     */
    void saveSmallAdverts(SmallProgramAdvert smallProgramAdvert);
    /**
     * 更新小程序广告
     * @param smallProgramAdvertSaveDto 数据对象分享
     * @return AdvertDto 对象数据
     */
    void updateSmallAdverts(SmallProgramAdvertSaveDto smallProgramAdvertSaveDto,String userId);
    /**
     * 删除小程序广告
     * @param smallProgramAdvertSaveDto 数据对象分享
     * @return AdvertDto 对象数据
     */
    void deleteSmallAdverts(SmallProgramAdvertSaveDto smallProgramAdvertSaveDto,String userId);
}
service-acct/src/main/java/com/java110/acct/cmd/account/QueryCommunityOwnerAccountCmd.java
@@ -14,6 +14,7 @@
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.owner.OwnerDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.intf.acct.IAccountInnerServiceSMO;
import com.java110.intf.fee.IFeeInnerServiceSMO;
import com.java110.intf.store.IContractInnerServiceSMO;
import com.java110.intf.store.IContractPartyaInnerServiceSMO;
@@ -67,6 +68,10 @@
        super.validateProperty(context);
    }
    @Autowired
    private IAccountInnerServiceSMO accountInnerServiceSMOImpl;
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException {
@@ -100,8 +105,7 @@
            ResponseEntity<String> responseEntity = getAccountBMOImpl.queryOwnerAccount(accountDto, ownerDto);
            context.setResponseEntity(responseEntity);
        }else{
            ArrayList<AccountDto> accountDtos = new ArrayList<>();
            accountDtos.add(accountDto);
            List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto);
            ResultVo resultVo = new ResultVo((int) Math.ceil((double) 1 / (double) accountDto.getRow()), 1, accountDtos);
            ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
service-common/src/main/java/com/java110/common/cmd/smallProgram/DeleteSmallProgramAdvertCmd.java
New file
@@ -0,0 +1,82 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.common.cmd.smallProgram;
import com.alibaba.fastjson.JSONObject;
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.doc.annotation.Java110CmdDoc;
import com.java110.doc.annotation.Java110ParamDoc;
import com.java110.doc.annotation.Java110ParamsDoc;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvertSaveDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Resource;
/**
 * 类表述:查询
 * 服务编码:advert.listAdvert
 * 请求路劲:/app/advert.ListAdvert
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110CmdDoc(title = "删除小程序广告",
        description = "删除小程序广告",
        httpMethod = "post",
        url = "http://{ip}:{port}/app/smallProgram.deleteAdverts",
        resource = "communityDoc",
        serviceCode = "smallProgram.deleteAdverts",
        seq = 16
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "id", type = "string", length = 20, remark = "id"),
        @Java110ParamDoc(name = "status", type = "int", length = 255, remark = "1:上线2:下线3:删除4:草稿"),
})
@Java110Cmd(serviceCode = "smallProgram.deleteAdverts")
public class DeleteSmallProgramAdvertCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(DeleteSmallProgramAdvertCmd.class);
    @Resource
    private ISmallProgramAdvertServiceSMO smallProgramAdvertService;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "id", "id不能为空");
        Assert.hasKeyAndValue(reqJson, "status", "状态不能为空");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        String userId = cmdDataFlowContext.getReqHeaders().get("user-id");
        SmallProgramAdvertSaveDto smallProgramAdvertSaveDto = BeanConvertUtil.covertBean(reqJson, SmallProgramAdvertSaveDto.class);
        smallProgramAdvertService.deleteSmallAdverts(smallProgramAdvertSaveDto,userId);
        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(ResultVo.CODE_OK, "删除成功"));
    }
}
service-common/src/main/java/com/java110/common/cmd/smallProgram/QuerySmallProgramAdvertCmd.java
New file
@@ -0,0 +1,84 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.common.cmd.smallProgram;
import com.alibaba.fastjson.JSONObject;
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.doc.annotation.Java110CmdDoc;
import com.java110.doc.annotation.Java110ParamDoc;
import com.java110.doc.annotation.Java110ParamsDoc;
import com.java110.dto.smallProgramAdvert.QuertAdvertDto;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvert;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvertDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import javax.annotation.Resource;
/**
 * 类表述:查询
 * 服务编码:advert.listAdvert
 * 请求路劲:/app/advert.ListAdvert
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110CmdDoc(title = "查询小程序广告详情",
        description = "查询小程序广告详情",
        httpMethod = "get",
        url = "http://{ip}:{port}/app/smallProgram.adverts",
        resource = "communityDoc",
        author = "吴学文",
        serviceCode = "smallProgram.adverts",
        seq = 16
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "id", type = "string", length = 11,  remark = "id"),
})
@Java110Cmd(serviceCode = "smallProgram.adverts")
public class QuerySmallProgramAdvertCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(QuerySmallProgramAdvertCmd.class);
    @Resource
    private ISmallProgramAdvertServiceSMO smallProgramAdvertService;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "id", "id不能为空");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        QuertAdvertDto quertAdvertDto = BeanConvertUtil.covertBean(reqJson, QuertAdvertDto.class);
        SmallProgramAdvertDto smallProgramAdvert = smallProgramAdvertService.querySmallAdvertsInfo(quertAdvertDto);
        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(ResultVo.CODE_OK, "查询成功",smallProgramAdvert));
    }
}
service-common/src/main/java/com/java110/common/cmd/smallProgram/QuerySmallProgramAllAdvertCmd.java
New file
@@ -0,0 +1,85 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.common.cmd.smallProgram;
import com.alibaba.fastjson.JSONObject;
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.doc.annotation.Java110CmdDoc;
import com.java110.doc.annotation.Java110ParamDoc;
import com.java110.doc.annotation.Java110ParamsDoc;
import com.java110.dto.smallProgramAdvert.QuertAdvertDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import javax.annotation.Resource;
/**
 * 类表述:查询
 * 服务编码:advert.listAdvert
 * 请求路劲:/app/advert.ListAdvert
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110CmdDoc(title = "小程序查询小程序广告",
        description = "小程序查询小程序广告",
        httpMethod = "get",
        url = "http://{ip}:{port}/app/smallProgram.advertsListApp",
        resource = "communityDoc",
        serviceCode = "smallProgram.advertsListApp",
        seq = 16
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "position", type = "string", length = 11,  remark = "广告位"),
})
@Java110Cmd(serviceCode = "smallProgram.advertsListApp")
public class QuerySmallProgramAllAdvertCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(QuerySmallProgramAllAdvertCmd.class);
    @Resource
    private ISmallProgramAdvertServiceSMO smallProgramAdvertService;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "position", "广告位");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        QuertAdvertDto quertAdvertDto = BeanConvertUtil.covertBean(reqJson, QuertAdvertDto.class);
        quertAdvertDto.setPage(1);
        quertAdvertDto.setRow(10000);
        quertAdvertDto.setStatus(1);
        ResultVo resultVo = smallProgramAdvertService.querySmallAdverts(quertAdvertDto);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}
service-common/src/main/java/com/java110/common/cmd/smallProgram/QuerySmallProgramPageAdvertCmd.java
New file
@@ -0,0 +1,88 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.common.cmd.smallProgram;
import com.alibaba.fastjson.JSONObject;
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.doc.annotation.*;
import com.java110.dto.smallProgramAdvert.QuertAdvertDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import javax.annotation.Resource;
/**
 * 类表述:查询
 * 服务编码:advert.listAdvert
 * 请求路劲:/app/advert.ListAdvert
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110CmdDoc(title = "查询小程序广告",
        description = "查询小程序广告",
        httpMethod = "get",
        url = "http://{ip}:{port}/app/smallProgram.advertsList",
        resource = "communityDoc",
        author = "吴学文",
        serviceCode = "smallProgram.advertsList",
        seq = 16
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "page", type = "int", length = 11, remark = "页数"),
        @Java110ParamDoc(name = "row", type = "int", length = 11, remark = "行数"),
        @Java110ParamDoc(name = "advertsId", type = "string", length = 11,  remark = "广告id"),
        @Java110ParamDoc(name = "advertsName", type = "string", length = 11,  remark = "广告名称"),
        @Java110ParamDoc(name = "position", type = "string", length = 11,  remark = "广告位"),
        @Java110ParamDoc(name = "sort", type = "string", length = 11,  remark = "排序规则"),
        @Java110ParamDoc(name = "status", type = "int", length = 11,  remark = "1:上线2:下线3:删除4:草稿"),
})
@Java110Cmd(serviceCode = "smallProgram.advertsList")
public class QuerySmallProgramPageAdvertCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(QuerySmallProgramPageAdvertCmd.class);
    @Resource
    private ISmallProgramAdvertServiceSMO smallProgramAdvertService;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
        Assert.hasKeyAndValue(reqJson, "sort", "排序规则不能为空");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        QuertAdvertDto quertAdvertDto = BeanConvertUtil.covertBean(reqJson, QuertAdvertDto.class);
        ResultVo resultVo = smallProgramAdvertService.querySmallAdverts(quertAdvertDto);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
        cmdDataFlowContext.setResponseEntity(responseEntity);
    }
}
service-common/src/main/java/com/java110/common/cmd/smallProgram/SaveSmallProgramAdvertCmd.java
New file
@@ -0,0 +1,114 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.common.cmd.smallProgram;
import com.alibaba.fastjson.JSONObject;
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.core.factory.GenerateCodeFactory;
import com.java110.doc.annotation.Java110CmdDoc;
import com.java110.doc.annotation.Java110ParamDoc;
import com.java110.doc.annotation.Java110ParamsDoc;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvert;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvertSaveDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.Date;
/**
 * 类表述:查询
 * 服务编码:advert.listAdvert
 * 请求路劲:/app/advert.ListAdvert
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110CmdDoc(title = "保存小程序广告",
        description = "保存小程序广告",
        httpMethod = "post",
        url = "http://{ip}:{port}/app/smallProgram.saveAdverts",
        resource = "communityDoc",
        serviceCode = "smallProgram.saveAdverts",
        seq = 16
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "id", type = "string", length = 20, remark = "id"),
        @Java110ParamDoc(name = "position", type = "string", length = 255, remark = "广告位"),
        @Java110ParamDoc(name = "advertsName", type = "string", length = 255, remark = "广告名称"),
        @Java110ParamDoc(name = "picUrl", type = "string", length = 255, remark = "图片url"),
        @Java110ParamDoc(name = "url", type = "string", length = 255, remark = "查询关键字"),
        @Java110ParamDoc(name = "sort", type = "int", length = 255, remark = "排序"),
        @Java110ParamDoc(name = "supplierName", type = "string", length = 255, remark = "供应商名称"),
        @Java110ParamDoc(name = "desc", type = "string", length = 255, remark = "广告说明"),
})
@Java110Cmd(serviceCode = "smallProgram.saveAdverts")
public class SaveSmallProgramAdvertCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(SaveSmallProgramAdvertCmd.class);
    @Resource
    private ISmallProgramAdvertServiceSMO smallProgramAdvertService;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "position", "广告位不能为空");
        Assert.hasKeyAndValue(reqJson, "advertsName", "广告名称不能为空");
        Assert.hasKeyAndValue(reqJson, "picUrl", "图片不能为空");
        Assert.hasKeyAndValue(reqJson, "sort", "排序不能为空");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        String userId = cmdDataFlowContext.getReqHeaders().get("user-id");
        SmallProgramAdvertSaveDto smallProgramAdvertSaveDto = BeanConvertUtil.covertBean(reqJson, SmallProgramAdvertSaveDto.class);
        String advertId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_advertId);
        SmallProgramAdvert smallProgramAdvert = new SmallProgramAdvert();
        smallProgramAdvert.setId(advertId);
        if(StringUtils.isEmpty(smallProgramAdvertSaveDto.getPosition())){
            smallProgramAdvert.setPosition("业主小程序首页轮播图");
        }else{
            smallProgramAdvert.setPosition(smallProgramAdvertSaveDto.getPosition());
        }
        smallProgramAdvert.setAdvertsName(smallProgramAdvertSaveDto.getAdvertsName());
        smallProgramAdvert.setPicUrl(smallProgramAdvertSaveDto.getPicUrl());
        smallProgramAdvert.setUrl(smallProgramAdvertSaveDto.getUrl());
        smallProgramAdvert.setSort(smallProgramAdvertSaveDto.getSort());
        smallProgramAdvert.setSupplierName(smallProgramAdvertSaveDto.getSupplierName());
        //初始状态为草稿
        smallProgramAdvert.setStatus(4);
        smallProgramAdvert.setDesc(smallProgramAdvertSaveDto.getDesc());
        smallProgramAdvert.setCreateTime(new Date());
        smallProgramAdvert.setUpdateTime(new Date());
        smallProgramAdvert.setCreateUserId(userId);
        smallProgramAdvert.setUpdateUserId(userId);
        smallProgramAdvertService.saveSmallAdverts(smallProgramAdvert);
        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"));
    }
}
service-common/src/main/java/com/java110/common/cmd/smallProgram/UpdateSmallProgramAdvertCmd.java
New file
@@ -0,0 +1,95 @@
/*
 * Copyright 2017-2020 吴学文 and java110 team.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.java110.common.cmd.smallProgram;
import com.alibaba.fastjson.JSONObject;
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.doc.annotation.Java110CmdDoc;
import com.java110.doc.annotation.Java110ParamDoc;
import com.java110.doc.annotation.Java110ParamsDoc;
import com.java110.dto.smallProgramAdvert.QuertAdvertDto;
import com.java110.dto.smallProgramAdvert.SmallProgramAdvertSaveDto;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.annotation.Resource;
/**
 * 类表述:查询
 * 服务编码:advert.listAdvert
 * 请求路劲:/app/advert.ListAdvert
 * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com
 * open source address: https://gitee.com/wuxw7/MicroCommunity
 * 官网:http://www.homecommunity.cn
 * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下
 * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行
 */
@Java110CmdDoc(title = "更新小程序广告",
        description = "更新小程序广告",
        httpMethod = "post",
        url = "http://{ip}:{port}/app/smallProgram.updateAdverts",
        resource = "communityDoc",
        serviceCode = "smallProgram.updateAdverts",
        seq = 16
)
@Java110ParamsDoc(params = {
        @Java110ParamDoc(name = "id", type = "long", length = 20, remark = "id"),
        @Java110ParamDoc(name = "position", type = "string", length = 255, remark = "广告位"),
        @Java110ParamDoc(name = "advertsName", type = "string", length = 255, remark = "广告名称"),
        @Java110ParamDoc(name = "picUrl", type = "string", length = 255, remark = "图片url"),
        @Java110ParamDoc(name = "url", type = "string", length = 255, remark = "查询关键字"),
        @Java110ParamDoc(name = "sort", type = "int", length = 255, remark = "排序"),
        @Java110ParamDoc(name = "supplierName", type = "string", length = 255, remark = "供应商名称"),
        @Java110ParamDoc(name = "desc", type = "string", length = 255, remark = "广告说明"),
        @Java110ParamDoc(name = "status", type = "int", length = 255, remark = "1:上线2:下线3:删除4:草稿"),
})
@Java110Cmd(serviceCode = "smallProgram.updateAdverts")
public class UpdateSmallProgramAdvertCmd extends Cmd {
    private static Logger logger = LoggerFactory.getLogger(UpdateSmallProgramAdvertCmd.class);
    @Resource
    private ISmallProgramAdvertServiceSMO smallProgramAdvertService;
    @Override
    public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "id", "id不能为空");
    }
    @Override
    public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
        String userId = cmdDataFlowContext.getReqHeaders().get("user-id");
        SmallProgramAdvertSaveDto smallProgramAdvertSaveDto = BeanConvertUtil.covertBean(reqJson, SmallProgramAdvertSaveDto.class);
        smallProgramAdvertService.updateSmallAdverts(smallProgramAdvertSaveDto,userId);
        cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(ResultVo.CODE_OK, "更新成功"));
    }
}
service-common/src/main/java/com/java110/common/dao/ISmallProgramAdvertHistoryServiceDao.java
New file
@@ -0,0 +1,37 @@
package com.java110.common.dao;
import com.java110.utils.exception.DAOException;
import java.util.List;
import java.util.Map;
/**
 * 广告信息组件内部之间使用,没有给外围系统提供服务能力
 * 广告信息服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface ISmallProgramAdvertHistoryServiceDao {
    /**
     * 保存 广告信息信息
     *
     * @param businessAdvertInfo 广告信息信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveSmallProgramAdvertInfo(Map businessAdvertInfo) throws DAOException;
    /**
     * 查询广告信息信息
     * 根据bId 查询广告信息信息
     *
     * @param info bId 信息
     * @return 广告信息信息
     * @throws DAOException DAO异常
     */
    List<Map> querySmallProgramAdvertInfoList(String advertsId) throws DAOException;
}
service-common/src/main/java/com/java110/common/dao/ISmallProgramAdvertServiceDao.java
New file
@@ -0,0 +1,61 @@
package com.java110.common.dao;
import com.java110.utils.exception.DAOException;
import java.util.List;
import java.util.Map;
/**
 * 广告信息组件内部之间使用,没有给外围系统提供服务能力
 * 广告信息服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface ISmallProgramAdvertServiceDao {
    /**
     * 保存 广告信息信息
     *
     * @param businessAdvertInfo 广告信息信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveSmallProgramAdvertInfo(Map businessAdvertInfo) throws DAOException;
    /**
     * 查询广告信息信息(business过程)
     * 根据bId 查询广告信息信息
     *
     * @param info bId 信息
     * @return 广告信息信息
     * @throws DAOException DAO异常
     */
    Map queryBusinessAdvertInfo(Map info) throws DAOException;
    /**
     * 查询广告信息信息
     * 根据bId 查询广告信息信息
     *
     * @param info bId 信息
     * @return 广告信息信息
     * @throws DAOException DAO异常
     */
    List<Map> querySmallProgramAdvertInfoList(Map info) throws DAOException;
    /**
     * 修改广告信息信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    void updateSmallProgramAdvertInfo(Map info) throws DAOException;
    /**
     * 查询广告信息总数
     *
     * @param info 广告信息信息
     * @return 广告信息数量
     */
    int querySmallProgramAdvertsCount(Map info);
}
service-common/src/main/java/com/java110/common/dao/impl/SmallProgramAdvertHistoryServiceDaoImpl.java
New file
@@ -0,0 +1,53 @@
package com.java110.common.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.common.dao.ISmallProgramAdvertHistoryServiceDao;
import com.java110.common.dao.ISmallProgramAdvertServiceDao;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.core.log.LoggerFactory;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 广告信息服务 与数据库交互
 * Created by wuxw on 2017/4/5.
 */
@Service("smallProgramAdvertHistoryServiceDaoImpl")
public class SmallProgramAdvertHistoryServiceDaoImpl extends BaseServiceDao implements ISmallProgramAdvertHistoryServiceDao {
    private static Logger logger = LoggerFactory.getLogger(SmallProgramAdvertHistoryServiceDaoImpl.class);
    /**
     * 广告信息信息封装
     *
     * @param info 广告信息信息 封装
     * @throws DAOException DAO异常
     */
    @Override
    public void saveSmallProgramAdvertInfo(Map info) throws DAOException {
        int saveFlag = sqlSessionTemplate.insert("smallProgramAdvertHistoryServiceDaoImpl.saveAdvertsHistory", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小程序广告日志信息数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询广告信息信息
     *
     * @param advertsId bId 信息
     * @return 广告信息信息
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> querySmallProgramAdvertInfoList(String advertsId) throws DAOException {
        List<Map> businessAdvertInfos = sqlSessionTemplate.selectList("smallProgramAdvertHistoryServiceDaoImpl.selectHistoryByAdvertsId", advertsId);
        return businessAdvertInfos;
    }
}
service-common/src/main/java/com/java110/common/dao/impl/SmallProgramAdvertServiceDaoImpl.java
New file
@@ -0,0 +1,97 @@
package com.java110.common.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.common.dao.IAdvertServiceDao;
import com.java110.common.dao.ISmallProgramAdvertServiceDao;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.core.log.LoggerFactory;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
import org.slf4j.Logger;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * 广告信息服务 与数据库交互
 * Created by wuxw on 2017/4/5.
 */
@Service("smallProgramAdvertServiceDaoImpl")
public class SmallProgramAdvertServiceDaoImpl extends BaseServiceDao implements ISmallProgramAdvertServiceDao {
    private static Logger logger = LoggerFactory.getLogger(SmallProgramAdvertServiceDaoImpl.class);
    /**
     * 广告信息信息封装
     *
     * @param businessAdvertInfo 广告信息信息 封装
     * @throws DAOException DAO异常
     */
    @Override
    public void saveSmallProgramAdvertInfo(Map businessAdvertInfo) throws DAOException {
        int saveFlag = sqlSessionTemplate.insert("smallProgramAdvertServiceDaoImpl.saveSmallProgramAdvertInfo", businessAdvertInfo);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小程序广告信息数据失败:" + JSONObject.toJSONString(businessAdvertInfo));
        }
    }
    /**
     * 查询广告信息信息
     *
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public Map queryBusinessAdvertInfo(Map info) throws DAOException {
        Map businessAdvertInfos = sqlSessionTemplate.selectOne("smallProgramAdvertServiceDaoImpl.selectSmallProgramAdvertInfo", info);
        return businessAdvertInfos;
    }
    /**
     * 修改广告信息信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public void updateSmallProgramAdvertInfo(Map info) throws DAOException {
        logger.debug("修改广告信息信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.update("smallProgramAdvertServiceDaoImpl.updateSmallProgramAdvertInfo", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小程序广告信息信息数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询广告信息数量
     *
     * @param info 广告信息信息
     * @return 广告信息数量
     */
    @Override
    public int querySmallProgramAdvertsCount(Map info) {
        logger.debug("查询广告信息数据 入参 info : {}", info);
        List<Map> businessAdvertInfos = sqlSessionTemplate.selectList("smallProgramAdvertServiceDaoImpl.querySmallProgramAdvertsCount", info);
        if (businessAdvertInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessAdvertInfos.get(0).get("count").toString());
    }
    /**
     * 查询广告信息信息
     *
     * @param info bId 信息
     * @return 广告信息信息
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> querySmallProgramAdvertInfoList(Map info) throws DAOException {
        List<Map> businessAdvertInfos = sqlSessionTemplate.selectList("smallProgramAdvertServiceDaoImpl.querySmallProgramAdvertInfoList", info);
        return businessAdvertInfos;
    }
}
service-common/src/main/java/com/java110/common/smo/impl/SmallProgramAdvertServiceSMOImpl.java
New file
@@ -0,0 +1,160 @@
package com.java110.common.smo.impl;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.java110.common.dao.ISmallProgramAdvertHistoryServiceDao;
import com.java110.common.dao.ISmallProgramAdvertServiceDao;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.PageDto;
import com.java110.dto.smallProgramAdvert.*;
import com.java110.intf.common.ISmallProgramAdvertServiceSMO;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.BusinessException;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import static com.java110.utils.util.BeanConvertUtil.covertBeanList;
/**
 * @ClassName FloorInnerServiceSMOImpl
 * @Description 广告信息内部服务实现类
 * @Author wuxw
 * @Date 2019/4/24 9:20
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@RestController
public class SmallProgramAdvertServiceSMOImpl extends BaseServiceSMO implements ISmallProgramAdvertServiceSMO {
    @Resource
    private ISmallProgramAdvertServiceDao smallProgramAdvertServiceDao;
    @Resource
    private ISmallProgramAdvertHistoryServiceDao smallProgramAdvertHistoryServiceDao;
    @Override
    public ResultVo querySmallAdverts(QuertAdvertDto quertAdvertDto) {
        //校验是否传了 分页信息
        int page = quertAdvertDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            quertAdvertDto.setPage((page - 1) * quertAdvertDto.getRow());
        }
        int count = smallProgramAdvertServiceDao.querySmallProgramAdvertsCount(BeanConvertUtil.beanCovertMap(quertAdvertDto));
        List<SmallProgramAdvertDto> smallProgramAdvertListDtoList = Lists.newArrayList();
        if (count > 0) {
            smallProgramAdvertListDtoList = BeanConvertUtil.covertBeanList(smallProgramAdvertServiceDao.querySmallProgramAdvertInfoList(BeanConvertUtil.beanCovertMap(quertAdvertDto)), SmallProgramAdvertDto.class);
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) quertAdvertDto.getRow()), count, smallProgramAdvertListDtoList);
        return resultVo;
    }
    @Override
    public SmallProgramAdvertDto querySmallAdvertsInfo(QuertAdvertDto quertAdvertDto) {
        Map map = smallProgramAdvertServiceDao.queryBusinessAdvertInfo(BeanConvertUtil.beanCovertMap(quertAdvertDto));
        if(map != null){
            SmallProgramAdvertDto smallProgramAdvert = BeanConvertUtil.covertBean(map,SmallProgramAdvertDto.class);
            List<Map> historyMap = smallProgramAdvertHistoryServiceDao.querySmallProgramAdvertInfoList(smallProgramAdvert.getId());
            List<SmallProgramAdvertHistoryDto> historyList = BeanConvertUtil.covertBeanList(historyMap, SmallProgramAdvertHistoryDto.class);
            smallProgramAdvert.setHistoryList(historyList);
            return smallProgramAdvert;
        }else{
            throw new BusinessException(ResponseConstant.RESULT_PARAM_ERROR, "无此广告信息");
        }
    }
    @Override
    public void saveSmallAdverts(SmallProgramAdvert smallProgramAdvert) {
        smallProgramAdvertServiceDao.saveSmallProgramAdvertInfo(BeanConvertUtil.beanCovertMap(smallProgramAdvert));
    }
    @Override
    @Transactional
    public void updateSmallAdverts(SmallProgramAdvertSaveDto smallProgramAdvertSaveDto,String userId) {
        Map map = smallProgramAdvertServiceDao.queryBusinessAdvertInfo(BeanConvertUtil.beanCovertMap(smallProgramAdvertSaveDto));
        if(map != null){
            SmallProgramAdvert smallProgramAdvert = BeanConvertUtil.covertBean(map,SmallProgramAdvert.class);
            String operation = "更新广告";
            if(smallProgramAdvertSaveDto.getStatus() != null){
                smallProgramAdvert.setStatus(smallProgramAdvertSaveDto.getStatus());
                if(smallProgramAdvertSaveDto.getStatus() == 2){
                    operation = "下线广告";
                    smallProgramAdvert.setOfflineTime(new Date());
                    smallProgramAdvert.setOnlineTime(null);
                }else if(smallProgramAdvertSaveDto.getStatus() == 1){
                    operation = "上线广告";
                    smallProgramAdvert.setOnlineTime(new Date());
                    smallProgramAdvert.setOfflineTime(null);
                }
            }
            if(!StringUtils.isEmpty(smallProgramAdvertSaveDto.getPosition())){
                smallProgramAdvert.setPosition(smallProgramAdvertSaveDto.getPosition());
            }
            if(!StringUtils.isEmpty(smallProgramAdvertSaveDto.getAdvertsName())){
                smallProgramAdvert.setAdvertsName(smallProgramAdvertSaveDto.getAdvertsName());
            }
            if(!StringUtils.isEmpty(smallProgramAdvertSaveDto.getPicUrl())){
                smallProgramAdvert.setPicUrl(smallProgramAdvertSaveDto.getPicUrl());
            }
            if(!StringUtils.isEmpty(smallProgramAdvertSaveDto.getUrl())){
                smallProgramAdvert.setUrl(smallProgramAdvertSaveDto.getUrl());
            }
            if(smallProgramAdvertSaveDto.getSort() != null){
                smallProgramAdvert.setSort(smallProgramAdvertSaveDto.getSort());
            }
            if(!StringUtils.isEmpty(smallProgramAdvertSaveDto.getSupplierName())){
                smallProgramAdvert.setSupplierName(smallProgramAdvertSaveDto.getSupplierName());
            }
            if(!StringUtils.isEmpty(smallProgramAdvertSaveDto.getDesc())){
                smallProgramAdvert.setDesc(smallProgramAdvertSaveDto.getDesc());
            }
            smallProgramAdvert.setUpdateTime(new Date());
            smallProgramAdvert.setUpdateUserId(userId);
            smallProgramAdvertServiceDao.updateSmallProgramAdvertInfo(BeanConvertUtil.beanCovertMap(smallProgramAdvert));
            //保存更新日志
            saveHistory(BeanConvertUtil.covertBean(map,SmallProgramAdvert.class),userId,operation);
        }else{
            throw new BusinessException(ResponseConstant.RESULT_PARAM_ERROR, "无此广告信息");
        }
    }
    @Override
    @Transactional
    public void deleteSmallAdverts(SmallProgramAdvertSaveDto smallProgramAdvertSaveDto, String userId) {
        Map map = smallProgramAdvertServiceDao.queryBusinessAdvertInfo(BeanConvertUtil.beanCovertMap(smallProgramAdvertSaveDto));
        if(map != null){
            SmallProgramAdvert smallProgramAdvert = BeanConvertUtil.covertBean(map,SmallProgramAdvert.class);
            smallProgramAdvert.setUpdateTime(new Date());
            smallProgramAdvert.setUpdateUserId(userId);
            smallProgramAdvert.setStatus(smallProgramAdvertSaveDto.getStatus());
            smallProgramAdvertServiceDao.updateSmallProgramAdvertInfo(BeanConvertUtil.beanCovertMap(smallProgramAdvert));
            //保存更新日志
            saveHistory(BeanConvertUtil.covertBean(map,SmallProgramAdvert.class),userId,"删除广告");
        }else{
            throw new BusinessException(ResponseConstant.RESULT_PARAM_ERROR, "无此广告信息");
        }
    }
    private void saveHistory(SmallProgramAdvert smallProgramAdvert,String userId ,String operation){
        SmallProgramAdvertHistoryDto historyDto = new SmallProgramAdvertHistoryDto();
        String historyId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_advertId);
        historyDto.setId(historyId);
        historyDto.setAdvertsId(smallProgramAdvert.getId());
        historyDto.setOperateTime(new Date());
        historyDto.setOperateUserId(userId);
        historyDto.setContent(JSONObject.toJSONString(smallProgramAdvert));
        historyDto.setOperation(operation);
        smallProgramAdvertHistoryServiceDao.saveSmallProgramAdvertInfo(BeanConvertUtil.beanCovertMap(historyDto));
    }
}