张天森
2022-09-27 e11e6f0751222b1a6dd356bf54ead9e597c9c2ea
Merge branch 'sanshuohuitang_dev' into huacheng_test
8个文件已修改
39 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/ComMediateTypeDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMediateTypeDao.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComMediateType.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/CommediateTypeServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMediaTypeMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/ComMediateTypeDTO.java
@@ -57,7 +57,7 @@
    /**
     * 启用状态(0:停用,1:启用)
     */
    @ApiModelProperty("启用状态(0:停用,1:启用)")
    @ApiModelProperty("启用状态(false:停用,true:启用)")
    private Boolean enabled;
    /**
@@ -93,6 +93,6 @@
    /**
     * 删除标识(0:未删除,1:已删除)
     */
    @ApiModelProperty("0:未删除,1:已删除")
    @ApiModelProperty("false:未删除,true:已删除")
    private Boolean deleteFlag;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java
@@ -47,7 +47,7 @@
    @GetMapping("/appletsList")
    public R appletList(){
        return R.ok(commediateTypeService.list(new QueryWrapper<ComMediateType>().eq("enabled",1)));
        return R.ok(commediateTypeService.list(new QueryWrapper<ComMediateType>().eq("enabled",1).eq("deleteFlag", 0)));
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMediateTypeDao.java
@@ -24,6 +24,11 @@
     * @return 处理结果
     * */
    IPage<ComMediateType> eventList(Page page, @Param("keyWord") String keyWord);
    /**
     * 查询该事件类型的事件数量
     * */
    Integer selectEventCount(Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComMediateType.java
@@ -110,6 +110,9 @@
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Integer eventCount;
//    @Override
//    public boolean equals(Object that) {
//        if (this == that) {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -83,7 +83,9 @@
            List<ComEventResource> resourceList = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getRefId, comEvent1.getId()));
            List<ComEventRequestImageVO> comEventRequestImageVO = CopyUtil.deepCopyListObject(resourceList, ComEventRequestImageVO.class);
            comEvent1.setImages(comEventRequestImageVO);
            if (nonNull(userService.getUserInfoByUserId(comEvent1.getRequestUserId().toString()).getData().getImageUrl())){
            comEvent1.setIcon(userService.getUserInfoByUserId(comEvent1.getRequestUserId().toString()).getData().getImageUrl());
            }
            ComMediateType category = commediateTypeService.getById(comEvent1.getEventCategory());
            comEvent1.setEventCategoryName(category.getName());
        });
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -130,6 +130,10 @@
                }
            }
        }
        if (loginUserInfo.getAccount().equals("admin") || loginUserInfo.getAccount().equals("xiqu")){
            id=null;
            range=null;
        }
        return R.ok(comSanshuoExpertDao.expertPage(new Page(page,size),keyWord,range,id));
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/CommediateTypeServiceImpl.java
@@ -3,6 +3,7 @@
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO;
@@ -19,6 +20,7 @@
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import static java.util.Objects.nonNull;
@@ -39,7 +41,16 @@
     * */
    @Override
    public R listEvent(String keyWord, Integer page, Integer size) {
        return R.ok(comMediateTypeDao.eventList(new Page(page,size),keyWord));
        IPage<ComMediateType> comMediateTypeIPage = comMediateTypeDao.eventList(new Page(page, size), keyWord);
        List<ComMediateType> records = comMediateTypeIPage.getRecords();
        for (ComMediateType record : records) {
            //查询事件数量
            if (nonNull(record) && nonNull(record.getId())){
                record.setEventCount(comMediateTypeDao.selectEventCount(record.getId()));
            }
        }
        comMediateTypeIPage.setRecords(records);
        return R.ok(comMediateTypeIPage);
    }
    /**
@@ -63,6 +74,8 @@
        BeanUtil.copyProperties(comMediateTypeDTO,mediateType);
        mediateType.setId(Snowflake.getId());
        mediateType.setCreateDate(new Date());
        mediateType.setEnabled(true);
        mediateType.setDeleteFlag(false);
        return R.ok(comMediateTypeDao.insert(mediateType));
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMediaTypeMapper.xml
@@ -8,4 +8,8 @@
            and name like concat('%',#{keyWord},'%')
        </if>
    </select>
    <select id="selectEventCount" resultType="java.lang.Integer">
        select count(id) from com_sanshuo_event_info
        where event_category = #{id}
    </select>
</mapper>