瀏覽代碼

1.支付单、税单模板添加
2.中控相关类添加
3.收银端页面优化
4.商品导入批量导入
5.中控发送相关逻辑编写

zcb 4 年之前
父節點
當前提交
8f9374739d
共有 52 個文件被更改,包括 2210 次插入98 次删除
  1. 49 0
      kmall-admin/src/main/java/com/kmall/admin/config/EccsPropertiesConfig.java
  2. 15 0
      kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java
  3. 54 0
      kmall-admin/src/main/java/com/kmall/admin/controller/kmall2eccs/KtoEccsController.java
  4. 102 0
      kmall-admin/src/main/java/com/kmall/admin/controller/shop/PriceModificationRecordController.java
  5. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java
  6. 4 0
      kmall-admin/src/main/java/com/kmall/admin/dao/GoodsSpecificationDao.java
  7. 9 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ProductDao.java
  8. 2 0
      kmall-admin/src/main/java/com/kmall/admin/dao/ProductStoreRelaDao.java
  9. 12 0
      kmall-admin/src/main/java/com/kmall/admin/dao/kmall2eccs/KtoEccsDao.java
  10. 16 0
      kmall-admin/src/main/java/com/kmall/admin/dao/shop/PriceModificationRecordDao.java
  11. 13 0
      kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java
  12. 1 1
      kmall-admin/src/main/java/com/kmall/admin/entity/kmall2eccs/KtoEccsEntity.java
  13. 239 0
      kmall-admin/src/main/java/com/kmall/admin/entity/shop/PriceModificationRecordEntity.java
  14. 38 0
      kmall-admin/src/main/java/com/kmall/admin/properties/EccsProperties.java
  15. 3 0
      kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java
  16. 6 0
      kmall-admin/src/main/java/com/kmall/admin/service/ProductStoreRelaService.java
  17. 2 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/BrandServiceImpl.java
  18. 166 8
      kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java
  19. 49 3
      kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java
  20. 44 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java
  21. 210 2
      kmall-admin/src/main/java/com/kmall/admin/service/impl/kmall2eccs/KtoEccsServiceImpl.java
  22. 59 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/shop/PriceModificationRecordServiceImpl.java
  23. 32 0
      kmall-admin/src/main/java/com/kmall/admin/service/impl/shop/ShopErrorPriceRecordServiceImpl.java
  24. 9 0
      kmall-admin/src/main/java/com/kmall/admin/service/kmall2eccs/KtoEccsService.java
  25. 73 0
      kmall-admin/src/main/java/com/kmall/admin/service/shop/PriceModificationRecordService.java
  26. 51 0
      kmall-admin/src/main/java/com/kmall/admin/task/SendToEccsTask.java
  27. 1 0
      kmall-admin/src/main/java/com/kmall/admin/utils/oms/OmsSign.java
  28. 56 0
      kmall-admin/src/main/java/com/kmall/admin/utils/sign/OutRequestMessage.java
  29. 2 0
      kmall-admin/src/main/resources/conf/eccs.properties
  30. 17 6
      kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml
  31. 209 0
      kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml
  32. 34 1
      kmall-admin/src/main/resources/mybatis/mapper/GoodsSpecificationDao.xml
  33. 46 8
      kmall-admin/src/main/resources/mybatis/mapper/MngChangeDao.xml
  34. 44 1
      kmall-admin/src/main/resources/mybatis/mapper/ProductDao.xml
  35. 4 0
      kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml
  36. 30 8
      kmall-admin/src/main/resources/mybatis/mapper/SupplierDao.xml
  37. 71 0
      kmall-admin/src/main/resources/mybatis/mapper/kmall2eccs/KtoEccsDao.xml
  38. 141 0
      kmall-admin/src/main/resources/mybatis/mapper/shop/PriceModificationRecordDao.xml
  39. 2 0
      kmall-admin/src/main/webapp/WEB-INF/page/compared/payorderinfo.html
  40. 1 0
      kmall-admin/src/main/webapp/WEB-INF/page/compared/taxinfo.html
  41. 3 2
      kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html
  42. 84 0
      kmall-admin/src/main/webapp/WEB-INF/page/shop/pricemodificationrecord.html
  43. 7 6
      kmall-admin/src/main/webapp/js/mk/mkactivitieshalfprice.js
  44. 1 1
      kmall-admin/src/main/webapp/js/mk/mkactivityform.js
  45. 6 45
      kmall-admin/src/main/webapp/js/sale/sale.js
  46. 4 3
      kmall-admin/src/main/webapp/js/shop/goods.js
  47. 150 0
      kmall-admin/src/main/webapp/js/shop/pricemodificationrecord.js
  48. 4 3
      kmall-admin/src/main/webapp/js/shop/storeProductStock.js
  49. 二進制
      kmall-admin/src/main/webapp/statics/file/alipay_pay_order.xls
  50. 二進制
      kmall-admin/src/main/webapp/statics/file/tax_info.xlsx
  51. 二進制
      kmall-admin/src/main/webapp/statics/file/weixin_pay_order.xls
  52. 33 0
      kmall-common/src/main/java/com/kmall/common/constant/Dict.java

+ 49 - 0
kmall-admin/src/main/java/com/kmall/admin/config/EccsPropertiesConfig.java

@@ -0,0 +1,49 @@
+package com.kmall.admin.config;
+
+import com.kmall.admin.properties.EccsProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Configurable;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+import org.springframework.core.env.Environment;
+import org.springframework.core.env.StandardEnvironment;
+
+/**
+ * @author zhangchuangbiao
+ * @version 1.0
+ * 2021-01-28 15:27
+ */
+
+@Configuration
+@PropertySource("classpath:conf/eccs.properties")
+public class EccsPropertiesConfig {
+
+//    @Value("${md5Salt}")
+    private String md5Salt;
+
+//    @Value("${requestUrl}")
+    private String requestUrl;
+
+    @Autowired
+    private Environment environment;
+
+
+
+
+    @Bean
+    public EccsProperties ecsProperties(){
+
+        String md5Salt = environment.getProperty("md5Salt");
+        String requestUrl = environment.getProperty("requestUrl");
+
+        EccsProperties eccsProperties = new EccsProperties();
+        eccsProperties.setMd5Salt(md5Salt);
+        eccsProperties.setRequestUrl(requestUrl);
+        return eccsProperties;
+
+    }
+
+}

+ 15 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/BrandController.java

@@ -5,8 +5,10 @@ import com.kmall.admin.dto.CopyBrandDto;
 import com.kmall.admin.dto.CopyCategoryDto;
 import com.kmall.admin.dto.StoreGoodsDto;
 import com.kmall.admin.entity.BrandEntity;
+import com.kmall.admin.entity.CategoryEntity;
 import com.kmall.admin.entity.ProductStoreRelaEntity;
 import com.kmall.admin.service.BrandService;
+import com.kmall.admin.service.CategoryService;
 import com.kmall.admin.utils.ParamUtils;
 import com.kmall.common.constant.Dict;
 import com.kmall.common.constant.JxlsXmlTemplateName;
@@ -39,6 +41,9 @@ public class BrandController {
     @Autowired
     private ExcelUtil excelUtil;
 
+    @Autowired
+    private CategoryService categoryService;
+
     /**
      * 查看列表
      */
@@ -91,6 +96,11 @@ public class BrandController {
         if (Objects.nonNull(brandEntity)){
             throw new RRException("该分类下已经有该品牌名称");
         }
+        // 查询该分类是一级还是二级分类
+        CategoryEntity categoryEntity = categoryService.queryObject(brand.getCategoryId());
+        // 获取节点等级
+        String level = categoryEntity.getLevel();
+        brand.setCategoryLevel(level);
         brandService.save(brand);
 
         return R.ok();
@@ -113,6 +123,11 @@ public class BrandController {
             throw new RRException(r.get("msg").toString());
         }
 
+        // 查询该分类是一级还是二级分类
+        CategoryEntity categoryEntity = categoryService.queryObject(brand.getCategoryId());
+        // 获取节点等级
+        String level = categoryEntity.getLevel();
+        brand.setCategoryLevel(level);
         brandService.update(brand);
 
         return R.ok();

+ 54 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/kmall2eccs/KtoEccsController.java

@@ -3,12 +3,19 @@ package com.kmall.admin.controller.kmall2eccs;
 import java.util.List;
 import java.util.Map;
 
+import com.kmall.admin.entity.GoodsEntity;
+import com.kmall.admin.entity.ProductStoreRelaEntity;
 import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
+import com.kmall.admin.service.GoodsService;
+import com.kmall.admin.service.ProductStoreRelaService;
 import com.kmall.admin.service.kmall2eccs.KtoEccsService;
+import com.kmall.common.constant.Dict;
 import com.kmall.common.utils.PageUtils;
 import com.kmall.common.utils.Query;
 import com.kmall.common.utils.R;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
@@ -27,6 +34,13 @@ public class KtoEccsController {
     @Autowired
     private KtoEccsService ktoEccsService;
 
+    @Autowired
+    private GoodsService goodsService;
+    @Autowired
+    private ProductStoreRelaService productStoreRelaService;
+
+    private static final Logger logger = LoggerFactory.getLogger(KtoEccsController.class);
+
     /**
      * 查看列表
      */
@@ -99,4 +113,44 @@ public class KtoEccsController {
 
         return R.ok().put("list", list);
     }
+
+
+    /**
+     * 中网向中控发送请求
+     */
+    @RequestMapping("/sendToEccs")
+    @ResponseBody
+    public R sendToEccs(@RequestBody Map<String,String> param){
+        R r = ktoEccsService.sendToEccs(param, Dict.sendToEccsType.inter.getItem());
+        return r;
+    }
+
+    /**
+     * 同步kmall商品库存,只给中控使用
+     */
+    @RequestMapping("/queryAllGoodsInfo")
+    @ResponseBody
+    public List<GoodsEntity> queryAllGoodsInfo(){
+
+
+        List<GoodsEntity> goodsEntities = goodsService.queryAllList();
+
+        return  goodsEntities;
+    }
+
+    /**
+     * 同步kmall门店商品库存,只给中控使用
+     */
+    @RequestMapping("/queryAllStoreProductInfo")
+    @ResponseBody
+    public List<ProductStoreRelaEntity> queryAllStoreProductInfo(){
+
+
+        List<ProductStoreRelaEntity> productStoreRelaEntities = productStoreRelaService.queryAllList();
+
+        return  productStoreRelaEntities;
+    }
+
+
+
 }

+ 102 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/shop/PriceModificationRecordController.java

@@ -0,0 +1,102 @@
+package com.kmall.admin.controller.shop;
+
+import java.util.List;
+import java.util.Map;
+
+import com.kmall.admin.entity.shop.PriceModificationRecordEntity;
+import com.kmall.admin.service.shop.PriceModificationRecordService;
+import com.kmall.common.utils.PageUtils;
+import com.kmall.common.utils.Query;
+import com.kmall.common.utils.R;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 价格修改记录表Controller
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2021-01-22 09:07:06
+ */
+@Controller
+@RequestMapping("pricemodificationrecord")
+public class PriceModificationRecordController {
+    @Autowired
+    private PriceModificationRecordService priceModificationRecordService;
+
+    /**
+     * 查看列表
+     */
+    @RequestMapping("/list")
+    @ResponseBody
+    public R list(@RequestParam Map<String, Object> params) {
+        //查询列表数据
+        Query query = new Query(params);
+
+        List<PriceModificationRecordEntity> priceModificationRecordList = priceModificationRecordService.queryList(query);
+        int total = priceModificationRecordService.queryTotal(query);
+
+        PageUtils pageUtil = new PageUtils(priceModificationRecordList, total, query.getLimit(), query.getPage());
+
+        return R.ok().put("page", pageUtil);
+    }
+
+    /**
+     * 查看信息
+     */
+    @RequestMapping("/info/{mpmrId}")
+    @ResponseBody
+    public R info(@PathVariable("mpmrId") Integer mpmrId) {
+        PriceModificationRecordEntity priceModificationRecord = priceModificationRecordService.queryObject(mpmrId);
+
+        return R.ok().put("priceModificationRecord", priceModificationRecord);
+    }
+
+    /**
+     * 保存
+     */
+    @RequestMapping("/save")
+    @ResponseBody
+    public R save(@RequestBody PriceModificationRecordEntity priceModificationRecord) {
+        priceModificationRecordService.save(priceModificationRecord);
+
+        return R.ok();
+    }
+
+    /**
+     * 修改
+     */
+    @RequestMapping("/update")
+    @ResponseBody
+    public R update(@RequestBody PriceModificationRecordEntity priceModificationRecord) {
+        priceModificationRecordService.update(priceModificationRecord);
+
+        return R.ok();
+    }
+
+    /**
+     * 删除
+     */
+    @RequestMapping("/delete")
+    @ResponseBody
+    public R delete(@RequestBody Integer[]mpmrIds) {
+        priceModificationRecordService.deleteBatch(mpmrIds);
+
+        return R.ok();
+    }
+
+    /**
+     * 查看所有列表
+     */
+    @RequestMapping("/queryAll")
+    @ResponseBody
+    public R queryAll(@RequestParam Map<String, Object> params) {
+
+        List<PriceModificationRecordEntity> list = priceModificationRecordService.queryList(params);
+
+        return R.ok().put("list", list);
+    }
+}

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsDao.java

@@ -82,4 +82,6 @@ public interface GoodsDao extends BaseDao<GoodsEntity> {
      * @return
      */
     List<GoodsEntity> querySpecialCosmetics(@Param("hdCodeSet") Set<String> hdCodeSet);
+
+    void updateBatch(List<GoodsEntity> updateGoodsList);
 }

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/GoodsSpecificationDao.java

@@ -3,6 +3,8 @@ package com.kmall.admin.dao;
 import com.kmall.admin.entity.GoodsSpecificationEntity;
 import com.kmall.manager.dao.BaseDao;
 
+import java.util.List;
+
 /**
  * 商品对应规格表值表Dao
  *
@@ -20,4 +22,6 @@ public interface GoodsSpecificationDao extends BaseDao<GoodsSpecificationEntity>
     int deleteByGoodsId(Long goodsId);
 
     GoodsSpecificationEntity queryByGoodsId(Long goodsId);
+
+    void updateBatch(List<GoodsSpecificationEntity> updateSpecificationList);
 }

+ 9 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ProductDao.java

@@ -1,9 +1,12 @@
 package com.kmall.admin.dao;
 
+import com.kmall.admin.entity.GoodsEntity;
 import com.kmall.admin.entity.ProductEntity;
 import org.apache.ibatis.annotations.Param;
 import com.kmall.manager.dao.BaseDao;
 
+import java.util.List;
+
 /**
  * Dao
  *
@@ -29,6 +32,12 @@ public interface ProductDao extends BaseDao<ProductEntity> {
      */
     ProductEntity queryObjectByGoodsIdAndStoreId(@Param("goodsId") String goodsId,@Param("storeId")String storeId);
 
+    /**
+     * 批量更新
+     * @param updateGoodsList
+     */
+    void updateBatch(List<ProductEntity> updateGoodsList);
+
 //    /**
 //     * 根据编码查询产品
 //     *

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/ProductStoreRelaDao.java

@@ -85,4 +85,6 @@ public interface ProductStoreRelaDao extends BaseDao<ProductStoreRelaEntity> {
     List<ProductStoreRelaEntity> queryExportList(Map<String, Object> params);
 
     void updatePriceBySku(@Param("updatePrice") String updatePrice, @Param("sku") String sku);
+
+    List<ProductStoreRelaEntity> queryAllList();
 }

+ 12 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/kmall2eccs/KtoEccsDao.java

@@ -3,6 +3,9 @@ package com.kmall.admin.dao.kmall2eccs;
 
 import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
 import com.kmall.manager.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * Dao
@@ -13,4 +16,13 @@ import com.kmall.manager.dao.BaseDao;
  */
 public interface KtoEccsDao extends BaseDao<KtoEccsEntity> {
 
+    /**
+     *
+     * @return
+     * @param page
+     * @param pageSize
+     */
+    List<KtoEccsEntity> queryNotSendRecord(@Param("page") Integer page, @Param("pageSize") Integer pageSize);
+
+    void updateBatch(List<KtoEccsEntity> queryList);
 }

+ 16 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/shop/PriceModificationRecordDao.java

@@ -0,0 +1,16 @@
+package com.kmall.admin.dao.shop;
+
+
+import com.kmall.admin.entity.shop.PriceModificationRecordEntity;
+import com.kmall.manager.dao.BaseDao;
+
+/**
+ * 价格修改记录表Dao
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2021-01-22 09:07:06
+ */
+public interface PriceModificationRecordDao extends BaseDao<PriceModificationRecordEntity> {
+
+}

+ 13 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/BrandEntity.java

@@ -48,6 +48,7 @@ public class BrandEntity implements Serializable {
     private String merchName;
     private Integer categoryId;
     private String categoryName;
+    private String categoryLevel;
 
     public String getCategoryName() {
         return categoryName;
@@ -264,4 +265,16 @@ public class BrandEntity implements Serializable {
     public Integer getNewSortOrder() {
         return newSortOrder;
     }
+
+    /**
+     * 分类等级
+     * @return
+     */
+    public String getCategoryLevel() {
+        return categoryLevel;
+    }
+
+    public void setCategoryLevel(String categoryLevel) {
+        this.categoryLevel = categoryLevel;
+    }
 }

+ 1 - 1
kmall-admin/src/main/java/com/kmall/admin/entity/kmall2eccs/KtoEccsEntity.java

@@ -27,7 +27,7 @@ public class KtoEccsEntity implements Serializable {
      */
     private Date requestTime;
     /**
-     * 请求类型(01 进货 02 上架 03 销售 04 退款
+     * 请求类型(01 进货 02 上架 03 销售 04 退款 )
      */
     private String requestType;
     /**

+ 239 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/shop/PriceModificationRecordEntity.java

@@ -0,0 +1,239 @@
+package com.kmall.admin.entity.shop;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 价格修改记录表实体
+ * 表名 mall_price_modification_record
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2021-01-22 09:07:06
+ */
+public class PriceModificationRecordEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 价格修改记录表id
+     */
+    private Integer mpmrId;
+    /**
+     * 商户编码
+     */
+    private String merchSn;
+    /**
+     * 第三方商户
+     */
+    private String thirdMerchSn;
+    /**
+     * 门店编码
+     */
+    private String shopSn;
+    /**
+     * 条码
+     */
+    private String barcode;
+    /**
+     * sku
+     */
+    private String sku;
+    /**
+     * 当前价格
+     */
+    private String currentPrice;
+    /**
+     * 修改价格
+     */
+    private String modifyPrice;
+    /**
+     * 修改方式 (1.界面修改 2.excel修改 )
+     */
+    private Integer modifyType;
+    /**
+     * 修改价格源头 (1.门店商品 2.日常活动 3.临时促销)
+     */
+    private Integer modifySource;
+    /**
+     * 修改人编号
+     */
+    private String moderSn;
+    /**
+     * 修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    private Date modTime;
+    /**
+     * 时间戳
+     */
+    private Date tstm;
+
+    /**
+     * 设置:价格修改记录表id
+     */
+    public void setMpmrId(Integer mpmrId) {
+        this.mpmrId = mpmrId;
+    }
+
+    /**
+     * 获取:价格修改记录表id
+     */
+    public Integer getMpmrId() {
+        return mpmrId;
+    }
+    /**
+     * 设置:商户编码
+     */
+    public void setMerchSn(String merchSn) {
+        this.merchSn = merchSn;
+    }
+
+    /**
+     * 获取:商户编码
+     */
+    public String getMerchSn() {
+        return merchSn;
+    }
+    /**
+     * 设置:第三方商户
+     */
+    public void setThirdMerchSn(String thirdMerchSn) {
+        this.thirdMerchSn = thirdMerchSn;
+    }
+
+    /**
+     * 获取:第三方商户
+     */
+    public String getThirdMerchSn() {
+        return thirdMerchSn;
+    }
+    /**
+     * 设置:门店编码
+     */
+    public void setShopSn(String shopSn) {
+        this.shopSn = shopSn;
+    }
+
+    /**
+     * 获取:门店编码
+     */
+    public String getShopSn() {
+        return shopSn;
+    }
+    /**
+     * 设置:条码
+     */
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    /**
+     * 获取:条码
+     */
+    public String getBarcode() {
+        return barcode;
+    }
+    /**
+     * 设置:sku
+     */
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    /**
+     * 获取:sku
+     */
+    public String getSku() {
+        return sku;
+    }
+    /**
+     * 设置:当前价格
+     */
+    public void setCurrentPrice(String currentPrice) {
+        this.currentPrice = currentPrice;
+    }
+
+    /**
+     * 获取:当前价格
+     */
+    public String getCurrentPrice() {
+        return currentPrice;
+    }
+    /**
+     * 设置:修改价格
+     */
+    public void setModifyPrice(String modifyPrice) {
+        this.modifyPrice = modifyPrice;
+    }
+
+    /**
+     * 获取:修改价格
+     */
+    public String getModifyPrice() {
+        return modifyPrice;
+    }
+    /**
+     * 设置:修改方式 (1.界面修改 2.excel修改 )
+     */
+    public void setModifyType(Integer modifyType) {
+        this.modifyType = modifyType;
+    }
+
+    /**
+     * 获取:修改方式 (1.界面修改 2.excel修改 )
+     */
+    public Integer getModifyType() {
+        return modifyType;
+    }
+    /**
+     * 设置:修改价格源头 (1.门店商品 2.日常活动 3.临时促销)
+     */
+    public void setModifySource(Integer modifySource) {
+        this.modifySource = modifySource;
+    }
+
+    /**
+     * 获取:修改价格源头 (1.门店商品 2.日常活动 3.临时促销)
+     */
+    public Integer getModifySource() {
+        return modifySource;
+    }
+    /**
+     * 设置:修改人编号
+     */
+    public void setModerSn(String moderSn) {
+        this.moderSn = moderSn;
+    }
+
+    /**
+     * 获取:修改人编号
+     */
+    public String getModerSn() {
+        return moderSn;
+    }
+    /**
+     * 设置:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public void setModTime(Date modTime) {
+        this.modTime = modTime;
+    }
+
+    /**
+     * 获取:修改时间,yyyy-MM-dd HH:mm:ss
+     */
+    public Date getModTime() {
+        return modTime;
+    }
+    /**
+     * 设置:时间戳
+     */
+    public void setTstm(Date tstm) {
+        this.tstm = tstm;
+    }
+
+    /**
+     * 获取:时间戳
+     */
+    public Date getTstm() {
+        return tstm;
+    }
+}

+ 38 - 0
kmall-admin/src/main/java/com/kmall/admin/properties/EccsProperties.java

@@ -0,0 +1,38 @@
+package com.kmall.admin.properties;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author zhangchuangbiao
+ * @version 1.0
+ * 2021-01-27 17:28
+ */
+
+
+public class EccsProperties {
+
+
+
+    private String md5Salt;
+
+    private String requestUrl;
+
+
+    public String getMd5Salt() {
+        return md5Salt;
+    }
+
+    public void setMd5Salt(String md5Salt) {
+        this.md5Salt = md5Salt;
+    }
+
+    public String getRequestUrl() {
+        return requestUrl;
+    }
+
+    public void setRequestUrl(String requestUrl) {
+        this.requestUrl = requestUrl;
+    }
+}

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/service/GoodsService.java

@@ -207,4 +207,7 @@ public interface GoodsService {
     void updateByEntity(GoodsEntity updateGoods);
 
     void checkGoodsPrice(SysUserEntity user);
+
+    List<GoodsEntity> queryAllList();
+
 }

+ 6 - 0
kmall-admin/src/main/java/com/kmall/admin/service/ProductStoreRelaService.java

@@ -140,4 +140,10 @@ public interface ProductStoreRelaService {
      * @param sku
      */
     void updatePriceBySku(String updatePrice, String sku);
+
+    /**
+     * 查询所有门店数据
+     * @return
+     */
+    List<ProductStoreRelaEntity> queryAllList();
 }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/BrandServiceImpl.java

@@ -242,6 +242,7 @@ public class BrandServiceImpl implements BrandService {
                     insertBrandEntity.setIsNew(isNew);
                     insertBrandEntity.setMerchSn(merchSn);
                     insertBrandEntity.setCategoryId(categoryId);
+                    insertBrandEntity.setCategoryLevel(categoryEntity.getLevel());
                     brandDao.save(insertBrandEntity);
                 } else {
                     BrandEntity updateBrandEntity = brandDao.queryObject(brandId);
@@ -249,6 +250,7 @@ public class BrandServiceImpl implements BrandService {
                         throw new ServiceException("第" + (i + 1) + "行的该品牌编号:【" + brandId + "】不存在!");
                     }
                     BeanUtils.copyProperties(brandEntity,updateBrandEntity);
+                    updateBrandEntity.setCategoryLevel(categoryEntity.getLevel());
                     brandDao.update(updateBrandEntity);
                 }
             }

+ 166 - 8
kmall-admin/src/main/java/com/kmall/admin/service/impl/GoodsServiceImpl.java

@@ -3,15 +3,19 @@ package com.kmall.admin.service.impl;
 import cn.hutool.http.HttpUtil;
 import com.alibaba.fastjson.JSON;
 import com.google.common.collect.ImmutableBiMap;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
+import com.google.gson.Gson;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.dto.GoodsDetailsDto;
 import com.kmall.admin.dto.GoodsDto;
 import com.kmall.admin.dto.GoodsPanoramaDto;
 import com.kmall.admin.entity.*;
+import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
 import com.kmall.admin.entity.mk.MkActivitiesEntity;
 import com.kmall.admin.entity.shop.ShopErrorPriceRecordEntity;
 import com.kmall.admin.service.*;
+import com.kmall.admin.service.kmall2eccs.KtoEccsService;
 import com.kmall.admin.service.mk.MkActivitiesService;
 import com.kmall.admin.service.mk.MkActivityFormService;
 import com.kmall.admin.service.GoodsService;
@@ -112,6 +116,9 @@ public class GoodsServiceImpl implements GoodsService {
     @Autowired
     private ShopErrorPriceRecordService shopErrorPriceRecordService;
 
+    @Autowired
+    private KtoEccsService ktoEccsService;
+
     @Override
     public GoodsEntity queryObject(Integer id) {
         Map<String, Object> map = new HashMap<String, Object>();
@@ -764,6 +771,20 @@ public class GoodsServiceImpl implements GoodsService {
         List<String> failGoodsSnList = new ArrayList<>();
         List<String> failGoodsTypeList = new ArrayList<>();
 //        List<String> failFreightList = new ArrayList<>();
+
+
+        // 定义需要批量插入的list
+        List<ProductEntity> insertProductList = new LinkedList<>();
+        List<GoodsSpecificationEntity> insertSpecificationList = new LinkedList<>();
+        List<MngChangeEntity> insertMngChangeList = new LinkedList<>();
+        List<GoodsEntity> insertGoodsList = new LinkedList<>();
+        List<SupplierEntity> insertSupplierList = new LinkedList<>();
+
+        // 定义需要批量修改的list
+        List<ProductEntity> updateProductList = new LinkedList<>();
+        List<GoodsSpecificationEntity> updateSpecificationList = new LinkedList<>();
+        List<GoodsEntity> updateGoodsList = new LinkedList<>();
+
         if (goodsEntityList != null && goodsEntityList.size() > 0) {
             for (int i = 0; i < goodsEntityList.size(); i++) {
                 GoodsDto goodsDto = goodsEntityList.get(i);
@@ -880,7 +901,10 @@ public class GoodsServiceImpl implements GoodsService {
                         supplierEntity.setChildSupplierFlag(goodsDto.getSupplierFlag());
                         supplierEntity.setIsShow("0");
 
-                        supplierDao.save(supplierEntity);
+                        // TODO 这里改成批量插入 SupplierEntity
+                        insertSupplierList.add(supplierEntity);
+
+//                        supplierDao.save(supplierEntity);
 //                        supplierEntity = supplierDao.queryObjectByName(goodsDto.getSupplierName(), thirdMerchantBizEntity.getMerchSn(),thirdMerchantBizEntity.getThirdPartyMerchCode());
                         goodsEntity.setSupplierId(supplierEntity.getId());
                     } else {
@@ -986,25 +1010,32 @@ public class GoodsServiceImpl implements GoodsService {
                         mngChangeEntity.setValidNum(goods.getGoodsNumber() + Integer.parseInt(goodsDto.getGoodsNumber()));//可用数
                         mngChangeEntity.setChangeNum(Integer.parseInt(goodsDto.getGoodsNumber()));//变化数
                         mngChangeEntity.setChangeType(Dict.changeType.item_3.getItem());
-                        mngChangeEntity.setGoodsId(Integer.parseInt(String.valueOf(goods.getId())));
+                        mngChangeEntity.setGoodsId(goods.getId().intValue());
 
                         goodsEntity.setId(goods.getId());
                         goodsEntity.setGoodsNumber(goods.getGoodsNumber()+Integer.parseInt(goodsDto.getGoodsNumber()));
-                        goodsDao.update(goodsEntity);
+
+                        // TODO 这里改成批量修改 GoodsEntity
+                        updateGoodsList.add(goodsEntity);
+//                        goodsDao.update(goodsEntity);
                     }else{
                         mngChangeEntity.setOriginalNum(0);//原库存数
                         mngChangeEntity.setValidNum(Integer.parseInt(goodsDto.getGoodsNumber()));//可用数
                         mngChangeEntity.setChangeNum(Integer.parseInt(goodsDto.getGoodsNumber()));//变化数
                         mngChangeEntity.setChangeType(Dict.changeType.item_2.getItem());
 
+                        // TODO 这里改成批量插入 GoodsEntity
+
                         goodsDao.save(goodsEntity);
+                        insertGoodsList.add(goodsEntity);
                         mngChangeEntity.setGoodsId(goodsEntity.getId().intValue());
                     }
 
 
+                    // TODO 这里改成批量插入 MngChangeEntity
 
-
-                    mngChangeDao.save(mngChangeEntity);
+//                    mngChangeDao.save(mngChangeEntity);
+                    insertMngChangeList.add(mngChangeEntity);
 //                    // 保税商品修改各个门店商品价格
 //                    if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
 //                        List<ProductStoreRelaEntity> productStoreRelaEntityList = productStoreRelaDao.queryByGoodsId(goodsDto.getId());
@@ -1028,11 +1059,18 @@ public class GoodsServiceImpl implements GoodsService {
                             goodsSpecification.setGoodsId(goodsEntity.getId());
                             goodsSpecification.setValue(goodsEntity.getCiqProdModel());
                             goodsSpecification.setSpecificationId(1);
+
+
+                            // TODO 这里改成批量插入 GoodsSpecificationEntity
                             goodsSpecificationDao.save(goodsSpecification);
+//                            insertSpecificationList.add(goodsSpecification);
                         }else {
                             goodsSpecification.setValue(goodsDto.getCiqProdModel());
                             goodsSpecification.setId(specificationEntity.getId());
-                            goodsSpecificationDao.update(goodsSpecification);
+
+                            // TODO 这里改成批量更新 GoodsSpecificationEntity
+//                            goodsSpecificationDao.update(goodsSpecification);
+                            updateSpecificationList.add(goodsSpecification);
                         }
                         if(product == null){
                             product = new ProductEntity();
@@ -1042,15 +1080,98 @@ public class GoodsServiceImpl implements GoodsService {
                             product.setGoodsNumber(goodsEntity.getGoodsNumber());
                             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
                             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
-                            productDao.save(product);
+
+                            // TODO 这里改成批量插入 ProductEntity
+                            insertProductList.add(product);
+//                            productDao.save(product);
                         }else{
                             product.setGoodsSpecificationIds(goodsSpecification.getId().toString());
                             product.setGoodsSpecificationNameValue(goodsSpecification.getValue());
-                            productDao.update(product);
+
+                            // TODO 这里改成批量更新 ProductEntity
+                            updateProductList.add(product);
+//                            productDao.update(product);
                         }
                     }
                 }
             }
+
+            // 批量插入数据
+            if(insertProductList != null && insertProductList.size() > 0) {
+                // 长度限制,如果大于50,就分多次插入
+                if(insertProductList.size() > 50){
+                    List<List<ProductEntity>> partition = Lists.partition(insertProductList, 50);
+                    for (List<ProductEntity> productEntities : partition) {
+                        productDao.saveBatch(productEntities);
+                    }
+                }else{
+                    productDao.saveBatch(insertProductList);;
+
+                }
+            }
+//            if(insertSpecificationList != null && insertSpecificationList.size() > 0) {
+//                goodsSpecificationDao.saveBatch(insertSpecificationList);
+//            }
+            if(insertMngChangeList != null && insertMngChangeList.size() > 0 ){
+                if(insertMngChangeList.size() > 50){
+                    List<List<MngChangeEntity>> partition = Lists.partition(insertMngChangeList, 50);
+                    for (List<MngChangeEntity> mngChangeEntities : partition) {
+                        mngChangeDao.saveBatch(mngChangeEntities);
+                    }
+                }else{
+                    mngChangeDao.saveBatch(insertMngChangeList);
+
+                }
+            }
+//            if(insertGoodsList != null && insertGoodsList.size() > 0 ){
+//                goodsDao.saveBatch(insertGoodsList);
+//            }
+            if(insertSupplierList != null && insertSupplierList.size() > 0 ){
+                if(insertSupplierList.size() > 50){
+                    List<List<SupplierEntity>> partition = Lists.partition(insertSupplierList, 50);
+                    for (List<SupplierEntity> supplierEntities : partition) {
+                        supplierDao.saveBatch(supplierEntities);
+                    }
+                }else{
+                    supplierDao.saveBatch(insertSupplierList);
+
+                }
+            }
+            // 批量更新数据
+            if(updateProductList != null && updateProductList.size() > 0 ){
+
+                if(updateProductList.size() > 50){
+                    List<List<ProductEntity>> partition = Lists.partition(updateProductList, 50);
+                    for (List<ProductEntity> productEntities : partition) {
+                        productDao.updateBatch(productEntities);
+                    }
+                }else{
+                    productDao.updateBatch(updateProductList);
+                }
+            }
+            if(updateSpecificationList != null && updateSpecificationList.size() > 0 ){
+                if(updateSpecificationList.size() > 50){
+                    List<List<GoodsSpecificationEntity>> partition = Lists.partition(updateSpecificationList, 50);
+                    for (List<GoodsSpecificationEntity> goodsSpecificationEntities : partition) {
+                        goodsSpecificationDao.updateBatch(goodsSpecificationEntities);
+                    }
+                }else{
+                    goodsSpecificationDao.updateBatch(updateSpecificationList);
+                }
+            }
+            if(updateGoodsList != null && updateGoodsList.size() > 0 ){
+                if(updateGoodsList.size() > 50){
+                    List<List<GoodsEntity>> partition = Lists.partition(updateGoodsList, 50);
+                    for (List<GoodsEntity> goodsEntities : partition) {
+                        goodsDao.updateBatch(goodsEntities);
+                    }
+                }else{
+                    goodsDao.updateBatch(updateGoodsList);
+                }
+            }
+
+
+
             ExportExceptionDataEntity exportExceptionDataEntity = new ExportExceptionDataEntity();
             exportExceptionDataEntity.setCreaterSn(user.getUserId().toString());
             exportExceptionDataEntity.setUserId(user.getUserId().intValue());
@@ -1137,6 +1258,38 @@ public class GoodsServiceImpl implements GoodsService {
                 goodsUtils.save(exportExceptionDataEntity);
                 throw new RRException("导入数据异常,异常信息请在商品管理》》商品导入异常数据中查看检查");
             }
+
+
+            // 将插入的商品和更新的商品放到一个list中
+            List<GoodsEntity> goodsEntities = new LinkedList<>();
+            goodsEntities.addAll(insertGoodsList);
+            goodsEntities.addAll(updateGoodsList);
+
+            List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
+            if(goodsEntities.size() > 0){
+                for (GoodsEntity goodsEntity : goodsEntities) {
+                    KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
+                    ktoEccsEntity.setRequestData(JSON.toJSONString(goodsEntity));
+                    ktoEccsEntity.setRequestType("01");
+                    ktoEccsEntity.setSendStatus("00");
+                    ktoEccsEntity.setCreaterSn(user.getUserId()+"");
+                    ktoEccsEntity.setCreateTime(new Date());
+
+                    ktoEccsEntities.add(ktoEccsEntity);
+                }
+
+            }
+            if(ktoEccsEntities.size() > 0){
+                if(ktoEccsEntities.size() > 50){
+                    List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
+                    for (List<KtoEccsEntity> ktoEccs : partition) {
+                        ktoEccsService.saveBatch(ktoEccs);
+                    }
+                }else{
+                    ktoEccsService.saveBatch(ktoEccsEntities);
+                }
+            }
+
         }else{
             throw new RRException("导入数据为空,或者检查商品编码数据是否为空");
         }
@@ -1932,6 +2085,11 @@ public class GoodsServiceImpl implements GoodsService {
 
     }
 
+    @Override
+    public List<GoodsEntity> queryAllList() {
+        return goodsDao.queryAllList();
+    }
+
     private void calculeatePromotion(SysUserEntity user, GoodsEntity goods, List<Map<String, String>> errorPriceSkuList, List<ShopErrorPriceRecordEntity> shopErrorPriceRecordEntities) {
         String prodBarcode = goods.getProdBarcode();
         String storeId = goods.getStoreId()+"";

+ 49 - 3
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -3,6 +3,7 @@ package com.kmall.admin.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.ImmutableBiMap;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.gson.Gson;
 import com.google.gson.internal.LinkedTreeMap;
@@ -19,6 +20,7 @@ import com.kmall.admin.dao.vip.Mall2PointsRulesDao;
 import com.kmall.admin.dto.*;
 import com.kmall.admin.entity.*;
 import com.kmall.admin.entity.OrderProcessRecordEntity;
+import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
 import com.kmall.admin.entity.mk.store.*;
 import com.kmall.admin.entity.vip.Mall2MemberConsumptionRecordsEntity;
 import com.kmall.admin.entity.vip.Mall2MemberPointsEntity;
@@ -724,6 +726,9 @@ public class OrderServiceImpl implements OrderService {
         SysUserEntity user = ShiroUtils.getUserEntity();
         map.put("orderId", order.getId());
         List<OrderGoodsEntity> orderGoodsVoList = orderGoodsDao.queryList(map);
+
+        // TODO 退单的库存明细存入表中,准备发送到中控
+        List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
         for (OrderGoodsEntity orderGoodsEntity : orderGoodsVoList) {
             ProductStoreRelaEntity storeRelaEntity = productStoreRelaDao
                     .queryByGoodsIdAndStoreId(order.getStoreId().longValue(), orderGoodsEntity.getGoodsId().longValue());
@@ -746,6 +751,26 @@ public class OrderServiceImpl implements OrderService {
                 stockNum = storeRelaEntity.getStockNum();
                 resetStoreGoodsStock(stockNum, storeRelaEntity, orderGoodsEntity, sellVolume, changeReason, user);//还原门店库存
             }
+
+
+//            orderGoodsVoList
+            KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
+            ktoEccsEntity.setRequestData(JSON.toJSONString(orderGoodsEntity));
+            ktoEccsEntity.setRequestType("04");
+            ktoEccsEntity.setSendStatus("00");
+            ktoEccsEntity.setCreaterSn(user.getUserId()+"");
+            ktoEccsEntity.setCreateTime(new Date());
+            ktoEccsEntities.add(ktoEccsEntity);
+        }
+        if(ktoEccsEntities.size() > 0){
+            if(ktoEccsEntities.size() > 50){
+                List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
+                for (List<KtoEccsEntity> ktoEccs : partition) {
+                    ktoEccsService.saveBatch(ktoEccs);
+                }
+            }else{
+                ktoEccsService.saveBatch(ktoEccsEntities);
+            }
         }
     }
 
@@ -2198,9 +2223,30 @@ public class OrderServiceImpl implements OrderService {
             WebSocketServer.sendMessage(sessionId, order.getOrder_sn(), order.getStore_id()
                     + "");
 
-            // 下单流程完成了,现在将下单的库存明细
+            // TODO 下单流程完成了,现在将下单的库存明细存入表中,准备发送到中控
+            List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
 //            orderGoodsVoList
-
+            for (OrderGoodsVo orderGoodsVo : orderGoodsVoList) {
+                KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
+                ktoEccsEntity.setRequestData(JSON.toJSONString(orderGoodsVo));
+                ktoEccsEntity.setRequestType("03");
+                ktoEccsEntity.setSendStatus("00");
+                ktoEccsEntity.setCreaterSn(user.getUserId()+"");
+                ktoEccsEntity.setCreateTime(new Date());
+                ktoEccsEntities.add(ktoEccsEntity);
+            }
+
+
+            if(ktoEccsEntities.size() > 0){
+                if(ktoEccsEntities.size() > 50){
+                    List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
+                    for (List<KtoEccsEntity> ktoEccs : partition) {
+                        ktoEccsService.saveBatch(ktoEccs);
+                    }
+                }else{
+                    ktoEccsService.saveBatch(ktoEccsEntities);
+                }
+            }
 
 
             return resultObj;
@@ -3300,7 +3346,7 @@ public class OrderServiceImpl implements OrderService {
 
         // 计算税费
         GoodsEntity goodsEntity = goodsService.queryObject(goodsDto.getId().intValue());
-        BigDecimal goodsTax = CalculateTax.calculateFinalTax(goodsEntity,goodsDto.getActualPaymentAmount().divide(number,2,RoundingMode.HALF_UP),goodsService).setScale(3,RoundingMode.HALF_UP);
+        BigDecimal goodsTax = CalculateTax.calculateFinalTax(goodsEntity,goodsDto.getStoreRetailPrice(),goodsService).setScale(3,RoundingMode.HALF_UP);
         goodsTax = goodsTax.multiply(number).setScale(2,RoundingMode.HALF_UP);
         orderGoodsVo.setTaxPrice(goodsTax);
 

+ 44 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/ProductStoreRelaServiceImpl.java

@@ -1,14 +1,18 @@
 package com.kmall.admin.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.google.common.collect.ImmutableBiMap;
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.kmall.admin.dao.*;
 import com.kmall.admin.dao.mk.dist.MkDistSellAllocationDao;
 import com.kmall.admin.dto.StoreGoodsDto;
 import com.kmall.admin.entity.*;
+import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
 import com.kmall.admin.entity.mk.dist.MkDistSellAllocationEntity;
 import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.service.ProductStoreRelaService;
+import com.kmall.admin.service.kmall2eccs.KtoEccsService;
 import com.kmall.admin.utils.ShiroUtils;
 import com.kmall.api.util.StockUtil;
 import com.kmall.common.constant.Dict;
@@ -70,6 +74,9 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
     @Autowired
     private GoodsBatchDao goodsBatchDao;
 
+    @Autowired
+    private KtoEccsService ktoEccsService;
+
     @Override
     public ProductStoreRelaEntity queryObject(Integer id) {
         ProductStoreRelaEntity productStoreRelaEntity = productStoreRelaDao.queryObject(id);
@@ -259,6 +266,7 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         productStoreRela.setModerSn(user.getUserId().toString());
         productStoreRela.setModTime(new Date());
         productStoreRela.setGoodsBizType(goodsEntity.getGoodsBizType());
+        productStoreRela.setSellVolume(0);
         return productStoreRelaDao.save(productStoreRela);
     }
 
@@ -841,11 +849,26 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
         productStoreRelaDao.updatePriceBySku(updatePrice,sku);
     }
 
+    /**
+     * 查询所有门店数据
+     *
+     * @return
+     */
+    @Override
+    public List<ProductStoreRelaEntity> queryAllList() {
+        return productStoreRelaDao.queryAllList();
+    }
+
 
     @Override
     @Transactional
     public int uploadExcel(List<StoreGoodsDto> storeGoodsDtoList) {
         if (storeGoodsDtoList != null && storeGoodsDtoList.size() > 0) {
+
+
+            SysUserEntity user = ShiroUtils.getUserEntity();
+            List<KtoEccsEntity> ktoEccsEntities = new LinkedList<>();
+
             for (int i = 0; i < storeGoodsDtoList.size(); i++) {
                 StoreGoodsDto storeGoodsDto = storeGoodsDtoList.get(i);
                 ProductStoreRelaEntity storeRelaEntity = new ProductStoreRelaEntity();
@@ -924,7 +947,28 @@ public class ProductStoreRelaServiceImpl implements ProductStoreRelaService {
                     storeRelaEntity.setStockNum(productStoreRelaEntity.getStockNum()+Integer.valueOf(storeGoodsDto.getStockNum()));
                     update(storeRelaEntity);
                 }
+
+
+                KtoEccsEntity ktoEccsEntity = new KtoEccsEntity();
+                ktoEccsEntity.setRequestData(JSON.toJSONString(storeRelaEntity));
+                ktoEccsEntity.setRequestType("02");
+                ktoEccsEntity.setSendStatus("00");
+                ktoEccsEntity.setCreaterSn(user.getUserId()+"");
+                ktoEccsEntity.setCreateTime(new Date());
+                ktoEccsEntities.add(ktoEccsEntity);
             }
+
+            if(ktoEccsEntities.size() > 0){
+                if(ktoEccsEntities.size() > 50){
+                    List<List<KtoEccsEntity>> partition = Lists.partition(ktoEccsEntities, 50);
+                    for (List<KtoEccsEntity> ktoEccs : partition) {
+                        ktoEccsService.saveBatch(ktoEccs);
+                    }
+                }else{
+                    ktoEccsService.saveBatch(ktoEccsEntities);
+                }
+            }
+
         }else{
             throw new RRException("导入数据为空,或者检查数据是否为空");
         }

+ 210 - 2
kmall-admin/src/main/java/com/kmall/admin/service/impl/kmall2eccs/KtoEccsServiceImpl.java

@@ -1,13 +1,23 @@
 package com.kmall.admin.service.impl.kmall2eccs;
 
+import com.alibaba.fastjson.JSON;
+import com.google.gson.Gson;
 import com.kmall.admin.dao.kmall2eccs.KtoEccsDao;
 import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
+import com.kmall.admin.properties.EccsProperties;
 import com.kmall.admin.service.kmall2eccs.KtoEccsService;
+import com.kmall.admin.utils.data.response.ResponseMessage;
+import com.kmall.admin.utils.oms.OmsSign;
+import com.kmall.common.constant.Dict;
+import com.kmall.common.utils.R;
+import com.kmall.common.utils.StringUtils;
+import okhttp3.Request;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
@@ -19,9 +29,16 @@ import java.util.Map;
  */
 @Service("ktoEccsService")
 public class KtoEccsServiceImpl implements KtoEccsService {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(KtoEccsServiceImpl.class);
+
     @Autowired
     private KtoEccsDao ktoEccsDao;
 
+    @Autowired
+    private EccsProperties eccsProperties;
+
+
     @Override
     public KtoEccsEntity queryObject(Long kteId) {
         return ktoEccsDao.queryObject(kteId);
@@ -56,4 +73,195 @@ public class KtoEccsServiceImpl implements KtoEccsService {
     public int deleteBatch(Long[]kteIds) {
         return ktoEccsDao.deleteBatch(kteIds);
     }
+
+    @Override
+    public void saveBatch(List<KtoEccsEntity> ktoEccsEntities) {
+        ktoEccsDao.saveBatch(ktoEccsEntities);
+    }
+
+    /**
+     * 中网向中控发送数据请求
+     *
+     * @return
+     */
+    @Override
+    public R sendToEccs(Map<String,String> param,String type) {
+
+        String returnUrl = "";
+        Integer page = null;
+        Integer pageSize = null;
+
+        // 判断是接口调用还是定时器调用
+        if(Dict.sendToEccsType.inter.getItem().equals(type)){
+
+            // 参数校验
+            R paramCheck = checkParam(param);
+            if(Integer.valueOf(paramCheck.get("code").toString()) != 0){
+                LOGGER.info("校验校验失败,原参数:"+param);
+                return R.error("参数校验失败");
+            }
+
+            // 校验签名
+            boolean check = checkSign(param);
+            if(!check){
+                return R.error("签名校验失败");
+            }
+            // 获取回调地址
+            returnUrl = param.get("returnUrl");
+            // 获取需要的页数
+            page = Integer.valueOf(param.get("page"));
+            // 获取需要的条数
+            pageSize = Integer.valueOf(param.get("pageSize"));
+        }
+
+
+        // 查询数据库中的记录
+        List<KtoEccsEntity> queryList = ktoEccsDao.queryNotSendRecord(page,pageSize);
+
+        List<KtoEccsEntity> sendList = new LinkedList<>();
+
+        if(queryList != null && queryList.size() > 0){
+
+            // 判断查询的记录中,是否大于100条,如果大于100条,分批次发送
+            if(queryList.size() > 100){
+                for (int i = 0; i < queryList.size(); i++) {
+                    sendList.add(queryList.get(i));
+                    // 每一百条组装成一个json串,发送一次
+                    if(i != 0 && i % 100 == 0){
+                        // 发送
+                        ResponseMessage responseMessage = sendHttpToEccs(returnUrl, sendList);
+                        // 记录这一百条的发送状态
+                        handleReturnMsg(queryList, responseMessage);
+                        sendList = new LinkedList<>();
+                    }else if(i == (queryList.size() - 1)){
+                        // 发送
+                        ResponseMessage responseMessage = sendHttpToEccs(returnUrl, sendList);
+                        // 记录这一百条的发送状态
+                        handleReturnMsg(queryList, responseMessage);
+                    }
+                }
+
+            }else{
+            // 如果没有大于100条,直接发送
+                for (int i = 0; i < queryList.size(); i++) {
+                    sendList.add(queryList.get(i));
+                }
+                // 发送
+                ResponseMessage responseMessage = sendHttpToEccs(returnUrl, sendList);
+                // 记录这一百条的发送状态
+                handleReturnMsg(queryList, responseMessage);
+            }
+        }
+
+
+        return R.ok("发送成功");
+    }
+
+    private R checkParam(Map<String, String> param) {
+
+        if(param.get("sign") == null){
+            return R.error("签名参数不存在");
+        }
+        if(param.get("data") == null){
+            return R.error("data参数不存在");
+        }
+        if(param.get("page") == null){
+            return R.error("page参数不存在");
+        }
+        if(param.get("pageSize") == null){
+            return R.error("pageSize参数不存在");
+        }
+        if(param.get("returnUrl") == null){
+            return R.error("returnUrl参数不存在");
+        }
+        return R.ok();
+    }
+
+    private boolean checkSign(Map<String, String> param) {
+
+        Map<String, String> sParaTemp = new TreeMap<>();
+        sParaTemp.put("data",param.get("data"));
+
+        //生成要请求给oms秘钥
+        LOGGER.info("md5混淆码参数:" + eccsProperties.getMd5Salt());
+        String sign = OmsSign.sign(sParaTemp,eccsProperties.getMd5Salt());
+
+        String checkSign = param.get("sign");
+
+        if(!sign.equals(checkSign))
+            return false;
+        return true;
+
+    }
+
+    /**
+     * 处理返回的结果集,并修改状态
+     * @param queryList
+     * @param responseMessage
+     */
+    private void handleReturnMsg(List<KtoEccsEntity> queryList, ResponseMessage responseMessage) {
+        // 如果是成功代码,
+        if ("0".equals(responseMessage.getCode())) {
+            // 修改为成功
+            queryList.forEach(ktoEccsEntity -> {
+                ktoEccsEntity.setSendStatus("01");
+                ktoEccsEntity.setRequestTime(new Date());
+            });
+        } else {
+            // 修改为发送失败
+            queryList.forEach(ktoEccsEntity -> {
+                ktoEccsEntity.setSendStatus("02");
+                ktoEccsEntity.setFailReason(responseMessage.getMsg());
+            });
+        }
+        // 批量修改记录状态
+        ktoEccsDao.updateBatch(queryList);
+    }
+
+    /**
+     * 发送请求个中控系统
+     * @param returnUrl 请求的地址
+     * @param sendList 发送的数据鞂
+     * @return
+     */
+    private ResponseMessage sendHttpToEccs(String returnUrl, List<KtoEccsEntity> sendList) {
+        String jsonParam = JSON.toJSONString(sendList);
+        // 发送请求向中控系统
+        Map<String, String> sParaTemp = new TreeMap<>();
+        sParaTemp.put("data",jsonParam);
+        String timestamp = String.valueOf(System.currentTimeMillis()/1000);
+        sParaTemp.put("timestamp", timestamp);
+        //生成要请求给oms秘钥
+        LOGGER.info("md5混淆码参数:" + eccsProperties.getMd5Salt());
+        String sign = OmsSign.sign(sParaTemp,eccsProperties.getMd5Salt());
+        sParaTemp.put("sign", sign);
+
+        if(StringUtils.isNullOrEmpty(returnUrl)){
+            returnUrl = eccsProperties.getRequestUrl();
+        }
+        //构建Request
+        Request request = com.kmall.admin.utils.oms.OkHttpUtils.buildRequest(returnUrl, JSON.toJSONString(sParaTemp));
+        LOGGER.info("发送中控的请求报文:" + request);
+        // 同步访问,返回结果字符串
+        String responseString = null;
+        try {
+
+            responseString = com.kmall.admin.utils.oms.OkHttpUtils.post(request);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        LOGGER.info("中控的响应报文"+responseString);
+        //解析响应数据
+        Gson gson = new Gson();
+        ResponseMessage result = gson.fromJson(responseString, ResponseMessage.class);
+        if(result == null){
+            String info = "解析响应数据Result失败";
+            LOGGER.error("--- {}", info);
+            throw new RuntimeException(info);
+        }
+
+        return result;
+    }
 }

+ 59 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/shop/PriceModificationRecordServiceImpl.java

@@ -0,0 +1,59 @@
+package com.kmall.admin.service.impl.shop;
+
+import com.kmall.admin.dao.shop.PriceModificationRecordDao;
+import com.kmall.admin.entity.shop.PriceModificationRecordEntity;
+import com.kmall.admin.service.shop.PriceModificationRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 价格修改记录表Service实现类
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2021-01-22 09:07:06
+ */
+@Service("priceModificationRecordService")
+public class PriceModificationRecordServiceImpl implements PriceModificationRecordService {
+    @Autowired
+    private PriceModificationRecordDao priceModificationRecordDao;
+
+    @Override
+    public PriceModificationRecordEntity queryObject(Integer mpmrId) {
+        return priceModificationRecordDao.queryObject(mpmrId);
+    }
+
+    @Override
+    public List<PriceModificationRecordEntity> queryList(Map<String, Object> map) {
+        return priceModificationRecordDao.queryList(map);
+    }
+
+    @Override
+    public int queryTotal(Map<String, Object> map) {
+        return priceModificationRecordDao.queryTotal(map);
+    }
+
+    @Override
+    public int save(PriceModificationRecordEntity priceModificationRecord) {
+        return priceModificationRecordDao.save(priceModificationRecord);
+    }
+
+    @Override
+    public int update(PriceModificationRecordEntity priceModificationRecord) {
+        return priceModificationRecordDao.update(priceModificationRecord);
+    }
+
+    @Override
+    public int delete(Integer mpmrId) {
+        return priceModificationRecordDao.delete(mpmrId);
+    }
+
+    @Override
+    public int deleteBatch(Integer[]mpmrIds) {
+        return priceModificationRecordDao.deleteBatch(mpmrIds);
+    }
+}

+ 32 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/shop/ShopErrorPriceRecordServiceImpl.java

@@ -2,15 +2,20 @@ package com.kmall.admin.service.impl.shop;
 
 import com.kmall.admin.dao.shop.ShopErrorPriceRecordDao;
 import com.kmall.admin.dto.UpdateGoodPriceDto;
+import com.kmall.admin.entity.shop.PriceModificationRecordEntity;
 import com.kmall.admin.entity.shop.ShopErrorPriceRecordEntity;
+import com.kmall.admin.fromcomm.entity.SysUserEntity;
 import com.kmall.admin.service.MkActivitiesPromotionService;
 import com.kmall.admin.service.MkDailyActivitiesService;
 import com.kmall.admin.service.ProductStoreRelaService;
+import com.kmall.admin.service.shop.PriceModificationRecordService;
 import com.kmall.admin.service.shop.ShopErrorPriceRecordService;
+import com.kmall.admin.utils.ShiroUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -34,6 +39,10 @@ public class ShopErrorPriceRecordServiceImpl implements ShopErrorPriceRecordServ
     @Autowired
     private MkDailyActivitiesService dailyActivitiesService;
 
+    @Autowired
+    private PriceModificationRecordService priceModificationRecordService;
+
+
     @Override
     public ShopErrorPriceRecordEntity queryObject(Integer mseprId) {
         return shopErrorPriceRecordDao.queryObject(mseprId);
@@ -122,24 +131,47 @@ public class ShopErrorPriceRecordServiceImpl implements ShopErrorPriceRecordServ
     }
 
     private void handlePrice(String updatePrice,Object service,ShopErrorPriceRecordEntity shopErrorPriceRecordEntity){
+        // 获取当前登录用户
+        SysUserEntity user = ShiroUtils.getUserEntity();
 
         String sku = shopErrorPriceRecordEntity.getSku();
 
+        PriceModificationRecordEntity p = new PriceModificationRecordEntity();
+
         // 修改门店商品价格
         if(service instanceof ProductStoreRelaService){
             ProductStoreRelaService productStoreRelaService = (ProductStoreRelaService) service;
             productStoreRelaService.updatePriceBySku(updatePrice,sku);
+
+            p.setModifySource(1);
         // 修改日常活动价格
         }else if(service instanceof MkActivitiesPromotionService){
             MkActivitiesPromotionService mkActivitiesPromotionService = (MkActivitiesPromotionService) service;
             mkActivitiesPromotionService.updatePriceBySku(updatePrice,sku,shopErrorPriceRecordEntity.getMkaId());
+
+            p.setModifySource(2);
         // 修改临时促销价格
         }else if(service instanceof MkDailyActivitiesService){
             MkDailyActivitiesService mkDailyActivitiesService = (MkDailyActivitiesService)service;
             mkDailyActivitiesService.updatePriceBySku(updatePrice,sku,shopErrorPriceRecordEntity.getMkaId());
+
+            p.setModifySource(3);
         }
 
 
+        p.setBarcode(shopErrorPriceRecordEntity.getBarcode());
+        p.setCurrentPrice(shopErrorPriceRecordEntity.getCurrentPrice());
+        p.setModifyPrice(updatePrice);
+        p.setMerchSn(shopErrorPriceRecordEntity.getMerchSn());
+        p.setShopSn(shopErrorPriceRecordEntity.getShopSn());
+        p.setSku(shopErrorPriceRecordEntity.getSku());
+        p.setThirdMerchSn(shopErrorPriceRecordEntity.getThirdMerchSn());
+        p.setModerSn(user.getUserId()+"");
+        p.setModTime(new Date());
+
+        p.setModifyType(1);
+
+        priceModificationRecordService.save(p);
 
     }
 }

+ 9 - 0
kmall-admin/src/main/java/com/kmall/admin/service/kmall2eccs/KtoEccsService.java

@@ -2,6 +2,7 @@ package com.kmall.admin.service.kmall2eccs;
 
 
 import com.kmall.admin.entity.kmall2eccs.KtoEccsEntity;
+import com.kmall.common.utils.R;
 
 import java.util.List;
 import java.util.Map;
@@ -70,4 +71,12 @@ public interface KtoEccsService {
      * @return 删除条数
      */
     int deleteBatch(Long[]kteIds);
+
+    void saveBatch(List<KtoEccsEntity> ktoEccsEntities);
+
+    /**
+     * 中网向中控发送数据请求
+     * @return
+     */
+    R sendToEccs(Map<String,String> param,String type);
 }

+ 73 - 0
kmall-admin/src/main/java/com/kmall/admin/service/shop/PriceModificationRecordService.java

@@ -0,0 +1,73 @@
+package com.kmall.admin.service.shop;
+
+
+import com.kmall.admin.entity.shop.PriceModificationRecordEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 价格修改记录表Service接口
+ *
+ * @author emato
+ * @email admin@qhdswl.com
+ * @date 2021-01-22 09:07:06
+ */
+public interface PriceModificationRecordService {
+
+    /**
+     * 根据主键查询实体
+     *
+     * @param mpmrId 主键
+     * @return 实体
+     */
+    PriceModificationRecordEntity queryObject(Integer mpmrId);
+
+    /**
+     * 分页查询
+     *
+     * @param map 参数
+     * @return list
+     */
+    List<PriceModificationRecordEntity> queryList(Map<String, Object> map);
+
+    /**
+     * 分页统计总数
+     *
+     * @param map 参数
+     * @return 总数
+     */
+    int queryTotal(Map<String, Object> map);
+
+    /**
+     * 保存实体
+     *
+     * @param priceModificationRecord 实体
+     * @return 保存条数
+     */
+    int save(PriceModificationRecordEntity priceModificationRecord);
+
+    /**
+     * 根据主键更新实体
+     *
+     * @param priceModificationRecord 实体
+     * @return 更新条数
+     */
+    int update(PriceModificationRecordEntity priceModificationRecord);
+
+    /**
+     * 根据主键删除
+     *
+     * @param mpmrId
+     * @return 删除条数
+     */
+    int delete(Integer mpmrId);
+
+    /**
+     * 根据主键批量删除
+     *
+     * @param mpmrIds
+     * @return 删除条数
+     */
+    int deleteBatch(Integer[]mpmrIds);
+}

+ 51 - 0
kmall-admin/src/main/java/com/kmall/admin/task/SendToEccsTask.java

@@ -0,0 +1,51 @@
+package com.kmall.admin.task;
+
+import com.kmall.admin.service.GoodsService;
+import com.kmall.admin.service.kmall2eccs.KtoEccsService;
+import com.kmall.common.constant.Dict;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author zhangchuangbiao
+ * @version 1.0
+ * 2021-01-28 14:59
+ */
+
+
+@Component("sendToEccsTask")
+@EnableScheduling
+@EnableAsync
+public class SendToEccsTask {
+
+
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private KtoEccsService ktoEccsService;
+
+
+    /**
+     * 发送数据给中控系统
+     * 每天1个小时执行1次
+     */
+    @Scheduled(cron = "0 0/1 * * * ?")
+//    @Scheduled(cron = "0 0 0/1 * * ?")
+    public void syncOmsHsCode() {
+        logger.info("同步所有商品表海关备案编码数据开始-----------------");
+        try {
+            ktoEccsService.sendToEccs(null, Dict.sendToEccsType.task.getItem());
+        } catch (Exception e) {
+            e.printStackTrace();
+            logger.info("同步所有商品表海关备案编码数据异常-----------------原因:" + e.getMessage());
+        }
+        logger.info("同步所有商品表海关备案编码数据结束-----------");
+
+    }
+
+}

+ 1 - 0
kmall-admin/src/main/java/com/kmall/admin/utils/oms/OmsSign.java

@@ -50,4 +50,5 @@ public class OmsSign {
     }
 
 
+
 }

+ 56 - 0
kmall-admin/src/main/java/com/kmall/admin/utils/sign/OutRequestMessage.java

@@ -0,0 +1,56 @@
+package com.kmall.admin.utils.sign;
+
+import java.io.Serializable;
+
+/**
+ * 外部请求消息结构
+ * 由外部系统发起
+ *
+ * @author Scott Chen
+ * @since 1.0
+ * 2018-03-28
+ */
+public class OutRequestMessage implements Serializable {
+    private static final long serialVersionUID = -3044821399294307105L;
+
+    //消息发起者编号
+    private String merchId;
+    //业务数据
+    private String data;
+    //时间戳
+    private String timestamp;
+    //签名
+    private String sign;
+
+    public String getMerchId() {
+        return merchId;
+    }
+
+    public void setMerchId(String merchId) {
+        this.merchId = merchId;
+    }
+
+    public String getData() {
+        return data;
+    }
+
+    public void setData(String data) {
+        this.data = data;
+    }
+
+    public String getTimestamp() {
+        return timestamp;
+    }
+
+    public void setTimestamp(String timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+}

+ 2 - 0
kmall-admin/src/main/resources/conf/eccs.properties

@@ -0,0 +1,2 @@
+md5Salt=QHDSECCS
+requestUrl=http://www.baidu.com

+ 17 - 6
kmall-admin/src/main/resources/mybatis/mapper/BrandDao.xml

@@ -22,6 +22,7 @@
         <result column="merchName" property="merchName" />
         <result column="category_id" property="categoryId" />
         <result column="categoryName" property="categoryName" />
+        <result column="category_level" property="categoryLevel" />
     </resultMap>
 
     <select id="queryObject" resultType="com.kmall.admin.entity.BrandEntity">
@@ -40,7 +41,8 @@
 			`is_new`,
 			`new_pic_url`,
 			`new_sort_order`,
-			category_id
+			category_id,
+			category_level
 		from mall_brand
 		where id = #{id}
 	</select>
@@ -62,6 +64,7 @@
         b.`new_pic_url`,
         b.`new_sort_order`,
         b.category_id,
+        b.category_level,
         s.store_name storeName,
         m.merch_name merchName
         from mall_brand b
@@ -90,7 +93,8 @@
         `is_new`,
         `new_pic_url`,
         `new_sort_order`,
-        b.category_id
+        b.category_id,
+        b.category_level
         from mall_brand b
         where 1=1
         <if test="storeId != null and storeId != ''">
@@ -125,7 +129,8 @@
         b.new_sort_order,
         m.merch_name merchName,
         cg.name categoryName,
-        b.category_id
+        b.category_id,
+        b.category_level
         from mall_brand b
         left join mall_merch m on b.merch_sn = m.merch_sn
         LEFT JOIN mall_category cg ON b.category_id = cg.id
@@ -193,7 +198,9 @@
 			`is_new`,
 			`new_pic_url`,
 			`new_sort_order`,
-            category_id)
+            category_id,
+            category_level
+            )
 		values(
 			#{name},
 			#{storeId},
@@ -208,7 +215,9 @@
 			#{isNew},
 			#{newPicUrl},
 			#{newSortOrder},
-            #{categoryId})
+            #{categoryId},
+            #{categoryLevel}
+            )
 	</insert>
 
     <update id="update" parameterType="com.kmall.admin.entity.BrandEntity">
@@ -227,6 +236,7 @@
             <if test="isNew != null">`is_new` = #{isNew},</if>
             <if test="newPicUrl != null">`new_pic_url` = #{newPicUrl},</if>
             <if test="categoryId != null">`category_id` = #{categoryId},</if>
+            <if test="categoryLevel != null">`category_level` = #{categoryLevel},</if>
             <if test="newSortOrder != null">`new_sort_order` = #{newSortOrder}</if>
         </set>
         where id = #{id}
@@ -285,7 +295,8 @@
         b.new_sort_order,
         m.merch_name merchName,
         cg.name categoryName,
-        b.category_id
+        b.category_id,
+        b.category_level
         from mall_brand b
         left join mall_merch m on b.merch_sn = m.merch_sn
         LEFT JOIN mall_category cg ON b.category_id = cg.id

+ 209 - 0
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -852,4 +852,213 @@
         </where>
     </select>
 
+    <insert id="saveBatch"  parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+
+        insert into mall_goods(
+        `merch_sn`,
+        third_party_merch_code,
+        `supplier_id`,
+        `goods_sn`,
+        `prod_barcode`,
+        `sku`,
+        `plu`,
+        `english_name`,
+        `cost_price`,
+        `daily_price`,
+        `goods_biz_type`,
+        `name`,
+        `unit_code`,
+        `brand`,
+        `goods_number`,
+        `keywords`,
+        `goods_brief`,
+        `goods_desc`,
+        `cus_goods_code`,
+        `ciq_prod_model`,
+        `ori_cnt_code`,
+        `cus_decl_ele`,
+        `cus_rec_code`,
+        `is_on_sale`,
+        `add_time`,
+        `sort_order`,
+        `is_delete`,
+        `counter_price`,
+        `extra_price`,
+        `is_new`,
+        `goods_unit`,
+        `primary_pic_url`,
+        `list_pic_url`,
+        `goods_rate`,
+        `sell_volume`,
+        `primary_product_id`,
+        `unit_price`,
+        `promotion_desc`,
+        `promotion_tag`,
+        `app_exclusive_price`,
+        `is_app_exclusive`,
+        `gross_weight`,
+        `net_weight`,
+        is_goods_share_stock,
+        `is_limited`,
+        `is_hot`,
+        `creater_sn`,
+        `create_time`,
+        `moder_sn`,
+        `mod_time`,
+        `mychem_id`,
+        `hs_code`,
+        `hs_code_name`,
+        `is_sync_hs_code`,
+        `is_sync_goods_rate`,
+        `imp_consum_tax_rate`,
+        `value_added_tax_rate`,
+        `legal_unit1_qty`,
+        `legal_unit2_qty`,
+        `cosm_threshold_value`,
+        `to_be_restored`,
+        `tstm`)
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+        (
+        #{item.merchSn},
+        #{item.thirdPartyMerchCode},
+        #{item.supplierId},
+        #{item.goodsSn},
+        #{item.prodBarcode},
+        #{item.sku},
+        #{item.plu},
+        #{item.englishName},
+        #{item.costPrice},
+        #{item.dailyPrice},
+        #{item.goodsBizType},
+        #{item.name},
+        #{item.unitCode},
+        #{item.brand},
+        #{item.goodsNumber},
+        #{item.keywords},
+        #{item.goodsBrief},
+        #{item.goodsDesc},
+        #{item.cusGoodsCode},
+        #{item.ciqProdModel},
+        #{item.oriCntCode},
+        #{item.cusDeclEle},
+        #{item.cusRecCode},
+        #{item.isOnSale},
+        #{item.addTime},
+        #{item.sortOrder},
+        #{item.isDelete},
+        #{item.counterPrice},
+        #{item.extraPrice},
+        #{item.isNew},
+        #{item.goodsUnit},
+        #{item.primaryPicUrl},
+        #{item.listPicUrl},
+        #{item.goodsRate},
+        #{item.sellVolume},
+        #{item.primaryProductId},
+        #{item.unitPrice},
+        #{item.promotionDesc},
+        #{item.promotionTag},
+        #{item.appExclusivePrice},
+        #{item.isAppExclusive},
+        #{item.grossWeight},
+        #{item.netWeight},
+        #{item.isGoodsShareStock},
+        #{item.isLimited},
+        #{item.isHot},
+        #{item.createrSn},
+        #{item.createTime},
+        #{item.moderSn},
+        #{item.modTime},
+        #{item.mychemId},
+        #{item.hsCode},
+        #{item.hsCodeName},
+        '0',
+        '0',
+        #{item.impConsumTaxRate},
+        #{item.valueAddedTaxRate},
+        #{item.legalUnit1Qty},
+        #{item.legalUnit2Qty},
+        #{item.cosmThresholdValue},
+        #{item.toBeRestored},
+        #{item.tstm})
+        </foreach>
+
+
+    </insert>
+
+    <update id="updateBatch" parameterType="java.util.List">
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+
+            update mall_goods
+            <set>
+                <if test="item.merchSn != null">`merch_sn` = #{item.merchSn},</if>
+                <if test="item.thirdPartyMerchCode != null">`third_party_merch_code` = #{item.thirdPartyMerchCode},</if>
+                <if test="item.supplierId != null">`supplier_id` = #{item.supplierId},</if>
+                <if test="item.goodsSn != null">`goods_sn` = #{item.goodsSn},</if>
+                <if test="item.prodBarcode != null">`prod_barcode` = #{item.prodBarcode},</if>
+                <if test="item.sku != null">`sku` = #{item.sku},</if>
+                <if test="item.plu != null">`plu` = #{item.plu},</if>
+                <if test="item.englishName != null">`english_name` = #{item.englishName},</if>
+                <if test="item.costPrice != null">`cost_price` = #{item.costPrice},</if>
+                <if test="item.dailyPrice != null">`daily_price` = #{item.dailyPrice},</if>
+                <if test="item.goodsBizType != null">`goods_biz_type` = #{item.goodsBizType},</if>
+                <if test="item.name != null">`name` = #{item.name},</if>
+                <if test="item.unitCode != null">`unit_code` = #{item.unitCode},</if>
+                <if test="item.brand != null">`brand` = #{item.brand},</if>
+                <if test="item.goodsNumber != null">`goods_number` = #{item.goodsNumber},</if>
+                <if test="item.keywords != null">`keywords` = #{item.keywords},</if>
+                <if test="item.goodsBrief != null">`goods_brief` = #{item.goodsBrief},</if>
+                <if test="item.goodsDesc != null">`goods_desc` = #{item.goodsDesc},</if>
+                <if test="item.cusGoodsCode != null">`cus_goods_code` = #{item.cusGoodsCode},</if>
+                <if test="item.ciqProdModel != null">`ciq_prod_model` = #{item.ciqProdModel},</if>
+                <if test="item.oriCntCode != null">`ori_cnt_code` = #{item.oriCntCode},</if>
+                <if test="item.cusDeclEle != null">`cus_decl_ele` = #{item.cusDeclEle},</if>
+                <if test="item.cusRecCode != null">`cus_rec_code` = #{item.cusRecCode},</if>
+                <if test="item.isOnSale != null">`is_on_sale` = #{item.isOnSale},</if>
+                <if test="item.addTime != null">`add_time` = #{item.addTime},</if>
+                <if test="item.sortOrder != null">`sort_order` = #{item.sortOrder},</if>
+                <if test="item.isDelete != null">`is_delete` = #{item.isDelete},</if>
+                <if test="item.counterPrice != null">`counter_price` = #{item.counterPrice},</if>
+                <if test="item.extraPrice != null">`extra_price` = #{item.extraPrice},</if>
+                <if test="item.isNew != null">`is_new` = #{item.isNew},</if>
+                <if test="item.goodsUnit != null">`goods_unit` = #{item.goodsUnit},</if>
+                <if test="item.primaryPicUrl != null">`primary_pic_url` = #{item.primaryPicUrl},</if>
+                <if test="item.listPicUrl != null">`list_pic_url` = #{item.listPicUrl},</if>
+                <if test="item.goodsRate != null">`goods_rate` = #{item.goodsRate},</if>
+                <if test="item.sellVolume != null">`sell_volume` = #{item.sellVolume},</if>
+                <if test="item.primaryProductId != null">`primary_product_id` = #{item.primaryProductId},</if>
+                <if test="item.unitPrice != null">`unit_price` = #{item.unitPrice},</if>
+                <if test="item.promotionDesc != null">`promotion_desc` = #{item.promotionDesc},</if>
+                <if test="item.promotionTag != null">`promotion_tag` = #{item.promotionTag},</if>
+                <if test="item.appExclusivePrice != null">`app_exclusive_price` = #{item.appExclusivePrice},</if>
+                <if test="item.isAppExclusive != null">`is_app_exclusive` = #{item.isAppExclusive},</if>
+                <if test="item.grossWeight != null">`gross_weight` = #{item.grossWeight},</if>
+                <if test="item.netWeight != null">`net_weight` = #{item.netWeight},</if>
+                <if test="item.isGoodsShareStock != null">`is_goods_share_stock` = #{item.isGoodsShareStock},</if>
+                <if test="item.isLimited != null">`is_limited` = #{item.isLimited},</if>
+                <if test="item.isHot != null">`is_hot` = #{item.isHot},</if>
+                <if test="item.createrSn != null">`creater_sn` = #{item.createrSn},</if>
+                <if test="item.createTime != null">`create_time` = #{item.createTime},</if>
+                <if test="item.moderSn != null">`moder_sn` = #{item.moderSn},</if>
+                <if test="item.modTime != null">`mod_time` = #{item.modTime},</if>
+                <if test="item.tstm != null">`tstm` = #{item.tstm},</if>
+                <if test="item.lastSaleTime != null">`last_sale_time` = #{item.lastSaleTime},</if>
+                <if test="item.mychemId != null">`mychem_id` = #{item.mychemId},</if>
+                <if test="item.hsCode != null">`hs_code` = #{item.hsCode},</if>
+                <if test="item.hsCodeName != null">`hs_code_name` = #{item.hsCodeName},</if>
+                <if test="item.isSyncHsCode != null">`is_sync_hs_code` = #{item.isSyncHsCode},</if>
+                <if test="item.isSyncGoodsRate != null">`is_sync_goods_rate` = #{item.isSyncGoodsRate},</if>
+                <if test="item.impConsumTaxRate != null">`imp_consum_tax_rate` = #{item.impConsumTaxRate},</if>
+                <if test="item.valueAddedTaxRate != null">`value_added_tax_rate` = #{item.valueAddedTaxRate},</if>
+                <if test="item.legalUnit1Qty != null">`legal_unit1_qty` = #{item.legalUnit1Qty},</if>
+                <if test="item.legalUnit2Qty != null">`legal_unit2_qty` = #{item.legalUnit2Qty},</if>
+                <if test="item.cosmThresholdValue != null">`cosm_threshold_value` = #{item.cosmThresholdValue},</if>
+                <if test="item.toBeRestored != null">`to_be_restored` = #{item.toBeRestored}</if>
+            </set>
+            where id = #{item.id}
+
+        </foreach>
+    </update>
+
 </mapper>

+ 34 - 1
kmall-admin/src/main/resources/mybatis/mapper/GoodsSpecificationDao.xml

@@ -124,4 +124,37 @@
 		where goods_id = #{goodsId}
     </select>
 
-</mapper>
+
+    <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+
+        insert into mall_goods_specification(
+        `goods_id`,
+        `specification_id`,
+        `value`,
+        `pic_url`)
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+        (
+            #{item.goodsId},
+            #{item.specificationId},
+            #{item.value},
+            #{item.picUrl}
+        )
+        </foreach>
+    </insert>
+
+    <update id="updateBatch" parameterType="java.util.List">
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+
+            update mall_goods_specification
+            <set>
+                <if test="item.goodsId != null">`goods_id` = #{item.goodsId},</if>
+                <if test="item.specificationId != null">`specification_id` = #{item.specificationId},</if>
+                <if test="item.value != null">`value` = #{item.value},</if>
+                <if test="item.picUrl != null">`pic_url` = #{item.picUrl}</if>
+            </set>
+            where id = #{item.id}
+        </foreach>
+    </update>
+
+</mapper>

+ 46 - 8
kmall-admin/src/main/resources/mybatis/mapper/MngChangeDao.xml

@@ -110,7 +110,7 @@
 			limit #{offset}, #{limit}
 		</if>
 	</select>
-	
+
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_mng_change c left join mall_merch m on c.merch_sn = m.merch_sn
 		left join third_merchant_biz mb on c.third_party_merch_code = mb.third_party_merch_code
@@ -130,7 +130,7 @@
 			AND c.change_type = #{changeType}
 		</if>
 	</select>
-	 
+
 	<insert id="save" parameterType="com.kmall.admin.entity.MngChangeEntity">
 		insert into mall_mng_change(
 			`change_num`,
@@ -163,9 +163,9 @@
 			#{modTime},
 			#{tstm})
 	</insert>
-	 
+
 	<update id="update" parameterType="com.kmall.admin.entity.MngChangeEntity">
-		update mall_mng_change 
+		update mall_mng_change
 		<set>
 			<if test="changeNum != null">`change_num` = #{changeNum}, </if>
 			<if test="originalNum != null">`original_num` = #{originalNum}, </if>
@@ -184,16 +184,54 @@
 		</set>
 		where id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		delete from mall_mng_change where id = #{value}
 	</delete>
-	
+
 	<delete id="deleteBatch">
-		delete from mall_mng_change where id in 
+		delete from mall_mng_change where id in
 		<foreach item="id" collection="array" open="(" separator="," close=")">
 			#{id}
 		</foreach>
 	</delete>
 
-</mapper>
+	<insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+
+		insert into mall_mng_change(
+		`change_num`,
+		`original_num`,
+		`valid_num`,
+		`merch_sn`,
+		`third_party_merch_code`,
+		`goods_id`,
+		`is_valid`,
+		`change_type`,
+		`change_reason`,
+		`creater_sn`,
+		`create_time`,
+		`moder_sn`,
+		`mod_time`,
+		`tstm`)
+		values
+		<foreach collection="list" index="index" item="item" separator=",">
+		(
+			#{item.changeNum},
+			#{item.originalNum},
+			#{item.validNum},
+			#{item.merchSn},
+			#{item.thirdPartyMerchCode},
+			#{item.goodsId},
+			#{item.isValid},
+			#{item.changeType},
+			#{item.changeReason},
+			#{item.createrSn},
+			#{item.createTime},
+			#{item.moderSn},
+			#{item.modTime},
+			#{item.tstm}
+		)
+		</foreach>
+	</insert>
+
+</mapper>

+ 44 - 1
kmall-admin/src/main/resources/mybatis/mapper/ProductDao.xml

@@ -138,4 +138,47 @@
         </foreach>
     </delete>
 
-</mapper>
+
+    <insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+
+        insert into mall_product(
+        `goods_id`,
+        `goods_specification_ids`,
+        `goods_specification_name_value`,
+        `goods_sn`,
+        `goods_number`,
+        `goods_default`
+        )
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+        (
+            #{item.goodsId},
+            #{item.goodsSpecificationIds},
+            #{item.goodsSpecificationNameValue},
+            #{item.goodsSn},
+            #{item.goodsNumber},
+            #{item.goodsDefault}
+        )
+        </foreach>
+    </insert>
+
+    <update id="updateBatch" parameterType="java.util.List">
+        <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+
+            update mall_product
+            <set>
+                <if test="item.goodsId != null">`goods_id` = #{item.goodsId},</if>
+                <if test="item.goodsSpecificationIds != null">`goods_specification_ids` = #{item.goodsSpecificationIds},</if>
+                <if test="item.goodsSpecificationNameValue != null">`goods_specification_name_value` =
+                    #{item.goodsSpecificationNameValue},
+                </if>
+                <if test="item.goodsSn != null">`goods_sn` = #{item.goodsSn},</if>
+                <if test="item.goodsNumber != null">`goods_number` = #{item.goodsNumber},</if>
+                <if test="item.goodsDefault != null">`goods_default` = #{item.goodsDefault},</if>
+            </set>
+            where id = #{item.id}
+
+        </foreach>
+    </update>
+
+</mapper>

+ 4 - 0
kmall-admin/src/main/resources/mybatis/mapper/ProductStoreRelaDao.xml

@@ -872,4 +872,8 @@
         update mall_product_store_rela set retail_price = #{updatePrice} where sku = #{sku}
     </update>
 
+    <select id="queryAllList" resultType="com.kmall.admin.entity.ProductStoreRelaEntity">
+        select * from mall_product_store_rela
+    </select>
+
 </mapper>

+ 30 - 8
kmall-admin/src/main/resources/mybatis/mapper/SupplierDao.xml

@@ -86,7 +86,7 @@
 			limit #{offset}, #{limit}
 		</if>
 	</select>
-	
+
  	<select id="queryTotal" resultType="int">
 		select count(*) from mall_supplier
 		WHERE 1=1
@@ -100,7 +100,7 @@
 			AND third_party_merch_code = #{thirdPartyMerchCode}
 		</if>
 	</select>
-	 
+
 	<insert id="save" parameterType="com.kmall.admin.entity.SupplierEntity" useGeneratedKeys="true" keyProperty="id">
 		insert into mall_supplier(
 			`level_merch_sn`,
@@ -117,9 +117,9 @@
 			#{sortOrder},
 			#{isShow},#{thirdPartyMerchCode})
 	</insert>
-	 
+
 	<update id="update" parameterType="com.kmall.admin.entity.SupplierEntity">
-		update mall_supplier 
+		update mall_supplier
 		<set>
 			<if test="levelMerchSn != null">`level_merch_sn` = #{levelMerchSn}, </if>
 			<if test="levelMerchFlag != null">`level_merch_flag` = #{levelMerchFlag}, </if>
@@ -131,16 +131,38 @@
 		</set>
 		where id = #{id}
 	</update>
-	
+
 	<delete id="delete">
 		delete from mall_supplier where id = #{value}
 	</delete>
-	
+
 	<delete id="deleteBatch">
-		delete from mall_supplier where id in 
+		delete from mall_supplier where id in
 		<foreach item="id" collection="array" open="(" separator="," close=")">
 			#{id}
 		</foreach>
 	</delete>
 
-</mapper>
+	<insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+		insert into mall_supplier(
+		`level_merch_sn`,
+		`level_merch_flag`,
+		`child_supplier_name`,
+		`child_supplier_flag`,
+		`sort_order`,
+		`is_show`,third_party_merch_code)
+		values
+		<foreach collection="list" index="index" item="item" separator=",">
+		(
+		#{item.levelMerchSn},
+		#{item.levelMerchFlag},
+		#{item.childSupplierName},
+		#{item.childSupplierFlag},
+		#{item.sortOrder},
+		#{item.isShow},
+		#{item.thirdPartyMerchCode}
+		)
+		</foreach>
+	</insert>
+
+</mapper>

+ 71 - 0
kmall-admin/src/main/resources/mybatis/mapper/kmall2eccs/KtoEccsDao.xml

@@ -120,4 +120,75 @@
 		</foreach>
 	</delete>
 
+	<insert id="saveBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
+
+
+		insert into kmall_to_eccs(
+		`request_data`,
+		`request_time`,
+		`request_type`,
+		`send_status`,
+		`fail_reason`,
+		`create_time`,
+		`creater_sn`,
+		`update_time`,
+		`moder_sn`)
+		values
+		<foreach collection="list" index="index" item="item" separator=",">
+		(
+		#{item.requestData},
+		#{item.requestTime},
+		#{item.requestType},
+		#{item.sendStatus},
+		#{item.failReason},
+		#{item.createTime},
+		#{item.createrSn},
+		#{item.updateTime},
+		#{item.moderSn})
+		</foreach>
+
+	</insert>
+
+	<update id="updateBatch" parameterType="java.util.List">
+		<foreach collection="list" item="item" index="index" open="" close="" separator=";">
+			update kmall_to_eccs
+			<set>
+				<if test="item.requestData != null">`request_data` = #{item.requestData}, </if>
+				<if test="item.requestTime != null">`request_time` = #{item.requestTime}, </if>
+				<if test="item.requestType != null">`request_type` = #{item.requestType}, </if>
+				<if test="item.sendStatus != null">`send_status` = #{item.sendStatus}, </if>
+				<if test="item.failReason != null">`fail_reason` = #{item.failReason}, </if>
+				<if test="item.createTime != null">`create_time` = #{item.createTime}, </if>
+				<if test="item.createrSn != null">`creater_sn` = #{item.createrSn}, </if>
+				<if test="item.updateTime != null">`update_time` = #{item.updateTime}, </if>
+				<if test="item.moderSn != null">`moder_sn` = #item.moderSn}</if>
+			</set>
+			where kte_id = #{item.kteId}
+		</foreach>
+	</update>
+
+
+	<select id="queryNotSendRecord" resultType="com.kmall.admin.entity.kmall2eccs.KtoEccsEntity">
+		select
+    		`kte_id`,
+    		`request_data`,
+    		`request_time`,
+    		`request_type`,
+    		`send_status`,
+    		`fail_reason`,
+    		`create_time`,
+    		`creater_sn`,
+    		`update_time`,
+    		`moder_sn`
+		from kmall_to_eccs
+		where
+			send_status = '00' or send_status = '02'
+
+		<if test="page != null and pageSize != null" >
+			limit #{page}, #{pageSize}
+		</if>
+
+
+	</select>
+
 </mapper>

+ 141 - 0
kmall-admin/src/main/resources/mybatis/mapper/shop/PriceModificationRecordDao.xml

@@ -0,0 +1,141 @@
+<?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.kmall.admin.dao.shop.PriceModificationRecordDao">
+
+    <resultMap type="com.kmall.admin.entity.shop.PriceModificationRecordEntity" id="priceModificationRecordMap">
+        <result property="mpmrId" column="mpmr_id"/>
+        <result property="merchSn" column="merch_sn"/>
+        <result property="thirdMerchSn" column="third_merch_sn"/>
+        <result property="shopSn" column="shop_sn"/>
+        <result property="barcode" column="barcode"/>
+        <result property="sku" column="sku"/>
+        <result property="currentPrice" column="current_price"/>
+        <result property="modifyPrice" column="modify_price"/>
+        <result property="modifyType" column="modify_type"/>
+        <result property="modifySource" column="modify_source"/>
+        <result property="moderSn" column="moder_sn"/>
+        <result property="modTime" column="mod_time"/>
+        <result property="tstm" column="tstm"/>
+    </resultMap>
+
+	<select id="queryObject" resultType="com.kmall.admin.entity.shop.PriceModificationRecordEntity">
+		select
+			`mpmr_id`,
+			`merch_sn`,
+			`third_merch_sn`,
+			`shop_sn`,
+			`barcode`,
+			`sku`,
+			`current_price`,
+			`modify_price`,
+			`modify_type`,
+			`modify_source`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`
+		from mall_price_modification_record
+		where mpmr_id = #{id}
+	</select>
+
+	<select id="queryList" resultType="com.kmall.admin.entity.shop.PriceModificationRecordEntity">
+		select
+    		`mpmr_id`,
+    		`merch_sn`,
+    		`third_merch_sn`,
+    		`shop_sn`,
+    		`barcode`,
+    		`sku`,
+    		`current_price`,
+    		`modify_price`,
+    		`modify_type`,
+    		`modify_source`,
+    		`moder_sn`,
+    		`mod_time`,
+    		`tstm`
+		from mall_price_modification_record
+		WHERE 1=1
+		<if test="name != null and name.trim() != ''">
+			AND name LIKE concat('%',#{name},'%')
+		</if>
+        <choose>
+            <when test="sidx != null and sidx.trim() != ''">
+                order by ${sidx} ${order}
+            </when>
+			<otherwise>
+                order by mpmr_id desc
+			</otherwise>
+        </choose>
+		<if test="offset != null and limit != null">
+			limit #{offset}, #{limit}
+		</if>
+	</select>
+
+ 	<select id="queryTotal" resultType="int">
+		select count(*) from mall_price_modification_record
+		WHERE 1=1
+        <if test="name != null and name.trim() != ''">
+            AND name LIKE concat('%',#{name},'%')
+        </if>
+	</select>
+
+	<insert id="save" parameterType="com.kmall.admin.entity.shop.PriceModificationRecordEntity" useGeneratedKeys="true" keyProperty="mpmrId">
+		insert into mall_price_modification_record(
+			`merch_sn`,
+			`third_merch_sn`,
+			`shop_sn`,
+			`barcode`,
+			`sku`,
+			`current_price`,
+			`modify_price`,
+			`modify_type`,
+			`modify_source`,
+			`moder_sn`,
+			`mod_time`,
+			`tstm`)
+		values(
+			#{merchSn},
+			#{thirdMerchSn},
+			#{shopSn},
+			#{barcode},
+			#{sku},
+			#{currentPrice},
+			#{modifyPrice},
+			#{modifyType},
+			#{modifySource},
+			#{moderSn},
+			#{modTime},
+			#{tstm})
+	</insert>
+
+	<update id="update" parameterType="com.kmall.admin.entity.shop.PriceModificationRecordEntity">
+		update mall_price_modification_record
+		<set>
+			<if test="merchSn != null">`merch_sn` = #{merchSn}, </if>
+			<if test="thirdMerchSn != null">`third_merch_sn` = #{thirdMerchSn}, </if>
+			<if test="shopSn != null">`shop_sn` = #{shopSn}, </if>
+			<if test="barcode != null">`barcode` = #{barcode}, </if>
+			<if test="sku != null">`sku` = #{sku}, </if>
+			<if test="currentPrice != null">`current_price` = #{currentPrice}, </if>
+			<if test="modifyPrice != null">`modify_price` = #{modifyPrice}, </if>
+			<if test="modifyType != null">`modify_type` = #{modifyType}, </if>
+			<if test="modifySource != null">`modify_source` = #{modifySource}, </if>
+			<if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
+			<if test="modTime != null">`mod_time` = #{modTime}, </if>
+			<if test="tstm != null">`tstm` = #{tstm}</if>
+		</set>
+		where mpmr_id = #{mpmrId}
+	</update>
+
+	<delete id="delete">
+		delete from mall_price_modification_record where mpmr_id = #{value}
+	</delete>
+
+	<delete id="deleteBatch">
+		delete from mall_price_modification_record where mpmr_id in
+		<foreach item="mpmrId" collection="array" open="(" separator="," close=")">
+			#{mpmrId}
+		</foreach>
+	</delete>
+
+</mapper>

+ 2 - 0
kmall-admin/src/main/webapp/WEB-INF/page/compared/payorderinfo.html

@@ -36,6 +36,8 @@
                         <i-button type="ghost" icon="ios-cloud-upload-outline">微信支付订单导入</i-button>
                     </Upload>
                 </i-col>
+                <a href="../statics/file/alipay_pay_order.xls">支付宝模板下载</a>&nbsp;&nbsp;&nbsp;&nbsp;
+                <a href="../statics/file/weixin_pay_order.xls">微信模板下载</a>
             </div>
         </Row>
 	    <table id="jqGrid"></table>

+ 1 - 0
kmall-admin/src/main/webapp/WEB-INF/page/compared/taxinfo.html

@@ -28,6 +28,7 @@
                         <i-button type="ghost" icon="ios-cloud-upload-outline">税单导入</i-button>
                     </Upload>
                 </i-col>
+                <a href="../statics/file/tax_info.xlsx">税单模板下载</a>
             </div>
         </Row>
 	    <table id="jqGrid"></table>

+ 3 - 2
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -347,9 +347,10 @@
                                 </tr>
                             </table>
 
-                        </div>
+                        </div>e y
                         <div class="modal-footer">
-                            <button type="button" style="margin:0 30px 0 20px;font-size: 20px;float: left" class="btn ivu-btn-error" @click="refundOrder()" id="refundOrder" data-dismiss="modal">退款</button>
+                            <button v-if="canRefund" type="button" style="margin:0 30px 0 20px;font-size: 20px;float: left" class="btn ivu-btn-error" @click="refundOrder()" id="refundOrder" data-dismiss="modal">退款</button>
+                            <button v-else disabled type="button" style="margin:0 30px 0 20px;font-size: 20px;float: left" class="btn ivu-btn-error" @click="refundOrder()"  data-dismiss="modal">退款</button>
                             <button type="button" style="margin:0 30px 0 20px;font-size: 30px;" class="btn btn-warning" @click="confirmDelivery" id="confirmDelivery" data-dismiss="modal">确定提货</button>
                             <button type="button" style="margin:0 30px 0 20px;font-size: 30px;" class="btn btn-primary" @click="resendNotice" id="resendNotice" data-dismiss="modal">重发通知</button>
                             <button type="button" style="margin:0 30px 0 20px;font-size: 30px;" class="btn btn-primary" @click="resendWaybill" id="resendWaybill" data-dismiss="modal">重发运单</button>

+ 84 - 0
kmall-admin/src/main/webapp/WEB-INF/page/shop/pricemodificationrecord.html

@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>价格修改记录表</title>
+    #parse("sys/header.html")
+</head>
+<body>
+<div id="rrapp" v-cloak>
+	<div v-show="showList">
+        <Row :gutter="16">
+            <div class="search-group">
+                <i-col span="4">
+                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
+                </i-col>
+                <i-button @click="query">查询</i-button>
+                <i-button @click="reloadSearch">重置</i-button>
+            </div>
+            <div class="buttons-group">
+                #if($shiro.hasPermission("pricemodificationrecord:save"))
+                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
+                #end
+                #if($shiro.hasPermission("pricemodificationrecord:update"))
+                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
+                #end
+                #if($shiro.hasPermission("pricemodificationrecord:delete"))
+                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
+                #end
+            </div>
+        </Row>
+	    <table id="jqGrid"></table>
+	    <div id="jqGridPager"></div>
+    </div>
+
+    <Card v-show="!showList">
+        <p slot="title">{{title}}</p>
+		<i-form ref="formValidate" :model="priceModificationRecord" :rules="ruleValidate" :label-width="80">
+            <Form-item label="商户编码" prop="merchSn">
+                <i-input v-model="priceModificationRecord.merchSn" placeholder="商户编码"/>
+            </Form-item>
+            <Form-item label="第三方商户" prop="thirdMerchSn">
+                <i-input v-model="priceModificationRecord.thirdMerchSn" placeholder="第三方商户"/>
+            </Form-item>
+            <Form-item label="门店编码" prop="shopSn">
+                <i-input v-model="priceModificationRecord.shopSn" placeholder="门店编码"/>
+            </Form-item>
+            <Form-item label="条码" prop="barcode">
+                <i-input v-model="priceModificationRecord.barcode" placeholder="条码"/>
+            </Form-item>
+            <Form-item label="sku" prop="sku">
+                <i-input v-model="priceModificationRecord.sku" placeholder="sku"/>
+            </Form-item>
+            <Form-item label="当前价格" prop="currentPrice">
+                <i-input v-model="priceModificationRecord.currentPrice" placeholder="当前价格"/>
+            </Form-item>
+            <Form-item label="修改价格" prop="modifyPrice">
+                <i-input v-model="priceModificationRecord.modifyPrice" placeholder="修改价格"/>
+            </Form-item>
+            <Form-item label="修改方式 (1.界面修改 2.excel修改 )" prop="modifyType">
+                <i-input v-model="priceModificationRecord.modifyType" placeholder="修改方式 (1.界面修改 2.excel修改 )"/>
+            </Form-item>
+            <Form-item label="修改价格源头 (1.门店商品 2.日常活动 3.临时促销)" prop="modifySource">
+                <i-input v-model="priceModificationRecord.modifySource" placeholder="修改价格源头 (1.门店商品 2.日常活动 3.临时促销)"/>
+            </Form-item>
+            <Form-item label="修改人编号" prop="moderSn">
+                <i-input v-model="priceModificationRecord.moderSn" placeholder="修改人编号"/>
+            </Form-item>
+            <Form-item label="修改时间,yyyy-MM-dd HH:mm:ss" prop="modTime">
+                <i-input v-model="priceModificationRecord.modTime" placeholder="修改时间,yyyy-MM-dd HH:mm:ss"/>
+            </Form-item>
+            <Form-item label="时间戳" prop="tstm">
+                <i-input v-model="priceModificationRecord.tstm" placeholder="时间戳"/>
+            </Form-item>
+            <Form-item>
+                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
+                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
+                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
+            </Form-item>
+        </i-form>
+	</Card>
+</div>
+
+<script src="${rc.contextPath}/js/shop/pricemodificationrecord.js?_${date.systemTime}"></script>
+</body>
+</html>

+ 7 - 6
kmall-admin/src/main/webapp/js/mk/mkactivitieshalfprice.js

@@ -84,7 +84,7 @@ let vm = new Vue({
 		add: function () {
 			vm.showList = false;
 			vm.title = "新增";
-			vm.mkActivitieshalfprice = {};
+			vm.mkActivitiesHalfPrice = {};
 		},
 		update: function (event) {
             let mafrId = getSelectedRow();
@@ -97,17 +97,18 @@ let vm = new Vue({
             vm.getInfo(mafrId)
 		},
 		saveOrUpdate: function (event) {
-            let url = vm.mkActivitieshalfprice.mafrId == null ? "../mkactivitieshalfprice/save" : "../mkactivitieshalfprice/update";
+            let url = vm.mkActivitiesHalfPrice.mafrId == null ? "../mkactivitieshalfprice/save" : "../mkactivitieshalfprice/update";
 
 			//添加上层的门店编号与营销方式编号
-			vm.mkActivitieshalfprice.shopSn = vm.storeId;
-			vm.mkActivitieshalfprice.mkaId = vm.mkaId;
+
+			vm.mkActivitiesHalfPrice.shopSn = vm.storeId;
+			vm.mkActivitiesHalfPrice.mkaId = vm.mkaId;
 
             $.ajax({
 				type: "POST",
 			    url: url,
 			    contentType: "application/json",
-			    data: JSON.stringify(vm.mkActivitieshalfprice),
+			    data: JSON.stringify(vm.mkActivitiesHalfPrice),
                 success: function (r) {
                     if (r.code === 0) {
                         alert('操作成功', function (index) {
@@ -145,7 +146,7 @@ let vm = new Vue({
 		},
 		getInfo: function(mafrId){
 			$.get("../mkactivitieshalfprice/info/"+mafrId, function (r) {
-                vm.mkActivitieshalfprice = r.mkActivitieshalfprice;
+                vm.mkActivitiesHalfPrice = r.mkActivitiesHalfPrice;
             });
 		},
         reloadSearch: function() {

+ 1 - 1
kmall-admin/src/main/webapp/js/mk/mkactivityform.js

@@ -47,7 +47,7 @@ $(function () {
     });
 
     var marketing =
-        {'lscx': '临时促销','yhq': '优惠券','rchd': '日常活动','mysy': '买一送一','mj': '满减', 'mz': '满赠','dz': '打折','zhjsp': '组合价商品','drjbj':'第二件半价'};
+        {'lscx': '临时促销',/*'yhq': '优惠券',*/'rchd': '日常活动','mysy': '买N送一',/*'mj': '满减', 'mz': '满赠','dz': '打折','zhjsp': '组合价商品',*/'drjbj':'第二件半价'};
 
 
     let mkCode = getQueryString("mkCode");

+ 6 - 45
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -13,7 +13,6 @@ window.onbeforeunload = function(){
 
 
 function debounce(fn,delay){
-    console.log("进来了");
     var timer=null
     return function(){
         console.log(timer);
@@ -581,7 +580,10 @@ let vm = new Vue({
         searchGoods: [],
 
         // 卡回执标志
-        delayResponse:false
+        delayResponse:false,
+
+        canRefund:true
+
     },
     watch: {
         prodBarcode (){
@@ -916,22 +918,10 @@ let vm = new Vue({
         },
         getIDCardInfo: function(){
             $.post("http://127.0.0.1:8000/idcard/read", function (r){
-                // var dataR = JSON.parse(r);
-                // console.log(dataR)
 
                 if(r.code == "0"){
-                    // if(!r.info){
-                    //     alert("请连接设备或设备有问题,请联系管理员!");
-                    //     return ;
-                    // }
-                    // var data = JSON.parse(r.info);
-                    // if(data.code=="0"){
                     vm.$refs.customName.value = r.rows[0].data.name;
                     vm.$refs.customIDCard.value = r.rows[0].data.id_no;
-                    // }else{
-                    //     alert(data.msg);
-                    //     return ;
-                    // }
 
                 }else if(r.code=="-1"){
                     alert(r.msg);
@@ -1089,21 +1079,6 @@ let vm = new Vue({
         },
         refundOrder:function(){
             vm.debounceRefund();
-            // confirm('确认退款吗?', function () {
-            //     $.ajax({
-            //         type: "POST",
-            //         url: "../order/orderRefund",
-            //         contentType: "application/json",
-            //         data: JSON.stringify({'orderId':vm.currentOrderNo,'sessionId':vm.sessionId}),
-            //         success: function (r) {
-            //             if (r.code == 0) {
-            //                 alert("退款成功")
-            //             }else{
-            //                 alert("退款失败,请联系管理员");
-            //             }
-            //         }
-            //     });
-            // })
         },
         //确认提货
         confirmDelivery: function(){
@@ -1216,22 +1191,6 @@ function printArea(content) {
     frameWindow.focus();
     frameWindow.print();
     alert('打印小票完成');
-    /*if(!vm.firstPrint){
-        setTimeout(function() {
-            // frameWindow.close();
-            frameWindow.focus();
-            frameWindow.print();
-            frameWindow.print();
-            alert('打印小票完成');
-        },250);
-        vm.firstPrint = true;
-    }else{
-        // frameWindow.close();
-        frameWindow.focus();
-        frameWindow.print();
-        frameWindow.print();
-        alert('打印小票完成');
-    }*/
 }
 
 function printArea2(content) {
@@ -1712,6 +1671,7 @@ function toPayOrder(payCode){
 
 function toRefund(){
     confirm('确认退款吗?', function () {
+        vm.canRefund = false;
         $.ajax({
             type: "POST",
             url: "../order/orderRefund",
@@ -1719,6 +1679,7 @@ function toRefund(){
             data: JSON.stringify({'orderId':vm.currentOrderNo,'sessionId':vm.sessionId}),
             success: function (r) {
                 if (r.code == 0) {
+                    vm.canRefund = true;
                     alert("退款成功")
                 }else{
                     alert("退款失败,请联系管理员");

+ 4 - 3
kmall-admin/src/main/webapp/js/shop/goods.js

@@ -39,11 +39,12 @@ $(function () {
                 }},
             {label: '商品库存', name: 'goodsNumber', index: 'goodsNumber', width: 100, align: 'right'},
             {label: '待恢复数量', name: 'toBeRestored', index: 'toBeRestored', width: 100, align: 'right',formatter:function(value){
-                if(value || value == null){
-                    return "0";
-                }else{
+                if(value){
                     return value;
+                }else{
+                    return "0";
                 }
+
                 }},
             {label: '日常价', name: 'dailyPrice', index: 'dailyPrice', width: 100, align: 'right'},
             {label: '成本价', name: 'costPrice', index: 'costPrice', width: 100, align: 'right'},

+ 150 - 0
kmall-admin/src/main/webapp/js/shop/pricemodificationrecord.js

@@ -0,0 +1,150 @@
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: '../pricemodificationrecord/list',
+        datatype: "json",
+        colModel: [
+			{label: 'mpmrId', name: 'mpmrId', index: 'mpmr_id', key: true, hidden: true},
+			{label: '商户编码', name: 'merchSn', index: 'merch_sn', width: 80},
+			{label: '第三方商户', name: 'thirdMerchSn', index: 'third_merch_sn', width: 80},
+			{label: '门店编码', name: 'shopSn', index: 'shop_sn', width: 80},
+			{label: '条码', name: 'barcode', index: 'barcode', width: 80},
+			{label: 'sku', name: 'sku', index: 'sku', width: 80},
+			{label: '当前价格', name: 'currentPrice', index: 'current_price', width: 80},
+			{label: '修改价格', name: 'modifyPrice', index: 'modify_price', width: 80},
+			{label: '修改方式 (1.界面修改 2.excel修改 )', name: 'modifyType', index: 'modify_type', width: 80},
+			{label: '修改价格源头 (1.门店商品 2.日常活动 3.临时促销)', name: 'modifySource', index: 'modify_source', width: 80},
+			{label: '修改人编号', name: 'moderSn', index: 'moder_sn', width: 80},
+			{label: '修改时间,yyyy-MM-dd HH:mm:ss', name: 'modTime', index: 'mod_time', width: 80},
+			{label: '时间戳', name: 'tstm', index: 'tstm', width: 80}],
+		viewrecords: true,
+        height: 550,
+        rowNum: 10,
+        rowList: [10, 30, 50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth: true,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader: {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames: {
+            page: "page",
+            rows: "limit",
+            order: "order"
+        },
+        gridComplete: function () {
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
+        }
+    });
+});
+
+let vm = new Vue({
+	el: '#rrapp',
+	data: {
+        showList: true,
+        title: null,
+		priceModificationRecord: {},
+		ruleValidate: {
+			name: [
+				{required: true, message: '名称不能为空', trigger: 'blur'}
+			]
+		},
+		q: {
+		    name: ''
+		}
+	},
+	methods: {
+		query: function () {
+			vm.reload();
+		},
+		add: function () {
+			vm.showList = false;
+			vm.title = "新增";
+			vm.priceModificationRecord = {};
+		},
+		update: function (event) {
+            let mpmrId = getSelectedRow();
+			if (mpmrId == null) {
+				return;
+			}
+			vm.showList = false;
+            vm.title = "修改";
+
+            vm.getInfo(mpmrId)
+		},
+		saveOrUpdate: function (event) {
+            let url = vm.priceModificationRecord.mpmrId == null ? "../pricemodificationrecord/save" : "../pricemodificationrecord/update";
+			$.ajax({
+				type: "POST",
+			    url: url,
+			    contentType: "application/json",
+			    data: JSON.stringify(vm.priceModificationRecord),
+                success: function (r) {
+                    if (r.code === 0) {
+                        alert('操作成功', function (index) {
+                            vm.reload();
+                        });
+                    } else {
+                        alert(r.msg);
+                    }
+                }
+			});
+		},
+		del: function (event) {
+            let mpmrIds = getSelectedRows();
+			if (mpmrIds == null){
+				return;
+			}
+
+			confirm('确定要删除选中的记录?', function () {
+				$.ajax({
+					type: "POST",
+				    url: "../pricemodificationrecord/delete",
+				    contentType: "application/json",
+				    data: JSON.stringify(mpmrIds),
+				    success: function (r) {
+						if (r.code == 0) {
+							alert('操作成功', function (index) {
+								$("#jqGrid").trigger("reloadGrid");
+							});
+						} else {
+							alert(r.msg);
+						}
+					}
+				});
+			});
+		},
+		getInfo: function(mpmrId){
+			$.get("../pricemodificationrecord/info/"+mpmrId, function (r) {
+                vm.priceModificationRecord = r.priceModificationRecord;
+            });
+		},
+        reloadSearch: function() {
+            vm.q = {
+                name: ''
+            }
+            vm.reload();
+		},
+		reload: function (event) {
+			vm.showList = true;
+            let page = $("#jqGrid").jqGrid('getGridParam', 'page');
+			$("#jqGrid").jqGrid('setGridParam', {
+                postData: {'name': vm.q.name},
+                page: page
+            }).trigger("reloadGrid");
+            vm.handleReset('formValidate');
+		},
+        handleSubmit: function (name) {
+            handleSubmitValidate(this, name, function () {
+                vm.saveOrUpdate()
+            });
+        },
+        handleReset: function (name) {
+            handleResetForm(this, name);
+        }
+	}
+});

+ 4 - 3
kmall-admin/src/main/webapp/js/shop/storeProductStock.js

@@ -53,11 +53,12 @@ $(function () {
             {label: '门店库存', name: 'stockNum', index: 'stockNum', width: 80, align: 'center'},
             {label: '园区库存', name: 'parkStock', index: 'parkStock', width: 80, align: 'center'},
             {label: '待恢复数量', name: 'toBeRestored', index: 'toBeRestored', width: 100, align: 'right',formatter:function(value){
-                    if(value || value == null){
-                        return "0";
-                    }else{
+                    if(value){
                         return value;
+                    }else{
+                        return "0";
                     }
+
                 }},
             {label: '零售价格', name: 'retailPrice', index: 'retailPrice', width: 80, align: 'right'},
             {label: '市场价', name: 'marketPrice', index: 'marketPrice', width: 80, align: 'right'},

二進制
kmall-admin/src/main/webapp/statics/file/alipay_pay_order.xls


二進制
kmall-admin/src/main/webapp/statics/file/tax_info.xlsx


二進制
kmall-admin/src/main/webapp/statics/file/weixin_pay_order.xls


+ 33 - 0
kmall-common/src/main/java/com/kmall/common/constant/Dict.java

@@ -1660,4 +1660,37 @@ public class Dict {
             this.itemName = itemName;
         }
     }
+
+
+    /**
+     * 发送中控类型  1.接口  2.定时器
+     */
+    public enum sendToEccsType {
+        inter("inter", "接口调用"),
+        task("task", "定时器调用");
+
+        private String item;
+        private String itemName;
+
+        sendToEccsType(String item, String itemName) {
+            this.item = item;
+            this.itemName = itemName;
+        }
+
+        public String getItem() {
+            return item;
+        }
+
+        public void setItem(String item) {
+            this.item = item;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+    }
 }