浏览代码

dada绑定

zangbin 3 年之前
父节点
当前提交
4af3c02b86
共有 21 个文件被更改,包括 1103 次插入26 次删除
  1. 9 0
      lb-module/src/main/java/com/ydd/module/dto/DadaDspWithdrawalDto.java
  2. 29 0
      lb-module/src/main/java/com/ydd/module/dto/DadaShopListDto.java
  3. 40 0
      lb-module/src/main/java/com/ydd/module/dto/DadaVerifyParamsDto.java
  4. 1 1
      lb-module/src/main/java/com/ydd/module/mapper/DadaDspWithdrawalMapper.java
  5. 4 4
      lb-module/src/main/java/com/ydd/module/mapper/ShopDeliveryMapper.java
  6. 2 2
      lb-module/src/main/java/com/ydd/module/service/IDadaDspWithdrawalService.java
  7. 3 0
      lb-module/src/main/java/com/ydd/module/service/IShopDeliveryBindService.java
  8. 3 0
      lb-module/src/main/java/com/ydd/module/service/IShopDeliveryService.java
  9. 33 4
      lb-module/src/main/java/com/ydd/module/service/impl/DadaDspWithdrawalServiceImpl.java
  10. 62 0
      lb-module/src/main/java/com/ydd/module/service/impl/ShopDeliveryBindServiceImpl.java
  11. 53 0
      lb-module/src/main/java/com/ydd/module/service/impl/ShopDeliveryServiceImpl.java
  12. 22 9
      lb-module/src/main/resources/mapper/module/DadaDspWithdrawalMapper.xml
  13. 36 1
      lb-module/src/main/resources/mapper/module/ShopDeliveryMapper.xml
  14. 1 1
      lb-web/src/main/java/com/ydd/web/controller/DadaDspAccountController.java
  15. 11 0
      lb-web/src/main/java/com/ydd/web/controller/DadaDspController.java
  16. 13 4
      lb-web/src/main/java/com/ydd/web/controller/MerchantController.java
  17. 97 0
      web-ui/src/api/module/dadaDsp.js
  18. 18 0
      web-ui/src/api/module/merchant.js
  19. 160 0
      web-ui/src/views/module/dadaAccountManagement/accountDetailIndex.vue
  20. 255 0
      web-ui/src/views/module/dadaWithdrawal/index.vue
  21. 251 0
      web-ui/src/views/module/merchant/dadaVerify.vue

+ 9 - 0
lb-module/src/main/java/com/ydd/module/dto/DadaDspWithdrawalDto.java

@@ -66,4 +66,13 @@ public class DadaDspWithdrawalDto implements Serializable {
      */
     private String name;
 
+    /**
+     * 账户总金额
+     */
+    private BigDecimal totalAccountAmount;
+
+    /**
+     * 开户行
+     */
+    private String bankName;
 }

+ 29 - 0
lb-module/src/main/java/com/ydd/module/dto/DadaShopListDto.java

@@ -88,4 +88,33 @@ public class DadaShopListDto {
      */
     private String dimensionName;
 
+    /**
+     * 商家编号
+     */
+    private String thirdShopId;
+
+    /**
+     * 门店编号
+     */
+    private String dadaShopNo;
+
+    /**
+     * 门店余额
+     */
+    private BigDecimal balance;
+
+    /**
+     * 达达配送商id
+     */
+    private Long dadaDspId;
+
+    /**
+     * 配送商名称
+     */
+    private String dadaDspName;
+
+     /**
+     * 达达配送商注册手机号
+     */
+    private String account;
 }

+ 40 - 0
lb-module/src/main/java/com/ydd/module/dto/DadaVerifyParamsDto.java

@@ -0,0 +1,40 @@
+package com.ydd.module.dto;
+
+import com.ydd.module.request.BasePageRequest;
+import lombok.Data;
+
+/**
+ * Demo class
+ *
+ * @author 14027
+ * @date 2022/3/2 14:52
+ */
+@Data
+public class DadaVerifyParamsDto extends BasePageRequest {
+  private static final long serialVersionUID=1L;
+
+  /**
+     * 门店名称
+     */
+    private String name;
+
+    /**
+     * 门店手机号
+     */
+    private String mobile;
+
+    /**
+     * 所属商家id
+     */
+    private Long merchantId;
+
+    /**
+     * 配送商id
+     */
+    private Long dadaDspId;
+
+    /**
+     * 绑定状态:1->绑定,0:未绑定,2-> 审核中,3->拒绝,4->待完善资料
+     */
+    private Integer status;
+}

+ 1 - 1
lb-module/src/main/java/com/ydd/module/mapper/DadaDspWithdrawalMapper.java

@@ -19,7 +19,7 @@ public interface DadaDspWithdrawalMapper extends BaseMapper<DadaDspWithdrawal> {
 
     BigDecimal selectTotalAmountByDadaDspId(@Param("dadaDspId") Long dadaDspId);
 
-    List<DadaDspWithdrawal> queryList(@Param("params") DadaDspAccountListDto accountDto, @Param("dadaDspId") Long dadaDspId);
+    List<DadaDspWithdrawalDto> queryList(@Param("params") DadaDspAccountListDto accountDto, @Param("dadaDspId") Long dadaDspId);
 
     List<DadaDspWithdrawalDto> withdrawalList(@Param("params") DadaDspAccountListDto accountDto);
 

+ 4 - 4
lb-module/src/main/java/com/ydd/module/mapper/ShopDeliveryMapper.java

@@ -1,14 +1,12 @@
 package com.ydd.module.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydd.module.domain.Member;
 import com.ydd.module.domain.Merchant;
 import com.ydd.module.domain.ShopDelivery;
-import com.ydd.module.dto.DeliveryDto;
-import com.ydd.module.dto.MemberDto;
-import com.ydd.module.dto.ShopDeliveryDto;
-import com.ydd.module.dto.ShopWaimaiDto;
+import com.ydd.module.dto.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -45,6 +43,8 @@ public interface ShopDeliveryMapper extends BaseMapper<ShopDelivery> {
 
     List<ShopWaimaiDto> waimaiVerify(@Param("page")Page page, @Param("params")Merchant merchant, @Param("merchantIdList")List<Integer> merchantIdList);
 
+    Page<DadaShopListDto> selectDadaVerify(IPage<DadaShopListDto> pageArt, @Param("params")DadaVerifyParamsDto paramsDto);
+
     List<ShopWaimaiDto> waimai(@Param("params")Merchant merchant, @Param("merchantIdList")List<Integer> merchantIdList);
 
     ShopDelivery getByMerchantIdAndDeliveryId(@Param("merchantId")Long merchantId, @Param("deliveryId")Long deliveryId);

+ 2 - 2
lb-module/src/main/java/com/ydd/module/service/IDadaDspWithdrawalService.java

@@ -23,7 +23,7 @@ public interface IDadaDspWithdrawalService extends IService<DadaDspWithdrawal> {
      * @param dadaDspId 配送商id
      * @return 收支列表
      */
-    List<DadaDspWithdrawal> queryList(DadaDspAccountListDto accountDto, Long dadaDspId);
+    List<DadaDspWithdrawalDto> queryList(DadaDspAccountListDto accountDto, Long dadaDspId);
 
     DadaDspAccountDto getInfo(Long id);
 
@@ -49,7 +49,7 @@ public interface IDadaDspWithdrawalService extends IService<DadaDspWithdrawal> {
      * @param id 提现记录id
      * @return 提现对象
      */
-    DadaDspWithdrawal getDadaWithdrawal(Long id);
+    DadaDspWithdrawalDto getDadaWithdrawal(Long id);
 
     boolean verify(DadaDspWithdrawal withdrawal, SysUser user);
 

+ 3 - 0
lb-module/src/main/java/com/ydd/module/service/IShopDeliveryBindService.java

@@ -6,6 +6,7 @@ import com.ydd.common.core.page.PageResult;
 import com.ydd.module.domain.Merchant;
 import com.ydd.module.domain.ShopDelivery;
 import com.ydd.module.domain.ShopDeliveryBind;
+import com.ydd.module.dto.DadaShopListDto;
 import com.ydd.module.dto.ShopDeliveryBindDto;
 import com.ydd.module.dto.ShopDeliveryBindHandleDto;
 import com.ydd.module.dto.ShopDeliveryDto;
@@ -84,6 +85,8 @@ public interface IShopDeliveryBindService extends IService<ShopDeliveryBind> {
 
     void editShopNo(ShopDeliveryDto shopDeliveryDto);
 
+    void updateDadaVerify(DadaShopListDto dadaShopListDto);
+
     ShopDeliveryBind selectInfo(Long id);
 
     /**

+ 3 - 0
lb-module/src/main/java/com/ydd/module/service/IShopDeliveryService.java

@@ -6,6 +6,7 @@ import com.ydd.common.core.domain.entity.SysUser;
 import com.ydd.common.core.page.PageResult;
 import com.ydd.module.domain.Merchant;
 import com.ydd.module.domain.ShopDelivery;
+import com.ydd.module.dto.DadaVerifyParamsDto;
 import com.ydd.module.dto.DeliveryDto;
 import com.ydd.module.dto.ShopDeliveryDto;
 import com.ydd.module.dto.ShopWaimaiDto;
@@ -53,6 +54,8 @@ public interface IShopDeliveryService extends IService<ShopDelivery> {
 
     PageResult waimaiVerify(Page page, Merchant merchant, SysUser sysUser);
 
+    PageResult dadaVerify(DadaVerifyParamsDto paramsDto, SysUser sysUser);
+
     List<ShopWaimaiDto> waimai(Merchant merchant, SysUser sysUser);
 
     /**

+ 33 - 4
lb-module/src/main/java/com/ydd/module/service/impl/DadaDspWithdrawalServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ydd.module.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydd.common.core.domain.entity.SysUser;
@@ -7,17 +8,20 @@ import com.ydd.common.enums.DadaDspWithdrawalStatusEnum;
 import com.ydd.common.exception.CustomException;
 import com.ydd.common.utils.DateUtils;
 import com.ydd.module.domain.DadaDsp;
+import com.ydd.module.domain.DadaDspBankCard;
 import com.ydd.module.domain.DadaDspWithdrawal;
 import com.ydd.module.dto.DadaDspAccountDto;
 import com.ydd.module.dto.DadaDspAccountListDto;
 import com.ydd.module.dto.DadaDspWithdrawalDto;
 import com.ydd.module.expection.CustomWebException;
 import com.ydd.module.mapper.DadaDspWithdrawalMapper;
+import com.ydd.module.service.IDadaDspBankCardService;
 import com.ydd.module.service.IDadaDspService;
 import com.ydd.module.service.IDadaDspWithdrawalService;
 import com.ydd.third.common.utils.StringUtils;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.compress.utils.Lists;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -37,15 +41,24 @@ public class DadaDspWithdrawalServiceImpl extends ServiceImpl<DadaDspWithdrawalM
 
     private final IDadaDspService iDadaDspService;
 
+    private final IDadaDspBankCardService iDadaDspBankCardService;
+
     @Override
-    public List<DadaDspWithdrawal> queryList(DadaDspAccountListDto accountDto, Long dadaDspId) {
+    public List<DadaDspWithdrawalDto> queryList(DadaDspAccountListDto accountDto, Long dadaDspId) {
         if (!StringUtils.isEmpty(accountDto.getStartDate())) {
             accountDto.setStartDate(DateUtils.parseToBeginTime(accountDto.getStartDate()));
         }
         if (!StringUtils.isEmpty(accountDto.getEndDate())) {
             accountDto.setEndDate(DateUtils.parseToTomorrowBeginTime(accountDto.getEndDate()));
         }
-        List<DadaDspWithdrawal> list = baseMapper.queryList(accountDto, dadaDspId);
+        List<DadaDspWithdrawalDto> list = baseMapper.queryList(accountDto, dadaDspId);
+        list.forEach(dto-> {
+          DadaDspBankCard bankCard = iDadaDspBankCardService.getOne(new QueryWrapper<DadaDspBankCard>().eq("dada_dsp_id", dto.getDadaDspId())
+          .eq("card_no", dto.getAccount()));
+          if (bankCard != null && StringUtils.isNotBlank(bankCard.getBankName())) {
+            dto.setBankName(bankCard.getBankName());
+          }
+        });
         return CollectionUtils.isNotEmpty(list) ? list : Lists.newArrayList();
     }
 
@@ -110,12 +123,28 @@ public class DadaDspWithdrawalServiceImpl extends ServiceImpl<DadaDspWithdrawalM
             accountDto.setEndDate(DateUtils.parseToTomorrowBeginTime(accountDto.getEndDate()));
         }
         List<DadaDspWithdrawalDto> list = baseMapper.withdrawalList(accountDto);
+        list.forEach(dto-> {
+          DadaDspBankCard bankCard = iDadaDspBankCardService.getOne(new QueryWrapper<DadaDspBankCard>().eq("dada_dsp_id", dto.getDadaDspId())
+          .eq("card_no", dto.getAccount()));
+          if (bankCard != null && StringUtils.isNotBlank(bankCard.getBankName())) {
+            dto.setBankName(bankCard.getBankName());
+          }
+        });
         return CollectionUtils.isNotEmpty(list) ? list : Lists.newArrayList();
     }
 
     @Override
-    public DadaDspWithdrawal getDadaWithdrawal(Long id) {
-        return baseMapper.selectById(id);
+    public DadaDspWithdrawalDto getDadaWithdrawal(Long id) {
+        DadaDspWithdrawalDto withdrawalDto = new DadaDspWithdrawalDto();
+        DadaDspWithdrawal withdrawal = baseMapper.selectById(id);
+        BeanUtils.copyProperties(withdrawal, withdrawalDto);
+        DadaDspBankCard bankCard = iDadaDspBankCardService.getOne(new QueryWrapper<DadaDspBankCard>().eq("deleted", 0)
+          .eq("dada_dsp_id", withdrawalDto.getDadaDspId())
+          .eq("card_no", withdrawalDto.getAccount()));
+        if (bankCard != null && StringUtils.isNotBlank(bankCard.getBankName())) {
+          withdrawalDto.setBankName(bankCard.getBankName());
+        }
+        return withdrawalDto;
     }
 
     @Override

+ 62 - 0
lb-module/src/main/java/com/ydd/module/service/impl/ShopDeliveryBindServiceImpl.java

@@ -7,10 +7,12 @@ import com.ydd.api.DeliveryService;
 import com.ydd.common.core.page.PageResult;
 import com.ydd.common.enums.DeliveryTypeEnums;
 import com.ydd.module.domain.*;
+import com.ydd.module.dto.DadaShopListDto;
 import com.ydd.module.dto.ShopDeliveryBindDto;
 import com.ydd.module.dto.ShopDeliveryBindHandleDto;
 import com.ydd.module.dto.ShopDeliveryDto;
 import com.ydd.module.enums.BindStatusEnum;
+import com.ydd.module.enums.DadaBindTypeEnum;
 import com.ydd.module.enums.IsDeleteEnum;
 import com.ydd.module.mapper.ShopDeliveryBindMapper;
 import com.ydd.module.service.IDspDeliveryService;
@@ -22,12 +24,15 @@ import com.ydd.third.common.vo.ResObject;
 import com.ydd.third.common.vo.shop.AmountResultVo;
 import com.ydd.third.common.vo.shop.QueryAmount;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @author 叶君翔
@@ -190,6 +195,63 @@ public class ShopDeliveryBindServiceImpl extends ServiceImpl<ShopDeliveryBindMap
     }
 
     @Override
+    public void updateDadaVerify(DadaShopListDto dadaShopListDto) {
+      Shop shop = iShopService.getById(dadaShopListDto.getId());
+
+      ShopDeliveryBind shopDeliveryBind = baseMapper.selectOne(new QueryWrapper<ShopDeliveryBind>().eq("merchant_id", shop.getMerchantId()).
+        eq("delivery_id", 7).eq("shop_id", shop.getId()).eq("deleted", 0));
+      if (shopDeliveryBind == null) {
+        shopDeliveryBind = new ShopDeliveryBind();
+      }
+      shopDeliveryBind.setThirdShopId(dadaShopListDto.getThirdShopId());
+      shopDeliveryBind.setDadaShopNo(dadaShopListDto.getDadaShopNo());
+      shopDeliveryBind.setAccount(dadaShopListDto.getAccount());
+
+      shopDeliveryBind.setMerchantId(shop.getMerchantId());
+      shopDeliveryBind.setShopId(shop.getId());
+      shopDeliveryBind.setBindStatus(BindStatusEnum.CHECK.status);
+      shopDeliveryBind.setDeliveryId(7L);
+      shopDeliveryBind.setDadaBindType(DadaBindTypeEnum.OPEN.type);
+      if (shopDeliveryBind.getId() == null) {
+        baseMapper.insert(shopDeliveryBind);
+      }else {
+        baseMapper.updateById(shopDeliveryBind);
+      }
+
+      List<Integer> bindStatusList = Arrays.asList(1, 4);
+      // 查询对应商家是否已经授权
+      List<ShopDeliveryBind> autoList = baseMapper.selectList(new QueryWrapper<ShopDeliveryBind>().eq("merchant_id", shop.getMerchantId()).
+        eq("delivery_id", 7).eq("deleted", 0).in("bind_status", bindStatusList));
+
+      if (CollectionUtils.isNotEmpty(autoList)) {
+        shopDeliveryBind.setBindStatus(BindStatusEnum.BIND.status);
+
+        // 更新门店编号
+        baseMapper.updateById(shopDeliveryBind);
+//            iShopDeliveryBindService.updateDaDaShopNo(type, shopDeliveryBind.getDeliveryId(), shopNo, merchant.getId(), shopId);
+        // 更新余额
+        this.changeDadaBalance(shopDeliveryBind, 7);
+      }
+    }
+
+    private void changeDadaBalance(ShopDeliveryBind shopDeliveryBind, Integer deliveryType){
+        QueryAmount queryAmount = new QueryAmount();
+        queryAmount.setIsDirectDelivery(0);
+        if (DeliveryTypeEnums.DADA_YZ.getType().equals(deliveryType)) {
+            queryAmount.setIsDirectDelivery(1);
+        }
+        // 查询余额
+        queryAmount.setMerchantId(shopDeliveryBind.getThirdShopId());
+        ResObject<AmountResultVo> res = dadaClient.queryAmount(queryAmount);
+        if(res.getCode() == 0) {
+            BigDecimal balanceAmount = res.getData().getBalanceAmount();
+            // 变更余额
+            baseMapper.updateShopAmount(shopDeliveryBind.getMerchantId(), shopDeliveryBind.getDeliveryId(), shopDeliveryBind.getThirdShopId(), balanceAmount);
+        }
+    }
+
+
+    @Override
     public ShopDeliveryBind selectInfo(Long id) {
         ShopDeliveryBind delivery = baseMapper.selectById(id);
         return baseMapper.selectInfo(delivery.getMerchantId(), delivery.getDeliveryId());

+ 53 - 0
lb-module/src/main/java/com/ydd/module/service/impl/ShopDeliveryServiceImpl.java

@@ -13,6 +13,8 @@ import com.ydd.module.domain.*;
 import com.ydd.module.dto.DeliveryDto;
 import com.ydd.module.dto.ShopDeliveryDto;
 import com.ydd.module.dto.ShopWaimaiDto;
+import com.ydd.module.dto.*;
+import com.ydd.module.enums.BindStatusEnum;
 import com.ydd.module.enums.IsDeleteEnum;
 import com.ydd.module.mapper.ShopDeliveryMapper;
 import com.ydd.module.service.*;
@@ -26,6 +28,9 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 商家授权配送平台Service业务层处理
@@ -58,6 +63,11 @@ public class ShopDeliveryServiceImpl extends ServiceImpl<ShopDeliveryMapper, Sho
     @Resource
     private IMemberService iMemberService;
 
+    @Resource
+    private IDadaDspService iDadaDspService;
+
+    @Resource
+    private IShopDeliveryBindService iShopDeliveryBindService;
 
     @Override
     public List<ShopDelivery> queryList(ShopDelivery shopDelivery) {
@@ -220,6 +230,49 @@ public class ShopDeliveryServiceImpl extends ServiceImpl<ShopDeliveryMapper, Sho
     }
 
     @Override
+    public PageResult dadaVerify(DadaVerifyParamsDto paramsDto, SysUser user) {
+      if (UserTypeEnums.DADA_DELIVERY_RAP.getCode().equals(user.getType()) ||
+        UserTypeEnums.DADA_DELIVERY.getCode().equals(user.getType())) {
+        paramsDto.setDadaDspId(user.getDadaDspId());
+      }
+
+      if (UserTypeEnums.DADA_MERCHANT.getCode().equals(user.getType())) {
+        Merchant merchant1 = iMerchantService.findByMobile(user.getPhonenumber());
+        paramsDto.setMerchantId(merchant1 == null ? null : merchant1.getId());
+      }
+
+      Page<DadaShopListDto> page = baseMapper.selectDadaVerify(new Page<>(paramsDto.getPageNum(), paramsDto.getPageSize()), paramsDto);
+      List<DadaShopListDto> shopListDtoList = page.getRecords();
+      shopListDtoList.forEach(shopDto -> {
+        // 获取绑定的达达商家编号、门店编号、绑定状态、余额、注册手机号
+//        ShopDeliveryBind shopDeliveryBind = iShopDeliveryBindService.getOne(new QueryWrapper<ShopDeliveryBind>().eq("deleted", 0).eq("shop_id", shopDto.getId()));
+//        if (shopDeliveryBind != null) {
+//          shopDto.setThirdShopId(shopDeliveryBind.getThirdShopId());
+//          shopDto.setDadaShopNo(shopDeliveryBind.getDadaShopNo());
+//          shopDto.setStatus(shopDeliveryBind.getBindStatus());
+//          shopDto.setBalance(shopDeliveryBind.getBalance());
+//          shopDto.setAccount(shopDeliveryBind.getAccount());
+//        }
+
+        // 赋值达达配送商名称
+        DadaDsp dadaDsp = iDadaDspService.getById(shopDto.getDadaDspId());
+        shopDto.setDadaDspName(dadaDsp == null ? null : dadaDsp.getName());
+        if (shopDto.getStatus() != null) {
+          // 获取已经授权的商户id
+          Long merchantId = shopDto.getMerchantId();
+          // 查询已经授权商户下面所有未授权门店
+          shopListDtoList.stream().filter(dto1 -> dto1.getMerchantId().equals(merchantId) && dto1.getThirdShopId() == null)
+            // 赋值已经授权的商户编号和注册手机号
+            .forEach(dto2 -> {
+              dto2.setThirdShopId(shopDto.getThirdShopId());
+              dto2.setAccount(shopDto.getAccount());
+            });
+        }
+      });
+      return new PageResult(page);
+    }
+
+    @Override
     public List<ShopWaimaiDto> waimai(Merchant merchant, SysUser user) {
         List<Integer> merchantIdList = new ArrayList<>();
         if (user.getType().equals(UserTypeEnums.AGENT.getCode())) {

+ 22 - 9
lb-module/src/main/resources/mapper/module/DadaDspWithdrawalMapper.xml

@@ -9,23 +9,34 @@
         where dada_dsp_id = #{dadaDspId} and status = 2 and deleted = 0
     </select>
 
-    <select id="queryList" resultType="com.ydd.module.domain.DadaDspWithdrawal">
-        select status,amount,account,create_time,remark
-        from lb_dada_dsp_withdrawal
+    <select id="queryList" resultType="com.ydd.module.dto.DadaDspWithdrawalDto">
+        select
+            ddw.id,
+            ddw.dada_dsp_id,
+            ddw.status,
+            ddw.amount,
+            ddw.account,
+            ddw.create_time,
+            ddw.zfb_name,
+            ddw.remark,
+            dd.name,
+            dd.amount as totalAccountAmount
+        from lb_dada_dsp_withdrawal ddw
+        left join lb_dada_dsp dd on ddw.dada_dsp_id = dd.id
         where 1 = 1
         <if test='dadaDspId != null'>
-            AND dada_dsp_id = #{dadaDspId}
+            AND ddw.dada_dsp_id = #{dadaDspId}
         </if>
         <if test='params.status != null and params.status != ""'>
-            AND status = #{params.status}
+            AND ddw.status = #{params.status}
         </if>
         <if test="params.startDate != null and params.startDate != ''">
-            AND create_time >= #{params.startDate}
+            AND ddw.create_time >= #{params.startDate}
         </if>
         <if test="params.endDate != null and params.endDate != ''">
-            AND create_time &lt;= #{params.endDate}
+            AND ddw.create_time &lt;= #{params.endDate}
         </if>
-        order by id desc
+        order by ddw.id desc
     </select>
 
     <select id="withdrawalList" resultType="com.ydd.module.dto.DadaDspWithdrawalDto">
@@ -34,10 +45,12 @@
         ddw.status,
         ddw.amount,
         ddw.account,
+        ddw.dada_dsp_id,
         ddw.create_time,
         ddw.zfb_name,
         ddw.remark,
-        dd.name
+        dd.name,
+        dd.amount as totalAccountAmount
         from lb_dada_dsp_withdrawal ddw left join lb_dada_dsp dd on ddw.dada_dsp_id = dd.id
         where 1 = 1
         <if test='params.status != null and params.status != ""'>

+ 36 - 1
lb-module/src/main/resources/mapper/module/ShopDeliveryMapper.xml

@@ -377,7 +377,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         limit 1
     </select>
 
-    <update id="editShopNo">
+    <select id="selectDadaVerify" resultType="com.ydd.module.dto.DadaShopListDto">
+        select
+            s.id,
+            s.`name`,
+            s.create_time,
+            s.merchant_id,
+            lm.dada_dsp_id,
+            sdb.third_shop_id,
+            sdb.dada_shop_no,
+            sdb.bind_status as status,
+            sdb.balance,
+            sdb.account
+        from lb_shop s
+        left join lb_merchant m on s.merchant_id = m.id
+        left join lb_member lm on lm.merchant_id = m.id and member_type = 2
+        left join lb_shop_delivery_bind sdb on s.id = sdb.shop_id and sdb.deleted = 0
+        where 1 = 1 and m.dada_dsp_id is not null
+        <if test="params.dadaDspId != null and params.dadaDspId != ''">
+            and lm.dada_dsp_id = #{params.dadaDspId}
+        </if>
+        <if test="params.merchantId != null and params.merchantId != ''">
+            and s.merchant_id = #{params.merchantId}
+        </if>
+        <if test="params.name != null and params.name != ''">
+            and s.`name` like concat('%', #{params.name}, '%')
+        </if>
+        <if test="params.mobile != null and params.mobile != ''">
+            and s.`mobile` like concat('%', #{params.mobile}, '%')
+        </if>
+        <if test="params.status != null">
+            and (sdb.bind_status = #{params.status} and sdb.deleted = 0)
+        </if>
+        order by s.id desc
+    </select>
+
+  <update id="editShopNo">
         update lb_shop_delivery
         <if test="params.type == 1">
             set dada_shop_no = #{params.shopNo}

+ 1 - 1
lb-web/src/main/java/com/ydd/web/controller/DadaDspAccountController.java

@@ -38,7 +38,7 @@ public class DadaDspAccountController extends BaseController {
     public TableDataInfo list(DadaDspAccountListDto accountDto) {
         SysUser user = getSysUser();
         startPage();
-        List<DadaDspWithdrawal> list = iDadaDspWithdrawalService.queryList(accountDto, user.getDadaDspId());
+        List<DadaDspWithdrawalDto> list = iDadaDspWithdrawalService.queryList(accountDto, user.getDadaDspId());
         return getDataTable(list);
     }
 

+ 11 - 0
lb-web/src/main/java/com/ydd/web/controller/DadaDspController.java

@@ -1,5 +1,6 @@
 package com.ydd.web.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ydd.common.annotation.Log;
 import com.ydd.common.core.controller.BaseController;
 import com.ydd.common.core.domain.Result;
@@ -7,6 +8,7 @@ import com.ydd.common.core.domain.entity.SysUser;
 import com.ydd.common.core.page.TableDataInfo;
 import com.ydd.common.enums.BusinessType;
 import com.ydd.common.enums.UserTypeEnums;
+import com.ydd.module.domain.DadaDsp;
 import com.ydd.module.dto.DadaDspDto;
 import com.ydd.module.service.IDadaDspService;
 import lombok.RequiredArgsConstructor;
@@ -76,4 +78,13 @@ public class DadaDspController extends BaseController {
         return toAjax(iDadaDspService.updateDadaDsp(dadaDspDto) ? 1 : 0);
     }
 
+    /**
+     * 门店列表
+     */
+    @GetMapping("/listDadaDsp")
+    public Result listDadaDsp() {
+        SysUser user = getSysUser();
+        List<DadaDsp> list = iDadaDspService.list(new QueryWrapper<DadaDsp>().eq("status", 1));
+        return Result.success(list);
+    }
 }

+ 13 - 4
lb-web/src/main/java/com/ydd/web/controller/MerchantController.java

@@ -14,10 +14,7 @@ import com.ydd.common.utils.poi.ExcelUtil;
 import com.ydd.module.domain.DspDelivery;
 import com.ydd.module.domain.Merchant;
 import com.ydd.module.domain.MerchantCategory;
-import com.ydd.module.dto.MerchantExportDto;
-import com.ydd.module.dto.ShopDeliveryBindHandleDto;
-import com.ydd.module.dto.ShopDeliveryDto;
-import com.ydd.module.dto.ShopWaimaiDto;
+import com.ydd.module.dto.*;
 import com.ydd.module.service.*;
 import com.ydd.system.service.ISysUserService;
 import lombok.RequiredArgsConstructor;
@@ -150,6 +147,12 @@ public class MerchantController extends BaseController {
         result.put("data",map);
         return result;
     }
+    @GetMapping("/shop/delivery/dadaVerify")
+    public Result dadaVerify(DadaVerifyParamsDto paramsDto) {
+        SysUser user = getSysUser();
+        PageResult pageResult = iShopDeliveryService.dadaVerify(paramsDto,user);
+        return Result.success(pageResult);
+    }
     @GetMapping("/shop/waimai")
     public Result waimai(Merchant merchant) {
         SysUser user = getSysUser();
@@ -275,6 +278,12 @@ public class MerchantController extends BaseController {
         return Result.success();
     }
 
+    @PostMapping("/shop/delivery/updateDadaVerify")
+    public Result updateDadaVerify(@RequestBody DadaShopListDto dadaShopListDto) {
+        iShopDeliveryBindService.updateDadaVerify(dadaShopListDto);
+        return Result.success();
+    }
+
     @GetMapping(value = "/shop/delivery/info" )
     public Result getDeliveryInfo(Long id) {
         return Result.success(iShopDeliveryBindService.selectInfo(id));

+ 97 - 0
web-ui/src/api/module/dadaDsp.js

@@ -0,0 +1,97 @@
+import request from '@/utils/request'
+
+// 查询达达配送服务商列表
+export function listDadaDsp(query) {
+  return request({
+    url: '/module/dadaDsp/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询客户商家列表
+export function listDadaMerchant(query) {
+  return request({
+    url: '/module/dadaDsp/merchant/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询达达配送服务商详细
+export function getDadaDsp(id) {
+  var url = '/module/dadaDsp/info?id=' + id
+  return request({
+    url: url,
+    method: 'get'
+  })
+}
+
+// 查询达达配送商关联商家明细
+export function getDadaMerchant(id) {
+  var url = '/module/dadaDsp/merchant/info?merchantId=' + id
+  return request({
+    url: url,
+    method: 'get'
+  })
+}
+
+// 新增达达配送服务商
+export function addDadaDsp(data) {
+  return request({
+    url: '/module/dadaDsp',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改达达配送服务商
+export function updateDadaDsp(data) {
+  return request({
+    url: '/module/dadaDsp',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除达达配送服务商
+export function delDadaDsp(id) {
+  return request({
+    url: '/module/DadaDsp/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出达达配送服务商
+export function exportDadaDsp(query) {
+  return request({
+    url: '/module/dadaDsp/export',
+    method: 'get',
+    params: query
+  })
+}
+
+export function getLoginUser() {
+  return request({
+    url: '/module/dadaDsp/getLoginUser',
+    method: 'get'
+  })
+}
+
+// 修改达达配送服务商-关联商户
+export function updateDadaMerchant(data) {
+  return request({
+    url: '/module/dadaDsp/merchant/edit',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询配送商列表
+export function getDadaDspList() {
+  return request({
+    url: '/module/dadaDsp/listDadaDsp',
+    method: 'get',
+    params: ''
+  })
+}

+ 18 - 0
web-ui/src/api/module/merchant.js

@@ -95,4 +95,22 @@ export function getFirstAgentList(query) {
     method: 'get',
     params: query
   })
+}
+
+// 查询达达配送商门店列表
+export function listShopVerify(query) {
+  return request({
+    url: '/module/merchant/shop/delivery/dadaVerify',
+    method: 'get',
+    params: query
+  })
+}
+
+// 修改达达绑定信息
+export function updateDadaVerify(data) {
+  return request({
+    url: '/module/merchant/shop/delivery/updateDadaVerify',
+    method: 'post',
+    data: data
+  })
 }

+ 160 - 0
web-ui/src/views/module/dadaAccountManagement/accountDetailIndex.vue

@@ -0,0 +1,160 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择" clearable>
+          <el-option v-for="item in withdrawalStatusOption" :key="item.value" :label="item.label" :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="日期" prop="createDate">
+        <el-date-picker
+          v-model="createDate"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd" 
+          format="yyyy-MM-dd">
+        >
+        </el-date-picker>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search"  @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="withdrawalList" stripe border highlight-current-row style="width: 100%">
+      <el-table-column label="提现配送商" align="center" prop="name"/>
+      <el-table-column label="账户总金额" align="center" prop="totalAccountAmount" />
+      <el-table-column label="提现金额(元)" align="center" prop="amount"/>
+      <el-table-column label="提现账户" align="center" prop="account" />
+      <el-table-column label="开户行" align="center" prop="bankName" />
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <span v-if="scope.row.status == 2">待处理</span>
+          <el-tag v-if="scope.row.status == 3" type="success">已提现</el-tag>
+          <el-tag v-if="scope.row.status == 4" type="danger">拒绝提现</el-tag>
+        </template>
+      </el-table-column>
+       <el-table-column label="备注" align="center" prop="remark" />
+       <el-table-column label="申请时间" align="center" prop="createTime" />
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { getAccountDetail } from "@/api/module/accountManagement";
+import moment from "moment";
+
+export default {
+  name: "AccountDetail",
+  data() {
+    return {
+      // 登录用户
+      user: {},
+      status: '',
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 服务商表格数据
+      withdrawalList: [],
+      createDate: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        status: undefined,
+        createDate: undefined,
+        startDate: undefined,
+        endDate: undefined,
+      },
+      withdrawalStatusOption: [
+         {
+          value:2,
+          label: "待处理",
+        },
+        {
+          value: 3,
+          label: "已同意",
+        },
+        {
+          value: 4,
+          label: "已拒绝",
+        }
+      ],
+      // 表单参数
+      form: {},
+    };
+  },
+  created() {
+    this.createDate[0] = this.formatDate(new Date().getTime() - 7 * 24 * 60 * 60 * 1000);
+    this.createDate[1] = this.formatDate(new Date().getTime());
+    this.getList();
+  },
+  methods: {
+    /** 查询收支明细 */
+    getList() {
+      this.loading = true;
+      if (this.createDate !== null && this.createDate !== "") {
+        if (this.createDate[0] !== undefined) {
+          this.queryParams.startDate = this.createDate[0];
+          this.queryParams.endDate = this.createDate[1];
+        }
+      } else {
+        this.queryParams.startDate = "";
+        this.queryParams.endDate = "";
+      }
+      getAccountDetail(this.queryParams).then(response => {
+        this.withdrawalList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    formatDate(time) {
+      return moment(time).format("YYYY-MM-DD");
+    },
+  
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.status = '';
+      this.createDate = '';
+      this.handleQuery();
+    },
+  }
+};
+</script>

+ 255 - 0
web-ui/src/views/module/dadaWithdrawal/index.vue

@@ -0,0 +1,255 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable >
+          <el-option
+              v-for="item in statusOption"
+              :key="item.value"
+              :label="item.name"
+              :value="item.value"
+            ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="日期" prop="createDate">
+        <el-date-picker
+          v-model="createDate"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd" 
+          format="yyyy-MM-dd">
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search"  @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="dadaDspWithdrawalList" stripe border highlight-current-row style="width: 100%">
+      <el-table-column label="提现配送商" align="center" prop="name"/>
+      <el-table-column label="账户总金额" align="center" prop="totalAccountAmount" />
+      <el-table-column label="提现金额" align="center" prop="amount"/>
+      <el-table-column label="提现账户" align="center" prop="account"/>
+      <el-table-column label="支付宝姓名" align="center" prop="zfbName">
+        <template slot-scope="scope">
+          <span>{{ scope.row.zfbName == null ? ' -- ' : scope.row.zfbName}} </span><br />
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status == 2">待审核</el-tag>
+          <el-tag v-if="scope.row.status == 3" type="success">已提现</el-tag>
+          <el-tag v-if="scope.row.status == 4" type="danger">拒绝提现</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="开户行" align="center" prop="bankName" />
+      <el-table-column label="备注" align="center" prop="remark"/>
+      <el-table-column label="申请时间" align="center" prop="createTime"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-if="(userType == 0 || userType == 1) && scope.row.status == 2"
+          >审核</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 审核 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="银行卡号" prop="account" v-if="form.type == 1">
+          <span>{{form.account}}</span>
+        </el-form-item>
+        <el-form-item label="支付宝账号" prop="account" v-if="form.type == 0">
+          <span>{{form.account}}</span>
+        </el-form-item>
+        <el-form-item label="支付宝姓名" prop="zfbName" v-if="form.type == 0">
+          <span>{{form.zfbName}}</span>
+        </el-form-item>
+        <el-form-item label="提现金额" prop="amount">
+          <span >{{form.amount}}</span>
+          元
+        </el-form-item>
+        <el-form-item label="开户行" prop="bankName" v-if="form.type == 1">
+          <span>{{form.bankName}}</span>
+        </el-form-item>
+        <el-form-item v-if="form.id > 0" label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handle(3)">同 意</el-button>
+        <el-button type="primary" @click="handle(4)">拒 绝</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listDadaDspWithdrawal, getDadaWithdrawal, updateDadaDspWithdrawal } from "@/api/module/dadaWithdrawal";
+
+export default {
+  name: "AgentWithdrawal",
+  components: {
+  },
+  data() {
+    return {
+      user: [],
+      statusOption: [{
+        value: 1,
+        name: '已提现'
+      },{
+        value: 0,
+        name: '待审核'
+      },{
+        value: -1,
+        name: '拒绝提现'
+      }],
+      dialogVisible: false,
+      createDate: [],
+      rate: 0,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 代理商提现申请表格数据
+      dadaDspWithdrawalList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 当前余额
+      amount: undefined,
+      // 用户类型
+      userType: undefined,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        status: undefined,
+        createDate: undefined,
+        startDate: undefined,
+        endDate: undefined,
+      },
+      // 表单参数
+      form: {},
+      rules: {}
+    };
+  },
+  created() {
+    this.userType = localStorage.getItem("SYS_USER_TYPE")
+    this.getList();
+  },
+  methods: {
+    // 弹出修改手续费弹框
+    updateRateBlock(){
+      this.dialogVisible = true
+    },
+    /** 查询代理商提现申请列表 */
+    getList() {
+      this.loading = true;
+       if (this.createDate !== null && this.createDate !== "") {
+        if (this.createDate[0] !== undefined) {
+          this.queryParams.startDate = this.createDate[0];
+          this.queryParams.endDate = this.createDate[1];
+        }
+      } else {
+        this.queryParams.startDate = "";
+        this.queryParams.endDate = "";
+      }
+      listDadaDspWithdrawal(this.queryParams).then(response => {
+        this.dadaDspWithdrawalList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: undefined,
+        status: 0,
+        amount: undefined,
+        arrivalAmount: undefined,
+        rate: undefined,
+        agentId: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "提现申请";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getDadaWithdrawal(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "提现审核";
+      });
+    },
+    // 同意提现
+    handle(status){
+      this.form.status = status
+      this.submitForm()
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDadaDspWithdrawal(this.form).then(response => {
+              this.msgSuccess("操作成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+  }
+};
+</script>

+ 251 - 0
web-ui/src/views/module/merchant/dadaVerify.vue

@@ -0,0 +1,251 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="门店名称" prop="name">
+        <el-input
+          v-model="queryParams.name"
+          placeholder="请输入门店名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="门店手机号" prop="mobile">
+        <el-input
+          v-model="queryParams.mobile"
+          placeholder="请输入门店手机号"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="所属配送商" prop="dadaDspId" v-if="userType == 1 || userType == 3">
+        <el-select v-model="queryParams.dadaDspId" placeholder="请选择" filterable clearable >
+          <el-option v-for="item in listDadaDsp" :key="item.id" :value="item.id" :label="item.name"/>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择" filterable clearable >
+          <el-option v-for="item in statusOption" :key="item.id" :value="item.id" :label="item.name"/>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search"  @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh"  @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-table v-loading="loading" :data="shopVerifyList" @selection-change="handleSelectionChange" stripe border highlight-current-row style="width: 100%">
+      <el-table-column label="门店名称" align="center" prop="name" />
+      <el-table-column label="商家编号" align="center" prop="thirdShopId" />
+      <el-table-column label="门店编号" align="center" prop="dadaShopNo" />
+      <el-table-column label="所属配送商" align="center" prop="dadaDspName" />
+      <el-table-column label="状态" align="center" prop="status">
+          <template slot-scope="scope">
+            <el-tag type="warning" v-if="scope.row.status == 0">未绑定</el-tag>
+            <el-tag type="success" v-if="scope.row.status == 1">绑定</el-tag>
+            <el-tag v-if="scope.row.status == 2">审核中</el-tag>
+            <el-tag type="danger" v-if="scope.row.status == 3">审核失败</el-tag>
+          </template>
+      </el-table-column>
+      <el-table-column label="余额" align="center" prop="balance"/>
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+           v-if="(userType == 4 || userType == 5 || userType == 1) && scope.row.status != 1"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+          >编辑资料</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改商家门店对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item label="商户编号" prop="thirdShopId">
+          <el-input style="width:500px" v-model="form.thirdShopId" placeholder="请输入商户编号" :disabled="this.oldThirdShopId != undefined" />
+        </el-form-item>
+        <el-form-item label="门店编号" prop="dadaShopNo">
+          <el-input style="width:500px" v-model="form.dadaShopNo" placeholder="请输入门店编号" />
+        </el-form-item>
+        <el-form-item label="联系电话" prop="account">
+          <el-input style="width:500px" v-model="form.account" placeholder="请输入联系电话" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listShopVerify, updateDadaVerify } from "@/api/module/merchant"
+import { getDadaDspList } from "@/api/module/dadaDsp";
+import user from '@/store/modules/user'
+
+export default {
+  name: "dadaVerify",
+  components: {
+
+  },
+  data() {
+    return {
+      statusOption: [
+          {
+              id: 1,
+              name: "绑定"
+          },{
+              id: 0,
+              name: "未绑定"
+          },{
+              id: 2,
+              name: "审核中"
+          },{
+              id: 3,
+              name: "拒绝"
+          },{
+              id: 4,
+              name: "待完善资料"
+          }
+      ],
+      user: {},
+      // 配送商
+      listDadaDsp: [],
+      // 遮罩层
+      loading: true,
+      oldThirdShopId: undefined,
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 商家门店表格数据
+      shopVerifyList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 登录用户类型
+      userType: undefined,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: undefined,
+        mobile: undefined,
+        dadaDspId: undefined,
+        status: undefined
+      },
+ 
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        thirdShopId: [
+          { required: true, message: "商家编号不能为空", trigger: "blur" }
+        ],
+        dadaShopNo: [
+          { required: true, message: "门店编号不能为空", trigger: "blur" }
+        ],
+        account: [
+          { required: true, message: "注册手机号不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.user = user.actions.getSysUser()
+    this.userType = localStorage.getItem("SYS_USER_TYPE")
+    this.getList();
+    getDadaDspList().then(response => {
+      this.listDadaDsp = response.data
+    });
+  },
+  methods: {
+    /** 查询商家门店列表 */
+    getList() {
+      this.loading = true;
+      listShopVerify(this.queryParams).then(response => {
+        this.shopVerifyList = response.data.data;
+        this.total = response.data.totalNums;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        thirdShopId: undefined,
+        dadaShopNo: undefined,
+        mobile: undefined,
+        account: undefined
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加商家门店";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      this.form.id = row.id
+      this.oldThirdShopId = row.thirdShopId
+      this.form.thirdShopId = row.thirdShopId
+      this.form.account = row.account
+      this.open = true;
+      this.title = "修改达达门店资料";
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDadaVerify(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } 
+        }
+      });
+    },
+  }
+};
+</script>