From 6279dd8d7f14b72487d46c135f204e84b00ea360 Mon Sep 17 00:00:00 2001 From: jiangqs <jiangqs> Date: 星期四, 04 五月 2023 09:29:36 +0800 Subject: [PATCH] 小程序初步完成 --- ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/conslole/ConfigController.java | 2 +- ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/SysTagServiceImpl.java | 10 ++++++++++ ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java | 10 +++++----- ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/sys/SysUserController.java | 5 +++++ ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/SysTagService.java | 6 ++++++ ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteConfigFallbackFactory.java | 3 ++- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteConfigFallbackFactory.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteConfigFallbackFactory.java index 2b7d11e..24cb941 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteConfigFallbackFactory.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteConfigFallbackFactory.java @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestBody; /** * 系统配置服务 @@ -28,7 +29,7 @@ { @Override - public R<SysTag> getSysTag(Long sysTagId) { + public R<SysTag> getSysTag(@RequestBody Long sysTagId) { return R.fail("获取系统标签失败:" + throwable.getMessage()); } }; diff --git a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java index 85710a6..7b74d13 100644 --- a/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java +++ b/ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java @@ -51,8 +51,8 @@ @Resource private ShopCertificateService shopCertificateService; - /*@Resource - private RemoteConfigService configService;*/ + @Resource + private RemoteConfigService configService; @Resource private RemoteUserService sysUserService; @@ -138,12 +138,12 @@ for(String str : shopTagIdArray){ shopRelTag = new ShopRelTag(); tagid = Long.valueOf(str); - //sysTag = configService.getSysTag(tagid).getData(); + sysTag = configService.getSysTag(tagid).getData(); shopRelTag.setDelFlag(0); shopRelTag.setShopId(shop.getShopId()); shopRelTag.setTagId(tagid); shopRelTagService.save(shopRelTag); - //shopTagSj.add(sysTag.getTagName()); + shopTagSj.add(sysTag.getTagName()); } shop.setShopTags(shopTagSj.toString()); this.saveOrUpdate(shop); @@ -303,7 +303,7 @@ StringJoiner shopTagSj = new StringJoiner(","); for(String str : shopTagIdArray){ tagId = Long.valueOf(str); - sysTag = sysUserService.getSysTag(tagId).getData(); + sysTag = configService.getSysTag(tagId).getData(); shopRelTag = new ShopRelTag(); shopRelTag.setDelFlag(0); shopRelTag.setShopId(shopId); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/conslole/ConfigController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/conslole/ConfigController.java index 4b1ec1b..76c2ab3 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/conslole/ConfigController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/conslole/ConfigController.java @@ -27,7 +27,7 @@ @PostMapping("/getSysTag") public R<SysTag> getSysTag(@RequestBody Long sysTagId) { - SysTag sysTag = sysTagService.getById(sysTagId); + SysTag sysTag = sysTagService.getByTagId(sysTagId); return R.ok(sysTag); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/sys/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/sys/SysUserController.java index bfe3cf6..6bd54b0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/sys/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/sys/SysUserController.java @@ -12,10 +12,12 @@ import com.ruoyi.common.security.annotation.RequiresPermissions; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.system.api.domain.dto.AppEditUserDto; +import com.ruoyi.system.api.domain.poji.config.SysTag; import com.ruoyi.system.api.domain.poji.sys.SysDept; import com.ruoyi.system.api.domain.poji.sys.SysRole; import com.ruoyi.system.api.domain.poji.sys.SysUser; import com.ruoyi.system.api.model.LoginUser; +import com.ruoyi.system.service.config.SysTagService; import com.ruoyi.system.service.sys.*; import org.apache.commons.lang3.ArrayUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @@ -56,6 +59,8 @@ @Autowired private ISysConfigService configService; + + /** * 获取用户列表 */ diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/SysTagService.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/SysTagService.java index ae70e65..50a845b 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/SysTagService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/config/SysTagService.java @@ -13,4 +13,10 @@ */ public interface SysTagService extends IService<SysTag> { + /** + * + * @param tagId + * @return + */ + SysTag getByTagId(Long tagId); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/SysTagServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/SysTagServiceImpl.java index 9e46a03..b146f5a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/SysTagServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/config/SysTagServiceImpl.java @@ -17,4 +17,14 @@ @Service public class SysTagServiceImpl extends ServiceImpl<SysTagMapper, SysTag> implements SysTagService { + + /** + * + * @param tagId + * @return + */ + @Override + public SysTag getByTagId(Long tagId){ + return this.getById(tagId); + } } -- Gitblit v1.7.1