商家入驻,邀请码获取,分账 内部配送费给到平台
This commit is contained in:
parent
33c04e83e8
commit
a457667dbe
@ -123,9 +123,12 @@ public class EsignPlatformInfo implements Serializable {
|
||||
@ApiModelProperty(value = "分账比例值,取值范围:[0.01,1.00]")
|
||||
private BigDecimal split_ratio;
|
||||
|
||||
@ApiModelProperty(value = "记录状态:1-有效;2-无效;")
|
||||
@ApiModelProperty(value = "状态:1-已审核通过;2-审核未通过;3-待审中;")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "审核代理商备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "创建人用户ID")
|
||||
private String created_by;
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
package com.suisung.mall.common.modules.store;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -267,6 +268,10 @@ public class ShopMchEntry implements Serializable {
|
||||
@ApiModelProperty(value = "父入驻id(总店入驻id)")
|
||||
private Long parent_id;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "代理商邀请码")
|
||||
private String invite_code;
|
||||
|
||||
@ApiModelProperty(value = "该商家入驻记录是否有效,0:无效,1:有效")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ -95,6 +95,14 @@ public interface EsignPlatformInfoService {
|
||||
*/
|
||||
EsignPlatformInfo getMch2ndAgentWithShippingFee(Long mchId);
|
||||
|
||||
/**
|
||||
* 根据代理邀请码获取代理商 信息
|
||||
*
|
||||
* @param inviteCode
|
||||
* @return
|
||||
*/
|
||||
EsignPlatformInfo getByInviteCode(String inviteCode);
|
||||
|
||||
/**
|
||||
* 根据代理商ID获取供应商 商家ID
|
||||
*
|
||||
|
||||
@ -418,6 +418,41 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EsignPlatformInfo getByInviteCode(String inviteCode) {
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(inviteCode)) {
|
||||
log.warn("[根据邀请码获取代理商] 邀请码不能为空");
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
log.debug("[根据邀请码获取代理商] 开始查询代理商信息,邀请码: {}", inviteCode);
|
||||
|
||||
// 根据邀请码查询代理商信息,状态必须为启用状态
|
||||
EsignPlatformInfo result = getOne(
|
||||
new LambdaQueryWrapper<EsignPlatformInfo>()
|
||||
.eq(EsignPlatformInfo::getInvite_code, inviteCode)
|
||||
.eq(EsignPlatformInfo::getStatus, CommonConstant.Enable)
|
||||
.orderByAsc(EsignPlatformInfo::getId),
|
||||
false
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
log.debug("[根据邀请码获取代理商] 成功获取代理商信息,ID: {}, 公司名: {}",
|
||||
result.getId(), result.getLicense_company());
|
||||
} else {
|
||||
log.warn("[根据邀请码获取代理商] 未找到有效的代理商信息,邀请码: {}", inviteCode);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("[根据邀请码获取代理商] 查询过程中发生异常,邀请码: {}", inviteCode, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据代理商ID获取供应商商家ID
|
||||
*
|
||||
@ -517,6 +552,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
||||
record.setRec_acc_clear_bank_no(record.getRec_acc_bank_no());
|
||||
record.setRec_acc_type(2); // 款账户账户类型:1-个人(对私);2-企业(对公);
|
||||
record.setStatus(3); // 状态:1-已审核通过;2-审核未通过;3-待审中;
|
||||
record.setRemark("(待审中)申请已提交,请等待平台审核");
|
||||
|
||||
if (StrUtil.isBlank(record.getCreated_by())) {
|
||||
record.setCreated_by(userId);
|
||||
@ -673,6 +709,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
|
||||
// 如果 esign_platform_info 记录不存在,新增esign_platform_info 记录
|
||||
// 状态:1-已审核通过;2-审核未通过;3-待审中;
|
||||
record.setStatus(CommonConstant.Enable);
|
||||
record.setRemark("(审核已通过)您申请的代理商资质,平台已审核通过,请邀请商家入驻平台");
|
||||
Boolean result = addOrUpdateEsignPlatformInfo(record);
|
||||
if (!result) {
|
||||
throw new ApiException("保存代理商信息失败");
|
||||
|
||||
@ -2533,35 +2533,47 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
||||
|
||||
// 平台分账参数
|
||||
if (CheckUtil.isNotEmpty(platformAmount) && platformAmount > 0) {
|
||||
if (!has2ndAgent && CheckUtil.isNotEmpty(shoppingFeeInner)) {
|
||||
// 没有县级代理商的时候,配送费暂由平台代收 add 2025-10-11
|
||||
// if (!has2ndAgent && CheckUtil.isNotEmpty(shoppingFeeInner)) {
|
||||
// // 没有县级代理商的时候,配送费暂由平台代收 add 2025-10-11
|
||||
// V3SacsSeparateRecvDatas receiver = new V3SacsSeparateRecvDatas();
|
||||
// receiver.setRecvNo(platformReceiver.getReceiver_no());
|
||||
// receiver.setSeparateValue(Convert.toStr(platformAmount + shoppingFeeInner));
|
||||
// recvDatas.add(receiver);
|
||||
// } else {
|
||||
// V3SacsSeparateRecvDatas receiver = new V3SacsSeparateRecvDatas();
|
||||
// receiver.setRecvNo(platformReceiver.getReceiver_no());
|
||||
// receiver.setSeparateValue(Convert.toStr(platformAmount));
|
||||
// recvDatas.add(receiver);
|
||||
// }
|
||||
|
||||
// 不管有没有县级代理商,内部配送费都交给平台收取 2026-01-26 update
|
||||
V3SacsSeparateRecvDatas receiver = new V3SacsSeparateRecvDatas();
|
||||
receiver.setRecvNo(platformReceiver.getReceiver_no());
|
||||
receiver.setSeparateValue(Convert.toStr(platformAmount + shoppingFeeInner));
|
||||
recvDatas.add(receiver);
|
||||
} else {
|
||||
V3SacsSeparateRecvDatas receiver = new V3SacsSeparateRecvDatas();
|
||||
receiver.setRecvNo(platformReceiver.getReceiver_no());
|
||||
receiver.setSeparateValue(Convert.toStr(platformAmount));
|
||||
recvDatas.add(receiver);
|
||||
}
|
||||
}
|
||||
|
||||
// 县级代理商分账参数
|
||||
// 有县级代理商分账情况
|
||||
if (has2ndAgent) {
|
||||
if (CheckUtil.isNotEmpty(shoppingFeeInner)) {
|
||||
// 有县级代理商的时候,配送费暂由它代收 add 2025-10-11
|
||||
V3SacsSeparateRecvDatas shippingFeeReceiver = new V3SacsSeparateRecvDatas();
|
||||
shippingFeeReceiver.setRecvNo(agent2ndReceiver.getReceiver_no());
|
||||
shippingFeeReceiver.setSeparateValue(Convert.toStr(agent2ndAmount + shoppingFeeInner));
|
||||
recvDatas.add(shippingFeeReceiver);
|
||||
} else {
|
||||
// if (CheckUtil.isNotEmpty(shoppingFeeInner)) {
|
||||
// // 有县级代理商的时候,配送费暂由它代收 add 2025-10-11
|
||||
// V3SacsSeparateRecvDatas shippingFeeReceiver = new V3SacsSeparateRecvDatas();
|
||||
// shippingFeeReceiver.setRecvNo(agent2ndReceiver.getReceiver_no());
|
||||
// shippingFeeReceiver.setSeparateValue(Convert.toStr(agent2ndAmount + shoppingFeeInner));
|
||||
// recvDatas.add(shippingFeeReceiver);
|
||||
// } else {
|
||||
// V3SacsSeparateRecvDatas receiver = new V3SacsSeparateRecvDatas();
|
||||
// receiver.setRecvNo(agent2ndReceiver.getReceiver_no());
|
||||
// receiver.setSeparateValue(Convert.toStr(agent2ndAmount));
|
||||
// recvDatas.add(receiver);
|
||||
// }
|
||||
|
||||
// 不管有没有县级代理商,内部配送费都交给平台收取 2026-01-26 update
|
||||
V3SacsSeparateRecvDatas receiver = new V3SacsSeparateRecvDatas();
|
||||
receiver.setRecvNo(agent2ndReceiver.getReceiver_no());
|
||||
receiver.setSeparateValue(Convert.toStr(agent2ndAmount));
|
||||
recvDatas.add(receiver);
|
||||
}
|
||||
}
|
||||
|
||||
// 省级代理商分账参数
|
||||
if (CheckUtil.isNotEmpty(agent1stSplitRatio) && agent1stReceiver != null &&
|
||||
|
||||
@ -27,6 +27,7 @@ import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.domain.UserDto;
|
||||
import com.suisung.mall.common.feignService.AccountService;
|
||||
import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||
import com.suisung.mall.common.modules.esign.EsignPlatformInfo;
|
||||
import com.suisung.mall.common.modules.lakala.LklLedgerEc;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreEmployee;
|
||||
@ -72,6 +73,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
@Resource
|
||||
private ShopMessageTemplateService shopMessageTemplateService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private EsignPlatformInfoService esignPlatformInfoService;
|
||||
|
||||
@ -408,6 +410,16 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
record.setApproval_remark("您的申请入驻平台材料已提交,待审中,请耐心等待!");
|
||||
record.setStatus(CommonConstant.Enable);
|
||||
|
||||
// 代理商id
|
||||
String inviteCode = shopMerchEntryJSON.getStr("invite_code", "");
|
||||
EsignPlatformInfo esignPlatformInfo = esignPlatformInfoService.getByInviteCode(inviteCode);
|
||||
if (esignPlatformInfo == null || !CommonConstant.Agent_Level_2nd.equals(esignPlatformInfo.getLevel())) {
|
||||
log.warn("注意:商家入住时:通过邀请码: {},找不到二级代理商", inviteCode);
|
||||
record.setDistributor_id(0L);
|
||||
} else {
|
||||
record.setDistributor_id(esignPlatformInfo.getId());
|
||||
}
|
||||
|
||||
// 转换拉卡拉的日期格式 yyyy-MM-dd
|
||||
record = convLklDateFormat(record);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user