Compare commits

...

2 Commits

@ -60,6 +60,20 @@ public class BaseTyreController extends BaseController
{
return prefix + "/tyre";
}
@RequiresPermissions("tyre:tyre:stat")
@GetMapping("/stat")
public String stat()
{
return prefix + "/stat";
}
/**
*
*/
@GetMapping("/detail/{tyreId}")
public String tyreDetil(@PathVariable("tyreId") Long tyreId, Model model)
{
@ -164,6 +178,120 @@ public class BaseTyreController extends BaseController
List<BaseTyre> list = baseTyreService.selectBaseTyreList(baseTyre);
return getDataTable(list);
}
@PostMapping("/statList")
public AjaxResult statList() {
List<TyreStatVO> list = new ArrayList<>();
// --- 模拟数据开始 ---
// 1. 观澜修理厂
TyreStatVO row1 = new TyreStatVO();
row1.setDeptName("观澜修理厂");
row1.setFactoryName("观澜修理厂");
row1.setNewTyre(23);
row1.setRotateTyre(20);
row1.setRemoldTyre(0);
row1.setRepairTyre(0);
row1.setOnCarTyre(768);
row1.setPendingAppraise(0);
row1.setPendingRepair(0);
row1.setPendingRemold(0);
row1.setPendingScrap(0);
row1.setScrapped(0);
list.add(row1);
// 2. 观湖修理厂
TyreStatVO row2 = new TyreStatVO();
row2.setDeptName("观湖修理厂");
row2.setFactoryName("观湖修理厂");
row2.setNewTyre(71);
row2.setRotateTyre(2);
row2.setRemoldTyre(0);
row2.setRepairTyre(0);
row2.setOnCarTyre(753);
row2.setPendingAppraise(0);
row2.setPendingRepair(0);
row2.setPendingRemold(0);
row2.setPendingScrap(0);
row2.setScrapped(0);
list.add(row2);
// 3. 清湖修理厂
TyreStatVO row3 = new TyreStatVO();
row3.setDeptName("清湖修理厂");
row3.setFactoryName("清湖修理厂");
row3.setNewTyre(22);
row3.setRotateTyre(10);
row3.setRemoldTyre(0);
row3.setRepairTyre(0);
row3.setOnCarTyre(695);
row3.setPendingAppraise(0);
row3.setPendingRepair(0);
row3.setPendingRemold(0);
row3.setPendingScrap(0);
row3.setScrapped(0);
list.add(row3);
// 4. 松岗修理厂
TyreStatVO row4 = new TyreStatVO();
row4.setDeptName("松岗修理厂");
row4.setFactoryName("松岗修理厂");
row4.setNewTyre(74);
row4.setRotateTyre(1);
row4.setRemoldTyre(1);
row4.setRepairTyre(0);
row4.setOnCarTyre(484);
row4.setPendingAppraise(0);
row4.setPendingRepair(0);
row4.setPendingRemold(0);
row4.setPendingScrap(1);
row4.setScrapped(0);
list.add(row4);
// 5. 新和修理厂
TyreStatVO row5 = new TyreStatVO();
row5.setDeptName("新和修理厂");
row5.setFactoryName("新和修理厂");
row5.setNewTyre(131);
row5.setRotateTyre(1);
row5.setRemoldTyre(0);
row5.setRepairTyre(0);
row5.setOnCarTyre(473);
row5.setPendingAppraise(0);
row5.setPendingRepair(0);
row5.setPendingRemold(0);
row5.setPendingScrap(0);
row5.setScrapped(1);
list.add(row5);
// --- 计算合计行 ---
TyreStatVO total = new TyreStatVO();
total.setDeptName("合计");
total.setFactoryName(""); // 合计行通常不需要显示场站名
// 这里简单手动累加一下,实际生产中可以用 Stream API
int newSum = list.stream().mapToInt(TyreStatVO::getNewTyre).sum();
int rotSum = list.stream().mapToInt(TyreStatVO::getRotateTyre).sum();
int remSum = list.stream().mapToInt(TyreStatVO::getRemoldTyre).sum();
int repSum = list.stream().mapToInt(TyreStatVO::getRepairTyre).sum();
int onCarSum = list.stream().mapToInt(TyreStatVO::getOnCarTyre).sum();
int penScrapSum = list.stream().mapToInt(TyreStatVO::getPendingScrap).sum();
int scrapSum = list.stream().mapToInt(TyreStatVO::getScrapped).sum();
total.setNewTyre(newSum);
total.setRotateTyre(rotSum);
total.setRemoldTyre(remSum);
total.setRepairTyre(repSum);
total.setOnCarTyre(onCarSum);
total.setPendingScrap(penScrapSum);
total.setScrapped(scrapSum);
// 将合计行插入到第一位(或者最后一位,看你需求,图中是在第一位)
list.add(0, total);
return AjaxResult.success(list);
}
@PostMapping("/getCarBingTire")
@ResponseBody
public List<BaseTyre> getCarBingTire(BaseTyre baseTyre)
@ -282,6 +410,8 @@ public class BaseTyreController extends BaseController
public static class TimelineItem {
private Long id;
private String title;

@ -1,13 +1,19 @@
package com.ruoyi.web.controller.tyre;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.domain.BaseCar;
import com.ruoyi.system.domain.BizOrderTireDetail;
import com.ruoyi.system.domain.MaintenanceOrderDTO;
import com.ruoyi.system.service.IBaseCarService;
import com.ruoyi.system.service.IBizOrderTireDetailService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
@ -37,6 +43,8 @@ public class BizMaintenanceOrderController extends BaseController
@Autowired
private IBizMaintenanceOrderService bizMaintenanceOrderService;
@Autowired
private IBizOrderTireDetailService bizOrderTireDetailService;
@RequiresPermissions("system:order:view")
@GetMapping()
@ -177,10 +185,36 @@ public class BizMaintenanceOrderController extends BaseController
*/
@PostMapping("/PDASaveMaintenanceOrder")
@ResponseBody
public AjaxResult PDASaveMaintenanceOrder(@RequestBody BizMaintenanceOrder bizMaintenanceOrder)
@Transactional(rollbackFor = Exception.class)
public AjaxResult PDASaveMaintenanceOrder(@RequestBody MaintenanceOrderDTO bizMaintenanceOrder)
{
bizMaintenanceOrder.setOrderNo(orderNoCreate());
return toAjax(bizMaintenanceOrderService.updateBizMaintenanceOrder(bizMaintenanceOrder));
// 2. 校验参数
if (bizMaintenanceOrder == null || bizMaintenanceOrder.getOrder() == null) {
return error("参数不能为空");
}
BizMaintenanceOrder order = bizMaintenanceOrder.getOrder();
Long orderId = order.getOrderId();
// 3. 执行更新操作
int n = bizMaintenanceOrderService.updateBizMaintenanceOrder(order);
// 4. 核心逻辑:只有更新成功(影响行数 > 0才继续执行
if (n > 0) {
// 保存详细表
if (bizMaintenanceOrder.getTireDetails() != null && bizMaintenanceOrder.getTireDetails().size() > 0){
for (BizOrderTireDetail bizOrderTireDetail : bizMaintenanceOrder.getTireDetails()){
bizOrderTireDetail.setCreateTime(DateUtils.getNowDate());
bizOrderTireDetail.setOrderId(orderId);
// 这里如果抛出异常,整个事务会回滚
bizOrderTireDetailService.insertBizOrderTireDetail(bizOrderTireDetail);
}
}
return success("保存成功");
} else {
// 5. 如果更新失败,直接返回错误,且不会执行下面的插入操作
return error("更新工单失败,未保存轮胎详情");
}
}
private String orderNoCreate(){

@ -0,0 +1,128 @@
package com.ruoyi.web.controller.tyre;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BizOrderTireDetail;
import com.ruoyi.system.service.IBizOrderTireDetailService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* Controller
*
* @author ruoyi
* @date 2026-04-17
*/
@Controller
@RequestMapping("/system/detail")
public class BizOrderTireDetailController extends BaseController
{
private String prefix = "system/detail";
@Autowired
private IBizOrderTireDetailService bizOrderTireDetailService;
@RequiresPermissions("system:detail:view")
@GetMapping()
public String detail()
{
return prefix + "/detail";
}
/**
*
*/
@RequiresPermissions("system:detail:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BizOrderTireDetail bizOrderTireDetail)
{
startPage();
List<BizOrderTireDetail> list = bizOrderTireDetailService.selectBizOrderTireDetailList(bizOrderTireDetail);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:detail:export")
@Log(title = "工单轮胎执行明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BizOrderTireDetail bizOrderTireDetail)
{
List<BizOrderTireDetail> list = bizOrderTireDetailService.selectBizOrderTireDetailList(bizOrderTireDetail);
ExcelUtil<BizOrderTireDetail> util = new ExcelUtil<BizOrderTireDetail>(BizOrderTireDetail.class);
return util.exportExcel(list, "工单轮胎执行明细数据");
}
/**
*
*/
@RequiresPermissions("system:detail:add")
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:detail:add")
@Log(title = "工单轮胎执行明细", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BizOrderTireDetail bizOrderTireDetail)
{
return toAjax(bizOrderTireDetailService.insertBizOrderTireDetail(bizOrderTireDetail));
}
/**
*
*/
@RequiresPermissions("system:detail:edit")
@GetMapping("/edit/{detailId}")
public String edit(@PathVariable("detailId") Long detailId, ModelMap mmap)
{
BizOrderTireDetail bizOrderTireDetail = bizOrderTireDetailService.selectBizOrderTireDetailByDetailId(detailId);
mmap.put("bizOrderTireDetail", bizOrderTireDetail);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:detail:edit")
@Log(title = "工单轮胎执行明细", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BizOrderTireDetail bizOrderTireDetail)
{
return toAjax(bizOrderTireDetailService.updateBizOrderTireDetail(bizOrderTireDetail));
}
/**
*
*/
@RequiresPermissions("system:detail:remove")
@Log(title = "工单轮胎执行明细", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(bizOrderTireDetailService.deleteBizOrderTireDetailByDetailIds(ids));
}
}

@ -0,0 +1,81 @@
<!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-detail-add">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">工单ID</label>
<div class="col-sm-8">
<input name="orderId" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">轮胎位置ID</label>
<div class="col-sm-8">
<input name="positionId" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">轮胎ID</label>
<div class="col-sm-8">
<input name="tireId" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">轮胎编号:</label>
<div class="col-sm-8">
<input name="tireCode" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">花纹深度:</label>
<div class="col-sm-8">
<input name="treadDepth" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">胎压:</label>
<div class="col-sm-8">
<input name="tirePress" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/detail"
$("#form-detail-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-detail-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,134 @@
<!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>
<label>工单ID</label>
<input type="text" name="orderId"/>
</li>
<li>
<label>轮胎位置ID</label>
<input type="text" name="positionId"/>
</li>
<li>
<label>轮胎ID</label>
<input type="text" name="tireId"/>
</li>
<li>
<label>轮胎编号:</label>
<input type="text" name="tireCode"/>
</li>
<li>
<label>花纹深度:</label>
<input type="text" name="treadDepth"/>
</li>
<li>
<label>胎压:</label>
<input type="text" name="tirePress"/>
</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="system:detail:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:detail:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:detail:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:detail: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('system:detail:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:detail:remove')}]];
var prefix = ctx + "system/detail";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "工单轮胎执行明细",
columns: [{
checkbox: true
},
{
field: 'detailId',
title: '明细ID',
visible: false
},
{
field: 'orderId',
title: '工单ID'
},
{
field: 'positionId',
title: '轮胎位置ID'
},
{
field: 'tireId',
title: '轮胎ID'
},
{
field: 'tireCode',
title: '轮胎编号'
},
{
field: 'treadDepth',
title: '花纹深度'
},
{
field: 'tirePress',
title: '胎压'
},
{
field: 'tireStatus',
title: '轮胎状态描述'
},
{
field: 'remark',
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.detailId + '\')"><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.detailId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,82 @@
<!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-detail-edit" th:object="${bizOrderTireDetail}">
<input name="detailId" th:field="*{detailId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">工单ID</label>
<div class="col-sm-8">
<input name="orderId" th:field="*{orderId}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">轮胎位置ID</label>
<div class="col-sm-8">
<input name="positionId" th:field="*{positionId}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">轮胎ID</label>
<div class="col-sm-8">
<input name="tireId" th:field="*{tireId}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">轮胎编号:</label>
<div class="col-sm-8">
<input name="tireCode" th:field="*{tireCode}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">花纹深度:</label>
<div class="col-sm-8">
<input name="treadDepth" th:field="*{treadDepth}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">胎压:</label>
<div class="col-sm-8">
<input name="tirePress" th:field="*{tirePress}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/detail";
$("#form-detail-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-detail-edit').serialize());
}
}
</script>
</body>
</html>

@ -1,129 +1,287 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('修改维保工单')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-edit" th:object="${bizMaintenanceOrder}">
<input name="orderId" th:field="*{orderId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">车辆ID/轮胎ID</label>
<div class="col-sm-8">
<input name="vehicleId" th:field="*{vehicleId}" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">车牌号码:</label>
<div class="col-sm-8">
<input name="plateNumber" th:field="*{plateNumber}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">维保类型:</label>
<div class="col-sm-8">
<select name="typeCode" class="form-control" th:with="type=${@dict.getType('main_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{typeCode}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">维修站点/修理厂ID</label>
<div class="col-sm-8">
<input name="factoryId" th:field="*{factoryId}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">仪表盘录入里程:</label>
<div class="col-sm-8">
<input name="inputMileage" th:field="*{inputMileage}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">上次维保里程:</label>
<div class="col-sm-8">
<input name="lastMileage" th:field="*{lastMileage}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">保养日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="maintainDate" th:value="${#dates.format(bizMaintenanceOrder.maintainDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">补充说明:</label>
<div class="col-sm-8">
<textarea name="description" class="form-control">[[*{description}]]</textarea>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<select name="status" class="form-control" th:with="type=${@dict.getType('order_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
</select>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">1代表汽车、2代表轮胎</label>
<div class="col-sm-8">
<input name="orderType" th:field="*{orderType}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/order";
$("#form-order-edit").validate({
focusCleanup: true
});
<th:block th:include="include :: header('维保详情')" />
<style>
/* --- 核心 CSS 样式开始 --- */
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
}
/* 顶部信息卡片 */
.info-card {
background: #fff;
padding: 20px;
border-radius: 4px;
margin-bottom: 20px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.info-row { margin-bottom: 10px; }
.info-label { color: #888; font-size: 13px; width: 120px; display: inline-block; }
.info-value { font-size: 13px; color: #333; font-weight: 500; }
.license-plate { font-size: 20px; font-weight: bold; color: #1ab394; margin-bottom: 15px; display: block; }
/* 维保对比区域 */
.maintenance-container {
display: flex;
background: #fff;
padding: 20px;
border-radius: 4px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
min-height: 600px;
}
.maint-section { flex: 1; padding: 0 20px; position: relative; }
.maint-title { font-weight: bold; font-size: 16px; margin-bottom: 20px; border-left: 4px solid #1ab394; padding-left: 10px; }
/* 分割线 */
.divider {
width: 1px;
background-color: #e7eaec;
margin: 0 20px;
}
$("input[name='maintainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
</script>
/* 轮胎布局容器 */
.axle-group { display: flex; justify-content: center; margin-bottom: 20px; position: relative; }
.axle-label {
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
background: #fff;
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
color: #666;
border: 1px solid #e7eaec;
z-index: 2;
}
/* 轮胎卡片 */
.tyre-card {
width: 100px;
height: 180px;
background-color: #2f4050; /* 深灰底色 */
border-radius: 10px 10px 20px 20px;
margin: 0 5px;
position: relative;
overflow: hidden;
color: #fff;
transition: all 0.3s;
display: flex;
flex-direction: column;
justify-content: flex-end; /* 内容沉底 */
padding-bottom: 10px;
box-sizing: border-box;
}
/* 胎纹模拟背景 */
.tyre-pattern {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
opacity: 0.1; /* 淡淡的纹路 */
background-image: repeating-linear-gradient(
45deg,
transparent,
transparent 10px,
#fff 10px,
#fff 20px
);
z-index: 1;
}
/* 轴位标签 (左前, 右前等) */
.pos-tag {
position: absolute;
top: 0; left: 0;
background: #999;
color: #fff;
font-size: 12px;
padding: 2px 8px;
border-radius: 0 0 10px 0;
z-index: 3;
}
/* 轮胎内容文字 */
.tyre-info { z-index: 3; padding: 0 10px; font-size: 12px; line-height: 1.5; }
.tyre-brand { font-weight: bold; font-size: 13px; }
.tyre-spec { font-size: 11px; opacity: 0.9; }
.tyre-dot { font-size: 11px; opacity: 0.8; }
.tyre-depth { color: #1ab394; font-weight: bold; margin-top: 2px; }
.tyre-status { font-size: 11px; border: 1px solid rgba(255,255,255,0.3); padding: 1px 3px; border-radius: 3px; display: inline-block; margin-top: 2px;}
/* 状态样式:卸胎 (绿色) */
.status-removed {
border: 2px solid #1ab394 !important;
background-color: #2f4050;
}
.status-removed .pos-tag { background: #1ab394; }
.status-removed .tyre-pattern { opacity: 0.3; } /* 卸胎纹路稍微明显点 */
.status-removed::after {
content: "卸胎";
position: absolute;
top: 30%; left: 50%;
transform: translateX(-50%);
color: #1ab394;
font-weight: bold;
font-size: 14px;
z-index: 4;
background: rgba(255,255,255,0.9);
padding: 2px 5px;
border-radius: 4px;
}
/* 状态样式:空位 (灰色透明) */
.status-empty {
background: #e7eaec;
border: 1px dashed #ccc;
}
.status-empty .pos-tag { background: #ccc; }
.status-empty .tyre-pattern { display: none; }
/* 按钮 */
.btn-xs { padding: 1px 5px; font-size: 12px; border-radius: 3px; }
</style>
</head>
<body class="gray-bg">
<div class="container-div">
<!-- 顶部基础信息 -->
<div class="info-card">
<span class="license-plate" id="licensePlate">粤B71857D</span>
<div class="row">
<div class="col-sm-3 info-row">
<span class="info-label">所属场站:</span><span class="info-value" id="factory">清湖修理厂</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">保养日期:</span><span class="info-value" id="maintDate">2026-04-16</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">创建时间:</span><span class="info-value" id="createTime">2026-04-17 10:49:49</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">创建人:</span><span class="info-value" id="creator">冯伟</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">完成时间:</span><span class="info-value" id="finishTime">2026-04-17 10:51:07</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">完成操作人:</span><span class="info-value" id="finishUser">冯伟</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">当前车辆里程(km)</span><span class="info-value" id="mileage">311233.00</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">线路:</span><span class="info-value" id="route">M204</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">所属部门:</span><span class="info-value" id="dept">第四分公司-同胜</span>
</div>
<div class="col-sm-3 info-row">
<span class="info-label">备注:</span><span class="info-value" id="remark">-</span>
</div>
</div>
</div>
<!-- 维保前后对比区域 -->
<div class="maintenance-container">
<!-- 维保前 -->
<div class="maint-section">
<div class="maint-title">维保前</div>
<div id="before-container">
<!-- JS 渲染内容 -->
</div>
</div>
<div class="divider"></div>
<!-- 维保后 -->
<div class="maint-section">
<div style="float: right;">
<button class="btn btn-white btn-xs"><i class="fa fa-history"></i> 操作记录</button>
</div>
<div class="maint-title">维保后</div>
<div id="after-container">
<!-- JS 渲染内容 -->
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<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' }
]
};
// 渲染函数
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>';
// 第二轴 (后轮)
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>';
$(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>`;
}
// 状态类名
let statusClass = tyre.status === 'removed' ? 'status-removed' : '';
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>`;
}
// 执行渲染
renderTyres(mockData.before, '#before-container');
renderTyres(mockData.after, '#after-container');
});
</script>
</body>
</html>

@ -21,14 +21,6 @@
<option th:each="dict : ${type}" th:if="${dict.dictValue == '1'} or ${dict.dictValue == '4'}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>维修站点:</label>
<select name="typeCode" th:with="type=${@dict.getType('main_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:if="${dict.dictValue == '1'} or ${dict.dictValue == '4'}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
<input type="text" name="factoryId"/>
</li>
<!-- <li>-->
<!-- <label>保养日期:</label>-->
<!-- <input type="text" class="time-input" placeholder="请选择保养日期" name="maintainDate"/>-->
@ -166,8 +158,7 @@
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.orderId + '\')"><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.orderId + '\')"><i class="fa fa-remove"></i>删除</a>');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.orderId + '\')"><i class="fa fa-eye"></i>详情</a> ');
return actions.join('');
}
}]
@ -175,5 +166,6 @@
$.table.init(options);
});
</script>
</body>
</html>

@ -0,0 +1,106 @@
<!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>
轮胎品牌:<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="tyreType" th:with="type=${@dict.getType('tyre_type')}">
<option value="">所有</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-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tyre:tyre:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "demo/table";
var datas = [[${@dict.getType('sys_normal_disable')}]];
$(function() {
var options = {
url: prefix + "/list",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
columns : [
[{
title : '统计维度',
align : 'center',
colspan : 2
}, {
title : '可用轮胎库存',
align : 'center',
colspan : 4
},
{
title : '在车轮胎',
align : 'center',
rowspan : 2
}
],
[
{
field : 'userId',
title : '所属部门'
}, {
field : 'userCode',
title : '所属场站'
}, {
field : 'userName',
title : '全新胎'
}, {
field : 'userPhone',
title : '周转胎'
}, {
field : 'userEmail',
title : '翻新胎'
}, {
field : 'userBalance',
title : '实验胎'
}
]
]
};
$.table.init(options);
});
</script>
</body>
</html>

@ -22,6 +22,17 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.18.1</version>
<scope>compile</scope>
</dependency>
</dependencies>

@ -1,19 +1,16 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* biz_order_tire_detail
* biz_order_tire_detail
*
* @author xins
* @date 2026-04-15
* @author ruoyi
* @date 2026-04-17
*/
public class BizOrderTireDetail extends BaseEntity
{
@ -27,70 +24,29 @@ public class BizOrderTireDetail extends BaseEntity
private Long orderId;
/** 轮胎位置ID关联位置表 */
@Excel(name = "轮胎位置ID", readConverterExp = "关联位置表")
@Excel(name = "轮胎位置ID", readConverterExp = "关=联位置表")
private Long positionId;
/** 轮胎ID关联轮胎档案base_tyre,如果是新胎可能为空或临时生成) */
@Excel(name = "轮胎ID", readConverterExp = "关联轮胎档案base_tyre,如果是新胎可能为空或临时生成")
/** 轮胎ID关联轮胎档案,如果是新胎可能为空或临时生成) */
@Excel(name = "轮胎ID", readConverterExp = "关=联轮胎档案,如果是新胎可能为空或临时生成")
private Long tireId;
/** 轮胎编号(冗余字段,记录快照) */
@Excel(name = "轮胎编号", readConverterExp = "冗余字段,记录快照")
@Excel(name = "轮胎编号", readConverterExp = "冗=余字段,记录快照")
private String tireCode;
/** 花纹深度mm截图中的10mm */
@Excel(name = "花纹深度mm", readConverterExp = "截图中的10mm")
@Excel(name = "花纹深度", readConverterExp = "m=m")
private BigDecimal treadDepth;
/** 轮胎状态描述(截图中的"新胎"、"模拟数据" */
@Excel(name = "轮胎状态描述", readConverterExp = "截图中的\"新胎\"、\"模拟数据\"")
/** 胎压 */
@Excel(name = "胎压")
private Long tirePress;
/** 轮胎状态描述(截图中的“新胎”、“模拟数据”) */
@Excel(name = "轮胎状态描述", readConverterExp = "截=图中的“新胎”、“模拟数据”")
private String tireStatus;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/** 轮胎品牌 */
@Excel(name = "轮胎品牌")
private String tyreBrand;
/** 轮胎型号 */
@Excel(name = "轮胎型号")
private String tyreModel;
/** 轮胎级别 */
@Excel(name = "轮胎级别")
private String tyreLevel;
/** 轮胎样式 */
@Excel(name = "轮胎样式")
private String tyrePattern;
/** 沟槽条数 */
@Excel(name = "沟槽条数")
private String grooves;
/** 花纹深度 */
@Excel(name = "花纹深度")
private String patternDepth;
/** 轮胎类型 */
@Excel(name = "轮胎类型")
private String tyreType;
/** 自编号 */
@Excel(name = "自编号")
private String selfNo;
/** 轮胎EPC */
@Excel(name = "轮胎EPC")
private String tyreEpc;
/** 轮位描述 */
@Excel(name = "轮位描述")
private String positionDesc;
public void setDetailId(Long detailId)
{
this.detailId = detailId;
@ -100,6 +56,7 @@ public class BizOrderTireDetail extends BaseEntity
{
return detailId;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
@ -109,6 +66,7 @@ public class BizOrderTireDetail extends BaseEntity
{
return orderId;
}
public void setPositionId(Long positionId)
{
this.positionId = positionId;
@ -118,6 +76,7 @@ public class BizOrderTireDetail extends BaseEntity
{
return positionId;
}
public void setTireId(Long tireId)
{
this.tireId = tireId;
@ -127,6 +86,7 @@ public class BizOrderTireDetail extends BaseEntity
{
return tireId;
}
public void setTireCode(String tireCode)
{
this.tireCode = tireCode;
@ -136,6 +96,7 @@ public class BizOrderTireDetail extends BaseEntity
{
return tireCode;
}
public void setTreadDepth(BigDecimal treadDepth)
{
this.treadDepth = treadDepth;
@ -145,6 +106,17 @@ public class BizOrderTireDetail extends BaseEntity
{
return treadDepth;
}
public void setTirePress(Long tirePress)
{
this.tirePress = tirePress;
}
public Long getTirePress()
{
return tirePress;
}
public void setTireStatus(String tireStatus)
{
this.tireStatus = tireStatus;
@ -154,95 +126,6 @@ public class BizOrderTireDetail extends BaseEntity
{
return tireStatus;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public String getTyreBrand() {
return tyreBrand;
}
public void setTyreBrand(String tyreBrand) {
this.tyreBrand = tyreBrand;
}
public String getTyreModel() {
return tyreModel;
}
public void setTyreModel(String tyreModel) {
this.tyreModel = tyreModel;
}
public String getTyreLevel() {
return tyreLevel;
}
public void setTyreLevel(String tyreLevel) {
this.tyreLevel = tyreLevel;
}
public String getTyrePattern() {
return tyrePattern;
}
public void setTyrePattern(String tyrePattern) {
this.tyrePattern = tyrePattern;
}
public String getGrooves() {
return grooves;
}
public void setGrooves(String grooves) {
this.grooves = grooves;
}
public String getPatternDepth() {
return patternDepth;
}
public void setPatternDepth(String patternDepth) {
this.patternDepth = patternDepth;
}
public String getTyreType() {
return tyreType;
}
public void setTyreType(String tyreType) {
this.tyreType = tyreType;
}
public String getSelfNo() {
return selfNo;
}
public void setSelfNo(String selfNo) {
this.selfNo = selfNo;
}
public String getTyreEpc() {
return tyreEpc;
}
public void setTyreEpc(String tyreEpc) {
this.tyreEpc = tyreEpc;
}
public String getPositionDesc() {
return positionDesc;
}
public void setPositionDesc(String positionDesc) {
this.positionDesc = positionDesc;
}
@Override
public String toString() {
@ -253,19 +136,13 @@ public class BizOrderTireDetail extends BaseEntity
.append("tireId", getTireId())
.append("tireCode", getTireCode())
.append("treadDepth", getTreadDepth())
.append("tirePress", getTirePress())
.append("tireStatus", getTireStatus())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("tyreBrand", getTyreBrand())
.append("tyreModel", getTyreModel())
.append("tyreLevel", getTyreLevel())
.append("tyrePattern", getTyrePattern())
.append("grooves", getGrooves())
.append("patternDepth", getPatternDepth())
.append("tyreType", getTyreType())
.append("selfNo", getSelfNo())
.append("tyreEpc", getTyreEpc())
.append("positionDesc", getPositionDesc())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,14 @@
package com.ruoyi.system.domain;
import lombok.Data;
import java.util.List;
@Data
public class MaintenanceOrderDTO {
// 原来的工单对象
private BizMaintenanceOrder order;
// 原来的轮胎详情对象(如果是列表,可以用 List<BizOrderTireDetail>
private List<BizOrderTireDetail> tireDetails;
}

@ -0,0 +1,34 @@
package com.ruoyi.system.domain;
import lombok.Data;
@Data
public class TyreStatVO {
/** 所属部门 */
private String deptName;
/** 所属场站 */
private String factoryName;
/** 可用轮胎库存 - 新胎 */
private Integer newTyre;
/** 可用轮胎库存 - 周转胎 */
private Integer rotateTyre;
/** 可用轮胎库存 - 翻新胎 */
private Integer remoldTyre;
/** 可用轮胎库存 - 修补胎 */
private Integer repairTyre;
/** 在车轮胎 */
private Integer onCarTyre;
/** 维护中/待处理库存 - 待鉴定 */
private Integer pendingAppraise;
/** 维护中/待处理库存 - 待修补 */
private Integer pendingRepair;
/** 维护中/待处理库存 - 待翻新 */
private Integer pendingRemold;
/** 维护中/待处理库存 - 待报废 */
private Integer pendingScrap;
/** 维护中/待处理库存 - 报废 */
private Integer scrapped;
}

@ -4,81 +4,58 @@ import java.util.List;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
* Mapper
* Mapper
*
* @author yangwanli
* @date 2026-04-15
* @author ruoyi
* @date 2026-04-17
*/
public interface BizOrderTireDetailMapper
{
/**
*
*
*
* @param detailId
* @return
* @param detailId
* @return
*/
public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId);
public BizOrderTireDetail selectBizOrderTireDetailByDetailId(Long detailId);
/**
дь цайхщ
* @param bizOrderTireDetail
* @return
*
*
* @param bizOrderTireDetail
* @return
*/
public List<BizOrderTireDetail> selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
*
* @param bizOrderTireDetail
* @param bizOrderTireDetail
* @return
*/
public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
*
* @param bizOrderTireDetail
* @param bizOrderTireDetail
* @return
*/
public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
*
* @param detailId
* @param detailId
* @return
*/
public int deleteBizOrderTireDetailById(Long detailId);
public int deleteBizOrderTireDetailByDetailId(Long detailId);
/**
*
*
*
* @param detailIds
* @return
*/
public int deleteBizOrderTireDetailByIds(String[] detailIds);
/**
* ID
*
* @param orderId ID
* @return
*/
public List<BizOrderTireDetail> selectTireDetailByOrderId(Long orderId);
/**
*
*
* @param tireDetails
* @return
*/
public int batchInsertTireDetail(List<BizOrderTireDetail> tireDetails);
/**
* ID
*
* @param orderId ID
* @return
*/
public int deleteTireDetailByOrderId(Long orderId);
public int deleteBizOrderTireDetailByDetailIds(String[] detailIds);
}

@ -4,91 +4,58 @@ import java.util.List;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
* Service
* Service
*
* @author yangwanli
* @date 2026-04-15
* @author ruoyi
* @date 2026-04-17
*/
public interface IBizOrderTireDetailService
{
/**
*
*
*
* @param detailId
* @return
* @param detailId
* @return
*/
public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId);
public BizOrderTireDetail selectBizOrderTireDetailByDetailId(Long detailId);
/**
*
*
*
* @param bizOrderTireDetail
* @return
* @param bizOrderTireDetail
* @return
*/
public List<BizOrderTireDetail> selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
*
* @param bizOrderTireDetail
* @param bizOrderTireDetail
* @return
*/
public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
*
* @param bizOrderTireDetail
* @param bizOrderTireDetail
* @return
*/
public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
*
* @param detailIds
* @param detailIds
* @return
*/
public int deleteBizOrderTireDetailByIds(String detailIds);
public int deleteBizOrderTireDetailByDetailIds(String detailIds);
/**
*
*
*
* @param detailId
* @param detailId
* @return
*/
public int deleteBizOrderTireDetailById(Long detailId);
/**
* ID
*
* @param orderId ID
* @return
*/
public List<BizOrderTireDetail> selectTireDetailByOrderId(Long orderId);
/**
*
*
* @param tireDetails
* @return
*/
public int batchInsertTireDetail(List<BizOrderTireDetail> tireDetails);
/**
* ID
*
* @param orderId ID
* @return
*/
public int deleteTireDetailByOrderId(Long orderId);
/**
*
*
* @param orderId ID
* @param tireDetails
* @return
*/
public int saveTireDetails(Long orderId, List<BizOrderTireDetail> tireDetails);
public int deleteBizOrderTireDetailByDetailId(Long detailId);
}

@ -1,23 +1,19 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.system.mapper.BizOrderTireDetailMapper;
import com.ruoyi.system.domain.BizOrderTireDetail;
import com.ruoyi.system.service.IBizOrderTireDetailService;
import com.ruoyi.common.core.text.Convert;
/**
* Service
* Service
*
* @author yangwanli
* @date 2026-04-15
* @author ruoyi
* @date 2026-04-17
*/
@Service
public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService
@ -26,22 +22,22 @@ public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService
private BizOrderTireDetailMapper bizOrderTireDetailMapper;
/**
*
*
*
* @param detailId
* @return
* @param detailId
* @return
*/
@Override
public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId)
public BizOrderTireDetail selectBizOrderTireDetailByDetailId(Long detailId)
{
return bizOrderTireDetailMapper.selectBizOrderTireDetailById(detailId);
return bizOrderTireDetailMapper.selectBizOrderTireDetailByDetailId(detailId);
}
/**
*
*
*
* @param bizOrderTireDetail
* @return
* @param bizOrderTireDetail
* @return
*/
@Override
public List<BizOrderTireDetail> selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail)
@ -50,117 +46,52 @@ public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService
}
/**
*
*
*
* @param bizOrderTireDetail
* @param bizOrderTireDetail
* @return
*/
@Override
public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail)
{
bizOrderTireDetail.setCreateTime(DateUtils.getNowDate());
bizOrderTireDetail.setCreateBy(ShiroUtils.getLoginName());
return bizOrderTireDetailMapper.insertBizOrderTireDetail(bizOrderTireDetail);
}
/**
*
*
*
* @param bizOrderTireDetail
* @param bizOrderTireDetail
* @return
*/
@Override
public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail)
{
bizOrderTireDetail.setUpdateTime(DateUtils.getNowDate());
return bizOrderTireDetailMapper.updateBizOrderTireDetail(bizOrderTireDetail);
}
/**
*
*
*
* @param detailIds
* @param detailIds
* @return
*/
@Override
public int deleteBizOrderTireDetailByIds(String detailIds)
public int deleteBizOrderTireDetailByDetailIds(String detailIds)
{
return bizOrderTireDetailMapper.deleteBizOrderTireDetailByIds(Convert.toStrArray(detailIds));
return bizOrderTireDetailMapper.deleteBizOrderTireDetailByDetailIds(Convert.toStrArray(detailIds));
}
/**
*
*
*
* @param detailId
* @param detailId
* @return
*/
@Override
public int deleteBizOrderTireDetailById(Long detailId)
public int deleteBizOrderTireDetailByDetailId(Long detailId)
{
return bizOrderTireDetailMapper.deleteBizOrderTireDetailById(detailId);
}
/**
* ID
*
* @param orderId ID
* @return
*/
@Override
public List<BizOrderTireDetail> selectTireDetailByOrderId(Long orderId)
{
return bizOrderTireDetailMapper.selectTireDetailByOrderId(orderId);
}
/**
*
*
* @param tireDetails
* @return
*/
@Override
public int batchInsertTireDetail(List<BizOrderTireDetail> tireDetails)
{
if (tireDetails == null || tireDetails.size() == 0) {
return 0;
}
return bizOrderTireDetailMapper.batchInsertTireDetail(tireDetails);
}
/**
* ID
*
* @param orderId ID
* @return
*/
@Override
public int deleteTireDetailByOrderId(Long orderId)
{
return bizOrderTireDetailMapper.deleteTireDetailByOrderId(orderId);
}
/**
*
*
* @param orderId ID
* @param tireDetails
* @return
*/
@Override
@Transactional
public int saveTireDetails(Long orderId, List<BizOrderTireDetail> tireDetails)
{
// 先删除原有明细
bizOrderTireDetailMapper.deleteTireDetailByOrderId(orderId);
// 插入新明细
if (tireDetails != null && tireDetails.size() > 0) {
for (BizOrderTireDetail detail : tireDetails) {
detail.setOrderId(orderId);
detail.setCreateTime(DateUtils.getNowDate());
detail.setCreateBy(ShiroUtils.getLoginName());
}
return bizOrderTireDetailMapper.batchInsertTireDetail(tireDetails);
}
return 1;
return bizOrderTireDetailMapper.deleteBizOrderTireDetailByDetailId(detailId);
}
}

@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="userName" column="user_name" />
<result property="updateName" column="update_name" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
@ -55,9 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBizMaintenanceOrderListTwo" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
select order_id, order_no, vehicle_id, plate_number, type_code, factory_id, d.dept_name as factoryName, input_mileage, last_mileage, maintain_date, description, bmo.status, order_type,
bmo.create_by,su.user_name, bmo.create_time, bmo.update_by, bmo.update_time, bmo.remark
bmo.create_by,su.user_name, bmo.create_time, bmo.update_by,sus.user_name as update_name, bmo.update_time, bmo.remark
from biz_maintenance_order bmo
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 sys_dept d on bmo.factory_id = d.dept_id
<where>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>

@ -11,23 +11,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="tireId" column="tire_id" />
<result property="tireCode" column="tire_code" />
<result property="treadDepth" column="tread_depth" />
<result property="tirePress" column="tire_press" />
<result property="tireStatus" column="tire_status" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<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="grooves" column="grooves" />
<result property="patternDepth" column="pattern_depth" />
<result property="tyreType" column="tyre_type" />
<result property="selfNo" column="self_no" />
<result property="tyreEpc" column="tyre_epc" />
<result property="positionDesc" column="position_desc" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBizOrderTireDetailVo">
select detail_id, order_id, position_id, tire_id, tire_code, tread_depth, tire_status, create_time from biz_order_tire_detail
select detail_id, order_id, position_id, tire_id, tire_code, tread_depth, tire_press, tire_status, create_by, create_time, update_by, update_time, remark from biz_order_tire_detail
</sql>
<select id="selectBizOrderTireDetailList" parameterType="BizOrderTireDetail" resultMap="BizOrderTireDetailResult">
@ -36,51 +30,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if test="tireCode != null and tireCode != ''"> and tire_code like concat('%', #{tireCode}, '%')</if>
<if test="tireCode != null and tireCode != ''"> and tire_code = #{tireCode}</if>
<if test="treadDepth != null "> and tread_depth = #{treadDepth}</if>
<if test="tirePress != null "> and tire_press = #{tirePress}</if>
<if test="tireStatus != null and tireStatus != ''"> and tire_status = #{tireStatus}</if>
</where>
</select>
<select id="selectBizOrderTireDetailById" parameterType="Long" resultMap="BizOrderTireDetailResult">
<select id="selectBizOrderTireDetailByDetailId" parameterType="Long" resultMap="BizOrderTireDetailResult">
<include refid="selectBizOrderTireDetailVo"/>
where detail_id = #{detailId}
</select>
<select id="selectTireDetailByOrderId" parameterType="Long" resultMap="BizOrderTireDetailResult">
select d.detail_id, d.order_id, d.position_id, d.tire_id, d.tire_code, d.tread_depth, d.tire_status, d.create_time,
t.tyre_brand, t.tyre_model, t.tyre_level, t.tyre_pattern, t.grooves, t.pattern_depth, t.tyre_type, t.self_no, t.tyre_epc,
p.dict_label as position_desc
from biz_order_tire_detail d
left join base_tyre t on d.tire_id = t.tyre_id
left join sys_dict_data p on d.position_id = p.dict_code and p.dict_type='WheelPosition'
where d.order_id = #{orderId}
order by d.position_id
</select>
<insert id="insertBizOrderTireDetail" parameterType="BizOrderTireDetail">
<insert id="insertBizOrderTireDetail" parameterType="BizOrderTireDetail" useGeneratedKeys="true" keyProperty="detailId">
insert into biz_order_tire_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="detailId != null">detail_id,</if>
<if test="orderConservativeId != null">order_id,</if>
<if test="orderId != null">order_id,</if>
<if test="positionId != null">position_id,</if>
<if test="tireId != null">tire_id,</if>
<if test="tireCode != null">tire_code,</if>
<if test="treadDepth != null">tread_depth,</if>
<if test="tirePress != null">tire_press,</if>
<if test="tireStatus != null">tire_status,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="detailId != null">#{detailId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="positionId != null>">#{positionId},</if>
<if test="tireId != null>">#{tireId},</if>
<if test="tireCode != null>">#{tireCode},</if>
<if test="treadDepth != null>">#{treadDepth},</if>
<if test="tireStatus != null>">#{tireStatus},</if>
<if test="createTime != null>">#{createTime},</if>
<if test="createBy != null>">#{createBy},</if>
<if test="positionId != null">#{positionId},</if>
<if test="tireId != null">#{tireId},</if>
<if test="tireCode != null">#{tireCode},</if>
<if test="treadDepth != null">#{treadDepth},</if>
<if test="tirePress != null">#{tirePress},</if>
<if test="tireStatus != null">#{tireStatus},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
@ -92,32 +82,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tireId != null">tire_id = #{tireId},</if>
<if test="tireCode != null">tire_code = #{tireCode},</if>
<if test="treadDepth != null">tread_depth = #{treadDepth},</if>
<if test="tirePress != null">tire_press = #{tirePress},</if>
<if test="tireStatus != null">tire_status = #{tireStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where detail_id = #{detailId}
</update>
<delete id="deleteBizOrderTireDetailById" parameterType="Long">
<delete id="deleteBizOrderTireDetailByDetailId" parameterType="Long">
delete from biz_order_tire_detail where detail_id = #{detailId}
</delete>
<delete id="deleteBizOrderTireDetailByIds" parameterType="String">
<delete id="deleteBizOrderTireDetailByDetailIds" parameterType="String">
delete from biz_order_tire_detail where detail_id in
<foreach item="detailId" collection="array" open="(" separator="," close=")">
#{detailId}
</foreach>
</delete>
<insert id="batchInsertTireDetail" parameterType="java.util.List">
insert into biz_order_tire_detail (order_id, position_id, tire_id, tire_code, tread_depth, tire_status, create_time, create_by) values
<foreach collection="list" item="item" separator=",">
(#{item.orderId}, #{item.positionId}, #{item.tireId}, #{item.tireCode}, #{item.treadDepth}, #{item.tireStatus}, #{item.createTime}, #{item.createBy})
</foreach>
</insert>
<delete id="deleteTireDetailByOrderId" parameterType="Long">
delete from biz_order_tire_detail where order_id = #{orderId}
</delete>
</mapper>
Loading…
Cancel
Save