Pārlūkot izejas kodu

feat(system):时间段改为Json后的冲突修改

wzq 1 nedēļu atpakaļ
vecāks
revīzija
7e5f9191de

+ 36 - 38
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppSitePlaceServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.exception.JeecgBootException;
@@ -19,11 +20,8 @@ import org.jeecg.modules.system.app.mapper.AppSiteMapper;
 import org.jeecg.modules.system.app.mapper.AppSitePlaceMapper;
 import org.jeecg.modules.system.app.mapper.AppSitePriceRulesMapper;
 import org.jeecg.modules.system.app.service.IAppSitePlaceService;
-import org.jeecg.modules.system.app.utils.TimeRangeFinder;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
@@ -63,41 +61,41 @@ public class AppSitePlaceServiceImpl extends ServiceImpl<AppSitePlaceMapper, App
         appSitePlace.setTenantId(site.getTenantId());
         appSitePlace.setSiteId(site.getId());
         appSitePlace.setType(SitePlaceTypeEnum.SCHOOL.getCode());
-        //时间段提取拼接
-        List<AppSiteRuleDTO> siteRuleDTOS = placeDTO.getSiteRuleDTOS();
-
-        List<String> teachingDay = new ArrayList<>();
-        List<String> noTeachingDay = new ArrayList<>();
-        if (!siteRuleDTOS.isEmpty()) {
-            siteRuleDTOS.forEach(dto -> {
-                if (dto.getIsTeaching() == 0) {
-                    teachingDay.add(dto.getStartTime() + "-" + dto.getEndTime());
-                } else {
-                    noTeachingDay.add(dto.getStartTime() + "-" + dto.getEndTime());
-                }
-            });
-        }
-        site.setTeachingDay(String.join(",", teachingDay));
-        site.setNoTeachingDay(String.join(",", noTeachingDay));
-        int updateById = appSiteMapper.updateById(site);
-        if (updateById < 1) {
-            throw new JeecgBootException("学校补充信息更新失败");
-        }
-        int insert = baseMapper.insert(appSitePlace);
-        if (insert < 1) {
-            throw new JeecgBootException("学校场所信息保存失败");
-        }
-        siteRuleDTOS.forEach(rule -> {
-            AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
-            BeanUtils.copyProperties(rule, appSitePriceRules);
-            appSitePriceRules.setSitePlaceId(appSitePlace.getId());
-            appSitePriceRules.setOrgCode(appSitePlace.getOrgCode());
-            appSitePriceRules.setTenantId(appSitePlace.getTenantId());
-            int savePriceResult = appSitePriceRulesMapper.insert(appSitePriceRules);
-            if (savePriceResult < 1) {
-                throw new JeecgBootException("场所价格规则保存失败", SC_INTERNAL_SERVER_ERROR_500);
-            }
-        });
+//        //时间段提取拼接
+//        List<AppSiteRuleDTO> siteRuleDTOS = placeDTO.getSiteRuleDTOS();
+//
+//        List<String> teachingDay = new ArrayList<>();
+//        List<String> noTeachingDay = new ArrayList<>();
+//        if (!siteRuleDTOS.isEmpty()) {
+//            siteRuleDTOS.forEach(dto -> {
+//                if (dto.getIsTeaching() == 0) {
+//                    teachingDay.add(dto.getStartTime() + "-" + dto.getEndTime());
+//                } else {
+//                    noTeachingDay.add(dto.getStartTime() + "-" + dto.getEndTime());
+//                }
+//            });
+//        }
+//        site.setTeachingDay(String.join(",", teachingDay));
+//        site.setNoTeachingDay(String.join(",", noTeachingDay));
+//        int updateById = appSiteMapper.updateById(site);
+//        if (updateById < 1) {
+//            throw new JeecgBootException("学校补充信息更新失败");
+//        }
+//        int insert = baseMapper.insert(appSitePlace);
+//        if (insert < 1) {
+//            throw new JeecgBootException("学校场所信息保存失败");
+//        }
+//        siteRuleDTOS.forEach(rule -> {
+//            AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
+//            BeanUtils.copyProperties(rule, appSitePriceRules);
+//            appSitePriceRules.setSitePlaceId(appSitePlace.getId());
+//            appSitePriceRules.setOrgCode(appSitePlace.getOrgCode());
+//            appSitePriceRules.setTenantId(appSitePlace.getTenantId());
+//            int savePriceResult = appSitePriceRulesMapper.insert(appSitePriceRules);
+//            if (savePriceResult < 1) {
+//                throw new JeecgBootException("场所价格规则保存失败", SC_INTERNAL_SERVER_ERROR_500);
+//            }
+//        });
 
         return Boolean.TRUE;
     }