Forráskód Böngészése

Merge branch 'feature/eccs-upgrade' of lvjian/eccs into feature/eccs-upgrade

吕健 2 éve
szülő
commit
e12fcfcf42

+ 15 - 14
eccs-biz/src/main/java/com/emato/biz/controller/warehouse/OWbShopBaseController.java → eccs-biz/src/main/java/com/emato/biz/controller/store/OWbShopBaseController.java

@@ -1,6 +1,9 @@
-package com.emato.biz.controller.warehouse;
+package com.emato.biz.controller.store;
 
 import java.util.List;
+
+import com.emato.biz.domain.store.OWbShopBase;
+import com.emato.biz.service.store.IOWbShopBaseService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -15,19 +18,17 @@ import com.emato.common.annotation.Log;
 import com.emato.common.core.controller.BaseController;
 import com.emato.common.core.domain.AjaxResult;
 import com.emato.common.enums.BusinessType;
-import com.emato.biz.domain.warehouse.OWbShopBase;
-import com.emato.biz.service.warehouse.IOWbShopBaseService;
 import com.emato.common.utils.poi.ExcelUtil;
 import com.emato.common.core.page.TableDataInfo;
 
 /**
  * 商户门店基本信息Controller
- *
- * @author scott
- * @date 2021-02-01
+ * 
+ * @author admin
+ * @date 2023-04-23
  */
 @RestController
-@RequestMapping("/biz/shopbase")
+@RequestMapping("/biz/shopBase")
 public class OWbShopBaseController extends BaseController
 {
     @Autowired
@@ -36,7 +37,7 @@ public class OWbShopBaseController extends BaseController
     /**
      * 查询商户门店基本信息列表
      */
-    @PreAuthorize("@ss.hasPermi('biz:shopbase:list')")
+    @PreAuthorize("@ss.hasPermi('biz:shopBase:list')")
     @GetMapping("/list")
     public TableDataInfo list(OWbShopBase oWbShopBase)
     {
@@ -48,20 +49,20 @@ public class OWbShopBaseController extends BaseController
     /**
      * 导出商户门店基本信息列表
      */
-    @PreAuthorize("@ss.hasPermi('biz:shopbase:export')")
+    @PreAuthorize("@ss.hasPermi('biz:shopBase:export')")
     @Log(title = "商户门店基本信息", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(OWbShopBase oWbShopBase)
     {
         List<OWbShopBase> list = oWbShopBaseService.selectOWbShopBaseList(oWbShopBase);
         ExcelUtil<OWbShopBase> util = new ExcelUtil<OWbShopBase>(OWbShopBase.class);
-        return util.exportExcel(list, "shopbase");
+        return util.exportExcel(list, "shopBase");
     }
 
     /**
      * 获取商户门店基本信息详细信息
      */
-    @PreAuthorize("@ss.hasPermi('biz:shopbase:query')")
+    @PreAuthorize("@ss.hasPermi('biz:shopBase:query')")
     @GetMapping(value = "/{shopSn}")
     public AjaxResult getInfo(@PathVariable("shopSn") String shopSn)
     {
@@ -71,7 +72,7 @@ public class OWbShopBaseController extends BaseController
     /**
      * 新增商户门店基本信息
      */
-    @PreAuthorize("@ss.hasPermi('biz:shopbase:add')")
+    @PreAuthorize("@ss.hasPermi('biz:shopBase:add')")
     @Log(title = "商户门店基本信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody OWbShopBase oWbShopBase)
@@ -82,7 +83,7 @@ public class OWbShopBaseController extends BaseController
     /**
      * 修改商户门店基本信息
      */
-    @PreAuthorize("@ss.hasPermi('biz:shopbase:edit')")
+    @PreAuthorize("@ss.hasPermi('biz:shopBase:edit')")
     @Log(title = "商户门店基本信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody OWbShopBase oWbShopBase)
@@ -93,7 +94,7 @@ public class OWbShopBaseController extends BaseController
     /**
      * 删除商户门店基本信息
      */
-    @PreAuthorize("@ss.hasPermi('biz:shopbase:remove')")
+    @PreAuthorize("@ss.hasPermi('biz:shopBase:remove')")
     @Log(title = "商户门店基本信息", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{shopSns}")
     public AjaxResult remove(@PathVariable String[] shopSns)

+ 61 - 40
eccs-biz/src/main/java/com/emato/biz/domain/warehouse/OWbShopBase.java → eccs-biz/src/main/java/com/emato/biz/domain/store/OWbShopBase.java

@@ -1,4 +1,4 @@
-package com.emato.biz.domain.warehouse;
+package com.emato.biz.domain.store;
 
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -9,15 +9,16 @@ import com.emato.common.core.domain.BaseEntity;
 
 /**
  * 商户门店基本信息对象 o_wb_shop_base
- *
- * @author scott
- * @date 2021-02-01
+ * 
+ * @author admin
+ * @date 2023-04-23
  */
 public class OWbShopBase extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 
     /** 门店编号 */
+    @Excel(name = "门店编号")
     private String shopSn;
 
     /** 商户编号 */
@@ -28,6 +29,10 @@ public class OWbShopBase extends BaseEntity
     @Excel(name = "商户名称")
     private String merchName;
 
+    /** 三方商户号 */
+    @Excel(name = "三方商户号")
+    private String thirdMerchSn;
+
     /** 商户渠道代码 */
     private String merchChnlCode;
 
@@ -43,21 +48,27 @@ public class OWbShopBase extends BaseEntity
     private String shopName;
 
     /** 门店所在省 */
+    @Excel(name = "门店所在省")
     private String shopProvince;
 
     /** 门店所在市 */
+    @Excel(name = "门店所在市")
     private String shopCity;
 
     /** 门店所在区县 */
+    @Excel(name = "门店所在区县")
     private String shopDistrict;
 
     /** 门店详细地址 */
+    @Excel(name = "门店详细地址")
     private String shopAddress;
 
     /** 联系人 */
+    @Excel(name = "联系人")
     private String shopContactName;
 
     /** 联系人电话 */
+    @Excel(name = "联系人电话")
     private String shopContactTel;
 
     /** 是否有效,0:有效,1:无效 */
@@ -76,165 +87,174 @@ public class OWbShopBase extends BaseEntity
     /** 时间戳 */
     private Date tstm;
 
-    public void setShopSn(String shopSn)
+    public void setShopSn(String shopSn) 
     {
         this.shopSn = shopSn;
     }
 
-    public String getShopSn()
+    public String getShopSn() 
     {
         return shopSn;
     }
-    public void setMerchSn(String merchSn)
+    public void setMerchSn(String merchSn) 
     {
         this.merchSn = merchSn;
     }
 
-    public String getMerchSn()
+    public String getMerchSn() 
     {
         return merchSn;
     }
-    public void setMerchName(String merchName)
+    public void setMerchName(String merchName) 
     {
         this.merchName = merchName;
     }
 
-    public String getMerchName()
+    public String getMerchName() 
     {
         return merchName;
     }
-    public void setMerchChnlCode(String merchChnlCode)
+    public void setThirdMerchSn(String thirdMerchSn) 
+    {
+        this.thirdMerchSn = thirdMerchSn;
+    }
+
+    public String getThirdMerchSn() 
+    {
+        return thirdMerchSn;
+    }
+    public void setMerchChnlCode(String merchChnlCode) 
     {
         this.merchChnlCode = merchChnlCode;
     }
 
-    public String getMerchChnlCode()
+    public String getMerchChnlCode() 
     {
         return merchChnlCode;
     }
-    public void setMerchChnlName(String merchChnlName)
+    public void setMerchChnlName(String merchChnlName) 
     {
         this.merchChnlName = merchChnlName;
     }
 
-    public String getMerchChnlName()
+    public String getMerchChnlName() 
     {
         return merchChnlName;
     }
-    public void setShopCode(String shopCode)
+    public void setShopCode(String shopCode) 
     {
         this.shopCode = shopCode;
     }
 
-    public String getShopCode()
+    public String getShopCode() 
     {
         return shopCode;
     }
-    public void setShopName(String shopName)
+    public void setShopName(String shopName) 
     {
         this.shopName = shopName;
     }
 
-    public String getShopName()
+    public String getShopName() 
     {
         return shopName;
     }
-    public void setShopProvince(String shopProvince)
+    public void setShopProvince(String shopProvince) 
     {
         this.shopProvince = shopProvince;
     }
 
-    public String getShopProvince()
+    public String getShopProvince() 
     {
         return shopProvince;
     }
-    public void setShopCity(String shopCity)
+    public void setShopCity(String shopCity) 
     {
         this.shopCity = shopCity;
     }
 
-    public String getShopCity()
+    public String getShopCity() 
     {
         return shopCity;
     }
-    public void setShopDistrict(String shopDistrict)
+    public void setShopDistrict(String shopDistrict) 
     {
         this.shopDistrict = shopDistrict;
     }
 
-    public String getShopDistrict()
+    public String getShopDistrict() 
     {
         return shopDistrict;
     }
-    public void setShopAddress(String shopAddress)
+    public void setShopAddress(String shopAddress) 
     {
         this.shopAddress = shopAddress;
     }
 
-    public String getShopAddress()
+    public String getShopAddress() 
     {
         return shopAddress;
     }
-    public void setShopContactName(String shopContactName)
+    public void setShopContactName(String shopContactName) 
     {
         this.shopContactName = shopContactName;
     }
 
-    public String getShopContactName()
+    public String getShopContactName() 
     {
         return shopContactName;
     }
-    public void setShopContactTel(String shopContactTel)
+    public void setShopContactTel(String shopContactTel) 
     {
         this.shopContactTel = shopContactTel;
     }
 
-    public String getShopContactTel()
+    public String getShopContactTel() 
     {
         return shopContactTel;
     }
-    public void setIsValid(String isValid)
+    public void setIsValid(String isValid) 
     {
         this.isValid = isValid;
     }
 
-    public String getIsValid()
+    public String getIsValid() 
     {
         return isValid;
     }
-    public void setCreaterSn(String createrSn)
+    public void setCreaterSn(String createrSn) 
     {
         this.createrSn = createrSn;
     }
 
-    public String getCreaterSn()
+    public String getCreaterSn() 
     {
         return createrSn;
     }
-    public void setModerSn(String moderSn)
+    public void setModerSn(String moderSn) 
     {
         this.moderSn = moderSn;
     }
 
-    public String getModerSn()
+    public String getModerSn() 
     {
         return moderSn;
     }
-    public void setModTime(Date modTime)
+    public void setModTime(Date modTime) 
     {
         this.modTime = modTime;
     }
 
-    public Date getModTime()
+    public Date getModTime() 
     {
         return modTime;
     }
-    public void setTstm(Date tstm)
+    public void setTstm(Date tstm) 
     {
         this.tstm = tstm;
     }
 
-    public Date getTstm()
+    public Date getTstm() 
     {
         return tstm;
     }
@@ -245,6 +265,7 @@ public class OWbShopBase extends BaseEntity
             .append("shopSn", getShopSn())
             .append("merchSn", getMerchSn())
             .append("merchName", getMerchName())
+            .append("thirdMerchSn", getThirdMerchSn())
             .append("merchChnlCode", getMerchChnlCode())
             .append("merchChnlName", getMerchChnlName())
             .append("shopCode", getShopCode())

+ 13 - 12
eccs-biz/src/main/java/com/emato/biz/mapper/warehouse/OWbShopBaseMapper.java → eccs-biz/src/main/java/com/emato/biz/mapper/store/OWbShopBaseMapper.java

@@ -1,19 +1,20 @@
-package com.emato.biz.mapper.warehouse;
+package com.emato.biz.mapper.store;
+
+import com.emato.biz.domain.store.OWbShopBase;
 
 import java.util.List;
-import com.emato.biz.domain.warehouse.OWbShopBase;
 
 /**
  * 商户门店基本信息Mapper接口
- *
- * @author scott
- * @date 2021-02-01
+ * 
+ * @author admin
+ * @date 2023-04-23
  */
-public interface OWbShopBaseMapper
+public interface OWbShopBaseMapper 
 {
     /**
      * 查询商户门店基本信息
-     *
+     * 
      * @param shopSn 商户门店基本信息ID
      * @return 商户门店基本信息
      */
@@ -21,7 +22,7 @@ public interface OWbShopBaseMapper
 
     /**
      * 查询商户门店基本信息列表
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 商户门店基本信息集合
      */
@@ -29,7 +30,7 @@ public interface OWbShopBaseMapper
 
     /**
      * 新增商户门店基本信息
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 结果
      */
@@ -37,7 +38,7 @@ public interface OWbShopBaseMapper
 
     /**
      * 修改商户门店基本信息
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 结果
      */
@@ -45,7 +46,7 @@ public interface OWbShopBaseMapper
 
     /**
      * 删除商户门店基本信息
-     *
+     * 
      * @param shopSn 商户门店基本信息ID
      * @return 结果
      */
@@ -53,7 +54,7 @@ public interface OWbShopBaseMapper
 
     /**
      * 批量删除商户门店基本信息
-     *
+     * 
      * @param shopSns 需要删除的数据ID
      * @return 结果
      */

+ 7 - 0
eccs-biz/src/main/java/com/emato/biz/mapper/warehouse/WbMerchShopInveMapper.java

@@ -29,4 +29,11 @@ public interface WbMerchShopInveMapper {
      */
     void saveOrUpdate(OWbMerchShopInve oWbMerchShopInve);
 
+    /**
+     * 根据门店列表查询门店库存
+     *
+     * @param shopSnList
+     * @return
+     */
+    List<OWbMerchShopInve> selectShopInveByShopSnList(List<String> shopSnList);
 }

+ 44 - 25
eccs-biz/src/main/java/com/emato/biz/service/impl/OWbInveMngServiceImpl.java

@@ -2,15 +2,17 @@ package com.emato.biz.service.impl;
 
 import java.io.IOException;
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
 
+import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpRequest;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.emato.biz.config.OmsConfig;
+import com.emato.biz.domain.OutRequest;
 import com.emato.biz.domain.merchant.MerchUser;
 import com.emato.biz.domain.merchant.ThirdMerchantBiz;
 import com.emato.biz.domain.warehouse.Page;
@@ -21,6 +23,7 @@ import com.emato.biz.mapper.warehouse.WbInveMngMapper;
 import com.emato.biz.util.JsonUtil;
 import com.emato.biz.util.OmsDataUtil;
 import com.emato.biz.util.RoleUtils;
+import com.emato.common.core.Result;
 import com.emato.common.core.domain.AjaxResult;
 import com.emato.common.core.domain.entity.SysUser;
 import com.emato.common.exception.ServiceException;
@@ -37,7 +40,6 @@ import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.emato.biz.mapper.warehouse.OWbInveMngMapper;
@@ -81,27 +83,19 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
      */
     @Override
     public AjaxResult pullInveMng(PullInveQueryVO queryVO) {
-        // 声明处理数量
-        AtomicInteger rows = new AtomicInteger(0);
         // 声明页数
         int page = 1;
-        queryVO.setPage(page);
-        queryVO.setLimit(10);
-
-        ThirdMerchantBiz merchantBiz = thirdMerchantBizMapper.selectByClientMerchSn(queryVO.getMerchId());
-        if (Objects.nonNull(merchantBiz)) {
-            queryVO.setThirdMerchId(merchantBiz.getThirdMerchSn());
-        }
-
+        // 处理查询参数
+        setQueryVO(queryVO, page, OmsConfig.getQuerySize());
 
+        // 声明处理数量
+        AtomicInteger rows = new AtomicInteger(0);
         // 查询 OMS 分页数据
         Optional<Page<OWbInveMng>> firstPageOpt =
                 OmsDataUtil.fetchOmsPageData(queryVO, OmsConfig.getQueryMngInveUrl(), OWbInveMng.class);
 
         // 如果有数据
-        /*firstPageOpt.ifPresent(firstPage -> {
-            // 如果有数据,开始批量处理
-            firstPage.getList().forEach(obj -> log.debug("拉取的 sku => {}", obj.getSku()));
+        firstPageOpt.ifPresent(firstPage -> {
             // 插入数据库
             firstPage.getList().stream().forEach(obj -> {
                 // 插入数据库
@@ -110,9 +104,7 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
                 rows.getAndIncrement();
             });
 
-            List<CompletableFuture<Void>> tasks = new ArrayList<>();
-
-            for(int pageNum = 2; pageNum <= firstPage.getTotalPage(); pageNum++) {
+            for(int pageNum = page + 1; pageNum <= firstPage.getTotalPage(); pageNum++) {
                 log.debug("当前拉取的页数 => {}", pageNum);
                 queryVO.setPage(pageNum);
                 // 分页拉取远程数据
@@ -121,15 +113,9 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
                     wbInveMngMapper.saveOrUpdate(obj);
                     rows.getAndIncrement();
                 });
-                // 查询 OMS 数据
-                CompletableFuture<Void> task = CompletableFuture.runAsync(() -> {
-                }, threadPoolExecutor);
-                // 将任务添加到列表中
-                tasks.add(task);
             }
-            CompletableFuture.allOf(tasks.toArray(new CompletableFuture[0])).join();
 
-        });*/
+        });
 
         log.debug("拉取库存成功,拉取数据条数 => {}", rows.get());
         return AjaxResult.success("拉取库存成功!");
@@ -156,6 +142,7 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
     @Override
     public List<OWbInveMng> selectOWbInveMngList(OWbInveMng oWbInveMng)
     {
+        // 获取登录用户
         SysUser user = SecurityUtils.getLoginUser().getUser();
         boolean allRole = RoleUtils.isAllRole(user);
 
@@ -421,4 +408,36 @@ public class OWbInveMngServiceImpl implements IOWbInveMngService
         return Optional.empty();
     }
 
+    /**
+     * 处理查询参数
+     *
+     * @param queryVO
+     * @param page
+     * @param limit
+     */
+    private void setQueryVO(PullInveQueryVO queryVO, int page, int limit) {
+        queryVO.setPage(page);
+        queryVO.setLimit(limit);
+
+        // 查询是否是三方商户
+        ThirdMerchantBiz thirdMerchantBiz = thirdMerchantBizMapper.selectByClientMerchSn(queryVO.getMerchId());
+        if (Objects.nonNull(thirdMerchantBiz)) {
+            // 如果是三方商户,查询条件加入三方商户
+            queryVO.setThirdMerchId(thirdMerchantBiz.getThirdMerchSn());
+        }
+
+        // 将 sku 变成 skuSet 参数
+        if (StrUtil.isNotBlank(queryVO.getSku())) {
+            List<String> skus = StrUtil.split(queryVO.getSku(), ",");
+            Set<String> skuSet = skus.stream().collect(Collectors.toSet());
+            queryVO.setSkuSets(skuSet);
+        }
+
+        // 将门店编号转为门店列表
+        if (StrUtil.isNotBlank(queryVO.getShopSn())) {
+            List<String> shopList = StrUtil.split(queryVO.getShopSn(), ",");
+            queryVO.setShopSnList(shopList);
+        }
+    }
+
 }

+ 61 - 6
eccs-biz/src/main/java/com/emato/biz/service/impl/OWbMerchShopInveServiceImpl.java

@@ -1,7 +1,6 @@
 package com.emato.biz.service.impl;
 
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
@@ -10,25 +9,28 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.emato.biz.config.OmsConfig;
+import com.emato.biz.domain.merchant.MerchUser;
 import com.emato.biz.domain.merchant.ThirdMerchantBiz;
-import com.emato.biz.domain.warehouse.OWbInveMng;
-import com.emato.biz.domain.warehouse.Page;
-import com.emato.biz.domain.warehouse.PullInveQueryVO;
+import com.emato.biz.domain.store.OWbShopBase;
+import com.emato.biz.domain.warehouse.*;
+import com.emato.biz.mapper.merchant.MerchUserMapper;
 import com.emato.biz.mapper.merchant.ThirdMerchantBizMapper;
+import com.emato.biz.mapper.store.OWbShopBaseMapper;
 import com.emato.biz.mapper.warehouse.WbMerchShopInveMapper;
 import com.emato.biz.util.OmsDataUtil;
+import com.emato.biz.util.RoleUtils;
 import com.emato.common.core.domain.AjaxResult;
+import com.emato.common.core.domain.entity.SysUser;
 import com.emato.common.exception.ServiceException;
 import com.emato.common.utils.DateUtils;
+import com.emato.common.utils.SecurityUtils;
 import com.emato.common.utils.oms.request.OkHttpUtils;
 import com.emato.common.utils.oms.request.OmsSign;
 import okhttp3.Request;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.emato.biz.mapper.warehouse.OWbMerchShopInveMapper;
-import com.emato.biz.domain.warehouse.OWbMerchShopInve;
 import com.emato.biz.service.warehouse.IOWbMerchShopInveService;
 
 import javax.annotation.Resource;
@@ -51,6 +53,12 @@ public class OWbMerchShopInveServiceImpl implements IOWbMerchShopInveService
     @Resource
     private ThirdMerchantBizMapper thirdMerchantBizMapper;
 
+    @Resource
+    private MerchUserMapper merchUserMapper;
+
+    @Resource
+    private OWbShopBaseMapper oWbShopBaseMapper;
+
     private static final Logger log = LoggerFactory.getLogger(OWbMerchShopInveServiceImpl.class);
 
 
@@ -125,6 +133,38 @@ public class OWbMerchShopInveServiceImpl implements IOWbMerchShopInveService
     @Override
     public List<OWbMerchShopInve> selectOWbMerchShopInveList(OWbMerchShopInve oWbMerchShopInve)
     {
+        // 获取登录用户
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        boolean allRole = RoleUtils.isAllRole(user);
+
+        if (!allRole) {
+            // 如果没有全部数据权限
+            // 查询该用户属于哪个商户
+            MerchUser merchUser = merchUserMapper.selectMerchUserByUserId(user.getUserId()+"");
+            if (Objects.isNull(merchUser)) {
+                // 如果用户没有绑定商户就返回空数据
+                return Collections.emptyList();
+            }
+
+            // 获取用户绑定的商户号,开始查询该商户的库存数据
+            String merchSn = merchUser.getMerchSn();
+            // 查询是否是个第三方商户
+            ThirdMerchantBiz merchantBiz = thirdMerchantBizMapper.selectByClientMerchSn(merchSn);
+            if (Objects.nonNull(merchantBiz)) {
+                // 如果是第三方商户
+                OWbShopBase queryParam = new OWbShopBase();
+                queryParam.setThirdMerchSn(merchantBiz.getThirdMerchSn());
+                // 根据门店查询门店库存
+                return getShopInveByShopQuery(queryParam);
+            }else {
+                // 如果没有三方商户,代表是个一方商户,查询一方商户门店
+                OWbShopBase queryParam = new OWbShopBase();
+                queryParam.setMerchSn(merchSn);
+                // 根据门店查询门店库存
+                return getShopInveByShopQuery(queryParam);
+            }
+        }
+
         return wbMerchShopInveMapper.selectWbMerchShopInveList(oWbMerchShopInve);
     }
 
@@ -284,4 +324,19 @@ public class OWbMerchShopInveServiceImpl implements IOWbMerchShopInveService
             queryVO.setShopSnList(shopList);
         }
     }
+
+    /**
+     * 根据门店查询条件获取门店库存
+     *
+     * @param queryParam
+     * @return
+     */
+    private List<OWbMerchShopInve> getShopInveByShopQuery(OWbShopBase queryParam) {
+        // 查询这个第三方商户下的门店
+        List<OWbShopBase> oWbShopBases = oWbShopBaseMapper.selectOWbShopBaseList(queryParam);
+        // 返回门店号集合
+        List<String> shopSnList = oWbShopBases.stream().map(OWbShopBase::getShopSn).collect(Collectors.toList());
+        // 根据门店号查询门店库存
+        return wbMerchShopInveMapper.selectShopInveByShopSnList(shopSnList);
+    }
 }

+ 16 - 13
eccs-biz/src/main/java/com/emato/biz/service/impl/OWbShopBaseServiceImpl.java

@@ -1,28 +1,31 @@
 package com.emato.biz.service.impl;
 
 import java.util.List;
+
+import com.emato.biz.domain.store.OWbShopBase;
+import com.emato.biz.mapper.store.OWbShopBaseMapper;
+import com.emato.biz.service.store.IOWbShopBaseService;
 import com.emato.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.emato.biz.mapper.warehouse.OWbShopBaseMapper;
-import com.emato.biz.domain.warehouse.OWbShopBase;
-import com.emato.biz.service.warehouse.IOWbShopBaseService;
+
+import javax.annotation.Resource;
 
 /**
  * 商户门店基本信息Service业务层处理
- *
- * @author yangbo
- * @date 2021-02-01
+ * 
+ * @author admin
+ * @date 2023-04-23
  */
 @Service
 public class OWbShopBaseServiceImpl implements IOWbShopBaseService
 {
-    @Autowired
+    @Resource
     private OWbShopBaseMapper oWbShopBaseMapper;
 
     /**
      * 查询商户门店基本信息
-     *
+     * 
      * @param shopSn 商户门店基本信息ID
      * @return 商户门店基本信息
      */
@@ -34,7 +37,7 @@ public class OWbShopBaseServiceImpl implements IOWbShopBaseService
 
     /**
      * 查询商户门店基本信息列表
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 商户门店基本信息
      */
@@ -46,7 +49,7 @@ public class OWbShopBaseServiceImpl implements IOWbShopBaseService
 
     /**
      * 新增商户门店基本信息
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 结果
      */
@@ -59,7 +62,7 @@ public class OWbShopBaseServiceImpl implements IOWbShopBaseService
 
     /**
      * 修改商户门店基本信息
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 结果
      */
@@ -71,7 +74,7 @@ public class OWbShopBaseServiceImpl implements IOWbShopBaseService
 
     /**
      * 批量删除商户门店基本信息
-     *
+     * 
      * @param shopSns 需要删除的商户门店基本信息ID
      * @return 结果
      */
@@ -83,7 +86,7 @@ public class OWbShopBaseServiceImpl implements IOWbShopBaseService
 
     /**
      * 删除商户门店基本信息信息
-     *
+     * 
      * @param shopSn 商户门店基本信息ID
      * @return 结果
      */

+ 13 - 12
eccs-biz/src/main/java/com/emato/biz/service/warehouse/IOWbShopBaseService.java → eccs-biz/src/main/java/com/emato/biz/service/store/IOWbShopBaseService.java

@@ -1,19 +1,20 @@
-package com.emato.biz.service.warehouse;
+package com.emato.biz.service.store;
+
+import com.emato.biz.domain.store.OWbShopBase;
 
 import java.util.List;
-import com.emato.biz.domain.warehouse.OWbShopBase;
 
 /**
  * 商户门店基本信息Service接口
- *
- * @author scott
- * @date 2021-02-01
+ * 
+ * @author admin
+ * @date 2023-04-23
  */
-public interface IOWbShopBaseService
+public interface IOWbShopBaseService 
 {
     /**
      * 查询商户门店基本信息
-     *
+     * 
      * @param shopSn 商户门店基本信息ID
      * @return 商户门店基本信息
      */
@@ -21,7 +22,7 @@ public interface IOWbShopBaseService
 
     /**
      * 查询商户门店基本信息列表
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 商户门店基本信息集合
      */
@@ -29,7 +30,7 @@ public interface IOWbShopBaseService
 
     /**
      * 新增商户门店基本信息
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 结果
      */
@@ -37,7 +38,7 @@ public interface IOWbShopBaseService
 
     /**
      * 修改商户门店基本信息
-     *
+     * 
      * @param oWbShopBase 商户门店基本信息
      * @return 结果
      */
@@ -45,7 +46,7 @@ public interface IOWbShopBaseService
 
     /**
      * 批量删除商户门店基本信息
-     *
+     * 
      * @param shopSns 需要删除的商户门店基本信息ID
      * @return 结果
      */
@@ -53,7 +54,7 @@ public interface IOWbShopBaseService
 
     /**
      * 删除商户门店基本信息信息
-     *
+     * 
      * @param shopSn 商户门店基本信息ID
      * @return 结果
      */

+ 30 - 17
eccs-biz/src/main/resources/mapper/biz/warehouse/OWbShopBaseMapper.xml → eccs-biz/src/main/resources/mapper/biz/store/OWbShopBaseMapper.xml

@@ -2,12 +2,13 @@
 <!DOCTYPE mapper
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.emato.biz.mapper.warehouse.OWbShopBaseMapper">
-
-    <resultMap type="OWbShopBase" id="OWbShopBaseResult">
+<mapper namespace="com.emato.biz.mapper.store.OWbShopBaseMapper">
+    
+    <resultMap type="com.emato.biz.domain.store.OWbShopBase" id="OWbShopBaseResult">
         <result property="shopSn"    column="shop_sn"    />
         <result property="merchSn"    column="merch_sn"    />
         <result property="merchName"    column="merch_name"    />
+        <result property="thirdMerchSn"    column="third_merch_sn"    />
         <result property="merchChnlCode"    column="merch_chnl_code"    />
         <result property="merchChnlName"    column="merch_chnl_name"    />
         <result property="shopCode"    column="shop_code"    />
@@ -27,31 +28,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectOWbShopBaseVo">
-        select shop_sn, merch_sn, merch_name, merch_chnl_code, merch_chnl_name, shop_code, shop_name, shop_province, shop_city, shop_district, shop_address, shop_contact_name, shop_contact_tel, is_valid, creater_sn, create_time, moder_sn, mod_time, tstm from o_wb_shop_base
+        select shop_sn, merch_sn, merch_name, third_merch_sn, merch_chnl_code, merch_chnl_name, shop_code, shop_name, shop_province, shop_city, shop_district, shop_address, shop_contact_name, shop_contact_tel, is_valid, creater_sn, create_time, moder_sn, mod_time, tstm from o_wb_shop_base
     </sql>
 
-    <select id="selectOWbShopBaseList" parameterType="OWbShopBase" resultMap="OWbShopBaseResult">
+    <select id="selectOWbShopBaseList" parameterType="com.emato.biz.domain.store.OWbShopBase" resultMap="OWbShopBaseResult">
         <include refid="selectOWbShopBaseVo"/>
         <where>
+            <if test="shopSn != null  and shopSn != ''"> and shop_sn = #{shopSn}</if>
             <if test="merchSn != null  and merchSn != ''"> and merch_sn = #{merchSn}</if>
             <if test="merchName != null  and merchName != ''"> and merch_name like concat('%', #{merchName}, '%')</if>
+            <if test="thirdMerchSn != null  and thirdMerchSn != ''"> and third_merch_sn = #{thirdMerchSn}</if>
+            <if test="thirdMerchSn == null and thirdMerchSn == ''"> and third_merch_sn IS NULL</if>
             <if test="shopCode != null  and shopCode != ''"> and shop_code = #{shopCode}</if>
             <if test="shopName != null  and shopName != ''"> and shop_name like concat('%', #{shopName}, '%')</if>
+            <if test="shopProvince != null  and shopProvince != ''"> and shop_province = #{shopProvince}</if>
+            <if test="shopCity != null  and shopCity != ''"> and shop_city = #{shopCity}</if>
+            <if test="shopDistrict != null  and shopDistrict != ''"> and shop_district = #{shopDistrict}</if>
+            <if test="shopAddress != null  and shopAddress != ''"> and shop_address = #{shopAddress}</if>
+            <if test="shopContactName != null  and shopContactName != ''"> and shop_contact_name like concat('%', #{shopContactName}, '%')</if>
+            <if test="shopContactTel != null  and shopContactTel != ''"> and shop_contact_tel = #{shopContactTel}</if>
             <if test="isValid != null  and isValid != ''"> and is_valid = #{isValid}</if>
         </where>
     </select>
-
+    
     <select id="selectOWbShopBaseById" parameterType="String" resultMap="OWbShopBaseResult">
         <include refid="selectOWbShopBaseVo"/>
         where shop_sn = #{shopSn}
     </select>
-
-    <insert id="insertOWbShopBase" parameterType="OWbShopBase">
+        
+    <insert id="insertOWbShopBase" parameterType="com.emato.biz.domain.store.OWbShopBase">
         insert into o_wb_shop_base
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="shopSn != null">shop_sn,</if>
-            <if test="merchSn != null">merch_sn,</if>
+            <if test="shopSn != null and shopSn != ''">shop_sn,</if>
+            <if test="merchSn != null and merchSn != ''">merch_sn,</if>
             <if test="merchName != null">merch_name,</if>
+            <if test="thirdMerchSn != null">third_merch_sn,</if>
             <if test="merchChnlCode != null">merch_chnl_code,</if>
             <if test="merchChnlName != null">merch_chnl_name,</if>
             <if test="shopCode != null">shop_code,</if>
@@ -70,9 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tstm != null">tstm,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="shopSn != null">#{shopSn},</if>
-            <if test="merchSn != null">#{merchSn},</if>
+            <if test="shopSn != null and shopSn != ''">#{shopSn},</if>
+            <if test="merchSn != null and merchSn != ''">#{merchSn},</if>
             <if test="merchName != null">#{merchName},</if>
+            <if test="thirdMerchSn != null">#{thirdMerchSn},</if>
             <if test="merchChnlCode != null">#{merchChnlCode},</if>
             <if test="merchChnlName != null">#{merchChnlName},</if>
             <if test="shopCode != null">#{shopCode},</if>
@@ -92,11 +104,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
-    <update id="updateOWbShopBase" parameterType="OWbShopBase">
+    <update id="updateOWbShopBase" parameterType="com.emato.biz.domain.store.OWbShopBase">
         update o_wb_shop_base
         <trim prefix="SET" suffixOverrides=",">
-            <if test="merchSn != null">merch_sn = #{merchSn},</if>
+            <if test="merchSn != null and merchSn != ''">merch_sn = #{merchSn},</if>
             <if test="merchName != null">merch_name = #{merchName},</if>
+            <if test="thirdMerchSn != null">third_merch_sn = #{thirdMerchSn},</if>
             <if test="merchChnlCode != null">merch_chnl_code = #{merchChnlCode},</if>
             <if test="merchChnlName != null">merch_chnl_name = #{merchChnlName},</if>
             <if test="shopCode != null">shop_code = #{shopCode},</if>
@@ -122,10 +135,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteOWbShopBaseByIds" parameterType="String">
-        delete from o_wb_shop_base where shop_sn in
+        delete from o_wb_shop_base where shop_sn in 
         <foreach item="shopSn" collection="array" open="(" separator="," close=")">
             #{shopSn}
         </foreach>
     </delete>
-
-</mapper>
+    
+</mapper>

+ 13 - 0
eccs-biz/src/main/resources/mapper/biz/warehouse/WbMerchShopInveMapper.xml

@@ -202,4 +202,17 @@
         </trim>
     </insert>
 
+    <!-- 根据门店列表查询门店库存 -->
+    <select id="selectShopInveByShopSnList" resultMap="OWbMerchShopInveResult">
+        SELECT
+            <include refid="selectWbMerchShopInveColumn"/>
+        FROM
+            wb_merch_shop_inve t
+        WHERE
+            t.shop_sn IN
+        <foreach collection="shopSnList" item="shopSn" open="(" separator="," close=")">
+            #{shopSn}
+        </foreach>
+    </select>
+
 </mapper>

+ 42 - 42
eccs-biz/src/main/resources/oms-config.yml

@@ -13,64 +13,64 @@ oms:
   md5Salt: IxyIvP0sJqlUZinx
 
 
-  #==================== 开发环境 ws.ds-bay.com ====================
-  # 查询商户信息接口
-  queryMerchantInfoUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryMerchantInfoUrl
-  # 查询第三方商户信息接口
-  queryThirdMerchantInfoUrl:
-  # 查询库存接口
-  #queryMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryInveMng
-  queryMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryWbInve
-  # 查询门店库存接口
-  #queryShopMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopInveMng
-  queryShopMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryWbShopInve
-  # 查询入库单接口
-  queryInveReceiptUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryInveReceiptGoods
-  # 查询入库单明细接口
-  queryInveReceiptDetailUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryInveReceiptGoods
-  # 查询结转接口
-  queryAdjustmentUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryAdjustmentRecord
-  # 查询结转明细接口
-  queryAdjustmentDetailUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryAdjustmentDetail
-  # 查询出区接口
-  queryInveShipmentUrl:
-  # 查询出区明细接口
-  queryInveShipmentDetailUrl:
-  # 查询门店进货接口
-  queryShopInUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopIn
-  # 查询门店出场接口
-  queryShopOutUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopOut
-  # 查询门店转移接口
-  queryShopMoveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopMove
-
-
-#  #==================== 测试环境 ws.ds-bay.com ====================
+#  #==================== 开发环境 ws.ds-bay.com ====================
 #  # 查询商户信息接口
-#  queryMerchantInfoUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryMerchantInfoUrl
+#  queryMerchantInfoUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryMerchantInfoUrl
 #  # 查询第三方商户信息接口
 #  queryThirdMerchantInfoUrl:
 #  # 查询库存接口
-#  queryMngInveUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryInveMng
+#  #queryMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryInveMng
+#  queryMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryWbInve
 #  # 查询门店库存接口
-#  queryShopMngInveUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopInveMng
+#  #queryShopMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopInveMng
+#  queryShopMngInveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryWbShopInve
 #  # 查询入库单接口
-#  queryInveReceiptUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryInveReceiptGoods
+#  queryInveReceiptUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryInveReceiptGoods
 #  # 查询入库单明细接口
-#  queryInveReceiptDetailUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryInveReceiptGoods
+#  queryInveReceiptDetailUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryInveReceiptGoods
 #  # 查询结转接口
-#  queryAdjustmentUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryAdjustmentRecord
+#  queryAdjustmentUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryAdjustmentRecord
 #  # 查询结转明细接口
-#  queryAdjustmentDetailUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryAdjustmentDetail
+#  queryAdjustmentDetailUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryAdjustmentDetail
 #  # 查询出区接口
 #  queryInveShipmentUrl:
 #  # 查询出区明细接口
 #  queryInveShipmentDetailUrl:
 #  # 查询门店进货接口
-#  queryShopInUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopIn
+#  queryShopInUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopIn
 #  # 查询门店出场接口
-#  queryShopOutUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopOut
+#  queryShopOutUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopOut
 #  # 查询门店转移接口
-#  queryShopMoveUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopMove
+#  queryShopMoveUrl: http://127.0.0.1:8086/al/queryOmsInfo/queryShopMove
+
+
+  #==================== 测试环境 ws.ds-bay.com ====================
+  # 查询商户信息接口
+  queryMerchantInfoUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryMerchantInfoUrl
+  # 查询第三方商户信息接口
+  queryThirdMerchantInfoUrl:
+  # 查询库存接口
+  queryMngInveUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryInveMng
+  # 查询门店库存接口
+  queryShopMngInveUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopInveMng
+  # 查询入库单接口
+  queryInveReceiptUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryInveReceiptGoods
+  # 查询入库单明细接口
+  queryInveReceiptDetailUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryInveReceiptGoods
+  # 查询结转接口
+  queryAdjustmentUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryAdjustmentRecord
+  # 查询结转明细接口
+  queryAdjustmentDetailUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryAdjustmentDetail
+  # 查询出区接口
+  queryInveShipmentUrl:
+  # 查询出区明细接口
+  queryInveShipmentDetailUrl:
+  # 查询门店进货接口
+  queryShopInUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopIn
+  # 查询门店出场接口
+  queryShopOutUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopOut
+  # 查询门店转移接口
+  queryShopMoveUrl: http://183.3.221.143:8086/al/queryOmsInfo/queryShopMove
 
 
 #  #==================== 生产环境 ws.ds-bay.com ====================

+ 12 - 12
eccs-ui/src/api/warehouse/shopbase.js → eccs-ui/src/api/store/shopBase.js

@@ -1,52 +1,52 @@
 import request from '@/utils/request'
 
 // 查询商户门店基本信息列表
-export function listShopbase(query) {
+export function listShopBase(query) {
   return request({
-    url: '/biz/shopbase/list',
+    url: '/biz/shopBase/list',
     method: 'get',
     params: query
   })
 }
 
 // 查询商户门店基本信息详细
-export function getShopbase(shopSn) {
+export function getShopBase(shopSn) {
   return request({
-    url: '/biz/shopbase/' + shopSn,
+    url: '/biz/shopBase/' + shopSn,
     method: 'get'
   })
 }
 
 // 新增商户门店基本信息
-export function addShopbase(data) {
+export function addShopBase(data) {
   return request({
-    url: '/biz/shopbase',
+    url: '/biz/shopBase',
     method: 'post',
     data: data
   })
 }
 
 // 修改商户门店基本信息
-export function updateShopbase(data) {
+export function updateShopBase(data) {
   return request({
-    url: '/biz/shopbase',
+    url: '/biz/shopBase',
     method: 'put',
     data: data
   })
 }
 
 // 删除商户门店基本信息
-export function delShopbase(shopSn) {
+export function delShopBase(shopSn) {
   return request({
-    url: '/biz/shopbase/' + shopSn,
+    url: '/biz/shopBase/' + shopSn,
     method: 'delete'
   })
 }
 
 // 导出商户门店基本信息
-export function exportShopbase(query) {
+export function exportShopBase(query) {
   return request({
-    url: '/biz/shopbase/export',
+    url: '/biz/shopBase/export',
     method: 'get',
     params: query
   })

+ 140 - 21
eccs-ui/src/views/warehouse/shopbase/index.vue → eccs-ui/src/views/store/shopBase/index.vue

@@ -1,6 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="门店编号" prop="shopSn">
+        <el-input
+          v-model="queryParams.shopSn"
+          placeholder="请输入门店编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="商户编号" prop="merchSn">
         <el-input
           v-model="queryParams.merchSn"
@@ -19,7 +28,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="门店编码" prop="shopCode">
+      <el-form-item label="三方商户号" prop="thirdMerchSn">
+        <el-input
+          v-model="queryParams.thirdMerchSn"
+          placeholder="请输入三方商户号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!--<el-form-item label="门店编码" prop="shopCode">
         <el-input
           v-model="queryParams.shopCode"
           placeholder="请输入门店编码"
@@ -28,6 +46,51 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+       <el-form-item label="门店所在省" prop="shopProvince">
+        <el-input
+          v-model="queryParams.shopProvince"
+          placeholder="请输入门店所在省"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="门店所在市" prop="shopCity">
+        <el-input
+          v-model="queryParams.shopCity"
+          placeholder="请输入门店所在市"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="门店所在区县" prop="shopDistrict">
+        <el-input
+          v-model="queryParams.shopDistrict"
+          placeholder="请输入门店所在区县"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="联系人" prop="shopContactName">
+        <el-input
+          v-model="queryParams.shopContactName"
+          placeholder="请输入联系人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="联系人电话" prop="shopContactTel">
+        <el-input
+          v-model="queryParams.shopContactTel"
+          placeholder="请输入联系人电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item> -->
       <el-form-item label="是否有效" prop="isValid">
         <el-select v-model="queryParams.isValid" placeholder="请选择是否有效" clearable size="small">
           <el-option
@@ -51,7 +114,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['biz:shopbase:add']"
+          v-hasPermi="['biz:shopBase:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -61,7 +124,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['biz:shopbase:edit']"
+          v-hasPermi="['biz:shopBase:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -71,7 +134,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['biz:shopbase:remove']"
+          v-hasPermi="['biz:shopBase:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -80,19 +143,26 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['biz:shopbase:export']"
+          v-hasPermi="['biz:shopBase:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="shopbaseList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="shopBaseList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="门店编号" align="center" prop="shopSn" />
       <el-table-column label="商户编号" align="center" prop="merchSn" />
       <el-table-column label="商户名称" align="center" prop="merchName" />
+      <el-table-column label="三方商户号" align="center" prop="thirdMerchSn" />
       <el-table-column label="门店编码" align="center" prop="shopCode" />
       <el-table-column label="门店名称" align="center" prop="shopName" />
+      <el-table-column label="门店所在省" align="center" prop="shopProvince" />
+      <el-table-column label="门店所在市" align="center" prop="shopCity" />
+      <el-table-column label="门店所在区县" align="center" prop="shopDistrict" />
+      <el-table-column label="门店详细地址" align="center" prop="shopAddress" />
+      <el-table-column label="联系人" align="center" prop="shopContactName" />
+      <el-table-column label="联系人电话" align="center" prop="shopContactTel" />
       <el-table-column label="是否有效" align="center" prop="isValid" :formatter="isValidFormat" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -101,19 +171,19 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['biz:shopbase:edit']"
+            v-hasPermi="['biz:shopBase:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['biz:shopbase:remove']"
+            v-hasPermi="['biz:shopBase:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
-
+    
     <pagination
       v-show="total>0"
       :total="total"
@@ -125,18 +195,52 @@
     <!-- 添加或修改商户门店基本信息对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="门店编号" prop="shopSn">
+          <el-input v-model="form.merchSn" placeholder="请输入门店编号" />
+        </el-form-item>
         <el-form-item label="商户编号" prop="merchSn">
           <el-input v-model="form.merchSn" placeholder="请输入商户编号" />
         </el-form-item>
         <el-form-item label="商户名称" prop="merchName">
           <el-input v-model="form.merchName" placeholder="请输入商户名称" />
         </el-form-item>
+        <el-form-item label="三方商户号" prop="thirdMerchSn">
+          <el-input v-model="form.thirdMerchSn" placeholder="请输入三方商户号" />
+        </el-form-item>
         <el-form-item label="门店编码" prop="shopCode">
           <el-input v-model="form.shopCode" placeholder="请输入门店编码" />
         </el-form-item>
         <el-form-item label="门店名称" prop="shopName">
           <el-input v-model="form.shopName" type="textarea" placeholder="请输入内容" />
         </el-form-item>
+        <el-form-item label="门店所在省" prop="shopProvince">
+          <el-input v-model="form.shopProvince" placeholder="请输入门店所在省" />
+        </el-form-item>
+        <el-form-item label="门店所在市" prop="shopCity">
+          <el-input v-model="form.shopCity" placeholder="请输入门店所在市" />
+        </el-form-item>
+        <el-form-item label="门店所在区县" prop="shopDistrict">
+          <el-input v-model="form.shopDistrict" placeholder="请输入门店所在区县" />
+        </el-form-item>
+        <el-form-item label="门店详细地址" prop="shopAddress">
+          <el-input v-model="form.shopAddress" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="联系人" prop="shopContactName">
+          <el-input v-model="form.shopContactName" placeholder="请输入联系人" />
+        </el-form-item>
+        <el-form-item label="联系人电话" prop="shopContactTel">
+          <el-input v-model="form.shopContactTel" placeholder="请输入联系人电话" />
+        </el-form-item>
+        <el-form-item label="是否有效" prop="isValid">
+          <el-select v-model="form.isValid" placeholder="请选择是否有效">
+            <el-option
+              v-for="dict in isValidOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -147,10 +251,10 @@
 </template>
 
 <script>
-import { listShopbase, getShopbase, delShopbase, addShopbase, updateShopbase, exportShopbase } from "@/api/warehouse/shopbase";
+import { listShopBase, getShopBase, delShopBase, addShopBase, updateShopBase, exportShopBase } from "@/api/store/shopBase";
 
 export default {
-  name: "Shopbase",
+  name: "ShopBase",
   components: {
   },
   data() {
@@ -168,27 +272,41 @@ export default {
       // 总条数
       total: 0,
       // 商户门店基本信息表格数据
-      shopbaseList: [],
+      shopBaseList: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
       open: false,
-      // 是否有效字典
+      // 是否有效,0:有效,1:无效字典
       isValidOptions: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        shopSn: null,
         merchSn: null,
         merchName: null,
+        thirdMerchSn: null,
         shopCode: null,
         shopName: null,
+        shopProvince: null,
+        shopCity: null,
+        shopDistrict: null,
+        shopAddress: null,
+        shopContactName: null,
+        shopContactTel: null,
         isValid: null,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
+        shopSn: [
+          { required: true, message: "门店编号不能为空", trigger: "blur" }
+        ],
+        merchSn: [
+          { required: true, message: "商户编号不能为空", trigger: "blur" }
+        ],
       }
     };
   },
@@ -202,13 +320,13 @@ export default {
     /** 查询商户门店基本信息列表 */
     getList() {
       this.loading = true;
-      listShopbase(this.queryParams).then(response => {
-        this.shopbaseList = response.rows;
+      listShopBase(this.queryParams).then(response => {
+        this.shopBaseList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
-    // 是否有效字典翻译
+    // 是否有效,0:有效,1:无效字典翻译
     isValidFormat(row, column) {
       return this.selectDictLabel(this.isValidOptions, row.isValid);
     },
@@ -223,6 +341,7 @@ export default {
         shopSn: null,
         merchSn: null,
         merchName: null,
+        thirdMerchSn: null,
         merchChnlCode: null,
         merchChnlName: null,
         shopCode: null,
@@ -268,7 +387,7 @@ export default {
     handleUpdate(row) {
       this.reset();
       const shopSn = row.shopSn || this.ids
-      getShopbase(shopSn).then(response => {
+      getShopBase(shopSn).then(response => {
         this.form = response.data;
         this.open = true;
         this.title = "修改商户门店基本信息";
@@ -279,13 +398,13 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.shopSn != null) {
-            updateShopbase(this.form).then(response => {
+            updateShopBase(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addShopbase(this.form).then(response => {
+            addShopBase(this.form).then(response => {
               this.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -302,7 +421,7 @@ export default {
           cancelButtonText: "取消",
           type: "warning"
         }).then(function() {
-          return delShopbase(shopSns);
+          return delShopBase(shopSns);
         }).then(() => {
           this.getList();
           this.msgSuccess("删除成功");
@@ -316,7 +435,7 @@ export default {
           cancelButtonText: "取消",
           type: "warning"
         }).then(function() {
-          return exportShopbase(queryParams);
+          return exportShopBase(queryParams);
         }).then(response => {
           this.download(response.msg);
         })

+ 2 - 0
eccs-ui/src/views/warehouse/shopinve/index.vue

@@ -555,6 +555,7 @@ export default {
     /** 拉取按钮操作 */
     handlePull() {
       let queryParams = this.pullForm;
+      
       console.log("传入的拉取参数 => ", queryParams);
       // 添加遮罩
       let _this = this;
@@ -564,6 +565,7 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(function() {
+
         return pullStoreInvemng(queryParams).then(res => {
           // 关闭弹出框
           that.closePullDialog();

+ 22 - 0
sql/20230423/shopBaseMenu.sql

@@ -0,0 +1,22 @@
+-- 菜单 SQL
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('商户门店基本信息', '2290', '1', 'shopBase', 'store/shopBase/index', 1, 0, 'C', '0', '0', 'biz:shopBase:list', '#', 'admin', sysdate(), '', null, '商户门店基本信息菜单');
+
+-- 按钮父菜单ID
+SELECT @parentId := LAST_INSERT_ID();
+
+-- 按钮 SQL
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('商户门店基本信息查询', @parentId, '1',  '#', '', 1, 0, 'F', '0', '0', 'biz:shopBase:query',        '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('商户门店基本信息新增', @parentId, '2',  '#', '', 1, 0, 'F', '0', '0', 'biz:shopBase:add',          '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('商户门店基本信息修改', @parentId, '3',  '#', '', 1, 0, 'F', '0', '0', 'biz:shopBase:edit',         '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('商户门店基本信息删除', @parentId, '4',  '#', '', 1, 0, 'F', '0', '0', 'biz:shopBase:remove',       '#', 'admin', sysdate(), '', null, '');
+
+insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+values('商户门店基本信息导出', @parentId, '5',  '#', '', 1, 0, 'F', '0', '0', 'biz:shopBase:export',       '#', 'admin', sysdate(), '', null, '');