CeDo
2021-05-26 32e138c5a0afe37a27e23131698eb90707cbae98
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package com.panzhihua.service_grid.service.impl;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.grid.EventApplicationAppReleaseAddDTO;
import com.panzhihua.common.model.dtos.grid.EventApplicationAppReleaseDeleteDTO;
import com.panzhihua.common.model.dtos.grid.EventApplicationAppReleaseEditDTO;
import com.panzhihua.common.model.dtos.grid.PageEventApplicationAppReleaseDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.EventApplicationAppReleaseDetailsVO;
import com.panzhihua.common.model.vos.grid.EventApplicationAppReleaseVO;
import com.panzhihua.service_grid.dao.*;
import com.panzhihua.service_grid.model.dos.*;
import com.panzhihua.service_grid.service.EventApplicationAppReleaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.BeanUtils;
 
import javax.annotation.Resource;
import java.util.Date;
 
/**
 * @auther lyq
 * @create 2021-04-14 15:03:01
 * @describe 订单表服务实现类
 */
@Slf4j
@Service
public class EventApplicationAppReleaseServiceImpl extends ServiceImpl<EventApplicationAppReleaseMapper, EventApplicationAppReleaseDO> implements EventApplicationAppReleaseService {
 
    @Resource
    private EventApplicationAppReleaseMapper eventApplicationAppReleaseMapper;
    /**
     * 新增APP应用版本信息
     * @param eventApplicationAppReleaseAddDTO
     * @return 新增结果
     */
    public R add(EventApplicationAppReleaseAddDTO eventApplicationAppReleaseAddDTO){
        EventApplicationAppReleaseDO eventApplicationAppReleaseDO = new EventApplicationAppReleaseDO();
        BeanUtils.copyProperties(eventApplicationAppReleaseAddDTO, eventApplicationAppReleaseDO);
        eventApplicationAppReleaseDO.setCreateAt(new Date());
        if(eventApplicationAppReleaseMapper.insert(eventApplicationAppReleaseDO)>0){
            return R.ok();
        }
        return R.fail();
    }
 
    /**
     * 修改APP应用版本信息
     * @param eventApplicationAppReleaseEditDTO
     * @return 维护结果
     */
    public R edit(EventApplicationAppReleaseEditDTO eventApplicationAppReleaseEditDTO){
        EventApplicationAppReleaseDO eventApplicationAppReleaseDO = new EventApplicationAppReleaseDO();
        BeanUtils.copyProperties(eventApplicationAppReleaseEditDTO, eventApplicationAppReleaseDO);
        //eventApplicationAppReleaseDO.setUpdateAt(new Date());
        if(eventApplicationAppReleaseMapper.updateById(eventApplicationAppReleaseDO)>0){
            return R.ok();
        }
        return R.fail();
    }
 
    /**
     * 分页查找APP应用版本信息
     * @param pageEventApplicationAppReleaseDTO
     * @return 维护结果
     */
    public R<IPage<EventApplicationAppReleaseVO>> query(PageEventApplicationAppReleaseDTO pageEventApplicationAppReleaseDTO){
        Page page = new Page(1,10);
        if(pageEventApplicationAppReleaseDTO.getPageNum()!=null) {
            page.setCurrent(pageEventApplicationAppReleaseDTO.getPageNum());
        }
        if(pageEventApplicationAppReleaseDTO.getPageSize()!=null) {
            page.setSize(pageEventApplicationAppReleaseDTO.getPageSize());
        }
        return R.ok(eventApplicationAppReleaseMapper.findByPage(page, pageEventApplicationAppReleaseDTO));
    }
 
    /**
     * 删除APP应用版本信息
     * @param EventApplicationAppReleaseDeleteDTO
     * @return 平台用户信息
     */
    public R delete(EventApplicationAppReleaseDeleteDTO EventApplicationAppReleaseDeleteDTO){
        return R.fail();
    }
 
    /**
     * 查询APP应用版本信息详细信息
     * @param id APP应用版本信息 id
     * @return 查找结果
     */
    public R<EventApplicationAppReleaseDetailsVO> eventApplicationAppReleaseDetails(Long id){
        EventApplicationAppReleaseDO eventApplicationAppReleaseDO = eventApplicationAppReleaseMapper.selectById(id);
        if(eventApplicationAppReleaseDO!=null) {
            EventApplicationAppReleaseDetailsVO eventApplicationAppReleaseDetailsVO = new EventApplicationAppReleaseDetailsVO();
            BeanUtils.copyProperties(eventApplicationAppReleaseDO, eventApplicationAppReleaseDetailsVO);
            return R.ok(eventApplicationAppReleaseDetailsVO);
        }
        return R.fail();
    }
 
}