huanghongfa
2021-09-27 fbd35a6f70686c72362171ca33db44a42060873e
Merge remote-tracking branch 'origin/test' into test
8个文件已修改
54 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientConsultationStatisticsDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientViewStatisticsDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ConvenientProductDO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientConsultationStatisticsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientViewStatisticsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientConsultationStatisticsDAO.java
@@ -55,4 +55,11 @@
     * @return
     */
    List<ConvenientConsultationStatisticsVO> selectSumForConsultationNum();
    /**
     * 获取商家总咨询量
     * @param merchantId
     * @return
     */
    int selectTotalConsultationVolume(@Param("merchantId") Long merchantId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ConvenientViewStatisticsDAO.java
@@ -55,4 +55,11 @@
     * @return
     */
    List<ConvenientViewStatisticsVO> selectSumForViewNum();
    /**
     * 获取商家总浏览量
     * @param merchantId
     * @return
     */
    int selectTotalViewNum(@Param("merchantId") Long merchantId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ConvenientProductDO.java
@@ -43,6 +43,10 @@
     */
    private Boolean onShelf;
    /**
     * 上架时间
     */
    private Date onShelfAt;
    /**
     * 产品介绍
     */
    private String introduction;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientMerchantServiceImpl.java
@@ -191,7 +191,7 @@
        R result = userService.disableOrEnableMerchantUsers(disableOrEnableConvenientMerchantDTO);
        int type = disableOrEnableConvenientMerchantDTO.getType().intValue();
        if (type == 2) {
            this.baseMapper.batchUpdateBusinessStatus(convenientMerchantDOList, 2);
            this.baseMapper.batchUpdateBusinessStatus(convenientMerchantDOList, 0);
        }
        if (R.isOk(result)) {
            return R.ok();
@@ -252,12 +252,10 @@
        SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
        String moth = mothFormat.format(nowDate);
        String day = dayFormat.format(nowDate);
        int consultationCount = convenientConsultationStatisticsDAO.selectCount(new QueryWrapper<ConvenientConsultationStatisticsDO>()
                .lambda().eq(ConvenientConsultationStatisticsDO::getMerchantId, merchantId));
        int consultationCount = convenientConsultationStatisticsDAO.selectTotalConsultationVolume(merchantId);
        int monthConsultationVolume = convenientConsultationStatisticsDAO.selectMonthConsultationVolume(merchantId, moth);
        int dayConsultationVolume = convenientConsultationStatisticsDAO.selectDayConsultationVolume(merchantId, day);
        Integer viewCount = convenientViewStatisticsDAO.selectCount(new QueryWrapper<ConvenientViewStatisticsDO>()
                .lambda().eq(ConvenientViewStatisticsDO::getMerchantId, merchantId));
        Integer viewCount = convenientViewStatisticsDAO.selectTotalViewNum(merchantId);
        int monthViewNum = convenientViewStatisticsDAO.selectMonthViewNum(merchantId, moth);
        int dayViewNum = convenientViewStatisticsDAO.selectDayViewNum(merchantId, day);
        convenientMerchantVO.setConsultationVolume(consultationCount);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientProductServiceImpl.java
@@ -66,6 +66,9 @@
        ConvenientProductDO convenientProductDO = new ConvenientProductDO();
        BeanUtils.copyProperties(convenientProductDTO, convenientProductDO);
        Date nowDate = new Date();
        if (convenientProductDTO.getOnShelf()) {
            convenientProductDO.setOnShelfAt(nowDate);
        }
        convenientProductDO.setCreatedAt(nowDate);
        this.baseMapper.insert(convenientProductDO);
        Long productId = convenientProductDO.getId();
@@ -91,16 +94,20 @@
        Long productId = convenientProductDTO.getId();
        Long updatedBy = convenientProductDTO.getUpdatedBy();
        ConvenientProductDO convenientProductDO = this.baseMapper.selectById(productId);
        Boolean isOnShelf = convenientProductDO.getOnShelf();
        if (isNull(convenientProductDO)) {
            return R.fail("产品不存在");
        }
        BeanUtils.copyProperties(convenientProductDTO, convenientProductDO);
        Date nowDate = new Date();
        if (!isOnShelf && convenientProductDTO.getOnShelf()) {
            convenientProductDO.setOnShelfAt(nowDate);
        }
        convenientProductDO.setUpdatedBy(updatedBy);
        this.baseMapper.updateById(convenientProductDO);
        List<ConvenientProductSpecificationDTO> productSpecificationDTOList = convenientProductDTO.getProductSpecificationDTOList();
        List<Long> notNeedDelIds = productSpecificationDTOList.stream().filter(specificationDTO -> nonNull(specificationDTO.getId()))
                .map(ConvenientProductSpecificationDTO::getId).collect(Collectors.toList());
        Date nowDate = new Date();
        productSpecificationDTOList.forEach(specificationDTO -> {
            Long specificationId = specificationDTO.getId();
            if (isNull(specificationId)) {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientConsultationStatisticsMapper.xml
@@ -35,5 +35,10 @@
        SELECT merchant_id, SUM(consultation_volume) AS totalConsultationNum
        FROM com_convenient_consultation_statistics GROUP BY merchant_id
    </select>
    <select id="selectTotalConsultationVolume" resultType="java.lang.Integer">
        SELECT IF(SUM(consultation_volume) IS NULL,0,SUM(consultation_volume))
        FROM com_convenient_consultation_statistics
        WHERE merchant_id = #{merchantId}
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientProductMapper.xml
@@ -9,6 +9,7 @@
                <id column="category_id" property="categoryId" />
                <id column="merchant_id" property="merchantId" />
                <id column="on_shelf" property="onShelf" />
                <id column="on_shelf_at" property="onShelfAt" />
                <id column="introduction" property="introduction" />
                <id column="is_del" property="isDel" />
                <id column="view_num" property="viewNum" />
@@ -20,7 +21,7 @@
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,`name`,category_id,merchant_id,on_shelf,introduction,is_del,view_num,created_at,created_by,updated_at,updated_by
        id,`name`,category_id,merchant_id,on_shelf,on_shelf_at,introduction,is_del,view_num,created_at,created_by,updated_at,updated_by
    </sql>
    <update id="batchDeleteByIds">
        UPDATE com_convenient_products SET is_del = 1 WHERE id IN
@@ -29,7 +30,11 @@
        </foreach>
    </update>
    <update id="batchOnShelfOrOffShelfByIds">
        UPDATE com_convenient_products SET on_shelf = #{saleStatus}, updated_by = #{updatedBy} WHERE id IN
        UPDATE com_convenient_products SET on_shelf = #{saleStatus},
         <if test="saleStatus">
             on_shelf_at = NOW(),
         </if>
        updated_by = #{updatedBy} WHERE id IN
        <foreach collection="needDealIds" open="(" separator="," close=")" index="index" item="item">
            #{item}
        </foreach>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ConvenientViewStatisticsMapper.xml
@@ -35,5 +35,10 @@
        SELECT merchant_id, SUM(view_num) AS totalViewNum
        FROM com_convenient_view_statistics GROUP BY merchant_id
    </select>
    <select id="selectTotalViewNum" resultType="java.lang.Integer">
        SELECT IF(SUM(view_num) IS NULL,0,SUM(view_num))
        FROM com_convenient_view_statistics
        WHERE merchant_id = #{merchantId}
    </select>
</mapper>