Bladeren bron

统计提交

pangqijun 2 jaren geleden
bovenliggende
commit
8ca74e18ff

+ 2 - 2
src/main/java/org/springblade/modules/api/controller/Api05Controller.java

@@ -179,7 +179,7 @@ public class Api05Controller extends BladeController {
 				//收款金额 默认等于抢购金额
 				BigDecimal collectionPrice = new BigDecimal(consign.getConsignPrice());
 
-				//使用收款账户进行打款
+				//统一收单
 				boolean flg = orderConsign(outTradeNo, request.getOrderNo(), collectionPrice.doubleValue());
 				if (flg){//是否发起统一收单
 					//修改授权状态
@@ -264,7 +264,7 @@ public class Api05Controller extends BladeController {
 		query.eq(PlatformAuthorization::getState, 1);
 		List<PlatformAuthorization> platformAuthorizations = paMapper.selectList(query);
 		LambdaQueryWrapper<Consign> consignLambdaQueryWrapper = Wrappers.lambdaQuery(Consign.class);
-		consignLambdaQueryWrapper.eq(Consign::getNowStock, 0).eq(Consign::getConsignState, 2).eq(Consign::getConsignFor, 2).orderByDesc(Consign::getEndTime);
+		consignLambdaQueryWrapper.eq(Consign::getConsignState, 2).orderByDesc(Consign::getEndTime);
 		List<Consign> list = consignService.list(consignLambdaQueryWrapper);
 		ConsignListVO consignListVO = null;
 		List<ConsignListVO> consignListVOS = new ArrayList<>();

+ 2 - 2
src/main/java/org/springblade/modules/api/task/ConsignSchedulingTask.java

@@ -75,7 +75,7 @@ public class ConsignSchedulingTask implements SchedulingConfigurer {
 				//0 0 1 * * ?
 				//定时时间间隔 分钟
 //				Integer taskTime  = Integer.parseInt(ParamCache.getValue(CommonConstant.TASK_SCHEDULING_TIME));//分钟
-				Integer taskTime  = 10;//分钟
+				Integer taskTime  = 120;//分钟
 				if(ObjectUtil.isEmpty(taskTime)){
 					taskTime = 10;
 				}
@@ -90,7 +90,7 @@ public class ConsignSchedulingTask implements SchedulingConfigurer {
 				return trigger.nextExecutionTime(triggerContext);
 			}
 		};
-		taskRegistrar.addTriggerTask(task, trigger);
+//		taskRegistrar.addTriggerTask(task, trigger);
 	}
 
 	/**

+ 2 - 2
src/main/java/org/springblade/modules/api/task/GrantSchedulingTask.java

@@ -71,7 +71,7 @@ public class GrantSchedulingTask implements SchedulingConfigurer {
 				//0 0 1 * * ?
 				//String cron = "0 0/5 * * * ?";
 //				int taskTime = Integer.parseInt(ParamCache.getValue(CommonConstant.TASK_GRANT_TIME));//分钟
-				int taskTime = 10;//分钟
+				int taskTime = 120;//分钟
 				if(StringUtil.isEmpty(taskTime)){
 					taskTime = 10;
 				}
@@ -81,7 +81,7 @@ public class GrantSchedulingTask implements SchedulingConfigurer {
 				return trigger.nextExecutionTime(triggerContext);
 			}
 		};
-		taskRegistrar.addTriggerTask(task, trigger);
+//		taskRegistrar.addTriggerTask(task, trigger);
 	}
 
 	private void alipayUnfreeze(){

+ 7 - 0
src/main/java/org/springblade/modules/finance/controller/OrderConsignController.java

@@ -30,6 +30,7 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.finance.vo.OrderConsignStaticVO;
 import org.springblade.modules.finance.wrapper.OrderConsignWrapper;
 import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -136,5 +137,11 @@ public class OrderConsignController extends BladeController {
 		return R.status(orderConsignService.removeByIds(Func.toLongList(ids)));
 	}
 
+	@ApiOperation(value = "寄售统计")
+	@GetMapping("/statistical")
+	public R<OrderConsignStaticVO> statistical() {
+		return R.data(orderConsignService.statistical());
+	}
+
 
 }

+ 3 - 0
src/main/java/org/springblade/modules/finance/service/IOrderConsignService.java

@@ -18,6 +18,7 @@ package org.springblade.modules.finance.service;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springblade.modules.finance.entity.OrderConsign;
+import org.springblade.modules.finance.vo.OrderConsignStaticVO;
 import org.springblade.modules.finance.vo.OrderConsignVO;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -47,4 +48,6 @@ public interface IOrderConsignService extends IService<OrderConsign> {
 	 */
 	Integer selectUserCount(Long userId, Long consignConfigId);
 
+	OrderConsignStaticVO statistical();
+
 }

+ 8 - 0
src/main/java/org/springblade/modules/finance/service/impl/OrderConsignServiceImpl.java

@@ -18,6 +18,7 @@ package org.springblade.modules.finance.service.impl;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.springblade.modules.finance.entity.OrderConsign;
+import org.springblade.modules.finance.vo.OrderConsignStaticVO;
 import org.springblade.modules.finance.vo.OrderConsignVO;
 import org.springblade.modules.finance.mapper.OrderConsignMapper;
 import org.springblade.modules.finance.service.IOrderConsignService;
@@ -50,4 +51,11 @@ public class OrderConsignServiceImpl extends ServiceImpl<OrderConsignMapper, Ord
 		return baseMapper.selectUserCount(userId,consignConfigId);
 	}
 
+	@Override
+	public OrderConsignStaticVO statistical() {
+		OrderConsignStaticVO staticVO = new OrderConsignStaticVO();
+
+		return null;
+	}
+
 }

+ 4 - 0
src/main/java/org/springblade/modules/finance/vo/OrderConsignStaticVO.java

@@ -0,0 +1,4 @@
+package org.springblade.modules.finance.vo;
+
+public class OrderConsignStaticVO {
+}

+ 29 - 0
src/main/java/org/springblade/modules/home/controller/HomeController.java

@@ -0,0 +1,29 @@
+package org.springblade.modules.home.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springblade.core.tool.api.R;
+import org.springblade.modules.home.service.IHomeService;
+import org.springblade.modules.home.vo.StatisticalVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@AllArgsConstructor
+@RequestMapping("home")
+@Api(value = "首页", tags = "首页接口")
+public class HomeController {
+
+	@Autowired
+	private IHomeService homeService;
+
+	@ApiOperation(value = "首页数据统计")
+	@GetMapping("/statistical")
+	public R<StatisticalVO> statistical() {
+		return R.data(homeService.statistical());
+	}
+
+}

+ 9 - 0
src/main/java/org/springblade/modules/home/service/IHomeService.java

@@ -0,0 +1,9 @@
+package org.springblade.modules.home.service;
+
+import org.springblade.modules.home.vo.StatisticalVO;
+
+public interface IHomeService {
+
+	StatisticalVO statistical();
+
+}

+ 39 - 0
src/main/java/org/springblade/modules/home/service/impl/HomeServiceImpl.java

@@ -0,0 +1,39 @@
+package org.springblade.modules.home.service.impl;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.modules.finance.entity.Order;
+import org.springblade.modules.finance.service.impl.OrderServiceImpl;
+import org.springblade.modules.home.service.IHomeService;
+import org.springblade.modules.home.vo.StatisticalVO;
+import org.springblade.modules.shopping.entity.ConsignConfig;
+import org.springblade.modules.shopping.service.impl.ConsignConfigServiceImpl;
+import org.springblade.modules.system.entity.User;
+import org.springblade.modules.system.service.impl.UserServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class HomeServiceImpl implements IHomeService {
+
+	@Autowired
+	private UserServiceImpl userService;
+	@Autowired
+	private OrderServiceImpl orderService;
+	@Autowired
+	private ConsignConfigServiceImpl consignConfigService;
+
+	@Override
+	public StatisticalVO statistical() {
+		StatisticalVO vo = new StatisticalVO();
+		// 查询app用户数
+		Integer userTotal = userService.getBaseMapper().selectCount(Condition.getQueryWrapper(new User()).eq("user_type", 2).eq("is_deleted", 0));
+		// 查询订单总数
+		Integer orderTotal = orderService.getBaseMapper().selectCount(Condition.getQueryWrapper(new Order()).eq("is_deleted", 0).notIn("pay_flag", 1, 2));
+		// 查询抢购场次
+		Integer snapTotal = consignConfigService.getBaseMapper().selectCount(Condition.getQueryWrapper(new ConsignConfig()).eq("is_deleted", 0).eq("is_enabled", 2));
+		vo.setOrderTotal(orderTotal);
+		vo.setSnapTotal(snapTotal);
+		vo.setUserTotal(userTotal);
+		return vo;
+	}
+}

+ 27 - 0
src/main/java/org/springblade/modules/home/vo/StatisticalVO.java

@@ -0,0 +1,27 @@
+package org.springblade.modules.home.vo;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@ApiModel(value = "StatisticalVo对象")
+public class StatisticalVO {
+
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@ApiModelProperty(value = "当前时间")
+	private Date currTime = new Date();
+
+	@ApiModelProperty(value = "用户总数")
+	private Integer userTotal;
+
+	@ApiModelProperty(value = "订单总数")
+	private Integer orderTotal;
+
+	@ApiModelProperty(value = "抢购场次总数")
+	private Integer snapTotal;
+}

+ 3 - 3
src/main/resources/application-dev.yml

@@ -96,7 +96,7 @@ alipay:
     payee-user-id: 2088341967443472
     # 回调域名
     domain: https://wine.gzzzyd.com
-    app-cert-path: D:\IdeaProjects\bladex-boot\src\main\resources\alipay\appCertPublicKey_2021003125657245.crt
-    ali-pay-cert-path: D:\IdeaProjects\bladex-boot\src\main\resources\alipay\alipayCertPublicKey_RSA2.crt
-    ali-pay-root-cert-path: D:\IdeaProjects\bladex-boot\src\main\resources\alipay\alipayRootCert.crt
+    app-cert-path: D:\workspace\bladex-boot\src\main\resources\alipay\appCertPublicKey_2021003125657245.crt
+    ali-pay-cert-path: D:\workspace\bladex-boot\src\main\resources\alipay\alipayCertPublicKey_RSA2.crt
+    ali-pay-root-cert-path: D:\workspace\bladex-boot\src\main\resources\alipay\alipayRootCert.crt