Merge remote-tracking branch 'origin/test' into test
| | |
| | | * @return |
| | | */ |
| | | List<ConvenientConsultationStatisticsVO> selectSumForConsultationNum(); |
| | | |
| | | /** |
| | | * 获取商家总咨询量 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | int selectTotalConsultationVolume(@Param("merchantId") Long merchantId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<ConvenientViewStatisticsVO> selectSumForViewNum(); |
| | | |
| | | /** |
| | | * 获取商家总浏览量 |
| | | * @param merchantId |
| | | * @return |
| | | */ |
| | | int selectTotalViewNum(@Param("merchantId") Long merchantId); |
| | | } |
| | |
| | | */ |
| | | private Boolean onShelf; |
| | | /** |
| | | * 上架时间 |
| | | */ |
| | | private Date onShelfAt; |
| | | /** |
| | | * 产品介绍 |
| | | */ |
| | | private String introduction; |
| | |
| | | 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(); |
| | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | 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)) { |
| | |
| | | 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> |
| | |
| | | <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" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <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 |
| | |
| | | </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> |
| | |
| | | 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> |