提交 | 用户 | 时间
|
7fd198
|
1 |
package com.iailab.module.model.mcs.pre.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
5c6007
|
4 |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7fd198
|
5 |
import com.iailab.module.model.mcs.pre.dao.MmItemOutputDao; |
5c6007
|
6 |
import com.iailab.module.model.mcs.pre.dto.MmItemOutputDTO; |
7fd198
|
7 |
import com.iailab.module.model.mcs.pre.entity.MmItemOutputEntity; |
潘 |
8 |
import com.iailab.module.model.mcs.pre.service.MmItemOutputService; |
|
9 |
import com.iailab.module.model.mdk.vo.MmItemOutputVO; |
5c6007
|
10 |
import org.springframework.beans.factory.annotation.Autowired; |
7fd198
|
11 |
import org.springframework.stereotype.Service; |
潘 |
12 |
import org.springframework.transaction.annotation.Transactional; |
|
13 |
import org.springframework.util.CollectionUtils; |
|
14 |
|
|
15 |
import java.util.List; |
|
16 |
import java.util.Map; |
|
17 |
import java.util.UUID; |
|
18 |
|
|
19 |
/** |
|
20 |
* @author PanZhibao |
|
21 |
* @date 2021年04月27日 9:22 |
|
22 |
*/ |
5c6007
|
23 |
@Service |
L |
24 |
public class MmItemOutputServiceImpl extends ServiceImpl<MmItemOutputDao, MmItemOutputEntity> implements MmItemOutputService { |
7fd198
|
25 |
|
5c6007
|
26 |
@Autowired |
L |
27 |
private MmItemOutputDao mmItemOutputDao; |
|
28 |
|
7fd198
|
29 |
@Override |
潘 |
30 |
@Transactional(rollbackFor = Exception.class) |
|
31 |
public void saveMmItemOutput(MmItemOutputEntity mmItemOutput) { |
|
32 |
mmItemOutput.setId(UUID.randomUUID().toString()); |
5c6007
|
33 |
mmItemOutputDao.insert(mmItemOutput); |
7fd198
|
34 |
} |
潘 |
35 |
|
|
36 |
@Override |
|
37 |
@Transactional(rollbackFor = Exception.class) |
|
38 |
public void update(MmItemOutputEntity mmItemOutput) { |
5c6007
|
39 |
mmItemOutputDao.updateById(mmItemOutput); |
7fd198
|
40 |
} |
潘 |
41 |
|
|
42 |
public void deleteBatch(String[] itemIds) { |
5c6007
|
43 |
QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper(); |
7fd198
|
44 |
queryWrapper.in("itemid", itemIds); |
5c6007
|
45 |
mmItemOutputDao.delete(queryWrapper); |
7fd198
|
46 |
} |
潘 |
47 |
|
|
48 |
@Override |
|
49 |
public MmItemOutputEntity getByItemid(String itemid) { |
5c6007
|
50 |
QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper(); |
7fd198
|
51 |
queryWrapper.eq("itemid", itemid); |
5c6007
|
52 |
List<MmItemOutputEntity> list = mmItemOutputDao.selectList(queryWrapper); |
7fd198
|
53 |
if (CollectionUtils.isEmpty(list)) { |
潘 |
54 |
return new MmItemOutputEntity(); |
|
55 |
} |
|
56 |
return list.get(0); |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public List<MmItemOutputDTO> queryList(Map<String, Object> params) { |
5c6007
|
61 |
return mmItemOutputDao.queryList(params); |
7fd198
|
62 |
} |
潘 |
63 |
|
|
64 |
@Override |
|
65 |
public MmItemOutputVO getOutPutById(String outputid) { |
5c6007
|
66 |
List<MmItemOutputVO> list = mmItemOutputDao.getOutPutById(outputid); |
7fd198
|
67 |
if (CollectionUtils.isEmpty(list)) { |
潘 |
68 |
return null; |
|
69 |
} |
|
70 |
return list.get(0); |
|
71 |
} |
|
72 |
|
|
73 |
@Override |
|
74 |
public List<MmItemOutputVO> getOutPutByItemId(String itemid) { |
5c6007
|
75 |
return mmItemOutputDao.getOutPutByItemId(itemid); |
7fd198
|
76 |
} |
潘 |
77 |
|
|
78 |
@Override |
|
79 |
public List<MmItemOutputVO> getOutPutByPointId(String pointid) { |
5c6007
|
80 |
return mmItemOutputDao.getOutPutByPointId(pointid); |
7fd198
|
81 |
} |
潘 |
82 |
} |