소스 검색

APP+小程序销售制单改价审核,总后台审核功能开发、分页sql优化,展示相关商品’、用户信息

yjwang 2 일 전
부모
커밋
bbb39e2c4e
19개의 변경된 파일954개의 추가작업 그리고 12개의 파일을 삭제
  1. 117 0
      fs-admin/src/main/java/com/fs/hisStore/controller/FsStorePreparedPriceChangeController.java
  2. 9 0
      fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java
  3. 3 0
      fs-service/src/main/java/com/fs/course/param/FsCourseLinkCreateParam.java
  4. 3 0
      fs-service/src/main/java/com/fs/course/param/newfs/FsCourseSortLinkParam.java
  5. 6 5
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java
  6. 1 0
      fs-service/src/main/java/com/fs/hisStore/config/StoreConfig.java
  7. 73 0
      fs-service/src/main/java/com/fs/hisStore/domain/FsStorePreparedPriceChange.java
  8. 8 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java
  9. 81 0
      fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePreparedPriceChangeMapper.java
  10. 50 0
      fs-service/src/main/java/com/fs/hisStore/param/FsStorePreparedPriceChangeParam.java
  11. 1 1
      fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java
  12. 82 0
      fs-service/src/main/java/com/fs/hisStore/service/IFsStorePreparedPriceChangeService.java
  13. 27 5
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java
  14. 206 0
      fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePreparedPriceChangeServiceImpl.java
  15. 51 0
      fs-service/src/main/java/com/fs/hisStore/vo/FsStorePreparedProductInfoVo.java
  16. 20 0
      fs-service/src/main/resources/mapper/hisStore/FsStoreCartScrmMapper.xml
  17. 149 0
      fs-service/src/main/resources/mapper/hisStore/FsStorePreparedPriceChangeMapper.xml
  18. 1 1
      fs-user-app/src/main/java/com/fs/app/controller/store/CompanyOrderScrmController.java
  19. 66 0
      fs-user-app/src/main/java/com/fs/app/controller/store/FsStorePreparedPriceChangeController.java

+ 117 - 0
fs-admin/src/main/java/com/fs/hisStore/controller/FsStorePreparedPriceChangeController.java

@@ -0,0 +1,117 @@
+package com.fs.hisStore.controller;
+
+import java.util.List;
+
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsStorePreparedPriceChange;
+import com.fs.hisStore.param.FsStorePreparedPriceChangeParam;
+import com.fs.hisStore.service.IFsStorePreparedPriceChangeService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 销售制单改价审核记录Controller
+ *
+ * @author fs
+ * @date 2026-01-16
+ */
+@RestController
+@RequestMapping("/shop/change")
+public class FsStorePreparedPriceChangeController extends BaseController {
+    @Autowired
+    private IFsStorePreparedPriceChangeService fsStorePreparedPriceChangeService;
+
+    /**
+     * 查询销售制单改价审核记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsStorePreparedPriceChangeParam fsStorePreparedPriceChange) {
+        startPage();
+        List<FsStorePreparedPriceChange> list = fsStorePreparedPriceChangeService.selectFsStorePreparedPriceChangeList(fsStorePreparedPriceChange);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出销售制单改价审核记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:export')")
+    @Log(title = "销售制单改价审核记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsStorePreparedPriceChangeParam fsStorePreparedPriceChange) {
+        List<FsStorePreparedPriceChange> list = fsStorePreparedPriceChangeService.selectFsStorePreparedPriceChangeList(fsStorePreparedPriceChange);
+        ExcelUtil<FsStorePreparedPriceChange> util = new ExcelUtil<FsStorePreparedPriceChange>(FsStorePreparedPriceChange.class);
+        return util.exportExcel(list, "销售制单改价审核记录数据");
+    }
+
+    /**
+     * 获取销售制单改价审核记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(fsStorePreparedPriceChangeService.selectFsStorePreparedPriceChangeById(id));
+    }
+
+    /**
+     * 新增销售制单改价审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:add')")
+    @Log(title = "销售制单改价审核记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsStorePreparedPriceChange fsStorePreparedPriceChange) {
+        return toAjax(fsStorePreparedPriceChangeService.insertFsStorePreparedPriceChange(fsStorePreparedPriceChange));
+    }
+
+    /**
+     * 修改销售制单改价审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:edit')")
+    @Log(title = "销售制单改价审核记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsStorePreparedPriceChange fsStorePreparedPriceChange) {
+        return toAjax(fsStorePreparedPriceChangeService.updateFsStorePreparedPriceChange(fsStorePreparedPriceChange));
+    }
+
+    /**
+     * 删除销售制单改价审核记录
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:remove')")
+    @Log(title = "销售制单改价审核记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(fsStorePreparedPriceChangeService.deleteFsStorePreparedPriceChangeByIds(ids));
+    }
+
+    /**
+     * 批量审核功能
+     */
+    @PreAuthorize("@ss.hasPermi('shop:change:batch:audit')")
+    @Log(title = "销售制单审核", businessType = BusinessType.GRANT, logParam = {"制单", "审核销售制单"})
+    @PostMapping("/batchAudit")
+    public R batchAudit(@RequestBody FsStorePreparedPriceChange fsStorePreparedPriceChange) {
+        if (fsStorePreparedPriceChange.getIds() == null || fsStorePreparedPriceChange.getIds().length == 0) {
+            return R.error("操作失败,关键信息不能为空!");
+        }
+        if (fsStorePreparedPriceChange.getAuditStatus() == null) {
+            return R.error("审核状态不能为空!");
+        } else if (fsStorePreparedPriceChange.getAuditStatus() < -1 && fsStorePreparedPriceChange.getAuditStatus() > 2) {
+            return R.error("审核状态异常!");
+        }
+        return fsStorePreparedPriceChangeService.batchAudit(fsStorePreparedPriceChange);
+    }
+}

+ 9 - 0
fs-common/src/main/java/com/fs/common/core/redis/RedisCache.java

@@ -301,4 +301,13 @@ public class RedisCache
     {
         redisTemplate.opsForList().rightPush(key, value);
     }
+
+    /**
+     * 判断key是否存在
+     * @param key 键
+     * @return true/false
+     */
+    public Boolean hasKey(String key) {
+        return redisTemplate.hasKey(key);
+    }
 }

+ 3 - 0
fs-service/src/main/java/com/fs/course/param/FsCourseLinkCreateParam.java

@@ -40,4 +40,7 @@ public class FsCourseLinkCreateParam {
 
     private Long projectId;//项目ID
 
+    //生成类型1分享课程,null是海报
+    private Integer type;
+
 }

+ 3 - 0
fs-service/src/main/java/com/fs/course/param/newfs/FsCourseSortLinkParam.java

@@ -41,4 +41,7 @@ public class FsCourseSortLinkParam {
     @ApiModelProperty(value = "项目id")
     private Long projectId;
 
+    //生成类型1分享课程,null是海报
+    private Integer type;
+
 }

+ 6 - 5
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseServiceImpl.java

@@ -582,7 +582,7 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
         BeanUtils.copyProperties(link, courseMap);
         courseMap.setProjectId(param.getProjectId());
         String courseJson = JSON.toJSONString(courseMap);
-        link.setRealLink(realLink + courseJson);
+        link.setRealLink((param.getType() == null ?realLink:appRealLink) + courseJson);
 
         link.setCreateTime(new Date());
 
@@ -593,13 +593,14 @@ public class FsUserCourseServiceImpl implements IFsUserCourseService
         if (i > 0){
             if (CloudHostUtils.hasCloudHostName("医健宝")){
                 String domainName = getDomainName(param.getCompanyUserId(), config);
-                String sortLink = domainName + link.getRealLink().replace("/#","");
+                String sortLink = domainName+"/courseH5"+ link.getRealLink().replace("/#","");
                 sortLink = sortLink.replaceAll("\\\\", "");
                 return R.ok().put("url", sortLink).put("link", random);
+            }else {
+                String domainName = getDomainName(param.getCompanyUserId(), config);
+                String sortLink = domainName + shortLink + link.getLink();
+                return R.ok().put("url", sortLink).put("link", random);
             }
-            String domainName = getDomainName(param.getCompanyUserId(), config);
-            String sortLink = domainName + shortLink + link.getLink();
-            return R.ok().put("url", sortLink).put("link", random);
         }
         return R.error("生成链接失败!");
     }

+ 1 - 0
fs-service/src/main/java/com/fs/hisStore/config/StoreConfig.java

@@ -25,4 +25,5 @@ public class StoreConfig implements Serializable {
     private Integer createSalesOrderType; // 订单改价方式 1 商品改价 2总价改价
     private Boolean isBrushOrders;//是否开启刷单按钮
     private Boolean isWeChatShipping;//是否开启微信发货
+    private Boolean isPreparedPriceChange;//是否开启制单改价审核
 }

+ 73 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsStorePreparedPriceChange.java

@@ -0,0 +1,73 @@
+package com.fs.hisStore.domain;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import com.fs.hisStore.vo.FsStorePreparedProductInfoVo;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 销售制单改价审核记录对象 fs_store_prepared_price_change
+ *
+ * @author fs
+ * @date 2026-01-16
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsStorePreparedPriceChange extends BaseEntity{
+
+    /** 主键ID */
+    @TableId(type = IdType.AUTO)
+    private String id;
+
+    /** 制单审核购物车ids */
+    @Excel(name = "制单审核购物车ids")
+    private String cartIds;
+
+    /** 支付金额 */
+    @Excel(name = "支付金额")
+    private BigDecimal money;
+
+    /** 物流代收自定义金额 */
+    @Excel(name = "物流代收自定义金额")
+    private BigDecimal payAmount;
+
+    /** 销售ID */
+    @Excel(name = "销售ID")
+    private Long companyUserId;
+
+    /** 原缓存key值 */
+    @Excel(name = "原缓存key值")
+    private String createOrderKey;
+
+    //审核状态-1驳回、0待审核、1审核中、2已审核
+    private Integer auditStatus;
+
+    //审核备注
+    private String auditRemark;
+
+    //支付类型 1-全付款 3-物流代收(货到付款)
+    private Integer payType;
+
+    //多商品信息
+    @TableField(exist = false)
+    private String matchedProducts;
+
+    //销售昵称
+    @TableField(exist = false)
+    private String nickName;
+
+    //批量操作id字段
+    @TableField(exist = false)
+    private String[] ids;
+
+    //购物车商品信息
+    @TableField(exist = false)
+    private List<FsStorePreparedProductInfoVo> preparedProductInfoVoList;
+}

+ 8 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java

@@ -8,6 +8,7 @@ import com.fs.hisStore.domain.FsStoreScrm;
 import com.fs.hisStore.param.FsStoreCartCountParam;
 import com.fs.hisStore.vo.FsStoreCartQueryVO;
 import com.fs.hisStore.vo.FsStoreCartVO;
+import com.fs.hisStore.vo.FsStorePreparedProductInfoVo;
 import com.fs.store.vo.FsStoreCartScrmQueryVO;
 import com.fs.store.vo.FsStoreCartScrmVO;
 import org.apache.ibatis.annotations.Delete;
@@ -190,4 +191,11 @@ public interface FsStoreCartScrmMapper
             "</if>" +
             "</script>"})
     List<FsStoreCartScrmVO> selectFsStoreCartListByUidMultiStore(@Param("uid") long uid, @Param("storeId") Long storeId);
+
+    /**
+     * 获取购物车制单商品信息
+     * @param cartIds 购物车ID串
+     * @return 购物车商品信息
+     * **/
+    List<FsStorePreparedProductInfoVo> getFsPreparedProductInfoVoList(@Param("cartIds") String[] cartIds);
 }

+ 81 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStorePreparedPriceChangeMapper.java

@@ -0,0 +1,81 @@
+package com.fs.hisStore.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.hisStore.domain.FsStorePreparedPriceChange;
+import com.fs.hisStore.param.FsStorePreparedPriceChangeParam;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 销售制单改价审核记录Mapper接口
+ *
+ * @author fs
+ * @date 2026-01-16
+ */
+public interface FsStorePreparedPriceChangeMapper extends BaseMapper<FsStorePreparedPriceChange> {
+    /**
+     * 查询销售制单改价审核记录
+     *
+     * @param id 销售制单改价审核记录主键
+     * @return 销售制单改价审核记录
+     */
+    FsStorePreparedPriceChange selectFsStorePreparedPriceChangeById(String id);
+
+    /**
+     * 查询销售制单改价审核记录列表
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 销售制单改价审核记录集合
+     */
+    List<FsStorePreparedPriceChange> selectFsStorePreparedPriceChangeList(FsStorePreparedPriceChange fsStorePreparedPriceChange);
+
+    /**
+     * 新增销售制单改价审核记录
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 结果
+     */
+    int insertFsStorePreparedPriceChange(FsStorePreparedPriceChange fsStorePreparedPriceChange);
+
+    /**
+     * 修改销售制单改价审核记录
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 结果
+     */
+    int updateFsStorePreparedPriceChange(FsStorePreparedPriceChange fsStorePreparedPriceChange);
+
+    /**
+     * 删除销售制单改价审核记录
+     *
+     * @param id 销售制单改价审核记录主键
+     * @return 结果
+     */
+    int deleteFsStorePreparedPriceChangeById(String id);
+
+    /**
+     * 批量删除销售制单改价审核记录
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsStorePreparedPriceChangeByIds(String[] ids);
+
+    /**
+     * 批量更新销售制单改价审核状态
+     *
+     * @param ids         更新id
+     * @param auditStatus 审核状态
+     * @param auditRemark 审核备注
+     **/
+    void batchAudit(@Param("ids") String[] ids, @Param("auditStatus") Integer auditStatus,@Param("auditRemark") String auditRemark);
+
+    /**
+     * 查询销售制单改价审核记录列表
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 销售制单改价审核记录集合
+     */
+    List<FsStorePreparedPriceChange> selectFsStorePreparedPriceChangePageList(FsStorePreparedPriceChangeParam fsStorePreparedPriceChange);
+}

+ 50 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStorePreparedPriceChangeParam.java

@@ -0,0 +1,50 @@
+package com.fs.hisStore.param;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 销售制单参数
+ * **/
+@Data
+public class FsStorePreparedPriceChangeParam implements Serializable {
+
+    /**制单ID**/
+    private Long id;
+
+    /** 制单审核购物车ids */
+    private String cartIds;
+
+    /** 销售ID */
+    private Long companyUserId;
+
+    /** 原缓存key值 */
+    private String createOrderKey;
+
+    //审核状态-1驳回、0待审核、1审核中、2已审核
+    private Integer auditStatus;
+
+    //审核备注
+    private String auditRemark;
+
+    //支付类型 1-全付款 3-物流代收(货到付款)
+    private Integer payType;
+
+    //多商品信息
+    private String matchedProducts;
+
+    //销售昵称
+    private String nickName;
+
+    //请求密钥
+    private String token;
+
+    @ApiModelProperty(value = "页码,默认为1")
+    private Integer pageNum =1;
+    @ApiModelProperty(value = "页码,默认为1")
+    private Integer page =1;
+    @ApiModelProperty(value = "页大小,默认为10")
+    private Integer pageSize = 10;
+}

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java

@@ -182,7 +182,7 @@ public interface IFsStoreOrderScrmService
 
     R addUserCart(long userId, String createOrderKey);
 
-    R updateSalseOrderMoney(String createOrderKey, BigDecimal money,BigDecimal payAmount,Integer payType);
+    R updateSalseOrderMoney(String createOrderKey, BigDecimal money,BigDecimal payAmount,Integer payType,Long userId);
 
     Integer selectFsStoreOrderCountByType(Long companyId, long userId, int type);
 

+ 82 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStorePreparedPriceChangeService.java

@@ -0,0 +1,82 @@
+package com.fs.hisStore.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.R;
+import com.fs.hisStore.domain.FsStorePreparedPriceChange;
+import com.fs.hisStore.param.FsStorePreparedPriceChangeParam;
+
+
+/**
+ * 销售制单改价审核记录Service接口
+ *
+ * @author fs
+ * @date 2026-01-16
+ */
+public interface IFsStorePreparedPriceChangeService extends IService<FsStorePreparedPriceChange> {
+    /**
+     * 查询销售制单改价审核记录
+     *
+     * @param id 销售制单改价审核记录主键
+     * @return 销售制单改价审核记录
+     */
+    FsStorePreparedPriceChange selectFsStorePreparedPriceChangeById(String id);
+
+    /**
+     * 查询销售制单改价审核记录列表
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 销售制单改价审核记录集合
+     */
+    List<FsStorePreparedPriceChange> selectFsStorePreparedPriceChangeList(FsStorePreparedPriceChangeParam fsStorePreparedPriceChange);
+
+    /**
+     * 新增销售制单改价审核记录
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 结果
+     */
+    int insertFsStorePreparedPriceChange(FsStorePreparedPriceChange fsStorePreparedPriceChange);
+
+    /**
+     * 修改销售制单改价审核记录
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 结果
+     */
+    int updateFsStorePreparedPriceChange(FsStorePreparedPriceChange fsStorePreparedPriceChange);
+
+    /**
+     * 批量删除销售制单改价审核记录
+     *
+     * @param ids 需要删除的销售制单改价审核记录主键集合
+     * @return 结果
+     */
+    int deleteFsStorePreparedPriceChangeByIds(String[] ids);
+
+    /**
+     * 删除销售制单改价审核记录信息
+     *
+     * @param id 销售制单改价审核记录主键
+     * @return 结果
+     */
+    int deleteFsStorePreparedPriceChangeById(String id);
+
+    /**
+     * 批量审核功能
+     *
+     * @param fsStorePreparedPriceChange 审核对象
+     * @return 批量审核结果
+     */
+    R batchAudit(FsStorePreparedPriceChange fsStorePreparedPriceChange);
+
+    /**
+     * 分享制单
+     *
+     * @param id            制单ID
+     * @param companyuserId 公司用户ID
+     * @return R
+     */
+    R sharePrepare(Long id, Long companyuserId);
+}

+ 27 - 5
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -404,6 +404,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
     @Autowired
     private FsStoreVerifyCodeScrmMapper verifyCodeMapper;
 
+    @Autowired
+    private IFsStorePreparedPriceChangeService fsStorePreparedPriceChangeService;
+
 
     /**
      * 查询订单
@@ -2676,7 +2679,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
     }
 
     @Override
-    public R updateSalseOrderMoney(String createOrderKey, BigDecimal money, BigDecimal payAmount,Integer payType) {
+    public R updateSalseOrderMoney(String createOrderKey, BigDecimal money, BigDecimal payAmount,Integer payType,Long userId) {
         //货到付款自定义金额
         if (payAmount == null) {
             String configJson = configService.selectConfigByKey("store.config");
@@ -2714,10 +2717,29 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                 throw new CustomException("价格必须大于商品总价" + config.getCreateMoneyRate() + "%", 501);
             }
         }
-        redisCache.setCacheObject("createOrderMoney:" + createOrderKey, money, 24, TimeUnit.HOURS);
-        redisCache.setCacheObject("createOrderAmount:" + createOrderKey, payAmount, 24, TimeUnit.HOURS);//物流代收自定义金额
-        redisCache.setCacheObject("createOrderPayType:" + createOrderKey, payType, 24, TimeUnit.HOURS);//支付类型 1-全付款 3-物流代收(货到付款)
-        return R.ok();
+
+        //根据配置获取是否开启改价审核
+        if(config.getIsPreparedPriceChange() != null && config.getIsPreparedPriceChange()){
+            //添加制单改价审核记录
+            FsStorePreparedPriceChange preparedPriceChange =new FsStorePreparedPriceChange();
+            preparedPriceChange.setAuditStatus(1);
+            preparedPriceChange.setPayType(payType);
+            preparedPriceChange.setMoney(money);//支付金额
+            preparedPriceChange.setPayAmount(payAmount);//物流改价金额
+            preparedPriceChange.setCompanyUserId(userId);//销售ID
+            preparedPriceChange.setCreateBy(userId.toString());//创建人
+            preparedPriceChange.setCreateOrderKey(createOrderKey);//唯一key
+            preparedPriceChange.setCartIds(carts.stream().map(c->c.getId().toString()).collect(Collectors.joining(",")));//购物车IDs
+            fsStorePreparedPriceChangeService.insertFsStorePreparedPriceChange(preparedPriceChange);
+        } else {
+            redisCache.setCacheObject("createOrderMoney:" + createOrderKey, money, 24, TimeUnit.HOURS);
+            redisCache.setCacheObject("createOrderAmount:" + createOrderKey, payAmount, 24, TimeUnit.HOURS);//物流代收自定义金额
+            redisCache.setCacheObject("createOrderPayType:" + createOrderKey, payType, 24, TimeUnit.HOURS);//支付类型 1-全付款 3-物流代收(货到付款)
+
+        }
+
+
+        return R.ok().put("disabled",config.getIsPreparedPriceChange() != null && config.getIsPreparedPriceChange());
     }
 
     @Override

+ 206 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStorePreparedPriceChangeServiceImpl.java

@@ -0,0 +1,206 @@
+package com.fs.hisStore.service.impl;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.hisStore.domain.FsStorePreparedPriceChange;
+import com.fs.hisStore.mapper.FsStoreCartScrmMapper;
+import com.fs.hisStore.mapper.FsStorePreparedPriceChangeMapper;
+import com.fs.hisStore.param.FsStorePreparedPriceChangeParam;
+import com.fs.hisStore.service.IFsStorePreparedPriceChangeService;
+import com.fs.hisStore.vo.FsStorePreparedProductInfoVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 销售制单改价审核记录Service业务层处理
+ *
+ * @author fs
+ * @date 2026-01-16
+ */
+@Service
+public class FsStorePreparedPriceChangeServiceImpl extends ServiceImpl<FsStorePreparedPriceChangeMapper, FsStorePreparedPriceChange> implements IFsStorePreparedPriceChangeService {
+    @Autowired
+    private RedisCache redisCache;
+
+    @Autowired
+    private FsStoreCartScrmMapper cartScrmMapper;
+
+    /**
+     * 查询销售制单改价审核记录
+     *
+     * @param id 销售制单改价审核记录主键
+     * @return 销售制单改价审核记录
+     */
+    @Override
+    public FsStorePreparedPriceChange selectFsStorePreparedPriceChangeById(String id) {
+        //获取制单信息
+        FsStorePreparedPriceChange fsStorePreparedPriceChange = baseMapper.selectFsStorePreparedPriceChangeById(id);
+        //判断信息是否存在
+        if (fsStorePreparedPriceChange == null) {
+            throw new ServiceException("查询失败,数据不存在!");
+        }
+        //获取购物车商品信息
+        String[] cartIds = fsStorePreparedPriceChange.getCartIds().split(",");
+        List<FsStorePreparedProductInfoVo> preparedProductInfoVoList = cartScrmMapper.getFsPreparedProductInfoVoList(cartIds);
+        if (!preparedProductInfoVoList.isEmpty()) {
+            fsStorePreparedPriceChange.setPreparedProductInfoVoList(preparedProductInfoVoList);
+        }
+        return fsStorePreparedPriceChange;
+    }
+
+    /**
+     * 查询销售制单改价审核记录列表
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 销售制单改价审核记录
+     */
+    @Override
+    public List<FsStorePreparedPriceChange> selectFsStorePreparedPriceChangeList(FsStorePreparedPriceChangeParam fsStorePreparedPriceChange) {
+        return baseMapper.selectFsStorePreparedPriceChangePageList(fsStorePreparedPriceChange);
+    }
+
+    /**
+     * 新增销售制单改价审核记录
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 结果
+     */
+    @Override
+    public int insertFsStorePreparedPriceChange(FsStorePreparedPriceChange fsStorePreparedPriceChange) {
+        fsStorePreparedPriceChange.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsStorePreparedPriceChange(fsStorePreparedPriceChange);
+    }
+
+    /**
+     * 修改销售制单改价审核记录
+     *
+     * @param fsStorePreparedPriceChange 销售制单改价审核记录
+     * @return 结果
+     */
+    @Override
+    public int updateFsStorePreparedPriceChange(FsStorePreparedPriceChange fsStorePreparedPriceChange) {
+        fsStorePreparedPriceChange.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateFsStorePreparedPriceChange(fsStorePreparedPriceChange);
+    }
+
+    /**
+     * 批量删除销售制单改价审核记录
+     *
+     * @param ids 需要删除的销售制单改价审核记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStorePreparedPriceChangeByIds(String[] ids) {
+        //获取信息状态是否匹配
+        List<FsStorePreparedPriceChange> list = baseMapper.selectList(new LambdaQueryWrapper<FsStorePreparedPriceChange>().in(FsStorePreparedPriceChange::getId, ids));
+        if (list.isEmpty()) {
+            throw new ServiceException("操作失败,数据不存在!");
+        } else if (list.size() != ids.length) {
+            throw new ServiceException("操作失败,部分数据不存在!");
+        }
+        List<FsStorePreparedPriceChange> invalidList = list.stream()
+                .filter(item -> item.getAuditStatus() == 1 || item.getAuditStatus() == 2)
+                .collect(Collectors.toList());
+
+        if (!invalidList.isEmpty()) {
+            throw new ServiceException("操作失败,部分数据状态不允许删除!");
+        }
+        return baseMapper.deleteFsStorePreparedPriceChangeByIds(ids);
+    }
+
+    /**
+     * 删除销售制单改价审核记录信息
+     *
+     * @param id 销售制单改价审核记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsStorePreparedPriceChangeById(String id) {
+        return baseMapper.deleteFsStorePreparedPriceChangeById(id);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public R batchAudit(FsStorePreparedPriceChange fsStorePreparedPriceChange) {
+        String[] ids = fsStorePreparedPriceChange.getIds();
+        //获取信息状态是否匹配
+        List<FsStorePreparedPriceChange> list = baseMapper.selectList(new LambdaQueryWrapper<FsStorePreparedPriceChange>().in(FsStorePreparedPriceChange::getId, fsStorePreparedPriceChange.getIds()));
+        if (list.isEmpty()) {
+            return R.error("操作失败,数据不存在!");
+        } else if (list.size() != ids.length) {
+            return R.error("操作失败,部分数据不存在!");
+        }
+
+        List<FsStorePreparedPriceChange> invalidList = list.stream()
+                .filter(item -> isValidForAudit(item))
+                .collect(Collectors.toList());
+
+        if (!invalidList.isEmpty()) {
+            return R.error("操作失败,部分数据状态不允许审核!");
+        }
+
+        //更新制单信息
+        baseMapper.batchAudit(fsStorePreparedPriceChange.getIds(), fsStorePreparedPriceChange.getAuditStatus(), fsStorePreparedPriceChange.getAuditRemark());
+        return R.ok();
+    }
+
+    @Override
+    public R sharePrepare(Long id, Long companyuserId) {
+        // 获取对应的制单信息
+        FsStorePreparedPriceChange fsStorePreparedPriceChange = baseMapper.selectById(id);
+        if (fsStorePreparedPriceChange == null) {
+            return R.error("操作失败,数据不存在!");
+        }
+
+        if (fsStorePreparedPriceChange.getCompanyUserId() == null) {
+            return R.error("操作失败,制单信息未绑定销售!");
+        }
+
+        if (!fsStorePreparedPriceChange.getCompanyUserId().equals(companyuserId)) {
+            return R.error("操作失败,销售信息不一致!");
+        }
+
+        // 配置写入REDIS
+        String keyPrefix = "createOrder";
+        String orderKey = fsStorePreparedPriceChange.getCreateOrderKey();
+
+        // 金额配置
+        String moneyKey = keyPrefix + "Money:" + orderKey;
+        if (redisCache.hasKey(moneyKey) && isPositiveBigDecimal(fsStorePreparedPriceChange.getMoney())) {
+            redisCache.setCacheObject(moneyKey, fsStorePreparedPriceChange.getMoney(), 24, TimeUnit.HOURS);
+        }
+
+        // 物流代收自定义金额
+        String amountKey = keyPrefix + "Amount:" + orderKey;
+        if (redisCache.hasKey(amountKey) && isPositiveBigDecimal(fsStorePreparedPriceChange.getPayAmount())) {
+            redisCache.setCacheObject(amountKey, fsStorePreparedPriceChange.getPayAmount(), 24, TimeUnit.HOURS);
+        }
+
+        // 支付类型
+        String payTypeKey = keyPrefix + "PayType:" + orderKey;
+        if (redisCache.hasKey(payTypeKey) && fsStorePreparedPriceChange.getPayType() != null) {
+            redisCache.setCacheObject(payTypeKey, fsStorePreparedPriceChange.getPayType(), 24, TimeUnit.HOURS);
+        }
+
+        return R.ok();
+    }
+
+    private boolean isPositiveBigDecimal(BigDecimal value) {
+        return value != null && value.compareTo(BigDecimal.ZERO) > 0;
+    }
+
+    private boolean isValidForAudit(FsStorePreparedPriceChange item) {
+        return item.getAuditStatus() == 2;
+    }
+
+}

+ 51 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStorePreparedProductInfoVo.java

@@ -0,0 +1,51 @@
+package com.fs.hisStore.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 制单改价商品Vo
+ **/
+@Data
+public class FsStorePreparedProductInfoVo implements Serializable {
+    /**
+     * 购物车ID
+     **/
+    private Long cartId;
+
+    /**
+     * 购物车数量
+     **/
+    private Integer cartNum;
+
+    /**
+     * 商品ID
+     **/
+    private Long productId;
+
+    /**
+     * 商品名称
+     **/
+    private String productName;
+
+    /**
+     * 商品图片
+     **/
+    private String image;
+
+    /**
+     * 通用名称
+     **/
+    private String commonName;
+
+    /**
+     * 店铺名称
+     **/
+    private String storeName;
+
+    /**
+     * 店铺ID
+     * **/
+    private Long storeId;
+}

+ 20 - 0
fs-service/src/main/resources/mapper/hisStore/FsStoreCartScrmMapper.xml

@@ -103,4 +103,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+
+    <select id="getFsPreparedProductInfoVoList" resultType="com.fs.hisStore.vo.FsStorePreparedProductInfoVo">
+        SELECT
+            cs.id AS cart_id,
+            cs.cart_num,
+            ps.product_id,
+            ps.product_name,
+            ps.image,
+            ps.common_name,
+            ss.store_name,
+            ss.store_id
+        FROM
+            fs_store_cart_scrm cs
+                INNER JOIN fs_store_product_scrm ps ON cs.product_id = ps.product_id
+                INNER JOIN fs_store_scrm ss ON ss.store_id = ps.store_id
+        WHERE
+            cs.is_del = 0 AND cs.id IN
+        <foreach collection="cartIds" item="id" index="index" open="(" separator="," close=")">#{id}</foreach>
+    </select>
+
 </mapper>

+ 149 - 0
fs-service/src/main/resources/mapper/hisStore/FsStorePreparedPriceChangeMapper.xml

@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.hisStore.mapper.FsStorePreparedPriceChangeMapper">
+    
+    <resultMap type="FsStorePreparedPriceChange" id="FsStorePreparedPriceChangeResult">
+        <result property="id"    column="id"    />
+        <result property="cartIds"    column="cart_ids"    />
+        <result property="money"    column="money"    />
+        <result property="payAmount"    column="pay_amount"    />
+        <result property="companyUserId"    column="company_user_id"    />
+        <result property="createOrderKey"    column="create_order_key"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="auditStatus"    column="audit_status"    />
+    </resultMap>
+
+    <sql id="selectFsStorePreparedPriceChangeVo">
+        select id, cart_ids, money, pay_amount, company_user_id, create_order_key, create_time, update_time, create_by, update_by,audit_status from fs_store_prepared_price_change
+    </sql>
+
+    <select id="selectFsStorePreparedPriceChangeList" parameterType="FsStorePreparedPriceChange" resultMap="FsStorePreparedPriceChangeResult">
+        <include refid="selectFsStorePreparedPriceChangeVo"/>
+        <where>
+            <if test="money != null "> and money = #{money}</if>
+            <if test="payAmount != null "> and pay_amount = #{payAmount}</if>
+            <if test="auditStatus != null "> and audit_status = #{auditStatus}</if>
+            <if test="cartIds != null  and cartIds != ''"> and cart_ids = #{cartIds}</if>
+            <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
+            <if test="createOrderKey != null  and createOrderKey != ''"> and create_order_key = #{createOrderKey}</if>
+        </where>
+        order by id desc
+    </select>
+    
+    <select id="selectFsStorePreparedPriceChangeById" parameterType="String" resultMap="FsStorePreparedPriceChangeResult">
+        <include refid="selectFsStorePreparedPriceChangeVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_store_prepared_price_change
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="cartIds != null and cartIds != ''">cart_ids,</if>
+            <if test="money != null">money,</if>
+            <if test="payAmount != null">pay_amount,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+            <if test="createOrderKey != null and createOrderKey != ''">create_order_key,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="auditStatus != null">audit_status,</if>
+            <if test="payType != null">pay_type,</if>
+            <if test="auditRemark != null">audit_remark ,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="cartIds != null and cartIds != ''">#{cartIds},</if>
+            <if test="money != null">#{money},</if>
+            <if test="payAmount != null">#{payAmount},</if>
+            <if test="companyUserId != null">#{companyUserId},</if>
+            <if test="createOrderKey != null and createOrderKey != ''">#{createOrderKey},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="auditStatus != null">#{auditStatus},</if>
+            <if test="payType != null">#{payType},</if>
+            <if test="auditRemark != null">#{auditRemark} ,</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsStorePreparedPriceChange" parameterType="FsStorePreparedPriceChange">
+        update fs_store_prepared_price_change
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="cartIds != null and cartIds != ''">cart_ids = #{cartIds},</if>
+            <if test="money != null">money = #{money},</if>
+            <if test="payAmount != null">pay_amount = #{payAmount},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
+            <if test="createOrderKey != null and createOrderKey != ''">create_order_key = #{createOrderKey},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
+            <if test="payType != null">pay_type = #{payType},</if>
+            <if test="auditRemark != null">audit_remark = #{auditRemark} ,</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsStorePreparedPriceChangeById" parameterType="String">
+        delete from fs_store_prepared_price_change where id = #{id}
+    </delete>
+
+    <delete id="deleteFsStorePreparedPriceChangeByIds" parameterType="String">
+        delete from fs_store_prepared_price_change where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <update id="batchAudit">
+        update fs_store_prepared_price_change set audit_status = #{auditStatus},audit_remark = #{auditRemark} where id in
+        <foreach item="id" collection="ids" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <select id="selectFsStorePreparedPriceChangePageList" resultType="com.fs.hisStore.domain.FsStorePreparedPriceChange">
+        SELECT
+            pc.*,
+            GROUP_CONCAT(
+                    ps.product_name
+                        SEPARATOR '|'
+                ) AS matched_products,
+            cu.nick_name
+        FROM
+            fs_store_prepared_price_change pc
+                LEFT JOIN fs_store_cart_scrm cs
+                          ON FIND_IN_SET(cs.id, REPLACE(pc.cart_ids, ' ', ''))
+                LEFT JOIN fs_store_product_scrm ps
+                          ON cs.product_id = ps.product_id
+                LEFT JOIN fs_store_scrm ss
+                          ON ss.store_id = ps.store_id
+                LEFT JOIN company_user cu ON pc.company_user_id = cu.user_id
+        WHERE
+            cs.is_del = 0
+            <if test="matchedProducts != null and matchedProducts != ''">
+               AND pc.id IN (
+                SELECT DISTINCT pc_sub.id
+                FROM fs_store_prepared_price_change pc_sub
+                LEFT JOIN fs_store_cart_scrm cs_sub
+                ON FIND_IN_SET(cs_sub.id, REPLACE(pc_sub.cart_ids, ' ', ''))
+                LEFT JOIN fs_store_product_scrm ps_sub
+                ON cs_sub.product_id = ps_sub.product_id
+                WHERE ps_sub.product_name LIKE CONCAT('%',#{matchedProducts},'%')
+                )
+            </if>
+            <if test="nickName != null and nickName != ''">
+                AND cu.nick_name LIKE CONCAT('%',#{nickName},'%')
+            </if>
+             <if test="auditStatus != null "> AND audit_status = #{auditStatus}</if>
+        GROUP BY
+            pc.id
+    </select>
+</mapper>

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/CompanyOrderScrmController.java

@@ -100,7 +100,7 @@ public class CompanyOrderScrmController extends AppBaseController {
         if (payAmount == null){
             payAmount = BigDecimal.ZERO;
         }
-        return orderService.updateSalseOrderMoney(createOrderKey,money,payAmount,payType);
+        return orderService.updateSalseOrderMoney(createOrderKey,money,payAmount,payType,userId);
     }
 
     @ApiOperation("商品改价")

+ 66 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/FsStorePreparedPriceChangeController.java

@@ -0,0 +1,66 @@
+package com.fs.app.controller.store;
+
+import com.fs.app.annotation.Login;
+import com.fs.hisStore.param.FsStorePreparedPriceChangeParam;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.company.domain.CompanyUser;
+import com.fs.company.service.ICompanyUserService;
+import com.fs.hisStore.domain.FsStorePreparedPriceChange;
+import com.fs.hisStore.service.IFsStorePreparedPriceChangeService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/shop/change")
+public class FsStorePreparedPriceChangeController {
+    @Autowired
+    public RedisCache redisCache;
+
+    @Autowired
+    private ICompanyUserService companyUserService;
+
+    @Autowired
+    private IFsStorePreparedPriceChangeService fsStorePreparedPriceChangeService;
+
+    /**
+     * 查询销售制单改价审核记录列表
+     */
+    @GetMapping("/list")
+    public R list(FsStorePreparedPriceChangeParam param) {
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        List<FsStorePreparedPriceChange> list = fsStorePreparedPriceChangeService.selectFsStorePreparedPriceChangeList(param);
+        PageInfo<FsStorePreparedPriceChange> listPageInfo=new PageInfo<>(list);
+        return R.ok().put("data",listPageInfo);
+    }
+
+    /**
+     * 分享制单
+     *
+     * @param param 参数
+     * @return R
+     **/
+    @Login
+    @ApiOperation("制单分享")
+    @PostMapping("/sharePrepare")
+    public R sharePrepare(@RequestBody FsStorePreparedPriceChangeParam param) {
+        Long userId = redisCache.getCacheObject("company-user-token:" + param.getToken());
+        if (userId == null) {
+            return R.error(403, "用户失效");
+        }
+        CompanyUser companyUser = companyUserService.selectCompanyUserById(userId);
+        if (companyUser == null || companyUser.getDelFlag().equals("1")) {
+            return R.error("用户不存在");
+        }
+        if (!companyUser.getStatus().equals("0")) {
+            return R.error("用户已禁用");
+        }
+
+        return fsStorePreparedPriceChangeService.sharePrepare(param.getId(), userId);
+    }
+}