Browse Source

refactor(app): 重构课程信息服务接口- 移除了 getCourseInfo 方法中的 orderId 参数
- 简化了价格规则查询逻辑,移除了订单类型判断
- 调整了控制器接口,使用路径变量接收 courseId
- 删除了未使用的服务接口和实现类
- 新增统计服务接口 IStatisticsService
- 移除了订单服务中的资金明细相关操作
-优化了订单信息查询逻辑,补充游戏地址设置

SheepHy 4 weeks ago
parent
commit
f3225418fd
40 changed files with 474 additions and 2088 deletions
  1. 3 4
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/commercial/CommercialController.java
  2. 0 12
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/WeChatPayService.java
  3. 3 48
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java
  4. 0 37
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/UserServiceImpl.java
  5. 0 166
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/ReceiptPaymentDetailsInfoController.java
  6. 0 180
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/ShopMoneyController.java
  7. 0 164
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/ShopMoneyHisController.java
  8. 73 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/StatisticsController.java
  9. 0 236
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/StatisticsInfoController.java
  10. 0 164
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/StatisticsInfoHisController.java
  11. 0 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/WebSearchHotController.java
  12. 0 87
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/ShopMoney.java
  13. 0 70
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/ShopMoneyHis.java
  14. 0 82
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/StatisticsInfo.java
  15. 0 90
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/StatisticsInfoHis.java
  16. 0 14
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/ShopMoneyHisMapper.java
  17. 0 22
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/ShopMoneyMapper.java
  18. 0 14
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/StatisticsInfoHisMapper.java
  19. 0 28
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/StatisticsInfoMapper.java
  20. 47 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/StatisticsMapper.java
  21. 0 5
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/ShopMoneyHisMapper.xml
  22. 0 39
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/ShopMoneyMapper.xml
  23. 0 5
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/StatisticsInfoHisMapper.xml
  24. 0 22
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/StatisticsInfoMapper.xml
  25. 256 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/StatisticsMapper.xml
  26. 1 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppCoureseService.java
  27. 0 22
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IReceiptPaymentDetailsInfoService.java
  28. 0 14
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IShopMoneyHisService.java
  29. 0 24
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IShopMoneyService.java
  30. 0 14
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IStatisticsInfoHisService.java
  31. 0 31
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IStatisticsInfoService.java
  32. 43 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IStatisticsService.java
  33. 3 13
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java
  34. 3 1
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoursesVerificationRecordServiceImpl.java
  35. 0 119
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/ReceiptPaymentDetailsInfoServiceImpl.java
  36. 0 18
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/ShopMoneyHisServiceImpl.java
  37. 0 115
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/ShopMoneyServiceImpl.java
  38. 0 18
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/StatisticsInfoHisServiceImpl.java
  39. 0 208
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/StatisticsInfoServiceImpl.java
  40. 42 0
      national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/StatisticsServiceImpl.java

+ 3 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/controller/commercial/CommercialController.java

@@ -82,10 +82,9 @@ public class CommercialController {
      * @return
      */
     @Operation(summary = "课程详情")
-    @GetMapping("/getCourseInfo")
-    public Result<List<CoursesPriceRulesVO>> getCourseInfo(@Schema(description = "课程ID") @RequestParam("courseId") String courseId,
-                                                           @Schema(description = "订单ID") @RequestParam("orderId") String orderId) {
-        return Result.OK(appCoureseService.getCourseInfo(courseId,orderId));
+    @GetMapping("/getCourseInfo/{courseId}")
+    public Result<List<CoursesPriceRulesVO>> getCourseInfo(@Schema(description = "课程ID") @PathVariable("courseId") String courseId) {
+        return Result.OK(appCoureseService.getCourseInfo(courseId));
     }
 
     /**

+ 0 - 12
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/WeChatPayService.java

@@ -8,9 +8,6 @@ import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
 import com.aliyun.oss.ServiceException;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.wechat.pay.java.core.notification.Notification;
-import com.wechat.pay.java.core.notification.RequestParam;
-import com.yomahub.liteflow.exception.IfTypeErrorException;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -20,7 +17,6 @@ import org.jeecg.modules.pay.serverPay.WXPayUtility;
 import org.jeecg.modules.system.app.dto.receiptPaymentDetails.ReceiptPaymentDetailsInfoVo;
 import org.jeecg.modules.system.app.entity.*;
 import org.jeecg.modules.system.app.mapper.*;
-import org.jeecg.modules.system.app.service.IReceiptPaymentDetailsInfoService;
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.mapper.SysDepartMapper;
 import org.jetbrains.annotations.NotNull;
@@ -32,7 +28,6 @@ import javax.crypto.NoSuchPaddingException;
 import javax.crypto.spec.GCMParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -77,10 +72,6 @@ public class WeChatPayService {
     @Resource
     private WeChatProfitSharingService weChatProfitSharingService;
 
-    @Resource
-    private IReceiptPaymentDetailsInfoService iReceiptPaymentDetailsInfoService;
-
-
     /**
      * 小程序支付拉起
      *
@@ -553,9 +544,6 @@ public class WeChatPayService {
             ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVoMd = getChangeMoney(receiptPaymentDetailsInfoVo, order.getOrgCode(), order.getTenantId(), 2, mdBigDecimal);
             ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVoSh = getChangeMoney(receiptPaymentDetailsInfoVo, order.getOrgCode(), sysDepart.getId(), 1, shBigDecimal);
             ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVoPt = getChangeMoney(receiptPaymentDetailsInfoVo, order.getOrgCode(), byOrgCode.getId(), 0, ptBigDecimal);
-            iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoPt);
-            iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoSh);
-            iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoMd);
         } else {
             parm.put("code", "FAIL");
             parm.put("message", "失败");

+ 3 - 48
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/OrderServiceImpl.java

@@ -41,7 +41,6 @@ import org.jeecg.modules.redission.RedissonDelayQueue;
 import org.jeecg.modules.system.app.dto.receiptPaymentDetails.ReceiptPaymentDetailsInfoVo;
 import org.jeecg.modules.system.app.entity.*;
 import org.jeecg.modules.system.app.mapper.*;
-import org.jeecg.modules.system.app.service.IReceiptPaymentDetailsInfoService;
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.mapper.SysDepartMapper;
@@ -128,8 +127,6 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
     @Resource
     private EvaluateMapper evaluateMapper;
     @Resource
-    private IReceiptPaymentDetailsInfoService iReceiptPaymentDetailsInfoService;
-    @Resource
     private SysDepartMapper sysDepartMapper;
     @Resource
     private SeparateAccountsMapper separateAccountsMapper;
@@ -1585,7 +1582,9 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
         if (CollUtil.isNotEmpty(insureOrderInfoList)) {
             appOrderInfoDTO.setInsureOrderInfoList(insureOrderInfoList);
         }
-
+        if(null == appOrderInfoDTO.getGameAddress()) {
+            appOrderInfoDTO.setGameAddress(appOrderInfoDTO.getProInfoList().get(0).getAddress());
+        }
         return appOrderInfoDTO;
     }
 
@@ -1945,27 +1944,6 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
                     log.error("微信支付成功通知成功,未查询到分账信息,不进行分账");
                     return stringStringMap;
                 }
-                BigDecimal shBigDecimal = BigDecimal.ZERO;
-                try {
-                    shBigDecimal = getBigDecimal(priceSum, separateAccounts.getShSeparateAccounts());
-                } catch (Exception e) {
-                    log.error("百分比计算错误", e);
-                }
-                BigDecimal ptBigDecimal = BigDecimal.ZERO;
-                try {
-                    ptBigDecimal = getBigDecimal(priceSum, separateAccounts.getPtSeparateAccounts());
-                } catch (Exception e) {
-                    log.error("百分比计算错误", e);
-                }
-                log.info("支付成功消息通知,门店添加明细:" + JSONObject.toJSONString(receiptPaymentDetailsInfoVo));
-                BigDecimal mdBigDecimal = priceSum.subtract(shBigDecimal).subtract(ptBigDecimal).setScale(2, RoundingMode.HALF_UP);
-                log.info("支付成功消息通知,金额:" + mdBigDecimal + ";" + shBigDecimal + ";" + ptBigDecimal);
-                ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVoMd = getChangeMoney(receiptPaymentDetailsInfoVo, appOrder.getOrgCode(), appOrder.getTenantId(), 2, mdBigDecimal);
-                ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVoSh = getChangeMoney(receiptPaymentDetailsInfoVo, sysDepart.getOrgCode(), sysDepart.getId(), 1, shBigDecimal);
-                ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVoPt = getChangeMoney(receiptPaymentDetailsInfoVo, byOrgCode.getOrgCode(), byOrgCode.getId(), 0, ptBigDecimal);
-                iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoPt);
-                iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoSh);
-                iReceiptPaymentDetailsInfoService.add(receiptPaymentDetailsInfoVoMd);
             }
 
         }
@@ -1996,29 +1974,6 @@ public class OrderServiceImpl extends ServiceImpl<AppOrderMapper, AppOrder> impl
     }
 
 
-    private ReceiptPaymentDetailsInfoVo getChangeMoney(ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVo, String orgCode, String deptId, Integer deptType, BigDecimal changeMoney) {
-        receiptPaymentDetailsInfoVo.setDeptId(deptId);
-        receiptPaymentDetailsInfoVo.setDeptType(deptType);
-        receiptPaymentDetailsInfoVo.setOrgCode(orgCode);
-        receiptPaymentDetailsInfoVo.setChangeMoney(changeMoney);
-        return receiptPaymentDetailsInfoVo;
-    }
-
-    private BigDecimal getBigDecimal(BigDecimal priceSum, BigDecimal proportion) {
-        if (proportion == null) {
-            return BigDecimal.ZERO;
-        } else {
-            if (proportion.compareTo(BigDecimal.ZERO) == 0) {
-                return BigDecimal.ZERO;
-            } else {   // 将百分比转换为小数(例如:50% -> 0.5)
-                BigDecimal divisor = proportion.divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
-                // 执行除法运算,设置精度和舍入模式
-                return priceSum.divide(divisor, 2, RoundingMode.HALF_UP);
-            }
-        }
-    }
-
-
     /**
      * @return String 订单号
      * @Author SheepHy

+ 0 - 37
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/UserServiceImpl.java

@@ -21,9 +21,7 @@ import org.jeecg.modules.app.vo.LoginUserVO;
 import org.jeecg.modules.app.vo.MsgInfoVO;
 import org.jeecg.modules.app.vo.MsgVO;
 import org.jeecg.modules.system.app.entity.FamilyMembers;
-import org.jeecg.modules.system.app.entity.StatisticsInfo;
 import org.jeecg.modules.system.app.mapper.FamilyMembersMapper;
-import org.jeecg.modules.system.app.mapper.StatisticsInfoMapper;
 import org.jeecg.modules.system.entity.SysAnnouncement;
 import org.jeecg.modules.system.entity.SysAnnouncementSend;
 import org.jeecg.modules.system.entity.SysDepart;
@@ -39,7 +37,6 @@ import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.UUID;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -68,8 +65,6 @@ public class UserServiceImpl implements IUserService {
     @Resource
     private RedisUtil redisUtil;
 
-    @Resource
-    private StatisticsInfoMapper statisticsInfoMapper;
 
     @Override
     @Transactional
@@ -99,38 +94,6 @@ public class UserServiceImpl implements IUserService {
                     throw new JeecgBootException("登录失败", SC_INTERNAL_SERVER_ERROR_500);
                 }
                 familyMembersMapper.insert(new FamilyMembers().setDelFlag(0).setUserId(user.getId()).setUserType(0).setRealNameStatus(0));
-                executor.submit(() -> {
-                    try {
-                        int dateAsInt = Integer.parseInt(
-                                LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))
-                        );
-                        //查询当天是否有平台统计信息
-                        StatisticsInfo statisticsInfo = statisticsInfoMapper.findByOrgCode("A01", dateAsInt);
-                        SysDepart byOrgCode = sysDepartMapper.findByOrgCode("A01");
-                        if (byOrgCode == null) {
-                            log.error("登录失败,平台部门不存在");
-                            return;
-                        }
-                        if (statisticsInfo == null) {
-                            statisticsInfo = new StatisticsInfo();
-                            statisticsInfo.setDateDaily(dateAsInt);
-                            statisticsInfo.setOrgCode(byOrgCode.getOrgCode());
-                            statisticsInfo.setDeptId(byOrgCode.getId());
-                            statisticsInfo.setAddNumber(1);
-                            statisticsInfo.setUpdateTime(new Date());
-                            statisticsInfo.setCreateTime(new Date());
-                            statisticsInfoMapper.insert(statisticsInfo);
-                        } else {
-                            statisticsInfo.setAddNumber(statisticsInfo.getAddNumber() + 1);
-                            statisticsInfo.setUpdateTime(new Date());
-                            statisticsInfoMapper.updateById(statisticsInfo);
-                        }
-                    } catch (Exception e) {
-                        log.error(e.getMessage());
-                        log.error(e);
-                    }
-                });
-
             }
 
             return generateLoginUserVO(user);

+ 0 - 166
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/ReceiptPaymentDetailsInfoController.java

@@ -1,166 +0,0 @@
-package org.jeecg.modules.system.app.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-import org.jeecg.modules.system.app.service.IReceiptPaymentDetailsInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Arrays;
- /**
- * @Description: 店铺资金明细
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Tag(name="店铺资金明细")
-@RestController
-@RequestMapping("/receiptPaymentDetailsInfo/receiptPaymentDetailsInfo")
-@Slf4j
-public class ReceiptPaymentDetailsInfoController extends JeecgController<ReceiptPaymentDetailsInfo, IReceiptPaymentDetailsInfoService> {
-	@Autowired
-	private IReceiptPaymentDetailsInfoService receiptPaymentDetailsInfoService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param receiptPaymentDetailsInfo
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "店铺资金明细-分页列表查询")
-	@Operation(summary="店铺资金明细-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<ReceiptPaymentDetailsInfo>> queryPageList(ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-
-
-//        QueryWrapper<ReceiptPaymentDetailsInfo> queryWrapper = QueryGenerator.initQueryWrapper(receiptPaymentDetailsInfo, req.getParameterMap());
-		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		Page<ReceiptPaymentDetailsInfo> page = new Page<ReceiptPaymentDetailsInfo>(pageNo, pageSize);
-		receiptPaymentDetailsInfo.setOrgCode(loginUser.getOrgCode());
-		IPage<ReceiptPaymentDetailsInfo> pageList = receiptPaymentDetailsInfoService.findPage(page, receiptPaymentDetailsInfo);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param receiptPaymentDetailsInfo
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金明细-添加")
-	@Operation(summary="店铺资金明细-添加")
-	@RequiresPermissions("receiptPaymentDetailsInfo:nm_receipt_payment_details_info:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo) {
-		receiptPaymentDetailsInfoService.save(receiptPaymentDetailsInfo);
-
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param receiptPaymentDetailsInfo
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金明细-编辑")
-	@Operation(summary="店铺资金明细-编辑")
-	@RequiresPermissions("receiptPaymentDetailsInfo:nm_receipt_payment_details_info:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo) {
-		receiptPaymentDetailsInfoService.updateById(receiptPaymentDetailsInfo);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金明细-通过id删除")
-	@Operation(summary="店铺资金明细-通过id删除")
-	@RequiresPermissions("receiptPaymentDetailsInfo:nm_receipt_payment_details_info:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		receiptPaymentDetailsInfoService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金明细-批量删除")
-	@Operation(summary="店铺资金明细-批量删除")
-	@RequiresPermissions("receiptPaymentDetailsInfo:nm_receipt_payment_details_info:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.receiptPaymentDetailsInfoService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "店铺资金明细-通过id查询")
-	@Operation(summary="店铺资金明细-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<ReceiptPaymentDetailsInfo> queryById(@RequestParam(name="id",required=true) String id) {
-		ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo = receiptPaymentDetailsInfoService.getById(id);
-		if(receiptPaymentDetailsInfo==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(receiptPaymentDetailsInfo);
-	}
-
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param receiptPaymentDetailsInfo
-    */
-    @RequiresPermissions("receiptPaymentDetailsInfo:nm_receipt_payment_details_info:exportXls")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo) {
-        return super.exportXls(request, receiptPaymentDetailsInfo, ReceiptPaymentDetailsInfo.class, "店铺资金明细");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequiresPermissions("receiptPaymentDetailsInfo:nm_receipt_payment_details_info:importExcel")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, ReceiptPaymentDetailsInfo.class);
-    }
-
-}

+ 0 - 180
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/ShopMoneyController.java

@@ -1,180 +0,0 @@
-package org.jeecg.modules.system.app.controller;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.system.app.entity.ShopMoney;
-import org.jeecg.modules.system.app.service.IShopMoneyService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Arrays;
- /**
- * @Description: 店铺资金总数
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Tag(name="店铺资金总数")
-@RestController
-@RequestMapping("/shopMoney/shopMoney")
-@Slf4j
-public class ShopMoneyController extends JeecgController<ShopMoney, IShopMoneyService> {
-	@Autowired
-	private IShopMoneyService shopMoneyService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param shopMoney
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "店铺资金总数-分页列表查询")
-	@Operation(summary="店铺资金总数-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<ShopMoney>> queryPageList(ShopMoney shopMoney,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-
-
-		Page<ShopMoney> page = new Page<ShopMoney>(pageNo, pageSize);
-		IPage<ShopMoney> pageList = shopMoneyService.findPage(page, shopMoney);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param shopMoney
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金总数-添加")
-	@Operation(summary="店铺资金总数-添加")
-	@RequiresPermissions("shopMoney:nm_shop_money:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody ShopMoney shopMoney) {
-		shopMoneyService.save(shopMoney);
-
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param shopMoney
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金总数-编辑")
-	@Operation(summary="店铺资金总数-编辑")
-	@RequiresPermissions("shopMoney:nm_shop_money:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody ShopMoney shopMoney) {
-		shopMoneyService.updateById(shopMoney);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金总数-通过id删除")
-	@Operation(summary="店铺资金总数-通过id删除")
-	@RequiresPermissions("shopMoney:nm_shop_money:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		shopMoneyService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "店铺资金总数-批量删除")
-	@Operation(summary="店铺资金总数-批量删除")
-	@RequiresPermissions("shopMoney:nm_shop_money:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.shopMoneyService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "店铺资金总数-通过id查询")
-	@Operation(summary="店铺资金总数-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<ShopMoney> queryById(@RequestParam(name="id",required=true) String id) {
-		ShopMoney shopMoney = shopMoneyService.getById(id);
-		if(shopMoney==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(shopMoney);
-	}
-
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param shopMoney
-    */
-    @RequiresPermissions("shopMoney:nm_shop_money:exportXls")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, ShopMoney shopMoney) {
-        return super.exportXls(request, shopMoney, ShopMoney.class, "店铺资金总数");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequiresPermissions("shopMoney:nm_shop_money:importExcel")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, ShopMoney.class);
-    }
-
-	 /**
-	  * 通过orgCode查询
-	  *
-	  * @return
-	  */
-	 //@AutoLog(value = "店铺资金总数-通过id查询")
-	 @Operation(summary="店铺资金总数-通过id查询")
-	 @GetMapping(value = "/queryByCode")
-	 public Result<ShopMoney> queryByCode() {
-		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		 ShopMoney shopMoney = shopMoneyService.findByOrgCode(loginUser.getOrgCode());
-		 if(shopMoney==null) {
-			 return Result.error("未找到对应数据");
-		 }
-		 return Result.OK(shopMoney);
-	 }
-
-}

+ 0 - 164
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/ShopMoneyHisController.java

@@ -1,164 +0,0 @@
-package org.jeecg.modules.system.app.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.system.app.entity.ShopMoneyHis;
-import org.jeecg.modules.system.app.service.IShopMoneyHisService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Arrays;
- /**
- * @Description: 变化历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Tag(name="变化历史记录表")
-@RestController
-@RequestMapping("/shopMoneyHis/shopMoneyHis")
-@Slf4j
-public class ShopMoneyHisController extends JeecgController<ShopMoneyHis, IShopMoneyHisService> {
-	@Autowired
-	private IShopMoneyHisService shopMoneyHisService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param shopMoneyHis
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "变化历史记录表-分页列表查询")
-	@Operation(summary="变化历史记录表-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<ShopMoneyHis>> queryPageList(ShopMoneyHis shopMoneyHis,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-
-
-        QueryWrapper<ShopMoneyHis> queryWrapper = QueryGenerator.initQueryWrapper(shopMoneyHis, req.getParameterMap());
-		Page<ShopMoneyHis> page = new Page<ShopMoneyHis>(pageNo, pageSize);
-		IPage<ShopMoneyHis> pageList = shopMoneyHisService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param shopMoneyHis
-	 * @return
-	 */
-	@AutoLog(value = "变化历史记录表-添加")
-	@Operation(summary="变化历史记录表-添加")
-	@RequiresPermissions("shopMoneyHis:nm_shop_money_his:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody ShopMoneyHis shopMoneyHis) {
-		shopMoneyHisService.save(shopMoneyHis);
-
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param shopMoneyHis
-	 * @return
-	 */
-	@AutoLog(value = "变化历史记录表-编辑")
-	@Operation(summary="变化历史记录表-编辑")
-	@RequiresPermissions("shopMoneyHis:nm_shop_money_his:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody ShopMoneyHis shopMoneyHis) {
-		shopMoneyHisService.updateById(shopMoneyHis);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "变化历史记录表-通过id删除")
-	@Operation(summary="变化历史记录表-通过id删除")
-	@RequiresPermissions("shopMoneyHis:nm_shop_money_his:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		shopMoneyHisService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "变化历史记录表-批量删除")
-	@Operation(summary="变化历史记录表-批量删除")
-	@RequiresPermissions("shopMoneyHis:nm_shop_money_his:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.shopMoneyHisService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "变化历史记录表-通过id查询")
-	@Operation(summary="变化历史记录表-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<ShopMoneyHis> queryById(@RequestParam(name="id",required=true) String id) {
-		ShopMoneyHis shopMoneyHis = shopMoneyHisService.getById(id);
-		if(shopMoneyHis==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(shopMoneyHis);
-	}
-
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param shopMoneyHis
-    */
-    @RequiresPermissions("shopMoneyHis:nm_shop_money_his:exportXls")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, ShopMoneyHis shopMoneyHis) {
-        return super.exportXls(request, shopMoneyHis, ShopMoneyHis.class, "变化历史记录表");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequiresPermissions("shopMoneyHis:nm_shop_money_his:importExcel")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, ShopMoneyHis.class);
-    }
-
-}

+ 73 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/StatisticsController.java

@@ -0,0 +1,73 @@
+package org.jeecg.modules.system.app.controller;
+
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.system.app.service.IStatisticsService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Tag(name="管理端统计")
+@RestController
+@RequestMapping("/statisticsInfo")
+@Slf4j
+public class StatisticsController {
+    @Resource
+    private IStatisticsService statisticsService;
+
+    /**
+     * <p>管理端首页获取商品销量排行</p>
+     * @author SheepHy
+     * @param type,参数为类则包含{@link Object}
+     *
+     */
+    @GetMapping("/findByShopSum")
+    @Operation(summary = "管理端首页获取商品销量排行")
+    public Result<List<Map<String, Object>>> findByShopSum(int type){
+        return Result.ok(statisticsService.findByShopSum(type));
+    }
+
+    /**
+     * <p>管理端首页获取部门售额排行</p>
+     * @author SheepHy
+     * @param type,参数为类则包含{@link Object}
+     *
+     */
+    @GetMapping("/findByDeptSum")
+    @Operation(summary = "管理端首页获取商品销量排行")
+    public Result<List<Map<String, Object>>> findByDeptSum(int type){
+        return Result.ok(statisticsService.findByDeptSum(type));
+    }
+
+    /**
+     * <p>首页统计</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    @GetMapping("/findIndexStatistics")
+    @Operation(summary = "首页统计")
+    public Result<Map<String, Object>> findIndexStatistics(){
+        return Result.ok(statisticsService.findIndexStatistics());
+    }
+
+    /**
+     * <p>本月销售额趋势图</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    @GetMapping("/findMonthSaleTrend")
+    @Operation(summary = "本月销售额趋势图")
+    public Result<List<Map<String, Object>>> findMonthSaleTrend(){
+        return Result.ok(statisticsService.findMonthSaleTrend());
+    }
+}

+ 0 - 236
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/StatisticsInfoController.java

@@ -1,236 +0,0 @@
-package org.jeecg.modules.system.app.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.SecurityUtils;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.common.system.vo.LoginUser;
-import org.jeecg.modules.system.app.entity.StatisticsInfo;
-import org.jeecg.modules.system.app.service.IStatisticsInfoService;
-import org.jeecg.modules.system.app.vo.statistics.FindByShopSumVO;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * @Description: 首页统计表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Tag(name="首页统计表")
-@RestController
-@RequestMapping("/statisticsInfo")
-@Slf4j
-public class StatisticsInfoController extends JeecgController<StatisticsInfo, IStatisticsInfoService> {
-	@Autowired
-	private IStatisticsInfoService statisticsInfoService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param statisticsInfo
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "首页统计表-分页列表查询")
-	@Operation(summary="首页统计表-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<StatisticsInfo>> queryPageList(StatisticsInfo statisticsInfo,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-
-
-        QueryWrapper<StatisticsInfo> queryWrapper = QueryGenerator.initQueryWrapper(statisticsInfo, req.getParameterMap());
-		Page<StatisticsInfo> page = new Page<StatisticsInfo>(pageNo, pageSize);
-		IPage<StatisticsInfo> pageList = statisticsInfoService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-
-
-	 /**
-	  * 首页查询
-	  * @return
-	  */
-	 //@AutoLog(value = "首页统计表-分页列表查询")
-	 @Operation(summary="首页统计表-首页查询")
-	 @GetMapping(value = "/findByStatistics")
-	 public Result<FindByStatisticsVO> findByStatistics() {
-		 LocalDateTime today = LocalDateTime.now();
-		 /**获取当天的yyyyMMdd时间格式 int类型*/
-		 int dateAsInt = Integer.parseInt(
-				 today.format(DateTimeFormatter.ofPattern("yyyyMMdd"))
-		 );
-		 LocalDateTime yesterday = today.minusDays(1);
-
-		 int yesterdayNum =  Integer.parseInt(
-				 yesterday.format(DateTimeFormatter.ofPattern("yyyyMMdd"))
-		 );
-		 /**获取当月的yyyyMMdd时间格式 int类型*/
-		 int firstDayInt = Integer.parseInt(today.withDayOfMonth(1).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
-		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		 FindByStatisticsVO findByStatisticsVOS =  statisticsInfoService.findByStatistics(loginUser.getOrgCode(),dateAsInt,firstDayInt,yesterdayNum);
-		 return Result.OK(findByStatisticsVOS);
-	 }
-
-	/**
-	 * 首页详情查询
-	 * @return
-	 */
-	//@AutoLog(value = "首页统计表-分页列表查询")
-	@Operation(summary="首页统计表-首页详情查询")
-	@GetMapping(value = "/findByShopMoneyList")
-	public Result<List<FindByStatisticsChartVO>> findByShopMoneyList(@RequestParam("type") Integer type) {
-
-		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		List<FindByStatisticsChartVO> findByStatisticsVOS= statisticsInfoService.findByShopMoneyList(loginUser.getOrgCode(),type);
-		return Result.OK(findByStatisticsVOS);
-	}
-	/**
-	 * 首页售卖商品数详情查询
-	 * @return
-	 */
-	//@AutoLog(value = "首页统计表-分页列表查询")
-	@Operation(summary="首页统计表-首页售卖商品数详情查询")
-	@GetMapping(value = "/findByShopSumList")
-	public Result<List<FindByShopSumVO>> findByShopSumList(@RequestParam("type") Integer type) {
-		LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		List<FindByShopSumVO> findByStatisticsVOS= statisticsInfoService.findByShopSumList(loginUser.getOrgCode(),type);
-		return Result.OK(findByStatisticsVOS);
-	}
-
-	
-	/**
-	 *   添加
-	 *
-	 * @param statisticsInfo
-	 * @return
-	 */
-	@AutoLog(value = "首页统计表-添加")
-	@Operation(summary="首页统计表-添加")
-	@RequiresPermissions("statisticsInfo:nm_statistics_info:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody StatisticsInfo statisticsInfo) {
-		statisticsInfoService.save(statisticsInfo);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param statisticsInfo
-	 * @return
-	 */
-	@AutoLog(value = "首页统计表-编辑")
-	@Operation(summary="首页统计表-编辑")
-	@RequiresPermissions("statisticsInfo:nm_statistics_info:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody StatisticsInfo statisticsInfo) {
-		statisticsInfoService.updateById(statisticsInfo);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "首页统计表-通过id删除")
-	@Operation(summary="首页统计表-通过id删除")
-	@RequiresPermissions("statisticsInfo:nm_statistics_info:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		statisticsInfoService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "首页统计表-批量删除")
-	@Operation(summary="首页统计表-批量删除")
-	@RequiresPermissions("statisticsInfo:nm_statistics_info:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.statisticsInfoService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "首页统计表-通过id查询")
-	@Operation(summary="首页统计表-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<StatisticsInfo> queryById(@RequestParam(name="id",required=true) String id) {
-		StatisticsInfo statisticsInfo = statisticsInfoService.getById(id);
-		if(statisticsInfo==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(statisticsInfo);
-	}
-	 @Operation(summary="首页统计表-通过id查询")
-	 @GetMapping(value = "/queryByCode")
-	 public Result<StatisticsInfo> queryByCode() {
-		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-		 StatisticsInfo statisticsInfo = statisticsInfoService.findByCode(loginUser.getOrgCode());
-		 if(statisticsInfo==null) {
-			 return Result.error("未找到对应数据");
-		 }
-		 return Result.OK(statisticsInfo);
-	 }
-
-
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param statisticsInfo
-    */
-    @RequiresPermissions("statisticsInfo:nm_statistics_info:exportXls")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, StatisticsInfo statisticsInfo) {
-        return super.exportXls(request, statisticsInfo, StatisticsInfo.class, "首页统计表");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequiresPermissions("statisticsInfo:nm_statistics_info:importExcel")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, StatisticsInfo.class);
-    }
-
-}

+ 0 - 164
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/StatisticsInfoHisController.java

@@ -1,164 +0,0 @@
-package org.jeecg.modules.system.app.controller;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.system.app.entity.StatisticsInfoHis;
-import org.jeecg.modules.system.app.service.IStatisticsInfoHisService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Arrays;
- /**
- * @Description: 首页统计历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Tag(name="首页统计历史记录表")
-@RestController
-@RequestMapping("/statisticsInfoHis/statisticsInfoHis")
-@Slf4j
-public class StatisticsInfoHisController extends JeecgController<StatisticsInfoHis, IStatisticsInfoHisService> {
-	@Autowired
-	private IStatisticsInfoHisService statisticsInfoHisService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param statisticsInfoHis
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "首页统计历史记录表-分页列表查询")
-	@Operation(summary="首页统计历史记录表-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<StatisticsInfoHis>> queryPageList(StatisticsInfoHis statisticsInfoHis,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-
-
-        QueryWrapper<StatisticsInfoHis> queryWrapper = QueryGenerator.initQueryWrapper(statisticsInfoHis, req.getParameterMap());
-		Page<StatisticsInfoHis> page = new Page<StatisticsInfoHis>(pageNo, pageSize);
-		IPage<StatisticsInfoHis> pageList = statisticsInfoHisService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param statisticsInfoHis
-	 * @return
-	 */
-	@AutoLog(value = "首页统计历史记录表-添加")
-	@Operation(summary="首页统计历史记录表-添加")
-	@RequiresPermissions("statisticsInfoHis:nm_statistics_info_his:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody StatisticsInfoHis statisticsInfoHis) {
-		statisticsInfoHisService.save(statisticsInfoHis);
-
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param statisticsInfoHis
-	 * @return
-	 */
-	@AutoLog(value = "首页统计历史记录表-编辑")
-	@Operation(summary="首页统计历史记录表-编辑")
-	@RequiresPermissions("statisticsInfoHis:nm_statistics_info_his:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody StatisticsInfoHis statisticsInfoHis) {
-		statisticsInfoHisService.updateById(statisticsInfoHis);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "首页统计历史记录表-通过id删除")
-	@Operation(summary="首页统计历史记录表-通过id删除")
-	@RequiresPermissions("statisticsInfoHis:nm_statistics_info_his:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		statisticsInfoHisService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "首页统计历史记录表-批量删除")
-	@Operation(summary="首页统计历史记录表-批量删除")
-	@RequiresPermissions("statisticsInfoHis:nm_statistics_info_his:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.statisticsInfoHisService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "首页统计历史记录表-通过id查询")
-	@Operation(summary="首页统计历史记录表-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<StatisticsInfoHis> queryById(@RequestParam(name="id",required=true) String id) {
-		StatisticsInfoHis statisticsInfoHis = statisticsInfoHisService.getById(id);
-		if(statisticsInfoHis==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(statisticsInfoHis);
-	}
-
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param statisticsInfoHis
-    */
-    @RequiresPermissions("statisticsInfoHis:nm_statistics_info_his:exportXls")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, StatisticsInfoHis statisticsInfoHis) {
-        return super.exportXls(request, statisticsInfoHis, StatisticsInfoHis.class, "首页统计历史记录表");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequiresPermissions("statisticsInfoHis:nm_statistics_info_his:importExcel")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, StatisticsInfoHis.class);
-    }
-
-}

+ 0 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/WebSearchHotController.java

@@ -19,7 +19,6 @@ import javax.annotation.Resource;
 public class WebSearchHotController {
     @Resource
     private IAppSearchHotService webSearchHotService;
-
     /**
      * @Author SheepHy
      * @Description 查询全部热词

+ 0 - 87
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/ShopMoney.java

@@ -1,87 +0,0 @@
-package org.jeecg.modules.system.app.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @Description: 店铺资金总数
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Data
-@TableName("nm_shop_money")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@Schema(description="店铺资金总数")
-public class ShopMoney implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**id*/
-	@TableId(type = IdType.ASSIGN_ID)
-    @Schema(description = "id")
-    private String id;
-	/**部门编码*/
-	@Excel(name = "部门编码", width = 15)
-    @Schema(description = "部门编码")
-    private String orgCode;
-	/**部门id*/
-	@Excel(name = "部门id", width = 15)
-    @Schema(description = "部门id")
-    private String deptId;
-	/**待结算金额*/
-	@Excel(name = "待结算金额", width = 15)
-    @Schema(description = "待结算金额")
-    private BigDecimal pendSettlementMoney;
-	/**可用余额*/
-	@Excel(name = "可用余额", width = 15)
-    @Schema(description = "可用余额")
-    private BigDecimal canBalance;
-	/**已到账金额*/
-	@Excel(name = "已到账金额", width = 15)
-    @Schema(description = "已到账金额")
-    private BigDecimal receivedAmount;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "创建时间")
-    private Date createTime;
-	/**修改时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "修改时间")
-    private Date updateTime;
-
-    @Excel(name = "明细id", width = 15)
-    @Schema(description = "明细id")
-    private String  receipPaymentDetailsId;
-
-
-    @Excel(name = "店铺资金状态", width = 15)
-    @Schema(description = "店铺资金状态  0-启用 1-停用")
-    @TableField(exist = false)
-    private Integer  accountStatus;
-
-    @Excel(name = "店铺名称", width = 15)
-    @Schema(description = "店铺名称  0-启用 1-停用")
-    @TableField(exist = false)
-    private String  siteName;
-
-    @Excel(name = "图片", width = 15)
-    @Schema(description = "图片")
-    @TableField(exist = false)
-    private String  siteCover;
-}

+ 0 - 70
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/ShopMoneyHis.java

@@ -1,70 +0,0 @@
-package org.jeecg.modules.system.app.entity;
-
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.util.Date;
-import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import org.jeecg.common.constant.ProvinceCityArea;
-import org.jeecg.common.util.SpringContextUtils;
-import lombok.Data;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.jeecg.common.aspect.annotation.Dict;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * @Description: 变化历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Data
-@TableName("nm_shop_money_his")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@Schema(description="变化历史记录表")
-public class ShopMoneyHis implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**id*/
-	@TableId(type = IdType.ASSIGN_ID)
-    @Schema(description = "id")
-    private String id;
-	/**部门编码*/
-	@Excel(name = "部门编码", width = 15)
-    @Schema(description = "部门编码")
-    private String orgCode;
-	/**部门id*/
-	@Excel(name = "部门id", width = 15)
-    @Schema(description = "部门id")
-    private String deptId;
-	/**待结算金额*/
-	@Excel(name = "待结算金额", width = 15)
-    @Schema(description = "待结算金额")
-    private BigDecimal pendSettlementMoney;
-	/**可用余额*/
-	@Excel(name = "可用余额", width = 15)
-    @Schema(description = "可用余额")
-    private BigDecimal canBalance;
-	/**已到账金额*/
-	@Excel(name = "已到账金额", width = 15)
-    @Schema(description = "已到账金额")
-    private BigDecimal receivedAmount;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "创建时间")
-    private Date createTime;
-	/**修改时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "修改时间")
-    private Date updateTime;
-}

+ 0 - 82
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/StatisticsInfo.java

@@ -1,82 +0,0 @@
-package org.jeecg.modules.system.app.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @Description: 首页统计表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Data
-@TableName("nm_statistics_info")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@Schema(description="首页统计表")
-public class StatisticsInfo implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**主键id*/
-	@TableId(type = IdType.ASSIGN_ID)
-    @Schema(description = "主键id")
-    private String id;
-	/**日期 列如20250813*/
-	@Excel(name = "日期 列如20250813", width = 15)
-    @Schema(description = "日期 列如20250813")
-    private Integer dateDaily;
-	/**销售金额*/
-	@Excel(name = "销售金额", width = 15)
-    @Schema(description = "销售金额")
-    private BigDecimal saleMoney =BigDecimal.ZERO;
-	/**有效订单数*/
-	@Excel(name = "有效订单数", width = 15)
-    @Schema(description = "有效订单数")
-    private Integer effectiveOrderNum=0;
-	/**预计收入*/
-	@Excel(name = "预计收入", width = 15)
-    @Schema(description = "预计收入")
-    private BigDecimal expectIncomeMoney =BigDecimal.ZERO;
-	/**消费人数*/
-	@Excel(name = "消费人数", width = 15)
-    @Schema(description = "消费人数")
-    private Integer consumeNumber=0;
-	/**新增用户数*/
-	@Excel(name = "新增用户数", width = 15)
-    @Schema(description = "新增用户数")
-    private Integer addNumber=0;
-	/**机构编码*/
-	@Excel(name = "机构编码", width = 15)
-    @Schema(description = "机构编码")
-    private String orgCode;
-	/**商户id*/
-	@Excel(name = "商户id", width = 15)
-    @Schema(description = "商户id")
-    private String deptId;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "创建时间")
-    private Date createTime;
-	/**修改时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "修改时间")
-    private Date updateTime;
-	/**明细id*/
-	@Excel(name = "明细id", width = 15)
-    @Schema(description = "明细id")
-    private String receipPaymentDetailsId;
-}

+ 0 - 90
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/StatisticsInfoHis.java

@@ -1,90 +0,0 @@
-package org.jeecg.modules.system.app.entity;
-
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.util.Date;
-import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import org.jeecg.common.constant.ProvinceCityArea;
-import org.jeecg.common.util.SpringContextUtils;
-import lombok.Data;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.jeecgframework.poi.excel.annotation.Excel;
-import org.jeecg.common.aspect.annotation.Dict;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
-
-/**
- * @Description: 首页统计历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Data
-@TableName("nm_statistics_info_his")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@Schema(description="首页统计历史记录表")
-public class StatisticsInfoHis implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-	/**主键id*/
-	@TableId(type = IdType.ASSIGN_ID)
-    @Schema(description = "主键id")
-    private String id;
-	/**日期 列如20250813*/
-	@Excel(name = "日期 列如20250813", width = 15)
-    @Schema(description = "日期 列如20250813")
-    private Integer dateDaily;
-	/**销售金额*/
-	@Excel(name = "销售金额", width = 15)
-    @Schema(description = "销售金额")
-    private BigDecimal saleMoney;
-	/**有效订单数*/
-	@Excel(name = "有效订单数", width = 15)
-    @Schema(description = "有效订单数")
-    private Integer effectiveOrderNum;
-	/**预计收入*/
-	@Excel(name = "预计收入", width = 15)
-    @Schema(description = "预计收入")
-    private BigDecimal expectIncomeMoney;
-	/**消费人数*/
-	@Excel(name = "消费人数", width = 15)
-    @Schema(description = "消费人数")
-    private Integer consumeNumber;
-	/**新增用户数*/
-	@Excel(name = "新增用户数", width = 15)
-    @Schema(description = "新增用户数")
-    private Integer addNumber;
-	/**机构编码*/
-	@Excel(name = "机构编码", width = 15)
-    @Schema(description = "机构编码")
-    private String orgCode;
-	/**商户id*/
-	@Excel(name = "商户id", width = 15)
-    @Schema(description = "商户id")
-    private String deptId;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "创建时间")
-    private Date createTime;
-	/**修改时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
-    @Schema(description = "修改时间")
-    private Date updateTime;
-	/**明细id*/
-	@Excel(name = "明细id", width = 15)
-    @Schema(description = "明细id")
-    private String receipPaymentDetailsId;
-	/**自增主键*/
-	@Excel(name = "自增主键", width = 15)
-    @Schema(description = "自增主键")
-    private Integer incrementId;
-}

+ 0 - 14
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/ShopMoneyHisMapper.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.system.app.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.system.app.entity.ShopMoneyHis;
-
-/**
- * @Description: 变化历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface ShopMoneyHisMapper extends BaseMapper<ShopMoneyHis> {
-
-}

+ 0 - 22
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/ShopMoneyMapper.java

@@ -1,22 +0,0 @@
-package org.jeecg.modules.system.app.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.system.app.entity.ShopMoney;
-
-/**
- * @Description: 店铺资金总数
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface ShopMoneyMapper extends BaseMapper<ShopMoney> {
-
-
-//    @Select("select  * from nm_shop_money where org_code =#{orgCode}")
-    ShopMoney findByOrgCode(@Param("orgCode") String orgCode);
-
-    IPage<ShopMoney> findPage(@Param("page")Page<ShopMoney> page, @Param("shopMoney")ShopMoney shopMoney);
-}

+ 0 - 14
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/StatisticsInfoHisMapper.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.system.app.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.jeecg.modules.system.app.entity.StatisticsInfoHis;
-
-/**
- * @Description: 首页统计历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface StatisticsInfoHisMapper extends BaseMapper<StatisticsInfoHis> {
-
-}

+ 0 - 28
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/StatisticsInfoMapper.java

@@ -1,28 +0,0 @@
-package org.jeecg.modules.system.app.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.jeecg.modules.system.app.entity.StatisticsInfo;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO;
-
-import java.util.List;
-
-/**
- * @Description: 首页统计表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface StatisticsInfoMapper extends BaseMapper<StatisticsInfo> {
-
-    @Select("select * from nm_statistics_info where org_code =#{orgCode} and date_daily =#{dateDaily}")
-    StatisticsInfo findByOrgCode(@Param("orgCode") String orgCode ,@Param("dateDaily")  Integer dateDaily);
-
-    @Select("select * from nm_statistics_info where org_code =#{orgCode} order by  date_daily desc limit 1")
-    StatisticsInfo findByCode(@Param("orgCode")String orgCode);
-
-    List<FindByStatisticsChartVO> findByOrgCodeAndDay(@Param("orgCode")String orgCode,@Param("dateAsInt") int dateAsInt,@Param("firstDayInt") int firstDayInt);
-
-    List<FindByStatisticsChartVO> findByShopMoneyList(@Param("orgCode")String orgCode,@Param("startTime") int startTime,@Param("endTime")  int endTime);
-}

+ 47 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/StatisticsMapper.java

@@ -0,0 +1,47 @@
+package org.jeecg.modules.system.app.mapper;
+
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface StatisticsMapper {
+    /**
+     * <p>管理端首页获取商品销量排行</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    @MapKey("ranking")
+    List<Map<String, Object>> findByShopSum(@Param("type")int type, @Param("orgCode")String orgCode);
+
+    /**
+     * <p>管理端首页获取部门售额排行</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    @MapKey("ranking")
+    List<Map<String, Object>> findByDeptSum(@Param("type")int type,@Param("orgCode")String orgCode);
+
+    /**
+     * <p>首页统计</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    Map<String, Object> findIndexStatistics(@Param("orgCode")String orgCode);
+
+    /**
+     * <p>本月销售额趋势图</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    List<Map<String, Object>> findMonthSaleTrend(@Param("orgCode")String orgCode);
+}

+ 0 - 5
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/ShopMoneyHisMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.system.app.mapper.ShopMoneyHisMapper">
-
-</mapper>

+ 0 - 39
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/ShopMoneyMapper.xml

@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.system.app.mapper.ShopMoneyMapper">
-
-    <select id="findByOrgCode" resultType="org.jeecg.modules.system.app.entity.ShopMoney">
-        select  a.id,
-                a.org_code ,
-                a.dept_id ,
-                a.pend_settlement_money ,
-                a.can_balance ,
-                a.received_amount ,
-                a.create_time ,
-                a.update_time ,
-                a.receip_payment_details_id ,
-                b.account_status
-        from nm_shop_money a
-        left join  nm_separate_accounts  b on a.dept_id =b.dept_id
-        where a.org_code =#{orgCode} limit 1
-    </select>
-    <select id="findPage" resultType="org.jeecg.modules.system.app.entity.ShopMoney">
-        SELECT a.id,
-        a.org_code ,
-        a.dept_id ,
-        a.pend_settlement_money ,
-        a.can_balance ,
-        a.received_amount ,
-        a.create_time ,
-        a.update_time ,
-        a.receip_payment_details_id ,
-        b.name as siteName,b.cover as siteCover FROM nm_shop_money a
-        inner join nm_site b on a.org_code = b.org_code
-        where 1=1
-        <if test="shopMoney != null and shopMoney != ''">
-            <if test="shopMoney.siteName != null and shopMoney.siteName  != ''">
-                AND b.name = #{shopMoney.siteName}
-            </if>
-        </if>
-    </select>
-</mapper>

+ 0 - 5
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/StatisticsInfoHisMapper.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.system.app.mapper.StatisticsInfoHisMapper">
-
-</mapper>

+ 0 - 22
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/StatisticsInfoMapper.xml

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.system.app.mapper.StatisticsInfoMapper">
-
-    <select id="findByOrgCodeAndDay"
-            resultType="org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO">
-        <![CDATA[select * from nm_statistics_info  where org_code =#{orgCode} and date_daily >=#{firstDayInt} and date_daily <= #{dateAsInt}]]>
-    </select>
-    <select id="findByShopMoneyList"
-            resultType="org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO">
-         <![CDATA[
-        select
-                b.name as deptName,
-                COALESCE(SUM(sale_money), 0) as saleMoney,
-                b.id from  nm_site b
-         left join  nm_statistics_info a on a.dept_id =b.tenant_id  and a.date_daily >=#{startTime} and a.date_daily <= #{endTime}
-         where  b.org_code like CONCAT('',#{orgCode},'%')   and b.del_flag =0
-        group by  b.id
-        order by  saleMoney desc
-         ]]>
-    </select>
-</mapper>

+ 256 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/StatisticsMapper.xml

@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.system.app.mapper.StatisticsMapper">
+    <select id="findByShopSum" resultType="map">
+        SELECT
+            product_name,
+            SUM(quantity) AS total_quantity,
+            SUM(price) AS total_price,
+            ROW_NUMBER() OVER (ORDER BY SUM(quantity) DESC, SUM(price) DESC) AS ranking
+        FROM nm_order_pro_info opi
+                 JOIN nm_order o ON opi.order_code = o.order_code
+                 JOIN nm_site s ON o.org_code = s.org_code
+        WHERE opi.type NOT IN (0,3, 4, 6)
+            AND opi.order_status NOT IN (3, 4, 5, 6)
+            AND (
+                  (#{type} = 1 AND DATE(opi.create_time) = CURDATE()) OR
+            (#{type} = 2 AND YEARWEEK(opi.create_time, 1) = YEARWEEK(CURDATE(), 1)) OR
+            (#{type} = 3 AND YEAR(opi.create_time) = YEAR(CURDATE()) AND MONTH(opi.create_time) = MONTH(CURDATE())) OR
+            (#{type} IS NULL OR #{type} NOT IN (1,2,3))
+            )
+          AND s.org_code LIKE CONCAT(#{orgCode}, '%')
+        GROUP BY product_name
+        ORDER BY total_quantity DESC, total_price DESC
+            LIMIT 30;
+    </select>
+
+    <select id="findByDeptSum" resultType="map">
+        SELECT
+            s.name AS name,
+            SUM(opi.price) AS total_price,
+            ROW_NUMBER() OVER (ORDER BY SUM(opi.quantity) DESC, SUM(opi.price) DESC) AS ranking
+        FROM nm_order_pro_info opi
+                 JOIN nm_order o ON opi.order_code = o.order_code
+                 JOIN nm_site s ON o.org_code = s.org_code
+        WHERE opi.type NOT IN (0,3,4,6)
+          AND opi.order_status NOT IN (3,4,5,6)
+          AND (
+            (#{type} = 1 AND opi.create_time >= CURDATE() AND opi.create_time &lt; CURDATE() + INTERVAL 1 DAY) OR
+            (#{type} = 2 AND opi.create_time >= DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY) AND opi.create_time &lt; DATE_SUB(CURDATE(), INTERVAL WEEKDAY(CURDATE()) DAY) + INTERVAL 7 DAY) OR
+            (#{type} = 3 AND opi.create_time >= DATE_FORMAT(CURDATE(), '%Y-%m-01') AND opi.create_time &lt; DATE_FORMAT(CURDATE(), '%Y-%m-01') + INTERVAL 1 MONTH) OR
+            (#{type} IS NULL OR #{type} NOT IN (1,2,3))
+            )
+          AND s.org_code LIKE CONCAT(#{orgCode}, '%')
+        GROUP BY s.org_code
+        ORDER BY total_price DESC
+            LIMIT 30
+    </select>
+
+    <select id="findIndexStatistics" resultType="map">
+        -- 今日和昨日数据对比
+        SELECT
+            today.salesAmount AS salesAmount,
+            yesterday.salesAmount AS yesterdaySalesAmount,
+            CASE
+                WHEN yesterday.salesAmount = 0 THEN '无环比数据'
+                ELSE CONCAT(
+                        CASE WHEN (today.salesAmount - yesterday.salesAmount) / yesterday.salesAmount >= 0 THEN '+' ELSE '' END,
+                        ROUND(((today.salesAmount - yesterday.salesAmount) / yesterday.salesAmount) * 100, 2), '%'
+                     )
+                END AS salesGrowthRate,
+
+            today.insuranceSalesAmount AS insuranceSalesAmount,
+            yesterday.insuranceSalesAmount AS yesterdayInsuranceSalesAmount,
+            CASE
+                WHEN yesterday.insuranceSalesAmount = 0 THEN '无环比数据'
+                ELSE CONCAT(
+                        CASE WHEN (today.insuranceSalesAmount - yesterday.insuranceSalesAmount) / yesterday.insuranceSalesAmount >= 0 THEN '+' ELSE '' END,
+                        ROUND(((today.insuranceSalesAmount - yesterday.insuranceSalesAmount) / yesterday.insuranceSalesAmount) * 100, 2), '%'
+                     )
+                END AS insuranceSalesGrowthRate,
+
+            today.validOrderCount AS validOrderCount,
+            yesterday.validOrderCount AS yesterdayValidOrderCount,
+            CASE
+                WHEN yesterday.validOrderCount = 0 THEN '无环比数据'
+                ELSE CONCAT(
+                        CASE WHEN (today.validOrderCount - yesterday.validOrderCount) / yesterday.validOrderCount >= 0 THEN '+' ELSE '' END,
+                        ROUND(((today.validOrderCount - yesterday.validOrderCount) / yesterday.validOrderCount) * 100, 2), '%'
+                     )
+                END AS validOrderGrowthRate,
+
+            today.expectedIncome AS expectedIncome,
+            yesterday.expectedIncome AS yesterdayExpectedIncome,
+            CASE
+                WHEN yesterday.expectedIncome = 0 THEN '无环比数据'
+                ELSE CONCAT(
+                        CASE WHEN (today.expectedIncome - yesterday.expectedIncome) / yesterday.expectedIncome >= 0 THEN '+' ELSE '' END,
+                        ROUND(((today.expectedIncome - yesterday.expectedIncome) / yesterday.expectedIncome) * 100, 2), '%'
+                     )
+                END AS expectedIncomeGrowthRate,
+
+            today.platformConsumptionUsers AS platformConsumptionUsers,
+            yesterday.platformConsumptionUsers AS yesterdayPlatformConsumptionUsers,
+            CASE
+                WHEN yesterday.platformConsumptionUsers = 0 THEN '无环比数据'
+                ELSE CONCAT(
+                        CASE WHEN (today.platformConsumptionUsers - yesterday.platformConsumptionUsers) / yesterday.platformConsumptionUsers >= 0 THEN '+' ELSE '' END,
+                        ROUND(((today.platformConsumptionUsers - yesterday.platformConsumptionUsers) / yesterday.platformConsumptionUsers) * 100, 2), '%'
+                     )
+                END AS platformConsumptionGrowthRate,
+
+            today.newUsersCount AS newUsersCount,
+            yesterday.newUsersCount AS yesterdayNewUsersCount,
+            CASE
+                WHEN yesterday.newUsersCount = 0 THEN '无环比数据'
+                ELSE CONCAT(
+                        CASE WHEN (today.newUsersCount - yesterday.newUsersCount) / yesterday.newUsersCount >= 0 THEN '+' ELSE '' END,
+                        ROUND(((today.newUsersCount - yesterday.newUsersCount) / yesterday.newUsersCount) * 100, 2), '%'
+                     )
+                END AS newUsersGrowthRate
+
+        FROM (
+                 -- 今日数据
+                 SELECT
+                     COALESCE((
+                                  SELECT SUM(nm_order_pro_info.price)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = CURDATE()
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS salesAmount,
+
+                     COALESCE((
+                                  SELECT SUM(nm_order_pro_info.price)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = CURDATE()
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order_pro_info.type = 6
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS insuranceSalesAmount,
+
+                     COALESCE((
+                                  SELECT COUNT(nm_order_pro_info.id)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = CURDATE()
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS validOrderCount,
+
+                     COALESCE((
+                                  SELECT SUM(pre_amount) / 100
+                                  FROM nm_profit_sharing_info
+                                  WHERE org_code = #{orgCode}
+                                    AND DATE(create_time) = CURDATE()
+                         ), 0) AS expectedIncome,
+
+                     COALESCE((
+                                  SELECT COUNT(DISTINCT nm_order_pro_info.family_user_id)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = CURDATE()
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS platformConsumptionUsers,
+
+                     COALESCE((
+                                  SELECT COUNT(id)
+                                  FROM sys_user
+                                  WHERE user_identity = 3
+                                    AND DATE(create_time) = CURDATE()
+                         ), 0) AS newUsersCount
+                 FROM DUAL
+             ) today,
+
+             (
+                 -- 昨日数据
+                 SELECT
+                     COALESCE((
+                                  SELECT SUM(nm_order_pro_info.price)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS salesAmount,
+
+                     COALESCE((
+                                  SELECT SUM(nm_order_pro_info.price)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order_pro_info.type = 6
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS insuranceSalesAmount,
+
+                     COALESCE((
+                                  SELECT COUNT(nm_order_pro_info.id)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS validOrderCount,
+
+                     COALESCE((
+                                  SELECT SUM(pre_amount) / 100
+                                  FROM nm_profit_sharing_info
+                                  WHERE org_code = #{orgCode}
+                                    AND DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
+                         ), 0) AS expectedIncome,
+
+                     COALESCE((
+                                  SELECT COUNT(DISTINCT nm_order_pro_info.family_user_id)
+                                  FROM nm_order_pro_info
+                                           LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+                                  WHERE DATE(nm_order_pro_info.create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
+                                  AND nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                                  AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                         ), 0) AS platformConsumptionUsers,
+
+                     COALESCE((
+                                  SELECT COUNT(id)
+                                  FROM sys_user
+                                  WHERE user_identity = 3
+                                    AND DATE(create_time) = DATE_SUB(CURDATE(), INTERVAL 1 DAY)
+                         ), 0) AS newUsersCount
+                 FROM DUAL
+             ) yesterday
+    </select>
+
+    <select id="findMonthSaleTrend" resultType="map">
+        WITH RECURSIVE date_range AS (
+            SELECT
+                DATE(CONCAT(YEAR(CURDATE()), '-', MONTH(CURDATE()), '-01')) AS date
+            UNION ALL
+            SELECT
+                date + INTERVAL 1 DAY
+            FROM date_range
+            WHERE date &lt; CURDATE()
+        ),
+        sales_data AS (
+            SELECT
+                DATE(nm_order_pro_info.create_time) AS sales_date,
+                SUM(nm_order_pro_info.price) AS daily_sales_amount
+            FROM nm_order_pro_info
+            LEFT JOIN nm_order ON nm_order_pro_info.order_code = nm_order.order_code
+            WHERE
+                nm_order_pro_info.order_status NOT IN (3, 4, 5, 6)
+                AND nm_order.org_code LIKE CONCAT(#{orgCode}, '%')
+                AND YEAR(nm_order_pro_info.create_time) = YEAR(CURDATE())
+                AND MONTH(nm_order_pro_info.create_time) = MONTH(CURDATE())
+                AND DAY(nm_order_pro_info.create_time) &lt;= DAY(CURDATE())
+            GROUP BY DATE(nm_order_pro_info.create_time)
+        )
+        SELECT
+            dr.date,
+            COALESCE(sd.daily_sales_amount, 0) AS dailySalesAmount
+        FROM date_range dr
+        LEFT JOIN sales_data sd ON dr.date = sd.sales_date
+        ORDER BY dr.date ASC
+    </select>
+</mapper>

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppCoureseService.java

@@ -52,7 +52,7 @@ public interface IAppCoureseService extends IService<AppCourses> {
 
     List<AppSiteAddressDTO> queryAddressList();
 
-    List<CoursesPriceRulesVO> getCourseInfo(String courseId,String orderId);
+    List<CoursesPriceRulesVO> getCourseInfo(String courseId);
 
     Boolean temporaryCourse(TemporaryCourseForm temporaryCourseForm);
 

+ 0 - 22
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IReceiptPaymentDetailsInfoService.java

@@ -1,22 +0,0 @@
-package org.jeecg.modules.system.app.service;
-
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.system.app.dto.receiptPaymentDetails.ReceiptPaymentDetailsInfoVo;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-
-/**
- * @Description: 店铺资金明细
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface IReceiptPaymentDetailsInfoService extends IService<ReceiptPaymentDetailsInfo> {
-
-    Result<String>  add(ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVo);
-
-    IPage<ReceiptPaymentDetailsInfo> findPage(Page<ReceiptPaymentDetailsInfo> page, ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo);
-}

+ 0 - 14
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IShopMoneyHisService.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.system.app.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.system.app.entity.ShopMoneyHis;
-
-/**
- * @Description: 变化历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface IShopMoneyHisService extends IService<ShopMoneyHis> {
-
-}

+ 0 - 24
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IShopMoneyService.java

@@ -1,24 +0,0 @@
-package org.jeecg.modules.system.app.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-import org.jeecg.modules.system.app.entity.ShopMoney;
-
-/**
- * @Description: 店铺资金总数
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface IShopMoneyService extends IService<ShopMoney> {
-
-    ShopMoney findByOrgCode(String orgCode);
-
-
-    Result<String> add(ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo);
-
-    IPage<ShopMoney> findPage(Page<ShopMoney> page, ShopMoney shopMoney);
-}

+ 0 - 14
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IStatisticsInfoHisService.java

@@ -1,14 +0,0 @@
-package org.jeecg.modules.system.app.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.modules.system.app.entity.StatisticsInfoHis;
-
-/**
- * @Description: 首页统计历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface IStatisticsInfoHisService extends IService<StatisticsInfoHis> {
-
-}

+ 0 - 31
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IStatisticsInfoService.java

@@ -1,31 +0,0 @@
-package org.jeecg.modules.system.app.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-import org.jeecg.modules.system.app.entity.StatisticsInfo;
-import org.jeecg.modules.system.app.vo.statistics.FindByShopSumVO;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsVO;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-/**
- * @Description: 首页统计表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-public interface IStatisticsInfoService extends IService<StatisticsInfo> {
-
-    Result<String> add(ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo, BigDecimal money);
-
-    StatisticsInfo findByCode(String orgCode);
-
-    FindByStatisticsVO findByStatistics(String orgCode, int dateAsInt, int firstDayInt, int yesterdayNum );
-
-    List<FindByStatisticsChartVO> findByShopMoneyList(String orgCode, Integer type);
-
-    List<FindByShopSumVO> findByShopSumList(String orgCode, Integer type);
-}

+ 43 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IStatisticsService.java

@@ -0,0 +1,43 @@
+package org.jeecg.modules.system.app.service;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IStatisticsService {
+    /**
+     * <p>管理端首页获取商品销量排行</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    List<Map<String, Object>> findByShopSum(int type);
+
+    /**
+     * <p>管理端首页获取部门售额排行</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    List<Map<String, Object>> findByDeptSum(int type);
+
+    /**
+     * <p>首页统计</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    Map<String, Object> findIndexStatistics();
+
+    /**
+     * <p>本月销售额趋势图</p>
+     * @author SheepHy
+     * @param 参数描述,参数为类则包含{@link Object}
+     * @return 返回值描述,如无返回值则为void 返回值为类则包含{@link object}
+     *
+     */
+    List<Map<String, Object>> findMonthSaleTrend();
+
+}

+ 3 - 13
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java

@@ -302,23 +302,13 @@ public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCour
     }
 
     @Override
-    public List<CoursesPriceRulesVO> getCourseInfo(String courseId,String orderId) {
+    public List<CoursesPriceRulesVO> getCourseInfo(String courseId) {
 
-        AppOrder appOrder = appOrderMapper.selectById(orderId);
 
         List<CoursesPriceRulesVO> verifyCourseInfoDTOList = new ArrayList<>();
 
-        List<AppCoursesPriceRules> priceRulesList;
-        if(appOrder.getOrderType() == 5 && appOrder.getOrderOrFree() == 1){
-            priceRulesList = priceRulesMapper.selectList(Wrappers.lambdaQuery(AppCoursesPriceRules.class)
-                    .eq(AppCoursesPriceRules::getCoursesId, courseId)
-                    .orderByAsc(AppCoursesPriceRules::getStartTime)
-                    .last("LIMIT 1"));
-        }else {
-            priceRulesList = priceRulesMapper.selectList(Wrappers.lambdaQuery(AppCoursesPriceRules.class)
-                    .eq(AppCoursesPriceRules::getCoursesId, courseId)
-                    .orderByAsc(AppCoursesPriceRules::getStartTime));
-        }
+        List<AppCoursesPriceRules> priceRulesList = priceRulesMapper.selectList(Wrappers.lambdaQuery(AppCoursesPriceRules.class).eq(AppCoursesPriceRules::getCoursesId, courseId));
+
 //        Map<Integer, List<AppCoursesPriceRules>> map = priceRulesList.stream().collect(Collectors.groupingBy(AppCoursesPriceRules::getCoursesType));
 
         for (AppCoursesPriceRules priceRules : priceRulesList) {

+ 3 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoursesVerificationRecordServiceImpl.java

@@ -88,7 +88,9 @@ public class AppCoursesVerificationRecordServiceImpl extends ServiceImpl<AppCour
                 String useUserId = verificationRecord.getUseUserId();
                 String coursesId = verificationRecord.getCoursesId();
                 List<AppOrderProInfo> orderProInfoList =
-                        appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getFamilyUserId, useUserId).eq(AppOrderProInfo::getProductId, coursesId));
+                        appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery()
+                                .eq(AppOrderProInfo::getFamilyUserId, useUserId)
+                                .eq(AppOrderProInfo::getProductId, coursesId));
                 if (ObjectUtil.isNotEmpty(orderProInfoList)) {
                     for (AppOrderProInfo orderProInfo : orderProInfoList) {
                         orderProInfo.setOrderStatus(CommonConstant.ORDER_STATUS_2);

+ 0 - 119
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/ReceiptPaymentDetailsInfoServiceImpl.java

@@ -1,119 +0,0 @@
-package org.jeecg.modules.system.app.service.impl;
-
-
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.apache.commons.lang3.ObjectUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.modules.system.app.dto.receiptPaymentDetails.ReceiptPaymentDetailsInfoVo;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-import org.jeecg.modules.system.app.mapper.ReceiptPaymentDetailsInfoMapper;
-import org.jeecg.modules.system.app.service.IReceiptPaymentDetailsInfoService;
-import org.jeecg.modules.system.app.service.IShopMoneyService;
-import org.jeecg.modules.system.app.service.IStatisticsInfoService;
-import org.jeecg.modules.system.entity.SysDepart;
-import org.jeecg.modules.system.mapper.SysDepartMapper;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import javax.validation.Valid;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @Description: 店铺资金明细
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Service
-public class ReceiptPaymentDetailsInfoServiceImpl extends ServiceImpl<ReceiptPaymentDetailsInfoMapper, ReceiptPaymentDetailsInfo> implements IReceiptPaymentDetailsInfoService {
-
-    @Autowired
-    ReceiptPaymentDetailsInfoMapper receiptPaymentDetailsInfoMapper;
-    SysDepartMapper sysDepartMapper;
-
-    @Autowired
-    IShopMoneyService iShopMoneyService;
-
-    @Autowired
-    IStatisticsInfoService iStatisticsInfoService;
-
-    @Override
-    public Result<String> add(@Valid ReceiptPaymentDetailsInfoVo receiptPaymentDetailsInfoVo) {
-        ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo = new ReceiptPaymentDetailsInfo();
-        BeanUtils.copyProperties(receiptPaymentDetailsInfoVo,receiptPaymentDetailsInfo);
-        if (StringUtils.isEmpty(receiptPaymentDetailsInfo.getOrgCode())){
-            return Result.error("添加资金明细失败,机构编码为空");
-        }
-        if (ObjectUtils.isEmpty(receiptPaymentDetailsInfo.getPurseChangeReason())){
-            return Result.error("添加资金明细失败,资金变化原因为空");
-        }
-        if (receiptPaymentDetailsInfo.getPurseChangeReason()==0||receiptPaymentDetailsInfo.getPurseChangeReason()==1){//用户支付和退款
-            receiptPaymentDetailsInfo.setMoneyType(0);//待结算
-        } else if (receiptPaymentDetailsInfo.getPurseChangeReason()==2) {//分账
-            receiptPaymentDetailsInfo.setMoneyType(1);//可用余额
-        } else if (receiptPaymentDetailsInfo.getPurseChangeReason()==3) {//银行卡导致
-            receiptPaymentDetailsInfo.setMoneyType(2);//已到账金额
-        }
-        SysDepart sysDepart = sysDepartMapper.findByOrgCode(receiptPaymentDetailsInfo.getOrgCode());
-        receiptPaymentDetailsInfo.setDeptId(sysDepart.getId());
-        ReceiptPaymentDetailsInfo receiptPaymentDetailsInfoOld =  receiptPaymentDetailsInfoMapper.findByOrgCode(receiptPaymentDetailsInfo.getOrgCode());
-        BigDecimal bigDecimal =null;
-        if (receiptPaymentDetailsInfoOld==null||receiptPaymentDetailsInfoOld.getAfterMoney()==null){
-            bigDecimal =BigDecimal.ZERO;
-        }else {
-            bigDecimal= receiptPaymentDetailsInfoOld.getAfterMoney();
-        }
-        receiptPaymentDetailsInfo.setBeforeMoney(bigDecimal);
-        receiptPaymentDetailsInfo.setAfterMoney(bigDecimal.add(receiptPaymentDetailsInfo.getChangeMoney()));
-        receiptPaymentDetailsInfo.setChangeMoney(receiptPaymentDetailsInfo.getChangeMoney());
-        receiptPaymentDetailsInfo.setCreateTime(new Date());
-        receiptPaymentDetailsInfo.setUpdateTime(new Date());
-        int insert = receiptPaymentDetailsInfoMapper.insert(receiptPaymentDetailsInfo);
-
-        if (insert!=1){
-            return Result.error("添加资金明细失败");
-        }
-        if (ObjectUtils.isEmpty(receiptPaymentDetailsInfoVo.getDeptType())){
-            return Result.error("添加资金明细成功,保存总额失败,部门类型不能为空");
-        }
-        //需要nm_statistics_info这个表里面插数据 只属于支出和退款进行
-        if (receiptPaymentDetailsInfoVo.getPurseChangeReason()==0||receiptPaymentDetailsInfoVo.getPurseChangeReason()==1){
-            Result<String> addResult = null;
-            try {
-                addResult = iStatisticsInfoService.add(receiptPaymentDetailsInfo,receiptPaymentDetailsInfoVo.getMoney());
-            } catch (Exception e) {
-                log.error("保存首页数据:"+JSONObject.toJSONString(e));
-                log.error("保存首页数据:"+e.getMessage());
-            }
-            if (addResult !=null&&!addResult.isSuccess()){
-                return addResult;
-            }
-        }
-        if (receiptPaymentDetailsInfoVo.getDeptType()==2){
-            Result<String> result= null;
-            try {
-                result = iShopMoneyService.add(receiptPaymentDetailsInfo);
-            } catch (Exception e) {
-                log.error("保存店铺数据:"+JSONObject.toJSONString(e));
-                log.error("保存店铺数据:"+e.getMessage());
-            }
-            if (result !=null&&!result.isSuccess()){
-                return result;
-            }
-        }
-
-
-        return Result.ok("成功");
-    }
-
-    @Override
-    public IPage<ReceiptPaymentDetailsInfo> findPage(Page<ReceiptPaymentDetailsInfo> page, ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo) {
-        return receiptPaymentDetailsInfoMapper.findPage(page,receiptPaymentDetailsInfo);
-    }
-}

+ 0 - 18
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/ShopMoneyHisServiceImpl.java

@@ -1,18 +0,0 @@
-package org.jeecg.modules.system.app.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.modules.system.app.entity.ShopMoneyHis;
-import org.jeecg.modules.system.app.mapper.ShopMoneyHisMapper;
-import org.jeecg.modules.system.app.service.IShopMoneyHisService;
-import org.springframework.stereotype.Service;
-
-/**
- * @Description: 变化历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Service
-public class ShopMoneyHisServiceImpl extends ServiceImpl<ShopMoneyHisMapper, ShopMoneyHis> implements IShopMoneyHisService {
-
-}

+ 0 - 115
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/ShopMoneyServiceImpl.java

@@ -1,115 +0,0 @@
-package org.jeecg.modules.system.app.service.impl;
-
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.exception.JeecgBootException;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-import org.jeecg.modules.system.app.entity.ShopMoney;
-import org.jeecg.modules.system.app.entity.ShopMoneyHis;
-import org.jeecg.modules.system.app.mapper.ShopMoneyHisMapper;
-import org.jeecg.modules.system.app.mapper.ShopMoneyMapper;
-import org.jeecg.modules.system.app.service.IShopMoneyService;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @Description: 店铺资金总数
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Service
-public class ShopMoneyServiceImpl extends ServiceImpl<ShopMoneyMapper, ShopMoney> implements IShopMoneyService {
-
-    @Autowired
-    ShopMoneyMapper shopMoneyMapper;
-
-    @Autowired
-    ShopMoneyHisMapper shopMoneyHisMapper;
-
-
-    @Override
-    public ShopMoney findByOrgCode(String orgCode) {
-        return shopMoneyMapper.findByOrgCode(orgCode);
-    }
-
-    @Override
-    @Transactional
-    public Result<String> add(ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo) {
-        ShopMoney shopMoney= shopMoneyMapper.findByOrgCode(receiptPaymentDetailsInfo.getOrgCode());
-        if (shopMoney==null){
-            if (receiptPaymentDetailsInfo.getPayType()==1){
-                return Result.error("不存在待结算金额,无法进行支出操作");
-            }
-            if (receiptPaymentDetailsInfo.getPayType()==0&&receiptPaymentDetailsInfo.getPurseChangeReason()==2){
-                return Result.error("不存在待结算金额,无法进行提现操作");
-            }
-            shopMoney =  new ShopMoney();
-            BeanUtils.copyProperties(receiptPaymentDetailsInfo,shopMoney);
-            shopMoney.setPendSettlementMoney(receiptPaymentDetailsInfo.getChangeMoney());
-            shopMoney.setReceipPaymentDetailsId(receiptPaymentDetailsInfo.getId());
-        }else {
-            ShopMoneyHis shopMoneyHis = new ShopMoneyHis();
-            BeanUtils.copyProperties(shopMoney,shopMoneyHis);
-            shopMoneyHis.setCreateTime(new Date());
-            shopMoneyHis.setUpdateTime(new Date());
-            int insert = shopMoneyHisMapper.insert(shopMoneyHis);
-            if (insert!=1){
-                throw new JeecgBootException("报错店铺资金历史错误,保存失败");
-//                return Result.error("报错店铺资金错误,保存失败");
-            }
-
-            if (receiptPaymentDetailsInfo.getPurseChangeReason()==2){//分账
-                shopMoney.setCanBalance(shopMoney.getCanBalance().add(receiptPaymentDetailsInfo.getChangeMoney()));
-                BigDecimal bigDecimal = getBigDecimal(shopMoney.getPendSettlementMoney(), receiptPaymentDetailsInfo.getChangeMoney());
-                shopMoney.setPendSettlementMoney(bigDecimal);
-                shopMoney.setUpdateTime(new Date());
-            }else if (receiptPaymentDetailsInfo.getPurseChangeReason()==3){//提现
-                shopMoney.setReceivedAmount( shopMoney.getReceivedAmount().add(receiptPaymentDetailsInfo.getChangeMoney()));
-                BigDecimal bigDecimal = getBigDecimal(shopMoney.getCanBalance(), receiptPaymentDetailsInfo.getChangeMoney());
-                shopMoney.setCanBalance(bigDecimal);
-                shopMoney.setUpdateTime(new Date());
-            }else if (receiptPaymentDetailsInfo.getPurseChangeReason()==1){//退款
-                BigDecimal bigDecimal = getBigDecimal(shopMoney.getPendSettlementMoney(), receiptPaymentDetailsInfo.getChangeMoney());
-                shopMoney.setPendSettlementMoney(bigDecimal);
-                shopMoney.setUpdateTime(new Date());
-            } else if (receiptPaymentDetailsInfo.getPurseChangeReason()==0) {//支付
-                shopMoney.setPendSettlementMoney(shopMoney.getPendSettlementMoney().add(receiptPaymentDetailsInfo.getChangeMoney()));
-                shopMoney.setUpdateTime(new Date());
-            }
-
-        }
-        shopMoney.setReceipPaymentDetailsId(receiptPaymentDetailsInfo.getId());
-        int insertShopMoney = shopMoneyMapper.insert(shopMoney);
-        if (insertShopMoney!=1){
-            throw new JeecgBootException("报错店铺资金错误,保存失败");
-//                return Result.error("报错店铺资金错误,保存失败");
-        }
-        return Result.ok("成功");
-    }
-
-    @Override
-    public IPage<ShopMoney> findPage(Page<ShopMoney> page, ShopMoney shopMoney) {
-        return shopMoneyMapper.findPage(page,shopMoney);
-    }
-
-    private BigDecimal getBigDecimal(BigDecimal bigDecimal1 ,BigDecimal bigDecimal2 ){
-        if (bigDecimal2.compareTo(BigDecimal.ZERO) <= 0) {
-            throw new IllegalArgumentException("扣款金额必须大于0");
-        }
-
-        if (bigDecimal1.compareTo(bigDecimal2) < 0) {
-            throw new IllegalArgumentException("余额不足");
-        }
-
-        return bigDecimal1.subtract(bigDecimal2);
-    }
-}

+ 0 - 18
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/StatisticsInfoHisServiceImpl.java

@@ -1,18 +0,0 @@
-package org.jeecg.modules.system.app.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.modules.system.app.entity.StatisticsInfoHis;
-import org.jeecg.modules.system.app.mapper.StatisticsInfoHisMapper;
-import org.jeecg.modules.system.app.service.IStatisticsInfoHisService;
-import org.springframework.stereotype.Service;
-
-/**
- * @Description: 首页统计历史记录表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Service
-public class StatisticsInfoHisServiceImpl extends ServiceImpl<StatisticsInfoHisMapper, StatisticsInfoHis> implements IStatisticsInfoHisService {
-
-}

+ 0 - 208
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/StatisticsInfoServiceImpl.java

@@ -1,208 +0,0 @@
-package org.jeecg.modules.system.app.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.exception.JeecgBootException;
-import org.jeecg.modules.system.app.entity.ReceiptPaymentDetailsInfo;
-import org.jeecg.modules.system.app.entity.StatisticsInfo;
-import org.jeecg.modules.system.app.entity.StatisticsInfoHis;
-import org.jeecg.modules.system.app.mapper.AppOrderMapper;
-import org.jeecg.modules.system.app.mapper.StatisticsInfoHisMapper;
-import org.jeecg.modules.system.app.mapper.StatisticsInfoMapper;
-import org.jeecg.modules.system.app.service.IStatisticsInfoService;
-import org.jeecg.modules.system.app.vo.statistics.FindByShopSumVO;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsChartVO;
-import org.jeecg.modules.system.app.vo.statistics.FindByStatisticsVO;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.time.DayOfWeek;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.time.temporal.TemporalAdjusters;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @Description: 首页统计表
- * @Author: jeecg-boot
- * @Date:   2025-08-18
- * @Version: V1.0
- */
-@Service
-public class StatisticsInfoServiceImpl extends ServiceImpl<StatisticsInfoMapper, StatisticsInfo> implements IStatisticsInfoService {
-
-    @Autowired
-    StatisticsInfoMapper statisticsInfoMapper;
-
-    @Autowired
-    StatisticsInfoHisMapper statisticsInfoHisMapper;
-
-    @Autowired
-    AppOrderMapper appOrderMapper;
-
-    @Override
-    public Result<String> add(ReceiptPaymentDetailsInfo receiptPaymentDetailsInfo,BigDecimal money) {
-        int dateAsInt = Integer.parseInt(
-                LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))
-        );
-        StatisticsInfo statisticsInfo= statisticsInfoMapper.findByOrgCode(receiptPaymentDetailsInfo.getOrgCode(),dateAsInt);
-        if (statisticsInfo==null){
-            statisticsInfo =  new StatisticsInfo();
-            BeanUtils.copyProperties(receiptPaymentDetailsInfo,statisticsInfo);
-            statisticsInfo.setDateDaily(dateAsInt);
-        }else {
-            StatisticsInfoHis statisticsInfoHis = new StatisticsInfoHis();
-            BeanUtils.copyProperties(statisticsInfo,statisticsInfoHis);
-            statisticsInfoHis.setCreateTime(new Date());
-            statisticsInfoHis.setUpdateTime(new Date());
-            int insert = statisticsInfoHisMapper.insert(statisticsInfoHis);
-            if (insert!=1){
-                throw new JeecgBootException("报错首页统计历史错误,保存失败");
-            }
-
-        }
-        if (receiptPaymentDetailsInfo.getPayType()==0){
-            statisticsInfo.setConsumeNumber(statisticsInfo.getConsumeNumber()+1);
-            statisticsInfo.setSaleMoney(statisticsInfo.getSaleMoney().add(money));
-            statisticsInfo.setExpectIncomeMoney(statisticsInfo.getExpectIncomeMoney().add(receiptPaymentDetailsInfo.getChangeMoney()));
-            statisticsInfo.setEffectiveOrderNum(statisticsInfo.getEffectiveOrderNum()+1);
-        }else if (receiptPaymentDetailsInfo.getPayType()==1){
-            statisticsInfo.setEffectiveOrderNum(statisticsInfo.getEffectiveOrderNum()-1);
-            statisticsInfo.setSaleMoney(statisticsInfo.getSaleMoney().subtract(money));
-            statisticsInfo.setExpectIncomeMoney(statisticsInfo.getExpectIncomeMoney().subtract(receiptPaymentDetailsInfo.getChangeMoney()));
-        }
-        statisticsInfo.setUpdateTime(new Date());
-        statisticsInfo.setReceipPaymentDetailsId(receiptPaymentDetailsInfo.getId());
-        return Result.ok("成功");
-    }
-
-    @Override
-    public StatisticsInfo findByCode(String orgCode) {
-        return statisticsInfoMapper.findByCode(orgCode);
-    }
-
-    @Override
-    public FindByStatisticsVO findByStatistics(String orgCode, int dateAsInt, int firstDayInt,int yesterdayNum ) {
-        StatisticsInfo byOrgCode = statisticsInfoMapper.findByOrgCode(orgCode, dateAsInt);
-        FindByStatisticsVO findByStatisticsVO =new FindByStatisticsVO();
-        if(byOrgCode!=null){
-            BeanUtils.copyProperties(byOrgCode,findByStatisticsVO);
-        }
-        // 定义日期格式(yyyyMMdd)
-        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
-        List<FindByStatisticsChartVO>    findByStatisticsChartVOS = statisticsInfoMapper.findByOrgCodeAndDay(orgCode,dateAsInt,firstDayInt);
-        for (FindByStatisticsChartVO findByStatisticsChartVO : findByStatisticsChartVOS) {
-            Integer dateDaily = findByStatisticsChartVO.getDateDaily();
-            // 解析为 LocalDate
-            LocalDate date = LocalDate.parse(String.valueOf(dateDaily), formatter);
-            findByStatisticsChartVO.setDateDailyDate(date);
-        }
-        StatisticsInfo byOrgCodeOld = statisticsInfoMapper.findByOrgCode(orgCode, yesterdayNum);
-        getStatisticsInfo(byOrgCode,byOrgCodeOld,findByStatisticsVO);
-        findByStatisticsVO.setFindByStatisticsChartVOList(findByStatisticsChartVOS);
-        return findByStatisticsVO;
-    }
-
-    @Override
-    public List<FindByStatisticsChartVO> findByShopMoneyList(String orgCode,Integer type) {
-        LocalDateTime today = LocalDateTime.now();
-        /**获取当天的yyyyMMdd时间格式 int类型*/
-        int endTime = Integer.parseInt(
-                today.format(DateTimeFormatter.ofPattern("yyyyMMdd"))
-        );
-        /**获取当月的yyyyMMdd时间格式 int类型*/
-        int startTime = Integer.parseInt(today.format(DateTimeFormatter.ofPattern("yyyyMMdd")));//默认当天
-        if (type==1){//今日
-            startTime = Integer.parseInt(today.format(DateTimeFormatter.ofPattern("yyyyMMdd")));
-        } else if (type==2) {//本周
-            startTime = Integer.parseInt(today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
-        }else if (type==3){//本月
-            startTime = Integer.parseInt(today.withDayOfMonth(1).format(DateTimeFormatter.ofPattern("yyyyMMdd")));
-        }
-        return statisticsInfoMapper.findByShopMoneyList(orgCode,startTime,endTime);
-    }
-
-    @Override
-    public List<FindByShopSumVO> findByShopSumList(String orgCode, Integer type) {
-        // 获取当前日期
-        LocalDate today = LocalDate.now();
-        LocalDateTime endTime = today.plusDays(1).atStartOfDay();
-        // 1. 今天 00:00:00
-        LocalDateTime startTime =today.atStartOfDay();
-        if (type==1){
-            // 1. 明天 00:00:00
-            startTime = today.plusDays(1).atStartOfDay();
-        } else if (type==2) {
-            // 2. 本周第一天(周一)00:00:00
-            startTime = today.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY))
-                    .atStartOfDay();
-        } else if (type==3) {
-            // 3. 当月第一天 00:00:00
-            startTime = today.with(TemporalAdjusters.firstDayOfMonth())
-                    .atStartOfDay();
-        }
-        return appOrderMapper.findByShopSumList(orgCode,startTime,endTime);
-    }
-
-    private void getStatisticsInfo(StatisticsInfo statisticsInfoNew ,StatisticsInfo statisticsInfoOld,FindByStatisticsVO findByStatisticsVO){
-        if (statisticsInfoOld!=null){
-            if (statisticsInfoNew==null){
-                findByStatisticsVO.setSaleMoneyChain(getTwoNum(BigDecimal.valueOf(-1)));
-                findByStatisticsVO.setAddNumberChain(getTwoNum(BigDecimal.valueOf(-1)));
-                findByStatisticsVO.setConsumeNumberChain(getTwoNum(BigDecimal.valueOf(-1)));
-                findByStatisticsVO.setEffectiveOrderNumChain(getTwoNum(BigDecimal.valueOf(-1)));
-                findByStatisticsVO.setExpectIncomeMoneyChain(getTwoNum(BigDecimal.valueOf(-1)));
-            }else {
-                findByStatisticsVO.setAddNumberChain(getChain(statisticsInfoNew.getAddNumber(),statisticsInfoOld.getAddNumber()));
-                findByStatisticsVO.setConsumeNumberChain(getChain(statisticsInfoNew.getConsumeNumber(),statisticsInfoOld.getConsumeNumber()));
-                findByStatisticsVO.setSaleMoneyChain(getChain(statisticsInfoNew.getSaleMoney(),statisticsInfoOld.getSaleMoney()));
-                findByStatisticsVO.setEffectiveOrderNumChain(getChain(statisticsInfoNew.getEffectiveOrderNum(),statisticsInfoOld.getEffectiveOrderNum()));
-                findByStatisticsVO.setExpectIncomeMoneyChain(getChain(statisticsInfoNew.getExpectIncomeMoney(),statisticsInfoOld.getExpectIncomeMoney()));
-            }
-        }
-    }
-
-    /**
-     * 保存两位小数
-     * @param bigDecimal
-     * @return
-     */
-    private BigDecimal getTwoNum(BigDecimal bigDecimal){
-        if (bigDecimal==null){
-            return BigDecimal.ZERO;
-        }
-        return bigDecimal.multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
-    }
-
-    /**
-     * 获取环比
-     * @param bigDecimalNew
-     * @param bigDecimalOld
-     * @return
-     */
-    private BigDecimal getChain(BigDecimal bigDecimalNew,BigDecimal bigDecimalOld){
-        if (bigDecimalOld.compareTo(BigDecimal.ZERO)==0){
-            return null;
-        }
-        return getTwoNum((bigDecimalNew.subtract(bigDecimalOld)).divide(bigDecimalOld, 2, RoundingMode.HALF_UP));
-    }
-
-    /**
-     * 获取环比
-     * @param bigDecimalNew
-     * @param bigDecimalOld
-     * @return
-     */
-    private BigDecimal getChain(int bigDecimalNew,int bigDecimalOld){
-        if (bigDecimalOld==0){
-            return null;
-        }
-        return getChain(BigDecimal.valueOf(bigDecimalNew),BigDecimal.valueOf(bigDecimalOld));
-    }
-
-}

+ 42 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/StatisticsServiceImpl.java

@@ -0,0 +1,42 @@
+package org.jeecg.modules.system.app.service.impl;
+
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.system.app.mapper.StatisticsMapper;
+import org.jeecg.modules.system.app.service.IStatisticsService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class StatisticsServiceImpl implements IStatisticsService {
+
+    @Resource
+    private StatisticsMapper statisticsMapper;
+
+    @Override
+    public List<Map<String, Object>> findByShopSum(int type) {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return statisticsMapper.findByShopSum(type,loginUser.getOrgCode());
+    }
+
+    @Override
+    public List<Map<String, Object>> findByDeptSum(int type) {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return statisticsMapper.findByDeptSum(type,loginUser.getOrgCode());
+    }
+
+    @Override
+    public Map<String, Object> findIndexStatistics() {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return statisticsMapper.findIndexStatistics(loginUser.getOrgCode());
+    }
+
+    @Override
+    public List<Map<String, Object>> findMonthSaleTrend() {
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        return statisticsMapper.findMonthSaleTrend(loginUser.getOrgCode());
+    }
+}