提交 | 用户 | 时间
|
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; |
8b3ee3
|
5 |
import com.iailab.framework.common.util.object.ConvertUtils; |
0255ea
|
6 |
import com.iailab.module.model.mpk.dao.SettingSelectDao; |
8b3ee3
|
7 |
import com.iailab.module.model.mpk.dto.MethodSettingDTO; |
587b43
|
8 |
import com.iailab.module.model.mpk.dto.SettingSelectDTO; |
8b3ee3
|
9 |
import com.iailab.module.model.mpk.entity.ModelMethodEntity; |
0255ea
|
10 |
import com.iailab.module.model.mpk.entity.SettingSelectEntity; |
D |
11 |
import com.iailab.module.model.mpk.service.SettingSelectService; |
|
12 |
import lombok.extern.slf4j.Slf4j; |
|
13 |
import org.apache.commons.lang3.StringUtils; |
|
14 |
import org.springframework.stereotype.Service; |
|
15 |
|
8b3ee3
|
16 |
import java.util.List; |
0255ea
|
17 |
import java.util.Map; |
8b3ee3
|
18 |
import java.util.UUID; |
0255ea
|
19 |
|
D |
20 |
/** |
|
21 |
* @description: |
|
22 |
* @author: dzd |
|
23 |
* @date: 2024/9/14 15:13 |
|
24 |
**/ |
|
25 |
@Slf4j |
|
26 |
@Service |
|
27 |
public class SettingSelectServiceImpl extends BaseServiceImpl<SettingSelectDao, SettingSelectEntity> implements SettingSelectService { |
|
28 |
|
|
29 |
|
|
30 |
@Override |
|
31 |
public void deleteByMap(Map<String, Object> map) { |
|
32 |
baseDao.delete(getWrapper(map)); |
|
33 |
} |
|
34 |
|
|
35 |
private QueryWrapper<SettingSelectEntity> getWrapper(Map<String, Object> params) { |
|
36 |
String settingId = (String) params.get("settingId"); |
|
37 |
|
|
38 |
QueryWrapper<SettingSelectEntity> wrapper = new QueryWrapper<>(); |
|
39 |
wrapper.eq(StringUtils.isNotBlank(settingId), "setting_id", settingId); |
|
40 |
|
|
41 |
return wrapper; |
|
42 |
} |
8b3ee3
|
43 |
|
潘 |
44 |
@Override |
587b43
|
45 |
public void insertList(List<SettingSelectDTO> list, String settingId) { |
8b3ee3
|
46 |
List<SettingSelectEntity> entityList = ConvertUtils.sourceToTarget(list, SettingSelectEntity.class); |
潘 |
47 |
for(int i = 0; i < entityList.size(); i++){ |
|
48 |
SettingSelectEntity entity = entityList.get(i); |
|
49 |
entity.setId(UUID.randomUUID().toString()); |
|
50 |
entity.setSettingId(settingId); |
|
51 |
entity.setSort(i); |
|
52 |
baseDao.insert(entity); |
|
53 |
} |
|
54 |
|
|
55 |
} |
0255ea
|
56 |
} |