From d6b81d600ab6671e532ed77ed6fb00678e5b864b Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期五, 18 八月 2023 14:40:01 +0800
Subject: [PATCH] 志愿者活动增加经纬度字段
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsConfigServiceImpl.java | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 51 insertions(+), 1 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsConfigServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsConfigServiceImpl.java
index d6718bd..6ed72b0 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsConfigServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsConfigServiceImpl.java
@@ -1,10 +1,20 @@
package com.panzhihua.service_community.service.impl;
+import static java.util.Objects.nonNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO;
import com.panzhihua.service_community.dao.McsConfigDAO;
import com.panzhihua.service_community.entity.McsConfig;
import com.panzhihua.service_community.service.McsConfigService;
-import org.springframework.stereotype.Service;
/**
* (McsConfig)表服务实现类
@@ -15,4 +25,44 @@
@Service("mcsConfigService")
public class McsConfigServiceImpl extends ServiceImpl<McsConfigDAO, McsConfig> implements McsConfigService {
+ /**
+ * 获取所有数字商业街配置
+ * @return
+ */
+ @Override
+ public R getAllMcsConfig() {
+ List<McsConfig> mcsConfigs = this.baseMapper.selectList(null);
+ List<McsConfigVO> configList = new ArrayList<>();
+ if (!mcsConfigs.isEmpty()) {
+ mcsConfigs.forEach(e -> {
+ McsConfigVO configVO = new McsConfigVO();
+ BeanUtils.copyProperties(e, configVO);
+ configList.add(configVO);
+ });
+ }
+ return R.ok(configList);
+ }
+
+ /**
+ * 修改数字商业街配置
+ * @param configs
+ * @return
+ */
+ @Override
+ public R putMcsConfig(List<McsConfigVO> configs) {
+ if (nonNull(configs) && !configs.isEmpty()) {
+ List<McsConfig> mcsConfigs = new ArrayList<>();
+ configs.forEach(e -> {
+ McsConfig mcsConfig = this.baseMapper.selectOne(new QueryWrapper<McsConfig>().lambda().eq(McsConfig::getKey, e.getKey()));
+ if (nonNull(mcsConfig)) {
+ mcsConfig.setValue(e.getValue());
+ mcsConfigs.add(mcsConfig);
+ }
+ });
+ if (!mcsConfigs.isEmpty()) {
+ this.updateBatchById(mcsConfigs);
+ }
+ }
+ return R.ok();
+ }
}
--
Gitblit v1.7.1