lidongdong
2023-09-06 bfab22c1eba23867c3448ea397dd8d00884b6412
解决新增配置报错
6个文件已添加
1个文件已修改
302 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCommunityDiscountVO.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerMerchantApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerCommunityDiscountDao.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCommunityDiscount.java 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerCommunityDiscountService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCommunityDiscountServiceImpl.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCommunityDiscountMapper.xml 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/VolunteerCommunityDiscountVO.java
New file
@@ -0,0 +1,47 @@
package com.panzhihua.common.model.vos.community;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("社区折扣")
public class VolunteerCommunityDiscountVO {
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 折扣
     */
    @ApiModelProperty(value = "折扣")
    private String discount;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date creationTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * 社区id
     */
    @ApiModelProperty(value = "社区id")
    private String communityId;
    @ApiModelProperty(value = "积分")
    private String integral;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerMerchantApi.java
@@ -267,7 +267,7 @@
    public R Configinsertvo(@RequestBody VolunteerCommunityConfigVO item)
    {
        R<VolunteerCommunityConfig> voR=vccService.getData(item.getCommunityId());
        if(voR==null)
        if(voR.getData()==null ||  StringUtils.isEmpty(voR.getData().getCommunityId()))
        {
            return vccService.insertvo(item);
        }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/VolunteerCommunityDiscountDao.java
New file
@@ -0,0 +1,39 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.vos.community.VolunteerCommunityDiscountVO;
import com.panzhihua.common.model.vos.community.VolunteerTypeVO;
import com.panzhihua.service_community.entity.VolunteerCommunityDiscount;
import com.panzhihua.service_community.entity.VolunteerType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface VolunteerCommunityDiscountDao extends BaseMapper<VolunteerCommunityDiscount>
{
    /**
     * 分页查询
     * @param
     * @return
     */
    List<VolunteerCommunityDiscount> getList(@Param("communityId") String communityId);
    /**
     * 新增
     * @param
     * @return
     */
    int insert(@Param("item") VolunteerCommunityDiscountVO item);
    int update(@Param("item") VolunteerCommunityDiscountVO item);
    int delete(@Param("id") String id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/VolunteerCommunityDiscount.java
New file
@@ -0,0 +1,57 @@
package com.panzhihua.service_community.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("社区折扣")
public class VolunteerCommunityDiscount implements Serializable {
    private static final long serialVersionUID = -70884515430727555L;
    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 折扣
     */
    @ApiModelProperty(value = "折扣")
    private String discount;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date creationTime;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * 社区id
     */
    @ApiModelProperty(value = "社区id")
    private String communityId;
    @ApiModelProperty(value = "积分")
    private String integral;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/VolunteerCommunityDiscountService.java
New file
@@ -0,0 +1,31 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.community.VolunteerCommunityDiscountVO;
import com.panzhihua.service_community.entity.VolunteerCommunityDiscount;
import java.util.List;
public interface VolunteerCommunityDiscountService extends IService<VolunteerCommunityDiscount>
{
    /**
     * 分页查询
     * @param
     * @return
     */
    List<VolunteerCommunityDiscount> getList(String communityId);
    /**
     * 新增
     * @param
     * @return
     */
    int insert(VolunteerCommunityDiscountVO item);
    int update(VolunteerCommunityDiscountVO item);
    int delete(String id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCommunityDiscountServiceImpl.java
New file
@@ -0,0 +1,39 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.community.VolunteerCommunityDiscountVO;
import com.panzhihua.service_community.dao.VolunteerCommunityDiscountDao;
import com.panzhihua.service_community.entity.VolunteerCommunityDiscount;
import com.panzhihua.service_community.service.VolunteerCommunityDiscountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class VolunteerCommunityDiscountServiceImpl extends ServiceImpl<VolunteerCommunityDiscountDao,
        VolunteerCommunityDiscount> implements VolunteerCommunityDiscountService
{
    @Override
    public List<VolunteerCommunityDiscount> getList(String communityId) {
        return baseMapper.getList(communityId);
    }
    @Override
    public int insert(VolunteerCommunityDiscountVO item) {
        return baseMapper.insert(item);
    }
    @Override
    public int update(VolunteerCommunityDiscountVO item) {
        return baseMapper.update(item);
    }
    @Override
    public int delete(String id) {
        return baseMapper.delete(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/VolunteerCommunityDiscountMapper.xml
New file
@@ -0,0 +1,87 @@
<?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="com.panzhihua.service_community.dao.VolunteerCommunityDiscountDao">
    <resultMap type="com.panzhihua.service_community.entity.VolunteerCommunityDiscount" id="VolunteerCommunityDiscountMap">
        <result property="id" column="id" />
        <result property="creationTime" column="creation_time" />
        <result property="updateTime" column="update_time" />
        <result property="communityId" column="community_id" />
        <result property="integral" column="integral" />
        <result property="discount" column="discount" />
    </resultMap>
    <!-- 分页查询 -->
    <select id="getList" resultMap="VolunteerCommunityDiscountMap">
        select
            id,
            community_id,
            discount,
            integral,
            creation_time,
            update_time
        from volunteer_community_discount
        where community_id=#{communityId}
        order by creation_time desc
    </select>
    <insert id="insert">
        insert into volunteer_community_discount
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="item.id != null">
                id,
            </if>
            <if test="item.communityId != null">
                community_id,
            </if>
            <if test="item.discount != null">
                discount,
            </if>
            <if test="item.integral != null">
                integral,
            </if>
            creation_time
        </trim>
        values
        <trim prefix="("  suffix=")" suffixOverrides=",">
            <if test="item.id != null">
                #{item.id},
            </if>
            <if test="item.communityId != null">
                #{item.communityId},
            </if>
            <if test="item.discount != null">
                #{item.discount},
            </if>
            <if test="item.integral != null">
                #{item.integral},
            </if>
            sysdate()
        </trim>
    </insert>
    <update id="update">
        update volunteer_community_discount
        <set>
            <if test="item.id != null">
                id=#{item.id},
            </if>
            <if test="item.communityId != null">
                community_id=#{item.communityId},
            </if>
            <if test="item.discount != null">
                discount=#{item.discount},
            </if>
            <if test="item.integral != null">
                integral=#{item.integral},
            </if>
            update_time=sysdate()
        </set>
        where id = #{item.id}
    </update>
    <delete id="delete" parameterType="String">
        delete from volunteer_community_discount where id=#{id}
    </delete>
</mapper>