|
@@ -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);
|
|
|
- }
|
|
|
-
|
|
|
}
|