提交 | 用户 | 时间
|
8c1646
|
1 |
package com.iailab.module.data.plan.item.service.impl; |
潘 |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.iailab.framework.common.pojo.PageResult; |
|
5 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
6 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
7 |
import com.iailab.module.data.plan.item.dao.PlanItemDao; |
|
8 |
import com.iailab.module.data.plan.item.entity.PlanItemEntity; |
|
9 |
import com.iailab.module.data.plan.item.service.PlanItemService; |
ed4f78
|
10 |
import com.iailab.module.data.plan.item.vo.PlanItemDataVO; |
8c1646
|
11 |
import com.iailab.module.data.plan.item.vo.PlanItemPageReqVO; |
潘 |
12 |
import com.iailab.module.data.plan.item.vo.PlanItemSaveReqVO; |
c96e44
|
13 |
import com.iailab.module.data.common.enums.IncreaseCodeEnum; |
潘 |
14 |
import com.iailab.module.data.point.service.DaSequenceNumService; |
|
15 |
import org.springframework.beans.factory.annotation.Autowired; |
8c1646
|
16 |
import org.springframework.stereotype.Service; |
潘 |
17 |
|
ed4f78
|
18 |
import java.util.*; |
8c1646
|
19 |
|
潘 |
20 |
/** |
|
21 |
* @author PanZhibao |
|
22 |
* @Description |
|
23 |
* @createTime 2024年11月01日 |
|
24 |
*/ |
|
25 |
@Service |
|
26 |
public class PlanItemServiceImpl extends BaseServiceImpl<PlanItemDao, PlanItemEntity> implements PlanItemService { |
c96e44
|
27 |
|
潘 |
28 |
@Autowired |
|
29 |
private DaSequenceNumService daSequenceNumService; |
8c1646
|
30 |
|
潘 |
31 |
@Override |
|
32 |
public PageResult<PlanItemEntity> page(PlanItemPageReqVO reqVO) { |
|
33 |
return baseDao.selectPage(reqVO); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public List<PlanItemEntity> list() { |
|
38 |
QueryWrapper<PlanItemEntity> queryWrapper = new QueryWrapper<>(); |
|
39 |
queryWrapper.orderByDesc("create_time"); |
|
40 |
return baseDao.selectList(queryWrapper); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
public void create(PlanItemSaveReqVO createReqVO) { |
|
45 |
PlanItemEntity entity = BeanUtils.toBean(createReqVO, PlanItemEntity.class); |
|
46 |
entity.setId(UUID.randomUUID().toString()); |
c96e44
|
47 |
entity.setItemNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.PLAN.name())); |
8c1646
|
48 |
entity.setCreateTime(new Date()); |
潘 |
49 |
baseDao.insert(entity); |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void update(PlanItemSaveReqVO updateReqVO) { |
|
54 |
PlanItemEntity entity = BeanUtils.toBean(updateReqVO, PlanItemEntity.class); |
|
55 |
entity.setUpdateTime(new Date()); |
|
56 |
baseDao.updateById(entity); |
|
57 |
} |
|
58 |
|
|
59 |
@Override |
|
60 |
public PlanItemEntity get(String id) { |
|
61 |
return baseDao.selectById(id); |
|
62 |
} |
|
63 |
|
|
64 |
@Override |
|
65 |
public PlanItemEntity getInfoByNo(String no) { |
|
66 |
QueryWrapper<PlanItemEntity> queryWrapper = new QueryWrapper<>(); |
|
67 |
queryWrapper.eq("item_no", no); |
|
68 |
return baseDao.selectOne(queryWrapper); |
|
69 |
} |
|
70 |
|
|
71 |
@Override |
|
72 |
public void delete(String id) { |
|
73 |
baseDao.deleteById(id); |
|
74 |
} |
ed4f78
|
75 |
|
潘 |
76 |
@Override |
|
77 |
public List<PlanItemDataVO> getSourceValue(Map<String, Object> params) { |
|
78 |
return baseDao.getSourceValue(params); |
|
79 |
} |
8c1646
|
80 |
} |