# 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
master
杨万里 2 weeks ago
commit 7361dad99c

@ -147,9 +147,12 @@ public class BaseCarController extends BaseController
@PostMapping("/PdaQueryCarList")
@ResponseBody
public AjaxResult PdaQueryCarList(@RequestBody BaseCar baseCar)
public AjaxResult PdaQueryCarList(BaseCar baseCar)
{
List<BaseCar> list = baseCarService.selectBaseCarList(baseCar);
if (list == null || list.isEmpty()){
return AjaxResult.error("查询到的车辆基础信息为空");
}
return AjaxResult.success(list);
}

@ -16,6 +16,8 @@ import com.ruoyi.system.service.IBaseTyreService;
import com.ruoyi.system.service.IRecordCheckService;
import com.ruoyi.system.service.IRecordTyreInstallService;
import com.ruoyi.system.service.IRecordWarehousingService;
import com.ruoyi.system.service.ITyreStatDetailService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -52,6 +54,10 @@ public class BaseTyreController extends BaseController
@Autowired
private IRecordCheckService recordCheckService;
//“库存盘点详情”对话框和“轮胎详情”页签
@Autowired
private ITyreStatDetailService tyreStatDetailService;
@RequiresPermissions("tyre:tyre:view")
@GetMapping()
public String tyre()
@ -82,6 +88,8 @@ public class BaseTyreController extends BaseController
return "error/404";
}
model.addAttribute("tyre", tyre);
// 用最少规则给详情页一个当前状态展示,避免页面出现完全空白的核心业务信息。
// model.addAttribute("tyreStatusText", StringUtils.isNotBlank(tyre.getCarNo()) ? "在车" : "在库");
// 2. 查询并整合所有记录
List<TimelineItem> timelineItems = new ArrayList<>();
@ -146,6 +154,7 @@ public class BaseTyreController extends BaseController
timelineItem.setId(item.getId());
timelineItem.setTitle("轮胎检查"+item.getCreateBy());
timelineItem.setType("check");
// timelineItem.setDetail(buildCheckDetail(item));
timelineItem.setDetail("深度:" + "17.8mm");
timelineItem.setTime(item.getCreateTime());
timelineItem.setIcon("fa-check-circle");
@ -328,4 +337,158 @@ public class BaseTyreController extends BaseController
public String getColor() { return color; }
public void setColor(String color) { this.color = color; }
}
private String buildCheckDetail(RecordCheck item)
{
List<String> detailParts = new ArrayList<>();
if (StringUtils.isNotBlank(item.getPatternDepth()))
{
detailParts.add("花纹深度:" + item.getPatternDepth() + "mm");
}
if (StringUtils.isNotBlank(item.getMileage()))
{
detailParts.add("车辆里程:" + item.getMileage());
}
if (StringUtils.isNotBlank(item.getResult()))
{
detailParts.add("处理意见:" + item.getResult());
}
if (StringUtils.isNotBlank(item.getMaintenanceType()))
{
detailParts.add("保养类型:" + item.getMaintenanceType());
}
return detailParts.isEmpty() ? "暂无检查明细" : String.join(" | ", detailParts);
}
private String defaultValue(String value)
{
return StringUtils.isBlank(value) ? "-" : value;
}
/**
*
*
*/
@RequiresPermissions("tyre:tyre:stat")
@GetMapping("/stat/detail")
public String statDetail(@RequestParam("deptName") String deptName,
@RequestParam("stockType") String stockType,
ModelMap mmap)
{
mmap.put("deptName", deptName);
mmap.put("stockType", stockType);
return prefix + "/statDetail";
}
/**
*
*
*/
@RequiresPermissions("tyre:tyre:stat")
@PostMapping("/stat/detail/list")
@ResponseBody
public TableDataInfo statDetailList(BaseTyre baseTyre, @RequestParam("stockType") String stockType)
{
startPage();
List<BaseTyre> list = tyreStatDetailService.selectStatDetailList(baseTyre, stockType);
return getDataTable(list);
}
@GetMapping("/detail2/{tyreId}")
public String tyreDetil2(@PathVariable("tyreId") Long tyreId, Model model)
{
// 1. 根据 ID 查询轮胎数据
BaseTyre tyre = baseTyreService.selectBaseTyreById(tyreId);
if (tyre == null) {
// 处理未找到轮胎的情况
return "error/404";
}
model.addAttribute("tyre", tyre);
// 用最少规则给详情页一个当前状态展示,避免页面出现完全空白的核心业务信息。
model.addAttribute("tyreStatusText", StringUtils.isNotBlank(tyre.getCarNo()) ? "在车" : "在库");
// 2. 查询并整合所有记录
List<TimelineItem> timelineItems = new ArrayList<>();
// --- 2.1 查询并转换入库记录 ---
RecordWarehousing warehousingQuery = new RecordWarehousing();
warehousingQuery.setTyreRfid(tyre.getTyreEpc());
List<RecordWarehousing> warehousingList = recordWarehousingService.selectRecordWarehousingList(warehousingQuery);
if (warehousingList != null) {
for (RecordWarehousing item : warehousingList) {
TimelineItem timelineItem = new TimelineItem();
timelineItem.setId(item.getId());
// 核心修改:根据 type 字段判断是入库还是出库
if (item.getType() != null && item.getType().equals("1")) {
// 1 代表 出库
timelineItem.setTitle("轮胎出库:"+item.getCreateBy());
timelineItem.setIcon("fa-sign-out"); // 或者是 fa-truck (卡车图标)
timelineItem.setColor("warning"); // 橙色/黄色,代表离开
timelineItem.setTime(item.getCreateTime());
} else {
// 0 代表 入库 (默认情况)
timelineItem.setTitle("轮胎入库:"+item.getCreateBy());
timelineItem.setIcon("fa-sign-in"); // 或者是 fa-inbox (盒子图标)
timelineItem.setColor("primary"); // 蓝色,代表进入
timelineItem.setTime(item.getCreateTime());
}
timelineItem.setType("warehousing");
timelineItem.setDetail("仓库:" + "轮胎仓库"); // 如果有仓库名称字段,可以替换 "轮胎仓库"
timelineItems.add(timelineItem);
}
}
// --- 2.2 查询并转换安装记录 ---
RecordTyreInstall installQuery = new RecordTyreInstall();
installQuery.setTyreRfid(tyre.getTyreEpc());
List<RecordTyreInstall> installList = recordTyreInstallService.selectRecordTyreInstallList(installQuery);
if (installList != null) {
for (RecordTyreInstall item : installList) {
TimelineItem timelineItem = new TimelineItem();
timelineItem.setId(item.getId());
timelineItem.setTitle("轮胎安装:"+item.getCreateBy());
timelineItem.setType("install");
timelineItem.setDetail("车辆:" + item.getCarNo() + " | 轮位:" + item.getWheelPostion());
timelineItem.setTime(item.getCreateTime());
timelineItem.setIcon("fa-car");
timelineItem.setColor("success");
timelineItems.add(timelineItem);
}
}
// --- 2.3 查询并转换检查记录 ---
RecordCheck checkQuery = new RecordCheck();
checkQuery.setTyreRfid(tyre.getTyreEpc());
List<RecordCheck> checkList = recordCheckService.selectRecordCheckList(checkQuery);
if (checkList != null) {
for (RecordCheck item : checkList) {
TimelineItem timelineItem = new TimelineItem();
timelineItem.setId(item.getId());
timelineItem.setTitle("轮胎检查"+item.getCreateBy());
timelineItem.setType("check");
timelineItem.setDetail(buildCheckDetail(item));
// timelineItem.setDetail("深度:" + "17.8mm");
timelineItem.setTime(item.getCreateTime());
timelineItem.setIcon("fa-check-circle");
timelineItem.setColor("warning");
timelineItems.add(timelineItem);
}
}
// --- 2.4 按时间排序 (最新在最上面) ---
timelineItems = timelineItems.stream()
.sorted(Comparator.comparing(TimelineItem::getTime, Comparator.nullsLast(Comparator.reverseOrder())))
.collect(Collectors.toList());
// 3. 传给前端
model.addAttribute("timelineItems", timelineItems);
// 库存盘点链路统一切到新版详情模板,保留旧模板文件给其他场景继续观察或回退。
return prefix + "/typreDetill2";
}
}

@ -2,6 +2,25 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('轮胎基础信息列表')" />
<style>
.stock-link {
color: #1c84c6 !important;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
.stock-link:hover,
.stock-link:focus {
color: #0f6ea8 !important;
text-decoration: underline;
}
.stock-link-disabled {
cursor: default;
opacity: 0.95;
}
</style>
</head>
<body class="gray-bg">
<div class="container-div">
@ -10,6 +29,9 @@
<form id="formId">
<div class="select-list">
<ul>
<li>
<input type="hidden" id="treeId" name="deptId"/>
</li>
<li>
<p>修理厂站:</p>
<input name="deptName" onclick="selectDeptTree()" id="treeName" type="text"/>
@ -39,6 +61,7 @@
<script th:inline="javascript">
var prefix = ctx + "tyre/tyre";
var datas = [[${@dict.getType('sys_normal_disable')}]];
var statColumns = ['新胎', '周转胎', '翻新胎', '实验胎'];
$(function() {
var options = {
@ -68,17 +91,29 @@
title : '所属场站'
}, {
field : '新胎',
title : '全新胎'
title : '全新胎',
formatter: function(value, row, index) {
return formatStockCount(value, row, '新胎');
}
}, {
field : '周转胎',
title : '周转胎'
title : '周转胎',
formatter: function(value, row, index) {
return formatStockCount(value, row, '周转胎');
}
}, {
field : '翻新胎',
title : '翻新胎'
title : '翻新胎',
formatter: function(value, row, index) {
return formatStockCount(value, row, '翻新胎');
}
}, {
field : '实验胎',
title : '实验胎'
},
title : '实验胎',
formatter: function(value, row, index) {
return formatStockCount(value, row, '实验胎');
}
},
{
field : '在车轮胎',
title : '在车轮胎'
@ -115,6 +150,34 @@
$("#treeName").val(body.find('#treeName').val());
$.modal.close(index);
}
function formatStockCount(value, row, stockType) {
var count = parseInt(value, 10);
if (isNaN(count)) {
count = 0;
}
// 数量为 0 也统一高亮成可感知状态,但不触发明细查询,避免用户误解为无此维度。
if (count === 0) {
return '<span class="stock-link stock-link-disabled">' + count + '</span>';
}
return '<a href="javascript:void(0)" class="stock-link" onclick="openStatDetail(\'' +
$.common.nullToStr(row.dept_name) + '\', \'' + stockType + '\')">' + count + '</a>';
}
function openStatDetail(deptName, stockType) {
var filterDeptName = deptName === "合计" ? "" : deptName;
var query = "?deptName=" + encodeURIComponent(filterDeptName) + "&stockType=" + encodeURIComponent(stockType);
var url = prefix + "/stat/detail" + query;
var modalWidth = Math.floor($(window).width() * 0.92);
var modalHeight = Math.floor($(window).height() * 0.88);
$.modal.openOptions({
title: "库存盘点详情",
url: url,
width: modalWidth,
height: modalHeight,
btn: []
});
}
</script>
</body>

@ -0,0 +1,212 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('库存盘点详情')" />
<style>
.detail-link {
color: #1c84c6 !important;
font-weight: 600;
text-decoration: underline;
cursor: pointer;
}
.detail-link:hover,
.detail-link:focus {
color: #0f6ea8 !important;
text-decoration: underline;
}
</style>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<input type="hidden" name="deptName" th:value="${deptName}">
<input type="hidden" id="stockType" name="stockType" th:value="${stockType}">
<div class="select-list">
<ul>
<li>
<p>所属场站:</p>
<input type="text" th:value="${#strings.isEmpty(deptName) ? '所有场站' : deptName}" readonly class="form-control">
</li>
<li>
<p>轮胎类型:</p>
<input type="text" th:value="${stockType}" readonly class="form-control">
</li>
<!-- <li>-->
<!-- <p>胎号:</p>-->
<!-- <input type="text" name="tyreNo" placeholder="请输入胎号">-->
<!-- </li>-->
<!-- <li>-->
<!-- <p>轮胎自编号:</p>-->
<!-- <input type="text" name="selfNo" placeholder="请输入轮胎自编号">-->
<!-- </li>-->
<!-- <li>-->
<!-- <p>品牌:</p>-->
<!-- <input type="text" name="tyreBrand" placeholder="请输入品牌">-->
<!-- </li>-->
<!-- <li>-->
<!-- <p>规格:</p>-->
<!-- <input type="text" name="tyreModel" placeholder="请输入规格">-->
<!-- </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="resetForm()"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
</li>
</ul>
</div>
</form>
</div>
<!-- <div class="btn-group-sm" id="toolbar" role="group">-->
<!-- <span class="btn btn-default disabled">-->
<!-- <i class="fa fa-info-circle"></i>-->
<!-- 当前仅展示已确认存在的库存字段,计算类指标后续可继续补齐-->
<!-- </span>-->
<!-- </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 prefix = ctx + "tyre/tyre";
var stockType = [[${stockType}]];
$(function() {
var options = {
url: prefix + "/stat/detail/list",
queryParams: function(params) {
params.stockType = $("#stockType").val();
return $.table.queryParams(params);
},
showSearch: false,
showRefresh: true,
showToggle: false,
showColumns: true,
modalName: "库存盘点详情",
columns: [{
field: 'tyreNo',
title: '胎号',
formatter: function(value, row, index) {
if ($.common.isEmpty(value)) {
return "-";
}
return '<a href="javascript:void(0)" class="detail-link" onclick="openTyreDetail(\'' + row.tyreId + '\', \'' +
value + '\')">' + value + '</a>';
}
}, {
field: 'selfNo',
title: '轮胎自编号',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
field: 'deptName',
title: '所属场站',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
field: 'carNo',
title: '所属车辆',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
field: 'wheelPostion',
title: '轮位',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
title: '轮胎状态',
formatter: function(value, row, index) {
return '在库';
}
}, {
field: 'tyreType',
title: '轮胎类型',
formatter: function(value) {
return $.common.isEmpty(value) ? stockType : value;
}
}, {
field: 'tyreBrand',
title: '品牌',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
field: 'tyreModel',
title: '规格',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
field: 'tyrePattern',
title: '花纹',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
},
// {
// title: 'DOT',
// formatter: function(value, row, index) {
// return '-';
// }
// },
{
field: 'patternDepth',
title: '初始花纹深度(mm)',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
},
// {
// title: '剩余花纹深度(mm)',
// formatter: function(value, row, index) {
// return '-';
// }
// },
{
field: 'createTime',
title: '操作时间',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}, {
field: 'createBy',
title: '操作人',
formatter: function(value) {
return $.common.isEmpty(value) ? "-" : value;
}
}]
};
$.table.init(options);
});
function resetForm() {
var deptName = $("input[name='deptName']").val();
var stockTypeValue = $("#stockType").val();
$.form.reset();
$("input[name='deptName']").val(deptName);
$("#stockType").val(stockTypeValue);
$.table.search();
}
function openTyreDetail(tyreId, tyreNo) {
var url = prefix + "/detail2/" + tyreId;
// 先在当前 iframe 上下文创建页签,确保 createMenuItem 能拿到 frameElement
// 然后再关闭弹窗,避免出现“只关窗不跳转”的问题。
$.modal.openTab("轮胎详情-" + tyreNo, url);
setTimeout(function() {
$.modal.close();
}, 80);
}
</script>
</body>
</html>

@ -0,0 +1,369 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('轮胎详情')" />
<style>
.detail-shell {
padding: 15px;
}
.summary-card,
.info-card,
.timeline-card {
background: #fff;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
margin-bottom: 16px;
}
.summary-card {
padding: 20px 24px;
}
.summary-title {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 16px;
}
.summary-name {
font-size: 34px;
font-weight: 700;
color: #2f4050;
line-height: 1.2;
margin-bottom: 10px;
}
.summary-meta {
color: #666;
font-size: 14px;
line-height: 1.9;
}
.summary-link {
display: inline-block;
margin-top: 14px;
color: #1c84c6;
border-bottom: 2px solid #1c84c6;
padding-bottom: 4px;
}
.info-card {
padding: 18px 20px 10px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #2f4050;
margin-bottom: 14px;
}
.section-title i {
margin-right: 6px;
color: #666;
}
.info-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
margin-bottom: 16px;
}
.info-table th,
.info-table td {
border: 1px solid #edf1f2;
padding: 12px 14px;
font-size: 14px;
word-break: break-all;
}
.info-table th {
width: 20%;
color: #7a8590;
font-weight: 500;
background: #fafbfc;
}
.info-table td {
color: #2f4050;
background: #fff;
}
.timeline-card {
padding: 18px 18px 12px;
min-height: 320px;
}
.timeline-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 18px;
}
.timeline-header .title {
font-size: 18px;
font-weight: 600;
color: #2f4050;
}
.mini-tip {
font-size: 12px;
color: #999;
}
.life-list {
list-style: none;
padding: 0;
margin: 0;
position: relative;
}
.life-list:before {
content: "";
position: absolute;
left: 22px;
top: 8px;
bottom: 8px;
width: 2px;
background: #e4e7ea;
}
.life-item {
position: relative;
padding-left: 54px;
margin-bottom: 22px;
}
.life-dot {
position: absolute;
left: 14px;
top: 4px;
width: 18px;
height: 18px;
border-radius: 50%;
background: #1c84c6;
border: 3px solid #d7ebf8;
}
.life-time {
color: #909399;
font-size: 12px;
margin-bottom: 4px;
}
.life-title {
color: #2f4050;
font-weight: 600;
margin-bottom: 6px;
}
.life-body {
color: #666;
line-height: 1.7;
font-size: 13px;
}
.text-muted-dash {
color: #999;
}
@media (max-width: 991px) {
.summary-title {
flex-direction: column;
}
}
</style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content detail-shell">
<div class="summary-card">
<div class="summary-title">
<div>
<div class="summary-name" th:text="'胎号:' + ${tyre.tyreNo}">胎号:-</div>
<div class="summary-meta">
<div th:text="'所属场站:' + (${#strings.isEmpty(tyre.deptName)} ? '-' : tyre.deptName)">所属场站:-</div>
<div th:text="'所属车队:' + (${#strings.isEmpty(tyre.team)} ? '-' : tyre.team)">所属车队:-</div>
</div>
<span class="summary-link" th:text="${tyre.tyreNo}">-</span>
</div>
<!-- <div>-->
<!-- <a class="btn btn-white btn-sm" href="javascript:void(0)" onclick="editTyre()" th:if="${@permission.hasPermi('tyre:tyre:edit')}">编辑</a>-->
<!-- </div>-->
</div>
</div>
<div class="row">
<div class="col-lg-9 col-md-8 col-sm-12">
<div class="info-card">
<div class="section-title"><i class="fa fa-bookmark"></i>基本信息</div>
<table class="info-table">
<tr>
<th>胎号</th>
<td th:text="${#strings.isEmpty(tyre.tyreNo) ? '-' : tyre.tyreNo}">-</td>
<th>轮胎自编号</th>
<td th:text="${#strings.isEmpty(tyre.selfNo) ? '-' : tyre.selfNo}">-</td>
</tr>
<tr>
<!-- <th>轮胎自编号二</th>-->
<!-- <td>-</td>-->
<th>RFID标签</th>
<td th:text="${#strings.isEmpty(tyre.tyreEpc) ? '-' : tyre.tyreEpc}">-</td>
<th>轮胎品牌</th>
<td th:text="${#strings.isEmpty(tyre.tyreBrand) ? '-' : tyre.tyreBrand}">-</td>
</tr>
<!-- <tr>-->
<!-- <th>供应商</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<tr>
<th>轮胎花纹</th>
<td th:text="${#strings.isEmpty(tyre.tyrePattern) ? '-' : tyre.tyrePattern}">-</td>
<th>轮胎层级</th>
<td th:text="${#strings.isEmpty(tyre.tyreLevel) ? '-' : tyre.tyreLevel}">-</td>
</tr>
<tr>
<!-- <th>DOT</th>-->
<!-- <td>-</td>-->
<th>轮胎规格</th>
<td th:text="${#strings.isEmpty(tyre.tyreModel) ? '-' : tyre.tyreModel}">-</td>
</tr>
</table>
</div>
<div class="info-card">
<div class="section-title"><i class="fa fa-bookmark"></i>状态信息</div>
<table class="info-table">
<!-- <tr>-->
<!-- <th>轮胎状态</th>-->
<!-- <td th:text="${tyreStatusText}">在库</td>-->
<!-- </tr>-->
<tr>
<th>轮胎类型</th>
<td th:text="${#strings.isEmpty(tyre.tyreType) ? '-' : tyre.tyreType}">-</td>
<th>初始花纹深度(mm)</th>
<td th:text="${#strings.isEmpty(tyre.patternDepth) ? '-' : tyre.patternDepth}">-</td>
<!-- <th>剩余花纹深度(mm)</th>-->
<!-- <td>-</td>-->
</tr>
<!-- <tr>-->
<!-- <th>行驶时长(h)</th>-->
<!-- <td>-</td>-->
<!-- <th>花纹磨损(h/mm)</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>GPS里程(km)</th>-->
<!-- <td>-</td>-->
<!-- <th>轮胎里程(km)</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>预计时长(h)</th>-->
<!-- <td>-</td>-->
<!-- <th>单耗里程(km/mm)</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>是否试验胎</th>-->
<!-- <td>-</td>-->
<!-- <th>保行里程(km)</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<tr>
<th>当前车辆</th>
<td th:text="${#strings.isEmpty(tyre.carNo) ? '-' : tyre.carNo}">-</td>
<th>当前轮位</th>
<td th:text="${#strings.isEmpty(tyre.wheelPostion) ? '-' : tyre.wheelPostion}">-</td>
</tr>
</table>
</div>
<div class="info-card">
<div class="section-title"><i class="fa fa-bookmark"></i>其他</div>
<table class="info-table">
<!-- <tr>-->
<!-- <th>来源</th>-->
<!-- <td>-</td>-->
<!-- <th>订单编号</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<tr>
<th>RFID</th>
<td th:text="${#strings.isEmpty(tyre.tyreEpc) ? '-' : tyre.tyreEpc}">-</td>
<th>入库时间</th>
<td th:text="${tyre.createTime == null ? '-' : #dates.format(tyre.createTime, 'yyyy-MM-dd HH:mm:ss')}">-</td>
<!-- <th>TKPH</th>-->
<!-- <td>-</td>-->
</tr>
<!-- <tr>-->
<!-- <th>建议公里</th>-->
<!-- <td>-</td>-->
<!-- <th>补气次数</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>修补次数</th>-->
<!-- <td>-</td>-->
<!-- <th>翻新次数</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <th>SKU编码</th>-->
<!-- <td>-</td>-->
<!-- </tr>-->
<tr>
<th>备注</th>
<td colspan="3" th:text="${#strings.isEmpty(tyre.remark) ? '-' : tyre.remark}">-</td>
</tr>
</table>
</div>
</div>
<div class="col-lg-3 col-md-4 col-sm-12">
<div class="timeline-card">
<div class="timeline-header">
<span class="title">生命周期</span>
<span class="mini-tip">按时间倒序展示</span>
</div>
<ul class="life-list" th:if="${!#lists.isEmpty(timelineItems)}">
<li class="life-item" th:each="item : ${timelineItems}">
<span class="life-dot"></span>
<div class="life-time" th:text="${item.time == null ? '-' : #dates.format(item.time, 'yyyy-MM-dd HH:mm:ss')}">-</div>
<div class="life-title" th:text="${item.title}">轮胎入库</div>
<div class="life-body" th:text="${#strings.isEmpty(item.detail) ? '-' : item.detail}">-</div>
</li>
</ul>
<div class="text-center text-muted-dash" style="padding: 60px 0;" th:if="${#lists.isEmpty(timelineItems)}">
暂无生命周期记录
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "tyre/tyre";
var tyreId = [[${tyre.tyreId}]];
function editTyre() {
var url = prefix + "/edit/" + tyreId;
$.modal.open("编辑轮胎", url, "900", "700");
}
$(function() {
// 兜底:关闭父窗口 tab 的 loading 遮罩
// 若 iframe 在 index.js 绑定 load 事件前就已加载完毕,遮罩不会自动关闭
if (window.parent && window.parent !== window && window.parent.$ && window.parent.$.modal) {
window.parent.$.modal.closeLoading();
}
});
</script>
</body>
</html>

@ -66,6 +66,9 @@ public class BaseTyre extends BaseEntity
@Excel(name = "所属车队")
private String carTeam;
/** 所属场站 */
private String deptName;
@Excel(name = "安装车辆")
private String carNo;
@Excel(name = "所在轮位")
@ -220,6 +223,16 @@ public class BaseTyre extends BaseEntity
return team;
}
public String getDeptName()
{
return deptName;
}
public void setDeptName(String deptName)
{
this.deptName = deptName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -241,6 +254,8 @@ public class BaseTyre extends BaseEntity
.append("tyreType", getTyreType())
.append("team", getTeam())
.append("deptName", getDeptName())
.append("createBy", getCreateBy())

@ -46,8 +46,16 @@ public class BizOrderTireDetail extends BaseEntity
/** 轮胎状态描述(截图中的“新胎”、“模拟数据”) */
@Excel(name = "轮胎状态描述", readConverterExp = "截=图中的“新胎”、“模拟数据”")
private String tireStatus;
// 数据类型(保养;换新胎,卸车;换新胎,装车)
private String dataType;
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
public void setDetailId(Long detailId)
{

@ -0,0 +1,15 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.BaseTyre;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
* Mapper
*/
public interface TyreStatDetailMapper
{
List<BaseTyre> selectStatDetailList(@Param("baseTyre") BaseTyre baseTyre, @Param("stockType") String stockType);
}

@ -0,0 +1,13 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.BaseTyre;
import java.util.List;
/**
* Service
*/
public interface ITyreStatDetailService
{
List<BaseTyre> selectStatDetailList(BaseTyre baseTyre, String stockType);
}

@ -61,9 +61,20 @@ public class BaseCarServiceImpl implements IBaseCarService
@DataScope(deptAlias = "d", userAlias = "u")
public List<BaseCar> selectBaseCarList(BaseCar baseCar)
{
String carNo = baseCar.getCarNo();
baseCar.setCarNo(buildLikePattern(carNo));
return baseCarMapper.selectBaseCarList(baseCar);
}
public static String buildLikePattern(String input) {
if (input == null || input.isEmpty()) {
return "%";
}
return "%" + input.chars()
.mapToObj(c -> String.valueOf((char) c))
.reduce((a, b) -> a + "%" + b)
.orElse("") + "%";
}
/**
*
*

@ -0,0 +1,30 @@
package com.ruoyi.system.service.impl;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.system.domain.BaseTyre;
import com.ruoyi.system.mapper.TyreStatDetailMapper;
import com.ruoyi.system.service.ITyreStatDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*/
@Service
public class TyreStatDetailServiceImpl implements ITyreStatDetailService
{
@Autowired
private TyreStatDetailMapper tyreStatDetailMapper;
/**
*
*/
@Override
@DataScope(deptAlias = "sd")
public List<BaseTyre> selectStatDetailList(BaseTyre baseTyre, String stockType)
{
return tyreStatDetailMapper.selectStatDetailList(baseTyre, stockType);
}
}

@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND status = #{status}
</if>
</where>
order by dict_sort asc
</select>
<select id="selectDictDataByType" parameterType="String" resultMap="SysDictDataResult">

@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tyrePattern" column="tyre_pattern" />
<result property="tyreType" column="tyre_type" />
<result property="team" column="team" />
<result property="deptName" column="dept_name" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
@ -25,10 +26,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="patternDepth" column="pattern_depth" />
<result property="company" column="company" />
<result property="carTeam" column="carTeam" />
<result property="grooves" column="grooves" />
</resultMap>
<sql id="selectBaseTyreVo">
select tyre_id, tyre_no,self_no, tyre_epc, tyre_brand, tyre_model, tyre_level, tyre_pattern, tyre_type, team, create_by, create_time, update_by, update_time, remark,car_no,wheel_postion from base_tyre
select d.tyre_id, d.tyre_no, d.self_no, d.tyre_epc, d.tyre_brand, d.tyre_model, d.tyre_level, d.tyre_pattern,
d.grooves, d.pattern_depth, d.tyre_type, d.team, d.create_by, d.create_time, d.update_by, d.update_time,
d.remark, d.car_no, d.wheel_postion, d.dept_id, sd.dept_name
from base_tyre d
left join sys_dept sd on sd.dept_id = d.dept_id
</sql>
<select id="selectBaseTyreList" parameterType="BaseTyre" resultMap="BaseTyreResult">
@ -82,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseTyreById" parameterType="Long" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where tyre_id = #{tyreId}
where d.tyre_id = #{tyreId}
</select>
<select id="checkTyreNoUnique" parameterType="String" resultType="int">
@ -91,7 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseTyreByEpc" parameterType="BaseTyre" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
<where>
<if test="tyreEpc != null and tyreEpc != ''"> and tyre_epc like concat('%', #{tyreEpc}, '%')</if>
<if test="tyreEpc != null and tyreEpc != ''"> and d.tyre_epc like concat('%', #{tyreEpc}, '%')</if>
</where>
</select>
<select id="getTeamByUser" resultType="java.lang.String">
@ -118,7 +125,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptName != null and deptName != ''"> and v.dept_name = #{deptName}</if>
${params.dataScope}
</where>
</select>

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TyreStatDetailMapper">
<resultMap type="BaseTyre" id="TyreStatDetailResult">
<result property="tyreId" column="tyre_id"/>
<result property="tyreNo" column="tyre_no"/>
<result property="selfNo" column="self_no"/>
<result property="tyreEpc" column="tyre_epc"/>
<result property="tyreBrand" column="tyre_brand"/>
<result property="tyreModel" column="tyre_model"/>
<result property="tyreLevel" column="tyre_level"/>
<result property="tyrePattern" column="tyre_pattern"/>
<result property="tyreType" column="tyre_type"/>
<result property="team" column="team"/>
<result property="deptName" column="dept_name"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="remark" column="remark"/>
<result property="carNo" column="car_no"/>
<result property="wheelPostion" column="wheel_postion"/>
<result property="patternDepth" column="pattern_depth"/>
<result property="grooves" column="grooves"/>
</resultMap>
<select id="selectStatDetailList" resultMap="TyreStatDetailResult">
select bt.tyre_id, bt.tyre_no, bt.self_no, bt.tyre_epc, bt.tyre_brand, bt.tyre_model, bt.tyre_level, bt.tyre_pattern,
bt.grooves, bt.pattern_depth, bt.tyre_type, bt.team, sd.dept_name,
bi.create_time, su.user_name as create_by, bt.car_no, bt.wheel_postion, bi.remark
from base_inventory bi
inner join base_tyre bt on bi.tyre_rfid = bt.tyre_epc
left join sys_dept sd on sd.dept_id = bt.dept_id
left join sys_user su on su.login_name = bi.create_by
where bi.status = '0'
<if test="baseTyre != null">
<if test="baseTyre.deptName != null and baseTyre.deptName != ''"> and sd.dept_name = #{baseTyre.deptName}</if>
<if test="baseTyre.tyreNo != null and baseTyre.tyreNo != ''"> and bt.tyre_no like concat('%', #{baseTyre.tyreNo}, '%')</if>
<if test="baseTyre.selfNo != null and baseTyre.selfNo != ''"> and bt.self_no like concat('%', #{baseTyre.selfNo}, '%')</if>
<if test="baseTyre.tyreBrand != null and baseTyre.tyreBrand != ''"> and bt.tyre_brand like concat('%', #{baseTyre.tyreBrand}, '%')</if>
<if test="baseTyre.tyreModel != null and baseTyre.tyreModel != ''"> and bt.tyre_model = #{baseTyre.tyreModel}</if>
${baseTyre.params.dataScope}
</if>
<if test="stockType != null and stockType != ''">
<choose>
<when test="stockType == '新胎'">
and bt.tyre_type in ('新胎', '全新胎', 'new')
</when>
<when test="stockType == '周转胎'">
and bt.tyre_type in ('周转胎', 'circulating')
</when>
<when test="stockType == '翻新胎'">
and bt.tyre_type in ('翻新胎', 'renovate')
</when>
<when test="stockType == '实验胎'">
and bt.tyre_type in ('实验胎', 'experimental')
</when>
</choose>
</if>
order by bi.create_time desc, bt.tyre_id desc
</select>
</mapper>
Loading…
Cancel
Save