商家入驻,fix bug。
This commit is contained in:
parent
4bd3b562f9
commit
bd063cc859
@ -108,6 +108,37 @@ public class CommonService {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 截取中文字符串的前n个字
|
||||
*
|
||||
* @param str 要截取的字符串,可能包含中文
|
||||
* @param n 要截取的字数
|
||||
* @return 截取后的字符串,如果原字符串为null则返回null
|
||||
*/
|
||||
public static String subZhCNString(String str, int n) {
|
||||
// 处理null情况
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 处理n小于等于0的情况
|
||||
if (n <= 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
int length = str.length();
|
||||
|
||||
// 如果字符串长度小于等于n,直接返回原字符串
|
||||
if (length <= n) {
|
||||
return str;
|
||||
}
|
||||
|
||||
// 对于长度超过n的字符串,使用字符数组进行高效截取
|
||||
char[] chars = new char[n];
|
||||
str.getChars(0, n, chars, 0);
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(isValidInput("", "+8618924071446"));
|
||||
}
|
||||
|
||||
@ -43,12 +43,11 @@ public interface LklLedgerEcService extends IBaseService<LklLedgerEc> {
|
||||
* 根据商户手机号查询记录
|
||||
*
|
||||
* @param mchId
|
||||
* @param mchMobile
|
||||
* @param ecStatus
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
LklLedgerEc getByMchMobile(Long mchId, String mchMobile, String ecStatus, Integer status);
|
||||
LklLedgerEc getByMchId(Long mchId, String ecStatus, Integer status);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
|
||||
|
||||
String contractMobile = shopMchEntry.getLegal_person_mobile();
|
||||
|
||||
LklLedgerEc lklLedgerEc = lklLedgerEcService.getByMchMobile(shopMchEntry.getId(), null, "", CommonConstant.Enable);
|
||||
LklLedgerEc lklLedgerEc = lklLedgerEcService.getByMchId(shopMchEntry.getId(), "", CommonConstant.Enable);
|
||||
if (lklLedgerEc != null
|
||||
&& "COMPLETED".equals(lklLedgerEc.getEc_status())) {
|
||||
// TODO 这种情况,需要怎么处理?
|
||||
|
||||
@ -11,6 +11,7 @@ package com.suisung.mall.shop.lakala.service.impl;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.modules.lakala.LklLedgerEc;
|
||||
import com.suisung.mall.common.utils.CheckUtil;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
@ -20,7 +21,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class LklLedgerEcServiceImpl extends BaseServiceImpl<LklLedgerEcMapper, LklLedgerEc> implements LklLedgerEcService {
|
||||
|
||||
|
||||
/**
|
||||
* 根据商家Id新增或更新记录
|
||||
*
|
||||
@ -29,24 +30,16 @@ public class LklLedgerEcServiceImpl extends BaseServiceImpl<LklLedgerEcMapper, L
|
||||
*/
|
||||
@Override
|
||||
public Boolean addOrUpdateByMchId(LklLedgerEc record) {
|
||||
if (record == null || (ObjectUtil.isEmpty(record.getMch_id()) && StrUtil.isBlank(record.getMch_mobile()))) {
|
||||
if (record == null || ObjectUtil.isEmpty(record.getMch_id())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QueryWrapper<LklLedgerEc> queryWrapper = new QueryWrapper<>();
|
||||
if (CheckUtil.isNotEmpty(record.getMch_id())) {
|
||||
queryWrapper.eq("mch_id", record.getMch_id());
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(record.getMch_mobile())) {
|
||||
queryWrapper.eq("mch_mobile", record.getMch_mobile());
|
||||
}
|
||||
|
||||
queryWrapper.eq("mch_id", record.getMch_id()).eq("status", CommonConstant.Enable);
|
||||
queryWrapper.orderByDesc("id");
|
||||
|
||||
LklLedgerEc existsRecord = findOne(queryWrapper);
|
||||
if (existsRecord != null
|
||||
&& existsRecord.getId() > 0) {
|
||||
if (existsRecord != null && existsRecord.getId() > 0) {
|
||||
// 更新记录
|
||||
record.setId(existsRecord.getId());
|
||||
return updateById(record);
|
||||
@ -113,25 +106,18 @@ public class LklLedgerEcServiceImpl extends BaseServiceImpl<LklLedgerEcMapper, L
|
||||
* 根据商户手机号查询记录
|
||||
*
|
||||
* @param mchId
|
||||
* @param mchMobile
|
||||
* @param ecStatus
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LklLedgerEc getByMchMobile(Long mchId, String mchMobile, String ecStatus, Integer status) {
|
||||
if (StrUtil.isBlank(mchMobile) && (mchId == null || mchId <= 0)) {
|
||||
public LklLedgerEc getByMchId(Long mchId, String ecStatus, Integer status) {
|
||||
if (mchId == null || mchId <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
QueryWrapper<LklLedgerEc> queryWrapper = new QueryWrapper<>();
|
||||
if (CheckUtil.isNotEmpty(mchId)) {
|
||||
queryWrapper.eq("mch_id", mchId);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(mchMobile)) {
|
||||
queryWrapper.eq("mch_mobile", mchMobile);
|
||||
}
|
||||
queryWrapper.eq("mch_id", mchId);
|
||||
|
||||
queryWrapper.orderByDesc("id");
|
||||
if (ObjectUtil.isNotEmpty(status)) {
|
||||
|
||||
@ -19,6 +19,7 @@ import com.suisung.mall.common.api.ResultCode;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.domain.UserDto;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.service.impl.CommonService;
|
||||
import com.suisung.mall.common.utils.RestTemplateHttpUtil;
|
||||
import com.suisung.mall.common.utils.StringUtils;
|
||||
import com.suisung.mall.common.utils.UploadUtil;
|
||||
@ -372,8 +373,9 @@ public class LklTkServiceImpl {
|
||||
formData.put("larIdCardStart", larIdCardStart); // 身份证有效期开始时间
|
||||
formData.put("larIdCardEnd", larIdCardEnd); // 身份证有效期结束时间,长期:9999-12-31
|
||||
|
||||
// 营业执照上的经营内容
|
||||
formData.put("businessContent", shopMchEntry.getBiz_license_content());
|
||||
// 营业执照上的经营内容(20字以内)
|
||||
String bizLicenseContent = CommonService.subZhCNString(shopMchEntry.getBiz_license_content(), 20);
|
||||
formData.put("businessContent", bizLicenseContent);
|
||||
|
||||
// 营业执照信息
|
||||
if (isQy) {
|
||||
|
||||
@ -924,28 +924,28 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
||||
/**
|
||||
* 支付订单,顺丰同城配送超时,自动取消订单并退款,加库存
|
||||
*
|
||||
* @param orderId <p>
|
||||
* RETURN_PROCESS_SUBMIT = 3100; //【客户】提交退单1ReturnReturn
|
||||
* RETURN_PROCESS_CHECK = 3105; //退单审核1ReturnReturn
|
||||
* RETURN_PROCESS_RECEIVED = 3110; //收货确认0ReturnReturn
|
||||
* RETURN_PROCESS_REFUND = 3115; //退款确认0ReturnReturn
|
||||
* RETURN_PROCESS_RECEIPT_CONFIRMATION = 3120; //[【客户】收款确认0 ReturnReturn
|
||||
* RETURN_PROCESS_FINISH = 3125; //完成1退货退款
|
||||
* RETURN_PROCESS_REFUSED = 3130; //-商家拒绝退货
|
||||
* RETURN_PROCESS_CANCEL = 3135; //-买家取消退款
|
||||
* @param shopOrderId <p>
|
||||
* RETURN_PROCESS_SUBMIT = 3100; //【客户】提交退单1ReturnReturn
|
||||
* RETURN_PROCESS_CHECK = 3105; //退单审核1ReturnReturn
|
||||
* RETURN_PROCESS_RECEIVED = 3110; //收货确认0ReturnReturn
|
||||
* RETURN_PROCESS_REFUND = 3115; //退款确认0ReturnReturn
|
||||
* RETURN_PROCESS_RECEIPT_CONFIRMATION = 3120; //[【客户】收款确认0 ReturnReturn
|
||||
* RETURN_PROCESS_FINISH = 3125; //完成1退货退款
|
||||
* RETURN_PROCESS_REFUSED = 3130; //-商家拒绝退货
|
||||
* RETURN_PROCESS_CANCEL = 3135; //-买家取消退款
|
||||
* @return
|
||||
*/
|
||||
@GlobalTransactional
|
||||
@Override
|
||||
public Boolean sfExpressExpiredForceRefund(String orderId) {
|
||||
public Boolean sfExpressExpiredForceRefund(String shopOrderId) {
|
||||
|
||||
String remark = "配送异常自动退款!";
|
||||
// 先整单退货申请
|
||||
CommonResult commonResult = addWholeItems(orderId, true, remark);
|
||||
CommonResult commonResult = addWholeItems(shopOrderId, true, remark);
|
||||
commonResult.checkFenResult();
|
||||
|
||||
QueryWrapper<ShopOrderReturn> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("order_id", orderId);
|
||||
queryWrapper.eq("order_id", shopOrderId);
|
||||
ShopOrderReturn shopOrderReturn = findOne(queryWrapper);
|
||||
if (shopOrderReturn == null) {
|
||||
throw new ApiException(I18nUtil._("订单信息异常!"));
|
||||
@ -2286,8 +2286,10 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
||||
return CommonResult.failed("订单未付款,无法退款");
|
||||
}
|
||||
|
||||
if (orderInfo.getOrder_state_id() != null && orderInfo.getOrder_state_id() >= StateCode.ORDER_STATE_SHIPPED) {
|
||||
return CommonResult.failed("该订单(状态)无法退款");
|
||||
if (orderInfo.getOrder_state_id() != null
|
||||
&& orderInfo.getOrder_state_id() >= StateCode.ORDER_STATE_SHIPPED
|
||||
&& orderInfo.getOrder_state_id() <= StateCode.ORDER_STATE_CANCEL) {
|
||||
return CommonResult.failed("已发货、已取消的订单无法退款");
|
||||
}
|
||||
|
||||
if (orderInfo.getStore_id() != null && !orderInfo.getStore_id().equals(Convert.toInt(currentUser.getStore_id()))) {
|
||||
|
||||
@ -674,12 +674,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
return new ThirdApiRes().fail(-1, "状态处理失败!");
|
||||
}
|
||||
|
||||
// 更改商城订单状态为:已取消,注意事务问题
|
||||
// List<String> orderList = new ArrayList<>();
|
||||
// orderList.add(shopStoreSfOrder.getShop_order_id());
|
||||
|
||||
// 重要:订单取消
|
||||
// success = shopOrderBaseService.cancel(orderList, null, false);
|
||||
// 重要:更改商城订单状态为:已取消,注意事务问题
|
||||
success = shopOrderReturnService.sfExpressExpiredForceRefund(shopOrderId);
|
||||
if (!success) {
|
||||
return new ThirdApiRes().fail(-1, "取消订单业务处理失败!");
|
||||
@ -708,7 +703,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
|
||||
/**
|
||||
* 接收顺丰配送状态更改回调
|
||||
* // 顺丰同城订单状态:1-订单创建;2-订单取消;10-配送员接单/配送员改派;12-配送员到店;15配送员配送中(已取货);17-配送员妥投完单;22-配送员撤单;31-取消中;91-骑士上报异常;
|
||||
* 顺丰同城订单状态:1-订单创建;2-订单取消;10-配送员接单/配送员改派;12-配送员到店;15配送员配送中(已取货);17-配送员妥投完单;22-配送员撤单;31-取消中;91-骑士上报异常;
|
||||
*
|
||||
* @param jsonData
|
||||
* @param sign
|
||||
@ -905,38 +900,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
return new ThirdApiRes().success("success");
|
||||
}
|
||||
|
||||
/**
|
||||
* 个推推送消息到店铺员工
|
||||
*
|
||||
* @param storeId
|
||||
* @param orderId
|
||||
* @param message
|
||||
* @param payloadJson
|
||||
* @return
|
||||
*/
|
||||
// @Override
|
||||
// public void pushMessageToStoreEmployee(Integer storeId, String orderId, String message, String payloadJson) {
|
||||
// try {
|
||||
// List<String> cidList = shopStoreEmployeeService.selectEmployeeGeTuiCidByStoreId(storeId, orderId, false);
|
||||
// if (CollUtil.isEmpty(cidList)) {
|
||||
// logger.error("获取不到店铺员工,无法推送消息!");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.isBlank(payloadJson)) {
|
||||
// payloadJson = new JSONObject().set("page", "orderDetail").set("orderId", orderId).set("storeId", storeId).toString();
|
||||
// }
|
||||
//
|
||||
// // 推送消息到员工
|
||||
// Pair<Boolean, String> result = geTuiPushService.pushListMessageToCids(cidList, "", message, "payload", payloadJson);
|
||||
// if (!result.getFirst()) {
|
||||
// logger.error("推送消息到员工失败:{}", result.getSecond());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// logger.error("推送消息到员工时发生异常:{}", e.getMessage(), e);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// 私有方法
|
||||
|
||||
|
||||
@ -623,9 +623,8 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
// === 拉卡拉签约逻辑 ===
|
||||
|
||||
if (CommonConstant.Enable.equals(record.getHas_ec_signed())) {
|
||||
LklLedgerEc ec = lklLedgerEcService.getByMchMobile(
|
||||
LklLedgerEc ec = lklLedgerEcService.getByMchId(
|
||||
record.getId(),
|
||||
"",
|
||||
"COMPLETED",
|
||||
CommonConstant.Enable
|
||||
);
|
||||
|
||||
@ -3057,6 +3057,8 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
return Pair.of(0, "入驻信息不能为空");
|
||||
}
|
||||
|
||||
// TODO 判断要不要给入驻的企业法人手机、小微联系人手机注册一个账号?
|
||||
|
||||
// 从绑定关系中,获取商家注册账号信息
|
||||
Integer userId = accountService.getUserBindConnectUserIdByCondition(shopMchEntry.getLogin_mobile(), BindCode.MOBILE, CommonConstant.USER_TYPE_MCH);
|
||||
if (userId == null) {
|
||||
@ -3066,7 +3068,7 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
|
||||
if (isExistsByStoreName(shopMchEntry.getStore_name())) {
|
||||
logger.error("生成店铺:店铺名称已存在");
|
||||
return Pair.of(0, "店铺名称已存在,请使用另一个名称");
|
||||
return Pair.of(0, "店铺名称已存在,请使用另一名称");
|
||||
}
|
||||
|
||||
// 校验店铺状态,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user