소스 검색

门店运力

wangtao 3 년 전
부모
커밋
0404d1926b

+ 31 - 54
lb-app/src/main/java/com/ydd/app/controller/StoreApi.java

@@ -3,12 +3,14 @@ package com.ydd.app.controller;
 import com.alibaba.fastjson.JSONObject;
 import com.ydd.app.dto.ShopReq;
 import com.ydd.app.dto.StoreDto;
+import com.ydd.app.dto.StoreStatusDto;
 import com.ydd.app.service.ApiShopService;
 import com.ydd.app.service.ApiStoreService;
 import com.ydd.common.annotation.AccessToken;
 import com.ydd.common.core.controller.BaseController;
 import com.ydd.common.core.domain.BaseResult;
 import com.ydd.common.core.page.PageResult;
+import com.ydd.common.utils.StringUtils;
 import com.ydd.module.domain.Shop;
 import com.ydd.module.dto.ShopDto;
 import com.ydd.module.dto.ShopSelectDto;
@@ -19,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -50,23 +53,11 @@ public class StoreApi extends BaseController {
     @RequestMapping(value = "/create", method = RequestMethod.POST)
     @AccessToken
     public BaseResult saveShop(StoreDto storeDto) {
-        logger.info("创建门店参数---"+JSONObject.toJSONString(storeDto));
-        Shop shop = apiStoreService.saveShop(getLoginId(), storeDto,false);
+        logger.info("创建门店参数---" + JSONObject.toJSONString(storeDto));
+        Shop shop = apiStoreService.saveShop(getLoginId(), storeDto, false);
         return BaseResult.success((Object) shop.getCode());
     }
 
-    /**
-     * 门店详情
-     */
-    @ApiOperation("门店详情")
-    @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "shopId", value = "门店ID")
-    })
-    @RequestMapping(value = "/detail", method = RequestMethod.GET)
-    @AccessToken
-    public BaseResult<ShopDto> findDetail(@RequestParam("shopId") Long shopId) {
-        return BaseResult.success(apiStoreService.findDetail(getLoginId(),shopId));
-    }
 
     /**
      * 更新门店资料
@@ -75,7 +66,7 @@ public class StoreApi extends BaseController {
     @RequestMapping(value = "/update", method = RequestMethod.POST)
     @AccessToken
     public BaseResult modify(StoreDto shopReq) {
-        logger.info("-----更新门店资料-提交数据----"+ JSONObject.toJSONString(shopReq));
+        logger.info("-----更新门店资料-提交数据----" + JSONObject.toJSONString(shopReq));
         Shop shop = apiStoreService.modify(getLoginId(), shopReq);
         return BaseResult.success((Object) shop.getCode());
     }
@@ -84,51 +75,37 @@ public class StoreApi extends BaseController {
     /**
      * 第三方审核修改
      */
-    @ApiOperation("第三方审核修改")
-    @RequestMapping(value = "/third/modify", method = RequestMethod.POST)
+    @ApiOperation("门店运力禁用")
+    @RequestMapping(value = "/delivery/status", method = RequestMethod.POST)
     @AccessToken
-    public BaseResult third(ShopReq shopReq) {
-        try{
-            apiStoreService.third(getLoginId(), shopReq);
-            return BaseResult.success();
-        }catch (CustomAppException e){
+    public BaseResult changeShopDelivery(@Validated StoreStatusDto dto) {
+        try {
+            if (StringUtils.isNotBlank(dto.getDeliveryIdStr())) {
+                apiStoreService.changeShopDelivery(getLoginId(), dto);
+                return BaseResult.success();
+            } else {
+                return BaseResult.error("运力id不能为空");
+            }
+
+        } catch (CustomAppException e) {
             return BaseResult.error(e.getMessage());
         }
     }
 
-    /**
-     * 删除门店
-     */
-    @ApiOperation("删除门店")
-    @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "shopId", value = "门店ID")
-    })
-    @RequestMapping(value = "/delete", method = RequestMethod.POST)
+    @ApiOperation("门店运力查询")
+    @RequestMapping(value = "/delivery", method = RequestMethod.POST)
     @AccessToken
-    public BaseResult delete(@RequestParam("shopId") Integer shopId) {
-        apiStoreService.delete(getLoginId(), shopId);
-        return BaseResult.success();
-    }
+    public BaseResult delivery(@Validated StoreStatusDto dto) {
+        try {
+            if (StringUtils.isNotBlank(dto.getDeliveryIdStr())) {
+                JSONObject json = apiStoreService.queryhopDelivery(getLoginId(), dto);
+                return BaseResult.success(json);
+            } else {
+                return BaseResult.error("运力id不能为空");
+            }
 
-    @ApiOperation("第三方门店详情")
-    @ApiImplicitParams({
-            @ApiImplicitParam(required = true, paramType = "query", name = "shopId", value = "门店ID"),
-            @ApiImplicitParam(required = true, paramType = "query", name = "deliveryId", value = "运力id")
-    })
-    @RequestMapping(value = "/thirddetail", method = RequestMethod.GET)
-    @AccessToken
-    public BaseResult<ShopDto> findThirdDetail(@RequestParam("shopId") Long shopId,@RequestParam("deliveryId")Long deliveryId) {
-        return BaseResult.success(apiStoreService.findThirdDetail(getLoginId(),shopId,deliveryId));
-    }
-
-    /**
-     * 门店列表(下拉选)
-     */
-    @ApiOperation("门店列表(下拉选)")
-    @RequestMapping(value = "/listSelect", method = RequestMethod.GET)
-    @AccessToken
-    public BaseResult<List<ShopSelectDto>> listSelect() {
-        return BaseResult.success(apiStoreService.findShopSelectList(getLoginId()));
+        } catch (CustomAppException e) {
+            return BaseResult.error(e.getMessage());
+        }
     }
-
 }

+ 1 - 1
lb-app/src/main/java/com/ydd/app/dto/BaseDto.java

@@ -8,7 +8,7 @@ import lombok.Data;
  */
 @Data
 public class BaseDto {
-    
+
     private String appId;
     private String sign;
     private Long timeStamp;

+ 6 - 34
lb-app/src/main/java/com/ydd/app/service/ApiStoreService.java

@@ -1,7 +1,9 @@
 package com.ydd.app.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ydd.app.dto.ShopReq;
 import com.ydd.app.dto.StoreDto;
+import com.ydd.app.dto.StoreStatusDto;
 import com.ydd.module.domain.DspDelivery;
 import com.ydd.module.domain.Shop;
 import com.ydd.module.dto.ShopDto;
@@ -30,13 +32,7 @@ public interface ApiStoreService {
      */
     Shop saveShop(Long loginId, StoreDto shop, boolean isMerchant);
 
-    /**
-     * 门店详情
-     * @param loginId
-     * @param shopId
-     * @return
-     */
-    ShopDto findDetail(Long loginId, Long shopId);
+
 
     /**
      * 更新门店信息
@@ -45,37 +41,13 @@ public interface ApiStoreService {
      */
     Shop modify(Long loginId, StoreDto shopReq);
 
-    /**
-     * 删除门店
-     * @param loginId
-     * @param shopId
-     */
-    void delete(Long loginId, Integer shopId);
 
-    /**
-     * 第三方审核修改
-     * @param loginId
-     * @param shopReq
-     */
-    void third(Long loginId, ShopReq shopReq);
 
 
-    /**
-     * 创建门店回调
-     * @param storeVo
-     */
-    void callBackCreate(FengniaoV3CallbackStoreVo storeVo);
-
-    /**
-     * 修改门店回调
-     * @param storeVo
-     */
-    void callBackEdit(FengniaoV3CallbackStoreVo storeVo);
-
-    ShopDto findThirdDetail(Long loginId, Long shopId,Long deliveryId);
-
     Integer getFengniaoShopStatus(Shop shop, DspDelivery d,String lbClient);
 
-    List<ShopSelectDto> findShopSelectList(Long loginId);
+    void  changeShopDelivery(Long loginId,StoreStatusDto storeStatusDto);
+
+    JSONObject queryhopDelivery(Long loginId, StoreStatusDto storeStatusDto);
 
 }

+ 44 - 333
lb-app/src/main/java/com/ydd/app/service/impl/ApiStoreServiceImpl.java

@@ -7,35 +7,31 @@ import com.ydd.app.ShopEditUtils;
 import com.ydd.app.ShopEntityUtils;
 import com.ydd.app.dto.ShopReq;
 import com.ydd.app.dto.StoreDto;
-import com.ydd.app.service.ApiShopService;
+import com.ydd.app.dto.StoreStatusDto;
 import com.ydd.app.service.ApiStoreService;
 import com.ydd.common.enums.DeliveryTypeEnums;
 import com.ydd.common.utils.SnCodeUtils;
-import com.ydd.common.utils.StringUtils;
 import com.ydd.ecloud.core.utils.JsonMapper;
 import com.ydd.module.domain.*;
-import com.ydd.module.dto.DeliveryDto;
-import com.ydd.module.dto.ShopDto;
-import com.ydd.module.dto.ShopSelectDto;
-import com.ydd.module.dto.WaimaiDto;
-import com.ydd.module.enums.*;
+import com.ydd.module.dto.StoreDeliveryDto;
+import com.ydd.module.enums.BindStatusEnum;
+import com.ydd.module.enums.IsDeleteEnum;
+import com.ydd.module.enums.MerchantStatusEnum;
+import com.ydd.module.enums.StatusEnum;
 import com.ydd.module.expection.CustomAppException;
 import com.ydd.module.service.*;
-import com.ydd.system.domain.SysConfig;
 import com.ydd.system.service.ISysConfigService;
 import com.ydd.third.common.vo.ResObject;
-import com.ydd.third.common.vo.callback.FengniaoV3CallbackStoreVo;
 import com.ydd.third.common.vo.shop.ShopResultVo;
 import com.ydd.third.common.vo.shop.ShopVo;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -66,12 +62,7 @@ public class ApiStoreServiceImpl implements ApiStoreService {
 
     private final IMerchantCategoryService iMerchantCategoryService;
 
-    private final ISysConfigService iSysConfigService;
-
-    private final IShopWaimaiService iShopWaimaiService;
-
-    private final IShopUserService iShopUserService;
-
+    private final IShopDeliveryDisableService iShopDeliveryDisableService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -243,66 +234,7 @@ public class ApiStoreServiceImpl implements ApiStoreService {
         req.setPoiAddress(shop.getPoiAddress());
         return  req;
     }
-    @Override
-    public ShopDto findDetail(Long loginId, Long shopId) {
-        ShopDto dto = iShopService.findDetail(shopId);
-        List<DeliveryDto> deliveryList = iShopService.findDeliveryList(dto.getId());
-        boolean isApt = false;
-        for (DeliveryDto d : deliveryList) {
-            if (d.getType().equals(DeliveryTypeEnums.AIPT.getType())) {
-                isApt = true;
-            }
-        }
-        // 查询门店没有绑定的运力
-        List<DspDelivery> unBinds = iDspDeliveryService.findNotBindByIds(deliveryList);
-        for (DspDelivery u : unBinds) {
-            if (!u.getType().equals(DeliveryTypeEnums.AIPT.getType())) {
-                ShopDelivery shopDelivery = new ShopDelivery();
-                shopDelivery.setMerchantId(dto.getMerchantId());
-                shopDelivery.setShopId(dto.getId());
-                shopDelivery.setDeliveryId(u.getId());
-                shopDelivery.setBindStatus(BindStatusEnum.UNBIND.status);
-                if (u.getType().equals(DeliveryTypeEnums.UUPT.getType()) ||
-                        u.getType().equals(DeliveryTypeEnums.SHUN_FENG.getType()) ||
-                        u.getType().equals(DeliveryTypeEnums.KUAI_FU.getType())) {
-                    shopDelivery.setBindStatus(BindStatusEnum.BIND.status);
-                }
-                iShopDeliveryService.save(shopDelivery);
-                DeliveryDto d1 = new DeliveryDto();
-                d1.setDeliveryId(u.getId());
-                d1.setName(u.getName());
-                d1.setLogo(u.getLogo());
-                d1.setDspDeliveryId(u.getId());
-                d1.setBindStatus(shopDelivery.getBindStatus());
-                d1.setType(u.getType());
-                deliveryList.add(d1);
-            }
-        }
-        if (!isApt) {
-            DspDelivery dsps = iDspDeliveryService.findOne(DeliveryTypeEnums.AIPT.getType());
-            if (dsps != null) {
-                DeliveryDto d = new DeliveryDto();
-                d.setDeliveryId(dsps.getId());
-                d.setName(dsps.getName());
-                d.setLogo(dsps.getLogo());
-                d.setDspDeliveryId(dsps.getId());
-                d.setBindStatus(1);
-                d.setType(DeliveryTypeEnums.AIPT.getType());
-                deliveryList.add(d);
-            }
-        }
-        dto.setDeliveries(deliveryList);
-        // 查询经营类目
-        Merchant merchant = iMerchantService.getById(dto.getMerchantId());
-        if (merchant != null) {
-            MerchantCategory category = iMerchantCategoryService.getById(merchant.getCategoryId());
-            dto.setFnProductType(category.getFnProductType());
-        }
-        // 门店经营类目
-        MerchantCategory category = iMerchantCategoryService.getById(dto.getCategoryId());
-        dto.setCategoryName(category != null ? category.getName() : "");
-        return dto;
-    }
+
 
     /**
      * 获取蜂鸟门店审核信息
@@ -314,29 +246,46 @@ public class ApiStoreServiceImpl implements ApiStoreService {
     @Override
     public Integer getFengniaoShopStatus(Shop shop, DspDelivery d, String lbClient) {
         Integer status = BindStatusEnum.UNBIND.status;
-//        ShopQueryVo shopQueryVo = new ShopQueryVo();
-//        shopQueryVo.setLbClient(lbClient);
-//        shopQueryVo.setOutShopCode(shop.getCode());
-//        shopQueryVo.setMerchantId(d.getShopId());
-//        shopQueryVo.setAccessToken(d.getAuthToken());
-//        ResObject<ShopQueryResultVo> shopRes = deliveryClient.queryShop(shopQueryVo);
-//        // 10-上架审核中,20-正常(已上架),30-上架审核失败,40-已冻结,50-已下架
-//        if (shopRes.getCode() == 0) {
-//            ShopQueryResultVo getShopStatus = shopRes.getData();
-//            Integer shopStatus = getShopStatus.getShopStatus();
-//            Integer modifyStatus = getShopStatus.getModifyStatus();
-//            if (10 == shopStatus){
-//                status=BindStatusEnum.CHECK.status;
-//            }else if (20 == shopStatus){
         status = BindStatusEnum.BIND.status;
-//            }else if (30 == shopStatus || 40 == shopStatus || 50 == shopStatus){
-//                status = BindStatusEnum.REFUND.status;
-//            }
-//        }
         return status;
     }
 
     @Override
+    public void changeShopDelivery(Long loginId,StoreStatusDto storeStatusDto) {
+        Shop shop = iShopService.getByCode(storeStatusDto.getShopCode());
+        if (shop == null) {
+            throw new CustomAppException("门店不存在!");
+        }
+        String deliverIds = storeStatusDto.getDeliveryIdStr();
+        if(StatusEnum.SHOW.getStatus().equals(storeStatusDto.getStatus())){
+            iShopDeliveryDisableService.remove(new QueryWrapper<ShopDeliveryDisable>().in("delivery_type",deliverIds).eq("shop_id",shop.getId()));
+        }else{
+            String[] ids = deliverIds.split(",");
+            for(int i=0;i<ids.length;i++){
+                ShopDeliveryDisable bean = new ShopDeliveryDisable();
+                bean.setAppId(storeStatusDto.getAppId());
+                bean.setDeliveryType(Long.valueOf(ids[i]));
+                bean.setShopId(shop.getId());
+                iShopDeliveryDisableService.save(bean);
+            }
+        }
+
+    }
+
+    @Override
+    public JSONObject queryhopDelivery(Long loginId, StoreStatusDto storeStatusDto) {
+        Shop shop = iShopService.getByCode(storeStatusDto.getShopCode());
+        if (shop == null) {
+            throw new CustomAppException("门店不存在!");
+        }
+        List<StoreDeliveryDto> list = iShopDeliveryDisableService.shopDelivery(shop.getId());
+        JSONObject json = new JSONObject();
+        json.put("shopCode",shop.getCode());
+        json.put("list",list);
+        return  json;
+    }
+
+    @Override
     @Transactional(rollbackFor = Exception.class)
     public Shop modify(Long loginId, StoreDto storeDto) {
         Shop shop = iShopService.getByCode(storeDto.getShopCode());
@@ -436,242 +385,4 @@ public class ApiStoreServiceImpl implements ApiStoreService {
         return  shop;
     }
 
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void delete(Long loginId, Integer shopId) {
-        log.info("删除门店id---" + shopId);
-        // 判断门店是否绑定美团、饿了么、饿百
-        List<WaimaiDto> shopWaimais = iShopWaimaiService.findList(shopId.longValue());
-        StringBuffer stringBuffer = new StringBuffer();
-        for (int i = 0; i < shopWaimais.size(); i++) {
-            if (shopWaimais.get(i).getBindStatus().equals(1)) {
-                stringBuffer.append(shopWaimais.get(i).getName());
-                if (shopWaimais.size() > 1 && i < shopWaimais.size() - 1) {
-                    stringBuffer.append(",");
-                }
-            }
-        }
-        if (StringUtils.isNotEmpty(stringBuffer.toString())) {
-            throw new CustomAppException("当前绑定[" + stringBuffer.toString() + "]请先解绑", 201);
-        }
-        iShopService.removeById(shopId);
-        // 删除门店账号,并且用户变为个人,如果是商家不管
-        List<ShopUser> shopUsers = iShopUserService.queryByShopId(shopId.longValue());
-        for (ShopUser u : shopUsers) {
-            Member member = iMemberService.getById(u.getMemberId());
-            if (member.getMemberType().equals(MemberTypeEnum.MERCHANT.type)) {
-                continue;
-            }
-            iMemberService.updateMember(member.getId());
-            iShopUserService.removeById(u.getId());
-        }
-
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void third(Long loginId, ShopReq shopReq) {
-        log.info("修改提交shopReq---" + JSONObject.toJSONString(shopReq));
-        ShopDelivery delivery = iShopDeliveryService.getOne(new QueryWrapper<ShopDelivery>().eq("shop_id", shopReq.getId()).eq("delivery_id", shopReq.getDeliveryId()));
-        log.info("delivery====" + JSONObject.toJSONString(delivery));
-        DspDelivery dspDelivery = iDspDeliveryService.getById(shopReq.getDeliveryId());
-        Member member = iMemberService.getById(loginId);
-        Merchant merchant = iMerchantService.getById(member.getMerchantId());
-        MerchantCategory category = iMerchantCategoryService.getById(merchant.getCategoryId());
-        merchant.setCategoryName(category.getFnProductType());
-        merchant.setMtCcategoryName(category.getMtProductType());
-        merchant.setBizLicense(shopReq.getBizLicense());
-        merchant.setBizLicenseNo(shopReq.getBizLicenseNo());
-        merchant.setLegalPerson(shopReq.getLegalPerson());
-        merchant.setIdcardNo(shopReq.getIdcardNo());
-        merchant.setIdcardFront(shopReq.getIdcardFront());
-        merchant.setIdcardBack(shopReq.getIdcardBack());
-        merchant.setBizLicenseIdcard(shopReq.getBizLicenseIdcard());
-        merchant.setDdCcategory(category.getDadaProductType());
-        merchant.setSsProductType(category.getSsProductType());
-        if (delivery.getThirdShopId() != null) {
-            Shop shop = iShopService.getById(shopReq.getId());
-            shopReq.setThirdShopId(delivery.getThirdShopId());
-            shopReq.setCode(shop.getCode());
-            ShopVo shopVo = ShopEditUtils.editShopVo(shopReq, dspDelivery, merchant);
-            if ("shunfeng".equals(shopVo.getLbClient()) || "uupt".equals(shopVo.getLbClient()) || "kuanfu".equals(shopVo.getLbClient())) {
-                delivery.setBindStatus(BindStatusEnum.BIND.getStatus());
-            }
-            ResObject<ShopResultVo> res = deliveryClient.updateShop(shopVo);
-            if (res.getCode() == 0) {//操作成功
-                ShopResultVo shopResultVo = res.getData();
-                String shopId = shopResultVo.getShopId();//返回的门店id,作保存以作后用
-                Object resData = shopResultVo.getResData(); //返回的详细数据
-                delivery.setBindStatus(BindStatusEnum.BIND.getStatus());
-                if (shopVo.getLbClient().equals("fengniao")) {
-                    Integer status = getFengniaoShopStatus(shop, dspDelivery, shopVo.getLbClient());
-                    delivery.setBindStatus(status);
-                }
-//                if (shopVo.getLbClient().equals("fengniaopt")){
-//                    Integer status =  getFengniaoShopStatus(shop,dspDelivery,shopVo.getLbClient());
-//                    delivery.setBindStatus(status);
-//                }
-                if ("meituan".equals(shopVo.getLbClient())) {
-                    delivery.setBindStatus(BindStatusEnum.CHECK.status);
-                }
-                delivery.setThirdShopId(shopId);
-            } else {
-                delivery.setAuthMsg(res.getMsg());
-                throw new CustomAppException(res.getMsg());
-            }
-            iShopDeliveryService.updateById(delivery);
-        } else {
-            Shop shop = new Shop();
-            BeanUtils.copyProperties(shopReq, shop);
-            ShopVo shopVo = ShopEntityUtils.createShopVo(shop, dspDelivery, merchant);
-            log.info("门店信息:" + JsonMapper.nonEmptyMapper().toJson(shopVo));
-            ResObject<ShopResultVo> res = deliveryClient.createShop(shopVo);
-            delivery.setBindStatus(BindStatusEnum.UNBIND.getStatus());
-            if ("shunfeng".equals(shopVo.getLbClient()) || "uupt".equals(shopVo.getLbClient()) || "kuanfu".equals(shopVo.getLbClient())) {
-                delivery.setBindStatus(BindStatusEnum.BIND.getStatus());
-            }
-            if (res.getCode() == 0) {//操作成功
-                ShopResultVo shopResultVo = res.getData();
-                String shopId = shopResultVo.getShopId();//返回的门店id,作保存以作后用
-                Object resData = shopResultVo.getResData(); //返回的详细数据
-                delivery.setBindStatus(BindStatusEnum.BIND.getStatus());
-                if (shopVo.getLbClient().equals("fengniao")) {
-                    Integer status = getFengniaoShopStatus(shop, dspDelivery, shopVo.getLbClient());
-                    delivery.setBindStatus(status);
-                }
-//                if (shopVo.getLbClient().equals("fengniaopt")){
-//                    Integer status =  getFengniaoShopStatus(shop,dspDelivery,shopVo.getLbClient());
-//                    delivery.setBindStatus(status);
-//                }
-                if (shopVo.getLbClient().equals("meituan")) {
-                    delivery.setBindStatus(BindStatusEnum.CHECK.getStatus());
-                }
-                delivery.setThirdShopId(shopId);
-            } else {
-                delivery.setAuthMsg(res.getMsg());
-                throw new CustomAppException(res.getMsg());
-            }
-            iShopDeliveryService.updateById(delivery);
-        }
-        ShopThird shopThird = new ShopThird();
-        shopThird.setShopId(shopReq.getId());
-        shopThird.setAddress(shopReq.getAddress());
-        shopThird.setContactName(shopReq.getContactName());
-        shopThird.setDoorHeadPhoto(shopReq.getDoorHeadPhoto());
-        shopThird.setLat(shopReq.getLat());
-        shopThird.setLng(shopReq.getLng());
-        shopThird.setCityCode(shopReq.getCityCode());
-        shopThird.setMobile(shopReq.getMobile());
-        shopThird.setName(shopReq.getName());
-        shopThird.setStreet(shopReq.getStreet());
-        shopThird.setDeliveryId(delivery.getDeliveryId());
-        shopThird.setProvinceName(shopReq.getProvinceName());
-        shopThird.setCityName(shopReq.getCityName());
-        shopThird.setDistrictName(shopReq.getDistrictName());
-
-        iShopThirdService.saveOrUpdate(shopThird);
-
-    }
-
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void callBackCreate(FengniaoV3CallbackStoreVo storeVo) {
-        Shop shop = iShopService.getOne(new QueryWrapper<Shop>().eq("code", storeVo.getOutShopCode()));
-        Integer deliveryType = DeliveryTypeEnums.FENG_NIAO.getType();
-        if ("5046731".equals(storeVo.getMerchantId())) {
-            deliveryType = DeliveryTypeEnums.FENG_NIAO_PT.getType();
-        }
-        if (shop == null) {
-            return;
-        }
-        DspDelivery delivery = iDspDeliveryService.findOne(deliveryType);
-        ShopDelivery sd = iShopDeliveryService.findOne(shop.getId(), delivery.getId());
-        Integer status = storeVo.getStatus(); // 门店认证状态
-        if (sd != null) {
-            sd.setThirdShopId(storeVo.getChainStoreId());
-            sd.setAuthMsg(storeVo.getRemark());
-            if (status == 10) { //上架审核中
-                sd.setBindStatus(BindStatusEnum.CHECK.status);
-                sd.setAuthMsg(storeVo.getStatusDesc());
-            } else if (status == 20) { //正常(已上架)
-                sd.setBindStatus(BindStatusEnum.BIND.status);
-            } else if (status == 30) { //上架审核失败
-                sd.setBindStatus(BindStatusEnum.REFUND.status);
-                sd.setAuthMsg(storeVo.getStatusDesc());
-            } else if (status == 40) { //已冻结
-
-            } else if (status == 50) { //已下架
-
-            }
-            iShopDeliveryService.updateById(sd);
-        }
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void callBackEdit(FengniaoV3CallbackStoreVo storeVo) {
-        Integer modifyStatus = storeVo.getModifyStatus(); //门店修改状态
-        Shop shop = iShopService.getOne(new QueryWrapper<Shop>().eq("code", storeVo.getOutShopCode()));
-        Integer deliveryType = DeliveryTypeEnums.FENG_NIAO.getType();
-        if ("5046731".equals(storeVo.getMerchantId())) {
-            deliveryType = DeliveryTypeEnums.FENG_NIAO_PT.getType();
-        }
-        DspDelivery delivery = iDspDeliveryService.findOne(deliveryType);
-        ShopDelivery sd = iShopDeliveryService.findOne(shop.getId(), delivery.getId());
-        if (sd != null) {
-            sd.setThirdShopId(storeVo.getChainStoreId());
-            sd.setAuthMsg(storeVo.getRemark());
-            if (modifyStatus == 0) { //无修改
-
-            } else if (modifyStatus == 10) { //资料修改审核中
-                sd.setBindStatus(BindStatusEnum.CHECK.status);
-                sd.setAuthMsg(storeVo.getStatusDesc());
-            } else if (modifyStatus == 20) { //审核通过
-                sd.setBindStatus(BindStatusEnum.BIND.status);
-            } else if (modifyStatus == 30) { //审核驳回
-                sd.setBindStatus(BindStatusEnum.REFUND.status);
-                sd.setAuthMsg(storeVo.getModifyStatusDesc());
-            }
-            iShopDeliveryService.updateById(sd);
-        }
-    }
-
-    @Override
-    public ShopDto findThirdDetail(Long loginId, Long shopId, Long deliveryId) {
-        ShopDto dto = new ShopDto();
-//        if (dto == null) {
-        dto = iShopService.findDetail(shopId);
-        // 查询经营类目
-        Merchant merchant = iMerchantService.getById(dto.getMerchantId());
-        if (merchant != null) {
-            MerchantCategory category = iMerchantCategoryService.getById(merchant.getCategoryId());
-            dto.setFnProductType(category.getFnProductType());
-        }
-//        }
-        // 不需要传入图片
-        Integer isNew = 0;
-        DspDelivery dspDelivery = iDspDeliveryService.getById(deliveryId);
-        if (dspDelivery != null) {
-            SysConfig pic = iSysConfigService.selectSysConfigByKey("FENGNIAO_PIC");
-            if (pic != null && (DeliveryTypeEnums.FENG_NIAO.getType().equals(dspDelivery.getType()) || DeliveryTypeEnums.FENG_NIAO_PT.getType().equals(dspDelivery.getType()))) {
-                if (pic.getConfigValue().equals("yes")) {
-                    isNew = 1;
-                }
-            }
-        }
-
-        dto.setIsPic(isNew);
-        return dto;
-    }
-
-    @Override
-    public List<ShopSelectDto> findShopSelectList(Long loginId) {
-        Member member = iMemberService.getById(loginId);
-        if (member.getMerchantId() == null) {
-            throw new CustomAppException("请先申请成为商家!");
-        }
-        return iShopService.findShopSelectList(member);
-    }
-
 }

+ 65 - 0
lb-module/src/main/java/com/ydd/module/domain/ShopDeliveryDisable.java

@@ -0,0 +1,65 @@
+package com.ydd.module.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import com.ydd.common.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+
+import java.math.BigDecimal;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 【请填写功能名称】对象 lb_shop_delivery_disable
+ * 
+ * @author douya
+ * @date 2022-04-07
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("lb_shop_delivery_disable")
+public class ShopDeliveryDisable implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
+    private Long shopId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
+    private String appId;
+
+    /** 运力 */
+    @Excel(name = "运力")
+    private Long deliveryType;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /** 更新时间 */
+    @TableField(update = "now()")
+    private Date updateTime;
+
+    /** 删除标识位: 0正常 1删除 */
+    @TableLogic
+    private Integer deleted;
+
+    @TableField(exist = false)
+    private Map<String, Object> params = new HashMap<>();
+}

+ 34 - 0
lb-module/src/main/java/com/ydd/module/dto/StoreDeliveryDto.java

@@ -0,0 +1,34 @@
+package com.ydd.module.dto;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * Project:lb-server
+ * Class:ShopReq
+ * Description:TODO
+ * Time:2022/4/6 18:24
+ *
+ * @author wangtao
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+public class StoreDeliveryDto implements Serializable {
+
+
+    /** 门店编号 */
+    @NotBlank(message = "门店编号不能为空")
+    private Integer deliveryId;
+
+    private String deliveryName;
+
+    private Integer bindStatus;
+    private String failMsg;
+    private Integer status;
+
+}

+ 18 - 0
lb-module/src/main/java/com/ydd/module/mapper/ShopDeliveryDisableMapper.java

@@ -0,0 +1,18 @@
+package com.ydd.module.mapper;
+
+import com.ydd.module.domain.ShopDeliveryDisable;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydd.module.dto.StoreDeliveryDto;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author douya
+ * @date 2022-04-07
+ */
+public interface ShopDeliveryDisableMapper extends BaseMapper<ShopDeliveryDisable> {
+
+    List<StoreDeliveryDto> shopDelivery(Long shopId);
+}

+ 18 - 0
lb-module/src/main/java/com/ydd/module/service/IShopDeliveryDisableService.java

@@ -0,0 +1,18 @@
+package com.ydd.module.service;
+
+import com.ydd.module.domain.ShopDeliveryDisable;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydd.module.dto.StoreDeliveryDto;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author douya
+ * @date 2022-04-07
+ */
+public interface IShopDeliveryDisableService extends IService<ShopDeliveryDisable> {
+
+    List<StoreDeliveryDto> shopDelivery(Long shopId);
+}

+ 30 - 0
lb-module/src/main/java/com/ydd/module/service/impl/ShopDeliveryDisableServiceImpl.java

@@ -0,0 +1,30 @@
+package com.ydd.module.service.impl;
+
+import com.ydd.module.dto.StoreDeliveryDto;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.apache.commons.lang3.StringUtils;
+import com.ydd.module.mapper.ShopDeliveryDisableMapper;
+import com.ydd.module.domain.ShopDeliveryDisable;
+import com.ydd.module.service.IShopDeliveryDisableService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author douya
+ * @date 2022-04-07
+ */
+@Service
+public class ShopDeliveryDisableServiceImpl extends ServiceImpl<ShopDeliveryDisableMapper, ShopDeliveryDisable> implements IShopDeliveryDisableService {
+
+
+    @Override
+    public List<StoreDeliveryDto> shopDelivery(Long shopId) {
+        return baseMapper.shopDelivery(shopId);
+    }
+}

+ 22 - 0
lb-module/src/main/resources/mapper/module/ShopDeliveryDisableMapper.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ydd.module.mapper.ShopDeliveryDisableMapper">
+    
+    <resultMap type="ShopDeliveryDisable" id="ShopDeliveryDisableResult">
+        <result property="id"    column="id"    />
+        <result property="shopId"    column="shop_id"    />
+        <result property="appId"    column="app_id"    />
+        <result property="deliveryType"    column="delivery_type"    />
+    </resultMap>
+
+    <select id="shopDelivery" resultType="com.ydd.module.dto.StoreDeliveryDto">
+        SELECT d.type deliveryId,d.`name` deliveryName,sd.bind_status,if(sd.bind_status!=1,sd.auth_msg,'') failMsg,
+        if(di.id is null,1,0) status
+        from lb_dsp_delivery d,lb_shop_delivery sd
+        LEFT JOIN lb_shop_delivery_disable di on sd.shop_id=di.shop_id
+        where sd.deleted=0  and sd.delivery_id=d.id and sd.shop_id=#{shopId}
+    </select>
+
+</mapper>