提交 | 用户 | 时间
|
0255ea
|
1 |
package com.iailab.module.model.mpk.service.impl; |
D |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
587b43
|
5 |
import com.iailab.framework.common.util.object.ConvertUtils; |
0255ea
|
6 |
import com.iailab.module.model.mpk.dao.MethodSettingDao; |
587b43
|
7 |
import com.iailab.module.model.mpk.dto.MethodSettingDTO; |
0255ea
|
8 |
import com.iailab.module.model.mpk.entity.MethodSettingEntity; |
587b43
|
9 |
import com.iailab.module.model.mpk.entity.SettingSelectEntity; |
0255ea
|
10 |
import com.iailab.module.model.mpk.service.MethodSettingService; |
587b43
|
11 |
import com.iailab.module.model.mpk.service.SettingSelectService; |
0255ea
|
12 |
import lombok.extern.slf4j.Slf4j; |
D |
13 |
import org.apache.commons.lang3.StringUtils; |
587b43
|
14 |
import org.springframework.beans.factory.annotation.Autowired; |
0255ea
|
15 |
import org.springframework.stereotype.Service; |
587b43
|
16 |
import org.springframework.util.CollectionUtils; |
0255ea
|
17 |
|
587b43
|
18 |
import java.util.List; |
0255ea
|
19 |
import java.util.Map; |
587b43
|
20 |
import java.util.UUID; |
0255ea
|
21 |
|
D |
22 |
/** |
|
23 |
* @description: |
|
24 |
* @author: dzd |
|
25 |
* @date: 2024/9/14 15:12 |
|
26 |
**/ |
|
27 |
@Slf4j |
|
28 |
@Service |
|
29 |
public class MethodSettingServiceImpl extends BaseServiceImpl<MethodSettingDao, MethodSettingEntity> implements MethodSettingService { |
587b43
|
30 |
@Autowired |
D |
31 |
private SettingSelectService settingSelectService; |
|
32 |
|
|
33 |
@Override |
|
34 |
public void insertList(List<MethodSettingDTO> list, String MethodId) { |
|
35 |
List<MethodSettingEntity> entityList = ConvertUtils.sourceToTarget(list, MethodSettingEntity.class); |
|
36 |
for(int i = 0; i < entityList.size(); i++){ |
|
37 |
MethodSettingEntity entity = entityList.get(i); |
|
38 |
entity.setId(UUID.randomUUID().toString()); |
|
39 |
entity.setMethodId(MethodId); |
|
40 |
entity.setSort(i); |
|
41 |
baseDao.insert(entity); |
|
42 |
if (!CollectionUtils.isEmpty(list.get(i).getSettingSelects())) { |
|
43 |
settingSelectService.insertList(list.get(i).getSettingSelects(), entity.getId()); |
|
44 |
} |
|
45 |
} |
|
46 |
} |
0255ea
|
47 |
} |