From a874b928e16320839315b9abcdf2cece1229a424 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期四, 07 十一月 2024 09:20:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java index 1010171..3951a35 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mpk/service/impl/MethodSettingServiceImpl.java @@ -2,14 +2,22 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.service.impl.BaseServiceImpl; +import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.model.mpk.dao.MethodSettingDao; +import com.iailab.module.model.mpk.dto.MethodSettingDTO; import com.iailab.module.model.mpk.entity.MethodSettingEntity; +import com.iailab.module.model.mpk.entity.SettingSelectEntity; import com.iailab.module.model.mpk.service.MethodSettingService; +import com.iailab.module.model.mpk.service.SettingSelectService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.List; import java.util.Map; +import java.util.UUID; /** * @description: @@ -19,4 +27,21 @@ @Slf4j @Service public class MethodSettingServiceImpl extends BaseServiceImpl<MethodSettingDao, MethodSettingEntity> implements MethodSettingService { + @Autowired + private SettingSelectService settingSelectService; + + @Override + public void insertList(List<MethodSettingDTO> list, String MethodId) { + List<MethodSettingEntity> entityList = ConvertUtils.sourceToTarget(list, MethodSettingEntity.class); + for(int i = 0; i < entityList.size(); i++){ + MethodSettingEntity entity = entityList.get(i); + entity.setId(UUID.randomUUID().toString()); + entity.setMethodId(MethodId); + entity.setSort(i); + baseDao.insert(entity); + if (!CollectionUtils.isEmpty(list.get(i).getSettingSelects())) { + settingSelectService.insertList(list.get(i).getSettingSelects(), entity.getId()); + } + } + } } \ No newline at end of file -- Gitblit v1.9.3