Merge branch 'main' into dev
This commit is contained in:
commit
7253649412
@ -63,8 +63,8 @@ public class GlobalExceptionHandler {
|
||||
.map(ConstraintViolation::getMessage)
|
||||
.collect(Collectors.joining("; "));
|
||||
|
||||
logError(req, "约束违反异常", e);
|
||||
return CommonResult.validateFailed("系统数据异常,请联系管理员!");
|
||||
logError(req, "数据库约束违反异常", e);
|
||||
return CommonResult.validateFailed("记录是否已存在,请检查!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -27,38 +27,78 @@ import java.util.regex.Pattern;
|
||||
@Slf4j
|
||||
public class CheckUtil {
|
||||
|
||||
// private static String[] parsePatterns = {"yyyy-MM-dd", "yyyy年MM月dd日",
|
||||
// "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy/MM/dd",
|
||||
// "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyyMMdd"};
|
||||
|
||||
/**
|
||||
* 校验数据 不为null和0
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
* @param param 待校验的Integer值
|
||||
* @return boolean 不为null且不为0返回true,否则返回false
|
||||
*/
|
||||
public static boolean isNotEmpty(Integer param) {
|
||||
return param != null && param != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验数据 不为null和0
|
||||
*
|
||||
* @param param 待校验的Long值
|
||||
* @return boolean 不为null且不为0返回true,否则返回false
|
||||
*/
|
||||
public static boolean isNotEmpty(Long param) {
|
||||
return param != null && param != 0;
|
||||
return param != null && param != 0L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验数据 不为null和0
|
||||
*
|
||||
* @param param 待校验的BigDecimal值
|
||||
* @return boolean 不为null且不为0返回true,否则返回false
|
||||
*/
|
||||
public static boolean isNotEmpty(BigDecimal param) {
|
||||
return param != null && param.floatValue() != 0;
|
||||
return param != null && param.compareTo(BigDecimal.ZERO) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验数据 不为null和0
|
||||
*
|
||||
* @param param 待校验的Float值
|
||||
* @return boolean 不为null且不为0返回true,否则返回false
|
||||
*/
|
||||
public static boolean isNotEmpty(Float param) {
|
||||
return param != null && param != 0;
|
||||
return param != null && param != 0f && !param.isNaN();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验数据 不为null和0
|
||||
*
|
||||
* @param param 待校验的Double值
|
||||
* @return boolean 不为null且不为0返回true,否则返回false
|
||||
*/
|
||||
public static boolean isNotEmpty(Double param) {
|
||||
return param != null && param != 0;
|
||||
return param != null && param != 0d && !param.isNaN();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验字符串不为null、空字符串、空白字符及特殊值
|
||||
*
|
||||
* @param param 待校验的字符串
|
||||
* @return boolean 不为空返回true,否则返回false
|
||||
*/
|
||||
public static boolean isNotEmpty(String param) {
|
||||
return param != null && param != "";
|
||||
// 检查null值和空字符串
|
||||
if (param == null || param.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 去除首尾空格后检查是否为空
|
||||
String trimmed = param.trim();
|
||||
if (trimmed.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查特殊值:undefined、null、none(不区分大小写)
|
||||
return !"undefined".equalsIgnoreCase(trimmed) &&
|
||||
!"null".equalsIgnoreCase(trimmed) &&
|
||||
!"none".equalsIgnoreCase(trimmed);
|
||||
}
|
||||
|
||||
public static boolean isEmpty(Integer param) {
|
||||
|
||||
@ -58,19 +58,15 @@ public class QuartzServiceImpl implements QuartzService {
|
||||
throw new ApiException(I18nUtil._("任务实现类名称不能为空!"));
|
||||
}
|
||||
|
||||
// 2. 加载任务类
|
||||
Class<Job> clazz;
|
||||
try {
|
||||
// 2. 加载任务类
|
||||
Class<Job> clazz;
|
||||
|
||||
String fullClassName = PATH_PREFIX + cName;
|
||||
logger.debug("[Quartz] 尝试加载任务类: {}", fullClassName);
|
||||
clazz = (Class<Job>) Class.forName(fullClassName);
|
||||
logger.debug("[Quartz] 成功加载任务类: {}", fullClassName);
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.error("[Quartz] 定时任务脚本不存在!类名: {}{}", PATH_PREFIX, cName, e);
|
||||
throw new ApiException(I18nUtil._("定时任务脚本不存在!类名: " + PATH_PREFIX + cName), e);
|
||||
}
|
||||
|
||||
try {
|
||||
// 3. 构建任务详情和触发器
|
||||
JobKey jobKey = new JobKey(jName, jGroup);
|
||||
JobDetail jobDetail = JobBuilder.newJob(clazz)
|
||||
@ -86,6 +82,9 @@ public class QuartzServiceImpl implements QuartzService {
|
||||
|
||||
logger.debug("[Quartz] 构建任务详情和触发器完成: jobKey={}, triggerKey={}", jobKey, triggerKey);
|
||||
|
||||
// 打印最终执行的 cron 表达式
|
||||
logger.info("[Quartz] 定时任务最终执行表达式: {}", trigger.getCronExpression());
|
||||
|
||||
// 4. 检查任务是否已存在
|
||||
if (scheduler.checkExists(jobKey)) {
|
||||
logger.info("[Quartz] 任务已存在,先删除旧任务: jobKey={}", jobKey);
|
||||
@ -110,6 +109,9 @@ public class QuartzServiceImpl implements QuartzService {
|
||||
logger.error("[Quartz] 添加定时任务失败!任务名称={}, 任务组={}, 触发器名称={}, 触发器组={}",
|
||||
jName, jGroup, tName, tGroup, e);
|
||||
throw new ApiException(I18nUtil._("添加定时任务失败!"), e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.error("[Quartz] 定时任务脚本不存在!类名: {}{}", PATH_PREFIX, cName, e);
|
||||
throw new ApiException(I18nUtil._("定时任务脚本不存在!类名: " + PATH_PREFIX + cName), e);
|
||||
} catch (Exception e) {
|
||||
logger.error("[Quartz] 添加定时任务时发生未知异常!任务名称={}, 任务组={}, 触发器名称={}, 触发器组={}",
|
||||
jName, jGroup, tName, tGroup, e);
|
||||
|
||||
@ -116,7 +116,9 @@ public class LakalaController extends BaseControllerImpl {
|
||||
|
||||
// return sfExpressApiService.createSfExpressShop(66, "能辉超市", "桂平市", "广西壮族自治区贵港市桂平市广佰汇超市(桂平店)", "谢能坤", "17777525395", "110.07165452271", "23.369069486251");
|
||||
|
||||
return lakalaApiService.sacsQuery("8226330541100GU", "20250918770188017227140800").toString();
|
||||
// return lakalaApiService.sacsQuery("8226330541100GU", "20250918770188017227140800").toString();
|
||||
|
||||
return lakalaApiService.queryLedgerMer("8226330541100HA");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量发送推送消息 - 测试案例", notes = "批量发送推送消息 - 测试案例")
|
||||
|
||||
@ -10,6 +10,7 @@ package com.suisung.mall.shop.lakala.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import org.springframework.data.util.Pair;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -268,6 +269,18 @@ public interface LakalaApiService {
|
||||
*/
|
||||
JSONObject sacsQuery(String merchantNo, String separateNo);
|
||||
|
||||
|
||||
/**
|
||||
* 商户分账业务信息查询
|
||||
* 参考:https://o.lakala.com/#/home/document/detail?id=381
|
||||
*
|
||||
* @param merCupNo 银联商户号
|
||||
* @return 分账业务信息,查询失败时返回null
|
||||
* <p>
|
||||
* 返回:{"merInnerNo":"4002025092404043540","merCupNo":"8226330541100HA","splitLowestRatio":20.0,"orgId":"980688","orgName":"桂平发发","splitStatus":"VALID","splitStatusText":"启用","splitRange":"ALL","sepFundSource":"TR","bindRelations":[{"merInnerNo":"4002025092404043540","merCupNo":"8226330541100HA","receiverNo":"SR2024000129789","receiverName":"桂平发发网络有限公司"}],"platformId":null,"splitLaunchMode":"MANUAL","splitRuleSource":null,"eleContractNo":"QY20250924613672961"}
|
||||
*/
|
||||
JSONObject queryLedgerMer(String merCupNo);
|
||||
|
||||
/**
|
||||
* 订单分账撤销
|
||||
* 参考:https://o.lakala.com/#/home/document/detail?id=390
|
||||
@ -288,4 +301,13 @@ public interface LakalaApiService {
|
||||
*/
|
||||
Integer fixedUnSuccessSeparateStatusJob();
|
||||
|
||||
/**
|
||||
* 检测修复补全商户的商户分账业务信息及分账接收方绑定关系(分账业务申请异步通知的补偿机制)
|
||||
*
|
||||
* @param shopMchEntry 商户入驻信息实例
|
||||
* @return
|
||||
*/
|
||||
Boolean checkAndFixLedgerMerApplyAndBindRelations(ShopMchEntry shopMchEntry);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -50,8 +50,9 @@ public interface LklLedgerMemberService extends IBaseService<LklLedgerMember> {
|
||||
* @param auditStatus
|
||||
* @param auditStatusText
|
||||
* @param remark
|
||||
* @param notifyResp
|
||||
* @return
|
||||
*/
|
||||
Boolean updateAuditResult(String applyId, String merInnerNo, String merCupNo, String entrustFileName, String entrustFilePath, String auditStatus, String auditStatusText, String remark);
|
||||
Boolean updateAuditResult(String applyId, String merInnerNo, String merCupNo, String entrustFileName, String entrustFilePath, String auditStatus, String auditStatusText, String remark, String notifyResp);
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -101,10 +101,11 @@ public class LklLedgerMemberServiceImpl extends BaseServiceImpl<LklLedgerMemberM
|
||||
* @param auditStatus
|
||||
* @param auditStatusText
|
||||
* @param remark
|
||||
* @param notifyResp
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateAuditResult(String applyId, String merInnerNo, String merCupNo, String entrustFileName, String entrustFilePath, String auditStatus, String auditStatusText, String remark) {
|
||||
public Boolean updateAuditResult(String applyId, String merInnerNo, String merCupNo, String entrustFileName, String entrustFilePath, String auditStatus, String auditStatusText, String remark, String notifyResp) {
|
||||
if (StrUtil.isBlank(applyId) || StrUtil.isBlank(merCupNo) || StrUtil.isBlank(auditStatus)) {
|
||||
log.error("缺少参数:applyId={}, merCupNo={}, auditStatus={}", applyId, merCupNo, auditStatus);
|
||||
return false;
|
||||
@ -119,6 +120,7 @@ public class LklLedgerMemberServiceImpl extends BaseServiceImpl<LklLedgerMemberM
|
||||
updateWrapper.set("audit_status", auditStatus);
|
||||
updateWrapper.set("audit_status_text", auditStatusText);
|
||||
updateWrapper.set("remark", remark);
|
||||
updateWrapper.set("audit_resp", notifyResp);
|
||||
|
||||
return update(updateWrapper);
|
||||
}
|
||||
|
||||
@ -42,9 +42,10 @@ public interface PushMessageService {
|
||||
*
|
||||
* @param userId
|
||||
* @param payload
|
||||
* @param isFinishNotice 是签署完成通知?
|
||||
* @return
|
||||
*/
|
||||
CompletableFuture<Boolean> noticeMerchantSignEcContract(Integer userId, JSONObject payload);
|
||||
CompletableFuture<Boolean> noticeMerchantSignEcContract(Integer userId, JSONObject payload, Boolean isFinishNotice);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -33,7 +33,7 @@ import java.util.stream.Collectors;
|
||||
public class PushMessageServiceImpl implements PushMessageService {
|
||||
|
||||
private static final String appName = "小发同城";
|
||||
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private UniCloudPushService uniCloudPushService;
|
||||
@ -109,7 +109,7 @@ public class PushMessageServiceImpl implements PushMessageService {
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public CompletableFuture<Boolean> noticeMerchantSignEcContract(Integer userId, JSONObject payload) {
|
||||
public CompletableFuture<Boolean> noticeMerchantSignEcContract(Integer userId, JSONObject payload, Boolean isFinishNotice) {
|
||||
try {
|
||||
// 获取商家的 cid 列表,确保用户 ID 有效
|
||||
if (userId == null || userId <= 0) {
|
||||
@ -137,9 +137,12 @@ public class PushMessageServiceImpl implements PushMessageService {
|
||||
return CompletableFuture.completedFuture(false); // 无有效 cid 无需推送
|
||||
}
|
||||
|
||||
String title = isFinishNotice ? "通知您合同已签署完毕" : "邀请您签署入驻合同";
|
||||
String content = isFinishNotice ? "您的开店入驻合同已签署完成!" : "恭喜您!您的开店入驻申请已初步审核通过!请尽快登录小发商家 APP 平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!";
|
||||
|
||||
Pair<Boolean, String> result = uniCloudPushService.sendPushMessageBatch(cidList,
|
||||
appName + "邀请您签署入驻合同",
|
||||
"恭喜您的开店入驻申请已审核通过!请尽快登录小发商家 APP 平台签署电子合同,签署链接24小时内有效(逾期需重新提交申请)。如有疑问请联系客服,感谢您的支持!",
|
||||
appName + title,
|
||||
content,
|
||||
payload);
|
||||
|
||||
if (!result.getFirst()) {
|
||||
|
||||
@ -72,8 +72,8 @@ public class SFExpressController {
|
||||
@ApiOperation(value = "查询顺丰同城订单状态流", notes = "查询顺丰同城订单状态流")
|
||||
@RequestMapping(value = "/list-order-feed", method = RequestMethod.POST)
|
||||
public ThirdApiRes listOrderFeed(@RequestParam(name = "order_id", defaultValue = "") String orderId) {
|
||||
if (StrUtil.isBlank(orderId) || orderId == "undefined" || orderId == "null") {
|
||||
return new ThirdApiRes().fail(1003, "请求参数有误!");
|
||||
if (StrUtil.isBlank(orderId) || "undefined".equals(orderId) || "null".equals(orderId) || "none".equals(orderId)) {
|
||||
return new ThirdApiRes().fail(1003, "缺少参数或参数有误!");
|
||||
}
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
|
||||
@ -293,6 +293,15 @@ public interface ShopMchEntryService {
|
||||
*/
|
||||
Boolean checkMerchEntryFinished(Long mchId);
|
||||
|
||||
|
||||
/**
|
||||
* 检查商户入驻流程,当前是否可以创建店铺了?
|
||||
*
|
||||
* @param mchId 商户入驻ID
|
||||
* @return boolean 可以创建店铺返回true,否则返回false
|
||||
*/
|
||||
Boolean canBuildingShopStore(Long mchId);
|
||||
|
||||
/**
|
||||
* 检查更新商户入驻店铺初始化状态
|
||||
*
|
||||
|
||||
@ -173,7 +173,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return CommonResult.failed("请指定店铺或银行的省市区!");
|
||||
}
|
||||
|
||||
|
||||
if (!PhoneNumberUtils.checkPhoneNumber(loginMobile)) {
|
||||
log.warn("申请人手机号码格式错误,手机号: {}", loginMobile);
|
||||
return CommonResult.failed("申请人手机号码有误!");
|
||||
@ -780,6 +779,12 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return fixCount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重要(补偿机制),检查修复商户入驻店铺信息(商家账号关联入驻店铺Id,给商家账户创立公司员工账号和权限)
|
||||
*
|
||||
* @param mchId 商户入驻ID(必填)
|
||||
* @return boolean 是否成功修复商户信息
|
||||
*/
|
||||
public Boolean checkAndFixMchStoreInfo(Long mchId) {
|
||||
// 1. 参数校验
|
||||
if (CheckUtil.isEmpty(mchId)) {
|
||||
@ -788,76 +793,86 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. 获取当前商户用户信息
|
||||
// 6. 获取当前商户用户信息
|
||||
UserDto currentUser = getCurrentUser();
|
||||
if (currentUser == null || !currentUser.isMerchant()) {
|
||||
log.warn("当前用户非商户账号");
|
||||
if (currentUser == null || CheckUtil.isEmpty(currentUser.getId())) {
|
||||
log.warn("当前用户未登录,入驻ID: {}", mchId);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 4.3 获取用户基础信息
|
||||
// 7. 获取用户基础信息
|
||||
AccountUserBase userBase = accountService.getUserBase(currentUser.getId());
|
||||
if (userBase == null) {
|
||||
log.warn("商户用户基础信息不存在,用户ID: {}", currentUser.getId());
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. 查询商户入驻记录
|
||||
// 2. 查询商户入驻记录
|
||||
ShopMchEntry shopMchEntry = get(mchId);
|
||||
if (shopMchEntry == null) {
|
||||
log.debug("未找到商户入驻记录 mchId {}", mchId);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 4.2 检查入驻状态
|
||||
// 3. 检测修复补全商户的商户分账业务信息及分账接收方绑定关系(分账业务申请异步通知的补偿机制)
|
||||
lakalaApiService.checkAndFixLedgerMerApplyAndBindRelations(shopMchEntry);
|
||||
|
||||
// 5. 检查入驻状态
|
||||
boolean isValidStatus = CommonConstant.Enable.equals(shopMchEntry.getHas_ec_signed())
|
||||
&& CommonConstant.Enable.equals(shopMchEntry.getHas_apply_mer())
|
||||
&& CommonConstant.Enable.equals(shopMchEntry.getHas_apply_split())
|
||||
&& CommonConstant.Enable.equals(shopMchEntry.getHas_apply_receiver())
|
||||
&& CommonConstant.Enable.equals(shopMchEntry.getHas_bind_receiver());
|
||||
|
||||
if (isValidStatus) {
|
||||
log.debug("入驻记录状态都通过了审核,进一步验证修复条件,入驻ID: {}", mchId);
|
||||
} else {
|
||||
log.debug("入驻记录状态个别未通过审核,接着检查验证修复条件,入驻ID: {}", mchId);
|
||||
if (!isValidStatus) {
|
||||
log.debug("入驻记录状态未全部通过审核,不能创建店铺,入驻ID: {}", mchId);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// 4.4 获取店铺员工信息
|
||||
// 8. 检查店铺关联关系
|
||||
boolean hasStoreRelation = false;
|
||||
if (StrUtil.isNotBlank(shopMchEntry.getStore_id()) && StrUtil.isNotBlank(userBase.getStore_ids())) {
|
||||
hasStoreRelation = userBase.getStore_ids().contains(shopMchEntry.getStore_id());
|
||||
}
|
||||
|
||||
// 9. 获取店铺员工信息
|
||||
ShopStoreEmployee storeEmployee = null;
|
||||
if (StrUtil.isNotBlank(shopMchEntry.getStore_id())) {
|
||||
storeEmployee = shopStoreEmployeeService.getStoreEmployeeByUserId(
|
||||
Convert.toInt(shopMchEntry.getStore_id()),
|
||||
currentUser.getId()
|
||||
);
|
||||
Integer storeId = Convert.toInt(shopMchEntry.getStore_id());
|
||||
if (CheckUtil.isNotEmpty(storeId)) {
|
||||
storeEmployee = shopStoreEmployeeService.getStoreEmployeeByUserId(
|
||||
storeId,
|
||||
currentUser.getId()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 4.5 检查店铺关联关系
|
||||
boolean hasStoreRelation = StrUtil.isNotBlank(userBase.getStore_ids()) &&
|
||||
userBase.getStore_ids().contains(shopMchEntry.getStore_id());
|
||||
// 10. 检查权限组信息
|
||||
boolean hasRoles = storeEmployee != null && StrUtil.isNotBlank(storeEmployee.getRights_group_id());
|
||||
|
||||
// 4.6 检查权限组信息
|
||||
boolean hasRoles = storeEmployee != null &&
|
||||
StrUtil.isNotBlank(storeEmployee.getRights_group_id());
|
||||
// 11. 当满足创建店铺条件且存在信息缺失时,需要进行修复
|
||||
if (storeEmployee == null || !hasRoles || !hasStoreRelation) {
|
||||
log.info("开始修复商户信息,入驻ID: {}, storeEmployee为空: {}, 缺少角色: {}, 缺少店铺关联: {}",
|
||||
mchId, storeEmployee == null, !hasRoles, !hasStoreRelation);
|
||||
|
||||
// 4.7 当以下任一条件满足时,需要进行修复
|
||||
// - 无店铺员工信息
|
||||
// - 无权限组信息
|
||||
// - 无店铺关联
|
||||
if (storeEmployee == null ||
|
||||
!hasRoles ||
|
||||
!hasStoreRelation) {
|
||||
|
||||
// 4.8 补偿创建初始化店铺部分赋值
|
||||
// 补偿创建初始化店铺部分赋值
|
||||
Pair<Integer, String> result = shopStoreBaseService.covMerchEntryInfo2StoreInfo(mchId, false);
|
||||
if (result != null && result.getFirst() > 0) {
|
||||
log.warn("商户信息修复成功,入驻ID: {}", mchId);
|
||||
log.info("商户信息修复成功,入驻ID: {}", mchId);
|
||||
// 修复成功后检查商户绑定状态是否完成,更改总的审核状态
|
||||
checkMerchEntryFinished(mchId);
|
||||
return true;
|
||||
} else {
|
||||
log.error("商户信息修复失败,入驻ID: {}, 错误信息:{}", mchId, result != null ? result.getSecond() : "未知错误");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 12. 如果信息完整,检查商户绑定状态是否完成,更改总的审核状态
|
||||
log.debug("商户信息完整,检查是否需要更新审核状态,入驻ID: {}", mchId);
|
||||
checkMerchEntryFinished(mchId);
|
||||
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("商户信息修复异常,mchId: {}", mchId, e);
|
||||
@ -1042,7 +1057,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
if (StrUtil.isBlank(contactMobile)) {
|
||||
return Pair.of(false, "联系人手机号不能为空");
|
||||
}
|
||||
queryWrapper.eq("legal_person_mobile", contactMobile);
|
||||
queryWrapper.eq("legal_person_mobile", contactMobile); // 企业和个人公用该字段(联系人手机号)
|
||||
|
||||
String msg = "";
|
||||
// 4. 根据主体类型设置额外查询条件和提示信息
|
||||
@ -1067,7 +1082,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return Pair.of(false, msg);
|
||||
}
|
||||
|
||||
|
||||
log.info("可以申请入驻,准备申请入驻");
|
||||
|
||||
return Pair.of(true, "可以申请入驻,准备下一个流程");
|
||||
@ -1430,21 +1444,45 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
/**
|
||||
* 更新商家入驻申请的店铺 ID
|
||||
*
|
||||
* @param id
|
||||
* @param storeId
|
||||
* @return
|
||||
* @param mchId 商户ID
|
||||
* @param storeId 店铺ID
|
||||
* @return 更新成功返回 true,否则返回 false
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateMerchEntryStoreStatus(Long id, Integer storeId) {
|
||||
if (ObjectUtil.isEmpty(id) && ObjectUtil.isEmpty(storeId)) {
|
||||
public Boolean updateMerchEntryStoreStatus(Long mchId, Integer storeId) {
|
||||
// 1. 参数校验:mchId 不能为空
|
||||
if (CheckUtil.isEmpty(mchId) || CheckUtil.isEmpty(storeId)) {
|
||||
log.warn("更新商户店铺状态失败:商户ID不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
return update(new UpdateWrapper<ShopMchEntry>()
|
||||
.eq("id", id)
|
||||
.set("store_id", storeId).set("store_status", CommonConstant.Enable));
|
||||
try {
|
||||
// 2. 构建更新条件
|
||||
UpdateWrapper<ShopMchEntry> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.eq("id", mchId)
|
||||
.set("store_id", storeId)
|
||||
.set("store_status", CommonConstant.Enable)
|
||||
.set("updated_at", new Date()); // 更新时间戳
|
||||
|
||||
// 3. 执行更新操作并返回结果
|
||||
boolean result = update(updateWrapper);
|
||||
|
||||
if (result) {
|
||||
log.info("商户店铺状态更新成功,mchId: {}, storeId: {}", mchId, storeId);
|
||||
} else {
|
||||
log.warn("商户店铺状态更新失败,未找到匹配记录,mchId: {}", mchId);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
// 4. 异常处理:记录异常信息
|
||||
log.error("更新商户店铺状态时发生异常,mchId: {}, storeId: {}", mchId, storeId, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 更新拉卡拉入网电子合同和签署地址
|
||||
// *
|
||||
@ -1738,6 +1776,7 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
log.error("更新商户入驻信息状态失败, mchId={}", mchId);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true; // 返回 true,表示入驻流程已全部完成
|
||||
|
||||
} catch (Exception e) {
|
||||
@ -1747,6 +1786,51 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查商户入驻流程,当前是否可以创建店铺了?
|
||||
*
|
||||
* @param mchId 商户入驻ID
|
||||
* @return boolean 可以创建店铺返回true,否则返回false
|
||||
*/
|
||||
@Override
|
||||
public Boolean canBuildingShopStore(Long mchId) {
|
||||
// 1. 参数校验
|
||||
if (ObjectUtil.isEmpty(mchId)) {
|
||||
log.error("检查商户是否可以创建店铺失败:商户入驻ID为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. 根据商户ID获取商户入驻信息
|
||||
ShopMchEntry merchantEntry = shopMerchEntryById(mchId);
|
||||
if (merchantEntry == null) {
|
||||
log.error("检查商户是否可以创建店铺失败:商户不存在, mchId={}", mchId);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. 检查各项前置状态是否已完成
|
||||
boolean isFinished = CommonConstant.Enable.equals(merchantEntry.getHas_ec_signed())
|
||||
&& CommonConstant.Enable.equals(merchantEntry.getHas_apply_mer())
|
||||
&& CommonConstant.Enable.equals(merchantEntry.getHas_apply_split())
|
||||
&& CommonConstant.Enable.equals(merchantEntry.getHas_apply_receiver())
|
||||
&& CommonConstant.Enable.equals(merchantEntry.getHas_bind_receiver());
|
||||
|
||||
// 4. 返回检查结果
|
||||
if (isFinished) {
|
||||
log.debug("商户满足创建店铺条件, mchId={}", mchId);
|
||||
return true;
|
||||
} else {
|
||||
log.debug("商户不满足创建店铺条件, mchId={}", mchId);
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// 5. 异常处理:记录异常信息,避免程序中断
|
||||
log.error("检查商户是否可以创建店铺时发生异常, mchId={}", mchId, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据商户号或商家手机号修改商户入驻信息多个状态
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user