From 2acc40db4dd14c3d27ea1645f2b5833969e5c1cb Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期一, 20 四月 2026 19:56:33 +0800
Subject: [PATCH] 代码生成
---
server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java | 46 ++++++++++++++++++++++++++++++----------------
1 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
index bf5a84a..cd636c8 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
@@ -236,11 +236,9 @@
@Override
@Transactional(rollbackFor = Exception.class)
- public void applyShop(ShopApplyDTO request, Member member) {
- Integer memberId = member.getId();
+ public void applyShop(ShopApplyDTO request) {
+ Member member = memberMapper.selectById(request.getMemberId());
- // 1. 鏍¢獙闂ㄥ簵鎵嬫満鍙峰敮涓�鎬э紙shop_info.telephone锛�
- checkTelephoneUnique(request.getTelephone(), null);
// 2. 鏍规嵁绫诲瀷鏍¢獙闄勪欢
if (Constants.equalsInteger(request.getCompanyType(), Constants.ZERO)) {
@@ -275,7 +273,7 @@
// 3. 鏌ヨ璇ヤ細鍛樻槸鍚﹀凡鏈夐棬搴楄褰�
QueryWrapper<ShopInfo> existQw = new QueryWrapper<>();
existQw.lambda()
- .eq(ShopInfo::getRegionMemberId, memberId)
+ .eq(ShopInfo::getRegionMemberId, member.getId())
.eq(ShopInfo::getDeleted, Constants.ZERO)
.last("limit 1");
ShopInfo existing = shopInfoMapper.selectOne(existQw);
@@ -315,15 +313,17 @@
existing.setPassword(encryptedPassword);
existing.setSalt(salt);
existing.setAliAccount(request.getAliAccount());
- existing.setAuditStatus(Constants.ZERO);
+ existing.setAliName(request.getAliName());
existing.setUpdateTime(now);
- existing.setUpdateUser(memberId);
existing.setAuditRemark(null);
existing.setAuditTime(null);
existing.setAuditUserId(null);
+ existing.setAuditStatus(Constants.ZERO);
shopInfoMapper.updateById(existing);
shopId = existing.getId();
} else {
+ // 1. 鏍¢獙闂ㄥ簵鎵嬫満鍙峰敮涓�鎬э紙shop_info.telephone锛�
+ checkTelephoneUnique(request.getTelephone(), null);
// 鏂板缓
ShopInfo shopInfo = new ShopInfo();
shopInfo.setCompanyType(request.getCompanyType());
@@ -345,14 +345,12 @@
shopInfo.setPassword(encryptedPassword);
shopInfo.setSalt(salt);
shopInfo.setAliAccount(request.getAliAccount());
- shopInfo.setOpenid(member.getOpenid());
- shopInfo.setAuditStatus(Constants.ZERO);
+ shopInfo.setAliName(request.getAliName());
shopInfo.setStatus(Constants.ZERO);
shopInfo.setDeleted(Constants.ZERO);
shopInfo.setCreateTime(now);
shopInfo.setUpdateTime(now);
- shopInfo.setCreateUser(memberId);
- shopInfo.setRegionMemberId(memberId);
+ shopInfo.setRegionMemberId(member.getId());
shopInfoMapper.insert(shopInfo);
shopId = shopInfo.getId();
}
@@ -554,6 +552,8 @@
shopInfo.setLegalPersonName(request.getLegalPersonName());
shopInfo.setLegalPersonPhone(request.getLegalPersonPhone());
shopInfo.setLegalPersonCard(request.getLegalPersonCard());
+ shopInfo.setAliAccount(request.getAliAccount());
+ shopInfo.setAliName(request.getAliName());
shopInfo.setUpdateTime(now);
shopInfoMapper.updateById(shopInfo);
@@ -657,12 +657,15 @@
vo.setPayStatus(shopInfo.getPayStatus());
vo.setScore(shopInfo.getScore());
vo.setCreateTime(shopInfo.getCreateTime());
+ vo.setAliAccount(shopInfo.getAliAccount());
+ vo.setAliName(shopInfo.getAliName());
+ vo.setDepositAmount(shopInfo.getDepositAmount());
// 鎷兼帴鍥剧墖鍓嶇紑
String imgPrefix = "";
try {
imgPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
- + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.SHOP_FILES).getCode();
+ + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILES).getCode();
} catch (Exception e) {
// 鏈厤缃椂蹇界暐
}
@@ -720,7 +723,7 @@
String memberPrefix = "";
try {
memberPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
- + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.MEMBER_FILES).getCode();
+ + systemDictDataBiz.queryByCode(Constants.OSS, Constants.MEMBER_FILES).getCode();
} catch (Exception e) {
// 鏈厤缃椂蹇界暐
}
@@ -761,6 +764,12 @@
qw.lambda().like(ShopInfo::getName, dto.getName());
}
+ // 鍩庡競绛涢�夛紙areaId鏄尯鍘匡紝闇�鍖归厤鍏秔arentId绛変簬鍩庡競ID锛�
+ if (dto.getCityId() != null) {
+ qw.inSql("AREA_ID",
+ "SELECT id FROM areas WHERE parent_id = " + dto.getCityId() + " AND isdeleted = 0");
+ }
+
// 璺濈绛涢�夛紙鍗曚綅锛氱背 鈫� 杞崲涓簁m姣旇緝锛�
if (distanceMeter != null && distanceMeter > 0) {
double maxKm = distanceMeter / 1000.0;
@@ -793,6 +802,8 @@
vo.setShopHours(shop.getShopHours());
vo.setAddress(shop.getAddress());
vo.setScore(shop.getScore());
+ vo.setLatitude(shop.getLatitude());
+ vo.setLongitude(shop.getLongitude());
// 闂ㄥご鐓х涓�寮�
vo.setCoverImg(getFirstImage(shop.getId(), Constants.FileType.STORE_FRONT.getKey(), imgPrefix));
// 璺濈
@@ -823,6 +834,10 @@
vo.setName(shop.getName());
vo.setAddress(shop.getAddress());
vo.setContent(shop.getContent());
+ vo.setDepositTypes(shop.getDepositTypes());
+ vo.setFeeStandard(shop.getFeeStandard());
+ vo.setLatitude(shop.getLatitude());
+ vo.setLongitude(shop.getLongitude());
// 闂ㄥご鐓� + 鍐呴儴鐓� 鍏ㄨ矾寰勯泦鍚�
String imgPrefix = getShopPrefix();
@@ -911,7 +926,7 @@
private String getShopPrefix() {
try {
return systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
- + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.SHOP_FILES).getCode();
+ + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILES).getCode();
} catch (Exception e) {
return "";
}
@@ -965,7 +980,7 @@
vo.setCoverImg(shop.getCoverImg());
if (StringUtils.isNotBlank(shop.getCoverImg())) {
String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
- + systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.SHOP_FILES).getCode();
+ + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILES).getCode();
vo.setFullCoverImg(path + shop.getCoverImg());
}
vo.setHasMessage(false);
@@ -1055,7 +1070,6 @@
if (shop == null) {
return null;
}
-
// 鍒涘缓token锛坓enerateTokenForRedis 宸茶嚜鍔ㄦ竻闄よ鐢ㄦ埛鏃oken锛屼繚璇佸敮涓�鏈夋晥锛�
String token = JwtTokenUtil.generateTokenForRedis(shop.getId(), Constants.TWO, JSONObject.toJSONString(shop), redisTemplate);
--
Gitblit v1.9.3