增加 统计图

master
wangh 7 months ago
parent 1afde55269
commit f001bd2bc5

@ -4,7 +4,7 @@ html {
body.signin {
height: auto;
background: url(../img/login_bg_new.jpg) no-repeat center fixed;
background: url(../img/main_bg.png) no-repeat center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;

@ -1,6 +1,8 @@
package com.ruoyi.manage.controller;
import java.util.List;
import com.ruoyi.manage.domain.ResultBeen;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -21,14 +23,13 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
*
* @author wangh
* @date 2024-01-17
*/
@Controller
@RequestMapping("/manage/ledger_rfid")
public class LedgerRfidController extends BaseController
{
public class LedgerRfidController extends BaseController {
private String prefix = "manage/ledger_rfid";
@Autowired
@ -36,19 +37,22 @@ public class LedgerRfidController extends BaseController
@RequiresPermissions("manage:ledger_rfid:view")
@GetMapping()
public String ledger_rfid()
{
public String ledger_rfid() {
return prefix + "/ledger_rfid";
}
@GetMapping("/count")
public String count() {
return prefix + "/count";
}
/**
*
*/
@RequiresPermissions("manage:ledger_rfid:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(LedgerRfid ledgerRfid)
{
public TableDataInfo list(LedgerRfid ledgerRfid) {
startPage();
List<LedgerRfid> list = ledgerRfidService.selectLedgerRfidList(ledgerRfid);
return getDataTable(list);
@ -61,8 +65,7 @@ public class LedgerRfidController extends BaseController
@Log(title = "轮挡台账", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(LedgerRfid ledgerRfid)
{
public AjaxResult export(LedgerRfid ledgerRfid) {
List<LedgerRfid> list = ledgerRfidService.selectLedgerRfidList(ledgerRfid);
ExcelUtil<LedgerRfid> util = new ExcelUtil<LedgerRfid>(LedgerRfid.class);
return util.exportExcel(list, "轮挡台账数据");
@ -72,8 +75,7 @@ public class LedgerRfidController extends BaseController
*
*/
@GetMapping("/add")
public String add()
{
public String add() {
return prefix + "/add";
}
@ -84,8 +86,7 @@ public class LedgerRfidController extends BaseController
@Log(title = "轮挡台账", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(LedgerRfid ledgerRfid)
{
public AjaxResult addSave(LedgerRfid ledgerRfid) {
return toAjax(ledgerRfidService.insertLedgerRfid(ledgerRfid));
}
@ -94,8 +95,7 @@ public class LedgerRfidController extends BaseController
*/
@RequiresPermissions("manage:ledger_rfid:edit")
@GetMapping("/edit/{objid}")
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
{
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
LedgerRfid ledgerRfid = ledgerRfidService.selectLedgerRfidByObjid(objid);
mmap.put("ledgerRfid", ledgerRfid);
return prefix + "/edit";
@ -108,8 +108,7 @@ public class LedgerRfidController extends BaseController
@Log(title = "轮挡台账", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(LedgerRfid ledgerRfid)
{
public AjaxResult editSave(LedgerRfid ledgerRfid) {
return toAjax(ledgerRfidService.updateLedgerRfid(ledgerRfid));
}
@ -118,17 +117,25 @@ public class LedgerRfidController extends BaseController
*/
@RequiresPermissions("manage:ledger_rfid:remove")
@Log(title = "轮挡台账", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
public AjaxResult remove(String ids) {
return toAjax(ledgerRfidService.deleteLedgerRfidByObjids(ids));
}
@PostMapping("/selectWasteNumber")
@ResponseBody
public AjaxResult selectWasteNumber(){
int number=ledgerRfidService.countWasteNumber();
public AjaxResult selectWasteNumber() {
int number = ledgerRfidService.countWasteNumber();
return success(number);
}
@PostMapping("/countRfid")
@ResponseBody
public AjaxResult countRfid() {
List<ResultBeen> list=ledgerRfidService.countRfid();
return success(list);
}
}

@ -0,0 +1,26 @@
package com.ruoyi.manage.domain;
/**
* @author wanghao
* @date 2024/2/29 13:40
*/
public class ResultBeen {
private String name;
private String value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

@ -2,6 +2,7 @@ package com.ruoyi.manage.mapper;
import java.util.List;
import com.ruoyi.manage.domain.LedgerRfid;
import com.ruoyi.manage.domain.ResultBeen;
import org.springframework.stereotype.Repository;
/**
* Mapper
@ -61,4 +62,6 @@ public interface LedgerRfidMapper
public int deleteLedgerRfidByObjids(String[] objids);
int countWasteNumber();
List<ResultBeen> countRfid();
}

@ -2,6 +2,7 @@ package com.ruoyi.manage.service;
import java.util.List;
import com.ruoyi.manage.domain.LedgerRfid;
import com.ruoyi.manage.domain.ResultBeen;
/**
* Service
@ -60,4 +61,6 @@ public interface ILedgerRfidService
public int deleteLedgerRfidByObjid(Long objid);
int countWasteNumber();
List<ResultBeen> countRfid();
}

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manage.domain.ResultBeen;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.LedgerRfidMapper;
@ -93,4 +94,9 @@ public class LedgerRfidServiceImpl implements ILedgerRfidService {
public int countWasteNumber() {
return ledgerRfidMapper.countWasteNumber();
}
@Override
public List<ResultBeen> countRfid() {
return ledgerRfidMapper.countRfid();
}
}

@ -102,4 +102,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(objid) from ledger_rfid where location_type=1 and is_scrap=2
</select>
<select id="countRfid" resultType="com.ruoyi.manage.domain.ResultBeen">
select bl.location_code as name , count(rifd_code) as value
from base_location bl
left join ledger_rfid lr on lr.location_code = bl.location_code
where stote_tag = 2
and is_enable = 'Y'
group by bl.location_code
</select>
</mapper>

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('轮挡统计')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 select-table table-striped" id="main" style="width: 100% ;height: 100%">
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
var prefix = ctx + "manage/ledger_rfid";
$(function () {
$.post(prefix + "/countRfid", null, function(result) {
console.log(echarts)
var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;
option = {
grid:{
top:0,
left:0,
bottom:0,
right:0
},
tooltip :{},
series: [
{
type: 'treemap',
data: result.data
}
]
};
option && myChart.setOption(option);
});
});
</script>
</body>
</html>
Loading…
Cancel
Save