Kaynağa Gözat

scrmMerge 商城系统代码合并

lmx 23 saat önce
ebeveyn
işleme
8c58411d02
100 değiştirilmiş dosya ile 4985 ekleme ve 7 silme
  1. 34 0
      fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java
  2. 29 0
      fs-service/src/main/java/com/fs/erp/domain/KbStockRequest.java
  3. 48 0
      fs-service/src/main/java/com/fs/erp/domain/KbStockResponse.java
  4. 91 0
      fs-service/src/main/java/com/fs/erp/service/impl/K9StockServiceImpl.java
  5. 13 0
      fs-service/src/main/java/com/fs/erp/utils/SignUtils.java
  6. 26 0
      fs-service/src/main/java/com/fs/erp/utils/UrlUtils.java
  7. 34 0
      fs-service/src/main/java/com/fs/his/config/FsErpConfig.java
  8. 7 0
      fs-service/src/main/java/com/fs/his/config/StoreConfig.java
  9. 28 0
      fs-service/src/main/java/com/fs/his/domain/FsStoreOrder.java
  10. 5 0
      fs-service/src/main/java/com/fs/his/domain/FsStoreOrderItem.java
  11. 1 1
      fs-service/src/main/java/com/fs/his/domain/FsStorePayment.java
  12. 4 4
      fs-service/src/main/java/com/fs/his/domain/FsStoreProductCategory.java
  13. 32 0
      fs-service/src/main/java/com/fs/his/domain/FsUser.java
  14. 9 0
      fs-service/src/main/java/com/fs/his/domain/FsUserAddress.java
  15. 69 0
      fs-service/src/main/java/com/fs/his/domain/FsUserBill.java
  16. 4 0
      fs-service/src/main/java/com/fs/his/mapper/FsAdvMapper.java
  17. 4 0
      fs-service/src/main/java/com/fs/his/mapper/FsArticleCateMapper.java
  18. 26 0
      fs-service/src/main/java/com/fs/his/mapper/FsArticleMapper.java
  19. 3 0
      fs-service/src/main/java/com/fs/his/mapper/FsCityMapper.java
  20. 25 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreAfterSalesMapper.java
  21. 6 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java
  22. 15 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreProductAttrValueMapper.java
  23. 17 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreProductCategoryMapper.java
  24. 77 0
      fs-service/src/main/java/com/fs/his/mapper/FsStoreProductMapper.java
  25. 7 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserAddressMapper.java
  26. 18 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserBillMapper.java
  27. 7 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java
  28. 2 0
      fs-service/src/main/java/com/fs/his/param/FsStoreOrderPayParam.java
  29. 3 0
      fs-service/src/main/java/com/fs/his/service/IFsAdvService.java
  30. 3 0
      fs-service/src/main/java/com/fs/his/service/IFsArticleCateService.java
  31. 4 0
      fs-service/src/main/java/com/fs/his/service/IFsArticleService.java
  32. 2 0
      fs-service/src/main/java/com/fs/his/service/IFsCityService.java
  33. 6 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreAfterSalesService.java
  34. 24 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java
  35. 6 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductAttrValueService.java
  36. 3 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductCategoryService.java
  37. 23 0
      fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java
  38. 3 0
      fs-service/src/main/java/com/fs/his/service/IFsUserAddressService.java
  39. 6 0
      fs-service/src/main/java/com/fs/his/service/IFsUserBillService.java
  40. 4 0
      fs-service/src/main/java/com/fs/his/service/IFsUserService.java
  41. 6 0
      fs-service/src/main/java/com/fs/his/service/impl/FsAdvServiceImpl.java
  42. 6 0
      fs-service/src/main/java/com/fs/his/service/impl/FsArticleCateServiceImpl.java
  43. 17 0
      fs-service/src/main/java/com/fs/his/service/impl/FsArticleServiceImpl.java
  44. 4 0
      fs-service/src/main/java/com/fs/his/service/impl/FsCityServiceImpl.java
  45. 22 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java
  46. 829 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java
  47. 14 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductAttrValueServiceImpl.java
  48. 4 1
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductCategoryServiceImpl.java
  49. 55 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java
  50. 5 0
      fs-service/src/main/java/com/fs/his/service/impl/FsUserAddressServiceImpl.java
  51. 32 0
      fs-service/src/main/java/com/fs/his/service/impl/FsUserBillServiceImpl.java
  52. 10 0
      fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java
  53. 15 0
      fs-service/src/main/java/com/fs/his/utils/ConfigUtil.java
  54. 2 1
      fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListUVO.java
  55. 16 0
      fs-service/src/main/java/com/fs/store/config/StoreIntegralConfig.java
  56. 24 0
      fs-service/src/main/java/com/fs/store/constants/StoreConstants.java
  57. 65 0
      fs-service/src/main/java/com/fs/store/domain/FsArticleViews.java
  58. 35 0
      fs-service/src/main/java/com/fs/store/domain/FsMenu.java
  59. 120 0
      fs-service/src/main/java/com/fs/store/domain/FsShippingTemplates.java
  60. 112 0
      fs-service/src/main/java/com/fs/store/domain/FsShippingTemplatesFree.java
  61. 138 0
      fs-service/src/main/java/com/fs/store/domain/FsShippingTemplatesRegion.java
  62. 131 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreActivity.java
  63. 109 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreCanvas.java
  64. 58 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreCart.java
  65. 192 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreCoupon.java
  66. 175 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreCouponIssue.java
  67. 81 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreCouponIssueUser.java
  68. 179 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreCouponUser.java
  69. 97 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreOrderStatus.java
  70. 78 0
      fs-service/src/main/java/com/fs/store/domain/FsStoreProductRelation.java
  71. 137 0
      fs-service/src/main/java/com/fs/store/domain/FsWechatTemplate.java
  72. 20 0
      fs-service/src/main/java/com/fs/store/dto/AppointInfoDTO.java
  73. 33 0
      fs-service/src/main/java/com/fs/store/dto/FsStoreOrderComputeDTO.java
  74. 22 0
      fs-service/src/main/java/com/fs/store/dto/FsStoreOrderPriceDTO.java
  75. 15 0
      fs-service/src/main/java/com/fs/store/dto/RegionDTO.java
  76. 34 0
      fs-service/src/main/java/com/fs/store/dto/RegionInfoDTO.java
  77. 21 0
      fs-service/src/main/java/com/fs/store/dto/TemplateDTO.java
  78. 44 0
      fs-service/src/main/java/com/fs/store/enums/OrderLogEnum.java
  79. 15 0
      fs-service/src/main/java/com/fs/store/enums/ShippingTempEnum.java
  80. 91 0
      fs-service/src/main/java/com/fs/store/mapper/FsArticleViewsMapper.java
  81. 62 0
      fs-service/src/main/java/com/fs/store/mapper/FsMenuMapper.java
  82. 90 0
      fs-service/src/main/java/com/fs/store/mapper/FsShippingTemplatesFreeMapper.java
  83. 65 0
      fs-service/src/main/java/com/fs/store/mapper/FsShippingTemplatesMapper.java
  84. 70 0
      fs-service/src/main/java/com/fs/store/mapper/FsShippingTemplatesRegionMapper.java
  85. 69 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreActivityMapper.java
  86. 65 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreCanvasMapper.java
  87. 96 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreCartMapper.java
  88. 134 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponIssueMapper.java
  89. 66 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponIssueUserMapper.java
  90. 67 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponMapper.java
  91. 105 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponUserMapper.java
  92. 62 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreOrderStatusMapper.java
  93. 94 0
      fs-service/src/main/java/com/fs/store/mapper/FsStoreProductRelationMapper.java
  94. 70 0
      fs-service/src/main/java/com/fs/store/mapper/FsWechatTemplateMapper.java
  95. 13 0
      fs-service/src/main/java/com/fs/store/param/FsArticleQueryParam.java
  96. 10 0
      fs-service/src/main/java/com/fs/store/param/FsArticleViewListParam.java
  97. 12 0
      fs-service/src/main/java/com/fs/store/param/FsArticleViewListQueryParam.java
  98. 16 0
      fs-service/src/main/java/com/fs/store/param/FsCouponIssueParam.java
  99. 16 0
      fs-service/src/main/java/com/fs/store/param/FsCouponUserEnableParam.java
  100. 12 0
      fs-service/src/main/java/com/fs/store/param/FsCouponUserParam.java

+ 34 - 0
fs-common/src/main/java/com/fs/common/utils/http/HttpUtils.java

@@ -16,6 +16,14 @@ import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import com.fs.common.constant.Constants;
@@ -259,4 +267,30 @@ public class HttpUtils
             return true;
         }
     }
+    /**
+     * json request
+     *
+     * @param url
+     * @param json
+     * @return
+     */
+    public static String doPost(String url, String json) {
+        CloseableHttpClient httpclient = HttpClientBuilder.create().build();
+        HttpPost post = new HttpPost(url);
+        String response = null;
+        try {
+            StringEntity s = new StringEntity(json,"UTF-8");
+//			s.setContentEncoding("UTF-8");
+            // 发送json数据需要设置contentType
+            s.setContentType("application/json");
+            post.setEntity(s);
+            HttpResponse res = httpclient.execute(post);
+            if (res.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
+                response = EntityUtils.toString(res.getEntity());// 返回json格式:
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return response;
+    }
 }

+ 29 - 0
fs-service/src/main/java/com/fs/erp/domain/KbStockRequest.java

@@ -0,0 +1,29 @@
+package com.fs.erp.domain;
+
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Builder;
+import lombok.Data;
+
+@Data
+@Builder
+public class KbStockRequest {
+
+    /**
+     * 单据ID
+     */
+    @JSONField(name = "key", ordinal = 1)
+    @Builder.Default
+    private String key = "GoodStock";
+
+    /**
+     * 仓库编码
+     */
+    @JSONField(name = "ckid", ordinal = 2)
+    private String stockCode;
+
+    /**
+     * 商品编码 【注:不传值,默认查询对应仓库所有商品库存;传值查询对应商品库存。传值格式为:商品编码+英文逗号。如:123,456,789】
+     */
+    @JSONField(name = "cgoodsid", ordinal = 3)
+    private String goodsCode;
+}

+ 48 - 0
fs-service/src/main/java/com/fs/erp/domain/KbStockResponse.java

@@ -0,0 +1,48 @@
+package com.fs.erp.domain;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.annotation.JSONField;
+import lombok.Data;
+
+@Data
+public class KbStockResponse {
+
+    /**
+     * true:请求成功;false:请求失败;
+     */
+    @JSONField(name = "IsSuccess")
+    private Boolean success;
+
+    /**
+     * 提示消息
+     */
+    @JSONField(name = "errmsg")
+    private String msg;
+
+    /**
+     * 返回数据
+     */
+    @JSONField(name = "data")
+    private String data;
+
+    /**
+     * 库存
+     */
+    private Integer stock;
+
+    public Integer getStock() {
+        int stocks = 0;
+        JSONArray dataArray = JSON.parseArray(this.data);
+        for (int i = 0; i < dataArray.size(); i++) {
+            JSONObject base = dataArray.getJSONObject(i);
+            for (Object item : base.getJSONArray("base")) {
+                JSONObject json = (JSONObject) item;
+                stocks += json.getIntValue("fqty");
+            }
+        }
+
+        return stocks;
+    }
+}

+ 91 - 0
fs-service/src/main/java/com/fs/erp/service/impl/K9StockServiceImpl.java

@@ -0,0 +1,91 @@
+package com.fs.erp.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.exception.CustomException;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.StringUtils;
+import com.fs.common.utils.http.HttpUtils;
+import com.fs.erp.domain.ErpGoods;
+import com.fs.erp.domain.ErpGoodsStock;
+import com.fs.erp.domain.KbStockRequest;
+import com.fs.erp.domain.KbStockResponse;
+import com.fs.erp.dto.*;
+import com.fs.erp.service.IErpGoodsService;
+import com.fs.erp.utils.SignUtils;
+import com.fs.erp.utils.UrlUtils;
+import com.fs.his.config.FsErpConfig;
+import com.fs.his.config.FsSysConfig;
+import com.fs.his.utils.ConfigUtil;
+import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+
+@Service
+@Slf4j
+@AllArgsConstructor
+public class K9StockServiceImpl implements IErpGoodsService {
+
+    @Autowired
+    private ConfigUtil configUtil;
+
+    @Override
+    public BaseResponse addGoods(ErpGoods goods) {
+        return null;
+    }
+
+    @Override
+    public ErpGoodsQueryResponse getGoods(ErpGoodsQueryRequert param) {
+        return null;
+    }
+
+    @Override
+    public ErpGoodsStockQueryResponse getGoodsStock(ErpGoodsStockQueryRequert param) {
+        String barcode = param.getBarcode();
+        KbStockRequest request = KbStockRequest.builder().goodsCode(barcode).build();
+        KbStockResponse kbStockResponse = getStock(request);
+        ErpGoodsStockQueryResponse response = new ErpGoodsStockQueryResponse();
+
+        if(kbStockResponse.getSuccess()){
+            ArrayList<ErpGoodsStock> erpGoodsStocks = new ArrayList<>();
+            ErpGoodsStock erpGoodsStock = new ErpGoodsStock();
+            Integer stocks = kbStockResponse.getStock();
+            erpGoodsStock.setBarcode(barcode);
+            erpGoodsStock.setQty(stocks.toString());
+            erpGoodsStock.setSalable_qty(stocks.toString());
+            erpGoodsStocks.add(erpGoodsStock);
+            response.setStocks(erpGoodsStocks);
+        } else {
+            throw new CustomException("库存不足");
+        }
+        return response;
+    }
+
+    /**
+     * 查看库存
+     * @param request 参数
+     * @return  KbStockResponse
+     * @throws ServiceException 异常
+     */
+    private KbStockResponse getStock(KbStockRequest request) throws ServiceException {
+        FsErpConfig erpConfig = configUtil.getErpConfig();
+        // 构造参数
+        String timeStep = System.currentTimeMillis() + "";
+        if (StringUtils.isBlank(request.getStockCode())) {
+            request.setStockCode(erpConfig.getCwarehouseCode());
+        }
+        String json = JSON.toJSONString(request);
+        String sign = SignUtils.sign(json, erpConfig.getKingbosSecret(), erpConfig.getKingbosan(), timeStep);
+        String url = erpConfig.getKingbosUrl().replace("do=k9save", "do=k9view");
+        url = UrlUtils.getUrl(url, sign, timeStep);
+
+        // 发送请求
+        log.info("\n【金博网络】: getStock send request url: {}", url);
+        String result = HttpUtils.doPost(url, json);
+        log.info("\n【金博网络】: getStock res:{}", result);
+        return JSONObject.parseObject(result, KbStockResponse.class);
+    }
+}

+ 13 - 0
fs-service/src/main/java/com/fs/erp/utils/SignUtils.java

@@ -0,0 +1,13 @@
+
+package com.fs.erp.utils;
+
+
+import com.fs.ad.yk.utils.Md5Util;
+
+public class SignUtils {
+
+    public static String sign(String data, String secret, String name, String timestamp) {
+        String enValue = "kingbos" + secret + timestamp + name + "zy01" + data;
+        return Md5Util.MD5(enValue);
+    }
+}

+ 26 - 0
fs-service/src/main/java/com/fs/erp/utils/UrlUtils.java

@@ -0,0 +1,26 @@
+package com.fs.erp.utils;
+
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+
+public class UrlUtils {
+    public static String getUrl(String url, String sign, String timeStep) {
+        String updatedUrl = updateURLParams(url, "timestep", timeStep);
+        updatedUrl = updateURLParams(updatedUrl, "sign", sign);
+        return updatedUrl;
+    }
+
+    public static String updateURLParams(String url, String param, String value) {
+        String encodedValue;
+        try {
+            encodedValue = URLEncoder.encode(value, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            encodedValue = value;
+            e.printStackTrace();
+        }
+
+        return url.replaceAll(param + "=", param + "=" + encodedValue);
+    }
+}

+ 34 - 0
fs-service/src/main/java/com/fs/his/config/FsErpConfig.java

@@ -0,0 +1,34 @@
+package com.fs.his.config;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class FsErpConfig {
+    //不推送erp的公司id
+    List<Long> noErpCompany;
+    //erp接口
+    Integer erpOpen;//是否开启ERP
+    Integer erpType;//1:管易 2:旺店通 3:金博
+    //管易
+    String erpAppKey;
+    String erpSessionKey;
+    String erpSecret;
+    String erpUrl;
+    String erpShopCode;//店铺CODE
+    //erp旺店通
+    String erpWdAppKey;
+    String erpWdAppsecret;
+    String erpWdSid;
+    String erpWdShopCode;
+    String erpWdBaseUrl;
+    String erpWarehouseCode;
+    //金博
+    String kingbosan;//账套名称
+    String kingbosSecret;//金博密钥
+    String kingbosUrl;//金博地址
+    String corgid;//机构编码
+    String cwarehouseCode;
+    String cwarehouseName;
+}

+ 7 - 0
fs-service/src/main/java/com/fs/his/config/StoreConfig.java

@@ -3,6 +3,7 @@ package com.fs.his.config;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 @Data
 public class StoreConfig implements Serializable {
@@ -19,4 +20,10 @@ public class StoreConfig implements Serializable {
     private String refundAddress;
     private Integer storeCall;
 
+    private String hotSearch;//热门搜索
+    private String certs;//资质证书
+    private BigDecimal serviceFee;//服务费
+    private Integer salesPriceRate;//成本售价比例
+    private Integer payAmount;//货到付款自定义金额
+
 }

+ 28 - 0
fs-service/src/main/java/com/fs/his/domain/FsStoreOrder.java

@@ -265,4 +265,32 @@ public class FsStoreOrder extends BaseEntity
     private Integer source;
     private BigDecimal billPrice;
 
+    //todo 以下为新增字段
+    private Integer isEditMoney;
+    /** 邮费 */
+    private BigDecimal totalPostage;
+
+    /** 支付邮费 */
+    private BigDecimal payPostage;
+
+    /** 实际支付积分 */
+    @Excel(name = "实际支付积分")
+    private BigDecimal payIntegral;
+
+
+    /** 给用户退了多少积分 */
+    private BigDecimal backIntegral;
+
+    /** 消费赚取积分 */
+    private BigDecimal gainIntegral;
+
+    /** 使用积分 */
+    @Excel(name = "使用积分")
+    private BigDecimal useIntegral;
+    //服务费
+    private BigDecimal serviceFee;
+
+    //返给前端使用的id 不需要添加到表
+    private Long id;
+
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/domain/FsStoreOrderItem.java

@@ -59,4 +59,9 @@ public class FsStoreOrderItem extends BaseEntity
     private Integer isGift;
 
     private Integer isDrug;
+
+    //todo 以下为新增字段
+    /** 订单号 */
+    @Excel(name = "订单号")
+    private String orderCode;
 }

+ 1 - 1
fs-service/src/main/java/com/fs/his/domain/FsStorePayment.java

@@ -52,7 +52,7 @@ public class FsStorePayment extends BaseEntity
     private String openId;
 
     /** 业务类型  */
-    @Excel(name = "业务类型 1问诊 ")
+    @Excel(name = "业务类型 1问诊 2商城")
     private Integer businessType;
 
     /** 关联业务ID */

+ 4 - 4
fs-service/src/main/java/com/fs/his/domain/FsStoreProductCategory.java

@@ -37,10 +37,10 @@ public class FsStoreProductCategory extends BaseEntity
     /** 是否推荐 */
     @Excel(name = "是否推荐")
     private Integer isShow;
-
+    //删除状态 以前为string 表里面为int
     /** 删除状态 */
     @Excel(name = "删除状态")
-    private String isDel;
+    private Integer isDel;
 
     public void setCateId(Long cateId) 
     {
@@ -96,12 +96,12 @@ public class FsStoreProductCategory extends BaseEntity
     {
         return isShow;
     }
-    public void setIsDel(String isDel) 
+    public void setIsDel(Integer isDel)
     {
         this.isDel = isDel;
     }
 
-    public String getIsDel() 
+    public Integer getIsDel()
     {
         return isDel;
     }

+ 32 - 0
fs-service/src/main/java/com/fs/his/domain/FsUser.java

@@ -1,8 +1,10 @@
 package com.fs.his.domain;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.StringUtils;
 import com.vdurmont.emoji.EmojiParser;
 import lombok.Data;
@@ -146,6 +148,36 @@ public class FsUser extends BaseEntity
 
     private Long qwExtId;
 
+    private String statusText;
+
+    /** 等级 */
+    private Integer level;
+
+    /** 推广上级用户ID */
+    private Long spreadUserId;
+
+    // 企微重粉
+    private Integer qwRepeat;
+    // 小程序(看课)重粉
+    private Integer userRepeat;
+    // 是否已购0 否 1程序内下单 2程序外下单
+    private Integer payOrder;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @TableField(exist = false)
+    private Date startCreateTime;
+
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date endCreateTime;
+
+    @TableField(exist = false)
+    private String companyUserNickName;
+
+    @ApiModelProperty(value = "所属公司")
+    @Excel(name = "所属公司", sort = 9)
+    private String companyName;
+
     /**
      * 企微销售ID
      * **/

+ 9 - 0
fs-service/src/main/java/com/fs/his/domain/FsUserAddress.java

@@ -70,6 +70,8 @@ public class FsUserAddress extends BaseEntity
     @Excel(name = "是否删除")
     private Integer isDel;
 
+    private Long id;
+
     public void setAddressId(Long addressId) 
     {
         this.addressId = addressId;
@@ -198,4 +200,11 @@ public class FsUserAddress extends BaseEntity
     }
 
 
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
 }

+ 69 - 0
fs-service/src/main/java/com/fs/his/domain/FsUserBill.java

@@ -43,6 +43,27 @@ public class FsUserBill extends BaseEntity
     @Excel(name = "关联ID")
     private String businessId;
 
+    /** 用户账单id */
+    private Long id;
+
+    /** 明细分类  */
+    @Excel(name = "明细分类 ")
+    private String category;
+
+    /** 明细类型 */
+    @Excel(name = "明细类型")
+    private String type;
+
+    /** 明细数字 */
+    @Excel(name = "明细数字")
+    private Double number;
+
+    /** 0 = 带确定 1 = 有效 -1 = 无效 */
+    @Excel(name = "0 = 带确定 1 = 有效 -1 = 无效")
+    private Integer status;
+
+    private Long tuiUserId;
+
     public void setBillId(Long billId) 
     {
         this.billId = billId;
@@ -121,4 +142,52 @@ public class FsUserBill extends BaseEntity
             .append("businessId", getBusinessId())
             .toString();
     }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Double getNumber() {
+        return number;
+    }
+
+    public void setNumber(Double number) {
+        this.number = number;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getTuiUserId() {
+        return tuiUserId;
+    }
+
+    public void setTuiUserId(Long tuiUserId) {
+        this.tuiUserId = tuiUserId;
+    }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/mapper/FsAdvMapper.java

@@ -3,6 +3,7 @@ package com.fs.his.mapper;
 import java.util.List;
 import com.fs.his.domain.FsAdv;
 import com.fs.his.param.FsAdvUParam;
+import com.fs.store.vo.FsAdvListQueryVO;
 import org.apache.ibatis.annotations.Select;
 
 /**
@@ -77,4 +78,7 @@ public interface FsAdvMapper
             "    order by status desc,sort,adv_id desc "+
             "</script>"})
     List<FsAdv> selectFsAdvListUVO(FsAdvUParam map);
+
+    @Select("select * from fs_adv where adv_type=#{advType} and status=1 order by sort desc")
+    List<FsAdvListQueryVO> selectFsAdvListQuery(Integer advType);
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/mapper/FsArticleCateMapper.java

@@ -3,6 +3,7 @@ package com.fs.his.mapper;
 import java.util.List;
 import com.fs.his.domain.FsArticleCate;
 import com.fs.his.vo.OptionsVO;
+import com.fs.store.vo.FsArticleCateListQueryVO;
 import org.apache.ibatis.annotations.Select;
 
 /**
@@ -65,4 +66,7 @@ public interface FsArticleCateMapper
     List<OptionsVO> selectFsArticleCateAllList();
     @Select("select * FROM fs_article_cate where is_del=0")
     List<FsArticleCate> selectFsArticleCateAllListVO();
+
+    @Select("select * from fs_article_cate where status=1 and is_del=0 order by sort asc " )
+    List<FsArticleCateListQueryVO> selectFsArticleCateListQuery();
 }

+ 26 - 0
fs-service/src/main/java/com/fs/his/mapper/FsArticleMapper.java

@@ -6,6 +6,8 @@ import com.fs.his.param.FsArticleListUParam;
 import com.fs.his.vo.FsArticleListUVO;
 import com.fs.his.vo.FsArticleListVO;
 import com.fs.his.vo.FsArticleVO;
+import com.fs.store.param.FsArticleQueryParam;
+import com.fs.store.vo.FsArticleListQueryVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -102,4 +104,28 @@ public interface FsArticleMapper
             "</script>"})
 
     List<FsArticleListVO> selectFsArticleListVO(FsArticle fsArticle);
+
+    @Update("update fs_article set views=views+1  where article_id=#{articleId}")
+    Integer updateViews(Long articleId);
+
+
+    @Select({"<script> " +
+            "select a.* from fs_article a  " +
+            "where 1=1 " +
+            "<if test = 'maps.isTui != null    '> " +
+            "and a.is_tui =#{maps.isTui} " +
+            "</if>" +
+            "<if test = 'maps.cateId != null and maps.cateId != 0    '> " +
+            "and a.cate_id =#{maps.cateId} " +
+            "</if>" +
+            "<if test = 'maps.keyword != null and maps.keyword != \"\"    '> " +
+            "and a.title like concat('%', #{maps.keyword}, '%') " +
+            "</if>" +
+            " order by a.sort desc "+
+            "<if test = 'maps.limit != null    '> " +
+            "limit #{maps.limit} " +
+            "</if>" +
+            "</script>"})
+    List<FsArticleListQueryVO> selectFsArticleListQuery(@Param("maps") FsArticleQueryParam param);
+
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/mapper/FsCityMapper.java

@@ -73,4 +73,7 @@ public interface FsCityMapper
     @Select("SELECT city_id,city_name FROM fs_city where parent_id=0 ")
     List<CitysAreaVO> getCitysArea();
 
+    @Select("select * from fs_city")
+    List<FsCity> selectFsCitys();
+
 }

+ 25 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreAfterSalesMapper.java

@@ -7,6 +7,8 @@ import com.fs.his.domain.FsStoreAfterSalesLogs;
 import com.fs.his.param.FsStoreAfterSalesListUParam;
 import com.fs.his.param.FsStoreAfterSalesParam;
 import com.fs.his.vo.*;
+import com.fs.store.param.FsStoreAfterSalesQueryParam;
+import com.fs.store.vo.FsStoreAfterSalesQueryVO;
 import lombok.Data;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -238,4 +240,27 @@ public interface FsStoreAfterSalesMapper
             " order by so.id desc "+
             "</script>"})
     Long selectFsStoreAfterSalesExcelListVOCount(@Param("maps") FsStoreAfterSalesParam fsStoreAfterSales);
+
+    @Select({"<script> " +
+            "select ifnull(count(1),0) from fs_store_after_sales   " +
+            "where user_id=#{userId}  and sales_status =#{salesStatus} " +
+            "</script>"})
+    Integer selectFsStoreAfterSalesCount(@Param("userId")long userId, @Param("salesStatus")int salesStatus);
+
+    @Select({"<script> " +
+            "select *  from fs_store_after_sales  " +
+            "where 1=1 " +
+            "<if test = 'maps.status != null and maps.status ==1   '> " +
+            "and sales_status = 0 " +
+            "</if>" +
+            "<if test = 'maps.status != null and maps.status ==2   '> " +
+            "and sales_status = 3 " +
+            "</if>" +
+            "<if test = 'maps.userId != null    '> " +
+            "and user_id = #{maps.userId} " +
+            "</if>" +
+            "order by create_time desc "+
+            "</script>"})
+    List<FsStoreAfterSalesQueryVO>  selectFsStoreAfterSalesListQuery(@Param("maps") FsStoreAfterSalesQueryParam storeAfterSalesParam);
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -1081,4 +1081,10 @@ public interface FsStoreOrderMapper
             "</if>" +
             "</script>"})
     Integer selectFsStoreOrderCountByType(@Param("companyId") Long companyId,@Param("userId") long userId, @Param("type")int type);
+
+    @Select({"<script> " +
+            "select ifnull(count(1),0) from fs_store_order o  " +
+            "where o.user_id=#{userId}  and o.status =#{status} " +
+            "</script>"})
+    int selectFsStoreOrderCount(@Param("userId")long userId,@Param("status")int status);
 }

+ 15 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreProductAttrValueMapper.java

@@ -5,6 +5,8 @@ import com.fs.his.domain.FsStoreProductAttr;
 import com.fs.his.domain.FsStoreProductAttrValue;
 import com.fs.his.param.FsStoreProductAttrValueListDParam;
 import com.fs.his.vo.FsStoreProductAttrValueListDVO;
+import com.fs.store.param.FsStoreProductAttrValueQueryParam;
+import com.fs.store.vo.FsStoreProductAttrValueQueryVO;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -155,4 +157,17 @@ public interface FsStoreProductAttrValueMapper
     @Select("    select id,doctor_brokerage, product_id, sku, stock, sales, price, image, cost_price cost, bar_code, ot_price, weight, volume, brokerage, brokerage_two,brokerage_three,give_integral  from fs_store_product_attr_value\n" +
             "    where  product_id=#{productId}")
     List<FsStoreProductAttrValue> selectFsStoreProductAttrValueVOByProductId(Long productId);
+
+    @Select({"<script> " +
+            "select v.*,p.product_name from fs_store_product_attr_value v inner join fs_store_product p on p.product_id=v.product_id    " +
+            "where p.is_show=1 and p.is_display=1 and (v.brokerage &gt;0 || v.brokerage_two &gt;0) " +
+            "<if test = 'maps.productName != null and  maps.productName !=\"\"    '> " +
+            "and p.product_name like CONCAT('%',#{maps.productName},'%') " +
+            "</if>" +
+            "<if test = 'maps.tuiCateId != null and maps.tuiCateId !=0    '> " +
+            "and p.tui_cate_id =#{maps.tuiCateId} " +
+            "</if>" +
+            " order by v.id desc "+
+            "</script>"})
+    List<FsStoreProductAttrValueQueryVO> selectStoreProductAttrValueListQuery(@Param("maps") FsStoreProductAttrValueQueryParam param);
 }

+ 17 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreProductCategoryMapper.java

@@ -5,6 +5,7 @@ import com.fs.his.domain.FsStoreProductCategory;
 import com.fs.his.vo.FsStoreProductCategoryVO;
 import com.fs.his.vo.FsStoreProductCategorysVO;
 import com.fs.his.vo.OptionsVO;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 /**
@@ -84,4 +85,20 @@ public interface FsStoreProductCategoryMapper
     List<FsStoreProductCategorysVO> selectFsStoreProductCategorysVOList();
     @Select("select * from fs_store_product_category where pid=0")
     List<FsStoreProductCategory> getPid();
+
+    @Select({"<script> " +
+            "select c.* from fs_store_product_category c " +
+            "where 1=1 " +
+            "<if test = 'maps.isDel != null    '> " +
+            "and c.is_del=#{maps.isDel} " +
+            "</if>" +
+            "<if test = 'maps.isShow != null    '> " +
+            "and c.is_show =#{maps.isShow} " +
+            "</if>" +
+            "<if test = 'maps.pid != null    '> " +
+            "and c.pid =#{maps.pid} " +
+            "</if>" +
+            " order by c.sort asc "+
+            "</script>"})
+    List<FsStoreProductCategory> selectFsStoreProductCategoryListQuery(@Param("maps")FsStoreProductCategory param);
 }

+ 77 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreProductMapper.java

@@ -6,6 +6,10 @@ import com.fs.his.domain.FsStoreProductRule;
 import com.fs.his.param.FsProductAttrValueParam;
 import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.vo.*;
+import com.fs.store.param.FsStoreProductQueryParam;
+import com.fs.store.vo.FsStoreProductActivityListVO;
+import com.fs.store.vo.FsStoreProductListQueryVO;
+import com.fs.store.vo.FsStoreProductQueryVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Update;
@@ -247,4 +251,77 @@ public interface FsStoreProductMapper
             "</if>" +
             "</script>"})
     Long selectFsStoreProductCount(int type);
+
+    @Select("select *, img_url as image from fs_store_product where is_del=0 and is_show=1 and  is_new=1 and is_display=1 order by sort desc limit #{count}")
+    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count);
+
+    @Select("select *, img_url as image from fs_store_product where is_del=0 and is_show=1 and  is_hot=1 and is_display=1 order by sort desc limit #{count}")
+    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count);
+
+    @Select({"<script> " +
+            "select * from fs_store_product where find_in_set(product_id,#{ids})  " +
+            "</script>"})
+    List<FsStoreProductActivityListVO> selectFsStoreProductByIds(@Param("ids")String productIds);
+
+    @Update("update fs_store_product p set stock=(select sum(stock) from fs_store_product_attr_value where product_id=#{productId}) where product_id=#{productId}  ")
+    Integer updateStock(Long productId);
+
+    @Select({"<script> " +
+            "select p.*,p.img_url as image,p.cost_price as cost from fs_store_product p  " +
+            "where is_del=0 and is_show=1  " +
+            "<if test = 'maps.productName != null and  maps.productName !=\"\"    '> " +
+            "and (p.product_name like CONCAT('%',#{maps.productName},'%')  or p.keyword like concat('%',#{maps.productName},'%') ) " +
+            "</if>" +
+            "<if test = 'maps.isDisplay != null and maps.isDisplay == 1   '> " +
+            "and p.is_display =#{maps.isDisplay}  " +
+            "</if>" +
+            "<if test = 'maps.companyId != null'> " +
+            "and find_in_set(#{maps.companyId}, p.company_ids) " +
+            "</if>" +
+            "<if test = 'maps.cateId != null    '> " +
+            "and p.cate_id =#{maps.cateId}  " +
+            "</if>" +
+            "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
+            "order by p.sort desc " +
+            "</if>" +
+            "<if test = 'maps.priceOrder != null and maps.priceOrder==\"desc\"   '> " +
+            "order by p.price desc " +
+            "</if>" +
+            "<if test = 'maps.priceOrder != null and maps.priceOrder==\"asc\"   '> " +
+            "order by p.price asc " +
+            "</if>" +
+            "<if test = 'maps.salesOrder != null  and maps.salesOrder==\"desc\" '> " +
+            "order by p.sales desc " +
+            "</if>" +
+            "<if test = 'maps.salesOrder != null  and maps.salesOrder==\"asc\" '> " +
+            "order by p.sales asc " +
+            "</if>" +
+            "<if test = 'maps.newOrder != null and maps.newOrder==\"desc\" '> " +
+            "and p.is_new =1 order by p.create_time desc  " +
+            "</if>" +
+            "</script>"})
+    List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(@Param("maps") FsStoreProductQueryParam param);
+
+    @Select({"<script> " +
+            "select p.*,p.img_url as image,p.images as sliderImage,p.desc as description,p.product_introduce as productInfo from fs_store_product p  " +
+            "where is_del=0 and is_show=1 and product_id=#{productId} " +
+            "</script>"})
+    FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId);
+
+    @Select("select *,img_url as image,cost_price as cost from fs_store_product where is_del=0 and is_show=1 and  is_best=1 and is_display=1 order by sort desc limit #{count}")
+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiQuery(int count);
+
+    @Select("select *,img_url as image,cost_price as cost from fs_store_product where is_del=0 and is_show=1 and  is_good=1 and is_display=1 order by sort desc limit #{count}")
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count);
+
+    @Select("select *,img_url as image,cost_price as cost from fs_store_product where is_del=0 and is_show=1 and  is_best=1 and is_display=1 order by sort desc")
+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery();
+
+    @Select("select *,img_url as image,cost_price as cost from fs_store_product where is_del=0 and is_show=1 and  is_good=1 and is_display=1 order by sort desc")
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery();
+
+    @Update("update fs_store_product set stock=stock-#{num}, sales=sales+#{num}" +
+            " where product_id=#{productId} and stock >= #{num}")
+    int decProductAttrStock(@Param("productId")Long productId, @Param("num")Integer cartNum);
+
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserAddressMapper.java

@@ -91,4 +91,11 @@ public interface FsUserAddressMapper
             "            <if test=\"isDefault != null \"> and is_default = #{isDefault}</if>" +
             "</script>"})
     Long selectFsUserAddressListCount(FsUserAddress fsUserAddress);
+
+    @Select("select * from fs_user_address where user_id=#{uid} and is_default=1 and is_del=0 limit 1")
+    FsUserAddress selectFsUserAddressByDefaultAddress(long uid);
+
+    @Update(" update fs_user_address set is_del=1 where user_id = #{userId}")
+    Integer delAllAddress(Long userId);
+
 }

+ 18 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserBillMapper.java

@@ -3,6 +3,8 @@ package com.fs.his.mapper;
 import com.fs.his.domain.FsUserBill;
 import com.fs.his.param.FsUserBillParam;
 import com.fs.his.vo.FsUserBillVO;
+import com.fs.store.param.FsUserBillQueryParam;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
@@ -81,4 +83,20 @@ public interface FsUserBillMapper
             "        order by bill_id desc"+
             "</script>"})
     List<FsUserBillVO> selectFsUserBillListVO(FsUserBillParam fsUserBill);
+
+    @Select({"<script> " +
+            "select * from fs_user_bill " +
+            "where 1=1 " +
+            "<if test = 'maps.billType != null and maps.billType != -1    '> " +
+            "and bill_type =#{maps.billType} " +
+            "</if>" +
+            "<if test = 'maps.userId != null  '> " +
+            "and user_id =#{maps.userId} " +
+            "</if>" +
+            "<if test = 'maps.category != null and maps.category  != \"\"  '> " +
+            "and category =#{maps.category} " +
+            "</if>" +
+            " order by id desc "+
+            "</script>"})
+    List<FsUserBill> selectFsUserBillListQuery(@Param("maps") FsUserBillQueryParam param);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/mapper/FsUserMapper.java

@@ -334,4 +334,11 @@ public interface FsUserMapper
     CompanyUserSummaryCountVO companyUserCount(@Param("companyUserId") String companyUserId);
 
     CompanyUserSummaryCountVO newUserRedPacketCount(@Param("companyUserId") String companyUserId);
+
+    @Select("select * from fs_user where ma_open_id=#{openid}")
+    FsUser selectFsUserByMaOpenId(String openid);
+
+    @Update("update fs_user set integral=integral-#{integral}" +
+            " where user_id=#{uid}")
+    int decIntegral(@Param("uid") Long uid, @Param("integral")double integral);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/FsStoreOrderPayParam.java

@@ -13,4 +13,6 @@ public class FsStoreOrderPayParam   implements Serializable {
     Long userCouponId;
     String remark;
     Long userId;
+    //todo 后续接入支付类型
+    private Integer payType;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/service/IFsAdvService.java

@@ -4,6 +4,7 @@ import java.util.List;
 import com.fs.his.domain.FsAdv;
 import com.fs.his.param.FsAdvUParam;
 import com.fs.his.vo.FsAdvUVO;
+import com.fs.store.vo.FsAdvListQueryVO;
 
 /**
  * 广告Service接口
@@ -65,4 +66,6 @@ public interface IFsAdvService
 
     List<FsAdv> selectFsAdvListUVO(FsAdvUParam map);
 
+    List<FsAdvListQueryVO> selectFsAdvListQuery(Integer advType);
+
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/service/IFsArticleCateService.java

@@ -3,6 +3,7 @@ package com.fs.his.service;
 import java.util.List;
 import com.fs.his.domain.FsArticleCate;
 import com.fs.his.vo.OptionsVO;
+import com.fs.store.vo.FsArticleCateListQueryVO;
 
 /**
  * 文章分类Service接口
@@ -64,4 +65,6 @@ public interface IFsArticleCateService
 
     List<FsArticleCate> selectFsArticleCateAllListVO();
 
+    List<FsArticleCateListQueryVO> selectFsArticleCateListQuery();
+
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/service/IFsArticleService.java

@@ -6,6 +6,8 @@ import com.fs.his.param.FsArticleListUParam;
 import com.fs.his.vo.FsArticleListUVO;
 import com.fs.his.vo.FsArticleListVO;
 import com.fs.his.vo.FsArticleVO;
+import com.fs.store.param.FsArticleQueryParam;
+import com.fs.store.vo.FsArticleListQueryVO;
 
 /**
  * 文章Service接口
@@ -68,4 +70,6 @@ public interface IFsArticleService
     int updateFsArticleViews(Long articleId);
 
     List<FsArticleListVO> selectFsArticleListVO(FsArticle fsArticle);
+
+    List<FsArticleListQueryVO> selectFsArticleListQuery(FsArticleQueryParam param);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/service/IFsCityService.java

@@ -67,4 +67,6 @@ public interface IFsCityService
 
     List<CitysAreaVO> getCitysArea();
 
+    List<FsCity> selectFsCitys();
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreAfterSalesService.java

@@ -8,6 +8,8 @@ import com.fs.his.domain.FsStoreAfterSalesItem;
 import com.fs.his.domain.FsStoreAfterSalesLogs;
 import com.fs.his.param.*;
 import com.fs.his.vo.*;
+import com.fs.store.param.FsStoreAfterSalesQueryParam;
+import com.fs.store.vo.FsStoreAfterSalesQueryVO;
 
 /**
  * 售后记录Service接口
@@ -100,4 +102,8 @@ public interface IFsStoreAfterSalesService
     Long selectFsStoreAfterSalesExcelListVOCount(FsStoreAfterSalesParam fsStoreAfterSales);
 
     void exportData(FsStoreAfterSalesParam fsStoreAfterSales);
+
+    Integer selectFsStoreAfterSalesCount(long userId, int salesStatus);
+
+    List<FsStoreAfterSalesQueryVO> selectFsStoreAfterSalesListQuery(FsStoreAfterSalesQueryParam storeAfterSalesParam);
 }

+ 24 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreOrderService.java

@@ -1,11 +1,13 @@
 package com.fs.his.service;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.util.List;
 import java.util.Map;
 
 import com.alibaba.fastjson.JSONObject;
 import com.fs.common.core.domain.R;
+import com.fs.company.domain.CompanyUser;
 import com.fs.company.param.FsStoreStatisticsParam;
 import com.fs.company.vo.FsStoreOrderStatisticsVO;
 import com.fs.company.vo.FsStoreProductStatisticsVO;
@@ -16,6 +18,10 @@ import com.fs.his.dto.ExpressResultDTO;
 import com.fs.his.dto.StoreOrderExpressExportDTO;
 import com.fs.his.param.*;
 import com.fs.his.vo.*;
+import com.fs.store.dto.FsStoreOrderComputeDTO;
+import com.fs.store.param.FsStoreConfirmOrderParam;
+import com.fs.store.param.FsStoreOrderComputedParam;
+import com.fs.store.param.FsStoreOrderCreateParam;
 
 /**
  * 订单Service接口
@@ -211,4 +217,22 @@ public interface IFsStoreOrderService
     ErpOrder getErpOrder(FsStoreOrder order) throws ParseException;
 
     Integer selectFsStoreOrderCountByType(Long companyId, long l, int i);
+
+    Integer selectFsStoreOrderCount(long userId, int status);
+
+    R createSalesOrder(CompanyUser companyUser, String cateIds);
+
+    R updateSalseOrderMoney(String createOrderKey, BigDecimal money, BigDecimal payAmount);
+
+    R getSalesOrder(String createOrderKey);
+
+    R addUserCart(long userId, String createOrderKey);
+
+    R confirmOrder(long uid, FsStoreConfirmOrderParam cartParam);
+
+    FsStoreOrderComputeDTO computedOrder(long parseLong, FsStoreOrderComputedParam param);
+
+    R createOrder(long userId, FsStoreOrderCreateParam param);
+
+    R mallPay(FsStoreOrderPayParam param);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductAttrValueService.java

@@ -4,6 +4,8 @@ import java.util.List;
 import com.fs.his.domain.FsStoreProductAttrValue;
 import com.fs.his.param.FsStoreProductAttrValueListDParam;
 import com.fs.his.vo.FsStoreProductAttrValueListDVO;
+import com.fs.store.param.FsStoreProductAttrValueQueryParam;
+import com.fs.store.vo.FsStoreProductAttrValueQueryVO;
 
 /**
  * 商品属性值Service接口
@@ -62,4 +64,8 @@ public interface IFsStoreProductAttrValueService
     public int deleteFsStoreProductAttrValueById(Long id);
 
     List<FsStoreProductAttrValueListDVO> selectFsStoreProductAttrValueListDVO(FsStoreProductAttrValueListDParam param);
+
+    List<FsStoreProductAttrValue> selectFsStoreProductAttrValueByProductId(Long productId);
+
+    List<FsStoreProductAttrValueQueryVO> selectStoreProductAttrValueListQuery(FsStoreProductAttrValueQueryParam param);
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductCategoryService.java

@@ -69,4 +69,7 @@ public interface IFsStoreProductCategoryService
     List<FsStoreProductCategorysVO> selectFsStoreProductCategorysVOList();
 
     List<FsStoreProductCategoryVO> getPidList();
+
+
+    List<FsStoreProductCategory> selectFsStoreProductCategoryListQuery(FsStoreProductCategory param);
 }

+ 23 - 0
fs-service/src/main/java/com/fs/his/service/IFsStoreProductService.java

@@ -10,6 +10,10 @@ import com.fs.his.param.FsProductAttrValueParam;
 import com.fs.his.param.FsStoreProductAddEditParam;
 import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.vo.*;
+import com.fs.store.param.FsStoreProductQueryParam;
+import com.fs.store.vo.FsStoreProductActivityListVO;
+import com.fs.store.vo.FsStoreProductListQueryVO;
+import com.fs.store.vo.FsStoreProductQueryVO;
 
 /**
  * 商品Service接口
@@ -94,4 +98,23 @@ public interface IFsStoreProductService
     Long selectFsStoreProductCount(int type, Long companyId);
     Long selectFsStoreProductCount(int type);
 
+    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count);
+
+    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count);
+
+    List<FsStoreProductActivityListVO> selectFsStoreProductByIds(String productIds);
+
+    List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(FsStoreProductQueryParam param);
+
+    FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId);
+
+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiQuery(int count);
+
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count);
+
+    List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery();
+
+    List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery();
+
+    void decProductStock(Long productId, Long productAttrValueId, Integer cartNum);
 }

+ 3 - 0
fs-service/src/main/java/com/fs/his/service/IFsUserAddressService.java

@@ -70,4 +70,7 @@ public interface IFsUserAddressService
     Boolean isEntityNull(FsUserAddress fsUserAddress);
 
     Long selectFsUserAddressListCount(FsUserAddress fsUserAddress);
+
+    Integer delAllAddress(Long userId);
+
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/IFsUserBillService.java

@@ -4,6 +4,7 @@ import java.util.List;
 import com.fs.his.domain.FsUserBill;
 import com.fs.his.param.FsUserBillParam;
 import com.fs.his.vo.FsUserBillVO;
+import com.fs.store.param.FsUserBillQueryParam;
 
 /**
  * 用户帐单记录Service接口
@@ -63,4 +64,9 @@ public interface IFsUserBillService
 
 
     List<FsUserBillVO> selectFsUserBillListVO(FsUserBillParam fsUserBill);
+
+    List<FsUserBill> selectFsUserBillListQuery(FsUserBillQueryParam param);
+
+    void addBill(Long uid,String cate,Integer billType, String title, double number, double balance, String remark,String busId,Long tuiUserId);
+
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/service/IFsUserService.java

@@ -171,4 +171,8 @@ public interface IFsUserService
     CompanyUserSummaryCountVO companyUserSummaryCount(Long userId, String companyUserId);
 
     ResponseResult<Boolean> becomeMember(@Valid FsUserCourseBeMemberParam param);
+
+    FsUser selectFsUserByMaOpenId(String openid);
+
+    int decIntegral( Long uid,  double usedIntegral);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsAdvServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.Collections;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
 import com.fs.his.param.FsAdvUParam;
+import com.fs.store.vo.FsAdvListQueryVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsAdvMapper;
@@ -106,4 +107,9 @@ public class FsAdvServiceImpl implements IFsAdvService
     public List<FsAdv> selectFsAdvListUVO(FsAdvUParam map) {
         return fsAdvMapper.selectFsAdvListUVO(map);
     }
+
+    @Override
+    public List<FsAdvListQueryVO> selectFsAdvListQuery(Integer advType) {
+        return fsAdvMapper.selectFsAdvListQuery(advType);
+    }
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsArticleCateServiceImpl.java

@@ -4,6 +4,7 @@ import java.util.Collections;
 import java.util.List;
 
 import com.fs.his.vo.OptionsVO;
+import com.fs.store.vo.FsArticleCateListQueryVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsArticleCateMapper;
@@ -104,4 +105,9 @@ public class FsArticleCateServiceImpl implements IFsArticleCateService
 
        return fsArticleCateMapper.selectFsArticleCateAllListVO();
     }
+
+    @Override
+    public List<FsArticleCateListQueryVO> selectFsArticleCateListQuery() {
+        return fsArticleCateMapper.selectFsArticleCateListQuery();
+    }
 }

+ 17 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsArticleServiceImpl.java

@@ -6,6 +6,10 @@ import com.fs.his.param.FsArticleListUParam;
 import com.fs.his.vo.FsArticleListUVO;
 import com.fs.his.vo.FsArticleListVO;
 import com.fs.his.vo.FsArticleVO;
+import com.fs.store.mapper.FsArticleViewsMapper;
+import com.fs.store.param.FsArticleQueryParam;
+import com.fs.store.vo.FsArticleListQueryVO;
+import com.fs.store.vo.FsArticleViewListQueryVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsArticleMapper;
@@ -24,6 +28,9 @@ public class FsArticleServiceImpl implements IFsArticleService
     @Autowired
     private FsArticleMapper fsArticleMapper;
 
+    @Autowired
+    private FsArticleViewsMapper viewsMapper;
+
     /**
      * 查询文章
      *
@@ -112,4 +119,14 @@ public class FsArticleServiceImpl implements IFsArticleService
     public List<FsArticleListVO> selectFsArticleListVO(FsArticle fsArticle) {
         return fsArticleMapper.selectFsArticleListVO(fsArticle);
     }
+
+    @Override
+    public List<FsArticleListQueryVO> selectFsArticleListQuery(FsArticleQueryParam param) {
+        List<FsArticleListQueryVO> list=fsArticleMapper.selectFsArticleListQuery(param);
+        for(FsArticleListQueryVO vo:list){
+            List<FsArticleViewListQueryVO> viewsList=viewsMapper.selectFsArticleViewsTopByArticleId(vo.getArticleId());
+            vo.setViewsList(viewsList);
+        }
+        return list;
+    }
 }

+ 4 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsCityServiceImpl.java

@@ -108,6 +108,10 @@ public class FsCityServiceImpl implements IFsCityService
     public List<CitysAreaVO> getCitysArea() {
         return fsCityMapper.getCitysArea();
     }
+    @Override
+    public List<FsCity> selectFsCitys() {
+        return fsCityMapper.selectFsCitys();
+    }
 
 
 }

+ 22 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreAfterSalesServiceImpl.java

@@ -41,6 +41,8 @@ import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
 import com.fs.huifuPay.service.HuiFuService;
 import com.fs.im.dto.*;
 import com.fs.im.service.IImService;
+import com.fs.store.param.FsStoreAfterSalesQueryParam;
+import com.fs.store.vo.FsStoreAfterSalesQueryVO;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
 import com.fs.ybPay.dto.RefundDTO;
@@ -128,6 +130,8 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
     FsExportTaskMapper fsExportTaskMapper;
     @Autowired
     IFsStoreOrderBillLogService fsStoreOrderBillLogService;
+    @Autowired
+    IFsStoreAfterSalesItemService fsStoreAfterSalesItemService;
 
 
     /**
@@ -878,4 +882,22 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService {
         task.setFileUrl(result.get("msg").toString());
         fsExportTaskMapper.updateFsExportTask(task);
     }
+
+    @Override
+    public Integer selectFsStoreAfterSalesCount(long userId, int salesStatus) {
+        return fsStoreAfterSalesMapper.selectFsStoreAfterSalesCount(userId,salesStatus);
+    }
+
+    @Override
+    public List<FsStoreAfterSalesQueryVO> selectFsStoreAfterSalesListQuery(FsStoreAfterSalesQueryParam storeAfterSalesParam) {
+        List<FsStoreAfterSalesQueryVO>  list=fsStoreAfterSalesMapper.selectFsStoreAfterSalesListQuery(storeAfterSalesParam);
+        for(FsStoreAfterSalesQueryVO vo:list){
+            FsStoreAfterSalesItem map=new FsStoreAfterSalesItem();
+            map.setAfterSalesId(vo.getId());
+            List<FsStoreAfterSalesItem>  items=fsStoreAfterSalesItemService.selectFsStoreAfterSalesItemList(map);
+            vo.setItems(items);
+        }
+        return list;
+    }
+
 }

+ 829 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -2,6 +2,9 @@ package com.fs.his.service.impl;
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.net.URLDecoder;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONUtil;
@@ -63,6 +66,27 @@ import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwExternalContactMapper;
 import com.fs.sop.mapper.QwSopLogsMapper;
 import com.fs.qw.service.impl.QwUserServiceImpl;
+import com.fs.store.config.StoreIntegralConfig;
+import com.fs.store.constants.StoreConstants;
+import com.fs.store.domain.FsShippingTemplates;
+import com.fs.store.domain.FsShippingTemplatesRegion;
+import com.fs.store.domain.FsStoreCart;
+import com.fs.store.domain.FsStoreCouponUser;
+import com.fs.store.dto.FsStoreOrderComputeDTO;
+import com.fs.store.dto.FsStoreOrderPriceDTO;
+import com.fs.store.dto.TemplateDTO;
+import com.fs.store.enums.BillDetailEnum;
+import com.fs.store.enums.OrderLogEnum;
+import com.fs.store.enums.ShippingTempEnum;
+import com.fs.store.mapper.FsStoreCartMapper;
+import com.fs.store.param.FsStoreConfirmOrderParam;
+import com.fs.store.param.FsStoreOrderComputedParam;
+import com.fs.store.param.FsStoreOrderCreateParam;
+import com.fs.store.service.IFsShippingTemplatesRegionService;
+import com.fs.store.service.IFsShippingTemplatesService;
+import com.fs.store.service.IFsStoreCouponUserService;
+import com.fs.store.service.IFsStoreOrderStatusService;
+import com.fs.store.vo.FsStoreCartQueryVO;
 import com.fs.system.domain.SysConfig;
 import com.fs.tzBankPay.doman.*;
 import com.fs.ybPay.domain.CreateWxOrderResult;
@@ -84,6 +108,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.beans.factory.annotation.Value;
@@ -101,6 +126,8 @@ import java.sql.Timestamp;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 import static com.fs.his.utils.PhoneUtil.decryptPhone;
 
@@ -241,6 +268,30 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
     @Autowired
     private IFsStoreProductGroupService storeProductGroupService;
 
+    @Autowired
+    private FsStoreCartMapper cartMapper;
+
+    @Autowired
+    private FsUserAddressMapper userAddressMapper;
+
+    @Autowired
+    private IFsStoreCouponUserService couponUserService;
+
+    @Autowired
+    private IFsShippingTemplatesService shippingTemplatesService;
+
+    @Autowired
+    private IFsShippingTemplatesRegionService shippingTemplatesRegionService;
+
+    @Autowired
+    private IFsUserBillService billService;
+
+    @Autowired
+    private IFsStoreProductService productService;
+
+    @Autowired
+    private IFsStoreOrderStatusService orderStatusService;
+
     /**
      * 查询订单
      *
@@ -459,6 +510,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         List<FsStoreOrderListUVO>  list=fsStoreOrderMapper.selectFsStoreOrderListUVO(param);
         for(FsStoreOrderListUVO vo:list){
             vo.setIsAfterSales(0);
+            vo.setId(vo.getOrderId());
             if(vo.getStatus().equals(FsStoreOrderStatusEnum.STATUS_4.getValue())){
                 //已完成订单
                 vo.setIsAfterSales(1);
@@ -3172,5 +3224,782 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
         return found;
     }
 
+    @Override
+    public Integer selectFsStoreOrderCount(long userId, int status) {
+        return fsStoreOrderMapper.selectFsStoreOrderCount(userId,status);
+    }
+
+    @Override
+    public R createSalesOrder(CompanyUser companyUser, String cateIds) {
+        List<FsStoreCartQueryVO>  carts=cartMapper.selectFsStoreCartListByIds(cateIds);
+        String uuid = IdUtil.randomUUID();
+        redisCache.setCacheObject("createOrderKey:"+uuid, companyUser.getCompanyId()+"-"+companyUser.getUserId(), 24, TimeUnit.HOURS);
+        redisCache.setCacheObject("orderCarts:"+uuid, carts, 24, TimeUnit.HOURS);
+        //计算总价
+        BigDecimal totalMoney= BigDecimal.ZERO;
+        for(FsStoreCartQueryVO vo:carts){
+            totalMoney=totalMoney.add(vo.getPrice().multiply(new BigDecimal(vo.getCartNum().toString())));
+        }
+        redisCache.setCacheObject("createOrderMoney:"+uuid, totalMoney, 24, TimeUnit.HOURS);
+        return R.ok().put("orderKey",uuid).put("carts",carts);
+    }
+
+    @Override
+    public R updateSalseOrderMoney(String createOrderKey, BigDecimal money,BigDecimal payAmount) {
+        //货到付款自定义金额
+        if (payAmount==null){
+            String configJson=configService.selectConfigByKey("store.config");
+            StoreConfig config=JSONUtil.toBean(configJson,StoreConfig.class);
+            Integer amount = config.getPayAmount();
+            if (amount!=null){
+                payAmount = new BigDecimal(amount);
+            }
+        }
+
+
+        if(money==null){
+            return R.error("请输入价格");
+        }
+        if(money.compareTo(BigDecimal.ZERO)<=0){
+            return R.error("价格应大于0");
+        }
+        String key=redisCache.getCacheObject("createOrderKey:"+createOrderKey);
+        if (StringUtils.isEmpty(key)) {
+            throw new CustomException("订单已过期",501);
+        }
+        List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
+        BigDecimal totalMoney= BigDecimal.ZERO;
+        for(FsStoreCartQueryVO vo:carts){
+            totalMoney=totalMoney.add(vo.getPrice().multiply(new BigDecimal(vo.getCartNum().toString())));
+        }
+        if(money.compareTo(totalMoney)==1){
+            throw new CustomException("价格不能大于商品总价",501);
+        }
+        String json=configService.selectConfigByKey("store.config");
+        StoreConfig config= JSONUtil.toBean(json,StoreConfig.class);
+        if(config.getCreateMoneyRate()!=null){
+            totalMoney=totalMoney.multiply(new BigDecimal(config.getCreateMoneyRate())).divide(new BigDecimal(100));
+            if(money.compareTo(totalMoney)==-1){
+                throw new CustomException("价格必须大于商品总价"+config.getCreateMoneyRate()+"%",501);
+            }
+        }
+        redisCache.setCacheObject("createOrderMoney:"+createOrderKey, money, 24, TimeUnit.HOURS);
+        redisCache.setCacheObject("createOrderAmount:"+createOrderKey, payAmount, 24, TimeUnit.HOURS);//物流代收自定义金额
+        return R.ok();
+    }
+
+
+    @Override
+    public R getSalesOrder(String createOrderKey) {
+        String key=redisCache.getCacheObject("createOrderKey:"+createOrderKey);
+        List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
+        BigDecimal money=redisCache.getCacheObject("createOrderMoney:"+createOrderKey);
+        if (StringUtils.isEmpty(key)) {
+            throw new CustomException("订单已过期",501);
+        }
+        return R.ok().put("carts",carts).put("totalMoney",money);
+    }
+
+    @Override
+    @Transactional
+    public R addUserCart(long userId, String createOrderKey) {
+        String key=redisCache.getCacheObject("createOrderKey:"+createOrderKey);
+        List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
+        if (StringUtils.isEmpty(key)) {
+            throw new CustomException("订单已过期",501);
+        }
+        List<Long> ids=new ArrayList<>();
+        for(FsStoreCartQueryVO vo : carts){
+            FsStoreCart storeCart = FsStoreCart.builder()
+                    .cartNum(vo.getCartNum())
+                    .productAttrValueId(vo.getProductAttrValueId())
+                    .productId(vo.getProductId())
+                    .userId(userId)
+                    .isPay(0)
+                    .isDel(0)
+                    .isBuy(1)
+                    .build();
+            storeCart.setCreateTime(new Date());
+            cartMapper.insertFsStoreCart(storeCart);
+            ids.add(storeCart.getId());
+        }
+        //删除REDIS
+//        redisCache.deleteObject("createOrderKey:"+createOrderKey);
+//        redisCache.deleteObject("orderCarts:" + createOrderKey);
+        String[] idArr=key.split("-");
+        return R.ok().put("cartIds",ids).put("companyId",idArr[0]).put("companyUserId",idArr[1]);
+
+    }
+
+    @Override
+    public R confirmOrder(long uid, FsStoreConfirmOrderParam cartParam) {
+        //获取地址信息和购物车信息
+        FsUserAddress address= userAddressMapper.selectFsUserAddressByDefaultAddress(uid);
+        List<FsStoreCartQueryVO>  carts=cartMapper.selectFsStoreCartListByIds(cartParam.getCartIds());
+        String uuid = IdUtil.randomUUID();
+        redisCache.setCacheObject("orderKey:"+uuid, cartParam.getCartIds(), 300, TimeUnit.SECONDS);
+        redisCache.setCacheObject("orderCarts:"+uuid, carts, 300, TimeUnit.SECONDS);
+        return R.ok().put("orderKey",uuid).put("address",address).put("carts",carts);
+
+    }
+
+
+    @Override
+    public FsStoreOrderComputeDTO computedOrder(long uid, FsStoreOrderComputedParam param) {
+        String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
+        if (ObjectUtil.isNull(cartIds)) {
+            throw new CustomException("订单已过期",501);
+        }
+        List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
+        BigDecimal payPrice=getOrderSumPrice(carts,"truePrice");
+        if(StringUtils.isNotEmpty(param.getCreateOrderKey()))
+        {
+            BigDecimal money=redisCache.getCacheObject("createOrderMoney:"+param.getCreateOrderKey());
+            if(money!=null){
+                payPrice=money;
+            }
+        }
+        BigDecimal serviceFee=BigDecimal.ZERO;
+        String configJson=configService.selectConfigByKey("store.config");
+        StoreConfig config=JSONUtil.toBean(configJson,StoreConfig.class);
+        if(config.getServiceFee()!=null){
+            serviceFee=config.getServiceFee();
+        }
+        payPrice = payPrice.add(serviceFee);
+        FsUserAddress userAddress = null;
+        if (param.getAddressId()!=null) {
+            userAddress = userAddressMapper.selectFsUserAddressByAddressId(param.getAddressId());
+        }
+        FsStoreOrderPriceDTO priceGroup = this.getOrderPriceGroup(carts, userAddress);
+        BigDecimal payPostage = priceGroup.getStorePostage();
+        payPrice = NumberUtil.add(payPrice, payPostage);
+
+        FsUser user=userService.selectFsUserById(uid);
+        // 积分抵扣
+        BigDecimal deductionPrice = BigDecimal.ZERO; //积分抵扣金额
+        double usedIntegral = 0; //使用了多少积分
+        if (param.getUseIntegral()!=null&&param.getUseIntegral()==1 && user.getIntegral().intValue() > 0) {
+            //如果积分总和小于用户积分 抵扣比例 计算抵扣价格
+            //默认配置
+            Double integralMax = Double.valueOf(100);
+            BigDecimal integralFull = new BigDecimal(100);
+            Double integralRatio = Double.valueOf(1);
+            String json=configService.selectConfigByKey("store.integral");
+            if(StringUtils.isEmpty(json)) {
+
+            }
+            else{
+                StoreIntegralConfig integralConfig=JSONUtil.toBean(json,StoreIntegralConfig.class);
+                integralMax = integralConfig.getIntegralMax();
+                integralFull = integralConfig.getIntegralFull();
+                integralRatio =integralConfig.getIntegralRatio();
+
+            }
+            if (priceGroup.getTotalPrice().compareTo(integralFull) >= 0) {
+                Double userIntegral = user.getIntegral().doubleValue();
+                if (integralMax.intValue() > 0 && Double.compare(userIntegral, integralMax) >= 0) {
+                    userIntegral = integralMax;
+                }
+                deductionPrice = BigDecimal.valueOf(NumberUtil.mul(userIntegral, integralRatio));
+                if (deductionPrice.compareTo(payPrice) < 0) {
+                    payPrice = NumberUtil.sub(payPrice, deductionPrice);
+                    usedIntegral = userIntegral;
+                } else {
+                    deductionPrice = payPrice;
+                    payPrice = BigDecimal.ZERO;
+                    usedIntegral = NumberUtil.round(NumberUtil.div(deductionPrice,
+                            BigDecimal.valueOf(integralRatio)), 2).doubleValue();
+                }
+            }
+        }
+
+        if (payPrice.compareTo(BigDecimal.ZERO) <= 0) {
+            payPrice = BigDecimal.ZERO;
+        }
+        //优惠券
+        if(param.getCouponUserId()!=null){
+            FsStoreCouponUser couponUser=couponUserService.selectFsStoreCouponUserById(param.getCouponUserId());
+            if(couponUser!=null&&couponUser.getStatus()==0){
+                if(couponUser.getUseMinPrice().compareTo(priceGroup.getTotalPrice())==-1){
+                    payPrice=payPrice.subtract(couponUser.getCouponPrice());
+                }
+            }
+        }
+
+        return FsStoreOrderComputeDTO.builder()
+                .totalPrice(priceGroup.getTotalPrice())
+                .payPrice(payPrice)
+                .payPostage(payPostage)
+                .deductionPrice(deductionPrice)
+                .usedIntegral(usedIntegral)
+                .payIntegral(priceGroup.getPayIntegral())
+                .serviceFee(serviceFee)
+                .build();
+    }
+
+    /**
+     * 获取某字段价格
+     *
+     * @param cartInfo 购物车
+     * @param key      key值
+     * @return Double
+     */
+    private BigDecimal getOrderSumPrice(List<FsStoreCartQueryVO> cartInfo, String key) {
+        BigDecimal sumPrice = BigDecimal.ZERO;
+
+        if ("truePrice".equals(key)) {
+            for (FsStoreCartQueryVO storeCart : cartInfo) {
+                sumPrice = NumberUtil.add(sumPrice, NumberUtil.mul(storeCart.getCartNum(), storeCart.getPrice()));
+            }
+        }
+        else if ("costPrice".equals(key)) {
+            for (FsStoreCartQueryVO storeCart : cartInfo) {
+                sumPrice = NumberUtil.add(sumPrice,
+                        NumberUtil.mul(storeCart.getCartNum(), storeCart.getCost()));
+            }
+        }else if ("payIntegral".equals(key)) {
+            for (FsStoreCartQueryVO storeCart : cartInfo) {
+                if (storeCart.getIntegral() != null) {
+                    sumPrice = NumberUtil.add(sumPrice,
+                            NumberUtil.mul(storeCart.getCartNum(), storeCart.getIntegral()));
+                }
+
+            }
+        }
+        return sumPrice;
+    }
+
+    /**
+     * 获取订单价格
+     */
+    private FsStoreOrderPriceDTO getOrderPriceGroup(List<FsStoreCartQueryVO> cartInfo, FsUserAddress userAddress) {
+        BigDecimal storePostage = BigDecimal.ZERO;
+        //免运费设置
+        BigDecimal storeFreePostage = BigDecimal.ZERO;
+
+        BigDecimal totalPrice = this.getOrderSumPrice(cartInfo, "truePrice");//获取订单总金额
+        BigDecimal costPrice = this.getOrderSumPrice(cartInfo, "costPrice");//获取订单成本价
+        BigDecimal payIntegral = this.getOrderSumPrice(cartInfo, "payIntegral");//获取订单需要的积分
+
+        //如果设置满包邮0 表示全局包邮,如果设置大于0表示满这价格包邮,否则走运费模板算法
+        if (storeFreePostage.compareTo(BigDecimal.ZERO) != 0 && totalPrice.compareTo(storeFreePostage) <= 0) {
+            storePostage = this.handlePostage(cartInfo, userAddress);
+        }
+
+        FsStoreOrderPriceDTO priceGroupDTO = new FsStoreOrderPriceDTO();
+        priceGroupDTO.setStorePostage(storePostage);
+//        priceGroupDTO.setStoreFreePostage(storeFreePostage);
+        priceGroupDTO.setTotalPrice(totalPrice);
+        priceGroupDTO.setCostPrice(costPrice);
+        priceGroupDTO.setPayIntegral(payIntegral);
+        return priceGroupDTO;
+    }
+
+    /**
+     * 根据运费模板算法返回邮费
+     *
+     * @param cartInfo    购物车
+     * @param userAddress 地址
+     * @return double
+     */
+    private BigDecimal handlePostage(List<FsStoreCartQueryVO> cartInfo, FsUserAddress userAddress) {
+        BigDecimal storePostage = BigDecimal.ZERO;
+        if (userAddress != null) {
+            if (userAddress.getCity() == null) {
+                return storePostage;
+            }
+            String cityId = userAddress.getCity();
+            List<String> citys = new ArrayList<>();
+            citys.add(cityId);
+            citys.add("0");//城市包括默认
+            List<Long> tempIds = cartInfo
+                    .stream()
+                    .map(FsStoreCartQueryVO::getTempId)
+                    .collect(Collectors.toList());
+
+            //获取商品用到的运费模板
+            List<FsShippingTemplates> shippingTemplatesList =shippingTemplatesService.selectFsShippingTemplatesByIds(StringUtils.join(tempIds,","));
+
+            //获取运费模板区域列表按照城市排序
+            List<FsShippingTemplatesRegion> shippingTemplatesRegionList = shippingTemplatesRegionService.selectFsShippingTemplatesRegionListByTempIdsAndCityIds(StringUtils.join(tempIds,","),StringUtils.join(citys,","));
+
+            //提取运费模板类型
+            Map<Long, Integer> shippingTemplatesMap = shippingTemplatesList
+                    .stream()
+                    .collect(Collectors.toMap(FsShippingTemplates::getId,
+                            FsShippingTemplates::getType));
+            //提取运费模板有相同值覆盖
+            Map<Long, FsShippingTemplatesRegion> shippingTemplatesRegionMap =
+                    shippingTemplatesRegionList.stream()
+                            .collect(Collectors.toMap(FsShippingTemplatesRegion::getTempId,
+                                    YxShippingTemplatesRegion -> YxShippingTemplatesRegion,
+                                    (key1, key2) -> key2));
+
+
+            Map<Long, TemplateDTO> templateDTOMap = new HashMap<>();
+            for (FsStoreCartQueryVO storeCartVO : cartInfo) {
+                Long tempId = storeCartVO.getTempId();
+                //根据模板类型获取相应的数量
+                double num = 0d;
+                if (ShippingTempEnum.TYPE_1.getValue().equals(shippingTemplatesMap.get(tempId))) {
+                    num = storeCartVO.getCartNum().doubleValue();
+                } else if (ShippingTempEnum.TYPE_2.getValue().equals(shippingTemplatesMap.get(tempId))) {
+                    num = NumberUtil.mul(storeCartVO.getCartNum(),
+                            storeCartVO.getWeight()).doubleValue();
+                } else if (ShippingTempEnum.TYPE_3.getValue().equals(shippingTemplatesMap.get(tempId))) {
+                    num = NumberUtil.mul(storeCartVO.getCartNum(),
+                            storeCartVO.getVolume()).doubleValue();
+                }
+
+                FsShippingTemplatesRegion shippingTemplatesRegion = shippingTemplatesRegionMap.get(tempId);
+                BigDecimal price = NumberUtil.round(NumberUtil.mul(storeCartVO.getCartNum(),
+                        storeCartVO.getPrice()), 2);
+                if (!templateDTOMap.containsKey(tempId)) {
+                    TemplateDTO templateDTO = TemplateDTO.builder()
+                            .number(num)
+                            .price(price)
+                            .first(shippingTemplatesRegion.getFirst().doubleValue())
+                            .firstPrice(shippingTemplatesRegion.getFirstPrice())
+                            .continues(shippingTemplatesRegion.getContinues().doubleValue())
+                            .continuePrice(shippingTemplatesRegion.getContinuePrice())
+                            .tempId(tempId)
+                            .cityId(cityId)
+                            .build();
+                    templateDTOMap.put(tempId, templateDTO);
+                } else {
+                    TemplateDTO templateDTO = templateDTOMap.get(tempId);
+                    templateDTO.setNumber(templateDTO.getNumber() + num);
+                    templateDTO.setPrice(NumberUtil.add(templateDTO.getPrice().doubleValue(), price));
+                }
+            }
+
+            //处理区域邮费
+            boolean isFirst = true; //用来是否多个产品的标识 false表示数量大于1
+            for (TemplateDTO templateDTO : templateDTOMap.values()) {
+                if (isFirst) {//首件
+                    //只满足首件
+                    if (Double.compare(templateDTO.getNumber(), templateDTO.getFirst()) <= 0) {
+                        storePostage = NumberUtil.round(NumberUtil.add(storePostage,
+                                templateDTO.getFirstPrice()), 2);
+                    } else {
+                        BigDecimal firstPrice = NumberUtil.add(storePostage, templateDTO.getFirstPrice());
+
+                        if (templateDTO.getContinues() <= 0) {
+                            storePostage = firstPrice;
+                        } else {
+                            //续件平均值且向上取整数
+                            double average = Math.ceil(NumberUtil.div(NumberUtil.sub(templateDTO.getNumber(),
+                                            templateDTO.getFirst()),
+                                    templateDTO.getContinues().doubleValue()));
+                            //最终邮费
+                            storePostage = NumberUtil.add(firstPrice, NumberUtil.mul(average,
+                                    templateDTO.getContinuePrice()));
+                        }
+
+                    }
+                    isFirst = false;
+                } else {
+                    //多件直接在以前的基数继续续建
+                    if (templateDTO.getContinues() > 0) {
+                        //续件平均值且向上取整数
+                        double average = Math.ceil(
+                                NumberUtil.div(
+                                        templateDTO.getNumber(),
+                                        templateDTO.getContinues()
+                                )
+                        );
+                        //最终邮费
+                        storePostage = NumberUtil.add(storePostage.doubleValue(), NumberUtil.mul(average,
+                                templateDTO.getContinuePrice()));
+                    }
+                }
+            }
+        }
+        return storePostage;
+    }
+
+    @Override
+    @Transactional
+    public R createOrder(long userId, FsStoreOrderCreateParam param) {
+        FsStoreOrderComputedParam computedParam=new FsStoreOrderComputedParam();
+        BeanUtils.copyProperties(param, computedParam);
+        //计算金额
+        FsStoreOrderComputeDTO dto=this.computedOrder(userId, computedParam);
+        String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
+//        Integer totalNum = 0;
+        BigDecimal integral = BigDecimal.ZERO;
+        if(cartIds!=null){
+            //获取购物车列表
+            List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
+            //获取地址
+            FsUserAddress address=userAddressMapper.selectFsUserAddressByAddressId(param.getAddressId());
+            //生成分布式唯一值
+            String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
+            //是否使用积分
+            Boolean isIntegral=false;
+            //组合数据
+            FsStoreOrder storeOrder = new FsStoreOrder();
+            storeOrder.setStoreHouseCode("CK01");
+            storeOrder.setCompanyId(param.getCompanyId());
+            storeOrder.setCompanyUserId(param.getCompanyUserId());
+            if(param.getCompanyUserId()!=null){
+                CompanyUser companyUser=companyUserService.selectCompanyUserById(param.getCompanyUserId());
+                if(companyUser!=null){
+                    storeOrder.setDeptId(companyUser.getDeptId());
+                }
+            }
+            storeOrder.setUserId(userId);
+            storeOrder.setOrderCode(orderSn);
+            storeOrder.setUserName(address.getRealName());
+            storeOrder.setUserPhone(address.getPhone());
+            storeOrder.setUserAddress(address.getProvince() + " " + address.getCity() +
+                    " " + address.getDistrict() + " " + address.getDetail().trim());
+            storeOrder.setCartId(cartIds);
+            storeOrder.setTotalNum(Long.parseLong(String.valueOf(carts.size())));
+            storeOrder.setTotalPrice(dto.getTotalPrice());
+            // todo add字段 TotalPostage
+            storeOrder.setTotalPostage(dto.getPayPostage());
+
+            //优惠券处理
+            if(param.getCouponUserId()!=null){
+                FsStoreCouponUser couponUser=couponUserService.selectFsStoreCouponUserById(param.getCouponUserId());
+                if(couponUser!=null&&couponUser.getStatus()==0){
+            // storeOrder.setCouponId(couponUser.getId()); todo 调整couponid存储到UserCouponId
+                    storeOrder.setUserCouponId(couponUser.getId());
+                    storeOrder.setCouponPrice(couponUser.getCouponPrice());
+                    //更新优惠券状态
+                    couponUser.setStatus(1);
+                    couponUser.setUseTime(new Date());
+                    couponUserService.updateFsStoreCouponUser(couponUser);
+                }
+            }
+            //处理推荐人
+            FsUser user= userService.selectFsUserById(storeOrder.getUserId());
+            if(user.getSpreadUserId()!=null&&user.getSpreadUserId()>0){
+                storeOrder.setTuiUserId(user.getSpreadUserId());
+            }
+            else{
+                if(param.getTuiUserId()!=null){
+                    FsUser tuiUser= userService.selectFsUserById(param.getTuiUserId());
+                    if(tuiUser!=null&&tuiUser.getIsPromoter()==1){
+                        storeOrder.setTuiUserId(param.getTuiUserId());
+                    }
+                }
+            }
+            storeOrder.setPayPostage(dto.getPayPostage());
+//            storeOrder.setDeductionPrice(dto.getDeductionPrice()); todo 抵扣金额存储到 DiscountMoney
+            storeOrder.setDiscountMoney(dto.getDeductionPrice());
+            storeOrder.setIsPay(0);
+            storeOrder.setPayType(param.getPayType());
+            if (isIntegral) {
+                storeOrder.setPayIntegral(integral);
+            }
+            storeOrder.setUseIntegral(BigDecimal.valueOf(dto.getUsedIntegral()));
+            storeOrder.setBackIntegral(BigDecimal.ZERO);
+            storeOrder.setGainIntegral(BigDecimal.ZERO);
+            storeOrder.setRemark(param.getMark());
+            //todo 获取成本价 调整为costPrice
+            BigDecimal costPrice = this.getOrderSumPrice(carts, "costPrice");
+            storeOrder.setCostPrice(costPrice);
+            //todo 类型转换为String
+            storeOrder.setIsChannel("1");
+            storeOrder.setShippingType(1);
+            storeOrder.setCreateTime(new Date());
+
+//            String json=configService.selectConfigByKey("store.config");
+            // todo 更改商城配置来源 his.store
+            String json=configService.selectConfigByKey("his.store");
+            StoreConfig config=JSONUtil.toBean(json,StoreConfig.class);
+            if(config.getServiceFee()!=null){
+                storeOrder.setServiceFee(config.getServiceFee());
+            }
+            if(param.getPayType().equals(1)){
+                //全款支付
+                storeOrder.setStatus(1);
+            }
+            else if(param.getPayType().equals(2)){
+                //货到付款
+                storeOrder.setStatus(2);
+            }
+            //后台制单处理
+            if(param.getPayPrice()!=null&&param.getPayPrice().compareTo(BigDecimal.ZERO)>0){
+                storeOrder.setPayPrice(param.getPayPrice());
+            }
+            else{
+                storeOrder.setPayPrice(dto.getPayPrice());
+            }
+            storeOrder.setOrderCreateType(param.getOrderCreateType());
+            Long prescribe = carts.stream().filter(item -> item.getProductType()!=null&&item.getProductType()==2).count();
+            if(prescribe>0){
+                storeOrder.setIsPrescribe(1);
+            } else {
+                storeOrder.setIsPrescribe(0);
+            }
+            Integer flag=fsStoreOrderMapper.insertFsStoreOrder(storeOrder);
+            if (flag==0) {
+                return R.error("订单创建失败");
+            }
+            //使用了积分扣积分
+            if (dto.getUsedIntegral() > 0) {
+                this.decIntegral(userId, dto.getUsedIntegral(), dto.getDeductionPrice().doubleValue(),storeOrder.getOrderId().toString());
+            }
+            //减库存加销量
+            this.deStockIncSale(carts);
+            //保存OrderItem
+            List<FsStoreOrderItem> listOrderItem=new ArrayList<>();
+            //保存购物车商品信息
+            for(FsStoreCartQueryVO vo:carts){
+                FsStoreCartDTO fsStoreCartDTO=new FsStoreCartDTO();
+                fsStoreCartDTO.setProductId(vo.getProductId());
+                fsStoreCartDTO.setPrice(vo.getPrice());
+                fsStoreCartDTO.setSku(vo.getProductAttrName());
+                fsStoreCartDTO.setProductName(vo.getProductName());
+                fsStoreCartDTO.setNum(vo.getCartNum());
+                fsStoreCartDTO.setBarCode(vo.getBarCode());
+                fsStoreCartDTO.setGroupBarCode(vo.getGroupBarCode());
+                fsStoreCartDTO.setBrokerage(vo.getBrokerage());
+                fsStoreCartDTO.setBrokerageTwo(vo.getBrokerageTwo());
+                fsStoreCartDTO.setBrokerageThree(vo.getBrokerageThree());
+                if(StringUtils.isEmpty(vo.getProductAttrImage())){
+                    fsStoreCartDTO.setImage(vo.getProductImage());
+                }
+                else{
+                    fsStoreCartDTO.setImage(vo.getProductAttrImage());
+                }
+
+                FsStoreOrderItem item=new FsStoreOrderItem();
+                item.setOrderId(storeOrder.getOrderId());
+                item.setOrderCode(orderSn);
+                item.setCartId(vo.getId());
+                item.setProductId(vo.getProductId());
+                item.setJsonInfo(JSONUtil.toJsonStr(fsStoreCartDTO));
+                //todo 类型转换Long
+                item.setNum(Long.valueOf(vo.getCartNum()));
+                item.setIsAfterSales(0);
+                //处方药
+                if(vo.getProductType().equals(2)){
+                    item.setIsPrescribe(1);
+                }
+                fsStoreOrderItemMapper.insertFsStoreOrderItem(item);
+                listOrderItem.add(item);
+            }
+            if(listOrderItem.size()>0){
+                String itemJson=JSONUtil.toJsonStr(listOrderItem);
+                storeOrder.setItemJson(itemJson);
+                fsStoreOrderMapper.updateFsStoreOrder(storeOrder);
+            }
+            //购物车状态修改
+            cartMapper.updateIsPay(cartIds);
+
+            //删除缓存
+            redisCache.deleteObject("orderKey:" + param.getOrderKey());
+            redisCache.deleteObject("orderCarts:" + param.getOrderKey());
+
+            //添加记录
+            orderStatusService.create(storeOrder.getOrderId(), OrderLogEnum.CREATE_ORDER.getValue(),
+                    OrderLogEnum.CREATE_ORDER.getDesc());
+
+            //加入redis,24小时自动取消
+            String redisKey = String.valueOf(StrUtil.format("{}{}",
+                    StoreConstants.REDIS_ORDER_OUTTIME_UNPAY, storeOrder.getOrderId()));
 
+            if(config.getUnPayTime()!=null&&config.getUnPayTime()>0){
+                redisCache.setCacheObject(redisKey,storeOrder.getOrderId(),config.getUnPayTime(), TimeUnit.MINUTES);
+            }
+            else{
+                redisCache.setCacheObject(redisKey,storeOrder.getOrderId(),30, TimeUnit.MINUTES);
+            }
+            //添加支付到期时间
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(storeOrder.getCreateTime());
+            calendar.add(Calendar.MINUTE,config.getUnPayTime());
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            String payLimitTime = format.format(calendar.getTime() );
+            //删除推荐订单KEY
+            String createOrderKey = param.getCreateOrderKey();
+            if(StringUtils.isNotEmpty(createOrderKey)){
+                redisCache.deleteObject("createOrderKey:"+ createOrderKey);
+                redisCache.deleteObject("orderCarts:" + createOrderKey);
+                redisCache.deleteObject("createOrderMoney:" + createOrderKey);
+                //货到付款自定义金额 key改为id存储
+                BigDecimal amount=redisCache.getCacheObject("createOrderAmount:"+createOrderKey);
+                redisCache.deleteObject("createOrderAmount:" + createOrderKey);
+                redisCache.setCacheObject("orderAmount:"+storeOrder.getOrderId(), amount, 24, TimeUnit.HOURS);//物流代收自定义金额
+            }
+            //todo 前端使用的是id这个属性 尽量适配前端代码
+            if(storeOrder.getId() == null){
+                storeOrder.setId(storeOrder.getOrderId());
+            }
+            return R.ok().put("order", storeOrder).put("payLimitTime",payLimitTime);
+        }
+        else{
+            return R.error("订单已过期");
+        }
+    }
+
+    /**
+     * 积分抵扣
+     */
+    private void decIntegral(Long uid, double usedIntegral, double deductionPrice,String busId) {
+        userService.decIntegral(uid, usedIntegral);
+        FsUser user=userService.selectFsUserById(uid);
+        //积分记录
+        billService.addBill(uid, BillDetailEnum.CATEGORY_2.getValue(),0, BillDetailEnum.TYPE_1.getDesc(),  usedIntegral, user.getIntegral().doubleValue(),
+                "购买商品使用" + usedIntegral + "积分抵扣" + deductionPrice + "元",busId,0L);
+
+    }
+
+    public void deStockIncSale(List<FsStoreCartQueryVO> cartInfo) {
+        for (FsStoreCartQueryVO storeCartVO : cartInfo) {
+            productService.decProductStock(storeCartVO.getProductId(),
+                    storeCartVO.getProductAttrValueId(),storeCartVO.getCartNum());
+        }
+    }
+
+    @Override
+    @Transactional
+    @Synchronized
+    public  R mallPay(FsStoreOrderPayParam param){
+
+        FsStoreOrder order = fsStoreOrderMapper.selectFsStoreOrderByOrderId(param.getOrderId());
+
+        if (order == null) {
+            return R.error("订单不存在");
+        }
+
+        if (!order.getStatus().equals(FsStoreOrderStatusEnum.STATUS_1.getValue())) {
+            return R.error("订单状态不正确");
+        }
+        FsUser user = userService.selectFsUserByUserId(param.getUserId());
+        //获取用户
+        if (user != null && StringUtils.isNotEmpty(user.getMaOpenId())) {
+            if (order.getPayMoney().compareTo(new BigDecimal(0)) == 0 && 1==2) {
+                this.payConfirm(order.getOrderCode(), "", "", "", 2);
+                return R.ok().put("data", param.getOrderId()).put("isPay", "1");
+            }
+            else {
+                //在线支付
+                String json = configService.selectConfigByKey("his.pay");
+                PayConfigDTO payConfigDTO = JSONUtil.toBean(json, PayConfigDTO.class);
+                String payCode = OrderCodeUtils.getOrderSn();
+                if (StringUtils.isEmpty(payCode)) {
+                    return R.error("订单生成失败,请重试");
+                }
+                FsStorePayment storePayment = new FsStorePayment();
+                storePayment.setStatus(0);
+                storePayment.setPayCode(payCode);
+                storePayment.setPayMode(payConfigDTO.getType());
+                storePayment.setPayMoney(order.getPayMoney());
+                storePayment.setBusinessCode(order.getOrderCode());
+                storePayment.setCreateTime(new Date());
+                storePayment.setPayTypeCode("weixin");
+                storePayment.setBusinessType(2);
+                storePayment.setRemark("商城订单支付");
+                storePayment.setOpenId(user.getMaOpenId());
+                storePayment.setUserId(user.getUserId());
+                storePayment.setCompanyId(order.getCompanyId());
+                storePayment.setCompanyUserId(order.getCompanyUserId());
+                storePayment.setStoreId(order.getStoreId());
+                storePayment.setBusinessId(order.getOrderId().toString());
+                if (storePaymentService.insertFsStorePayment(storePayment) > 0) {
+
+                    if (payConfigDTO.getType().equals("wx")) {
+                        //创建微信订单
+                        WxPayConfig payConfig = new WxPayConfig();
+                        SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.pay");
+                        FsPayConfig fsPayConfig = new Gson().fromJson(sysConfig.getConfigValue(), FsPayConfig.class);
+                        payConfig.setAppId(fsPayConfig.getAppId());
+                        payConfig.setMchId(fsPayConfig.getWxMchId());
+                        payConfig.setMchKey(fsPayConfig.getWxMchKey());
+                        payConfig.setSubAppId(org.apache.commons.lang3.StringUtils.trimToNull(null));
+                        payConfig.setSubMchId(org.apache.commons.lang3.StringUtils.trimToNull(null));
+                        payConfig.setKeyPath(null);
+                        payConfig.setNotifyUrl(wxPayProperties.getNotifyUrl());
+                        wxPayService.setConfig(payConfig);
+                        WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
+                        orderRequest.setOpenid(user.getMaOpenId());//公众号支付提供用户openid
+                        orderRequest.setBody("药品订单支付");
+                        orderRequest.setOutTradeNo("store-" + storePayment.getPayCode());
+                        orderRequest.setTotalFee(WxPayUnifiedOrderRequest.yuanToFen(storePayment.getPayMoney().toString()));//测试
+                        //orderRequest.setTotalFee(WxPayUnifiedOrderRequest.yuanToFen(money));//测试
+                        orderRequest.setTradeType("JSAPI");
+                        orderRequest.setSpbillCreateIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
+                        //调用统一下单接口,获取"预支付交易会话标识"
+                        try {
+                            WxPayMpOrderResult orderResult = wxPayService.createOrder(orderRequest);
+                            return R.ok().put("data", orderResult).put("type", "wx").put("isPay", 0);
+                        } catch (WxPayException e) {
+                            e.printStackTrace();
+                            throw new CustomException("支付失败" + e.getMessage());
+                        }
+                    }
+                    else if (payConfigDTO.getType().equals("yb")) {
+                        WxJspayDTO p = new WxJspayDTO();
+                        // 使用setter方法为对象赋值
+                        p.setPayMoney(storePayment.getPayMoney().toString());
+                        p.setLowOrderId("store-" + storePayment.getPayCode());
+                        p.setBody("药品订单支付");
+                        p.setIsMinipg("1");
+                        p.setOpenId(user.getMaOpenId());
+                        p.setAttach("");
+                        p.setStoreid("0");
+                        CreateWxOrderResult wxOrder = payService.createWxOrder(p);
+                        if (wxOrder.getStatus().equals("100")) {
+                            FsStorePayment mt = new FsStorePayment();
+                            mt.setPaymentId(storePayment.getPaymentId());
+                            mt.setTradeNo(wxOrder.getUpOrderId());
+                            fsStorePaymentMapper.updateFsStorePayment(mt);
+                            return R.ok().put("isPay", 0).put("data", wxOrder).put("type", "yb");
+                        } else {
+                            throw new CustomException("支付失败");
+                        }
+                    }
+                    else if (payConfigDTO.getType().equals("tz")) {
+                        PayCreateOrder o = new PayCreateOrder();
+                        o.setOrderNo("store" + storePayment.getPayCode()); // 业务系统订单号
+                        o.setTrxAmt(storePayment.getPayMoney().doubleValue()); // 交易金额
+                        o.setBusinessCstNo(order.getUserId().toString()); // 业务平台客户号
+                        String phone = "";
+                        if (user.getPhone() != null && user.getPhone().length() > 4) {
+                            phone = user.getPhone().substring(user.getPhone().length() - 4);
+                            if (user.getPhone().length() > 11) {
+                                o.setPayerMobileNo(PhoneUtil.decryptPhone(user.getPhone()));
+                            } else {
+                                o.setPayerMobileNo(user.getPhone());
+                            }
+                        }
+                        o.setPayerName("微信用户" + phone);
+                        o.setGoodsInfo("药品订单支付"); // 订单信息
+                        o.setOpenId(user.getMaOpenId());
+                        o.setOrderType(2);
+                        o.setOrderId(order.getOrderId().toString());
+                        TzBankResult<PayCreateOrderResult> result = tzBankService.createOrder(o);
+                        FsStorePayment mt = new FsStorePayment();
+                        mt.setPaymentId(storePayment.getPaymentId());
+                        mt.setTradeNo(result.getBody().getOrderFlowNo());
+                        fsStorePaymentMapper.updateFsStorePayment(mt);
+                        return R.ok().put("isPay", 0).put("data", result).put("type", "tz");
+                    }
+                    else if (payConfigDTO.getType().equals("hf")) {
+                        HuiFuCreateOrder o = new HuiFuCreateOrder();
+                        o.setTradeType("T_MINIAPP");
+                        o.setOpenid(user.getMaOpenId());
+                        o.setReqSeqId("store-" + storePayment.getPayCode());
+                        o.setTransAmt(storePayment.getPayMoney().toString());
+                        o.setGoodsDesc("药品订单支付");
+                        HuifuCreateOrderResult result = huiFuService.createOrder(o);
+                        FsStorePayment mt = new FsStorePayment();
+                        mt.setPaymentId(storePayment.getPaymentId());
+                        mt.setTradeNo(result.getHf_seq_id());
+                        storePaymentService.updateFsStorePayment(mt);
+                        return R.ok().put("isPay", 0).put("data", result).put("type", "hf");
+                    }
+                }
+            }
+        }
+        else{
+            return R.error("用户不存在");
+        }
+        return R.error();
+    }
 }

+ 14 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductAttrValueServiceImpl.java

@@ -4,6 +4,8 @@ import java.util.List;
 
 import com.fs.his.param.FsStoreProductAttrValueListDParam;
 import com.fs.his.vo.FsStoreProductAttrValueListDVO;
+import com.fs.store.param.FsStoreProductAttrValueQueryParam;
+import com.fs.store.vo.FsStoreProductAttrValueQueryVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsStoreProductAttrValueMapper;
@@ -98,4 +100,16 @@ public class FsStoreProductAttrValueServiceImpl implements IFsStoreProductAttrVa
     public List<FsStoreProductAttrValueListDVO> selectFsStoreProductAttrValueListDVO(FsStoreProductAttrValueListDParam param) {
         return fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueListDVO(param);
     }
+
+    @Override
+    public List<FsStoreProductAttrValue> selectFsStoreProductAttrValueByProductId(Long productId) {
+        return fsStoreProductAttrValueMapper.selectFsStoreProductAttrValueByProductId(productId);
+    }
+
+    @Override
+    public List<FsStoreProductAttrValueQueryVO> selectStoreProductAttrValueListQuery(FsStoreProductAttrValueQueryParam param) {
+        return fsStoreProductAttrValueMapper.selectStoreProductAttrValueListQuery(param);
+    }
+
+
 }

+ 4 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductCategoryServiceImpl.java

@@ -166,6 +166,9 @@ public class FsStoreProductCategoryServiceImpl implements IFsStoreProductCategor
         }
         return v;
     }
-
+    @Override
+    public List<FsStoreProductCategory> selectFsStoreProductCategoryListQuery(FsStoreProductCategory param) {
+        return fsStoreProductCategoryMapper.selectFsStoreProductCategoryListQuery(param);
+    }
 
 }

+ 55 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStoreProductServiceImpl.java

@@ -29,6 +29,10 @@ import com.fs.his.mapper.FsStoreProductAttrValueMapper;
 import com.fs.his.param.FsStoreProductListSParam;
 import com.fs.his.service.IFsPackageService;
 import com.fs.his.vo.*;
+import com.fs.store.param.FsStoreProductQueryParam;
+import com.fs.store.vo.FsStoreProductActivityListVO;
+import com.fs.store.vo.FsStoreProductListQueryVO;
+import com.fs.store.vo.FsStoreProductQueryVO;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -783,5 +787,56 @@ public class FsStoreProductServiceImpl implements IFsStoreProductService
         return fsStoreProductMapper.selectFsStoreProductCount(type);
     }
 
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count) {
+        return fsStoreProductMapper.selectFsStoreProductNewQuery(count);
+    }
+
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count) {
+        return fsStoreProductMapper.selectFsStoreProductHotQuery(count);
+    }
+
+    @Override
+    public List<FsStoreProductActivityListVO> selectFsStoreProductByIds(String productIds) {
+        return fsStoreProductMapper.selectFsStoreProductByIds(productIds);
+    }
+
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductListQuery(FsStoreProductQueryParam param) {
+        return fsStoreProductMapper.selectFsStoreProductListQuery(param);
+    }
+
+    @Override
+    public FsStoreProductQueryVO selectFsStoreProductByIdQuery(Long productId) {
+        return fsStoreProductMapper.selectFsStoreProductByIdQuery(productId);
+    }
+
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductTuiQuery(int count) {
+        return fsStoreProductMapper.selectFsStoreProductTuiQuery(count);
+    }
+
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count) {
+        return fsStoreProductMapper.selectFsStoreProductGoodQuery(count);
+    }
+
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery() {
+        return fsStoreProductMapper.selectFsStoreProductTuiListQuery();
+    }
 
+    @Override
+    public List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery() {
+        return fsStoreProductMapper.selectFsStoreProductGoodListQuery();
+    }
+
+    @Override
+    public void decProductStock(Long productId, Long productAttrValueId, Integer cartNum) {
+        //处理属性sku
+        fsStoreProductAttrValueMapper.decProductAttrStock(productAttrValueId,cartNum);
+        fsStoreProductMapper.decProductAttrStock(productId,cartNum);
+
+    }
 }

+ 5 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsUserAddressServiceImpl.java

@@ -205,4 +205,9 @@ public class FsUserAddressServiceImpl implements IFsUserAddressService
         }
         return sb.toString().toLowerCase();
     }
+
+    @Override
+    public Integer delAllAddress(Long userId) {
+        return fsUserAddressMapper.delAllAddress(userId);
+    }
 }

+ 32 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsUserBillServiceImpl.java

@@ -1,9 +1,16 @@
 package com.fs.his.service.impl;
 
+import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
+
+import cn.hutool.json.JSONUtil;
 import com.fs.common.utils.DateUtils;
 import com.fs.his.param.FsUserBillParam;
 import com.fs.his.vo.FsUserBillVO;
+import com.fs.store.param.FsUserBillQueryParam;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.his.mapper.FsUserBillMapper;
@@ -19,6 +26,8 @@ import com.fs.his.service.IFsUserBillService;
 @Service
 public class FsUserBillServiceImpl implements IFsUserBillService
 {
+    Logger logger= LoggerFactory.getLogger(getClass());
+
     @Autowired
     private FsUserBillMapper fsUserBillMapper;
 
@@ -99,4 +108,27 @@ public class FsUserBillServiceImpl implements IFsUserBillService
     public List<FsUserBillVO> selectFsUserBillListVO(FsUserBillParam fsUserBill) {
         return fsUserBillMapper.selectFsUserBillListVO(fsUserBill);
     }
+
+    @Override
+    public List<FsUserBill> selectFsUserBillListQuery(FsUserBillQueryParam param) {
+        return fsUserBillMapper.selectFsUserBillListQuery(param);
+    }
+
+    @Override
+    public void addBill(Long uid, String cate,Integer billType,String title, double number, double balance, String renark,String busId,Long tuiUserId) {
+        FsUserBill bill=new FsUserBill();
+        bill.setCategory(cate);
+        bill.setBillType(billType);
+        bill.setUserId(uid);
+        bill.setTitle(title);
+        bill.setNumber(number);
+        bill.setBalance(new BigDecimal(balance));
+        bill.setRemark(renark);
+        bill.setBusinessId(busId);
+        bill.setStatus(1);
+        bill.setCreateTime(new Date());
+        bill.setTuiUserId(tuiUserId);
+        logger.info("加入addBill:"+ JSONUtil.toJsonStr(bill));
+        fsUserBillMapper.insertFsUserBill(bill);
+    }
 }

+ 10 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsUserServiceImpl.java

@@ -953,4 +953,14 @@ public class FsUserServiceImpl implements IFsUserService
         return fsUserCompanyUser;
     }
 
+    @Override
+    public FsUser selectFsUserByMaOpenId(String openid) {
+        return fsUserMapper.selectFsUserByMaOpenId(openid);
+    }
+
+    @Override
+    public int decIntegral(Long uid, double usedIntegral) {
+        return fsUserMapper.decIntegral(uid,usedIntegral);
+    }
+
 }

+ 15 - 0
fs-service/src/main/java/com/fs/his/utils/ConfigUtil.java

@@ -1,6 +1,7 @@
 package com.fs.his.utils;
 
 import com.alibaba.fastjson.JSON;
+import com.fs.his.config.FsErpConfig;
 import com.fs.his.config.FsSysConfig;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.mapper.SysConfigMapper;
@@ -14,6 +15,7 @@ import java.util.Map;
 @Service
 public class ConfigUtil {
     FsSysConfig fsSysConfig;
+    FsErpConfig fsErpConfig;
     @Autowired
     SysConfigMapper sysConfigMapper;
     public FsSysConfig getSysConfig(){
@@ -27,4 +29,17 @@ public class ConfigUtil {
             return this.fsSysConfig ;
         }
     }
+
+    public FsErpConfig getErpConfig(){
+
+        if (this.fsErpConfig==null){
+            SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("erp.config");
+            String configValue = sysConfig.getConfigValue();
+            FsErpConfig config = JSON.parseObject(configValue, FsErpConfig.class);
+            this.fsErpConfig=config;
+            return this.fsErpConfig;
+        }else {
+            return this.fsErpConfig ;
+        }
+    }
 }

+ 2 - 1
fs-service/src/main/java/com/fs/his/vo/FsStoreOrderListUVO.java

@@ -36,6 +36,7 @@ public class FsStoreOrderListUVO implements Serializable {
     private String itemJson;
     private BigDecimal billPrice;
 
-
+    //todo 加一个id给前端使用
+    private Long id;
 
 }

+ 16 - 0
fs-service/src/main/java/com/fs/store/config/StoreIntegralConfig.java

@@ -0,0 +1,16 @@
+package com.fs.store.config;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class StoreIntegralConfig implements Serializable {
+    private Double integralRatio;//积分比例
+    private Double integralMax; //最大使用积分
+    private BigDecimal integralFull;//满多少金额可用
+
+
+
+}

+ 24 - 0
fs-service/src/main/java/com/fs/store/constants/StoreConstants.java

@@ -0,0 +1,24 @@
+package com.fs.store.constants;
+
+public interface StoreConstants {
+
+    /**
+     * 订单自动取消时间(分钟)
+     */
+    long ORDER_OUTTIME_UNPAY = 30;
+    /**
+     * 订单自动收货时间(天)
+     */
+    long ORDER_OUTTIME_UNCONFIRM = 7;
+    /**
+     * redis订单未付款key
+     */
+    String REDIS_ORDER_OUTTIME_UNPAY = "order:unpay:";
+    /**
+     * redis订单收货key
+     */
+    String REDIS_ORDER_OUTTIME_UNCONFIRM = "order:unconfirm:";
+
+    String WECHAT_PUSH_REMARK = "FS为您服务!";
+    String DELIVERY = "delivery";
+}

+ 65 - 0
fs-service/src/main/java/com/fs/store/domain/FsArticleViews.java

@@ -0,0 +1,65 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 文章阅读对象 fs_article_views
+ * 
+ * @author fs
+ * @date 2022-03-25
+ */
+public class FsArticleViews extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long viewId;
+
+    /** 文章ID */
+    @Excel(name = "文章ID")
+    private Long articleId;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    public void setViewId(Long viewId) 
+    {
+        this.viewId = viewId;
+    }
+
+    public Long getViewId() 
+    {
+        return viewId;
+    }
+    public void setArticleId(Long articleId) 
+    {
+        this.articleId = articleId;
+    }
+
+    public Long getArticleId() 
+    {
+        return articleId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("viewId", getViewId())
+            .append("articleId", getArticleId())
+            .append("userId", getUserId())
+            .toString();
+    }
+}

+ 35 - 0
fs-service/src/main/java/com/fs/store/domain/FsMenu.java

@@ -0,0 +1,35 @@
+package com.fs.store.domain;
+
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 用户端菜单管理对象 fs_menu
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+@Data
+public class FsMenu extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long menuId;
+
+    private String menuName;
+
+    private String icon;
+
+    private Integer isShow;
+
+    private Integer linkType;
+
+    private String linkUrl;
+
+    private Integer sort;
+
+    private Integer menuType;//菜单类型
+
+
+}

+ 120 - 0
fs-service/src/main/java/com/fs/store/domain/FsShippingTemplates.java

@@ -0,0 +1,120 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+
+/**
+ * 运费模板对象 fs_shipping_templates
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsShippingTemplates extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 模板ID */
+    private Long id;
+
+    /** 模板名称 */
+    @Excel(name = "模板名称")
+    private String name;
+
+    /** 计费方式 */
+    @Excel(name = "计费方式")
+    private Integer type;
+
+    /** 地域以及费用 */
+    @Excel(name = "地域以及费用")
+    private String regionInfo;
+
+    /** 指定包邮开关 */
+    @Excel(name = "指定包邮开关")
+    private Integer appoint;
+
+    /** 指定包邮内容 */
+    @Excel(name = "指定包邮内容")
+    private String appointInfo;
+
+    /** $column.columnComment */
+    @Excel(name = "指定包邮内容")
+    private Integer isDel;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setType(Integer type) 
+    {
+        this.type = type;
+    }
+
+    public Integer getType() 
+    {
+        return type;
+    }
+    public void setRegionInfo(String regionInfo) 
+    {
+        this.regionInfo = regionInfo;
+    }
+
+    public String getRegionInfo() 
+    {
+        return regionInfo;
+    }
+    public void setAppoint(Integer appoint) 
+    {
+        this.appoint = appoint;
+    }
+
+    public Integer getAppoint() 
+    {
+        return appoint;
+    }
+    public void setAppointInfo(String appointInfo) 
+    {
+        this.appointInfo = appointInfo;
+    }
+
+    public String getAppointInfo() 
+    {
+        return appointInfo;
+    }
+    public void setIsDel(Integer isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel() 
+    {
+        return isDel;
+    }
+    public void setSort(Long sort) 
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort() 
+    {
+        return sort;
+    }
+
+
+}

+ 112 - 0
fs-service/src/main/java/com/fs/store/domain/FsShippingTemplatesFree.java

@@ -0,0 +1,112 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Builder;
+
+import java.math.BigDecimal;
+
+@Builder
+/**
+ * 免邮费对象 fs_shipping_templates_free
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsShippingTemplatesFree extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 模板ID */
+    @Excel(name = "模板ID")
+    private Long tempId;
+
+    /** 省ID */
+    @Excel(name = "省ID")
+    private Long provinceId;
+
+    /** 城市ID */
+    @Excel(name = "城市ID")
+    private Long cityId;
+
+    /** 包邮件数 */
+    @Excel(name = "包邮件数")
+    private BigDecimal number;
+
+    /** 包邮金额 */
+    @Excel(name = "包邮金额")
+    private BigDecimal price;
+
+    /** 计费方式 */
+    @Excel(name = "计费方式")
+    private Integer type;
+
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTempId(Long tempId) 
+    {
+        this.tempId = tempId;
+    }
+
+    public Long getTempId() 
+    {
+        return tempId;
+    }
+    public void setProvinceId(Long provinceId) 
+    {
+        this.provinceId = provinceId;
+    }
+
+    public Long getProvinceId() 
+    {
+        return provinceId;
+    }
+    public void setCityId(Long cityId) 
+    {
+        this.cityId = cityId;
+    }
+
+    public Long getCityId() 
+    {
+        return cityId;
+    }
+    public void setNumber(BigDecimal number) 
+    {
+        this.number = number;
+    }
+
+    public BigDecimal getNumber() 
+    {
+        return number;
+    }
+    public void setPrice(BigDecimal price) 
+    {
+        this.price = price;
+    }
+
+    public BigDecimal getPrice() 
+    {
+        return price;
+    }
+    public void setType(Integer type) 
+    {
+        this.type = type;
+    }
+
+    public Integer getType() 
+    {
+        return type;
+    }
+
+}

+ 138 - 0
fs-service/src/main/java/com/fs/store/domain/FsShippingTemplatesRegion.java

@@ -0,0 +1,138 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Builder;
+
+import java.math.BigDecimal;
+
+@Builder
+/**
+ * 邮费区域对象 fs_shipping_templates_region
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsShippingTemplatesRegion extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 编号 */
+    private Long id;
+
+    /** 省ID */
+    @Excel(name = "省ID")
+    private Long provinceId;
+
+    /** 模板ID */
+    @Excel(name = "模板ID")
+    private Long tempId;
+
+    /** 城市ID */
+    @Excel(name = "城市ID")
+    private Long cityId;
+
+    /** 首件 */
+    @Excel(name = "首件")
+    private BigDecimal first;
+
+    /** 首件运费 */
+    @Excel(name = "首件运费")
+    private BigDecimal firstPrice;
+
+    /** 续件 */
+    @Excel(name = "续件")
+    private BigDecimal continues;
+
+    /** 续件运费 */
+    @Excel(name = "续件运费")
+    private BigDecimal continuePrice;
+
+    /** 计费方式 */
+    @Excel(name = "计费方式")
+    private Integer type;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setProvinceId(Long provinceId) 
+    {
+        this.provinceId = provinceId;
+    }
+
+    public Long getProvinceId() 
+    {
+        return provinceId;
+    }
+    public void setTempId(Long tempId) 
+    {
+        this.tempId = tempId;
+    }
+
+    public Long getTempId() 
+    {
+        return tempId;
+    }
+    public void setCityId(Long cityId) 
+    {
+        this.cityId = cityId;
+    }
+
+    public Long getCityId() 
+    {
+        return cityId;
+    }
+    public void setFirst(BigDecimal first) 
+    {
+        this.first = first;
+    }
+
+    public BigDecimal getFirst() 
+    {
+        return first;
+    }
+    public void setFirstPrice(BigDecimal firstPrice) 
+    {
+        this.firstPrice = firstPrice;
+    }
+
+    public BigDecimal getFirstPrice() 
+    {
+        return firstPrice;
+    }
+    public void setContinues(BigDecimal continues) 
+    {
+        this.continues = continues;
+    }
+
+    public BigDecimal getContinues() 
+    {
+        return continues;
+    }
+    public void setContinuePrice(BigDecimal continuePrice) 
+    {
+        this.continuePrice = continuePrice;
+    }
+
+    public BigDecimal getContinuePrice() 
+    {
+        return continuePrice;
+    }
+    public void setType(Integer type) 
+    {
+        this.type = type;
+    }
+
+    public Integer getType() 
+    {
+        return type;
+    }
+
+
+}

+ 131 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreActivity.java

@@ -0,0 +1,131 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+
+/**
+ * 活动对象 fs_store_activity
+ * 
+ * @author fs
+ * @date 2022-11-18
+ */
+public class FsStoreActivity extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long activityId;
+
+    /** 标题 */
+    @Excel(name = "标题")
+    private String title;
+
+    /** 描述 */
+    @Excel(name = "描述")
+    private String descs;
+
+    /** 封面图 */
+    @Excel(name = "封面图")
+    private String logoUrl;
+
+    /** 活动图 */
+    @Excel(name = "活动图")
+    private String images;
+
+    /** 活动商品 */
+    @Excel(name = "活动商品")
+    private String productIds;
+
+    /** 活动内容 */
+    @Excel(name = "活动内容")
+    private String content;
+
+    /** 状态 0禁用 1启用 */
+    @Excel(name = "状态 0禁用 1启用")
+    private Integer status;
+
+    private Integer shareNumber;
+
+    public Integer getShareNumber() {
+        return shareNumber;
+    }
+
+    public void setShareNumber(Integer shareNumber) {
+        this.shareNumber = shareNumber;
+    }
+
+    public String getDescs() {
+        return descs;
+    }
+
+    public void setDescs(String descs) {
+        this.descs = descs;
+    }
+
+    public void setActivityId(Long activityId)
+    {
+        this.activityId = activityId;
+    }
+
+    public Long getActivityId() 
+    {
+        return activityId;
+    }
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }
+
+    public String getTitle() 
+    {
+        return title;
+    }
+
+    public void setLogoUrl(String logoUrl) 
+    {
+        this.logoUrl = logoUrl;
+    }
+
+    public String getLogoUrl() 
+    {
+        return logoUrl;
+    }
+    public void setImages(String images) 
+    {
+        this.images = images;
+    }
+
+    public String getImages() 
+    {
+        return images;
+    }
+    public void setProductIds(String productIds) 
+    {
+        this.productIds = productIds;
+    }
+
+    public String getProductIds() 
+    {
+        return productIds;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+
+
+}

+ 109 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreCanvas.java

@@ -0,0 +1,109 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 画布信息对象 fs_store_canvas
+ * 
+ * @author fs
+ * @date 2022-08-29
+ */
+public class FsStoreCanvas extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 画布id */
+    private Long canvasId;
+
+    /** 终端 1-小程序 */
+    @Excel(name = "终端 1-小程序")
+    private Integer terminal;
+
+    /** 画布json数据 */
+    @Excel(name = "画布json数据")
+    private String json;
+
+    /** 类型 1-系统画布 2-自定义页面 3-商家店铺装修 */
+    @Excel(name = "类型 1-系统画布 2-自定义页面 3-商家店铺装修")
+    private Integer type;
+
+    /** 名称 */
+    @Excel(name = "名称")
+    private String name;
+
+    /** 删除标识 */
+    @Excel(name = "删除标识")
+    private Integer isDel;
+
+    public void setCanvasId(Long canvasId) 
+    {
+        this.canvasId = canvasId;
+    }
+
+    public Long getCanvasId() 
+    {
+        return canvasId;
+    }
+    public void setTerminal(Integer terminal) 
+    {
+        this.terminal = terminal;
+    }
+
+    public Integer getTerminal() 
+    {
+        return terminal;
+    }
+    public void setJson(String json) 
+    {
+        this.json = json;
+    }
+
+    public String getJson() 
+    {
+        return json;
+    }
+    public void setType(Integer type) 
+    {
+        this.type = type;
+    }
+
+    public Integer getType() 
+    {
+        return type;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setIsDel(Integer isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel() 
+    {
+        return isDel;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("canvasId", getCanvasId())
+            .append("terminal", getTerminal())
+            .append("json", getJson())
+            .append("type", getType())
+            .append("name", getName())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("isDel", getIsDel())
+            .toString();
+    }
+}

+ 58 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreCart.java

@@ -0,0 +1,58 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.*;
+
+/**
+ * 购物车对象 fs_store_cart
+ * 
+ * @author fs
+ * @date 2022-03-21
+ */
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class FsStoreCart extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 购物车表ID */
+    private Long id;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 类型 */
+    @Excel(name = "类型")
+    private String type;
+
+    /** 商品ID */
+    @Excel(name = "商品ID")
+    private Long productId;
+
+    /** $column.columnComment */
+    @Excel(name = "商品ID")
+    private Long productAttrValueId;
+
+    /** 商品数量 */
+    @Excel(name = "商品数量")
+    private Integer cartNum;
+
+    /** 0 = 未购买 1 = 已购买 */
+    @Excel(name = "0 = 未购买 1 = 已购买")
+    private Integer isPay;
+
+    /** 是否删除 */
+    @Excel(name = "是否删除")
+    private Integer isDel;
+
+    /** 是否为立即购买 */
+    @Excel(name = "是否为立即购买")
+    private Integer isBuy;
+
+
+}

+ 192 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreCoupon.java

@@ -0,0 +1,192 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.math.BigDecimal;
+
+/**
+ * 优惠券对象 fs_store_coupon
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsStoreCoupon extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 优惠券表ID */
+    private Long couponId;
+
+    /** 优惠券名称 */
+    @Excel(name = "优惠券名称")
+    private String title;
+
+    /** 兑换消耗积分值 */
+    @Excel(name = "兑换消耗积分值")
+    private Long integral;
+
+    /** 兑换的优惠券面值 */
+    @Excel(name = "兑换的优惠券面值")
+    private BigDecimal couponPrice;
+
+    /** 最低消费多少金额可用优惠券 */
+    @Excel(name = "最低消费多少金额可用优惠券")
+    private BigDecimal useMinPrice;
+
+    /** 优惠券有效期限(单位:天) */
+    @Excel(name = "优惠券有效期限", readConverterExp = "单=位:天")
+    private Long couponTime;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Long sort;
+
+    /** 状态(0:关闭,1:开启) */
+    @Excel(name = "状态", readConverterExp = "0=:关闭,1:开启")
+    private Integer status;
+
+    /** 商品ids */
+    @Excel(name = "商品ids")
+    private String productIds;
+
+    @Excel(name = "套餐分类IDS")
+    private String packageCateIds;
+
+    /** 优惠券类型 0-通用 1-商品券 */
+    @Excel(name = "优惠券类型 0-通用 1-商品券")
+    private Integer type;
+
+    /** 是否删除 */
+    @Excel(name = "是否删除")
+    private Integer isDel;
+
+    public String getPackageCateIds() {
+        return packageCateIds;
+    }
+
+    public void setPackageCateIds(String packageCateIds) {
+        this.packageCateIds = packageCateIds;
+    }
+
+    public void setCouponId(Long couponId)
+    {
+        this.couponId = couponId;
+    }
+
+    public Long getCouponId() 
+    {
+        return couponId;
+    }
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }
+
+    public String getTitle() 
+    {
+        return title;
+    }
+    public void setIntegral(Long integral) 
+    {
+        this.integral = integral;
+    }
+
+    public Long getIntegral() 
+    {
+        return integral;
+    }
+    public void setCouponPrice(BigDecimal couponPrice) 
+    {
+        this.couponPrice = couponPrice;
+    }
+
+    public BigDecimal getCouponPrice() 
+    {
+        return couponPrice;
+    }
+    public void setUseMinPrice(BigDecimal useMinPrice) 
+    {
+        this.useMinPrice = useMinPrice;
+    }
+
+    public BigDecimal getUseMinPrice() 
+    {
+        return useMinPrice;
+    }
+    public void setCouponTime(Long couponTime) 
+    {
+        this.couponTime = couponTime;
+    }
+
+    public Long getCouponTime() 
+    {
+        return couponTime;
+    }
+    public void setSort(Long sort) 
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort() 
+    {
+        return sort;
+    }
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+    public void setProductIds(String productIds) 
+    {
+        this.productIds = productIds;
+    }
+
+    public String getProductIds() 
+    {
+        return productIds;
+    }
+    public void setType(Integer type)
+    {
+        this.type = type;
+    }
+
+    public Integer getType()
+    {
+        return type;
+    }
+    public void setIsDel(Integer isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel() 
+    {
+        return isDel;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("couponId", getCouponId())
+            .append("title", getTitle())
+            .append("integral", getIntegral())
+            .append("couponPrice", getCouponPrice())
+            .append("useMinPrice", getUseMinPrice())
+            .append("couponTime", getCouponTime())
+            .append("sort", getSort())
+            .append("status", getStatus())
+            .append("productIds", getProductIds())
+            .append("type", getType())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("isDel", getIsDel())
+            .toString();
+    }
+}

+ 175 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreCouponIssue.java

@@ -0,0 +1,175 @@
+package com.fs.store.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 优惠券领取对象 fs_store_coupon_issue
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsStoreCouponIssue extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** $column.columnComment */
+    private String couponName;
+
+    /** 优惠券ID */
+    @Excel(name = "优惠券ID")
+    private Long couponId;
+
+    /** 优惠券类型 0-通用 1-商品券 */
+    @Excel(name = "优惠券类型 0-通用 1-商品券")
+    private Integer couponType;
+
+    /** 优惠券领取开启时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "优惠券领取开启时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /** 优惠券领取结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "优惠券领取结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date limitTime;
+
+    /** 优惠券领取数量 */
+    @Excel(name = "优惠券领取数量")
+    private Integer totalCount;
+
+    /** 优惠券剩余领取数量 */
+    @Excel(name = "优惠券剩余领取数量")
+    private Integer remainCount;
+
+    /** 是否无限张数 */
+    @Excel(name = "是否无限张数")
+    private Integer isPermanent;
+
+    /** 1 正常 0 未开启 -1 已无效 */
+    @Excel(name = "1 正常 0 未开启 -1 已无效")
+    private Integer status;
+
+    /** $column.columnComment */
+    @Excel(name = "1 正常 0 未开启 -1 已无效")
+    private Integer isDel;
+
+    private BigDecimal couponPrice;
+
+    public BigDecimal getCouponPrice() {
+        return couponPrice;
+    }
+
+    public void setCouponPrice(BigDecimal couponPrice) {
+        this.couponPrice = couponPrice;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setCouponName(String couponName)
+    {
+        this.couponName = couponName;
+    }
+
+    public String getCouponName()
+    {
+        return couponName;
+    }
+    public void setCouponId(Long couponId)
+    {
+        this.couponId = couponId;
+    }
+
+    public Long getCouponId()
+    {
+        return couponId;
+    }
+
+
+
+    public Integer getCouponType() {
+        return couponType;
+    }
+
+    public void setCouponType(Integer couponType) {
+        this.couponType = couponType;
+    }
+
+    public void setStartTime(Date startTime)
+    {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime()
+    {
+        return startTime;
+    }
+
+    public void setTotalCount(Integer totalCount)
+    {
+        this.totalCount = totalCount;
+    }
+
+    public Integer getTotalCount()
+    {
+        return totalCount;
+    }
+    public void setRemainCount(Integer remainCount)
+    {
+        this.remainCount = remainCount;
+    }
+
+    public Integer getRemainCount()
+    {
+        return remainCount;
+    }
+    public void setIsPermanent(Integer isPermanent)
+    {
+        this.isPermanent = isPermanent;
+    }
+
+    public Integer getIsPermanent()
+    {
+        return isPermanent;
+    }
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus()
+    {
+        return status;
+    }
+    public void setIsDel(Integer isDel)
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel()
+    {
+        return isDel;
+    }
+
+    public Date getLimitTime() {
+        return limitTime;
+    }
+
+    public void setLimitTime(Date limitTime) {
+        this.limitTime = limitTime;
+    }
+}

+ 81 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreCouponIssueUser.java

@@ -0,0 +1,81 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 优惠券用户领取记录对象 fs_store_coupon_issue_user
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsStoreCouponIssueUser extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 领取优惠券用户ID */
+    @Excel(name = "领取优惠券用户ID")
+    private Long userId;
+
+    /** 优惠券领取ID */
+    @Excel(name = "优惠券领取ID")
+    private Long issueId;
+
+    /** $column.columnComment */
+    @Excel(name = "优惠券领取ID")
+    private Integer isDel;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setIssueId(Long issueId) 
+    {
+        this.issueId = issueId;
+    }
+
+    public Long getIssueId() 
+    {
+        return issueId;
+    }
+    public void setIsDel(Integer isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel() 
+    {
+        return isDel;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("userId", getUserId())
+            .append("issueId", getIssueId())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("isDel", getIsDel())
+            .toString();
+    }
+}

+ 179 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreCouponUser.java

@@ -0,0 +1,179 @@
+package com.fs.store.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 优惠券发放记录对象 fs_store_coupon_user
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsStoreCouponUser extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 优惠券发放记录id */
+    private Long id;
+
+    /** 兑换的项目id */
+    @Excel(name = "兑换的项目id")
+    private Long couponId;
+
+    /** 优惠券所属用户 */
+    @Excel(name = "优惠券所属用户")
+    private Long userId;
+
+    /** 优惠券名称 */
+    @Excel(name = "优惠券名称")
+    private String couponTitle;
+
+    /** 优惠券的面值 */
+    @Excel(name = "优惠券的面值")
+    private BigDecimal couponPrice;
+
+    /** 最低消费多少金额可用优惠券 */
+    @Excel(name = "最低消费多少金额可用优惠券")
+    private BigDecimal useMinPrice;
+
+    /** 优惠券结束时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "优惠券结束时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date limitTime;
+
+    /** 使用时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date useTime;
+
+    /** 获取方式 */
+    @Excel(name = "获取方式")
+    private String type;
+
+    /** 状态(0:未使用,1:已使用, 2:已过期) */
+    @Excel(name = "状态", readConverterExp = "0=:未使用,1:已使用,,2=:已过期")
+    private Integer status;
+
+    /** 是否有效 */
+    @Excel(name = "是否有效")
+    private Integer isFail;
+
+    /** $column.columnComment */
+    @Excel(name = "是否有效")
+    private Integer isDel;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setCouponId(Long couponId) 
+    {
+        this.couponId = couponId;
+    }
+
+    public Long getCouponId() 
+    {
+        return couponId;
+    }
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setCouponTitle(String couponTitle) 
+    {
+        this.couponTitle = couponTitle;
+    }
+
+    public String getCouponTitle() 
+    {
+        return couponTitle;
+    }
+    public void setCouponPrice(BigDecimal couponPrice) 
+    {
+        this.couponPrice = couponPrice;
+    }
+
+    public BigDecimal getCouponPrice() 
+    {
+        return couponPrice;
+    }
+    public void setUseMinPrice(BigDecimal useMinPrice) 
+    {
+        this.useMinPrice = useMinPrice;
+    }
+
+    public BigDecimal getUseMinPrice() 
+    {
+        return useMinPrice;
+    }
+
+    public Date getLimitTime() {
+        return limitTime;
+    }
+
+    public void setLimitTime(Date limitTime) {
+        this.limitTime = limitTime;
+    }
+
+    public void setUseTime(Date useTime)
+    {
+        this.useTime = useTime;
+    }
+
+    public Date getUseTime() 
+    {
+        return useTime;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+    public void setIsFail(Integer isFail) 
+    {
+        this.isFail = isFail;
+    }
+
+    public Integer getIsFail() 
+    {
+        return isFail;
+    }
+    public void setIsDel(Integer isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel() 
+    {
+        return isDel;
+    }
+
+
+}

+ 97 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreOrderStatus.java

@@ -0,0 +1,97 @@
+package com.fs.store.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.Date;
+
+/**
+ * 订单操作记录对象 fs_store_order_status
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsStoreOrderStatus extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 订单id */
+    @Excel(name = "订单id")
+    private Long orderId;
+
+    /** 操作类型 */
+    @Excel(name = "操作类型")
+    private String changeType;
+
+    /** 操作备注 */
+    @Excel(name = "操作备注")
+    private String changeMessage;
+
+    /** 操作时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date changeTime;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setOrderId(Long orderId) 
+    {
+        this.orderId = orderId;
+    }
+
+    public Long getOrderId() 
+    {
+        return orderId;
+    }
+    public void setChangeType(String changeType) 
+    {
+        this.changeType = changeType;
+    }
+
+    public String getChangeType() 
+    {
+        return changeType;
+    }
+    public void setChangeMessage(String changeMessage) 
+    {
+        this.changeMessage = changeMessage;
+    }
+
+    public String getChangeMessage() 
+    {
+        return changeMessage;
+    }
+    public void setChangeTime(Date changeTime) 
+    {
+        this.changeTime = changeTime;
+    }
+
+    public Date getChangeTime() 
+    {
+        return changeTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("orderId", getOrderId())
+            .append("changeType", getChangeType())
+            .append("changeMessage", getChangeMessage())
+            .append("changeTime", getChangeTime())
+            .toString();
+    }
+}

+ 78 - 0
fs-service/src/main/java/com/fs/store/domain/FsStoreProductRelation.java

@@ -0,0 +1,78 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+
+/**
+ * 商品点赞和收藏对象 fs_store_product_relation
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsStoreProductRelation extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 商品ID */
+    @Excel(name = "商品ID")
+    private Long productId;
+
+    /** 类型(收藏(collect)、点赞(like)) */
+    @Excel(name = "类型(收藏(collect)、点赞(like))")
+    private String type;
+
+
+    /** $column.columnComment */
+    @Excel(name = "某种类型的商品(普通商品、秒杀商品)")
+    private Integer isDel;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Long productId) {
+        this.productId = productId;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Integer getIsDel() {
+        return isDel;
+    }
+
+    public void setIsDel(Integer isDel) {
+        this.isDel = isDel;
+    }
+}

+ 137 - 0
fs-service/src/main/java/com/fs/store/domain/FsWechatTemplate.java

@@ -0,0 +1,137 @@
+package com.fs.store.domain;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 微信模板对象 fs_wechat_template
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public class FsWechatTemplate extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 模板id */
+    private Integer id;
+
+    /** 模板编号 */
+    @Excel(name = "模板编号")
+    private String tempkey;
+
+    /** 模板名 */
+    @Excel(name = "模板名")
+    private String name;
+
+    /** 回复内容 */
+    @Excel(name = "回复内容")
+    private String content;
+
+    /** 模板ID */
+    @Excel(name = "模板ID")
+    private String tempId;
+
+    /** 状态 */
+    @Excel(name = "状态")
+    private Integer status;
+
+    /** $column.columnComment */
+    @Excel(name = "状态")
+    private Integer isDel;
+
+    /** 类型:template:模板消息 subscribe:订阅消息 */
+    @Excel(name = "类型:template:模板消息 subscribe:订阅消息")
+    private String type;
+
+    public void setId(Integer id) 
+    {
+        this.id = id;
+    }
+
+    public Integer getId() 
+    {
+        return id;
+    }
+    public void setTempkey(String tempkey) 
+    {
+        this.tempkey = tempkey;
+    }
+
+    public String getTempkey() 
+    {
+        return tempkey;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setTempId(String tempId) 
+    {
+        this.tempId = tempId;
+    }
+
+    public String getTempId() 
+    {
+        return tempId;
+    }
+    public void setStatus(Integer status) 
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus() 
+    {
+        return status;
+    }
+    public void setIsDel(Integer isDel) 
+    {
+        this.isDel = isDel;
+    }
+
+    public Integer getIsDel() 
+    {
+        return isDel;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("tempkey", getTempkey())
+            .append("name", getName())
+            .append("content", getContent())
+            .append("tempId", getTempId())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("status", getStatus())
+            .append("isDel", getIsDel())
+            .append("type", getType())
+            .toString();
+    }
+}

+ 20 - 0
fs-service/src/main/java/com/fs/store/dto/AppointInfoDTO.java

@@ -0,0 +1,20 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class AppointInfoDTO implements Serializable {
+    private String number;
+
+    /** 包邮费用 */
+    private String price;
+
+    /** 包邮地区 */
+    private List<RegionDTO> place;
+
+    private String placeName;
+
+}

+ 33 - 0
fs-service/src/main/java/com/fs/store/dto/FsStoreOrderComputeDTO.java

@@ -0,0 +1,33 @@
+package com.fs.store.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class FsStoreOrderComputeDTO implements Serializable
+{
+
+    private BigDecimal payPrice;
+
+    private BigDecimal totalPrice;
+
+    private Double usedIntegral; //使用了多少积分
+
+    private BigDecimal payIntegral;
+
+    private BigDecimal serviceFee; //服务费
+
+    private BigDecimal payPostage;
+
+    private BigDecimal deductionPrice;
+
+
+}

+ 22 - 0
fs-service/src/main/java/com/fs/store/dto/FsStoreOrderPriceDTO.java

@@ -0,0 +1,22 @@
+package com.fs.store.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+ public class FsStoreOrderPriceDTO implements Serializable
+{
+    private BigDecimal totalPrice;//总价
+
+    private BigDecimal costPrice;//成本价
+
+    private BigDecimal storeFreePostage;//包邮邮费
+
+    private BigDecimal storePostage;//邮费
+
+    private BigDecimal payIntegral;//积分
+
+
+}

+ 15 - 0
fs-service/src/main/java/com/fs/store/dto/RegionDTO.java

@@ -0,0 +1,15 @@
+package com.fs.store.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Getter
+@Setter
+public class RegionDTO implements Serializable {
+    private String name;
+    private String cityId;
+    List<RegionDTO> children;
+}

+ 34 - 0
fs-service/src/main/java/com/fs/store/dto/RegionInfoDTO.java

@@ -0,0 +1,34 @@
+package com.fs.store.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.List;
+
+
+@Getter
+@Setter
+public class RegionInfoDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @NotBlank(message = "请填写可配送区域")
+    private String regionName;
+
+    @NotBlank(message = "请填写首件")
+    private String first;
+
+    @NotBlank(message = "请填写首件价格")
+    private String price;
+
+    @NotBlank(message = "请填写续件")
+    @JsonProperty("continues")
+    private String continues;
+
+    @NotBlank(message = "请填写续件价格")
+    private String continuePrice;
+
+    private List<RegionDTO> region;
+}

+ 21 - 0
fs-service/src/main/java/com/fs/store/dto/TemplateDTO.java

@@ -0,0 +1,21 @@
+package com.fs.store.dto;
+
+import lombok.*;
+
+import java.math.BigDecimal;
+
+@Getter
+@Setter
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+public class TemplateDTO {
+    private Double number;
+    private BigDecimal price;
+    private Double first;
+    private BigDecimal firstPrice;
+    private Double continues;
+    private BigDecimal continuePrice;
+    private Long tempId;
+    private String cityId;
+}

+ 44 - 0
fs-service/src/main/java/com/fs/store/enums/OrderLogEnum.java

@@ -0,0 +1,44 @@
+package com.fs.store.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.stream.Stream;
+
+@Getter
+@AllArgsConstructor
+public enum OrderLogEnum {
+    REFUND_ORDER_SUCCESS("refund_price_success","退款成功"),
+    ORDER_EDIT("order_edit","订单改价"),
+    REMOVE_ORDER("remove_order","删除订单"),
+    EVAL_ORDER("order_eval","用户评价"),
+    REFUND_ORDER_APPLY("apply_refund","用户申请退款"),
+    TAKE_ORDER_DELIVERY("user_take_delivery","用户已收货"),
+    PAY_ORDER_SUCCESS("pay_success","用户付款成功"),
+    PAY_REMAIN_ORDER_SUCCESS("pay_remain_success","用户付款尾款成功"),
+
+    CREATE_ORDER("create_order","订单生成"),
+    CANCEL_ORDER("cancel_order","订单已取消"),
+    NONE_ORDER("NONE","订单OK"),
+    DELIVERY_GOODS("delivery_goods", "订单发货"),
+    FINISH_ORDER("finish","确认收货"),
+    LOCK_TUI_MONEY("lock_tui_money","冻结推广金"),
+    UNLOCK_TUI_MONEY("unlock_tui_money","解冻推广金"),
+    EDIT_ORDER_PRICE("edit_order_money","改价");
+
+    private String value;
+    private String desc;
+
+
+
+    public static OrderLogEnum toType(String value) {
+        return Stream.of(OrderLogEnum.values())
+                .filter(p -> p.value.equals(value))
+                .findAny()
+                .orElse(null);
+    }
+
+    public static String getDesc(String value) {
+        return toType(value) == null ? null : toType(value).desc;
+    }
+}

+ 15 - 0
fs-service/src/main/java/com/fs/store/enums/ShippingTempEnum.java

@@ -0,0 +1,15 @@
+package com.fs.store.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+public enum ShippingTempEnum {
+    TYPE_1(1,"按件数"),
+    TYPE_2(2,"按重量"),
+    TYPE_3(3,"按体积");
+
+    private Integer value;
+    private String desc;
+}

+ 91 - 0
fs-service/src/main/java/com/fs/store/mapper/FsArticleViewsMapper.java

@@ -0,0 +1,91 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsArticleViews;
+import com.fs.store.param.FsArticleViewListParam;
+import com.fs.store.param.FsArticleViewListQueryParam;
+import com.fs.store.vo.FsArticleViewListQueryVO;
+import com.fs.store.vo.FsArticleViewListVO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 文章阅读Mapper接口
+ *
+ * @author fs
+ * @date 2022-03-25
+ */
+public interface FsArticleViewsMapper
+{
+    /**
+     * 查询文章阅读
+     *
+     * @param viewId 文章阅读ID
+     * @return 文章阅读
+     */
+    public FsArticleViews selectFsArticleViewsById(Long viewId);
+
+    /**
+     * 查询文章阅读列表
+     *
+     * @param fsArticleViews 文章阅读
+     * @return 文章阅读集合
+     */
+    public List<FsArticleViews> selectFsArticleViewsList(FsArticleViews fsArticleViews);
+
+    /**
+     * 新增文章阅读
+     *
+     * @param fsArticleViews 文章阅读
+     * @return 结果
+     */
+    public int insertFsArticleViews(FsArticleViews fsArticleViews);
+
+    /**
+     * 修改文章阅读
+     *
+     * @param fsArticleViews 文章阅读
+     * @return 结果
+     */
+    public int updateFsArticleViews(FsArticleViews fsArticleViews);
+
+    /**
+     * 删除文章阅读
+     *
+     * @param viewId 文章阅读ID
+     * @return 结果
+     */
+    public int deleteFsArticleViewsById(Long viewId);
+    public int deleteFsArticleViewsByIds(Long[] viewIds);
+    /**
+     * 批量删除文章阅读
+     *
+     * @param viewIds 需要删除的数据ID
+     * @return 结果
+     */
+
+
+    @Select("select u.user_id,u.avatar from fs_article_views v left join  fs_user u on u.user_id=v.user_id  where v.article_id=#{articleId} order by v.view_id desc  limit 3 ")
+    List<FsArticleViewListQueryVO> selectFsArticleViewsTopByArticleId(Long articleId);
+
+
+    @Select({"<script> " +
+            "select u.user_id,u.avatar,u.nickname from fs_article_views v left join  fs_user u on u.user_id=v.user_id   " +
+            "where 1=1 " +
+            "<if test = 'maps.articleId != null    '> " +
+            "and v.article_id =#{maps.articleId} " +
+            "</if>" +
+            " order by v.view_id desc "+
+            "</script>"})
+    List<FsArticleViewListQueryVO> selectFsArticleViewsListQueryVO(@Param("maps") FsArticleViewListQueryParam param);
+    @Select({"<script> " +
+            "select v.*, a.title as article_title,  u.user_id,u.avatar,u.nickname from fs_article_views v left join fs_user u on u.user_id=v.user_id left join fs_article a on v.article_id=a.article_id   " +
+            "where 1=1 " +
+            "<if test = 'maps.articleTitle != null and  maps.articleTitle !=\"\"    '> " +
+            "and a.title like CONCAT('%',#{maps.articleTitle},'%') " +
+            "</if>" +
+            " order by v.view_id desc "+
+            "</script>"})
+    List<FsArticleViewListVO> selectFsArticleViewsListVO(@Param("maps") FsArticleViewListParam param);
+}

+ 62 - 0
fs-service/src/main/java/com/fs/store/mapper/FsMenuMapper.java

@@ -0,0 +1,62 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsMenu;
+
+import java.util.List;
+
+/**
+ * 用户端菜单管理Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsMenuMapper 
+{
+    /**
+     * 查询用户端菜单管理
+     * 
+     * @param menuId 用户端菜单管理ID
+     * @return 用户端菜单管理
+     */
+    public FsMenu selectFsMenuById(Long menuId);
+
+    /**
+     * 查询用户端菜单管理列表
+     * 
+     * @param fsMenu 用户端菜单管理
+     * @return 用户端菜单管理集合
+     */
+    public List<FsMenu> selectFsMenuList(FsMenu fsMenu);
+
+    /**
+     * 新增用户端菜单管理
+     * 
+     * @param fsMenu 用户端菜单管理
+     * @return 结果
+     */
+    public int insertFsMenu(FsMenu fsMenu);
+
+    /**
+     * 修改用户端菜单管理
+     * 
+     * @param fsMenu 用户端菜单管理
+     * @return 结果
+     */
+    public int updateFsMenu(FsMenu fsMenu);
+
+    /**
+     * 删除用户端菜单管理
+     * 
+     * @param menuId 用户端菜单管理ID
+     * @return 结果
+     */
+    public int deleteFsMenuById(Long menuId);
+
+    /**
+     * 批量删除用户端菜单管理
+     * 
+     * @param menuIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsMenuByIds(Long[] menuIds);
+}

+ 90 - 0
fs-service/src/main/java/com/fs/store/mapper/FsShippingTemplatesFreeMapper.java

@@ -0,0 +1,90 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsShippingTemplatesFree;
+import com.fs.store.dto.TemplateDTO;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 免邮费Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsShippingTemplatesFreeMapper 
+{
+    /**
+     * 查询免邮费
+     * 
+     * @param id 免邮费ID
+     * @return 免邮费
+     */
+    public FsShippingTemplatesFree selectFsShippingTemplatesFreeById(Long id);
+
+    /**
+     * 查询免邮费列表
+     * 
+     * @param fsShippingTemplatesFree 免邮费
+     * @return 免邮费集合
+     */
+    public List<FsShippingTemplatesFree> selectFsShippingTemplatesFreeList(FsShippingTemplatesFree fsShippingTemplatesFree);
+
+    /**
+     * 新增免邮费
+     * 
+     * @param fsShippingTemplatesFree 免邮费
+     * @return 结果
+     */
+    public int insertFsShippingTemplatesFree(FsShippingTemplatesFree fsShippingTemplatesFree);
+
+    /**
+     * 修改免邮费
+     * 
+     * @param fsShippingTemplatesFree 免邮费
+     * @return 结果
+     */
+    public int updateFsShippingTemplatesFree(FsShippingTemplatesFree fsShippingTemplatesFree);
+
+    /**
+     * 删除免邮费
+     * 
+     * @param id 免邮费ID
+     * @return 结果
+     */
+    public int deleteFsShippingTemplatesFreeById(Long id);
+
+    /**
+     * 批量删除免邮费
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsShippingTemplatesFreeByIds(Long[] ids);
+
+    @Delete("delete from fs_shipping_templates_free where temp_id=#{tempId}")
+    int deleteFsShippingTemplatesFreeByTempId(Long tempId);
+    @Select({"<script> " +
+            "select count(1) from fs_shipping_templates_free " +
+            "where 1=1 " +
+
+            "<if test = 'maps.tempId != null    '> " +
+            "and temp_id =#{maps.tempId} " +
+            "</if>" +
+            "<if test = 'maps.cityId != null    '> " +
+            "and city_id =#{maps.cityId} " +
+            "</if>" +
+            "<if test = 'maps.cityId != null    '> " +
+            "and city_id =#{maps.cityId} " +
+            "</if>" +
+            "<if test = 'maps.price != null    '> " +
+            "and price &lt;=  #{maps.price} " +
+            "</if>" +
+            "<if test = 'maps.number != null    '> " +
+            "and number &lt;=  #{maps.number} " +
+            "</if>" +
+            "</script>"})
+    int selectCountByTemplateDTO(@Param("maps") TemplateDTO mapValue);
+}

+ 65 - 0
fs-service/src/main/java/com/fs/store/mapper/FsShippingTemplatesMapper.java

@@ -0,0 +1,65 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsShippingTemplates;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 运费模板Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsShippingTemplatesMapper 
+{
+    /**
+     * 查询运费模板
+     * 
+     * @param shippingId 运费模板ID
+     * @return 运费模板
+     */
+    public FsShippingTemplates selectFsShippingTemplatesById(Long id);
+
+    /**
+     * 查询运费模板列表
+     * 
+     * @param fsShippingTemplates 运费模板
+     * @return 运费模板集合
+     */
+    public List<FsShippingTemplates> selectFsShippingTemplatesList(FsShippingTemplates fsShippingTemplates);
+
+    /**
+     * 新增运费模板
+     * 
+     * @param fsShippingTemplates 运费模板
+     * @return 结果
+     */
+    public int insertFsShippingTemplates(FsShippingTemplates fsShippingTemplates);
+
+    /**
+     * 修改运费模板
+     * 
+     * @param fsShippingTemplates 运费模板
+     * @return 结果
+     */
+    public int updateFsShippingTemplates(FsShippingTemplates fsShippingTemplates);
+
+    /**
+     * 删除运费模板
+     * 
+     * @param shippingId 运费模板ID
+     * @return 结果
+     */
+    public int deleteFsShippingTemplatesById(Long id);
+
+    /**
+     * 批量删除运费模板
+     * 
+     * @param shippingIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsShippingTemplatesByIds(Long[] id);
+    @Select("select * from fs_shipping_templates where find_in_set(id,#{ids})")
+    List<FsShippingTemplates> selectFsShippingTemplatesByIds(String ids);
+}

+ 70 - 0
fs-service/src/main/java/com/fs/store/mapper/FsShippingTemplatesRegionMapper.java

@@ -0,0 +1,70 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsShippingTemplatesRegion;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 邮费区域Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsShippingTemplatesRegionMapper 
+{
+    /**
+     * 查询邮费区域
+     * 
+     * @param id 邮费区域ID
+     * @return 邮费区域
+     */
+    public FsShippingTemplatesRegion selectFsShippingTemplatesRegionById(Long id);
+
+    /**
+     * 查询邮费区域列表
+     * 
+     * @param fsShippingTemplatesRegion 邮费区域
+     * @return 邮费区域集合
+     */
+    public List<FsShippingTemplatesRegion> selectFsShippingTemplatesRegionList(FsShippingTemplatesRegion fsShippingTemplatesRegion);
+
+    /**
+     * 新增邮费区域
+     * 
+     * @param fsShippingTemplatesRegion 邮费区域
+     * @return 结果
+     */
+    public int insertFsShippingTemplatesRegion(FsShippingTemplatesRegion fsShippingTemplatesRegion);
+
+    /**
+     * 修改邮费区域
+     * 
+     * @param fsShippingTemplatesRegion 邮费区域
+     * @return 结果
+     */
+    public int updateFsShippingTemplatesRegion(FsShippingTemplatesRegion fsShippingTemplatesRegion);
+
+    /**
+     * 删除邮费区域
+     * 
+     * @param id 邮费区域ID
+     * @return 结果
+     */
+    public int deleteFsShippingTemplatesRegionById(Long id);
+
+    /**
+     * 批量删除邮费区域
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsShippingTemplatesRegionByIds(Long[] ids);
+
+    @Delete("delete from fs_shipping_templates_region where temp_id=#{tempId}")
+    int deleteFsShippingTemplatesRegionByTempId(Long tempId);
+    @Select("select * from fs_shipping_templates_region where find_in_set(temp_id,#{tempIds}) and find_in_set(city_id,#{cityIds})")
+    List<FsShippingTemplatesRegion> selectFsShippingTemplatesRegionListByTempIdsAndCityIds(@Param("tempIds") String tempIds,@Param("cityIds") String cityIds);
+}

+ 69 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreActivityMapper.java

@@ -0,0 +1,69 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreActivity;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 活动Mapper接口
+ * 
+ * @author fs
+ * @date 2022-11-18
+ */
+public interface FsStoreActivityMapper 
+{
+    /**
+     * 查询活动
+     * 
+     * @param activityId 活动ID
+     * @return 活动
+     */
+    public FsStoreActivity selectFsStoreActivityById(Long activityId);
+
+    /**
+     * 查询活动列表
+     * 
+     * @param fsStoreActivity 活动
+     * @return 活动集合
+     */
+    public List<FsStoreActivity> selectFsStoreActivityList(FsStoreActivity fsStoreActivity);
+
+    /**
+     * 新增活动
+     * 
+     * @param fsStoreActivity 活动
+     * @return 结果
+     */
+    public int insertFsStoreActivity(FsStoreActivity fsStoreActivity);
+
+    /**
+     * 修改活动
+     * 
+     * @param fsStoreActivity 活动
+     * @return 结果
+     */
+    public int updateFsStoreActivity(FsStoreActivity fsStoreActivity);
+
+    /**
+     * 删除活动
+     * 
+     * @param activityId 活动ID
+     * @return 结果
+     */
+    public int deleteFsStoreActivityById(Long activityId);
+
+    /**
+     * 批量删除活动
+     * 
+     * @param activityIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreActivityByIds(Long[] activityIds);
+    @Select("select * from fs_store_activity where status=1 order by activity_id desc limit 1")
+    FsStoreActivity selectFsStoreActivityByTop();
+
+    @Update("update fs_store_activity set share_number=share_number+1 where activity_id=#{activityId} ")
+    int addShare(Long activityId);
+}

+ 65 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreCanvasMapper.java

@@ -0,0 +1,65 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreCanvas;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 画布信息Mapper接口
+ * 
+ * @author fs
+ * @date 2022-08-29
+ */
+public interface FsStoreCanvasMapper 
+{
+    /**
+     * 查询画布信息
+     * 
+     * @param canvasId 画布信息ID
+     * @return 画布信息
+     */
+    public FsStoreCanvas selectFsStoreCanvasById(Long canvasId);
+
+    /**
+     * 查询画布信息列表
+     * 
+     * @param fsStoreCanvas 画布信息
+     * @return 画布信息集合
+     */
+    public List<FsStoreCanvas> selectFsStoreCanvasList(FsStoreCanvas fsStoreCanvas);
+
+    /**
+     * 新增画布信息
+     * 
+     * @param fsStoreCanvas 画布信息
+     * @return 结果
+     */
+    public int insertFsStoreCanvas(FsStoreCanvas fsStoreCanvas);
+
+    /**
+     * 修改画布信息
+     * 
+     * @param fsStoreCanvas 画布信息
+     * @return 结果
+     */
+    public int updateFsStoreCanvas(FsStoreCanvas fsStoreCanvas);
+
+    /**
+     * 删除画布信息
+     * 
+     * @param canvasId 画布信息ID
+     * @return 结果
+     */
+    public int deleteFsStoreCanvasById(Long canvasId);
+
+    /**
+     * 批量删除画布信息
+     * 
+     * @param canvasIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreCanvasByIds(Long[] canvasIds);
+    @Select("select * from fs_store_canvas where terminal=#{terminal} ")
+    FsStoreCanvas selectFsStoreCanvasByTerminal(Integer terminal);
+}

+ 96 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreCartMapper.java

@@ -0,0 +1,96 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreCart;
+import com.fs.store.param.FsStoreCartCountParam;
+import com.fs.store.vo.FsStoreCartQueryVO;
+import com.fs.store.vo.FsStoreCartVO;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 购物车Mapper接口
+ *
+ * @author fs
+ * @date 2022-03-21
+ */
+public interface FsStoreCartMapper
+{
+    /**
+     * 查询购物车
+     *
+     * @param id 购物车ID
+     * @return 购物车
+     */
+    public FsStoreCart selectFsStoreCartById(Long id);
+
+    /**
+     * 查询购物车列表
+     *
+     * @param fsStoreCart 购物车
+     * @return 购物车集合
+     */
+    public List<FsStoreCart> selectFsStoreCartList(FsStoreCart fsStoreCart);
+
+    /**
+     * 新增购物车
+     *
+     * @param fsStoreCart 购物车
+     * @return 结果
+     */
+    public int insertFsStoreCart(FsStoreCart fsStoreCart);
+
+    /**
+     * 修改购物车
+     *
+     * @param fsStoreCart 购物车
+     * @return 结果
+     */
+    public int updateFsStoreCart(FsStoreCart fsStoreCart);
+
+    /**
+     * 删除购物车
+     *
+     * @param id 购物车ID
+     * @return 结果
+     */
+    public int deleteFsStoreCartById(Long id);
+
+    /**
+     * 批量删除购物车
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreCartByIds(Long[] ids);
+
+    @Select("select c.*,c.card_id as id,p.product_type,p.product_name,p.img_url as product_image,v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock from fs_store_cart c inner join fs_store_product p on p.product_id=c.product_id inner join fs_store_product_attr_value v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{uid}")
+    List<FsStoreCartVO> selectFsStoreCartListByUid(long uid);
+    @Delete({"<script>"+
+            "delete from fs_store_cart where card_id in"+
+           "<foreach collection='array' item='id' open='(' separator=',' close=')'>#{id}</foreach>"+
+            "</script>"})
+    int delCart(Long[] ids);
+    @Select("select c.*,p.cate_id,p.product_name,p.img_url as product_image,p.temp_id,p.product_type,v.price,v.sku as product_attr_name,v.image as product_attr_image,v.stock,v.cost_price as cost,v.integral,v.weight,v.volume,v.bar_code,v.group_bar_code,v.brokerage,v.brokerage_two,v.brokerage_three from fs_store_cart c left join fs_store_product p on p.product_id=c.product_id left join fs_store_product_attr_value v on v.id=c.product_attr_value_id where find_in_set(c.card_id,#{ids})")
+    List<FsStoreCartQueryVO> selectFsStoreCartListByIds(String ids);
+    @Update("update  fs_store_cart set is_pay=1 where find_in_set(card_id,#{cartIds})")
+    void updateIsPay(String cartIds);
+
+
+    @Select("select ifnull(sum(c.cart_num),0) from fs_store_cart c inner join fs_store_product p on p.product_id=c.product_id inner join fs_store_product_attr_value v on v.id=c.product_attr_value_id where c.is_pay=0 and c.is_del=0 and c.is_buy=0 and p.is_show=1 and p.is_del=0 and c.user_id= #{userId}")
+    Integer selectFsStoreCartCountByUserId(long userId);
+    @Select({"<script> " +
+            "select ifnull(sum(c.cart_num),0) from fs_store_cart c  " +
+            "where c.is_pay=0 and c.is_del=0 and c.is_buy=0 " +
+            "<if test = 'maps.userId != null     '> " +
+            "and c.user_id =#{maps.userId} " +
+            "</if>" +
+            "<if test = 'maps.productId != null    '> " +
+            "and c.product_id =#{maps.productId} " +
+            "</if>" +
+            "</script>"})
+    Integer selectFsStoreCartCount(@Param("maps") FsStoreCartCountParam param);
+}

+ 134 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponIssueMapper.java

@@ -0,0 +1,134 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreCouponIssue;
+import com.fs.store.param.FsCouponIssueParam;
+import com.fs.store.vo.FsStoreCouponIssueVO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 优惠券领取Mapper接口
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsStoreCouponIssueMapper
+{
+    /**
+     * 查询优惠券领取
+     *
+     * @param id 优惠券领取ID
+     * @return 优惠券领取
+     */
+    public FsStoreCouponIssue selectFsStoreCouponIssueById(Long id);
+
+    /**
+     * 查询优惠券领取列表
+     *
+     * @param fsStoreCouponIssue 优惠券领取
+     * @return 优惠券领取集合
+     */
+    public List<FsStoreCouponIssue> selectFsStoreCouponIssueList(FsStoreCouponIssue fsStoreCouponIssue);
+
+    /**
+     * 新增优惠券领取
+     *
+     * @param fsStoreCouponIssue 优惠券领取
+     * @return 结果
+     */
+    public int insertFsStoreCouponIssue(FsStoreCouponIssue fsStoreCouponIssue);
+
+    /**
+     * 修改优惠券领取
+     *
+     * @param fsStoreCouponIssue 优惠券领取
+     * @return 结果
+     */
+    public int updateFsStoreCouponIssue(FsStoreCouponIssue fsStoreCouponIssue);
+
+    /**
+     * 删除优惠券领取
+     *
+     * @param id 优惠券领取ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponIssueById(Long id);
+
+    /**
+     * 批量删除优惠券领取
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponIssueByIds(Long[] ids);
+
+    @Select({"<script> " +
+            "select i.*,c.coupon_price,c.use_min_price,c.coupon_time,ifnull((select count(1) from fs_store_coupon_issue_user where user_id=#{userId} and issue_id=i.id),0) as  receive_count from fs_store_coupon_issue i left join fs_store_coupon c on c.coupon_id=i.coupon_id  " +
+            "where i.limit_time &gt; now() " +
+            "<if test = 'maps.isDel != null     '> " +
+            "and i.is_del =#{maps.isDel} " +
+            "</if>" +
+            "<if test = 'maps.status != null     '> " +
+            "and i.status =#{maps.status} " +
+            "</if>" +
+            "<if test = 'maps.couponType != null     '> " +
+            "and i.coupon_type =#{maps.couponType} " +
+            "</if>" +
+            " order by i.id desc "+
+            "</script>"})
+    List<FsStoreCouponIssueVO> selectFsStoreCouponIssueListQueryVO(@Param("userId") String userId, @Param("maps")FsStoreCouponIssue map);
+    @Update({"<script> " +
+            "update fs_store_coupon_issue  set remain_count=(select ifnull(count(1),0) from fs_store_coupon_issue_user where issue_id=#{id}) where id=#{id}  " +
+            "</script>"})
+    void updateFsStoreCouponIssueCount(Long id);
+    @Select({"<script> " +
+            "select i.*,c.coupon_price,c.use_min_price,c.coupon_time   from fs_store_coupon_issue i left join fs_store_coupon c on c.coupon_id=i.coupon_id  " +
+            "where i.limit_time &gt; now() and i.is_del=0 and i.status=1   " +
+            "<if test = 'maps.cateId != null and maps.cateId!=0     '> " +
+            "and find_in_set(#{maps.cateId},c.package_cate_ids) " +
+            "</if>" +
+            "<if test = 'maps.couponType != null     '> " +
+            "and i.coupon_type= #{maps.couponType} " +
+            "</if>" +
+            "<if test = 'maps.couponPrice != null     '> " +
+            "and c.coupon_price =  #{maps.couponPrice} " +
+            "</if>" +
+            " order by c.coupon_price desc "+
+            "</script>"})
+    List<FsStoreCouponIssueVO> getCompanyCouponIssueList(@Param("maps") FsCouponIssueParam map);
+    @Select({"<script> " +
+            "select i.*,c.coupon_price,c.use_min_price,c.coupon_time  from fs_store_coupon_issue i left join fs_store_coupon c on c.coupon_id=i.coupon_id  " +
+            "where i.id=#{id}  order by c.coupon_price desc " +
+            "</script>"})
+    FsStoreCouponIssueVO selectFsStoreCouponIssueVOById(Long id);
+    @Select({"<script> " +
+            "select i.*,c.coupon_price,c.use_min_price,c.coupon_time  from fs_store_coupon_issue i left join fs_store_coupon c on c.coupon_id=i.coupon_id  " +
+            "where i.limit_time &gt; now() " +
+            "<if test = 'maps.isDel != null     '> " +
+            "and i.is_del =#{maps.isDel} " +
+            "</if>" +
+            "<if test = 'maps.status != null     '> " +
+            "and i.status =#{maps.status} " +
+            "</if>" +
+            "<if test = 'maps.couponType != null     '> " +
+            "and i.coupon_type =#{maps.couponType} " +
+            "</if>" +
+            "<if test = 'maps.couponPrice != null     '> " +
+            "and c.coupon_price =#{maps.couponPrice} " +
+            "</if>" +
+            "<if test = 'maps.couponName != null and  maps.couponName !=\"\"     '> " +
+            "and i.coupon_name like CONCAT('%',#{maps.couponName},'%') " +
+            "</if>" +
+            "<if test = 'maps.beginTime != null and maps.beginTime != \"\" '> " +
+            "and date_format(i.create_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.endTime != null and maps.endTime != \"\" '> " +
+            "and date_format(i.create_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
+            "</if>" +
+            " order by c.coupon_price "+
+            "</script>"})
+    List<FsStoreCouponIssueVO> selectFsStoreCouponIssueListVO(@Param("maps")FsStoreCouponIssue fsStoreCouponIssue);
+}

+ 66 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponIssueUserMapper.java

@@ -0,0 +1,66 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreCouponIssueUser;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 优惠券用户领取记录Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsStoreCouponIssueUserMapper 
+{
+    /**
+     * 查询优惠券用户领取记录
+     * 
+     * @param id 优惠券用户领取记录ID
+     * @return 优惠券用户领取记录
+     */
+    public FsStoreCouponIssueUser selectFsStoreCouponIssueUserById(Long id);
+
+    /**
+     * 查询优惠券用户领取记录列表
+     * 
+     * @param fsStoreCouponIssueUser 优惠券用户领取记录
+     * @return 优惠券用户领取记录集合
+     */
+    public List<FsStoreCouponIssueUser> selectFsStoreCouponIssueUserList(FsStoreCouponIssueUser fsStoreCouponIssueUser);
+
+    /**
+     * 新增优惠券用户领取记录
+     * 
+     * @param fsStoreCouponIssueUser 优惠券用户领取记录
+     * @return 结果
+     */
+    public int insertFsStoreCouponIssueUser(FsStoreCouponIssueUser fsStoreCouponIssueUser);
+
+    /**
+     * 修改优惠券用户领取记录
+     * 
+     * @param fsStoreCouponIssueUser 优惠券用户领取记录
+     * @return 结果
+     */
+    public int updateFsStoreCouponIssueUser(FsStoreCouponIssueUser fsStoreCouponIssueUser);
+
+    /**
+     * 删除优惠券用户领取记录
+     * 
+     * @param id 优惠券用户领取记录ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponIssueUserById(Long id);
+
+    /**
+     * 批量删除优惠券用户领取记录
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponIssueUserByIds(Long[] ids);
+    @Select("select ifnull(count(1),0) from fs_store_coupon_issue_user where user_id=#{userId} and issue_id=#{id} ")
+    int checkReceive(@Param("userId") String userId,@Param("id") Long id);
+}

+ 67 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponMapper.java

@@ -0,0 +1,67 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreCoupon;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 优惠券Mapper接口
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsStoreCouponMapper
+{
+    /**
+     * 查询优惠券
+     *
+     * @param couponId 优惠券ID
+     * @return 优惠券
+     */
+    public FsStoreCoupon selectFsStoreCouponById(Long couponId);
+
+    /**
+     * 查询优惠券列表
+     *
+     * @param fsStoreCoupon 优惠券
+     * @return 优惠券集合
+     */
+    public List<FsStoreCoupon> selectFsStoreCouponList(FsStoreCoupon fsStoreCoupon);
+
+    /**
+     * 新增优惠券
+     *
+     * @param fsStoreCoupon 优惠券
+     * @return 结果
+     */
+    public int insertFsStoreCoupon(FsStoreCoupon fsStoreCoupon);
+
+    /**
+     * 修改优惠券
+     *
+     * @param fsStoreCoupon 优惠券
+     * @return 结果
+     */
+    public int updateFsStoreCoupon(FsStoreCoupon fsStoreCoupon);
+
+    /**
+     * 删除优惠券
+     *
+     * @param couponId 优惠券ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponById(Long couponId);
+
+    /**
+     * 批量删除优惠券
+     *
+     * @param couponIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponByIds(Long[] couponIds);
+
+
+    @Select("select * from fs_store_coupon where find_in_set(coupon_id,#{ids})")
+    List<FsStoreCoupon> selectFsStoreCouponByIds(String ids);
+}

+ 105 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreCouponUserMapper.java

@@ -0,0 +1,105 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreCouponUser;
+import com.fs.store.param.FsCouponUserEnableParam;
+import com.fs.store.vo.FsStoreCouponUserVO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 优惠券发放记录Mapper接口
+ *
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsStoreCouponUserMapper
+{
+    /**
+     * 查询优惠券发放记录
+     *
+     * @param id 优惠券发放记录ID
+     * @return 优惠券发放记录
+     */
+    public FsStoreCouponUser selectFsStoreCouponUserById(Long id);
+
+    /**
+     * 查询优惠券发放记录列表
+     *
+     * @param fsStoreCouponUser 优惠券发放记录
+     * @return 优惠券发放记录集合
+     */
+    public List<FsStoreCouponUser> selectFsStoreCouponUserList(FsStoreCouponUser fsStoreCouponUser);
+
+    /**
+     * 新增优惠券发放记录
+     *
+     * @param fsStoreCouponUser 优惠券发放记录
+     * @return 结果
+     */
+    public int insertFsStoreCouponUser(FsStoreCouponUser fsStoreCouponUser);
+
+    /**
+     * 修改优惠券发放记录
+     *
+     * @param fsStoreCouponUser 优惠券发放记录
+     * @return 结果
+     */
+    public int updateFsStoreCouponUser(FsStoreCouponUser fsStoreCouponUser);
+
+    /**
+     * 删除优惠券发放记录
+     *
+     * @param id 优惠券发放记录ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponUserById(Long id);
+
+    /**
+     * 批量删除优惠券发放记录
+     *
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreCouponUserByIds(Long[] ids);
+
+    @Update("update fs_store_coupon_user set status=2 where status=0 and limit_time<now() ")
+    int updateFsCouponByExpire();
+    @Select({"<script> " +
+            "select cu.* from fs_store_coupon_user cu inner join fs_store_coupon c on c.coupon_id=cu.coupon_id  " +
+            "where cu.status=0 and cu.is_del=0 " +
+            "<if test = 'maps.userId != null     '> " +
+            "and cu.user_id =#{maps.userId} " +
+            "</if>" +
+            "<if test = 'maps.packageCateId != null     '> " +
+            "and (find_in_set( #{maps.packageCateId},c.package_cate_ids) or c.package_cate_ids=0) " +
+            "</if>" +
+            "<if test = 'maps.useMinPrice != null     '> " +
+            "and cu.use_min_price &lt; #{maps.useMinPrice} " +
+            "</if>" +
+            "<if test = 'maps.couponType != null     '> " +
+            "and c.type = #{maps.couponType} " +
+            "</if>" +
+            "</script>"})
+    List<FsStoreCouponUser> selectFsStoreCouponUserListByEnable(@Param("maps")FsCouponUserEnableParam param);
+    @Select({"<script> " +
+            "select cu.*,u.nickname,u.phone from fs_store_coupon_user cu inner join fs_user u  on u.user_id=cu.user_id  " +
+            "where  cu.is_del=0 " +
+            "<if test = 'maps.status != null     '> " +
+            "and cu.status =#{maps.status} " +
+            "</if>" +
+            "<if test = 'maps.couponTitle != null     '> " +
+            "and cu.coupon_title =#{maps.couponTitle} " +
+            "</if>" +
+            "<if test = 'maps.beginTime != null and maps.beginTime != \"\" '> " +
+            "and date_format(cu.create_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.endTime != null and maps.endTime != \"\" '> " +
+            "and date_format(cu.create_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
+            "</if>" +
+            "order by cu.id desc " +
+            "</script>"})
+    List<FsStoreCouponUserVO> selectFsStoreCouponUserListVO(@Param("maps")FsStoreCouponUser fsStoreCouponUser);
+}

+ 62 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreOrderStatusMapper.java

@@ -0,0 +1,62 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreOrderStatus;
+
+import java.util.List;
+
+/**
+ * 订单操作记录Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsStoreOrderStatusMapper 
+{
+    /**
+     * 查询订单操作记录
+     * 
+     * @param id 订单操作记录ID
+     * @return 订单操作记录
+     */
+    public FsStoreOrderStatus selectFsStoreOrderStatusById(Long id);
+
+    /**
+     * 查询订单操作记录列表
+     * 
+     * @param fsStoreOrderStatus 订单操作记录
+     * @return 订单操作记录集合
+     */
+    public List<FsStoreOrderStatus> selectFsStoreOrderStatusList(FsStoreOrderStatus fsStoreOrderStatus);
+
+    /**
+     * 新增订单操作记录
+     * 
+     * @param fsStoreOrderStatus 订单操作记录
+     * @return 结果
+     */
+    public int insertFsStoreOrderStatus(FsStoreOrderStatus fsStoreOrderStatus);
+
+    /**
+     * 修改订单操作记录
+     * 
+     * @param fsStoreOrderStatus 订单操作记录
+     * @return 结果
+     */
+    public int updateFsStoreOrderStatus(FsStoreOrderStatus fsStoreOrderStatus);
+
+    /**
+     * 删除订单操作记录
+     * 
+     * @param id 订单操作记录ID
+     * @return 结果
+     */
+    public int deleteFsStoreOrderStatusById(Long id);
+
+    /**
+     * 批量删除订单操作记录
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreOrderStatusByIds(Long[] ids);
+}

+ 94 - 0
fs-service/src/main/java/com/fs/store/mapper/FsStoreProductRelationMapper.java

@@ -0,0 +1,94 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsStoreProductRelation;
+import com.fs.store.param.FsStoreProductRelationParam;
+import com.fs.store.param.FsStoreProductRelationQueryParam;
+import com.fs.store.vo.FsStoreProductRelationQueryVO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 商品点赞和收藏Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsStoreProductRelationMapper 
+{
+    /**
+     * 查询商品点赞和收藏
+     * 
+     * @param id 商品点赞和收藏ID
+     * @return 商品点赞和收藏
+     */
+    public FsStoreProductRelation selectFsStoreProductRelationById(Long id);
+
+    /**
+     * 查询商品点赞和收藏列表
+     * 
+     * @param fsStoreProductRelation 商品点赞和收藏
+     * @return 商品点赞和收藏集合
+     */
+    public List<FsStoreProductRelation> selectFsStoreProductRelationList(FsStoreProductRelation fsStoreProductRelation);
+
+    /**
+     * 新增商品点赞和收藏
+     * 
+     * @param fsStoreProductRelation 商品点赞和收藏
+     * @return 结果
+     */
+    public int insertFsStoreProductRelation(FsStoreProductRelation fsStoreProductRelation);
+
+    /**
+     * 修改商品点赞和收藏
+     * 
+     * @param fsStoreProductRelation 商品点赞和收藏
+     * @return 结果
+     */
+    public int updateFsStoreProductRelation(FsStoreProductRelation fsStoreProductRelation);
+
+    /**
+     * 删除商品点赞和收藏
+     * 
+     * @param id 商品点赞和收藏ID
+     * @return 结果
+     */
+    public int deleteFsStoreProductRelationById(Long id);
+
+    /**
+     * 批量删除商品点赞和收藏
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsStoreProductRelationByIds(Long[] ids);
+
+
+
+    @Select({"<script> " +
+            "select p.img_url as image,p.product_name,p.price,r.*   from fs_store_product_relation r left join  fs_store_product p  on p.product_id=r.product_id   " +
+            "where r.is_del=0 " +
+            "<if test = 'maps.userId != null    '> " +
+            "and r.user_id =#{maps.userId} " +
+            "</if>" +
+            " order by update_time desc "+
+            "</script>"})
+    List<FsStoreProductRelationQueryVO> selectFsStoreProductRelationListVOQuery(@Param("maps") FsStoreProductRelationQueryParam param);
+    @Select({"<script> " +
+            "select p.img_url as image,p.product_name,p.price,r.*,u.nickname,u.phone   from fs_store_product_relation r left join  fs_store_product p  on p.product_id=r.product_id left join fs_user u on u.user_id=r.user_id   " +
+            "where r.is_del=0 " +
+            "<if test = 'maps.userId != null    '> " +
+            "and r.user_id =#{maps.userId} " +
+            "</if>" +
+            "<if test = 'maps.phone != null and maps.phone != \"\"    '> " +
+            "and u.phone =#{maps.phone} " +
+            "</if>" +
+            "<if test = 'maps.productName != null and maps.productName != \"\"    '> " +
+            "and p.product_name =#{maps.productName} " +
+            "</if>" +
+            " order by update_time desc "+
+            "</script>"})
+    List<FsStoreProductRelationQueryVO> selectFsStoreProductRelationListVO(@Param("maps") FsStoreProductRelationParam param);
+}

+ 70 - 0
fs-service/src/main/java/com/fs/store/mapper/FsWechatTemplateMapper.java

@@ -0,0 +1,70 @@
+package com.fs.store.mapper;
+
+import com.fs.store.domain.FsWechatTemplate;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ * 微信模板Mapper接口
+ * 
+ * @author fs
+ * @date 2022-03-15
+ */
+public interface FsWechatTemplateMapper 
+{
+    /**
+     * 查询微信模板
+     * 
+     * @param id 微信模板ID
+     * @return 微信模板
+     */
+    public FsWechatTemplate selectFsWechatTemplateById(Integer id);
+
+    /**
+     * 查询微信模板列表
+     * 
+     * @param fsWechatTemplate 微信模板
+     * @return 微信模板集合
+     */
+    public List<FsWechatTemplate> selectFsWechatTemplateList(FsWechatTemplate fsWechatTemplate);
+
+    /**
+     * 新增微信模板
+     * 
+     * @param fsWechatTemplate 微信模板
+     * @return 结果
+     */
+    public int insertFsWechatTemplate(FsWechatTemplate fsWechatTemplate);
+
+    /**
+     * 修改微信模板
+     * 
+     * @param fsWechatTemplate 微信模板
+     * @return 结果
+     */
+    public int updateFsWechatTemplate(FsWechatTemplate fsWechatTemplate);
+
+    /**
+     * 删除微信模板
+     * 
+     * @param id 微信模板ID
+     * @return 结果
+     */
+    public int deleteFsWechatTemplateById(Integer id);
+
+    /**
+     * 批量删除微信模板
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteFsWechatTemplateByIds(Integer[] ids);
+
+    @Select("select * from fs_wechat_template where tempkey=#{key}")
+    FsWechatTemplate selectFsWechatTemplateByKey(String key);
+    @Select("select temp_id from fs_wechat_template where status=1")
+    List<String> selectFsWechatTemplateIds();
+    @Select("select temp_id from fs_wechat_template where find_in_set(tempkey,#{key})")
+    List<String> selectFsWechatTemplateIdsByKeys(String key);
+}

+ 13 - 0
fs-service/src/main/java/com/fs/store/param/FsArticleQueryParam.java

@@ -0,0 +1,13 @@
+package com.fs.store.param;
+
+import com.fs.common.param.BaseQueryParam;
+import lombok.Data;
+
+@Data
+public class FsArticleQueryParam extends BaseQueryParam
+{
+
+    private Long cateId;
+    private Integer isTui;
+
+}

+ 10 - 0
fs-service/src/main/java/com/fs/store/param/FsArticleViewListParam.java

@@ -0,0 +1,10 @@
+package com.fs.store.param;
+
+import com.fs.common.param.BaseQueryParam;
+import lombok.Data;
+
+@Data
+public class FsArticleViewListParam extends BaseQueryParam
+{
+    private String articleTitle;
+}

+ 12 - 0
fs-service/src/main/java/com/fs/store/param/FsArticleViewListQueryParam.java

@@ -0,0 +1,12 @@
+package com.fs.store.param;
+
+import com.fs.common.param.BaseQueryParam;
+import lombok.Data;
+
+@Data
+public class FsArticleViewListQueryParam extends BaseQueryParam
+{
+
+    private Long articleId;
+
+}

+ 16 - 0
fs-service/src/main/java/com/fs/store/param/FsCouponIssueParam.java

@@ -0,0 +1,16 @@
+package com.fs.store.param;
+
+import com.fs.common.param.BaseQueryParam;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class FsCouponIssueParam extends BaseQueryParam implements Serializable
+{
+
+    private Integer cateId;
+    private Integer couponType;
+    private BigDecimal couponPrice;
+}

+ 16 - 0
fs-service/src/main/java/com/fs/store/param/FsCouponUserEnableParam.java

@@ -0,0 +1,16 @@
+package com.fs.store.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class FsCouponUserEnableParam implements Serializable
+{
+
+    Integer couponType;
+    BigDecimal useMinPrice;
+    Long userId;
+    Long packageCateId;
+}

+ 12 - 0
fs-service/src/main/java/com/fs/store/param/FsCouponUserParam.java

@@ -0,0 +1,12 @@
+package com.fs.store.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class FsCouponUserParam implements Serializable
+{
+
+
+}

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor