杨万里 3 weeks ago
commit 0bbf2338a5

@ -1,4 +1,4 @@
package com.ruoyi.system.controller;
package com.ruoyi.web.controller.tyre;
import java.util.List;

@ -0,0 +1,388 @@
package com.ruoyi.web.controller.tyre;
import java.util.List;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.file.MimeTypeUtils;
import com.ruoyi.common.utils.uuid.Seq;
import com.ruoyi.system.domain.BaseCar;
import com.ruoyi.system.service.IBaseCarService;
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 org.springframework.web.multipart.MultipartFile;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.config.ServerConfig;
import com.ruoyi.system.domain.BizMaintenanceOrder;
import com.ruoyi.system.domain.BizOrderTireDetail;
import com.ruoyi.system.domain.SysAttachment;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.system.service.IBizMaintenanceOrderService;
import com.ruoyi.system.service.IBizOrderTireDetailService;
import com.ruoyi.system.service.ISysAttachmentService;
import com.ruoyi.system.service.ISysDeptService;
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 yangwanli
* @date 2026-04-15
*/
@Controller
@RequestMapping("/tyre/order")
public class BizMaintenanceOrderController extends BaseController {
private String prefix = "tyre/order";
@Autowired
private IBizMaintenanceOrderService bizMaintenanceOrderService;
@Autowired
private ISysAttachmentService sysAttachmentService;
@Autowired
private ISysDeptService deptService;
@Autowired
private IBaseCarService baseCarService;
@Autowired
private IBizOrderTireDetailService tireDetailService;
@Autowired
private ServerConfig serverConfig;
@RequiresPermissions("system:order:view")
@GetMapping()
public String order() {
return prefix + "/order";
}
/**
*
*/
@RequiresPermissions("system:order:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BizMaintenanceOrder bizMaintenanceOrder) {
startPage();
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizRepairOrderList(bizMaintenanceOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("system:order:export")
@Log(title = "维保工单主表", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BizMaintenanceOrder bizMaintenanceOrder) {
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
ExcelUtil<BizMaintenanceOrder> util = new ExcelUtil<BizMaintenanceOrder>(BizMaintenanceOrder.class);
return util.exportExcel(list, "维保工单数据");
}
/**
*
*/
@RequiresPermissions("system:order:add")
@GetMapping("/add")
public String add(ModelMap mmap) {
BizMaintenanceOrder bizMaintenanceOrder = new BizMaintenanceOrder();
bizMaintenanceOrder.setOrderType("1"); // 汽车类型
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
return prefix + "/add";
}
/**
*
*/
@RequiresPermissions("system:order:add")
@Log(title = "维保工单主表", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BizMaintenanceOrder bizMaintenanceOrder) {
return toAjax(bizMaintenanceOrderService.insertBizMaintenanceOrder(bizMaintenanceOrder));
}
/**
*
*/
@RequiresPermissions("system:order:edit")
@GetMapping("/edit/{orderId}")
public String edit(@PathVariable("orderId") Long orderId, ModelMap mmap) {
BizMaintenanceOrder bizMaintenanceOrder = bizMaintenanceOrderService.selectBizMaintenanceOrderById(orderId);
// 查询工单关联的附件(图片)
List<SysAttachment> attachments = sysAttachmentService.selectAttachmentsByOrderId(orderId);
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
mmap.put("attachments", attachments);
return prefix + "/edit";
}
/**
*
*/
@RequiresPermissions("system:order:edit")
@Log(title = "维保工单主表", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BizMaintenanceOrder bizMaintenanceOrder, String attachmentUrls) {
// 更新工单
int result = bizMaintenanceOrderService.updateBizMaintenanceOrder(bizMaintenanceOrder);
if (result > 0 && bizMaintenanceOrder.getOrderId() != null) {
// 先删除该工单的所有附件记录
sysAttachmentService.deleteAttachmentsByOrderId(bizMaintenanceOrder.getOrderId());
// 重新插入新的附件记录
if (attachmentUrls != null && !attachmentUrls.trim().isEmpty()) {
String[] urls = attachmentUrls.split(",");
for (String url : urls) {
if (url != null && !url.trim().isEmpty()) {
SysAttachment attachment = new SysAttachment();
String fileName = url.substring(url.lastIndexOf("/") + 1);
attachment.setFileName(fileName);
attachment.setFilePath(url);
attachment.setOrderId(bizMaintenanceOrder.getOrderId());
attachment.setUploadBy(ShiroUtils.getLoginName());
sysAttachmentService.insertSysAttachment(attachment);
}
}
}
}
return toAjax(result);
}
/**
*
*/
@RequiresPermissions("system:order:remove")
@Log(title = "维保工单主表", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(bizMaintenanceOrderService.deleteBizMaintenanceOrderByIds(ids));
}
/**
*
*/
@RequiresPermissions("system:order:view")
@GetMapping("/detail/{orderId}")
public String detail(@PathVariable("orderId") Long orderId, ModelMap mmap) {
BizMaintenanceOrder bizMaintenanceOrder = bizMaintenanceOrderService.selectBizMaintenanceOrderById(orderId);
// 查询工单关联的附件(图片)
List<SysAttachment> attachments = sysAttachmentService.selectAttachmentsByOrderId(orderId);
// 查询工单关联的轮胎明细
List<BizOrderTireDetail> tireDetails = tireDetailService.selectTireDetailByOrderId(orderId);
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
mmap.put("attachments", attachments);
mmap.put("tireDetails", tireDetails);
return prefix + "/detail";
}
/**
*
*/
@PostMapping("/queryByPlate")
@ResponseBody
public AjaxResult queryByPlate(String plateNumber) {
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectOrderByPlateNumber(plateNumber);
return AjaxResult.success(list);
}
/**
*
*/
@PostMapping("/queryByTireCode")
@ResponseBody
public AjaxResult queryByTireCode(String tireCode) {
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectOrderByTireCode(tireCode);
return AjaxResult.success(list);
}
/**
*
*/
@RequiresPermissions("system:order:edit")
@PostMapping("/updateStatus")
@ResponseBody
public AjaxResult updateStatus(Long orderId, String status) {
int result = bizMaintenanceOrderService.updateOrderStatus(orderId, status);
return toAjax(result);
}
/**
*
*/
@RequiresPermissions("system:order:submit")
@GetMapping("/submit")
public String submit(ModelMap mmap) {
BizMaintenanceOrder bizMaintenanceOrder = new BizMaintenanceOrder();
bizMaintenanceOrder.setOrderType("1"); // 汽车类型
bizMaintenanceOrder.setStatus("UNSTARTED"); // 未开始状态
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
mmap.put("depts", deptService.selectDeptList(new SysDept()));
mmap.put("cars", baseCarService.selectBaseCarList(new BaseCar()));
return prefix + "/submit";
}
/**
*
*/
@RequiresPermissions("system:order:submit")
@Log(title = "提交工单", businessType = BusinessType.INSERT)
@PostMapping("/submit")
@ResponseBody
public AjaxResult submitSave(BizMaintenanceOrder bizMaintenanceOrder, String attachmentUrls) {
// 设置创建人
bizMaintenanceOrder.setCreateBy(ShiroUtils.getLoginName());
bizMaintenanceOrder.setOrderNo(Seq.getId(Seq.orderSeqType));
// 设置工单类型为汽车类型
bizMaintenanceOrder.setOrderType("1");
// 插入工单
int result = bizMaintenanceOrderService.insertBizMaintenanceOrder(bizMaintenanceOrder);
if (result > 0 && bizMaintenanceOrder.getOrderId() != null && attachmentUrls != null && !attachmentUrls.trim().isEmpty()) {
// 处理图片上传
String[] urls = attachmentUrls.split(",");
for (String url : urls) {
if (url != null && !url.trim().isEmpty()) {
SysAttachment attachment = new SysAttachment();
// 提取文件名
String fileName = url.substring(url.lastIndexOf("/") + 1);
attachment.setFileName(fileName);
attachment.setFilePath(url);
attachment.setOrderId(bizMaintenanceOrder.getOrderId());
attachment.setUploadBy(ShiroUtils.getLoginName());
sysAttachmentService.insertSysAttachment(attachment);
}
}
}
return toAjax(result);
}
/**
* WebUploader
*/
@Log(title = "上传工单图片", businessType = BusinessType.OTHER)
@PostMapping("/uploadImage")
@ResponseBody
public AjaxResult uploadImage(MultipartFile file) {
try {
String imagePath = FileUploadUtils.upload(RuoYiConfig.getUploadPath(), file, MimeTypeUtils.IMAGE_EXTENSION, true);
// 上传路径
// String uploadPath = RuoYiConfig.getUploadPath();
// // 上传并返回新文件名称
// String fileName = FileUploadUtils.upload(uploadPath, file);
// String url = serverConfig.getUrl() + fileName;
// WebUploader要求的返回格式
AjaxResult ajax = AjaxResult.success();
ajax.put("url", imagePath);
ajax.put("fileName", imagePath);
ajax.put("code", 0);
ajax.put("msg", "上传成功");
return ajax;
} catch (Exception e) {
AjaxResult ajax = AjaxResult.error("图片上传失败: " + e.getMessage());
ajax.put("code", 1);
return ajax;
}
}
/**
*
*/
@Log(title = "删除工单图片", businessType = BusinessType.DELETE)
@PostMapping("/deleteImage")
@ResponseBody
public AjaxResult deleteImage(String filePath) {
try {
// 从完整URL中提取文件名
String fileName = StringUtils.substringAfterLast(filePath, "/");
if (StringUtils.isNotEmpty(fileName)) {
// 构建完整文件路径
String fullPath = RuoYiConfig.getUploadPath() + StringUtils.substringAfter(filePath, Constants.RESOURCE_PREFIX);
FileUtils.deleteFile(fullPath);
return AjaxResult.success("图片删除成功");
}
return AjaxResult.error("文件路径无效");
} catch (Exception e) {
return AjaxResult.error("图片删除失败: " + e.getMessage());
}
}
/**
*
*/
@GetMapping("/getOrderImages")
@ResponseBody
public AjaxResult getOrderImages(Long orderId) {
List<SysAttachment> attachments = sysAttachmentService.selectAttachmentsByOrderId(orderId);
return AjaxResult.success(attachments);
}
/**
*
*/
@GetMapping("/getFactoryList")
@ResponseBody
public AjaxResult getFactoryList() {
// 获取部门列表
SysDept queryDept = new SysDept();
queryDept.setParentId(227L);
List<SysDept> deptList = deptService.selectDeptList(queryDept);
return AjaxResult.success(deptList);
}
/**
*
*/
@GetMapping("/getCarList")
@ResponseBody
public AjaxResult getCarList() {
// 获取部门列表
List<BaseCar> carList = baseCarService.selectBaseCarList(new BaseCar());
return AjaxResult.success(carList);
}
@RequiresPermissions("system:order:scrapView")
@GetMapping("/scrapOrder")
public String scrapOrder() {
return prefix + "/scrapOrder";
}
/**
*
*/
@RequiresPermissions("system:order:scrapList")
@PostMapping("/listScrap")
@ResponseBody
public TableDataInfo listScrap(BizMaintenanceOrder bizMaintenanceOrder) {
startPage();
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizScrapOrderList(bizMaintenanceOrder);
return getDataTable(list);
}
}

@ -0,0 +1,225 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('补胎工单详情')" />
<style>
.image-gallery {
display: flex;
flex-wrap: wrap;
gap: 15px;
margin-top: 10px;
}
.image-item {
width: 150px;
border: 1px solid #ddd;
border-radius: 4px;
overflow: hidden;
padding: 5px;
background: #f9f9f9;
}
.image-item img {
width: 100%;
height: 120px;
object-fit: cover;
border-radius: 3px;
}
.image-info {
font-size: 12px;
text-align: center;
margin-top: 5px;
color: #666;
word-break: break-all;
}
.field-label {
font-weight: bold;
color: #555;
}
.readonly-field {
background-color: #f8f9fa;
border-color: #dee2e6;
color: #495057;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<!-- 基本信息 -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">基本信息</h3>
</div>
<div class="panel-body">
<form class="form-horizontal m">
<div class="form-group">
<label class="col-sm-3 control-label field-label">工单编号:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.orderNo}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">车牌号:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.plateNumber}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">维保类型:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.typeCode}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">仪表盘录入里程:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.inputMileage}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">上次维保里程:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.lastMileage}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">保养日期:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${#dates.format(bizMaintenanceOrder.maintainDate, 'yyyy-MM-dd')}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">维修站点:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.factoryName}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">提交人:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.createBy}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">提交日期:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${#dates.format(bizMaintenanceOrder.createTime, 'yyyy-MM-dd HH:mm:ss')}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">状态:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.status}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">补充说明:</label>
<div class="col-sm-8">
<textarea class="form-control readonly-field" th:text="${bizMaintenanceOrder.description}" readonly rows="3"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">修补人:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${bizMaintenanceOrder.maintainer}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label field-label">修补日期:</label>
<div class="col-sm-8">
<input class="form-control readonly-field" th:value="${#dates.format(bizMaintenanceOrder.maintainerDate, 'yyyy-MM-dd')}" readonly>
</div>
</div>
</form>
</div>
</div>
<!-- 图片 -->
<!-- <div class="panel panel-default">-->
<!-- <div class="panel-heading">-->
<!-- <h3 class="panel-title">图片</h3>-->
<!-- </div>-->
<!-- <div class="panel-body">-->
<!-- <div th:if="${attachments != null and not attachments.empty}">-->
<!-- <div class="image-gallery">-->
<!-- <div th:each="attachment : ${attachments}" class="image-item preview-item" style="cursor: pointer;" th:data-src="@{${attachment.filePath}}" th:data-name="${attachment.fileName}">-->
<!-- <img th:src="@{${attachment.filePath}}" th:alt="${attachment.fileName}" >-->
<!-- <div class="image-info">-->
<!-- <div th:text="${attachment.fileName}" style="font-weight: bold; font-size: 11px;"></div>-->
<!-- <div th:text="${#dates.format(attachment.uploadTime, 'yyyy-MM-dd HH:mm')}" style="font-size: 10px; color: #888;"></div>-->
<!-- <div th:text="${attachment.uploadBy}" style="font-size: 10px; color: #666;"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div th:if="${attachments == null or attachments.empty}" class="text-center text-muted">-->
<!-- <p>暂无上传图片</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- 轮胎信息 -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">轮胎信息</h3>
</div>
<div class="panel-body">
<div th:if="${tireDetails != null and not tireDetails.empty}">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width: 60px;">序号</th>
<th>轮胎编号</th>
<th>轮胎位置</th>
<th>品牌</th>
<th>型号</th>
<th>花纹深度(mm)</th>
<th>状态描述</th>
</tr>
</thead>
<tbody>
<tr th:each="tire, iterStat : ${tireDetails}">
<td th:text="${iterStat.count}"></td>
<td th:text="${tire.tireCode}"></td>
<td th:text="${tire.positionDesc}"></td>
<td th:text="${tire.tyreBrand}"></td>
<td th:text="${tire.tyreModel}"></td>
<td th:text="${tire.treadDepth}"></td>
<td th:text="${tire.tireStatus}"></td>
</tr>
</tbody>
</table>
</div>
<div th:if="${tireDetails == null or tireDetails.empty}" class="text-center text-muted">
<p>暂无轮胎信息</p>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
$(function() {
// 图片点击预览
$(document).on('click', '.preview-item', function() {
var imgSrc = $(this).data('src');
var imgTitle = $(this).data('name') || '工单图片';
previewImage(imgSrc, imgTitle);
});
});
// 图片点击预览
function previewImage(imgSrc, imgTitle) {
layer.open({
type: 1,
title: imgTitle || '工单图片',
shadeClose: true,
shade: 0.8,
area: ['90%', '90%'],
content: '<div style="text-align:center; padding: 20px;"><img src="' + imgSrc + '" style="max-width:100%;max-height:100%;" /></div>'
});
}
</script>
</body>
</html>

@ -0,0 +1,447 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('编辑补胎工单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-fileinput-css" />
<th:block th:include="include :: bootstrap-select-css" />
<style>
/* 图片预览样式 */
.file-preview-frame {
position: relative;
display: inline-block;
margin: 5px;
}
.file-preview-image {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 4px;
border: 1px solid #ddd;
}
.file-remove-btn {
position: absolute;
top: -8px;
right: -8px;
background: #dc3545;
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
line-height: 18px;
text-align: center;
cursor: pointer;
font-size: 12px;
z-index: 10;
}
.uploaded-images {
margin-top: 15px;
}
.uploaded-image-item {
position: relative;
display: inline-block;
margin: 5px;
}
.uploaded-image-item img {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 4px;
border: 1px solid #ddd;
}
.uploaded-image-item .remove-btn {
position: absolute;
top: -8px;
right: -8px;
background: #dc3545;
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
line-height: 18px;
text-align: center;
cursor: pointer;
font-size: 12px;
}
.existing-images {
margin-top: 15px;
padding: 10px;
background: #f8f9fa;
border-radius: 4px;
}
.existing-images-title {
font-weight: bold;
margin-bottom: 10px;
color: #555;
}
</style>
</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 type="hidden" name="orderId" th:value="${bizMaintenanceOrder.orderId}"/>
<input name="orderType" type="hidden" value="1"/>
<input type="hidden" id="attachmentUrls" name="attachmentUrls">
<!-- 车辆信息选择 -->
<div class="form-group">
<label class="col-sm-3 control-label is-required">车辆信息:</label>
<div class="col-sm-8">
<select name="vehicleId" class="form-control selectpicker" id="vehicleSelect" data-live-search="true" required>
<option value="">请选择车辆</option>
</select>
</div>
</div>
<!-- 车牌号码(自动填充) -->
<div class="form-group" style="display: none;">
<label class="col-sm-3 control-label is-required">车牌号码:</label>
<div class="col-sm-8">
<input name="plateNumber" class="form-control" type="text" id="plateNumber" placeholder="车牌号码" readonly required th:value="${bizMaintenanceOrder.plateNumber}">
</div>
</div>
<!-- 工单类型 -->
<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" id="typeCode" required th:with="type=${@dict.getType('main_type')}">
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{typeCode}"></option>
</select>
</div>
</div>
<!-- 执行站点 -->
<div class="form-group">
<label class="col-sm-3 control-label is-required">执行站点:</label>
<div class="col-sm-8">
<select name="factoryId" class="form-control selectpicker" id="factorySelect" data-live-search="true" required>
<option value="">请选择站点</option>
</select>
</div>
</div>
<!-- 仪表盘录入里程 -->
<div class="form-group">
<label class="col-sm-3 control-label">仪表盘录入里程:</label>
<div class="col-sm-8">
<input name="inputMileage" class="form-control" type="number" step="0.01" placeholder="请输入当前里程(km)" th:value="${bizMaintenanceOrder.inputMileage}">
</div>
</div>
<!-- 上次维保里程 -->
<div class="form-group">
<label class="col-sm-3 control-label">上次维保里程:</label>
<div class="col-sm-8">
<input name="lastMileage" class="form-control" type="number" step="0.01" placeholder="请输入上次维保里程(km)" th:value="${bizMaintenanceOrder.lastMileage}">
</div>
</div>
<!-- 保养日期 -->
<div class="form-group">
<label class="col-sm-3 control-label is-required">保养日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="maintainDate" class="form-control" placeholder="yyyy-MM-dd" type="text" required th:value="${#dates.format(bizMaintenanceOrder.maintainDate, 'yyyy-MM-dd')}">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<!-- 补充说明 -->
<div class="form-group">
<label class="col-sm-3 control-label">补充说明:</label>
<div class="col-sm-8">
<textarea name="description" class="form-control" rows="3" placeholder="请输入补充说明" th:text="${bizMaintenanceOrder.description}"></textarea>
</div>
</div>
<!-- 上传图片 -->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">上传图片:</label>-->
<!-- <div class="col-sm-8">-->
<!-- &lt;!&ndash; 已存在的图片 &ndash;&gt;-->
<!-- <div class="existing-images" th:if="${attachments != null and not attachments.empty}">-->
<!-- <div class="existing-images-title">已上传图片(点击可预览,点击×删除):</div>-->
<!-- <div class="uploaded-images" id="existingImages">-->
<!-- <div th:each="attachment, iterStat : ${attachments}" class="uploaded-image-item" th:data-url="${attachment.filePath}" th:data-index="${iterStat.index}">-->
<!-- <img th:src="@{${attachment.filePath}}" th:alt="${attachment.fileName}" onerror="this.src=ctx + 'static/img/no-image.png'" style="cursor: pointer;" class="preview-img">-->
<!-- <button type="button" class="remove-btn" th:data-index="${iterStat.index}">×</button>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- &lt;!&ndash; 新图片上传 &ndash;&gt;-->
<!-- <div class="file-loading">-->
<!-- <input id="orderImages" name="files" type="file" multiple>-->
<!-- </div>-->
<!-- <div class="uploaded-images" id="uploadedImages">-->
<!-- &lt;!&ndash; 新上传图片预览区域 &ndash;&gt;-->
<!-- </div>-->
<!-- <span class="help-block">可上传多张图片支持jpg、png格式单张不超过20MB</span>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<button type="button" class="btn btn-primary" onclick="submitHandler()">保存</button>
<button type="button" class="btn btn-danger" onclick="$.modal.close()">取消</button>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-select-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script type="text/javascript">
var prefix = ctx + "tyre/order";
var uploadedFiles = [];
// 从后端获取已存在的图片
var existingFiles = [[${attachments}]] || [];
// 初始化已存在的图片URL数组
$(function() {
if (existingFiles && existingFiles.length > 0) {
$.each(existingFiles, function(index, item) {
if (item.filePath) {
uploadedFiles.push(item.filePath);
}
});
updateAttachmentUrls();
}
});
// 页面加载完成后执行
$(function() {
// 初始化日期插件
$("#form-order-edit input[name='maintainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 初始化表单验证
$("#form-order-edit").validate({
focusCleanup: true
});
// 初始化selectpicker
initSelectPicker();
// 初始化文件上传
initFileInput();
// 加载车辆列表和站点列表
loadVehicleList();
loadFactoryList();
// 绑定已存在图片的预览和删除事件
bindExistingImageEvents();
});
// 绑定已存在图片的事件
function bindExistingImageEvents() {
// 图片预览
$(document).on('click', '.preview-img', function() {
var imgSrc = $(this).attr('src');
var imgTitle = $(this).attr('alt') || '工单图片';
previewImage(imgSrc, imgTitle);
});
// 删除图片
$(document).on('click', '.remove-btn', function() {
var $item = $(this).closest('.uploaded-image-item');
var fileUrl = $item.data('url');
removeExistingImage(fileUrl, $item);
});
}
// 初始化selectpicker
function initSelectPicker() {
try {
$('.selectpicker').selectpicker({
liveSearch: true,
liveSearchPlaceholder: '请输入关键词搜索...',
noneSelectedText: '请选择',
noneResultsText: '没有找到匹配的结果'
});
} catch (e) {
console.error('selectpicker初始化失败:', e);
}
}
// 初始化bootstrap-fileinput
function initFileInput() {
try {
var $fileInput = $("#orderImages");
if ($fileInput.length === 0) {
console.error('文件输入框不存在');
return;
}
$fileInput.fileinput({
theme: 'fa',
language: 'zh',
uploadUrl: prefix + '/uploadImage',
uploadAsync: true,
maxFileCount: 10,
maxFileSize: 20480,
allowedFileExtensions: ['jpg', 'jpeg', 'png'],
showUpload: true,
showRemove: true,
showPreview: true,
showClose: false,
showCaption: true,
browseOnZoneClick: true,
autoReplace: false,
browseClass: "btn btn-primary",
browseLabel: "选择图片",
browseIcon: "<i class='glyphicon glyphicon-folder-open'></i>&nbsp;",
removeClass: "btn btn-default",
removeLabel: "删除",
removeIcon: "<i class='glyphicon glyphicon-trash'></i>&nbsp;",
uploadClass: "btn btn-info",
uploadLabel: "上传",
uploadIcon: "<i class='glyphicon glyphicon-upload'></i>&nbsp;",
msgPlaceholder: "选择图片...",
msgSizeTooLarge: "文件 \"{name}\" ({size} KB) 超过了最大限制 {maxSize} KB。",
msgInvalidFileExtension: "文件 \"{name}\" 格式不正确。只支持 \"{extensions}\" 格式的文件。",
msgFilesTooMany: "选择的文件数量({n})超过了最大限制{m}。",
dropZoneTitle: "拖拽图片到这里 &hellip;<br>或点击选择按钮",
dropZoneClickTitle: "<br>(或点击选择{files})",
fileActionSettings: {
showUpload: false,
showRemove: true
}
}).on('fileuploaded', function(event, data, previewId, index) {
var response = data.response;
if (response.code == 0) {
var fileUrl = response.url;
uploadedFiles.push(fileUrl);
updateAttachmentUrls();
$.modal.msgSuccess('上传成功');
} else {
$.modal.alertError(response.msg || '上传失败');
}
}).on('fileuploaderror', function(event, data, msg) {
$.modal.alertError('上传失败: ' + msg);
}).on('fileerror', function(event, data, msg) {
$.modal.alertError('文件错误: ' + msg);
});
} catch (e) {
console.error('fileinput初始化失败:', e);
}
}
// 加载车辆列表
function loadVehicleList() {
$.ajax({
url: ctx + "tyre/car/list",
type: "post",
dataType: "json",
success: function(data) {
var select = $("#vehicleSelect");
select.empty();
select.append('<option value="">请选择车辆</option>');
$.each(data.rows || data, function(index, item) {
select.append('<option value="' + item.id + '" data-plate="' + item.carNo + '">' + item.carNo + ' - ' + (item.team || '') + '</option>');
});
// 设置选中的车辆
var selectedVehicleId = [[${bizMaintenanceOrder.vehicleId}]];
if (selectedVehicleId) {
select.val(selectedVehicleId);
}
select.selectpicker('refresh');
},
error: function() {
$.modal.alertError("加载车辆列表失败");
}
});
}
// 加载站点列表
function loadFactoryList() {
$.ajax({
url: prefix + "/getFactoryList",
type: "get",
dataType: "json",
success: function(data) {
var select = $("#factorySelect");
select.empty();
select.append('<option value="">请选择站点</option>');
$.each(data.data, function(index, item) {
select.append('<option value="' + item.deptId + '">' + item.deptName + '</option>');
});
// 设置选中的站点
var selectedFactoryId = [[${bizMaintenanceOrder.factoryId}]];
if (selectedFactoryId) {
select.val(selectedFactoryId);
}
select.selectpicker('refresh');
},
error: function() {
$.modal.alertError("加载站点列表失败");
}
});
}
// 车辆选择事件
$(document).on("changed.bs.select", "#vehicleSelect", function(e, clickedIndex, isSelected, previousValue) {
var selectedOption = $(this).find("option:selected");
var plateNumber = selectedOption.data("plate");
$("#plateNumber").val(plateNumber || "");
});
// 更新隐藏字段的值
function updateAttachmentUrls() {
$('#attachmentUrls').val(uploadedFiles.join(','));
}
// 图片点击预览
function previewImage(imgSrc, imgTitle) {
layer.open({
type: 1,
title: imgTitle || '工单图片',
shadeClose: true,
shade: 0.8,
area: ['90%', '90%'],
content: '<div style="text-align:center; padding: 20px;"><img src="' + imgSrc + '" style="max-width:100%;max-height:100%;" /></div>'
});
}
// 删除已存在的图片
function removeExistingImage(fileUrl, $element) {
$.modal.confirm("确定删除该图片吗?", function() {
// 从数组中移除
uploadedFiles = uploadedFiles.filter(function(url) {
return url !== fileUrl;
});
updateAttachmentUrls();
// 从DOM中移除
$element.remove();
// 如果没有图片了,隐藏整个区域
if ($('#existingImages .uploaded-image-item').length === 0) {
$('.existing-images').hide();
}
$.modal.msgSuccess('删除成功,保存后生效');
});
}
// 表单提交
function submitHandler() {
if ($.validate.form()) {
var data = $("#form-order-edit").serializeArray();
// 添加图片附件URL
var attachmentUrls = uploadedFiles.join(',');
data.push({"name": "attachmentUrls", "value": attachmentUrls});
$.operate.saveTab(prefix + "/edit", data);
}
}
</script>
</body>
</html>

@ -0,0 +1,209 @@
<!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>工单编号:</label>
<input type="text" name="orderNo"/>
</li>
<li>
<label>车牌号码:</label>
<input type="text" name="plateNumber"/>
</li>
<li>
<label>维保类型:</label>
<select name="typeCode" th:with="type=${@dict.getType('main_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>状态:</label>
<select name="status" th:with="type=${@dict.getType('order_status')}">
<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-success" onclick="$.operate.addTab()" shiro:hasPermission="system:order:submit">
<i class="fa fa-pencil"></i> 提交工单
</a>
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:order:edit">-->
<!-- <i class="fa fa-edit"></i> 编辑-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:order:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:order:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- <a class="btn btn-info" onclick="$.operate.view()" shiro:hasPermission="system:order:view">-->
<!-- <i class="fa fa-eye"></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:order:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:order:remove')}]];
var viewFlag = [[${@permission.hasPermi('system:order:view')}]];
var prefix = ctx + "tyre/order";
function showDetail(orderId) {
// 这里使用了若依框架常用的 $.modal.open 方法
// 如果你的框架没有这个方法,可以使用 Bootstrap 的 Modal 手动填充数据
$.modal.open("轮胎详情", prefix + "/detail/" + orderId);
// 或者如果你是弹出一个包含详细信息的 Alert
// $.modal.alertSuccess("你点击的轮胎ID是: " + tyreId);
}
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/submit",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "补胎工单",
columns: [{
checkbox: true
},
{
field: 'orderId',
title: '工单ID',
visible: false
},
{
field: 'orderNo',
title: '工单编号'
},
{
field: 'plateNumber',
title: '车牌号码'
},
{
field: 'typeCode',
title: '维保类型',
formatter: function(value, item, index) {
if (item.typeCode == '1') {
return '二级保养';
}
else if (item.typeCode == '2') {
return '抢碎修';
}
else if (item.typeCode == '3') {
return '拆报废车';
}
else if (item.typeCode == '4') {
return '月检';
}
else if (item.typeCode == '5') {
return '小修';
}
}
},
{
field: 'inputMileage',
title: '录入里程'
},
{
field: 'lastMileage',
title: '上次里程'
},
{
field: 'maintainDate',
title: '保养日期'
},
{
field: 'description',
title: '补充说明'
},
{
field: 'factoryName',
title: '维修站点'
},
{
field: 'status',
title: '状态',
formatter: function(value, row, index) {
if (value === 'UNSTARTED') return '<span class="label label-warning">未开始</span>';
if (value === 'PROCESSING') return '<span class="label label-primary">执行中</span>';
if (value === 'COMPLETED') return '<span class="label label-success">已完成</span>';
return value;
}
},
{
field: 'createBy',
title: '创建人'
},
{
field: 'createTime',
title: '提交日期'
},
{
field: 'maintainer',
title: '修补人'
},
{
field: 'maintainerDate',
title: '修补日期'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
if(row.status == 'UNSTARTED'){
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + 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-info btn-xs ' + viewFlag + '" href="javascript:void(0)" onclick="showDetail(\'' + row.orderId + '\')"><i class="fa fa-eye"></i>详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
// 初始化日期插件
$("#formId input[name='maintainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 提交工单新窗口
$.operate.openNewWindow = function(url) {
if (url === 'submit') {
$.modal.open("提交工单", prefix + "/submit", "800", "600");
} else {
$.modal.open("详情查看", url, "900", "700");
}
};
});
</script>
</body>
</html>

@ -0,0 +1,193 @@
<!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>工单编号:</label>
<input type="text" name="orderNo"/>
</li>
<li>
<label>车牌号码:</label>
<input type="text" name="plateNumber"/>
</li>
<li>
<label>状态:</label>
<select name="status" th:with="type=${@dict.getType('order_status')}">
<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-success" onclick="$.operate.addTab()" shiro:hasPermission="system:order:submit">-->
<!-- <i class="fa fa-pencil"></i> 提交工单-->
<!-- </a>-->
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:order:edit">-->
<!-- <i class="fa fa-edit"></i> 编辑-->
<!-- </a>-->
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:order:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:order:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- <a class="btn btn-info" onclick="$.operate.view()" shiro:hasPermission="system:order:view">-->
<!-- <i class="fa fa-eye"></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:order:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:order:remove')}]];
var viewFlag = [[${@permission.hasPermi('system:order:view')}]];
var prefix = ctx + "tyre/order";
function showDetail(orderId) {
// 这里使用了若依框架常用的 $.modal.open 方法
// 如果你的框架没有这个方法,可以使用 Bootstrap 的 Modal 手动填充数据
$.modal.open("轮胎详情", prefix + "/detail/" + orderId);
// 或者如果你是弹出一个包含详细信息的 Alert
// $.modal.alertSuccess("你点击的轮胎ID是: " + tyreId);
}
$(function() {
var options = {
url: prefix + "/listScrap",
modalName: "补胎工单",
columns: [{
checkbox: true
},
{
field: 'orderId',
title: '工单ID',
visible: false
},
{
field: 'orderNo',
title: '工单编号'
},
{
field: 'plateNumber',
title: '车牌号码'
},
{
field: 'typeCode',
title: '维保类型',
formatter: function(value, item, index) {
if (item.typeCode == '1') {
return '二级保养';
}
else if (item.typeCode == '2') {
return '抢碎修';
}
else if (item.typeCode == '3') {
return '拆报废车';
}
else if (item.typeCode == '4') {
return '月检';
}
else if (item.typeCode == '5') {
return '小修';
}
}
},
{
field: 'inputMileage',
title: '录入里程'
},
{
field: 'lastMileage',
title: '上次里程'
},
{
field: 'maintainDate',
title: '保养日期'
},
{
field: 'description',
title: '补充说明'
},
{
field: 'factoryName',
title: '维修站点'
},
{
field: 'status',
title: '状态',
formatter: function(value, row, index) {
if (value === 'UNSTARTED') return '<span class="label label-warning">未开始</span>';
if (value === 'PROCESSING') return '<span class="label label-primary">执行中</span>';
if (value === 'COMPLETED') return '<span class="label label-success">已完成</span>';
return value;
}
},
{
field: 'createBy',
title: '创建人'
},
{
field: 'createTime',
title: '提交日期'
},
{
field: 'maintainer',
title: '修补人'
},
{
field: 'maintainerDate',
title: '修补日期'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-info btn-xs ' + viewFlag + '" href="javascript:void(0)" onclick="showDetail(\'' + row.orderId + '\')"><i class="fa fa-eye"></i>详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
// 初始化日期插件
$("#formId input[name='maintainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 提交工单新窗口
$.operate.openNewWindow = function(url) {
if (url === 'submit') {
$.modal.open("提交工单", prefix + "/submit", "800", "600");
} else {
$.modal.open("详情查看", url, "900", "700");
}
};
});
</script>
</body>
</html>

@ -0,0 +1,373 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('提交补胎工单')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-fileinput-css" />
<th:block th:include="include :: bootstrap-select-css" />
<style>
/* 图片预览样式 */
.file-preview-frame {
position: relative;
display: inline-block;
margin: 5px;
}
.file-preview-image {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 4px;
border: 1px solid #ddd;
}
.file-remove-btn {
position: absolute;
top: -8px;
right: -8px;
background: #dc3545;
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
line-height: 18px;
text-align: center;
cursor: pointer;
font-size: 12px;
z-index: 10;
}
.uploaded-images {
margin-top: 15px;
}
.uploaded-image-item {
position: relative;
display: inline-block;
margin: 5px;
}
.uploaded-image-item img {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 4px;
border: 1px solid #ddd;
}
.uploaded-image-item .remove-btn {
position: absolute;
top: -8px;
right: -8px;
background: #dc3545;
color: white;
border: none;
border-radius: 50%;
width: 20px;
height: 20px;
line-height: 18px;
text-align: center;
cursor: pointer;
font-size: 12px;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-order-submit">
<input name="orderType" type="hidden" value="1"/>
<input name="status" type="hidden" value="UNSTARTED"/>
<input type="hidden" id="attachmentUrls" name="attachmentUrls">
<!-- 车辆信息选择 -->
<div class="form-group">
<label class="col-sm-3 control-label is-required">车辆信息:</label>
<div class="col-sm-8">
<select name="vehicleId" class="form-control selectpicker" id="vehicleSelect" data-live-search="true" required>
<option value="">请选择车辆</option>
</select>
</div>
</div>
<!-- 车牌号码(自动填充) -->
<div class="form-group" style="display: none">
<label class="col-sm-3 control-label is-required">车牌号码:</label>
<div class="col-sm-8">
<input name="plateNumber" class="form-control" type="text" id="plateNumber" placeholder="车牌号码" readonly required>
</div>
</div>
<!-- 工单类型 -->
<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" id="typeCode" required th:with="type=${@dict.getType('main_type')}">
<option value=""></option>
<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 is-required">执行站点:</label>
<div class="col-sm-8">
<select name="factoryId" class="form-control selectpicker" id="factorySelect" data-live-search="true" required>
<option value="">请选择站点</option>
</select>
</div>
</div>
<!-- 仪表盘录入里程 -->
<div class="form-group">
<label class="col-sm-3 control-label">仪表盘录入里程:</label>
<div class="col-sm-8">
<input name="inputMileage" class="form-control" type="number" step="0.01" placeholder="请输入当前里程(km)">
</div>
</div>
<!-- 上次维保里程 -->
<div class="form-group">
<label class="col-sm-3 control-label">上次维保里程:</label>
<div class="col-sm-8">
<input name="lastMileage" class="form-control" type="number" step="0.01" placeholder="请输入上次维保里程(km)">
</div>
</div>
<!-- 保养日期 -->
<div class="form-group">
<label class="col-sm-3 control-label is-required">保养日期:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="maintainDate" 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 class="form-group">
<label class="col-sm-3 control-label">补充说明:</label>
<div class="col-sm-8">
<textarea name="description" class="form-control" rows="3" placeholder="请输入补充说明"></textarea>
</div>
</div>
<!-- 上传图片 -->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">上传图片:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <div class="file-loading">-->
<!-- <input id="orderImages" name="files" type="file" multiple>-->
<!-- </div>-->
<!-- <div class="uploaded-images" id="uploadedImages">-->
<!-- &lt;!&ndash; 已上传图片预览区域 &ndash;&gt;-->
<!-- </div>-->
<!-- <span class="help-block">可上传多张图片支持jpg、png格式单张不超过20MB</span>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<div class="col-sm-8 col-sm-offset-3">
<button type="button" class="btn btn-primary" onclick="submitHandler()">提交</button>
<button type="button" class="btn btn-danger" onclick="$.modal.close()">取消</button>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-select-js" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<script type="text/javascript">
var prefix = ctx + "tyre/order";
var uploadedFiles = [];
// 页面加载完成后执行
$(function() {
// 初始化日期插件
$("#form-order-submit input[name='maintainDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
// 初始化表单验证
$("#form-order-submit").validate({
focusCleanup: true
});
// 初始化selectpicker
initSelectPicker();
// 初始化文件上传
initFileInput();
// 加载车辆列表和站点列表
loadVehicleList();
loadFactoryList();
});
// 初始化selectpicker
function initSelectPicker() {
try {
$('.selectpicker').selectpicker({
liveSearch: true,
liveSearchPlaceholder: '请输入关键词搜索...',
noneSelectedText: '请选择',
noneResultsText: '没有找到匹配的结果'
});
} catch (e) {
console.error('selectpicker初始化失败:', e);
}
}
// 初始化bootstrap-fileinput
function initFileInput() {
try {
var $fileInput = $("#orderImages");
if ($fileInput.length === 0) {
console.error('文件输入框不存在');
return;
}
$fileInput.fileinput({
theme: 'fa',
language: 'zh',
uploadUrl: prefix + '/uploadImage',
uploadAsync: true,
maxFileCount: 10,
maxFileSize: 20480,
allowedFileExtensions: ['jpg', 'jpeg', 'png'],
showUpload: true,
showRemove: true,
showPreview: true,
showClose: false,
showCaption: true,
browseOnZoneClick: true,
autoReplace: false,
browseClass: "btn btn-primary",
browseLabel: "选择图片",
browseIcon: "<i class='glyphicon glyphicon-folder-open'></i>&nbsp;",
removeClass: "btn btn-default",
removeLabel: "删除",
removeIcon: "<i class='glyphicon glyphicon-trash'></i>&nbsp;",
uploadClass: "btn btn-info",
uploadLabel: "上传",
uploadIcon: "<i class='glyphicon glyphicon-upload'></i>&nbsp;",
msgPlaceholder: "选择图片...",
msgSizeTooLarge: "文件 \"{name}\" ({size} KB) 超过了最大限制 {maxSize} KB。",
msgInvalidFileExtension: "文件 \"{name}\" 格式不正确。只支持 \"{extensions}\" 格式的文件。",
msgFilesTooMany: "选择的文件数量({n})超过了最大限制{m}。",
dropZoneTitle: "拖拽图片到这里 &hellip;<br>或点击选择按钮",
dropZoneClickTitle: "<br>(或点击选择{files})",
fileActionSettings: {
showUpload: false,
showRemove: true
}
}).on('fileuploaded', function(event, data, previewId, index) {
var response = data.response;
if (response.code == 0) {
var fileUrl = response.url;
uploadedFiles.push(fileUrl);
updateAttachmentUrls();
$.modal.msgSuccess('上传成功');
} else {
$.modal.alertError(response.msg || '上传失败');
}
}).on('fileuploaderror', function(event, data, msg) {
$.modal.alertError('上传失败: ' + msg);
}).on('fileerror', function(event, data, msg) {
$.modal.alertError('文件错误: ' + msg);
});
} catch (e) {
console.error('fileinput初始化失败:', e);
}
}
// 加载车辆列表
function loadVehicleList() {
$.ajax({
url: prefix + "/getCarList",
type: "get",
dataType: "json",
success: function(data) {
var select = $("#vehicleSelect");
select.empty();
select.append('<option value="">请选择车辆</option>');
$.each(data.data || data, function(index, item) {
select.append('<option value="' + item.id + '" data-plate="' + item.carNo + '">' + item.carNo + ' - ' + (item.team || '') + '</option>');
});
select.selectpicker('refresh');
},
error: function() {
$.modal.alertError("加载车辆列表失败");
}
});
}
// 加载站点列表
function loadFactoryList() {
$.ajax({
url: prefix + "/getFactoryList",
type: "get",
dataType: "json",
success: function(data) {
var select = $("#factorySelect");
select.empty();
select.append('<option value="">请选择站点</option>');
$.each(data.data, function(index, item) {
select.append('<option value="' + item.deptId + '">' + item.deptName + '</option>');
});
select.selectpicker('refresh');
},
error: function() {
$.modal.alertError("加载站点列表失败");
}
});
}
// 车辆选择事件
$(document).on("changed.bs.select", "#vehicleSelect", function(e, clickedIndex, isSelected, previousValue) {
var selectedOption = $(this).find("option:selected");
var plateNumber = selectedOption.data("plate");
$("#plateNumber").val(plateNumber || "");
});
// 更新隐藏字段的值
function updateAttachmentUrls() {
$('#attachmentUrls').val(uploadedFiles.join(','));
}
// 删除已上传的文件
function removeUploadedFile(fileUrl) {
$.ajax({
url: prefix + '/deleteImage',
type: 'post',
data: { filePath: fileUrl },
success: function(response) {
if (response.code == 0) {
uploadedFiles = uploadedFiles.filter(function(url) {
return url !== fileUrl;
});
updateAttachmentUrls();
$('.uploaded-image-item[data-url="' + fileUrl + '"]').remove();
$.modal.msgSuccess('删除成功');
} else {
$.modal.alertError(response.msg || '删除失败');
}
}
});
}
// 表单提交
function submitHandler() {
if ($.validate.form()) {
var data = $("#form-order-submit").serializeArray();
// 添加图片附件URL
var attachmentUrls = uploadedFiles.join(',');
data.push({"name": "attachmentUrls", "value": attachmentUrls});
$.operate.saveTab(prefix + "/submit", data);
}
}
</script>
</body>
</html>

@ -15,12 +15,18 @@ public class Seq
// 上传序列类型
public static final String uploadSeqType = "UPLOAD";
// 工单序列类型
public static final String orderSeqType = "ORDER";
// 通用接口序列数
private static AtomicInteger commSeq = new AtomicInteger(1);
// 上传接口序列数
private static AtomicInteger uploadSeq = new AtomicInteger(1);
// 工单接口序列数
private static AtomicInteger orderSeq = new AtomicInteger(1);
// 机器标识
private static final String machineCode = "A";

@ -0,0 +1,253 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
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_maintenance_order
*
* @author xins
* @date 2026-04-15
*/
public class BizMaintenanceOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工单ID */
private Long orderId;
/** 工单编号 */
@Excel(name = "工单编号")
private String orderNo;
/** 车辆ID/轮胎ID */
@Excel(name = "车辆ID/轮胎ID")
private Long vehicleId;
/** 车牌号码(冗余字段,便于查询) */
@Excel(name = "车牌号码", readConverterExp = "冗余字段,便于查询")
private String plateNumber;
/** 维保类型(如:二级保养) */
@Excel(name = "维保类型", readConverterExp = "如=:二级保养")
private String typeCode;
/** 维修站点/修理厂ID */
@Excel(name = "维修站点/修理厂ID")
private Long factoryId;
/** 仪表盘录入里程(截图中的必填项) */
@Excel(name = "仪表盘录入里程", readConverterExp = "截图中的必填项")
private BigDecimal inputMileage;
/** 上次维保里程(快照) */
@Excel(name = "上次维保里程", readConverterExp = "快照")
private BigDecimal lastMileage;
/** 保养日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "保养日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintainDate;
/** 补充说明 */
@Excel(name = "补充说明")
private String description;
/** 状态UNSTARTED未开始, PROCESSING执行中, COMPLETED已完成 */
@Excel(name = "状态", readConverterExp = "UNSTARTED未开始, PROCESSING执行中, COMPLETED已完成")
private String status;
/** 1代表汽车、2代表轮胎 */
@Excel(name = "1代表汽车、2代表轮胎")
private String orderType;
/** 维修站点名称(扩展字段,用于显示) */
@Excel(name = "维修站点")
private String factoryName;
/** 维修人 */
@Excel(name = "维修人")
private String maintainer;
/** 维修日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "维修日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintainerDate;
/** 轮胎明细列表 */
private List<BizOrderTireDetail> tireDetails;
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setOrderNo(String orderNo)
{
this.orderNo = orderNo;
}
public String getOrderNo()
{
return orderNo;
}
public void setVehicleId(Long vehicleId)
{
this.vehicleId = vehicleId;
}
public Long getVehicleId()
{
return vehicleId;
}
public void setPlateNumber(String plateNumber)
{
this.plateNumber = plateNumber;
}
public String getPlateNumber()
{
return plateNumber;
}
public void setTypeCode(String typeCode)
{
this.typeCode = typeCode;
}
public String getTypeCode()
{
return typeCode;
}
public void setFactoryId(Long factoryId)
{
this.factoryId = factoryId;
}
public Long getFactoryId()
{
return factoryId;
}
public void setInputMileage(BigDecimal inputMileage)
{
this.inputMileage = inputMileage;
}
public BigDecimal getInputMileage()
{
return inputMileage;
}
public void setLastMileage(BigDecimal lastMileage)
{
this.lastMileage = lastMileage;
}
public BigDecimal getLastMileage()
{
return lastMileage;
}
public void setMaintainDate(Date maintainDate)
{
this.maintainDate = maintainDate;
}
public Date getMaintainDate()
{
return maintainDate;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getOrderType()
{
return orderType;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getMaintainer() {
return maintainer;
}
public void setMaintainer(String maintainer) {
this.maintainer = maintainer;
}
public Date getMaintainerDate() {
return maintainerDate;
}
public void setMaintainerDate(Date maintainerDate) {
this.maintainerDate = maintainerDate;
}
public List<BizOrderTireDetail> getTireDetails() {
return tireDetails;
}
public void setTireDetails(List<BizOrderTireDetail> tireDetails) {
this.tireDetails = tireDetails;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("orderId", getOrderId())
.append("orderNo", getOrderNo())
.append("vehicleId", getVehicleId())
.append("plateNumber", getPlateNumber())
.append("typeCode", getTypeCode())
.append("factoryId", getFactoryId())
.append("inputMileage", getInputMileage())
.append("lastMileage", getLastMileage())
.append("maintainDate", getMaintainDate())
.append("description", getDescription())
.append("status", getStatus())
.append("orderType", getOrderType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("factoryName", getFactoryName())
.append("maintainer", getMaintainer())
.append("maintainerDate", getMaintainerDate())
.toString();
}
}

@ -0,0 +1,271 @@
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
*
* @author xins
* @date 2026-04-15
*/
public class BizOrderTireDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 明细ID */
private Long detailId;
/** 工单ID */
@Excel(name = "工单ID")
private Long orderId;
/** 轮胎位置ID关联位置表 */
@Excel(name = "轮胎位置ID", readConverterExp = "关联位置表")
private Long positionId;
/** 轮胎ID关联轮胎档案base_tyre如果是新胎可能为空或临时生成 */
@Excel(name = "轮胎ID", readConverterExp = "关联轮胎档案base_tyre如果是新胎可能为空或临时生成")
private Long tireId;
/** 轮胎编号(冗余字段,记录快照) */
@Excel(name = "轮胎编号", readConverterExp = "冗余字段,记录快照")
private String tireCode;
/** 花纹深度mm截图中的10mm */
@Excel(name = "花纹深度mm", readConverterExp = "截图中的10mm")
private BigDecimal treadDepth;
/** 轮胎状态描述(截图中的"新胎"、"模拟数据" */
@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;
}
public Long getDetailId()
{
return detailId;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setPositionId(Long positionId)
{
this.positionId = positionId;
}
public Long getPositionId()
{
return positionId;
}
public void setTireId(Long tireId)
{
this.tireId = tireId;
}
public Long getTireId()
{
return tireId;
}
public void setTireCode(String tireCode)
{
this.tireCode = tireCode;
}
public String getTireCode()
{
return tireCode;
}
public void setTreadDepth(BigDecimal treadDepth)
{
this.treadDepth = treadDepth;
}
public BigDecimal getTreadDepth()
{
return treadDepth;
}
public void setTireStatus(String tireStatus)
{
this.tireStatus = tireStatus;
}
public String getTireStatus()
{
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() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("detailId", getDetailId())
.append("orderId", getOrderId())
.append("positionId", getPositionId())
.append("tireId", getTireId())
.append("tireCode", getTireCode())
.append("treadDepth", getTreadDepth())
.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())
.toString();
}
}

@ -0,0 +1,143 @@
package com.ruoyi.system.domain;
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.core.domain.BaseEntity;
/**
* sys_attachment
*
* @author
* @date 2026-04-15
*/
public class SysAttachment extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 附件ID */
private Long attachmentId;
/** 文件名 */
private String fileName;
/** 文件存储路径 */
private String filePath;
/** 文件大小(字节) */
private Long fileSize;
/** 文件类型 */
private String fileType;
/** 上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date uploadTime;
/** 上传人 */
private String uploadBy;
/** 工单ID */
private Long orderId;
/** 备注 */
private String remark;
public void setAttachmentId(Long attachmentId)
{
this.attachmentId = attachmentId;
}
public Long getAttachmentId()
{
return attachmentId;
}
public void setFileName(String fileName)
{
this.fileName = fileName;
}
public String getFileName()
{
return fileName;
}
public void setFilePath(String filePath)
{
this.filePath = filePath;
}
public String getFilePath()
{
return filePath;
}
public void setFileSize(Long fileSize)
{
this.fileSize = fileSize;
}
public Long getFileSize()
{
return fileSize;
}
public void setFileType(String fileType)
{
this.fileType = fileType;
}
public String getFileType()
{
return fileType;
}
public void setUploadTime(Date uploadTime)
{
this.uploadTime = uploadTime;
}
public Date getUploadTime()
{
return uploadTime;
}
public void setUploadBy(String uploadBy)
{
this.uploadBy = uploadBy;
}
public String getUploadBy()
{
return uploadBy;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
public Long getOrderId()
{
return orderId;
}
public void setRemark(String remark)
{
this.remark = remark;
}
public String getRemark()
{
return remark;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("attachmentId", getAttachmentId())
.append("fileName", getFileName())
.append("filePath", getFilePath())
.append("fileSize", getFileSize())
.append("fileType", getFileType())
.append("uploadTime", getUploadTime())
.append("uploadBy", getUploadBy())
.append("orderId", getOrderId())
.append("remark", getRemark())
.toString();
}
}

@ -0,0 +1,112 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BizMaintenanceOrder;
/**
* Mapper
*
* @author yangwanli
* @date 2026-04-15
*/
public interface BizMaintenanceOrderMapper
{
/**
*
*
* @param orderId
* @return
*/
public BizMaintenanceOrder selectBizMaintenanceOrderById(Long orderId);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public List<BizMaintenanceOrder> selectBizMaintenanceOrderList(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public int insertBizMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public int updateBizMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param orderId
* @return
*/
public int deleteBizMaintenanceOrderById(Long orderId);
/**
*
*
* @param orderIds
* @return
*/
public int deleteBizMaintenanceOrderByIds(String[] orderIds);
/**
*
*
* @param status
* @return
*/
public int selectOrderCountByStatus(String status);
/**
*
*
* @param plateNumber
* @return
*/
public List<BizMaintenanceOrder> selectOrderByPlateNumber(String plateNumber);
/**
*
*
* @param tireCode
* @return
*/
public List<BizMaintenanceOrder> selectOrderByTireCode(String tireCode);
/**
*
*
* @param orderId ID
* @param status
* @return
*/
public int updateOrderStatus(Long orderId, String status);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public List<BizMaintenanceOrder> selectBizRepairOrderList(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public List<BizMaintenanceOrder> selectBizScrapOrderList(BizMaintenanceOrder bizMaintenanceOrder);
}

@ -0,0 +1,84 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
* Mapper
*
* @author yangwanli
* @date 2026-04-15
*/
public interface BizOrderTireDetailMapper
{
/**
*
*
* @param detailId
* @return
*/
public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId);
/**
дь цайхщ
* @param bizOrderTireDetail
* @return
*/
public List<BizOrderTireDetail> selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
* @param bizOrderTireDetail
* @return
*/
public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
* @param bizOrderTireDetail
* @return
*/
public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
* @param detailId
* @return
*/
public int deleteBizOrderTireDetailById(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);
}

@ -0,0 +1,77 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysAttachment;
/**
*
*
* @author
* @date 2026-04-15
*/
public interface SysAttachmentMapper
{
/**
*
*
* @param attachmentId ID
* @return
*/
public SysAttachment selectSysAttachmentById(Long attachmentId);
/**
*
*
* @param sysAttachment
* @return
*/
public List<SysAttachment> selectSysAttachmentList(SysAttachment sysAttachment);
/**
*
*
* @param sysAttachment
* @return
*/
public int insertSysAttachment(SysAttachment sysAttachment);
/**
*
*
* @param sysAttachment
* @return
*/
public int updateSysAttachment(SysAttachment sysAttachment);
/**
*
*
* @param attachmentId ID
* @return
*/
public int deleteSysAttachmentById(Long attachmentId);
/**
*
*
* @param attachmentIds ID
* @return
*/
public int deleteSysAttachmentByIds(Long[] attachmentIds);
/**
* ID
*
* @param orderId ID
* @return
*/
public List<SysAttachment> selectAttachmentsByOrderId(Long orderId);
/**
* ID
*
* @param orderId ID
* @return
*/
public int deleteAttachmentsByOrderId(Long orderId);
}

@ -0,0 +1,123 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.system.domain.BizMaintenanceOrder;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
* Service
*
* @author yangwanli
* @date 2026-04-15
*/
public interface IBizMaintenanceOrderService
{
/**
*
*
* @param orderId
* @return
*/
public BizMaintenanceOrder selectBizMaintenanceOrderById(Long orderId);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public List<BizMaintenanceOrder> selectBizMaintenanceOrderList(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public int insertBizMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public int updateBizMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param orderIds
* @return
*/
public int deleteBizMaintenanceOrderByIds(String orderIds);
/**
*
*
* @param orderId
* @return
*/
public int deleteBizMaintenanceOrderById(Long orderId);
/**
*
*
* @param plateNumber
* @return
*/
public List<BizMaintenanceOrder> selectOrderByPlateNumber(String plateNumber);
/**
*
*
* @param tireCode
* @return
*/
public List<BizMaintenanceOrder> selectOrderByTireCode(String tireCode);
/**
*
*
* @param orderId ID
* @param status
* @return
*/
public int updateOrderStatus(Long orderId, String status);
/**
*
*
* @param status
* @return
*/
public int selectOrderCountByStatus(String status);
/**
*
*
* @param bizMaintenanceOrder
* @param tireDetails
* @return
*/
public int saveOrderWithDetails(BizMaintenanceOrder bizMaintenanceOrder, List<BizOrderTireDetail> tireDetails);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public List<BizMaintenanceOrder> selectBizRepairOrderList(BizMaintenanceOrder bizMaintenanceOrder);
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
public List<BizMaintenanceOrder> selectBizScrapOrderList(BizMaintenanceOrder bizMaintenanceOrder);
}

@ -0,0 +1,94 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.BizOrderTireDetail;
/**
* Service
*
* @author yangwanli
* @date 2026-04-15
*/
public interface IBizOrderTireDetailService
{
/**
*
*
* @param detailId
* @return
*/
public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId);
/**
*
*
* @param bizOrderTireDetail
* @return
*/
public List<BizOrderTireDetail> selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
* @param bizOrderTireDetail
* @return
*/
public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
* @param bizOrderTireDetail
* @return
*/
public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail);
/**
*
*
* @param detailIds
* @return
*/
public int deleteBizOrderTireDetailByIds(String detailIds);
/**
*
*
* @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);
}

@ -0,0 +1,87 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysAttachment;
/**
*
*
* @author
* @date 2026-04-15
*/
public interface ISysAttachmentService
{
/**
*
*
* @param attachmentId ID
* @return
*/
public SysAttachment selectSysAttachmentById(Long attachmentId);
/**
*
*
* @param sysAttachment
* @return
*/
public List<SysAttachment> selectSysAttachmentList(SysAttachment sysAttachment);
/**
*
*
* @param sysAttachment
* @return
*/
public int insertSysAttachment(SysAttachment sysAttachment);
/**
*
*
* @param sysAttachment
* @return
*/
public int updateSysAttachment(SysAttachment sysAttachment);
/**
*
*
* @param attachmentId ID
* @return
*/
public int deleteSysAttachmentById(Long attachmentId);
/**
*
*
* @param attachmentIds ID
* @return
*/
public int deleteSysAttachmentByIds(String attachmentIds);
/**
* ID
*
* @param orderId ID
* @return
*/
public List<SysAttachment> selectAttachmentsByOrderId(Long orderId);
/**
* ID
*
* @param orderId ID
* @return
*/
public int deleteAttachmentsByOrderId(Long orderId);
/**
*
*
* @param attachments
* @param orderId ID
* @param uploadBy
* @return
*/
public int batchSaveAttachments(List<SysAttachment> attachments, Long orderId, String uploadBy);
}

@ -0,0 +1,235 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.annotation.DataScope;
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.BizMaintenanceOrderMapper;
import com.ruoyi.system.domain.BizMaintenanceOrder;
import com.ruoyi.system.service.IBizMaintenanceOrderService;
import com.ruoyi.system.service.IBizOrderTireDetailService;
import com.ruoyi.system.domain.BizOrderTireDetail;
import com.ruoyi.common.core.text.Convert;
/**
* Service
*
* @author yangwanli
* @date 2026-04-15
*/
@Service
public class BizMaintenanceOrderServiceImpl implements IBizMaintenanceOrderService
{
@Autowired
private BizMaintenanceOrderMapper bizMaintenanceOrderMapper;
@Autowired
private IBizOrderTireDetailService bizOrderTireDetailService;
/**
*
*
* @param orderId
* @return
*/
@Override
public BizMaintenanceOrder selectBizMaintenanceOrderById(Long orderId)
{
BizMaintenanceOrder order = bizMaintenanceOrderMapper.selectBizMaintenanceOrderById(orderId);
if (order != null) {
// 查询轮胎明细
List<BizOrderTireDetail> tireDetails = bizOrderTireDetailService.selectTireDetailByOrderId(orderId);
order.setTireDetails(tireDetails);
}
return order;
}
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<BizMaintenanceOrder> selectBizMaintenanceOrderList(BizMaintenanceOrder bizMaintenanceOrder)
{
return bizMaintenanceOrderMapper.selectBizMaintenanceOrderList(bizMaintenanceOrder);
}
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
@Override
public int insertBizMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder)
{
bizMaintenanceOrder.setCreateTime(DateUtils.getNowDate());
bizMaintenanceOrder.setCreateBy(ShiroUtils.getLoginName());
bizMaintenanceOrder.setOrderType("1"); // 默认设置为汽车类型
return bizMaintenanceOrderMapper.insertBizMaintenanceOrder(bizMaintenanceOrder);
}
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
@Override
@Transactional
public int updateBizMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder)
{
bizMaintenanceOrder.setUpdateTime(DateUtils.getNowDate());
bizMaintenanceOrder.setUpdateBy(ShiroUtils.getLoginName());
return bizMaintenanceOrderMapper.updateBizMaintenanceOrder(bizMaintenanceOrder);
}
/**
*
*
* @param orderIds
* @return
*/
@Override
@Transactional
public int deleteBizMaintenanceOrderByIds(String orderIds)
{
String[] ids = Convert.toStrArray(orderIds);
for (String id : ids) {
Long orderId = Long.parseLong(id);
// 先删除轮胎明细
bizOrderTireDetailService.deleteTireDetailByOrderId(orderId);
}
return bizMaintenanceOrderMapper.deleteBizMaintenanceOrderByIds(ids);
}
/**
*
*
* @param orderId
* @return
*/
@Override
@Transactional
public int deleteBizMaintenanceOrderById(Long orderId)
{
// 先删除轮胎明细
bizOrderTireDetailService.deleteTireDetailByOrderId(orderId);
return bizMaintenanceOrderMapper.deleteBizMaintenanceOrderById(orderId);
}
/**
*
*
* @param plateNumber
* @return
*/
@Override
public List<BizMaintenanceOrder> selectOrderByPlateNumber(String plateNumber)
{
return bizMaintenanceOrderMapper.selectOrderByPlateNumber(plateNumber);
}
/**
*
*
* @param tireCode
* @return
*/
@Override
public List<BizMaintenanceOrder> selectOrderByTireCode(String tireCode)
{
return bizMaintenanceOrderMapper.selectOrderByTireCode(tireCode);
}
/**
*
*
* @param orderId ID
* @param status
* @return
*/
@Override
public int updateOrderStatus(Long orderId, String status)
{
return bizMaintenanceOrderMapper.updateOrderStatus(orderId, status);
}
/**
*
*
* @param status
* @return
*/
@Override
public int selectOrderCountByStatus(String status)
{
return bizMaintenanceOrderMapper.selectOrderCountByStatus(status);
}
/**
*
*
* @param bizMaintenanceOrder
* @param tireDetails
* @return
*/
@Override
@Transactional
public int saveOrderWithDetails(BizMaintenanceOrder bizMaintenanceOrder, List<BizOrderTireDetail> tireDetails)
{
// 保存工单
bizMaintenanceOrder.setCreateTime(DateUtils.getNowDate());
bizMaintenanceOrder.setCreateBy(ShiroUtils.getLoginName());
bizMaintenanceOrder.setOrderType("1"); // 默认设置为汽车类型
int result = bizMaintenanceOrderMapper.insertBizMaintenanceOrder(bizMaintenanceOrder);
if (result > 0 && tireDetails != null && tireDetails.size() > 0) {
// 保存轮胎明细
for (BizOrderTireDetail detail : tireDetails) {
detail.setOrderId(bizMaintenanceOrder.getOrderId());
detail.setCreateTime(DateUtils.getNowDate());
detail.setCreateBy(ShiroUtils.getLoginName());
}
bizOrderTireDetailService.batchInsertTireDetail(tireDetails);
}
return result;
}
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<BizMaintenanceOrder> selectBizRepairOrderList(BizMaintenanceOrder bizMaintenanceOrder)
{
return bizMaintenanceOrderMapper.selectBizRepairOrderList(bizMaintenanceOrder);
}
/**
*
*
* @param bizMaintenanceOrder
* @return
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<BizMaintenanceOrder> selectBizScrapOrderList(BizMaintenanceOrder bizMaintenanceOrder)
{
return bizMaintenanceOrderMapper.selectBizScrapOrderList(bizMaintenanceOrder);
}
}

@ -0,0 +1,166 @@
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
*
* @author yangwanli
* @date 2026-04-15
*/
@Service
public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService
{
@Autowired
private BizOrderTireDetailMapper bizOrderTireDetailMapper;
/**
*
*
* @param detailId
* @return
*/
@Override
public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId)
{
return bizOrderTireDetailMapper.selectBizOrderTireDetailById(detailId);
}
/**
*
*
* @param bizOrderTireDetail
* @return
*/
@Override
public List<BizOrderTireDetail> selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail)
{
return bizOrderTireDetailMapper.selectBizOrderTireDetailList(bizOrderTireDetail);
}
/**
*
*
* @param bizOrderTireDetail
* @return
*/
@Override
public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail)
{
bizOrderTireDetail.setCreateTime(DateUtils.getNowDate());
bizOrderTireDetail.setCreateBy(ShiroUtils.getLoginName());
return bizOrderTireDetailMapper.insertBizOrderTireDetail(bizOrderTireDetail);
}
/**
*
*
* @param bizOrderTireDetail
* @return
*/
@Override
public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail)
{
return bizOrderTireDetailMapper.updateBizOrderTireDetail(bizOrderTireDetail);
}
/**
*
*
* @param detailIds
* @return
*/
@Override
public int deleteBizOrderTireDetailByIds(String detailIds)
{
return bizOrderTireDetailMapper.deleteBizOrderTireDetailByIds(Convert.toStrArray(detailIds));
}
/**
*
*
* @param detailId
* @return
*/
@Override
public int deleteBizOrderTireDetailById(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;
}
}

@ -0,0 +1,154 @@
package com.ruoyi.system.service.impl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysAttachmentMapper;
import com.ruoyi.system.domain.SysAttachment;
import com.ruoyi.system.service.ISysAttachmentService;
import com.ruoyi.common.utils.DateUtils;
/**
*
*
* @author
* @date 2026-04-15
*/
@Service
public class SysAttachmentServiceImpl implements ISysAttachmentService
{
@Autowired
private SysAttachmentMapper sysAttachmentMapper;
/**
*
*
* @param attachmentId ID
* @return
*/
@Override
public SysAttachment selectSysAttachmentById(Long attachmentId)
{
return sysAttachmentMapper.selectSysAttachmentById(attachmentId);
}
/**
*
*
* @param sysAttachment
* @return
*/
@Override
public List<SysAttachment> selectSysAttachmentList(SysAttachment sysAttachment)
{
return sysAttachmentMapper.selectSysAttachmentList(sysAttachment);
}
/**
*
*
* @param sysAttachment
* @return
*/
@Override
public int insertSysAttachment(SysAttachment sysAttachment)
{
sysAttachment.setUploadTime(DateUtils.getNowDate());
return sysAttachmentMapper.insertSysAttachment(sysAttachment);
}
/**
*
*
* @param sysAttachment
* @return
*/
@Override
public int updateSysAttachment(SysAttachment sysAttachment)
{
return sysAttachmentMapper.updateSysAttachment(sysAttachment);
}
/**
*
*
* @param attachmentId ID
* @return
*/
@Override
public int deleteSysAttachmentById(Long attachmentId)
{
return sysAttachmentMapper.deleteSysAttachmentById(attachmentId);
}
/**
*
*
* @param attachmentIds ID
* @return
*/
@Override
public int deleteSysAttachmentByIds(String attachmentIds)
{
String[] attachmentIdArray = attachmentIds.split(",");
Long[] longArray = ArrayUtils.toObject(
Arrays.stream(attachmentIdArray).mapToLong(Long::parseLong).toArray());
return sysAttachmentMapper.deleteSysAttachmentByIds(longArray);
}
/**
* ID
*
* @param orderId ID
* @return
*/
@Override
public List<SysAttachment> selectAttachmentsByOrderId(Long orderId)
{
return sysAttachmentMapper.selectAttachmentsByOrderId(orderId);
}
/**
* ID
*
* @param orderId ID
* @return
*/
@Override
public int deleteAttachmentsByOrderId(Long orderId)
{
return sysAttachmentMapper.deleteAttachmentsByOrderId(orderId);
}
/**
*
*
* @param attachments
* @param orderId ID
* @param uploadBy
* @return
*/
@Override
public int batchSaveAttachments(List<SysAttachment> attachments, Long orderId, String uploadBy)
{
if (attachments == null || attachments.isEmpty()) {
return 0;
}
int result = 0;
for (SysAttachment attachment : attachments) {
if (attachment != null) {
attachment.setOrderId(orderId);
attachment.setUploadBy(uploadBy);
attachment.setUploadTime(DateUtils.getNowDate());
result += sysAttachmentMapper.insertSysAttachment(attachment);
}
}
return result;
}
}

@ -0,0 +1,212 @@
<?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.BizMaintenanceOrderMapper">
<resultMap type="BizMaintenanceOrder" id="BizMaintenanceOrderResult">
<result property="orderId" column="order_id" />
<result property="orderNo" column="order_no" />
<result property="vehicleId" column="vehicle_id" />
<result property="plateNumber" column="plate_number" />
<result property="typeCode" column="type_code" />
<result property="factoryId" column="factory_id" />
<result property="inputMileage" column="input_mileage" />
<result property="lastMileage" column="last_mileage" />
<result property="maintainDate" column="maintain_date" />
<result property="description" column="description" />
<result property="status" column="status" />
<result property="orderType" column="order_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="factoryName" column="factory_name" />
<result property="maintainer" column="maintainer" />
<result property="maintainerDate" column="maintainer_date" />
</resultMap>
<sql id="selectBizMaintenanceOrderVo">
select order_id, order_no, vehicle_id, plate_number, type_code, factory_id, input_mileage, last_mileage, maintain_date, description, status, order_type, create_by, create_time, update_by, update_time, remark from biz_maintenance_order
</sql>
<select id="selectBizMaintenanceOrderList" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
from biz_maintenance_order o
left join sys_dept d on d.dept_id = o.factory_id
<where>
<if test="orderNo != null and orderNo != ''"> and o.order_no like concat('%', #{orderNo}, '%')</if>
<if test="plateNumber != null and plateNumber != ''"> and o.plate_number like concat('%', #{plateNumber}, '%')</if>
<if test="typeCode != null and typeCode != ''"> and o.type_code = #{typeCode}</if>
<if test="factoryId != null "> and o.factory_id = #{factoryId}</if>
<if test="inputMileage != null "> and o.input_mileage = #{inputMileage}</if>
<if test="lastMileage != null "> and o.last_mileage = #{lastMileage}</if>
<if test="maintainDate != null "> and o.maintain_date = #{maintainDate}</if>
<if test="description != null and description != ''"> and o.description like concat('%', #{description}, '%')</if>
<if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="orderType != null and orderType != ''"> and o.order_type = #{orderType}</if>
<!-- 按照补胎工单查询 -->
<if test="orderType == null or orderType == ''"> and o.order_type = '1'</if>
${params.dataScope}
</where>
order by o.create_time desc
</select>
<select id="selectBizRepairOrderList" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
from biz_maintenance_order o
left join sys_dept d on d.dept_id = o.factory_id
<where>
and o.type_code in ('1','2','4','5')
<if test="orderNo != null and orderNo != ''"> and o.order_no like concat('%', #{orderNo}, '%')</if>
<if test="plateNumber != null and plateNumber != ''"> and o.plate_number like concat('%', #{plateNumber}, '%')</if>
<if test="typeCode != null and typeCode != ''"> and o.type_code = #{typeCode}</if>
<if test="factoryId != null "> and o.factory_id = #{factoryId}</if>
<if test="inputMileage != null "> and o.input_mileage = #{inputMileage}</if>
<if test="lastMileage != null "> and o.last_mileage = #{lastMileage}</if>
<if test="maintainDate != null "> and o.maintain_date = #{maintainDate}</if>
<if test="description != null and description != ''"> and o.description like concat('%', #{description}, '%')</if>
<if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="orderType != null and orderType != ''"> and o.order_type = #{orderType}</if>
<!-- 按照补胎工单查询 -->
<if test="orderType == null or orderType == ''"> and o.order_type = '1'</if>
${params.dataScope}
</where>
order by o.create_time desc
</select>
<select id="selectBizScrapOrderList" parameterType="BizMaintenanceOrder" resultMap="BizMaintenanceOrderResult">
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
from biz_maintenance_order o
left join sys_dept d on d.dept_id = o.factory_id
<where>
and o.type_code = '3'
<if test="orderNo != null and orderNo != ''"> and o.order_no like concat('%', #{orderNo}, '%')</if>
<if test="plateNumber != null and plateNumber != ''"> and o.plate_number like concat('%', #{plateNumber}, '%')</if>
<if test="typeCode != null and typeCode != ''"> and o.type_code = #{typeCode}</if>
<if test="factoryId != null "> and o.factory_id = #{factoryId}</if>
<if test="inputMileage != null "> and o.input_mileage = #{inputMileage}</if>
<if test="lastMileage != null "> and o.last_mileage = #{lastMileage}</if>
<if test="maintainDate != null "> and o.maintain_date = #{maintainDate}</if>
<if test="description != null and description != ''"> and o.description like concat('%', #{description}, '%')</if>
<if test="status != null and status != ''"> and o.status = #{status}</if>
<if test="orderType != null and orderType != ''"> and o.order_type = #{orderType}</if>
<!-- 按照补胎工单查询 -->
<if test="orderType == null or orderType == ''"> and o.order_type = '1'</if>
${params.dataScope}
</where>
order by o.create_time desc
</select>
<select id="selectBizMaintenanceOrderById" parameterType="Long" resultMap="BizMaintenanceOrderResult">
select o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark, d.dept_name as factory_name
from biz_maintenance_order o
left join sys_dept d on d.dept_id = o.factory_id
where o.order_id = #{orderId}
</select>
<insert id="insertBizMaintenanceOrder" parameterType="BizMaintenanceOrder" useGeneratedKeys="true" keyProperty="orderId">
insert into biz_maintenance_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNo != null">order_no,</if>
<if test="vehicleId != null">vehicle_id,</if>
<if test="plateNumber != null">plate_number,</if>
<if test="typeCode != null">type_code,</if>
<if test="factoryId != null">factory_id,</if>
<if test="inputMileage != null">input_mileage,</if>
<if test="lastMileage != null">last_mileage,</if>
<if test="maintainDate != null">maintain_date,</if>
<if test="description != null">description,</if>
<if test="status != null">status,</if>
<if test="orderType != null">order_type,</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>
<if test="maintainer != null">maintainer,</if>
<if test="maintainerDate != null">maintainer_date,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNo != null">#{orderNo},</if>
<if test="vehicleId != null">#{vehicleId},</if>
<if test="plateNumber != null">#{plateNumber},</if>
<if test="typeCode != null">#{typeCode},</if>
<if test="factoryId != null">#{factoryId},</if>
<if test="inputMileage != null">#{inputMileage},</if>
<if test="lastMileage != null">#{lastMileage},</if>
<if test="maintainDate != null">#{maintainDate},</if>
<if test="description != null">#{description},</if>
<if test="status != null">#{status},</if>
<if test="orderType != null">#{orderType},</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>
<if test="maintainer != null">#{maintainer},</if>
<if test="maintainerDate != null">#{maintainerDate},</if>
</trim>
</insert>
<update id="updateBizMaintenanceOrder" parameterType="BizMaintenanceOrder">
update biz_maintenance_order
<trim prefix="SET" suffixOverrides=",">
<if test="orderNo != null">order_no = #{orderNo},</if>
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
<if test="plateNumber != null">plate_number = #{plateNumber},</if>
<if test="typeCode != null">type_code = #{typeCode},</if>
<if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="inputMileage != null">input_mileage = #{inputMileage},</if>
<if test="lastMileage != null">last_mileage = #{lastMileage},</if>
<if test="maintainDate != null">maintain_date = #{maintainDate},</if>
<if test="description != null">description = #{description},</if>
<if test="status != null">status = #{status},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="maintainer != null">maintainer = #{maintainer},</if>
<if test="maintainerDate != null">maintainer_date = #{maintainerDate},</if>
</trim>
where order_id = #{orderId}
</update>
<delete id="deleteBizMaintenanceOrderById" parameterType="Long">
delete from biz_maintenance_order where order_id = #{orderId}
</delete>
<delete id="deleteBizMaintenanceOrderByIds" parameterType="String">
delete from biz_maintenance_order where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
</delete>
<select id="selectOrderCountByStatus" parameterType="String" resultType="int">
select count(*) from biz_maintenance_order where status = #{status} and order_type = '1'
</select>
<select id="selectOrderByPlateNumber" parameterType="String" resultMap="BizMaintenanceOrderResult">
<include refid="selectBizMaintenanceOrderVo"/>
where plate_number like concat('%', #{plateNumber}, '%') and order_type = '1'
order by create_time desc
</select>
<select id="selectOrderByTireCode" parameterType="String" resultMap="BizMaintenanceOrderResult">
select distinct o.order_id, o.order_no, o.vehicle_id, o.plate_number, o.type_code, o.factory_id, o.input_mileage, o.last_mileage, o.maintain_date, o.description, o.status, o.order_type, o.create_by, o.create_time, o.update_by, o.update_time, o.remark
from biz_maintenance_order o
inner join biz_order_tire_detail d on o.order_id = d.order_id
where d.tire_code like concat('%', #{tireCode}, '%') and o.order_type = '1'
order by o.create_time desc
</select>
<update id="updateOrderStatus" parameterType="map">
update biz_maintenance_order
set status = #{status}, update_time = now()
where order_id = #{orderId}
</update>
</mapper>

@ -0,0 +1,123 @@
<?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.BizOrderTireDetailMapper">
<resultMap type="BizOrderTireDetail" id="BizOrderTireDetailResult">
<result property="detailId" column="detail_id" />
<result property="orderId" column="order_id" />
<result property="positionId" column="position_id" />
<result property="tireId" column="tire_id" />
<result property="tireCode" column="tire_code" />
<result property="treadDepth" column="tread_depth" />
<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" />
</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
</sql>
<select id="selectBizOrderTireDetailList" parameterType="BizOrderTireDetail" resultMap="BizOrderTireDetailResult">
<include refid="selectBizOrderTireDetailVo"/>
<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>
<if test="tireCode != null and tireCode != ''"> and tire_code like concat('%', #{tireCode}, '%')</if>
<if test="treadDepth != null "> and tread_depth = #{treadDepth}</if>
<if test="tireStatus != null and tireStatus != ''"> and tire_status = #{tireStatus}</if>
</where>
</select>
<select id="selectBizOrderTireDetailById" 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 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="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="tireStatus != null">tire_status,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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>
</trim>
</insert>
<update id="updateBizOrderTireDetail" parameterType="BizOrderTireDetail">
update biz_order_tire_detail
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="positionId != null">position_id = #{positionId},</if>
<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="tireStatus != null">tire_status = #{tireStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
</trim>
where detail_id = #{detailId}
</update>
<delete id="deleteBizOrderTireDetailById" parameterType="Long">
delete from biz_order_tire_detail where detail_id = #{detailId}
</delete>
<delete id="deleteBizOrderTireDetailByIds" 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>

@ -0,0 +1,98 @@
<?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.SysAttachmentMapper">
<resultMap type="SysAttachment" id="SysAttachmentResult">
<result property="attachmentId" column="attachment_id" />
<result property="fileName" column="file_name" />
<result property="filePath" column="file_path" />
<result property="fileSize" column="file_size" />
<result property="fileType" column="file_type" />
<result property="uploadTime" column="upload_time" />
<result property="uploadBy" column="upload_by" />
<result property="orderId" column="order_id" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSysAttachmentVo">
select attachment_id, file_name, file_path, file_size, file_type, upload_time, upload_by, order_id, remark from sys_attachment
</sql>
<select id="selectSysAttachmentList" parameterType="SysAttachment" resultMap="SysAttachmentResult">
<include refid="selectSysAttachmentVo"/>
<where>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
<if test="uploadBy != null and uploadBy != ''"> and upload_by = #{uploadBy}</if>
<if test="orderId != null "> and order_id = #{orderId}</if>
</where>
</select>
<select id="selectSysAttachmentById" parameterType="Long" resultMap="SysAttachmentResult">
<include refid="selectSysAttachmentVo"/>
where attachment_id = #{attachmentId}
</select>
<select id="selectAttachmentsByOrderId" parameterType="Long" resultMap="SysAttachmentResult">
<include refid="selectSysAttachmentVo"/>
where order_id = #{orderId}
order by upload_time desc
</select>
<insert id="insertSysAttachment" parameterType="SysAttachment" useGeneratedKeys="true" keyProperty="attachmentId">
insert into sys_attachment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileName != null and fileName != ''">file_name,</if>
<if test="filePath != null and filePath != ''">file_path,</if>
<if test="fileSize != null">file_size,</if>
<if test="fileType != null and fileType != ''">file_type,</if>
<if test="uploadTime != null">upload_time,</if>
<if test="uploadBy != null and uploadBy != ''">upload_by,</if>
<if test="orderId != null">order_id,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileName != null and fileName != ''">#{fileName},</if>
<if test="filePath != null and filePath != ''">#{filePath},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="fileType != null and fileType != ''">#{fileType},</if>
<if test="uploadTime != null">#{uploadTime},</if>
<if test="uploadBy != null and uploadBy != ''">#{uploadBy},</if>
<if test="orderId != null">#{orderId},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysAttachment" parameterType="SysAttachment">
update sys_attachment
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="fileType != null and fileType != ''">file_type = #{fileType},</if>
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
<if test="uploadBy != null and uploadBy != ''">upload_by = #{uploadBy},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where attachment_id = #{attachmentId}
</update>
<delete id="deleteSysAttachmentById" parameterType="Long">
delete from sys_attachment where attachment_id = #{attachmentId}
</delete>
<delete id="deleteAttachmentsByOrderId" parameterType="Long">
delete from sys_attachment where order_id = #{orderId}
</delete>
<delete id="deleteSysAttachmentByIds" parameterType="String">
delete from sys_attachment where attachment_id in
<foreach item="attachmentId" collection="array" open="(" separator="," close=")">
#{attachmentId}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save