From 0a206f3acb9af0ec9db650861d34a256cda1c960 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 26 二月 2026 17:48:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java | 58 ++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java
index c31ca94..e09e475 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java
@@ -154,10 +154,18 @@
shop.setPassword(Utils.Secure.encryptPassword(shop.getPassword(), salt));
shop.setSalt(salt);
shopMapper.insert(shop);
+ //鍒嗕韩鐮�
String url = inviteRecordService.createShopMiniProgramCode(shop.getId());
if(StringUtils.isNotBlank(url)){
shopMapper.update(null,new UpdateWrapper<Shop>().lambda()
.set(Shop::getProgramCode,url)
+ .eq(Shop::getId,shop.getId()));
+ }
+ //鍒嗕韩娴锋姤
+ String posterUrl = inviteRecordService.createShareImg(Constants.ONE,shop.getId(),shop.getPosterImg());
+ if(StringUtils.isNotBlank(posterUrl)){
+ shopMapper.update(null,new UpdateWrapper<Shop>().lambda()
+ .set(Shop::getPosterImgCode,posterUrl)
.eq(Shop::getId,shop.getId()));
}
return shop.getId();
@@ -238,7 +246,7 @@
@Override
@Transactional
- public void updateById(Shop shop) {
+ public void updateById(Shop shop) throws Exception {
LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
if(shop.getId()==null ){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage());
@@ -251,6 +259,20 @@
shop.setEditor(user.getId());
shop.setEditDate(new Date());
+ if(StringUtils.isBlank(model.getProgramCode())){
+ //鍒嗕韩鐮�
+ String url = inviteRecordService.createShopMiniProgramCode(shop.getId());
+ if(StringUtils.isNotBlank(url)){
+ shop.setProgramCode(url);
+ }
+ }
+ if(StringUtils.isNotBlank(shop.getPosterImg())){
+ //鍒嗕韩娴锋姤
+ String posterUrl = inviteRecordService.createShareImg(Constants.ONE,shop.getId(),shop.getPosterImg());
+ if(StringUtils.isNotBlank(posterUrl)){
+ shop.setPosterImgCode(posterUrl);
+ }
+ }
shopMapper.updateById(shop);
if(shop.getSaleType() !=null && !Constants.equalsInteger(shop.getSaleType(),model.getSaleType())){
//濡傛灉閿�鍞ā寮忓彂鐢熺紪鐮侊紝璁板綍鍙樻洿璁板綍
@@ -277,15 +299,15 @@
}
- @Override
- public void updateByIdInBatch(List<Shop> shops) {
- if (CollectionUtils.isEmpty(shops)) {
- return;
- }
- for (Shop shop: shops) {
- this.updateById(shop);
- }
- }
+// @Override
+// public void updateByIdInBatch(List<Shop> shops) {
+// if (CollectionUtils.isEmpty(shops)) {
+// return;
+// }
+// for (Shop shop: shops) {
+// this.updateById(shop);
+// }
+// }
@Transactional(rollbackFor = {Exception.class,BusinessException.class})
@Override
@@ -679,20 +701,20 @@
&& StringUtils.isNotBlank(dto.getLgt())){
isArea = true;
}
-
- List<Shop> shopList = shopJoinMapper.selectList(new MPJLambdaWrapper<Shop>()
+ List<Shop> shopList = shopJoinMapper.selectJoinList(Shop.class,new MPJLambdaWrapper<Shop>()
.selectAll(Shop.class)
- .select(" CONVERT( ST_Distance_Sphere ( POINT ( LONGITUDE, LATITUDE ), POINT ( "+dto.getLgt()+", "+dto.getLat()+" )) /1000,DECIMAL(15,2))",Shop::getDistance)
- .leftJoin(Areas.class,Areas::getId,Shop::getAreaId)
- .eq(Objects.nonNull(dto.getCityId()),Areas::getParentId,dto.getCityId())
- .like(Objects.nonNull(dto.getShopName()),Shop::getName,dto.getShopName())
+ .select(" CONVERT( ST_Distance_Sphere ( POINT ( LONGITUDE, LATITUDE ), POINT ( '"+dto.getLgt()+"' , '"+dto.getLat()+"' )) /1000,DECIMAL(15,2))",Shop::getDistance)
+ .leftJoin(SystemUser.class,SystemUser::getId,Shop::getCreator)
+ .like(StringUtils.isNotBlank(dto.getCityName()),Shop::getAddr,dto.getCityName())
+ .like(StringUtils.isNotBlank(dto.getShopName()),Shop::getName,dto.getShopName())
.orderByDesc(!isArea,Shop::getId)
- .orderByAsc(isArea,Shop::getDistance)
+ .orderByAsc(isArea," distance ")
);
String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
+ systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode();
for(Shop model:shopList){
- model.setImgFullUrl(path+model.getImgurl());
+
+ model.setImgFullUrl(StringUtils.isNotBlank(model.getImgurl())?path+model.getImgurl():null);
}
return shopList;
--
Gitblit v1.9.3