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