From 9070c4b91af86df50c88631143a3ef27a78a5608 Mon Sep 17 00:00:00 2001 From: 1186 <13640910284@163.com> Date: Mon, 1 Jul 2024 10:19:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=94=80=E5=94=AE=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BB=A3=E7=A0=81=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/ConfigController.java | 155 ++++++++++++ .../web/controller/NodeBuyLogController.java | 220 ----------------- .../NodeIncomeConfigController.java | 157 ++++++++++++ .../controller/NodePriceConfigController.java | 187 -------------- .../web/controller/NodeSettingController.java | 193 --------------- .../web/controller/NodeTaskController.java | 158 ------------ .../web/controller/NodeTaskLogController.java | 158 ------------ ...ontroller.java => UserNodeController.java} | 103 ++++---- .../web/controller/UserNodeLogController.java | 181 ++++++++++++++ .../templates/project/config/configAdd.html | 49 ++++ .../templates/project/config/configEdit.html | 53 ++++ .../templates/project/config/configList.html | 86 +++++++ .../nodeIncomeConfig/nodeIncomeConfigAdd.html | 37 +++ .../nodeIncomeConfigEdit.html | 38 +++ .../nodeIncomeConfigList.html | 110 +++++++++ .../project/tMember/tMemberList.html | 42 +--- .../project/userNode/userNodeAdd.html | 67 +++++ .../project/userNode/userNodeEdit.html | 68 +++++ .../project/userNode/userNodeList.html | 127 ++++++++++ .../project/userNodeLog/userNodeLogAdd.html | 145 +++++++++++ .../project/userNodeLog/userNodeLogEdit.html | 146 +++++++++++ .../project/userNodeLog/userNodeLogList.html | 232 ++++++++++++++++++ .../java/com/ruoyi/system/domain/Config.java | 69 ++++++ .../ruoyi/system/domain/NodeAwardSetting.java | 56 +++-- .../ruoyi/system/domain/NodeIncomeConfig.java | 35 +++ .../java/com/ruoyi/system/domain/TMember.java | 26 -- .../com/ruoyi/system/domain/UserNode.java | 65 +++++ .../com/ruoyi/system/domain/UserNodeLog.java | 114 +++++++++ .../com/ruoyi/system/mapper/ConfigMapper.java | 62 +++++ .../system/mapper/NodeIncomeConfigMapper.java | 62 +++++ .../ruoyi/system/mapper/TMemberMapper.java | 5 - .../system/mapper/UserNodeLogMapper.java | 62 +++++ .../ruoyi/system/mapper/UserNodeMapper.java | 62 +++++ .../ruoyi/system/service/ConfigService.java | 86 +++++++ .../service/NodeIncomeConfigService.java | 85 +++++++ .../ruoyi/system/service/TMemberService.java | 6 +- .../system/service/UserNodeLogService.java | 85 +++++++ .../ruoyi/system/service/UserNodeService.java | 85 +++++++ .../resources/mapper/system/ConfigMapper.xml | 115 +++++++++ .../mapper/system/NodeIncomeConfigMapper.xml | 87 +++++++ .../resources/mapper/system/TMemberMapper.xml | 11 +- .../mapper/system/UserNodeLogMapper.xml | 165 +++++++++++++ .../mapper/system/UserNodeMapper.xml | 117 +++++++++ 43 files changed, 3099 insertions(+), 1073 deletions(-) create mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/ConfigController.java delete mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/NodeBuyLogController.java create mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/NodeIncomeConfigController.java delete mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/NodePriceConfigController.java delete mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/NodeSettingController.java delete mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskController.java delete mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskLogController.java rename alive-admin/src/main/java/com/ruoyi/web/controller/{NodeController.java => UserNodeController.java} (53%) create mode 100644 alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeLogController.java create mode 100644 alive-admin/src/main/resources/templates/project/config/configAdd.html create mode 100644 alive-admin/src/main/resources/templates/project/config/configEdit.html create mode 100644 alive-admin/src/main/resources/templates/project/config/configList.html create mode 100644 alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigAdd.html create mode 100644 alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigEdit.html create mode 100644 alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigList.html create mode 100644 alive-admin/src/main/resources/templates/project/userNode/userNodeAdd.html create mode 100644 alive-admin/src/main/resources/templates/project/userNode/userNodeEdit.html create mode 100644 alive-admin/src/main/resources/templates/project/userNode/userNodeList.html create mode 100644 alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogAdd.html create mode 100644 alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogEdit.html create mode 100644 alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogList.html create mode 100644 alive-server/src/main/java/com/ruoyi/system/domain/Config.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/domain/NodeIncomeConfig.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/domain/UserNode.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/domain/UserNodeLog.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/mapper/ConfigMapper.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/mapper/NodeIncomeConfigMapper.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeLogMapper.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeMapper.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/service/ConfigService.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/service/NodeIncomeConfigService.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/service/UserNodeLogService.java create mode 100644 alive-server/src/main/java/com/ruoyi/system/service/UserNodeService.java create mode 100644 alive-server/src/main/resources/mapper/system/ConfigMapper.xml create mode 100644 alive-server/src/main/resources/mapper/system/NodeIncomeConfigMapper.xml create mode 100644 alive-server/src/main/resources/mapper/system/UserNodeLogMapper.xml create mode 100644 alive-server/src/main/resources/mapper/system/UserNodeMapper.xml diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/ConfigController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/ConfigController.java new file mode 100644 index 0000000..22451a4 --- /dev/null +++ b/alive-admin/src/main/java/com/ruoyi/web/controller/ConfigController.java @@ -0,0 +1,155 @@ +package com.ruoyi.web.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.Config; +import com.ruoyi.system.service.ConfigService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 一些配置Controller + * + * @author HayDen + * @date 2024-06-27 + */ +@Controller +@RequestMapping("/project/config") +public class ConfigController extends BaseController +{ + private String prefix = "project/config"; + + @Autowired + private ConfigService configService; + + @RequiresPermissions("project:config:view") + @GetMapping() + public String config() + { + return prefix + "/configList"; + } + + /** + * 查询一些配置列表 + */ + @RequiresPermissions("project:config:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(Config config) + { + startPage(); + List list = configService.selectConfigList(config); + return getDataTable(list); + } + + /** + * 查询一些配置对象 + */ + @RequiresPermissions("project:config:config") + @PostMapping("/config") + @ResponseBody + public Config findConfig(Config config) + { + config = configService.findConfig(config); + return config; + } + + /** + * 导出一些配置列表 + */ + @RequiresPermissions("project:config:export") + @Log(title = "一些配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(Config config) + { + List list = configService.selectConfigList(config); + ExcelUtil util = new ExcelUtil(Config.class); + return util.exportExcel(list, "一些配置"); + } + + /** + * 新增一些配置 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/configAdd"; + } + /** + * 新增一些配置 + */ + @GetMapping(value = { "/add/{id}", "/add/" }) + public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) + { + if (StringUtils.isNotNull(id)) + { + mmap.put("config", configService.selectConfigById(id)); + } + return prefix + "/configAdd"; + } + + /** + * 新增保存一些配置 + */ + @RequiresPermissions("project:config:add") + @Log(title = "一些配置", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(Config config) + { + SysUser sysUser = getSysUser(); + config.setCreateBy(sysUser.getUserName()); + return toAjax(configService.updateOrAddConfig(config)); + } + + /** + * 修改一些配置 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Integer id, ModelMap mmap) + { + Config config = configService.selectConfigById(id); + mmap.put("config", config); + return prefix + "/configEdit"; + } + + /** + * 修改保存一些配置 + */ + @RequiresPermissions("project:config:edit") + @Log(title = "一些配置", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(Config config) + { + SysUser sysUser = getSysUser(); + config.setUpdateBy(sysUser.getUserName()); + return toAjax(configService.updateOrAddConfig(config)); + } + + + /** + * 删除一些配置 + */ + @RequiresPermissions("project:config:remove") + @Log(title = "一些配置", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(configService.deleteConfigByIds(ids)); + } + +} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeBuyLogController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/NodeBuyLogController.java deleted file mode 100644 index 7dfcf76..0000000 --- a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeBuyLogController.java +++ /dev/null @@ -1,220 +0,0 @@ -package com.ruoyi.web.controller; - -import com.ruoyi.common.utils.StringUtils; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.system.domain.NodeSetting; -import com.ruoyi.system.domain.TMember; -import com.ruoyi.system.service.NodeSettingService; -import com.ruoyi.system.service.TMemberService; -import com.ruoyi.system.utils.NumberUtil; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.NodeBuyLog; -import com.ruoyi.system.service.NodeBuyLogService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; - -/** - * 节点认购记录Controller - * - * @author HayDen - * @date 2024-01-08 - */ -@Controller -@RequestMapping("/project/nodeSubscribe") -public class NodeBuyLogController extends BaseController -{ - private String prefix = "project/nodeBuyLog"; - - @Autowired - private NodeBuyLogService nodeSubscribeService; - - @Autowired - private NodeSettingService nodeSettingService; - - @Autowired - private TMemberService tMemberService; - - @RequiresPermissions("project:nodeSubscribe:view") - @GetMapping() - public String nodeSubscribe() - { - return prefix + "/nodeSubscribeList"; - } - - /** - * 查询节点认购记录列表 - */ - @RequiresPermissions("project:nodeSubscribe:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(NodeBuyLog nodeSubscribe) - { - if(!StringUtils.isEmpty(nodeSubscribe.getTopAddress())){ - TMember tMember = tMemberService.findTMember(new TMember().setAccount(nodeSubscribe.getTopAddress())); - if(tMember == null || tMember.getTopUser().equals(0)){ - return getDataTable(new ArrayList<>()); - } - nodeSubscribe.setTopUserId(tMember.getId()); - } - startPage(); - List list = nodeSubscribeService.selectNodeSubscribeList(nodeSubscribe); - return getDataTable(list); - } - - /** - * 查询节点认购记录对象 - */ - @RequiresPermissions("project:nodeSubscribe:nodeSubscribe") - @PostMapping("/nodeSubscribe") - @ResponseBody - public NodeBuyLog findNodeSubscribe(NodeBuyLog nodeSubscribe) - { - nodeSubscribe = nodeSubscribeService.findNodeSubscribe(nodeSubscribe); - return nodeSubscribe; - } - - /** - * 导出节点认购记录列表 - */ - @RequiresPermissions("project:nodeSubscribe:export") - @Log(title = "节点认购记录", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(NodeBuyLog nodeSubscribe) - { - List list = nodeSubscribeService.selectNodeSubscribeList(nodeSubscribe); - ExcelUtil util = new ExcelUtil(NodeBuyLog.class); - return util.exportExcel(list, "节点认购记录"); - } - - /** - * 新增节点认购记录 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/nodeSubscribeAdd"; - } - /** - * 新增节点认购记录 - */ - @GetMapping(value = { "/add/{id}", "/add/" }) - public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) - { - if (StringUtils.isNotNull(id)) - { - mmap.put("nodeSubscribe", nodeSubscribeService.selectNodeSubscribeById(id)); - } - return prefix + "/nodeSubscribeAdd"; - } - - /** - * 新增保存节点认购记录 - */ - @RequiresPermissions("project:nodeSubscribe:add") - @Log(title = "节点认购记录", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(NodeBuyLog nodeSubscribe) - { - SysUser sysUser = getSysUser(); - nodeSubscribe.setCreateBy(sysUser.getUserName()); - nodeSubscribe.setAddress(nodeSubscribe.getWalletAddress().toLowerCase()); - TMember tMember = tMemberService.findTMember(new TMember().setAccount(nodeSubscribe.getAddress())); - if(tMember == null){ - return error("该地址未注册"); - } - nodeSubscribe.setInputAddress("无"); - nodeSubscribe.setOutAddress("无"); - //查询当前生效的节点 - NodeSetting nodeSetting = nodeSettingService.findNodeSetting(new NodeSetting().setStatus(1)); - if(nodeSetting == null){ - return error("当前没有可分配的NFT"); - } - nodeSubscribe.setNodeSettingId(nodeSetting.getId().intValue()); - nodeSubscribe.setOrderNumber("0x000000000000"); - nodeSubscribe.setIllustrate("后台手动分配"); - nodeSubscribe.setStatus(2); - nodeSubscribe.setUserId(tMember.getId().intValue()); - nodeSubscribe.setPayCoin("USDT"); - return toAjax(nodeSubscribeService.updateOrAddNodeSubscribe(nodeSubscribe)); - } - - /** - * 修改节点认购记录 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) - { - NodeBuyLog nodeSubscribe = nodeSubscribeService.selectNodeSubscribeById(id); - mmap.put("nodeSubscribe", nodeSubscribe); - return prefix + "/nodeSubscribeEdit"; - } - - /** - * 修改保存节点认购记录 - */ - @RequiresPermissions("project:nodeSubscribe:edit") - @Log(title = "节点认购记录", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(NodeBuyLog nodeSubscribe) - { - SysUser sysUser = getSysUser(); - nodeSubscribe.setUpdateBy(sysUser.getUserName()); - NodeBuyLog log = nodeSubscribeService.findNodeSubscribe(new NodeBuyLog().setHash(nodeSubscribe.getHash())); - if(log != null){ - return error("hash不能重复绑定"); - } - log = nodeSubscribeService.selectNodeSubscribeById(nodeSubscribe.getId().intValue()); - if(log == null || !org.apache.commons.lang3.StringUtils.isBlank(log.getHash())){ - return error("无法重复绑定hash"); - } - nodeSubscribe.setStatus(2); - nodeSubscribe.setCreateTime(new Date()); - return toAjax(nodeSubscribeService.updateOrAddNodeSubscribe(nodeSubscribe)); - } - - @Log(title = "结算数据", businessType = BusinessType.UPDATE) - @PostMapping( "/settlement") - @ResponseBody - public AjaxResult settlement(String ids) - { - System.out.printf(ids); - String[] arr = ids.split(","); - Integer code = nodeSubscribeService.countLogTop(arr); - if(arr.length != code){ - return error("只有未结算的数据才能结算哦!"); - } - return toAjax(nodeSubscribeService.updateBuyLogTop(arr)); - } - - /** - * 删除节点认购记录 - */ - @RequiresPermissions("project:nodeSubscribe:remove") - @Log(title = "节点认购记录", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(nodeSubscribeService.deleteNodeSubscribeByIds(ids)); - } - -} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeIncomeConfigController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/NodeIncomeConfigController.java new file mode 100644 index 0000000..8aedef2 --- /dev/null +++ b/alive-admin/src/main/java/com/ruoyi/web/controller/NodeIncomeConfigController.java @@ -0,0 +1,157 @@ +package com.ruoyi.web.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.NodeIncomeConfig; +import com.ruoyi.system.service.NodeIncomeConfigService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 收益配置Controller + * + * @author HayDen + * @date 2024-06-27 + */ +@Controller +@RequestMapping("/project/nodeIncomeConfig") +public class NodeIncomeConfigController extends BaseController +{ + private String prefix = "project/nodeIncomeConfig"; + + @Autowired + private NodeIncomeConfigService nodeIncomeConfigService; + + @RequiresPermissions("project:nodeIncomeConfig:view") + @GetMapping() + public String nodeIncomeConfig() + { + return prefix + "/nodeIncomeConfigList"; + } + + /** + * 查询收益配置列表 + */ + @RequiresPermissions("project:nodeIncomeConfig:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(NodeIncomeConfig nodeIncomeConfig) + { + startPage(); + List list = nodeIncomeConfigService.selectNodeIncomeConfigList(nodeIncomeConfig); + return getDataTable(list); + } + + /** + * 查询收益配置对象 + */ + @RequiresPermissions("project:nodeIncomeConfig:nodeIncomeConfig") + @PostMapping("/nodeIncomeConfig") + @ResponseBody + public NodeIncomeConfig findNodeIncomeConfig(NodeIncomeConfig nodeIncomeConfig) + { + nodeIncomeConfig = nodeIncomeConfigService.findNodeIncomeConfig(nodeIncomeConfig); + return nodeIncomeConfig; + } + + /** + * 导出收益配置列表 + */ + @RequiresPermissions("project:nodeIncomeConfig:export") + @Log(title = "收益配置", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(NodeIncomeConfig nodeIncomeConfig) + { + List list = nodeIncomeConfigService.selectNodeIncomeConfigList(nodeIncomeConfig); + ExcelUtil util = new ExcelUtil(NodeIncomeConfig.class); + return util.exportExcel(list, "收益配置"); + } + + /** + * 新增收益配置 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/nodeIncomeConfigAdd"; + } + /** + * 新增收益配置 + */ + @GetMapping(value = { "/add/{id}", "/add/" }) + public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) + { + if (StringUtils.isNotNull(id)) + { + mmap.put("nodeIncomeConfig", nodeIncomeConfigService.selectNodeIncomeConfigById(id)); + } + return prefix + "/nodeIncomeConfigAdd"; + } + + /** + * 新增保存收益配置 + */ + @RequiresPermissions("project:nodeIncomeConfig:add") + @Log(title = "收益配置", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(NodeIncomeConfig nodeIncomeConfig) + { + SysUser sysUser = getSysUser(); + nodeIncomeConfig.setCreateBy(sysUser.getUserName()); + return toAjax(nodeIncomeConfigService.updateOrAddNodeIncomeConfig(nodeIncomeConfig)); + } + + /** + * 修改收益配置 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Integer id, ModelMap mmap) + { + NodeIncomeConfig nodeIncomeConfig = nodeIncomeConfigService.selectNodeIncomeConfigById(id); + nodeIncomeConfig.setIncome(new BigDecimal(nodeIncomeConfig.getIncome().stripTrailingZeros().toPlainString())); + mmap.put("nodeIncomeConfig", nodeIncomeConfig); + return prefix + "/nodeIncomeConfigEdit"; + } + + /** + * 修改保存收益配置 + */ + @RequiresPermissions("project:nodeIncomeConfig:edit") + @Log(title = "收益配置", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(NodeIncomeConfig nodeIncomeConfig) + { + SysUser sysUser = getSysUser(); + nodeIncomeConfig.setUpdateBy(sysUser.getUserName()); + return toAjax(nodeIncomeConfigService.updateOrAddNodeIncomeConfig(nodeIncomeConfig)); + } + + + /** + * 删除收益配置 + */ + @RequiresPermissions("project:nodeIncomeConfig:remove") + @Log(title = "收益配置", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(nodeIncomeConfigService.deleteNodeIncomeConfigByIds(ids)); + } + +} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodePriceConfigController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/NodePriceConfigController.java deleted file mode 100644 index 14dcef3..0000000 --- a/alive-admin/src/main/java/com/ruoyi/web/controller/NodePriceConfigController.java +++ /dev/null @@ -1,187 +0,0 @@ -package com.ruoyi.web.controller; - -import com.ruoyi.common.utils.StringUtils; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.system.service.NodeSettingService; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.NodePriceConfig; -import com.ruoyi.system.service.NodePriceConfigService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; - -import javax.annotation.Resource; - -/** - * 节点价格区间配置Controller - * - * @author HayDen - * @date 2024-01-08 - */ -@Controller -@RequestMapping("/project/nodePriceConfig") -public class NodePriceConfigController extends BaseController -{ - private String prefix = "project/nodePriceConfig"; - - @Autowired - private NodePriceConfigService nodePriceConfigService; - - @Resource - private NodeSettingService nodeSettingService; - - public Map map = new HashMap<>(); - - @RequiresPermissions("project:nodePriceConfig:view") - @GetMapping() - public String nodePriceConfig(Long id) - { - SysUser sysUser = getSysUser(); - map.put(sysUser.getUserId(),id); - return prefix + "/nodePriceConfigList"; - } - - /** - * 查询节点价格区间配置列表 - */ - @RequiresPermissions("project:nodePriceConfig:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(NodePriceConfig nodePriceConfig) - { - startPage(); - SysUser sysUser = getSysUser(); - nodePriceConfig.setNodeSettingId(map.get(sysUser.getUserId()).intValue()); - List list = nodePriceConfigService.selectNodePriceConfigList(nodePriceConfig); - return getDataTable(list); - } - - /** - * 查询节点价格区间配置对象 - */ - @RequiresPermissions("project:nodePriceConfig:nodePriceConfig") - @PostMapping("/nodePriceConfig") - @ResponseBody - public NodePriceConfig findNodePriceConfig(NodePriceConfig nodePriceConfig) - { - nodePriceConfig = nodePriceConfigService.findNodePriceConfig(nodePriceConfig); - return nodePriceConfig; - } - - /** - * 导出节点价格区间配置列表 - */ - @RequiresPermissions("project:nodePriceConfig:export") - @Log(title = "节点价格区间配置", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(NodePriceConfig nodePriceConfig) - { - List list = nodePriceConfigService.selectNodePriceConfigList(nodePriceConfig); - ExcelUtil util = new ExcelUtil(NodePriceConfig.class); - return util.exportExcel(list, "节点价格区间配置"); - } - - /** - * 新增节点价格区间配置 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/nodePriceConfigAdd"; - } - /** - * 新增节点价格区间配置 - */ - @GetMapping(value = { "/add/{id}", "/add/" }) - public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) - { - if (StringUtils.isNotNull(id)) - { - mmap.put("nodePriceConfig", nodePriceConfigService.selectNodePriceConfigById(id)); - } - return prefix + "/nodePriceConfigAdd"; - } - - /** - * 新增保存节点价格区间配置 - */ - @RequiresPermissions("project:nodePriceConfig:add") - @Log(title = "节点价格区间配置", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(NodePriceConfig nodePriceConfig) - { - SysUser sysUser = getSysUser(); - if(nodeSettingService.countPriceConfig(nodePriceConfig.getStartNum(),nodePriceConfig.getEndNum(),null,map.get(sysUser.getUserId()).intValue()) > 0){ - return error("该区间的配置已存在"); - } - if(nodePriceConfig.getStartNum() >= nodePriceConfig.getEndNum()){ - return error("配置区间错误"); - } - nodePriceConfig.setNodeSettingId(map.get(sysUser.getUserId()).intValue()); - nodePriceConfig.setCreateBy(sysUser.getUserName()); - return toAjax(nodePriceConfigService.updateOrAddNodePriceConfig(nodePriceConfig)); - } - - /** - * 修改节点价格区间配置 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) - { - NodePriceConfig nodePriceConfig = nodePriceConfigService.selectNodePriceConfigById(id); - mmap.put("nodePriceConfig", nodePriceConfig); - return prefix + "/nodePriceConfigEdit"; - } - - /** - * 修改保存节点价格区间配置 - */ - @RequiresPermissions("project:nodePriceConfig:edit") - @Log(title = "节点价格区间配置", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(NodePriceConfig nodePriceConfig) - { - SysUser sysUser = getSysUser(); - if(nodeSettingService.countPriceConfig(nodePriceConfig.getStartNum(),nodePriceConfig.getEndNum(),nodePriceConfig.getId().intValue(),map.get(sysUser.getUserId()).intValue()) > 0){ - return error("该区间的配置已存在"); - } - if(nodePriceConfig.getStartNum() >= nodePriceConfig.getEndNum()){ - return error("配置区间错误"); - } - nodePriceConfig.setUpdateBy(sysUser.getUserName()); - return toAjax(nodePriceConfigService.updateOrAddNodePriceConfig(nodePriceConfig)); - } - - - /** - * 删除节点价格区间配置 - */ - @RequiresPermissions("project:nodePriceConfig:remove") - @Log(title = "节点价格区间配置", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(nodePriceConfigService.deleteNodePriceConfigByIds(ids)); - } - -} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeSettingController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/NodeSettingController.java deleted file mode 100644 index 216a5d0..0000000 --- a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeSettingController.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.ruoyi.web.controller; - -import com.ruoyi.common.utils.StringUtils; - -import java.math.BigDecimal; -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.system.domain.NodeAwardSetting; -import com.ruoyi.system.service.NodeAwardSettingService; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.NodeSetting; -import com.ruoyi.system.service.NodeSettingService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; - -/** - * 节点设置Controller - * - * @author HayDen - * @date 2024-01-08 - */ -@Controller -@RequestMapping("/project/nodeSetting") -public class NodeSettingController extends BaseController -{ - private String prefix = "project/nodeSetting"; - - @Autowired - private NodeSettingService nodeSettingService; - - @Autowired - private NodeAwardSettingService nodeAwardSettingService; - - - @RequiresPermissions("project:nodeSetting:view") - @GetMapping() - public String nodeSetting() - { - return prefix + "/nodeSettingList"; - } - - /** - * 查询节点设置列表 - */ - @RequiresPermissions("project:nodeSetting:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(NodeSetting nodeSetting) - { - startPage(); - List list = nodeSettingService.selectNodeSettingList(nodeSetting); - return getDataTable(list); - } - - /** - * 查询节点设置对象 - */ - @RequiresPermissions("project:nodeSetting:nodeSetting") - @PostMapping("/nodeSetting") - @ResponseBody - public NodeSetting findNodeSetting(NodeSetting nodeSetting) - { - nodeSetting = nodeSettingService.findNodeSetting(nodeSetting); - return nodeSetting; - } - - /** - * 导出节点设置列表 - */ - @RequiresPermissions("project:nodeSetting:export") - @Log(title = "节点设置", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(NodeSetting nodeSetting) - { - List list = nodeSettingService.selectNodeSettingList(nodeSetting); - ExcelUtil util = new ExcelUtil(NodeSetting.class); - return util.exportExcel(list, "节点设置"); - } - - /** - * 新增节点设置 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/nodeSettingAdd"; - } - /** - * 新增节点设置 - */ - @GetMapping(value = { "/add/{id}", "/add/" }) - public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) - { - if (StringUtils.isNotNull(id)) - { - mmap.put("nodeSetting", nodeSettingService.selectNodeSettingById(id)); - } - return prefix + "/nodeSettingAdd"; - } - - /** - * 新增保存节点设置 - */ - @RequiresPermissions("project:nodeSetting:add") - @Log(title = "节点设置", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(NodeSetting nodeSetting) - { - nodeSetting.setNodeName(nodeSetting.getNodeNamePs()); - if(nodeSettingService.findNodeSetting(new NodeSetting().setNodeGrade(nodeSetting.getNodeGrade())) != null){ - return error("该等级的盒子已存在"); - } - if(nodeSetting.getStatus() == 1 && nodeSettingService.findNodeSetting(new NodeSetting().setStatus(1)) != null){ - return error("只能同时存在一个可销售盒子"); - } - SysUser sysUser = getSysUser(); - nodeSetting.setCreateBy(sysUser.getUserName()); - nodeSettingService.updateOrAddNodeSetting(nodeSetting); - //开始创建奖励配置 - NodeAwardSetting nodeAwardSetting = new NodeAwardSetting(); - nodeAwardSetting.setNodeSettingId(nodeSetting.getId().intValue()); - nodeAwardSetting.setRebate(BigDecimal.ZERO); - nodeAwardSetting.setRbitAmount(BigDecimal.ZERO); - nodeAwardSetting.setRbitOne(BigDecimal.ZERO); - nodeAwardSetting.setNftAmount(BigDecimal.ZERO); - nodeAwardSetting.setNftOne(BigDecimal.ZERO); - nodeAwardSetting.setNftTwo(BigDecimal.ZERO); - nodeAwardSettingService.updateOrAddNodeAwardSetting(nodeAwardSetting); - return toAjax(1); - } - - /** - * 修改节点设置 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) - { - NodeSetting nodeSetting = nodeSettingService.selectNodeSettingById(id); - nodeSetting.setNodeNamePs(nodeSetting.getNodeName()); - mmap.put("nodeSetting", nodeSetting); - return prefix + "/nodeSettingEdit"; - } - - /** - * 修改保存节点设置 - */ - @RequiresPermissions("project:nodeSetting:edit") - @Log(title = "节点设置", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(NodeSetting nodeSetting) - { - if(nodeSetting.getStatus() == 1){ - NodeSetting nod = nodeSettingService.findNodeSetting(new NodeSetting().setStatus(1)); - if(nod != null && !nod.getId().equals(nodeSetting.getId())){ - return error("只能同时存在一个可销售盒子"); - } - } - nodeSetting.setNodeName(nodeSetting.getNodeNamePs()); - SysUser sysUser = getSysUser(); - nodeSetting.setUpdateBy(sysUser.getUserName()); - return toAjax(nodeSettingService.updateOrAddNodeSetting(nodeSetting)); - } - - - - /** - * 删除节点设置 - */ - @RequiresPermissions("project:nodeSetting:remove") - @Log(title = "节点设置", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(nodeSettingService.deleteNodeSettingByIds(ids)); - } - -} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskController.java deleted file mode 100644 index c5f3185..0000000 --- a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.ruoyi.web.controller; - -import com.ruoyi.common.utils.StringUtils; -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysUser; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.NodeTask; -import com.ruoyi.system.service.NodeTaskService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; - -/** - * NEER任务配置Controller - * - * @author HayDen - * @date 2024-02-24 - */ -@Controller -@RequestMapping("/project/nodeTask") -public class NodeTaskController extends BaseController -{ - private String prefix = "project/nodeTask"; - - @Autowired - private NodeTaskService nodeTaskService; - - @RequiresPermissions("project:nodeTask:view") - @GetMapping() - public String nodeTask() - { - return prefix + "/nodeTaskList"; - } - - /** - * 查询NEER任务配置列表 - */ - @RequiresPermissions("project:nodeTask:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(NodeTask nodeTask) - { - startPage(); - List list = nodeTaskService.selectNodeTaskList(nodeTask); - return getDataTable(list); - } - - /** - * 查询NEER任务配置对象 - */ - @RequiresPermissions("project:nodeTask:nodeTask") - @PostMapping("/nodeTask") - @ResponseBody - public NodeTask findNodeTask(NodeTask nodeTask) - { - nodeTask = nodeTaskService.findNodeTask(nodeTask); - return nodeTask; - } - - /** - * 导出NEER任务配置列表 - */ - @RequiresPermissions("project:nodeTask:export") - @Log(title = "NEER任务配置", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(NodeTask nodeTask) - { - List list = nodeTaskService.selectNodeTaskList(nodeTask); - ExcelUtil util = new ExcelUtil(NodeTask.class); - return util.exportExcel(list, "NEER任务配置"); - } - - /** - * 新增NEER任务配置 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/nodeTaskAdd"; - } - /** - * 新增NEER任务配置 - */ - @GetMapping(value = { "/add/{id}", "/add/" }) - public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) - { - if (StringUtils.isNotNull(id)) - { - mmap.put("nodeTask", nodeTaskService.selectNodeTaskById(id)); - } - return prefix + "/nodeTaskAdd"; - } - - /** - * 新增保存NEER任务配置 - */ - @RequiresPermissions("project:nodeTask:add") - @Log(title = "NEER任务配置", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(NodeTask nodeTask) - { - SysUser sysUser = getSysUser(); - nodeTask.setCreateBy(sysUser.getUserName()); - return toAjax(nodeTaskService.updateOrAddNodeTask(nodeTask)); - } - - /** - * 修改NEER任务配置 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) - { - NodeTask nodeTask = nodeTaskService.selectNodeTaskById(id); - mmap.put("nodeTask", nodeTask); - return prefix + "/nodeTaskEdit"; - } - - /** - * 修改保存NEER任务配置 - */ - @RequiresPermissions("project:nodeTask:edit") - @Log(title = "NEER任务配置", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(NodeTask nodeTask) - { - SysUser sysUser = getSysUser(); - nodeTask.setUpdateBy(sysUser.getUserName()); - return toAjax(nodeTaskService.updateOrAddNodeTask(nodeTask)); - } - - - /** - * 删除NEER任务配置 - */ - @RequiresPermissions("project:nodeTask:remove") - @Log(title = "NEER任务配置", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(nodeTaskService.deleteNodeTaskByIds(ids)); - } - -} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskLogController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskLogController.java deleted file mode 100644 index cd5d8b0..0000000 --- a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeTaskLogController.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.ruoyi.web.controller; - -import com.ruoyi.common.utils.StringUtils; -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysUser; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.NodeTaskLog; -import com.ruoyi.system.service.NodeTaskLogService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; - -/** - * 我的任务奖励Controller - * - * @author HayDen - * @date 2024-02-24 - */ -@Controller -@RequestMapping("/project/nodeTaskLog") -public class NodeTaskLogController extends BaseController -{ - private String prefix = "project/nodeTaskLog"; - - @Autowired - private NodeTaskLogService nodeTaskLogService; - - @RequiresPermissions("project:nodeTaskLog:view") - @GetMapping() - public String nodeTaskLog() - { - return prefix + "/nodeTaskLogList"; - } - - /** - * 查询我的任务奖励列表 - */ - @RequiresPermissions("project:nodeTaskLog:list") - @PostMapping("/list") - @ResponseBody - public TableDataInfo list(NodeTaskLog nodeTaskLog) - { - startPage(); - List list = nodeTaskLogService.selectNodeTaskLogList(nodeTaskLog); - return getDataTable(list); - } - - /** - * 查询我的任务奖励对象 - */ - @RequiresPermissions("project:nodeTaskLog:nodeTaskLog") - @PostMapping("/nodeTaskLog") - @ResponseBody - public NodeTaskLog findNodeTaskLog(NodeTaskLog nodeTaskLog) - { - nodeTaskLog = nodeTaskLogService.findNodeTaskLog(nodeTaskLog); - return nodeTaskLog; - } - - /** - * 导出我的任务奖励列表 - */ - @RequiresPermissions("project:nodeTaskLog:export") - @Log(title = "我的任务奖励", businessType = BusinessType.EXPORT) - @PostMapping("/export") - @ResponseBody - public AjaxResult export(NodeTaskLog nodeTaskLog) - { - List list = nodeTaskLogService.selectNodeTaskLogList(nodeTaskLog); - ExcelUtil util = new ExcelUtil(NodeTaskLog.class); - return util.exportExcel(list, "我的任务奖励"); - } - - /** - * 新增我的任务奖励 - */ - @GetMapping("/add") - public String add() - { - return prefix + "/nodeTaskLogAdd"; - } - /** - * 新增我的任务奖励 - */ - @GetMapping(value = { "/add/{id}", "/add/" }) - public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) - { - if (StringUtils.isNotNull(id)) - { - mmap.put("nodeTaskLog", nodeTaskLogService.selectNodeTaskLogById(id)); - } - return prefix + "/nodeTaskLogAdd"; - } - - /** - * 新增保存我的任务奖励 - */ - @RequiresPermissions("project:nodeTaskLog:add") - @Log(title = "我的任务奖励", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(NodeTaskLog nodeTaskLog) - { - SysUser sysUser = getSysUser(); - nodeTaskLog.setCreateBy(sysUser.getUserName()); - return toAjax(nodeTaskLogService.updateOrAddNodeTaskLog(nodeTaskLog)); - } - - /** - * 修改我的任务奖励 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) - { - NodeTaskLog nodeTaskLog = nodeTaskLogService.selectNodeTaskLogById(id); - mmap.put("nodeTaskLog", nodeTaskLog); - return prefix + "/nodeTaskLogEdit"; - } - - /** - * 修改保存我的任务奖励 - */ - @RequiresPermissions("project:nodeTaskLog:edit") - @Log(title = "我的任务奖励", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(NodeTaskLog nodeTaskLog) - { - SysUser sysUser = getSysUser(); - nodeTaskLog.setUpdateBy(sysUser.getUserName()); - return toAjax(nodeTaskLogService.updateOrAddNodeTaskLog(nodeTaskLog)); - } - - - /** - * 删除我的任务奖励 - */ - @RequiresPermissions("project:nodeTaskLog:remove") - @Log(title = "我的任务奖励", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(nodeTaskLogService.deleteNodeTaskLogByIds(ids)); - } - -} diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeController.java similarity index 53% rename from alive-admin/src/main/java/com/ruoyi/web/controller/NodeController.java rename to alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeController.java index 8d35831..f6f3057 100644 --- a/alive-admin/src/main/java/com/ruoyi/web/controller/NodeController.java +++ b/alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeController.java @@ -1,87 +1,84 @@ package com.ruoyi.web.controller; -import com.ruoyi.common.utils.StringUtils; -import java.util.List; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.UserNode; +import com.ruoyi.system.service.UserNodeService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.Node; -import com.ruoyi.system.service.NodeService; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 用户节点Controller * * @author HayDen - * @date 2024-01-11 + * @date 2024-06-27 */ @Controller -@RequestMapping("/project/node") -public class NodeController extends BaseController +@RequestMapping("/project/userNode") +public class UserNodeController extends BaseController { - private String prefix = "project/node"; + private String prefix = "project/userNode"; @Autowired - private NodeService nodeService; + private UserNodeService userNodeService; - @RequiresPermissions("project:node:view") + @RequiresPermissions("project:userNode:view") @GetMapping() - public String node() + public String userNode() { - return prefix + "/nodeList"; + return prefix + "/userNodeList"; } /** * 查询用户节点列表 */ - @RequiresPermissions("project:node:list") + @RequiresPermissions("project:userNode:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(Node node) + public TableDataInfo list(UserNode userNode) { - if(!StringUtils.isEmpty(node.getAddress())){ - node.setAddress(node.getAddress().toLowerCase()); + if(!org.apache.commons.lang3.StringUtils.isBlank(userNode.getWalletAddress())){ + userNode.setWalletAddress(userNode.getWalletAddress().toLowerCase()); } startPage(); - List list = nodeService.selectNodeList(node); + List list = userNodeService.selectUserNodeList(userNode); return getDataTable(list); } /** * 查询用户节点对象 */ - @RequiresPermissions("project:node:node") - @PostMapping("/node") + @RequiresPermissions("project:userNode:userNode") + @PostMapping("/userNode") @ResponseBody - public Node findNode(Node node) + public UserNode findUserNode(UserNode userNode) { - node = nodeService.findNode(node); - return node; + userNode = userNodeService.findUserNode(userNode); + return userNode; } /** * 导出用户节点列表 */ - @RequiresPermissions("project:node:export") + @RequiresPermissions("project:userNode:export") @Log(title = "用户节点", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(Node node) + public AjaxResult export(UserNode userNode) { - List list = nodeService.selectNodeList(node); - ExcelUtil util = new ExcelUtil(Node.class); + List list = userNodeService.selectUserNodeList(userNode); + ExcelUtil util = new ExcelUtil(UserNode.class); return util.exportExcel(list, "用户节点"); } @@ -91,7 +88,7 @@ public class NodeController extends BaseController @GetMapping("/add") public String add() { - return prefix + "/nodeAdd"; + return prefix + "/userNodeAdd"; } /** * 新增用户节点 @@ -101,23 +98,23 @@ public class NodeController extends BaseController { if (StringUtils.isNotNull(id)) { - mmap.put("node", nodeService.selectNodeById(id)); + mmap.put("userNode", userNodeService.selectUserNodeById(id)); } - return prefix + "/nodeAdd"; + return prefix + "/userNodeAdd"; } /** * 新增保存用户节点 */ - @RequiresPermissions("project:node:add") + @RequiresPermissions("project:userNode:add") @Log(title = "用户节点", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(Node node) + public AjaxResult addSave(UserNode userNode) { SysUser sysUser = getSysUser(); - node.setCreateBy(sysUser.getUserName()); - return toAjax(nodeService.updateOrAddNode(node)); + userNode.setCreateBy(sysUser.getUserName()); + return toAjax(userNodeService.updateOrAddUserNode(userNode)); } /** @@ -126,36 +123,36 @@ public class NodeController extends BaseController @GetMapping("/edit/{id}") public String edit(@PathVariable("id") Integer id, ModelMap mmap) { - Node node = nodeService.selectNodeById(id); - mmap.put("node", node); - return prefix + "/nodeEdit"; + UserNode userNode = userNodeService.selectUserNodeById(id); + mmap.put("userNode", userNode); + return prefix + "/userNodeEdit"; } /** * 修改保存用户节点 */ - @RequiresPermissions("project:node:edit") + @RequiresPermissions("project:userNode:edit") @Log(title = "用户节点", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(Node node) + public AjaxResult editSave(UserNode userNode) { SysUser sysUser = getSysUser(); - node.setUpdateBy(sysUser.getUserName()); - return toAjax(nodeService.updateOrAddNode(node)); + userNode.setUpdateBy(sysUser.getUserName()); + return toAjax(userNodeService.updateOrAddUserNode(userNode)); } /** * 删除用户节点 */ - @RequiresPermissions("project:node:remove") + @RequiresPermissions("project:userNode:remove") @Log(title = "用户节点", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) { - return toAjax(nodeService.deleteNodeByIds(ids)); + return toAjax(userNodeService.deleteUserNodeByIds(ids)); } } diff --git a/alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeLogController.java b/alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeLogController.java new file mode 100644 index 0000000..19bdc48 --- /dev/null +++ b/alive-admin/src/main/java/com/ruoyi/web/controller/UserNodeLogController.java @@ -0,0 +1,181 @@ +package com.ruoyi.web.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.system.domain.TMember; +import com.ruoyi.system.domain.UserNodeLog; +import com.ruoyi.system.service.TMemberService; +import com.ruoyi.system.service.UserNodeLogService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 节点认购记录Controller + * + * @author HayDen + * @date 2024-06-27 + */ +@Controller +@RequestMapping("/project/userNodeLog") +public class UserNodeLogController extends BaseController +{ + private String prefix = "project/userNodeLog"; + + @Autowired + private UserNodeLogService userNodeLogService; + + @Autowired + private TMemberService memberService; + + @RequiresPermissions("project:userNodeLog:view") + @GetMapping() + public String userNodeLog() + { + return prefix + "/userNodeLogList"; + } + + /** + * 查询节点认购记录列表 + */ + @RequiresPermissions("project:userNodeLog:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(UserNodeLog userNodeLog) + { + if(!org.apache.commons.lang3.StringUtils.isBlank(userNodeLog.getWalletAddress())){ + userNodeLog.setWalletAddress(userNodeLog.getWalletAddress().toLowerCase()); + } + startPage(); + List list = userNodeLogService.selectUserNodeLogList(userNodeLog); + return getDataTable(list); + } + + /** + * 查询节点认购记录对象 + */ + @RequiresPermissions("project:userNodeLog:userNodeLog") + @PostMapping("/userNodeLog") + @ResponseBody + public UserNodeLog findUserNodeLog(UserNodeLog userNodeLog) + { + userNodeLog = userNodeLogService.findUserNodeLog(userNodeLog); + return userNodeLog; + } + + /** + * 导出节点认购记录列表 + */ + @RequiresPermissions("project:userNodeLog:export") + @Log(title = "节点认购记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(UserNodeLog userNodeLog) + { + List list = userNodeLogService.selectUserNodeLogList(userNodeLog); + ExcelUtil util = new ExcelUtil(UserNodeLog.class); + return util.exportExcel(list, "节点认购记录"); + } + + /** + * 新增节点认购记录 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/userNodeLogAdd"; + } + /** + * 新增节点认购记录 + */ + @GetMapping(value = { "/add/{id}", "/add/" }) + public String add(@PathVariable(value = "id", required = false) Integer id, ModelMap mmap) + { + if (StringUtils.isNotNull(id)) + { + mmap.put("userNodeLog", userNodeLogService.selectUserNodeLogById(id)); + } + return prefix + "/userNodeLogAdd"; + } + + /** + * 新增保存节点认购记录 + */ + @RequiresPermissions("project:userNodeLog:add") + @Log(title = "节点认购记录", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(UserNodeLog userNodeLog) + { + SysUser sysUser = getSysUser(); + userNodeLog.setCreateBy(sysUser.getUserName()); + userNodeLog.setWalletAddress(userNodeLog.getWalletAddress().toLowerCase()); + TMember member = memberService.findTMember(new TMember().setAccount(userNodeLog.getWalletAddress())); + if(member == null){ + return error("用户不存在"); + } + userNodeLog.setUserId(member.getId().intValue()); + userNodeLog.setNodeSettingId(0); + userNodeLog.setBuyAmount(BigDecimal.ZERO); + userNodeLog.setStatus(2); + userNodeLog.setOrderNumber("0000000000000000"); + userNodeLog.setPayCoin("USDT"); + userNodeLog.setAddressOne("0"); + userNodeLog.setAwardOne(BigDecimal.ZERO); + userNodeLog.setAddressTwo("0"); + userNodeLog.setAwardTwo(BigDecimal.ZERO); + userNodeLog.setIllustrate("管理系统添加节点"); + userNodeLog.setDataJson("后台添加节点"); + return toAjax(userNodeLogService.updateOrAddUserNodeLog(userNodeLog)); + } + + /** + * 修改节点认购记录 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Integer id, ModelMap mmap) + { + UserNodeLog userNodeLog = userNodeLogService.selectUserNodeLogById(id); + mmap.put("userNodeLog", userNodeLog); + return prefix + "/userNodeLogEdit"; + } + + /** + * 修改保存节点认购记录 + */ + @RequiresPermissions("project:userNodeLog:edit") + @Log(title = "节点认购记录", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(UserNodeLog userNodeLog) + { + SysUser sysUser = getSysUser(); + userNodeLog.setUpdateBy(sysUser.getUserName()); + return toAjax(userNodeLogService.updateOrAddUserNodeLog(userNodeLog)); + } + + + /** + * 删除节点认购记录 + */ + @RequiresPermissions("project:userNodeLog:remove") + @Log(title = "节点认购记录", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(userNodeLogService.deleteUserNodeLogByIds(ids)); + } + +} diff --git a/alive-admin/src/main/resources/templates/project/config/configAdd.html b/alive-admin/src/main/resources/templates/project/config/configAdd.html new file mode 100644 index 0000000..f532939 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/config/configAdd.html @@ -0,0 +1,49 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/config/configEdit.html b/alive-admin/src/main/resources/templates/project/config/configEdit.html new file mode 100644 index 0000000..d966e77 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/config/configEdit.html @@ -0,0 +1,53 @@ + + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/config/configList.html b/alive-admin/src/main/resources/templates/project/config/configList.html new file mode 100644 index 0000000..bdf7f12 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/config/configList.html @@ -0,0 +1,86 @@ + + + + + + +
+
+
+ +
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigAdd.html b/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigAdd.html new file mode 100644 index 0000000..568e95d --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigAdd.html @@ -0,0 +1,37 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigEdit.html b/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigEdit.html new file mode 100644 index 0000000..1274704 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigEdit.html @@ -0,0 +1,38 @@ + + + + + + +
+
+ +
+ +
+ +
+
+ +
+
+ + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigList.html b/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigList.html new file mode 100644 index 0000000..92c32ec --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/nodeIncomeConfig/nodeIncomeConfigList.html @@ -0,0 +1,110 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/tMember/tMemberList.html b/alive-admin/src/main/resources/templates/project/tMember/tMemberList.html index 8310464..27fd15e 100644 --- a/alive-admin/src/main/resources/templates/project/tMember/tMemberList.html +++ b/alive-admin/src/main/resources/templates/project/tMember/tMemberList.html @@ -35,7 +35,7 @@
  •  搜索 -  团队盒子 +  重置
  • @@ -55,8 +55,8 @@ -->
    - - +
    @@ -67,7 +67,7 @@ var removeFlag = [[${@permission.hasPermi('project:tMember:remove')}]]; var prefix = ctx + "project/tMember"; - function getTeamNode(){ + /*function getTeamNode(){ var address = $("#account").val(); if(address == null || address == ''){ $.modal.alertWarning("请输入地址"); @@ -82,7 +82,7 @@ $("#nodeNumber").val(data.result); } }); - } + }*/ layui.use('laydate', function(){ var laydate = layui.laydate; @@ -102,11 +102,7 @@ var options = { url: prefix + "/list", createUrl: prefix + "/add", - subordinateListUrl: prefix + "/subordinateList", - getRebateListUrl: prefix + "/getRebateList", updateUrl: prefix + "/edit/{id}", - specificUrl: prefix + "/specific", - exportUrl: prefix + "/export", modalName: "用户", columns: [{ checkbox: true @@ -150,7 +146,7 @@ field: 'referId', title: '上级ID' }, - { + /* { field: 'rebate', title: '返佣' }, @@ -165,7 +161,7 @@ { field: 'accessories', title: 'NFT配件' - }, + },*/ { field: 'teamNum', title: '团队人数', @@ -173,10 +169,10 @@ return row.teamNum - 1; } }, - { + /*{ field: 'buyNumber', title: '团队盒子数量' - }, + },*/ { field: 'topUser', title: '特定用户', @@ -191,25 +187,7 @@ { field: 'createTime', title: '注册时间' - }, - { - title: '操作', - align: 'center', - formatter: function(value, row, index) { - var actions = []; - actions.push('下级 '); - var more = []; - more.push("返佣 "); - more.push("BRIT "); - more.push("积分 "); - more.push("配件 "); - actions.push('相关业绩 '); - if (row.topUser == 0) { - actions.push('特定顶级'); - } - return actions.join(''); - } - }] + }] }; $.table.init(options); }); diff --git a/alive-admin/src/main/resources/templates/project/userNode/userNodeAdd.html b/alive-admin/src/main/resources/templates/project/userNode/userNodeAdd.html new file mode 100644 index 0000000..7030a04 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/userNode/userNodeAdd.html @@ -0,0 +1,67 @@ + + + + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/userNode/userNodeEdit.html b/alive-admin/src/main/resources/templates/project/userNode/userNodeEdit.html new file mode 100644 index 0000000..dbf05ab --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/userNode/userNodeEdit.html @@ -0,0 +1,68 @@ + + + + + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/userNode/userNodeList.html b/alive-admin/src/main/resources/templates/project/userNode/userNodeList.html new file mode 100644 index 0000000..2f48c4b --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/userNode/userNodeList.html @@ -0,0 +1,127 @@ + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogAdd.html b/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogAdd.html new file mode 100644 index 0000000..332ab61 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogAdd.html @@ -0,0 +1,145 @@ + + + + + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    + + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogEdit.html b/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogEdit.html new file mode 100644 index 0000000..fccd498 --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogEdit.html @@ -0,0 +1,146 @@ + + + + + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogList.html b/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogList.html new file mode 100644 index 0000000..7349f2a --- /dev/null +++ b/alive-admin/src/main/resources/templates/project/userNodeLog/userNodeLogList.html @@ -0,0 +1,232 @@ + + + + + + +
    +
    +
    +
    +
    +
      +
    • + + +
    • + +
    • + + +
    • +
    • + + +
    • +
    • + + + +
    • + +
    • + + + - + +
    • +
    • +  搜索 +  重置 +
    • +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/alive-server/src/main/java/com/ruoyi/system/domain/Config.java b/alive-server/src/main/java/com/ruoyi/system/domain/Config.java new file mode 100644 index 0000000..b7ca8ea --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/domain/Config.java @@ -0,0 +1,69 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +/** + * 一些配置对象 sys_config + * + * @author HayDen + * @date 2024-06-27 + */ +@Setter +@Getter +@Accessors(chain = true) +public class Config extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 1正常,0删除 + */ + @Excel(name = "1正常,0删除") + private Integer flag; + + /** + * 分类,根据业务分组 + */ + @Excel(name = "分类,根据业务分组") + private String type; + + /** + * key + */ + @Excel(name = "key") + private String configKey; + + /** + * 1小数,2百分数,3字符串,4json,5整数 + */ + @Excel(name = "1小数,2百分数,3字符串,4json,5整数") + private Integer valueType; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String value; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String defaultValue; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String description; + + /** + * $column.columnComment + */ + @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + private String defaultDescription; + +} diff --git a/alive-server/src/main/java/com/ruoyi/system/domain/NodeAwardSetting.java b/alive-server/src/main/java/com/ruoyi/system/domain/NodeAwardSetting.java index d83c24f..988e5b7 100644 --- a/alive-server/src/main/java/com/ruoyi/system/domain/NodeAwardSetting.java +++ b/alive-server/src/main/java/com/ruoyi/system/domain/NodeAwardSetting.java @@ -1,6 +1,7 @@ package com.ruoyi.system.domain; import java.math.BigDecimal; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -8,68 +9,69 @@ import lombok.experimental.Accessors; import com.ruoyi.common.core.domain.BaseEntity; import lombok.Getter; import lombok.Setter; + import java.util.Date; + import com.ruoyi.common.core.domain.BaseEntity; /** * 节点奖励设置对象 node_award_setting - * + * * @author HayDen * @date 2024-02-24 */ @Setter @Getter @Accessors(chain = true) -public class NodeAwardSetting extends BaseEntity -{ +public class NodeAwardSetting extends BaseEntity { private static final long serialVersionUID = 1L; /** - * 节点奖励id - */ -@Excel(name = "节点奖励id") + * 节点奖励id + */ + @Excel(name = "节点奖励id") private Integer nodeSettingId; /** - * 返佣比例 - */ -@Excel(name = "返佣比例") + * 返佣比例 + */ + @Excel(name = "返佣比例") private BigDecimal rebate; /** - * 购买盒子获取Rbit奖励数量 - */ -@Excel(name = "购买盒子获取Rbit奖励数量") + * 购买盒子获取Rbit奖励数量 + */ + @Excel(name = "购买盒子获取Rbit奖励数量") private BigDecimal rbitAmount; /** - * 1代Rbit奖励比例 - */ -@Excel(name = "1代Rbit奖励比例") + * 1代Rbit奖励比例 + */ + @Excel(name = "1代Rbit奖励比例") private BigDecimal rbitOne; /** - * 2代Rbit奖励比例 - */ -@Excel(name = "2代Rbit奖励比例") + * 2代Rbit奖励比例 + */ + @Excel(name = "2代Rbit奖励比例") private BigDecimal rebateTwo; /** - * 购买盒子NFT碎片奖励数量 - */ -@Excel(name = "购买盒子NFT碎片奖励数量") + * 购买盒子NFT碎片奖励数量 + */ + @Excel(name = "购买盒子NFT碎片奖励数量") private BigDecimal nftAmount; /** - * 1代NFT碎片奖励比例 - */ -@Excel(name = "1代NFT碎片奖励比例") + * 1代NFT碎片奖励比例 + */ + @Excel(name = "1代NFT碎片奖励比例") private BigDecimal nftOne; /** - * 2代NFT碎片奖励比例 - */ -@Excel(name = "2代NFT碎片奖励比例") + * 2代NFT碎片奖励比例 + */ + @Excel(name = "2代NFT碎片奖励比例") private BigDecimal nftTwo; } diff --git a/alive-server/src/main/java/com/ruoyi/system/domain/NodeIncomeConfig.java b/alive-server/src/main/java/com/ruoyi/system/domain/NodeIncomeConfig.java new file mode 100644 index 0000000..bd697bf --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/domain/NodeIncomeConfig.java @@ -0,0 +1,35 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * 收益配置对象 node_income_config + * + * @author HayDen + * @date 2024-06-27 + */ +@Setter +@Getter +@Accessors(chain = true) +public class NodeIncomeConfig extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 收益比例 + */ + @Excel(name = "收益比例") + private BigDecimal income; + + /** + * 代数 + */ + @Excel(name = "代数") + private Integer era; + +} diff --git a/alive-server/src/main/java/com/ruoyi/system/domain/TMember.java b/alive-server/src/main/java/com/ruoyi/system/domain/TMember.java index 634643a..bd83691 100644 --- a/alive-server/src/main/java/com/ruoyi/system/domain/TMember.java +++ b/alive-server/src/main/java/com/ruoyi/system/domain/TMember.java @@ -98,31 +98,5 @@ public class TMember extends BaseEntity { private Integer teamNum; - /** - * 返佣 - */ - private String rebate; - - - /** - * BRIT - */ - private String brit; - - /** - * 积分 - */ - private String integral; - - /** - * 配件 - */ - private String accessories; - - /** - * 团队购买盒子数量,不算自己 - */ - private Integer buyNumber; - private Integer topUser; } diff --git a/alive-server/src/main/java/com/ruoyi/system/domain/UserNode.java b/alive-server/src/main/java/com/ruoyi/system/domain/UserNode.java new file mode 100644 index 0000000..cbfca4c --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/domain/UserNode.java @@ -0,0 +1,65 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * 用户节点对象 user_node + * + * @author HayDen + * @date 2024-06-27 + */ +@Setter +@Getter +@Accessors(chain = true) +public class UserNode extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 钱包地址 + */ + @Excel(name = "钱包地址") + private String walletAddress; + + /** + * 节点数量 + */ + @Excel(name = "节点数量") + private Integer nodeNumber; + + /** + * 冻结节点 + */ + @Excel(name = "冻结节点") + private Integer nodeFreeze; + + /** + * 支付总金额 + */ + @Excel(name = "支付总金额") + private BigDecimal buyAmountCount; + + /** + * 用户id + */ + @Excel(name = "用户id") + private Integer userId; + + /** + * 节点总量 + */ + @Excel(name = "节点总量") + private Integer nodeCount; + + /** + * 推广收入 + */ + @Excel(name = "推广收入") + private BigDecimal promotionUsdt; + +} diff --git a/alive-server/src/main/java/com/ruoyi/system/domain/UserNodeLog.java b/alive-server/src/main/java/com/ruoyi/system/domain/UserNodeLog.java new file mode 100644 index 0000000..6a86634 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/domain/UserNodeLog.java @@ -0,0 +1,114 @@ +package com.ruoyi.system.domain; + +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.math.BigDecimal; + +/** + * 节点认购记录对象 user_node_log + * + * @author HayDen + * @date 2024-06-27 + */ +@Setter +@Getter +@Accessors(chain = true) +public class UserNodeLog extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 钱包地址 + */ + @Excel(name = "钱包地址") + private String walletAddress; + + /** + * 认购数量 + */ + @Excel(name = "认购数量") + private Integer nodeNumber; + + /** + * 支付币种 + */ + @Excel(name = "支付币种") + private String payCoin; + + /** + * 认购金额 + */ + @Excel(name = "认购金额") + private BigDecimal buyAmount; + + /** + * 节点配置ID + */ + @Excel(name = "节点配置ID") + private Integer nodeSettingId; + + /** + * 1:订单生成 2:链上确认 3:支付成功 4:支付失败 + */ + @Excel(name = "1:订单生成 2:链上确认 3:支付成功 4:支付失败") + private Integer status; + + /** + * 用户id + */ + @Excel(name = "用户id") + private Integer userId; + + /** + * 交易hash + */ + @Excel(name = "交易hash") + private String hash; + + /** + * 订单号 + */ + @Excel(name = "订单号") + private String orderNumber; + + /** + * 一代奖励 + */ + @Excel(name = "一代奖励") + private String addressOne; + + /** + * 一代奖励金额 + */ + @Excel(name = "一代奖励金额") + private BigDecimal awardOne; + + /** + * 二代奖励 + */ + @Excel(name = "二代奖励") + private String addressTwo; + + /** + * 二代奖励金额 + */ + @Excel(name = "二代奖励金额") + private BigDecimal awardTwo; + + + /** + * 订单说明 + */ + @Excel(name = "订单说明") + private String illustrate; + + /** + * 数据JSON + */ + @Excel(name = "数据JSON") + private String dataJson; + +} diff --git a/alive-server/src/main/java/com/ruoyi/system/mapper/ConfigMapper.java b/alive-server/src/main/java/com/ruoyi/system/mapper/ConfigMapper.java new file mode 100644 index 0000000..871f217 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/mapper/ConfigMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.Config; + +import java.util.List; + +/** + * 一些配置Mapper接口 + * + * @author HayDen + * @date 2024-06-27 + */ +public interface ConfigMapper +{ + /** + * 查询一些配置 + * + * @param id 一些配置ID + * @return 一些配置 + */ + Config selectConfigById(Integer id); + + /** + * 查询一些配置列表 + * + * @param config 一些配置 + * @return 一些配置集合 + */ + List selectConfigList(Config config); + + /** + * 查询一些配置对象 + * + * @param config 一些配置 + * @return 一些配置 + */ + Config findConfig(Config config); + + /** + * 新增一些配置 + * + * @param config 一些配置 + * @return 结果 + */ + int insertConfig(Config config); + + /** + * 修改一些配置 + * + * @param config 一些配置 + * @return 结果 + */ + int updateConfig(Config config); + + /** + * 批量删除一些配置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteConfigByIds(String[] ids); +} diff --git a/alive-server/src/main/java/com/ruoyi/system/mapper/NodeIncomeConfigMapper.java b/alive-server/src/main/java/com/ruoyi/system/mapper/NodeIncomeConfigMapper.java new file mode 100644 index 0000000..de49a5c --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/mapper/NodeIncomeConfigMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.NodeIncomeConfig; + +import java.util.List; + +/** + * 收益配置Mapper接口 + * + * @author HayDen + * @date 2024-06-27 + */ +public interface NodeIncomeConfigMapper +{ + /** + * 查询收益配置 + * + * @param id 收益配置ID + * @return 收益配置 + */ + NodeIncomeConfig selectNodeIncomeConfigById(Integer id); + + /** + * 查询收益配置列表 + * + * @param nodeIncomeConfig 收益配置 + * @return 收益配置集合 + */ + List selectNodeIncomeConfigList(NodeIncomeConfig nodeIncomeConfig); + + /** + * 查询收益配置对象 + * + * @param nodeIncomeConfig 收益配置 + * @return 收益配置 + */ + NodeIncomeConfig findNodeIncomeConfig(NodeIncomeConfig nodeIncomeConfig); + + /** + * 新增收益配置 + * + * @param nodeIncomeConfig 收益配置 + * @return 结果 + */ + int insertNodeIncomeConfig(NodeIncomeConfig nodeIncomeConfig); + + /** + * 修改收益配置 + * + * @param nodeIncomeConfig 收益配置 + * @return 结果 + */ + int updateNodeIncomeConfig(NodeIncomeConfig nodeIncomeConfig); + + /** + * 批量删除收益配置 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteNodeIncomeConfigByIds(String[] ids); +} diff --git a/alive-server/src/main/java/com/ruoyi/system/mapper/TMemberMapper.java b/alive-server/src/main/java/com/ruoyi/system/mapper/TMemberMapper.java index 6f1e856..e73b754 100644 --- a/alive-server/src/main/java/com/ruoyi/system/mapper/TMemberMapper.java +++ b/alive-server/src/main/java/com/ruoyi/system/mapper/TMemberMapper.java @@ -38,11 +38,6 @@ public interface TMemberMapper List findInviteRespList(InviteResp inviteResp); - /** - * 查询下级购买盒子数量汇总 - */ - List findUserBoxRespList(@Param("ids")List ids); - /** * 查询用户对象 * diff --git a/alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeLogMapper.java b/alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeLogMapper.java new file mode 100644 index 0000000..cf5e048 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeLogMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.UserNodeLog; + +import java.util.List; + +/** + * 节点认购记录Mapper接口 + * + * @author HayDen + * @date 2024-06-27 + */ +public interface UserNodeLogMapper +{ + /** + * 查询节点认购记录 + * + * @param id 节点认购记录ID + * @return 节点认购记录 + */ + UserNodeLog selectUserNodeLogById(Integer id); + + /** + * 查询节点认购记录列表 + * + * @param userNodeLog 节点认购记录 + * @return 节点认购记录集合 + */ + List selectUserNodeLogList(UserNodeLog userNodeLog); + + /** + * 查询节点认购记录对象 + * + * @param userNodeLog 节点认购记录 + * @return 节点认购记录 + */ + UserNodeLog findUserNodeLog(UserNodeLog userNodeLog); + + /** + * 新增节点认购记录 + * + * @param userNodeLog 节点认购记录 + * @return 结果 + */ + int insertUserNodeLog(UserNodeLog userNodeLog); + + /** + * 修改节点认购记录 + * + * @param userNodeLog 节点认购记录 + * @return 结果 + */ + int updateUserNodeLog(UserNodeLog userNodeLog); + + /** + * 批量删除节点认购记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteUserNodeLogByIds(String[] ids); +} diff --git a/alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeMapper.java b/alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeMapper.java new file mode 100644 index 0000000..6dc5584 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/mapper/UserNodeMapper.java @@ -0,0 +1,62 @@ +package com.ruoyi.system.mapper; + +import com.ruoyi.system.domain.UserNode; + +import java.util.List; + +/** + * 用户节点Mapper接口 + * + * @author HayDen + * @date 2024-06-27 + */ +public interface UserNodeMapper +{ + /** + * 查询用户节点 + * + * @param id 用户节点ID + * @return 用户节点 + */ + UserNode selectUserNodeById(Integer id); + + /** + * 查询用户节点列表 + * + * @param userNode 用户节点 + * @return 用户节点集合 + */ + List selectUserNodeList(UserNode userNode); + + /** + * 查询用户节点对象 + * + * @param userNode 用户节点 + * @return 用户节点 + */ + UserNode findUserNode(UserNode userNode); + + /** + * 新增用户节点 + * + * @param userNode 用户节点 + * @return 结果 + */ + int insertUserNode(UserNode userNode); + + /** + * 修改用户节点 + * + * @param userNode 用户节点 + * @return 结果 + */ + int updateUserNode(UserNode userNode); + + /** + * 批量删除用户节点 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteUserNodeByIds(String[] ids); +} diff --git a/alive-server/src/main/java/com/ruoyi/system/service/ConfigService.java b/alive-server/src/main/java/com/ruoyi/system/service/ConfigService.java new file mode 100644 index 0000000..cc36ca3 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/service/ConfigService.java @@ -0,0 +1,86 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.Config; +import com.ruoyi.system.mapper.ConfigMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 一些配置Service业务层处理 + * + * @author HayDen + * @date 2024-06-27 + */ +@Service +public class ConfigService +{ + @Autowired + private ConfigMapper configMapper; + + /** + * 查询一些配置 + * + * @param id 一些配置ID + * @return 一些配置 + */ + public Config selectConfigById(Integer id) + { + return configMapper.selectConfigById(id); + } + + /** + * 查询一些配置列表 + * + * @param config 一些配置 + * @return 一些配置 + */ + public List selectConfigList(Config config) + { + List configList = configMapper.selectConfigList(config); + return configList; + } + + /** + * 查询一些配置对象 + * + * @param config 一些配置 + * @return 一些配置 + */ + public Config findConfig(Config config) + { + config = configMapper.findConfig(config); + return config; + } + + /** + * 修改或者添加一些配置 + * + * @param config 一些配置 + * @return 结果 + */ + public int updateOrAddConfig(Config config) { + if (config.getId() != null){ + config.setUpdateTime(DateUtils.getNowDate()); + config.setDefaultValue(config.getValue()); + return configMapper.updateConfig(config); + }else{ + config.setCreateTime(DateUtils.getNowDate()); + return configMapper.insertConfig(config); + } + } + + /** + * 删除一些配置对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteConfigByIds(String ids) + { + return configMapper.deleteConfigByIds(Convert.toStrArray(ids)); + } +} diff --git a/alive-server/src/main/java/com/ruoyi/system/service/NodeIncomeConfigService.java b/alive-server/src/main/java/com/ruoyi/system/service/NodeIncomeConfigService.java new file mode 100644 index 0000000..c95a601 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/service/NodeIncomeConfigService.java @@ -0,0 +1,85 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.NodeIncomeConfig; +import com.ruoyi.system.mapper.NodeIncomeConfigMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 收益配置Service业务层处理 + * + * @author HayDen + * @date 2024-06-27 + */ +@Service +public class NodeIncomeConfigService +{ + @Autowired + private NodeIncomeConfigMapper nodeIncomeConfigMapper; + + /** + * 查询收益配置 + * + * @param id 收益配置ID + * @return 收益配置 + */ + public NodeIncomeConfig selectNodeIncomeConfigById(Integer id) + { + return nodeIncomeConfigMapper.selectNodeIncomeConfigById(id); + } + + /** + * 查询收益配置列表 + * + * @param nodeIncomeConfig 收益配置 + * @return 收益配置 + */ + public List selectNodeIncomeConfigList(NodeIncomeConfig nodeIncomeConfig) + { + List nodeIncomeConfigList = nodeIncomeConfigMapper.selectNodeIncomeConfigList(nodeIncomeConfig); + return nodeIncomeConfigList; + } + + /** + * 查询收益配置对象 + * + * @param nodeIncomeConfig 收益配置 + * @return 收益配置 + */ + public NodeIncomeConfig findNodeIncomeConfig(NodeIncomeConfig nodeIncomeConfig) + { + nodeIncomeConfig = nodeIncomeConfigMapper.findNodeIncomeConfig(nodeIncomeConfig); + return nodeIncomeConfig; + } + + /** + * 修改或者添加收益配置 + * + * @param nodeIncomeConfig 收益配置 + * @return 结果 + */ + public int updateOrAddNodeIncomeConfig(NodeIncomeConfig nodeIncomeConfig) { + if (nodeIncomeConfig.getId() != null){ + nodeIncomeConfig.setUpdateTime(DateUtils.getNowDate()); + return nodeIncomeConfigMapper.updateNodeIncomeConfig(nodeIncomeConfig); + }else{ + nodeIncomeConfig.setCreateTime(DateUtils.getNowDate()); + return nodeIncomeConfigMapper.insertNodeIncomeConfig(nodeIncomeConfig); + } + } + + /** + * 删除收益配置对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteNodeIncomeConfigByIds(String ids) + { + return nodeIncomeConfigMapper.deleteNodeIncomeConfigByIds(Convert.toStrArray(ids)); + } +} diff --git a/alive-server/src/main/java/com/ruoyi/system/service/TMemberService.java b/alive-server/src/main/java/com/ruoyi/system/service/TMemberService.java index 942c915..c3645bf 100644 --- a/alive-server/src/main/java/com/ruoyi/system/service/TMemberService.java +++ b/alive-server/src/main/java/com/ruoyi/system/service/TMemberService.java @@ -61,14 +61,12 @@ public class TMemberService public List selectTMemberList(TMember tMember) { List tMemberList = tMemberMapper.selectTMemberList(tMember); - for (TMember tMember1 : tMemberList){ - //团队购买盒子数量,不算自己 - tMember1.setBuyNumber(tMemberMapper.sumBoxNumber(tMember1.getId())); + /* for (TMember tMember1 : tMemberList){ tMember1.setRebate(new BigDecimal(tMember1.getRebate()).stripTrailingZeros().toPlainString()); tMember1.setBrit(new BigDecimal(tMember1.getBrit()).stripTrailingZeros().toPlainString()); tMember1.setIntegral(new BigDecimal(tMember1.getIntegral()).stripTrailingZeros().toPlainString()); tMember1.setAccessories(new BigDecimal(tMember1.getAccessories()).stripTrailingZeros().toPlainString()); - } + }*/ return tMemberList; } diff --git a/alive-server/src/main/java/com/ruoyi/system/service/UserNodeLogService.java b/alive-server/src/main/java/com/ruoyi/system/service/UserNodeLogService.java new file mode 100644 index 0000000..729d83b --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/service/UserNodeLogService.java @@ -0,0 +1,85 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.UserNodeLog; +import com.ruoyi.system.mapper.UserNodeLogMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 节点认购记录Service业务层处理 + * + * @author HayDen + * @date 2024-06-27 + */ +@Service +public class UserNodeLogService +{ + @Autowired + private UserNodeLogMapper userNodeLogMapper; + + /** + * 查询节点认购记录 + * + * @param id 节点认购记录ID + * @return 节点认购记录 + */ + public UserNodeLog selectUserNodeLogById(Integer id) + { + return userNodeLogMapper.selectUserNodeLogById(id); + } + + /** + * 查询节点认购记录列表 + * + * @param userNodeLog 节点认购记录 + * @return 节点认购记录 + */ + public List selectUserNodeLogList(UserNodeLog userNodeLog) + { + List userNodeLogList = userNodeLogMapper.selectUserNodeLogList(userNodeLog); + return userNodeLogList; + } + + /** + * 查询节点认购记录对象 + * + * @param userNodeLog 节点认购记录 + * @return 节点认购记录 + */ + public UserNodeLog findUserNodeLog(UserNodeLog userNodeLog) + { + userNodeLog = userNodeLogMapper.findUserNodeLog(userNodeLog); + return userNodeLog; + } + + /** + * 修改或者添加节点认购记录 + * + * @param userNodeLog 节点认购记录 + * @return 结果 + */ + public int updateOrAddUserNodeLog(UserNodeLog userNodeLog) { + if (userNodeLog.getId() != null){ + userNodeLog.setUpdateTime(DateUtils.getNowDate()); + return userNodeLogMapper.updateUserNodeLog(userNodeLog); + }else{ + userNodeLog.setCreateTime(DateUtils.getNowDate()); + return userNodeLogMapper.insertUserNodeLog(userNodeLog); + } + } + + /** + * 删除节点认购记录对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteUserNodeLogByIds(String ids) + { + return userNodeLogMapper.deleteUserNodeLogByIds(Convert.toStrArray(ids)); + } +} diff --git a/alive-server/src/main/java/com/ruoyi/system/service/UserNodeService.java b/alive-server/src/main/java/com/ruoyi/system/service/UserNodeService.java new file mode 100644 index 0000000..62fcb49 --- /dev/null +++ b/alive-server/src/main/java/com/ruoyi/system/service/UserNodeService.java @@ -0,0 +1,85 @@ +package com.ruoyi.system.service; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.system.domain.UserNode; +import com.ruoyi.system.mapper.UserNodeMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 用户节点Service业务层处理 + * + * @author HayDen + * @date 2024-06-27 + */ +@Service +public class UserNodeService +{ + @Autowired + private UserNodeMapper userNodeMapper; + + /** + * 查询用户节点 + * + * @param id 用户节点ID + * @return 用户节点 + */ + public UserNode selectUserNodeById(Integer id) + { + return userNodeMapper.selectUserNodeById(id); + } + + /** + * 查询用户节点列表 + * + * @param userNode 用户节点 + * @return 用户节点 + */ + public List selectUserNodeList(UserNode userNode) + { + List userNodeList = userNodeMapper.selectUserNodeList(userNode); + return userNodeList; + } + + /** + * 查询用户节点对象 + * + * @param userNode 用户节点 + * @return 用户节点 + */ + public UserNode findUserNode(UserNode userNode) + { + userNode = userNodeMapper.findUserNode(userNode); + return userNode; + } + + /** + * 修改或者添加用户节点 + * + * @param userNode 用户节点 + * @return 结果 + */ + public int updateOrAddUserNode(UserNode userNode) { + if (userNode.getId() != null){ + userNode.setUpdateTime(DateUtils.getNowDate()); + return userNodeMapper.updateUserNode(userNode); + }else{ + userNode.setCreateTime(DateUtils.getNowDate()); + return userNodeMapper.insertUserNode(userNode); + } + } + + /** + * 删除用户节点对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteUserNodeByIds(String ids) + { + return userNodeMapper.deleteUserNodeByIds(Convert.toStrArray(ids)); + } +} diff --git a/alive-server/src/main/resources/mapper/system/ConfigMapper.xml b/alive-server/src/main/resources/mapper/system/ConfigMapper.xml new file mode 100644 index 0000000..9314601 --- /dev/null +++ b/alive-server/src/main/resources/mapper/system/ConfigMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + select id, create_time, update_time, flag, type, config_key, value_type, value, default_value, description, default_description from sys_config + + + + + + + + + + insert into sys_config + + create_time, + update_time, + flag, + type, + config_key, + value_type, + value, + default_value, + description, + default_description, + + + #{createTime}, + #{updateTime}, + #{flag}, + #{type}, + #{configKey}, + #{valueType}, + #{value}, + #{defaultValue}, + #{description}, + #{defaultDescription}, + + + + + update sys_config + + create_time = #{createTime}, + update_time = #{updateTime}, + flag = #{flag}, + type = #{type}, + config_key = #{configKey}, + value_type = #{valueType}, + value = #{value}, + default_value = #{defaultValue}, + description = #{description}, + default_description = #{defaultDescription}, + + where id = #{id} + + + + delete from sys_config where id in + + #{id} + + + + \ No newline at end of file diff --git a/alive-server/src/main/resources/mapper/system/NodeIncomeConfigMapper.xml b/alive-server/src/main/resources/mapper/system/NodeIncomeConfigMapper.xml new file mode 100644 index 0000000..fcbbc5b --- /dev/null +++ b/alive-server/src/main/resources/mapper/system/NodeIncomeConfigMapper.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + select id, create_time, create_by, update_time, update_by, income, era from node_income_config + + + + + + + + + + insert into node_income_config + + create_time, + create_by, + update_time, + update_by, + income, + era, + + + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{income}, + #{era}, + + + + + update node_income_config + + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + income = #{income}, + era = #{era}, + + where id = #{id} + + + + delete from node_income_config where id in + + #{id} + + + + \ No newline at end of file diff --git a/alive-server/src/main/resources/mapper/system/TMemberMapper.xml b/alive-server/src/main/resources/mapper/system/TMemberMapper.xml index a7ed244..7337ff7 100644 --- a/alive-server/src/main/resources/mapper/system/TMemberMapper.xml +++ b/alive-server/src/main/resources/mapper/system/TMemberMapper.xml @@ -64,8 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select tm.*, (SELECT IFNULL(SUM(op_value),"0") FROM t_member_wallet_log WHERE member_id=tm.id AND op_type=12) as rebate, (SELECT IFNULL(SUM(op_value),"0") FROM t_member_wallet_log WHERE member_id=tm.id AND op_type in(4,6,8)) as brit, - (SELECT IFNULL(SUM(op_value),"0") FROM t_member_wallet_log WHERE member_id=tm.id AND op_type in(10,11)) as integral, - (SELECT IFNULL(SUM(op_value),"0") FROM t_member_wallet_log WHERE member_id=tm.id AND op_type in(5,7,9)) as accessories + (SELECT IFNULL(SUM(op_value),"0") FROM t_member_wallet_log WHERE member_id=tm.id AND op_type in(10,11)) as integral from t_member tm and tm.id = #{id} @@ -104,14 +103,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + and id = #{id} + and wallet_address = #{walletAddress} + and node_number = #{nodeNumber} + and pay_coin = #{payCoin} + and buy_amount = #{buyAmount} + and node_setting_id = #{nodeSettingId} + and status = #{status} + and user_id = #{userId} + and hash = #{hash} + and order_number = #{orderNumber} + and address_one = #{addressOne} + and award_one = #{awardOne} + and address_two = #{addressTwo} + and award_two = #{awardTwo} + and illustrate = #{illustrate} + and data_json = #{dataJson} + and create_time between #{params.beginTime} and #{params.endTime} + + order by id desc + + + + + + + + insert into user_node_log + + create_time, + create_by, + update_time, + update_by, + wallet_address, + node_number, + pay_coin, + buy_amount, + node_setting_id, + status, + user_id, + hash, + order_number, + address_one, + award_one, + address_two, + award_two, + illustrate, + data_json, + + + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{walletAddress}, + #{nodeNumber}, + #{payCoin}, + #{buyAmount}, + #{nodeSettingId}, + #{status}, + #{userId}, + #{hash}, + #{orderNumber}, + #{addressOne}, + #{awardOne}, + #{addressTwo}, + #{awardTwo}, + #{illustrate}, + #{dataJson}, + + + + + update user_node_log + + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + wallet_address = #{walletAddress}, + node_number = #{nodeNumber}, + pay_coin = #{payCoin}, + buy_amount = #{buyAmount}, + node_setting_id = #{nodeSettingId}, + status = #{status}, + user_id = #{userId}, + hash = #{hash}, + order_number = #{orderNumber}, + address_one = #{addressOne}, + award_one = #{awardOne}, + address_two = #{addressTwo}, + award_two = #{awardTwo}, + illustrate = #{illustrate}, + data_json = #{dataJson}, + + where id = #{id} + + + + delete from user_node_log where id in + + #{id} + + + + \ No newline at end of file diff --git a/alive-server/src/main/resources/mapper/system/UserNodeMapper.xml b/alive-server/src/main/resources/mapper/system/UserNodeMapper.xml new file mode 100644 index 0000000..0f562ff --- /dev/null +++ b/alive-server/src/main/resources/mapper/system/UserNodeMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + select id, create_time, create_by, update_time, update_by, wallet_address, node_number, node_freeze, buy_amount_count, user_id, node_count, promotion_usdt from user_node + + + + + + + + + + insert into user_node + + create_time, + create_by, + update_time, + update_by, + wallet_address, + node_number, + node_freeze, + buy_amount_count, + user_id, + node_count, + promotion_usdt, + + + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + #{walletAddress}, + #{nodeNumber}, + #{nodeFreeze}, + #{buyAmountCount}, + #{userId}, + #{nodeCount}, + #{promotionUsdt}, + + + + + update user_node + + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + wallet_address = #{walletAddress}, + node_number = #{nodeNumber}, + node_freeze = #{nodeFreeze}, + buy_amount_count = #{buyAmountCount}, + user_id = #{userId}, + node_count = #{nodeCount}, + promotion_usdt = #{promotionUsdt}, + + where id = #{id} + + + + delete from user_node where id in + + #{id} + + + + \ No newline at end of file