Jelajahi Sumber

Merge branch 'featrue/接收kmall推送数据和向外部提供接口查询' of qng/eccs into master

project 2 tahun lalu
induk
melakukan
abdc48dd85
26 mengubah file dengan 2158 tambahan dan 3 penghapusan
  1. 2 2
      eccs-admin/src/main/resources/application-prod.yml
  2. 1 1
      eccs-admin/src/main/resources/application-test.yml
  3. 50 0
      eccs-biz/src/main/java/com/emato/biz/controller/mall/InventoryDataController.java
  4. 54 0
      eccs-biz/src/main/java/com/emato/biz/controller/mall/SalesDetailController.java
  5. 50 0
      eccs-biz/src/main/java/com/emato/biz/domain/OmsUtils.java
  6. 61 0
      eccs-biz/src/main/java/com/emato/biz/domain/mall/InventoryDataPushVo.java
  7. 77 0
      eccs-biz/src/main/java/com/emato/biz/domain/mall/InventoryDataVo.java
  8. 373 0
      eccs-biz/src/main/java/com/emato/biz/domain/mall/NewSystemFormatEntiy.java
  9. 336 0
      eccs-biz/src/main/java/com/emato/biz/domain/mall/PushSystemOdOderVo.java
  10. 20 0
      eccs-biz/src/main/java/com/emato/biz/mapper/mall/InventoryDataMapper.java
  11. 15 0
      eccs-biz/src/main/java/com/emato/biz/mapper/mall/MallMngChangeMapper.java
  12. 17 0
      eccs-biz/src/main/java/com/emato/biz/mapper/mall/SalesDetailMapper.java
  13. 270 0
      eccs-biz/src/main/java/com/emato/biz/service/impl/SalesDetaiServicelImpl.java
  14. 19 0
      eccs-biz/src/main/java/com/emato/biz/service/mall/ISalesDetaiServicel.java
  15. 88 0
      eccs-biz/src/main/resources/mapper/biz/mall/InventoryDataMapper.xml
  16. 171 0
      eccs-biz/src/main/resources/mapper/biz/mall/MallMngChangeMapper.xml
  17. 163 0
      eccs-biz/src/main/resources/mapper/biz/mall/SalesDetailMapper.xml.xml
  18. 12 0
      eccs-common/src/main/java/com/emato/common/annotation/AnonymousAccess.java
  19. 97 0
      eccs-common/src/main/java/com/emato/common/core/Result.java
  20. 87 0
      eccs-common/src/main/java/com/emato/common/core/ResultNew.java
  21. 31 0
      eccs-common/src/main/java/com/emato/common/utils/DateUtils.java
  22. 102 0
      eccs-common/src/main/java/com/emato/common/utils/oms/request/DesUtils.java
  23. 33 0
      eccs-common/src/main/java/com/emato/common/utils/sign/Md5Utils.java
  24. 22 0
      eccs-framework/src/main/java/com/emato/framework/config/SecurityConfig.java
  25. 2 0
      eccs-system/src/main/java/com/emato/system/mapper/SysConfigMapper.java
  26. 5 0
      eccs-system/src/main/resources/mapper/system/SysConfigMapper.xml

+ 2 - 2
eccs-admin/src/main/resources/application-prod.yml

@@ -8,13 +8,13 @@ spring:
   # redis 配置
   redis:
     # 地址
-    host: 8.135.102.238
+    host: 120.78.152.8
     # 端口,默认为6379
     port: 6379
     # 数据库索引
     database: 0
     # 密码
-    password:
+    password: Abc-123#*.-
     # 连接超时时间
     timeout: 10s
     lettuce:

+ 1 - 1
eccs-admin/src/main/resources/application-test.yml

@@ -10,7 +10,7 @@ spring:
     # 地址
     host: 120.78.152.8
     # 端口,默认为6379
-    port: 7379
+    port: 6379
     # 数据库索引
     database: 0
     # 密码

+ 50 - 0
eccs-biz/src/main/java/com/emato/biz/controller/mall/InventoryDataController.java

@@ -0,0 +1,50 @@
+package com.emato.biz.controller.mall;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.emato.biz.domain.mall.InventoryDataVo;
+import com.emato.biz.service.mall.ISalesDetaiServicel;
+import com.emato.common.annotation.AnonymousAccess;
+import com.emato.common.core.Result;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+@RequestMapping("/inventory")
+public class InventoryDataController {
+
+    @Autowired
+    private ISalesDetaiServicel salesDetaiServicel;
+
+    /**
+     * 接收来自oms的库存数据
+     * @param inventoryDataVo
+     * @return
+     */
+    @AnonymousAccess
+    @PostMapping("/pushinvent")
+    public Result pushInventory(@RequestBody InventoryDataVo inventoryDataVo)
+    {
+        return salesDetaiServicel.inserInventory(inventoryDataVo);
+    }
+
+    /**
+     * 查询库存数据提供给外部系统
+     * @param msg
+     * @param httpRequest
+     * @return
+     */
+    @AnonymousAccess
+    @PostMapping("/getinvdata")
+    public Result getpushinventMsg(@RequestBody JSONObject msg, HttpServletRequest httpRequest)
+    {
+        return salesDetaiServicel.queryInventory(msg,httpRequest);
+    }
+
+
+}

+ 54 - 0
eccs-biz/src/main/java/com/emato/biz/controller/mall/SalesDetailController.java

@@ -0,0 +1,54 @@
+package com.emato.biz.controller.mall;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.emato.biz.domain.mall.NewSystemFormatEntiy;
+import com.emato.biz.service.mall.ISalesDetaiServicel;
+import com.emato.common.annotation.AnonymousAccess;
+import com.emato.common.core.Result;
+import com.emato.common.core.ResultNew;
+import org.apache.http.Header;
+import org.apache.http.HttpRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+@RequestMapping("/salesdetail")
+public class SalesDetailController {
+
+
+    @Autowired
+    private ISalesDetaiServicel salesDetaiServicel;
+
+
+    /**
+     * kmall向eccs系统推送数据
+     * @param newSystemFormatEntiy
+     * @return
+     */
+    @AnonymousAccess
+    @PostMapping("/eccspushsales")
+    public ResultNew pushSalesDetailServicel(@RequestBody NewSystemFormatEntiy newSystemFormatEntiy)
+    {
+        return ResultNew.success(salesDetaiServicel.pushSalesDetaiServicel(newSystemFormatEntiy));
+    }
+
+    /**
+     * 外部系统查询订单销售数据
+     * @param msg
+     * @return
+     */
+    @AnonymousAccess
+    @PostMapping("/getsalesdet")
+    public Result getSalesDetaiData(@RequestBody JSONObject msg, HttpServletRequest httpRequest)
+    {
+        return salesDetaiServicel.getSalesDetaiData(msg,httpRequest);
+    }
+
+
+}

+ 50 - 0
eccs-biz/src/main/java/com/emato/biz/domain/OmsUtils.java

@@ -0,0 +1,50 @@
+package com.emato.biz.domain;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "omsdata")
+public class OmsUtils {
+
+
+    private String omsDriver;
+
+    private String omsUser;
+
+    private String omsPassword;
+
+    private String omsUrl;
+
+    public String getOmsDriver() {
+        return omsDriver;
+    }
+
+    public void setOmsDriver(String omsDriver) {
+        this.omsDriver = omsDriver;
+    }
+
+    public String getOmsUser() {
+        return omsUser;
+    }
+
+    public void setOmsUser(String omsUser) {
+        this.omsUser = omsUser;
+    }
+
+    public String getOmsPassword() {
+        return omsPassword;
+    }
+
+    public void setOmsPassword(String omsPassword) {
+        this.omsPassword = omsPassword;
+    }
+
+    public String getOmsUrl() {
+        return omsUrl;
+    }
+
+    public void setOmsUrl(String omsUrl) {
+        this.omsUrl = omsUrl;
+    }
+}

+ 61 - 0
eccs-biz/src/main/java/com/emato/biz/domain/mall/InventoryDataPushVo.java

@@ -0,0 +1,61 @@
+package com.emato.biz.domain.mall;
+
+import java.io.Serializable;
+
+public class InventoryDataPushVo implements Serializable {
+
+    //条形码
+    private String barcode;
+
+    //产品名称
+    private String productName;
+
+    //门店编号
+    private String shopSn;
+
+    //门店库存
+    private Integer shopInvent;
+
+    //e码头库存
+    private Integer eMatou;
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getShopSn() {
+        return shopSn;
+    }
+
+    public void setShopSn(String shopSn) {
+        this.shopSn = shopSn;
+    }
+
+    public Integer getShopInvent() {
+        return shopInvent;
+    }
+
+    public void setShopInvent(Integer shopInvent) {
+        this.shopInvent = shopInvent;
+    }
+
+    public Integer geteMatou() {
+        return eMatou;
+    }
+
+    public void seteMatou(Integer eMatou) {
+        this.eMatou = eMatou;
+    }
+}

+ 77 - 0
eccs-biz/src/main/java/com/emato/biz/domain/mall/InventoryDataVo.java

@@ -0,0 +1,77 @@
+package com.emato.biz.domain.mall;
+
+import java.io.Serializable;
+
+/**
+ * 库存接口实体类
+ */
+public class InventoryDataVo implements Serializable {
+
+    //条形码
+    private String barcode;
+
+    //产品名称
+    private String productName;
+
+    //门店编码
+    private String shopCode;
+
+    //门店名称
+    private String shopName;
+
+    //门店库存
+    private Integer shopInvent;
+
+    //e码头库存
+    private Integer eMatou;
+
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public String getShopName() {
+        return shopName;
+    }
+
+    public void setShopName(String shopName) {
+        this.shopName = shopName;
+    }
+
+    public Integer getShopInvent() {
+        return shopInvent;
+    }
+
+    public void setShopInvent(Integer shopInvent) {
+        this.shopInvent = shopInvent;
+    }
+
+    public Integer geteMatou() {
+        return eMatou;
+    }
+
+    public void seteMatou(Integer eMatou) {
+        this.eMatou = eMatou;
+    }
+
+    public String getShopCode() {
+        return shopCode;
+    }
+
+    public void setShopCode(String shopCode) {
+        this.shopCode = shopCode;
+    }
+
+}

+ 373 - 0
eccs-biz/src/main/java/com/emato/biz/domain/mall/NewSystemFormatEntiy.java

@@ -0,0 +1,373 @@
+package com.emato.biz.domain.mall;
+
+import java.io.Serializable;
+
+/**
+ * 线下订单实体类(新)
+ * 用于接收数据
+ */
+public class NewSystemFormatEntiy implements Serializable {
+
+    private String storeNameSn;//门店名称
+    private String merchSn;//商户编号
+    private String merchSnName;//商户名称
+    private String thirdMerchSn;//第三方商户编号
+    private String thirdMerchSnName;//第三方商户名称
+    private String receiptNo;// 销售单号
+    private String cashRegisterNo;// 收银台
+    private String timeStampDetails;// 销售时间
+    private String staffID;// 收银员
+    private String staffName;// 收银员姓名
+    private String hsCode;// 品类编码
+    private String hsCodeName;// 品类名称
+    private String ematouCode;// 商品编码
+    private String plu;// PLU
+    private String mychemID;// MychemID
+    private String productNameEN;// 商品名称(英文)
+    private String productNameCN;// 商品名称(中文)
+    private String barcode;// 商品主条码
+    private String packSize;// 规格
+    private String productSpecification;// 单位
+    private String brand;// 品牌
+    private String edlp;// 日常价
+    private String currentPrice;// 实际销售价
+    private String costPrice;// 进货价
+    private String taxRate;// 综合税率
+    private String productCategory;// 商品类型
+    private String supplierName;// 主供应商名称
+    private String transactionType;// 销售类型
+    private String saleReturnType;// 退货类型
+    private String remark;// 备注
+    private Integer goodsId; // 商品id
+    private String orderStatus;//订单状态
+    private String taxPrice; // 税费
+    //private String outRefundNo;//退款订单号
+    //private String refundTime;//退款时间
+    //private String primeCost;//成本价=备案单价*货物数量(门店现有库存)
+    //private String goodsNumber;//可用库存数
+    private String storeName;//门店名称
+    private String payFlag;//支付方式
+    private String orderSnWx;//微信流水号
+    private String orderSnAli;//支付宝流水号
+
+
+    public String getMerchSn() {
+        return merchSn;
+    }
+
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    public String getMerchSnName() {
+        return merchSnName;
+    }
+
+    public void setMerchSnName(String merchSnName) {
+        this.merchSnName = merchSnName;
+    }
+
+    public String getThirdMerchSn() {
+        return thirdMerchSn;
+    }
+
+    public void setThirdMerchSn(String thirdMerchSn) {
+        this.thirdMerchSn = thirdMerchSn;
+    }
+
+    public String getThirdMerchSnName() {
+        return thirdMerchSnName;
+    }
+
+    public void setThirdMerchSnName(String thirdMerchSnName) {
+        this.thirdMerchSnName = thirdMerchSnName;
+    }
+
+    public String getReceiptNo() {
+        return receiptNo;
+    }
+
+    public void setReceiptNo(String receiptNo) {
+        this.receiptNo = receiptNo;
+    }
+
+    public String getCashRegisterNo() {
+        return cashRegisterNo;
+    }
+
+    public void setCashRegisterNo(String cashRegisterNo) {
+        this.cashRegisterNo = cashRegisterNo;
+    }
+
+    public String getTimeStampDetails() {
+        return timeStampDetails;
+    }
+
+    public void setTimeStampDetails(String timeStampDetails) {
+        this.timeStampDetails = timeStampDetails;
+    }
+
+    public String getStaffID() {
+        return staffID;
+    }
+
+    public void setStaffID(String staffID) {
+        this.staffID = staffID;
+    }
+
+    public String getStaffName() {
+        return staffName;
+    }
+
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+
+    public String getHsCode() {
+        return hsCode;
+    }
+
+    public void setHsCode(String hsCode) {
+        this.hsCode = hsCode;
+    }
+
+    public String getHsCodeName() {
+        return hsCodeName;
+    }
+
+    public void setHsCodeName(String hsCodeName) {
+        this.hsCodeName = hsCodeName;
+    }
+
+    public String getEmatouCode() {
+        return ematouCode;
+    }
+
+    public void setEmatouCode(String ematouCode) {
+        this.ematouCode = ematouCode;
+    }
+
+    public String getPlu() {
+        return plu;
+    }
+
+    public void setPlu(String plu) {
+        this.plu = plu;
+    }
+
+    public String getMychemID() {
+        return mychemID;
+    }
+
+    public void setMychemID(String mychemID) {
+        this.mychemID = mychemID;
+    }
+
+    public String getProductNameEN() {
+        return productNameEN;
+    }
+
+    public void setProductNameEN(String productNameEN) {
+        this.productNameEN = productNameEN;
+    }
+
+    public String getProductNameCN() {
+        return productNameCN;
+    }
+
+    public void setProductNameCN(String productNameCN) {
+        this.productNameCN = productNameCN;
+    }
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public String getPackSize() {
+        return packSize;
+    }
+
+    public void setPackSize(String packSize) {
+        this.packSize = packSize;
+    }
+
+    public String getProductSpecification() {
+        return productSpecification;
+    }
+
+    public void setProductSpecification(String productSpecification) {
+        this.productSpecification = productSpecification;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getEdlp() {
+        return edlp;
+    }
+
+    public void setEdlp(String edlp) {
+        this.edlp = edlp;
+    }
+
+    public String getCurrentPrice() {
+        return currentPrice;
+    }
+
+    public void setCurrentPrice(String currentPrice) {
+        this.currentPrice = currentPrice;
+    }
+
+    public String getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(String costPrice) {
+        this.costPrice = costPrice;
+    }
+
+    public String getTaxRate() {
+        return taxRate;
+    }
+
+    public void setTaxRate(String taxRate) {
+        this.taxRate = taxRate;
+    }
+
+    public String getProductCategory() {
+        return productCategory;
+    }
+
+    public void setProductCategory(String productCategory) {
+        this.productCategory = productCategory;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public String getTransactionType() {
+        return transactionType;
+    }
+
+    public void setTransactionType(String transactionType) {
+        this.transactionType = transactionType;
+    }
+
+    public String getSaleReturnType() {
+        return saleReturnType;
+    }
+
+    public void setSaleReturnType(String saleReturnType) {
+        this.saleReturnType = saleReturnType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Integer getGoodsId() {
+        return goodsId;
+    }
+
+    public void setGoodsId(Integer goodsId) {
+        this.goodsId = goodsId;
+    }
+
+    public String getOrderStatus() {
+        return orderStatus;
+    }
+
+    public void setOrderStatus(String orderStatus) {
+        this.orderStatus = orderStatus;
+    }
+
+    public String getTaxPrice() {
+        return taxPrice;
+    }
+
+    public void setTaxPrice(String taxPrice) {
+        this.taxPrice = taxPrice;
+    }
+
+//    public String getOutRefundNo() {
+//        return outRefundNo;
+//    }
+//
+//    public void setOutRefundNo(String outRefundNo) {
+//        this.outRefundNo = outRefundNo;
+//    }
+
+//    public String getRefundTime() {
+//        return refundTime;
+//    }
+//
+//    public void setRefundTime(String refundTime) {
+//        this.refundTime = refundTime;
+//    }
+
+//    public String getGoodsNumber() {
+//        return goodsNumber;
+//    }
+//
+//    public void setGoodsNumber(String goodsNumber) {
+//        this.goodsNumber = goodsNumber;
+//    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getPayFlag() {
+        return payFlag;
+    }
+
+    public void setPayFlag(String payFlag) {
+        this.payFlag = payFlag;
+    }
+
+    public String getOrderSnWx() {
+        return orderSnWx;
+    }
+
+    public void setOrderSnWx(String orderSnWx) {
+        this.orderSnWx = orderSnWx;
+    }
+
+    public String getOrderSnAli() {
+        return orderSnAli;
+    }
+
+    public void setOrderSnAli(String orderSnAli) {
+        this.orderSnAli = orderSnAli;
+    }
+
+    public String getStoreNameSn() {
+        return storeNameSn;
+    }
+
+    public void setStoreNameSn(String storeNameSn) {
+        this.storeNameSn = storeNameSn;
+    }
+}

+ 336 - 0
eccs-biz/src/main/java/com/emato/biz/domain/mall/PushSystemOdOderVo.java

@@ -0,0 +1,336 @@
+package com.emato.biz.domain.mall;
+
+import java.io.Serializable;
+
+public class PushSystemOdOderVo implements Serializable {
+
+    private String storeNameSn;//门店名称
+    //private String merchSn;//商户编号
+    //private String merchSnName;//商户名称
+    //private String thirdMerchSn;//第三方商户编号
+    //private String thirdMerchSnName;//第三方商户名称
+    private String receiptNo;// 销售单号
+    private String cashRegisterNo;// 收银台
+    private String timeStampDetails;// 销售时间
+    private String staffID;// 收银员
+    private String staffName;// 收银员姓名
+    //private String hsCode;// 品类编码
+    private String hsCodeName;// 品类名称
+    private String ematouCode;// 商品编码
+    private String plu;// PLU
+    private String mychemID;// MychemID
+    private String productNameEN;// 商品名称(英文)
+    private String productNameCN;// 商品名称(中文)
+    private String barcode;// 商品主条码
+    private String packSize;// 规格
+    private String productSpecification;// 单位
+    private String brand;// 品牌
+    private String edlp;// 日常价
+    private String currentPrice;// 实际销售价
+    private String costPrice;// 进货价
+    //private String taxRate;// 综合税率
+    //private String productCategory;// 商品类型
+    private String supplierName;// 主供应商名称
+    private String transactionType;// 销售类型
+    private String saleReturnType;// 退货类型
+    private String remark;// 备注
+    //private Integer goodsId; // 商品id
+    private String orderStatus;//订单状态
+    private String taxPrice; // 税费
+//    private String outRefundNo;//退款订单号
+//    private String refundTime;//退款时间
+    //private String primeCost;//成本价=备案单价*货物数量(门店现有库存)
+    //private String goodsNumber;//可用库存数
+    private String storeName;//门店名称
+    private String payFlag;//支付方式
+    private String orderSnWx;//微信流水号
+    private String orderSnAli;//支付宝流水号
+
+//    public String getMerchSnName() {
+//        return merchSnName;
+//    }
+//
+//    public void setMerchSnName(String merchSnName) {
+//        this.merchSnName = merchSnName;
+//    }
+
+//    public String getThirdMerchSnName() {
+//        return thirdMerchSnName;
+//    }
+//
+//    public void setThirdMerchSnName(String thirdMerchSnName) {
+//        this.thirdMerchSnName = thirdMerchSnName;
+//    }
+
+    public String getReceiptNo() {
+        return receiptNo;
+    }
+
+    public void setReceiptNo(String receiptNo) {
+        this.receiptNo = receiptNo;
+    }
+
+    public String getCashRegisterNo() {
+        return cashRegisterNo;
+    }
+
+    public void setCashRegisterNo(String cashRegisterNo) {
+        this.cashRegisterNo = cashRegisterNo;
+    }
+
+    public String getTimeStampDetails() {
+        return timeStampDetails;
+    }
+
+    public void setTimeStampDetails(String timeStampDetails) {
+        this.timeStampDetails = timeStampDetails;
+    }
+
+    public String getStaffID() {
+        return staffID;
+    }
+
+    public void setStaffID(String staffID) {
+        this.staffID = staffID;
+    }
+
+    public String getStaffName() {
+        return staffName;
+    }
+
+    public void setStaffName(String staffName) {
+        this.staffName = staffName;
+    }
+
+    public String getHsCodeName() {
+        return hsCodeName;
+    }
+
+    public void setHsCodeName(String hsCodeName) {
+        this.hsCodeName = hsCodeName;
+    }
+
+    public String getEmatouCode() {
+        return ematouCode;
+    }
+
+    public void setEmatouCode(String ematouCode) {
+        this.ematouCode = ematouCode;
+    }
+
+    public String getPlu() {
+        return plu;
+    }
+
+    public void setPlu(String plu) {
+        this.plu = plu;
+    }
+
+    public String getMychemID() {
+        return mychemID;
+    }
+
+    public void setMychemID(String mychemID) {
+        this.mychemID = mychemID;
+    }
+
+    public String getProductNameEN() {
+        return productNameEN;
+    }
+
+    public void setProductNameEN(String productNameEN) {
+        this.productNameEN = productNameEN;
+    }
+
+    public String getProductNameCN() {
+        return productNameCN;
+    }
+
+    public void setProductNameCN(String productNameCN) {
+        this.productNameCN = productNameCN;
+    }
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public String getPackSize() {
+        return packSize;
+    }
+
+    public void setPackSize(String packSize) {
+        this.packSize = packSize;
+    }
+
+    public String getProductSpecification() {
+        return productSpecification;
+    }
+
+    public void setProductSpecification(String productSpecification) {
+        this.productSpecification = productSpecification;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getEdlp() {
+        return edlp;
+    }
+
+    public void setEdlp(String edlp) {
+        this.edlp = edlp;
+    }
+
+    public String getCurrentPrice() {
+        return currentPrice;
+    }
+
+    public void setCurrentPrice(String currentPrice) {
+        this.currentPrice = currentPrice;
+    }
+
+    public String getCostPrice() {
+        return costPrice;
+    }
+
+    public void setCostPrice(String costPrice) {
+        this.costPrice = costPrice;
+    }
+
+//    public String getTaxRate() {
+//        return taxRate;
+//    }
+//
+//    public void setTaxRate(String taxRate) {
+//        this.taxRate = taxRate;
+//    }
+
+//    public String getProductCategory() {
+//        return productCategory;
+//    }
+//
+//    public void setProductCategory(String productCategory) {
+//        this.productCategory = productCategory;
+//    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
+    public String getTransactionType() {
+        return transactionType;
+    }
+
+    public void setTransactionType(String transactionType) {
+        this.transactionType = transactionType;
+    }
+
+    public String getSaleReturnType() {
+        return saleReturnType;
+    }
+
+    public void setSaleReturnType(String saleReturnType) {
+        this.saleReturnType = saleReturnType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getOrderStatus() {
+        return orderStatus;
+    }
+
+    public void setOrderStatus(String orderStatus) {
+        this.orderStatus = orderStatus;
+    }
+
+    public String getTaxPrice() {
+        return taxPrice;
+    }
+
+    public void setTaxPrice(String taxPrice) {
+        this.taxPrice = taxPrice;
+    }
+
+//    public String getOutRefundNo() {
+//        return outRefundNo;
+//    }
+//
+//    public void setOutRefundNo(String outRefundNo) {
+//        this.outRefundNo = outRefundNo;
+//    }
+//
+//    public String getRefundTime() {
+//        return refundTime;
+//    }
+//
+//    public void setRefundTime(String refundTime) {
+//        this.refundTime = refundTime;
+//    }
+
+//    public String getGoodsNumber() {
+//        return goodsNumber;
+//    }
+//
+//    public void setGoodsNumber(String goodsNumber) {
+//        this.goodsNumber = goodsNumber;
+//    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
+
+    public String getPayFlag() {
+        return payFlag;
+    }
+
+    public void setPayFlag(String payFlag) {
+        this.payFlag = payFlag;
+    }
+
+    public String getOrderSnWx() {
+        return orderSnWx;
+    }
+
+    public void setOrderSnWx(String orderSnWx) {
+        this.orderSnWx = orderSnWx;
+    }
+
+    public String getOrderSnAli() {
+        return orderSnAli;
+    }
+
+    public void setOrderSnAli(String orderSnAli) {
+        this.orderSnAli = orderSnAli;
+    }
+
+    public String getStoreNameSn() {
+        return storeNameSn;
+    }
+
+    public void setStoreNameSn(String storeNameSn) {
+        this.storeNameSn = storeNameSn;
+    }
+}

+ 20 - 0
eccs-biz/src/main/java/com/emato/biz/mapper/mall/InventoryDataMapper.java

@@ -0,0 +1,20 @@
+package com.emato.biz.mapper.mall;
+
+import com.emato.biz.domain.mall.InventoryDataPushVo;
+import com.emato.biz.domain.mall.InventoryDataVo;
+
+import java.util.List;
+import java.util.Map;
+
+public interface InventoryDataMapper {
+    void inserInventory(InventoryDataVo inventoryDataVo);
+
+
+    List<InventoryDataPushVo> getInventoryData(Map<String,Object> map);
+
+    Integer queryOneInventory(InventoryDataVo inventoryDataVo);
+
+    void updateInventory(InventoryDataVo inventoryDataVo);
+
+    Integer getInventoryTotal();
+}

+ 15 - 0
eccs-biz/src/main/java/com/emato/biz/mapper/mall/MallMngChangeMapper.java

@@ -1,7 +1,11 @@
 package com.emato.biz.mapper.mall;
 
+import java.util.Date;
 import java.util.List;
+import java.util.Map;
+
 import com.emato.biz.domain.mall.MallMngChange;
+import com.emato.biz.domain.mall.NewSystemFormatEntiy;
 
 /**
  * 电商库存变化记录表Mapper接口
@@ -58,4 +62,15 @@ public interface MallMngChangeMapper
      * @return 结果
      */
     public int deleteMallMngChangeByIds(Long[] ids);
+
+
+    List<NewSystemFormatEntiy> getSalesDetaiData(Map<String, Object> weChatMapMsg);
+
+    void pullQueryData(Map map);
+
+    int pushSalesDetaiDate(NewSystemFormatEntiy newSystemFormatEntiy);
+
+    Integer getTotalRecord(Map<String, Object> weChatMapMsg);
+
+
 }

+ 17 - 0
eccs-biz/src/main/java/com/emato/biz/mapper/mall/SalesDetailMapper.java

@@ -0,0 +1,17 @@
+package com.emato.biz.mapper.mall;
+
+import com.emato.biz.domain.mall.NewSystemFormatEntiy;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+@Component
+public interface SalesDetailMapper {
+
+    public List<NewSystemFormatEntiy> getSalesDetaiData(Map<String, Object> weChatMapMsg);
+
+    public void pullQueryData(Map map);
+
+    public int pushSalesDetaiDate(NewSystemFormatEntiy newSystemFormatEntiy);
+}

+ 270 - 0
eccs-biz/src/main/java/com/emato/biz/service/impl/SalesDetaiServicelImpl.java

@@ -0,0 +1,270 @@
+package com.emato.biz.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.emato.biz.domain.OmsUtils;
+import com.emato.biz.domain.mall.InventoryDataPushVo;
+import com.emato.biz.domain.mall.InventoryDataVo;
+import com.emato.biz.domain.mall.NewSystemFormatEntiy;
+import com.emato.biz.mapper.mall.InventoryDataMapper;
+import com.emato.biz.mapper.mall.MallMngChangeMapper;
+import com.emato.biz.service.mall.ISalesDetaiServicel;
+import com.emato.common.core.Result;
+import com.emato.common.utils.DateUtils;
+import com.emato.common.utils.sign.Md5Utils;
+import com.emato.system.mapper.SysConfigMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * CW推送数据接口
+ */
+@Service
+public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
+
+
+    private final Logger logger = LoggerFactory.getLogger(SalesDetaiServicelImpl.class);
+
+    @Autowired
+    private InventoryDataMapper inventoryDataMapper;
+    @Autowired
+    private MallMngChangeMapper mallMngChangeMapper;
+    @Autowired
+    private SysConfigMapper configMapper;
+    @Autowired
+    private OmsUtils omsUtils;
+
+    /**
+     * kmall向eccs系统推送数据
+     * @param newSystemFormatEntiy
+     * @return
+     */
+    @Override
+    public int pushSalesDetaiServicel(NewSystemFormatEntiy newSystemFormatEntiy) {
+        return mallMngChangeMapper.pushSalesDetaiDate(newSystemFormatEntiy);
+    }
+
+    /**
+     * 外部系统查询订单销售数据
+     * @param msg
+     * @return
+     */
+    @Override
+    public Result getSalesDetaiData(JSONObject msg, HttpServletRequest httpServletRequest) {
+        try {
+
+            //校验签名
+            Map<String, Object> weChatMapSalesMsg = JSONObject.toJavaObject(msg, Map.class);
+            //签名验证
+            String strSign = weChatMapSalesMsg.get("sign").toString().trim();
+            String merchId = weChatMapSalesMsg.get("merchId").toString().trim()==null?"":weChatMapSalesMsg.get("merchId").toString().trim();
+            String timestamp = weChatMapSalesMsg.get("timestamp").toString().trim()==null?"":weChatMapSalesMsg.get("timestamp").toString().trim();
+            String str = configMapper.getConfigValue("salesdetai").trim();;
+            if(timestamp.equals("")||merchId.equals("")){
+                return Result.error("900051","参数错误");
+            }
+            if(!strSign.trim().equals(checkType(weChatMapSalesMsg.get("data").toString(),timestamp,str))){
+                return Result.error("900052","签名错误");
+            }
+            Map<String, Object> weSalesMsg =  JSONObject.toJavaObject(JSON.parseObject(weChatMapSalesMsg.get("data").toString()), Map.class);
+
+            String starTime = (String) weSalesMsg.get("starTime");
+            String endTime = (String) weSalesMsg.get("endTime");
+            Integer pageIndex = Integer.parseInt(weSalesMsg.get("pageIndex")+"");
+            Integer pageSize = Integer.parseInt(weSalesMsg.get("pageSize")+"");
+            weSalesMsg.put("starTime", DateUtils.getStrDate((String) weSalesMsg.get("starTime")));
+            weSalesMsg.put("endTime",DateUtils.getStrDate((String)weSalesMsg.get("endTime")));
+
+            if(pageIndex>500){
+                return Result.error("900053","请求总数或时间区间过大");
+            }
+            pageIndex = (pageIndex-1)*pageSize;
+            weSalesMsg.put("offset",pageIndex);
+            weSalesMsg.put("limit",pageSize);
+                //记录调用参数接口日志
+            long diff=(Long.parseLong(endTime) - Long.parseLong(starTime))/1000/60/60;
+            if(diff<=24){
+                pullQueryData(weChatMapSalesMsg);
+                List<NewSystemFormatEntiy> list = mallMngChangeMapper.getSalesDetaiData(weSalesMsg);
+                Integer total = mallMngChangeMapper.getTotalRecord(weSalesMsg);
+                //desList = DesUtils.encode(JSON.toJSONString(list));
+                if(list.size()==0){
+                    return Result.error("900054","该条件下无数据");
+                }else{
+                    Map<String,Object> map = new HashMap<>();
+                    map.put("total",total);
+                    map.put("rows",list);
+                    return Result.success(map);
+                }
+            }else{
+                return Result.error("900053","请求总数或时间区间过大");
+            }
+
+        }catch (Exception e){
+            logger.error("外部系统查询订单销售数据错误="+ JSON.toJSONString(msg),e);
+            return Result.error("900051","参数错误");
+        }
+
+    }
+
+    /**
+     * 记录外部调用接口参数,时间和调用方
+     * @param msg
+     */
+    private void pullQueryData(Map msg) {
+        Map<String,Object> map = new HashMap<>();
+        map.put("tranDirection",msg.get("merchId"));
+        map.put("msg",msg.toString());
+        mallMngChangeMapper.pullQueryData(map);
+
+    }
+
+
+    /**
+     * 插入来源于oms的库存数据
+     * @param inventoryDataVo
+     */
+    @Override
+    public Result inserInventory(InventoryDataVo inventoryDataVo) {
+        try{
+            logger.error("插入来源于oms的库存数据");
+            //查询是否存在该库存信息
+            Integer checkStuts = inventoryDataMapper.queryOneInventory(inventoryDataVo);
+            if(checkStuts>0){
+                inventoryDataMapper.updateInventory(inventoryDataVo);
+            }else{
+                inventoryDataMapper.inserInventory(inventoryDataVo);
+            }
+            return Result.success();
+        }catch (Exception e){
+            logger.error("插入来源于oms的库存数据"+JSON.toJSONString(inventoryDataVo),e);
+            return Result.error("1001","数据插入出错");
+        }
+    }
+
+    /**
+     * 查询库存数据提供给外部系统
+     * @param msg
+     * @param httpServletRequest
+     * @return
+     */
+    @Override
+    public Result queryInventory(JSONObject msg, HttpServletRequest httpServletRequest) {
+        try{
+
+            //校验签名
+            Map<String, Object> weChatMapMsg = JSONObject.toJavaObject(msg, Map.class);
+            //签名验证
+            String strSign = weChatMapMsg.get("sign").toString().trim();
+            String merchId = weChatMapMsg.get("merchId").toString().trim()==null?"":weChatMapMsg.get("merchId").toString().trim();
+            String timestamp = weChatMapMsg.get("timestamp").toString().trim()==null?"":weChatMapMsg.get("timestamp").toString().trim();
+            String str = configMapper.getConfigValue("inventory");;
+            if(timestamp.equals("")||merchId.equals("")){
+                return Result.error("900001","参数错误");
+            }
+            if(!strSign.trim().equals(checkType(weChatMapMsg.get("data").toString(),timestamp,str))){
+                return Result.error("900002","签名错误");
+            }
+            Map<String, Object> weDtilMsg =  JSONObject.toJavaObject(JSON.parseObject(weChatMapMsg.get("data").toString()), Map.class);
+            Integer pageIndex = Integer.parseInt(weDtilMsg.get("pageIndex")+"");
+            Integer pageSize = Integer.parseInt(weDtilMsg.get("pageSize")+"");
+            pageIndex = (pageIndex-1)*pageSize;
+            weChatMapMsg.put("offset",pageIndex);
+            weChatMapMsg.put("limit",pageSize);
+            weChatMapMsg.put("merchId",merchId);
+            weChatMapMsg.put("sign",strSign);
+            String merchSn = weDtilMsg.get("merchSn").toString().trim()==null?"":weDtilMsg.get("merchSn").toString().trim();
+            if(merchSn.equals("")){
+                return Result.error("900001","参数错误");
+            }
+            if(pageSize>3000){
+                return Result.error("900003","请求数量过大");
+            }
+
+            pullQueryData(weChatMapMsg);
+            //  数据查询
+            //List<InventoryDataPushVo> list = inventoryDataMapper.getInventoryData(weChatMapMsg);
+            List<InventoryDataPushVo> list = getOmsData(weDtilMsg,weChatMapMsg);
+            Integer total = inventoryDataMapper.getInventoryTotal();
+            if(list.size()==0){
+                return Result.error("900004","该条件下无数据");
+            }else{
+                Map<String,Object> map = new HashMap<>();
+                map.put("total",total);
+                map.put("invTime",DateUtils.dateToStrLong(new Date()));
+                map.put("rows",list);
+                return Result.success(map);
+            }
+        }catch (Exception e){
+            logger.error("外部系统查询库存系统条件="+JSON.toJSONString(msg),e);
+            return Result.error("900001","参数错误");
+        }
+
+    }
+
+
+    //签名加密校验
+    public String checkType(String data,String timestamp,String sekey) {
+        String sign = sekey+"data" + data + "timestamp" + timestamp;
+        return Md5Utils.encryption(sign);
+    }
+
+
+
+    public List<InventoryDataPushVo> getOmsData(Map<String, Object> weDtilMsg,Map<String, Object> weChatMapMsg){
+        String driver=omsUtils.getOmsDriver();
+        String user=omsUtils.getOmsUser();
+        String password=omsUtils.getOmsPassword();
+        String url=omsUtils.getOmsUrl();
+        List<InventoryDataPushVo> inventoryDataPushVos = null;
+        try{
+            //加载数据库驱动
+            Class.forName(driver);
+            //连接数据库
+            Connection conn = DriverManager.getConnection(url,user,password);
+            //创建Statement对象
+            Statement stmt = conn.createStatement();
+            String sql = "SELECT wmsi.merch_sn,ppr.prod_barcode,ppr.prod_name,wmsi.shop_sn,wim.valid_num,wmsi.shop_inve FROM wb_inve_mng wim LEFT JOIN pd_product_record ppr ON wim.sku = ppr.sku LEFT JOIN wb_merch_shop_inve wmsi ON wim.sku = wmsi.sku WHERE ppr.is_record = 1 AND ppr.is_valid = 0 AND wim.inve_status = 0 AND wim.is_valid = 0 AND wmsi.is_valid = 0 AND wim.merch_sn='"+weDtilMsg.get("merchSn")+"' limit "+weChatMapMsg.get("offset")+","+weChatMapMsg.get("limit")+"";
+            //建立结果集
+            ResultSet rs = stmt.executeQuery(sql);
+            inventoryDataPushVos =convertList(rs);
+            //关闭结果集
+            rs.close();
+            //关闭Statement对象
+            stmt.close();
+            //关闭数据库
+            conn.close();
+
+        }catch(Exception e){
+          logger.error("查询oms库存数据出错");
+        }
+        return inventoryDataPushVos;
+    }
+
+
+
+    private static List<InventoryDataPushVo> convertList(ResultSet rs) throws SQLException {
+        List<InventoryDataPushVo> list = new ArrayList();
+        while (rs.next()) {
+            InventoryDataPushVo inventoryDataPushVo = new InventoryDataPushVo();
+            inventoryDataPushVo.setBarcode(rs.getString("prod_barcode"));
+            inventoryDataPushVo.setProductName(rs.getString("prod_name"));
+            inventoryDataPushVo.setShopSn(rs.getString("shop_sn"));
+            inventoryDataPushVo.setShopInvent(rs.getInt("shop_inve"));
+            inventoryDataPushVo.seteMatou(rs.getInt("valid_num"));
+            list.add(inventoryDataPushVo);
+        }
+        return list;
+    }
+
+}

+ 19 - 0
eccs-biz/src/main/java/com/emato/biz/service/mall/ISalesDetaiServicel.java

@@ -0,0 +1,19 @@
+package com.emato.biz.service.mall;
+
+import com.alibaba.fastjson.JSONObject;
+import com.emato.biz.domain.mall.InventoryDataVo;
+import com.emato.biz.domain.mall.NewSystemFormatEntiy;
+import com.emato.common.core.Result;
+
+import javax.servlet.http.HttpServletRequest;
+
+public interface ISalesDetaiServicel {
+    int pushSalesDetaiServicel(NewSystemFormatEntiy newSystemFormatEntiy);
+
+    Result getSalesDetaiData(JSONObject msg,HttpServletRequest httpServletRequest);
+
+    public Result inserInventory(InventoryDataVo inventoryDataVo);
+
+    public Result  queryInventory(JSONObject msg, HttpServletRequest httpServletRequest);
+
+}

+ 88 - 0
eccs-biz/src/main/resources/mapper/biz/mall/InventoryDataMapper.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.emato.biz.mapper.mall.InventoryDataMapper">
+
+
+    <!--    外部接口查询-->
+    <select id="getInventoryData"  parameterType="java.util.Map" resultType="com.emato.biz.domain.mall.InventoryDataPushVo">
+        SELECT
+            bar_code as barcode,
+            product_name as productName,
+            shop_name as shopName,
+            shop_invent as shopInvent,
+            e_matou as eMatou
+        FROM
+        o_inventory_data
+        <if test="offset != null and limit != null">
+            limit #{offset}, #{limit}
+        </if>
+    </select>
+
+    <select id="getInventoryTotal" resultType="java.lang.Integer">
+        SELECT
+        count(*)
+        FROM
+        o_inventory_data
+    </select>
+
+
+    <insert id="inserInventory" parameterType="com.emato.biz.domain.mall.InventoryDataVo" >
+        insert into o_inventory_data
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+            <if test="barcode != null" >
+                bar_code,
+            </if>
+            <if test="productName != null" >
+                product_name,
+            </if>
+            <if test="shopCode != null" >
+                shop_code,
+            </if>
+            <if test="shopName != null" >
+                shop_name,
+            </if>
+            <if test="shopInvent != null" >
+                shop_invent,
+            </if>
+            <if test="eMatou != null" >
+                e_matou,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+            <if test="barcode != null" >
+                #{barcode},
+            </if>
+            <if test="productName != null" >
+                #{productName},
+            </if>
+            <if test="shopCode != null" >
+                #{shopCode},
+            </if>
+            <if test="shopName != null" >
+                #{shopName},
+            </if>
+            <if test="shopInvent != null" >
+                #{shopInvent},
+            </if>
+            <if test="eMatou != null" >
+                #{eMatou},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateInventory" parameterType="com.emato.biz.domain.mall.InventoryDataVo">
+        update o_inventory_data
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="shopInvent != null">shop_invent = #{shopInvent},</if>
+            <if test="eMatou != null">e_matou = #{eMatou},</if>
+        </trim>
+        where bar_code = #{barcode}  and shop_code = #{shopCode}
+    </update>
+
+    <select id="queryOneInventory" parameterType="com.emato.biz.domain.mall.InventoryDataVo" resultType="java.lang.Integer">
+        select count(*) from o_inventory_data oid  where bar_code = #{barcode}  and shop_code = #{shopCode}
+    </select>
+
+</mapper>

+ 171 - 0
eccs-biz/src/main/resources/mapper/biz/mall/MallMngChangeMapper.xml

@@ -113,4 +113,175 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+
+
+    <!--    接收kmall数据-->
+    <insert id="pushSalesDetaiDate" parameterType="NewSystemFormatEntiy">
+        insert into mall_sales_detail_data
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="merchSn != null">merch_sn,</if>
+            <if test="merchSnName != null">merch_sn_name,</if>
+            <if test="thirdMerchSn != null">third_merch_sn,</if>
+            <if test="thirdMerchSnName != null">third_merch_sn_name,</if>
+            <if test="receiptNo != null">receipt_no,</if>
+            <if test="storeName != null">store_name,</if>
+            <if test="storeNameSn != null">store_name_sn,</if>
+            <if test="cashRegisterNo != null">cash_register_no,</if>
+            <if test="timeStampDetails != null">time_stamp,</if>
+            <if test="staffID != null">staff_id,</if>
+            <if test="staffName != null">staff_name,</if>
+            <if test="payFlag != null">pay_flag,</if>
+            <if test="orderStatus != null">order_status,</if>
+            <if test="orderSnWx != null">order_sn_wx,</if>
+
+            <if test="orderSnAli != null">order_sn_ali,</if>
+            <if test="hsCode != null">hs_code,</if>
+            <if test="hsCodeName != null">hs_code_name,</if>
+            <if test="ematouCode != null">ematou_code,</if>
+            <if test="plu != null">plu,</if>
+            <if test="mychemID != null">mychem_id,</if>
+            <if test="productNameEN != null">product_name_en,</if>
+            <if test="productNameCN != null">product_name_cn,</if>
+            <if test="barcode != null">barcode,</if>
+            <if test="packSize != null">pack_size,</if>
+            <if test="productSpecification != null">product_spec,</if>
+            <if test="brand != null">brand,</if>
+            <if test="edlp != null">edlp,</if>
+            <if test="currentPrice != null">current_price,</if>
+            <if test="costPrice != null">cost_price,</if>
+            <if test="taxRate != null">tax_rate,</if>
+            <if test="taxPrice != null">tax_price,</if>
+            <if test="productCategory != null">product_category,</if>
+            <if test="supplierName != null">supplier_name,</if>
+            <if test="transactionType != null">transaction_type,</if>
+            <if test="saleReturnType != null">sale_return_type,</if>
+            <if test="remark != null">remark,</if>
+
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="merchSn != null">#{merchSn},</if>
+            <if test="merchSnName != null">#{merchSnName},</if>
+            <if test="thirdMerchSn != null">#{thirdMerchSn},</if>
+            <if test="thirdMerchSnName != null">#{thirdMerchSnName},</if>
+            <if test="receiptNo != null">#{receiptNo},</if>
+            <if test="storeName != null">#{storeName},</if>
+            <if test="storeNameSn != null">#{storeNameSn},</if>
+            <if test="cashRegisterNo != null">#{cashRegisterNo},</if>
+            <if test="timeStampDetails != null">#{timeStampDetails},</if>
+            <if test="staffID != null">#{staffID},</if>
+            <if test="staffName != null">#{staffName},</if>
+            <if test="payFlag != null">#{payFlag},</if>
+            <if test="orderStatus != null">#{orderStatus},</if>
+            <if test="orderSnWx != null">#{orderSnWx},</if>
+
+            <if test="orderSnAli != null">#{orderSnAli},</if>
+            <if test="hsCode != null">#{hsCode},</if>
+            <if test="hsCodeName != null">#{hsCodeName},</if>
+            <if test="ematouCode != null">#{ematouCode},</if>
+            <if test="plu != null">#{plu},</if>
+            <if test="mychemID != null">#{mychemID},</if>
+            <if test="productNameEN != null">#{productNameEN},</if>
+            <if test="productNameCN != null">#{productNameCN},</if>
+            <if test="barcode != null">#{barcode},</if>
+            <if test="packSize != null">#{packSize},</if>
+            <if test="productSpecification != null">#{productSpecification},</if>
+            <if test="brand != null">#{brand},</if>
+            <if test="edlp != null">#{edlp},</if>
+            <if test="currentPrice != null">#{currentPrice},</if>
+            <if test="costPrice != null">#{costPrice},</if>
+            <if test="taxRate != null">#{taxRate},</if>
+            <if test="taxPrice != null">#{taxPrice},</if>
+            <if test="productCategory != null">#{productCategory},</if>
+            <if test="supplierName != null">#{supplierName},</if>
+            <if test="transactionType != null">#{transactionType},</if>
+            <if test="saleReturnType != null">#{saleReturnType},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+
+    <!--    外部接口查询订单信息-->
+    <select id="getSalesDetaiData"  parameterType="java.util.Map" resultType="com.emato.biz.domain.mall.PushSystemOdOderVo">
+        SELECT
+        merch_sn_name as merchSnName,
+        third_merch_sn_name as thirdMerchSnName,
+        receipt_no as receiptNo,
+        store_name as storeName,
+        store_name_sn as storeNameSn,
+        cash_register_no as cashRegisterNo,
+        time_stamp as timeStampDetails,
+        staff_id as staffID,
+        staff_name as staffName,
+        pay_flag as payFlag,
+        order_status as orderStatus,
+        order_sn_wx as orderSnWx,
+        order_sn_ali as orderSnAli,
+        hs_code as hsCode,
+        hs_code_name as hsCodeName,
+        ematou_code as ematouCode,
+        plu as plu,
+        mychem_id as mychemID,
+        product_name_en as productNameEN,
+        product_name_cn as productNameCN,
+        barcode as barcode,
+        pack_size as packSize,
+        product_spec as productSpecification,
+        brand as brand,
+        edlp as edlp,
+        current_price as currentPrice,
+        cost_price as costPrice,
+        tax_rate as taxRate,
+        tax_price as taxPrice,
+        product_category as productCategory,
+        supplier_name as supplierName,
+        transaction_type as transactionType,
+        sale_return_type as saleReturnType,
+        remark
+        FROM
+        mall_sales_detail_data
+        WHERE
+        <if test="starTime != null and starTime != ''">
+             time_stamp &gt; STR_TO_DATE(#{starTime}, '%Y-%m-%d %H:%i:%s')
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND time_stamp &lt;= STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s')
+        </if>
+        <if test="orderStatus !=null and orderStatus !=''">
+            AND order_status = #{orderStatus}
+        </if>
+        <if test="orderNo !=null and orderNo !=''">
+            AND receipt_no = #{orderNo}
+        </if>
+        <if test="offset != null and limit != null">
+            limit #{offset}, #{limit}
+        </if>
+    </select>
+
+    <select id="getTotalRecord"  parameterType="java.util.Map" resultType="java.lang.Integer">
+        SELECT
+        count(*)
+        FROM
+        mall_sales_detail_data
+        WHERE
+        <if test="starTime != null and starTime != ''">
+            time_stamp &gt; STR_TO_DATE(#{starTime}, '%Y-%m-%d %H:%i:%s')
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND time_stamp &lt;= STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s')
+        </if>
+    </select>
+
+    <!--    记录外部调用接口入参-->
+    <insert id="pullQueryData" parameterType="java.lang.String">
+        insert into mall_sales_detail_log(
+        <if test="msg != null and msg != '' ">msg,</if>
+        <if test="tranDirection != null and tranDirection != '' ">tran_direction,</if>
+        msg_date
+        )values(
+        <if test="msg != null and msg != ''">#{msg},</if>
+        <if test="tranDirection != null and tranDirection != ''">#{tranDirection},</if>
+        sysdate()
+        )
+    </insert>
+
 </mapper>

+ 163 - 0
eccs-biz/src/main/resources/mapper/biz/mall/SalesDetailMapper.xml.xml

@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.emato.biz.mapper.mall.SalesDetailMapper">
+
+
+<!--    接收kmall数据-->
+    <insert id="pushSalesDetaiDate" parameterType="NewSystemFormatEntiy">
+        insert into mall_sales_detail_data(
+            <if test="merchSn != null">merch_sn,</if>
+            <if test="merchSnName != null">merch_sn_name,</if>
+            <if test="thirdMerchSn != null">third_merch_sn,</if>
+            <if test="thirdMerchSnName != null">third_merch_sn_name,</if>
+            <if test="receiptNo != null">receipt_no,</if>
+            <if test="storeName != null">store_name,</if>
+            <if test="storeNameSn != null">store_name_sn,</if>
+            <if test="cashRegisterNo != null">ash_register_no,</if>
+             /*销售时间*/
+            <if test="timeStampDetails != null">time_stamp,</if>
+            <if test="staffID != null">staff_id,</if>
+            <if test="staffName != null">staff_name,</if>
+            <if test="payFlag != null">pay_flag,</if>
+            <if test="orderStatus != null">order_status,</if>
+            <if test="orderSnWx != null">order_sn_wx,</if>
+
+            <if test="orderSnAli != null">order_sn_ali,</if>
+            <if test="hsCode != null">hs_code,</if>
+            <if test="hsCodeName != null">hs_code_name,</if>
+            <if test="ematouCode != null">ematou_code,</if>
+            <if test="plu != null">plu,</if>
+            <if test="mychemID != null">mychem_id,</if>
+            <if test="productNameEN != null">product_name_en,</if>
+            <if test="productNameCN != null">product_name_cn,</if>
+            <if test="barcode != null">barcode,</if>
+            <if test="packSize != null">pack_size,</if>
+            <if test="productSpecification != null">product_spec,</if>
+            <if test="brand != null">brand,</if>
+            <if test="edlp != null">edlp,</if>
+            <if test="currentPrice != null">current_price,</if>
+            <if test="costPrice != null">cost_price,</if>
+            <if test="taxRate != null">tax_rate,</if>
+            <if test="productCategory != null">product_category,</if>
+            <if test="supplierName != null">supplier_name,</if>
+            <if test="transactionType != null">transaction_type,</if>
+            <if test="saleReturnType != null">sale_return_type,</if>
+            <if test="remark != null">remark</if>
+        )values(
+        <if test="merchSn != null">#{merchSn},</if>
+        <if test="merchSnName != null">#{merchSnName},</if>
+        <if test="thirdMerchSn != null">#{thirdMerchSn},</if>
+        <if test="thirdMerchSnName != null">#{thirdMerchSnName},</if>
+        <if test="receiptNo != null">#{receiptNo},</if>
+        <if test="storeName != null">#{storeName},</if>
+        <if test="storeNameSn != null">#{storeNameSn},</if>
+        <if test="cashRegisterNo != null">#{cashRegisterNo},</if>
+        /*销售时间*/
+        <if test="timeStampDetails != null">#{timeStampDetails},</if>
+        <if test="staffID != null">#{staffID},</if>
+        <if test="staffName != null">#{staffName},</if>
+        <if test="payFlag != null">#{payFlag},</if>
+        <if test="orderStatus != null">#{orderStatus},</if>
+        <if test="orderSnWx != null">#{orderSnWx},</if>
+
+        <if test="orderSnAli != null">#{orderSnAli},</if>
+        <if test="hsCode != null">#{hsCode},</if>
+        <if test="hsCodeName != null">#{hsCodeName},</if>
+        <if test="ematouCode != null">#{ematouCode},</if>
+        <if test="plu != null">#{plu},</if>
+        <if test="mychemID != null">#{mychemID},</if>
+        <if test="productNameEN != null">#{productNameEN},</if>
+        <if test="productNameCN != null">#{productNameCN},</if>
+        <if test="barcode != null">#{barcode},</if>
+        <if test="packSize != null">#{packSize},</if>
+        <if test="productSpecification != null">#{productSpecification},</if>
+        <if test="brand != null">#{brand},</if>
+        <if test="edlp != null">#{edlp},</if>
+        <if test="currentPrice != null">#{currentPrice},</if>
+        <if test="costPrice != null">#{costPrice},</if>
+        <if test="taxRate != null">#{taxRate},</if>
+        <if test="productCategory != null">#{productCategory},</if>
+        <if test="supplierName != null">#{supplierName},</if>
+        <if test="transactionType != null">#{transactionType},</if>
+        <if test="saleReturnType != null">#{saleReturnType},</if>
+        <if test="remark != null">#{remark}</if>
+        )
+    </insert>
+
+
+<!--    外部接口查询订单信息-->
+    <select id="getSalesDetaiData"  parameterType="java.util.Map" resultType="com.emato.biz.domain.mall.NewSystemFormatEntiy">
+        SELECT
+        merch_sn,
+        merch_sn_name,
+        third_merch_sn,
+        third_merch_sn_name,
+        receipt_no,
+        store_name,
+        store_name_sn,
+        ash_register_no,
+        time_stamp,
+        staff_id,
+        staff_name,
+        pay_flag,
+        order_status,
+        order_sn_wx,
+        order_sn_ali,
+        hs_code,
+        hs_code_name,
+        ematou_code,
+        plu,
+        mychem_id,
+        product_name_en,
+        product_name_cn,
+        barcode,
+        pack_size,
+        product_spec,
+        brand,
+        edlp,
+        current_price,
+        cost_price,
+        tax_rate,
+        product_category,
+        supplier_name,
+        transaction_type,
+        sale_return_type,
+        remark,
+        create_time
+        FROM
+        mall_sales_detail_data
+        WHERE
+        STR_TO_DATE(create_time, '%Y-%m-%d %H:%i:%s')
+        BETWEEN
+        <if test="starTime !=null and starTime !=''">
+            STR_TO_DATE(#{starTime}, '%Y-%m-%d %H:%i:%s')
+        </if>
+        <if test="endTime !=null and endTime !=''">
+            AND STR_TO_DATE(#{endTime}, '%Y-%m-%d %H:%i:%s')
+        </if>
+        <if test="orderStatus !=null and orderStatus !=''">
+            AND order_status = #{orderStatus}
+        </if>
+        <if test="pageIndex != null and pageSize != null">
+            limit #{pageIndex}, #{pageSize}
+        </if>
+    </select>
+
+<!--    记录外部调用接口入参-->
+    <insert id="pullQueryData" parameterType="java.util.Map">
+        insert into mall_sales_detail_log
+        <if test="msg != null and msg != '' ">msg,</if>
+        <if test="tranDirection != null and tranDirection != '' ">tran_direction,</if>
+        datasyn_time
+        )values(
+        <if test="msg != null and msg != ''">#{msg},</if>
+        <if test="tranDirection != null and tranDirection != ''">#{tranDirection},</if>
+        sysdate()
+        )
+    </insert>
+
+
+
+</mapper>

+ 12 - 0
eccs-common/src/main/java/com/emato/common/annotation/AnonymousAccess.java

@@ -0,0 +1,12 @@
+package com.emato.common.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * 匿名认证
+ */
+@Target({ ElementType.PARAMETER, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface AnonymousAccess {
+}

+ 97 - 0
eccs-common/src/main/java/com/emato/common/core/Result.java

@@ -0,0 +1,97 @@
+package com.emato.common.core;
+
+import java.io.Serializable;
+import java.util.Map;
+
+public class Result implements Serializable {
+
+    private String code;
+
+    private String msg;
+
+    private String status;
+
+    private Map<String,Object> data;
+
+    //private String totalRecord;
+
+
+
+    public static Result success() {
+        Result result = new Result();
+        result.code = "200";
+        result.msg = "请求成功";
+        result.status = "true";
+        result.data = null;
+        return result;
+    }
+
+//    public static Result success(Object data,String totalRecord) {
+//        Result result = new Result();
+//        result.code = "200";
+//        result.msg = "请求成功";
+//        result.status = "true";
+//        result.totalRecord = totalRecord;
+//        result.data = data;
+//        return result;
+//    }
+
+    public static Result success(Map<String,Object> data) {
+        Result result = new Result();
+        result.code = "200";
+        result.msg = "请求成功";
+        result.status = "true";
+        result.data = data;
+        return result;
+    }
+
+    public static Result error(String code, String msg) {
+        Result result = new Result();
+        result.code = code;
+        result.status = "false";
+        result.msg = msg;
+        result.data = null;
+        return result;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+//    public String getTotalRecord() {
+//        return totalRecord;
+//    }
+//
+//    public void setTotalRecord(String totalRecord) {
+//        this.totalRecord = totalRecord;
+//    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Map<String, Object> getData() {
+        return data;
+    }
+
+    public void setData(Map<String, Object> data) {
+        this.data = data;
+    }
+}
+

+ 87 - 0
eccs-common/src/main/java/com/emato/common/core/ResultNew.java

@@ -0,0 +1,87 @@
+package com.emato.common.core;
+
+import java.io.Serializable;
+
+public class ResultNew implements Serializable {
+
+    private String code;
+
+    private String msg;
+
+    private String status;
+
+    private Object data;
+
+    //private String totalRecord;
+
+
+
+    public static ResultNew success() {
+        ResultNew result = new ResultNew();
+        result.code = "200";
+        result.msg = "请求成功";
+        result.status = "true";
+        result.data = null;
+        return result;
+    }
+
+
+    public static ResultNew success(Object data) {
+        ResultNew result = new ResultNew();
+        result.code = "200";
+        result.msg = "请求成功";
+        result.status = "true";
+        result.data = data;
+        return result;
+    }
+
+    public static ResultNew error(String code, String msg) {
+        ResultNew result = new ResultNew();
+        result.code = code;
+        result.status = "false";
+        result.msg = msg;
+        result.data = "";
+        return result;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+//    public String getTotalRecord() {
+//        return totalRecord;
+//    }
+//
+//    public void setTotalRecord(String totalRecord) {
+//        this.totalRecord = totalRecord;
+//    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+}
+

+ 31 - 0
eccs-common/src/main/java/com/emato/common/utils/DateUtils.java

@@ -103,6 +103,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return DateFormatUtils.format(now, "yyyyMMdd");
     }
 
+    public  static  String dateToStrLong(Date dateDate) {
+        SimpleDateFormat formatter =  new  SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
+        String dateString = formatter.format(dateDate);
+        return  dateString;
+    }
+
     /**
      * 日期型字符串转化为日期 格式
      */
@@ -152,4 +158,29 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         // long sec = diff % nd % nh % nm / ns;
         return day + "天" + hour + "小时" + min + "分钟";
     }
+
+
+    public static String getStrDate(String mlDate){
+        SimpleDateFormat format =  new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //设置格式
+        String timeText=format.format(Long.parseLong(mlDate));
+        return timeText;
+    }
+
+    /**
+     * @param strDate
+     * @param
+     * @return 若失败则返回当前时间
+     */
+    public static Date parseToDate(String strDate) {
+        try {
+            if (strDate == null || strDate.trim().length() == 0) {
+                return new Date();
+            }
+            SimpleDateFormat sdf = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
+            return sdf.parse(strDate);
+        } catch (ParseException e) {
+            return new Date();
+        }
+    }
+
 }

+ 102 - 0
eccs-common/src/main/java/com/emato/common/utils/oms/request/DesUtils.java

@@ -0,0 +1,102 @@
+package com.emato.common.utils.oms.request;
+
+import javax.crypto.*;
+import javax.crypto.spec.DESKeySpec;
+import java.security.SecureRandom;
+
+public class DesUtils {
+
+    private static final String DES = "DES";
+    private static final String KEY = "4YztMHI7PsT4rLZN";
+    public static final String SIGN = "C5B4054FD8D23tQB";
+
+    private static byte[] encrypt(byte[] src, byte[] key) throws Exception {
+        SecureRandom sr = new SecureRandom();
+        DESKeySpec dks = new DESKeySpec(key);
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
+        SecretKey secretKey = keyFactory.generateSecret(dks);
+        Cipher cipher = Cipher.getInstance(DES);
+        cipher.init(Cipher.ENCRYPT_MODE, secretKey, sr);
+        return cipher.doFinal(src);
+    }
+
+    private static byte[] decrypt(byte[] src, byte[] key) throws Exception {
+        SecureRandom sr = new SecureRandom();
+        DESKeySpec dks = new DESKeySpec(key);
+        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(DES);
+        SecretKey secretKey = keyFactory.generateSecret(dks);
+        Cipher cipher = Cipher.getInstance(DES);
+        cipher.init(Cipher.DECRYPT_MODE, secretKey, sr);
+        return cipher.doFinal(src);
+    }
+
+    private static String byte2hex(byte[] b) {
+        String hs = "";
+        String temp = "";
+        for (int n = 0; n < b.length; n++) {
+            temp = (java.lang.Integer.toHexString(b[n] & 0XFF));
+            if (temp.length() == 1)
+                hs = hs + "0" + temp;
+            else
+                hs = hs + temp;
+        }
+        return hs.toUpperCase();
+
+    }
+
+    private static byte[] hex2byte(byte[] b) {
+        if ((b.length % 2) != 0)
+            throw new IllegalArgumentException("length not even");
+        byte[] b2 = new byte[b.length / 2];
+        for (int n = 0; n < b.length; n += 2) {
+            String item = new String(b, n, 2);
+            b2[n / 2] = (byte) Integer.parseInt(item, 16);
+        }
+        return b2;
+    }
+
+    private static String decode(String src, String key) {
+        String decryptStr = "";
+        try {
+            byte[] decrypt = decrypt(hex2byte(src.getBytes()), key.getBytes());
+            decryptStr = new String(decrypt);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return decryptStr;
+    }
+
+    private static String encode(String src, String key){
+        byte[] bytes = null;
+        String encryptStr = "";
+        try {
+            bytes = encrypt(src.getBytes(), key.getBytes());
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        if (bytes != null)
+            encryptStr = byte2hex(bytes);
+        return encryptStr;
+    }
+
+    /**
+     * 解密
+     */
+    public static String decode(String src) {
+        return decode(src, KEY);
+    }
+
+    /**
+     * 加密
+     */
+    public static String encode(String src) {
+        return encode(src, KEY);
+    }
+//    public static void main(String[] args) {
+//        String ss = "uu123@#$";
+//        String encodeSS = encode(ss);
+//        System.out.println(encodeSS);
+//        String decodeSS = decode(encodeSS);
+//        System.out.println(decodeSS);
+//    }
+}

+ 33 - 0
eccs-common/src/main/java/com/emato/common/utils/sign/Md5Utils.java

@@ -1,5 +1,6 @@
 package com.emato.common.utils.sign;
 
+import java.io.UnsupportedEncodingException;
 import java.security.MessageDigest;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,4 +64,36 @@ public class Md5Utils
             return s;
         }
     }
+
+
+    /**
+     * MD5加密,返回32位密文
+     * @param plainText
+     * @return String
+     * @throws UnsupportedEncodingException
+     */
+    public static String encryption(String plainText){
+        String re_md5 = new String();
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");
+            md.update(plainText.getBytes("UTF-8"));
+            byte b[] = md.digest();
+            int i;
+            StringBuffer buf = new StringBuffer("");
+            for (int offset = 0; offset < b.length; offset++) {
+                i = b[offset];
+                if (i < 0)
+                    i += 256;
+                if (i < 16)
+                    buf.append("0");
+                buf.append(Integer.toHexString(i));
+            }
+            re_md5 = buf.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return re_md5;
+    }
+
+
 }

+ 22 - 0
eccs-framework/src/main/java/com/emato/framework/config/SecurityConfig.java

@@ -1,5 +1,7 @@
 package com.emato.framework.config;
 
+import com.emato.common.annotation.AnonymousAccess;
+import com.emato.common.utils.spring.SpringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.http.HttpMethod;
@@ -17,6 +19,13 @@ import org.springframework.web.filter.CorsFilter;
 import com.emato.framework.security.filter.JwtAuthenticationTokenFilter;
 import com.emato.framework.security.handle.AuthenticationEntryPointImpl;
 import com.emato.framework.security.handle.LogoutSuccessHandlerImpl;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
+import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * spring security配置
@@ -113,6 +122,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/webjars/**").anonymous()
                 .antMatchers("/*/api-docs").anonymous()
                 .antMatchers("/druid/**").anonymous()
+                .antMatchers(getAnonymousAccess()).anonymous()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
                 .and()
@@ -125,6 +135,18 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
         httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
     }
 
+    private String[] getAnonymousAccess() {
+        Map<RequestMappingInfo, HandlerMethod> handlerMethods = SpringUtils.getBean(RequestMappingHandlerMapping.class).getHandlerMethods();
+        Set<String> anonymousAccess = new HashSet<>();
+        for (Map.Entry<RequestMappingInfo, HandlerMethod> entry : handlerMethods.entrySet()) {
+            HandlerMethod value = entry.getValue();
+            AnonymousAccess methodAnnotation = value.getMethodAnnotation(AnonymousAccess.class);
+            if (methodAnnotation != null) {
+                anonymousAccess.addAll(entry.getKey().getPatternsCondition().getPatterns());
+            }
+        }
+        return anonymousAccess.toArray(new String[0]);
+    }
     
     /**
      * 强散列哈希加密实现

+ 2 - 0
eccs-system/src/main/java/com/emato/system/mapper/SysConfigMapper.java

@@ -65,4 +65,6 @@ public interface SysConfigMapper
      * @return 结果
      */
     public int deleteConfigByIds(Long[] configIds);
+
+    public String getConfigValue(String configKey);
 }

+ 5 - 0
eccs-system/src/main/resources/mapper/system/SysConfigMapper.xml

@@ -37,6 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectConfigVo"/>
         <include refid="sqlwhereSearch"/>
     </select>
+
+    <select id="getConfigValue" parameterType="java.lang.String" resultType="java.lang.String">
+        select  config_value
+		from sys_config where config_key=#{configKey}
+    </select>
     
     <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
         <include refid="selectConfigVo"/>