Compare commits
No commits in common. "dfab392ed69ad0a1d22ed32b7fcbd0a4ea44139f" and "f2b7283fa5a37e5f2d6d57feffb0f7441b73d82b" have entirely different histories.
dfab392ed6
...
f2b7283fa5
@ -73,12 +73,4 @@ public interface EsignPlatformInfoService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
EsignPlatformInfo getMch2ndAgentWithShippingFee(Long mchId);
|
EsignPlatformInfo getMch2ndAgentWithShippingFee(Long mchId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据代理商ID获取供应商 商家ID
|
|
||||||
*
|
|
||||||
* @param agentId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
String getSupplierIdByAgentId(Long agentId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
|||||||
} else {
|
} else {
|
||||||
log.debug("[获取平台和代理商信息] 未找到一级代理,parent_id: {}", agent2nd.getParent_id());
|
log.debug("[获取平台和代理商信息] 未找到一级代理,parent_id: {}", agent2nd.getParent_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
log.debug("[获取平台和代理商信息] 查询完成,共获取 {} 条记录", esignPlatformInfos.size());
|
log.debug("[获取平台和代理商信息] 查询完成,共获取 {} 条记录", esignPlatformInfos.size());
|
||||||
return esignPlatformInfos;
|
return esignPlatformInfos;
|
||||||
}
|
}
|
||||||
@ -294,46 +294,4 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据代理商ID获取供应商商家ID
|
|
||||||
*
|
|
||||||
* @param agentId 代理商ID
|
|
||||||
* @return 供应商商家ID,未找到时返回空字符串
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getSupplierIdByAgentId(Long agentId) {
|
|
||||||
// 参数校验
|
|
||||||
if (agentId == null || agentId <= 0) {
|
|
||||||
log.warn("[获取供应商ID] 参数校验失败:代理商ID为空或无效,agentId={}", agentId);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
log.debug("[获取供应商ID] 开始查询供应商信息,agentId={}", agentId);
|
|
||||||
|
|
||||||
// 构建查询条件
|
|
||||||
QueryWrapper<EsignPlatformInfo> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("id", agentId)
|
|
||||||
.eq("level", CommonConstant.Agent_Level_2nd)
|
|
||||||
.eq("status", CommonConstant.Enable)
|
|
||||||
.select("supplier_id");
|
|
||||||
|
|
||||||
// 查询记录
|
|
||||||
EsignPlatformInfo result = getOne(queryWrapper);
|
|
||||||
|
|
||||||
// 检查结果并返回
|
|
||||||
if (result != null && StrUtil.isNotBlank(result.getSupplier_id())) {
|
|
||||||
log.debug("[获取供应商ID] 成功获取供应商ID,agentId={}, supplierId={}", agentId, result.getSupplier_id());
|
|
||||||
return result.getSupplier_id();
|
|
||||||
} else {
|
|
||||||
log.debug("[获取供应商ID] 未找到有效的供应商ID,agentId={}", agentId);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("[获取供应商ID] 查询过程中发生异常,agentId={}", agentId, e);
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,5 +115,4 @@ public interface LklLedgerReceiverService extends IBaseService<LklLedgerReceiver
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
LklLedgerReceiver getMch2ndAgent(Long mchId);
|
LklLedgerReceiver getMch2ndAgent(Long mchId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
|||||||
import com.suisung.mall.shop.esign.service.EsignPlatformInfoService;
|
import com.suisung.mall.shop.esign.service.EsignPlatformInfoService;
|
||||||
import com.suisung.mall.shop.lakala.mapper.LklLedgerReceiverMapper;
|
import com.suisung.mall.shop.lakala.mapper.LklLedgerReceiverMapper;
|
||||||
import com.suisung.mall.shop.lakala.service.LakalaApiService;
|
import com.suisung.mall.shop.lakala.service.LakalaApiService;
|
||||||
|
import com.suisung.mall.shop.lakala.service.LklLedgerMemberService;
|
||||||
import com.suisung.mall.shop.lakala.service.LklLedgerReceiverService;
|
import com.suisung.mall.shop.lakala.service.LklLedgerReceiverService;
|
||||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -48,6 +49,10 @@ public class LklLedgerReceiverServiceImpl extends BaseServiceImpl<LklLedgerRecei
|
|||||||
@Resource
|
@Resource
|
||||||
private LakalaApiService lakalaApiService;
|
private LakalaApiService lakalaApiService;
|
||||||
|
|
||||||
|
@Lazy
|
||||||
|
@Resource
|
||||||
|
private LklLedgerMemberService lklLedgerMemberService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopMchEntryService shopMchEntryService;
|
private ShopMchEntryService shopMchEntryService;
|
||||||
|
|
||||||
@ -476,7 +481,7 @@ public class LklLedgerReceiverServiceImpl extends BaseServiceImpl<LklLedgerRecei
|
|||||||
result = findOne(queryWrapper);
|
result = findOne(queryWrapper);
|
||||||
log.debug("[获取二级代理] 使用区域信息查询,districtId={}", shopMchEntry.getStore_district());
|
log.debug("[获取二级代理] 使用区域信息查询,districtId={}", shopMchEntry.getStore_district());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
log.info("[获取二级代理] 未找到匹配的二级代理信息,mchId={}", mchId);
|
log.info("[获取二级代理] 未找到匹配的二级代理信息,mchId={}", mchId);
|
||||||
} else {
|
} else {
|
||||||
@ -490,5 +495,4 @@ public class LklLedgerReceiverServiceImpl extends BaseServiceImpl<LklLedgerRecei
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -909,8 +909,8 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
return Pair.of(false, "[预约订单校验] 请在店铺营业时间内预约下单");
|
return Pair.of(false, "[预约订单校验] 请在店铺营业时间内预约下单");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7. 预约时间范围检查 - 仅能预约50分钟后的订单(防止用户在下单页面停留太长,45分钟也是可以通过的)
|
// 7. 预约时间范围检查 - 仅能预约50分钟后的订单
|
||||||
Date fortyFiveMinutesLater = DateUtil.offsetMinute(new Date(), 45);
|
Date fortyFiveMinutesLater = DateUtil.offsetMinute(new Date(), 50);
|
||||||
if (!bookingBeginTime.after(fortyFiveMinutesLater)) {
|
if (!bookingBeginTime.after(fortyFiveMinutesLater)) {
|
||||||
return Pair.of(false, "[预约订单校验] 请预约50分后的订单");
|
return Pair.of(false, "[预约订单校验] 请预约50分后的订单");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,6 @@ public interface SFExpressApiService {
|
|||||||
/**
|
/**
|
||||||
* 创建顺丰同店铺-连锁店铺
|
* 创建顺丰同店铺-连锁店铺
|
||||||
*
|
*
|
||||||
* @param mchId 商家入驻编号
|
|
||||||
* @param storeId 商家门店ID
|
* @param storeId 商家门店ID
|
||||||
* @param shopName 店名
|
* @param shopName 店名
|
||||||
* @param cityName 城市
|
* @param cityName 城市
|
||||||
@ -40,7 +39,7 @@ public interface SFExpressApiService {
|
|||||||
* @param latitude 纬度
|
* @param latitude 纬度
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Pair<Boolean, String> createSfExpressShop(Long mchId, Integer storeId, String shopName, String cityName, String shopAddress, String contactName, String contactPhone, String longitude, String latitude);
|
Pair<Boolean, String> createSfExpressShop(Integer storeId, String shopName, String cityName, String shopAddress, String contactName, String contactPhone, String longitude, String latitude);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -32,7 +32,6 @@ import com.suisung.mall.common.pojo.req.*;
|
|||||||
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
||||||
import com.suisung.mall.common.pojo.to.AddressParseResultTO;
|
import com.suisung.mall.common.pojo.to.AddressParseResultTO;
|
||||||
import com.suisung.mall.common.utils.*;
|
import com.suisung.mall.common.utils.*;
|
||||||
import com.suisung.mall.shop.esign.service.EsignPlatformInfoService;
|
|
||||||
import com.suisung.mall.shop.message.service.PushMessageService;
|
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
import com.suisung.mall.shop.order.service.ShopOrderBaseService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
||||||
@ -120,10 +119,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductItemService shopProductItemService;
|
private ShopProductItemService shopProductItemService;
|
||||||
|
|
||||||
@Lazy
|
|
||||||
@Autowired
|
|
||||||
private EsignPlatformInfoService esignPlatformInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建顺丰同店铺-连锁店铺
|
* 创建顺丰同店铺-连锁店铺
|
||||||
*
|
*
|
||||||
@ -184,7 +179,8 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
logger.error("创建顺丰同店铺:联系人手机号不能为空");
|
logger.error("创建顺丰同店铺:联系人手机号不能为空");
|
||||||
return Pair.of(false, "联系人手机号不能为空");
|
return Pair.of(false, "联系人手机号不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AddressParseResultTO addressParseResultTO = AddressUtil.parseAddress(shopMchEntry.getStore_address());
|
AddressParseResultTO addressParseResultTO = AddressUtil.parseAddress(shopMchEntry.getStore_address());
|
||||||
// 解析城市名称
|
// 解析城市名称
|
||||||
String cityName = "桂平市"; // 默认城市
|
String cityName = "桂平市"; // 默认城市
|
||||||
@ -216,7 +212,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
// 调用创建店铺方法
|
// 调用创建店铺方法
|
||||||
Pair<Boolean, String> result = createSfExpressShop(
|
Pair<Boolean, String> result = createSfExpressShop(
|
||||||
mchId,
|
|
||||||
Convert.toInt(shopMchEntry.getStore_id()),
|
Convert.toInt(shopMchEntry.getStore_id()),
|
||||||
shopStoreName,
|
shopStoreName,
|
||||||
cityName,
|
cityName,
|
||||||
@ -233,9 +228,8 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建顺丰同店铺-连锁店铺
|
* 创建顺丰同城(普通型)店铺
|
||||||
*
|
*
|
||||||
* @param mchId 商家入驻编号
|
|
||||||
* @param storeId 商家门店ID
|
* @param storeId 商家门店ID
|
||||||
* @param shopName 店名
|
* @param shopName 店名
|
||||||
* @param cityName 城市
|
* @param cityName 城市
|
||||||
@ -244,18 +238,18 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
* @param contactPhone 店铺电话
|
* @param contactPhone 店铺电话
|
||||||
* @param longitude 经度
|
* @param longitude 经度
|
||||||
* @param latitude 纬度
|
* @param latitude 纬度
|
||||||
* @return
|
* @return Pair<Boolean, String> 第一个元素表示是否成功,第二个元素表示结果信息或错误信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Pair<Boolean, String> createSfExpressShop(Long mchId, Integer storeId, String shopName, String cityName,
|
public Pair<Boolean, String> createSfExpressShop(Integer storeId, String shopName, String cityName,
|
||||||
String shopAddress, String contactName, String contactPhone,
|
String shopAddress, String contactName, String contactPhone,
|
||||||
String longitude, String latitude) {
|
String longitude, String latitude) {
|
||||||
logger.info("开始创建顺丰同城店铺, storeId: {}", storeId);
|
logger.info("开始创建顺丰同城店铺, storeId: {}", storeId);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 1. 验证必要参数
|
// 1. 验证必要参数
|
||||||
if (CheckUtil.isEmpty(mchId) || CheckUtil.isEmpty(storeId) || StringUtils.isAnyBlank(shopName, shopAddress, contactName, contactPhone)) {
|
if (CheckUtil.isEmpty(storeId) || StringUtils.isAnyBlank(shopName, shopAddress, contactName, contactPhone)) {
|
||||||
logger.error("创建顺丰店铺,缺少必要参数!mchId:{}, storeId:{},shopName:{},shopAddress:{},contactName:{},contactPhone:{}", mchId, storeId, shopName, shopAddress, contactName, contactPhone);
|
logger.error("创建顺丰店铺,缺少必要参数!storeId:{},shopName:{},shopAddress:{},contactName:{},contactPhone:{}", storeId, shopName, shopAddress, contactName, contactPhone);
|
||||||
return Pair.of(false, "创建顺丰店铺,缺少必要参数!");
|
return Pair.of(false, "创建顺丰店铺,缺少必要参数!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,28 +278,9 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShopMchEntry shopMchEntry = shopMchEntryService.shopMerchEntryById(mchId);
|
|
||||||
if (shopMchEntry == null) {
|
|
||||||
logger.error("无法找到商家入驻信息!");
|
|
||||||
return Pair.of(false, "无法找到商家入驻信息");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 二级代理商的商家 Id
|
|
||||||
String sfSupplierId = "";
|
|
||||||
// 获取创建店铺的商家Id(由店铺的县级代理商提供)
|
|
||||||
if (CheckUtil.isNotEmpty(shopMchEntry.getDistributor_id())) {
|
|
||||||
logger.debug("获取创建店铺的县级代理商Id: distributorId={}", shopMchEntry.getDistributor_id());
|
|
||||||
sfSupplierId = esignPlatformInfoService.getSupplierIdByAgentId(shopMchEntry.getDistributor_id());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 县级代理商如果没有商家Id,直接获取默认配置的商家Id
|
|
||||||
if (StrUtil.isBlank(sfSupplierId)) {
|
|
||||||
sfSupplierId = supplierId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 构建请求参数
|
// 4. 构建请求参数
|
||||||
Map<String, Object> params = buildCommonParams();
|
Map<String, Object> params = buildCommonParams();
|
||||||
params.put("supplier_id", sfSupplierId); // 店铺所属商家id(应该由县级代理商提供)
|
params.put("supplier_id", supplierId); // 店铺所属商家id
|
||||||
params.put("out_shop_id", storeId); // 外部店铺ID
|
params.put("out_shop_id", storeId); // 外部店铺ID
|
||||||
params.put("shop_name", shopName); // 店铺名称
|
params.put("shop_name", shopName); // 店铺名称
|
||||||
params.put("city_name", cityName); // 城市名称
|
params.put("city_name", cityName); // 城市名称
|
||||||
|
|||||||
@ -190,6 +190,8 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
@Lazy
|
@Lazy
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxQrCodeService wxQrCodeService;
|
private WxQrCodeService wxQrCodeService;
|
||||||
|
@Autowired
|
||||||
|
private I18nUtil i18nUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3286,7 +3288,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
shopStoreInfo.setStore_close_hours("21:30");
|
shopStoreInfo.setStore_close_hours("21:30");
|
||||||
shopStoreInfo.setStore_discount(BigDecimal.valueOf(10));
|
shopStoreInfo.setStore_discount(BigDecimal.valueOf(10));
|
||||||
shopStoreInfo.setStore_banner(storeFacadeImage);
|
shopStoreInfo.setStore_banner(storeFacadeImage);
|
||||||
|
|
||||||
shopStoreInfo.setStore_tel(contact_mobile);
|
shopStoreInfo.setStore_tel(contact_mobile);
|
||||||
shopStoreInfo.setContact_mobile(contact_mobile);
|
shopStoreInfo.setContact_mobile(contact_mobile);
|
||||||
shopStoreInfo.setContact_name(shopMchEntry.getContact_name());
|
shopStoreInfo.setContact_name(shopMchEntry.getContact_name());
|
||||||
@ -3430,8 +3432,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
|||||||
if (storeArea != null) {
|
if (storeArea != null) {
|
||||||
String[] areaNames = storeArea.split("/");
|
String[] areaNames = storeArea.split("/");
|
||||||
String cityName = areaNames.length > 0 ? areaNames[areaNames.length - 1] : storeArea.replace("/", "");
|
String cityName = areaNames.length > 0 ? areaNames[areaNames.length - 1] : storeArea.replace("/", "");
|
||||||
|
sfExpressApiService.createSfExpressShop(storeId, shopMchEntry.getStore_name(),
|
||||||
sfExpressApiService.createSfExpressShop(mchId, storeId, shopMchEntry.getStore_name(),
|
|
||||||
cityName, shopMchEntry.getStore_address(), shopMchEntry.getContact_name(),
|
cityName, shopMchEntry.getStore_address(), shopMchEntry.getContact_name(),
|
||||||
contact_mobile, shopMchEntry.getStore_longitude(), shopMchEntry.getStore_latitude());
|
contact_mobile, shopMchEntry.getStore_longitude(), shopMchEntry.getStore_latitude());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user