Compare commits

...

4 Commits

Author SHA1 Message Date
杨万里 7361dad99c Merge branch 'master' of http://1.13.177.47:3000/Yangwl/SZXBGJ_HT
# Conflicts:
#	ruoyi-admin/src/main/resources/templates/tyre/tyre/stat.html
#	ruoyi-system/src/main/java/com/ruoyi/system/domain/BizOrderTireDetail.java
#	ruoyi-system/src/main/resources/mapper/tyre/BaseTyreMapper.xml
2 weeks ago
杨万里 11b96058d9 修改系统图表以及首页筛选框 2 weeks ago
杨万里 1378b3fd71 修改JDK版本 3 weeks ago
杨万里 c354b57a9a 修改查看保养工单数据 3 weeks ago

@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@ -147,12 +149,14 @@ public class SysIndexController extends BaseController
@PostMapping("/queryIndexData")
@ResponseBody
public AjaxResult queryIndexData()
public AjaxResult queryIndexData(SysDeptVo sysDeptVo)
{
Map map =new HashMap();
//查询库存、在用轮胎数量、车辆数量
Map tireTypeTotal = iBaseInventoryService.querytotal();
List<Map> mapList = iRecordWarehousingService.selectRecord();
Map tireTypeTotal = iBaseInventoryService.querytotal(sysDeptVo);
List<Map> mapList = iRecordWarehousingService.selectRecord(sysDeptVo);
//规格占比
List<Map> mapListTyreModel = iRecordWarehousingService.selectTyreModel();
//新胎装车统计

@ -25,6 +25,9 @@ import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.framework.shiro.service.SysPasswordService;
import com.ruoyi.system.service.ISysUserService;
import static com.ruoyi.common.utils.file.FileUploadUtils.extractFilename;
import static com.ruoyi.common.utils.file.FileUploadUtils.uuidFilename;
/**
*
*
@ -161,6 +164,8 @@ public class SysProfileController extends BaseController
if (!file.isEmpty())
{
SysUser currentUser = getSysUser();
String fileName = uuidFilename(file);
System.out.println(fileName);
String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
if (userService.updateUserAvatar(currentUser.getUserId(), avatar))
{

@ -1,8 +1,10 @@
package com.ruoyi.web.controller.tyre;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig;
@ -10,9 +12,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.service.IBaseCarService;
import com.ruoyi.system.service.IBizOrderTireDetailService;
import com.ruoyi.system.service.ISysAttachmentService;
import com.ruoyi.system.service.*;
import com.sun.jna.platform.win32.OaIdl;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,7 +22,6 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.service.IBizMaintenanceOrderService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
@ -46,6 +45,9 @@ public class BizMaintenanceOrderController extends BaseController
@Autowired
private IBaseCarService baseCarService;
@Autowired
private IBaseTyreService baseTyreService;
@Autowired
private IBizMaintenanceOrderService bizMaintenanceOrderService;
@ -131,7 +133,7 @@ public class BizMaintenanceOrderController extends BaseController
}
/**
*
*
*/
@RequiresPermissions("system:order:edit")
@GetMapping("/edit/{orderId}")
@ -139,6 +141,25 @@ public class BizMaintenanceOrderController extends BaseController
{
BizMaintenanceOrder bizMaintenanceOrder = bizMaintenanceOrderService.selectBizMaintenanceOrderByOrderId(orderId);
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
//查询前一个工单
BizMaintenanceOrder bizMaintenanceOrderBefore = bizMaintenanceOrderService.selectBizMaintenanceOrderByOrderIdBefore(bizMaintenanceOrder);
BizOrderTireDetail bizOrderTireDetail = new BizOrderTireDetail();
List<Map> bizOrderTireDetailsBefore = new ArrayList<>();
if (bizMaintenanceOrderBefore==null){
//如果上一次的检查结果为空
//则数据为车辆目前的安装数据
//查询此车辆安装的轮胎数据
bizOrderTireDetailsBefore = bizOrderTireDetailService.selectBaseTrieInstall(bizMaintenanceOrder.getPlateNumber());
}else {
bizOrderTireDetail.setOrderId(bizMaintenanceOrderBefore.getOrderId());
bizOrderTireDetailsBefore = bizOrderTireDetailService.selectBizOrderTireDetail(bizOrderTireDetail);
}
//查询此车辆的维保数据
bizOrderTireDetail.setOrderId(orderId);
List<Map> bizOrderTireDetails = bizOrderTireDetailService.selectBizOrderTireDetail(bizOrderTireDetail);
mmap.put("bizOrderTireDetailsBefore", bizOrderTireDetailsBefore);
mmap.put("bizOrderTireDetails", bizOrderTireDetails);
return prefix + "/edit";
}
@ -188,8 +209,9 @@ public class BizMaintenanceOrderController extends BaseController
}
/**
* PDA
* @param bizMaintenanceOrder
* PDA
* @param json
* @param files
* @return
*/
@PostMapping("/PDASaveMaintenanceOrder")

@ -28,6 +28,7 @@ import java.util.List;
public class RecordTyreInstallController extends BaseController
{
private String prefix = "tyre/install";
private String prefix_uninstall = "tyre/uninstall";
@Autowired
private IRecordTyreInstallService recordTyreInstallService;
@ -39,6 +40,12 @@ public class RecordTyreInstallController extends BaseController
return prefix + "/install";
}
@RequiresPermissions("tyre:install:uninstall")
@GetMapping("/uninstall")
public String uninstall()
{
return prefix_uninstall + "/install";
}
/**
*
*/

@ -7,7 +7,7 @@ ruoyi:
# 版权年份
copyrightYear: 2026
# 实例演示开关
demoEnabled: true
demoEnabled: false
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: C:/ruoyi/uploadPath
# 获取ip地址开关

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 26 KiB

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>智能轮胎管理系统</title>
<title>公交轮胎管理系统</title>
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/>
@ -27,7 +27,7 @@
</div>
<a th:href="@{/index}">
<li class="logo hidden-xs">
<span class="logo-lg">智能轮胎管理系统</span>
<span class="logo-lg">公交轮胎管理系统</span>
</li>
</a>
<div class="sidebar-collapse tab-content" id="side-menu">

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>智能轮胎管理系统</title>
<title>公交轮胎管理系统</title>
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/>
@ -26,7 +26,7 @@
</div>
<a th:href="@{/index}">
<li class="logo hidden-xs">
<span class="logo-lg">智能轮胎管理系统</span>
<span class="logo-lg">公交轮胎管理系统</span>
</li>
</a>
<div class="sidebar-collapse">

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>智能轮胎系统登录</title>
<meta name="description" content="智能轮胎管理系统">
<title>公交轮胎管理系统登录</title>
<meta name="description" content="公交轮胎管理系统">
<!-- 原有CSS引用保持不变 -->
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
@ -118,12 +118,12 @@
<form id="signupForm" autocomplete="off">
<!-- 用户名 -->
<div class="form-group">
<input type="text" name="username" class="form-control uname" placeholder="请输入用户名" value="admin" />
<input type="text" name="username" class="form-control uname" placeholder="请输入用户名" value="" />
</div>
<!-- 密码 -->
<div class="form-group">
<input type="password" name="password" class="form-control pword" placeholder="请输入密码" value="haiwei@123" />
<input type="password" name="password" class="form-control pword" placeholder="请输入密码" value="" />
</div>
<!-- 验证码 (根据后端配置显示) -->

@ -30,8 +30,8 @@
<label>分公司: </label>
<select id="branchCompany" name="branchCompany" class="form-control" onchange="handleCompanyChange()">
<option value="">-- 请选择 --</option>
<option value="one">一分公司</option>
<option value="three">三分公司</option>
<option value="202">一分公司</option>
<option value="227">三分公司</option>
</select>
</li>
@ -43,7 +43,7 @@
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.form.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
@ -83,7 +83,7 @@
<div class="panel-body" style="padding: 10px;">
<div style="display: flex; align-items: center;">
<i class="fa fa-circle" style="color: #1ab394; margin-right: 5px;"></i>
<span style="font-weight: bold; font-size: 16px;">全新胎</span>
<span style="font-weight: bold; font-size: 14px;">全新胎</span>
</div>
<h2 style="margin: 10px 0;" id="newTop">305</h2>
<small id="new">在库: 305</small>
@ -96,7 +96,7 @@
<div class="panel-body" style="padding: 10px;">
<div style="display: flex; align-items: center;">
<i class="fa fa-circle" style="color: #ed5565; margin-right: 5px;"></i>
<span style="font-weight: bold; font-size: 16px;">翻新胎</span>
<span style="font-weight: bold; font-size: 14px;">翻新胎</span>
</div>
<h2 style="margin: 10px 0;" id="renovateTop">35</h2>
<small id="renovate">在库: 34 </small>
@ -109,7 +109,7 @@
<div class="panel-body" style="padding: 10px;">
<div style="display: flex; align-items: center;">
<i class="fa fa-circle" style="color: #f8ac59; margin-right: 5px;"></i>
<span style="font-weight: bold; font-size: 16px;">周转胎</span>
<span style="font-weight: bold; font-size: 14px;">周转胎</span>
</div>
<h2 style="margin: 10px 0;" id="circulatingTop">1</h2>
<small id="circulating">在库: 1 </small>
@ -122,7 +122,7 @@
<div class="panel-body" style="padding: 10px;">
<div style="display: flex; align-items: center;">
<i class="fa fa-circle" style="color: #3c5dbf; margin-right: 5px;"></i>
<span style="font-weight: bold; font-size: 16px;">实验胎</span>
<span style="font-weight: bold; font-size: 14px;">实验胎</span>
</div>
<h2 style="margin: 10px 0;"id="experimentalTop">1</h2>
<small id="experimental" >在库: 1 </small>
@ -213,426 +213,248 @@
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: echarts-js" />
<script th:inline="javascript">
// ... (保持原有的 editFlag, prefix, shopData 等变量定义不变) ...
var editFlag = [[${@permission.hasPermi('tyre:tyre:edit')}]];
var removeFlag = [[${@permission.hasPermi('tyre:tyre:remove')}]];
var prefix = ctx + "tyre/tyre";
var datas = [[${@dict.getType('tyre_type')}]];
// 修理厂数据源
var shopData = {
'one': [
{ value: 'guangming', name: '一分公司修理厂' },
], // 一分公司:空数组
'three': [ // 三分公司:包含两个选项
{ value: 'guangming', name: '光明修理厂' },
{ value: 'shiyan', name: '石岩修理厂' }
'202': [ { value: '229', name: '一分公司修理厂' }, ],
'227': [
{ value: '200', name: '光明修理厂' },
{ value: '201', name: '石岩修理厂' }
]
};
// 初始化 ECharts 实例
var pieChart = echarts.init(document.getElementById('pieChart'));
var lineChart = echarts.init(document.getElementById('lineChart'));
var specChart = echarts.init(document.getElementById('specChart'));
var sourceChart = echarts.init(document.getElementById('sourceChart'));
$(function() {
// 1. 初始化时间控件
$("input[name='birthday']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 实时时间更新
function updateClock() {
const now = new Date();
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const timeStr = now.toTimeString().substr(0, 8); // "11:14:10"
const dateStr = now.toLocaleDateString(); // "2026/4/15"
const weekStr = weekDays[now.getDay()];
// 2. 进入页面时,自动请求数据
loadData();
// 这里的 HTML 结构完全模拟了你图片中的样式
$('#clock').html(`${timeStr} <small style="color:#999; margin: 0 10px;">|</small> ${dateStr} ${weekStr}`);
}
// ================= 1. 环形图逻辑 (保持原有逻辑) =================
var pieChart = echarts.init(document.getElementById('pieChart'));
// 3. 启动时钟
updateClock();
setInterval(updateClock, 1000);
});
// ================= 核心修改:统一的数据加载函数 =================
function loadData() {
// 显示加载层(可选,提升体验)
// var index = layer.load(1);
function renderPieChart(data) {
var option = {
color: ['#1ab394', '#f8ac59', '#5B7CD9', '#ed5565', '#999'], // 配色方案
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
series: [
{
name: '实时库存',
type: 'pie',
radius: ['60%', '75%'], // 环形
avoidLabelOverlap: false,
label: {
show: false
},
labelLine: {
show: false
},
data: [
{ value: data.new, name: '新胎' },
{ value: data.circulating, name: '周转胎' },
{ value: data.renovate, name: '翻新胎' },
{ value: data.experimental, name: '试验胎' }
// 注意如果后端返回0这里也要传0否则图表会少一块
]
}
]
};
pieChart.setOption(option);
$('#new').text(`在库: ${data.new}`);
$('#circulating').text(`在库: ${data.circulating}`);
$('#renovate').text(`在库: ${data.renovate}`);
$('#experimental').text(`在库: ${data.experimental}`);
$('#newTop').text(`${data.new}`);
$('#circulatingTop').text(`${data.circulating}`);
$('#renovateTop').text(`${data.renovate}`);
$('#experimentalTop').text(`${data.experimental}`);
$('#right_new').text(`${data.new}`);
$('#right_circulating').text(`${data.circulating}`);
$('#right_renovate').text(`${data.renovate}`);
$('#right_experimental').text(`${data.experimental}`);
// 3. 动态更新中间的文字覆盖层
// 获取DOM元素并更新文本
const clockDiv = document.getElementById('pie-center-text');
if (clockDiv) {
// 这里复用你原本的逻辑,或者直接用接口返回的 total
clockDiv.innerHTML = `总数<br><span style="font-size:24px;font-weight:bold">${data.total || 0}</span>`;
}
}
// 4. 发起 AJAX 请求获取数据
$.ajax({
url: ctx+'queryIndexData', // 你的接口地址
url: ctx + 'queryIndexData',
type: 'POST',
// 关键点:使用 serialize() 自动收集表单内的 branchCompany 和 repairShop 值
data: $('#formId').serialize(),
dataType: 'json',
success: function(res) {
if (res.code === 0) { // 假设 code 0 代表成功
// 调用渲染函数
// layer.close(index);
if (res.code === 0) {
// 渲染各个图表
renderPieChart(res.data.tireTypeTotal);
// --- 新增代码:渲染折线图 ---
// 假设 res.data.mapList 是包含日期和数量的数组
if (res.data.mapList && res.data.mapList.length > 0) {
renderLineChart(res.data.mapList);
} else {
// 处理空数据情况,防止报错
renderLineChart([]);
}
// --- 新增代码:渲染规格占比图 ---
// 假设接口返回的数据结构为 res.data.mapListTyreModel
if (res.data.mapListTyreModel && res.data.mapListTyreModel.length > 0) {
renderSpecChart(res.data.mapListTyreModel);
} else {
renderSpecChart([]); // 传空数组显示暂无数据
}
// --- 新增代码:渲染规格占比图 ---
// 假设接口返回的数据结构为 res.data.mapListTyreModel
if (res.data.mapListInstall && res.data.mapListInstall.length > 0) {
renderSourceChart(res.data.mapListInstall);
} else {
renderSourceChart([]); // 传空数组显示暂无数据
}
if (res.data.mapList) renderLineChart(res.data.mapList);
if (res.data.mapListTyreModel) renderSpecChart(res.data.mapListTyreModel);
if (res.data.mapListInstall) renderSourceChart(res.data.mapListInstall);
} else {
// 错误处理
console.error('数据加载失败:', res.msg);
// 即使失败,也渲染一个默认的空数据或者错误提示
renderPieChart({total: 0, new: 0, circulating: 0, renovate: 0, experimental: 0});
renderLineChart([]);
renderSpecChart([]); // 错误时也传空
renderSourceChart([]); // 错误时也传空
$.modal.msgError(res.msg);
}
},
error: function() {
console.error('网络请求出错');
renderPieChart({total: 0, new: 0, circulating: 0, renovate: 0, experimental: 0});
// layer.close(index);
$.modal.msgError("数据请求失败");
}
});
}
// ================= 2. 折线图逻辑 (新增) =================
var lineChart = echarts.init(document.getElementById('lineChart'));
// ================= 表单操作逻辑 =================
function renderLineChart(mapList) {
// 1. 数据预处理:从 mapList 中提取 X轴(date) 和 Y轴数据
var dates = [];
var inData = []; // 入库数量 (type_0_count)
var outData = []; // 出库数量 (type_1_count)
// 搜索:直接调用加载函数
$.form.search = function() {
loadData();
};
mapList.forEach(function(item) {
dates.push(item.date); // X轴日期
inData.push(item.type_0_count); // Y轴入库
outData.push(item.type_1_count); // Y轴出库
});
// 重置:重置表单 + 恢复下拉框状态 + 重新加载
$.form.reset = function() {
$('form')[0].reset(); // 重置表单域
handleCompanyChange(); // 恢复修理厂下拉框的禁用状态
loadData(); // 重新加载默认数据
};
var lineOption = {
tooltip: {
trigger: 'axis'
},
legend: {
data: ['入库数量', '出库数量'],
right: '10%'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: dates, // 使用接口返回的日期
axisLine: {
lineStyle: {
color: '#ccc'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
splitLine: {
lineStyle: {
type: 'dashed',
color: '#eee'
}
}
},
series: [
{
name: '入库数量',
type: 'line',
smooth: true,
symbol: 'circle',
symbolSize: 6,
itemStyle: {
color: '#1ab394' // 绿色
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: 'rgba(26, 179, 148, 0.5)' },
{ offset: 0.8, color: 'rgba(26, 179, 148, 0.1)' }
])
},
data: inData // 使用接口返回的入库数据
},
{
name: '出库数量',
type: 'line',
smooth: true,
symbol: 'circle',
symbolSize: 6,
itemStyle: {
color: '#ed5565' // 红色
},
data: outData // 使用接口返回的出库数据
}
]
};
lineChart.setOption(lineOption);
}
// 窗口大小改变时重绘图表
window.addEventListener('resize', function() {
pieChart.resize();
lineChart.resize();
});
// ================= 规格占比图表 (修改版:支持异步数据) =================
var specChart = echarts.init(document.getElementById("specChart"));
// 1. 定义一个全局的颜色数组 (放在函数外面,避免 undefined 错误)
var specColors = ['#5B7CD9', '#8CC657', '#F7C763', '#E96966', '#73C0DE', '#45B97C', '#9A60B4', '#EA7E53'];
function renderSpecChart(modelData) {
// 1. 数据预处理
if (!modelData || modelData.length === 0) {
specChart.clear(); // 清空图表
specChart.setOption({
title: { text: '', left: 'center', top: 'center', textStyle: { fontSize: 16 } },
xAxis: { show: false },
yAxis: { show: false },
series: []
});
return;
}
// 2. 动态生成 Series 数据
// 使用 map 遍历后端传来的规格列表
var specSeries = modelData.map(function(item, index) {
// 使用 index % specColors.length 确保颜色循环使用,且不会越界
var color = specColors[index % specColors.length];
return {
name: item.tyreModel,
type: 'bar',
stack: 'total',
barWidth: 20,
label: { show: false },
itemStyle: {
color: color // 使用计算出的颜色
},
data: [item.total]
};
});
// 3. 生成图例数据
var legendData = modelData.map(item => item.tyreModel);
// 4. 设置图表 Option
var specOption = {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' }
},
legend: {
bottom: 0,
data: legendData,
textStyle: { fontSize: 12 }
},
grid: {
left: '50',
right: '20',
bottom: '60',
top: '10',
containLabel: true
},
xAxis: {
type: 'value',
max: function(value) {
return Math.ceil(value.max * 1.2);
},
splitLine: { show: true, lineStyle: { type: 'dashed' } }
},
yAxis: {
type: 'category',
data: ['规格统计'] // 可以改为动态的,或者保持单维度
},
series: specSeries
};
specChart.setOption(specOption);
}
// 初始化时传空数据
renderSpecChart([]);
// ================= 来源占比图表 (修改版:支持异步数据) =================
var sourceChart = echarts.init(document.getElementById("sourceChart"));
function renderSourceChart(modelData) {
// 1. 数据预处理
if (!modelData || modelData.length === 0) {
sourceChart.clear(); // 清空图表
sourceChart.setOption({
title: { text: '', left: 'center', top: 'center', textStyle: { fontSize: 16 } },
xAxis: { show: false },
yAxis: { show: false },
series: []
});
return;
}
// 2. 动态生成 Series 数据
// 使用 map 遍历后端传来的规格列表
var sourceSeries = modelData.map(function(item, index) {
// 使用 index % specColors.length 确保颜色循环使用,且不会越界
var color = specColors[index % specColors.length];
return {
name: item.tyreModel,
type: 'bar',
stack: 'total',
barWidth: 20,
label: { show: false },
itemStyle: {
color: color // 使用计算出的颜色
},
data: [item.total]
};
});
// 3. 生成图例数据
var legendData = modelData.map(item => item.tyreModel);
// 4. 设置图表 Option
var sourceOption = {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' }
},
legend: {
bottom: 0,
data: legendData,
textStyle: { fontSize: 12 }
},
grid: {
left: '50',
right: '20',
bottom: '60',
top: '10',
containLabel: true
},
xAxis: {
type: 'value',
max: function(value) {
return Math.ceil(value.max * 1.2);
},
splitLine: { show: true, lineStyle: { type: 'dashed' } }
},
yAxis: {
type: 'category',
data: ['装车统计'] // 可以改为动态的,或者保持单维度
},
series: sourceSeries
};
sourceChart.setOption(sourceOption);
}
renderSourceChart([])
// 窗口大小改变时自适应
window.addEventListener('resize', function() {
specChart.resize();
sourceChart.resize();
});
updateClock(); // 初始化
setInterval(updateClock, 1000); // 每秒刷新
});
// 分公司下拉框改变时触发的函数
// 分公司下拉框改变事件
function handleCompanyChange() {
var companyVal = $("#branchCompany").val(); // 获取选中的分公司值
var $shopSelect = $("#repairShop"); // 获取修理厂下拉框对象
var companyVal = $("#branchCompany").val();
var $shopSelect = $("#repairShop");
// 1. 清空修理厂下拉框现有的选项
$shopSelect.empty();
$shopSelect.empty(); // 清空旧选项
if (!companyVal) {
// 如果没选分公司
$shopSelect.append('<option value="">-- 请先选分公司 --</option>');
$shopSelect.prop('disabled', true); // 禁用下拉框
$shopSelect.prop('disabled', true);
} else {
// 获取对应的修理厂数据
var shops = shopData[companyVal];
if (shops && shops.length > 0) {
// 如果有数据,遍历添加
$shopSelect.append('<option value="">-- 请选择修理厂 --</option>'); // 增加一个空选项方便重置
shops.forEach(function(item) {
$shopSelect.append('<option value="' + item.value + '">' + item.name + '</option>');
});
$shopSelect.prop('disabled', false); // 启用下拉框
$shopSelect.prop('disabled', false);
} else {
// 如果是空数组(如一分公司)
$shopSelect.append('<option value="">-- 暂无数据 --</option>');
$shopSelect.prop('disabled', true); // 禁用下拉框
$shopSelect.prop('disabled', true);
}
}
}
$.form.reset = function() {
$('form').each(function() {
this.reset();
// ================= 图表渲染逻辑 (保持原有逻辑不变) =================
// 1. 时钟逻辑
function updateClock() {
const now = new Date();
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const timeStr = now.toTimeString().substr(0, 8);
const dateStr = now.toLocaleDateString();
const weekStr = weekDays[now.getDay()];
$('#clock').html(`${timeStr} <small style="color:#999; margin: 0 10px;">|</small> ${dateStr} ${weekStr}`);
}
// 2. 环形图
function renderPieChart(data) {
// ... (保持你原有的 renderPieChart 代码不变) ...
var option = {
color: ['#1ab394', '#f8ac59', '#5B7CD9', '#ed5565', '#999'],
tooltip: { trigger: 'item', formatter: '{a} <br/>{b}: {c} ({d}%)' },
series: [{
name: '实时库存',
type: 'pie',
radius: ['60%', '75%'],
avoidLabelOverlap: false,
label: { show: false },
labelLine: { show: false },
data: [
{ value: data.new, name: '新胎' },
{ value: data.circulating, name: '周转胎' },
{ value: data.renovate, name: '翻新胎' },
{ value: data.experimental, name: '试验胎' }
]
}]
};
pieChart.setOption(option);
// 更新DOM文本...
$('#new').text(`在库: ${data.new}`);
$('#circulating').text(`在库: ${data.circulating}`);
$('#renovate').text(`在库: ${data.renovate}`);
$('#experimental').text(`在库: ${data.experimental}`);
$('#newTop').text(`${data.new}`);
$('#circulatingTop').text(`${data.circulating}`);
$('#renovateTop').text(`${data.renovate}`);
$('#experimentalTop').text(`${data.experimental}`);
$('#right_new').text(`${data.new}`);
$('#right_circulating').text(`${data.circulating}`);
$('#right_renovate').text(`${data.renovate}`);
$('#right_experimental').text(`${data.experimental}`);
const clockDiv = document.getElementById('pie-center-text');
if (clockDiv) {
clockDiv.innerHTML = `总数<br><span style="font-size:24px;font-weight:bold">${data.total || 0}</span>`;
}
}
// 3. 折线图
function renderLineChart(mapList) {
// ... (保持你原有的 renderLineChart 代码不变) ...
var dates = [], inData = [], outData = [];
if(mapList){
mapList.forEach(function(item) {
dates.push(item.date);
inData.push(item.type_0_count);
outData.push(item.type_1_count);
});
}
var lineOption = {
tooltip: { trigger: 'axis' },
legend: { data: ['入库数量', '出库数量'], right: '10%' },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: { type: 'category', boundaryGap: false, data: dates, axisLine: { lineStyle: { color: '#ccc' } } },
yAxis: { type: 'value', axisLine: { show: false }, splitLine: { lineStyle: { type: 'dashed', color: '#eee' } } },
series: [
{
name: '入库数量', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6,
itemStyle: { color: '#1ab394' },
areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(26, 179, 148, 0.5)' }, { offset: 0.8, color: 'rgba(26, 179, 148, 0.1)' }]) },
data: inData
},
{
name: '出库数量', type: 'line', smooth: true, symbol: 'circle', symbolSize: 6,
itemStyle: { color: '#ed5565' },
data: outData
}
]
};
lineChart.setOption(lineOption);
}
// 4. 规格占比图
var specColors = ['#5B7CD9', '#8CC657', '#F7C763', '#E96966', '#73C0DE', '#45B97C', '#9A60B4', '#EA7E53'];
function renderSpecChart(modelData) {
// ... (保持你原有的 renderSpecChart 代码不变) ...
if (!modelData || modelData.length === 0) { specChart.clear(); return; }
var specSeries = modelData.map(function(item, index) {
var color = specColors[index % specColors.length];
return { name: item.tyreModel, type: 'bar', stack: 'total', barWidth: 20, label: { show: false }, itemStyle: { color: color }, data: [item.total] };
});
// 手动触发一次 change 事件,确保修理厂下拉框回到初始禁用状态
handleCompanyChange();
};
var specOption = {
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: { bottom: 0, data: modelData.map(i => i.tyreModel), textStyle: { fontSize: 12 } },
grid: { left: '50', right: '20', bottom: '60', top: '10', containLabel: true },
xAxis: { type: 'value', max: function(value) { return Math.ceil(value.max * 1.2); }, splitLine: { show: true, lineStyle: { type: 'dashed' } } },
yAxis: { type: 'category', data: ['规格统计'] },
series: specSeries
};
specChart.setOption(specOption);
}
// 5. 来源占比图
function renderSourceChart(modelData) {
// ... (保持你原有的 renderSourceChart 代码不变) ...
if (!modelData || modelData.length === 0) { sourceChart.clear(); return; }
var sourceSeries = modelData.map(function(item, index) {
var color = specColors[index % specColors.length];
return { name: item.tyreModel, type: 'bar', stack: 'total', barWidth: 20, label: { show: false }, itemStyle: { color: color }, data: [item.total] };
});
var sourceOption = {
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: { bottom: 0, data: modelData.map(i => i.tyreModel), textStyle: { fontSize: 12 } },
grid: { left: '50', right: '20', bottom: '60', top: '10', containLabel: true },
xAxis: { type: 'value', max: function(value) { return Math.ceil(value.max * 1.2); }, splitLine: { show: true, lineStyle: { type: 'dashed' } } },
yAxis: { type: 'category', data: ['装车统计'] },
series: sourceSeries
};
sourceChart.setOption(sourceOption);
}
// 窗口大小改变自适应
window.addEventListener('resize', function() {
pieChart.resize();
lineChart.resize();
specChart.resize();
sourceChart.resize();
});
</script>
</body>
</html>

@ -41,8 +41,8 @@
<li>
<p>操作类型</p>
<select name="type" th:with="type=${@dict.getType('install_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<option value="0">安装</option>
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
</select>
</li>
<li>
@ -115,9 +115,17 @@
field : 'tyreModel',
title : '规格型号'
},
{
field : 'company',
title : '所属分公司'
},
{
field : 'team',
title : '所属分公司车队'
title : '所属分公司修理厂'
},
{
field : 'carTeam',
title : '车队'
},
{
field : 'carNo',

@ -126,6 +126,41 @@
border-radius: 4px;
}
/* 状态样式:装胎 (橙色/金色) */
.status-installed {
border: 2px solid #f8ac59 !important; /* 橙色边框 */
background-color: #2f4050;
position: relative; /* 确保伪元素定位正确 */
}
/* 位置标签背景色 */
.status-installed .pos-tag {
background: #f8ac59;
color: #fff; /* 确保文字清晰 */
}
/* 轮胎纹路:稍微调亮一点,表示是新胎或重点关注的胎 */
.status-installed .tyre-pattern {
opacity: 0.8;
}
/* 中间的文字标签 */
.status-installed::after {
content: "装胎";
position: absolute;
top: 30%;
left: 50%;
transform: translateX(-50%);
color: #f8ac59; /* 文字颜色与边框呼应 */
font-weight: bold;
font-size: 14px;
z-index: 4;
background: rgba(255, 255, 255, 0.95); /* 稍微不透明一点,保证文字可读性 */
padding: 2px 8px;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* 加一点阴影更有立体感 */
}
/* 状态样式:空位 (灰色透明) */
.status-empty {
background: #e7eaec;
@ -165,13 +200,16 @@
<span class="info-label">完成操作人:</span><span class="info-value" id="finishUser" th:text="*{bizMaintenanceOrder.updateBy}"></span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">当前车辆里程(km)</span><span class="info-value" id="mileage" th:text="*{bizMaintenanceOrder.inputMileage}"></span>
<span class="info-label">上次维保里程(km)</span><span class="info-value" id="lastMileage" th:text="*{bizMaintenanceOrder.lastMileage}"></span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">当前车辆里程(km)</span><span class="info-value" id="inputMileage" th:text="*{bizMaintenanceOrder.inputMileage}"></span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">线路:</span><span class="info-value" id="route" th:text="*{bizMaintenanceOrder.line}"></span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">补充说明:</span><span class="info-value" id="remark" th:text="*{bizMaintenanceOrder.description}">-</span>
<span class="info-label">补充说明:</span><span class="info-value" id="description" th:text="*{bizMaintenanceOrder.description}">-</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">备注:</span><span class="info-value" id="remark" th:text="*{bizMaintenanceOrder.remark}">-</span>
@ -195,7 +233,7 @@
<!-- 维保后 -->
<div class="maint-section">
<div style="float: right;">
<button class="btn btn-white btn-xs"><i class="fa fa-history"></i> 操作记录</button>
<!-- <button class="btn btn-white btn-xs"><i class="fa fa-history"></i> 操作记录</button>-->
</div>
<div class="maint-title">维保后</div>
<div id="after-container">
@ -210,77 +248,169 @@
<script th:inline="javascript">
$(function() {
// 模拟数据
const mockData = {
before: [
{ pos: '左前', brand: '米其林', spec: '275/70R22.5', dot: '1223', depth: '12.5mm', status: 'normal' },
{ pos: '右前', brand: '米其林', spec: '275/70R22.5', dot: '1223', depth: '12.0mm', status: 'normal' },
{ pos: '左外', brand: '赛轮', spec: '245/70R19.5', dot: '3725', depth: '16.30mm', status: 'normal' },
{ pos: '左内', brand: '赛轮', spec: '245/70R19.5', dot: '4425', depth: '16.30mm', status: 'normal' },
{ pos: '右内', brand: '', spec: '', dot: '', depth: '', status: 'empty' }, // 空位
{ pos: '右外', brand: '', spec: '', dot: '', depth: '', status: 'empty' }
],
after: [
{ pos: '左前', brand: '米其林', spec: '275/70R22.5', dot: '1223', depth: '12.5mm', status: 'normal' },
{ pos: '右前', brand: '米其林', spec: '275/70R22.5', dot: '1223', depth: '12.0mm', status: 'normal' },
{ pos: '左外', brand: '赛轮', spec: '245/70R19.5', dot: '3725', depth: '16.30mm', status: 'removed' }, // 卸胎
{ pos: '左内', brand: '赛轮', spec: '245/70R19.5', dot: '4425', depth: '16.30mm', status: 'removed' }, // 卸胎
{ pos: '右内', brand: '', spec: '', dot: '', depth: '', status: 'empty' },
{ pos: '右外', brand: '', spec: '', dot: '', depth: '', status: 'empty' }
]
};
const POSITION_ORDER = [
'左前轮', '右前轮', // 轴1
'左外轮', '左内轮', '右内轮', '右外轮' // 轴2
];
var backendData = /*[[${bizOrderTireDetails}]]*/ null;
var beforeendData = /*[[${bizOrderTireDetailsBefore}]]*/ null;
// 检查数据是否为空
if (!backendData) {
console.error("未获取到轮胎数据");
return;
}
if (!beforeendData) {
console.error("未获取到轮胎数据");
return;
}
// 使用新函数处理数据
var formattedData = transformTyreData(backendData);
var formattedDataBefore = transformTyreData(beforeendData);
// --- 数据格式化 ---
// 假设后端数据结构包含position(位置), brand(品牌), spec(规格), dot, depth(深度)
// 这里需要将后端数据映射为 renderTyres 函数需要的格式
// var formattedData = backendData.map(function(item) {
// // 这里的字段名需要根据你实际返回的 Map 的 Key 进行调整
// // 例如:如果后端返回的是 "tireBrand",这里就写 item.tireBrand
// return {
// pos: item.position || item.pos || '未知', // 轮胎位置 (左前/右后等)
// brand: item.brand || '-', // 品牌
// spec: item.spec || '-', // 规格
// dot: item.dot || '-', // DOT
// depth: (item.depth || '0') + 'mm', // 深度 (加上单位)
// // 逻辑判断:如果深度小于某个值或者有特定标记,标记为 'removed',否则 'normal'
// // 这里简化处理,假设只要数据存在就是 normal或者根据后端字段 item.status 判断
// status: item.status === 'removed' ? 'removed' : 'normal'
// };
// });
// var formattedDataBefore = beforeendData.map(function(item) {
// // 这里的字段名需要根据你实际返回的 Map 的 Key 进行调整
// // 例如:如果后端返回的是 "tireBrand",这里就写 item.tireBrand
// return {
// pos: item.position || item.pos || '未知', // 轮胎位置 (左前/右后等)
// brand: item.brand || '-', // 品牌
// spec: item.spec || '-', // 规格
// dot: item.dot || '-', // DOT
// depth: (item.depth || '0') + 'mm', // 深度 (加上单位)
// // 逻辑判断:如果深度小于某个值或者有特定标记,标记为 'removed',否则 'normal'
// // 这里简化处理,假设只要数据存在就是 normal或者根据后端字段 item.status 判断
// status: item.status || 'normal'
// };
// });
// 渲染函数
function renderTyres(data, containerId) {
let html = '';
// 第一轴 (前轮)
// --- 第一轴 (前轮) ---
html += '<div class="axle-group">';
html += '<div class="axle-label">1</div>'; // 轴号
html += createTyreCard(data[0]);
html += createTyreCard(data[1]);
html += '<div class="axle-label">1</div>';
// 渲染前轴的两个位置 (索引 0 和 1)
// 如果数据不存在,传入 null 或空对象
html += createTyreCard(data[0] || null);
html += createTyreCard(data[1] || null);
html += '</div>';
// 第二轴 (后轮)
// --- 第二轴 (后轮) ---
html += '<div class="axle-group">';
html += '<div class="axle-label">2</div>'; // 轴号
html += createTyreCard(data[2]);
html += createTyreCard(data[3]);
html += createTyreCard(data[4]);
html += createTyreCard(data[5]);
html += '<div class="axle-label">2</div>';
// 渲染后轴的四个位置 (索引 2, 3, 4, 5)
// 如果数据不存在,传入 null
html += createTyreCard(data[2] || null);
html += createTyreCard(data[3] || null);
html += createTyreCard(data[4] || null);
html += createTyreCard(data[5] || null);
html += '</div>';
$(containerId).html(html);
}
// 创建单个轮胎卡片
function createTyreCard(tyre) {
// 空位处理
if (tyre.status === 'empty') {
return `<div class="tyre-card status-empty">
<div class="pos-tag">${tyre.pos}</div>
</div>`;
// 1. 如果 tyre 是 null 或 undefined直接返回空位
if (!tyre) {
return `
<div class="tyre-card status-empty">
<div class="pos-tag">未知</div>
</div>`;
}
// 状态类名
let statusClass = tyre.status === 'removed' ? 'status-removed' : '';
// 2. 如果 tyre 存在,但 status 是 'empty' (根据你的旧逻辑)
if (tyre.status === 'empty') {
// 注意:这里你可能需要根据 tyre.pos 来显示位置,如果 tyre 对象里有 pos 字段
return `
<div class="tyre-card status-empty">
<div class="pos-tag">${tyre.pos || '未知'}</div>
</div>`;
}
return `<div class="tyre-card ${statusClass}">
<div class="pos-tag">${tyre.pos}</div>
<div class="tyre-pattern"></div> <!-- 胎纹背景 -->
<div class="tyre-info">
<div class="tyre-brand">${tyre.brand}</div>
<div class="tyre-spec">${tyre.spec}</div>
<div class="tyre-dot">DOT ${tyre.dot}</div>
<div class="tyre-depth">${tyre.depth}</div>
<div class="tyre-status">常规检查</div>
</div>
</div>`;
// 3. 正常轮胎逻辑
// let statusClass = tyre.status === 'removed' ? 'status-removed' : '';
// 动态判断类名
let statusClass = '';
if (tyre.status === 'removed') {
statusClass = 'status-removed';
} else if (tyre.status === 'installed') { // 假设装胎的状态值是 'installed'
statusClass = 'status-installed';
}
return `
<div class="tyre-card ${statusClass}">
<div class="pos-tag">${tyre.pos}</div>
<div class="tyre-pattern"></div>
<div class="tyre-info">
<div class="tyre-brand">${tyre.brand}</div>
<div class="tyre-spec">${tyre.spec}</div>
<div class="tyre-dot">${tyre.dot}</div>
<div class="tyre-depth">${tyre.depth}</div>
<div class="tyre-status">常规检查</div>
</div>
</div>`;
}
// 执行渲染
renderTyres(formattedDataBefore, '#before-container');
renderTyres(formattedData, '#after-container');
// --- 工具函数:将后端扁平数据转换为固定长度的数组 ---
function transformTyreData(backendList) {
// 1. 先创建一个长度为6的空数组填充 null (代表空位)
let result = new Array(6).fill(null);
// 2. 遍历后端传来的每一条数据
if (backendList && backendList.length > 0) {
backendList.forEach(item => {
// 3. 获取后端数据中的位置名称
let pos = item.position || item.pos || '未知';
// 4. 查找这个位置在标准顺序 (POSITION_ORDER) 中的索引
// 例如:后端数据是 {position: "右内轮"},它在 POSITION_ORDER 中的索引是 4
let index = POSITION_ORDER.indexOf(pos);
// 5. 如果找到了对应的位置,就把格式化后的数据填入 result 数组的对应索引
if (index !== -1) {
result[index] = {
pos: pos,
brand: item.brand || '-',
spec: item.spec || '-',
dot: item.dot || '-',
depth: (item.depth || '0') + 'mm',
// 这里处理 status 逻辑:如果后端没传 status默认为 'normal'
status: item.status || 'normal'
};
}
// 如果没找到 (比如后端传了"备胎"这种页面不显示的位置),则忽略
});
}
return result; // 返回 [null, 轮胎数据, null, ...] 这种结构
}
// 执行渲染
renderTyres(mockData.before, '#before-container');
renderTyres(mockData.after, '#after-container');
});
</script>
</body>
</html>

@ -83,8 +83,7 @@
{
title : '在车轮胎',
align : 'center',
rowspan : 2
rowspan : 1
}
],
[{
@ -114,7 +113,11 @@
formatter: function(value, row, index) {
return formatStockCount(value, row, '实验胎');
}
}
},
{
field : '在车轮胎',
title : '在车轮胎'
}
]
]
};
@ -178,4 +181,4 @@
</script>
</body>
</html>
</html>

@ -42,7 +42,7 @@
</select>
</li>
<li>
<p>所属车队</p>
<p>修理厂</p>
<input type="text" name="team"/>
</li>
<li class="select-time">
@ -166,10 +166,18 @@
field : 'wheelPostion',
title : '安装轮位'
},
{
field : 'company',
title : '所属公司'
},
{
field : 'team',
title : '所属车队'
title : '所属修理厂'
},
{
field : 'carTeam',
title : '所属车队'
},
{
field : 'remark',
title : '备注'

@ -0,0 +1,46 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增轮胎安装记录')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-install-add">
<div class="form-group">
<label class="col-sm-3 control-label">轮胎RFID</label>
<div class="col-sm-8">
<input name="tyreRfid" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">类型 0安装 1卸下</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">里程:</label>
<div class="col-sm-8">
<input name="mileage" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
var prefix = ctx + "tyre/install"
$("#form-install-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-install-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改轮胎安装记录')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-install-edit" th:object="${recordTyreInstall}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">轮胎RFID</label>
<div class="col-sm-8">
<input name="tyreRfid" th:field="*{tyreRfid}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">轮胎胎号:</label>
<div class="col-sm-8">
<input name="tyreNo" th:field="*{tyreNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">轮胎自编号:</label>
<div class="col-sm-8">
<input name="selfNo" th:field="*{selfNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">车辆:</label>
<div class="col-sm-8">
<input name="carNo" th:field="*{carNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">轮位:</label>
<div class="col-sm-8">
<select name="wheelPostion" class="form-control m-b" th:with="type=${@dict.getType('WheelPosition')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">里程:</label>
<div class="col-sm-8">
<input name="mileage" th:field="*{mileage}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
var prefix = ctx + "tyre/install";
$("#form-install-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-install-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,181 @@
<!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 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<p>轮胎芯片:</p>
<input type="text" name="tyreRfid"/>
</li>
<li>
<p>胎号:</p>
<input type="text" name="tyreNo"/>
</li>
<li>
<p>自编号:</p>
<input type="text" name="selfNo"/>
</li>
<li>
<p>车牌号:</p>
<input type="text" name="carNo"/>
</li>
<li>
轮位:<select name="wheelPostion" th:with="type=${@dict.getType('WheelPosition')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
轮胎品牌:<select name="tyreBrand" th:with="type=${@dict.getType('brand')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<p>操作类型</p>
<select name="type" th:with="type=${@dict.getType('install_type')}">
<option value="1">卸下</option>
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="tyre:install:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="tyre:install:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="tyre:install:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tyre:install:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('tyre:install:edit')}]];
var removeFlag = [[${@permission.hasPermi('tyre:install:remove')}]];
var prefix = ctx + "tyre/install";
var datas = [[${@dict.getType('install_type')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "轮胎安装记录",
columns: [{
checkbox: true
},
{
field : 'id',
title : '主键',
visible: false
},
{
field : 'tyreRfid',
title : '轮胎芯片'
},
{
field : 'tyreNo',
title : '外胎号'
},
{
field : 'selfNo',
title : '自编号'
},
{
field : 'tyreBrand',
title : '品牌'
},
{
field : 'tyreModel',
title : '规格型号'
},
{
field : 'company',
title : '所属分公司'
},
{
field : 'team',
title : '所属分公司修理厂'
},
{
field : 'carTeam',
title : '车队'
},
{
field : 'carNo',
title : '车辆'
},
{
field : 'wheelPostion',
title : '轮位'
},
{
field : 'type',
title : '类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
},
{
field : 'mileage',
title : '里程(公里数)'
},
{
field : 'patternDepth',
title : '花纹深度(毫米)'
},
{
field : 'remark',
title : '备注'
},
{
field : 'createBy',
title : '操作人'
},
{
field : 'createTime',
title : '操作时间'
},
// {
// title: '操作',
// align: 'center',
// formatter: function(value, row, index) {
// var actions = [];
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -95,6 +95,11 @@
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

@ -0,0 +1,9 @@
package com.ruoyi.common.core.domain.entity;
import lombok.Data;
@Data
public class SysDeptVo {
private Long branchCompany;
private Long repairShop;
}

@ -57,10 +57,14 @@ public class BaseTyre extends BaseEntity
/** 轮胎类别 */
@Excel(name = "轮胎类别")
private String tyreType;
@Excel(name = "所属公司")
private String company;
/** 所属车队 */
@Excel(name = "所属车队")
@Excel(name = "所属修理厂")
private String team;
@Excel(name = "所属车队")
private String carTeam;
/** 所属场站 */
private String deptName;
@ -71,6 +75,22 @@ public class BaseTyre extends BaseEntity
private String wheelPostion;
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getCarTeam() {
return carTeam;
}
public void setCarTeam(String carTeam) {
this.carTeam = carTeam;
}
public String getPatternDepth() {
return patternDepth;
}

@ -57,7 +57,7 @@ public class BizOrderTireDetail extends BaseEntity
this.dataType = dataType;
}
public void setDetailId(Long detailId)
public void setDetailId(Long detailId)
{
this.detailId = detailId;
}

@ -25,8 +25,12 @@ public class RecordTyreInstall extends BaseEntity
private String tyreNo;
@Excel(name = "规格型号")
private String tyreModel;
@Excel(name = "所属")
@Excel(name = "分公司")
private String company;
@Excel(name = "修理厂")
private String team;
@Excel(name = "车队")
private String carTeam;
private String tyreBrand;
/** 类型 0安装 1卸下 */
@ -45,6 +49,21 @@ public class RecordTyreInstall extends BaseEntity
private String selfNo;
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getCarTeam() {
return carTeam;
}
public void setCarTeam(String carTeam) {
this.carTeam = carTeam;
}
public String getTyreModel() {
return tyreModel;

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import com.ruoyi.system.domain.BaseInventory;
import java.util.List;
@ -67,7 +68,7 @@ public interface BaseInventoryMapper
int updateBaseInventoryByEpc(BaseInventory baseInventory);
Map querytotal();
Map querytotal(SysDeptVo sysDeptVo);
int queryInCar();

@ -63,4 +63,6 @@ public interface BizMaintenanceOrderMapper
public int deleteBizMaintenanceOrderByOrderIds(String[] orderIds);
BizMaintenanceOrder selectBizMaintenanceOrderTD();
BizMaintenanceOrder selectBizMaintenanceOrderByOrderIdBefore(BizMaintenanceOrder bizMaintenanceOrder);
}

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper;
import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
@ -58,4 +60,8 @@ public interface BizOrderTireDetailMapper
* @return
*/
public int deleteBizOrderTireDetailByDetailIds(String[] detailIds);
List<Map> selectBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
List<Map> selectBaseTrieInstall(String plateNumber);
}

@ -2,6 +2,7 @@ package com.ruoyi.system.mapper;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import com.ruoyi.system.domain.RecordWarehousing;
import java.util.List;
@ -63,7 +64,7 @@ public interface RecordWarehousingMapper
*/
public int deleteRecordWarehousingByIds(String[] ids);
List<Map> selectRecord();
List<Map> selectRecord(SysDeptVo sysDeptVo);
List<Map> selectTyreModel();

@ -1,6 +1,7 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import com.ruoyi.system.domain.BaseInventory;
import com.ruoyi.system.domain.BaseTyre;
@ -68,7 +69,7 @@ public interface IBaseInventoryService
AjaxResult OutInventoryByPda(BaseInventory baseInventory, BaseTyre baseTyre);
Map querytotal();
Map querytotal(SysDeptVo sysDeptVo);
int queryInCar();

@ -2,6 +2,7 @@ package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BizMaintenanceOrder;
import org.apache.ibatis.annotations.Param;
/**
* Service
@ -63,4 +64,6 @@ public interface IBizMaintenanceOrderService
BizMaintenanceOrder selectBizMaintenanceOrderTD();
BizMaintenanceOrder selectBizMaintenanceOrderByOrderIdBefore(BizMaintenanceOrder bizMaintenanceOrder);
}

@ -1,6 +1,8 @@
package com.ruoyi.system.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
@ -58,4 +60,8 @@ public interface IBizOrderTireDetailService
* @return
*/
public int deleteBizOrderTireDetailByDetailId(Long detailId);
List<Map> selectBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
List<Map> selectBaseTrieInstall(String plateNumber);
}

@ -1,6 +1,7 @@
package com.ruoyi.system.service;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import com.ruoyi.system.domain.RecordWarehousing;
import java.util.List;
@ -62,7 +63,7 @@ public interface IRecordWarehousingService
*/
public int deleteRecordWarehousingById(Long id);
List<Map> selectRecord();
List<Map> selectRecord(SysDeptVo sysDeptVo);
List<Map> selectTyreModel();

@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
@ -127,7 +128,7 @@ public class BaseInventoryServiceImpl implements IBaseInventoryService
int m=0,t=0;
try {
if (isbaseInventory!=null){
return AjaxResult.error("该轮胎已仓库");
return AjaxResult.error("该轮胎已在!");
}else {
//插入库存表以及基础信息表
baseInventory.setStatus("0");
@ -208,8 +209,8 @@ public class BaseInventoryServiceImpl implements IBaseInventoryService
}
@Override
public Map querytotal() {
return baseInventoryMapper.querytotal();
public Map querytotal(SysDeptVo sysDeptVo) {
return baseInventoryMapper.querytotal(sysDeptVo);
}
@Override

@ -208,6 +208,7 @@ public class BaseTyreServiceImpl implements IBaseTyreService
}
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<Map> vTyreStockSummary(SysDept sysDept) {
List<Map> mapList = baseTyreMapper.vTyreStockSummary(sysDept);
return mapList;

@ -115,4 +115,9 @@ public class BizMaintenanceOrderServiceImpl implements IBizMaintenanceOrderServi
public BizMaintenanceOrder selectBizMaintenanceOrderTD() {
return bizMaintenanceOrderMapper.selectBizMaintenanceOrderTD();
}
@Override
public BizMaintenanceOrder selectBizMaintenanceOrderByOrderIdBefore(BizMaintenanceOrder bizMaintenanceOrder) {
return bizMaintenanceOrderMapper.selectBizMaintenanceOrderByOrderIdBefore(bizMaintenanceOrder);
}
}

@ -1,6 +1,8 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import java.util.Map;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -94,4 +96,14 @@ public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService
{
return bizOrderTireDetailMapper.deleteBizOrderTireDetailByDetailId(detailId);
}
@Override
public List<Map> selectBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail) {
return bizOrderTireDetailMapper.selectBizOrderTireDetail(bizOrderTireDetail);
}
@Override
public List<Map> selectBaseTrieInstall(String plateNumber) {
return bizOrderTireDetailMapper.selectBaseTrieInstall(plateNumber);
}
}

@ -1,6 +1,7 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.entity.SysDeptVo;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
@ -101,8 +102,8 @@ public class RecordWarehousingServiceImpl implements IRecordWarehousingService
}
@Override
public List<Map> selectRecord() {
return recordWarehousingMapper.selectRecord();
public List<Map> selectRecord(SysDeptVo sysDeptVo) {
return recordWarehousingMapper.selectRecord(sysDeptVo);
}
@Override

@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBaseInventoryVo"/>
<where>
<if test="tyreRfid != null and tyreRfid != ''"> and tyre_rfid = #{tyreRfid}</if>
<if test="tyreOutsideId != null and tyreOutsideId != ''"> and tyre_outside_id = #{tyreOutsideId}</if>
<!-- <if test="tyreOutsideId != null and tyreOutsideId != ''"> and tyre_outside_id = #{tyreOutsideId}</if>-->
<if test="number != null "> and number = #{number}</if>
</where>
</select>
@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="queryCarTotal" resultType="java.lang.Integer">
SELECT COUNT(*) FROM `base_car`
</select>
<select id="querytotal" resultType="java.util.Map">
<select id="querytotal" resultType="java.util.Map" parameterType="SysDeptVo">
SELECT
COUNT(bi.id) AS total,
COUNT(CASE WHEN bt.tyre_type IN ('全新胎', 'new') THEN 1 END) AS new,
@ -69,8 +69,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
COUNT(CASE WHEN bt.tyre_type IN ('renovate') THEN 1 END) AS renovate,
COUNT(CASE WHEN bt.tyre_type IN ('experimental') THEN 1 END) AS experimental
FROM base_inventory bi
INNER JOIN base_tyre bt ON bi.tyre_rfid = bt.tyre_epc
WHERE bi.status = '0';
INNER JOIN base_tyre bt ON bi.tyre_rfid = bt.tyre_epc
LEFT JOIN sys_dept d ON d.dept_id = bt.dept_id
WHERE bi.status = '0'
<if test="branchCompany != null and branchCompany != ''"> AND (bt.dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{branchCompany} OR find_in_set( #{branchCompany}, ancestors)))</if>
<if test="repairShop != null and repairShop != ''"> AND (bt.dept_id IN (SELECT dept_id FROM sys_dept WHERE dept_id = #{repairShop} OR find_in_set( #{repairShop}, ancestors)))</if>
</select>
<insert id="insertBaseInventory" parameterType="BaseInventory">

@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="carNo" column="car_no" />
<result property="wheelPostion" column="wheel_postion" />
<result property="patternDepth" column="pattern_depth" />
<result property="company" column="company" />
<result property="carTeam" column="carTeam" />
<result property="grooves" column="grooves" />
</resultMap>
@ -37,9 +39,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectBaseTyreList" parameterType="BaseTyre" resultMap="BaseTyreResult">
select tyre_id, tyre_no,self_no, tyre_epc, tyre_brand, tyre_model, tyre_level, tyre_pattern, pattern_depth,tyre_type, team, su.user_name as create_by, d.create_time, d.update_by, d.update_time, d.remark,car_no,wheel_postion
from base_tyre d
left join sys_user su ON su.login_name = d.create_by
SELECT
tyre_id,
tyre_no,
self_no,
tyre_epc,
tyre_brand,
tyre_model,
tyre_level,
tyre_pattern,
pattern_depth,
tyre_type,
sdss.dept_name as company,
d.team,
sd.dept_name as carTeam,
su.user_name AS create_by,
d.create_time,
d.update_by,
d.update_time,
d.remark,
d.car_no,
wheel_postion
FROM
base_tyre d
LEFT JOIN sys_user su ON su.login_name = d.create_by
LEFT JOIN base_car bc ON bc.car_no = d.car_no
LEFT JOIN sys_dept sd ON bc.dept_id = sd.dept_id
LEFT JOIN sys_dept sds ON sd.parent_id = sds.dept_id
LEFT JOIN sys_dept sdss ON sds.parent_id = sdss.dept_id
where tyre_id is not null
<if test="tyreNo != null and tyreNo != ''"> and tyre_no like concat('%', #{tyreNo}, '%')</if>
<if test="selfNo != null and selfNo != ''"> and self_no like concat('%', #{selfNo}, '%')</if>
@ -49,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tyreLevel != null and tyreLevel != ''"> and tyre_level = #{tyreLevel}</if>
<if test="tyrePattern != null and tyrePattern != ''"> and tyre_pattern = #{tyrePattern}</if>
<if test="tyreType != null and tyreType != ''"> and tyre_type = #{tyreType}</if>
<if test="team != null and team != ''"> and team like concat('%', #{team}, '%')</if>
<if test="team != null and team != ''"> and d.team like concat('%', #{team}, '%')</if>
<if test="carNo != null and carNo != ''"> and car_no = #{carNo}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(d.create_time,'%Y%m%d') &gt;= date_format(#{params.beginTime},'%Y%m%d')
@ -85,15 +112,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="vTyreStockSummary" resultType="java.util.Map" parameterType="SysDept">
SELECT
IFNULL(dept_name, '合计') AS dept_name,
IFNULL(v.dept_name, '合计') AS dept_name,
new_count AS '新胎',
circulating_count AS '周转胎',
renovate_count AS '翻新胎',
experimental_count AS '实验胎'
experimental_count AS '实验胎',
incar AS '在车轮胎'
FROM
v_tyre_stock_summary
v_tyre_stock_summary v
left join sys_dept d on v.dept_name = d.dept_name
<where>
<if test="deptName != null and deptName != ''"> and dept_name = #{deptName}</if>
<if test="deptName != null and deptName != ''"> and v.dept_name = #{deptName}</if>
${params.dataScope}
</where>
</select>

@ -121,6 +121,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
DATE(create_time) = CURDATE();
</select>
<select id="selectBizMaintenanceOrderByOrderIdBefore"
resultMap="BizMaintenanceOrderResult" parameterType="BizMaintenanceOrder">
SELECT
order_id,
order_no,
vehicle_id,
plate_number,
type_code,
sd.dept_name as factoryName,
input_mileage,
last_mileage,
maintain_date,
description,
bmo.`STATUS`,
order_type,
su.user_name as create_by,
bmo.create_time,
sus.user_name as update_by,
bmo.update_time,
bmo.remark,
bc.line
FROM
biz_maintenance_order bmo
LEFT JOIN sys_dept sd ON bmo.factory_id = sd.dept_id
LEFT JOIN sys_user su ON su.login_name = bmo.create_by
LEFT JOIN sys_user sus ON sus.login_name = bmo.update_by
LEFT JOIN base_car bc ON bc.id = bmo.vehicle_id
WHERE
bmo.order_id != #{orderId}
AND bmo.plate_number = #{plateNumber}
ORDER BY
bmo.create_time DESC -- 关键点1按照维保日期倒序排列最近的时间在前
LIMIT 1; -- 关键点2只取第一条数据
</select>
<insert id="insertBizMaintenanceOrder" parameterType="BizMaintenanceOrder" useGeneratedKeys="true" keyProperty="orderId">
insert into biz_maintenance_order

@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBizOrderTireDetailList" parameterType="BizOrderTireDetail" resultMap="BizOrderTireDetailResult">
<include refid="selectBizOrderTireDetailVo"/>
<where>
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
<if test="positionId != null "> and position_id = #{positionId}</if>
<if test="tireId != null "> and tire_id = #{tireId}</if>
@ -36,11 +36,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tireStatus != null and tireStatus != ''"> and tire_status = #{tireStatus}</if>
</where>
</select>
<select id="selectBizOrderTireDetailByDetailId" parameterType="Long" resultMap="BizOrderTireDetailResult">
<include refid="selectBizOrderTireDetailVo"/>
where detail_id = #{detailId}
</select>
<select id="selectBizOrderTireDetail" resultType="java.util.Map" parameterType="BizOrderTireDetail">
SELECT
bt.tyre_brand as brand,
bt.tyre_model as spec,
botd.tire_code as dot,
botd.tread_depth as depth,
sdd.dict_label as position,
IFNULL(botd.tire_status, 'normal') as status
FROM
biz_order_tire_detail botd
LEFT JOIN base_tyre bt ON bt.tyre_id = botd.tire_id
LEFT JOIN sys_dict_data sdd ON sdd.dict_code = botd.position_id
<where>
<if test="orderId != null "> and order_id = #{orderId}</if>
</where>
</select>
<select id="selectBaseTrieInstall" resultType="java.util.Map" parameterType="String">
SELECT
bt.tyre_brand as brand,
bt.tyre_model as spec,
bt.tyre_no as dot,
bt.pattern_depth as depth,
bt.wheel_postion as position,
'installed' as status
FROM
base_tyre bt
WHERE
car_no = #{plateNumber}
</select>
<insert id="insertBizOrderTireDetail" parameterType="BizOrderTireDetail" useGeneratedKeys="true" keyProperty="detailId">
insert into biz_order_tire_detail

@ -22,6 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tyreModel" column="tyre_model" />
<result property="team" column="team" />
<result property="patternDepth" column="patter_depth" />
<result property="company" column="company" />
<result property="carTeam" column="carTeam" />
</resultMap>
<sql id="selectRecordTyreInstallVo">
@ -30,10 +32,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectRecordTyreInstallList" parameterType="RecordTyreInstall" resultMap="RecordTyreInstallResult">
select rti.id, rti.tyre_rfid, rti.type, rti.mileage, su.user_name as create_by, rti.create_time,rti.update_by,rti.car_no,
rti.wheel_postion,rti.update_time, rti.remark,rti.pattern_depth,bt.tyre_brand,bt.tyre_no,bt.self_no,bt.tyre_model,bt.team
rti.wheel_postion,rti.update_time, rti.remark,rti.pattern_depth,bt.tyre_brand,bt.tyre_no,bt.self_no,bt.tyre_model,
sdss.dept_name as company,bt.team,sd.dept_name as carTeam
from record_tyre_install rti
LEFT JOIN base_tyre bt ON rti.tyre_rfid = bt.tyre_epc
left join sys_user su ON su.login_name = rti.create_by
LEFT JOIN base_car bc ON bc.car_no = bt.car_no
LEFT JOIN sys_dept sd ON bc.dept_id = sd.dept_id
LEFT JOIN sys_dept sds ON sd.parent_id = sds.dept_id
LEFT JOIN sys_dept sdss ON sds.parent_id = sdss.dept_id
where rti.id is not null
<if test="tyreRfid != null and tyreRfid != ''"> and rti.tyre_rfid = #{tyreRfid}</if>

@ -43,15 +43,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectRecordWarehousingVo"/>
where id = #{id}
</select>
<select id="selectRecord" resultType="java.util.Map">
<select id="selectRecord" resultType="java.util.Map" parameterType="SysDept">
SELECT
DATE(create_time) AS date,
DATE(rw.create_time) AS date,
SUM(CASE WHEN type = 0 THEN 1 ELSE 0 END) AS type_0_count,
SUM(CASE WHEN type = 1 THEN 1 ELSE 0 END) AS type_1_count
FROM record_warehousing
WHERE create_time >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
AND create_time &lt; CURDATE() + INTERVAL 1 DAY
GROUP BY DATE(create_time)
FROM record_warehousing rw
LEFT JOIN base_tyre bt ON bt.tyre_epc = rw.tyre_rfid
WHERE rw.create_time >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)
AND rw.create_time &lt; CURDATE() + INTERVAL 1 DAY
GROUP BY DATE(rw.create_time)
ORDER BY date;
</select>
<select id="selectTyreModel" resultType="java.util.Map">

Loading…
Cancel
Save