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