|
@@ -1,41 +1,26 @@
|
|
|
package com.ydd.app.service.impl;
|
|
|
|
|
|
import cn.hutool.core.lang.UUID;
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baidu.aip.ocr.AipOcr;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
-import com.ydd.api.DeliveryService;
|
|
|
-import com.ydd.app.ShopEditUtils;
|
|
|
-import com.ydd.app.ShopEntityUtils;
|
|
|
import com.ydd.app.dto.*;
|
|
|
import com.ydd.app.service.*;
|
|
|
+import com.ydd.module.dto.OpenCustomerDto;
|
|
|
import com.ydd.app.vo.OpenMemberInfoVo;
|
|
|
import com.ydd.common.constant.Constants;
|
|
|
import com.ydd.common.core.domain.ResponseResult;
|
|
|
+import com.ydd.common.core.page.PageResult;
|
|
|
import com.ydd.common.core.redis.RedisCache;
|
|
|
-import com.ydd.common.enums.DeliveryTypeEnums;
|
|
|
import com.ydd.common.enums.ResponseResultCodeEnum;
|
|
|
import com.ydd.common.utils.DateUtils;
|
|
|
import com.ydd.common.utils.SnCodeUtils;
|
|
|
import com.ydd.common.utils.sign.Md5Utils;
|
|
|
-import com.ydd.ecloud.core.utils.JsonMapper;
|
|
|
import com.ydd.framework.web.service.TokenService;
|
|
|
import com.ydd.module.domain.*;
|
|
|
-import com.ydd.module.dto.DeliveryConfigDto;
|
|
|
-import com.ydd.module.dto.StoreDeliveryDto;
|
|
|
import com.ydd.module.enums.*;
|
|
|
-import com.ydd.module.expection.CustomAppException;
|
|
|
import com.ydd.module.service.*;
|
|
|
-import com.ydd.third.common.utils.AddressLngLatExchanger;
|
|
|
-import com.ydd.third.common.utils.CoordinateUtils;
|
|
|
-import com.ydd.third.common.vo.ResObject;
|
|
|
-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.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.xmlbeans.impl.xb.xsdschema.AppinfoDocument;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -43,7 +28,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ydd.module.enums.CacheKeyEnum.SMS_REGISTER_CAPTCHA;
|
|
|
|
|
@@ -238,7 +222,7 @@ public class ApiDevelopServiceImpl implements ApiDevelopService {
|
|
|
@Override
|
|
|
public ResponseResult editMemberInfo(OpenMemberInfoDto memberInfoDto) {
|
|
|
Member member = iMemberService.getMemberByMobile(memberInfoDto.getResistMobile());
|
|
|
- ResponseResult result = specialJudge(member, memberInfoDto.getResistMobile(), memberInfoDto.getCode());
|
|
|
+ ResponseResult result = memberInfoJudge(member, memberInfoDto.getResistMobile(), memberInfoDto.getCode());
|
|
|
if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
|
|
|
return result;
|
|
|
}
|
|
@@ -253,7 +237,7 @@ public class ApiDevelopServiceImpl implements ApiDevelopService {
|
|
|
@Override
|
|
|
public ResponseResult editMemberPassword(OpenMemberPasswordDto memberPasswordDto) {
|
|
|
Member member = iMemberService.getMemberByMobile(memberPasswordDto.getResistMobile());
|
|
|
- ResponseResult result = specialJudge(member, memberPasswordDto.getResistMobile(), memberPasswordDto.getCode());
|
|
|
+ ResponseResult result = memberInfoJudge(member, memberPasswordDto.getResistMobile(), memberPasswordDto.getCode());
|
|
|
if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
|
|
|
return result;
|
|
|
}
|
|
@@ -267,7 +251,47 @@ public class ApiDevelopServiceImpl implements ApiDevelopService {
|
|
|
return ResponseResult.success();
|
|
|
}
|
|
|
|
|
|
- private ResponseResult specialJudge(Member member, String resistMobile, String code) {
|
|
|
+ @Override
|
|
|
+ public ResponseResult appSecretInfo(Long loginId) {
|
|
|
+ ResponseResult result = appInfoJudge(loginId);
|
|
|
+ if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ AppInfo appInfo = (AppInfo) result.getData();
|
|
|
+
|
|
|
+ List<AppInfo> appInfoList = iAppInfoService.list(new QueryWrapper<AppInfo>().eq("deleted", 0).eq("name", appInfo.getName()));
|
|
|
+ return ResponseResult.success(appInfoList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseResult setCallbackUrl(Long loginId, AppInfo appInfo) {
|
|
|
+ ResponseResult result = appInfoJudge(loginId);
|
|
|
+ if (result.getCode() != ResponseResultCodeEnum.SUCCESS.getCode()) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ AppInfo oldAppInfo = (AppInfo) result.getData();
|
|
|
+
|
|
|
+ List<AppInfo> appInfoList = iAppInfoService.list(new QueryWrapper<AppInfo>().eq("deleted", 0).eq("name", oldAppInfo.getName()));
|
|
|
+
|
|
|
+ appInfoList.stream().forEach(appInfo1 -> {
|
|
|
+ appInfo1.setStoreStatusNotifyUrl(appInfo.getStoreStatusNotifyUrl());
|
|
|
+ appInfo1.setOrderStatusNotifyUrl(appInfo.getOrderStatusNotifyUrl());
|
|
|
+
|
|
|
+ iAppInfoService.updateById(appInfo1);
|
|
|
+ });
|
|
|
+
|
|
|
+ return ResponseResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseResult selectCustomerList(String cityName, String businessName, String contactName) {
|
|
|
+ List<OpenCustomerDto> customerVoList = iMerchantService.selectCustomerList(cityName, businessName, contactName);
|
|
|
+ return ResponseResult.success(new PageResult(customerVoList));
|
|
|
+ }
|
|
|
+
|
|
|
+ private ResponseResult memberInfoJudge(Member member, String resistMobile, String code) {
|
|
|
ResponseResult result = ResponseResult.success();
|
|
|
|
|
|
if (Objects.isNull(member)) {
|
|
@@ -281,8 +305,9 @@ public class ApiDevelopServiceImpl implements ApiDevelopService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public ResponseResult appSecretInfo(Long loginId) {
|
|
|
+ private ResponseResult appInfoJudge(Long loginId) {
|
|
|
+ ResponseResult result = ResponseResult.success();
|
|
|
+
|
|
|
Member member = iMemberService.getById(loginId);
|
|
|
if (Objects.isNull(member)) {
|
|
|
return ResponseResult.error(ResponseResultCodeEnum.REFRESH_TOKEN_INVALID);
|
|
@@ -294,8 +319,8 @@ public class ApiDevelopServiceImpl implements ApiDevelopService {
|
|
|
return ResponseResult.error(ResponseResultCodeEnum.APP_ID_ERR);
|
|
|
}
|
|
|
|
|
|
- List<AppInfo> appInfoList = iAppInfoService.list(new QueryWrapper<AppInfo>().eq("deleted", 0).eq("name", appInfo.getName()));
|
|
|
- return ResponseResult.success(appInfoList);
|
|
|
+ result.setData(appInfo);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
}
|