| | |
| | | v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum())); |
| | | v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum())); |
| | | v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum())); |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); |
| | | String authorAvatar = v.getAuthorAvatar(); |
| | | if (StringUtils.isNotBlank(authorAvatar)&&!authorAvatar.contains("http")) { |
| | | v.setAuthorAvatar(cosUtil.getPreviewUrl(authorAvatar)); |
| | | } |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| New file |
| | |
| | | package cn.lili.modules.member.entity.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UpdateTracesDTO { |
| | | /** |
| | | * 包裹编号 |
| | | */ |
| | | private String packageNo; |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | private String orderSn; |
| | | /** |
| | | * 快递公司id |
| | | */ |
| | | private String logisticsId; |
| | | /** |
| | | * 快递单号 |
| | | */ |
| | | private String logisticsNo; |
| | | /** |
| | | * 快递编码 |
| | | */ |
| | | private String logisticsCode; |
| | | } |
| | |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.lmk.domain.vo.OrderCountVO; |
| | | import cn.lili.modules.member.entity.dto.MemberAddressDTO; |
| | | import cn.lili.modules.member.entity.dto.UpdateTracesDTO; |
| | | import cn.lili.modules.order.cart.entity.dto.TradeDTO; |
| | | import cn.lili.modules.order.order.entity.dos.Order; |
| | | import cn.lili.modules.order.order.entity.dto.*; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | */ |
| | | Traces getTraces(String orderSn); |
| | | |
| | | void updateTraces(@RequestBody UpdateTracesDTO updateTracesDTO); |
| | | |
| | | /** |
| | | * 获取地图版 物流踪迹 |
| | | * |
| | |
| | | import cn.lili.modules.lmk.mapper.LmkOrderSelectMapper; |
| | | import cn.lili.modules.lmk.service.CouponVirtualService; |
| | | import cn.lili.modules.member.entity.dto.MemberAddressDTO; |
| | | import cn.lili.modules.member.entity.dto.UpdateTracesDTO; |
| | | import cn.lili.modules.member.mapper.MemberMapper; |
| | | import cn.lili.modules.order.cart.entity.dto.TradeDTO; |
| | | import cn.lili.modules.order.cart.entity.enums.DeliveryMethodEnum; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateTraces(UpdateTracesDTO updateTracesDTO) { |
| | | LambdaQueryWrapper<OrderPackage> eq = Wrappers.<OrderPackage>lambdaQuery() |
| | | .eq(OrderPackage::getOrderSn, updateTracesDTO.getOrderSn()) |
| | | .eq(OrderPackage::getPackageNo, updateTracesDTO.getPackageNo()); |
| | | OrderPackage one = orderPackageService.getOne(eq); |
| | | if (one == null) { |
| | | throw new ServiceException("当前包裹不存在"); |
| | | } |
| | | |
| | | String logisticsId = updateTracesDTO.getLogisticsId(); |
| | | if (StringUtils.isNotBlank(logisticsId)) { |
| | | Logistics logic = logisticsService.getById(logisticsId); |
| | | one.setLogisticsNo(updateTracesDTO.getLogisticsNo()); |
| | | one.setLogisticsCode(logic.getCode()); |
| | | one.setLogisticsName(logic.getName()); |
| | | orderPackageService.updateById(one); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Traces getMapTraces(String orderSn) { |
| | | //获取订单信息 |
| | | Order order = this.getBySn(orderSn); |
| | |
| | | checkBatchDeliver(orderBatchDeliverDTOList); |
| | | //订单批量发货 |
| | | for (OrderBatchDeliverDTO orderBatchDeliverDTO : orderBatchDeliverDTOList) { |
| | | this.delivery(orderBatchDeliverDTO.getOrderSn(), orderBatchDeliverDTO.getLogisticsNo(), orderBatchDeliverDTO.getLogisticsId()); |
| | | String logisticsNo = orderBatchDeliverDTO.getLogisticsNo(); |
| | | String[] split = logisticsNo.split(","); |
| | | //如果物流单号包含多个,则进行拆单 |
| | | if (split.length > 1) { |
| | | for (int i = 0; i < split.length; i++) { |
| | | PartDeliveryParamsDTO partDeliveryParamsDTO = new PartDeliveryParamsDTO(); |
| | | partDeliveryParamsDTO.setOrderSn(orderBatchDeliverDTO.getOrderSn()); |
| | | partDeliveryParamsDTO.setLogisticsNo(split[i]); |
| | | partDeliveryParamsDTO.setLogisticsId(orderBatchDeliverDTO.getLogisticsId()); |
| | | ArrayList<PartDeliveryDTO> partDeliveryDTOList = new ArrayList<>(); |
| | | partDeliveryParamsDTO.setPartDeliveryDTOList(partDeliveryDTOList); |
| | | if (i == split.length - 1){ |
| | | List<OrderItem> orderItemList = orderItemService.getByOrderSn(orderBatchDeliverDTO.getOrderSn()); |
| | | for (OrderItem orderItem : orderItemList) { |
| | | if (RefundStatusEnum.NO_REFUND.name().equals(orderItem.getIsRefund())) { |
| | | PartDeliveryDTO partDeliveryDTO = new PartDeliveryDTO(); |
| | | partDeliveryDTO.setDeliveryNum(orderItem.getNum()); |
| | | partDeliveryDTO.setOrderItemId(orderItem.getId()); |
| | | partDeliveryDTOList.add(partDeliveryDTO); |
| | | } |
| | | } |
| | | } |
| | | this.partDelivery(partDeliveryParamsDTO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | // 提取商品名(注意:键是resultMap中定义的property值"goodsName") |
| | | if (Objects.nonNull(map.get("goodsName"))) { |
| | | String goodsName = map.get("goodsName").toString(); |
| | | goodsData.add(goodsName); |
| | | String buyerCount = map.get("buyerCount").toString(); |
| | | String repurchaseBuyerCount = map.get("repurchaseBuyerCount").toString(); |
| | | String format = String.format("%s:购买人数 %s 复购人数%s", goodsName, buyerCount, repurchaseBuyerCount); |
| | | goodsData.add(format); |
| | | } |
| | | |
| | | // 提取复购率(复购率通常是数字类型,这里用BigDecimal接收) |
| | |
| | | if (Objects.nonNull(searchDTO.getCanFilter()) && searchDTO.getCanFilter()) { |
| | | // 使用sn字段排序并在折叠时选择sn最小的记录 |
| | | searchQueryBuilder.withCollapseField("goodsId.keyword"); |
| | | searchQueryBuilder.withSort(SortBuilders.fieldSort("sn.keyword").order(SortOrder.ASC)); |
| | | searchQueryBuilder.withSort(SortBuilders.fieldSort("price").order(SortOrder.ASC)); |
| | | } |
| | | NativeSearchQuery searchQuery = searchQueryBuilder.build(); |
| | | searchQuery.setTrackTotalHits(true); |
| | |
| | | */ |
| | | @Select("SELECT sum(uv_num) FROM li_s_platform_view_data ${ew.customSqlSegment}") |
| | | Integer count(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); |
| | | /** |
| | | * UV流量统计 |
| | | * |
| | | * @param queryWrapper 查询条件 |
| | | * @return UV流量统计数量 |
| | | */ |
| | | @Select("SELECT COUNT(DISTINCT(user_id)) FROM lmk_action_record ${ew.customSqlSegment}") |
| | | Integer uvCount(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | // @Override |
| | | // public Integer countUv(StatisticsQueryParam queryParam) { |
| | | // Date[] dates = StatisticsDateUtil.getDateArray(queryParam); |
| | | // //获取当前时间 |
| | | // Calendar calendar = Calendar.getInstance(); |
| | | // |
| | | // calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0); |
| | | // calendar.set(Calendar.MILLISECOND, 0); |
| | | // //如果是今天的统计,则从redis 中拿,否则从数据库中拿 |
| | | // if (dates[0].equals(calendar.getTime())) { |
| | | // if (StringUtils.isNotEmpty(queryParam.getStoreId())) { |
| | | // return cache.counter(CachePrefix.UV.getPrefix() + StatisticsSuffix.suffix(queryParam.getStoreId())).intValue(); |
| | | // } |
| | | // return cache.counter(CachePrefix.UV.getPrefix() + StatisticsSuffix.suffix()).intValue(); |
| | | // } else { |
| | | // QueryWrapper queryWrapper = new QueryWrapper(); |
| | | // queryWrapper.between("date", dates[0], dates[1]); |
| | | // //根据店铺查询判定,如果有,则店铺查询,如果没有,则根据商家查询 |
| | | // if (StringUtils.isNotEmpty(queryParam.getStoreId())) { |
| | | // queryWrapper.eq("store_id", queryParam.getStoreId()); |
| | | // } else { |
| | | // queryWrapper.eq("store_id", -1); |
| | | // } |
| | | // return this.baseMapper.count(queryWrapper); |
| | | // } |
| | | // } |
| | | @Override |
| | | public Integer countUv(StatisticsQueryParam queryParam) { |
| | | Date[] dates = StatisticsDateUtil.getDateArray(queryParam); |
| | |
| | | |
| | | calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | //如果是今天的统计,则从redis 中拿,否则从数据库中拿 |
| | | if (dates[0].equals(calendar.getTime())) { |
| | | if (StringUtils.isNotEmpty(queryParam.getStoreId())) { |
| | | return cache.counter(CachePrefix.UV.getPrefix() + StatisticsSuffix.suffix(queryParam.getStoreId())).intValue(); |
| | | } |
| | | return cache.counter(CachePrefix.UV.getPrefix() + StatisticsSuffix.suffix()).intValue(); |
| | | } else { |
| | | |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.between("date", dates[0], dates[1]); |
| | | //根据店铺查询判定,如果有,则店铺查询,如果没有,则根据商家查询 |
| | | if (StringUtils.isNotEmpty(queryParam.getStoreId())) { |
| | | queryWrapper.eq("store_id", queryParam.getStoreId()); |
| | | } else { |
| | | queryWrapper.eq("store_id", -1); |
| | | } |
| | | return this.baseMapper.count(queryWrapper); |
| | | } |
| | | queryWrapper.between("start_time", dates[0], dates[1]); |
| | | queryWrapper.eq("page_status", "JOIN"); |
| | | return this.baseMapper.uvCount(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | //创建时间 |
| | | if (CharSequenceUtil.isNotEmpty(startDate) && CharSequenceUtil.isNotEmpty(endDate)) { |
| | | wrapper.between("bill_time", startDate, endDate); |
| | | wrapper.between("create_time", startDate, endDate); |
| | | } else if (CharSequenceUtil.isNotEmpty(startDate)) { |
| | | wrapper.ge("bill_time", startDate); |
| | | wrapper.ge("create_time", startDate); |
| | | } else if (CharSequenceUtil.isNotEmpty(endDate)) { |
| | | wrapper.le("bill_time", endDate); |
| | | wrapper.le("create_time", endDate); |
| | | } |
| | | //账单号 |
| | | wrapper.eq(CharSequenceUtil.isNotEmpty(sn), "sn", sn); |
| | |
| | | <if test="query.status != null and query.status !=''"> |
| | | AND LGCT.status = #{query.status} |
| | | </if> |
| | | order by LGCT.create_time DESC |
| | | </select> |
| | | <resultMap id="getCustomizeTemplateMap" type="cn.lili.modules.lmk.domain.vo.CustomizeTemplateVO"> |
| | | <id property="id" column="id"/> |
| | |
| | | |
| | | <select id="getAuthorLikeVideoPage" resultMap="WxResultMap"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | ( |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.STATUS, |
| | | LV.play_num, |
| | | LV.comment_num, |
| | | LV.collect_num, |
| | |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name as authorName, |
| | | LM.face as authorAvatar |
| | | LM.nick_name AS authorName, |
| | | LM.face AS authorAvatar, |
| | | LV.create_time |
| | | FROM |
| | | lmk_thumbs_up_record LMC |
| | | INNER JOIN lmk_video LV ON LMC.ref_id = LV.id AND LV.delete_flag = 0 AND LV.status = '1' |
| | | INNER JOIN lmk_video LV ON LMC.ref_id = LV.id |
| | | AND LV.delete_flag = 0 |
| | | AND LV.STATUS = '1' |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LMC.delete_flag = 0 AND LMC.user_id = #{query.authorId} AND LMC.thumbs_up_type = 'video' AND LV.video_type = #{query.videoType} |
| | | LMC.delete_flag = 0 |
| | | AND LM.id IS NOT NULL |
| | | AND LMC.user_id = #{query.authorId} AND LMC.thumbs_up_type = 'video' AND LV.video_type = #{query.videoType} |
| | | UNION ALL |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.STATUS, |
| | | LV.play_num, |
| | | LV.comment_num, |
| | | LV.collect_num, |
| | | LV.thumbs_up_num, |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.video_content_type, |
| | | LV.video_type, |
| | | LV.video_imgs, |
| | | LV.id, |
| | | LM.nick_name AS authorName, |
| | | LM.avatar AS authorAvatar, |
| | | LV.create_time |
| | | FROM |
| | | lmk_thumbs_up_record LMC |
| | | INNER JOIN lmk_video LV ON LMC.ref_id = LV.id |
| | | AND LV.delete_flag = 0 |
| | | AND LV.STATUS = '1' |
| | | LEFT JOIN li_admin_user LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LMC.delete_flag = 0 |
| | | AND LM.id IS NOT NULL |
| | | AND LMC.user_id = #{query.authorId} AND LMC.thumbs_up_type = 'video' AND LV.video_type = #{query.videoType}) t |
| | | ORDER BY |
| | | LMC.create_time DESC |
| | | t.create_time DESC |
| | | </select> |
| | | <!-- <select id="getAuthorLikeVideoPage" resultMap="WxResultMap">--> |
| | | <!-- SELECT--> |
| | | <!-- LV.author_id,--> |
| | | <!-- LV.cover_url,--> |
| | | <!-- LV.video_fit,--> |
| | | <!-- LV.video_duration,--> |
| | | <!-- LV.video_file_key,--> |
| | | <!-- LV.title,--> |
| | | <!-- LV.goods_view_num,--> |
| | | <!-- LV.goods_order_num,--> |
| | | <!-- LV.recommend,--> |
| | | <!-- LV.status,--> |
| | | <!-- LV.play_num,--> |
| | | <!-- LV.comment_num,--> |
| | | <!-- LV.collect_num,--> |
| | | <!-- LV.thumbs_up_num,--> |
| | | <!-- LV.weight,--> |
| | | <!-- LV.audit_pass_time,--> |
| | | <!-- LV.update_time,--> |
| | | <!-- LV.video_content_type,--> |
| | | <!-- LV.video_type,--> |
| | | <!-- LV.video_imgs,--> |
| | | <!-- LV.id,--> |
| | | <!-- LM.nick_name as authorName,--> |
| | | <!-- LM.face as authorAvatar--> |
| | | <!-- FROM--> |
| | | <!-- lmk_thumbs_up_record LMC--> |
| | | <!-- INNER JOIN lmk_video LV ON LMC.ref_id = LV.id AND LV.delete_flag = 0 AND LV.status = '1'--> |
| | | <!-- LEFT JOIN li_member LM ON LV.author_id = LM.id--> |
| | | <!-- WHERE--> |
| | | <!-- LMC.delete_flag = 0 AND LMC.user_id = #{query.authorId} AND LMC.thumbs_up_type = 'video' AND LV.video_type = #{query.videoType}--> |
| | | <!-- ORDER BY--> |
| | | <!-- LMC.create_time DESC--> |
| | | <!-- </select>--> |
| | | |
| | | |
| | | <!-- 微信视频编辑详情 --> |
| | |
| | | <resultMap id="productRepurchase" type="java.util.Map"> |
| | | <result column="goods_name" property="goodsName"/> |
| | | <result column="repurchase_rate_percent" property="repurchaseRate"/> |
| | | <result column="buyer_count" property="buyerCount"/> |
| | | <result column="repurchase_buyer_count" property="repurchaseBuyerCount"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="viewDataCount" type="java.util.Map"> |
| | |
| | | import cn.lili.modules.lmk.service.GoodsCustomizeTemplateService; |
| | | import cn.lili.modules.lmk.service.UserCheckTemplateService; |
| | | import cn.lili.modules.member.entity.dto.MemberAddressDTO; |
| | | import cn.lili.modules.member.entity.dto.UpdateTracesDTO; |
| | | import cn.lili.modules.member.service.StoreLogisticsService; |
| | | import cn.lili.modules.order.cart.entity.vo.BindingTemplateParam; |
| | | import cn.lili.modules.order.order.entity.dto.OrderSearchParams; |
| | |
| | | return ResultUtil.data(orderPackageService.getOrderPackageVOList(orderSn)); |
| | | } |
| | | |
| | | @PostMapping(value = "/updateTraces") |
| | | public ResultMessage<Object> updateTraces(@RequestBody UpdateTracesDTO updateTracesDTO) { |
| | | orderService.updateTraces(updateTracesDTO); |
| | | return ResultUtil.success(ResultCode.SUCCESS); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询物流踪迹") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "orderSn", value = "订单编号", required = true, dataType = "String", paramType = "path") |