Lijingyang пре 2 месеци
родитељ
комит
d128723c6f
20 измењених фајлова са 2320 додато и 63 уклоњено
  1. 2 2
      ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/interceptor/PlatformDataScopeInterceptor.java
  2. 2 2
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierAuthorizeController.java
  3. 53 2
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoController.java
  4. 109 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoTemporaryController.java
  5. 9 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplyAreaController.java
  6. 338 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/SupplierInfoTemporary.java
  7. 330 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/SupplierInfoTemporaryBo.java
  8. 2 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/SupplyAreaBo.java
  9. 431 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/SupplierInfoTemporaryVo.java
  10. 26 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/SupplyAreaJsonVo.java
  11. 15 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/mapper/SupplierInfoTemporaryMapper.java
  12. 1 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierAuthorizeService.java
  13. 8 1
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoService.java
  14. 77 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoTemporaryService.java
  15. 4 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplyAreaService.java
  16. 9 3
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierAuthorizeServiceImpl.java
  17. 456 33
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java
  18. 210 0
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoTemporaryServiceImpl.java
  19. 231 18
      ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplyAreaServiceImpl.java
  20. 7 0
      ruoyi-modules/ruoyi-customer/src/main/resources/mapper/customer/SupplierInfoTemporaryMapper.xml

+ 2 - 2
ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/interceptor/PlatformDataScopeInterceptor.java

@@ -89,7 +89,7 @@ public class PlatformDataScopeInterceptor implements Interceptor {
         "partner_contacts",
         "partner_contract",
         "partner_warehouse",
-        "partner_qualification"
+        "partner_qualification",
         "address_area",
         "supplier_",
         "supply_area",
@@ -210,7 +210,7 @@ public class PlatformDataScopeInterceptor implements Interceptor {
         }
 
         // 前缀匹配
-        return tableName.startsWith("qrtz_") || tableName.startsWith("product_") || tableName.startsWith("com_");
+        return tableName.startsWith("qrtz_") || tableName.startsWith("product_") || tableName.startsWith("com_") ||tableName.startsWith("supplier_");
     }
 
     /**

+ 2 - 2
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierAuthorizeController.java

@@ -76,8 +76,8 @@ public class SupplierAuthorizeController extends BaseController {
      */
 //    @SaCheckPermission("supplier:supplierauthorize:query")
     @GetMapping("/getAuthorizeDetailList")
-    public R<List<SupplierAuthorizeVo>> getAuthorizeDetailList(Long supplierId, PageQuery pageQuery) {
-        return R.ok(supplierAuthorizeService.getAuthorizeDetailList(supplierId, pageQuery));
+    public TableDataInfo<SupplierAuthorizeVo> getAuthorizeDetailList(Long supplierId, PageQuery pageQuery) {
+        return supplierAuthorizeService.getAuthorizeDetailList(supplierId, pageQuery);
     }
 
     @GetMapping("/getDetailList")

+ 53 - 2
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoController.java

@@ -13,6 +13,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 import org.dromara.customer.domain.SupplierInfo;
 import org.dromara.customer.domain.vo.SupplierInformationVo;
 import org.dromara.customer.service.ISupplierProcurementService;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.validation.annotation.Validated;
 import org.dromara.common.idempotent.annotation.RepeatSubmit;
@@ -97,6 +98,26 @@ public class SupplierInfoController extends BaseController {
         return R.ok(collect);
     }
 
+    /**
+     * 根据id获取品目列表 srm用
+     * @param supplierId
+     * @return
+     */
+    @GetMapping("/getsrmCategories")
+    public R<List<String>> getsrmSupplierCategories(@RequestParam Long supplierId) throws JsonProcessingException {
+        // 根据供应商ID查询已选择的品目ID列表
+        SupplierInfoVo supplierInfo = supplierInfoService.querySrmById(supplierId);
+        if (ObjectUtil.isEmpty(supplierInfo) || ObjectUtil.isEmpty(supplierInfo.getOperatingCategory())) {
+            return R.ok(List.of());
+        }
+        List<String> collect = Arrays.stream(supplierInfo.getOperatingCategory().split(",")).collect(Collectors.toList());
+        //List<String> categoryIds = supplierCategoryService.getCategoryIdsBySupplierId(supplierId);
+        return R.ok(collect);
+    }
+
+
+
+
 
 
 
@@ -113,7 +134,7 @@ public class SupplierInfoController extends BaseController {
     }
 
     /**
-     * 获取供应商信息详细信息
+     * 获取供应商信息详细信息  这是给scm用的
      *
      * @param id 主键
      */
@@ -124,6 +145,22 @@ public class SupplierInfoController extends BaseController {
         return R.ok(supplierInfoService.queryById(id));
     }
 
+    /**
+     * 获取供应商信息详细信息  这是给srm用的
+     *
+     * @param id 主键
+     */
+    @GetMapping("/srm/{id}")
+    public R<SupplierInfoVo> getSrmInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable("id") Long id) throws JsonProcessingException {
+        return R.ok(supplierInfoService.querySrmById(id));
+    }
+
+
+
+
+
+
     /**
      * 新增供应商信息
      */
@@ -142,7 +179,8 @@ public class SupplierInfoController extends BaseController {
     @Log(title = "供应商信息", businessType = BusinessType.UPDATE)
     @RepeatSubmit()
     @PutMapping()
-    public R<Void> edit(@Validated(EditGroup.class) @RequestBody SupplierInfoBo bo) {
+    @Transactional(rollbackFor = Exception.class)
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody SupplierInfoBo bo) throws JsonProcessingException {
         return toAjax(supplierInfoService.updateByBo(bo));
     }
 
@@ -158,4 +196,17 @@ public class SupplierInfoController extends BaseController {
                           @PathVariable("ids") Long[] ids) {
         return toAjax(supplierInfoService.deleteWithValidByIds(List.of(ids), true));
     }
+
+
+
+    @RepeatSubmit()
+    @PutMapping("/edit")
+    @Transactional(rollbackFor = Exception.class)
+
+    public R<Void> srmEdit(@RequestBody SupplierInfoBo bo) throws JsonProcessingException {
+        return toAjax(supplierInfoService.srmUpdateByBo(bo));
+    }
+
+
+
 }

+ 109 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplierInfoTemporaryController.java

@@ -0,0 +1,109 @@
+package org.dromara.customer.controller;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import org.dromara.customer.domain.vo.SupplierInfoTemporaryVo;
+import org.dromara.customer.domain.bo.SupplierInfoTemporaryBo;
+import org.dromara.customer.service.ISupplierInfoTemporaryService;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 供应商临时信息
+ * 前端访问路由地址为:/customer/infoTemporary
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/infoTemporary")
+public class SupplierInfoTemporaryController extends BaseController {
+
+    private final ISupplierInfoTemporaryService supplierInfoTemporaryService;
+
+    /**
+     * 查询供应商临时信息列表
+     */
+    //@SaCheckPermission("customer:infoTemporary:list")
+    @GetMapping("/list")
+    public TableDataInfo<SupplierInfoTemporaryVo> list(SupplierInfoTemporaryBo bo, PageQuery pageQuery) {
+        return supplierInfoTemporaryService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出供应商临时信息列表
+     */
+    //@SaCheckPermission("customer:infoTemporary:export")
+    @Log(title = "供应商临时信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(SupplierInfoTemporaryBo bo, HttpServletResponse response) {
+        List<SupplierInfoTemporaryVo> list = supplierInfoTemporaryService.queryList(bo);
+        ExcelUtil.exportExcel(list, "供应商临时信息", SupplierInfoTemporaryVo.class, response);
+    }
+
+    /**
+     * 获取供应商临时信息详细信息
+     *
+     * @param id 主键
+     */
+    //@SaCheckPermission("customer:infoTemporary:query")
+    @GetMapping("/{id}")
+    public R<SupplierInfoTemporaryVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable("id") Long id) {
+
+        return R.ok(supplierInfoTemporaryService.queryByVOId(id));
+    }
+
+    /**
+     * 新增供应商临时信息
+     */
+    //@SaCheckPermission("customer:infoTemporary:add")
+    @Log(title = "供应商临时信息", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody SupplierInfoTemporaryBo bo) {
+        return toAjax(supplierInfoTemporaryService.insertByBo(bo));
+    }
+
+    /**
+     * 修改供应商临时信息
+     */
+    //@SaCheckPermission("customer:infoTemporary:edit")
+    @Log(title = "供应商临时信息", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody SupplierInfoTemporaryBo bo) {
+        return toAjax(supplierInfoTemporaryService.updateByBo(bo));
+    }
+
+    /**
+     * 删除供应商临时信息
+     *
+     * @param ids 主键串
+     */
+    //@SaCheckPermission("customer:infoTemporary:remove")
+    @Log(title = "供应商临时信息", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable("ids") Long[] ids) {
+        return toAjax(supplierInfoTemporaryService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 9 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/controller/SupplyAreaController.java

@@ -39,7 +39,7 @@ public class SupplyAreaController extends BaseController {
     private final ISupplyAreaService supplyAreaService;
 
     /**
-     * 查询供应区域列表
+     * 查询供应区域列表   给scm用的
      */
     //@SaCheckPermission("supplier:area:list")
     @GetMapping("/list")
@@ -47,6 +47,14 @@ public class SupplyAreaController extends BaseController {
         return supplyAreaService.queryPageList(bo, pageQuery);
     }
 
+    /**
+     * 查询供应区域列表   给srm用的
+     */
+    @GetMapping("/srm/list")
+    public TableDataInfo<SupplyAreaVo> srmList(SupplyAreaBo bo, PageQuery pageQuery) {
+        return supplyAreaService.querySrmPageList(bo, pageQuery);
+    }
+
 
 
 

+ 338 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/SupplierInfoTemporary.java

@@ -0,0 +1,338 @@
+package org.dromara.customer.domain;
+
+import org.dromara.common.tenant.core.TenantEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.dromara.common.translation.annotation.Translation;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.dromara.common.translation.constant.TransConstant;
+
+import java.io.Serial;
+
+/**
+ * 供应商临时信息对象 supplier_info_temporary
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("supplier_info_temporary")
+public class SupplierInfoTemporary extends TenantEntity {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 对应supplier_info.id
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 供应商编号
+     */
+    private String supplierNo;
+
+    private Long supplierId;
+
+    /**
+     * 供应商名称
+     */
+    private String enterpriseName;
+
+    /**
+     * 企业规模
+     */
+    private Long membershipSize;
+
+    /**
+     * 供应商类型(如生产厂家/经销商/代理商)
+     */
+    private Long supplierType;
+
+    /**
+     * 合作类型(如框架合作/项目合作/一次性合作)
+     */
+    private Long cooperationType;
+
+    /**
+     * 固定电话(多个号码用分隔符区分)
+     */
+    private String fixedPhone;
+
+    /**
+     * 传真号码
+     */
+    private String fax;
+
+    /**
+     * 企业官网地址
+     */
+    private String url;
+
+    /**
+     * 邮政编码
+     */
+    private String postCode;
+
+    /**
+     * 企业邮箱
+     */
+    private String mailbox;
+
+    /**
+     * 办公地址-省份
+     */
+    private String officeProvince;
+
+    /**
+     * 办公地址-城市
+     */
+    private String officeCity;
+
+    /**
+     * 办公地址-区县
+     */
+    private String officeCounty;
+
+    /**
+     * 办公地址-详细地址
+     */
+    private String officeAddress;
+
+    /**
+     * 工商注册名称(与营业执照一致)
+     */
+    private String businessName;
+
+    /**
+     * 统一社会信用代码
+     */
+    private String socialCreditCode;
+
+    /**
+     * 法定代表人姓名
+     */
+    private String legalPersonName;
+
+    /**
+     * 法定代表人身份证号(加密存储)
+     */
+    private String legalPersonId;
+
+    /**
+     * 注册资本(如500万/1000万元人民币)
+     */
+    private String registeredCapital;
+
+    /**
+     * 经营地址-省份
+     */
+    private String businessProvince;
+
+    /**
+     * 经营地址-城市
+     */
+    private String businessCity;
+
+    /**
+     * 经营地址-区县
+     */
+    private String businessCounty;
+
+    /**
+     * 经营地址-详细地址
+     */
+    private String businessAddress;
+
+    /**
+     * 营业执照图片存储地址(多个地址用分隔符区分)
+     */
+    private String businessLicense;
+
+    /**
+     * 发票类型(如增值税专票/普票/电子发票)
+     */
+    private String invoiceType;
+
+    /**
+     * 发票抬头
+     */
+    private String invoiceHeader;
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentifier;
+
+    /**
+     * 开户银行
+     */
+    private String depositaryBank;
+
+    /**
+     * 行号(开户银行行号)
+     */
+    private String rowNum;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccounts;
+
+    /**
+     * 开票地址
+     */
+    private String invoiceAddress;
+
+    /**
+     * 开票固定电话
+     */
+    private String invoiceLandline;
+
+    /**
+     * 供货范围(经营品类/产品范围)
+     */
+    private String scopeSupply;
+
+    /**
+     * 合作方式(0线下 1线上 2混合)
+     */
+    private String cooperateWay;
+
+    /**
+     * 合作等级(如A级/B级/C级)
+     */
+    private String cooperateLevel;
+
+    /**
+     * 合同到期时间
+     */
+    private Date contractEndTime;
+
+    /**
+     * 供货状态(0未供货 1供货中 2暂停供货 3终止供货)
+     */
+    private Long supplyStatus;
+
+    /**
+     * 供货评分(如1-100分)
+     */
+    private Long supplyScore;
+
+    /**
+     * 年销售额(单位:万元)
+     */
+    private Long yearSales;
+
+    /**
+     * 供应商联系人姓名
+     */
+    private String supplierName;
+
+    /**
+     * 供应商联系人电话
+     */
+    private String supplierPhone;
+
+    /**
+     * 供应商登录密码(加密存储)
+     */
+    private String supplierPassword;
+
+    /**
+     * 经营品类(多个品类用分隔符区分)
+     */
+    private String operatingCategory;
+
+    /**
+     * 经营品牌(多个品牌用分隔符区分)
+     */
+    private String operatingBrand;
+
+    /**
+     * 其他合作客户(客户名称列表)
+     */
+    private String otherCustomers;
+
+    /**
+     * 企业简称
+     */
+    private String shortName;
+
+    /**
+     * 行业分类(如电子/建材/食品)
+     */
+    private Long industrCategory;
+
+    /**
+     * 补充类型(预留字段)
+     */
+    private String type;
+
+    /**
+     * 所属集团公司(如有)
+     */
+    private Long ownedCompany;
+
+    /**
+     * 数据推送状态(0未推送 1已推送 2推送失败)
+     */
+    private String pushStatus;
+
+    /**
+     * 有效期起始时间
+     */
+    private Date validityFromDate;
+
+    /**
+     * 有效期截止时间
+     */
+    private Date validityToDate;
+
+    /**
+     * 行序号(导入数据用)
+     */
+    private Long rowNo;
+
+    /**
+     * 经办人身份证/授权书图片地址
+     */
+    private String personImage;
+
+    /**
+     * 对接人编号
+     */
+    private Long abutmentNo;
+
+    /**
+     * 是否合作(0否 1是)
+     */
+    private Long cooperative;
+
+    /**
+     * 覆盖区域列表(JSON格式,如省份/城市列表)
+     */
+    private String areaListJson;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    private String status;
+
+    /**
+     * 删除标志(0代表存在 2代表删除)
+     */
+    @TableLogic
+    private String delFlag;
+
+    /**
+     * 备注信息
+     */
+    private String remark;
+
+
+}

+ 330 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/SupplierInfoTemporaryBo.java

@@ -0,0 +1,330 @@
+package org.dromara.customer.domain.bo;
+
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+import org.dromara.common.translation.annotation.Translation;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.dromara.common.translation.constant.TransConstant;
+
+/**
+ * 供应商临时信息业务对象 supplier_info_temporary
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = SupplierInfoTemporary.class, reverseConvertGenerate = false)
+public class SupplierInfoTemporaryBo extends BaseEntity {
+
+    /**
+     * 对应supplier_info.id
+     */
+    private Long id;
+
+    /**
+     * 供应商编号
+     */
+    private String supplierNo;
+
+    private Long supplierId;
+
+    /**
+     * 供应商名称
+     */
+    private String enterpriseName;
+
+    /**
+     * 企业规模
+     */
+    private Long membershipSize;
+
+    /**
+     * 供应商类型(如生产厂家/经销商/代理商)
+     */
+    private Long supplierType;
+
+    /**
+     * 合作类型(如框架合作/项目合作/一次性合作)
+     */
+    private Long cooperationType;
+
+    /**
+     * 固定电话(多个号码用分隔符区分)
+     */
+    private String fixedPhone;
+
+    /**
+     * 传真号码
+     */
+    private String fax;
+
+    /**
+     * 企业官网地址
+     */
+    private String url;
+
+    /**
+     * 邮政编码
+     */
+    private String postCode;
+
+    /**
+     * 企业邮箱
+     */
+    private String mailbox;
+
+    /**
+     * 办公地址-省份
+     */
+    private String officeProvince;
+
+    /**
+     * 办公地址-城市
+     */
+    private String officeCity;
+
+    /**
+     * 办公地址-区县
+     */
+    private String officeCounty;
+
+    /**
+     * 办公地址-详细地址
+     */
+    private String officeAddress;
+
+    /**
+     * 工商注册名称(与营业执照一致)
+     */
+    private String businessName;
+
+    /**
+     * 统一社会信用代码
+     */
+    private String socialCreditCode;
+
+    /**
+     * 法定代表人姓名
+     */
+    private String legalPersonName;
+
+    /**
+     * 法定代表人身份证号(加密存储)
+     */
+    private String legalPersonId;
+
+    /**
+     * 注册资本(如500万/1000万元人民币)
+     */
+    private String registeredCapital;
+
+    /**
+     * 经营地址-省份
+     */
+    private String businessProvince;
+
+    /**
+     * 经营地址-城市
+     */
+    private String businessCity;
+
+    /**
+     * 经营地址-区县
+     */
+    private String businessCounty;
+
+    /**
+     * 经营地址-详细地址
+     */
+    private String businessAddress;
+
+    /**
+     * 营业执照图片存储地址(多个地址用分隔符区分)
+     */
+    private String businessLicense;
+
+    /**
+     * 发票类型(如增值税专票/普票/电子发票)
+     */
+    private String invoiceType;
+
+    /**
+     * 发票抬头
+     */
+    private String invoiceHeader;
+
+    /**
+     * 纳税人识别号
+     */
+    private String taxpayerIdentifier;
+
+    /**
+     * 开户银行
+     */
+    private String depositaryBank;
+
+    /**
+     * 行号(开户银行行号)
+     */
+    private String rowNum;
+
+    /**
+     * 银行账号
+     */
+    private String bankAccounts;
+
+    /**
+     * 开票地址
+     */
+    private String invoiceAddress;
+
+    /**
+     * 开票固定电话
+     */
+    private String invoiceLandline;
+
+    /**
+     * 供货范围(经营品类/产品范围)
+     */
+    private String scopeSupply;
+
+    /**
+     * 合作方式(0线下 1线上 2混合)
+     */
+    private String cooperateWay;
+
+    /**
+     * 合作等级(如A级/B级/C级)
+     */
+    private String cooperateLevel;
+
+    /**
+     * 合同到期时间
+     */
+    private Date contractEndTime;
+
+    /**
+     * 供货状态(0未供货 1供货中 2暂停供货 3终止供货)
+     */
+    private Long supplyStatus;
+
+    /**
+     * 供货评分(如1-100分)
+     */
+    private Long supplyScore;
+
+    /**
+     * 年销售额(单位:万元)
+     */
+    private Long yearSales;
+
+    /**
+     * 供应商联系人姓名
+     */
+    private String supplierName;
+
+    /**
+     * 供应商联系人电话
+     */
+    private String supplierPhone;
+
+    /**
+     * 供应商登录密码(加密存储)
+     */
+    private String supplierPassword;
+
+    /**
+     * 经营品类(多个品类用分隔符区分)
+     */
+    private String operatingCategory;
+
+    /**
+     * 经营品牌(多个品牌用分隔符区分)
+     */
+    private String operatingBrand;
+
+    /**
+     * 其他合作客户(客户名称列表)
+     */
+    private String otherCustomers;
+
+    /**
+     * 企业简称
+     */
+    private String shortName;
+
+    /**
+     * 行业分类(如电子/建材/食品)
+     */
+    private Long industrCategory;
+
+    /**
+     * 补充类型(预留字段)
+     */
+    private String type;
+
+    /**
+     * 所属集团公司(如有)
+     */
+    private Long ownedCompany;
+
+    /**
+     * 数据推送状态(0未推送 1已推送 2推送失败)
+     */
+    private String pushStatus;
+
+    /**
+     * 有效期起始时间
+     */
+    private Date validityFromDate;
+
+    /**
+     * 有效期截止时间
+     */
+    private Date validityToDate;
+
+    /**
+     * 行序号(导入数据用)
+     */
+    private Long rowNo;
+
+    /**
+     * 经办人身份证/授权书图片地址
+     */
+    private String personImage;
+
+    /**
+     * 对接人编号
+     */
+    private Long abutmentNo;
+
+    /**
+     * 是否合作(0否 1是)
+     */
+    private Long cooperative;
+
+    /**
+     * 覆盖区域列表(JSON格式,如省份/城市列表)
+     */
+    private String areaListJson;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    private String status;
+
+    /**
+     * 备注信息
+     */
+    private String remark;
+
+
+}

+ 2 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/bo/SupplyAreaBo.java

@@ -59,4 +59,6 @@ public class SupplyAreaBo extends BaseEntity {
     private List<SupplyAreaBo> areaList;
 
 
+    private Long supplyStatus;
+
 }

+ 431 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/SupplierInfoTemporaryVo.java

@@ -0,0 +1,431 @@
+package org.dromara.customer.domain.vo;
+
+import org.dromara.common.translation.annotation.Translation;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.dromara.common.translation.constant.TransConstant;
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
+import cn.idev.excel.annotation.ExcelProperty;
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.common.excel.convert.ExcelDictConvert;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+ * 供应商临时信息视图对象 supplier_info_temporary
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = SupplierInfoTemporary.class)
+public class SupplierInfoTemporaryVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 对应supplier_info.id
+     */
+    @ExcelProperty(value = "id ")
+    private Long id;
+
+    /**
+     * 供应商编号
+     */
+    @ExcelProperty(value = "供应商编号")
+    private String supplierNo;
+
+
+    private Long supplierId;
+
+    /**
+     * 供应商名称
+     */
+    @ExcelProperty(value = "供应商名称")
+    private String enterpriseName;
+
+    /**
+     * 企业规模
+     */
+    @ExcelProperty(value = "企业规模")
+    private Long membershipSize;
+
+    /**
+     * 供应商类型(如生产厂家/经销商/代理商)
+     */
+    @ExcelProperty(value = "供应商类型", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=生产厂家/经销商/代理商")
+    private Long supplierType;
+
+    /**
+     * 合作类型(如框架合作/项目合作/一次性合作)
+     */
+    @ExcelProperty(value = "合作类型", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=框架合作/项目合作/一次性合作")
+    private Long cooperationType;
+
+    /**
+     * 固定电话(多个号码用分隔符区分)
+     */
+    @ExcelProperty(value = "固定电话", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "多=个号码用分隔符区分")
+    private String fixedPhone;
+
+    /**
+     * 传真号码
+     */
+    @ExcelProperty(value = "传真号码")
+    private String fax;
+
+    /**
+     * 企业官网地址
+     */
+    @ExcelProperty(value = "企业官网地址")
+    private String url;
+
+    /**
+     * 邮政编码
+     */
+    @ExcelProperty(value = "邮政编码")
+    private String postCode;
+
+    /**
+     * 企业邮箱
+     */
+    @ExcelProperty(value = "企业邮箱")
+    private String mailbox;
+
+    /**
+     * 办公地址-省份
+     */
+    @ExcelProperty(value = "办公地址-省份")
+    private String officeProvince;
+
+    /**
+     * 办公地址-城市
+     */
+    @ExcelProperty(value = "办公地址-城市")
+    private String officeCity;
+
+    /**
+     * 办公地址-区县
+     */
+    @ExcelProperty(value = "办公地址-区县")
+    private String officeCounty;
+
+    /**
+     * 办公地址-详细地址
+     */
+    @ExcelProperty(value = "办公地址-详细地址")
+    private String officeAddress;
+
+    /**
+     * 工商注册名称(与营业执照一致)
+     */
+    @ExcelProperty(value = "工商注册名称", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "与=营业执照一致")
+    private String businessName;
+
+    /**
+     * 统一社会信用代码
+     */
+    @ExcelProperty(value = "统一社会信用代码")
+    private String socialCreditCode;
+
+    /**
+     * 法定代表人姓名
+     */
+    @ExcelProperty(value = "法定代表人姓名")
+    private String legalPersonName;
+
+    /**
+     * 法定代表人身份证号(加密存储)
+     */
+    @ExcelProperty(value = "法定代表人身份证号", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "加=密存储")
+    private String legalPersonId;
+
+    /**
+     * 注册资本(如500万/1000万元人民币)
+     */
+    @ExcelProperty(value = "注册资本", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=500万/1000万元人民币")
+    private String registeredCapital;
+
+    /**
+     * 经营地址-省份
+     */
+    @ExcelProperty(value = "经营地址-省份")
+    private String businessProvince;
+
+    /**
+     * 经营地址-城市
+     */
+    @ExcelProperty(value = "经营地址-城市")
+    private String businessCity;
+
+    /**
+     * 经营地址-区县
+     */
+    @ExcelProperty(value = "经营地址-区县")
+    private String businessCounty;
+
+    /**
+     * 经营地址-详细地址
+     */
+    @ExcelProperty(value = "经营地址-详细地址")
+    private String businessAddress;
+
+    /**
+     * 营业执照图片存储地址(多个地址用分隔符区分)
+     */
+    @ExcelProperty(value = "营业执照图片存储地址", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "多=个地址用分隔符区分")
+    private String businessLicense;
+
+    /**
+     * 发票类型(如增值税专票/普票/电子发票)
+     */
+    @ExcelProperty(value = "发票类型", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=增值税专票/普票/电子发票")
+    private String invoiceType;
+
+    /**
+     * 发票抬头
+     */
+    @ExcelProperty(value = "发票抬头")
+    private String invoiceHeader;
+
+    /**
+     * 纳税人识别号
+     */
+    @ExcelProperty(value = "纳税人识别号")
+    private String taxpayerIdentifier;
+
+    /**
+     * 开户银行
+     */
+    @ExcelProperty(value = "开户银行")
+    private String depositaryBank;
+
+    /**
+     * 行号(开户银行行号)
+     */
+    @ExcelProperty(value = "行号", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "开=户银行行号")
+    private String rowNum;
+
+    /**
+     * 银行账号
+     */
+    @ExcelProperty(value = "银行账号")
+    private String bankAccounts;
+
+    /**
+     * 开票地址
+     */
+    @ExcelProperty(value = "开票地址")
+    private String invoiceAddress;
+
+    /**
+     * 开票固定电话
+     */
+    @ExcelProperty(value = "开票固定电话")
+    private String invoiceLandline;
+
+    /**
+     * 供货范围(经营品类/产品范围)
+     */
+    @ExcelProperty(value = "供货范围", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "经=营品类/产品范围")
+    private String scopeSupply;
+
+    /**
+     * 合作方式(0线下 1线上 2混合)
+     */
+    @ExcelProperty(value = "合作方式", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=线下,1=线上,2=混合")
+    private String cooperateWay;
+
+    /**
+     * 合作等级(如A级/B级/C级)
+     */
+    @ExcelProperty(value = "合作等级", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=A级/B级/C级")
+    private String cooperateLevel;
+
+    /**
+     * 合同到期时间
+     */
+    @ExcelProperty(value = "合同到期时间")
+    private Date contractEndTime;
+
+    /**
+     * 供货状态(0未供货 1供货中 2暂停供货 3终止供货)
+     */
+    @ExcelProperty(value = "供货状态", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=未供货,1=供货中,2=暂停供货,3=终止供货")
+    private Long supplyStatus;
+
+    /**
+     * 供货评分(如1-100分)
+     */
+    @ExcelProperty(value = "供货评分", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=1-100分")
+    private Long supplyScore;
+
+    /**
+     * 年销售额(单位:万元)
+     */
+    @ExcelProperty(value = "年销售额", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "单=位:万元")
+    private Long yearSales;
+
+    /**
+     * 供应商联系人姓名
+     */
+    @ExcelProperty(value = "供应商联系人姓名")
+    private String supplierName;
+
+    /**
+     * 供应商联系人电话
+     */
+    @ExcelProperty(value = "供应商联系人电话")
+    private String supplierPhone;
+
+    /**
+     * 供应商登录密码(加密存储)
+     */
+    @ExcelProperty(value = "供应商登录密码", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "加=密存储")
+    private String supplierPassword;
+
+    /**
+     * 经营品类(多个品类用分隔符区分)
+     */
+    @ExcelProperty(value = "经营品类", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "多=个品类用分隔符区分")
+    private String operatingCategory;
+
+    /**
+     * 经营品牌(多个品牌用分隔符区分)
+     */
+    @ExcelProperty(value = "经营品牌", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "多=个品牌用分隔符区分")
+    private String operatingBrand;
+
+    /**
+     * 其他合作客户(客户名称列表)
+     */
+    @ExcelProperty(value = "其他合作客户", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "客=户名称列表")
+    private String otherCustomers;
+
+    /**
+     * 企业简称
+     */
+    @ExcelProperty(value = "企业简称")
+    private String shortName;
+
+    /**
+     * 行业分类(如电子/建材/食品)
+     */
+    @ExcelProperty(value = "行业分类", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=电子/建材/食品")
+    private Long industrCategory;
+
+    /**
+     * 补充类型(预留字段)
+     */
+    @ExcelProperty(value = "补充类型", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "预=留字段")
+    private String type;
+
+    /**
+     * 所属集团公司(如有)
+     */
+    @ExcelProperty(value = "所属集团公司", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "如=有")
+    private Long ownedCompany;
+
+    /**
+     * 数据推送状态(0未推送 1已推送 2推送失败)
+     */
+    @ExcelProperty(value = "数据推送状态", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=未推送,1=已推送,2=推送失败")
+    private String pushStatus;
+
+    /**
+     * 有效期起始时间
+     */
+    @ExcelProperty(value = "有效期起始时间")
+    private Date validityFromDate;
+
+    /**
+     * 有效期截止时间
+     */
+    @ExcelProperty(value = "有效期截止时间")
+    private Date validityToDate;
+
+    /**
+     * 行序号(导入数据用)
+     */
+    @ExcelProperty(value = "行序号", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "导=入数据用")
+    private Long rowNo;
+
+    /**
+     * 经办人身份证/授权书图片地址
+     */
+    @ExcelProperty(value = "经办人身份证/授权书图片地址")
+    private String personImage;
+
+    /**
+     * 经办人身份证/授权书图片地址Url
+     */
+    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "personImage")
+    private String personImageUrl;
+    /**
+     * 对接人编号
+     */
+    @ExcelProperty(value = "对接人编号")
+    private Long abutmentNo;
+
+    /**
+     * 是否合作(0否 1是)
+     */
+    @ExcelProperty(value = "是否合作", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=否,1=是")
+    private Long cooperative;
+
+    /**
+     * 覆盖区域列表(JSON格式,如省份/城市列表)
+     */
+    @ExcelProperty(value = "覆盖区域列表", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "J=SON格式,如省份/城市列表")
+    private String areaListJson;
+
+    /**
+     * 状态(0正常 1停用)
+     */
+    @ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
+    @ExcelDictFormat(readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    /**
+     * 备注信息
+     */
+    @ExcelProperty(value = "备注信息")
+    private String remark;
+
+
+}

+ 26 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/domain/vo/SupplyAreaJsonVo.java

@@ -0,0 +1,26 @@
+package org.dromara.customer.domain.vo;
+
+import lombok.Data;
+
+/**
+ * 供应商区域JSON序列化专用VO(仅保留目标字段,杜绝冗余空属性)
+ */
+@Data
+public class SupplyAreaJsonVo {
+    // 雪花算法ID
+    private Long id;
+    // 供应商编号
+    private String supplyNo;
+    // 供应商ID
+    private Long supplierId;
+    // 区域编码
+    private String areaCode;
+    // 区域名称
+    private String areaName;
+    // 父级编码
+    private String parentCode;
+    // 区域级别
+    private String level;
+    // 必须保留的null字段
+    private Object areaList;
+}

+ 15 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/mapper/SupplierInfoTemporaryMapper.java

@@ -0,0 +1,15 @@
+package org.dromara.customer.mapper;
+
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import org.dromara.customer.domain.vo.SupplierInfoTemporaryVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+/**
+ * 供应商临时信息Mapper接口
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+public interface SupplierInfoTemporaryMapper extends BaseMapperPlus<SupplierInfoTemporary, SupplierInfoTemporaryVo> {
+
+}

+ 1 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierAuthorizeService.java

@@ -69,7 +69,7 @@ public interface ISupplierAuthorizeService extends IService<SupplierAuthorize>{
      */
     Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
-    List<SupplierAuthorizeVo> getAuthorizeDetailList(Long supplierId,PageQuery pageQuery);
+    TableDataInfo<SupplierAuthorizeVo> getAuthorizeDetailList(Long supplierId,PageQuery pageQuery);
 
     List<SupplierAuthorizeVo> srmgetAuthorizeDetailList(SupplierAuthorizeBo  bo);
 

+ 8 - 1
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoService.java

@@ -3,6 +3,7 @@ package org.dromara.customer.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.fasterxml.jackson.core.JsonProcessingException;
+import jakarta.validation.constraints.NotNull;
 import org.dromara.customer.domain.SupplierInfo;
 import org.dromara.customer.domain.bo.SupplierAuthorizeBo;
 import org.dromara.customer.domain.vo.SupplierInfoVo;
@@ -77,7 +78,7 @@ public interface ISupplierInfoService extends IService<SupplierInfo>{
      * @param bo 供应商信息
      * @return 是否修改成功
      */
-    Boolean updateByBo(SupplierInfoBo bo);
+    Boolean updateByBo(SupplierInfoBo bo) throws JsonProcessingException;
 
     /**
      * 校验并批量删除供应商信息信息
@@ -92,4 +93,10 @@ public interface ISupplierInfoService extends IService<SupplierInfo>{
     IPage<SupplierInfo> getSupplyCapacityList(SupplierAuthorizeBo bo, PageQuery pageQuery);
 
     int updateIsDisable();
+
+    SupplierInfoVo querySrmById(@NotNull(message = "主键不能为空") Long id);
+
+    Long getSupplierStatus(Long id);
+
+    boolean srmUpdateByBo(SupplierInfoBo bo);
 }

+ 77 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplierInfoTemporaryService.java

@@ -0,0 +1,77 @@
+package org.dromara.customer.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import org.dromara.customer.domain.vo.SupplierInfoTemporaryVo;
+import org.dromara.customer.domain.bo.SupplierInfoTemporaryBo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 供应商临时信息Service接口
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+public interface ISupplierInfoTemporaryService extends IService<SupplierInfoTemporary>{
+
+    /**
+     * 查询供应商临时信息
+     *
+     * @param id 主键
+     * @return 供应商临时信息
+     */
+    SupplierInfoTemporaryVo queryById(Long id);
+
+
+    SupplierInfoTemporaryVo queryByVOId(Long id);
+
+    SupplierInfoTemporary querBySupplierId(Long id);
+
+    /**
+     * 分页查询供应商临时信息列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 供应商临时信息分页列表
+     */
+    TableDataInfo<SupplierInfoTemporaryVo> queryPageList(SupplierInfoTemporaryBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的供应商临时信息列表
+     *
+     * @param bo 查询条件
+     * @return 供应商临时信息列表
+     */
+    List<SupplierInfoTemporaryVo> queryList(SupplierInfoTemporaryBo bo);
+
+    /**
+     * 新增供应商临时信息
+     *
+     * @param bo 供应商临时信息
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(SupplierInfoTemporaryBo bo);
+
+    /**
+     * 修改供应商临时信息
+     *
+     * @param bo 供应商临时信息
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(SupplierInfoTemporaryBo bo);
+
+    /**
+     * 校验并批量删除供应商临时信息信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    SupplierInfoTemporaryVo getVoOne(Long id);
+}

+ 4 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/ISupplyAreaService.java

@@ -72,4 +72,8 @@ public interface ISupplyAreaService extends IService<SupplyArea>{
     Map<Long, String> queryProvincesorCity(Long supplierId,Map<Long, List<String>> areaMap,int level);
 
     List<Long> getSupplierIdsByArea(String province, String city);
+
+    int deleteBySupplierId(Long supplierId);
+
+    TableDataInfo<SupplyAreaVo> querySrmPageList(SupplyAreaBo bo, PageQuery pageQuery);
 }

+ 9 - 3
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierAuthorizeServiceImpl.java

@@ -533,7 +533,7 @@ public class SupplierAuthorizeServiceImpl  extends ServiceImpl<SupplierAuthorize
     }
 
     @Override
-    public List<SupplierAuthorizeVo> getAuthorizeDetailList(Long supplierId,PageQuery pageQuery) {
+    public TableDataInfo<SupplierAuthorizeVo> getAuthorizeDetailList(Long supplierId,PageQuery pageQuery) {
         LambdaQueryWrapper<SupplierAuthorize> lqw = new LambdaQueryWrapper<>();
         lqw.eq(SupplierAuthorize::getSupplierId, supplierId);
         Page<SupplierAuthorize> page = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize());
@@ -558,8 +558,14 @@ public class SupplierAuthorizeServiceImpl  extends ServiceImpl<SupplierAuthorize
             Map<String, String> stringStringMap = categorysMap.get(item.getId());
             item.setCategorysMap(stringStringMap);
         });
-
-        return supplierAuthorizeVos;
+        // 直接创建新的分页对象,包含处理后的数据
+        Page<SupplierAuthorizeVo> resultPage = new Page<>();
+        resultPage.setCurrent(supplierAuthorizePage.getCurrent());
+        resultPage.setSize(supplierAuthorizePage.getSize());
+        resultPage.setTotal(supplierAuthorizePage.getTotal());
+        resultPage.setRecords(supplierAuthorizeVos);
+
+        return TableDataInfo.build(resultPage);
     }
 
     @Override

+ 456 - 33
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoServiceImpl.java

@@ -4,8 +4,10 @@ import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.common.core.utils.MapstructUtils;
@@ -17,14 +19,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.dromara.customer.domain.SupplierBusinessInfo;
-import org.dromara.customer.domain.SupplierProcurement;
-import org.dromara.customer.domain.SupplyArea;
+import org.dromara.customer.domain.*;
 import org.dromara.customer.domain.bo.EnterpriseScaleBo;
 import org.dromara.customer.domain.bo.SupplierAuthorizeBo;
-import org.dromara.customer.domain.vo.EnterpriseScaleVo;
-import org.dromara.customer.domain.vo.SupplierBusinessInfoVo;
-import org.dromara.customer.domain.vo.SupplierInformationVo;
+import org.dromara.customer.domain.bo.SupplyAreaBo;
+import org.dromara.customer.domain.vo.*;
 import org.dromara.customer.enums.SupplierStatusEnum;
 import org.dromara.customer.mapper.SupplierAuthorizeMapper;
 import org.dromara.customer.mapper.SupplierBusinessInfoMapper;
@@ -38,8 +37,6 @@ import org.dromara.system.api.domain.vo.RemoteSupplierTypeVo;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.dromara.customer.domain.bo.SupplierInfoBo;
-import org.dromara.customer.domain.vo.SupplierInfoVo;
-import org.dromara.customer.domain.SupplierInfo;
 import org.dromara.customer.mapper.SupplierInfoMapper;
 import org.springframework.util.CollectionUtils;
 
@@ -69,6 +66,8 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
 
     private final CommonSupplierAuthorizeService commonSupplierAuthorizeMapper;
 
+    private final ISupplierInfoTemporaryService supplierInfoTemporaryService;
+
     @DubboReference
     private final RemoteComStaffService remoteComStaffService;
 
@@ -157,42 +156,246 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
      * @return 是否修改成功
      */
     @Override
-    public Boolean updateByBo(SupplierInfoBo bo) {
-        SupplierInfoVo supplierInfoVo = baseMapper.selectVoById(bo.getId());
-        //根据状态来更新
-        //待审核or停用or修改待审核-> 正式供应商
-        if (supplierInfoVo.getSupplyStatus() != bo.getSupplyStatus() && bo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode()) {
+    public Boolean updateByBo(SupplierInfoBo bo) throws JsonProcessingException {
+        //SupplierInfoVo supplierInfoVo = baseMapper.selectVoById(bo.getId());
+        SupplierInfo supplierInfoVo = baseMapper.selectById(bo.getId());
+        // 状态 待审核 正式供应商 停用 审核未通过  修改待审核
+        // 正式供应商 -> 停用
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.DISABLED.getCode()) {
             SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
-            update.setCooperative(1l);
+            update.setCooperative(0l);
             return baseMapper.updateById(update) > 0;
         }
-        // 正式供应商-> 停用
-        if (supplierInfoVo.getSupplyStatus() != bo.getSupplyStatus() && bo.getSupplyStatus() == SupplierStatusEnum.DISABLED.getCode()) {
+        //正式供应商 -> 修改待审核
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode()) {
+            //一、修改了基本信息
+            //状态为修改待审核
+            supplierInfoVo.setSupplyStatus(SupplierStatusEnum.REVIEW_UPDATED.getCode());
+            //先copy到临时表
+            SupplierInfoTemporary supplierInfoTemporary = new SupplierInfoTemporary();
+            BeanUtils.copyProperties(bo, supplierInfoTemporary,"id");
+            //修改待审核
+            //ID一对一
+            supplierInfoTemporary.setSupplierId(bo.getId());
+            supplierInfoTemporary.setSupplyStatus(SupplierStatusEnum.REVIEW_UPDATED.getCode());
+            //通过传参在set临时表
+            //查询供应地址 存入  areaListJson  为了回显
+            SupplyAreaBo supplyAreaBo = new SupplyAreaBo();
+            supplyAreaBo.setSupplierId(bo.getId());
+            PageQuery pageQuery = new PageQuery();
+            TableDataInfo<SupplyAreaVo> supplyAreaVoTableDataInfo = supplyAreaService.queryPageList(supplyAreaBo, pageQuery);
+            ObjectMapper objectMapper = new ObjectMapper();
+            String areaListJson = objectMapper.writeValueAsString(supplyAreaVoTableDataInfo);
+            supplierInfoTemporary.setAreaListJson(areaListJson);
+            boolean save = supplierInfoTemporaryService.save(supplierInfoTemporary);
+            return baseMapper.updateById(supplierInfoVo) > 0;
+        }
+
+
+        //待审核  -> 正式供应商  审核未通过
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.PENDING_REVIEW.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode()) {
             SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
-            update.setCooperative(0l);
+            update.setCooperative(1L);
             return baseMapper.updateById(update) > 0;
         }
-        //待审核 ->审核未通过
-        if (supplierInfoVo.getSupplyStatus() != bo.getSupplyStatus() && bo.getSupplyStatus() == SupplierStatusEnum.REVIEW_FAILED.getCode()) {
+        //待审核  -> 审核未通过
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.PENDING_REVIEW.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.REVIEW_FAILED.getCode()) {
             SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
-            update.setCooperative(0l);
             return baseMapper.updateById(update) > 0;
         }
 
-        // 审核不通过->待审核
-        if (supplierInfoVo.getSupplyStatus()==SupplierStatusEnum.REVIEW_FAILED.getCode() && supplierInfoVo.getSupplyStatus() != bo.getSupplyStatus() && bo.getSupplyStatus() == SupplierStatusEnum.PENDING_REVIEW.getCode()) {
+        //停用 ->正式供应商
+        if (supplierInfoVo.getSupplyStatus() ==SupplierStatusEnum.DISABLED.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode()) {
             SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
-            update.setCooperative(0l);
+            update.setCooperative(1L);
+            return baseMapper.updateById(update) > 0;
+        }
+        //审核未通过  -> 无
+
+        // 待修改审核  -> 正式供应商  审核未通过  待修改审核
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode()) {
+            //1.1 审核通过
+            //1.2 将临时表信息copy到info表
+            Long id = supplierInfoVo.getId();
+            SupplierInfoTemporary supplierInfoTemporary = supplierInfoTemporaryService.getOne(new LambdaQueryWrapper<SupplierInfoTemporary>()
+                .eq(SupplierInfoTemporary::getSupplierId, id));
+            // 临时表数据判空防护
+            if (supplierInfoTemporary == null) {
+                return false;
+            }
+            BeanUtils.copyProperties(supplierInfoTemporary, supplierInfoVo, "id");
+            supplierInfoVo.setId(id);
+
+            //删除SupplyArea 把 AreaList再存入SupplyArea
+            int i = supplyAreaService.deleteBySupplierId(id);
+            String areaListJson = supplierInfoTemporary.getAreaListJson();
+            if (areaListJson == null || areaListJson.trim().isEmpty()) {
+                // 无区域数据,直接更新主表即可
+                return baseMapper.updateById(supplierInfoVo) > 0;
+            }
+            ObjectMapper objectMapper = new ObjectMapper();
+            try {
+                // 1. 解析JSON字符串为 TableDataInfo<SupplyAreaVo>(和存储时的类型一致)
+                // 注意:泛型解析需要用 TypeReference 明确类型,否则会解析为 LinkedHashMap
+                TableDataInfo<SupplyAreaVo> areaTableData = objectMapper.readValue(
+                    areaListJson,
+                    new TypeReference<TableDataInfo<SupplyAreaVo>>() {}
+                );
+                // 2. 提取 SupplyAreaVo 列表(判空避免空指针)
+                List<SupplyAreaVo> supplyAreaVoList = areaTableData.getRows();
+                if (supplyAreaVoList == null || supplyAreaVoList.isEmpty()) {
+                    // 无地址数据,直接更新主表即可
+                    return baseMapper.updateById(supplierInfoVo) > 0;
+                }
+
+                // 3. 转换 SupplyAreaVo -> SupplyArea(持久化实体)
+                List<SupplyArea> supplyAreaList = new ArrayList<>();
+                for (SupplyAreaVo vo : supplyAreaVoList) {
+                    SupplyArea area = new SupplyArea();
+                    // 方式1:使用 BeanUtils 复制属性(简单属性,无复杂嵌套时可用)
+                    BeanUtils.copyProperties(vo, area, "id");
+                    area.setId(IdWorker.getId());
+                    // 关键:设置供应商ID(关联当前供应商)
+                    area.setSupplierId(id);
+                    supplyAreaList.add(area);
+                }
+                // 4. 批量存入 SupplyArea 表(推荐批量插入,效率高于循环单条插入)
+                // 假设 supplyAreaService 有批量插入方法(如果没有,可在Mapper中添加 batchInsert)
+                boolean batchSave = supplyAreaService.saveBatch(supplyAreaList);
+
+
+                // 5. 更新主表 SupplierInfo
+                supplierInfoVo.setSupplyStatus(SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode());
+                boolean updateMain = baseMapper.updateById(supplierInfoVo) > 0;
+                if (updateMain == false){
+                    throw new RuntimeException("更新供应商信息失败");
+                }
+                boolean remove = supplierInfoTemporaryService.remove(new LambdaQueryWrapper<SupplierInfoTemporary>().eq(SupplierInfoTemporary::getSupplierId, id));
+                // 6. 返回最终结果(地址批量插入 + 主表更新都成功才返回 true)
+                return batchSave && updateMain && remove;
+
+            } catch (JsonProcessingException e) {
+                // JSON解析异常处理(可打印日志、抛出业务异常等)
+                e.printStackTrace();
+                throw new RuntimeException("解析供应商地址JSON失败", e);
+            }
+
+        }
+
+        //待修改审核 驳回
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.REVIEW_FAILED.getCode()) {
+            SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
+            update.setCooperative(0L);
+            // 补充:审核未通过,建议同时删除临时表的待审核数据,避免残留
+            supplierInfoTemporaryService.remove(new LambdaQueryWrapper<SupplierInfoTemporary>()
+                .eq(SupplierInfoTemporary::getSupplierId, update.getId()));
             return baseMapper.updateById(update) > 0;
         }
 
+        //待修改审核 ->待修改审核
+        if (supplierInfoVo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode() && bo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode()) {
+            Long supplierId = supplierInfoVo.getId();
+            // 1. 校验核心参数(避免空指针)
+            if (supplierId == null || bo == null) {
+                throw new IllegalArgumentException("供应商ID不能为空,无法更新待审核数据");
+            }
+            // 3. 第二步:更新临时表的供应商基础信息(非区域部分,如联系人、电话等)
+            SupplierInfoTemporary tempSupplier = supplierInfoTemporaryService.getOne(
+                new LambdaQueryWrapper<SupplierInfoTemporary>()
+                    .eq(SupplierInfoTemporary::getSupplierId, supplierId)
+            );
+            if (tempSupplier == null) {
+                throw new RuntimeException("临时表无待审核数据,无法更新基础信息");
+            }
+
+            // 3.1 用最新提交的bo数据,更新临时表基础信息(覆盖旧的待审核数据)
+            SupplierInfo tempMain = MapstructUtils.convert(bo, SupplierInfo.class);
+            BeanUtils.copyProperties(tempMain, tempSupplier, "id", "supplierId", "areaListJson");
+            // 忽略:主键、关联字段、区域JSON(区域JSON已由insertByBo处理完成)
+            // 3.2 保持临时表状态仍为「待修改审核」(兜底,避免意外修改)
+            tempSupplier.setSupplyStatus(SupplierStatusEnum.REVIEW_UPDATED.getCode());
+            // 4. 更新临时表的基础信息(区域JSON已由insertByBo更新,此处仅更新基础信息)
+            try {
+                boolean operateResult = supplierInfoTemporaryService.saveOrUpdate(tempSupplier);
+                // 5. 主表状态无需修改(仍为4),直接返回结果
+                return operateResult;
+            } catch (Exception e) {
+                throw new RuntimeException("更新供应商待审核基础数据失败,请联系管理员", e);
+            }
+        }
 
-        //变成修改待审核状态
         SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
-        update.setSupplyStatus(4L);
         return baseMapper.updateById(update) > 0;
     }
 
+    @Override
+    public boolean srmUpdateByBo(SupplierInfoBo bo) {
+        Long id = bo.getId();
+        SupplierInfo supplierInfo = baseMapper.selectById(id);
+        //如果是待审核 随便改
+        if (bo.getSupplyStatus() == SupplierStatusEnum.PENDING_REVIEW.getCode()){
+            SupplierInfo update = MapstructUtils.convert(bo, SupplierInfo.class);
+            return baseMapper.updateById(update) > 0;
+        }
+        //如果是启用状态,就变成待修改审核状态
+        if (supplierInfo.getSupplyStatus() == SupplierStatusEnum.OFFICIAL_SUPPLIER.getCode()){
+            SupplierInfoTemporary supplierInfoTemporary = supplierInfoTemporaryService.querBySupplierId(id);
+            if (supplierInfoTemporary == null){
+                BeanUtils.copyProperties(bo, supplierInfoTemporary,"id");
+                supplierInfoTemporary.setSupplierId(id);
+                supplierInfoTemporary.setSupplyStatus(SupplierStatusEnum.REVIEW_UPDATED.getCode());
+                boolean save = supplierInfoTemporaryService.save(supplierInfoTemporary);
+                if (save == false){
+                    throw new RuntimeException("保存供应商待审核数据失败");
+                }
+            }
+            //一共三个地方
+            boolean flag =false;
+            //1.简称
+            if (bo.getShortName() != null && StringUtils.isNotBlank(bo.getShortName())){
+                supplierInfoTemporary.setShortName(bo.getShortName());
+                flag = supplierInfoTemporaryService.updateById(supplierInfoTemporary);
+            }
+            //2.供货品牌
+            if (bo.getOperatingBrand() != null && StringUtils.isNotBlank(bo.getOperatingBrand())){
+                supplierInfoTemporary.setOperatingBrand(bo.getOperatingBrand());
+                flag = supplierInfoTemporaryService.updateById(supplierInfoTemporary);
+            }
+            //3.供货类目
+            if (bo.getOperatingCategory() != null && StringUtils.isNotBlank(bo.getOperatingCategory())){
+                supplierInfoTemporary.setOperatingCategory(bo.getOperatingCategory());
+                flag = supplierInfoTemporaryService.updateById(supplierInfoTemporary);
+            }
+
+            supplierInfo.setSupplyStatus(SupplierStatusEnum.REVIEW_UPDATED.getCode());
+            boolean update =baseMapper.updateById(supplierInfo) > 0;
+            return update && flag;
+        }
+        //如果是待审核状态,就变成待修改审核状态
+        if (supplierInfo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode()){
+            SupplierInfoTemporary supplierInfoTemporary = supplierInfoTemporaryService.querBySupplierId(id);
+            //一共三个地方
+            boolean flag =false;
+            //1.简称
+            if (bo.getShortName() != null && StringUtils.isNotBlank(bo.getShortName())){
+                supplierInfoTemporary.setShortName(bo.getShortName());
+                flag = supplierInfoTemporaryService.updateById(supplierInfoTemporary);
+            }
+            //2.供货品牌
+            if (bo.getOperatingBrand() != null && StringUtils.isNotBlank(bo.getOperatingBrand())){
+                supplierInfoTemporary.setOperatingBrand(bo.getOperatingBrand());
+                flag = supplierInfoTemporaryService.updateById(supplierInfoTemporary);
+            }
+            //3.供货类目
+            if (bo.getOperatingCategory() != null && StringUtils.isNotBlank(bo.getOperatingCategory())){
+                supplierInfoTemporary.setOperatingCategory(bo.getOperatingCategory());
+                flag = supplierInfoTemporaryService.updateById(supplierInfoTemporary);
+            }
+            return flag;
+        }
+        return false;
+    }
+
     /**
      * 校验并批量删除供应商信息信息
      *
@@ -216,7 +419,15 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
      */
     @Override
     public SupplierInfoVo queryById(Long id) throws JsonProcessingException {
-        SupplierInfoVo supplierInfoVo = baseMapper.selectVoById(id);
+        SupplierInfoVo supplierInfoVo1 = baseMapper.selectVoOne(new LambdaQueryWrapper<SupplierInfo>().select(SupplierInfo::getSupplyStatus)
+            .eq(SupplierInfo::getId, id));
+        SupplierInfoVo supplierInfoVo =new SupplierInfoVo();
+        if (supplierInfoVo1.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode()) {
+            SupplierInfoTemporaryVo supplierInfoTemporaryVo = supplierInfoTemporaryService.getVoOne(id);
+            BeanUtils.copyProperties(supplierInfoTemporaryVo, supplierInfoVo);
+        }else {
+            supplierInfoVo = baseMapper.selectVoById(id);
+        }
         SupplierInfoVo supplierInformationVo = handleProcurementInfo(supplierInfoVo);
         //返回工商信息
         SupplierBusinessInfoVo supplierBusinessInfoVo = supplierBusinessInfoMapper
@@ -225,7 +436,6 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
             // 将工商信息复制到供应商信息对象中
             copyBusinessInfoToSupplierInfoVo(supplierBusinessInfoVo, supplierInformationVo);
         }
-
         return supplierInformationVo;
     }
 
@@ -256,8 +466,6 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
             lqw.eq(SupplierInfo::getSupplyStatus,bo.getSupplyStatus());
         }
 
-
-
         // 2. 添加品牌条件
         if (bo.getOperatingBrand()!= null && StringUtils.isNotBlank(bo.getOperatingBrand())){
             if (StringUtils.isNotBlank(bo.getOperatingBrand())){
@@ -310,7 +518,164 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
 
     @Override
     public TableDataInfo<SupplierInfoVo> getSupplierApproveInformation(SupplierInfoBo bo, PageQuery pageQuery) {
+        if (bo.getSupplyStatus() == null){
+            // 步骤1:定义两个列表,存储主表(状态0)和临时表(状态4)的数据
+            List<SupplierInfoVo> mainTableVoList = new ArrayList<>();
+            List<SupplierInfoVo> tempTableVoList = new ArrayList<>();
+
+            // 步骤2:查询主表(info)状态为 0 的数据
+            LambdaQueryWrapper<SupplierInfo> mainLqw = buildCommonQueryWrapper(bo);
+            mainLqw.eq(SupplierInfo::getSupplyStatus, SupplierStatusEnum.PENDING_REVIEW.getCode()); // 状态0:待审核(可替换为 SupplierStatusEnum.PENDING_REVIEW.getCode())
+            Page<SupplierInfoVo> mainPage = baseMapper.selectVoPage(new Page<>(1, Integer.MAX_VALUE), mainLqw); // 查询全部符合条件的数据,不做分页
+            if (!CollectionUtils.isEmpty(mainPage.getRecords())) {
+                mainTableVoList = mainPage.getRecords();
+            }
+
+            // 步骤3:查询临时表(temporary)状态为 4 的数据
+            LambdaQueryWrapper<SupplierInfoTemporary> tempLqw = new LambdaQueryWrapper<>();
+            tempLqw.eq(SupplierInfoTemporary::getSupplyStatus, SupplierStatusEnum.REVIEW_UPDATED.getCode()); // 状态4:修改待审核(可替换为 SupplierStatusEnum.REVIEW_UPDATED.getCode())
+            // 补充bo中的其他查询条件(如品牌,和主表查询保持一致)
+            if (bo.getOperatingBrand() != null && StringUtils.isNotBlank(bo.getOperatingBrand())) {
+                Long productBrandIdByName = remoteProductService.getProductBrandIdByName(bo.getOperatingBrand());
+                if (productBrandIdByName != null) {
+                    tempLqw.like(SupplierInfoTemporary::getOperatingBrand, productBrandIdByName);
+                }
+            }
+
+            // 若有区域、产品经理/采购人员过滤,需同步对临时表执行相同过滤逻辑(此处复用你原有的过滤方法)
+            List<Long> validSupplierIds = new ArrayList<>();
+            // 3.1 区域过滤(同步主表逻辑)
+            if (StringUtils.isNotBlank(bo.getProvince()) || StringUtils.isNotBlank(bo.getCity())) {
+                validSupplierIds = supplyAreaService.getSupplierIdsByArea(bo.getProvince(), bo.getCity());
+                if (CollectionUtils.isEmpty(validSupplierIds)) {
+                    validSupplierIds.add(-1L); // 无数据时添加无效ID,避免查询全部
+                }
+                tempLqw.in(SupplierInfoTemporary::getId, validSupplierIds);
+            }
+            // 3.2 产品经理/采购人员过滤(同步主表逻辑)
+            if (bo.getProductManager() != null || bo.getBuyer() != null) {
+                validSupplierIds = supplierProcurementService.getSupplierIdsByProcurement(bo.getProductManager(), bo.getBuyer());
+                if (CollectionUtils.isEmpty(validSupplierIds)) {
+                    validSupplierIds.add(-1L);
+                }
+                tempLqw.in(SupplierInfoTemporary::getId, validSupplierIds);
+            }
+
+            // 查询临时表全部符合条件数据,并转换为 SupplierInfoVo(保证和主表数据结构一致)
+            List<SupplierInfoTemporary> tempTableList = supplierInfoTemporaryService.list(tempLqw);
+            if (!CollectionUtils.isEmpty(tempTableList)) {
+                // 转换:SupplierInfoTemporary -> SupplierInfoVo(可使用Mapstruct,此处用BeanUtils示例,需保证字段一致)
+                tempTableVoList = tempTableList.stream().map(temp -> {
+                    SupplierInfoVo vo = new SupplierInfoVo();
+                    org.springframework.beans.BeanUtils.copyProperties(temp, vo);
+                    vo.setId(temp.getSupplierId());
+                    return vo;
+                }).collect(Collectors.toList());
+            }
+
+            // 步骤4:合并两个列表的数据
+            List<SupplierInfoVo> totalVoList = new ArrayList<>();
+            totalVoList.addAll(mainTableVoList);
+            totalVoList.addAll(tempTableVoList);
+
+            // 步骤5:按照 supplyNo 倒序排序(处理null值,避免排序异常)
+            if (!CollectionUtils.isEmpty(totalVoList)) {
+                totalVoList.sort((vo1, vo2) -> {
+                    // 优先处理null值,null值排后面
+                    if (vo1.getSupplierNo() == null && vo2.getSupplierNo() == null) {
+                        return 0;
+                    }
+                    if (vo1.getSupplierNo() == null) {
+                        return 1;
+                    }
+                    if (vo2.getSupplierNo() == null) {
+                        return -1;
+                    }
+                    // 倒序排序(compareTo反过来)
+                    return vo2.getSupplierNo().compareTo(vo1.getSupplierNo());
+                });
+
+                // 批量处理扩展信息(复用你原有的逻辑)
+                totalVoList = batchHandleBaseExtInfo(totalVoList);
+                handleEnterpriseScaleName(totalVoList);
+            }
+
+            // 步骤6:手动实现分页(关键:内存数据分页)
+            int pageNum = pageQuery.getPageNum();
+            int pageSize = pageQuery.getPageSize();
+            int totalCount = totalVoList.size();
+
+            // 计算分页参数
+            int startIndex = (pageNum - 1) * pageSize;
+            int endIndex = Math.min(startIndex + pageSize, totalCount);
+            List<SupplierInfoVo> pageVoList = new ArrayList<>();
+
+            // 截取当前页数据
+            if (startIndex < totalCount) {
+                pageVoList = totalVoList.subList(startIndex, endIndex);
+            }
+
+            // 步骤7:封装分页结果(构建Page对象,符合返回值要求)
+            Page<SupplierInfoVo> resultPage = new Page<>(pageNum, pageSize, totalCount);
+            resultPage.setRecords(pageVoList);
+
+            // 步骤8:返回封装后的TableDataInfo
+            return TableDataInfo.build(resultPage);
+
+        }
+
         // 1. 构建审批状态条件
+        LambdaQueryWrapper<SupplierInfo> lqw = new LambdaQueryWrapper<>();
+        lqw.eq(SupplierInfo::getSupplyStatus,bo.getSupplyStatus());
+
+        // 2.添加品牌条件
+        if (bo.getOperatingBrand()!= null && StringUtils.isNotBlank(bo.getOperatingBrand())){
+            if (StringUtils.isNotBlank(bo.getOperatingBrand())){
+                Long productBrandIdByName = remoteProductService.getProductBrandIdByName(bo.getOperatingBrand());
+                if (productBrandIdByName != null){
+                    lqw.like(SupplierInfo::getOperatingBrand, productBrandIdByName);
+                }
+            }
+        }
+        //3.可供货区域省和市 - 添加供应区域过滤
+        if (StringUtils.isNotBlank(bo.getProvince()) || StringUtils.isNotBlank(bo.getCity())) {
+            // 查询符合条件的供应商ID列表
+            List<Long> supplierIds = supplyAreaService.getSupplierIdsByArea(bo.getProvince(), bo.getCity());
+            if (supplierIds != null && !supplierIds.isEmpty()) {
+                lqw.in(SupplierInfo::getId, supplierIds);
+
+            } else {
+                lqw.in(SupplierInfo::getId, -1L);
+
+            }
+        }
+        //产品经理和采购人员
+        if (bo.getProductManager() != null || bo.getBuyer() != null) {
+            // 查询符合条件的供应商ID列表
+            List<Long> supplierIds = supplierProcurementService.getSupplierIdsByProcurement(bo.getProductManager(), bo.getBuyer());
+            if (supplierIds != null && !supplierIds.isEmpty()) {
+                lqw.in(SupplierInfo::getId, supplierIds);
+            } else {
+                lqw.in(SupplierInfo::getId, -1L);
+            }
+        }
+        // 2. 基础分页查询
+        Page<SupplierInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        List<SupplierInfoVo> supplierVos = result.getRecords();
+
+        // 3. 批量处理扩展信息
+        if (!CollectionUtils.isEmpty(supplierVos)) {
+            supplierVos = batchHandleBaseExtInfo(supplierVos);
+            handleEnterpriseScaleName(supplierVos);
+        }
+
+        // 4. 封装分页结果
+        Page<SupplierInfoVo> newPage = copyPageResult(result, supplierVos);
+        return TableDataInfo.build(newPage);
+    }
+
+    /*
+    // 1. 构建审批状态条件
         LambdaQueryWrapper<SupplierInfo> lqw = new LambdaQueryWrapper<>();
         if (bo.getSupplyStatus() == null) {
             List<Long> status = Arrays.asList(0L, 4L);
@@ -318,7 +683,6 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
         }else {
             lqw.eq(SupplierInfo::getSupplyStatus,bo.getSupplyStatus());
         }
-
         // 2.添加品牌条件
         if (bo.getOperatingBrand()!= null && StringUtils.isNotBlank(bo.getOperatingBrand())){
             if (StringUtils.isNotBlank(bo.getOperatingBrand())){
@@ -340,7 +704,6 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
 
             }
         }
-
         //产品经理和采购人员
         if (bo.getProductManager() != null || bo.getBuyer() != null) {
             // 查询符合条件的供应商ID列表
@@ -351,8 +714,6 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
                 lqw.in(SupplierInfo::getId, -1L);
             }
         }
-
-
         // 2. 基础分页查询
         Page<SupplierInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
         List<SupplierInfoVo> supplierVos = result.getRecords();
@@ -366,6 +727,43 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
         // 4. 封装分页结果
         Page<SupplierInfoVo> newPage = copyPageResult(result, supplierVos);
         return TableDataInfo.build(newPage);
+     */
+
+    /**
+     * 构建公共查询条件(主表和临时表共用的查询条件,提取为公共方法,减少冗余)
+     */
+    private LambdaQueryWrapper<SupplierInfo> buildCommonQueryWrapper(SupplierInfoBo bo) {
+        LambdaQueryWrapper<SupplierInfo> lqw = new LambdaQueryWrapper<>();
+
+        // 品牌条件(复用你原有的逻辑)
+        if (bo.getOperatingBrand() != null && StringUtils.isNotBlank(bo.getOperatingBrand())) {
+            Long productBrandIdByName = remoteProductService.getProductBrandIdByName(bo.getOperatingBrand());
+            if (productBrandIdByName != null) {
+                lqw.like(SupplierInfo::getOperatingBrand, productBrandIdByName);
+            }
+        }
+
+        // 区域条件(复用你原有的逻辑)
+        if (StringUtils.isNotBlank(bo.getProvince()) || StringUtils.isNotBlank(bo.getCity())) {
+            List<Long> supplierIds = supplyAreaService.getSupplierIdsByArea(bo.getProvince(), bo.getCity());
+            if (!CollectionUtils.isEmpty(supplierIds)) {
+                lqw.in(SupplierInfo::getId, supplierIds);
+            } else {
+                lqw.in(SupplierInfo::getId, -1L);
+            }
+        }
+
+        // 产品经理/采购人员条件(复用你原有的逻辑)
+        if (bo.getProductManager() != null || bo.getBuyer() != null) {
+            List<Long> supplierIds = supplierProcurementService.getSupplierIdsByProcurement(bo.getProductManager(), bo.getBuyer());
+            if (!CollectionUtils.isEmpty(supplierIds)) {
+                lqw.in(SupplierInfo::getId, supplierIds);
+            } else {
+                lqw.in(SupplierInfo::getId, -1L);
+            }
+        }
+
+        return lqw;
     }
 
     @Override
@@ -434,6 +832,31 @@ public class SupplierInfoServiceImpl  extends ServiceImpl<SupplierInfoMapper, Su
 
     }
 
+    @Override
+    public SupplierInfoVo querySrmById(Long id) {
+        SupplierInfoVo supplierInfoVo = baseMapper.selectVoById(id);
+
+        SupplierInfoVo supplierInformationVo = handleProcurementInfo(supplierInfoVo);
+        //返回工商信息
+        SupplierBusinessInfoVo supplierBusinessInfoVo = supplierBusinessInfoMapper
+            .selectVoOne(new LambdaQueryWrapper<SupplierBusinessInfo>().eq(SupplierBusinessInfo::getSupplierId, id));
+        if (supplierBusinessInfoVo != null) {
+            // 将工商信息复制到供应商信息对象中
+            copyBusinessInfoToSupplierInfoVo(supplierBusinessInfoVo, supplierInformationVo);
+        }
+        return supplierInformationVo;
+    }
+
+    @Override
+    public Long getSupplierStatus(Long id) {
+        SupplierInfoVo supplierInfoVo1 = baseMapper.selectVoOne(new LambdaQueryWrapper<SupplierInfo>().select(SupplierInfo::getSupplyStatus)
+            .eq(SupplierInfo::getId,id));
+
+        return supplierInfoVo1.getSupplyStatus();
+    }
+
+
+
     /**
      * 将工商信息复制到供应商信息VO中
      *

+ 210 - 0
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplierInfoTemporaryServiceImpl.java

@@ -0,0 +1,210 @@
+package org.dromara.customer.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.dromara.customer.domain.bo.SupplierInfoTemporaryBo;
+import org.dromara.customer.domain.vo.SupplierInfoTemporaryVo;
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import org.dromara.customer.mapper.SupplierInfoTemporaryMapper;
+import org.dromara.customer.service.ISupplierInfoTemporaryService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 供应商临时信息Service业务层处理
+ *
+ * @author LionLi
+ * @date 2026-01-28
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class SupplierInfoTemporaryServiceImpl  extends ServiceImpl<SupplierInfoTemporaryMapper, SupplierInfoTemporary> implements ISupplierInfoTemporaryService {
+
+    private final SupplierInfoTemporaryMapper baseMapper;
+
+    /**
+     * 查询供应商临时信息
+     *
+     * @param id 主键
+     * @return 供应商临时信息
+     */
+    @Override
+    public SupplierInfoTemporaryVo queryById(Long id){
+        return baseMapper.selectVoById(id);
+    }
+
+    @Override
+    public SupplierInfoTemporaryVo queryByVOId(Long id) {
+        SupplierInfoTemporaryVo supplierInfoTemporaryVo = baseMapper.selectVoOne(new LambdaQueryWrapper<SupplierInfoTemporary>().eq(SupplierInfoTemporary::getSupplierId, id));
+        return supplierInfoTemporaryVo;
+    }
+
+    @Override
+    public SupplierInfoTemporary querBySupplierId(Long id) {
+        SupplierInfoTemporary supplierInfoTemporary = baseMapper.selectOne(new LambdaQueryWrapper<SupplierInfoTemporary>().eq(SupplierInfoTemporary::getSupplierId, id));
+        return supplierInfoTemporary;
+    }
+
+    /**
+     * 分页查询供应商临时信息列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 供应商临时信息分页列表
+     */
+    @Override
+    public TableDataInfo<SupplierInfoTemporaryVo> queryPageList(SupplierInfoTemporaryBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<SupplierInfoTemporary> lqw = buildQueryWrapper(bo);
+        Page<SupplierInfoTemporaryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的供应商临时信息列表
+     *
+     * @param bo 查询条件
+     * @return 供应商临时信息列表
+     */
+    @Override
+    public List<SupplierInfoTemporaryVo> queryList(SupplierInfoTemporaryBo bo) {
+        LambdaQueryWrapper<SupplierInfoTemporary> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<SupplierInfoTemporary> buildQueryWrapper(SupplierInfoTemporaryBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<SupplierInfoTemporary> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(SupplierInfoTemporary::getId);
+        lqw.eq(StringUtils.isNotBlank(bo.getSupplierNo()), SupplierInfoTemporary::getSupplierNo, bo.getSupplierNo());
+        lqw.like(StringUtils.isNotBlank(bo.getEnterpriseName()), SupplierInfoTemporary::getEnterpriseName, bo.getEnterpriseName());
+        lqw.eq(bo.getMembershipSize() != null, SupplierInfoTemporary::getMembershipSize, bo.getMembershipSize());
+        lqw.eq(bo.getSupplierType() != null, SupplierInfoTemporary::getSupplierType, bo.getSupplierType());
+        lqw.eq(bo.getCooperationType() != null, SupplierInfoTemporary::getCooperationType, bo.getCooperationType());
+        lqw.eq(StringUtils.isNotBlank(bo.getFixedPhone()), SupplierInfoTemporary::getFixedPhone, bo.getFixedPhone());
+        lqw.eq(StringUtils.isNotBlank(bo.getFax()), SupplierInfoTemporary::getFax, bo.getFax());
+        lqw.eq(StringUtils.isNotBlank(bo.getUrl()), SupplierInfoTemporary::getUrl, bo.getUrl());
+        lqw.eq(StringUtils.isNotBlank(bo.getPostCode()), SupplierInfoTemporary::getPostCode, bo.getPostCode());
+        lqw.eq(StringUtils.isNotBlank(bo.getMailbox()), SupplierInfoTemporary::getMailbox, bo.getMailbox());
+        lqw.eq(StringUtils.isNotBlank(bo.getOfficeProvince()), SupplierInfoTemporary::getOfficeProvince, bo.getOfficeProvince());
+        lqw.eq(StringUtils.isNotBlank(bo.getOfficeCity()), SupplierInfoTemporary::getOfficeCity, bo.getOfficeCity());
+        lqw.eq(StringUtils.isNotBlank(bo.getOfficeCounty()), SupplierInfoTemporary::getOfficeCounty, bo.getOfficeCounty());
+        lqw.eq(StringUtils.isNotBlank(bo.getOfficeAddress()), SupplierInfoTemporary::getOfficeAddress, bo.getOfficeAddress());
+        lqw.like(StringUtils.isNotBlank(bo.getBusinessName()), SupplierInfoTemporary::getBusinessName, bo.getBusinessName());
+        lqw.eq(StringUtils.isNotBlank(bo.getSocialCreditCode()), SupplierInfoTemporary::getSocialCreditCode, bo.getSocialCreditCode());
+        lqw.like(StringUtils.isNotBlank(bo.getLegalPersonName()), SupplierInfoTemporary::getLegalPersonName, bo.getLegalPersonName());
+        lqw.eq(StringUtils.isNotBlank(bo.getLegalPersonId()), SupplierInfoTemporary::getLegalPersonId, bo.getLegalPersonId());
+        lqw.eq(StringUtils.isNotBlank(bo.getRegisteredCapital()), SupplierInfoTemporary::getRegisteredCapital, bo.getRegisteredCapital());
+        lqw.eq(StringUtils.isNotBlank(bo.getBusinessProvince()), SupplierInfoTemporary::getBusinessProvince, bo.getBusinessProvince());
+        lqw.eq(StringUtils.isNotBlank(bo.getBusinessCity()), SupplierInfoTemporary::getBusinessCity, bo.getBusinessCity());
+        lqw.eq(StringUtils.isNotBlank(bo.getBusinessCounty()), SupplierInfoTemporary::getBusinessCounty, bo.getBusinessCounty());
+        lqw.eq(StringUtils.isNotBlank(bo.getBusinessAddress()), SupplierInfoTemporary::getBusinessAddress, bo.getBusinessAddress());
+        lqw.eq(StringUtils.isNotBlank(bo.getBusinessLicense()), SupplierInfoTemporary::getBusinessLicense, bo.getBusinessLicense());
+        lqw.eq(StringUtils.isNotBlank(bo.getInvoiceType()), SupplierInfoTemporary::getInvoiceType, bo.getInvoiceType());
+        lqw.eq(StringUtils.isNotBlank(bo.getInvoiceHeader()), SupplierInfoTemporary::getInvoiceHeader, bo.getInvoiceHeader());
+        lqw.eq(StringUtils.isNotBlank(bo.getTaxpayerIdentifier()), SupplierInfoTemporary::getTaxpayerIdentifier, bo.getTaxpayerIdentifier());
+        lqw.eq(StringUtils.isNotBlank(bo.getDepositaryBank()), SupplierInfoTemporary::getDepositaryBank, bo.getDepositaryBank());
+        lqw.eq(StringUtils.isNotBlank(bo.getRowNum()), SupplierInfoTemporary::getRowNum, bo.getRowNum());
+        lqw.eq(StringUtils.isNotBlank(bo.getBankAccounts()), SupplierInfoTemporary::getBankAccounts, bo.getBankAccounts());
+        lqw.eq(StringUtils.isNotBlank(bo.getInvoiceAddress()), SupplierInfoTemporary::getInvoiceAddress, bo.getInvoiceAddress());
+        lqw.eq(StringUtils.isNotBlank(bo.getInvoiceLandline()), SupplierInfoTemporary::getInvoiceLandline, bo.getInvoiceLandline());
+        lqw.eq(StringUtils.isNotBlank(bo.getScopeSupply()), SupplierInfoTemporary::getScopeSupply, bo.getScopeSupply());
+        lqw.eq(StringUtils.isNotBlank(bo.getCooperateWay()), SupplierInfoTemporary::getCooperateWay, bo.getCooperateWay());
+        lqw.eq(bo.getCooperateLevel() != null, SupplierInfoTemporary::getCooperateLevel, bo.getCooperateLevel());
+        lqw.eq(bo.getContractEndTime() != null, SupplierInfoTemporary::getContractEndTime, bo.getContractEndTime());
+        lqw.eq(bo.getSupplyStatus() != null, SupplierInfoTemporary::getSupplyStatus, bo.getSupplyStatus());
+        lqw.eq(bo.getSupplyScore() != null, SupplierInfoTemporary::getSupplyScore, bo.getSupplyScore());
+        lqw.eq(bo.getYearSales() != null, SupplierInfoTemporary::getYearSales, bo.getYearSales());
+        lqw.like(StringUtils.isNotBlank(bo.getSupplierName()), SupplierInfoTemporary::getSupplierName, bo.getSupplierName());
+        lqw.eq(StringUtils.isNotBlank(bo.getSupplierPhone()), SupplierInfoTemporary::getSupplierPhone, bo.getSupplierPhone());
+        lqw.eq(StringUtils.isNotBlank(bo.getSupplierPassword()), SupplierInfoTemporary::getSupplierPassword, bo.getSupplierPassword());
+        lqw.eq(StringUtils.isNotBlank(bo.getOperatingCategory()), SupplierInfoTemporary::getOperatingCategory, bo.getOperatingCategory());
+        lqw.eq(StringUtils.isNotBlank(bo.getOperatingBrand()), SupplierInfoTemporary::getOperatingBrand, bo.getOperatingBrand());
+        lqw.eq(StringUtils.isNotBlank(bo.getOtherCustomers()), SupplierInfoTemporary::getOtherCustomers, bo.getOtherCustomers());
+        lqw.like(StringUtils.isNotBlank(bo.getShortName()), SupplierInfoTemporary::getShortName, bo.getShortName());
+        lqw.eq(bo.getIndustrCategory() != null, SupplierInfoTemporary::getIndustrCategory, bo.getIndustrCategory());
+        lqw.eq(StringUtils.isNotBlank(bo.getType()), SupplierInfoTemporary::getType, bo.getType());
+        lqw.eq(bo.getOwnedCompany() != null, SupplierInfoTemporary::getOwnedCompany, bo.getOwnedCompany());
+        lqw.eq(StringUtils.isNotBlank(bo.getPushStatus()), SupplierInfoTemporary::getPushStatus, bo.getPushStatus());
+        lqw.eq(bo.getValidityFromDate() != null, SupplierInfoTemporary::getValidityFromDate, bo.getValidityFromDate());
+        lqw.eq(bo.getValidityToDate() != null, SupplierInfoTemporary::getValidityToDate, bo.getValidityToDate());
+        lqw.eq(bo.getRowNo() != null, SupplierInfoTemporary::getRowNo, bo.getRowNo());
+        lqw.eq(StringUtils.isNotBlank(bo.getPersonImage()), SupplierInfoTemporary::getPersonImage, bo.getPersonImage());
+        lqw.eq(bo.getAbutmentNo() != null, SupplierInfoTemporary::getAbutmentNo, bo.getAbutmentNo());
+        lqw.eq(bo.getCooperative() != null, SupplierInfoTemporary::getCooperative, bo.getCooperative());
+        lqw.eq(StringUtils.isNotBlank(bo.getAreaListJson()), SupplierInfoTemporary::getAreaListJson, bo.getAreaListJson());
+        lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SupplierInfoTemporary::getStatus, bo.getStatus());
+        lqw.eq(StringUtils.isNotBlank(bo.getRemark()), SupplierInfoTemporary::getRemark, bo.getRemark());
+        return lqw;
+    }
+
+    /**
+     * 新增供应商临时信息
+     *
+     * @param bo 供应商临时信息
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(SupplierInfoTemporaryBo bo) {
+        SupplierInfoTemporary add = MapstructUtils.convert(bo, SupplierInfoTemporary.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改供应商临时信息
+     *
+     * @param bo 供应商临时信息
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(SupplierInfoTemporaryBo bo) {
+        SupplierInfoTemporary update = MapstructUtils.convert(bo, SupplierInfoTemporary.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(SupplierInfoTemporary entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除供应商临时信息信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+
+    @Override
+    public SupplierInfoTemporaryVo getVoOne(Long id) {
+        LambdaQueryWrapper<SupplierInfoTemporary> lqw = new LambdaQueryWrapper<>();
+        lqw.eq(SupplierInfoTemporary::getSupplierId, id);
+        return  baseMapper.selectVoOne(lqw);
+    }
+}

+ 231 - 18
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/SupplyAreaServiceImpl.java

@@ -1,6 +1,11 @@
 package org.dromara.customer.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
@@ -10,6 +15,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.dromara.customer.domain.SupplierInfo;
+import org.dromara.customer.domain.SupplierInfoTemporary;
+import org.dromara.customer.domain.vo.SupplierInfoVo;
+import org.dromara.customer.domain.vo.SupplyAreaJsonVo;
+import org.dromara.customer.enums.SupplierStatusEnum;
+import org.dromara.customer.mapper.SupplierInfoMapper;
+import org.dromara.customer.service.ISupplierInfoTemporaryService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.dromara.customer.domain.bo.SupplyAreaBo;
@@ -35,6 +47,12 @@ public class SupplyAreaServiceImpl  extends ServiceImpl<SupplyAreaMapper, Supply
 
     private final SupplyAreaMapper baseMapper;
 
+    private final ISupplierInfoTemporaryService supplierInfoTemporaryService;
+
+    private final SupplierInfoMapper supplierInfoMapper;
+
+    private final ObjectMapper objectMapper;
+
     /**
      * 查询供应区域
      *
@@ -132,6 +150,28 @@ public class SupplyAreaServiceImpl  extends ServiceImpl<SupplyAreaMapper, Supply
             .collect(Collectors.toList());
     }
 
+    @Override
+    public int deleteBySupplierId(Long supplierId) {
+        // 使用更精确的条件,避免全表扫描导致的锁升级
+        LambdaQueryWrapper<SupplyArea> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(SupplyArea::getSupplierId, supplierId);
+
+        // 先查询是否存在数据,避免不必要的锁等待
+        List<SupplyArea> exists = baseMapper.selectList(wrapper);
+        if (exists.isEmpty()) {
+            return 0;
+        }
+
+        return baseMapper.delete(wrapper);
+    }
+
+    @Override
+    public TableDataInfo<SupplyAreaVo> querySrmPageList(SupplyAreaBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<SupplyArea> lqw = buildQueryWrapper(bo);
+        Page<SupplyAreaVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
     /**
      * 分页查询供应区域列表
      *
@@ -141,6 +181,63 @@ public class SupplyAreaServiceImpl  extends ServiceImpl<SupplyAreaMapper, Supply
      */
     @Override
     public TableDataInfo<SupplyAreaVo> queryPageList(SupplyAreaBo bo, PageQuery pageQuery) {
+        //做判断 先查询 供应status = 4 的
+        if (bo.getSupplyStatus() != null) {
+            if (bo.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode()) {
+                SupplierInfoTemporary one = supplierInfoTemporaryService.getOne(new LambdaQueryWrapper<SupplierInfoTemporary>()
+                    .select(SupplierInfoTemporary::getAreaListJson)
+                    .eq(SupplierInfoTemporary::getId, bo.getSupplierId()));
+                // 临时表数据和JSON字符串非空判断
+                if (one != null && one.getAreaListJson() != null && !one.getAreaListJson().trim().isEmpty()) {
+                    try {
+                        // 关键:将JSON字符串解析为方法返回值要求的 TableDataInfo<SupplyAreaVo> 类型
+                        TableDataInfo<SupplyAreaVo> tableDataInfo = objectMapper.readValue(
+                            one.getAreaListJson(),
+                            new TypeReference<TableDataInfo<SupplyAreaVo>>() {
+                            }
+                        );
+                        // 解析成功,直接返回转换后的结果
+                        return tableDataInfo;
+                    } catch (JsonProcessingException e) {
+                        // JSON解析失败处理:打印日志,返回空的TableDataInfo,避免服务崩溃
+                        e.printStackTrace();
+                        // 也可以抛出业务异常,根据项目规范调整
+                        return TableDataInfo.build(new Page<SupplyAreaVo>());
+                    }
+
+                }
+            }
+        }
+        //没做判断自己查
+        SupplierInfoVo supplierInfoVo1 = supplierInfoMapper.selectVoOne(new LambdaQueryWrapper<SupplierInfo>().select(SupplierInfo::getSupplyStatus)
+            .eq(SupplierInfo::getId, bo.getSupplierId()));
+        if (supplierInfoVo1.getSupplyStatus() == SupplierStatusEnum.REVIEW_UPDATED.getCode()){
+            //做判断 先查询 供应status = 4 的
+            SupplierInfoTemporary one = supplierInfoTemporaryService.getOne(new LambdaQueryWrapper<SupplierInfoTemporary>()
+                .select(SupplierInfoTemporary::getAreaListJson)
+                .eq(SupplierInfoTemporary::getSupplierId, bo.getSupplierId()));
+            // 临时表数据和JSON字符串非空判断
+            if (one != null && one.getAreaListJson() != null && !one.getAreaListJson().trim().isEmpty()) {
+                try {
+                    // 关键:将JSON字符串解析为方法返回值要求的 TableDataInfo<SupplyAreaVo> 类型
+                    TableDataInfo<SupplyAreaVo> tableDataInfo = objectMapper.readValue(
+                        one.getAreaListJson(),
+                        new TypeReference<TableDataInfo<SupplyAreaVo>>() {
+                        }
+                    );
+                    // 解析成功,直接返回转换后的结果
+                    return tableDataInfo;
+                } catch (JsonProcessingException e) {
+                    // JSON解析失败处理:打印日志,返回空的TableDataInfo,避免服务崩溃
+                    e.printStackTrace();
+                    // 也可以抛出业务异常,根据项目规范调整
+                    return TableDataInfo.build(new Page<SupplyAreaVo>());
+                }
+
+            }
+        }
+
+
         LambdaQueryWrapper<SupplyArea> lqw = buildQueryWrapper(bo);
         Page<SupplyAreaVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
         return TableDataInfo.build(result);
@@ -183,33 +280,149 @@ public class SupplyAreaServiceImpl  extends ServiceImpl<SupplyAreaMapper, Supply
         if (bo == null || bo.getSupplierId() == null) {
             throw new IllegalArgumentException("供应商ID不能为空");
         }
+        Long supplierId = bo.getSupplierId();
         List<SupplyAreaBo> areaList = bo.getAreaList();
         if (areaList == null || areaList.isEmpty()) {
-            return true;
+            throw new IllegalArgumentException("区域列表不能为空");
         }
 
-        // 2. 遍历区域列表,为每个对象赋值supplierId和supplyNo
-        Long supplierId = bo.getSupplierId();
-        int delete = baseMapper.delete(new LambdaQueryWrapper<SupplyArea>().eq(SupplyArea::getSupplierId, supplierId));
-        String supplyNo = bo.getSupplyNo(); // 如果需要的话也赋值
-        List<SupplyArea> supplyAreas = new ArrayList<>();
-        for (SupplyAreaBo areaBo : areaList) {
-            SupplyArea supplyArea = new SupplyArea();
-            BeanUtils.copyProperties(areaBo, supplyArea);
-            // 核心:给每个区域对象设置供应商ID
-            supplyArea.setSupplierId(supplierId);
-            supplyArea.setSupplyNo(supplyNo);
-            supplyAreas.add(supplyArea);
-        }
+        // 步骤2:提取供应商核心关联数据,保证后续数据完整性
+        String supplyNo = bo.getSupplyNo();
+
+        Long REVIEW_UPDATED = SupplierStatusEnum.REVIEW_UPDATED.getCode(); // 固定状态4
+
+        Long supplyStatus = bo.getSupplyStatus();
+
+        if (REVIEW_UPDATED.equals(supplyStatus)) {
+            // 步骤3:将 SupplyAreaBo 列表转换为 SupplyArea 列表(与示例 JSON 结构对齐)
+            List<SupplyAreaJsonVo> supplyAreaList = new ArrayList<>();
+            for (SupplyAreaBo areaBo : areaList) {
+                if (areaBo == null) {
+                    continue; // 跳过空数据,避免序列化异常
+                }
+                SupplyAreaJsonVo supplyArea = new SupplyAreaJsonVo();
+                // 复制属性(简单字段对齐,复杂字段可后续用 Mapstruct 优化)
+                BeanUtils.copyProperties(areaBo, supplyArea);
+                // 补全核心关联字段,确保 JSON 数据可直接用于后续审核同步
+                supplyArea.setId(IdWorker.getId());
+                supplyArea.setSupplierId(supplierId);
+                supplyArea.setSupplyNo(supplyNo);
+                supplyAreaList.add(supplyArea);
+            }
+
+            // 转换后再次校验,避免全是无效数据
+            if (CollectionUtils.isEmpty(supplyAreaList)) {
+                throw new IllegalArgumentException("区域列表不能为空");
+            }
+
+            // 步骤4:封装标准 TableDataInfo 结构(与示例 JSON 完全一致,保证后续解析无缝衔接)
+            int totalCount = supplyAreaList.size();
+            // 构建分页对象(页码 1,每页条数 = 总条数,存储全部有效区域数据)
+            Page<SupplyAreaJsonVo> supplyAreaPage = new Page<>(1, totalCount, totalCount);
+            supplyAreaPage.setRecords(supplyAreaList);
+            // 封装为标准返回结构(自动包含 total、rows、code=200、msg=查询成功)
+            TableDataInfo<SupplyAreaJsonVo> tableDataInfo = TableDataInfo.build(supplyAreaPage);
+            // 可选:显式设置 code 和 msg,完全和示例 JSON 对齐(默认已一致,可省略)
+            tableDataInfo.setCode(200);
+            tableDataInfo.setMsg("查询成功");
+            // 步骤5:将 TableDataInfo 序列化为 JSON 字符串(存入临时表的核心数据)
+            String areaListJson;
+            try {
+                areaListJson = objectMapper.writeValueAsString(tableDataInfo);
+            } catch (JsonProcessingException e) {
+                throw new RuntimeException("供应商区域数据 JSON 序列化失败,请检查数据格式", e);
+            }
+            // 步骤6:处理临时表(SupplierInfoTemporary)- 查询→新建/更新
+            // 6.1 查询该供应商对应的临时表记录(一对一关联,以 supplierId 作为临时表 ID)
+            SupplierInfoTemporary tempSupplier = supplierInfoTemporaryService.getOne(
+                new LambdaQueryWrapper<SupplierInfoTemporary>()
+                    .eq(SupplierInfoTemporary::getSupplierId, supplierId)
+                    .select( // 仅查询必要字段,提升查询效率
+                        SupplierInfoTemporary::getId,
+                        SupplierInfoTemporary::getSupplierNo,
+                        SupplierInfoTemporary::getSupplyStatus,
+                        SupplierInfoTemporary::getAreaListJson
+                    )
+            );
+
+            SupplierInfo supplierInfo = supplierInfoMapper.selectById(supplierId);
+            // 6.2 临时表记录不存在:新建记录,补全核心业务字段
+            if (tempSupplier == null) {
+                tempSupplier = new SupplierInfoTemporary();
+                BeanUtils.copyProperties(supplierInfo, tempSupplier,"id");
+                tempSupplier.setSupplierId(supplierId);
+                // 默认为「修改待审核」状态(REVIEW_UPDATED = 4),符合业务流程
+                tempSupplier.setSupplyStatus(SupplierStatusEnum.REVIEW_UPDATED.getCode());
+            }
+
+            // 6.3 无论新建/更新,均设置 areaListJson 字段(核心操作)
+
 
-        // 3. 执行批量插入操作
-        boolean insertCount = baseMapper.insertBatch(supplyAreas);
+            int update = supplierInfoMapper.update(new LambdaUpdateWrapper<SupplierInfo>()
+                .set(SupplierInfo::getSupplyStatus, SupplierStatusEnum.REVIEW_UPDATED.getCode())
+                .eq(SupplierInfo::getId, supplierId));
 
-        // 4. 判断插入结果(插入数量和列表数量一致则返回成功)
-        return insertCount;
+            tempSupplier.setAreaListJson(areaListJson);
 
+            // 步骤7:保存/更新临时表(MyBatis-Plus saveOrUpdate 自动判断 ID 是否存在,原子操作)
+            boolean operateResult;
+            try {
+                operateResult = supplierInfoTemporaryService.saveOrUpdate(tempSupplier);
+                return operateResult;
+            } catch (Exception e) {
+                throw new RuntimeException("供应商临时表数据操作失败,请联系管理员", e);
+            }
+        }else {
+            // 2.1 转换BO为正式库实体SupplyArea
+            List<SupplyArea> supplyAreaOfficialList = new ArrayList<>();
+            for (SupplyAreaBo areaBo : areaList) {
+                if (areaBo == null) {
+                    continue; // 跳过空数据,保证入库数据有效
+                }
+                SupplyArea supplyArea = new SupplyArea();
+                BeanUtils.copyProperties(areaBo, supplyArea);
+                // 补全核心关联字段
+                supplyArea.setSupplierId(supplierId);
+                supplyArea.setSupplyNo(supplyNo);
+                supplyAreaOfficialList.add(supplyArea);
+            }
+
+            // 2.2 二次校验:避免转换后无有效数据
+            if (CollectionUtils.isEmpty(supplyAreaOfficialList)) {
+                throw new IllegalArgumentException("区域列表无有效数据");
+            }
+
+            // 2.3 批量插入正式库(MyBatis-Plus自带saveBatch,高效无冗余)
+            try {
+                boolean b = baseMapper.insertBatch(supplyAreaOfficialList);
+                return b;
+            } catch (Exception e) {
+                throw new RuntimeException("供应商区域正式表数据插入失败,请联系管理员", e);
+            }
+        }
     }
 
+    /**
+     * // 2. 遍历区域列表,为每个对象赋值supplierId和supplyNo
+     *         int delete = baseMapper.delete(new LambdaQueryWrapper<SupplyArea>().eq(SupplyArea::getSupplierId, supplierId));
+     *         String supplyNo = bo.getSupplyNo(); // 如果需要的话也赋值
+     *         List<SupplyArea> supplyAreas = new ArrayList<>();
+     *         for (SupplyAreaBo areaBo : areaList) {
+     *             SupplyArea supplyArea = new SupplyArea();
+     *             BeanUtils.copyProperties(areaBo, supplyArea);
+     *             // 核心:给每个区域对象设置供应商ID
+     *             supplyArea.setSupplierId(supplierId);
+     *             supplyArea.setSupplyNo(supplyNo);
+     *             supplyAreas.add(supplyArea);
+     *         }
+     *
+     *         // 3. 执行批量插入操作
+     *         boolean insertCount = baseMapper.insertBatch(supplyAreas);
+     *
+     *         // 4. 判断插入结果(插入数量和列表数量一致则返回成功)
+     *         return insertCount;
+     */
+
     /**
      * 修改供应区域
      *

+ 7 - 0
ruoyi-modules/ruoyi-customer/src/main/resources/mapper/customer/SupplierInfoTemporaryMapper.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.dromara.customer.mapper.SupplierInfoTemporaryMapper">
+
+</mapper>