商家的账号注册登录接口,增加代理商的支持。

This commit is contained in:
Jack 2026-01-17 10:34:27 +08:00
parent fa7c4b8c4c
commit 4e6927d2b9
13 changed files with 65 additions and 61 deletions

View File

@ -28,7 +28,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.util.Pair; import org.springframework.data.util.Pair;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -234,9 +233,9 @@ public class LoginController extends BaseControllerImpl {
return CommonResult.success(accountUserBaseService.doAppConnectLogin(bind_name, code)); return CommonResult.success(accountUserBaseService.doAppConnectLogin(bind_name, code));
} }
@ApiOperation(value = "商家注册与登录") @ApiOperation(value = "商家(代理商)注册与登录")
@RequestMapping(value = "/doMerchSmsRegisterAndLogin", method = RequestMethod.POST) @RequestMapping(value = "/doMerchSmsRegisterAndLogin", method = RequestMethod.POST)
public CommonResult doMerchSmsRegisterAndLogin(HttpServletRequest request, @RequestBody JSONObject paramJSON) { public CommonResult doMerchSmsRegisterAndLogin(@RequestBody(required = false) JSONObject paramJSON) {
if (paramJSON == null) { if (paramJSON == null) {
return CommonResult.failed("缺少必要参数!"); return CommonResult.failed("缺少必要参数!");
} }
@ -256,8 +255,10 @@ public class LoginController extends BaseControllerImpl {
String cid = paramJSON.getStr("cid"); String cid = paramJSON.getStr("cid");
String osType = paramJSON.getStr("os_type"); String osType = paramJSON.getStr("os_type");
// 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
Integer userType = paramJSON.getInt("user_type");
return accountUserBaseService.doMerchSmsRegisterAndLogin(userMobile, randKey, verifyCode, cid, osType); return accountUserBaseService.doMerchSmsRegisterAndLogin(userMobile, randKey, verifyCode, userType, cid, osType);
} }
@ApiOperation(value = "微信用户一键登录与注册") @ApiOperation(value = "微信用户一键登录与注册")
@ -288,9 +289,11 @@ public class LoginController extends BaseControllerImpl {
@ApiOperation(value = "忘记密码-更改新密码") @ApiOperation(value = "忘记密码-更改新密码")
@RequestMapping(value = "/edit/forgetPassword", method = RequestMethod.POST) @RequestMapping(value = "/edit/forgetPassword", method = RequestMethod.POST)
public CommonResult editForgetPassword(@RequestBody JSONObject paramJSON) { public CommonResult editForgetPassword(@RequestBody JSONObject paramJSON) {
// TODO 这个方法肯定有问题待修改
return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"), return accountUserBaseService.doMerchSmsRegisterAndLogin(paramJSON.getStr("user_mobile"),
paramJSON.getStr("rand_key"), paramJSON.getStr("rand_key"),
paramJSON.getStr("verify_code"), paramJSON.getStr("verify_code"),
paramJSON.getInt("user_type"),
paramJSON.getStr("cid"), paramJSON.getStr("os_type")); paramJSON.getStr("cid"), paramJSON.getStr("os_type"));
} }

View File

@ -142,11 +142,12 @@ public interface AccountUserBaseService extends IBaseService<AccountUserBase> {
* @param user_mobile * @param user_mobile
* @param rand_key 防机器人刷验证码 * @param rand_key 防机器人刷验证码
* @param verify_code * @param verify_code
* @param userType 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
* @param cid 推送 cid * @param cid 推送 cid
* @param osType 手机系统类型 1-Android2-iOS3-微信小程序 * @param osType 手机系统类型 1-Android2-iOS3-微信小程序
* @return * @return
*/ */
CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, String cid, String osType); CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, Integer userType, String cid, String osType);
/** /**
* 微信小程序一键登录注册接口 * 微信小程序一键登录注册接口

View File

@ -51,7 +51,6 @@ import com.suisung.mall.common.modules.distribution.ShopDistributionUserCommissi
import com.suisung.mall.common.modules.pay.PayUserResource; import com.suisung.mall.common.modules.pay.PayUserResource;
import com.suisung.mall.common.modules.plantform.ShopPlantformSubsiteUser; import com.suisung.mall.common.modules.plantform.ShopPlantformSubsiteUser;
import com.suisung.mall.common.modules.store.ShopStoreBase; import com.suisung.mall.common.modules.store.ShopStoreBase;
import com.suisung.mall.common.modules.store.ShopStoreInfo;
import com.suisung.mall.common.modules.store.ShopStoreMember; import com.suisung.mall.common.modules.store.ShopStoreMember;
import com.suisung.mall.common.modules.store.ShopStoreMemberLevel; import com.suisung.mall.common.modules.store.ShopStoreMemberLevel;
import com.suisung.mall.common.pojo.dto.SmsDto; import com.suisung.mall.common.pojo.dto.SmsDto;
@ -1682,8 +1681,8 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
String verifyCode = (String) userInfo.get("verify_code"); String verifyCode = (String) userInfo.get("verify_code");
String verify_token = (String) userInfo.get("verify_token"); String verify_token = (String) userInfo.get("verify_token");
String rand_key = (String) userInfo.get("rand_key"); String rand_key = (String) userInfo.get("rand_key");
Integer userIsAdmin = Convert.toInt(userInfo.getOrDefault("user_is_admin", CommonConstant.USER_TYPE_NORMAL)); // 用户类型:0-普通买家; 1-管理员2-入驻商家 Integer userIsAdmin = Convert.toInt(userInfo.getOrDefault("user_is_admin", CommonConstant.USER_TYPE_NORMAL)); // 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
Integer userType = userIsAdmin; // 用户身份:0-普通买家; 1-管理员2-入驻商家 Integer userType = userIsAdmin; // 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
String user_email = (String) userInfo.get("user_email"); String user_email = (String) userInfo.get("user_email");
Integer bind_type = getParameter("bind_type", BindCode.MOBILE); Integer bind_type = getParameter("bind_type", BindCode.MOBILE);
@ -2960,12 +2959,13 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
* @param user_mobile * @param user_mobile
* @param rand_key 防机器人刷验证码 * @param rand_key 防机器人刷验证码
* @param verify_code * @param verify_code
* @param userType 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
* @param cid 推送 cid * @param cid 推送 cid
* @param osType 手机系统类型 1-Android2-iOS3-微信小程序 * @param osType 手机系统类型 1-Android2-iOS3-微信小程序
* @return * @return
*/ */
@Override @Override
public CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, String cid, String osType) { public CommonResult doMerchSmsRegisterAndLogin(String user_mobile, String rand_key, String verify_code, Integer userType, String cid, String osType) {
// 流程通过手机号检查是否有绑定关系没有就直接注册有就直接登录返回登录后的所有信息附加是否已经申请入驻标记 // 流程通过手机号检查是否有绑定关系没有就直接注册有就直接登录返回登录后的所有信息附加是否已经申请入驻标记
// 商家入驻账号都是需要手机号绑定的账号组成1000000+(数字加法)自增ID密码随机6位数 // 商家入驻账号都是需要手机号绑定的账号组成1000000+(数字加法)自增ID密码随机6位数
if (StrUtil.isBlank(user_mobile) || StrUtil.isBlank(verify_code)) { if (StrUtil.isBlank(user_mobile) || StrUtil.isBlank(verify_code)) {
@ -2986,7 +2986,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
// rmk 为什么随机数和手机号一致 // rmk 为什么随机数和手机号一致
if (ObjectUtil.notEqual(user_mobile, rand_key)) { if (ObjectUtil.notEqual(user_mobile, rand_key)) {
return CommonResult.failed(_("非法数据,或者提交超时,请刷新页面重新提交!")); return CommonResult.failed(_("非法数据,请刷新页面重新提交!"));
} }
String verifyMobile = PhoneNumberUtils.convZhPhoneNumber(user_mobile); String verifyMobile = PhoneNumberUtils.convZhPhoneNumber(user_mobile);
@ -2996,9 +2996,11 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
return CommonResult.failed(_("验证码错误!")); return CommonResult.failed(_("验证码错误!"));
} }
userType = CheckUtil.isEmpty(userType) ? CommonConstant.USER_TYPE_MCH : userType;
// 找出手机对应的绑定用户 // 找出手机对应的绑定用户
// 是否为手机号注册密码6位随机数 // 是否为手机号注册密码6位随机数
return doMobileBindLogin(verifyMobile, CommonConstant.USER_TYPE_MCH, cid, osType); return doMobileBindLogin(verifyMobile, userType, cid, osType);
} }
/** /**
@ -3275,7 +3277,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
* *
* @param user_mobile * @param user_mobile
* @param regPwd 注册用途 * @param regPwd 注册用途
* @param userType * @param userType 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
* @param cid * @param cid
* @param osType * @param osType
* @return * @return
@ -3294,6 +3296,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
AccountUserBindConnect bind_row = accountUserBindConnectService.getBindByBindId(user_mobile, BindCode.MOBILE, userType); AccountUserBindConnect bind_row = accountUserBindConnectService.getBindByBindId(user_mobile, BindCode.MOBILE, userType);
AccountUserBase accountUserBase; AccountUserBase accountUserBase;
if (bind_row != null) { if (bind_row != null) {
// 已经注册账号的绑定了手机的情况 // 已经注册账号的绑定了手机的情况
Integer user_id = bind_row.getUser_id(); Integer user_id = bind_row.getUser_id();
accountUserBase = get(user_id); accountUserBase = get(user_id);
@ -3306,7 +3309,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
Map<String, Object> userInfo = new HashMap<>(); Map<String, Object> userInfo = new HashMap<>();
userInfo.put("user_account", user_mobile); userInfo.put("user_account", user_mobile);
userInfo.put("user_mobile", user_mobile); userInfo.put("user_mobile", user_mobile);
userInfo.put("user_is_admin", userType); // 商家入驻注册 userInfo.put("user_is_admin", userType); // 商家或代理商入驻注册
String user_password = regPwd; String user_password = regPwd;
if (StrUtil.isBlank(user_password)) { if (StrUtil.isBlank(user_password)) {
// 随机数明文密码 // 随机数明文密码
@ -3330,7 +3333,8 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
params.put("username", accountUserBase.getUser_account()); params.put("username", accountUserBase.getUser_account());
params.put("password", ""); params.put("password", "");
params.put("user_mobile", user_mobile); params.put("user_mobile", user_mobile);
params.put("is_merch", CommonConstant.Enable.toString()); // 是否为商家入驻 1-其他- params.put("is_merch", CommonConstant.USER_TYPE_MCH.equals(userType) ? "1" : "2"); // 是否为商家入驻 1-其他-
params.put("is_agent", CommonConstant.USER_TYPE_AGENT.equals(userType) ? "1" : "2"); // 是否为代理商入驻 1-其他-
if (StrUtil.isNotBlank(cid)) { if (StrUtil.isNotBlank(cid)) {
params.put("cid", cid); // 个推客户端Id params.put("cid", cid); // 个推客户端Id

View File

@ -94,7 +94,7 @@ public class AdminAppMarketUpdateServiceImpl extends BaseServiceImpl<AdminAppMar
QueryWrapper<AdminAppMarketUpdate> queryWrapper = new QueryWrapper<>(); QueryWrapper<AdminAppMarketUpdate> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("market_id", marketId).eq("status", CommonConstant.Enable).orderByDesc("version_key"); queryWrapper.eq("market_id", marketId).eq("status", CommonConstant.Enable).orderByDesc("version_key");
AdminAppMarketUpdate adminAppMarketUpdate = findOne(queryWrapper); AdminAppMarketUpdate adminAppMarketUpdate = getOne(queryWrapper, false);
if (adminAppMarketUpdate == null) { if (adminAppMarketUpdate == null) {
return CommonResult.success(null, "没有找到最新版本"); return CommonResult.success(null, "没有找到最新版本");
} }
@ -285,6 +285,6 @@ public class AdminAppMarketUpdateServiceImpl extends BaseServiceImpl<AdminAppMar
queryWrapper.eq("market_id", marketId).eq("status", CommonConstant.Enable) queryWrapper.eq("market_id", marketId).eq("status", CommonConstant.Enable)
.eq("package_name", packageName).orderByDesc("version_key"); .eq("package_name", packageName).orderByDesc("version_key");
return findOne(queryWrapper); return getOne(queryWrapper, false);
} }
} }

View File

@ -10,8 +10,8 @@ import com.suisung.mall.common.exception.ApiException;
import com.suisung.mall.common.exception.ApiUserException; import com.suisung.mall.common.exception.ApiUserException;
import com.suisung.mall.common.modules.cms.CmsArticleComment; import com.suisung.mall.common.modules.cms.CmsArticleComment;
import com.suisung.mall.common.modules.cms.CmsArticleCommentHelpful; import com.suisung.mall.common.modules.cms.CmsArticleCommentHelpful;
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
import com.suisung.mall.common.utils.I18nUtil; import com.suisung.mall.common.utils.I18nUtil;
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -48,13 +48,13 @@ public class CmsArticleCommentHelpfulServiceImpl extends BaseServiceImpl<CmsArti
queryWrapper.eq("user_id", user.getId()); queryWrapper.eq("user_id", user.getId());
queryWrapper.eq("article_id", cmsArticleCommentHelpful.getArticle_id()); queryWrapper.eq("article_id", cmsArticleCommentHelpful.getArticle_id());
CmsArticleCommentHelpful dbArticleCommentHelpful = findOne(queryWrapper); CmsArticleCommentHelpful dbArticleCommentHelpful = getOne(queryWrapper, false);
QueryWrapper<CmsArticleComment> commentQueryWrapper = new QueryWrapper<>(); QueryWrapper<CmsArticleComment> commentQueryWrapper = new QueryWrapper<>();
commentQueryWrapper.eq("comment_id", cmsArticleCommentHelpful.getComment_id()); commentQueryWrapper.eq("comment_id", cmsArticleCommentHelpful.getComment_id());
commentQueryWrapper.eq("article_id", cmsArticleCommentHelpful.getArticle_id()); commentQueryWrapper.eq("article_id", cmsArticleCommentHelpful.getArticle_id());
commentQueryWrapper.eq("user_id", user.getId()); commentQueryWrapper.eq("user_id", user.getId());
CmsArticleComment dbArticleComment = cmsArticleCommentService.findOne(commentQueryWrapper); CmsArticleComment dbArticleComment = cmsArticleCommentService.getOne(commentQueryWrapper, false);
if (null == dbArticleCommentHelpful) { if (null == dbArticleCommentHelpful) {
cmsArticleCommentHelpful.setUser_id(user.getId()); cmsArticleCommentHelpful.setUser_id(user.getId());

View File

@ -20,11 +20,12 @@ public class CommonConstant {
public static final Integer Delivery_Amount_Comput_Type_Payment = 3; public static final Integer Delivery_Amount_Comput_Type_Payment = 3;
/** /**
* 用户类型0-普通用户1-管理员2-入驻商户 * 用户类型:0-普通买家; 1-管理员2-入驻商家3-代理商
*/ */
public static final Integer USER_TYPE_NORMAL = 0; public static final Integer USER_TYPE_NORMAL = 0;
public static final Integer USER_TYPE_ADMIN = 1; public static final Integer USER_TYPE_ADMIN = 1;
public static final Integer USER_TYPE_MCH = 2; public static final Integer USER_TYPE_MCH = 2;
public static final Integer USER_TYPE_AGENT = 3;
// 国际电话区号 // 国际电话区号
public static final String IDD_ZH_CN = "+86"; //中国 public static final String IDD_ZH_CN = "+86"; //中国

View File

@ -264,7 +264,7 @@ public class IndexController extends BaseControllerImpl {
QueryWrapper<PayConsumeTrade> tradeQueryWrapper = new QueryWrapper<>(); QueryWrapper<PayConsumeTrade> tradeQueryWrapper = new QueryWrapper<>();
tradeQueryWrapper.eq("order_id", order_id); tradeQueryWrapper.eq("order_id", order_id);
tradeQueryWrapper.eq("buyer_id", userDto.getId()); tradeQueryWrapper.eq("buyer_id", userDto.getId());
PayConsumeTrade payConsumeTrade = payConsumeTradeService.findOne(tradeQueryWrapper); PayConsumeTrade payConsumeTrade = payConsumeTradeService.getOne(tradeQueryWrapper, false);
Integer trade_is_paid = payConsumeTrade.getTrade_is_paid(); Integer trade_is_paid = payConsumeTrade.getTrade_is_paid();
if (trade_is_paid.equals(StateCode.ORDER_PAID_STATE_YES)) { if (trade_is_paid.equals(StateCode.ORDER_PAID_STATE_YES)) {
return CommonResult.success("订单已支付"); return CommonResult.success("订单已支付");

View File

@ -229,7 +229,7 @@ public class PayConsumeDepositServiceImpl extends BaseServiceImpl<PayConsumeDepo
} }
// 读取最新记录 // 读取最新记录
deposit_row = findOne(deposit_column_row); deposit_row = getOne(deposit_column_row, false);
// 待走流程 // 待走流程
if (deposit_row != null) { if (deposit_row != null) {

View File

@ -1261,7 +1261,7 @@ public class PayUserPayServiceImpl extends BaseServiceImpl<PayUserPayMapper, Pay
// 不可以联合支付 // 不可以联合支付
QueryWrapper<PayConsumeTrade> tradeQueryWrapper = new QueryWrapper<>(); QueryWrapper<PayConsumeTrade> tradeQueryWrapper = new QueryWrapper<>();
tradeQueryWrapper.eq("order_id", order_id); tradeQueryWrapper.eq("order_id", order_id);
PayConsumeTrade trade_row_tmp = payConsumeTradeService.findOne(tradeQueryWrapper); PayConsumeTrade trade_row_tmp = payConsumeTradeService.getOne(tradeQueryWrapper, false);
// 固定死 是门店收银还是店铺收银 统一店铺收银 // 固定死 是门店收银还是店铺收银 统一店铺收银
if (true) { if (true) {
@ -1296,7 +1296,7 @@ public class PayUserPayServiceImpl extends BaseServiceImpl<PayUserPayMapper, Pay
logger.info(String.format(I18nUtil._("支付回调验签结果verifyResult【%s】"), verifyResult)); logger.info(String.format(I18nUtil._("支付回调验签结果verifyResult【%s】"), verifyResult));
QueryWrapper<PayPaymentChannel> channelQueryWrapper = new QueryWrapper<>(); QueryWrapper<PayPaymentChannel> channelQueryWrapper = new QueryWrapper<>();
channelQueryWrapper.eq("payment_channel_code", payment_channel_code); channelQueryWrapper.eq("payment_channel_code", payment_channel_code);
PayPaymentChannel payPaymentChannel = payPaymentChannelService.findOne(channelQueryWrapper); PayPaymentChannel payPaymentChannel = payPaymentChannelService.getOne(channelQueryWrapper, false);
Integer payment_channel_id = payPaymentChannel.getPayment_channel_id(); Integer payment_channel_id = payPaymentChannel.getPayment_channel_id();
// 插入充值记录 // 插入充值记录
@ -1416,7 +1416,7 @@ public class PayUserPayServiceImpl extends BaseServiceImpl<PayUserPayMapper, Pay
logger.debug("[拉卡拉支付通知] 查询交易信息: orderId={}", orderId); logger.debug("[拉卡拉支付通知] 查询交易信息: orderId={}", orderId);
QueryWrapper<PayConsumeTrade> tradeQueryWrapper = new QueryWrapper<>(); QueryWrapper<PayConsumeTrade> tradeQueryWrapper = new QueryWrapper<>();
tradeQueryWrapper.eq("order_id", orderId); tradeQueryWrapper.eq("order_id", orderId);
PayConsumeTrade trade_row_tmp = payConsumeTradeService.findOne(tradeQueryWrapper); PayConsumeTrade trade_row_tmp = payConsumeTradeService.getOne(tradeQueryWrapper, false);
Integer payment_store_id = trade_row_tmp != null ? trade_row_tmp.getStore_id() : 0; Integer payment_store_id = trade_row_tmp != null ? trade_row_tmp.getStore_id() : 0;
String orderSubject = trade_row_tmp != null ? trade_row_tmp.getTrade_title() : ""; String orderSubject = trade_row_tmp != null ? trade_row_tmp.getTrade_title() : "";
@ -1437,7 +1437,7 @@ public class PayUserPayServiceImpl extends BaseServiceImpl<PayUserPayMapper, Pay
logger.debug("[拉卡拉支付通知] 查询支付渠道: channelCode=lakala"); logger.debug("[拉卡拉支付通知] 查询支付渠道: channelCode=lakala");
QueryWrapper<PayPaymentChannel> channelQueryWrapper = new QueryWrapper<>(); QueryWrapper<PayPaymentChannel> channelQueryWrapper = new QueryWrapper<>();
channelQueryWrapper.eq("payment_channel_code", "lakala"); channelQueryWrapper.eq("payment_channel_code", "lakala");
PayPaymentChannel payPaymentChannel = payPaymentChannelService.findOne(channelQueryWrapper); PayPaymentChannel payPaymentChannel = payPaymentChannelService.getOne(channelQueryWrapper, false);
if (payPaymentChannel == null) { if (payPaymentChannel == null) {
logger.error("[拉卡拉支付通知] 支付渠道不存在: channelCode=lakala"); logger.error("[拉卡拉支付通知] 支付渠道不存在: channelCode=lakala");

View File

@ -251,7 +251,7 @@ public class KdApiExpressSearchServiceImpl implements KdApiExpressSearchService
queryWrapper.eq("order_id", orderId); queryWrapper.eq("order_id", orderId);
queryWrapper.eq("logistics_enable", CommonConstant.Enable); queryWrapper.eq("logistics_enable", CommonConstant.Enable);
ShopOrderLogistics shopOrderLogistic = shopOrderLogisticsService.findOne(queryWrapper); ShopOrderLogistics shopOrderLogistic = shopOrderLogisticsService.getOne(queryWrapper, false);
if (ObjectUtil.isEmpty(shopOrderLogistic)) { if (ObjectUtil.isEmpty(shopOrderLogistic)) {
logger.warn(I18nUtil._("未找到发货记录")); logger.warn(I18nUtil._("未找到发货记录"));
return null; return null;
@ -313,7 +313,7 @@ public class KdApiExpressSearchServiceImpl implements KdApiExpressSearchService
public CommonResult returnLogistics(String return_tracking_name, String return_tracking_number, String order_id) { public CommonResult returnLogistics(String return_tracking_name, String return_tracking_number, String order_id) {
QueryWrapper<ShopBaseExpress> wrapper = new QueryWrapper<>(); QueryWrapper<ShopBaseExpress> wrapper = new QueryWrapper<>();
wrapper.eq("express_name", return_tracking_name); wrapper.eq("express_name", return_tracking_name);
ShopBaseExpress shopBaseExpress = shopBaseExpressService.findOne(wrapper); ShopBaseExpress shopBaseExpress = shopBaseExpressService.getOne(wrapper, false);
if (shopBaseExpress == null) { if (shopBaseExpress == null) {
throw new ApiException(I18nUtil._("系统中未配置该物流信息,请检查发货信息是否正确!")); throw new ApiException(I18nUtil._("系统中未配置该物流信息,请检查发货信息是否正确!"));
} }
@ -331,7 +331,7 @@ public class KdApiExpressSearchServiceImpl implements KdApiExpressSearchService
QueryWrapper<ShopOrderReturn> orderReturnQueryWrapper = new QueryWrapper<>(); QueryWrapper<ShopOrderReturn> orderReturnQueryWrapper = new QueryWrapper<>();
orderReturnQueryWrapper.eq("return_tracking_number", return_tracking_number); orderReturnQueryWrapper.eq("return_tracking_number", return_tracking_number);
orderReturnQueryWrapper.eq("return_tracking_name", return_tracking_name); orderReturnQueryWrapper.eq("return_tracking_name", return_tracking_name);
ShopOrderReturn orderReturn = shopOrderReturnService.findOne(orderReturnQueryWrapper); ShopOrderReturn orderReturn = shopOrderReturnService.getOne(orderReturnQueryWrapper, false);
if (orderReturn == null) { if (orderReturn == null) {
throw new ApiException(I18nUtil._("退款退货信息不存在!")); throw new ApiException(I18nUtil._("退款退货信息不存在!"));

View File

@ -30,14 +30,12 @@ import java.util.Map;
@Service @Service
public class ShopBaseCurrencyServiceImpl extends BaseServiceImpl<ShopBaseCurrencyMapper, ShopBaseCurrency> implements ShopBaseCurrencyService { public class ShopBaseCurrencyServiceImpl extends BaseServiceImpl<ShopBaseCurrencyMapper, ShopBaseCurrency> implements ShopBaseCurrencyService {
private final Logger logger = LoggerFactory.getLogger(ShopBaseCurrencyServiceImpl.class);
@Autowired @Autowired
private AccountBaseConfigService accountBaseConfigService; private AccountBaseConfigService accountBaseConfigService;
@Autowired @Autowired
private HttpServletRequest servletRequest; private HttpServletRequest servletRequest;
private Logger logger = LoggerFactory.getLogger(ShopBaseCurrencyServiceImpl.class);
/** /**
* 获取当前汇率 * 获取当前汇率
*/ */
@ -62,7 +60,7 @@ public class ShopBaseCurrencyServiceImpl extends BaseServiceImpl<ShopBaseCurrenc
} else { } else {
QueryWrapper<ShopBaseCurrency> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopBaseCurrency> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("currency_is_default", 1); queryWrapper.eq("currency_is_default", 1);
user_currency_row = findOne(queryWrapper); user_currency_row = getOne(queryWrapper, false);
} }
if (user_currency_row != null) { if (user_currency_row != null) {
currency_exchange_rate = user_currency_row.getCurrency_exchange_rate(); currency_exchange_rate = user_currency_row.getCurrency_exchange_rate();
@ -94,7 +92,7 @@ public class ShopBaseCurrencyServiceImpl extends BaseServiceImpl<ShopBaseCurrenc
} else { } else {
QueryWrapper<ShopBaseCurrency> queryWrapper = new QueryWrapper<>(); QueryWrapper<ShopBaseCurrency> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("currency_is_default", 1); queryWrapper.eq("currency_is_default", 1);
user_currency_row = findOne(queryWrapper); user_currency_row = getOne(queryWrapper, false);
} }
if (user_currency_row != null) { if (user_currency_row != null) {

View File

@ -9,6 +9,7 @@
package com.suisung.mall.shop.esign.service.impl; package com.suisung.mall.shop.esign.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.suisung.mall.common.constant.CommonConstant; import com.suisung.mall.common.constant.CommonConstant;
@ -83,8 +84,8 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
.eq("status", CommonConstant.Enable) .eq("status", CommonConstant.Enable)
.orderByAsc("id"); .orderByAsc("id");
EsignPlatformInfo esignPlatformInfo = findOne(queryWrapper); EsignPlatformInfo esignPlatformInfo = getOne(queryWrapper, false);
if (esignPlatformInfo == null || esignPlatformInfo.getId() == null || esignPlatformInfo.getId() <= 0) { if (ObjectUtil.isEmpty(esignPlatformInfo)) {
log.error("[获取平台和代理商信息] 未找到有效的平台方记录"); log.error("[获取平台和代理商信息] 未找到有效的平台方记录");
return Collections.emptyList(); return Collections.emptyList();
} }
@ -108,14 +109,13 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
return esignPlatformInfos; return esignPlatformInfos;
} }
// 获取县级代理商的省级代理商 // 获取县级代理商的省级代理商
queryWrapper.clear(); queryWrapper.clear();
queryWrapper.eq("id", agent2nd.getParent_id()) queryWrapper.eq("id", agent2nd.getParent_id())
.eq("level", CommonConstant.Agent_Level_1st) .eq("level", CommonConstant.Agent_Level_1st)
.gt("split_ratio", 0) .gt("split_ratio", 0)
.eq("status", CommonConstant.Enable); .eq("status", CommonConstant.Enable);
EsignPlatformInfo agent1st = findOne(queryWrapper); EsignPlatformInfo agent1st = getOne(queryWrapper, false);
if (agent1st != null) { if (agent1st != null) {
esignPlatformInfos.add(agent1st); esignPlatformInfos.add(agent1st);
log.debug("[获取平台和代理商信息] 成功获取一级代理信息ID: {}", agent1st.getId()); log.debug("[获取平台和代理商信息] 成功获取一级代理信息ID: {}", agent1st.getId());
@ -149,7 +149,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
queryWrapper.eq("license_number", licenseNumber); queryWrapper.eq("license_number", licenseNumber);
} }
return findOne(queryWrapper); return getOne(queryWrapper, false);
} }
/** /**
@ -185,7 +185,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
.eq("status", CommonConstant.Enable) .eq("status", CommonConstant.Enable)
.select("telephone", "license_number", "legal_person_mobile"); .select("telephone", "license_number", "legal_person_mobile");
EsignPlatformInfo esignPlatformInfo = findOne(queryWrapper); EsignPlatformInfo esignPlatformInfo = getOne(queryWrapper, false);
if (esignPlatformInfo == null) { if (esignPlatformInfo == null) {
log.warn("[获取平台方信息] 未找到有效的平台方记录"); log.warn("[获取平台方信息] 未找到有效的平台方记录");
return null; return null;
@ -253,7 +253,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
// 优先使用指定的分销商ID查询否则使用区域信息查询 // 优先使用指定的分销商ID查询否则使用区域信息查询
if (shopMchEntry.getDistributor_id() != null && shopMchEntry.getDistributor_id() > 0) { if (shopMchEntry.getDistributor_id() != null && shopMchEntry.getDistributor_id() > 0) {
queryWrapper.eq("id", shopMchEntry.getDistributor_id()); queryWrapper.eq("id", shopMchEntry.getDistributor_id());
result = findOne(queryWrapper); result = getOne(queryWrapper, false);
log.debug("[获取二级代理] 使用指定分销商ID查询distributorId={}", shopMchEntry.getDistributor_id()); log.debug("[获取二级代理] 使用指定分销商ID查询distributorId={}", shopMchEntry.getDistributor_id());
@ -264,7 +264,7 @@ public class EsignPlatformInfoServiceImpl extends BaseServiceImpl<EsignPlatformI
queryWrapper.eq("license_district_id", shopMchEntry.getStore_district()) queryWrapper.eq("license_district_id", shopMchEntry.getStore_district())
.gt("shipping_fee", 0).ne("supplier_id", "") .gt("shipping_fee", 0).ne("supplier_id", "")
.orderByAsc("id"); .orderByAsc("id");
result = findOne(queryWrapper); result = getOne(queryWrapper, false);
log.debug("[获取二级代理] 使用区域信息查询districtId={}", shopMchEntry.getStore_district()); log.debug("[获取二级代理] 使用区域信息查询districtId={}", shopMchEntry.getStore_district());

View File

@ -76,12 +76,10 @@ public class LklLedgerReceiverServiceImpl extends BaseServiceImpl<LklLedgerRecei
} }
queryWrapper.eq("platform_id", platformId).eq("status", CommonConstant.Enable); queryWrapper.eq("platform_id", platformId).eq("status", CommonConstant.Enable);
List<LklLedgerReceiver> existsRecordList = list(queryWrapper); LklLedgerReceiver existsRecord = getOne(queryWrapper, false);
if (CollectionUtil.isNotEmpty(existsRecordList) if (ObjectUtil.isNotEmpty(existsRecord)) {
&& existsRecordList.get(0) != null
&& existsRecordList.get(0).getId() > 0) {
// 更新记录 // 更新记录
record.setId(existsRecordList.get(0).getId()); record.setId(existsRecord.getId());
return updateById(record); return updateById(record);
} }
@ -147,7 +145,6 @@ public class LklLedgerReceiverServiceImpl extends BaseServiceImpl<LklLedgerRecei
return null; return null;
} }
JSONArray reqParams = new JSONArray(); JSONArray reqParams = new JSONArray();
for (EsignPlatformInfo esignPlatformInfo : esignPlatformInfoList) { for (EsignPlatformInfo esignPlatformInfo : esignPlatformInfoList) {
JSONObject reqParam = new JSONObject(); JSONObject reqParam = new JSONObject();