diff --git a/cyx-admin/src/main/java/com/cyx/web/base/controller/BigScreenController.java b/cyx-admin/src/main/java/com/cyx/web/base/controller/BigScreenController.java index 489447e..d072933 100644 --- a/cyx-admin/src/main/java/com/cyx/web/base/controller/BigScreenController.java +++ b/cyx-admin/src/main/java/com/cyx/web/base/controller/BigScreenController.java @@ -3,16 +3,16 @@ package com.cyx.web.base.controller; import com.cyx.common.core.controller.BaseController; import com.cyx.common.core.domain.AjaxResult; import com.cyx.common.core.domain.entity.SysUser; -import com.cyx.common.core.page.TableDataInfo; +import com.cyx.common.json.JSONObject; import com.cyx.web.base.domain.TAmentAdvancedDept; import com.cyx.web.base.domain.TAmentAdvancedParty; import com.cyx.web.base.domain.TAmentPartyAffairs; +import com.cyx.web.base.domain.TAmentTrade; import com.cyx.web.base.service.ITAmentAdvancedDeptService; import com.cyx.web.base.service.ITAmentAdvancedPartyService; import com.cyx.web.base.service.ITAmentPartyAffairsService; -import org.apache.shiro.authz.annotation.RequiresPermissions; +import com.cyx.web.base.service.ITAmentTradeService; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -122,6 +122,27 @@ public class BigScreenController extends BaseController { return AjaxResult.success(list); } + @Resource + private ITAmentTradeService tAmentTradeService; + + @PostMapping("/tradeEcharts") + @ResponseBody + public AjaxResult tradeEcharts(TAmentTrade tAmentTrade) + { + int yearCount = 0; + double yearMoney = 0.0000; + JSONObject object = new JSONObject(); + List> list = tAmentTradeService.tradeEcharts(tAmentTrade); + for (int i=0;i list = tAmentTradeService.selectTAmentTradeList(tAmentTrade); + return getDataTable(list); + } + + /** + * 导出交易数据列表 + */ + @RequiresPermissions("base:trade:export") + @Log(title = "交易数据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(TAmentTrade tAmentTrade) + { + List list = tAmentTradeService.selectTAmentTradeList(tAmentTrade); + ExcelUtil util = new ExcelUtil(TAmentTrade.class); + return util.exportExcel(list, "交易数据数据"); + } + + /** + * 新增交易数据 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存交易数据 + */ + @RequiresPermissions("base:trade:add") + @Log(title = "交易数据", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(TAmentTrade tAmentTrade) + { + return toAjax(tAmentTradeService.insertTAmentTrade(tAmentTrade)); + } + + /** + * 修改交易数据 + */ + @RequiresPermissions("base:trade:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + TAmentTrade tAmentTrade = tAmentTradeService.selectTAmentTradeById(id); + mmap.put("tAmentTrade", tAmentTrade); + return prefix + "/edit"; + } + + /** + * 修改保存交易数据 + */ + @RequiresPermissions("base:trade:edit") + @Log(title = "交易数据", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(TAmentTrade tAmentTrade) + { + return toAjax(tAmentTradeService.updateTAmentTrade(tAmentTrade)); + } + + /** + * 删除交易数据 + */ + @RequiresPermissions("base:trade:remove") + @Log(title = "交易数据", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(tAmentTradeService.deleteTAmentTradeByIds(ids)); + } +} diff --git a/cyx-admin/src/main/java/com/cyx/web/base/domain/TAmentTrade.java b/cyx-admin/src/main/java/com/cyx/web/base/domain/TAmentTrade.java new file mode 100644 index 0000000..56bd55b --- /dev/null +++ b/cyx-admin/src/main/java/com/cyx/web/base/domain/TAmentTrade.java @@ -0,0 +1,93 @@ +package com.cyx.web.base.domain; + +import com.cyx.common.annotation.Excel; +import com.cyx.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 交易数据对象 t_ament_trade + * + * @author ruoyi + * @date 2023-09-18 + */ +public class TAmentTrade extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 交易数 */ + @Excel(name = "交易数") + private Long tradeCount; + + /** 交易额 */ + @Excel(name = "交易额") + private Long tradeMony; + + /** 类型(房屋建筑、市政、公路、铁路、民航、水运、水利、能源、邮电通信、其他) */ + @Excel(name = "类型", readConverterExp = "房=屋建筑、市政、公路、铁路、民航、水运、水利、能源、邮电通信、其他") + private String type; + + /** 年月份 */ + @Excel(name = "年月份") + private String monthOf; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setTradeCount(Long tradeCount) + { + this.tradeCount = tradeCount; + } + + public Long getTradeCount() + { + return tradeCount; + } + public void setTradeMony(Long tradeMony) + { + this.tradeMony = tradeMony; + } + + public Long getTradeMony() + { + return tradeMony; + } + public void setType(String type) + { + this.type = type; + } + + public String getType() + { + return type; + } + public void setMonthOf(String monthOf) + { + this.monthOf = monthOf; + } + + public String getMonthOf() + { + return monthOf; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("tradeCount", getTradeCount()) + .append("tradeMony", getTradeMony()) + .append("type", getType()) + .append("monthOf", getMonthOf()) + .toString(); + } +} diff --git a/cyx-admin/src/main/java/com/cyx/web/base/mapper/TAmentTradeMapper.java b/cyx-admin/src/main/java/com/cyx/web/base/mapper/TAmentTradeMapper.java new file mode 100644 index 0000000..a783d3d --- /dev/null +++ b/cyx-admin/src/main/java/com/cyx/web/base/mapper/TAmentTradeMapper.java @@ -0,0 +1,65 @@ +package com.cyx.web.base.mapper; + +import java.util.List; +import java.util.Map; + +import com.cyx.web.base.domain.TAmentTrade; + +/** + * 交易数据Mapper接口 + * + * @author ruoyi + * @date 2023-09-18 + */ +public interface TAmentTradeMapper +{ + /** + * 查询交易数据 + * + * @param id 交易数据主键 + * @return 交易数据 + */ + public TAmentTrade selectTAmentTradeById(Long id); + + /** + * 查询交易数据列表 + * + * @param tAmentTrade 交易数据 + * @return 交易数据集合 + */ + public List selectTAmentTradeList(TAmentTrade tAmentTrade); + + /** + * 新增交易数据 + * + * @param tAmentTrade 交易数据 + * @return 结果 + */ + public int insertTAmentTrade(TAmentTrade tAmentTrade); + + /** + * 修改交易数据 + * + * @param tAmentTrade 交易数据 + * @return 结果 + */ + public int updateTAmentTrade(TAmentTrade tAmentTrade); + + /** + * 删除交易数据 + * + * @param id 交易数据主键 + * @return 结果 + */ + public int deleteTAmentTradeById(Long id); + + /** + * 批量删除交易数据 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteTAmentTradeByIds(String[] ids); + + List> tradeEcharts(); +} diff --git a/cyx-admin/src/main/java/com/cyx/web/base/service/ITAmentTradeService.java b/cyx-admin/src/main/java/com/cyx/web/base/service/ITAmentTradeService.java new file mode 100644 index 0000000..4381359 --- /dev/null +++ b/cyx-admin/src/main/java/com/cyx/web/base/service/ITAmentTradeService.java @@ -0,0 +1,65 @@ +package com.cyx.web.base.service; + +import java.util.List; +import java.util.Map; + +import com.cyx.web.base.domain.TAmentTrade; + +/** + * 交易数据Service接口 + * + * @author ruoyi + * @date 2023-09-18 + */ +public interface ITAmentTradeService +{ + /** + * 查询交易数据 + * + * @param id 交易数据主键 + * @return 交易数据 + */ + public TAmentTrade selectTAmentTradeById(Long id); + + /** + * 查询交易数据列表 + * + * @param tAmentTrade 交易数据 + * @return 交易数据集合 + */ + public List selectTAmentTradeList(TAmentTrade tAmentTrade); + + /** + * 新增交易数据 + * + * @param tAmentTrade 交易数据 + * @return 结果 + */ + public int insertTAmentTrade(TAmentTrade tAmentTrade); + + /** + * 修改交易数据 + * + * @param tAmentTrade 交易数据 + * @return 结果 + */ + public int updateTAmentTrade(TAmentTrade tAmentTrade); + + /** + * 批量删除交易数据 + * + * @param ids 需要删除的交易数据主键集合 + * @return 结果 + */ + public int deleteTAmentTradeByIds(String ids); + + /** + * 删除交易数据信息 + * + * @param id 交易数据主键 + * @return 结果 + */ + public int deleteTAmentTradeById(Long id); + + List> tradeEcharts(TAmentTrade tAmentTrade); +} diff --git a/cyx-admin/src/main/java/com/cyx/web/base/service/impl/TAmentTradeServiceImpl.java b/cyx-admin/src/main/java/com/cyx/web/base/service/impl/TAmentTradeServiceImpl.java new file mode 100644 index 0000000..0da917f --- /dev/null +++ b/cyx-admin/src/main/java/com/cyx/web/base/service/impl/TAmentTradeServiceImpl.java @@ -0,0 +1,101 @@ +package com.cyx.web.base.service.impl; + +import java.util.List; +import java.util.Map; + +import com.cyx.common.core.text.Convert; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.cyx.web.base.mapper.TAmentTradeMapper; +import com.cyx.web.base.domain.TAmentTrade; +import com.cyx.web.base.service.ITAmentTradeService; + +/** + * 交易数据Service业务层处理 + * + * @author ruoyi + * @date 2023-09-18 + */ +@Service +public class TAmentTradeServiceImpl implements ITAmentTradeService +{ + @Autowired + private TAmentTradeMapper tAmentTradeMapper; + + /** + * 查询交易数据 + * + * @param id 交易数据主键 + * @return 交易数据 + */ + @Override + public TAmentTrade selectTAmentTradeById(Long id) + { + return tAmentTradeMapper.selectTAmentTradeById(id); + } + + /** + * 查询交易数据列表 + * + * @param tAmentTrade 交易数据 + * @return 交易数据 + */ + @Override + public List selectTAmentTradeList(TAmentTrade tAmentTrade) + { + return tAmentTradeMapper.selectTAmentTradeList(tAmentTrade); + } + + /** + * 新增交易数据 + * + * @param tAmentTrade 交易数据 + * @return 结果 + */ + @Override + public int insertTAmentTrade(TAmentTrade tAmentTrade) + { + return tAmentTradeMapper.insertTAmentTrade(tAmentTrade); + } + + /** + * 修改交易数据 + * + * @param tAmentTrade 交易数据 + * @return 结果 + */ + @Override + public int updateTAmentTrade(TAmentTrade tAmentTrade) + { + return tAmentTradeMapper.updateTAmentTrade(tAmentTrade); + } + + /** + * 批量删除交易数据 + * + * @param ids 需要删除的交易数据主键 + * @return 结果 + */ + @Override + public int deleteTAmentTradeByIds(String ids) + { + return tAmentTradeMapper.deleteTAmentTradeByIds(Convert.toStrArray(ids)); + } + + /** + * 删除交易数据信息 + * + * @param id 交易数据主键 + * @return 结果 + */ + @Override + public int deleteTAmentTradeById(Long id) + { + return tAmentTradeMapper.deleteTAmentTradeById(id); + } + + @Override + public List> tradeEcharts(TAmentTrade tAmentTrade){ + return tAmentTradeMapper.tradeEcharts(); + } +} diff --git a/cyx-system/src/main/resources/mapper/base/TAmentTradeMapper.xml b/cyx-system/src/main/resources/mapper/base/TAmentTradeMapper.xml new file mode 100644 index 0000000..ac502fa --- /dev/null +++ b/cyx-system/src/main/resources/mapper/base/TAmentTradeMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + select id, trade_count, trade_mony, type, month_of from t_ament_trade + + + + + + + + + + insert into t_ament_trade + + trade_count, + trade_mony, + type, + month_of, + + + #{tradeCount}, + #{tradeMony}, + #{type}, + #{monthOf}, + + + + + update t_ament_trade + + trade_count = #{tradeCount}, + trade_mony = #{tradeMony}, + type = #{type}, + month_of = #{monthOf}, + + where id = #{id} + + + + delete from t_ament_trade where id = #{id} + + + + delete from t_ament_trade where id in + + #{id} + + + + \ No newline at end of file