5fd8f535ef44ef055d91673740491b9c9177aa89..79c4524bc2cac69ef74cbf4adc6a092e3bfa4f4b
2025-08-28 seatonwan9
更新代码
79c452 对比 | 目录
2025-08-28 seatonwan9
更新代码
1cda9b 对比 | 目录
5个文件已添加
52个文件已修改
1362 ■■■■ 已修改文件
sql/tb_report_result_submission.sql 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/controller/CartController.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/controller/OrderController.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/controller/PointsController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/controller/ProductPricingController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/dto/AddPointsFlowDTO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/dto/CartItemDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/dto/CreateOrderDTO.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/dto/CreateOrderItemDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/dto/OrderQueryDTO.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/dto/PointsFlowQueryDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/ApprovalRecord.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/Cart.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/OrderApproval.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/OrderAttachment.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/OrderDetail.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/OrderEvaluation.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/OrderInfo.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/Points.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/PointsFlow.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/PointsRule.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/Product.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/ProductPricing.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/ReportResultSubmission.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/entity/UserPoints.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/mapper/CartMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/mapper/OrderInfoMapper.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/mapper/ProductPricingMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/mapper/ReportResultSubmissionMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/mapper/UserPointsMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/CartPersistenceService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/CartService.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/OrderInfoService.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/PointsFlowService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/ProductPricingService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/UserPointsService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/impl/CartPersistenceServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/impl/CartServiceImpl.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/impl/OrderInfoServiceImpl.java 196 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/impl/PointsFlowServiceImpl.java 196 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/service/impl/UserPointsServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/vo/CartItemVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/vo/CartVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/vo/OrderDetailItemVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/webmanage/vo/OrderDetailVO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ApprovalRecordMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/CartMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/OrderAttachmentMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/OrderDetailMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/OrderEvaluationMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/OrderInfoMapper.xml 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PointsMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductMapper.xml 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductPricingMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ReportResultSubmissionMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/UserPointsMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/tb_report_result_submission.sql
New file
@@ -0,0 +1,125 @@
/*
 Navicat Premium Data Transfer
 Source Server         : zypt
 Source Server Type    : PostgreSQL
 Source Server Version : 110016
 Source Host           : 36.133.126.138:5432
 Source Catalog        : zypt-v2
 Source Schema         : public
 Target Server Type    : PostgreSQL
 Target Server Version : 110016
 File Encoding         : 65001
 Date: 26/08/2025 12:49:41
*/
-- ----------------------------
-- Table structure for tb_report_result_submission
-- ----------------------------
DROP TABLE IF EXISTS "public"."tb_report_result_submission";
CREATE TABLE "public"."tb_report_result_submission" (
  "id" varchar(36) COLLATE "pg_catalog"."default" NOT NULL,
  "name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL,
  "describe" varchar(6000) COLLATE "pg_catalog"."default" NOT NULL,
  "source_id" varchar(36) COLLATE "pg_catalog"."default",
  "source_name" varchar(100) COLLATE "pg_catalog"."default",
  "scheme_id" varchar(36) COLLATE "pg_catalog"."default",
  "scheme_name" varchar(100) COLLATE "pg_catalog"."default",
  "industrial_chain_id" varchar(360) COLLATE "pg_catalog"."default",
  "industrial_chain_name" varchar(1000) COLLATE "pg_catalog"."default",
  "important_area_id" varchar(1000) COLLATE "pg_catalog"."default",
  "important_area_name" varchar(1000) COLLATE "pg_catalog"."default",
  "scene_id" varchar(36) COLLATE "pg_catalog"."default",
  "scene_name" varchar(100) COLLATE "pg_catalog"."default",
  "dept_id" varchar(36) COLLATE "pg_catalog"."default",
  "submission_unit" varchar(100) COLLATE "pg_catalog"."default",
  "sort" int4 DEFAULT 0,
  "status" char(1) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "appro_status" char(1) COLLATE "pg_catalog"."default",
  "create_by" varchar(20) COLLATE "pg_catalog"."default",
  "create_user_id" varchar(36) COLLATE "pg_catalog"."default" NOT NULL,
  "create_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "update_by" varchar(20) COLLATE "pg_catalog"."default",
  "update_user_id" varchar(36) COLLATE "pg_catalog"."default" NOT NULL,
  "update_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "deleted" char(1) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "home_image" varchar(36) COLLATE "pg_catalog"."default",
  "upload_doc" char(1) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "upload_video" char(1) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 0,
  "flow_id" varchar(36) COLLATE "pg_catalog"."default",
  "type_id" varchar(1000) COLLATE "pg_catalog"."default",
  "type_name" varchar(1000) COLLATE "pg_catalog"."default",
  "type_child_id" varchar(1000) COLLATE "pg_catalog"."default",
  "type_child_name" varchar(1000) COLLATE "pg_catalog"."default",
  "business_process_id" varchar(360) COLLATE "pg_catalog"."default",
  "business_process_name" varchar(1000) COLLATE "pg_catalog"."default",
  "award_id" varchar(36) COLLATE "pg_catalog"."default",
  "award_name" varchar(100) COLLATE "pg_catalog"."default",
  "data_source" char(1) COLLATE "pg_catalog"."default" NOT NULL DEFAULT 1,
  "important_district_id" varchar(1000) COLLATE "pg_catalog"."default",
  "important_district_name" varchar(1000) COLLATE "pg_catalog"."default",
  "unit_id" varchar(36) COLLATE "pg_catalog"."default" DEFAULT '1'::character varying,
  "display" varchar(36) COLLATE "pg_catalog"."default",
  "url1" varchar(255) COLLATE "pg_catalog"."default",
  "important_full_name" text COLLATE "pg_catalog"."default"
)
;
COMMENT ON COLUMN "public"."tb_report_result_submission"."id" IS '主键id';
COMMENT ON COLUMN "public"."tb_report_result_submission"."name" IS '成果名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."describe" IS '成果描述';
COMMENT ON COLUMN "public"."tb_report_result_submission"."source_id" IS '发布范围id';
COMMENT ON COLUMN "public"."tb_report_result_submission"."source_name" IS '发布范围';
COMMENT ON COLUMN "public"."tb_report_result_submission"."scheme_id" IS '方案id';
COMMENT ON COLUMN "public"."tb_report_result_submission"."scheme_name" IS '方案名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."industrial_chain_id" IS '单位工程ID(一级工序)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."industrial_chain_name" IS '单位工程名称(一级工序)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."important_area_id" IS '重点领域id(三级工序)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."important_area_name" IS '重点领域名称(三级工序)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."scene_id" IS '场景方向id';
COMMENT ON COLUMN "public"."tb_report_result_submission"."scene_name" IS '场景方向名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."dept_id" IS '提报单位id';
COMMENT ON COLUMN "public"."tb_report_result_submission"."submission_unit" IS '提报单位名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."sort" IS '显示顺序';
COMMENT ON COLUMN "public"."tb_report_result_submission"."status" IS '状态(0正常 1停用)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."appro_status" IS '审核状态';
COMMENT ON COLUMN "public"."tb_report_result_submission"."create_by" IS '创建人名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."create_user_id" IS '创建者';
COMMENT ON COLUMN "public"."tb_report_result_submission"."create_time" IS '创建时间';
COMMENT ON COLUMN "public"."tb_report_result_submission"."update_by" IS '更新人名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."update_user_id" IS '更新者';
COMMENT ON COLUMN "public"."tb_report_result_submission"."update_time" IS '更新时间';
COMMENT ON COLUMN "public"."tb_report_result_submission"."deleted" IS '是否删除';
COMMENT ON COLUMN "public"."tb_report_result_submission"."home_image" IS '首页图片';
COMMENT ON COLUMN "public"."tb_report_result_submission"."upload_doc" IS '是否已上传文档';
COMMENT ON COLUMN "public"."tb_report_result_submission"."upload_video" IS '是否已上传视频';
COMMENT ON COLUMN "public"."tb_report_result_submission"."flow_id" IS '流程ID';
COMMENT ON COLUMN "public"."tb_report_result_submission"."type_id" IS '类型ID';
COMMENT ON COLUMN "public"."tb_report_result_submission"."type_name" IS '类型名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."type_child_id" IS '类型子级ID';
COMMENT ON COLUMN "public"."tb_report_result_submission"."type_child_name" IS '类型子级名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."business_process_id" IS '业务环节ID';
COMMENT ON COLUMN "public"."tb_report_result_submission"."business_process_name" IS '业务环节名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."award_id" IS '奖项ID';
COMMENT ON COLUMN "public"."tb_report_result_submission"."award_name" IS '奖项名称';
COMMENT ON COLUMN "public"."tb_report_result_submission"."data_source" IS '数据来源(1:手动提报,2:数据同步)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."important_district_id" IS '单位工程ID(二级工序)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."important_district_name" IS '单位工程名称(二级工序)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."unit_id" IS '所属单位ID';
COMMENT ON COLUMN "public"."tb_report_result_submission"."display" IS '公开情况(GROUP_OPEN:集团内公开;UNIT_OPEN:单位内公开;AUTH_OPEN:授权公开)';
COMMENT ON COLUMN "public"."tb_report_result_submission"."important_full_name" IS '单位工程全名';
COMMENT ON TABLE "public"."tb_report_result_submission" IS '成果提报基础信息表';
-- ----------------------------
-- Indexes structure for table tb_report_result_submission
-- ----------------------------
CREATE INDEX "idx_appro_status_result" ON "public"."tb_report_result_submission" USING btree (
  "appro_status" COLLATE "pg_catalog"."default" "pg_catalog"."bpchar_ops" ASC NULLS LAST
);
-- ----------------------------
-- Primary Key structure for table tb_report_result_submission
-- ----------------------------
ALTER TABLE "public"."tb_report_result_submission" ADD CONSTRAINT "tb_tb_report_result_submission_pkey" PRIMARY KEY ("id");
src/main/java/com/webmanage/controller/CartController.java
@@ -35,8 +35,8 @@
    @PostMapping("/add")
    @ApiOperation("添加商品到购物车")
    public Result<Object> addToCart(@Valid @RequestBody CartItemDTO cartItemDTO,
                                   @RequestParam @NotNull Long userId,
                                   @RequestParam @NotNull Long unitId) {
                                   @RequestParam @NotNull String userId,
                                   @RequestParam String unitId) {
        try {
            boolean result = cartService.addToCart(userId, unitId, cartItemDTO);
            if (result) {
@@ -52,8 +52,8 @@
    
    @DeleteMapping("/remove")
    @ApiOperation("从购物车移除商品")
    public Result<Object> removeFromCart(@RequestParam @NotNull Long userId,
                                        @RequestParam @NotNull Long unitId,
    public Result<Object> removeFromCart(@RequestParam @NotNull String userId,
                                        @RequestParam  String unitId,
                                        @RequestParam @NotNull Long pricingId) {
        try {
            boolean result = cartService.removeFromCart(userId, unitId, pricingId);
@@ -70,8 +70,8 @@
    
    @PutMapping("/update")
    @ApiOperation("更新购物车商品数量")
    public Result<Object> updateCartItemQuantity(@RequestParam @NotNull Long userId,
                                               @RequestParam @NotNull Long unitId,
    public Result<Object> updateCartItemQuantity(@RequestParam @NotNull String userId,
                                               @RequestParam  String unitId,
                                               @RequestParam @NotNull Long pricingId,
                                               @RequestParam @NotNull @Min(1) Integer quantity) {
        try {
@@ -89,8 +89,8 @@
    
    @DeleteMapping("/clear")
    @ApiOperation("清空购物车")
    public Result<Object> clearCart(@RequestParam @NotNull Long userId,
                                   @RequestParam @NotNull Long unitId) {
    public Result<Object> clearCart(@RequestParam @NotNull String userId,
                                   @RequestParam  String unitId) {
        try {
            boolean result = cartService.clearCart(userId, unitId);
            if (result) {
@@ -106,8 +106,8 @@
    
    @GetMapping("/info")
    @ApiOperation("获取购物车信息")
    public Result<Object> getCart(@RequestParam @NotNull Long userId,
                                 @RequestParam @NotNull Long unitId) {
    public Result<Object> getCart(@RequestParam @NotNull String userId,
                                 @RequestParam  String unitId) {
        try {
            CartVO cart = cartService.getCart(userId, unitId);
            return Result.success(cart);
@@ -119,8 +119,8 @@
    
    @GetMapping("/items")
    @ApiOperation("获取购物车商品列表")
    public Result<Object> getCartItems(@RequestParam @NotNull Long userId,
                                      @RequestParam @NotNull Long unitId) {
    public Result<Object> getCartItems(@RequestParam @NotNull String userId,
                                      @RequestParam  String unitId) {
        try {
            List<CartItemVO> items = cartService.getCartItems(userId, unitId);
            return Result.success(items);
@@ -132,8 +132,8 @@
    
    @DeleteMapping("/batch-remove")
    @ApiOperation("批量删除购物车商品")
    public Result<Object> batchRemoveFromCart(@RequestParam @NotNull Long userId,
                                             @RequestParam @NotNull Long unitId,
    public Result<Object> batchRemoveFromCart(@RequestParam @NotNull String userId,
                                             @RequestParam  String unitId,
                                             @RequestBody List<Long> pricingIds) {
        try {
            boolean result = cartService.batchRemoveFromCart(userId, unitId, pricingIds);
@@ -150,8 +150,8 @@
    
    @GetMapping("/count")
    @ApiOperation("获取购物车商品数量")
    public Result<Object> getCartItemCount(@RequestParam @NotNull Long userId,
                                          @RequestParam @NotNull Long unitId) {
    public Result<Object> getCartItemCount(@RequestParam @NotNull String userId,
                                          @RequestParam  String unitId) {
        try {
            Integer count = cartService.getCartItemCount(userId, unitId);
            return Result.success(count);
@@ -163,8 +163,8 @@
    
    @PostMapping("/sync-to-db")
    @ApiOperation("同步Redis购物车数据到数据库")
    public Result<Object> syncCartToDatabase(@RequestParam @NotNull Long userId,
                                            @RequestParam @NotNull Long unitId) {
    public Result<Object> syncCartToDatabase(@RequestParam @NotNull String userId,
                                            @RequestParam @NotNull String unitId) {
        try {
            boolean result = cartService.syncCartToDatabase(userId, unitId);
            if (result) {
@@ -180,8 +180,8 @@
    
    @PostMapping("/load-from-db")
    @ApiOperation("从数据库加载购物车数据到Redis")
    public Result<Object> loadCartFromDatabase(@RequestParam @NotNull Long userId,
                                              @RequestParam @NotNull Long unitId) {
    public Result<Object> loadCartFromDatabase(@RequestParam @NotNull String userId,
                                              @RequestParam @NotNull String unitId) {
        try {
            boolean result = cartService.loadCartFromDatabase(userId, unitId);
            if (result) {
@@ -197,8 +197,8 @@
    
    @GetMapping("/consistency")
    @ApiOperation("检查购物车数据一致性")
    public Result<Object> checkCartConsistency(@RequestParam @NotNull Long userId,
                                              @RequestParam @NotNull Long unitId) {
    public Result<Object> checkCartConsistency(@RequestParam @NotNull String userId,
                                              @RequestParam @NotNull String unitId) {
        try {
            boolean isConsistent = cartService.checkCartConsistency(userId, unitId);
            if (isConsistent) {
src/main/java/com/webmanage/controller/OrderController.java
@@ -43,6 +43,13 @@
        catch (Exception e) { log.error("查询买家订单列表失败", e); return Result.error("查询买家订单列表失败:" + e.getMessage()); }
    }
    @PostMapping("/buyer/page/with-product-conditions")
    @ApiOperation("分页查询买家订单列表(支持产品条件)")
    public Result<Object> getBuyerOrderPageWithProductConditions(@Valid @RequestBody OrderQueryDTO queryDTO) {
        try { return Result.success(orderInfoService.getBuyerOrderPageWithProductConditions(queryDTO)); }
        catch (Exception e) { log.error("查询买家订单列表失败", e); return Result.error("查询买家订单列表失败:" + e.getMessage()); }
    }
    @PostMapping("/create")
    @ApiOperation("创建订单(包含订单详情),需在 Header 携带 Idempotency-Token 防重复提交")
    public Result<OrderInfo> createOrder(@RequestHeader(value = "Idempotency-Token", required = false) String token,
@@ -119,6 +126,20 @@
                return Result.error("提供者ID不能为空");
            }
            return Result.success(orderInfoService.getSellerOrderPage(queryDTO));
        } catch (Exception e) {
            log.error("查询卖家订单列表失败", e);
            return Result.error("查询卖家订单列表失败:" + e.getMessage());
        }
    }
    @PostMapping("/seller/page/with-product-conditions")
    @ApiOperation("分页查询卖家订单列表(支持产品条件)")
    public Result<Object> getSellerOrderPageWithProductConditions(@Valid @RequestBody OrderQueryDTO queryDTO) {
        try {
            if (queryDTO.getProviderId() == null) {
                return Result.error("提供者ID不能为空");
            }
            return Result.success(orderInfoService.getSellerOrderPageWithProductConditions(queryDTO));
        } catch (Exception e) {
            log.error("查询卖家订单列表失败", e);
            return Result.error("查询卖家订单列表失败:" + e.getMessage());
@@ -290,6 +311,20 @@
        }
    }
    @PostMapping("/workflow/update")
    @ApiOperation("根据订单ID更新工作流ID(workflow_id)")
    public Result<Boolean> updateWorkflowId(
            @ApiParam("订单ID") @RequestParam @NotBlank String orderId,
            @ApiParam("工作流ID") @RequestParam @NotBlank String workflowId) {
        try {
            boolean result = orderInfoService.updateWorkflowId(orderId, workflowId);
            return result ? Result.success(true) : Result.error("更新工作流ID失败");
        } catch (Exception e) {
            log.error("更新工作流ID失败,订单ID: {}", orderId, e);
            return Result.error("更新工作流ID失败:" + e.getMessage());
        }
    }
    @GetMapping("/agreement/check/{orderId}")
    @ApiOperation("检查订单是否包含协议类型的子订单")
    public Result<Boolean> checkAgreementPriceType(
src/main/java/com/webmanage/controller/PointsController.java
@@ -250,7 +250,7 @@
    @GetMapping("/total/user/{userId}")
    @ApiOperation("获取用户积分统计")
    public Result<UserPoints> getUserPointsTotal(@ApiParam("用户ID") @PathVariable Long userId) {
    public Result<UserPoints> getUserPointsTotal(@ApiParam("用户ID") @PathVariable String userId) {
        try {
            UserPoints userPoints = pointsFlowService.getUserPointsTotal(userId);
            return Result.success(userPoints);
src/main/java/com/webmanage/controller/ProductPricingController.java
@@ -10,6 +10,7 @@
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -107,9 +108,9 @@
     */
    @GetMapping("/product/{productId}")
    @ApiOperation("根据产品ID查询定价列表")
    public Result<List<ProductPricing>> getPricingByProductId(@ApiParam("产品ID") @PathVariable Long productId) {
    public Result<List<ProductPricing>> getPricingByProductId(@ApiParam("产品ID") @PathVariable String productId) {
        try {
            if (productId == null) {
            if (!StringUtils.hasText(productId)) {
                return Result.error("产品ID不能为空");
            }
            List<ProductPricing> result = productPricingService.getPricingByProductId(productId);
src/main/java/com/webmanage/dto/AddPointsFlowDTO.java
@@ -15,12 +15,13 @@
public class AddPointsFlowDTO {
    @ApiModelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    private String userId;
    @ApiModelProperty("提供者ID")
    private String providerId;
    @ApiModelProperty("单位ID")
    @NotNull(message = "单位ID不能为空")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("规则类型(0获得/1消费)")
    @NotNull(message = "规则类型不能为空")
@@ -33,13 +34,6 @@
    @ApiModelProperty("积分规则类别(资源贡献、资源传播、资源交易、交流社区互动)")
    @NotBlank(message = "积分规则编码")
    private String ruleNameCode;
    @ApiModelProperty("数据类目)")
    @NotBlank(message = "数据类目不能为空")
    private String dataCategoty;
    @ApiModelProperty("关联订单ID")
    private String orderId;
    @ApiModelProperty("触发次数(默认为1)")
    private Integer count = 1;
src/main/java/com/webmanage/dto/CartItemDTO.java
@@ -21,7 +21,7 @@
    @ApiModelProperty("商品ID")
    @NotNull(message = "商品ID不能为空")
    private Long productId;
    private String productId;
    @ApiModelProperty("商品名称")
    private String productName;
src/main/java/com/webmanage/dto/CreateOrderDTO.java
@@ -17,11 +17,11 @@
    @ApiModelProperty("用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;
    private String userId;
    @ApiModelProperty("单位ID")
    @NotNull(message = "单位ID不能为空")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("产品名称")
    @NotBlank(message = "产品名称不能为空")
@@ -31,7 +31,7 @@
    private String providerName;
    @ApiModelProperty("提供者ID")
    private Long providerId;
    private String providerId;
    @ApiModelProperty("支付方式(如:积分/现金/混合)")
    @NotBlank(message = "支付方式不能为空")
src/main/java/com/webmanage/dto/CreateOrderItemDTO.java
@@ -16,7 +16,7 @@
    @ApiModelProperty("产品ID")
    @NotNull(message = "产品ID不能为空")
    private Long productId;
    private String productId;
    @ApiModelProperty("产品套件名称")
    private String suiteName;
@@ -55,7 +55,7 @@
    private BigDecimal totalPrice;
    @ApiModelProperty("产品提供者ID")
    private Long providerId;
    private String providerId;
    @ApiModelProperty("产品提供者名称")
    private String providerName;
src/main/java/com/webmanage/dto/OrderQueryDTO.java
@@ -20,13 +20,13 @@
    private Integer pageSize = 10;
    @ApiModelProperty("用户ID")
    private Long userId;
    private String userId;
    @ApiModelProperty("单位ID")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("提供者ID")
    private Long providerId;
    private String providerId;
    @ApiModelProperty("订单状态")
    private String orderStatus;
@@ -63,4 +63,17 @@
    @ApiModelProperty("排序方向(asc/desc)")
    private String orderDirection = "desc";
    @ApiModelProperty("行业领域ID")
    private String industryId;
    @ApiModelProperty("单位工程ID")
    private String unitProjectId;
    @ApiModelProperty("产品类型ID")
    private String productTypeId;
    @ApiModelProperty("产品类型子级ID")
    private String productSubTypeId;
}
src/main/java/com/webmanage/dto/PointsFlowQueryDTO.java
@@ -20,10 +20,10 @@
    private Integer pageSize = 10;
    @ApiModelProperty("用户ID")
    private Long userId;
    private String userId;
    @ApiModelProperty("单位ID")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("流水类型(0获得1/消费)")
    private Integer dataType;
src/main/java/com/webmanage/entity/ApprovalRecord.java
@@ -13,7 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("approval_record")
@TableName("tb_approval_record")
@ApiModel(value = "ApprovalRecord", description = "审批记录")
public class ApprovalRecord {
src/main/java/com/webmanage/entity/Cart.java
@@ -14,7 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("cart")
@TableName("tb_cart")
@ApiModel(value = "Cart", description = "购物车")
public class Cart {
    @ApiModelProperty("主键ID")
@@ -23,11 +23,11 @@
    @ApiModelProperty("用户ID")
    @TableField("user_id")
    private Long userId;
    private String userId;
    @ApiModelProperty("单位ID")
    @TableField("unit_id")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("商品定价ID")
    @TableField("pricing_id")
@@ -35,7 +35,7 @@
    @ApiModelProperty("商品ID")
    @TableField("product_id")
    private Long productId;
    private String productId;
    @ApiModelProperty("商品名称")
    @TableField("product_name")
src/main/java/com/webmanage/entity/OrderApproval.java
@@ -13,7 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_approval")
@TableName("tb_order_approval")
@ApiModel(value = "OrderApproval", description = "订单审批记录")
public class OrderApproval {
src/main/java/com/webmanage/entity/OrderAttachment.java
@@ -13,7 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_attachment")
@TableName("tb_order_attachment")
@ApiModel(value = "OrderAttachment", description = "订单附件")
public class OrderAttachment {
src/main/java/com/webmanage/entity/OrderDetail.java
@@ -14,7 +14,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_detail")
@TableName("tb_order_detail")
@ApiModel(value = "OrderDetail", description = "订单详情")
public class OrderDetail {
@@ -32,7 +32,7 @@
    @ApiModelProperty("产品ID")
    @TableField("product_id")
    private Long productId;
    private String productId;
    @ApiModelProperty("产品套件名称")
    @TableField("suite_name")
@@ -80,7 +80,7 @@
    @ApiModelProperty("产品提供者ID")
    @TableField("provider_id")
    private Long providerId;
    private String providerId;
    @ApiModelProperty("产品提供者名称")
    @TableField("provider_name")
src/main/java/com/webmanage/entity/OrderEvaluation.java
@@ -13,7 +13,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_evaluation")
@TableName("tb_order_evaluation")
@ApiModel(value = "OrderEvaluation", description = "订单评价")
public class OrderEvaluation {
src/main/java/com/webmanage/entity/OrderInfo.java
@@ -16,7 +16,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_info")
@TableName("tb_order_info")
public class OrderInfo implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -31,19 +31,19 @@
     * 产品ID
     */
    @TableField("product_id")
    private Long productId;
    private String productId;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;
    private String userId;
    /**
     * 单位ID
     */
    @TableField("unit_id")
    private Long unitId;
    private String unitId;
    /**
     * 产品名称
@@ -61,7 +61,7 @@
     * 提供者ID
     */
    @TableField("provider_id")
    private Long providerId;
    private String providerId;
    /**
     * 申请时间
src/main/java/com/webmanage/entity/Points.java
@@ -18,7 +18,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("points")
@TableName("tb_points")
@ApiModel(value = "Points", description = "积分主表")
public class Points implements Serializable {
src/main/java/com/webmanage/entity/PointsFlow.java
@@ -15,7 +15,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("points_flow")
@TableName("tb_points_flow")
public class PointsFlow implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -30,13 +30,13 @@
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;
    private String userId;
    /**
     * 单位ID
     */
    @TableField("unit_id")
    private Long unitId;
    private String unitId;
    /**
     * 数据类目
src/main/java/com/webmanage/entity/PointsRule.java
@@ -18,7 +18,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("points_rule")
@TableName("tb_points_rule")
@ApiModel(value = "PointsRule", description = "积分规则")
public class PointsRule implements Serializable {
src/main/java/com/webmanage/entity/Product.java
@@ -15,7 +15,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("product")
@TableName("tb_product")
public class Product implements Serializable {
    private static final long serialVersionUID = 1L;
src/main/java/com/webmanage/entity/ProductPricing.java
@@ -16,7 +16,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("product_pricing")
@TableName("tb_product_pricing")
public class ProductPricing implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -91,7 +91,7 @@
     * 关联产品ID
     */
    @TableField("product_id")
    private Long productId;
    private String productId;
    /**
     * 产品名称
@@ -103,7 +103,7 @@
     * 产品提供者ID
     */
    @TableField("provider_id")
    private Long providerId;
    private String providerId;
    /**
     * 产品提供者名称
src/main/java/com/webmanage/entity/ReportResultSubmission.java
New file
@@ -0,0 +1,105 @@
package com.webmanage.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
/**
 * 产品信息表实体类
 */
@Data
@TableName("tb_report_result_submission")
public class ReportResultSubmission {
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    private String name;
    private String describe;
    private String sourceId;
    private String sourceName;
    private String schemeId;
    private String schemeName;
    private String industrialChainId;
    private String industrialChainName;
    private String importantAreaId;
    private String importantAreaName;
    private String sceneId;
    private String sceneName;
    private String deptId;
    private String submissionUnit;
    private Integer sort;
    private String status;
    private String approStatus;
    private String createBy;
    private String createUserId;
    private LocalDateTime createTime;
    private String updateBy;
    private String updateUserId;
    private LocalDateTime updateTime;
    private String deleted;
    private String homeImage;
    private String uploadDoc;
    private String uploadVideo;
    private String flowId;
    private String typeId;
    private String typeName;
    private String typeChildId;
    private String typeChildName;
    private String businessProcessId;
    private String businessProcessName;
    private String awardId;
    private String awardName;
    private String dataSource;
    private String importantDistrictId;
    private String importantDistrictName;
    private String unitId;
    private String display;
    private String url1;
    private String importantFullName;
}
src/main/java/com/webmanage/entity/UserPoints.java
@@ -15,7 +15,7 @@
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user_points")
@TableName("tb_user_points")
public class UserPoints implements Serializable {
    private static final long serialVersionUID = 1L;
@@ -30,13 +30,13 @@
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;
    private String userId;
    /**
     * 单位ID
     */
    @TableField("unit_id")
    private Long unitId;
    private String unitId;
    /**
     * 积分余额
src/main/java/com/webmanage/mapper/CartMapper.java
@@ -16,22 +16,22 @@
    /**
     * 根据用户ID和单位ID查询购物车商品列表
     */
    List<Cart> selectByUserIdAndUnitId(@Param("userId") Long userId, @Param("unitId") Long unitId);
    List<Cart> selectByUserIdAndUnitId(@Param("userId") String userId, @Param("unitId") String unitId);
    
    /**
     * 根据用户ID、单位ID和定价ID查询购物车商品
     */
    Cart selectByUserIdUnitIdAndPricingId(@Param("userId") Long userId, @Param("unitId") Long unitId, @Param("pricingId") Long pricingId);
    Cart selectByUserIdUnitIdAndPricingId(@Param("userId") String userId, @Param("unitId") String unitId, @Param("pricingId") Long pricingId);
    
    /**
     * 根据用户ID和单位ID统计购物车商品数量
     */
    Integer countByUserIdAndUnitId(@Param("userId") Long userId, @Param("unitId") Long unitId);
    Integer countByUserIdAndUnitId(@Param("userId") String userId, @Param("unitId") String unitId);
    
    /**
     * 根据用户ID和单位ID计算购物车总金额
     */
    java.math.BigDecimal sumTotalAmountByUserIdAndUnitId(@Param("userId") Long userId, @Param("unitId") Long unitId);
    java.math.BigDecimal sumTotalAmountByUserIdAndUnitId(@Param("userId") String userId, @Param("unitId") String unitId);
    Integer deleteByCustomerCondition(@Param("id") Long id);
}
src/main/java/com/webmanage/mapper/OrderInfoMapper.java
@@ -16,8 +16,8 @@
    /**
     * 分页查询买家订单列表
     */
    IPage<OrderInfo> selectBuyerOrderPage(Page<OrderInfo> page, @Param("userId") Long userId,
                                        @Param("unitId") Long unitId, @Param("orderStatus") String orderStatus,
    IPage<OrderInfo> selectBuyerOrderPage(Page<OrderInfo> page, @Param("userId") String userId,
                                        @Param("unitId") String unitId, @Param("orderStatus") String orderStatus,
                                        @Param("paymentStatus") String paymentStatus, @Param("paymentType") String paymentType,
                                        @Param("productName") String productName, @Param("providerName") String providerName,
                                        @Param("orderId") String orderId, @Param("applyTimeStart") String applyTimeStart,
@@ -28,7 +28,7 @@
    /**
     * 分页查询卖家订单列表
     */
    IPage<OrderInfo> selectSellerOrderPage(Page<OrderInfo> page, @Param("providerId") Long providerId,
    IPage<OrderInfo> selectSellerOrderPage(Page<OrderInfo> page, @Param("providerId") String providerId,
                                         @Param("orderStatus") String orderStatus, @Param("paymentStatus") String paymentStatus,
                                         @Param("productName") String productName, @Param("orderId") String orderId,
                                         @Param("applyTimeStart") String applyTimeStart, @Param("applyTimeEnd") String applyTimeEnd,
@@ -43,4 +43,26 @@
                                                   @Param("orderId") String orderId, @Param("applyTimeStart") String applyTimeStart,
                                                   @Param("applyTimeEnd") String applyTimeEnd, @Param("orderBy") String orderBy,
                                                   @Param("orderDirection") String orderDirection);
    /**
     * 分页查询买家订单列表(支持产品条件)
     */
    IPage<OrderInfo> selectBuyerOrderPageWithProductConditions(Page<OrderInfo> page, @Param("userId") String userId,
                                        @Param("unitId") String unitId, @Param("orderStatus") String orderStatus,
                                        @Param("paymentStatus") String paymentStatus, @Param("paymentType") String paymentType,
                                        @Param("productName") String productName, @Param("providerName") String providerName,
                                        @Param("orderId") String orderId, @Param("applyTimeStart") String applyTimeStart,
                                        @Param("applyTimeEnd") String applyTimeEnd, @Param("createTimeStart") String createTimeStart,
                                        @Param("createTimeEnd") String createTimeEnd, @Param("orderBy") String orderBy,
                                        @Param("orderDirection") String orderDirection, @Param("productIds") java.util.List<String> productIds);
    /**
     * 分页查询卖家订单列表(支持产品条件)
     */
    IPage<OrderInfo> selectSellerOrderPageWithProductConditions(Page<OrderInfo> page, @Param("providerId") String providerId,
                                         @Param("orderStatus") String orderStatus, @Param("paymentStatus") String paymentStatus,
                                         @Param("productName") String productName, @Param("orderId") String orderId,
                                         @Param("applyTimeStart") String applyTimeStart, @Param("applyTimeEnd") String applyTimeEnd,
                                         @Param("createTimeStart") String createTimeStart, @Param("createTimeEnd") String createTimeEnd,
                                         @Param("orderBy") String orderBy, @Param("orderDirection") String orderDirection, @Param("productIds") java.util.List<String> productIds);
}
src/main/java/com/webmanage/mapper/ProductPricingMapper.java
@@ -26,7 +26,7 @@
    /**
     * 根据产品ID查询定价列表
     */
    List<ProductPricing> selectByProductId(@Param("productId") Long productId);
    List<ProductPricing> selectByProductId(@Param("productId") String productId);
    /**
     * 根据条件查询产品定价
src/main/java/com/webmanage/mapper/ReportResultSubmissionMapper.java
New file
@@ -0,0 +1,30 @@
package com.webmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.webmanage.entity.ReportResultSubmission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * 产品信息表Mapper接口
 */
@Mapper
public interface ReportResultSubmissionMapper extends BaseMapper<ReportResultSubmission> {
    /**
     * 根据条件查询产品ID列表
     * @param industryId 行业领域ID
     * @param unitProjectId 单位工程ID
     * @param productTypeId 产品类型ID
     * @param productSubTypeId 产品类型子级ID
     * @return 产品ID列表
     */
    List<String> selectProductIdsByConditions(
        @Param("industryId") String industryId,
        @Param("unitProjectId") String unitProjectId,
        @Param("productTypeId") String productTypeId,
        @Param("productSubTypeId") String productSubTypeId
    );
}
src/main/java/com/webmanage/mapper/UserPointsMapper.java
@@ -17,10 +17,10 @@
    /**
     * 根据用户ID查询积分信息
     */
    UserPoints selectByUserId(@Param("userId") Long userId);
    UserPoints selectByUserId(@Param("userId") String userId);
    
    /**
     * 根据单位ID查询积分信息
     */
    UserPoints selectByUnitId(@Param("unitId") Long unitId);
    UserPoints selectByUnitId(@Param("unitId") String unitId);
}
src/main/java/com/webmanage/service/CartPersistenceService.java
@@ -3,9 +3,9 @@
import com.webmanage.vo.CartItemVO;
public interface CartPersistenceService {
    void saveOrUpdate(Long userId, Long unitId, CartItemVO item);
    void remove(Long userId, Long unitId, Long pricingId);
    void clear(Long userId, Long unitId);
    void saveOrUpdate(String userId, String unitId, CartItemVO item);
    void remove(String userId, String unitId, Long pricingId);
    void clear(String userId, String unitId);
}
src/main/java/com/webmanage/service/CartService.java
@@ -14,60 +14,60 @@
    /**
     * 添加商品到购物车(Redis + 数据库)
     */
    boolean addToCart(Long userId, Long unitId, CartItemDTO cartItemDTO);
    boolean addToCart(String userId, String unitId, CartItemDTO cartItemDTO);
    
    /**
     * 从购物车移除商品(Redis + 数据库)
     */
    boolean removeFromCart(Long userId, Long unitId, Long pricingId);
    boolean removeFromCart(String userId, String unitId, Long pricingId);
    
    /**
     * 更新购物车商品数量(Redis + 数据库)
     */
    boolean updateCartItemQuantity(Long userId, Long unitId, Long pricingId, Integer quantity);
    boolean updateCartItemQuantity(String userId, String unitId, Long pricingId, Integer quantity);
    
    /**
     * 清空购物车(Redis + 数据库)
     */
    boolean clearCart(Long userId, Long unitId);
    boolean clearCart(String userId, String unitId);
    
    /**
     * 获取购物车信息(优先Redis,失败则从数据库加载)
     */
    CartVO getCart(Long userId, Long unitId);
    CartVO getCart(String userId, String unitId);
    
    /**
     * 获取购物车商品列表(优先Redis,失败则从数据库加载)
     */
    List<CartItemVO> getCartItems(Long userId, Long unitId);
    List<CartItemVO> getCartItems(String userId, String unitId);
    
    /**
     * 检查购物车商品库存
     */
    boolean checkCartItemStock(Long userId, Long unitId, Long pricingId);
    boolean checkCartItemStock(String userId, String unitId, Long pricingId);
    
    /**
     * 批量删除购物车商品(Redis + 数据库)
     */
    boolean batchRemoveFromCart(Long userId, Long unitId, List<Long> pricingIds);
    boolean batchRemoveFromCart(String userId, String unitId, List<Long> pricingIds);
    
    /**
     * 获取购物车商品数量(优先Redis,失败则从数据库加载)
     */
    Integer getCartItemCount(Long userId, Long unitId);
    Integer getCartItemCount(String userId, String unitId);
    
    /**
     * 从数据库加载购物车数据到Redis
     */
    boolean loadCartFromDatabase(Long userId, Long unitId);
    boolean loadCartFromDatabase(String userId, String unitId);
    
    /**
     * 同步Redis数据到数据库
     */
    boolean syncCartToDatabase(Long userId, Long unitId);
    boolean syncCartToDatabase(String userId, String unitId);
    
    /**
     * 检查购物车数据一致性
     */
    boolean checkCartConsistency(Long userId, Long unitId);
    boolean checkCartConsistency(String userId, String unitId);
}
src/main/java/com/webmanage/service/OrderInfoService.java
@@ -18,12 +18,22 @@
    /**
     * 分页查询买家订单列表
     */
    PageResult<OrderInfo> getBuyerOrderPage(OrderQueryDTO queryDTO);
    PageResult<OrderDetailVO> getBuyerOrderPage(OrderQueryDTO queryDTO);
    /**
     * 分页查询卖家订单列表
     */
    PageResult<OrderInfo> getSellerOrderPage(OrderQueryDTO queryDTO);
    PageResult<OrderDetailVO> getSellerOrderPage(OrderQueryDTO queryDTO);
    /**
     * 分页查询买家订单列表(支持产品条件)
     */
    PageResult<OrderDetailVO> getBuyerOrderPageWithProductConditions(OrderQueryDTO queryDTO);
    /**
     * 分页查询卖家订单列表(支持产品条件)
     */
    PageResult<OrderDetailVO> getSellerOrderPageWithProductConditions(OrderQueryDTO queryDTO);
    /**
     * 分页查询待审批订单列表
@@ -122,4 +132,12 @@
     * @return 是否取消成功
     */
    boolean cancelOrder(String orderId);
    /**
     * 根据订单ID更新工作流ID
     * @param orderId 订单ID
     * @param workflowId 工作流实例ID
     * @return 是否更新成功
     */
    boolean updateWorkflowId(String orderId, String workflowId);
}
src/main/java/com/webmanage/service/PointsFlowService.java
@@ -43,7 +43,7 @@
    /**
     * 获取用户积分统计
     */
    UserPoints getUserPointsTotal(Long userId);
    UserPoints getUserPointsTotal(String userId);
    /**
     * 获取单位积分统计
src/main/java/com/webmanage/service/ProductPricingService.java
@@ -38,7 +38,7 @@
    /**
     * 根据产品ID查询定价列表
     */
    List<ProductPricing> getPricingByProductId(Long productId);
    List<ProductPricing> getPricingByProductId(String productId);
    /**
     * 根据条件查询产品定价
src/main/java/com/webmanage/service/UserPointsService.java
@@ -14,15 +14,15 @@
    /**
     * 获取个人积分统计
     */
    PointsStatsVO getPersonalPointsStats(Long userId);
    PointsStatsVO getPersonalPointsStats(String userId);
    
    /**
     * 获取单位积分统计
     */
    PointsStatsVO getUnitPointsStats(Long unitId);
    PointsStatsVO getUnitPointsStats(String unitId);
    
    /**
     * 更新用户积分
     */
    void updateUserPoints(Long userId, Long unitId, Integer points);
    void updateUserPoints(String userId, String unitId, Integer points);
}
src/main/java/com/webmanage/service/impl/CartPersistenceServiceImpl.java
@@ -8,6 +8,7 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
@@ -20,12 +21,14 @@
    @Override
    @Async("asyncExecutor")
    public void saveOrUpdate(Long userId, Long unitId, CartItemVO item) {
    public void saveOrUpdate(String userId, String unitId, CartItemVO item) {
        try {
            Cart cart = new Cart();
            BeanUtils.copyProperties(item, cart);
            cart.setUserId(userId);
            cart.setUnitId(unitId);
            if(StringUtils.hasText(unitId)){
                cart.setUnitId(unitId);
            }
            cart.setUpdateTime(LocalDateTime.now());
            Cart existing = cartMapper.selectByUserIdUnitIdAndPricingId(userId, unitId, item.getPricingId());
            if (existing != null) {
@@ -40,7 +43,7 @@
    @Override
    @Async("asyncExecutor")
    public void remove(Long userId, Long unitId, Long pricingId) {
    public void remove(String userId, String unitId, Long pricingId) {
        try {
            Cart existing = cartMapper.selectByUserIdUnitIdAndPricingId(userId, unitId, pricingId);
            if (existing != null) {
@@ -51,7 +54,7 @@
    @Override
    @Async("asyncExecutor")
    public void clear(Long userId, Long unitId) {
    public void clear(String userId, String unitId) {
        try {
            java.util.List<Cart> cartItems = cartMapper.selectByUserIdAndUnitId(userId, unitId);
            for (Cart item : cartItems) {
src/main/java/com/webmanage/service/impl/CartServiceImpl.java
@@ -18,6 +18,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
@@ -55,7 +56,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean addToCart(Long userId, Long unitId, CartItemDTO cartItemDTO) {
    public boolean addToCart(String userId, String unitId, CartItemDTO cartItemDTO) {
        try {
            // 验证商品定价是否存在
            ProductPricing pricing = productPricingMapper.selectById(cartItemDTO.getPricingId());
@@ -64,7 +65,7 @@
            }
            // 构建购物车key
            String cartKey = buildCartKey(userId, unitId);
            String cartKey = buildCartKey(userId,unitId);
            String cartItemKey = buildCartItemKey(userId, unitId, cartItemDTO.getPricingId());
            // 检查商品是否已在购物车中
@@ -110,7 +111,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean removeFromCart(Long userId, Long unitId, Long pricingId) {
    public boolean removeFromCart(String userId, String unitId, Long pricingId) {
        try {
            String cartItemKey = buildCartItemKey(userId, unitId, pricingId);
@@ -137,7 +138,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateCartItemQuantity(Long userId, Long unitId, Long pricingId, Integer quantity) {
    public boolean updateCartItemQuantity(String userId, String unitId, Long pricingId, Integer quantity) {
        try {
            if (quantity <= 0) {
                return removeFromCart(userId, unitId, pricingId);
@@ -171,7 +172,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean clearCart(Long userId, Long unitId) {
    public boolean clearCart(String userId, String unitId) {
        try {
            String cartKey = buildCartKey(userId, unitId);
            List<Long> pricingIds = getCartItemPricingIds(userId, unitId);
@@ -199,12 +200,13 @@
    }
    @Override
    public CartVO getCart(Long userId, Long unitId) {
    public CartVO getCart(String userId, String unitId) {
        try {
            CartVO cartVO = new CartVO();
            cartVO.setUserId(userId);
            cartVO.setUnitId(unitId);
            if (StringUtils.hasText(unitId)){
                cartVO.setUnitId(unitId);
            }
            List<CartItemVO> items = getCartItems(userId, unitId);
            cartVO.setItems(items);
@@ -226,7 +228,7 @@
    }
    @Override
    public List<CartItemVO> getCartItems(Long userId, Long unitId) {
    public List<CartItemVO> getCartItems(String userId, String unitId) {
        try {
            // 优先从Redis获取
            List<CartItemVO> items = getCartItemsFromRedis(userId, unitId);
@@ -245,14 +247,14 @@
    }
    @Override
    public boolean checkCartItemStock(Long userId, Long unitId, Long pricingId) {
    public boolean checkCartItemStock(String userId, String unitId, Long pricingId) {
        // TODO: 实现库存检查逻辑
        return true;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean batchRemoveFromCart(Long userId, Long unitId, List<Long> pricingIds) {
    public boolean batchRemoveFromCart(String userId, String unitId, List<Long> pricingIds) {
        try {
            if (CollectionUtils.isEmpty(pricingIds)) {
                return true;
@@ -270,7 +272,7 @@
    }
    @Override
    public Integer getCartItemCount(Long userId, Long unitId) {
    public Integer getCartItemCount(String userId, String unitId) {
        try {
            // 优先从Redis获取
            String cartKey = buildCartKey(userId, unitId);
@@ -288,7 +290,7 @@
    }
    @Override
    public boolean loadCartFromDatabase(Long userId, Long unitId) {
    public boolean loadCartFromDatabase(String userId, String unitId) {
        try {
            List<Cart> cartItems = cartMapper.selectByUserIdAndUnitId(userId, unitId);
            if (CollectionUtils.isEmpty(cartItems)) {
@@ -319,7 +321,7 @@
    }
    @Override
    public boolean syncCartToDatabase(Long userId, Long unitId) {
    public boolean syncCartToDatabase(String userId, String unitId) {
        try {
            List<CartItemVO> redisItems = getCartItemsFromRedis(userId, unitId);
            if (CollectionUtils.isEmpty(redisItems)) {
@@ -343,7 +345,7 @@
    }
    @Override
    public boolean checkCartConsistency(Long userId, Long unitId) {
    public boolean checkCartConsistency(String userId, String unitId) {
        try {
            List<CartItemVO> redisItems = getCartItemsFromRedis(userId, unitId);
            List<Cart> dbItems = cartMapper.selectByUserIdAndUnitId(userId, unitId);
@@ -378,15 +380,21 @@
    // ==================== 私有方法 ====================
    private String buildCartKey(Long userId, Long unitId) {
        return CART_KEY_PREFIX + userId + ":" + unitId;
    private String buildCartKey(String userId, String unitId) {
        if(StringUtils.hasText(unitId)){
            return CART_KEY_PREFIX + userId + ":" + unitId;
        }
        return CART_KEY_PREFIX + userId;
    }
    private String buildCartItemKey(Long userId, Long unitId, Long pricingId) {
        return CART_ITEM_KEY_PREFIX + userId + ":" + unitId + ":" + pricingId;
    private String buildCartItemKey(String userId, String unitId, Long pricingId) {
        if(StringUtils.hasText(unitId)){
            return CART_ITEM_KEY_PREFIX + userId + ":" + unitId + ":" + pricingId;
        }
        return CART_ITEM_KEY_PREFIX + userId + ":" + pricingId;
    }
    private void updateCartItemList(Long userId, Long unitId, Long pricingId, boolean add) {
    private void updateCartItemList(String userId, String unitId, Long pricingId, boolean add) {
        String cartKey = buildCartKey(userId, unitId);
        List<Long> pricingIds = (List<Long>) redisTemplate.opsForValue().get(cartKey);
@@ -403,13 +411,13 @@
        redisTemplate.opsForValue().set(cartKey, pricingIds, CART_EXPIRE_DAYS, TimeUnit.DAYS);
    }
    private List<Long> getCartItemPricingIds(Long userId, Long unitId) {
    private List<Long> getCartItemPricingIds(String userId, String unitId) {
        String cartKey = buildCartKey(userId, unitId);
        List<Long> pricingIds = (List<Long>) redisTemplate.opsForValue().get(cartKey);
        return pricingIds != null ? pricingIds : new ArrayList<>();
    }
    private List<CartItemVO> getCartItemsFromRedis(Long userId, Long unitId) {
    private List<CartItemVO> getCartItemsFromRedis(String userId, String unitId) {
        try {
            String cartKey = buildCartKey(userId, unitId);
            List<Long> pricingIds = (List<Long>) redisTemplate.opsForValue().get(cartKey);
@@ -434,7 +442,7 @@
        }
    }
    
    private List<CartItemVO> getCartItemsFromDatabase(Long userId, Long unitId) {
    private List<CartItemVO> getCartItemsFromDatabase(String userId, String unitId) {
        try {
            List<Cart> cartItems = cartMapper.selectByUserIdAndUnitId(userId, unitId);
            List<CartItemVO> items = new ArrayList<>();
@@ -456,7 +464,7 @@
        return itemVO;
    }
    
    private void syncCartItemToDatabase(Long userId, Long unitId, CartItemVO item) {
    private void syncCartItemToDatabase(String userId, String unitId, CartItemVO item) {
        try {
            Cart cart = new Cart();
            BeanUtils.copyProperties(item, cart);
@@ -480,7 +488,7 @@
        }
    }
    
    private void removeCartItemFromDatabase(Long userId, Long unitId, Long pricingId) {
    private void removeCartItemFromDatabase(String userId, String unitId, Long pricingId) {
        try {
            Cart existingCart = cartMapper.selectByUserIdUnitIdAndPricingId(userId, unitId, pricingId);
            if (existingCart != null) {
@@ -491,7 +499,7 @@
        }
    }
    
    private void clearCartFromDatabase(Long userId, Long unitId) {
    private void clearCartFromDatabase(String userId, String unitId) {
        try {
            // 使用逻辑删除
            List<Cart> cartItems = cartMapper.selectByUserIdAndUnitId(userId, unitId);
src/main/java/com/webmanage/service/impl/OrderInfoServiceImpl.java
@@ -22,6 +22,7 @@
import com.webmanage.mapper.OrderDetailMapper;
import com.webmanage.mapper.OrderEvaluationMapper;
import com.webmanage.mapper.OrderInfoMapper;
import com.webmanage.mapper.ReportResultSubmissionMapper;
import com.webmanage.service.OrderInfoService;
import com.webmanage.service.OrderNoService;
import com.webmanage.service.MinioService;
@@ -67,8 +68,11 @@
    @Resource
    private MinioService minioService;
    @Resource
    private ReportResultSubmissionMapper reportResultSubmissionMapper;
    @Override
    public PageResult<OrderInfo> getBuyerOrderPage(OrderQueryDTO queryDTO) {
    public PageResult<OrderDetailVO> getBuyerOrderPage(OrderQueryDTO queryDTO) {
        // 参数校验
        if (queryDTO.getUserId() == null) {
            throw new BusinessException("用户ID不能为空");
@@ -88,10 +92,23 @@
            queryDTO.getCreateTimeEnd() != null ? queryDTO.getCreateTimeEnd().toString() : null,
            queryDTO.getOrderBy(), queryDTO.getOrderDirection()
        );
        // 将订单与详情联表封装到VO
        List<OrderDetailVO> voList = result.getRecords().stream().map(order -> {
            OrderDetailVO vo = new OrderDetailVO();
            BeanUtils.copyProperties(order, vo);
            List<OrderDetail> details = orderDetailMapper.selectByOrderId(order.getOrderId());
            List<OrderDetailItemVO> items = details.stream().map(d -> {
                OrderDetailItemVO item = new OrderDetailItemVO();
                BeanUtils.copyProperties(d, item);
                return item;
            }).collect(java.util.stream.Collectors.toList());
            vo.setOrderDetails(items);
            return vo;
        }).collect(java.util.stream.Collectors.toList());
        // 构建返回结果
        return new PageResult<OrderInfo>(
            result.getRecords(),
        return new PageResult<OrderDetailVO>(
            voList,
            result.getTotal(),
            queryDTO.getPageNum().longValue(),
            queryDTO.getPageSize().longValue(),
@@ -100,7 +117,7 @@
    }
    @Override
    public PageResult<OrderInfo> getSellerOrderPage(OrderQueryDTO queryDTO) {
    public PageResult<OrderDetailVO> getSellerOrderPage(OrderQueryDTO queryDTO) {
        // 参数校验
        if (queryDTO.getProviderId() == null) {
            throw new BusinessException("提供者ID不能为空");
@@ -120,9 +137,23 @@
            queryDTO.getOrderBy(), queryDTO.getOrderDirection()
        );
        // 将订单与详情联表封装到VO
        List<OrderDetailVO> voList = result.getRecords().stream().map(order -> {
            OrderDetailVO vo = new OrderDetailVO();
            BeanUtils.copyProperties(order, vo);
            List<OrderDetail> details = orderDetailMapper.selectByOrderId(order.getOrderId());
            List<OrderDetailItemVO> items = details.stream().map(d -> {
                OrderDetailItemVO item = new OrderDetailItemVO();
                BeanUtils.copyProperties(d, item);
                return item;
            }).collect(java.util.stream.Collectors.toList());
            vo.setOrderDetails(items);
            return vo;
        }).collect(java.util.stream.Collectors.toList());
        // 构建返回结果
        return new PageResult<OrderInfo>(
            result.getRecords(),
        return new PageResult<OrderDetailVO>(
            voList,
            result.getTotal(),
            queryDTO.getPageNum().longValue(),
            queryDTO.getPageSize().longValue(),
@@ -147,6 +178,139 @@
        // 构建返回结果
        return new PageResult<OrderInfo>(
            result.getRecords(),
            result.getTotal(),
            queryDTO.getPageNum().longValue(),
            queryDTO.getPageSize().longValue(),
            result.getPages()
        );
    }
    @Override
    public PageResult<OrderDetailVO> getBuyerOrderPageWithProductConditions(OrderQueryDTO queryDTO) {
        // 参数校验
        if (queryDTO.getUserId() == null) {
            throw new BusinessException("用户ID不能为空");
        }
        // 根据产品条件查询产品ID列表
        List<String> productIds = null;
        if (StringUtils.hasText(queryDTO.getIndustryId()) || StringUtils.hasText(queryDTO.getUnitProjectId()) ||
            StringUtils.hasText(queryDTO.getProductTypeId()) || StringUtils.hasText(queryDTO.getProductSubTypeId())) {
            productIds = reportResultSubmissionMapper.selectProductIdsByConditions(
                queryDTO.getIndustryId(), queryDTO.getUnitProjectId(),
                queryDTO.getProductTypeId(), queryDTO.getProductSubTypeId()
            );
            // 如果没有找到匹配的产品,直接返回空结果
            if (CollectionUtils.isEmpty(productIds)) {
                return new PageResult<OrderDetailVO>(
                    java.util.Collections.emptyList(),
                    0L,
                    queryDTO.getPageNum().longValue(),
                    queryDTO.getPageSize().longValue(),
                    0L
                );
            }
        }
        // 创建分页对象
        Page<OrderInfo> page = new Page<>(queryDTO.getPageNum(), queryDTO.getPageSize());
        // 执行分页查询
        IPage<OrderInfo> result = baseMapper.selectBuyerOrderPageWithProductConditions(
            page, queryDTO.getUserId(), queryDTO.getUnitId(), queryDTO.getOrderStatus(),
            queryDTO.getPaymentStatus(), queryDTO.getPaymentType(), queryDTO.getProductName(),
            queryDTO.getProviderName(), queryDTO.getOrderId(),
            queryDTO.getApplyTimeStart() != null ? queryDTO.getApplyTimeStart().toString() : null,
            queryDTO.getApplyTimeEnd() != null ? queryDTO.getApplyTimeEnd().toString() : null,
            queryDTO.getCreateTimeStart() != null ? queryDTO.getCreateTimeStart().toString() : null,
            queryDTO.getCreateTimeEnd() != null ? queryDTO.getCreateTimeEnd().toString() : null,
            queryDTO.getOrderBy(), queryDTO.getOrderDirection(), productIds
        );
        // 将订单与详情联表封装到VO
        List<OrderDetailVO> voList = result.getRecords().stream().map(order -> {
            OrderDetailVO vo = new OrderDetailVO();
            BeanUtils.copyProperties(order, vo);
            List<OrderDetail> details = orderDetailMapper.selectByOrderId(order.getOrderId());
            List<OrderDetailItemVO> items = details.stream().map(d -> {
                OrderDetailItemVO item = new OrderDetailItemVO();
                BeanUtils.copyProperties(d, item);
                return item;
            }).collect(java.util.stream.Collectors.toList());
            vo.setOrderDetails(items);
            return vo;
        }).collect(java.util.stream.Collectors.toList());
        // 构建返回结果
        return new PageResult<OrderDetailVO>(
            voList,
            result.getTotal(),
            queryDTO.getPageNum().longValue(),
            queryDTO.getPageSize().longValue(),
            result.getPages()
        );
    }
    @Override
    public PageResult<OrderDetailVO> getSellerOrderPageWithProductConditions(OrderQueryDTO queryDTO) {
        // 参数校验
        if (queryDTO.getProviderId() == null) {
            throw new BusinessException("提供者ID不能为空");
        }
        // 根据产品条件查询产品ID列表
        List<String> productIds = null;
        if (StringUtils.hasText(queryDTO.getIndustryId()) || StringUtils.hasText(queryDTO.getUnitProjectId()) ||
            StringUtils.hasText(queryDTO.getProductTypeId()) || StringUtils.hasText(queryDTO.getProductSubTypeId())) {
            productIds = reportResultSubmissionMapper.selectProductIdsByConditions(
                queryDTO.getIndustryId(), queryDTO.getUnitProjectId(),
                queryDTO.getProductTypeId(), queryDTO.getProductSubTypeId()
            );
            // 如果没有找到匹配的产品,直接返回空结果
            if (CollectionUtils.isEmpty(productIds)) {
                return new PageResult<OrderDetailVO>(
                    java.util.Collections.emptyList(),
                    0L,
                    queryDTO.getPageNum().longValue(),
                    queryDTO.getPageSize().longValue(),
                    0L
                );
            }
        }
        // 创建分页对象
        Page<OrderInfo> page = new Page<>(queryDTO.getPageNum(), queryDTO.getPageSize());
        // 执行分页查询
        IPage<OrderInfo> result = baseMapper.selectSellerOrderPageWithProductConditions(
            page, queryDTO.getProviderId(), queryDTO.getOrderStatus(), queryDTO.getPaymentStatus(),
            queryDTO.getProductName(), queryDTO.getOrderId(),
            queryDTO.getApplyTimeStart() != null ? queryDTO.getApplyTimeStart().toString() : null,
            queryDTO.getApplyTimeEnd() != null ? queryDTO.getApplyTimeEnd().toString() : null,
            queryDTO.getCreateTimeStart() != null ? queryDTO.getCreateTimeStart().toString() : null,
            queryDTO.getCreateTimeEnd() != null ? queryDTO.getCreateTimeEnd().toString() : null,
            queryDTO.getOrderBy(), queryDTO.getOrderDirection(), productIds
        );
        // 将订单与详情联表封装到VO
        List<OrderDetailVO> voList = result.getRecords().stream().map(order -> {
            OrderDetailVO vo = new OrderDetailVO();
            BeanUtils.copyProperties(order, vo);
            List<OrderDetail> details = orderDetailMapper.selectByOrderId(order.getOrderId());
            List<OrderDetailItemVO> items = details.stream().map(d -> {
                OrderDetailItemVO item = new OrderDetailItemVO();
                BeanUtils.copyProperties(d, item);
                return item;
            }).collect(java.util.stream.Collectors.toList());
            vo.setOrderDetails(items);
            return vo;
        }).collect(java.util.stream.Collectors.toList());
        // 构建返回结果
        return new PageResult<OrderDetailVO>(
            voList,
            result.getTotal(),
            queryDTO.getPageNum().longValue(),
            queryDTO.getPageSize().longValue(),
@@ -940,4 +1104,24 @@
            throw new BusinessException("取消订单失败:" + e.getMessage());
        }
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateWorkflowId(String orderId, String workflowId) {
        if (!StringUtils.hasText(orderId)) {
            throw new BusinessException("订单ID不能为空");
        }
        if (!StringUtils.hasText(workflowId)) {
            throw new BusinessException("工作流ID不能为空");
        }
        OrderInfo orderInfo = this.getById(orderId);
        if (orderInfo == null) {
            throw new BusinessException("订单不存在");
        }
        orderInfo.setWorkflowId(workflowId);
        orderInfo.setUpdatedAt(LocalDateTime.now());
        return this.updateById(orderInfo);
    }
}
src/main/java/com/webmanage/service/impl/PointsFlowServiceImpl.java
@@ -42,7 +42,7 @@
    @Override
    public PageResult<PointsFlow> getPersonalPointsFlowPage(PointsFlowQueryDTO queryDTO) {
        if (queryDTO.getUserId() == null) {
        if (!StringUtils.hasText(queryDTO.getUserId())) {
            throw new BusinessException("用户ID不能为空");
        }
@@ -123,68 +123,118 @@
            throw new BusinessException("参数不能为空");
        }
        Long userId = addPointsFlowDTO.getUserId();
        Long unitId = addPointsFlowDTO.getUnitId();
        String userId = addPointsFlowDTO.getUserId();
        String providerId = addPointsFlowDTO.getProviderId();
        String unitId = addPointsFlowDTO.getUnitId();
        Integer ruleType = addPointsFlowDTO.getRuleType();
        String category = addPointsFlowDTO.getCategory();
        String ruleNameCode = addPointsFlowDTO.getRuleNameCode();
        Integer count = addPointsFlowDTO.getCount() != null ? addPointsFlowDTO.getCount() : 1;
        // 根据ruleType、ruleNameCode、category查询生效时间最新的积分规则
        PointsRule pointsRule = getLatestEffectiveRule(ruleType, ruleNameCode, category);
        if (pointsRule == null) {
            throw new BusinessException("积分规则不存在或未启用: ruleType=" + ruleType + ", ruleNameCode=" + ruleNameCode + ", category=" + category);
        boolean applyUser = StringUtils.hasText(userId) ;
        boolean applyProvider = StringUtils.hasText(providerId) ;;
        if (!applyUser && !applyProvider) {
            throw new BusinessException("userId 与 providerId 不能同时为空");
        }
        // 验证规则类型是否匹配
        if (!ruleType.equals(pointsRule.getRuleType())) {
            throw new BusinessException("规则类型不匹配,期望: " + pointsRule.getRuleType() + ",实际: " + ruleType);
        // 分别获取用户侧/提供者侧最新生效规则(按 points_winner 过滤:1用户、0提供者)
        PointsRule userRule = null;
        PointsRule providerRule = null;
        if (applyUser) {
            userRule = getLatestEffectiveRule(ruleType, ruleNameCode, category, 1);
            if (userRule == null) {
                throw new BusinessException("未找到用户侧生效规则: ruleType=" + ruleType + ", ruleNameCode=" + ruleNameCode + ", category=" + category + ", points_winner=1");
            }
            if (!ruleType.equals(userRule.getRuleType())) {
                throw new BusinessException("用户侧规则类型不匹配,期望: " + userRule.getRuleType() + ",实际: " + ruleType);
            }
        }
        if (applyProvider) {
            providerRule = getLatestEffectiveRule(ruleType, ruleNameCode, category, 0);
            if (providerRule == null) {
                throw new BusinessException("未找到提供者侧生效规则: ruleType=" + ruleType + ", ruleNameCode=" + ruleNameCode + ", category=" + category + ", points_winner=0");
            }
            if (!ruleType.equals(providerRule.getRuleType())) {
                throw new BusinessException("提供者侧规则类型不匹配,期望: " + providerRule.getRuleType() + ",实际: " + ruleType);
            }
        }
        // 计算积分值
        Integer basePoints = pointsRule.getPointsValue() != null ? pointsRule.getPointsValue() : 0;
        Integer totalPoints = basePoints * count;
        // 如果是消费类型,积分为负数
        if (ruleType == RuleTypeEnum.CONSUME.getCode()) { // 1表示消费类型
            totalPoints = -totalPoints;
        // 计算两侧积分变化(各自按规则计算)
        int userPointsChange = 0;
        int providerPointsChange = 0;
        if (applyUser) {
            int base = userRule.getPointsValue() != null ? userRule.getPointsValue() : 0;
            int amount = base * count;
            userPointsChange = (ruleType == RuleTypeEnum.CONSUME.getCode()) ? -Math.abs(amount) : Math.abs(amount);
        }
        if (applyProvider) {
            int base = providerRule.getPointsValue() != null ? providerRule.getPointsValue() : 0;
            int amount = base * count;
            providerPointsChange = (ruleType == RuleTypeEnum.CONSUME.getCode()) ? -Math.abs(amount) : Math.abs(amount);
        }
        // 检查每日积分上限
        if (pointsRule.getIsLimit() != null && pointsRule.getIsLimit() == 0) { // 0表示有每日上限
            checkDailyLimitByRule(userId, unitId, pointsRule, totalPoints);
        // 每日上限校验(分别校验)
        if (applyUser && userRule.getIsLimit() != null && userRule.getIsLimit() == 0) {
            checkDailyLimitByRule(userId, unitId, userRule, userPointsChange);
        }
        if (applyProvider && providerRule.getIsLimit() != null && providerRule.getIsLimit() == 0) {
            checkDailyLimitByRule(providerId, providerId, providerRule, providerPointsChange);
        }
        // 如果是扣积分操作,先检查余额是否足够
        if (totalPoints < 0) {
            checkBalanceSufficient(userId, unitId, Math.abs(totalPoints));
        // 余额校验(仅在扣减时)
        if (applyUser && userPointsChange < 0) {
            checkBalanceSufficient(userId, unitId, Math.abs(userPointsChange));
        }
        if (applyProvider && providerPointsChange < 0) {
            checkBalanceSufficient(providerId, providerId, Math.abs(providerPointsChange));
        }
        // 创建积分流水记录
        PointsFlow pointsFlow = new PointsFlow();
        pointsFlow.setUserId(userId);
        pointsFlow.setUnitId(unitId);
        pointsFlow.setDataType(ruleType);
        pointsFlow.setDataCategory(addPointsFlowDTO.getCategory());
        pointsFlow.setPoints(totalPoints);
        pointsFlow.setName(addPointsFlowDTO.getDescription() != null ? addPointsFlowDTO.getDescription() : pointsRule.getRuleDescription());
        pointsFlow.setFlowTime(LocalDateTime.now());
        pointsFlow.setRlueId(pointsRule.getId());
        // 生成用户侧流水并更新账户
        if (applyUser && userPointsChange != 0) {
            PointsFlow pointsFlow = new PointsFlow();
            pointsFlow.setUserId(userId);
            pointsFlow.setUnitId(unitId);
            pointsFlow.setDataType(ruleType);
            pointsFlow.setDataCategory(addPointsFlowDTO.getCategory());
            pointsFlow.setPoints(userPointsChange);
            pointsFlow.setName(addPointsFlowDTO.getDescription() != null ? addPointsFlowDTO.getDescription() : userRule.getRuleDescription());
            pointsFlow.setFlowTime(LocalDateTime.now());
            pointsFlow.setRlueId(userRule.getId());
        boolean saved = save(pointsFlow);
        if (!saved) {
            throw new BusinessException("保存积分流水失败");
            boolean saved = save(pointsFlow);
            if (!saved) {
                throw new BusinessException("保存积分流水失败");
            }
            updateUserPointsByRule(userId, unitId, userPointsChange);
        }
        // 更新用户积分账户
        updateUserPointsByRule(userId, unitId, totalPoints);
        // 生成提供者侧流水并更新账户
        if (applyProvider && providerPointsChange != 0) {
            PointsFlow providerFlow = new PointsFlow();
            providerFlow.setUserId(providerId);
            providerFlow.setUnitId(providerId);
            providerFlow.setDataType(ruleType);
            providerFlow.setDataCategory(addPointsFlowDTO.getCategory());
            providerFlow.setPoints(providerPointsChange);
            providerFlow.setName(addPointsFlowDTO.getDescription() != null ? addPointsFlowDTO.getDescription() : providerRule.getRuleDescription());
            providerFlow.setFlowTime(LocalDateTime.now());
            providerFlow.setRlueId(providerRule.getId());
            boolean providerSaved = save(providerFlow);
            if (!providerSaved) {
                throw new BusinessException("保存提供者积分流水失败");
            }
            updateProviderUnitPoints(providerId, providerPointsChange);
        }
        return true;
    }
    @Override
    public UserPoints getUserPointsTotal(Long userId) {
        if (userId == null) {
    public UserPoints getUserPointsTotal(String userId) {
        if (!StringUtils.hasText(userId)) {
            throw new BusinessException("用户ID不能为null");
        }
        
@@ -272,9 +322,25 @@
    }
    /**
     * 根据ruleType、ruleNameCode、category、points_winner查询生效时间最新的积分规则
     */
    private PointsRule getLatestEffectiveRule(Integer ruleType, String ruleNameCode, String category, Integer pointsWinner) {
        QueryWrapper<PointsRule> wrapper = new QueryWrapper<>();
        wrapper.eq("deleted", 0)
               .eq("is_enabled", 0)
               .eq("rule_type", ruleType)
               .eq("rule_name_code", ruleNameCode)
               .eq("data_category", category)
               .eq(pointsWinner != null, "points_winner", pointsWinner)
               .orderByDesc("created_at")
               .last("LIMIT 1");
        return pointsRuleService.getOne(wrapper);
    }
    /**
     * 检查每日积分上限(基于规则)
     */
    private void checkDailyLimitByRule(Long userId, Long unitId, PointsRule pointsRule, Integer currentPoints) {
    private void checkDailyLimitByRule(String userId, String unitId, PointsRule pointsRule, Integer currentPoints) {
        // 获取今日开始和结束时间
        LocalDate today = LocalDate.now();
        LocalDateTime startOfDay = today.atStartOfDay();
@@ -315,7 +381,7 @@
    /**
     * 检查积分余额是否足够
     */
    private void checkBalanceSufficient(Long userId, Long unitId, Integer requiredPoints) {
    private void checkBalanceSufficient(String userId, String unitId, Integer requiredPoints) {
        // 检查个人积分余额
        QueryWrapper<UserPoints> userWrapper = new QueryWrapper<>();
        userWrapper.eq("deleted", 0)
@@ -371,7 +437,7 @@
    /**
     * 更新用户积分
     */
    private void updateUserPoints(Long userId, Long unitId, Integer pointsValue) {
    private void updateUserPoints(String userId, String unitId, Integer pointsValue) {
        // 更新个人积分
        QueryWrapper<UserPoints> userWrapper = new QueryWrapper<>();
        userWrapper.eq("deleted", 0)
@@ -412,7 +478,7 @@
    /**
     * 根据规则更新用户积分账户
     */
    private void updateUserPointsByRule(Long userId, Long unitId, Integer pointsValue) {
    private void updateUserPointsByRule(String userId, String unitId, Integer pointsValue) {
        // 更新个人积分账户
        QueryWrapper<UserPoints> userWrapper = new QueryWrapper<>();
        userWrapper.eq("deleted", 0)
@@ -499,4 +565,46 @@
            userPointsMapper.updateById(unitPoints);
        }
    }
    /**
     * 仅更新提供者(单位)积分账户
     */
    private void updateProviderUnitPoints(String providerUnitId, Integer pointsValue) {
        QueryWrapper<UserPoints> unitWrapper = new QueryWrapper<>();
        unitWrapper.eq("deleted", 0)
                  .eq("unit_id", providerUnitId);
        UserPoints unitPoints = userPointsMapper.selectOne(unitWrapper);
        if (unitPoints == null) {
            if (pointsValue < 0) {
                throw new BusinessException("提供者积分余额不足,无法扣除积分");
            }
            unitPoints = new UserPoints();
            unitPoints.setUserId(null);
            unitPoints.setUnitId(providerUnitId);
            unitPoints.setBalance(pointsValue);
            unitPoints.setTotalEarned(pointsValue > 0 ? pointsValue : 0);
            unitPoints.setTotalConsumed(pointsValue < 0 ? Math.abs(pointsValue) : 0);
            userPointsMapper.insert(unitPoints);
        } else {
            if (pointsValue < 0 && unitPoints.getBalance() + pointsValue < 0) {
                throw new BusinessException("提供者积分余额不足,当前余额: " + unitPoints.getBalance() + ",需要扣除: " + Math.abs(pointsValue));
            }
            unitPoints.setBalance(unitPoints.getBalance() + pointsValue);
            if (pointsValue > 0) {
                unitPoints.setTotalEarned(unitPoints.getTotalEarned() != null ?
                        unitPoints.getTotalEarned() + pointsValue : pointsValue);
            }
            if (pointsValue < 0) {
                unitPoints.setTotalConsumed(unitPoints.getTotalConsumed() != null ?
                        unitPoints.getTotalConsumed() + Math.abs(pointsValue) : Math.abs(pointsValue));
            }
            unitPoints.setUpdateTime(LocalDateTime.now());
            userPointsMapper.updateById(unitPoints);
        }
    }
}
src/main/java/com/webmanage/service/impl/ProductPricingServiceImpl.java
@@ -162,11 +162,8 @@
    }
    @Override
    public List<ProductPricing> getPricingByProductId(Long productId) {
    public List<ProductPricing> getPricingByProductId(String productId) {
        try {
            if (productId == null) {
                throw new BusinessException("产品ID不能为空");
            }
            return baseMapper.selectByProductId(productId);
        } catch (Exception e) {
            log.error("根据产品ID查询定价失败: ", e);
src/main/java/com/webmanage/service/impl/UserPointsServiceImpl.java
@@ -23,7 +23,7 @@
public class UserPointsServiceImpl extends ServiceImpl<UserPointsMapper, UserPoints> implements UserPointsService {
    
    @Override
    public PointsStatsVO getPersonalPointsStats(Long userId) {
    public PointsStatsVO getPersonalPointsStats(String userId) {
        UserPoints userPoints = this.baseMapper.selectByUserId(userId);
        
        PointsStatsVO statsVO = new PointsStatsVO();
@@ -48,7 +48,7 @@
    }
    
    @Override
    public PointsStatsVO getUnitPointsStats(Long unitId) {
    public PointsStatsVO getUnitPointsStats(String unitId) {
        UserPoints userPoints = this.baseMapper.selectByUnitId(unitId);
        
        PointsStatsVO statsVO = new PointsStatsVO();
@@ -86,7 +86,7 @@
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateUserPoints(Long userId, Long unitId, Integer points) {
    public void updateUserPoints(String userId, String unitId, Integer points) {
        // 查询用户积分记录
        LambdaQueryWrapper<UserPoints> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserPoints::getUserId, userId);
src/main/java/com/webmanage/vo/CartItemVO.java
@@ -19,7 +19,7 @@
    private Long pricingId;
    @ApiModelProperty("商品ID")
    private Long productId;
    private String productId;
    @ApiModelProperty("商品名称")
    private String productName;
src/main/java/com/webmanage/vo/CartVO.java
@@ -16,10 +16,10 @@
public class CartVO {
    @ApiModelProperty("用户ID")
    private Long userId;
    private String userId;
    @ApiModelProperty("单位ID")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("购物车商品项列表")
    private List<CartItemVO> items;
src/main/java/com/webmanage/vo/OrderDetailItemVO.java
@@ -20,7 +20,7 @@
    private Long pricingId;
    @ApiModelProperty("产品ID")
    private Long productId;
    private String productId;
    @ApiModelProperty("产品套件名称")
    private String suiteName;
@@ -56,7 +56,7 @@
    private BigDecimal totalPrice;
    @ApiModelProperty("产品提供者ID")
    private Long providerId;
    private String providerId;
    @ApiModelProperty("产品提供者名称")
    private String providerName;
src/main/java/com/webmanage/vo/OrderDetailVO.java
@@ -19,13 +19,13 @@
    private String orderId;
    @ApiModelProperty("产品ID")
    private Long productId;
    private String productId;
    @ApiModelProperty("用户ID")
    private Long userId;
    private String userId;
    @ApiModelProperty("单位ID")
    private Long unitId;
    private String unitId;
    @ApiModelProperty("产品名称")
    private String productName;
@@ -34,7 +34,7 @@
    private String providerName;
    @ApiModelProperty("提供者ID")
    private Long providerId;
    private String providerId;
    @ApiModelProperty("申请时间")
    private LocalDateTime applyTime;
src/main/resources/mapper/ApprovalRecordMapper.xml
@@ -30,8 +30,8 @@
    <select id="selectApprovalRecordPage" resultMap="BaseResultMap">
        SELECT ar.<include refid="Base_Column_List"/>
        FROM approval_record ar
        LEFT JOIN order_info oi ON ar.order_id = oi.order_id
        FROM tb_approval_record ar
        LEFT JOIN tb_order_info oi ON ar.order_id = oi.order_id
        WHERE ar.deleted = 0
        <if test="orderId != null and orderId != ''">
            AND ar.order_id = #{orderId}
@@ -80,15 +80,15 @@
    <select id="selectByOrderId" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"/>
        FROM approval_record
        FROM tb_approval_record
        WHERE deleted = 0 AND order_id = #{orderId}
        ORDER BY created_at ASC
    </select>
    <select id="selectPendingApprovalPage" resultMap="BaseResultMap">
        SELECT ar.<include refid="Base_Column_List"/>
        FROM approval_record ar
        LEFT JOIN order_info oi ON ar.order_id = oi.order_id
        FROM tb_approval_record ar
        LEFT JOIN tb_order_info oi ON ar.order_id = oi.order_id
        WHERE ar.deleted = 0 AND ar.approval_result IS NULL
        <if test="orderId != null and orderId != ''">
            AND ar.order_id = #{orderId}
src/main/resources/mapper/CartMapper.xml
@@ -4,10 +4,10 @@
    
    <resultMap id="BaseResultMap" type="com.webmanage.entity.Cart">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="user_id" property="userId" jdbcType="BIGINT"/>
        <result column="unit_id" property="unitId" jdbcType="BIGINT"/>
        <result column="user_id" property="userId" jdbcType="VARCHAR"/>
        <result column="unit_id" property="unitId" jdbcType="VARCHAR"/>
        <result column="pricing_id" property="pricingId" jdbcType="BIGINT"/>
        <result column="product_id" property="productId" jdbcType="BIGINT"/>
        <result column="product_id" property="productId" jdbcType="VARCHAR"/>
        <result column="product_name" property="productName" jdbcType="VARCHAR"/>
        <result column="suite_name" property="suiteName" jdbcType="VARCHAR"/>
        <result column="sales_form" property="salesForm" jdbcType="VARCHAR"/>
@@ -37,40 +37,48 @@
    
    <select id="selectByUserIdAndUnitId" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"/>
        FROM cart
        FROM tb_cart
        WHERE deleted = 0 
        AND user_id = #{userId}
        AND unit_id = #{unitId}
        AND user_id = #{userId}
        <if test="unitId !=null and unitId != ''">
            AND unit_id = #{unitId}
        </if>
        ORDER BY add_time DESC
    </select>
    
    <select id="selectByUserIdUnitIdAndPricingId" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List"/>
        FROM cart
        WHERE deleted = 0
        AND user_id = #{userId}
        AND unit_id = #{unitId}
        FROM tb_cart
        WHERE deleted = 0
        AND user_id = #{userId}
        <if test="unitId != '' and unitId != null">
            AND unit_id = #{unitId}
        </if>
        AND pricing_id = #{pricingId}
        LIMIT 1
    </select>
    
    <select id="countByUserIdAndUnitId" resultType="java.lang.Integer">
        SELECT COUNT(*)
        FROM cart
        FROM tb_cart
        WHERE deleted = 0 
        AND user_id = #{userId}
        AND unit_id = #{unitId}
        AND user_id = #{userId}
        <if test="unitId != '' and unitId != null">
            AND unit_id = #{unitId}
        </if>
    </select>
    
    <select id="sumTotalAmountByUserIdAndUnitId" resultType="java.math.BigDecimal">
        SELECT COALESCE(SUM(total_price), 0)
        FROM cart
        FROM tb_cart
        WHERE deleted = 0 
        AND user_id = #{userId}
        AND unit_id = #{unitId}
        AND user_id = #{userId}
        <if test="unitId != '' and unitId != null">
            AND unit_id = #{unitId}
        </if>
    </select>
    <delete id="deleteByCustomerCondition">
        delete from cart where id = #{id}
        delete from tb_cart where id = #{id}
    </delete>
    
</mapper>
src/main/resources/mapper/OrderAttachmentMapper.xml
@@ -34,7 +34,7 @@
    <select id="selectByOrderId" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_attachment
        FROM tb_order_attachment
        WHERE deleted = 0 AND order_id = #{orderId}
        ORDER BY created_at ASC
    </select>
src/main/resources/mapper/OrderDetailMapper.xml
@@ -38,7 +38,7 @@
    <select id="selectByOrderId" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_detail
        FROM tb_order_detail
        WHERE deleted = 0 AND order_id = #{orderId}
        ORDER BY created_at ASC
    </select>
src/main/resources/mapper/OrderEvaluationMapper.xml
@@ -34,7 +34,7 @@
    <select id="selectByOrderId" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_evaluation
        FROM tb_order_evaluation
        WHERE deleted = 0 AND order_id = #{orderId}
        LIMIT 1
    </select>
src/main/resources/mapper/OrderInfoMapper.xml
@@ -37,12 +37,12 @@
    <select id="selectBuyerOrderPage" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_info
        FROM tb_order_info
        WHERE deleted = 0
        <if test="userId != null">
            AND user_id = #{userId}
        </if>
        <if test="unitId != null">
        <if test="unitId != null and unitId != ''">
            AND unit_id = #{unitId}
        </if>
        <if test="orderStatus != null and orderStatus != ''">
@@ -98,9 +98,9 @@
    <select id="selectSellerOrderPage" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_info
        FROM tb_order_info
        WHERE deleted = 0
        <if test="providerId != null">
        <if test="providerId != null and providerId != ''">
            AND provider_id = #{providerId}
        </if>
        <if test="orderStatus != null and orderStatus != ''">
@@ -150,7 +150,7 @@
    <select id="selectPendingApprovalOrderPage" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_info
        FROM tb_order_info
        WHERE deleted = 0
        AND order_status IN ('待上传文件', '待授权', '待交易确认', '已完成', '已评价')
        <if test="orderStatus != null and orderStatus != ''">
@@ -190,4 +190,129 @@
        </choose>
    </select>
    <!-- 分页查询买家订单列表(支持产品条件) -->
    <select id="selectBuyerOrderPageWithProductConditions" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM tb_order_info
        WHERE deleted = 0
        <if test="userId != null">
            AND user_id = #{userId}
        </if>
        <if test="unitId != null and unitId != ''">
            AND unit_id = #{unitId}
        </if>
        <if test="orderStatus != null and orderStatus != ''">
            AND order_status = #{orderStatus}
        </if>
        <if test="paymentStatus != null and paymentStatus != ''">
            AND payment_status = #{paymentStatus}
        </if>
        <if test="paymentType != null and paymentType != ''">
            AND payment_type = #{paymentType}
        </if>
        <if test="productName != null and productName != ''">
            AND product_name LIKE CONCAT('%', #{productName}, '%')
        </if>
        <if test="providerName != null and providerName != ''">
            AND provider_name LIKE CONCAT('%', #{providerName}, '%')
        </if>
        <if test="orderId != null and orderId != ''">
            AND order_id LIKE CONCAT('%', #{orderId}, '%')
        </if>
        <if test="applyTimeStart != null and applyTimeStart != ''">
            AND apply_time >= #{applyTimeStart}::timestamp
        </if>
        <if test="applyTimeEnd != null and applyTimeEnd != ''">
            AND apply_time &lt;= #{applyTimeEnd}::timestamp
        </if>
        <if test="createTimeStart != null and createTimeStart != ''">
            AND created_at >= #{createTimeStart}::timestamp
        </if>
        <if test="createTimeEnd != null and createTimeEnd != ''">
            AND created_at &lt;= #{createTimeEnd}::timestamp
        </if>
        <if test="productIds != null and productIds.size() > 0">
            AND product_id IN
            <foreach collection="productIds" item="productId" open="(" separator="," close=")">
                #{productId}
            </foreach>
        </if>
        ORDER BY
        <choose>
            <when test="orderBy != null and orderBy != ''">
                ${orderBy}
            </when>
            <otherwise>
                created_at
            </otherwise>
        </choose>
        <choose>
            <when test="orderDirection != null and orderDirection == 'asc'">
                ASC
            </when>
            <otherwise>
                DESC
            </otherwise>
        </choose>
    </select>
    <!-- 分页查询卖家订单列表(支持产品条件) -->
    <select id="selectSellerOrderPageWithProductConditions" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM tb_order_info
        WHERE deleted = 0
        <if test="providerId != null and providerId != ''">
            AND provider_id = #{providerId}
        </if>
        <if test="orderStatus != null and orderStatus != ''">
            AND order_status = #{orderStatus}
        </if>
        <if test="paymentStatus != null and paymentStatus != ''">
            AND payment_status = #{paymentStatus}
        </if>
        <if test="productName != null and productName != ''">
            AND product_name LIKE CONCAT('%', #{productName}, '%')
        </if>
        <if test="orderId != null and orderId != ''">
            AND order_id LIKE CONCAT('%', #{orderId}, '%')
        </if>
        <if test="applyTimeStart != null and applyTimeStart != ''">
            AND apply_time >= #{applyTimeStart}::timestamp
        </if>
        <if test="applyTimeEnd != null and applyTimeEnd != ''">
            AND apply_time &lt;= #{applyTimeEnd}::timestamp
        </if>
        <if test="createTimeStart != null and createTimeStart != ''">
            AND created_at >= #{createTimeStart}::timestamp
        </if>
        <if test="createTimeEnd != null and createTimeEnd != ''">
            AND created_at &lt;= #{createTimeEnd}::timestamp
        </if>
        <if test="productIds != null and productIds.size() > 0">
            AND product_id IN
            <foreach collection="productIds" item="productId" open="(" separator="," close=")">
                #{productId}
            </foreach>
        </if>
        ORDER BY
        <choose>
            <when test="orderBy != null and orderBy != ''">
                ${orderBy}
            </when>
            <otherwise>
                created_at
            </otherwise>
        </choose>
        <choose>
            <when test="orderDirection != null and orderDirection == 'asc'">
                ASC
            </when>
            <otherwise>
                DESC
            </otherwise>
        </choose>
    </select>
</mapper>
src/main/resources/mapper/PointsMapper.xml
@@ -5,7 +5,7 @@
    <!-- 分页查询积分主表 -->
    <select id="selectPointsMainPage" resultType="com.webmanage.entity.Points">
        SELECT *
        FROM points
        FROM tb_points
        WHERE deleted = 0
        <if test="queryDTO.pointsName != null and queryDTO.pointsName != ''">
            AND points_name LIKE CONCAT('%', #{queryDTO.pointsName}, '%')
src/main/resources/mapper/ProductMapper.xml
New file
@@ -0,0 +1,80 @@
<?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="com.webmanage.mapper.ProductMapper">
    <!-- 结果映射 -->
    <resultMap id="BaseResultMap" type="com.webmanage.entity.Product">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="product_name" property="productName" jdbcType="VARCHAR"/>
        <result column="product_code" property="productCode" jdbcType="VARCHAR"/>
        <result column="product_type" property="productType" jdbcType="VARCHAR"/>
        <result column="category" property="category" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="provider_id" property="providerId" jdbcType="BIGINT"/>
        <result column="provider_name" property="providerName" jdbcType="VARCHAR"/>
        <result column="provider_type" property="providerType" jdbcType="VARCHAR"/>
        <result column="status" property="status" jdbcType="VARCHAR"/>
        <result column="audit_status" property="auditStatus" jdbcType="VARCHAR"/>
        <result column="tags" property="tags" jdbcType="VARCHAR"/>
        <result column="cover_image" property="coverImage" jdbcType="VARCHAR"/>
        <result column="demo_url" property="demoUrl" jdbcType="VARCHAR"/>
        <result column="doc_url" property="docUrl" jdbcType="VARCHAR"/>
        <result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
        <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP"/>
        <result column="created_by" property="createdBy" jdbcType="BIGINT"/>
        <result column="updated_by" property="updatedBy" jdbcType="BIGINT"/>
        <result column="deleted" property="deleted" jdbcType="INTEGER"/>
    </resultMap>
    <!-- 基础字段 -->
    <sql id="Base_Column_List">
        id, product_name, product_code, product_type, category, description,
        provider_id, provider_name, provider_type, status, audit_status,
        tags, cover_image, demo_url, doc_url, created_at, updated_at,
        created_by, updated_by, deleted
    </sql>
    <!-- 根据条件查询产品列表 -->
    <select id="selectProductList" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM tb_product
        WHERE deleted = 0
        <if test="productName != null and productName != ''">
            AND product_name LIKE CONCAT('%', #{productName}, '%')
        </if>
        <if test="productType != null and productType != ''">
            AND product_type = #{productType}
        </if>
        <if test="status != null and status != ''">
            AND status = #{status}
        </if>
        <if test="providerId != null">
            AND provider_id = #{providerId}
        </if>
        ORDER BY created_at DESC
    </select>
    <!-- 根据ID查询产品详情 -->
    <select id="selectProductById" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM tb_product
        WHERE id = #{id} AND deleted = 0
    </select>
    <!-- 更新产品状态 -->
    <update id="updateProductStatus">
        UPDATE tb_product
        SET status = #{status}, updated_at = CURRENT_TIMESTAMP
        WHERE id = #{id} AND deleted = 0
    </update>
    <!-- 更新产品审核状态 -->
    <update id="updateProductAuditStatus">
        UPDATE tb_product
        SET audit_status = #{auditStatus}, updated_at = CURRENT_TIMESTAMP
        WHERE id = #{id} AND deleted = 0
    </update>
</mapper>
src/main/resources/mapper/ProductPricingMapper.xml
@@ -15,9 +15,9 @@
        <result column="points_price" property="pointsPrice" jdbcType="DECIMAL"/>
        <result column="currency_price" property="currencyPrice" jdbcType="DECIMAL"/>
        <result column="is_active" property="isActive" jdbcType="BOOLEAN"/>
        <result column="product_id" property="productId" jdbcType="BIGINT"/>
        <result column="product_id" property="productId" jdbcType="VARCHAR"/>
        <result column="product_name" property="productName" jdbcType="VARCHAR"/>
        <result column="provider_id" property="providerId" jdbcType="BIGINT"/>
        <result column="provider_id" property="providerId" jdbcType="VARCHAR"/>
        <result column="provider_name" property="providerName" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
@@ -38,7 +38,7 @@
    <select id="selectProductPricingPage" resultMap="BaseResultMap">
        SELECT 
        <include refid="Base_Column_List"/>
        FROM product_pricing
        FROM tb_product_pricing
        WHERE deleted = 0
        <if test="productId != null">
            AND product_id = #{productId}
@@ -50,7 +50,7 @@
    <select id="selectByProductId" resultMap="BaseResultMap">
        SELECT 
        <include refid="Base_Column_List"/>
        FROM product_pricing
        FROM tb_product_pricing
        WHERE deleted = 0 AND product_id = #{productId}
        ORDER BY created_at DESC
    </select>
@@ -59,7 +59,7 @@
    <select id="selectByCondition" resultMap="BaseResultMap">
        SELECT 
        <include refid="Base_Column_List"/>
        FROM product_pricing
        FROM tb_product_pricing
        WHERE deleted = 0
        <if test="suiteName != null and suiteName != ''">
            AND suite_name LIKE CONCAT('%', #{suiteName}, '%')
src/main/resources/mapper/ReportResultSubmissionMapper.xml
New file
@@ -0,0 +1,24 @@
<?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="com.webmanage.mapper.ReportResultSubmissionMapper">
    <!-- 根据条件查询产品ID列表 -->
    <select id="selectProductIdsByConditions" resultType="java.lang.String">
        SELECT id
        FROM tb_report_result_submission
        WHERE deleted = '0'
        <if test="industryId != null and industryId != ''">
            AND industrial_chain_id = #{industryId}
        </if>
        <if test="unitProjectId != null and unitProjectId != ''">
            AND important_area_id = #{unitProjectId}
        </if>
        <if test="productTypeId != null and productTypeId != ''">
            AND type_id = #{productTypeId}
        </if>
        <if test="productSubTypeId != null and productSubTypeId != ''">
            AND type_child_id = #{productSubTypeId}
        </if>
    </select>
</mapper>
src/main/resources/mapper/UserPointsMapper.xml
@@ -5,7 +5,7 @@
    <!-- 根据用户ID查询积分信息 -->
    <select id="selectByUserId" resultType="com.webmanage.entity.UserPoints">
        SELECT *
        FROM user_points
        FROM tb_user_points
        WHERE user_id = #{userId}
        AND deleted = 0
        LIMIT 1
@@ -14,7 +14,7 @@
    <!-- 根据单位ID查询积分信息 -->
    <select id="selectByUnitId" resultType="com.webmanage.entity.UserPoints">
        SELECT *
        FROM user_points
        FROM tb_user_points
        WHERE unit_id = #{unitId}
        AND deleted = 0
        LIMIT 1