diff --git a/pom.xml b/pom.xml index 0f8e3f3d..3e880a4d 100644 --- a/pom.xml +++ b/pom.xml @@ -232,6 +232,7 @@ ruoyi-modules ruoyi-api ruoyi-common + ruoyi-modules/ruoyi-invest pom diff --git a/ruoyi-modules/ruoyi-invest/pom.xml b/ruoyi-modules/ruoyi-invest/pom.xml new file mode 100644 index 00000000..a429309b --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/pom.xml @@ -0,0 +1,108 @@ + + + + ruoyi + com.ruoyi + 3.6.1 + ../../pom.xml + + 4.0.0 + + ruoyi-invest + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + com.baomidou + mybatis-plus-boot-starter + 3.4.2 + + + + org.projectlombok + lombok + + + + + io.springfox + springfox-swagger-ui + ${swagger.fox.version} + + + + + mysql + mysql-connector-java + + + + + com.ruoyi + ruoyi-common-datasource + + + + + com.ruoyi + ruoyi-common-datascope + + + + + com.ruoyi + ruoyi-common-log + + + + + com.ruoyi + ruoyi-common-swagger + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java new file mode 100644 index 00000000..1c882421 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/RuoYiInvestApplication.java @@ -0,0 +1,34 @@ +package com.ruoyi.invest; + +import com.ruoyi.common.security.annotation.EnableCustomConfig; +import com.ruoyi.common.security.annotation.EnableRyFeignClients; +import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * 系统模块 + * + * @author ruoyi + */ +@EnableCustomConfig +@EnableCustomSwagger2 +@EnableRyFeignClients +@SpringBootApplication +public class RuoYiInvestApplication +{ + public static void main(String[] args) + { + SpringApplication.run(RuoYiInvestApplication.class, args); + System.out.println("(♥◠‿◠)ノ゙ 投资模块启动成功 ლ(´ڡ`ლ)゙ \n" + + " .-------. ____ __ \n" + + " | _ _ \\ \\ \\ / / \n" + + " | ( ' ) | \\ _. / ' \n" + + " |(_ o _) / _( )_ .' \n" + + " | (_,_).' __ ___(_ o _)' \n" + + " | |\\ \\ | || |(_,_)' \n" + + " | | \\ `' /| `-' / \n" + + " | | \\ / \\ / \n" + + " ''-' `'-' `-..-' "); + } +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java new file mode 100644 index 00000000..414860b9 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbFirmController.java @@ -0,0 +1,105 @@ +package com.ruoyi.invest.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.invest.service.TbFirmService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.invest.domain.TbFirm; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 企业Controller + * + * @author ruoyi + * @date 2023-01-13 + */ +@RestController +@RequestMapping("/firm") +public class TbFirmController extends BaseController +{ + @Autowired + private TbFirmService tbFirmService; + + /** + * 查询企业列表 + */ +// @RequiresPermissions("system:firm:list") + @GetMapping("/list") + public TableDataInfo list(TbFirm tbFirm) + { + startPage(); + List list = tbFirmService.selectTbFirmList(tbFirm); + return getDataTable(list); + } + + /** + * 导出企业列表 + */ +// @RequiresPermissions("system:firm:export") + @Log(title = "企业", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbFirm tbFirm) + { + List list = tbFirmService.selectTbFirmList(tbFirm); + ExcelUtil util = new ExcelUtil(TbFirm.class); + util.exportExcel(response, list, "企业数据"); + } + + /** + * 获取企业详细信息 + */ +// @RequiresPermissions("system:firm:query") + @GetMapping(value = "/{firmId}") + public AjaxResult getInfo(@PathVariable("firmId") Long firmId) + { + return success(tbFirmService.selectTbFirmByFirmId(firmId)); + } + + /** + * 新增企业 + */ +// @RequiresPermissions("system:firm:add") + @Log(title = "企业", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbFirm tbFirm) + { + return toAjax(tbFirmService.insertTbFirm(tbFirm)); + } + + /** + * 修改企业 + */ +// @RequiresPermissions("system:firm:edit") + @Log(title = "企业", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbFirm tbFirm) + { + return toAjax(tbFirmService.updateTbFirm(tbFirm)); + } + + /** + * 删除企业 + */ +// @RequiresPermissions("system:firm:remove") + @Log(title = "企业", businessType = BusinessType.DELETE) + @DeleteMapping("/{firmIds}") + public AjaxResult remove(@PathVariable Long[] firmIds) + { + return toAjax(tbFirmService.deleteTbFirmByFirmIds(firmIds)); + } +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java new file mode 100644 index 00000000..a3fa93de --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/controller/TbInvestController.java @@ -0,0 +1,104 @@ +package com.ruoyi.invest.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.annotation.RequiresPermissions; +import com.ruoyi.invest.domain.TbInvest; +import com.ruoyi.invest.service.TbInvestService; +import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.common.core.utils.poi.ExcelUtil; +import com.ruoyi.common.core.web.page.TableDataInfo; + +/** + * 投资Controller + * + * @author ruoyi + * @date 2023-01-13 + */ +@RestController +@RequestMapping("/invest") +public class TbInvestController extends BaseController +{ + @Autowired + private TbInvestService tbInvestService; + + /** + * 查询投资列表 + */ +// @RequiresPermissions("system:invest:list") + @GetMapping("/list") + public TableDataInfo list(TbInvest tbInvest) + { + startPage(); + List list = tbInvestService.selectTbInvestList(tbInvest); + return getDataTable(list); + } + + /** + * 导出投资列表 + */ +// @RequiresPermissions("system:invest:export") + @Log(title = "投资", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, TbInvest tbInvest) + { + List list = tbInvestService.selectTbInvestList(tbInvest); + ExcelUtil util = new ExcelUtil(TbInvest.class); + util.exportExcel(response, list, "投资数据"); + } + + /** + * 获取投资详细信息 + */ +// @RequiresPermissions("system:invest:query") + @GetMapping(value = "/{investId}") + public AjaxResult getInfo(@PathVariable("investId") Long investId) + { + return success(tbInvestService.selectTbInvestByInvestId(investId)); + } + + /** + * 新增投资 + */ +// @RequiresPermissions("system:invest:add") + @Log(title = "投资", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody TbInvest tbInvest) + { + return toAjax(tbInvestService.insertTbInvest(tbInvest)); + } + + /** + * 修改投资 + */ +// @RequiresPermissions("system:invest:edit") + @Log(title = "投资", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody TbInvest tbInvest) + { + return toAjax(tbInvestService.updateTbInvest(tbInvest)); + } + + /** + * 删除投资 + */ +// @RequiresPermissions("system:invest:remove") + @Log(title = "投资", businessType = BusinessType.DELETE) + @DeleteMapping("/{investIds}") + public AjaxResult remove(@PathVariable Long[] investIds) + { + return toAjax(tbInvestService.deleteTbInvestByInvestIds(investIds)); + } +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java new file mode 100644 index 00000000..0e78c2e1 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbFirm.java @@ -0,0 +1,71 @@ +package com.ruoyi.invest.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 企业表 + * @TableName tb_firm + */ +@TableName(value ="tb_firm") +@Data +public class TbFirm implements Serializable { + /** + * 企业id + */ + @TableId(type = IdType.AUTO) + private Integer firmId; + + /** + * 企业名称 + */ + private String firmName; + + /** + * 企业logo + */ + private String firmPic; + + /** + * 企业市值 + */ + private Double firmMarket; + + /** + * 企业描述 + */ + private String firmDesc; + + /** + * 删除状态0:存在2:删除 + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建人 + */ + private String createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private String updateBy; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java new file mode 100644 index 00000000..8da1b383 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/domain/TbInvest.java @@ -0,0 +1,76 @@ +package com.ruoyi.invest.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 投资表 + * @TableName tb_invest + */ +@TableName(value ="tb_invest") +@Data +public class TbInvest implements Serializable { + /** + * 投资id + */ + @TableId(type = IdType.AUTO) + private Integer investId; + + /** + * 用户id + */ + private Integer userId; + + /** + * 企业id + */ + private Integer firmId; + + /** + * 投资金额 + */ + private Double investAmount; + + /** + * 投资收益 + */ + private Double investYield; + + /** + * 投资状态0:手动投资1:自动投资 + */ + private Integer investState; + + /** + * 删除状态0:存在2:删除 + */ + private Integer delFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建人 + */ + private String createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private String updateBy; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java new file mode 100644 index 00000000..59437f28 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbFirmMapper.java @@ -0,0 +1,65 @@ +package com.ruoyi.invest.mapper; + +import com.ruoyi.invest.domain.TbFirm; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Entity com.ruoyi.invest.domain.TbFirm + */ +@Mapper +public interface TbFirmMapper extends BaseMapper { + /** + * 查询企业 + * + * @param firmId 企业主键 + * @return 企业 + */ + public TbFirm selectTbFirmByFirmId(Long firmId); + + /** + * 查询企业列表 + * + * @param tbFirm 企业 + * @return 企业集合 + */ + public List selectTbFirmList(TbFirm tbFirm); + + /** + * 新增企业 + * + * @param tbFirm 企业 + * @return 结果 + */ + public int insertTbFirm(TbFirm tbFirm); + + /** + * 修改企业 + * + * @param tbFirm 企业 + * @return 结果 + */ + public int updateTbFirm(TbFirm tbFirm); + + /** + * 删除企业 + * + * @param firmId 企业主键 + * @return 结果 + */ + public int deleteTbFirmByFirmId(Long firmId); + + /** + * 批量删除企业 + * + * @param firmIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTbFirmByFirmIds(Long[] firmIds); +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java new file mode 100644 index 00000000..9f84b152 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/mapper/TbInvestMapper.java @@ -0,0 +1,65 @@ +package com.ruoyi.invest.mapper; + +import com.ruoyi.invest.domain.TbInvest; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Entity com.ruoyi.invest.domain.TbInvest + */ +@Mapper +public interface TbInvestMapper extends BaseMapper { + /** + * 查询投资 + * + * @param investId 投资主键 + * @return 投资 + */ + public TbInvest selectTbInvestByInvestId(Long investId); + + /** + * 查询投资列表 + * + * @param tbInvest 投资 + * @return 投资集合 + */ + public List selectTbInvestList(TbInvest tbInvest); + + /** + * 新增投资 + * + * @param tbInvest 投资 + * @return 结果 + */ + public int insertTbInvest(TbInvest tbInvest); + + /** + * 修改投资 + * + * @param tbInvest 投资 + * @return 结果 + */ + public int updateTbInvest(TbInvest tbInvest); + + /** + * 删除投资 + * + * @param investId 投资主键 + * @return 结果 + */ + public int deleteTbInvestByInvestId(Long investId); + + /** + * 批量删除投资 + * + * @param investIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTbInvestByInvestIds(Long[] investIds); +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java new file mode 100644 index 00000000..a7df95f6 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbFirmService.java @@ -0,0 +1,59 @@ +package com.ruoyi.invest.service; + +import com.ruoyi.invest.domain.TbFirm; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * + */ +public interface TbFirmService extends IService { + /** + * 查询企业 + * + * @param firmId 企业主键 + * @return 企业 + */ + public TbFirm selectTbFirmByFirmId(Long firmId); + + /** + * 查询企业列表 + * + * @param tbFirm 企业 + * @return 企业集合 + */ + public List selectTbFirmList(TbFirm tbFirm); + + /** + * 新增企业 + * + * @param tbFirm 企业 + * @return 结果 + */ + public int insertTbFirm(TbFirm tbFirm); + + /** + * 修改企业 + * + * @param tbFirm 企业 + * @return 结果 + */ + public int updateTbFirm(TbFirm tbFirm); + + /** + * 批量删除企业 + * + * @param firmIds 需要删除的企业主键集合 + * @return 结果 + */ + public int deleteTbFirmByFirmIds(Long[] firmIds); + + /** + * 删除企业信息 + * + * @param firmId 企业主键 + * @return 结果 + */ + public int deleteTbFirmByFirmId(Long firmId); +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java new file mode 100644 index 00000000..56086c06 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/TbInvestService.java @@ -0,0 +1,59 @@ +package com.ruoyi.invest.service; + +import com.ruoyi.invest.domain.TbInvest; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * + */ +public interface TbInvestService extends IService { + /** + * 查询投资 + * + * @param investId 投资主键 + * @return 投资 + */ + public TbInvest selectTbInvestByInvestId(Long investId); + + /** + * 查询投资列表 + * + * @param tbInvest 投资 + * @return 投资集合 + */ + public List selectTbInvestList(TbInvest tbInvest); + + /** + * 新增投资 + * + * @param tbInvest 投资 + * @return 结果 + */ + public int insertTbInvest(TbInvest tbInvest); + + /** + * 修改投资 + * + * @param tbInvest 投资 + * @return 结果 + */ + public int updateTbInvest(TbInvest tbInvest); + + /** + * 批量删除投资 + * + * @param investIds 需要删除的投资主键集合 + * @return 结果 + */ + public int deleteTbInvestByInvestIds(Long[] investIds); + + /** + * 删除投资信息 + * + * @param investId 投资主键 + * @return 结果 + */ + public int deleteTbInvestByInvestId(Long investId); +} diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java new file mode 100644 index 00000000..c99ac7f4 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbFirmServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.invest.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.invest.domain.TbFirm; +import com.ruoyi.invest.service.TbFirmService; +import com.ruoyi.invest.mapper.TbFirmMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + */ +@Service +public class TbFirmServiceImpl extends ServiceImpl + implements TbFirmService{ + @Autowired + private TbFirmMapper tbFirmMapper; + + /** + * 查询企业 + * + * @param firmId 企业主键 + * @return 企业 + */ + @Override + public TbFirm selectTbFirmByFirmId(Long firmId) + { + return tbFirmMapper.selectTbFirmByFirmId(firmId); + } + + /** + * 查询企业列表 + * + * @param tbFirm 企业 + * @return 企业 + */ + @Override + public List selectTbFirmList(TbFirm tbFirm) + { + return tbFirmMapper.selectTbFirmList(tbFirm); + } + + /** + * 新增企业 + * + * @param tbFirm 企业 + * @return 结果 + */ + @Override + public int insertTbFirm(TbFirm tbFirm) + { + tbFirm.setCreateTime(DateUtils.getNowDate()); + return tbFirmMapper.insertTbFirm(tbFirm); + } + + /** + * 修改企业 + * + * @param tbFirm 企业 + * @return 结果 + */ + @Override + public int updateTbFirm(TbFirm tbFirm) + { + tbFirm.setUpdateTime(DateUtils.getNowDate()); + return tbFirmMapper.updateTbFirm(tbFirm); + } + + /** + * 批量删除企业 + * + * @param firmIds 需要删除的企业主键 + * @return 结果 + */ + @Override + public int deleteTbFirmByFirmIds(Long[] firmIds) + { + return tbFirmMapper.deleteTbFirmByFirmIds(firmIds); + } + + /** + * 删除企业信息 + * + * @param firmId 企业主键 + * @return 结果 + */ + @Override + public int deleteTbFirmByFirmId(Long firmId) + { + return tbFirmMapper.deleteTbFirmByFirmId(firmId); + } +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java new file mode 100644 index 00000000..1af6d5ce --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/java/com/ruoyi/invest/service/impl/TbInvestServiceImpl.java @@ -0,0 +1,99 @@ +package com.ruoyi.invest.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.utils.DateUtils; +import com.ruoyi.invest.domain.TbInvest; +import com.ruoyi.invest.service.TbInvestService; +import com.ruoyi.invest.mapper.TbInvestMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + */ +@Service +public class TbInvestServiceImpl extends ServiceImpl + implements TbInvestService{ + @Autowired + private TbInvestMapper tbInvestMapper; + + /** + * 查询投资 + * + * @param investId 投资主键 + * @return 投资 + */ + @Override + public TbInvest selectTbInvestByInvestId(Long investId) + { + return tbInvestMapper.selectTbInvestByInvestId(investId); + } + + /** + * 查询投资列表 + * + * @param tbInvest 投资 + * @return 投资 + */ + @Override + public List selectTbInvestList(TbInvest tbInvest) + { + return tbInvestMapper.selectTbInvestList(tbInvest); + } + + /** + * 新增投资 + * + * @param tbInvest 投资 + * @return 结果 + */ + @Override + public int insertTbInvest(TbInvest tbInvest) + { + tbInvest.setCreateTime(DateUtils.getNowDate()); + return tbInvestMapper.insertTbInvest(tbInvest); + } + + /** + * 修改投资 + * + * @param tbInvest 投资 + * @return 结果 + */ + @Override + public int updateTbInvest(TbInvest tbInvest) + { + tbInvest.setUpdateTime(DateUtils.getNowDate()); + return tbInvestMapper.updateTbInvest(tbInvest); + } + + /** + * 批量删除投资 + * + * @param investIds 需要删除的投资主键 + * @return 结果 + */ + @Override + public int deleteTbInvestByInvestIds(Long[] investIds) + { + return tbInvestMapper.deleteTbInvestByInvestIds(investIds); + } + + /** + * 删除投资信息 + * + * @param investId 投资主键 + * @return 结果 + */ + @Override + public int deleteTbInvestByInvestId(Long investId) + { + return tbInvestMapper.deleteTbInvestByInvestId(investId); + } +} + + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..f45744cc --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/bootstrap.yml @@ -0,0 +1,25 @@ +# Tomcat +server: + port: 9301 + +# Spring +spring: + application: + # 应用名称 + name: ruoyi-invest + profiles: + # 环境配置 + active: dev + cloud: + nacos: + discovery: + # 服务注册地址 + server-addr: 127.0.0.1:8848 + config: + # 配置中心地址 + server-addr: 127.0.0.1:8848 + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml b/ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml new file mode 100644 index 00000000..313140f7 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/logback.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/info.log + + + + ${log.path}/info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/error.log + + + + ${log.path}/error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml new file mode 100644 index 00000000..9a3d1147 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbFirmMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + select firm_id, firm_name, firm_pic, firm_market, firm_desc, del_flag, create_time, create_by, update_time, update_by from tb_firm + + + + + + + + insert into tb_firm + + firm_id, + firm_name, + firm_pic, + firm_market, + firm_desc, + del_flag, + create_time, + create_by, + update_time, + update_by, + + + #{firmId}, + #{firmName}, + #{firmPic}, + #{firmMarket}, + #{firmDesc}, + #{delFlag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update tb_firm + + firm_name = #{firmName}, + firm_pic = #{firmPic}, + firm_market = #{firmMarket}, + firm_desc = #{firmDesc}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where firm_id = #{firmId} + + + + delete from tb_firm where firm_id = #{firmId} + + + + delete from tb_firm where firm_id in + + #{firmId} + + + diff --git a/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml new file mode 100644 index 00000000..bafe16d3 --- /dev/null +++ b/ruoyi-modules/ruoyi-invest/src/main/resources/mapper/TbInvestMapper.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + select invest_id, user_id, firm_id, invest_amount, invest_yield, invest_state, del_flag, create_time, create_by, update_time, update_by from tb_invest + + + + + + + + insert into tb_invest + + user_id, + firm_id, + invest_amount, + invest_yield, + invest_state, + del_flag, + create_time, + create_by, + update_time, + update_by, + + + #{userId}, + #{firmId}, + #{investAmount}, + #{investYield}, + #{investState}, + #{delFlag}, + #{createTime}, + #{createBy}, + #{updateTime}, + #{updateBy}, + + + + + update tb_invest + + user_id = #{userId}, + firm_id = #{firmId}, + invest_amount = #{investAmount}, + invest_yield = #{investYield}, + invest_state = #{investState}, + del_flag = #{delFlag}, + create_time = #{createTime}, + create_by = #{createBy}, + update_time = #{updateTime}, + update_by = #{updateBy}, + + where invest_id = #{investId} + + + + delete from tb_invest where invest_id = #{investId} + + + + delete from tb_invest where invest_id in + + #{investId} + + + diff --git a/ruoyi-ui/src/api/invest/firm.js b/ruoyi-ui/src/api/invest/firm.js new file mode 100644 index 00000000..6013a18e --- /dev/null +++ b/ruoyi-ui/src/api/invest/firm.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询企业列表 +export function listFirm(query) { + return request({ + url: '/invest/firm/list', + method: 'get', + params: query + }) +} + +// 查询企业详细 +export function getFirm(firmId) { + return request({ + url: '/invest/firm/' + firmId, + method: 'get' + }) +} + +// 新增企业 +export function addFirm(data) { + return request({ + url: '/invest/firm', + method: 'post', + data: data + }) +} + +// 修改企业 +export function updateFirm(data) { + return request({ + url: '/invest/firm', + method: 'put', + data: data + }) +} + +// 删除企业 +export function delFirm(firmId) { + return request({ + url: '/invest/firm/' + firmId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/invest/invest.js b/ruoyi-ui/src/api/invest/invest.js new file mode 100644 index 00000000..abc0e021 --- /dev/null +++ b/ruoyi-ui/src/api/invest/invest.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询投资列表 +export function listInvest(query) { + return request({ + url: '/invest/invest/list', + method: 'get', + params: query + }) +} + +// 查询投资详细 +export function getInvest(investId) { + return request({ + url: '/invest/invest/' + investId, + method: 'get' + }) +} + +// 新增投资 +export function addInvest(data) { + return request({ + url: '/invest/invest', + method: 'post', + data: data + }) +} + +// 修改投资 +export function updateInvest(data) { + return request({ + url: '/invest/invest', + method: 'put', + data: data + }) +} + +// 删除投资 +export function delInvest(investId) { + return request({ + url: '/invest/invest/' + investId, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/invest/firm/index.vue b/ruoyi-ui/src/views/invest/firm/index.vue new file mode 100644 index 00000000..eadb7b0f --- /dev/null +++ b/ruoyi-ui/src/views/invest/firm/index.vue @@ -0,0 +1,287 @@ + + + diff --git a/ruoyi-ui/src/views/invest/invest/index.vue b/ruoyi-ui/src/views/invest/invest/index.vue new file mode 100644 index 00000000..8d7a6226 --- /dev/null +++ b/ruoyi-ui/src/views/invest/invest/index.vue @@ -0,0 +1,309 @@ + + +