增加 统计图

master
wangh 7 months ago
parent 1afde55269
commit f001bd2bc5

@ -4,7 +4,7 @@ html {
body.signin { body.signin {
height: auto; 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; -webkit-background-size: cover;
-moz-background-size: cover; -moz-background-size: cover;
-o-background-size: cover; -o-background-size: cover;

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

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

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manage.domain.ResultBeen;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.LedgerRfidMapper; import com.ruoyi.manage.mapper.LedgerRfidMapper;
@ -93,4 +94,9 @@ public class LedgerRfidServiceImpl implements ILedgerRfidService {
public int countWasteNumber() { public int countWasteNumber() {
return ledgerRfidMapper.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 count(objid) from ledger_rfid where location_type=1 and is_scrap=2
</select> </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> </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