KKSU
2024-02-19 9b27517fe8051d1766bae57eb3c5adbbc40dbbd6
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
package cc.mrbird.febs.mall.controller;
 
import cc.mrbird.febs.common.entity.FebsConstant;
import cc.mrbird.febs.common.enumerates.DataDictionaryEnum;
import cc.mrbird.febs.common.utils.FebsUtil;
import cc.mrbird.febs.mall.dto.AdminGfaBasicSetDto;
import cc.mrbird.febs.mall.dto.HlmScoreSetDto;
import cc.mrbird.febs.mall.entity.*;
import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper;
import cc.mrbird.febs.mall.mapper.MallProductBuyMapper;
import cc.mrbird.febs.mall.mapper.MallProductBuyRecordMapper;
import cc.mrbird.febs.mall.mapper.MallProductNftMapper;
import cc.mrbird.febs.mall.service.IMallNewsInfoService;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
 
/**
 * @author wzy
 * @date 2022-05-13
 **/
@Controller("newView")
@RequestMapping(FebsConstant.VIEW_PREFIX + "modules/news")
@RequiredArgsConstructor
public class ViewNewsController {
 
    private final IMallNewsInfoService mallNewsInfoService;
    private final MallProductNftMapper mallProductNftMapper;
    private final MallProductBuyMapper mallProductBuyMapper;
    private final MallProductBuyRecordMapper mallProductBuyRecordMapper;
    private final DataDictionaryCustomMapper dataDictionaryCustomMapper;
 
    /**
     * 用户留言
     */
    @GetMapping("productMemberSpeak")
    @RequiresPermissions("productMemberSpeak:view")
    public String productMemberSpeak() {
        return FebsUtil.view("modules/news/productMemberSpeak");
    }
 
    /**
     * NFT预约产品
     */
    @GetMapping("productNFTList")
    @RequiresPermissions("productNFTList:view")
    public String productNFTList() {
        return FebsUtil.view("modules/news/productNFTList");
    }
 
    /**
     * NFT预约产品-新增
     */
    @GetMapping("productNFTAdd")
    @RequiresPermissions("productNFTAdd:add")
    public String productNFTAdd() {
        return FebsUtil.view("modules/news/productNFTAdd");
    }
 
    /**
     * NFT预约产品-详情
     * @return
     */
    @GetMapping("productNFTUpdate/{id}")
    @RequiresPermissions("productNFTUpdate:update")
    public String productNFTUpdate(@PathVariable long id, Model model) {
        MallProductNft mallProductNft = mallProductNftMapper.selectById(id);
        model.addAttribute("mallProductNft", mallProductNft);
        return FebsUtil.view("modules/news/productNFTUpdate");
    }
 
    /**
     * 用户NFT预约列表
     */
    @GetMapping("productBuyList")
    @RequiresPermissions("productBuyList:view")
    public String productBuyList() {
        return FebsUtil.view("modules/news/productBuyList");
    }
 
    /**
     * 用户NFT预约列表
     */
    @GetMapping("productBuyListNew")
    @RequiresPermissions("productBuyListNew:view")
    public String productBuyListNew() {
        return FebsUtil.view("modules/news/productBuyListNew");
    }
 
    /**
     * 用户NFT提现列表
     */
    @GetMapping("productSellList")
    @RequiresPermissions("productSellList:view")
    public String productSellList() {
        return FebsUtil.view("modules/news/productSellList");
    }
 
    /**
     * 用户NFT提现-手动分配
     * @return
     */
    @GetMapping("productSellPick/{id}")
    @RequiresPermissions("productSellPick:update")
    public String productSellPick(@PathVariable long id, Model model) {
        MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(id);
        model.addAttribute("mallProductBuy", mallProductBuy);
        return FebsUtil.view("modules/news/productSellPick");
    }
 
 
    /**
     * 用户预约打款记录--确认支付
     * @return
     */
    @GetMapping("buyRecordPay/{id}")
    @RequiresPermissions("buyRecordPay:update")
    public String buyRecordPay(@PathVariable long id, Model model) {
        MallProductBuyRecord mallProductBuyRecord = mallProductBuyRecordMapper.selectById(id);
        model.addAttribute("mallProductBuyRecord", mallProductBuyRecord);
        return FebsUtil.view("modules/news/buyRecordPay");
    }
 
 
    /**
     * 用户预约打款记录--凭证
     * @return
     */
    @GetMapping("buyRecordImg/{id}")
    @RequiresPermissions("buyRecordImg:update")
    public String buyRecordImg(@PathVariable long id, Model model) {
        MallProductBuyRecord mallProductBuyRecord = mallProductBuyRecordMapper.selectById(id);
        model.addAttribute("mallProductBuyRecord", mallProductBuyRecord);
        return FebsUtil.view("modules/news/buyRecordImg");
    }
 
    /**
     * 基础设置
     * @param model
     * @return
     */
    @GetMapping("gfaBasicSet")
    @RequiresPermissions("gfaBasicSet:view")
    public String gfaBasicSet(Model model) {
        AdminGfaBasicSetDto gfaBasicSetDto = new AdminGfaBasicSetDto();
        DataDictionaryCustom startTimeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.YU_YUE_START_TIME.getType(),
                DataDictionaryEnum.YU_YUE_START_TIME.getCode());
        if (startTimeDic != null) {
            gfaBasicSetDto.setStartTime(startTimeDic.getValue());
        }
        DataDictionaryCustom endCntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.YU_YUE_END_TIME.getType(),
                DataDictionaryEnum.YU_YUE_END_TIME.getCode());
        if (startTimeDic != null) {
            gfaBasicSetDto.setEndTime(endCntDic.getValue());
        }
        gfaBasicSetDto.setFrozenFcmCnt(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.MEMBER_FROZEN_FCM_CNT.getType(),
                DataDictionaryEnum.MEMBER_FROZEN_FCM_CNT.getCode()).getValue());
        gfaBasicSetDto.setOutFcmFee(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.OUT_FCM_FEE.getType(),
                DataDictionaryEnum.OUT_FCM_FEE.getCode()).getValue());
        gfaBasicSetDto.setFcmPrice(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FCM_PRICE.getType(),
                DataDictionaryEnum.FCM_PRICE.getCode()).getValue());
        gfaBasicSetDto.setFcmDesToryCnt(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FCM_DESTORY_CNT.getType(),
                DataDictionaryEnum.FCM_DESTORY_CNT.getCode()).getValue());
        gfaBasicSetDto.setFcmDesToryCnt(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FCM_DESTORY_CNT.getType(),
                DataDictionaryEnum.FCM_DESTORY_CNT.getCode()).getValue());
        gfaBasicSetDto.setFcmDesToryTotal(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FCM_DESTORY_TOTAL.getType(),
                DataDictionaryEnum.FCM_DESTORY_TOTAL.getCode()).getValue());
        gfaBasicSetDto.setNftFee(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.NFT_FEE.getType(),
                DataDictionaryEnum.NFT_FEE.getCode()).getValue());
        gfaBasicSetDto.setOutFcmMin(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.OUT_FCM_MIN.getType(),
                DataDictionaryEnum.OUT_FCM_MIN.getCode()).getValue());
        gfaBasicSetDto.setNftMin(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.NFT_MIN.getType(),
                DataDictionaryEnum.NFT_MIN.getCode()).getValue());
        gfaBasicSetDto.setMinuteCnt(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.INSURE_END_MINUTE.getType(),
                DataDictionaryEnum.INSURE_END_MINUTE.getCode()).getValue());
        gfaBasicSetDto.setFcmDesToryCntPercent(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FCM_DESTORY_TOTAL_PERCENT.getType(),
                DataDictionaryEnum.FCM_DESTORY_TOTAL_PERCENT.getCode()).getValue());
        gfaBasicSetDto.setFcmDesToryCntPointPercent(dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FCM_DESTORY_POINT_PERCENT.getType(),
                DataDictionaryEnum.FCM_DESTORY_POINT_PERCENT.getCode()).getValue());
        model.addAttribute("gfaBasicSet", gfaBasicSetDto);
        return FebsUtil.view("modules/news/gfaBasicSet");
    }
 
    /**
     * 新闻中心-列表
     * @return
     */
    @GetMapping("newsInfoList")
    @RequiresPermissions("newsInfoList:view")
    public String newsInfoList() {
        return FebsUtil.view("modules/news/newsInfoList");
    }
 
    /**
     * 新闻中心-新增
     * @return
     */
    @GetMapping("newsInfoAdd")
    @RequiresPermissions("newsInfoAdd:add")
    public String newsInfoAdd() {
        return FebsUtil.view("modules/news/newsInfoAdd");
    }
 
    /**
     * 新闻中心-详情
     * @param id
     * @param model
     * @return
     */
    @GetMapping("newsInfoUpdate/{id}")
    @RequiresPermissions("newsInfoUpdate:update")
    public String newsInfoUpdate(@PathVariable long id, Model model) {
        MallNewsInfo data = mallNewsInfoService.getNewsInfoById(id);
        model.addAttribute("newsInfo", data);
        return FebsUtil.view("modules/news/newsInfoUpdate");
    }
 
    @GetMapping("newsCategory")
    @RequiresPermissions("news:category:view")
    public String newsCategory() {
        return FebsUtil.view("modules/news/newsCategory");
    }
 
    @GetMapping("addCategory")
    @RequiresPermissions("news:category:add")
    public String addCategory(Long id, Model model) {
        if (id != null) {
            MallNewsCategory obj = mallNewsInfoService.findNewsCategoryById(id);
            model.addAttribute("obj", obj);
        }
        return FebsUtil.view("modules/news/newsCategoryAdd");
    }
 
    @GetMapping("updateCategory/{id}")
    @RequiresPermissions("news:category:update")
    public String updateCategory(@PathVariable Long id, Model model) {
        if (id != null) {
            MallNewsCategory obj = mallNewsInfoService.findNewsCategoryById(id);
            model.addAttribute("obj", obj);
        }
        return FebsUtil.view("modules/news/newsCategoryAdd");
    }
}