Browse Source

1.商家端首页今日数据成交金额获取业务逻辑修改 2.商家端首页今日数据售后订单获取业务逻辑修改 3.商家端首页今日数据待处理订单获取业务逻辑修改4.商家端首页今日数据店铺访问次数获取业务逻辑修改 5.商家端首页今日数据用户访问次数获取业务逻辑修改 6.商家端首页今日数据订单转化率获取业务逻辑修改

multiwx
dy-hu 1 month ago
parent
commit
fee418edc0
  1. 3
      cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java
  2. 5
      cereshop-app/src/main/java/com/shop/cereshop/app/service/order/impl/CereShopOrderServiceImpl.java
  3. 1
      cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java
  4. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/page/index/Index.java
  5. 2
      cereshop-business/src/main/java/com/shop/cereshop/business/service/business/impl/CerePlatformBusinessServiceImpl.java
  6. 53
      cereshop-business/src/main/resources/mybatis/mapper/business/CerePlatformBusinessDAO.xml

3
cereshop-app/src/main/java/com/shop/cereshop/app/service/cart/impl/CereShopCartServiceImpl.java

@ -37,6 +37,7 @@ import com.shop.cereshop.app.service.seckill.CereShopSeckillDetailService;
import com.shop.cereshop.app.service.seckill.CereShopSeckillService;
import com.shop.cereshop.app.service.shop.CereShopConversionService;
import com.shop.cereshop.app.service.stock.CereStockService;
import com.shop.cereshop.app.utils.ContextUtil;
import com.shop.cereshop.app.utils.SceneUtil;
import com.shop.cereshop.commons.constant.CoReturnFormat;
import com.shop.cereshop.commons.constant.IntegerEnum;
@ -212,6 +213,7 @@ public class CereShopCartServiceImpl implements CereShopCartService {
cereShopConversion.setShopId(shopCart.getShopId());
cereShopConversion.setCreateTime(time);
cereShopConversion.setType(ParamEnum.CONVERSION_CART.getCode());
cereShopConversion.setProject(ContextUtil.getProject());
cereShopConversionService.insert(cereShopConversion);
//新增日志
cerePlatformLogService.addLog(user,"购物车模块","客户端操作","加入购物车",user.getBuyerUserId(),time);
@ -717,6 +719,7 @@ public class CereShopCartServiceImpl implements CereShopCartService {
cereShopConversion.setShopId(shopCart.getShopId());
cereShopConversion.setCreateTime(time);
cereShopConversion.setType(ParamEnum.CONVERSION_CART.getCode());
cereShopConversion.setProject(ContextUtil.getProject());
cereShopConversionService.insert(cereShopConversion);
}
}

5
cereshop-app/src/main/java/com/shop/cereshop/app/service/order/impl/CereShopOrderServiceImpl.java

@ -99,6 +99,7 @@ import com.shop.cereshop.app.service.shop.CereShopCommentService;
import com.shop.cereshop.app.service.shop.CereShopConversionService;
import com.shop.cereshop.app.service.stock.CereStockService;
import com.shop.cereshop.app.service.storehouse.CereShopStorehouseService;
import com.shop.cereshop.app.utils.ContextUtil;
import com.shop.cereshop.app.utils.DistributionUtil;
import com.shop.cereshop.commons.config.AlipayConfig;
import com.shop.cereshop.commons.config.PayConfig;
@ -552,6 +553,7 @@ public class CereShopOrderServiceImpl implements CereShopOrderService {
cereShopConversion.setShopId(id);
cereShopConversion.setCreateTime(TimeUtils.yyMMddHHmmss());
cereShopConversion.setType(ParamEnum.CONVERSION_PAY.getCode());
cereShopConversion.setProject(ContextUtil.getProject());
conversions.add(cereShopConversion);
});
//批量插入转化数据
@ -615,6 +617,7 @@ public class CereShopOrderServiceImpl implements CereShopOrderService {
cereShopConversion.setShopId(id);
cereShopConversion.setCreateTime(TimeUtils.yyMMddHHmmss());
cereShopConversion.setType(ParamEnum.CONVERSION_PAY.getCode());
cereShopConversion.setProject(ContextUtil.getProject());
conversions.add(cereShopConversion);
});
//批量插入转化数据
@ -652,6 +655,7 @@ public class CereShopOrderServiceImpl implements CereShopOrderService {
shopIds.forEach(id -> {
//新增转化数据
CereShopConversion cereShopConversion = new CereShopConversion();
cereShopConversion.setProject(ContextUtil.getProject());
cereShopConversion.setShopId(id);
cereShopConversion.setCreateTime(TimeUtils.yyMMddHHmmss());
cereShopConversion.setType(ParamEnum.CONVERSION_PAY.getCode());
@ -900,6 +904,7 @@ public class CereShopOrderServiceImpl implements CereShopOrderService {
addPayLog(order, time, orderNo, transactionId);
//新增转化数据
CereShopConversion cereShopConversion = new CereShopConversion();
cereShopConversion.setProject(ContextUtil.getProject());
cereShopConversion.setType(ParamEnum.CONVERSION_PAY_SUCCESS.getCode());
cereShopConversion.setShopId(order.getShopId());
cereShopConversion.setCreateTime(time);

1
cereshop-app/src/main/java/com/shop/cereshop/app/service/product/impl/CereShopProductServiceImpl.java

@ -278,6 +278,7 @@ public class CereShopProductServiceImpl implements CereShopProductService {
visit.setTerminal(param.getTerminal());
visit.setSystem(param.getSystem());
visit.setCity(param.getCity());
visit.setProject(ContextUtil.getProject());
cereShopVisitService.insert(visit);
//新增转化数据
CereShopConversion cereShopConversion=new CereShopConversion();

2
cereshop-business/src/main/java/com/shop/cereshop/business/page/index/Index.java

@ -21,7 +21,7 @@ import java.util.List;
public class Index {
/**
* 店铺访问人数
* 商家店铺访问人数
*/
@ApiModelProperty(value = "店铺访问人数")
private Integer total;

2
cereshop-business/src/main/java/com/shop/cereshop/business/service/business/impl/CerePlatformBusinessServiceImpl.java

@ -213,7 +213,7 @@ public class CerePlatformBusinessServiceImpl implements CerePlatformBusinessServ
String project = ContextUtil.getProject();
Index index=new Index();
//查询今日商家访问人数
//查询今日商家所有店铺访问人数
index.setTotal(cerePlatformBusinessDAO.getTotal(project, param.getBusinessId()));
//查询今日待处理订单数
index.setStayOrders(cerePlatformBusinessDAO.getStayOrders(project,param.getBusinessId()));

53
cereshop-business/src/main/resources/mybatis/mapper/business/CerePlatformBusinessDAO.xml

@ -307,41 +307,37 @@
</select>
<select id="getTotal" resultType="java.lang.Integer">
SELECT COUNT(*) from cere_shop_visit where shop_id=#{businessId}
AND project = #{project}
SELECT COUNT(*) from cere_shop_visit a Left Join cere_platform_shop b on a.shop_id=b.shop_id
where a.project = #{project} and b.business_id=#{businessId}
and DATEDIFF(LEFT(NOW(),10),LEFT(visit_time,10))=0
</select>
<select id="getStayOrders" resultType="java.lang.Integer">
SELECT COUNT(*) from cere_shop_order
where shop_id = #{businessId}
AND project = #{project}
and order_id NOT IN (SELECT order_id FROM cere_order_after)
and state = 2
SELECT COUNT(*) from cere_shop_order a left join cere_platform_shop b on a.shop_id = b.shop_id
where a.project = #{project} and b.business_id=#{businessId}
and a.order_id NOT IN (SELECT order_id FROM cere_order_after)
and a.state = 2 and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0
</select>
<select id="getStayAfters" resultType="java.lang.Integer">
SELECT COUNT(*) from cere_order_after a
SELECT COUNT(*) from (SELECT a.*, b.shop_id from cere_order_after a
LEFT JOIN cere_shop_order b ON a.order_id=b.order_id
where b.shop_id=#{businessId}
AND b.project = #{project}
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0
where b.project = #{project}
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0 ) c LEFT JOIN cere_platform_shop d on c.shop_id = d.shop_id where d.business_id = #{businessId}
</select>
<select id="getMoney" resultType="java.math.BigDecimal">
SELECT SUM(price) from cere_shop_order
where shop_id = #{businessId}
AND project = #{project}
and state = 4
and DATEDIFF(LEFT(NOW(),10), LEFT(create_time,10)) = 0
select SUM(a.price) from cere_shop_order a left join cere_platform_shop b on a.shop_id = b.shop_id
where a.project = #{project} and b.business_id = #{businessId}
and a.state = 4
and DATEDIFF(LEFT(NOW(),10), LEFT(a.create_time,10)) = 0
</select>
<select id="getVisit" resultType="java.lang.Integer">
SELECT COUNT(distinct buyer_user_id) from cere_shop_visit
where shop_id=#{businessId}
AND project = #{project}
and visit_time >= #{startTime}
and visit_time &lt;= #{endTime}
select COUNT(distinct a.buyer_user_id) from cere_shop_visit a left join cere_platform_shop b on a.shop_id = b.shop_id
where a.project = #{project} and b.business_id = #{businessId}
and a.visit_time >= #{startTime}
and a.visit_time &lt;= #{endTime}
</select>
<select id="getHotProducts" resultType="com.shop.cereshop.business.page.index.HotSellProduct">
@ -365,21 +361,20 @@
</select>
<select id="findVisits" resultType="java.math.BigDecimal">
SELECT COUNT(*) from cere_shop_conversion
where shop_id=#{businessId}
AND project = #{project}
and type=#{type}
select COUNT(*) from cere_shop_conversion a left join cere_platform_shop b on a.shop_id = b.shop_id
where a.project = #{project} and b.business_id = #{businessId}
and a.type=#{type}
<if test='condition=="1"'>
and DATEDIFF(LEFT(NOW(),10),LEFT(create_time,10))=0
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=0
</if>
<if test='condition=="2"'>
and DATEDIFF(LEFT(NOW(),10),LEFT(create_time,10))=1
and DATEDIFF(LEFT(NOW(),10),LEFT(a.create_time,10))=1
</if>
<if test='condition=="3"'>
and DATE_SUB(CURDATE(),INTERVAL 7 DAY)&lt;=create_time
and DATE_SUB(CURDATE(),INTERVAL 7 DAY)&lt;=a.create_time
</if>
<if test='condition=="4"'>
and DATE_SUB(CURDATE(),INTERVAL 30 DAY)&lt;=create_time
and DATE_SUB(CURDATE(),INTERVAL 30 DAY)&lt;=a.create_time
</if>
</select>

Loading…
Cancel
Save