Compare commits
237 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c11e6d23e | |||
| 599a64a9f6 | |||
| 0bb857f53f | |||
| 7793e8c88d | |||
| 3fbec6b4c6 | |||
| 0fda3429cc | |||
| 1c8e088942 | |||
| ee4a2d3a6f | |||
| f0ce87c78e | |||
| ff2d598fa8 | |||
| e8c072e906 | |||
| fbcae73292 | |||
| 404064f4c2 | |||
| bab3008b67 | |||
| 4454a63465 | |||
| 0d58584b13 | |||
| dd0c96a79e | |||
| eada1643a6 | |||
| e210eddad0 | |||
| 8abb1262c6 | |||
| 3279044126 | |||
| 037f9f70b4 | |||
| 95ec63a3a2 | |||
| 90315b979f | |||
| feacac879a | |||
| ed5e357dff | |||
| 25e02c2dd1 | |||
| 565fb70b1b | |||
| f4ab420e95 | |||
| e1d7d4eabf | |||
| 48802a666b | |||
| 194290bb49 | |||
| 588eeb616f | |||
| 989fb77f4d | |||
| 4e9ac87d9b | |||
| a19f94ccb1 | |||
| 0f342b87f2 | |||
| 35d3c3248c | |||
| 93066d08f1 | |||
| 98180bda0b | |||
| 52bb53001b | |||
| 7f7c29150c | |||
| c4fa0dbbd6 | |||
| d7158d2e34 | |||
| 56f237e7bc | |||
| cdeeef7b86 | |||
| f833a26698 | |||
| 4ccc4f5a2c | |||
| 92b94fc3fa | |||
| ceccc58be9 | |||
| c3e72256ef | |||
| 2ed1fba191 | |||
| 39a58bf52b | |||
| a9858a0213 | |||
| ff0aed0ad8 | |||
| 485b405434 | |||
| af5038775f | |||
| 42167683e9 | |||
| 45762c4bff | |||
| 25ac606130 | |||
| 3943334324 | |||
| f8a699ed59 | |||
| 04b0966998 | |||
| 8fb45b9bf9 | |||
| 5eed3c89d4 | |||
| 392f0546f6 | |||
| 39b2347df0 | |||
| 8f174491eb | |||
| 5148464bea | |||
| c25d5a81ce | |||
| dd418b8f75 | |||
| 863e9dcab1 | |||
| 2d498ea8ef | |||
| 76a6a232b4 | |||
| 2cf86c2dec | |||
| 808649c2ec | |||
| 92e5ccdff9 | |||
| 29b4552e26 | |||
| efe4d0124c | |||
| e7fa450f1c | |||
| 877c33e74a | |||
| ec42344101 | |||
| 98e98e1ffc | |||
| 197bd7d683 | |||
| d493ebc20e | |||
| eaa44aab1a | |||
| a6fb1c21b4 | |||
| 1a9375086c | |||
| 1b5de183bd | |||
| 53cc5a0d76 | |||
| e97416feeb | |||
| 1754272f7f | |||
| 968c27c237 | |||
| 367236a02b | |||
| fa5166b145 | |||
| ad54a11aae | |||
| a049277ea0 | |||
| 06a34dd59a | |||
| 6151ed58fe | |||
| f4d33560b4 | |||
| f124a08377 | |||
| 31a28b418d | |||
| ff7be4b8ae | |||
| f5af7f93fc | |||
| 197c6272f9 | |||
| 41b339e825 | |||
| 45a4166b0b | |||
| e3741192c4 | |||
| 600135e196 | |||
| ac908a133a | |||
| 4cc4c58470 | |||
| c8e912f378 | |||
| 5ef7e407ac | |||
| ff43646921 | |||
| b775bf9184 | |||
| bfae893862 | |||
| c934bcb9dc | |||
| 3e5e9c265e | |||
| f581602691 | |||
| 4abdfe4ee8 | |||
| f0d897222f | |||
| c504daf333 | |||
| 119c39ece8 | |||
| bb2bccf92c | |||
| a68e1de1d4 | |||
| 198479f091 | |||
| eed931c65b | |||
| f8c4c1177b | |||
| fd2fd5c899 | |||
| 36982e053e | |||
| 03a475d1c9 | |||
| 4b13a8c0d3 | |||
| 5259e85f98 | |||
| 8a8c13d9e3 | |||
| 31c3b52963 | |||
| 471244b8e6 | |||
| 4d2649d5e9 | |||
| beb42524dc | |||
| 58d75735d6 | |||
| 6604eb70cb | |||
| 874e5da9af | |||
| 73f030e222 | |||
| e1d983f0ad | |||
| 538ced5cd2 | |||
| 14ad8988e7 | |||
| 1b27a1c58d | |||
| cad18ed55c | |||
| 7d3fb8d322 | |||
| 6885640533 | |||
| 76e4b86357 | |||
| 311a82a32f | |||
| 3c067f4233 | |||
| f16582a5db | |||
| 6b4785b006 | |||
| 072bf26b12 | |||
| 21ae722873 | |||
| 4e77bd61b8 | |||
| bc26ada1f6 | |||
| 6dfadcec94 | |||
| d2600ed52e | |||
| f0c1967f7a | |||
| 142f2414a9 | |||
| 5562e14ca5 | |||
| fe80681e2e | |||
| 3ba8cd9d3e | |||
| 2aa0fd027a | |||
| 675b55baa5 | |||
| 00956c1ca5 | |||
| 767d9ae343 | |||
| bb9f905303 | |||
| 534eae1a56 | |||
| be821d0265 | |||
| 286180258f | |||
| afddad1926 | |||
| 97ecfa3c79 | |||
| 76b378d205 | |||
| 99af352328 | |||
| c6736d120d | |||
| 951050da3d | |||
| e5c22d51f4 | |||
| f0237085ed | |||
| 453aba2930 | |||
| f74de955c5 | |||
| a8fce86d84 | |||
| 5b7be1a41c | |||
| dffed92a76 | |||
| cfc0f6fcbc | |||
| 47b8f474a9 | |||
| 663f4689a7 | |||
| 3a30209005 | |||
| 4d9b91501e | |||
| dc7431daaf | |||
| 1a5d5e3550 | |||
| c7ab97f948 | |||
| 1a841f3f85 | |||
| 704b9df74d | |||
| 61228d9c35 | |||
| 37d6173697 | |||
| eade3040d2 | |||
| 9eafc6bac5 | |||
| bde21f33c7 | |||
| 6f186ea197 | |||
| 45498067a6 | |||
| 0c4467ea4f | |||
| 0f0f4e048c | |||
| 7253649412 | |||
| c9790a76e1 | |||
| 4a11ac1867 | |||
| 4efd79c180 | |||
| 5fa1877072 | |||
| 3d63719719 | |||
| 2275668d43 | |||
| 18af66e858 | |||
| 65f3031a70 | |||
| e624d14abb | |||
| f524928b5a | |||
| b94da3f38a | |||
| fcec279495 | |||
| a2cda4e494 | |||
| 0ac51a5119 | |||
| 1ae6a7a0aa | |||
| 4699a7a90c | |||
| 8f4c981cb5 | |||
| 338758884c | |||
| 5e2e83bc24 | |||
| 99ec09fe04 | |||
| 61e1614c62 | |||
| e100c95d3b | |||
| a5871fb9b0 | |||
| 4563779ce3 | |||
| fca7eeec37 | |||
| 11943acfb8 | |||
| 527c83e677 | |||
| f1204cf2d0 | |||
| b8406deda7 | |||
| 36d27edefe | |||
| 0e1ef491e2 |
@ -11,7 +11,6 @@ import com.suisung.mall.common.utils.I18nUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -33,7 +32,6 @@ public class AccountBaseUserLevelController {
|
||||
@Autowired
|
||||
private AccountBaseUserLevelService accountBaseUserLevelService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -232,17 +231,5 @@ public class AccountUserBaseController extends BaseControllerImpl {
|
||||
return CommonResult.success(accountUserBaseService.logout());
|
||||
}
|
||||
|
||||
@ApiOperation("注册商家账号,项目之间远程调用")
|
||||
@RequestMapping(value = "/merchant/inner-register", method = RequestMethod.POST)
|
||||
public Pair<Boolean, String> merchantInnerRegister(@RequestParam("mobile") String mobile, @RequestParam("regPwd") String regPwd) {
|
||||
return accountUserBaseService.merchantInnerRegister(mobile, regPwd);
|
||||
}
|
||||
|
||||
@ApiOperation("更改分店商家的手机号(仅限于分店,尽量不要更高总店的手机号),项目之间远程调用")
|
||||
@RequestMapping(value = "/change/merchant/login-mobile", method = RequestMethod.POST)
|
||||
public Pair<Boolean, String> changeMerchantLoginMobile(@RequestParam("oldMobile") String oldMobile, @RequestParam("newMobile") String newMobile, @RequestParam("password") String password) {
|
||||
return accountUserBaseService.changeMerchantLoginMobile(oldMobile, newMobile, password);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -85,17 +85,5 @@ public class AccountUserBindConnectController {
|
||||
return accountUserBindConnectService.getUserBindConnectUserIdByCondition(bind_id, bind_type, user_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查手机注册的商家是否存在(仅供内部调用)
|
||||
*
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "检查手机注册的商家是否存在(仅供内部调用)", notes = "检查手机注册的商家是否存在(仅供内部调用)")
|
||||
@RequestMapping(value = "/is-merchant-exists", method = RequestMethod.POST)
|
||||
public Integer isMerchantExists(@RequestParam(name = "mobile") String mobile) {
|
||||
return accountUserBindConnectService.isMerchantExists(mobile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -298,25 +298,6 @@ public interface AccountUserBaseService extends IBaseService<AccountUserBase> {
|
||||
*/
|
||||
ThirdApiRes saveBatchAccountInfo(List<AccountUserInfo> accountUserInfoList);
|
||||
|
||||
/**
|
||||
* 商家内部注册(服务之间调用)
|
||||
*
|
||||
* @param mobile 商家手机号
|
||||
* @param regPwd 注册密码
|
||||
* @return Pair<Boolean, String> 第一个元素表示是否成功,第二个元素表示提示信息
|
||||
*/
|
||||
Pair<Boolean, String> merchantInnerRegister(String mobile, String regPwd);
|
||||
|
||||
/**
|
||||
* 更改分店商家的手机号(仅限于分店,尽量不要更改总店的手机号),项目之间远程调用
|
||||
*
|
||||
* @param oldMobile 老的手机号
|
||||
* @param newMobile 新的手机号
|
||||
* @param password 新的登录密码(可选)
|
||||
* @return Pair<Boolean, String> 操作结果和提示信息,true表示成功,false表示失败
|
||||
*/
|
||||
Pair<Boolean, String> changeMerchantLoginMobile(String oldMobile, String newMobile, String password);
|
||||
|
||||
/**
|
||||
* 批量保存accountInfo
|
||||
*
|
||||
|
||||
@ -4,7 +4,6 @@ import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.modules.account.AccountUserBindConnect;
|
||||
import com.suisung.mall.common.pojo.req.WxUserInfoReq;
|
||||
import com.suisung.mall.core.web.service.IBaseService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -90,17 +89,9 @@ public interface AccountUserBindConnectService extends IBaseService<AccountUserB
|
||||
*/
|
||||
AccountUserBindConnect initAccountUserBindConnect(String bindId, Integer bindType, Integer userId, Integer userType);
|
||||
|
||||
List<AccountUserBindConnect> getAllBindPage(String bindTmpl, Integer pageNum, Integer pageSize);
|
||||
List<AccountUserBindConnect> getAllBindPage(String bindTmpl,Integer pageNum, Integer pageSize);
|
||||
|
||||
long getAllBindCount(String bindTmpl);
|
||||
|
||||
void bindTmplId(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 检查手机注册的商家是否存在
|
||||
*
|
||||
* @param mobile
|
||||
* @return 1-存在;2-不存在;3-参数有误
|
||||
*/
|
||||
Integer isMerchantExists(String mobile);
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@ import static com.suisung.mall.common.utils.I18nUtil._;
|
||||
@Service
|
||||
public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseMapper, AccountUserBase> implements AccountUserBaseService {
|
||||
|
||||
private final String VERIFY_CODE_KEY = RedisConstant.VERIFY_CODE_KEY; //"register:verifyCode:";
|
||||
private final String VERIFY_CODE_KEY = "register:verifyCode:";
|
||||
private final Logger logger = LoggerFactory.getLogger(AccountUserBaseServiceImpl.class);
|
||||
@Autowired
|
||||
private AuthService authService;
|
||||
@ -1715,6 +1715,8 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
|
||||
|
||||
// 有手机参数,优先手机注册
|
||||
// if ((StrUtil.isNotBlank(user_mobile))
|
||||
// || (CheckUtil.isMobile(user_account, user_intl) && StrUtil.equals(user_account, user_mobile))) {
|
||||
if (StrUtil.isNotBlank(user_mobile) && CheckUtil.isMobile(user_mobile, user_intl)) {
|
||||
|
||||
if (StrUtil.isNotBlank(rand_key) && StrUtil.isNotBlank(verifyCode)) {
|
||||
@ -1799,7 +1801,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
throw new ApiException(_("绑定账号失败"));
|
||||
}
|
||||
return user_base_row;
|
||||
|
||||
// throw new ApiException(_("用户已经存在,请更换用户名"));
|
||||
} else {
|
||||
// 检测到用户尚未注册,立即新增用户基本信息和用户附加信息
|
||||
String user_nickname = Convert.toStr(userInfo.get("user_nickname"), user_account);
|
||||
@ -1814,6 +1816,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
// 密码加盐加密
|
||||
user_password = SecureUtil.md5(user_salt + SecureUtil.md5(user_password));
|
||||
user_base_reg_row.setUser_password(user_password);
|
||||
// user_base_reg_row.setUser_password((BCrypt.hashpw(user_password)));
|
||||
user_base_reg_row.setUser_nickname(user_nickname);
|
||||
user_base_reg_row.setUser_state(user_state);
|
||||
user_base_reg_row.setUser_key(user_key);
|
||||
@ -1897,17 +1900,16 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
|
||||
// 远程调用异常忽略掉
|
||||
try {
|
||||
// User_Resource初始化 用户积分
|
||||
if (!payService.initUserPoints(user_id)) {
|
||||
log.error("初始化用户积分失败");
|
||||
// throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
// 初始化用户经验表
|
||||
if (!accountUserInfoService.initUserExperience(user_id)) {
|
||||
log.error("初始化用户经验表失败");
|
||||
// throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
|
||||
@ -1923,6 +1925,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
addSourceUserId(user_id, user_parent_id);
|
||||
}
|
||||
|
||||
//todo 分享券
|
||||
// 分享券活动id
|
||||
Integer activityId = Convert.toInt(getParameter("activity_id"));
|
||||
if (CheckUtil.isEmpty(activityId) && CheckUtil.isNotEmpty(activity_id)) {
|
||||
@ -1950,7 +1953,7 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
// 如果是商家首次注册 恭喜您,成功注册了商家账号!您的初始密码为:${password},密码可登录商家版 APP,登录后请尽快修改密码。
|
||||
Map<String, Object> smsArgs = new HashMap<>();
|
||||
smsArgs.put("password", user_password_src);
|
||||
sendSmsMessage(PhoneNumberUtils.cleanPhoneNumber(user_mobile), "SMS_496910525", smsArgs);
|
||||
sendSmsMessage(PhoneNumberUtils.cleanPhoneNumber(user_mobile), "SMS_496910525", smsArgs); // SMS_496910525
|
||||
}
|
||||
|
||||
//初次注册发送消息
|
||||
@ -3218,20 +3221,6 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
* @return
|
||||
*/
|
||||
public CommonResult doMobileBindLogin(String user_mobile, Integer userType, String cid, String osType) {
|
||||
return doMobileBindLogin(user_mobile, "", userType, cid, osType);
|
||||
}
|
||||
|
||||
/**
|
||||
* (商家版app)入驻商家手机号绑定登录
|
||||
*
|
||||
* @param user_mobile
|
||||
* @param regPwd 注册用途
|
||||
* @param userType
|
||||
* @param cid
|
||||
* @param osType
|
||||
* @return
|
||||
*/
|
||||
public CommonResult doMobileBindLogin(String user_mobile, String regPwd, Integer userType, String cid, String osType) {
|
||||
if (StrUtil.isBlank(user_mobile) || userType == null) {
|
||||
return CommonResult.failed("缺少必要参数!");
|
||||
}
|
||||
@ -3258,11 +3247,8 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
userInfo.put("user_account", user_mobile);
|
||||
userInfo.put("user_mobile", user_mobile);
|
||||
userInfo.put("user_is_admin", userType); // 商家入驻注册
|
||||
String user_password = regPwd;
|
||||
if (StrUtil.isBlank(user_password)) {
|
||||
// 随机数明文密码
|
||||
user_password = com.suisung.mall.common.utils.StringUtils.random(6, com.suisung.mall.common.utils.StringUtils.RandomType.STRING);
|
||||
}
|
||||
// 随机数明文密码
|
||||
String user_password = com.suisung.mall.common.utils.StringUtils.random(6, com.suisung.mall.common.utils.StringUtils.RandomType.STRING);
|
||||
userInfo.put("user_password", user_password);
|
||||
userInfo.put("is_admin", userType); // 商家入驻注册
|
||||
|
||||
@ -3281,162 +3267,17 @@ public class AccountUserBaseServiceImpl extends BaseServiceImpl<AccountUserBaseM
|
||||
params.put("username", accountUserBase.getUser_account());
|
||||
params.put("password", "");
|
||||
params.put("user_mobile", user_mobile);
|
||||
params.put("is_merch", CommonConstant.Enable.toString()); // 是否为商家入驻 1-是;其他-否
|
||||
params.put("is_merch", "1"); // 是否为商家入驻 1-是;其他-否
|
||||
|
||||
if (StrUtil.isNotBlank(cid)) {
|
||||
params.put("cid", cid); // 个推客户端Id
|
||||
params.put("os_type", osType);// 个推客系统类别 1-Android;2-iOS;3-微信小程序;
|
||||
// logger.info("推送参数2 cid:{}, osType:{}", cid, osType);
|
||||
}
|
||||
|
||||
return login(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家内部注册(服务之间调用)
|
||||
*
|
||||
* @param mobile 商家手机号
|
||||
* @param regPwd 注册明文密码
|
||||
* @return Pair<Boolean, String> 第一个元素表示是否成功,第二个元素表示提示信息
|
||||
*/
|
||||
@Override
|
||||
public Pair<Boolean, String> merchantInnerRegister(String mobile, String regPwd) {
|
||||
log.info("商家内部注册开始,手机号: {}", mobile);
|
||||
|
||||
// 1. 参数校验
|
||||
if (StrUtil.isBlank(mobile)) {
|
||||
log.warn("商家内部注册失败:手机号为空");
|
||||
return Pair.of(false, "手机号不能为空");
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. 转换手机号格式(添加国家区号)
|
||||
String convertedMobile = PhoneNumberUtils.convZhPhoneNumber(mobile);
|
||||
|
||||
// 3. 检查手机号是否已注册为商家
|
||||
Integer isExists = accountUserBindConnectService.isMerchantExists(convertedMobile);
|
||||
if (CommonConstant.Enable.equals(isExists)) {
|
||||
log.warn("商家内部注册失败:手机号已注册,手机号: {}", convertedMobile);
|
||||
return Pair.of(false, "该手机号已注册!");
|
||||
}
|
||||
|
||||
// 4. 执行手机号绑定登录(注册商家账号)
|
||||
CommonResult result = doMobileBindLogin(convertedMobile, regPwd, CommonConstant.USER_TYPE_MCH, null, null);
|
||||
|
||||
// 5. 检查注册结果
|
||||
if (result == null || result.getCode() != ResultCode.SUCCESS.getCode()) {
|
||||
String errorMsg = result != null ? result.getMsg() : "注册结果为空";
|
||||
log.error("商家账号注册失败:{},手机号: {}", errorMsg, convertedMobile);
|
||||
return Pair.of(false, "商家账号注册失败:" + errorMsg);
|
||||
}
|
||||
|
||||
log.info("商家内部注册成功,手机号: {}", convertedMobile);
|
||||
return Pair.of(true, "商家注册成功");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("商家内部注册异常,手机号: {}", mobile, e);
|
||||
return Pair.of(false, "商家注册失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改分店商家的手机号(仅限于分店,尽量不要更改总店的手机号),项目之间远程调用
|
||||
*
|
||||
* @param oldMobile 老的手机号
|
||||
* @param newMobile 新的手机号
|
||||
* @param password 新的登录密码(可选)
|
||||
* @return Pair<Boolean, String> 操作结果和提示信息,true表示成功,false表示失败
|
||||
*/
|
||||
@Override
|
||||
public Pair<Boolean, String> changeMerchantLoginMobile(String oldMobile, String newMobile, String password) {
|
||||
log.debug("开始更改商家登录手机号,老手机号:{},新手机号:{},是否需要设置密码:{}", oldMobile, newMobile, StrUtil.isNotBlank(password));
|
||||
|
||||
try {
|
||||
// 验证输入参数
|
||||
if (StrUtil.isBlank(oldMobile) || StrUtil.isBlank(newMobile)) {
|
||||
log.warn("手机号参数为空,老手机号:{},新手机号:{}", oldMobile, newMobile);
|
||||
return Pair.of(false, "手机号不能为空");
|
||||
}
|
||||
|
||||
// 格式化手机号,添加国际区号
|
||||
String formattedOldMobile = PhoneNumberUtils.convZhPhoneNumber(oldMobile);
|
||||
String formattedNewMobile = PhoneNumberUtils.convZhPhoneNumber(newMobile);
|
||||
log.debug("格式化后的手机号:老:{} 新:{}", formattedOldMobile, formattedNewMobile);
|
||||
|
||||
// 查询老手机号是否绑定商家账号
|
||||
AccountUserBindConnect bindConnect = bindConnectService.getBindByBindId(formattedOldMobile, BindCode.MOBILE, CommonConstant.USER_TYPE_MCH);
|
||||
if (bindConnect == null) {
|
||||
log.warn("该老手机号未绑定商家账号,手机号:{}", formattedOldMobile);
|
||||
return Pair.of(false, "该老手机号未绑定商家账号,无法进行更换");
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
Integer userId = bindConnect.getUser_id();
|
||||
log.debug("绑定记录中的用户ID:{}", userId);
|
||||
|
||||
AccountUserBase userBase = get(userId);
|
||||
if (userBase == null) {
|
||||
log.warn("用户信息不存在,用户ID:{}", userId);
|
||||
return Pair.of(false, "用户信息不存在,无法进行更换");
|
||||
}
|
||||
|
||||
// 验证用户确实是商家类型
|
||||
if (!userBase.getUser_is_admin().equals(CommonConstant.USER_TYPE_MCH)) {
|
||||
log.warn("该账号不是商家账号,用户ID:{},用户类型:{}", userId, userBase.getUser_is_admin());
|
||||
return Pair.of(false, "该账号不是商家账号,无法进行更换");
|
||||
}
|
||||
|
||||
// 检查目标手机号是否已被其他商家账号使用
|
||||
AccountUserBase existingNewUser = getByAccountAndType(formattedNewMobile, CommonConstant.USER_TYPE_MCH);
|
||||
if (existingNewUser != null && !existingNewUser.getUser_id().equals(userId)) {
|
||||
log.warn("目标手机号已被其他商家账号使用,手机号:{},用户ID:{}", formattedNewMobile, existingNewUser.getUser_id());
|
||||
return Pair.of(false, "该手机号已被其他商家账号使用");
|
||||
}
|
||||
|
||||
// 检查新手机号是否已被其他商家绑定
|
||||
AccountUserBindConnect newBindConnect = bindConnectService.getBindByBindId(formattedNewMobile, BindCode.MOBILE, CommonConstant.USER_TYPE_MCH);
|
||||
if (newBindConnect != null && !newBindConnect.getUser_id().equals(userId)) {
|
||||
log.warn("该新手机号已被其他商家账号绑定,手机号:{},用户ID:{}", formattedNewMobile, newBindConnect.getUser_id());
|
||||
return Pair.of(false, "该手机号已被其他商家账号绑定");
|
||||
}
|
||||
|
||||
// 更新用户账号为新手机号
|
||||
log.debug("开始更新用户账号信息,用户ID:{},新手机号:{}", userId, formattedNewMobile);
|
||||
userBase.setUser_account(formattedNewMobile);
|
||||
|
||||
// 如果提供了密码,则更新密码
|
||||
if (StrUtil.isNotBlank(password)) {
|
||||
log.debug("需要更新用户密码");
|
||||
String user_salt = IdUtil.simpleUUID();
|
||||
String encryptedPassword = SecureUtil.md5(user_salt + SecureUtil.md5(password));
|
||||
userBase.setUser_password(encryptedPassword);
|
||||
userBase.setUser_salt(user_salt);
|
||||
}
|
||||
|
||||
// 更新用户基础信息
|
||||
boolean updateUserResult = saveOrUpdate(userBase);
|
||||
if (!updateUserResult) {
|
||||
log.error("更新用户账号信息失败,用户ID:{}", userId);
|
||||
return Pair.of(false, "更新用户账号信息失败");
|
||||
}
|
||||
|
||||
// 更新绑定表中的bind_id为新手机号
|
||||
log.debug("开始更新绑定信息,原绑定ID:{},新绑定ID:{}", bindConnect.getBind_id(), formattedNewMobile);
|
||||
bindConnect.setBind_id(formattedNewMobile);
|
||||
boolean updateBindResult = accountUserBindConnectService.saveOrUpdate(bindConnect);
|
||||
if (!updateBindResult) {
|
||||
log.error("更新绑定信息失败,绑定ID:{}", formattedNewMobile);
|
||||
return Pair.of(false, "更新绑定信息失败");
|
||||
}
|
||||
|
||||
log.info("更换商家登录手机号成功,用户ID:{},新手机号:{}", userId, formattedNewMobile);
|
||||
return Pair.of(true, "更换商家登录手机号成功");
|
||||
} catch (Exception e) {
|
||||
log.error("更改商家登录手机号过程中发生异常,老手机号:{},新手机号:{}", oldMobile, newMobile, e);
|
||||
return Pair.of(false, "系统异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> doAppConnectLogin(String bind_name, String code) {
|
||||
String id_prefix = "";
|
||||
|
||||
@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.suisung.mall.account.mapper.AccountUserBindConnectMapper;
|
||||
@ -20,7 +19,6 @@ import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||
import com.suisung.mall.common.modules.account.AccountUserBindConnect;
|
||||
import com.suisung.mall.common.modules.account.AccountUserInfo;
|
||||
import com.suisung.mall.common.pojo.req.WxUserInfoReq;
|
||||
import com.suisung.mall.common.utils.CheckUtil;
|
||||
import com.suisung.mall.common.utils.I18nUtil;
|
||||
import com.suisung.mall.common.utils.StringUtils;
|
||||
import com.suisung.mall.common.utils.phone.PhoneNumberUtils;
|
||||
@ -369,65 +367,6 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查手机注册的商家是否存在
|
||||
*
|
||||
* @param mobile
|
||||
* @return 1-已存在 2-不存在 3-格式错误
|
||||
*/
|
||||
@Override
|
||||
public Integer isMerchantExists(String mobile) {
|
||||
log.debug("检查商家是否存在,手机号: {}", mobile);
|
||||
|
||||
if (StrUtil.isBlank(mobile)) {
|
||||
log.warn("手机号为空,无法检查商家是否存在");
|
||||
return 3;
|
||||
}
|
||||
|
||||
try {
|
||||
String convertedMobile = PhoneNumberUtils.convZhPhoneNumber(mobile);
|
||||
if (CheckUtil.isEmpty(convertedMobile)) {
|
||||
log.warn("手机号格式无效: {}", mobile);
|
||||
return 3;
|
||||
}
|
||||
|
||||
// 使用正确的绑定类型检查手机号
|
||||
LambdaQueryWrapper<AccountUserBindConnect> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AccountUserBindConnect::getBind_id, convertedMobile)
|
||||
.eq(AccountUserBindConnect::getBind_type, BindCode.MOBILE) // 1-手机号
|
||||
.eq(AccountUserBindConnect::getUser_type, CommonConstant.USER_TYPE_MCH) // 2-入驻商家
|
||||
.eq(AccountUserBindConnect::getBind_active, CommonConstant.Enable)
|
||||
.orderByAsc(AccountUserBindConnect::getBind_time)
|
||||
.select(AccountUserBindConnect::getUser_id);
|
||||
|
||||
log.debug("执行查询,转换后的手机号: {}, 查询条件: {}", convertedMobile, queryWrapper.getSqlSegment());
|
||||
|
||||
AccountUserBindConnect accountUserBindConnect = getOne(queryWrapper);
|
||||
if (accountUserBindConnect == null || CheckUtil.isEmpty(accountUserBindConnect.getUser_id())) {
|
||||
log.info("未找到手机号绑定的商家记录,手机号: {}", convertedMobile);
|
||||
return 2;
|
||||
}
|
||||
|
||||
Integer userId = accountUserBindConnect.getUser_id();
|
||||
log.debug("找到用户ID: {}", userId);
|
||||
|
||||
AccountUserBase accountUserBase = accountUserBaseService.get(userId);
|
||||
if (accountUserBase == null) {
|
||||
log.warn("用户基础信息不存在,用户ID: {}", userId);
|
||||
return 2;
|
||||
}
|
||||
|
||||
log.info("商家存在,用户ID: {}", userId);
|
||||
return 1;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("查询商家绑定信息时发生异常,手机号: {}", mobile, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户绑定手机号和openid
|
||||
*
|
||||
@ -566,24 +505,24 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountUserBindConnect> getAllBindPage(String bindTmpl, Integer pageNum, Integer pageSize) {
|
||||
public List<AccountUserBindConnect> getAllBindPage(String bindTmpl,Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<AccountUserBindConnect> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("bind_id,bind_type,user_id,user_type");
|
||||
queryWrapper.in("bind_type", Arrays.asList(BindCode.MOBILE, BindCode.WEIXIN_XCX))
|
||||
queryWrapper.in("bind_type", Arrays.asList(BindCode.MOBILE,BindCode.WEIXIN_XCX))
|
||||
.eq("user_type", CommonConstant.USER_TYPE_NORMAL)
|
||||
.eq("bind_active", CommonConstant.Enable)
|
||||
.eq("bind_tmpl", bindTmpl)
|
||||
.eq("bind_tmpl",bindTmpl)
|
||||
.orderByAsc("bind_time");
|
||||
return this.lists(queryWrapper, pageNum, pageSize).getRecords();
|
||||
return this.lists(queryWrapper,pageNum,pageSize).getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getAllBindCount(String bindTmpl) {
|
||||
QueryWrapper<AccountUserBindConnect> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.in("bind_type", Arrays.asList(BindCode.MOBILE, BindCode.WEIXIN_XCX))
|
||||
queryWrapper.in("bind_type", Arrays.asList(BindCode.MOBILE,BindCode.WEIXIN_XCX))
|
||||
.eq("user_type", CommonConstant.USER_TYPE_NORMAL)
|
||||
.eq("bind_active", CommonConstant.Enable)
|
||||
.eq("bind_tmpl", bindTmpl)
|
||||
.eq("bind_tmpl",bindTmpl)
|
||||
.orderByAsc("bind_time");
|
||||
return this.count(queryWrapper);
|
||||
}
|
||||
@ -598,42 +537,42 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
||||
// log.info("错误信息--{}",e.getMessage());
|
||||
// }
|
||||
log.info("jsonObject:{}", jsonObject);
|
||||
String openId = jsonObject.getStr("FromUserName");//用户openid
|
||||
String openId=jsonObject.getStr("FromUserName");//用户openid
|
||||
QueryWrapper<AccountUserBindConnect> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("bind_openid", openId)
|
||||
queryWrapper.eq("bind_openid",openId)
|
||||
.eq("user_type", CommonConstant.USER_TYPE_NORMAL)
|
||||
.in("bind_type", Arrays.asList(1, 15))
|
||||
.in("bind_type",Arrays.asList(1,15))
|
||||
.eq("bind_active", CommonConstant.Enable);
|
||||
List<AccountUserBindConnect> accountUserBindConnectList = list(queryWrapper);
|
||||
List<AccountUserBindConnect> accountUserBindConnectList= list(queryWrapper);
|
||||
if (!accountUserBindConnectList.isEmpty()) {
|
||||
AccountUserBindConnect accountUserBindConnect = accountUserBindConnectList.get(0);
|
||||
JSONArray jsonArray = null;
|
||||
JSONObject object = null;
|
||||
AccountUserBindConnect accountUserBindConnect=accountUserBindConnectList.get(0);
|
||||
JSONArray jsonArray=null;
|
||||
JSONObject object= null;
|
||||
try {
|
||||
jsonArray = jsonObject.getJSONArray("List");
|
||||
} catch (RuntimeException runtimeException) {
|
||||
jsonArray= jsonObject.getJSONArray("List");
|
||||
}catch (RuntimeException runtimeException){
|
||||
log.info("单个模板");
|
||||
object = jsonObject.getJSONObject("List");
|
||||
object=jsonObject.getJSONObject("List");
|
||||
}
|
||||
UpdateWrapper<AccountUserBindConnect> updateWrapper = new UpdateWrapper<>();
|
||||
if (jsonArray != null) {
|
||||
object = (JSONObject) jsonArray.get(0);
|
||||
String templateId = object.getStr("TemplateId");//模板id
|
||||
String SubscribeStatusString = object.getStr("SubscribeStatusString");//订阅结果(accept接收;reject拒收)参考地址https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html#%E8%AE%A2%E9%98%85%E6%B6%88%E6%81%AF%E8%AF%AD%E9%9F%B3%E6%8F%90%E9%86%92
|
||||
if (SubscribeStatusString.equals("accept")) {
|
||||
object= (JSONObject) jsonArray.get(0);
|
||||
String templateId= object.getStr("TemplateId");//模板id
|
||||
String SubscribeStatusString= object.getStr("SubscribeStatusString");//订阅结果(accept接收;reject拒收)参考地址https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html#%E8%AE%A2%E9%98%85%E6%B6%88%E6%81%AF%E8%AF%AD%E9%9F%B3%E6%8F%90%E9%86%92
|
||||
if(SubscribeStatusString.equals("accept")){
|
||||
accountUserBindConnect.setBind_tmpl(templateId);
|
||||
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
||||
}
|
||||
} else {
|
||||
}else {
|
||||
assert object != null;
|
||||
String templateId = object.getStr("TemplateId");//模板id
|
||||
String SubscribeStatusString = object.getStr("SubscribeStatusString");
|
||||
if (StringUtils.isNotEmpty(SubscribeStatusString) && SubscribeStatusString.equals("accept")) {
|
||||
String templateId= object.getStr("TemplateId");//模板id
|
||||
String SubscribeStatusString= object.getStr("SubscribeStatusString");
|
||||
if(StringUtils.isNotEmpty(SubscribeStatusString)&&SubscribeStatusString.equals("accept")){
|
||||
accountUserBindConnect.setBind_tmpl(templateId);
|
||||
getUpdateWrapper(updateWrapper, accountUserBindConnect);
|
||||
} else {
|
||||
String ErrorStatus = object.getStr("ErrorStatus");
|
||||
if (ErrorStatus.equals("success")) {
|
||||
}else {
|
||||
String ErrorStatus=object.getStr("ErrorStatus");
|
||||
if(ErrorStatus.equals("success")){
|
||||
log.info("消息推送成功给用户,不需要操作");
|
||||
return;
|
||||
}
|
||||
@ -645,17 +584,16 @@ public class AccountUserBindConnectServiceImpl extends BaseServiceImpl<AccountUs
|
||||
|
||||
/**
|
||||
* 封装相同参数的调用方法
|
||||
*
|
||||
* @param updateWrapper
|
||||
* @param accountUserBindConnect
|
||||
*/
|
||||
private void getUpdateWrapper(UpdateWrapper<AccountUserBindConnect> updateWrapper,
|
||||
AccountUserBindConnect accountUserBindConnect) {
|
||||
updateWrapper.set("bind_tmpl", accountUserBindConnect.getBind_tmpl());
|
||||
updateWrapper.eq("bind_id", accountUserBindConnect.getBind_id());
|
||||
updateWrapper.eq("bind_type", accountUserBindConnect.getBind_type());
|
||||
updateWrapper.eq("user_id", accountUserBindConnect.getUser_id());
|
||||
updateWrapper.eq("user_type", accountUserBindConnect.getUser_type());
|
||||
updateWrapper.set("bind_tmpl",accountUserBindConnect.getBind_tmpl());
|
||||
updateWrapper.eq("bind_id",accountUserBindConnect.getBind_id());
|
||||
updateWrapper.eq("bind_type",accountUserBindConnect.getBind_type());
|
||||
updateWrapper.eq("user_id",accountUserBindConnect.getUser_id());
|
||||
updateWrapper.eq("user_type",accountUserBindConnect.getUser_type());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,6 +44,4 @@ public class RedisConstant {
|
||||
// 预约订单任务新增键
|
||||
public static final String Order_Booking_Task_Key = ConstantRedis.Cache_NameSpace + "new:order:booking:task:";
|
||||
|
||||
public static final String VERIFY_CODE_KEY = "register:verifyCode:";
|
||||
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import com.suisung.mall.common.pojo.output.TimelineOutput;
|
||||
import com.suisung.mall.common.pojo.res.ThirdApiRes;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -313,28 +312,4 @@ public interface AccountService {
|
||||
|
||||
@GetMapping(value = "/admin/account/accountController/getAllBindCount")
|
||||
long getAllBindCount(@RequestParam(name = "bindTmpl") String bindTmpl);
|
||||
|
||||
|
||||
/**
|
||||
* 检查手机注册的商家是否存在(仅供内部调用)
|
||||
*
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/admin/account/account-user-bind-connect/is-merchant-exists", method = RequestMethod.POST)
|
||||
Integer isMerchantExists(@RequestParam(name = "mobile") String mobile);
|
||||
|
||||
/**
|
||||
* 服务间注册商家账号,项目之间远程调用
|
||||
*/
|
||||
@RequestMapping(value = "/admin/account/account-user-base/merchant/inner-register", method = RequestMethod.POST)
|
||||
Pair<Boolean, String> merchantInnerRegister(@RequestParam("mobile") String mobile, @RequestParam("regPwd") String regPwd);
|
||||
|
||||
/**
|
||||
* 服务间注册商家账号,项目之间远程调用
|
||||
*/
|
||||
@RequestMapping(value = "/admin/account/account-user-base/merchant/inner-register", method = RequestMethod.POST)
|
||||
Pair<Boolean, String> changeMerchantLoginMobile(@RequestParam("oldMobile") String oldMobile, @RequestParam("newMobile") String newMobile, @RequestParam("password") String password);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -96,9 +96,6 @@ public class ShopMchEntry implements Serializable {
|
||||
@ApiModelProperty(value = "入驻商家店铺门面环境图片的存储路径", required = true)
|
||||
private String environment_image;
|
||||
|
||||
@ApiModelProperty(value = "收银台照片", required = true)
|
||||
private String checkstand_image;
|
||||
|
||||
@ApiModelProperty(value = "入驻主体类型,企业或个人:1-企业;2-个人;", required = true)
|
||||
private Integer entity_type;
|
||||
|
||||
@ -186,9 +183,6 @@ public class ShopMchEntry implements Serializable {
|
||||
@ApiModelProperty(value = "结算账户⾏号", required = true)
|
||||
private String openning_bank_code;
|
||||
|
||||
@ApiModelProperty(value = "开户许可证(银行对公开户证明)")
|
||||
private String opening_permit_image;
|
||||
|
||||
@ApiModelProperty(value = "结算账户清算⾏号")
|
||||
private String clearing_bank_code;
|
||||
|
||||
@ -264,9 +258,6 @@ public class ShopMchEntry implements Serializable {
|
||||
@ApiModelProperty(value = "是否绑定分账接收方:1-是;2-否;")
|
||||
private Integer has_bind_receiver;
|
||||
|
||||
@ApiModelProperty(value = "父入驻id(总店入驻id)")
|
||||
private Long parent_id;
|
||||
|
||||
@ApiModelProperty(value = "该商家入驻记录是否有效,0:无效,1:有效")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.common.modules.store;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("shop_mch_entry_branch")
|
||||
@ApiModel(value = "shop_mch_entry_branch 实体", description = "商家分店拉卡拉商户申请数据")
|
||||
public class ShopMchEntryBranch implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "id", type = IdType.INPUT)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "拉卡拉外部(银联)商户号", required = true)
|
||||
private String lkl_mer_cup_no;
|
||||
|
||||
@ApiModelProperty(value = "拉卡拉终端号")
|
||||
private String lkl_term_no;
|
||||
|
||||
@ApiModelProperty(value = "审核关联号", required = true)
|
||||
private String review_related_id;
|
||||
|
||||
@ApiModelProperty(value = "请求拉卡拉参数")
|
||||
private String lkl_req;
|
||||
|
||||
@ApiModelProperty(value = "拉卡拉响应数据")
|
||||
private String lkl_reps;
|
||||
|
||||
@ApiModelProperty(value = "拉卡拉通知响应数据")
|
||||
private String lkl_notify_reps;
|
||||
|
||||
@ApiModelProperty(value = "该商家入驻记录是否有效,0:无效,1:有效")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "商家入驻记录的创建时间")
|
||||
private Date created_at;
|
||||
|
||||
@ApiModelProperty(value = "商家入驻记录的更新时间")
|
||||
private Date updated_at;
|
||||
}
|
||||
@ -141,9 +141,6 @@ public class ShopStoreBase implements Serializable {
|
||||
@ApiModelProperty(value = "店铺统一的打包费, 0-10元范围")
|
||||
private BigDecimal packing_fee;
|
||||
|
||||
@ApiModelProperty(value = "分店所属总店 Id,一般分店有值,总店为0")
|
||||
private Integer parent_id;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "新增时间")
|
||||
|
||||
@ -126,9 +126,6 @@ public class ShopStoreInfo implements Serializable {
|
||||
@ApiModelProperty(value = "店铺内部运费,单位(分)0-使用平台的内部运费;>0 使用店铺的内部运费")
|
||||
private Integer shopping_fee_inner;
|
||||
|
||||
@ApiModelProperty(value = "是否自配送:1-是;2-否;")
|
||||
private Integer is_delivery_self;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "新增时间")
|
||||
|
||||
@ -52,9 +52,6 @@ public class ShopStoreSameCityTransportBase implements Serializable {
|
||||
@ApiModelProperty(value = "顺丰同城(第三方)店铺ID")
|
||||
private String shop_id;
|
||||
|
||||
@ApiModelProperty(value = "顺丰平台商家Id (用于县级代理商创建店铺的)")
|
||||
private String supplier_id;
|
||||
|
||||
@ApiModelProperty(value = "店铺主营商品分类ID")
|
||||
private Integer business_type;
|
||||
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
package com.suisung.mall.common.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 新增主店的分店的请求DTO实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "新增主店的分店的请求DTO实体类", description = "新增主店的分店的请求DTO实体类")
|
||||
public class MainStoreBranchReqDTO implements java.io.Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主店店铺 ID
|
||||
*/
|
||||
private Integer parent_store_id;
|
||||
|
||||
/**
|
||||
* 登录手机号
|
||||
*/
|
||||
private String login_mobile;
|
||||
|
||||
/**
|
||||
* 登录密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 分店名称
|
||||
*/
|
||||
private String store_name;
|
||||
|
||||
/**
|
||||
* 分店联系人
|
||||
*/
|
||||
private String contact_name;
|
||||
|
||||
/**
|
||||
* 分店联系人手机号
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 门头图片
|
||||
*/
|
||||
private String front_facade_image;
|
||||
|
||||
/**
|
||||
* 环境图片
|
||||
*/
|
||||
private String environment_image;
|
||||
|
||||
/**
|
||||
* 分店地址
|
||||
*/
|
||||
private String store_address;
|
||||
|
||||
/**
|
||||
* 分店经度
|
||||
*/
|
||||
private String store_longitude;
|
||||
|
||||
/**
|
||||
* 分店纬度
|
||||
*/
|
||||
private String store_latitude;
|
||||
|
||||
|
||||
}
|
||||
@ -11,7 +11,6 @@ package com.suisung.mall.common.utils;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.suisung.mall.common.exception.ApiException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.*;
|
||||
@ -251,44 +250,6 @@ public class RestTemplateHttpUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送拉卡拉的POST请求并处理异常,原样返回
|
||||
*
|
||||
* @param url 请求URL
|
||||
* @param headers 请求头
|
||||
* @param requestBody 请求体
|
||||
* @param responseType 响应类型
|
||||
* @param <T> 泛型类型
|
||||
* @return ResponseEntity<T>
|
||||
*/
|
||||
public static <T> JSONObject sendLklPostSrc(String url, JSONObject headers, JSONObject requestBody, Class<T> responseType) {
|
||||
// 使用 APPLICATION_JSON 作为默认 content-type
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||
|
||||
// 安全添加 headers
|
||||
if (headers != null) {
|
||||
headers.forEach((key, value) -> {
|
||||
if (value != null) {
|
||||
httpHeaders.add(key, value.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
HttpEntity<Object> entity = new HttpEntity<>(requestBody, httpHeaders);
|
||||
|
||||
try {
|
||||
ResponseEntity<T> response = restTemplate.postForEntity(url, entity, responseType);
|
||||
Object body = response.getBody();
|
||||
return (body instanceof JSONObject) ? (JSONObject) body : JSONUtil.parseObj(body);
|
||||
} catch (Exception e) {
|
||||
log.error("Unexpected error occurred while calling LKL API: {}", e.getMessage(), e);
|
||||
new ApiException("Unexpected error occurred while calling LKL API");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 在JSONObject中查找第一个非空值
|
||||
*
|
||||
|
||||
@ -57,11 +57,9 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||
@Service
|
||||
public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl<ShopActivityGroupbookingMapper, ShopActivityGroupbooking> implements ShopActivityGroupbookingService {
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopActivityGroupbookingHistoryService shopActivityGroupbookingHistoryService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopActivityGroupbookingService shopActivityGroupbookingService;
|
||||
|
||||
@ -69,11 +67,9 @@ public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl<ShopAct
|
||||
@Autowired
|
||||
private ShopStoreActivityBaseService shopStoreActivityBaseService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopOrderInfoService shopOrderInfoService;
|
||||
|
||||
@ -81,7 +77,6 @@ public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl<ShopAct
|
||||
@Autowired
|
||||
private ShopUserVoucherService shopUserVoucherService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopOrderReturnService shopOrderReturnService;
|
||||
|
||||
@ -89,7 +84,6 @@ public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl<ShopAct
|
||||
@Autowired
|
||||
private ShopOrderBaseService shopOrderBaseService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopOrderDataService shopOrderDataService;
|
||||
|
||||
@ -97,11 +91,9 @@ public class ShopActivityGroupbookingServiceImpl extends BaseServiceImpl<ShopAct
|
||||
@Autowired
|
||||
private ShopStoreBaseService shopStoreBaseService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopOrderItemService shopOrderItemService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopProductItemService shopProductItemService;
|
||||
|
||||
|
||||
@ -54,8 +54,6 @@ public class AccountBaseConfigServiceImpl extends BaseServiceImpl<AccountBaseCon
|
||||
|
||||
public static Map<String, AccountBaseConfig> configMap;
|
||||
public static Long version = 0L;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@ import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||
import com.suisung.mall.shop.lakala.service.LakalaApiService;
|
||||
import com.suisung.mall.shop.lakala.service.LklLedgerEcService;
|
||||
import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl;
|
||||
import com.suisung.mall.shop.library.service.LibraryProductService;
|
||||
import com.suisung.mall.shop.message.service.MqMessageService;
|
||||
import com.suisung.mall.shop.message.service.PushMessageService;
|
||||
@ -81,13 +80,9 @@ public class LakalaController extends BaseControllerImpl {
|
||||
@Resource
|
||||
private ShopStorePrinterService shopStorePrinterService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private LklLedgerEcService lklLedgerEcService;
|
||||
|
||||
@Resource
|
||||
private LklTkServiceImpl lklTkService;
|
||||
|
||||
|
||||
@ApiOperation(value = "测试案例", notes = "测试案例")
|
||||
@RequestMapping(value = "/testcase", method = RequestMethod.POST)
|
||||
@ -99,8 +94,7 @@ public class LakalaController extends BaseControllerImpl {
|
||||
|
||||
// return lakalaApiService.tradeQuery(paramsJSON.getInt("storeId"), paramsJSON.getStr("orderId"));
|
||||
|
||||
return lklTkService.openMerchantAddTerm("8226330541100J8");
|
||||
|
||||
return shopStorePrinterService.printShopStoreReturnOrder(paramsJSON.getStr("returnId"));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量发送推送消息 - 测试案例", notes = "批量发送推送消息 - 测试案例")
|
||||
|
||||
@ -100,7 +100,7 @@ public class LklTkController extends BaseControllerImpl {
|
||||
return CommonResult.failed(resp.getSecond());
|
||||
}
|
||||
|
||||
// https://mall.gpxscs.cn/api/mobile/shop/lakala/tk/registrationMerchantNotify
|
||||
// https://mall.gpxscs.cn/api/mobile/shop/lakala/ledger/applyLedgerMerReceiverBindNotify
|
||||
@ApiOperation(value = "拉卡拉进件申请异步回调通知", notes = "拉卡拉进件申请异步回调通知")
|
||||
@RequestMapping(value = "/registrationMerchantNotify", method = {RequestMethod.POST})
|
||||
public ResponseEntity<JSONObject> registrationMerchantNotify(HttpServletRequest request) {
|
||||
@ -112,18 +112,6 @@ public class LklTkController extends BaseControllerImpl {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resp);
|
||||
}
|
||||
|
||||
// https://mall.gpxscs.cn/api/mobile/shop/lakala/tk/updateMerchantNotify
|
||||
@ApiOperation(value = "商户改件异步回调通知", notes = "商户改件异步回调通知")
|
||||
@RequestMapping(value = "/updateMerchantNotify", method = {RequestMethod.POST})
|
||||
public ResponseEntity<JSONObject> updateMerchantNotify(HttpServletRequest request) {
|
||||
JSONObject resp = lklTkService.updateMerchantNotify(request);
|
||||
if (resp != null && resp.get("code").equals("200")) {
|
||||
return ResponseEntity.ok(resp);
|
||||
}
|
||||
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(resp);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "上传文件", notes = "上传文件")
|
||||
@RequestMapping(value = "/uploadOcrImg", method = RequestMethod.POST)
|
||||
public CommonResult uploadOcrImg(@RequestParam(name = "upfile") MultipartFile file,
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
package com.suisung.mall.shop.lakala.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
@ -30,7 +29,6 @@ import com.suisung.mall.shop.lakala.service.LklBanksService;
|
||||
import com.suisung.mall.shop.lakala.service.LklLedgerReceiverService;
|
||||
import com.suisung.mall.shop.lakala.utils.LakalaUtil;
|
||||
import com.suisung.mall.shop.page.service.impl.OssServiceImpl;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryBranchService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import org.slf4j.Logger;
|
||||
@ -71,12 +69,6 @@ public class LklTkServiceImpl {
|
||||
@Value("${lakala.tk.notify_pub_key_path}")
|
||||
private String notifyPubKeyPath;
|
||||
|
||||
@Value("${lakala.tk.api_pub_key_path}")
|
||||
private String apiPubKeyPath;
|
||||
|
||||
@Value("${lakala.tk.api_pri_key_path}")
|
||||
private String apiPriKeyPath;
|
||||
|
||||
@Value("${lakala.tk.activity_id}")
|
||||
private Integer activityId;
|
||||
|
||||
@ -97,13 +89,13 @@ public class LklTkServiceImpl {
|
||||
@Resource
|
||||
private LklLedgerReceiverService lklLedgerReceiverService;
|
||||
|
||||
// @Lazy
|
||||
// @Lazy
|
||||
// @Resource
|
||||
// private EsignContractService esignContractService;
|
||||
//
|
||||
@Lazy
|
||||
@Resource
|
||||
private ShopMchEntryBranchService shopMchEntryBranchService;
|
||||
// @Lazy
|
||||
// @Resource
|
||||
// private EsignContractFillingFileService esignContractFillingFileService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
@ -361,6 +353,7 @@ public class LklTkServiceImpl {
|
||||
urlPath = "/auth/oauth/token";
|
||||
}
|
||||
|
||||
|
||||
String response = RestTemplateHttpUtil.sendPostFormData(buildLklTkUrl(urlPath), null, formData, String.class);
|
||||
if (ObjectUtil.isEmpty(response)) {
|
||||
return "";
|
||||
@ -547,8 +540,7 @@ public class LklTkServiceImpl {
|
||||
logger.debug("开始处理商户附件文件,商户ID: {}", mchId);
|
||||
JSONArray attachments = new JSONArray();
|
||||
if (Boolean.TRUE.equals(isQy)) {
|
||||
// 企业
|
||||
JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMchEntry.getLegal_person_id_images(), "ID_CARD_FRONT", false);
|
||||
JSONObject SETTLE_ID_CARD_FRONT = updatePhoto(shopMchEntry.getLegal_person_id_images(), "FR_ID_CARD_FRONT", false);
|
||||
if (SETTLE_ID_CARD_FRONT != null) {
|
||||
attachments.put(SETTLE_ID_CARD_FRONT); // 法人身份证正面
|
||||
logger.debug("成功添加法人身份证正面图片");
|
||||
@ -556,7 +548,7 @@ public class LklTkServiceImpl {
|
||||
logger.warn("法人身份证正面图片添加失败");
|
||||
}
|
||||
|
||||
JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMchEntry.getLegal_person_id_images2(), "ID_CARD_BEHIND", false);
|
||||
JSONObject SETTLE_ID_CARD_BEHIND = updatePhoto(shopMchEntry.getLegal_person_id_images2(), "FR_ID_CARD_BEHIND", false);
|
||||
if (SETTLE_ID_CARD_BEHIND != null) {
|
||||
attachments.put(SETTLE_ID_CARD_BEHIND); // 法人身份证国徽面
|
||||
logger.debug("成功添加法人身份证国徽面图片");
|
||||
@ -572,17 +564,7 @@ public class LklTkServiceImpl {
|
||||
logger.warn("营业执照图片添加失败");
|
||||
}
|
||||
|
||||
// 银行对公开户正面
|
||||
JSONObject OPENING_PERMIT = updatePhoto(shopMchEntry.getOpening_permit_image(), "OPENING_PERMIT", false);
|
||||
if (OPENING_PERMIT != null) {
|
||||
attachments.put(OPENING_PERMIT); // 营业执照
|
||||
logger.debug("成功添加开户许可证证明图片");
|
||||
} else {
|
||||
logger.warn("成功添加开户许可证证明图片添加失败");
|
||||
}
|
||||
|
||||
} else {
|
||||
// 小微个人
|
||||
JSONObject ID_CARD_FRONT = updatePhoto(shopMchEntry.getIndividual_id_images(), "ID_CARD_FRONT", false);
|
||||
if (ID_CARD_FRONT != null) {
|
||||
attachments.put(ID_CARD_FRONT); // 身份证正面
|
||||
@ -598,15 +580,6 @@ public class LklTkServiceImpl {
|
||||
} else {
|
||||
logger.warn("身份证国徽面图片添加失败");
|
||||
}
|
||||
|
||||
// 对私必传银行卡
|
||||
JSONObject BANK_CARD = updatePhoto(shopMchEntry.getBank_image(), "BANK_CARD", false);
|
||||
if (BANK_CARD != null) {
|
||||
attachments.put(BANK_CARD); // 银行卡图片
|
||||
logger.debug("成功添加银行卡图片");
|
||||
} else {
|
||||
logger.warn("银行卡图片添加失败");
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject SHOP_OUTSIDE_IMG = updatePhoto(shopMchEntry.getFront_facade_image(), "SHOP_OUTSIDE_IMG", false);
|
||||
@ -625,15 +598,13 @@ public class LklTkServiceImpl {
|
||||
logger.warn("门店内部图片添加失败");
|
||||
}
|
||||
|
||||
// 收银台图片
|
||||
JSONObject CHECKSTAND_IMG = updatePhoto(shopMchEntry.getCheckstand_image(), "CHECKSTAND_IMG", false);
|
||||
if (CHECKSTAND_IMG != null) {
|
||||
attachments.put(CHECKSTAND_IMG); // 收银台图片
|
||||
logger.debug("成功添加收银台图片");
|
||||
JSONObject BANK_CARD = updatePhoto(shopMchEntry.getBank_image(), "BANK_CARD", false);
|
||||
if (BANK_CARD != null) {
|
||||
attachments.put(BANK_CARD); // 银行卡图片
|
||||
logger.debug("成功添加银行卡图片");
|
||||
} else {
|
||||
logger.warn("收银台图片添加失败");
|
||||
logger.warn("银行卡图片添加失败");
|
||||
}
|
||||
|
||||
reqJsonBody.put("attchments", attachments);
|
||||
logger.debug("商户附件文件处理完成,共添加 {} 个附件", attachments.size());
|
||||
// 附件文件相关结束
|
||||
@ -803,310 +774,6 @@ public class LklTkServiceImpl {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户改件异步回调通知
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public JSONObject updateMerchantNotify(HttpServletRequest request) {
|
||||
try {
|
||||
// 解密请求参数
|
||||
String requestBody = LakalaUtil.getBody(request);
|
||||
logger.info("拉卡拉商户增终异步通知 - 接收原始数据: {}", requestBody);
|
||||
|
||||
if (StrUtil.isBlank(requestBody)) {
|
||||
logger.warn("拉卡拉商户增终异步通知 - 请求参数为空");
|
||||
return new JSONObject().set("code", "400").set("message", "返回参数为空");
|
||||
}
|
||||
|
||||
JSONObject reqBodyJSON = JSONUtil.parseObj(requestBody);
|
||||
if (reqBodyJSON.isEmpty() || reqBodyJSON.get("data") == null) {
|
||||
logger.warn("拉卡拉商户增终异步通知 - 参数格式有误,无法解析: {}", requestBody);
|
||||
return new JSONObject().set("code", "400").set("message", "参数格式有误,无法解析");
|
||||
}
|
||||
|
||||
String srcData = reqBodyJSON.getStr("data");
|
||||
if (StrUtil.isBlank(srcData)) {
|
||||
logger.warn("拉卡拉商户增终异步通知 - 关键参数为空值");
|
||||
return new JSONObject().set("code", "400").set("message", "关键参数为空值");
|
||||
}
|
||||
|
||||
// 公钥解密出来的数据
|
||||
String notifyPubKey = LakalaUtil.getResourceFile(notifyPubKeyPath, false, false);
|
||||
String lklNotifyResp = LakalaUtil.decryptNotifyData(notifyPubKey, srcData);
|
||||
if (StrUtil.isBlank(lklNotifyResp)) {
|
||||
logger.error("拉卡拉商户增终异步通知 - 数据解密失败,加密数据: {}", srcData);
|
||||
return new JSONObject().set("code", "400").set("message", "数据解密出错!");
|
||||
}
|
||||
logger.info("拉卡拉商户增终异步通知 - 解密后数据: {}", lklNotifyResp);
|
||||
|
||||
// 逻辑处理
|
||||
JSONObject dataJSON = JSONUtil.parseObj(lklNotifyResp);
|
||||
String reviewPass = dataJSON.getStr("reviewPass");
|
||||
String merCupNo = dataJSON.getStr("externalCustomerNo"); //拉卡拉外部商户号
|
||||
String termNo = dataJSON.getStr("termNo"); //拉卡拉分配的业务终端号
|
||||
String reviewRelatedId = dataJSON.getStr("reviewRelatedId"); //拉卡拉分配的业务终端号
|
||||
|
||||
logger.info("拉卡拉商户增终异步通知 - 解析数据完成 - 审核状态: {}, 外部商户号: {}, 终端号: {}, 审核关联ID: {}",
|
||||
reviewPass, merCupNo, termNo, reviewRelatedId);
|
||||
|
||||
// 合并参数校验
|
||||
if (dataJSON.isEmpty() ||
|
||||
StrUtil.isBlank(reviewPass) ||
|
||||
StrUtil.isBlank(reviewRelatedId) ||
|
||||
StrUtil.isBlank(termNo)) {
|
||||
logger.warn("拉卡拉商户增终异步通知 - 参数解析出错,解密数据: {}", lklNotifyResp);
|
||||
return new JSONObject().set("code", "500").set("message", "返回参数缺少关键数据");
|
||||
}
|
||||
|
||||
// 更新商户分店入驻表
|
||||
// status 状态:1-已成功;2-审核未通过;3-未处理;4-待审核;
|
||||
Integer status = "PASS".equals(reviewPass) ? CommonConstant.Enable :
|
||||
"UNPASS".equals(reviewPass) ? CommonConstant.Disable2 :
|
||||
"PASSING".equals(reviewPass) ? 3 : 4;
|
||||
logger.info("拉卡拉商户增终异步通知 - 更新分店入驻表,审核关联ID: {}, 状态: {}, 通知响应: {}", reviewRelatedId, status, lklNotifyResp);
|
||||
shopMchEntryBranchService.updateByReviewRelatedId(reviewRelatedId, status, lklNotifyResp);
|
||||
|
||||
// 给商家总店入驻表增加拉卡拉的商户号和拉卡拉返回的数据
|
||||
ShopMchEntry shopMchEntry = shopMchEntryService.getShopMerchEntryByMerCupNo(merCupNo, 0L);
|
||||
if (shopMchEntry == null) {
|
||||
logger.error("拉卡拉商户增终异步通知 - 商户号入驻信息不存在: {}", merCupNo);
|
||||
return new JSONObject().put("code", "500").put("message", merCupNo + "商户号入驻信息不存在");
|
||||
}
|
||||
|
||||
// 校验审核状态: PREPARE:待提交; PASS:通过; UNPASS:未通过; PASSING:审核中;
|
||||
if (!"PASS".equals(reviewPass)) {
|
||||
logger.info("拉卡拉商户增终异步通知 - 审核未通过,状态: {}, 结果: {}", reviewPass, dataJSON.getStr("reviewResult"));
|
||||
return new JSONObject().set("code", "500").set("message", "忽略处理,因审核未通过:" + dataJSON.getStr("reviewResult"));
|
||||
}
|
||||
|
||||
logger.info("拉卡拉商户增终异步通知 - 审核通过,开始创建分店入驻记录,审核关联ID: {}, 终端号: {}", reviewRelatedId, termNo);
|
||||
// RMK 拉卡拉增终成功, 创建分店入驻记录,创建商家账号、创建店铺和周边信息
|
||||
shopMchEntryBranchService.createMchEntryBranchStore(reviewRelatedId, termNo, lklNotifyResp);
|
||||
|
||||
logger.info("拉卡拉商户增终异步通知 - 处理完成,审核关联ID: {}", reviewRelatedId);
|
||||
return new JSONObject().set("code", "200").set("message", "处理成功");
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("处理拉卡拉增终异步通知异常", e);
|
||||
return new JSONObject().set("code", "500").set("message", "处理异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向拉卡拉申请增加终端
|
||||
*
|
||||
* @param externalCustomerNo 拉卡拉外部商户号
|
||||
* @return 拉卡拉响应数据
|
||||
*/
|
||||
public JSONObject openMerchantAddTerm(String externalCustomerNo) {
|
||||
logger.debug("开始向拉卡拉申请增加终端,externalCustomerNo={}", externalCustomerNo);
|
||||
|
||||
try {
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(externalCustomerNo)) {
|
||||
logger.warn("拉卡拉外部商户号不能为空");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 构造请求参数并加密
|
||||
JSONObject requestParams = new JSONObject();
|
||||
requestParams.set("externalCustomerNo", externalCustomerNo);
|
||||
requestParams.set("bzPos", "WECHAT_PAY");
|
||||
requestParams.set("termNum", 1);
|
||||
|
||||
Long shopId = getLklShopId(externalCustomerNo, null);
|
||||
if (shopId == null) {
|
||||
logger.error("拉卡拉商户ID不存在,externalCustomerNo={}", externalCustomerNo);
|
||||
return null;
|
||||
}
|
||||
|
||||
requestParams.set("shopId", shopId);
|
||||
|
||||
JSONObject feeInfoDto = new JSONObject();
|
||||
feeInfoDto.set("topFee", Convert.toDouble(wxFee));
|
||||
feeInfoDto.set("fee", Convert.toDouble(wxFee));
|
||||
feeInfoDto.set("feeType", "WECHAT");
|
||||
requestParams.set("fees", feeInfoDto);
|
||||
|
||||
String privateKey = LakalaUtil.getResourceFile(apiPriKeyPath, false, false);
|
||||
if (StrUtil.isBlank(privateKey)) {
|
||||
logger.error("获取拉卡拉私钥失败,apiPriKeyPath={}", apiPriKeyPath);
|
||||
return null;
|
||||
}
|
||||
|
||||
String encryptedParams = LakalaUtil.encryptByPrivateKey(requestParams.toString(), privateKey);
|
||||
logger.debug("请求参数加密完成");
|
||||
|
||||
// 获取认证信息
|
||||
String authorization = getLklTkAuthorization();
|
||||
if (StrUtil.isBlank(authorization)) {
|
||||
logger.error("获取拉卡拉token失败");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 构造请求头和请求体
|
||||
JSONObject header = new JSONObject().set("Authorization", authorization);
|
||||
JSONObject requestBody = new JSONObject().set("data", encryptedParams);
|
||||
|
||||
// 发送请求
|
||||
String urlPath = "/htkmerchants/open/merchant/addTerm";
|
||||
JSONObject response = RestTemplateHttpUtil.sendLklPostSrc(
|
||||
buildLklTkUrl(urlPath), header, requestBody, JSONObject.class);
|
||||
|
||||
// 检查响应结果
|
||||
if (response == null || !"000000".equals(response.getStr("code")) || response.get("data") == null) {
|
||||
logger.error("向拉卡拉申请增加终端失败,response={}", response);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 解密响应数据
|
||||
String publicKey = LakalaUtil.getResourceFile(apiPubKeyPath, false, false);
|
||||
if (StrUtil.isBlank(publicKey)) {
|
||||
logger.error("向拉卡拉申请增加终端获取公钥失败,apiPubKeyPath={}", apiPubKeyPath);
|
||||
return null;
|
||||
}
|
||||
|
||||
String responseData = LakalaUtil.decryptByPublicKey(response.getStr("data"), publicKey);
|
||||
logger.debug("响应数据解密完成");
|
||||
|
||||
return JSONUtil.parseObj(responseData);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("向拉卡拉申请增加终端异常,externalCustomerNo={}", externalCustomerNo, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商家进件成功,拉卡拉商户号获取商户信息(需加密)
|
||||
*
|
||||
* @param externalCustomerNo 外部商户号(优先使用)
|
||||
* @param customerNo 内部商户号(备选)
|
||||
* @return 商户信息JSONObject,获取失败返回null
|
||||
*/
|
||||
public JSONObject openMerchantInfo(String externalCustomerNo, String customerNo) {
|
||||
try {
|
||||
// 构造请求参数并加密(至少需要一个参数)
|
||||
JSONObject requestParams = new JSONObject();
|
||||
if (StrUtil.isNotBlank(externalCustomerNo)) {
|
||||
requestParams.set("externalCustomerNo", externalCustomerNo);
|
||||
}
|
||||
if (StrUtil.isNotBlank(customerNo)) {
|
||||
requestParams.set("customerNo", customerNo);
|
||||
}
|
||||
|
||||
// 检查参数是否有效
|
||||
if (requestParams.isEmpty()) {
|
||||
logger.warn("拉卡拉商户信息查询参数为空");
|
||||
return null;
|
||||
}
|
||||
|
||||
String privateKey = LakalaUtil.getResourceFile(apiPriKeyPath, false, false);
|
||||
if (StrUtil.isBlank(privateKey)) {
|
||||
logger.error("获取拉卡拉私钥失败,apiPriKeyPath={}", apiPriKeyPath);
|
||||
return null;
|
||||
}
|
||||
|
||||
String encryptedParams = LakalaUtil.encryptByPrivateKey(requestParams.toString(), privateKey);
|
||||
|
||||
// 获取认证信息
|
||||
String authorization = getLklTkAuthorization();
|
||||
if (StrUtil.isBlank(authorization)) {
|
||||
logger.error("获取拉卡拉token失败");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 构造请求头和请求体
|
||||
String urlPath = buildLklTkUrl("/htkmerchants/open/merchant/info");
|
||||
JSONObject header = new JSONObject().set("Authorization", authorization);
|
||||
JSONObject requestBody = new JSONObject().set("data", encryptedParams);
|
||||
|
||||
// 发送请求
|
||||
JSONObject response = RestTemplateHttpUtil.sendLklPostSrc(urlPath, header, requestBody, JSONObject.class);
|
||||
|
||||
// 检查响应结果
|
||||
if (response == null || !"000000".equals(response.getStr("code")) || response.get("data") == null) {
|
||||
logger.warn("拉卡拉商户信息获取失败,response={}", response);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 解密响应数据
|
||||
String publicKey = LakalaUtil.getResourceFile(apiPubKeyPath, false, false);
|
||||
if (StrUtil.isBlank(publicKey)) {
|
||||
logger.error("获取拉卡拉公钥失败,apiPubKeyPath={}", apiPubKeyPath);
|
||||
return null;
|
||||
}
|
||||
|
||||
String responseData = LakalaUtil.decryptByPublicKey(response.getStr("data"), publicKey);
|
||||
|
||||
return JSONUtil.parseObj(responseData);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("获取拉卡拉商户信息异常,externalCustomerNo={}, customerNo={}", externalCustomerNo, customerNo, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取拉卡拉商户的 shopId
|
||||
*
|
||||
* @param externalCustomerNo 外部商户号(优先使用)
|
||||
* @param customerNo 内部商户号(备选)
|
||||
* @return 拉卡拉商户的shopId,获取失败返回null
|
||||
*/
|
||||
public Long getLklShopId(String externalCustomerNo, String customerNo) {
|
||||
logger.debug("开始获取拉卡拉商户shopId,externalCustomerNo={}, customerNo={}", externalCustomerNo, customerNo);
|
||||
|
||||
try {
|
||||
JSONObject response = openMerchantInfo(externalCustomerNo, customerNo);
|
||||
if (response == null) {
|
||||
logger.warn("获取拉卡拉商户信息失败,externalCustomerNo={}, customerNo={}", externalCustomerNo, customerNo);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 检查响应中的code字段是否表示成功
|
||||
// if (!"000000".equals(response.getStr("code"))) {
|
||||
// logger.warn("拉卡拉商户信息获取失败,code={},response={}", response.getStr("code"), response);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
logger.info("拉卡拉商户信息:{}", response);
|
||||
|
||||
// 检查shopInfoList是否存在且不为空
|
||||
JSONArray shopInfoList = response.getJSONArray("shopInfoList");
|
||||
if (CollUtil.isEmpty(shopInfoList)) {
|
||||
logger.warn("拉卡拉商户信息中shopInfoList为空或不存在,response={}", response);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 获取第一个shopInfo中的shopId
|
||||
JSONObject firstShopInfo = shopInfoList.getJSONObject(0);
|
||||
if (firstShopInfo == null) {
|
||||
logger.warn("拉卡拉商户信息中第一个shopInfo为空,shopInfoList={}", shopInfoList);
|
||||
return null;
|
||||
}
|
||||
|
||||
Long shopId = firstShopInfo.getLong("shopId");
|
||||
if (shopId == null) {
|
||||
logger.warn("拉卡拉商户信息中shopId为空,firstShopInfo={}", firstShopInfo);
|
||||
return null;
|
||||
}
|
||||
|
||||
logger.debug("成功获取拉卡拉商户shopId: {}", shopId);
|
||||
return shopId;
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("获取拉卡拉商户shopId异常,externalCustomerNo={}, customerNo={}", externalCustomerNo, customerNo, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 进件审核通过之后,要下一步流程操作:申请分账业务、创建分账接收方
|
||||
*
|
||||
|
||||
@ -44,38 +44,6 @@ import java.util.regex.Pattern;
|
||||
@Slf4j
|
||||
public class LakalaUtil {
|
||||
|
||||
public static final String KEY_ALGORITHM = "RSA";
|
||||
/**
|
||||
* RSA最大加密密文大小
|
||||
*/
|
||||
private static final int MAX_ENCRYPT_BLOCK = 117;
|
||||
|
||||
/**
|
||||
* RSA最大解密密文大小
|
||||
*/
|
||||
private static final int MAX_DECRYPT_BLOCK = 128;
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
String publicK = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB";
|
||||
String privateK = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw==";
|
||||
byte[] privateKey = Base64.decodeBase64(privateK);
|
||||
byte[] publicKey = Base64.decodeBase64(publicK);
|
||||
|
||||
|
||||
String aaa = "中文怎么样";
|
||||
String bytes = encryptByPrivateKey(aaa, privateK);
|
||||
|
||||
System.out.println(bytes);
|
||||
String bytes1 = decryptByPublicKey(bytes, publicK);
|
||||
System.out.println("result:" + bytes1);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化 拉卡拉 SDK(全局只需设置一次)
|
||||
*
|
||||
@ -528,109 +496,6 @@ public class LakalaUtil {
|
||||
return Pair.of(true, requestBody);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉卡拉拓客 第三方接口 加密
|
||||
*
|
||||
* @param data 待加密的数据(明文字符串)
|
||||
* @param priKey Base64编码的私钥字符串
|
||||
* @return Base64编码的加密数据
|
||||
*/
|
||||
public static String encryptByPrivateKey(String data, String priKey) {
|
||||
log.debug("开始使用私钥进行数据加密,数据长度: {}", data.length());
|
||||
|
||||
try {
|
||||
// 将Base64编码的私钥转换为字节数组
|
||||
byte[] keyBytes = Base64.decodeBase64(priKey);
|
||||
// 将明文数据转换为字节数组
|
||||
byte[] dataBytes = data.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
|
||||
PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec);
|
||||
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
|
||||
cipher.init(Cipher.ENCRYPT_MODE, privateKey);
|
||||
|
||||
int inputLen = dataBytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offSet = 0;
|
||||
byte[] cache;
|
||||
int i = 0;
|
||||
|
||||
// 对数据分段加密
|
||||
while (inputLen - offSet > 0) {
|
||||
if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {
|
||||
cache = cipher.doFinal(dataBytes, offSet, MAX_ENCRYPT_BLOCK);
|
||||
} else {
|
||||
cache = cipher.doFinal(dataBytes, offSet, inputLen - offSet);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
i++;
|
||||
offSet = i * MAX_ENCRYPT_BLOCK;
|
||||
}
|
||||
|
||||
byte[] encryptedData = out.toByteArray();
|
||||
// 将加密后的字节数组转换为Base64编码字符串
|
||||
String result = Base64.encodeBase64String(encryptedData);
|
||||
log.debug("数据加密完成,加密后数据长度: {}", result.length());
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("使用私钥加密数据时发生异常", e);
|
||||
throw new RuntimeException("私钥加密失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 拉卡拉拓客 第三方接口 解密
|
||||
*
|
||||
* @param data 待解密的数据(Base64编码的加密字符串)
|
||||
* @param pubKey Base64编码的公钥字符串
|
||||
* @return 解密后的明文数据
|
||||
*/
|
||||
public static String decryptByPublicKey(String data, String pubKey) {
|
||||
log.debug("开始使用公钥进行数据解密,数据长度: {}", data.length());
|
||||
|
||||
try {
|
||||
// 将Base64编码的公钥和数据转换为字节数组
|
||||
byte[] keyBytes = Base64.decodeBase64(pubKey);
|
||||
byte[] dataBytes = Base64.decodeBase64(data);
|
||||
|
||||
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(keyBytes);
|
||||
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
|
||||
PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec);
|
||||
|
||||
Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm());
|
||||
cipher.init(Cipher.DECRYPT_MODE, publicKey);
|
||||
|
||||
int inputLen = dataBytes.length;
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
int offSet = 0;
|
||||
byte[] cache;
|
||||
int i = 0;
|
||||
|
||||
// 对数据分段解密
|
||||
while (inputLen - offSet > 0) {
|
||||
if (inputLen - offSet > MAX_DECRYPT_BLOCK) {
|
||||
cache = cipher.doFinal(dataBytes, offSet, MAX_DECRYPT_BLOCK);
|
||||
} else {
|
||||
cache = cipher.doFinal(dataBytes, offSet, inputLen - offSet);
|
||||
}
|
||||
out.write(cache, 0, cache.length);
|
||||
i++;
|
||||
offSet = i * MAX_DECRYPT_BLOCK;
|
||||
}
|
||||
|
||||
byte[] decryptedData = out.toByteArray();
|
||||
// 将解密后的字节数组转换为明文字符串
|
||||
String result = new String(decryptedData, StandardCharsets.UTF_8);
|
||||
log.debug("数据解密完成,解密后数据长度: {}", result.length());
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("使用公钥解密数据时发生异常", e);
|
||||
throw new RuntimeException("公钥解密失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建拉卡拉接口公共参数
|
||||
* <p>
|
||||
|
||||
@ -69,7 +69,7 @@ public class OrderPayedListener {
|
||||
String dataStr = new String(data, StandardCharsets.UTF_8);
|
||||
listener(dataStr, channel, message);
|
||||
}
|
||||
|
||||
|
||||
public void listener(String data, Channel channel, Message message) throws IOException, InterruptedException {
|
||||
// String messageId = message.getMessageProperties().getMessageId();
|
||||
if (StrUtil.isBlank(data)) {
|
||||
@ -154,7 +154,7 @@ public class OrderPayedListener {
|
||||
&& !isBookingOrder) {
|
||||
|
||||
// 如果是立即下单,将触发顺丰同城下单,否则(预约下单) redis+cron 定时触发顺丰同城下单
|
||||
Pair<Boolean, String> pairCreateSfOrder = sfExpressApiService.innerCreateSfExpressOrder(orderId, orderPickupNum, false);
|
||||
Pair<Boolean, String> pairCreateSfOrder = sfExpressApiService.innerCreateSfExpressOrder(orderId, orderPickupNum);
|
||||
if (pairCreateSfOrder == null) {
|
||||
logger.error("[订单支付监听] 顺丰同城下单失败,无返回值 订单ID: {}", orderId);
|
||||
continue;
|
||||
|
||||
@ -1422,7 +1422,6 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
Map checkoutRow = new HashMap();
|
||||
// 配送方式:5-门店自提;10-普通快递;16-同城配送;
|
||||
Integer deliveryTypeId = getParameter("delivery_type_id", StateCode.DELIVERY_TYPE_SAME_CITY);
|
||||
|
||||
logger.debug("提交订单时,配送方式 delivery_type_id:{}", deliveryTypeId);
|
||||
|
||||
if (getParameter("checkout_row") == null) {
|
||||
@ -1489,8 +1488,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
}
|
||||
|
||||
cartRow.put("user_id", userId);
|
||||
Integer storeId = productRow.getStore_id();
|
||||
cartRow.put("store_id", storeId);
|
||||
cartRow.put("store_id", productRow.getStore_id());
|
||||
cartRow.put("item_id", itemId);
|
||||
cartRow.put("cart_quantity", cartQuantity);
|
||||
cartRow.put("single_activity", shopUserCartService.ifSingleActivity());
|
||||
@ -6344,7 +6342,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
if (address_row == null) {
|
||||
// 默认配送地址
|
||||
QueryWrapper<ShopUserDeliveryAddress> addressQueryWrapper = new QueryWrapper<>();
|
||||
addressQueryWrapper.eq("ud_is_default", CommonConstant.Enable).eq("user_id", buyer_user_id);
|
||||
addressQueryWrapper.eq("ud_is_default", 1).eq("user_id", buyer_user_id);
|
||||
ShopUserDeliveryAddress deliveryAddress = userDeliveryAddressService.findOne(addressQueryWrapper);
|
||||
cart_data.put("address_row", Convert.toMap(String.class, Object.class, deliveryAddress));
|
||||
}
|
||||
@ -6596,13 +6594,8 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
||||
BigDecimal order_money_select_items = Convert.toBigDecimal(store_item.get("order_money_select_items"));
|
||||
BigDecimal freight = Convert.toBigDecimal(store_item.get("freight"));
|
||||
|
||||
// TODO 注:配送方式:5-到店自提;10-普通快递;16-同城配送;15-商家自配送
|
||||
Integer delivery_type_id = Convert.toInt(checkout_row.get("delivery_type_id"));
|
||||
|
||||
// 判断这家店是不是自己配送?
|
||||
if (shopStoreInfoService.isDeliverySelf(_store_id)) {
|
||||
delivery_type_id = StateCode.DELIVERY_TYPE_IN_STORE_SERVICE;
|
||||
}
|
||||
// TODO 注:配送方式:5-到店自提;10-普通快递;16-同城配送;
|
||||
Integer delivery_type_id = Convert.toInt(checkout_row.get("delivery_type_id")); //StateCode.DELIVERY_TYPE_SAME_CITY;
|
||||
|
||||
// 店铺统一设置的打包费(formatCartRows 方法里计算好的)
|
||||
BigDecimal packingFee = Convert.toBigDecimal(store_item.get("packing_fee"));
|
||||
|
||||
@ -99,10 +99,8 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
||||
private ShopStoreInfoService shopStoreInfoService;
|
||||
@Autowired
|
||||
private ShopDistributionUserCommissionService shopDistributionUserCommissionService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountBaseConfigService accountBaseConfigService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
@Autowired
|
||||
@ -909,7 +907,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
||||
}
|
||||
|
||||
// 调用顺丰接口创建订单
|
||||
Pair<Boolean, String> sfResult = sfExpressApiService.innerCreateSfExpressOrder(orderId, 0L, false);
|
||||
Pair<Boolean, String> sfResult = sfExpressApiService.innerCreateSfExpressOrder(orderId, 0L);
|
||||
if (sfResult == null) {
|
||||
logger.error("[预约订单顺丰下单] 调用顺丰接口无返回值, orderId={}", orderId);
|
||||
throw new RuntimeException("预约订单顺丰下单失败,接口无响应");
|
||||
|
||||
@ -44,7 +44,7 @@ public class SFExpressAdminController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "【测试补偿】创建顺丰同城店铺", notes = "创建顺丰同城店铺")
|
||||
@ApiOperation(value = "创建顺丰同城店铺", notes = "创建顺丰同城店铺")
|
||||
@RequestMapping(value = "/create-shop-inner", method = RequestMethod.POST)
|
||||
public CommonResult createSfExpressShopNotify(@RequestBody JSONObject requestBody) {
|
||||
Pair<Boolean, String> result = sfExpressApiService.createSfExpressShopInner(
|
||||
@ -64,12 +64,4 @@ public class SFExpressAdminController {
|
||||
}
|
||||
return CommonResult.failed(result.getSecond());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "重新创建顺丰订单(重新派发)", notes = "重新创建顺丰订单(重新派发)")
|
||||
@RequestMapping(value = "/recreate-order", method = RequestMethod.POST)
|
||||
public CommonResult recreateOrder(@RequestBody JSONObject requestBody) {
|
||||
return sfExpressApiService.recreateOrder(
|
||||
requestBody.getStr("order_id")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,23 +70,8 @@ public interface SFExpressApiService {
|
||||
ThirdApiRes createSfExpressShopNotify(String jsonData, String sign);
|
||||
|
||||
|
||||
/**
|
||||
* 创建顺丰同城订单
|
||||
*
|
||||
* @param shopOrderId
|
||||
* @return
|
||||
*/
|
||||
ThirdApiRes createOrder(String shopOrderId);
|
||||
|
||||
|
||||
/**
|
||||
* 重新创建顺丰同城订单
|
||||
*
|
||||
* @param shopOrderId
|
||||
* @return
|
||||
*/
|
||||
CommonResult recreateOrder(String shopOrderId);
|
||||
|
||||
/**
|
||||
* 获取顺丰同城店铺信息
|
||||
*
|
||||
@ -100,10 +85,9 @@ public interface SFExpressApiService {
|
||||
*
|
||||
* @param orderId
|
||||
* @param orderPickupNum
|
||||
* @param ignoreExists 是否忽略已存在本地订单
|
||||
* @return
|
||||
*/
|
||||
Pair<Boolean, String> innerCreateSfExpressOrder(String orderId, Long orderPickupNum, Boolean ignoreExists);
|
||||
Pair<Boolean, String> innerCreateSfExpressOrder(String orderId, Long orderPickupNum);
|
||||
|
||||
/**
|
||||
* 取消订单,当商家处发生异常需要取消配送时,可调用此接口对订单进行取消操作,同步返回结果。
|
||||
|
||||
@ -105,6 +105,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
@Autowired
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private PushMessageService pushMessageService;
|
||||
@ -353,7 +354,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
return Pair.of(false, "创建顺丰店铺失败,返回的店铺ID为空");
|
||||
}
|
||||
|
||||
transportBase.setSupplier_id(sfSupplierId);
|
||||
transportBase.setShop_id(sfShopId);
|
||||
transportBase.setShop_state(CommonConstant.Enable); // 顺丰同城快递商品特惠
|
||||
transportBase.setDelivery_brand(CommonConstant.DELIVERY_BRAND_SF);
|
||||
@ -553,60 +553,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
return JsonUtil.json2object(retRespStr, ThirdApiRes.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新创建顺丰同城订单
|
||||
* 1、先获取顺丰同城订单的当前状态,如果没有取消的订单,则取消该订单
|
||||
* 2、取消成功,则重新创建顺丰同城订单,取消失败,则返回错误信息
|
||||
* 3、重新创建订单成功,更新订单轨迹
|
||||
*
|
||||
* @param shopOrderId 商城订单ID
|
||||
* @return CommonResult 操作结果
|
||||
*/
|
||||
@Override
|
||||
public CommonResult recreateOrder(String shopOrderId) {
|
||||
logger.info("[顺丰] 开始重新创建订单: shopOrderId={}", shopOrderId);
|
||||
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(shopOrderId)) {
|
||||
logger.warn("[顺丰] 重新创建订单失败: 订单ID为空");
|
||||
return CommonResult.failed("订单ID不能为空");
|
||||
}
|
||||
|
||||
// 获取顺丰订单ID
|
||||
String sfOrderId = shopStoreSfOrderService.getSfOrderIdByShopOrderId(shopOrderId);
|
||||
if (StrUtil.isBlank(sfOrderId)) {
|
||||
logger.warn("[顺丰] 重新创建订单失败: 未找到对应的顺丰订单, shopOrderId={}", shopOrderId);
|
||||
return CommonResult.failed("未找到对应的顺丰订单");
|
||||
}
|
||||
|
||||
try {
|
||||
// 取消原订单
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("order_id", sfOrderId);
|
||||
ThirdApiRes cancelOrderRes = cancelOrder(params);
|
||||
if (cancelOrderRes != null && !ObjectUtil.equal(cancelOrderRes.getError_code(), 0)) {
|
||||
logger.error("[顺丰] 取消原订单失败: errorCode={}, errorMsg={}",
|
||||
cancelOrderRes.getError_code(), cancelOrderRes.getError_msg());
|
||||
return CommonResult.failed(cancelOrderRes.getError_msg());
|
||||
}
|
||||
|
||||
// 重新创建订单,传递默认取货号1
|
||||
Pair<Boolean, String> createOrderRes = innerCreateSfExpressOrder(shopOrderId, 0L, true);
|
||||
if (createOrderRes.getFirst()) {
|
||||
logger.info("[顺丰] 重新创建订单成功: shopOrderId={}", shopOrderId);
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
logger.error("[顺丰] 重新创建订单失败: {}", createOrderRes.getSecond());
|
||||
return CommonResult.failed(createOrderRes.getSecond());
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("[顺丰] 重新创建订单过程中发生异常: shopOrderId={}", shopOrderId, e);
|
||||
return CommonResult.failed("系统异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取顺丰同城店铺信息
|
||||
*
|
||||
@ -646,19 +592,18 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
*
|
||||
* @param shopOrderId
|
||||
* @param orderPickupNum
|
||||
* @param ignoreExists
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public Pair<Boolean, String> innerCreateSfExpressOrder(String shopOrderId, Long orderPickupNum, Boolean ignoreExists) {
|
||||
public Pair<Boolean, String> innerCreateSfExpressOrder(String shopOrderId, Long orderPickupNum) {
|
||||
logger.info("开始顺丰同城下单");
|
||||
if (StrUtil.isBlank(shopOrderId) || CheckUtil.isEmpty(orderPickupNum)) {
|
||||
if (StrUtil.isBlank(shopOrderId) || orderPickupNum == null) {
|
||||
return Pair.of(false, "顺丰同城下单时,缺少必要参数!");
|
||||
}
|
||||
|
||||
// 检查 shop_store_sf_order 订单是否已存在?
|
||||
if (!ignoreExists && shopStoreSfOrderService.exists(devId, shopOrderId)) {
|
||||
if (shopStoreSfOrderService.exists(devId, shopOrderId)) {
|
||||
return Pair.of(true, "顺丰同城已下单过!");
|
||||
}
|
||||
|
||||
@ -700,7 +645,7 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
shopStoreSfOrder.setStatus_desc("已创建顺丰同城订单");
|
||||
|
||||
// 下单成功,保存顺丰同城订单记录到 shop_store_sf_order 表里
|
||||
Boolean success = shopStoreSfOrderService.saveShopStoreSfOrder(shopStoreSfOrder);
|
||||
Boolean success = shopStoreSfOrderService.insertShopStoreSfOrder(shopStoreSfOrder);
|
||||
if (!success) {
|
||||
logger.error("顺丰下单返回的结果:{}", sfExpressApiRes.get("result").toString());
|
||||
return Pair.of(false, "保存顺丰同城下单失败!");
|
||||
@ -1422,17 +1367,14 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
if (!shopOrderBase.getOperate_flag().equals("0")) {
|
||||
return CommonResult.failed("该状态不允许发货操作");
|
||||
}
|
||||
|
||||
Pair<Boolean, String> pair = wxOrderShippingService.uploadShippingInfoToWx(2, shopOrderBase.getOrder_id());
|
||||
if (pair.getFirst()) {
|
||||
Integer orderStatus = StateCode.ORDER_STATE_SHIPPED;//已发货
|
||||
Integer orderIsOutStatus = StateCode.ORDER_PICKING_STATE_YES; // 已出库
|
||||
shopOrderInfoService.changeOrderStatus(orderId, orderStatus, orderIsOutStatus, 0);
|
||||
|
||||
//完成订单后修改订单异常操作流程进入完成订单环节
|
||||
shopOrderBase.setOperate_flag("1");
|
||||
shopOrderBaseService.updateById(shopOrderBase);
|
||||
|
||||
//出库扣减思迅库存star
|
||||
// RMK 第三方数据同步相关:redis 给这个商品减去对应的库存
|
||||
QueryWrapper<ShopOrderItem> itemQueryWrapper = new QueryWrapper<>();
|
||||
@ -1441,7 +1383,6 @@ public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||
if (picking(order_item_rows)) {
|
||||
logger.info("自行发货商品扣减库存成功");
|
||||
}
|
||||
|
||||
if (!order_item_rows.isEmpty()) {
|
||||
for (ShopOrderItem shopOrderItem : order_item_rows) {
|
||||
Map<String, Integer> stockDeltaMap = new HashMap<>();
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.controller.admin;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.pojo.dto.MainStoreBranchReqDTO;
|
||||
import com.suisung.mall.common.service.impl.BaseControllerImpl;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryBranchService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags = "商家入驻业务控制器")
|
||||
@RestController
|
||||
@RequestMapping("/admin/shop/merch/branch")
|
||||
public class ShopMchEntryBranchAdminController extends BaseControllerImpl {
|
||||
|
||||
|
||||
@Resource
|
||||
private ShopMchEntryBranchService shopMchEntryBranchService;
|
||||
|
||||
/**
|
||||
* 申请总店的分店
|
||||
*
|
||||
* @param mainStoreBranchReqJSON
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "后台-申请总店的分店", notes = "向拉卡拉申请总店的分店")
|
||||
@RequestMapping(value = "/apply/store", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryList(@RequestBody JSONObject mainStoreBranchReqJSON) {
|
||||
try {
|
||||
// 参数校验
|
||||
if (mainStoreBranchReqJSON == null) {
|
||||
return CommonResult.failed("请求参数不能为空");
|
||||
}
|
||||
|
||||
MainStoreBranchReqDTO mainStoreBranchReq = mainStoreBranchReqJSON.toBean(MainStoreBranchReqDTO.class);
|
||||
Pair<Boolean, String> result = shopMchEntryBranchService.applyMchEntryBranchStore(mainStoreBranchReq);
|
||||
|
||||
if (result.getFirst()) {
|
||||
return CommonResult.success();
|
||||
}
|
||||
|
||||
return CommonResult.failed(result.getSecond());
|
||||
} catch (Exception e) {
|
||||
log.error("申请总店分店异常", e);
|
||||
return CommonResult.failed("系统异常,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -34,7 +34,7 @@ public class ShopStorePrinterController {
|
||||
@ApiOperation(value = "内部测试案例", notes = "内部测试案例")
|
||||
@RequestMapping(value = "/testcase", method = {RequestMethod.GET})
|
||||
public CommonResult TestCase() {
|
||||
Object data = shopStoreSameCityTransportBaseService.computeSameCityTransportFee(3L, "110.078141", "23.375037", 100, BigDecimal.valueOf(19), BigDecimal.valueOf(5.5), BigDecimal.valueOf(5.5), false, true);
|
||||
Object data = shopStoreSameCityTransportBaseService.computeSameCityTransportFee(3L, "110.078141", "23.375037", 100, BigDecimal.valueOf(19), BigDecimal.valueOf(5.5), BigDecimal.valueOf(5.5), true);
|
||||
// Double distanceD = PositionUtil.getDistance4(110.084376,23.394216,110.11752034714767,23.31704849881646);
|
||||
|
||||
// BigDecimal s = new BigDecimal(2.50).setScale(2, RoundingMode.HALF_UP);
|
||||
|
||||
@ -62,7 +62,7 @@ public class ShopMchEntryController extends BaseControllerImpl {
|
||||
@ApiOperation(value = "获取商家入驻资料详情", notes = "获取商家入驻资料详情")
|
||||
@RequestMapping(value = "/detail", method = RequestMethod.POST)
|
||||
public CommonResult shopMerchEntryDetail(@RequestBody JSONObject jsonParam) {
|
||||
return shopMchEntryService.shopMerchEntryDetail(jsonParam.getLong("mch_id"), jsonParam.getStr("mobile"), null);
|
||||
return shopMchEntryService.shopMerchEntryDetail(null, jsonParam.getStr("mobile"), null);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过手机号mobile获取商家入驻审核状态", notes = "通过手机号获取商家入驻审核状态,远程调用用途")
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntryBranch;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public interface ShopMchEntryBranchMapper extends BaseMapper<ShopMchEntryBranch> {
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
|
||||
* Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
|
||||
* Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
|
||||
* Vestibulum commodo. Ut rhoncus gravida arcu.
|
||||
*/
|
||||
|
||||
package com.suisung.mall.shop.store.service;
|
||||
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntryBranch;
|
||||
import com.suisung.mall.common.pojo.dto.MainStoreBranchReqDTO;
|
||||
import org.springframework.data.util.Pair;
|
||||
|
||||
public interface ShopMchEntryBranchService {
|
||||
|
||||
/**
|
||||
* 保存或更新商户终端入驻申请信息
|
||||
*
|
||||
* @param shopMchEntryBranch 商户入驻申请信息
|
||||
* @return 保存结果
|
||||
*/
|
||||
Boolean saveShopMchEntryBranch(ShopMchEntryBranch shopMchEntryBranch);
|
||||
|
||||
|
||||
/**
|
||||
* 更新商户终端入驻申请信息
|
||||
*
|
||||
* @param reviewRelatedId 商户终端入驻申请ID
|
||||
* @param status 商户终端入驻申请状态
|
||||
* @param notifyResp 商户终端入驻申请通知响应数据
|
||||
* @return 更新结果
|
||||
*/
|
||||
Boolean updateByReviewRelatedId(String reviewRelatedId, Integer status, String notifyResp);
|
||||
|
||||
/**
|
||||
* 根据商户终端入驻申请ID查询商户终端入驻申请信息
|
||||
*
|
||||
* @param reviewRelatedId 商户终端入驻申请ID
|
||||
* @return 商户入驻申请信息
|
||||
*/
|
||||
ShopMchEntryBranch getByReviewRelatedId(String reviewRelatedId);
|
||||
|
||||
|
||||
/**
|
||||
* (重要)创建主店铺的分店账号、店铺信息、店铺员工信息、店铺权限信息、入驻信息
|
||||
*
|
||||
* @param mainStoreBranchReq 商户终端入驻申请门店信息
|
||||
* @return 创建结果
|
||||
*/
|
||||
Pair<Boolean, String> applyMchEntryBranchStore(MainStoreBranchReqDTO mainStoreBranchReq);
|
||||
|
||||
/**
|
||||
* (重要)创建商户终端入驻申请门店信息、创建商户终端入驻申请门店员工信息、创建商户终端入驻申请门店权限信息、创建商户终端入驻申请门店入驻信息
|
||||
*
|
||||
* @param reviewRelatedId 商户终端入驻申请ID
|
||||
* @param termNo 终端号
|
||||
* @param lklNotifyResp 拉卡拉通知响应数据
|
||||
* @return 创建结果
|
||||
*/
|
||||
Pair<Boolean, String> createMchEntryBranchStore(String reviewRelatedId, String termNo, String lklNotifyResp);
|
||||
}
|
||||
@ -9,7 +9,6 @@
|
||||
package com.suisung.mall.shop.store.service;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import org.springframework.data.util.Pair;
|
||||
@ -19,14 +18,6 @@ import java.util.List;
|
||||
|
||||
public interface ShopMchEntryService {
|
||||
|
||||
/**
|
||||
* 新增或修改商家入驻申请信息
|
||||
*
|
||||
* @param shopMchEntry
|
||||
* @return
|
||||
*/
|
||||
Boolean saveOrUpdateShopMchEntry(ShopMchEntry shopMchEntry);
|
||||
|
||||
/**
|
||||
* 获取店铺的经营类目列表
|
||||
*
|
||||
@ -138,15 +129,6 @@ public interface ShopMchEntryService {
|
||||
ShopMchEntry getShopMerchEntryByCondition(String loginMobile, String bizLicenseNumber, Integer... approvalStatusList);
|
||||
|
||||
|
||||
/**
|
||||
* 根据拉卡拉商户号获取有效的商家入驻申请记录
|
||||
*
|
||||
* @param merCupNo
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
ShopMchEntry getShopMerchEntryByMerCupNo(String merCupNo, Long parentId);
|
||||
|
||||
/**
|
||||
* 根据拉卡拉外部商户号获取有效的商家入驻申请记录
|
||||
*
|
||||
@ -393,14 +375,4 @@ public interface ShopMchEntryService {
|
||||
* @return
|
||||
*/
|
||||
ShopMchEntry getLklContractStatusUrl(Integer storeId);
|
||||
|
||||
ShopMchEntry findOneByLambdaQueryWrapper(LambdaQueryWrapper<ShopMchEntry> query);
|
||||
|
||||
/**
|
||||
* 根据商户入驻Id删除商户入驻记录
|
||||
*
|
||||
* @param mchId 商户入驻Id
|
||||
* @return 删除结果,true为成功,false为失败
|
||||
*/
|
||||
Boolean removeByMchId(Long mchId);
|
||||
}
|
||||
@ -166,17 +166,6 @@ public interface ShopStoreBaseService extends IBaseService<ShopStoreBase> {
|
||||
*/
|
||||
Pair<Integer, String> covMerchEntryInfo2StoreInfo(Long mchId, Boolean allowThrown);
|
||||
|
||||
/**
|
||||
* (重要)入驻审批通过并且合同盖章完结之后,把商家入驻信息转换成店铺信息,正式生成店铺所需的数据
|
||||
*
|
||||
* @param mchId 入驻编号
|
||||
* @param parentStoreId 总店店铺Id
|
||||
* @param allowThrown 是否允许抛出异常?
|
||||
* @return
|
||||
*/
|
||||
Pair<Integer, String> covMerchEntryInfo2StoreInfo(Long mchId, Integer parentStoreId, Boolean allowThrown);
|
||||
|
||||
|
||||
/**
|
||||
* 根据店铺名称判断店铺是否存在
|
||||
*
|
||||
|
||||
@ -47,12 +47,4 @@ public interface ShopStoreInfoService extends IBaseService<ShopStoreInfo> {
|
||||
* @return
|
||||
*/
|
||||
Integer getStoreShippingFeeInner(Integer storeId);
|
||||
|
||||
/**
|
||||
* 获取店铺的配送方式是否 自配送
|
||||
*
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
Boolean isDeliverySelf(Integer storeId);
|
||||
}
|
||||
|
||||
@ -94,11 +94,10 @@ public interface ShopStoreSameCityTransportBaseService {
|
||||
* @param orderProductAmount 订单商品原价金额
|
||||
* @param orderDiscountAmount 订单商品折扣金额(订单原价减去每个商品折扣费)
|
||||
* @param orderPayAmount 订单实际支付金额(折扣金额-优惠券-积分扣-人工干预扣费),不包含运费
|
||||
* @param isPlatform 是否平台: 1-是;2-否
|
||||
* @param canThrow 能否抛出异常?
|
||||
* @return
|
||||
*/
|
||||
SameCityDeliveryFeeRespDTO computeSameCityTransportFee(Long storeId, String orderLongitude, String orderLatitude, Integer weightGram, BigDecimal orderProductAmount, BigDecimal orderDiscountAmount, BigDecimal orderPayAmount, Boolean isPlatform, Boolean canThrow);
|
||||
SameCityDeliveryFeeRespDTO computeSameCityTransportFee(Long storeId, String orderLongitude, String orderLatitude, Integer weightGram, BigDecimal orderProductAmount, BigDecimal orderDiscountAmount, BigDecimal orderPayAmount, Boolean canThrow);
|
||||
|
||||
/**
|
||||
* 平台计算同城订单的内部配送费(仅仅作用于平台内部配送费计算,商家配送费忽略此方法,只对下单成功的订单起效果)
|
||||
|
||||
@ -31,12 +31,12 @@ public interface ShopStoreSfOrderService extends IBaseService<ShopStoreSfOrder>
|
||||
String getSfOrderIdByShopOrderId(String shopOrderId);
|
||||
|
||||
/**
|
||||
* 保存(新增或更新)一个顺丰同城订单记录
|
||||
* 新增一个顺丰同城订单记录
|
||||
*
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
Boolean saveShopStoreSfOrder(ShopStoreSfOrder record);
|
||||
Boolean insertShopStoreSfOrder(ShopStoreSfOrder record);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -1,470 +0,0 @@
|
||||
package com.suisung.mall.shop.store.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.exception.ApiException;
|
||||
import com.suisung.mall.common.feignService.AccountService;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntryBranch;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreBase;
|
||||
import com.suisung.mall.common.pojo.dto.MainStoreBranchReqDTO;
|
||||
import com.suisung.mall.common.utils.CheckUtil;
|
||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||
import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl;
|
||||
import com.suisung.mall.shop.store.mapper.ShopMchEntryBranchMapper;
|
||||
import com.suisung.mall.shop.store.mapper.ShopMchEntryMapper;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryBranchService;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ShopMchEntryBranchServiceImpl extends BaseServiceImpl<ShopMchEntryBranchMapper, ShopMchEntryBranch> implements ShopMchEntryBranchService {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopStoreBaseService shopStoreBaseService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopMchEntryService shopMchEntryService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private ShopMchEntryMapper shopMchEntryMapper;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private LklTkServiceImpl lklTkService;
|
||||
|
||||
|
||||
/**
|
||||
* 保存或更新商户终端入驻申请信息
|
||||
* <p>
|
||||
* 根据 reviewRelatedId 确定新增或更改记录
|
||||
*
|
||||
* @param shopMchEntryBranch 商户入驻申请信息
|
||||
* @return 保存结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveShopMchEntryBranch(ShopMchEntryBranch shopMchEntryBranch) {
|
||||
try {
|
||||
if (shopMchEntryBranch == null) {
|
||||
log.error("商户终端入驻申请信息不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 验证必要字段
|
||||
if (StrUtil.isBlank(shopMchEntryBranch.getReview_related_id())) {
|
||||
log.error("审核关联号不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
String reviewRelatedId = shopMchEntryBranch.getReview_related_id();
|
||||
|
||||
// 查询是否已存在记录
|
||||
ShopMchEntryBranch existingRecord = getByReviewRelatedId(reviewRelatedId);
|
||||
|
||||
boolean result;
|
||||
if (existingRecord != null) {
|
||||
// 更新现有记录
|
||||
shopMchEntryBranch.setId(existingRecord.getId());
|
||||
result = updateById(shopMchEntryBranch);
|
||||
log.info("更新商户终端入驻申请信息成功,审核关联号: {}", reviewRelatedId);
|
||||
} else {
|
||||
// 新增记录
|
||||
result = save(shopMchEntryBranch);
|
||||
log.info("新增商户终端入驻申请信息成功,审核关联号: {}", reviewRelatedId);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("保存或更新商户终端入驻申请信息失败,审核关联号: {}",
|
||||
shopMchEntryBranch != null ? shopMchEntryBranch.getReview_related_id() : "null", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateByReviewRelatedId(String reviewRelatedId, Integer status, String notifyResp) {
|
||||
try {
|
||||
// 参数校验
|
||||
if (StrUtil.isBlank(reviewRelatedId)) {
|
||||
log.warn("审核关联号不能为空,无法执行更新操作");
|
||||
return false;
|
||||
}
|
||||
|
||||
LambdaUpdateWrapper<ShopMchEntryBranch> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId).set(ShopMchEntryBranch::getUpdated_at, new Date());
|
||||
|
||||
// 只有当状态值有效时才更新状态字段
|
||||
if (CheckUtil.isNotEmpty(status)) {
|
||||
updateWrapper.set(ShopMchEntryBranch::getStatus, status);
|
||||
log.debug("更新状态字段为: {}", status);
|
||||
}
|
||||
|
||||
// 更新通知响应内容
|
||||
if (StrUtil.isNotBlank(notifyResp)) { // 允许空字符串,但不能为null
|
||||
updateWrapper.set(ShopMchEntryBranch::getLkl_notify_reps, notifyResp);
|
||||
}
|
||||
|
||||
boolean result = update(updateWrapper);
|
||||
|
||||
if (result) {
|
||||
log.info("成功更新分店入驻申请记录,审核关联号: {}", reviewRelatedId);
|
||||
} else {
|
||||
log.warn("更新分店入驻申请记录失败,审核关联号: {}", reviewRelatedId);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("更新分店入驻申请记录时发生异常,审核关联号: {}", reviewRelatedId, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据商户终端入驻申请ID查询商户终端入驻申请信息
|
||||
*
|
||||
* @param reviewRelatedId 商户终端入驻申请ID
|
||||
* @return 商户入驻申请信息
|
||||
*/
|
||||
@Override
|
||||
public ShopMchEntryBranch getByReviewRelatedId(String reviewRelatedId) {
|
||||
try {
|
||||
if (StrUtil.isBlank(reviewRelatedId)) {
|
||||
log.warn("审核关联号为空,无法查询商户终端入驻申请信息");
|
||||
return null;
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<ShopMchEntryBranch> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMchEntryBranch::getReview_related_id, reviewRelatedId);
|
||||
|
||||
ShopMchEntryBranch result = findOne(queryWrapper);
|
||||
|
||||
if (result != null) {
|
||||
log.debug("查询商户终端入驻申请信息成功,审核关联号: {}", reviewRelatedId);
|
||||
} else {
|
||||
log.info("未找到对应的商户终端入驻申请信息,审核关联号: {}", reviewRelatedId);
|
||||
}
|
||||
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
log.error("查询商户终端入驻申请信息失败,审核关联号: {}", reviewRelatedId, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测分店信息,并向拉卡拉申请创建分店商户入驻申请
|
||||
*
|
||||
* @param mainStoreBranchReq 分店入驻请求DTO
|
||||
* @return Pair<Boolean, String> - 执行结果和提示信息
|
||||
*/
|
||||
@Override
|
||||
public Pair<Boolean, String> applyMchEntryBranchStore(MainStoreBranchReqDTO mainStoreBranchReq) {
|
||||
log.info("开始创建分店商户入驻申请,请求参数: {}", JSONUtil.toJsonStr(mainStoreBranchReq));
|
||||
|
||||
try {
|
||||
// 1. 参数校验
|
||||
if (mainStoreBranchReq == null) {
|
||||
log.warn("分店入驻信息不能为空");
|
||||
return Pair.of(false, "分店入驻信息不能为空");
|
||||
}
|
||||
|
||||
// 必填参数校验
|
||||
if (mainStoreBranchReq.getParent_store_id() == null) {
|
||||
return Pair.of(false, "主店ID不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(mainStoreBranchReq.getLogin_mobile())) {
|
||||
return Pair.of(false, "登录手机号不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(mainStoreBranchReq.getStore_name())) {
|
||||
return Pair.of(false, "分店名称不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(mainStoreBranchReq.getStore_address())) {
|
||||
return Pair.of(false, "分店地址不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(mainStoreBranchReq.getStore_longitude())) {
|
||||
return Pair.of(false, "分店经度不能为空");
|
||||
}
|
||||
if (StrUtil.isBlank(mainStoreBranchReq.getStore_latitude())) {
|
||||
return Pair.of(false, "分店纬度不能为空");
|
||||
}
|
||||
|
||||
// 2. 检查主店信息是否存在及入驻状态
|
||||
LambdaQueryWrapper<ShopMchEntry> entryQueryWrapper = new LambdaQueryWrapper<>();
|
||||
entryQueryWrapper.eq(ShopMchEntry::getStore_id, mainStoreBranchReq.getParent_store_id())
|
||||
.eq(ShopMchEntry::getApproval_status, CommonConstant.MCH_APPR_STA_PASS)
|
||||
.eq(ShopMchEntry::getParent_id, 0L); // 总店记录
|
||||
ShopMchEntry mchEntry = shopMchEntryService.findOneByLambdaQueryWrapper(entryQueryWrapper);
|
||||
|
||||
if (mchEntry == null) {
|
||||
return Pair.of(false, "主店商户入驻信息不存在");
|
||||
}
|
||||
|
||||
if (!Objects.equals(mchEntry.getLkl_tk_audit_status(), CommonConstant.Enable)) {
|
||||
return Pair.of(false, "主店入驻状态未完成,无法创建分店");
|
||||
}
|
||||
|
||||
// 3. 检查店铺名称是否已经存在
|
||||
LambdaQueryWrapper<ShopStoreBase> nameQueryWrapper = new LambdaQueryWrapper<>();
|
||||
nameQueryWrapper.eq(ShopStoreBase::getStore_name, mainStoreBranchReq.getStore_name());
|
||||
if (shopStoreBaseService.getOne(nameQueryWrapper) != null) {
|
||||
return Pair.of(false, "店铺名称已存在");
|
||||
}
|
||||
|
||||
// 4. 检查分店登录手机号是否已经注册过商户
|
||||
Integer status = accountService.isMerchantExists(mainStoreBranchReq.getLogin_mobile());
|
||||
if (CheckUtil.isEmpty(status)) {
|
||||
return Pair.of(false, "检查商户信息失败!");
|
||||
}
|
||||
|
||||
if (CommonConstant.Enable.equals(status)) {
|
||||
return Pair.of(false, "手机号已被其他商家注册");
|
||||
}
|
||||
|
||||
// 5. 检查分店终端号是否已经申请或申请中
|
||||
LambdaQueryWrapper<ShopMchEntryBranch> branchQueryWrapper = new LambdaQueryWrapper<>();
|
||||
branchQueryWrapper.eq(ShopMchEntryBranch::getLkl_mer_cup_no, mchEntry.getLkl_mer_inner_no())
|
||||
.in(ShopMchEntryBranch::getStatus, Arrays.asList(1, 3)); // 1-申请中,3-可能的其他状态
|
||||
if (count(branchQueryWrapper) > 0) {
|
||||
return Pair.of(false, "分店终端号已申请或申请中,请等待审核");
|
||||
}
|
||||
|
||||
// 6. 调用拉卡拉接口创建商户终端
|
||||
JSONObject lklResp = lklTkService.openMerchantAddTerm(mchEntry.getLkl_mer_cup_no());
|
||||
if (lklResp == null || StrUtil.isBlank(lklResp.getStr("reviewRelatedId"))) {
|
||||
log.error("调用拉卡拉接口创建商户终端失败,主店拉卡拉商户号: {}", mchEntry.getLkl_mer_cup_no());
|
||||
return Pair.of(false, "分店提交申请失败");
|
||||
}
|
||||
|
||||
// 7. 保存商户入驻申请信息
|
||||
ShopMchEntryBranch shopMchEntryBranch = new ShopMchEntryBranch();
|
||||
shopMchEntryBranch.setLkl_mer_cup_no(mchEntry.getLkl_mer_cup_no());
|
||||
shopMchEntryBranch.setReview_related_id(lklResp.getStr("reviewRelatedId"));
|
||||
shopMchEntryBranch.setLkl_req(JSONUtil.toJsonStr(mainStoreBranchReq));
|
||||
shopMchEntryBranch.setLkl_reps(JSONUtil.toJsonStr(lklResp));
|
||||
|
||||
if (!saveShopMchEntryBranch(shopMchEntryBranch)) {
|
||||
return Pair.of(false, "分店提交申请失败");
|
||||
}
|
||||
|
||||
log.info("分店商户入驻申请创建成功,审核关联号: {}", lklResp.getStr("reviewRelatedId"));
|
||||
return Pair.of(true, "分店提交申请成功");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("创建分店商户入驻申请时发生异常,请求参数: {}", JSONUtil.toJsonStr(mainStoreBranchReq), e);
|
||||
return Pair.of(false, "分店提交申请失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (重要)创建商户终端入驻申请门店信息、创建商户终端入驻申请门店员工信息、创建商户终端入驻申请门店权限信息、创建商户终端入驻申请门店入驻信息
|
||||
*
|
||||
* @param reviewRelatedId 商户终端入驻申请ID
|
||||
* @param termNo 商户终端编号
|
||||
* @param lklNotifyResp 拉卡拉通知响应数据
|
||||
* @return 创建结果
|
||||
*/
|
||||
@GlobalTransactional
|
||||
@Override
|
||||
public Pair<Boolean, String> createMchEntryBranchStore(String reviewRelatedId, String termNo, String lklNotifyResp) {
|
||||
log.info("开始处理分店商户入驻,审核关联号: {}, 终端号: {}", reviewRelatedId, termNo);
|
||||
|
||||
// 1. 参数校验
|
||||
if (StrUtil.isBlank(reviewRelatedId) || StrUtil.isBlank(termNo)) {
|
||||
return Pair.of(false, "参数不能为空");
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. 查询分店入驻申请记录
|
||||
ShopMchEntryBranch shopMchEntryBranch = getByReviewRelatedId(reviewRelatedId);
|
||||
if (shopMchEntryBranch == null) {
|
||||
return Pair.of(false, "分店商户入驻申请不存在");
|
||||
}
|
||||
|
||||
// 3. 更新分店入驻申请记录
|
||||
shopMchEntryBranch.setLkl_term_no(termNo);
|
||||
shopMchEntryBranch.setStatus(CommonConstant.Enable);
|
||||
shopMchEntryBranch.setLkl_notify_reps(lklNotifyResp);
|
||||
if (!updateById(shopMchEntryBranch)) {
|
||||
throw new ApiException("更新分店入驻申请记录失败");
|
||||
}
|
||||
|
||||
// 4. 解析分店入驻请求数据
|
||||
MainStoreBranchReqDTO mainStoreBranchReq = JSONUtil.toBean(shopMchEntryBranch.getLkl_req(), MainStoreBranchReqDTO.class);
|
||||
if (mainStoreBranchReq == null) {
|
||||
throw new ApiException("解析分店入驻请求数据失败");
|
||||
}
|
||||
|
||||
// 5. 获取总店入驻信息
|
||||
ShopMchEntry parentShopMchEntry = shopMchEntryService.getShopMerchEntryByMerCupNo(shopMchEntryBranch.getLkl_mer_cup_no(), 0L);
|
||||
if (parentShopMchEntry == null) {
|
||||
throw new ApiException("主店入驻信息不存在");
|
||||
}
|
||||
|
||||
// 6. 构建分店入驻信息
|
||||
ShopMchEntry shopMchEntry = new ShopMchEntry();
|
||||
cn.hutool.core.bean.BeanUtil.copyProperties(parentShopMchEntry, shopMchEntry, "id");
|
||||
shopMchEntry.setId(null); // ID设置为null,以便插入新记录
|
||||
shopMchEntry.setLkl_term_no(termNo);
|
||||
shopMchEntry.setLogin_mobile(mainStoreBranchReq.getLogin_mobile());
|
||||
shopMchEntry.setParent_id(parentShopMchEntry.getId()); // 设置主店入驻ID为父ID
|
||||
shopMchEntry.setStore_name(mainStoreBranchReq.getStore_name());
|
||||
shopMchEntry.setStore_address(mainStoreBranchReq.getStore_address());
|
||||
shopMchEntry.setStore_longitude(mainStoreBranchReq.getStore_longitude());
|
||||
shopMchEntry.setStore_latitude(mainStoreBranchReq.getStore_latitude());
|
||||
shopMchEntry.setStatus(CommonConstant.Enable);
|
||||
|
||||
if (StrUtil.isNotBlank(mainStoreBranchReq.getContact_name())) {
|
||||
shopMchEntry.setContact_name(mainStoreBranchReq.getContact_name());
|
||||
}
|
||||
if (StrUtil.isNotBlank(mainStoreBranchReq.getFront_facade_image())) {
|
||||
shopMchEntry.setFront_facade_image(mainStoreBranchReq.getFront_facade_image());
|
||||
}
|
||||
if (StrUtil.isNotBlank(mainStoreBranchReq.getEnvironment_image())) {
|
||||
shopMchEntry.setEnvironment_image(mainStoreBranchReq.getEnvironment_image());
|
||||
}
|
||||
shopMchEntry.setEmail(StrUtil.isBlank(mainStoreBranchReq.getEmail()) ? parentShopMchEntry.getLogin_mobile() + "@qq.com" : mainStoreBranchReq.getEmail());
|
||||
|
||||
// 7. 保存分店入驻记录
|
||||
if (!shopMchEntryService.saveOrUpdateShopMchEntry(shopMchEntry)) {
|
||||
throw new ApiException("保存分店入驻记录失败:" + shopMchEntry.getStore_name());
|
||||
}
|
||||
|
||||
// 8. 创建分店店铺商家登录账号
|
||||
Pair<Boolean, String> registerResult = accountService.merchantInnerRegister(mainStoreBranchReq.getLogin_mobile(), mainStoreBranchReq.getPassword());
|
||||
if (!registerResult.getFirst()) {
|
||||
throw new ApiException("分店商户注册账号失败:" + registerResult.getSecond());
|
||||
}
|
||||
|
||||
// 9. 创建分店店铺信息
|
||||
Pair<Integer, String> storeResult = shopStoreBaseService.covMerchEntryInfo2StoreInfo(shopMchEntry.getId(), Convert.toInt(parentShopMchEntry.getStore_id(), 0), true);
|
||||
if (storeResult == null || storeResult.getFirst() <= 0) {
|
||||
throw new ApiException("创建分店店铺信息失败: " + (storeResult != null ? storeResult.getSecond() : "未知错误"));
|
||||
}
|
||||
|
||||
log.info("分店商户入驻处理成功,分店入驻ID: {}, 店铺ID: {}", shopMchEntry.getId(), storeResult.getFirst());
|
||||
return Pair.of(true, "分店商户入驻处理成功");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("处理分店商户入驻时发生异常,审核关联号: {}, 终端号: {}", reviewRelatedId, termNo, e);
|
||||
throw new ApiException("处理分店商户入驻时发生异常,审核关联号: " + reviewRelatedId + ", 终端号: " + termNo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清理分店商户入驻信息
|
||||
*
|
||||
* @param lklMerCupNo 拉卡拉商户号
|
||||
* @param lklTermNo 拉卡拉终端号
|
||||
* @return 清理结果
|
||||
*/
|
||||
@GlobalTransactional
|
||||
public Pair<Boolean, String> cleanMchEntryBranchStore(String lklMerCupNo, String lklTermNo) {
|
||||
log.info("开始清理分店商户入驻信息,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo);
|
||||
|
||||
// 1. 参数校验
|
||||
if (StrUtil.isBlank(lklMerCupNo) || StrUtil.isBlank(lklTermNo)) {
|
||||
log.warn("清理分店商户入驻参数校验失败,lklMerCupNo: {}, lklTermNo: {}", lklMerCupNo, lklTermNo);
|
||||
return Pair.of(false, "参数不能为空");
|
||||
}
|
||||
|
||||
try {
|
||||
log.debug("步骤1 - 查询分店入驻记录,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo);
|
||||
// 2. 查询分店入驻记录
|
||||
LambdaQueryWrapper<ShopMchEntry> entryQueryWrapper = new LambdaQueryWrapper<>();
|
||||
entryQueryWrapper.eq(ShopMchEntry::getLkl_mer_cup_no, lklMerCupNo)
|
||||
.eq(ShopMchEntry::getLkl_term_no, lklTermNo);
|
||||
ShopMchEntry shopMchEntry = shopMchEntryService.findOneByLambdaQueryWrapper(entryQueryWrapper);
|
||||
|
||||
if (shopMchEntry == null) {
|
||||
log.warn("未找到对应的分店入驻记录,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo);
|
||||
return Pair.of(false, "未找到对应的分店入驻记录");
|
||||
}
|
||||
log.debug("步骤1 - 找到分店入驻记录,分店ID: {}, 店铺名称: {}", shopMchEntry.getId(), shopMchEntry.getStore_name());
|
||||
|
||||
log.debug("步骤2 - 查询分店店铺信息,分店入驻ID: {}", shopMchEntry.getId());
|
||||
// 3. 查询分店店铺信息
|
||||
LambdaQueryWrapper<ShopStoreBase> storeQueryWrapper = new LambdaQueryWrapper<>();
|
||||
storeQueryWrapper.eq(ShopStoreBase::getStore_id, shopMchEntry.getStore_id());
|
||||
ShopStoreBase shopStore = shopStoreBaseService.getOne(storeQueryWrapper);
|
||||
|
||||
if (shopStore == null) {
|
||||
log.warn("未找到对应的分店店铺信息,分店入驻ID: {}", shopMchEntry.getId());
|
||||
} else {
|
||||
log.debug("步骤2 - 找到分店店铺信息,店铺ID: {}, 店铺名称: {}", shopStore.getStore_id(), shopStore.getStore_name());
|
||||
}
|
||||
|
||||
log.debug("步骤3 - 删除分店店铺信息,店铺ID: {}", shopStore != null ? shopStore.getStore_id() : "null");
|
||||
// 4. 删除分店店铺信息
|
||||
if (shopStore != null) {
|
||||
boolean deleteStoreResult = shopStoreBaseService.removeById(shopStore.getStore_id());
|
||||
if (!deleteStoreResult) {
|
||||
log.error("删除分店店铺信息失败,店铺ID: {}", shopStore.getStore_id());
|
||||
throw new ApiException("删除分店店铺信息失败");
|
||||
}
|
||||
log.debug("步骤3 - 删除分店店铺信息成功,店铺ID: {}", shopStore.getStore_id());
|
||||
}
|
||||
|
||||
log.debug("步骤4 - 删除分店入驻记录,分店ID: {}", shopMchEntry.getId());
|
||||
// 5. 删除分店入驻记录
|
||||
boolean deleteEntryResult = shopMchEntryService.removeByMchId(shopMchEntry.getId());
|
||||
if (!deleteEntryResult) {
|
||||
log.error("删除分店入驻记录失败,分店ID: {}", shopMchEntry.getId());
|
||||
throw new ApiException("删除分店入驻记录失败");
|
||||
}
|
||||
log.debug("步骤4 - 删除分店入驻记录成功,分店ID: {}", shopMchEntry.getId());
|
||||
|
||||
log.debug("步骤5 - 查询分店入驻申请记录,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo);
|
||||
// 6. 查询分店入驻申请记录
|
||||
LambdaQueryWrapper<ShopMchEntryBranch> branchQueryWrapper = new LambdaQueryWrapper<>();
|
||||
branchQueryWrapper.eq(ShopMchEntryBranch::getLkl_mer_cup_no, lklMerCupNo)
|
||||
.eq(ShopMchEntryBranch::getLkl_term_no, lklTermNo);
|
||||
ShopMchEntryBranch shopMchEntryBranch = getOne(branchQueryWrapper);
|
||||
|
||||
if (shopMchEntryBranch != null) {
|
||||
log.debug("步骤5 - 找到分店入驻申请记录,审核关联ID: {}", shopMchEntryBranch.getReview_related_id());
|
||||
|
||||
log.debug("步骤6 - 删除分店入驻申请记录,审核关联ID: {}", shopMchEntryBranch.getReview_related_id());
|
||||
// 7. 删除分店入驻申请记录
|
||||
boolean deleteBranchResult = removeById(shopMchEntryBranch.getId());
|
||||
if (!deleteBranchResult) {
|
||||
log.error("删除分店入驻申请记录失败,审核关联ID: {}", shopMchEntryBranch.getReview_related_id());
|
||||
throw new ApiException("删除分店入驻申请记录失败");
|
||||
}
|
||||
log.debug("步骤6 - 删除分店入驻申请记录成功,审核关联ID: {}", shopMchEntryBranch.getReview_related_id());
|
||||
}
|
||||
|
||||
log.info("分店商户入驻信息清理完成,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo);
|
||||
return Pair.of(true, "分店商户入驻信息清理成功");
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("清理分店商户入驻信息时发生异常,拉卡拉商户号: {}, 终端号: {}", lklMerCupNo, lklTermNo, e);
|
||||
throw new ApiException("清理分店商户入驻信息时发生异常,拉卡拉商户号: " + lklMerCupNo + ", 终端号: " + lklTermNo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -30,7 +30,6 @@ import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||
import com.suisung.mall.common.modules.lakala.LklLedgerEc;
|
||||
import com.suisung.mall.common.modules.store.ShopMchEntry;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreEmployee;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreInfo;
|
||||
import com.suisung.mall.common.pojo.to.AddressParseResultTO;
|
||||
import com.suisung.mall.common.utils.*;
|
||||
import com.suisung.mall.common.utils.phone.PhoneNumberUtils;
|
||||
@ -46,7 +45,6 @@ import com.suisung.mall.shop.store.mapper.ShopMchEntryMapper;
|
||||
import com.suisung.mall.shop.store.service.ShopMchEntryService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
||||
import com.suisung.mall.shop.store.service.ShopStoreInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.util.Pair;
|
||||
@ -99,61 +97,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
@Resource
|
||||
private ShopBaseDistrictService shopBaseDistrictService;
|
||||
|
||||
@Lazy
|
||||
@Resource
|
||||
private ShopStoreInfoService shopStoreInfoService;
|
||||
|
||||
/**
|
||||
* 新增或修改商家入驻申请信息
|
||||
*
|
||||
* @param shopMchEntry 商家入驻申请信息实体对象,不能为空
|
||||
* @return Boolean 操作结果,true表示成功,false表示失败
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveOrUpdateShopMchEntry(ShopMchEntry shopMchEntry) {
|
||||
// 1. 参数校验
|
||||
if (shopMchEntry == null) {
|
||||
log.warn("商家入驻申请信息不能为空");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
// 2. 记录操作日志
|
||||
Long mchId = shopMchEntry.getId();
|
||||
String storeName = shopMchEntry.getStore_name();
|
||||
String loginMobile = shopMchEntry.getLogin_mobile();
|
||||
|
||||
if (mchId != null && mchId > 0) {
|
||||
log.info("开始更新商家入驻申请信息,ID: {}, 店铺名称: {}, 手机号: {}", mchId, storeName, loginMobile);
|
||||
} else {
|
||||
log.info("开始新增商家入驻申请信息,店铺名称: {}, 手机号: {}", storeName, loginMobile);
|
||||
}
|
||||
|
||||
// 3. 执行保存或更新操作
|
||||
boolean result = saveOrUpdate(shopMchEntry);
|
||||
|
||||
// 4. 记录操作结果
|
||||
if (result) {
|
||||
if (mchId != null && mchId > 0) {
|
||||
log.info("商家入驻申请信息更新成功,ID: {}", mchId);
|
||||
} else {
|
||||
log.info("商家入驻申请信息新增成功,新ID: {}", shopMchEntry.getId());
|
||||
}
|
||||
} else {
|
||||
log.error("商家入驻申请信息保存或更新失败,ID: {}, 店铺名称: {}, 手机号: {}",
|
||||
mchId, storeName, loginMobile);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("商家入驻申请信息保存或更新异常,店铺名称: {}, 手机号: {}",
|
||||
shopMchEntry.getStore_name(), shopMchEntry.getLogin_mobile(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取店铺的经营类目列表
|
||||
*
|
||||
@ -246,11 +189,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return CommonResult.failed("请选择是企业还是个人");
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(record.getCheckstand_image())) {
|
||||
log.warn("未上传店铺门头照片,手机号: {}", loginMobile);
|
||||
return CommonResult.failed("请上传店铺收银台照片");
|
||||
}
|
||||
|
||||
// 不管是企业或个人,只要没有填写联系人,就直接把商家手机号码作为联系人手机号码
|
||||
if (StrUtil.isBlank(record.getLegal_person_mobile())) {
|
||||
record.setLegal_person_mobile(loginMobile);
|
||||
@ -327,12 +265,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return CommonResult.failed("缺少法人身份证信息!");
|
||||
}
|
||||
|
||||
// TODO 银行开户许可证明(开户账号图片) 必填项
|
||||
if (StrUtil.isBlank(record.getOpening_permit_image())) {
|
||||
log.warn("缺少银行开户许可证明图片,手机号: {}", loginMobile);
|
||||
return CommonResult.failed("缺少银行开户许可证明图片!");
|
||||
}
|
||||
|
||||
if (!StringUtils.validateIDCard(record.getLegal_person_id_number())) {
|
||||
log.warn("法人身份证号码格式错误,号码: {},手机号: {}", record.getLegal_person_id_number(), loginMobile);
|
||||
return CommonResult.failed("法人身份证号码有误!");
|
||||
@ -662,79 +594,48 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
/**
|
||||
* 通过 mobile 申请手机号或自增 ID 获取商家入驻申请详情
|
||||
*
|
||||
* @param recordId 商家入驻记录ID(可选)
|
||||
* @param mobile 商家登录手机号(可选)
|
||||
* @param approvalStatusList 审批状态列表过滤条件(可选)
|
||||
* @return CommonResult 包含商家入驻申请详情的响应结果
|
||||
* @param recordId
|
||||
* @param mobile
|
||||
* @param approvalStatusList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CommonResult shopMerchEntryDetail(Long recordId, String mobile, List<Integer> approvalStatusList) {
|
||||
log.debug("获取商家入驻申请详情开始: recordId={}, mobile={}", recordId, mobile);
|
||||
// 检查登录用户是否有管理权限或者是用户自己
|
||||
|
||||
// 参数校验:recordId 和 mobile 至少提供一个
|
||||
// approvalStatus 入驻商家的审批状态:1-已通过;2-未通过;3-待审核;
|
||||
if (ObjectUtil.isEmpty(recordId) && StrUtil.isBlank(mobile)) {
|
||||
log.warn("获取商家入驻详情失败:缺少必要参数 recordId 或 mobile");
|
||||
return CommonResult.failed("缺少必要参数!");
|
||||
}
|
||||
|
||||
try {
|
||||
// 构建查询条件
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
// 根据ID查询
|
||||
if (ObjectUtil.isNotEmpty(recordId)) {
|
||||
queryWrapper.eq("id", recordId);
|
||||
}
|
||||
|
||||
// 根据手机号查询
|
||||
if (StrUtil.isNotBlank(mobile)) {
|
||||
queryWrapper.eq("login_mobile", mobile);
|
||||
}
|
||||
|
||||
// 状态过滤条件
|
||||
if (CollectionUtil.isNotEmpty(approvalStatusList)) {
|
||||
queryWrapper.in("approval_status", approvalStatusList);
|
||||
}
|
||||
|
||||
// 按ID倒序排列,获取最新一条记录
|
||||
queryWrapper.orderByDesc("id");
|
||||
ShopMchEntry record = getOne(queryWrapper);
|
||||
|
||||
// 如果没有找到记录,返回默认的成功结果
|
||||
if (ObjectUtil.isEmpty(record)) {
|
||||
log.debug("未找到商家入驻记录: recordId={}, mobile={}", recordId, mobile);
|
||||
return CommonResult.success(
|
||||
new JSONObject().set("approval_status", CommonConstant.MCH_APPR_STA_NONE),
|
||||
"请求成功!"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// 处理审核意见空值情况
|
||||
if (StrUtil.isBlank(record.getApproval_invalid_col())) {
|
||||
record.setApproval_invalid_col("[]");
|
||||
}
|
||||
|
||||
// 尝试更新入驻表的合同下载地址和合同签署状态
|
||||
updateMerchEntrySignedStatusAndContractDownloadUrl(record);
|
||||
|
||||
if (StrUtil.isNotBlank(record.getStore_id())) {
|
||||
// 转换为JSONObject并添加额外属性
|
||||
JSONObject retObj = JSONUtil.parseObj(record);
|
||||
// 获取店铺信息
|
||||
ShopStoreInfo storeInfo = shopStoreInfoService.getById(record.getStore_id());
|
||||
if (storeInfo != null && retObj != null) {
|
||||
retObj.set("is_delivery_self", storeInfo.getIs_delivery_self());
|
||||
return CommonResult.success(record);
|
||||
}
|
||||
}
|
||||
|
||||
return CommonResult.success(record);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("获取商家入驻申请详情异常: recordId={}, mobile={}", recordId, mobile, e);
|
||||
return CommonResult.failed("系统异常,请稍后重试");
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(recordId)) {
|
||||
queryWrapper.eq("id", recordId);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(mobile)) {
|
||||
queryWrapper.eq("login_mobile", mobile);
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(approvalStatusList)) {
|
||||
queryWrapper.in("approval_status", approvalStatusList);
|
||||
}
|
||||
queryWrapper.orderByDesc("id");
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return CommonResult.success(new JSONObject().set("approval_status", CommonConstant.MCH_APPR_STA_NONE), "请求成功!");
|
||||
}
|
||||
|
||||
ShopMchEntry record = recordList.get(0);
|
||||
// 审核意见空值,返回"[]"
|
||||
if (StrUtil.isBlank(record.getApproval_invalid_col())) {
|
||||
record.setApproval_invalid_col("[]");
|
||||
}
|
||||
|
||||
// 试试更新入驻表的合同下载地址和合同签署状态
|
||||
updateMerchEntrySignedStatusAndContractDownloadUrl(record);
|
||||
|
||||
return CommonResult.success(record);
|
||||
}
|
||||
|
||||
|
||||
@ -1330,32 +1231,19 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ShopMchEntry getShopMerchEntryByMerCupNo(String merCupNo, Long parentId) {
|
||||
public ShopMchEntry getShopMerchEntryByMerCupNo(String merCupNo) {
|
||||
if (StrUtil.isBlank(merCupNo)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
LambdaQueryWrapper<ShopMchEntry> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMchEntry::getLkl_mer_cup_no, merCupNo)
|
||||
.eq(ShopMchEntry::getStatus, CommonConstant.Enable)
|
||||
.orderByAsc(ShopMchEntry::getId);
|
||||
|
||||
if (parentId != null && parentId >= 0) {
|
||||
queryWrapper.eq(ShopMchEntry::getParent_id, parentId);
|
||||
}
|
||||
|
||||
ShopMchEntry record = findOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(record)) {
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("lkl_mer_cup_no", merCupNo).eq("status", CommonConstant.Enable).orderByAsc("id");
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopMchEntry getShopMerchEntryByMerCupNo(String merCupNo) {
|
||||
return getShopMerchEntryByMerCupNo(merCupNo, null);
|
||||
return recordList.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1364,14 +1252,14 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
return null;
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<ShopMchEntry> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMchEntry::getLkl_mer_inner_no, merInnerNo).eq(ShopMchEntry::getStatus, CommonConstant.Enable).orderByAsc(ShopMchEntry::getId);
|
||||
ShopMchEntry record = findOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(record)) {
|
||||
QueryWrapper<ShopMchEntry> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("lkl_mer_inner_no", merInnerNo).eq("status", CommonConstant.Enable).orderByAsc("id");
|
||||
List<ShopMchEntry> recordList = list(queryWrapper);
|
||||
if (CollectionUtil.isEmpty(recordList)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return record;
|
||||
return recordList.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2654,40 +2542,6 @@ public class ShopMchEntryServiceImpl extends BaseServiceImpl<ShopMchEntryMapper,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据Lambda查询条件获取单个商户入驻记录
|
||||
*
|
||||
* @param query Lambda查询条件,不能为空
|
||||
* @return 商户入驻记录,未找到时返回null
|
||||
*/
|
||||
@Override
|
||||
public ShopMchEntry findOneByLambdaQueryWrapper(LambdaQueryWrapper<ShopMchEntry> query) {
|
||||
// 参数校验
|
||||
if (query == null) {
|
||||
log.warn("查询条件为空,无法执行查询");
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
// 执行查询
|
||||
return findOne(query);
|
||||
} catch (Exception e) {
|
||||
log.error("执行商户入驻查询时发生异常", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商户入驻Id删除商户入驻记录
|
||||
*
|
||||
* @param mchId 商户入驻Id
|
||||
* @return 删除结果,true为成功,false为失败
|
||||
*/
|
||||
@Override
|
||||
public Boolean removeByMchId(Long mchId) {
|
||||
return remove(mchId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +74,6 @@ import com.suisung.mall.shop.wechat.service.WxQrCodeService;
|
||||
import io.seata.spring.annotation.GlobalTransactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -2474,8 +2473,12 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
}
|
||||
|
||||
// 打包费
|
||||
BigDecimal packingFee = Convert.toBigDecimal(getParameter("packing_fee"), BigDecimal.ZERO);
|
||||
if (packingFee.compareTo(new BigDecimal("10")) >= 0) {
|
||||
BigDecimal packingFee = Convert.toBigDecimal(getParameter("packing_fee"));
|
||||
if (packingFee == null || packingFee.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
packingFee = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
if (packingFee.compareTo(new BigDecimal("10")) > 0) {
|
||||
logger.warn("打包费超出范围: {}", packingFee);
|
||||
return CommonResult.failed("打包费请控制在0到10元范围");
|
||||
}
|
||||
@ -2500,10 +2503,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
}
|
||||
}
|
||||
|
||||
// 店铺内部配送费
|
||||
info.setShopping_fee_inner(Convert.toInt(getParameter("shopping_fee_inner", 0)));
|
||||
info.setIs_delivery_self(Convert.toInt(getParameter("is_delivery_self", 0)));
|
||||
|
||||
// 百度坐标系BD09经纬度 转出 火星坐标系GCJ02经纬度 (因为数据库保存的经纬度统一是GCJ02经纬度,所以需要转换 )
|
||||
base = bd09ToGcj02Gps(base);
|
||||
|
||||
@ -2665,8 +2664,12 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
}
|
||||
|
||||
// 打包费
|
||||
BigDecimal packingFee = Convert.toBigDecimal(getParameter("packing_fee"), BigDecimal.ZERO);
|
||||
if (packingFee.compareTo(new BigDecimal("10")) >= 0) {
|
||||
BigDecimal packingFee = Convert.toBigDecimal(getParameter("packing_fee"));
|
||||
if (packingFee == null || packingFee.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
packingFee = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
if (packingFee.compareTo(new BigDecimal("10")) > 0) {
|
||||
logger.warn("打包费超出范围: {}", packingFee);
|
||||
return CommonResult.failed("打包费请控制在0到10元范围");
|
||||
}
|
||||
@ -3251,11 +3254,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
|
||||
@Override
|
||||
public Pair<Integer, String> covMerchEntryInfo2StoreInfo(Long mchId, Boolean allowThrown) {
|
||||
return covMerchEntryInfo2StoreInfo(mchId, 0, allowThrown);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<Integer, String> covMerchEntryInfo2StoreInfo(Long mchId, Integer parentStoreId, Boolean allowThrown) {
|
||||
// 参数校验
|
||||
if (ObjectUtil.isEmpty(mchId)) {
|
||||
logger.error("生成店铺:入驻商家自增Id不能为空");
|
||||
@ -3287,10 +3285,9 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
// 检查店铺名称
|
||||
ShopStoreBase shopStoreBase = findOneByStoreName(shopMchEntry.getStore_name());
|
||||
if (shopStoreBase != null
|
||||
&& StringUtils.isAnyBlank(shopStoreBase.getLkl_merchant_no(), shopStoreBase.getLkl_term_no(), shopMchEntry.getLkl_mer_cup_no(), shopMchEntry.getLkl_term_no())
|
||||
&& !shopStoreBase.getLkl_merchant_no().equals(shopMchEntry.getLkl_mer_cup_no())
|
||||
&& !shopStoreBase.getLkl_term_no().equals(shopMchEntry.getLkl_term_no())
|
||||
) {
|
||||
&& StrUtil.isNotBlank(shopStoreBase.getLkl_merchant_no())
|
||||
&& StrUtil.isNotBlank(shopMchEntry.getLkl_mer_cup_no())
|
||||
&& !shopStoreBase.getLkl_merchant_no().equals(shopMchEntry.getLkl_mer_cup_no())) {
|
||||
logger.error("生成店铺:店铺名称已存在");
|
||||
return Pair.of(0, "店铺名称已存在,请使用另一名称");
|
||||
}
|
||||
@ -3304,12 +3301,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
shopStoreBase.setUser_id(userId);
|
||||
shopStoreBase.setStore_name(shopMchEntry.getStore_name());
|
||||
|
||||
if (CheckUtil.isNotEmpty(parentStoreId)) {
|
||||
shopStoreBase.setParent_id(parentStoreId);
|
||||
} else {
|
||||
shopStoreBase.setParent_id(0);
|
||||
}
|
||||
|
||||
// 店铺二级分类
|
||||
if (CheckUtil.isEmpty(shopStoreBase.getStore_category_id())) {
|
||||
shopStoreBase.setStore_category_id(shopMchEntry.getBiz_category());
|
||||
@ -3332,7 +3323,6 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
if (CheckUtil.isEmpty(shopStoreBase.getSplit_ratio())) {
|
||||
shopStoreBase.setSplit_ratio(splitRatio);
|
||||
}
|
||||
|
||||
if (CheckUtil.isEmpty(shopStoreBase.getPacking_fee())) {
|
||||
shopStoreBase.setPacking_fee(BigDecimal.ZERO);
|
||||
}
|
||||
@ -3545,8 +3535,13 @@ public class ShopStoreBaseServiceImpl extends BaseServiceImpl<ShopStoreBaseMappe
|
||||
}
|
||||
|
||||
// 创建顺丰店铺
|
||||
// if (storeArea != null) {
|
||||
// String[] areaNames = storeArea.split("/");
|
||||
// String cityName = areaNames.length > 0 ? areaNames[areaNames.length - 1] : storeArea.replace("/", "");
|
||||
|
||||
sfExpressApiService.createSfExpressShop(mchId, storeId, shopMchEntry.getContact_name(),
|
||||
contact_mobile, shopMchEntry.getStore_longitude(), shopMchEntry.getStore_latitude());
|
||||
// }
|
||||
|
||||
return Pair.of(storeId, "新增成功");
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -50,7 +50,6 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||
@Service
|
||||
public class ShopStoreEmployeeServiceImpl extends BaseServiceImpl<ShopStoreEmployeeMapper, ShopStoreEmployee> implements ShopStoreEmployeeService {
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
|
||||
@ -2,10 +2,8 @@ package com.suisung.mall.shop.store.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.feignService.AccountService;
|
||||
import com.suisung.mall.common.modules.account.AccountUserBase;
|
||||
import com.suisung.mall.common.modules.store.ShopStoreAnalytics;
|
||||
@ -162,38 +160,4 @@ public class ShopStoreInfoServiceImpl extends BaseServiceImpl<ShopStoreInfoMappe
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺的配送方式是否自配送
|
||||
*
|
||||
* @param storeId 店铺ID
|
||||
* @return true表示自配送,false表示非自配送或店铺不存在
|
||||
*/
|
||||
@Override
|
||||
public Boolean isDeliverySelf(Integer storeId) {
|
||||
// 参数校验
|
||||
if (storeId == null) {
|
||||
log.warn("店铺ID为空,无法判断配送方式");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
LambdaQueryWrapper<ShopStoreInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopStoreInfo::getStore_id, storeId)
|
||||
.select(ShopStoreInfo::getIs_delivery_self);
|
||||
ShopStoreInfo shopStoreInfo = findOne(queryWrapper);
|
||||
|
||||
// 店铺不存在或配送方式字段为空时返回false
|
||||
if (shopStoreInfo == null || shopStoreInfo.getIs_delivery_self() == null) {
|
||||
log.debug("店铺信息不存在或配送方式未设置,storeId: {}", storeId);
|
||||
return false;
|
||||
}
|
||||
|
||||
return CommonConstant.Enable.equals(shopStoreInfo.getIs_delivery_self());
|
||||
} catch (Exception e) {
|
||||
log.error("查询店铺配送方式异常,storeId: {}", storeId, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -43,7 +43,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.util.Pair;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -63,10 +62,6 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||
public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<ShopStoreSameCityTransportBaseMapper, ShopStoreSameCityTransportBase> implements ShopStoreSameCityTransportBaseService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ShopStoreSameCityTransportBaseServiceImpl.class);
|
||||
|
||||
@Value("${sf-express.supplier_id}")
|
||||
private String supplierId;
|
||||
|
||||
@Autowired
|
||||
private ShopStoreSameCityTransportService shopStoreSameCityTransportService;
|
||||
@Autowired
|
||||
@ -76,6 +71,7 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
@Autowired
|
||||
private ShopOrderInfoService shopOrderInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private AccountBaseConfigService accountBaseConfigService;
|
||||
|
||||
@ -329,7 +325,6 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
transportBase.setStore_id(storeId);
|
||||
transportBase.setIs_platform(isPlatform);
|
||||
|
||||
|
||||
// 设置默认值
|
||||
transportBase.setArea_type(1);
|
||||
transportBase.setBasis(1);
|
||||
@ -356,11 +351,6 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
}
|
||||
}
|
||||
|
||||
// 顺丰同城平台商家Id
|
||||
if (StrUtil.isBlank(transportBase.getSupplier_id())) {
|
||||
transportBase.setSupplier_id(supplierId);
|
||||
}
|
||||
|
||||
// 构造返回DTO
|
||||
ShopStoreSameCityTransportBaseDTO shopStoreSameCityTransportBaseDTO = new ShopStoreSameCityTransportBaseDTO();
|
||||
shopStoreSameCityTransportBaseDTO.setTransportBase(transportBase);
|
||||
@ -448,10 +438,6 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
transportBase.setWeight_increase_fee(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
if (StrUtil.isBlank(transportBase.getSupplier_id())) {
|
||||
transportBase.setSupplier_id(supplierId);
|
||||
}
|
||||
|
||||
// 构建查询条件:确保同一店铺同一平台标识下只有一条启用记录
|
||||
QueryWrapper<ShopStoreSameCityTransportBase> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("store_id", transportBase.getStore_id());
|
||||
@ -469,6 +455,7 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
transportBase.setCreated_at(now);
|
||||
transportBase.setUpdated_at(now);
|
||||
transportBase.setStatus(CommonConstant.Enable); // 确保状态为启用
|
||||
|
||||
if (add(transportBase)) {
|
||||
// 确保获取到ID
|
||||
Long transportBaseId = transportBase.getTransport_base_id();
|
||||
@ -492,6 +479,7 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
transportBase.setTransport_base_id(exist.getTransport_base_id());
|
||||
transportBase.setUpdated_at(now);
|
||||
transportBase.setStatus(CommonConstant.Enable); // 确保状态为启用
|
||||
|
||||
if (updateById(transportBase)) {
|
||||
log.info("更新同城配送基础信息成功, transportBaseId={}, storeId={}", transportBase.getTransport_base_id(), transportBase.getStore_id());
|
||||
return Pair.of(transportBase.getTransport_base_id(), "更新成功!");
|
||||
@ -601,12 +589,11 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
* @param orderProductAmount 订单商品原价金额
|
||||
* @param orderDiscountAmount 订单商品折扣金额(订单原价减去每个商品折扣费)
|
||||
* @param orderPayAmount 订单实际支付金额(折扣金额-优惠券-积分扣-人工干预扣费),不包含运费
|
||||
* @param isPlatform 是否平台: 1-是;2-否
|
||||
* @param canThrow 不能配送是否抛出异常?
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public SameCityDeliveryFeeRespDTO computeSameCityTransportFee(Long storeId, String orderLongitude, String orderLatitude, Integer weightGram, BigDecimal orderProductAmount, BigDecimal orderDiscountAmount, BigDecimal orderPayAmount, Boolean isPlatform, Boolean canThrow) {
|
||||
public SameCityDeliveryFeeRespDTO computeSameCityTransportFee(Long storeId, String orderLongitude, String orderLatitude, Integer weightGram, BigDecimal orderProductAmount, BigDecimal orderDiscountAmount, BigDecimal orderPayAmount, Boolean canThrow) {
|
||||
// 计算订单同城配送费,该函数的流程说明:
|
||||
// 1.先获取订单的经纬度,计算配送距离,获取配送范围,确定是否能配送,如果能计算基础运费?
|
||||
// 2.如果能配送,再订单总重量,订单原价金额,订单折后金额,订单实付金额
|
||||
@ -640,7 +627,8 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
return new SameCityDeliveryFeeRespDTO(false, false, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, "无法获取" + storeName + "的具体位置,请联系商家。");
|
||||
}
|
||||
|
||||
ShopStoreSameCityTransportBase transportBase = getShopStoreSameCityTransportBaseById(storeId, isPlatform ? CommonConstant.Enable : CommonConstant.Disable2);
|
||||
// 获取店铺商家的基础运费设置记录
|
||||
ShopStoreSameCityTransportBase transportBase = getShopStoreSameCityTransportBaseById(storeId, CommonConstant.Disable2);
|
||||
if (transportBase == null) {
|
||||
logger.error("{}同城配送费计算:无法获取基础运费设置记录。", storeName);
|
||||
if (canThrow) {
|
||||
@ -767,8 +755,8 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
|
||||
}
|
||||
|
||||
logger.debug(storeName + "下单时,根据商家运费设置规则减免{}元运费", reduceDeliveryFee);
|
||||
logger.debug(storeName + "下单时,不符合规则的:\n {}\n符合规则的:{}", JSONUtil.toJsonStr(noPassed), JSONUtil.toJsonStr(passed));
|
||||
// logger.debug(storeName + "下单时,根据商家运费设置规则减免{}元运费", reduceDeliveryFee);
|
||||
// logger.debug(storeName + "下单时,不符合规则的:\n {}\n符合规则的:{}", JSONUtil.toJsonStr(noPassed), JSONUtil.toJsonStr(passed));
|
||||
boolean canDelivery = true;
|
||||
if (passed.size() == 0 && noPassed.size() > 0) {
|
||||
// 没有一个满足起送距离和起送金额的规则订单
|
||||
@ -889,171 +877,162 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
||||
*/
|
||||
@Override
|
||||
public Integer computeSameCityInnerDeliveryFee(Integer storeId, String orderLongitude, String orderLatitude, Integer orderWeightGram, BigDecimal orderProductAmount, BigDecimal orderDiscountAmount, BigDecimal orderPayAmount) {
|
||||
SameCityDeliveryFeeRespDTO sameCityDeliveryFeeRespDTO = computeSameCityTransportFee(Convert.toLong(storeId), orderLongitude, orderLatitude, orderWeightGram, orderProductAmount, orderDiscountAmount, orderPayAmount, true, false);
|
||||
if (sameCityDeliveryFeeRespDTO == null
|
||||
|| sameCityDeliveryFeeRespDTO.getDeliveryFee() == null
|
||||
|| sameCityDeliveryFeeRespDTO.getDeliveryFee().compareTo(BigDecimal.ZERO) <= 0) {
|
||||
// 参数校验
|
||||
if (storeId == null || orderLongitude == null || orderLatitude == null || storeId <= 0) {
|
||||
logger.warn("同城配送缺少必要参数,无法计算配送费。");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return sameCityDeliveryFeeRespDTO.getDeliveryFee().multiply(new BigDecimal(100)).intValue();
|
||||
// 获取店铺基本信息
|
||||
ShopStoreBase storeBase = shopStoreBaseService.get(storeId);
|
||||
if (storeBase == null) {
|
||||
logger.warn("同城配送缺少店铺基本信息,无法计算配送费。");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 参数校验
|
||||
// if (storeId == null || orderLongitude == null || orderLatitude == null || storeId <= 0) {
|
||||
// logger.warn("同城配送缺少必要参数,无法计算配送费。");
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // 获取店铺基本信息
|
||||
// ShopStoreBase storeBase = shopStoreBaseService.get(storeId);
|
||||
// if (storeBase == null) {
|
||||
// logger.warn("同城配送缺少店铺基本信息,无法计算配送费。");
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// String storeName = storeBase.getStore_name();
|
||||
// String storeLng = storeBase.getStore_longitude();
|
||||
// String storeLat = storeBase.getStore_latitude();
|
||||
// if (StrUtil.isBlank(storeLng) || StrUtil.isBlank(storeLat)) {
|
||||
// logger.warn("无法获取{}的具体位置,请联系商家。", storeName);
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // 获取平台的基础运费设置记录
|
||||
// ShopStoreSameCityTransportBase transportBase = getShopStoreSameCityTransportBaseById(Convert.toLong(storeId), CommonConstant.Enable);
|
||||
// if (transportBase == null) {
|
||||
// logger.warn("商家{}尚未完成同城配送设置,无法计算配送费。", storeName);
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // 设置默认值
|
||||
// if (transportBase.getDistance_base() == null) {
|
||||
// transportBase.setDistance_base(0);
|
||||
// }
|
||||
// if (transportBase.getWeight_base() == null) {
|
||||
// transportBase.setWeight_base(0);
|
||||
// }
|
||||
// if (transportBase.getDelivery_base_fee() == null) {
|
||||
// transportBase.setDelivery_base_fee(BigDecimal.ZERO);
|
||||
// }
|
||||
//
|
||||
// // 计算两点的距离(单位米)
|
||||
// Double distanceD = PositionUtil.getDistance1(Convert.toDouble(storeLng), Convert.toDouble(storeLat), Convert.toDouble(orderLongitude), Convert.toDouble(orderLatitude));
|
||||
// Integer distance = (distanceD != null) ? distanceD.intValue() : 0;
|
||||
//
|
||||
// // 基础配送费计算
|
||||
// BigDecimal deliveryBaseFee = Convert.toBigDecimal(transportBase.getDelivery_base_fee(), BigDecimal.ZERO);
|
||||
//
|
||||
// // 获取运费配送范围信息
|
||||
// List<ShopStoreSameCityTransport> transportList = shopStoreSameCityTransportService.selectShopStoreSameCityTransportList(Convert.toLong(storeId));
|
||||
//
|
||||
// if (CollUtil.isEmpty(transportList)) {
|
||||
// // 没有配送范围规则的时候,直接以基础配送费来配送
|
||||
// return deliveryBaseFee.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
// }
|
||||
//
|
||||
// // 判断配送范围和起送金额条件
|
||||
// String canNotDeliveryReason = "";
|
||||
// boolean canDelivery = false;
|
||||
//
|
||||
// // 优先处理距离和金额都满足的规则
|
||||
// for (ShopStoreSameCityTransport transport : transportList) {
|
||||
// // 判断订单距离是否在配送范围内
|
||||
// if (transport.getMax_delivery_radius() >= distance) {
|
||||
// // 距离在配送范围内,判断金额是否符合起配金额额度
|
||||
// boolean moneyPassed = false;
|
||||
// if (CommonConstant.Delivery_Amount_Comput_Type_Original.equals(transport.getMin_delivery_amount_type())) {
|
||||
// moneyPassed = orderProductAmount != null && transport.getMin_delivery_amount().compareTo(orderProductAmount) <= 0;
|
||||
// } else if (CommonConstant.Delivery_Amount_Comput_Type_Discounted.equals(transport.getMin_delivery_amount_type())) {
|
||||
// moneyPassed = orderDiscountAmount != null && transport.getMin_delivery_amount().compareTo(orderDiscountAmount) <= 0;
|
||||
// } else if (CommonConstant.Delivery_Amount_Comput_Type_Payment.equals(transport.getMin_delivery_amount_type())) {
|
||||
// moneyPassed = orderPayAmount != null && transport.getMin_delivery_amount().compareTo(orderPayAmount) <= 0;
|
||||
// }
|
||||
//
|
||||
// // 距离和金额都满足条件
|
||||
// if (moneyPassed) {
|
||||
// canDelivery = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 如果没有找到完全满足条件的规则,再详细检查找出失败原因
|
||||
// if (!canDelivery) {
|
||||
// for (ShopStoreSameCityTransport transport : transportList) {
|
||||
// // 判断订单距离是否在配送范围内
|
||||
// if (transport.getMax_delivery_radius() < distance) {
|
||||
// // 记录距离不满足的原因
|
||||
// canNotDeliveryReason = storeName + "的订单不在配送范围内,订单无法配送。";
|
||||
// } else {
|
||||
// // 距离在配送范围内,判断金额是否符合起配金额额度
|
||||
// if (CommonConstant.Delivery_Amount_Comput_Type_Original.equals(transport.getMin_delivery_amount_type())) {
|
||||
// if (orderProductAmount != null && transport.getMin_delivery_amount().compareTo(orderProductAmount) > 0) {
|
||||
// BigDecimal diffMoney = transport.getMin_delivery_amount().subtract(orderProductAmount);
|
||||
// canNotDeliveryReason = String.format("%s商品原价金额还差%.2f元,才满足配送条件,请检查订单。", storeName, diffMoney);
|
||||
// } else {
|
||||
// canDelivery = true;
|
||||
// break;
|
||||
// }
|
||||
// } else if (CommonConstant.Delivery_Amount_Comput_Type_Discounted.equals(transport.getMin_delivery_amount_type())) {
|
||||
// if (orderDiscountAmount != null && transport.getMin_delivery_amount().compareTo(orderDiscountAmount) > 0) {
|
||||
// BigDecimal diffMoney = transport.getMin_delivery_amount().subtract(orderDiscountAmount);
|
||||
// canNotDeliveryReason = String.format("%s订单折后金额还差%.2f元,才满足配送条件,请检查订单。", storeName, diffMoney);
|
||||
// } else {
|
||||
// canDelivery = true;
|
||||
// break;
|
||||
// }
|
||||
// } else if (CommonConstant.Delivery_Amount_Comput_Type_Payment.equals(transport.getMin_delivery_amount_type())) {
|
||||
// if (orderPayAmount != null && transport.getMin_delivery_amount().compareTo(orderPayAmount) > 0) {
|
||||
// BigDecimal diffMoney = transport.getMin_delivery_amount().subtract(orderPayAmount);
|
||||
// canNotDeliveryReason = String.format("%s订单应支付金额还差%.2f元,才满足配送条件,请检查订单。", storeName, diffMoney);
|
||||
// } else {
|
||||
// canDelivery = true;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 如果仍然不能配送,记录日志并返回0
|
||||
// if (!canDelivery) {
|
||||
// logger.warn(canNotDeliveryReason.isEmpty() ? (storeName + "订单不在配送范围内或未达起送金额,请检查!") : canNotDeliveryReason);
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// // 额外配送费计算
|
||||
// // 每增加一个距离累加运费
|
||||
// if (transportBase.getDistance_increase_km() != null && transportBase.getDistance_increase_fee() != null && distance > transportBase.getDistance_base() * 1000) {
|
||||
// // 实际配送距离超出基础距离,单位km
|
||||
// BigDecimal diffDistanceM = CommonUtil.DecimalRoundHalfUp(BigDecimal.valueOf(distance - transportBase.getDistance_base() * 1000).divide(BigDecimal.valueOf(1000)));
|
||||
// // 倍数
|
||||
// BigDecimal times = BigDecimal.ZERO;
|
||||
// if (transportBase.getDistance_increase_km() > 0 && diffDistanceM.intValue() > transportBase.getDistance_increase_km()) {
|
||||
// // 末尾非零进位,比如:2.1将是3, 2.0将是2,2.001将是3
|
||||
// times = NumberUtil.div(diffDistanceM, transportBase.getDistance_increase_km()).setScale(0, RoundingMode.UP);
|
||||
// }
|
||||
//
|
||||
// // 超过基础运费距离后,累加上运费
|
||||
// deliveryBaseFee = deliveryBaseFee.add(transportBase.getDistance_increase_fee().multiply(times));
|
||||
// }
|
||||
//
|
||||
// // 每增加一个重量累加运费(重量暂时忽略,配置的时候设置0)
|
||||
// if (transportBase.getWeight_increase_kg() != null && transportBase.getWeight_increase_fee() != null && orderWeightGram != null && orderWeightGram > transportBase.getWeight_base() * 1000) {
|
||||
// // 实际配送重量超出基础重量,单位kg
|
||||
// BigDecimal diffWeightKg = CommonUtil.DecimalRoundHalfUp(BigDecimal.valueOf(orderWeightGram - transportBase.getWeight_base() * 1000).divide(BigDecimal.valueOf(1000)));
|
||||
// // 倍数
|
||||
// BigDecimal times = BigDecimal.ZERO;
|
||||
// if (transportBase.getWeight_increase_kg() > 0 && diffWeightKg.intValue() > transportBase.getWeight_increase_kg()) {
|
||||
// // 末尾非零进位,比如:2.1将是3, 2.0将是2,2.001将是3
|
||||
// times = NumberUtil.div(diffWeightKg, transportBase.getWeight_increase_kg()).setScale(0, RoundingMode.UP);
|
||||
// }
|
||||
//
|
||||
// deliveryBaseFee = deliveryBaseFee.add(transportBase.getWeight_increase_fee().multiply(times));
|
||||
// }
|
||||
//
|
||||
// // 返回单位为分的配送费
|
||||
// return deliveryBaseFee.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
String storeName = storeBase.getStore_name();
|
||||
String storeLng = storeBase.getStore_longitude();
|
||||
String storeLat = storeBase.getStore_latitude();
|
||||
if (StrUtil.isBlank(storeLng) || StrUtil.isBlank(storeLat)) {
|
||||
logger.warn("无法获取{}的具体位置,请联系商家。", storeName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 获取平台的基础运费设置记录
|
||||
ShopStoreSameCityTransportBase transportBase = getShopStoreSameCityTransportBaseById(Convert.toLong(storeId), CommonConstant.Enable);
|
||||
if (transportBase == null) {
|
||||
logger.warn("商家{}尚未完成同城配送设置,无法计算配送费。", storeName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 设置默认值
|
||||
if (transportBase.getDistance_base() == null) {
|
||||
transportBase.setDistance_base(0);
|
||||
}
|
||||
if (transportBase.getWeight_base() == null) {
|
||||
transportBase.setWeight_base(0);
|
||||
}
|
||||
if (transportBase.getDelivery_base_fee() == null) {
|
||||
transportBase.setDelivery_base_fee(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
// 计算两点的距离(单位米)
|
||||
Double distanceD = PositionUtil.getDistance1(Convert.toDouble(storeLng), Convert.toDouble(storeLat), Convert.toDouble(orderLongitude), Convert.toDouble(orderLatitude));
|
||||
Integer distance = (distanceD != null) ? distanceD.intValue() : 0;
|
||||
|
||||
// 基础配送费计算
|
||||
BigDecimal deliveryBaseFee = Convert.toBigDecimal(transportBase.getDelivery_base_fee(), BigDecimal.ZERO);
|
||||
|
||||
// 获取运费配送范围信息
|
||||
List<ShopStoreSameCityTransport> transportList = shopStoreSameCityTransportService.selectShopStoreSameCityTransportList(Convert.toLong(storeId));
|
||||
|
||||
if (CollUtil.isEmpty(transportList)) {
|
||||
// 没有配送范围规则的时候,直接以基础配送费来配送
|
||||
return deliveryBaseFee.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
|
||||
// 判断配送范围和起送金额条件
|
||||
String canNotDeliveryReason = "";
|
||||
boolean canDelivery = false;
|
||||
|
||||
// 优先处理距离和金额都满足的规则
|
||||
for (ShopStoreSameCityTransport transport : transportList) {
|
||||
// 判断订单距离是否在配送范围内
|
||||
if (transport.getMax_delivery_radius() >= distance) {
|
||||
// 距离在配送范围内,判断金额是否符合起配金额额度
|
||||
boolean moneyPassed = false;
|
||||
if (CommonConstant.Delivery_Amount_Comput_Type_Original.equals(transport.getMin_delivery_amount_type())) {
|
||||
moneyPassed = orderProductAmount != null && transport.getMin_delivery_amount().compareTo(orderProductAmount) <= 0;
|
||||
} else if (CommonConstant.Delivery_Amount_Comput_Type_Discounted.equals(transport.getMin_delivery_amount_type())) {
|
||||
moneyPassed = orderDiscountAmount != null && transport.getMin_delivery_amount().compareTo(orderDiscountAmount) <= 0;
|
||||
} else if (CommonConstant.Delivery_Amount_Comput_Type_Payment.equals(transport.getMin_delivery_amount_type())) {
|
||||
moneyPassed = orderPayAmount != null && transport.getMin_delivery_amount().compareTo(orderPayAmount) <= 0;
|
||||
}
|
||||
|
||||
// 距离和金额都满足条件
|
||||
if (moneyPassed) {
|
||||
canDelivery = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有找到完全满足条件的规则,再详细检查找出失败原因
|
||||
if (!canDelivery) {
|
||||
for (ShopStoreSameCityTransport transport : transportList) {
|
||||
// 判断订单距离是否在配送范围内
|
||||
if (transport.getMax_delivery_radius() < distance) {
|
||||
// 记录距离不满足的原因
|
||||
canNotDeliveryReason = storeName + "的订单不在配送范围内,订单无法配送。";
|
||||
} else {
|
||||
// 距离在配送范围内,判断金额是否符合起配金额额度
|
||||
if (CommonConstant.Delivery_Amount_Comput_Type_Original.equals(transport.getMin_delivery_amount_type())) {
|
||||
if (orderProductAmount != null && transport.getMin_delivery_amount().compareTo(orderProductAmount) > 0) {
|
||||
BigDecimal diffMoney = transport.getMin_delivery_amount().subtract(orderProductAmount);
|
||||
canNotDeliveryReason = String.format("%s商品原价金额还差%.2f元,才满足配送条件,请检查订单。", storeName, diffMoney);
|
||||
} else {
|
||||
canDelivery = true;
|
||||
break;
|
||||
}
|
||||
} else if (CommonConstant.Delivery_Amount_Comput_Type_Discounted.equals(transport.getMin_delivery_amount_type())) {
|
||||
if (orderDiscountAmount != null && transport.getMin_delivery_amount().compareTo(orderDiscountAmount) > 0) {
|
||||
BigDecimal diffMoney = transport.getMin_delivery_amount().subtract(orderDiscountAmount);
|
||||
canNotDeliveryReason = String.format("%s订单折后金额还差%.2f元,才满足配送条件,请检查订单。", storeName, diffMoney);
|
||||
} else {
|
||||
canDelivery = true;
|
||||
break;
|
||||
}
|
||||
} else if (CommonConstant.Delivery_Amount_Comput_Type_Payment.equals(transport.getMin_delivery_amount_type())) {
|
||||
if (orderPayAmount != null && transport.getMin_delivery_amount().compareTo(orderPayAmount) > 0) {
|
||||
BigDecimal diffMoney = transport.getMin_delivery_amount().subtract(orderPayAmount);
|
||||
canNotDeliveryReason = String.format("%s订单应支付金额还差%.2f元,才满足配送条件,请检查订单。", storeName, diffMoney);
|
||||
} else {
|
||||
canDelivery = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果仍然不能配送,记录日志并返回0
|
||||
if (!canDelivery) {
|
||||
logger.warn(canNotDeliveryReason.isEmpty() ? (storeName + "订单不在配送范围内或未达起送金额,请检查!") : canNotDeliveryReason);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 额外配送费计算
|
||||
// 每增加一个距离累加运费
|
||||
if (transportBase.getDistance_increase_km() != null && transportBase.getDistance_increase_fee() != null && distance > transportBase.getDistance_base() * 1000) {
|
||||
// 实际配送距离超出基础距离,单位km
|
||||
BigDecimal diffDistanceM = CommonUtil.DecimalRoundHalfUp(BigDecimal.valueOf(distance - transportBase.getDistance_base() * 1000).divide(BigDecimal.valueOf(1000)));
|
||||
// 倍数
|
||||
BigDecimal times = BigDecimal.ZERO;
|
||||
if (transportBase.getDistance_increase_km() > 0 && diffDistanceM.intValue() > transportBase.getDistance_increase_km()) {
|
||||
// 末尾非零进位,比如:2.1将是3, 2.0将是2,2.001将是3
|
||||
times = NumberUtil.div(diffDistanceM, transportBase.getDistance_increase_km()).setScale(0, RoundingMode.UP);
|
||||
}
|
||||
|
||||
// 超过基础运费距离后,累加上运费
|
||||
deliveryBaseFee = deliveryBaseFee.add(transportBase.getDistance_increase_fee().multiply(times));
|
||||
}
|
||||
|
||||
// 每增加一个重量累加运费(重量暂时忽略,配置的时候设置0)
|
||||
if (transportBase.getWeight_increase_kg() != null && transportBase.getWeight_increase_fee() != null && orderWeightGram != null && orderWeightGram > transportBase.getWeight_base() * 1000) {
|
||||
// 实际配送重量超出基础重量,单位kg
|
||||
BigDecimal diffWeightKg = CommonUtil.DecimalRoundHalfUp(BigDecimal.valueOf(orderWeightGram - transportBase.getWeight_base() * 1000).divide(BigDecimal.valueOf(1000)));
|
||||
// 倍数
|
||||
BigDecimal times = BigDecimal.ZERO;
|
||||
if (transportBase.getWeight_increase_kg() > 0 && diffWeightKg.intValue() > transportBase.getWeight_increase_kg()) {
|
||||
// 末尾非零进位,比如:2.1将是3, 2.0将是2,2.001将是3
|
||||
times = NumberUtil.div(diffWeightKg, transportBase.getWeight_increase_kg()).setScale(0, RoundingMode.UP); // 修正:应该除以weight_increase_kg而不是distance_increase_km
|
||||
}
|
||||
|
||||
deliveryBaseFee = deliveryBaseFee.add(transportBase.getWeight_increase_fee().multiply(times));
|
||||
}
|
||||
|
||||
// 返回单位为分的配送费
|
||||
return deliveryBaseFee.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,6 @@ package com.suisung.mall.shop.store.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.suisung.mall.common.api.CommonResult;
|
||||
@ -46,16 +45,13 @@ public class ShopStoreSameCityTransportServiceImpl extends BaseServiceImpl<ShopS
|
||||
public CommonResult deleteShopStoreSameCityTransport(Long transportId) {
|
||||
// 判断有没有权限
|
||||
UserDto user = getCurrentUser();
|
||||
if (user == null || !user.isStore() || !user.isPlatform()) {
|
||||
if (user == null || !user.isStore()) {
|
||||
return CommonResult.failed("无权限操作!");
|
||||
}
|
||||
|
||||
Long storeId = 0L;
|
||||
if (user.isPlatform()) {
|
||||
storeId = Convert.toLong(user.getStore_id());
|
||||
}
|
||||
Long storeId = Convert.toLong(user.getStore_id());
|
||||
|
||||
if (transportId == null || transportId <= 0) {
|
||||
if (transportId == null || transportId <= 0 || storeId == null || storeId <= 0) {
|
||||
return CommonResult.failed("缺少必要参数");
|
||||
}
|
||||
|
||||
@ -212,16 +208,14 @@ public class ShopStoreSameCityTransportServiceImpl extends BaseServiceImpl<ShopS
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteShopStoreSameCityTransport(Long transportId, Long storeId) {
|
||||
if (transportId == null || transportId == null || transportId <= 0) {
|
||||
logger.error("缺少 transportId 必要参数!");
|
||||
if (transportId == null || transportId == null || transportId <= 0 || storeId == null || storeId <= 0) {
|
||||
logger.error("缺少 transportId 或 storeId 必要参数!");
|
||||
return false;
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<ShopStoreSameCityTransport> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopStoreSameCityTransport::getTransport_id, transportId);
|
||||
if (storeId != null && storeId > 0) {
|
||||
queryWrapper.eq(ShopStoreSameCityTransport::getStore_id, storeId);
|
||||
}
|
||||
QueryWrapper<ShopStoreSameCityTransport> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("transport_id", transportId);
|
||||
queryWrapper.eq("store_id", storeId);
|
||||
|
||||
ShopStoreSameCityTransport record = getOne(queryWrapper);
|
||||
if (record == null) {
|
||||
|
||||
@ -92,7 +92,7 @@ public class ShopStoreSfOrderServiceImpl extends BaseServiceImpl<ShopStoreSfOrde
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean saveShopStoreSfOrder(ShopStoreSfOrder record) {
|
||||
public Boolean insertShopStoreSfOrder(ShopStoreSfOrder record) {
|
||||
if (record == null) {
|
||||
logger.info("参数空值,保存失败!");
|
||||
return false;
|
||||
@ -103,13 +103,6 @@ public class ShopStoreSfOrderServiceImpl extends BaseServiceImpl<ShopStoreSfOrde
|
||||
return false;
|
||||
}
|
||||
|
||||
ShopStoreSfOrder shopStoreSfOrder = getByShopOrderId(record.getShop_order_id());
|
||||
if (shopStoreSfOrder != null) {
|
||||
logger.warn("该商家订单已存在,进行更新操作:{}", record);
|
||||
record.setId(shopStoreSfOrder.getId());
|
||||
return updateById(record);
|
||||
}
|
||||
|
||||
return save(record);
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import com.suisung.mall.common.api.ResultCode;
|
||||
import com.suisung.mall.common.api.StateCode;
|
||||
import com.suisung.mall.common.constant.CommonConstant;
|
||||
import com.suisung.mall.common.domain.UserDto;
|
||||
import com.suisung.mall.common.enums.DicEnum;
|
||||
import com.suisung.mall.common.exception.ApiException;
|
||||
import com.suisung.mall.common.exception.ApiUserException;
|
||||
import com.suisung.mall.common.feignService.AccountService;
|
||||
@ -51,6 +52,7 @@ import com.suisung.mall.shop.product.pojo.vo.FixOrderVo;
|
||||
import com.suisung.mall.shop.product.pojo.vo.ProductVo;
|
||||
import com.suisung.mall.shop.product.service.*;
|
||||
import com.suisung.mall.shop.store.service.*;
|
||||
import com.suisung.mall.shop.sync.keymanage.RedisKey;
|
||||
import com.suisung.mall.shop.user.mapper.ShopUserCartMapper;
|
||||
import com.suisung.mall.shop.user.service.ShopUserCartService;
|
||||
import com.suisung.mall.shop.user.service.ShopUserDeliveryAddressService;
|
||||
@ -277,15 +279,15 @@ public class ShopUserCartServiceImpl extends BaseServiceImpl<ShopUserCartMapper,
|
||||
|
||||
if (ObjectUtil.equal(cart.getUser_id(), user_id)) {
|
||||
cart.setCart_quantity(cart_quantity);
|
||||
int i = 0;
|
||||
while (i < 3) {
|
||||
boolean result = edit(cart);
|
||||
int i=0;
|
||||
while (i<3){
|
||||
boolean result=edit(cart);
|
||||
if (!result) {
|
||||
i++;
|
||||
if (i == 3) {
|
||||
if(i==3){
|
||||
throw new ApiException(ResultCode.FAILED);
|
||||
}
|
||||
} else {
|
||||
}else {
|
||||
logger.info("重试成功,跳出");
|
||||
break;
|
||||
}
|
||||
@ -2667,7 +2669,7 @@ public class ShopUserCartServiceImpl extends BaseServiceImpl<ShopUserCartMapper,
|
||||
BigDecimal orderPaymentAmount = Convert.toBigDecimal(store_row.get("order_money_select_items"));
|
||||
|
||||
// 同城配送运费检查和计算(只返回数据,不能配送不抛异常)
|
||||
SameCityDeliveryFeeRespDTO sameCityDeliveryFeeResp = shopStoreSameCityTransportBaseService.computeSameCityTransportFee(storeId, orderLng, orderLat, 0, productMoneyOriginGoods, orderSelDiscountAmount, orderPaymentAmount, false, canThrow);
|
||||
SameCityDeliveryFeeRespDTO sameCityDeliveryFeeResp = shopStoreSameCityTransportBaseService.computeSameCityTransportFee(storeId, orderLng, orderLat, 0, productMoneyOriginGoods, orderSelDiscountAmount, orderPaymentAmount, canThrow);
|
||||
|
||||
// 是否能配送(在配送范围内)
|
||||
Boolean canDelivery = sameCityDeliveryFeeResp.getCanDelivery();
|
||||
@ -3154,26 +3156,20 @@ public class ShopUserCartServiceImpl extends BaseServiceImpl<ShopUserCartMapper,
|
||||
// logger.info("店铺ID为{},同城配送,收取打包费{}元", storeId, packingFee);
|
||||
|
||||
// 如果打包费为空或小于等于0,直接返回0
|
||||
if (CheckUtil.isEmpty(packingFee)) {
|
||||
if (packingFee == null || packingFee.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
// deliveryTypeId = deliveryTypeId == null ? StateCode.DELIVERY_TYPE_SAME_CITY : deliveryTypeId;
|
||||
deliveryTypeId = deliveryTypeId == null ? StateCode.DELIVERY_TYPE_SAME_CITY : deliveryTypeId;
|
||||
|
||||
// 只有同城配送才收取打包费
|
||||
// if (Boolean.FALSE.equals(isVirtualOrder)
|
||||
// && deliveryTypeId != null && (deliveryTypeId.intValue() == StateCode.DELIVERY_TYPE_SAME_CITY)
|
||||
// || deliveryTypeId.intValue() == StateCode.DELIVERY_TYPE_IN_STORE_SERVICE) {
|
||||
// logger.debug("店铺ID,同城配送,符合收取打包费{}元", storeId, packingFee);
|
||||
// return packingFee;
|
||||
// }
|
||||
|
||||
if (Boolean.FALSE.equals(isVirtualOrder)) {
|
||||
if (Boolean.FALSE.equals(isVirtualOrder)
|
||||
&& deliveryTypeId != null && deliveryTypeId.intValue() == StateCode.DELIVERY_TYPE_SAME_CITY) {
|
||||
logger.debug("店铺ID,同城配送,符合收取打包费{}元", storeId, packingFee);
|
||||
return packingFee;
|
||||
}
|
||||
|
||||
// 虚拟商品不收取打包费
|
||||
// 非同城配送不收取打包费
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ public class WxURLSchemeServiceImpl implements WxURLSchemeService {
|
||||
public CommonResult generateCommonWxUrlScheme() {
|
||||
// 常量定义
|
||||
final String REDIS_KEY = "rdsCommonWxUrlScheme";
|
||||
final long EXPIRE_DAYS = 365;
|
||||
final long EXPIRE_DAYS = 30;
|
||||
|
||||
// === 第一阶段:尝试从Redis获取缓存 ===
|
||||
Object cachedScheme = redisService.get(REDIS_KEY);
|
||||
@ -85,7 +85,7 @@ public class WxURLSchemeServiceImpl implements WxURLSchemeService {
|
||||
requestBody.put("jump_wxa", jumpWxa);
|
||||
requestBody.put("is_expire", true);
|
||||
requestBody.put("expire_type", 0);
|
||||
long expireSeconds = TimeUnit.DAYS.toSeconds(EXPIRE_DAYS);
|
||||
long expireSeconds = TimeUnit.DAYS.toSeconds(EXPIRE_DAYS); // 30天有效期
|
||||
requestBody.put("expire_time", System.currentTimeMillis() / 1000 + expireSeconds);
|
||||
|
||||
// === 第三阶段:调用微信API ===
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
store_biz_state, store_biz_opening_date, ringtone_is_enable, shop_parent_id, store_2nd_category_id,
|
||||
store_category_id, store_state_id, store_time, store_end_time, product_category_ids, store_o2o_tags,
|
||||
store_o2o_flag, store_o2o_merchant_id, store_circle, subsite_id, lkl_merchant_no, lkl_term_no, wx_qrcode,
|
||||
split_ratio, packing_fee,parent_id,created_at, updated_at
|
||||
split_ratio, packing_fee, created_at, updated_at
|
||||
</sql>
|
||||
|
||||
<select id="statisticState" resultType="java.util.Map">
|
||||
|
||||
@ -1 +1 @@
|
||||
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAI4dPEw5wEGxH9aN+5WwFazEDvhomT/FWX0yHQRMdL0CTi8dy0hIN1sdNEbBmcOKc6dw2XHQCVQS3hfFFvpmnUqLJi32RbMhzxYz8Li9zN45eNKhiUfm/LupucHeTm3axGfOT3dfi0uhgq9LHk7ku12Pe+JIYdDu8RMCNeLJ7/AJAgMBAAECgYBAJSgLS+HghN9XC50sMl+GLLSJIUVSyHQdE1qPjyb+DSVXFP6lcJsz0BnBei86WKrdQA2V1o3vWdjPJ9G4UkraJ3hz2elzEeYok+MpLiPRicUd9RNHTVp9YqTzFyAsuranMxwt07tQaZBGc0T6hiGEsSHShwA+FfLGmz0TacR7hQJBAMOjlnP6zEzjUiW0BoZDnLHR6B5EpVVwhN7gS1B0HZtkGOjuoMz8z/GBbKLniGUtoRTDqFE4MJe7iA7237DZvscCQQC59gcIU4ezoonbDvMPbr4GMCgjP2eVrXUD02qGLJlQ45Wla6FpFZvQH5Wno5qRjdU9+Kjwms4lTTLVPHHfh0qvAkEAj2O9CDCPwOLz+JJkHdA8btBskpK5o0+e80Ptr4ALmzLYVxFfZh79wgKcPyH4BEBXScLGARFv/CYE6QLknNhbTQJAZ+F5+DrBOaX4oHhvaxWP7WEFavtGYCSvk12MyjsrwjYAKJJBbrR1gAPE1Arek6TJlH7N0OqJcej4FopXimjHXQJBAIS5nqeJPd3J7ath+uge+itkQUJnrTDHe4Feinmenuh6YLcwVJwuGqtUqxUUW/6TCrxdlMdiFmBjBjr7lkhlnuc=
|
||||
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw==
|
||||
@ -1 +1 @@
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCOHTxMOcBBsR/WjfuVsBWsxA74aJk/xVl9Mh0ETHS9Ak4vHctISDdbHTRGwZnDinOncNlx0AlUEt4XxRb6Zp1KiyYt9kWzIc8WM/C4vczeOXjSoYlH5vy7qbnB3k5t2sRnzk93X4tLoYKvSx5O5Ltdj3viSGHQ7vETAjXiye/wCQIDAQAB
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB
|
||||
12
pom.xml
12
pom.xml
@ -324,10 +324,10 @@
|
||||
<sentinel.transport.dashboard>114.132.210.208:8718</sentinel.transport.dashboard>
|
||||
<!-- mysql配置 -->
|
||||
<mysql.host>114.132.210.208</mysql.host>
|
||||
<mysql.port>13307</mysql.port>
|
||||
<mysql.port>3306</mysql.port>
|
||||
<mysql.db>mall_dev</mysql.db>
|
||||
<mysql.user>web_dev</mysql.user>
|
||||
<mysql.pwd>bbWHo1th]g25</mysql.pwd>
|
||||
<mysql.pwd>Abc654321$^</mysql.pwd>
|
||||
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
||||
<!-- <mysql.host>127.0.0.1</mysql.host>-->
|
||||
<!-- <mysql.port>3306</mysql.port>-->
|
||||
@ -383,10 +383,10 @@
|
||||
<sentinel.transport.dashboard>114.132.210.208:8718</sentinel.transport.dashboard>
|
||||
<!-- mysql配置 -->
|
||||
<mysql.host>114.132.210.208</mysql.host>
|
||||
<mysql.port>13307</mysql.port>
|
||||
<mysql.port>3306</mysql.port>
|
||||
<mysql.db>mall_dev</mysql.db>
|
||||
<mysql.user>web_dev</mysql.user>
|
||||
<mysql.pwd>bbWHo1th]g25</mysql.pwd>
|
||||
<mysql.pwd>Abc654321$^</mysql.pwd>
|
||||
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
||||
<!-- redis配置 -->
|
||||
<redis.host>114.132.210.208</redis.host>
|
||||
@ -436,10 +436,10 @@
|
||||
<sentinel.transport.dashboard>10.1.8.3:8718</sentinel.transport.dashboard>
|
||||
<!-- mysql配置 -->
|
||||
<mysql.host>114.132.210.208</mysql.host>
|
||||
<mysql.port>13307</mysql.port>
|
||||
<mysql.port>3306</mysql.port>
|
||||
<mysql.db>mall_dev</mysql.db>
|
||||
<mysql.user>web_dev</mysql.user>
|
||||
<mysql.pwd>bbWHo1th]g25</mysql.pwd>
|
||||
<mysql.pwd>Abc654321$^</mysql.pwd>
|
||||
<mysql.driver>com.mysql.cj.jdbc.Driver</mysql.driver>
|
||||
<!-- redis配置 -->
|
||||
<redis.host>10.1.8.3</redis.host>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user