ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/poji/shop/Shop.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -327,6 +328,11 @@ @TableField("ks_poi_id") private String ksPoiId; /** * 该字段用于用户登录获取默认门店 */ @TableField(exist = false) private Boolean isDefault; @Override protected Serializable pkVal() { ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/business/MerLotteryEventController.java
@@ -23,6 +23,7 @@ import com.ruoyi.system.api.service.RemoteShopService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -37,6 +38,7 @@ * @author zhibing.pu * @Date 2025/5/8 18:13 */ @Slf4j @Api(value = "商户端商户相关接口", tags = "商户端商户相关接口", description = "商户端商户相关接口") @RestController @RequestMapping("/mer/lotteryEvent") @@ -118,6 +120,8 @@ lotteryEvent.setId(IdUtils.simpleUUID()); String weiXinQrCode = remoteMemberService.getWeiXinQrCode("id=" + lotteryEvent.getId() + "&activityType=" + lotteryEvent.getActivityType(), "/pages/turntable/index"); lotteryEvent.setWxMiniProgramQrCode(weiXinQrCode); lotteryEvent.setCreateTime(LocalDateTime.now()); lotteryEvent.setCreateUserId(lotteryEvent.getCreateUserId()); } lotteryEvent.setUpdateTime(LocalDateTime.now()); lotteryEvent.setUpdateUserId(SecurityUtils.getUserId()); ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppLotteryEventController.java
@@ -249,6 +249,8 @@ one.setLotteryEventQuestionId(lotteryEventQuestions.getId()); one.setLotteryEventQuestionsAnswersId(lotteryEventQuestionsAnswers.getId()); one.setCreateTime(LocalDateTime.now()); }else{ one.setLotteryEventQuestionsAnswersId(lotteryEventQuestionsAnswers.getId()); } one.setIsCorrect(0); //答案正确 ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/controller/miniapp/AppCouponController.java
@@ -1,5 +1,6 @@ package com.ruoyi.member.controller.miniapp; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.R; @@ -104,9 +105,8 @@ @ApiImplicitParam(name = "id", value = "优惠券id", required = true, dataType = "String", paramType = "path") }) public R<CouponInfoVo> getCouponInfo(@PathVariable("couponId") String couponId) { MemberCoupon memberCoupon = memberCouponService.getById(couponId); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Coupon coupon = couponService.getById(memberCoupon.getCouponId()); Coupon coupon = couponService.getById(couponId); CouponInfoVo vo = new CouponInfoVo(); vo.setId(coupon.getCouponId()); vo.setName(coupon.getCouponName()); @@ -134,9 +134,11 @@ } vo.setLaveNum(coupon.getSendLimitFlag()); vo.setReceiveNum(coupon.getSendLimitNumber()); int count = memberCouponService.count(new QueryWrapper<MemberCoupon>().eq("coupon_id", memberCoupon.getCouponId()).eq("del_flag", 0)); int count = memberCouponService.count(new QueryWrapper<MemberCoupon>().eq("coupon_id", couponId).eq("del_flag", 0)); vo.setLaveNum(coupon.getSendLimitNumber() - count); vo.setStatus(memberCoupon.getCouponStatus()); Long userId = SecurityUtils.getUserId(); List<MemberCoupon> list = memberCouponService.list(new QueryWrapper<MemberCoupon>().eq("coupon_id", couponId).eq("user_id", userId).eq("del_flag", 0)); vo.setStatus(list.isEmpty() ? null : list.get(0).getCouponStatus()); return R.ok(vo); } ruoyi-modules/ruoyi-member/src/main/java/com/ruoyi/member/domain/vo/AppMemberCouponPageVo.java
@@ -18,7 +18,7 @@ public class AppMemberCouponPageVo { @ApiModelProperty(value = "用户优惠券id") private Long memberCouponId; private String memberCouponId; @ApiModelProperty(value = "优惠券id") private String couponId; ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/management/MgtOrderController.java
@@ -210,7 +210,7 @@ //分页获取三方订单 @RequestMapping(value = "/pageMgtThirdOrder", method = RequestMethod.POST) @ApiOperation(value = "分页获取三方订单") @ApiOperation(value = "分页获取三方订单【2.0】") public R<Page<MgtThirdOrderPageVo>> pageMgtThirdOrder(@RequestBody MgtThirdOrderPageDto dto) { Long userId = SecurityUtils.getUserId(); dto.setUserId(userId); @@ -222,7 +222,7 @@ } // 导出三方订单 @RequestMapping(value = "/exportPageMgtThirdOrder", method = RequestMethod.POST) @ApiOperation(value = "导出三方订单列表") @ApiOperation(value = "导出三方订单列表【2.0】") public void exportPageMgtThirdOrder( MgtThirdOrderPageDto mgtShopOrderPageDto, HttpServletResponse response) { Long userId = SecurityUtils.getUserId(); mgtShopOrderPageDto.setUserId(userId); ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/dto/MgtShopOrderPageDto.java
@@ -17,7 +17,7 @@ @ApiModelProperty(value = "关键词") private String keyword; @ApiModelProperty(value = "订单来源") @ApiModelProperty(value = "订单来源 1.商城2.秒杀活动3.线下创建4.抽奖5.美团6.抖音7.快手") private Integer orderFrom; @ApiModelProperty(value = "订单状态0.已取消1.待支付2.待核销3.已完成") ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/dto/MgtThirdOrderPageDto.java
@@ -23,7 +23,7 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTimeEnd; @ApiModelProperty(value = "订单来源1.店铺商品2.平台秒杀活动3.线下创建") @ApiModelProperty(value = "订单来源5.美团6.抖音7.快手8.小鹅云") private Integer orderFrom; @ApiModelProperty(value = "核销时间-范围开始") ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/MgtOrderTotal.java
@@ -53,4 +53,19 @@ @ApiModelProperty(value="活动订单未付金额总数") @JsonSerialize(using = ToStringSerializer.class) private BigDecimal activityUnPayMoneyTotal; @ApiModelProperty(value="活动订单总数") private Integer thirdOrderTotal; @ApiModelProperty(value="活动订单金额总数") @JsonSerialize(using = ToStringSerializer.class) private BigDecimal thirdOrderMoneyTotal; @ApiModelProperty(value="活动订单已付金额总数") @JsonSerialize(using = ToStringSerializer.class) private BigDecimal thirdPayMoneyTotal; @ApiModelProperty(value="活动订单未付金额总数") @JsonSerialize(using = ToStringSerializer.class) private BigDecimal thirdUnPayMoneyTotal; } ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/mapper/order/OrderMapper.java
@@ -727,4 +727,13 @@ * @return */ MgtPlTotalThirdOrderStaticsVO getPlTotalThirdOrderStatics(@Param("param")MgtBasePlatformDto mgtBasePlatformDto); /** * @description 统计第三方订单总数 * @author jqs * @date 2023/6/16 13:53 * @param mgtShopOrderPageDto * @return MgtOrderTotal */ MgtOrderTotal totalOrderFour(@Param("param")MgtShopOrderPageDto mgtShopOrderPageDto); } ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -3972,6 +3972,8 @@ MgtOrderTotal mgtOrderTotalFirst = orderMapper.totalOrderFirst(mgtShopOrderPageDto); MgtOrderTotal mgtOrderTotalSecond = orderMapper.totalOrderSecond(mgtShopOrderPageDto); MgtOrderTotal mgtOrderTotalThird = orderMapper.totalOrderThird(mgtShopOrderPageDto); MgtOrderTotal mgtOrderTotalFour = orderMapper.totalOrderFour(mgtShopOrderPageDto); mgtOrderTotal.setOrderTotal(mgtOrderTotalFirst.getOrderTotal()); mgtOrderTotal.setOrderMoneyTotal(mgtOrderTotalFirst.getOrderMoneyTotal()); mgtOrderTotal.setShopOrderTotal(mgtOrderTotalSecond.getShopOrderTotal()); @@ -4368,7 +4370,7 @@ */ private List<MgtMapBigTotalVo> bigListRemoveNull(List<MgtMapBigTotalVo> MgtMapIntTotalVos) { for (int i = 0; i < MgtMapIntTotalVos.size(); i++) { if (StringUtils.isBlank(MgtMapIntTotalVos.get(i).getMapKey())) { if(MgtMapIntTotalVos.get(i).getMapKey().isEmpty()){ MgtMapIntTotalVos.remove(i); } } @@ -4957,8 +4959,33 @@ //获取来源销售排名 List<MgtMapBigTotalVo> orderFromList = orderMapper.listPlTotalOrderTotalOrderFrom(mgtBasePlatformDto); if (orderFromList != null && orderFromList.size() > 0) { MgtMapBigTotalVo duoyin = new MgtMapBigTotalVo(); duoyin.setMapKey("抖音"); duoyin.setMapValue(totalOrderTotalVo.getDouyinAmount()); MgtMapBigTotalVo kauishou = new MgtMapBigTotalVo(); kauishou.setMapKey("快手"); kauishou.setMapValue(totalOrderTotalVo.getKuaishouAmount()); MgtMapBigTotalVo meituan = new MgtMapBigTotalVo(); meituan.setMapKey("美团"); meituan.setMapValue(totalOrderTotalVo.getMeituanAmount()); orderFromList.add(duoyin); orderFromList.add(kauishou); orderFromList.add(meituan); orderFromList = bigListRemoveNull(orderFromList); mgtTotalOrderTotalVo.setOrderFromRankList(orderFromList); // //排行 List<MgtMapBigTotalVo> sortedList = orderFromList.stream() // 按 mapValue 降序排序,处理 null 值(若 mapValue 可能为 null) .sorted(Comparator.comparing( MgtMapBigTotalVo::getMapValue, Comparator.nullsLast(BigDecimal::compareTo).reversed() )) .collect(Collectors.toList()); mgtTotalOrderTotalVo.setOrderFromRankList(sortedList); } //订单分布 //日期全部时固定为5天 ruoyi-modules/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -567,7 +567,7 @@ </if> ORDER BY toc.create_time DESC </select> <!-- todo 统计--> <select id="totalOrderFirst" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal"> SELECT COUNT(temp.order_id) orderTotal, @@ -730,7 +730,8 @@ toc.receivable_money receivableMoney, toc.create_time createTime, toc.pay_money payMoney, CASE WHEN toc.unbinding_flag = 0 THEN toc.shop_id WHEN toc.unbinding_flag = 1 AND toc.order_from = 1 THEN toc.shop_id WHEN toc.order_status = 3 THEN toc.shop_id ELSE NULL END shopId, -- CASE WHEN toc.unbinding_flag = 0 THEN toc.shop_id WHEN toc.unbinding_flag = 1 AND toc.order_from = 1 THEN toc.shop_id WHEN toc.order_status = 3 THEN toc.shop_id ELSE NULL END shopId, toc.shop_id shopId, toc.use_time verifyTime, CASE toc.order_from WHEN 1 THEN '小程序' @@ -746,6 +747,9 @@ WHERE toc.del_flag = 0 AND toc.order_from != 2 -- 不查找秒杀活动的订单 <if test="param.orderStatus != null"> AND toc.order_status = #{param.orderStatus} </if> <if test="param.orderFrom != null"> and toc.order_from = #{param.orderFrom} </if> <if test="param.goodsType != null and param.goodsType !=''"> AND tog.goods_type = #{param.goodsType} @@ -1213,6 +1217,9 @@ <foreach collection="param.shopIdList" item="item" open="(" separator="," close=")"> #{item} </foreach> </if> <if test="param."> and order_from = #{param.} </if> <if test="param.startDate!=null and param.startDate!=''"> AND Date(create_time) >= #{param.startDate} @@ -2244,11 +2251,11 @@ <if test="param.createTimeEnd != null and param.createTimeEnd != ''"> AND Date(toc.create_time) <= #{param.createTimeEnd} </if> <if test="param.verifyStartTime != null and param.verifyStartTime != ''"> AND Date(toc.use_time) >= #{param.verifyStartTime} <if test="param.useTimeBegin != null and param.useTimeBegin != ''"> AND Date(toc.use_time) >= #{param.useTimeBegin} </if> <if test="param.verifyEndTime != null and param.verifyEndTime != ''"> AND Date(toc.use_time) <= #{param.verifyEndTime} <if test="param.useTimeEnd != null and param.useTimeEnd != ''"> AND Date(toc.use_time) <= #{param.useTimeEnd} </if> ORDER BY toc.create_time DESC </select> @@ -2283,4 +2290,41 @@ and create_time between #{param.startTime} and #{param.endTime} </if> </select> <select id="totalOrderFour" resultType="com.ruoyi.order.domain.vo.MgtOrderTotal"> SELECT COUNT(temp.order_id) thirdOrderTotal, IFNULL(SUM( temp.receivable_money ),0) thirdOrderMoneyTotal, IFNULL(SUM(temp.pay_money),0) thirdPayMoneyTotal, IFNULL(SUM(CASE WHEN (temp.receivable_money ) > temp.pay_money THEN ( temp.receivable_money ) - temp.pay_money ELSE 0 END),0)thirdUnPayMoneyTotal FROM (SELECT toc.order_id,toc.receivable_money,toc.pay_money FROM t_order toc INNER JOIN t_order_goods tog ON tog.order_id = toc.order_id WHERE toc.del_flag = 0 AND toc.order_from in (5,6,7) <if test="param.orderStatus != null"> AND toc.order_status = #{param.orderStatus} </if> <if test="param.goodsType != null and param.goodsType !=''"> AND tog.goods_type = #{param.goodsType} </if> <!--<if test="param.shopId != null and param.shopId != ''">--> <!--AND toc.shop_id = #{param.shopId}--> <!--</if>--> <if test="param.shopId != null and param.shopId != ''"> AND toc.shop_id = #{param.shopId} AND (toc.unbinding_flag = 0 OR (toc.unbinding_flag = 1 AND toc.order_from in (5,6,7)) OR (toc.unbinding_flag = 1 AND toc.order_from in (5,6,7) AND toc.order_status = 3)) </if> <if test="param.shopIds != null and param.shopIds != ''"> and toc.order_status = 3 AND FIND_IN_SET(toc.shop_id, #{param.shopIds}) > 0 </if> <if test="param.keyword != null and param.keyword != ''"> AND (toc.order_no LIKE CONCAT('%',#{param.keyword},'%') OR toc.activity_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(toc.user_id, #{param.userIds}) > 0) </if> <if test="param.useTimeBegin != null and param.useTimeBegin != ''"> AND Date(toc.use_time) >= #{param.verifyStartTime} </if> <if test="param.verifyEndTime != null and param.verifyEndTime != ''"> AND Date(toc.use_time) <= #{param.verifyEndTime} </if> GROUP BY toc.order_id) AS temp </select> </mapper> ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java
@@ -303,6 +303,9 @@ List<ShopRelUser> shopRelUser = shopRelUserService.getByUserId(userId); List<Shop> collect = shopRelUser.stream().map(e -> { Shop shop = shopService.getById(e.getShopId()); if (e.getIsDefault()==1){ shop.setIsDefault(true); } return shop; }).collect(Collectors.toList()); return R.ok(collect); ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/dto/MgtOneClinkSyncingPageDTO.java
@@ -6,6 +6,7 @@ import lombok.Data; import org.springframework.cglib.core.Local; import java.time.LocalDate; import java.time.LocalDateTime; @Data @@ -19,10 +20,13 @@ private String syncingName; @ApiModelProperty(value = "操作同步时间范围-开始时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime syncingStartTime; @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate syncingStartTime; @ApiModelProperty(value = "操作同步时间范围-结束时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime syncingEndTime; @JsonFormat(pattern = "yyyy-MM-dd") private LocalDate syncingEndTime; private LocalDateTime startTime; private LocalDateTime endTime; } ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/OneClinkSyncingServiceImpl.java
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -43,8 +44,13 @@ @Override public IPage<MgtOneClinkSyncPageVO> pageOneClinkSyncing(MgtOneClinkSyncingPageDTO mgtPageDto) { LocalDateTime startTime = mgtPageDto.getSyncingStartTime().atStartOfDay(); LocalDateTime endTime = mgtPageDto.getSyncingEndTime().atTime(LocalTime.MAX); mgtPageDto.setStartTime(startTime); mgtPageDto.setEndTime(endTime); //分页查询 IPage<MgtOneClinkSyncPageVO> page = new Page<>(mgtPageDto.getPageNum(),mgtPageDto.getPageSize()); return this.baseMapper.pageOneClinkSyncing(page,mgtPageDto); } ruoyi-modules/ruoyi-system/src/main/resources/mapper/config/AdvertMapper.xml
@@ -101,7 +101,13 @@ link_url linkUrl, jump_type jumpType, jump_id jumpId, logo_url logoUrl logo_url logoUrl, target_type_slogan targetTypeSlogan, link_type_slogan linkTypeSlogan, link_url_slogan linkUrlSlogan, jump_type_slogan jumpTypeSlogan, jump_id_slogan jumpIdSlogan, appid_slogan appidSlogan FROM t_advert WHERE del_flag = 0 ORDER BY create_time DESC LIMIT 1 </select> </mapper> ruoyi-modules/ruoyi-system/src/main/resources/mapper/config/OneClinkSyncingMapper.xml
@@ -20,11 +20,11 @@ <if test="null != dto.syncingName and ''!= dto.syncingName"> and syncing_name like concat('%',#{dto.syncingName},'%') </if> <if test="dto.syncingStartTime!=null and dto.syncingStartTime != ''"> AND syncing_time >= #{dto.syncingStartTime} <if test="dto.startTime!=null and dto.startTime != ''"> AND syncing_time >= #{dto.startTime} </if> <if test="dto.syncingStartTime!=null and dto.syncingStartTime != ''"> AND syncing_time <= #{dto.syncingEndTime} <if test="dto.endTime!=null and dto.endTime != ''"> AND syncing_time <= #{dto.endTime} </if> </select> </mapper>