diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java index 665f8ce5..288aab7f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BaseTyreController.java @@ -60,6 +60,20 @@ public class BaseTyreController extends BaseController { return prefix + "/tyre"; } + + @RequiresPermissions("tyre:tyre:stat") + @GetMapping("/stat") + public String stat() + { + return prefix + "/stat"; + } + + /** + * 获取轮胎库存统计报表(模拟数据) + */ + + + @GetMapping("/detail/{tyreId}") public String tyreDetil(@PathVariable("tyreId") Long tyreId, Model model) { @@ -164,6 +178,120 @@ public class BaseTyreController extends BaseController List list = baseTyreService.selectBaseTyreList(baseTyre); return getDataTable(list); } + @PostMapping("/statList") + public AjaxResult statList() { + List list = new ArrayList<>(); + + // --- 模拟数据开始 --- + + // 1. 观澜修理厂 + TyreStatVO row1 = new TyreStatVO(); + row1.setDeptName("观澜修理厂"); + row1.setFactoryName("观澜修理厂"); + row1.setNewTyre(23); + row1.setRotateTyre(20); + row1.setRemoldTyre(0); + row1.setRepairTyre(0); + row1.setOnCarTyre(768); + row1.setPendingAppraise(0); + row1.setPendingRepair(0); + row1.setPendingRemold(0); + row1.setPendingScrap(0); + row1.setScrapped(0); + list.add(row1); + + // 2. 观湖修理厂 + TyreStatVO row2 = new TyreStatVO(); + row2.setDeptName("观湖修理厂"); + row2.setFactoryName("观湖修理厂"); + row2.setNewTyre(71); + row2.setRotateTyre(2); + row2.setRemoldTyre(0); + row2.setRepairTyre(0); + row2.setOnCarTyre(753); + row2.setPendingAppraise(0); + row2.setPendingRepair(0); + row2.setPendingRemold(0); + row2.setPendingScrap(0); + row2.setScrapped(0); + list.add(row2); + + // 3. 清湖修理厂 + TyreStatVO row3 = new TyreStatVO(); + row3.setDeptName("清湖修理厂"); + row3.setFactoryName("清湖修理厂"); + row3.setNewTyre(22); + row3.setRotateTyre(10); + row3.setRemoldTyre(0); + row3.setRepairTyre(0); + row3.setOnCarTyre(695); + row3.setPendingAppraise(0); + row3.setPendingRepair(0); + row3.setPendingRemold(0); + row3.setPendingScrap(0); + row3.setScrapped(0); + list.add(row3); + + // 4. 松岗修理厂 + TyreStatVO row4 = new TyreStatVO(); + row4.setDeptName("松岗修理厂"); + row4.setFactoryName("松岗修理厂"); + row4.setNewTyre(74); + row4.setRotateTyre(1); + row4.setRemoldTyre(1); + row4.setRepairTyre(0); + row4.setOnCarTyre(484); + row4.setPendingAppraise(0); + row4.setPendingRepair(0); + row4.setPendingRemold(0); + row4.setPendingScrap(1); + row4.setScrapped(0); + list.add(row4); + + // 5. 新和修理厂 + TyreStatVO row5 = new TyreStatVO(); + row5.setDeptName("新和修理厂"); + row5.setFactoryName("新和修理厂"); + row5.setNewTyre(131); + row5.setRotateTyre(1); + row5.setRemoldTyre(0); + row5.setRepairTyre(0); + row5.setOnCarTyre(473); + row5.setPendingAppraise(0); + row5.setPendingRepair(0); + row5.setPendingRemold(0); + row5.setPendingScrap(0); + row5.setScrapped(1); + list.add(row5); + + // --- 计算合计行 --- + TyreStatVO total = new TyreStatVO(); + total.setDeptName("合计"); + total.setFactoryName(""); // 合计行通常不需要显示场站名 + + // 这里简单手动累加一下,实际生产中可以用 Stream API + int newSum = list.stream().mapToInt(TyreStatVO::getNewTyre).sum(); + int rotSum = list.stream().mapToInt(TyreStatVO::getRotateTyre).sum(); + int remSum = list.stream().mapToInt(TyreStatVO::getRemoldTyre).sum(); + int repSum = list.stream().mapToInt(TyreStatVO::getRepairTyre).sum(); + int onCarSum = list.stream().mapToInt(TyreStatVO::getOnCarTyre).sum(); + int penScrapSum = list.stream().mapToInt(TyreStatVO::getPendingScrap).sum(); + int scrapSum = list.stream().mapToInt(TyreStatVO::getScrapped).sum(); + + total.setNewTyre(newSum); + total.setRotateTyre(rotSum); + total.setRemoldTyre(remSum); + total.setRepairTyre(repSum); + total.setOnCarTyre(onCarSum); + total.setPendingScrap(penScrapSum); + total.setScrapped(scrapSum); + + // 将合计行插入到第一位(或者最后一位,看你需求,图中是在第一位) + list.add(0, total); + + return AjaxResult.success(list); + } + @PostMapping("/getCarBingTire") @ResponseBody public List getCarBingTire(BaseTyre baseTyre) @@ -282,6 +410,8 @@ public class BaseTyreController extends BaseController + + public static class TimelineItem { private Long id; private String title; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizMaintenanceOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizMaintenanceOrderController.java index b04b52a8..88363a33 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizMaintenanceOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizMaintenanceOrderController.java @@ -1,13 +1,19 @@ package com.ruoyi.web.controller.tyre; +import java.util.Date; import java.util.List; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.domain.BaseCar; +import com.ruoyi.system.domain.BizOrderTireDetail; +import com.ruoyi.system.domain.MaintenanceOrderDTO; import com.ruoyi.system.service.IBaseCarService; +import com.ruoyi.system.service.IBizOrderTireDetailService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; @@ -37,6 +43,8 @@ public class BizMaintenanceOrderController extends BaseController @Autowired private IBizMaintenanceOrderService bizMaintenanceOrderService; + @Autowired + private IBizOrderTireDetailService bizOrderTireDetailService; @RequiresPermissions("system:order:view") @GetMapping() @@ -177,10 +185,36 @@ public class BizMaintenanceOrderController extends BaseController */ @PostMapping("/PDASaveMaintenanceOrder") @ResponseBody - public AjaxResult PDASaveMaintenanceOrder(@RequestBody BizMaintenanceOrder bizMaintenanceOrder) + @Transactional(rollbackFor = Exception.class) + public AjaxResult PDASaveMaintenanceOrder(@RequestBody MaintenanceOrderDTO bizMaintenanceOrder) { - bizMaintenanceOrder.setOrderNo(orderNoCreate()); - return toAjax(bizMaintenanceOrderService.updateBizMaintenanceOrder(bizMaintenanceOrder)); + // 2. 校验参数 + if (bizMaintenanceOrder == null || bizMaintenanceOrder.getOrder() == null) { + return error("参数不能为空"); + } + + BizMaintenanceOrder order = bizMaintenanceOrder.getOrder(); + Long orderId = order.getOrderId(); + + // 3. 执行更新操作 + int n = bizMaintenanceOrderService.updateBizMaintenanceOrder(order); + + // 4. 核心逻辑:只有更新成功(影响行数 > 0)才继续执行 + if (n > 0) { + // 保存详细表 + if (bizMaintenanceOrder.getTireDetails() != null && bizMaintenanceOrder.getTireDetails().size() > 0){ + for (BizOrderTireDetail bizOrderTireDetail : bizMaintenanceOrder.getTireDetails()){ + bizOrderTireDetail.setCreateTime(DateUtils.getNowDate()); + bizOrderTireDetail.setOrderId(orderId); + // 这里如果抛出异常,整个事务会回滚 + bizOrderTireDetailService.insertBizOrderTireDetail(bizOrderTireDetail); + } + } + return success("保存成功"); + } else { + // 5. 如果更新失败,直接返回错误,且不会执行下面的插入操作 + return error("更新工单失败,未保存轮胎详情"); + } } private String orderNoCreate(){ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizOrderTireDetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizOrderTireDetailController.java new file mode 100644 index 00000000..3e3bfc92 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tyre/BizOrderTireDetailController.java @@ -0,0 +1,128 @@ +package com.ruoyi.web.controller.tyre; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.BizOrderTireDetail; +import com.ruoyi.system.service.IBizOrderTireDetailService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 工单轮胎执行明细Controller + * + * @author ruoyi + * @date 2026-04-17 + */ +@Controller +@RequestMapping("/system/detail") +public class BizOrderTireDetailController extends BaseController +{ + private String prefix = "system/detail"; + + @Autowired + private IBizOrderTireDetailService bizOrderTireDetailService; + + @RequiresPermissions("system:detail:view") + @GetMapping() + public String detail() + { + return prefix + "/detail"; + } + + /** + * 查询工单轮胎执行明细列表 + */ + @RequiresPermissions("system:detail:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(BizOrderTireDetail bizOrderTireDetail) + { + startPage(); + List list = bizOrderTireDetailService.selectBizOrderTireDetailList(bizOrderTireDetail); + return getDataTable(list); + } + + /** + * 导出工单轮胎执行明细列表 + */ + @RequiresPermissions("system:detail:export") + @Log(title = "工单轮胎执行明细", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(BizOrderTireDetail bizOrderTireDetail) + { + List list = bizOrderTireDetailService.selectBizOrderTireDetailList(bizOrderTireDetail); + ExcelUtil util = new ExcelUtil(BizOrderTireDetail.class); + return util.exportExcel(list, "工单轮胎执行明细数据"); + } + + /** + * 新增工单轮胎执行明细 + */ + @RequiresPermissions("system:detail:add") + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存工单轮胎执行明细 + */ + @RequiresPermissions("system:detail:add") + @Log(title = "工单轮胎执行明细", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(BizOrderTireDetail bizOrderTireDetail) + { + return toAjax(bizOrderTireDetailService.insertBizOrderTireDetail(bizOrderTireDetail)); + } + + /** + * 修改工单轮胎执行明细 + */ + @RequiresPermissions("system:detail:edit") + @GetMapping("/edit/{detailId}") + public String edit(@PathVariable("detailId") Long detailId, ModelMap mmap) + { + BizOrderTireDetail bizOrderTireDetail = bizOrderTireDetailService.selectBizOrderTireDetailByDetailId(detailId); + mmap.put("bizOrderTireDetail", bizOrderTireDetail); + return prefix + "/edit"; + } + + /** + * 修改保存工单轮胎执行明细 + */ + @RequiresPermissions("system:detail:edit") + @Log(title = "工单轮胎执行明细", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(BizOrderTireDetail bizOrderTireDetail) + { + return toAjax(bizOrderTireDetailService.updateBizOrderTireDetail(bizOrderTireDetail)); + } + + /** + * 删除工单轮胎执行明细 + */ + @RequiresPermissions("system:detail:remove") + @Log(title = "工单轮胎执行明细", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(bizOrderTireDetailService.deleteBizOrderTireDetailByDetailIds(ids)); + } +} diff --git a/ruoyi-admin/src/main/resources/templates/tyre/detail/add.html b/ruoyi-admin/src/main/resources/templates/tyre/detail/add.html new file mode 100644 index 00000000..91ef64b1 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/tyre/detail/add.html @@ -0,0 +1,81 @@ + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/tyre/detail/detail.html b/ruoyi-admin/src/main/resources/templates/tyre/detail/detail.html new file mode 100644 index 00000000..b8f24f20 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/tyre/detail/detail.html @@ -0,0 +1,134 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/tyre/detail/edit.html b/ruoyi-admin/src/main/resources/templates/tyre/detail/edit.html new file mode 100644 index 00000000..6d0ee17c --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/tyre/detail/edit.html @@ -0,0 +1,82 @@ + + + + + + +
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/tyre/order/Detail.html b/ruoyi-admin/src/main/resources/templates/tyre/order/Detail.html new file mode 100644 index 00000000..e69de29b diff --git a/ruoyi-admin/src/main/resources/templates/tyre/order/edit.html b/ruoyi-admin/src/main/resources/templates/tyre/order/edit.html index 360280c8..70a46546 100644 --- a/ruoyi-admin/src/main/resources/templates/tyre/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/tyre/order/edit.html @@ -1,129 +1,287 @@ - + - - - - -
-
- -
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
-
- - -
-
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- -
- -
-
-
-
-
- - - + /* 轮胎布局容器 */ + .axle-group { display: flex; justify-content: center; margin-bottom: 20px; position: relative; } + .axle-label { + position: absolute; + top: 50%; left: 50%; + transform: translate(-50%, -50%); + background: #fff; + padding: 2px 8px; + border-radius: 4px; + font-size: 12px; + color: #666; + border: 1px solid #e7eaec; + z-index: 2; + } + + /* 轮胎卡片 */ + .tyre-card { + width: 100px; + height: 180px; + background-color: #2f4050; /* 深灰底色 */ + border-radius: 10px 10px 20px 20px; + margin: 0 5px; + position: relative; + overflow: hidden; + color: #fff; + transition: all 0.3s; + display: flex; + flex-direction: column; + justify-content: flex-end; /* 内容沉底 */ + padding-bottom: 10px; + box-sizing: border-box; + } + + /* 胎纹模拟背景 */ + .tyre-pattern { + position: absolute; + top: 0; left: 0; right: 0; bottom: 0; + opacity: 0.1; /* 淡淡的纹路 */ + background-image: repeating-linear-gradient( + 45deg, + transparent, + transparent 10px, + #fff 10px, + #fff 20px + ); + z-index: 1; + } + + /* 轴位标签 (左前, 右前等) */ + .pos-tag { + position: absolute; + top: 0; left: 0; + background: #999; + color: #fff; + font-size: 12px; + padding: 2px 8px; + border-radius: 0 0 10px 0; + z-index: 3; + } + + /* 轮胎内容文字 */ + .tyre-info { z-index: 3; padding: 0 10px; font-size: 12px; line-height: 1.5; } + .tyre-brand { font-weight: bold; font-size: 13px; } + .tyre-spec { font-size: 11px; opacity: 0.9; } + .tyre-dot { font-size: 11px; opacity: 0.8; } + .tyre-depth { color: #1ab394; font-weight: bold; margin-top: 2px; } + .tyre-status { font-size: 11px; border: 1px solid rgba(255,255,255,0.3); padding: 1px 3px; border-radius: 3px; display: inline-block; margin-top: 2px;} + + /* 状态样式:卸胎 (绿色) */ + .status-removed { + border: 2px solid #1ab394 !important; + background-color: #2f4050; + } + .status-removed .pos-tag { background: #1ab394; } + .status-removed .tyre-pattern { opacity: 0.3; } /* 卸胎纹路稍微明显点 */ + .status-removed::after { + content: "卸胎"; + position: absolute; + top: 30%; left: 50%; + transform: translateX(-50%); + color: #1ab394; + font-weight: bold; + font-size: 14px; + z-index: 4; + background: rgba(255,255,255,0.9); + padding: 2px 5px; + border-radius: 4px; + } + + /* 状态样式:空位 (灰色透明) */ + .status-empty { + background: #e7eaec; + border: 1px dashed #ccc; + } + .status-empty .pos-tag { background: #ccc; } + .status-empty .tyre-pattern { display: none; } + + /* 按钮 */ + .btn-xs { padding: 1px 5px; font-size: 12px; border-radius: 3px; } + + + +
+ + +
+ 粤B71857D +
+
+ 所属场站:清湖修理厂 +
+
+ 保养日期:2026-04-16 +
+
+ 创建时间:2026-04-17 10:49:49 +
+
+ 创建人:冯伟 +
+ +
+ 完成时间:2026-04-17 10:51:07 +
+
+ 完成操作人:冯伟 +
+
+ 当前车辆里程(km):311233.00 +
+
+ 线路:M204 +
+ +
+ 所属部门:第四分公司-同胜 +
+
+ 备注:- +
+
+
+ + +
+ + +
+
维保前
+
+ +
+
+ +
+ + +
+
+ +
+
维保后
+
+ +
+
+ +
+
+ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/tyre/order/order.html b/ruoyi-admin/src/main/resources/templates/tyre/order/order.html index 1363688b..9e3c47ea 100644 --- a/ruoyi-admin/src/main/resources/templates/tyre/order/order.html +++ b/ruoyi-admin/src/main/resources/templates/tyre/order/order.html @@ -21,14 +21,6 @@ -
  • - - - -
  • @@ -166,8 +158,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - // actions.push('编辑 '); - actions.push('删除'); + actions.push('详情 '); return actions.join(''); } }] @@ -175,5 +166,6 @@ $.table.init(options); }); + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/tyre/tyre/stat.html b/ruoyi-admin/src/main/resources/templates/tyre/tyre/stat.html new file mode 100644 index 00000000..d2e72625 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/tyre/tyre/stat.html @@ -0,0 +1,106 @@ + + + + + + +
    +
    +
    +
    +
    +
      + +
    • + 轮胎品牌: +
    • +
    • +

      轮胎类别:

      + +
    • + +
    • +  搜索 +  重置 +
    • +
    +
    +
    +
    + +
    + + + 导出 + + +
    +
    +
    +
    +
    +
    + + + + + \ No newline at end of file diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 8aa5b2b0..4cbc43c4 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -22,6 +22,17 @@ com.ruoyi ruoyi-common + + org.projectlombok + lombok + provided + + + net.java.dev.jna + jna-platform + 5.18.1 + compile + diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BizOrderTireDetail.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BizOrderTireDetail.java index bb5ce6da..61599eb6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/BizOrderTireDetail.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/BizOrderTireDetail.java @@ -1,19 +1,16 @@ package com.ruoyi.system.domain; import java.math.BigDecimal; -import java.util.Date; - -import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; /** - * 工单轮胎执行明细表对象 biz_order_tire_detail + * 工单轮胎执行明细对象 biz_order_tire_detail * - * @author xins - * @date 2026-04-15 + * @author ruoyi + * @date 2026-04-17 */ public class BizOrderTireDetail extends BaseEntity { @@ -27,70 +24,29 @@ public class BizOrderTireDetail extends BaseEntity private Long orderId; /** 轮胎位置ID(关联位置表) */ - @Excel(name = "轮胎位置ID", readConverterExp = "关联位置表") + @Excel(name = "轮胎位置ID", readConverterExp = "关=联位置表") private Long positionId; - /** 轮胎ID(关联轮胎档案base_tyre,如果是新胎可能为空或临时生成) */ - @Excel(name = "轮胎ID", readConverterExp = "关联轮胎档案base_tyre,如果是新胎可能为空或临时生成") + /** 轮胎ID(关联轮胎档案,如果是新胎可能为空或临时生成) */ + @Excel(name = "轮胎ID", readConverterExp = "关=联轮胎档案,如果是新胎可能为空或临时生成") private Long tireId; /** 轮胎编号(冗余字段,记录快照) */ - @Excel(name = "轮胎编号", readConverterExp = "冗余字段,记录快照") + @Excel(name = "轮胎编号", readConverterExp = "冗=余字段,记录快照") private String tireCode; /** 花纹深度(mm)(截图中的10mm) */ - @Excel(name = "花纹深度(mm)", readConverterExp = "截图中的10mm") + @Excel(name = "花纹深度", readConverterExp = "m=m") private BigDecimal treadDepth; - /** 轮胎状态描述(截图中的"新胎"、"模拟数据") */ - @Excel(name = "轮胎状态描述", readConverterExp = "截图中的\"新胎\"、\"模拟数据\"") + /** 胎压 */ + @Excel(name = "胎压") + private Long tirePress; + + /** 轮胎状态描述(截图中的“新胎”、“模拟数据”) */ + @Excel(name = "轮胎状态描述", readConverterExp = "截=图中的“新胎”、“模拟数据”") private String tireStatus; - /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - - /** 轮胎品牌 */ - @Excel(name = "轮胎品牌") - private String tyreBrand; - - /** 轮胎型号 */ - @Excel(name = "轮胎型号") - private String tyreModel; - - /** 轮胎级别 */ - @Excel(name = "轮胎级别") - private String tyreLevel; - - /** 轮胎样式 */ - @Excel(name = "轮胎样式") - private String tyrePattern; - - /** 沟槽条数 */ - @Excel(name = "沟槽条数") - private String grooves; - - /** 花纹深度 */ - @Excel(name = "花纹深度") - private String patternDepth; - - /** 轮胎类型 */ - @Excel(name = "轮胎类型") - private String tyreType; - - /** 自编号 */ - @Excel(name = "自编号") - private String selfNo; - - /** 轮胎EPC */ - @Excel(name = "轮胎EPC") - private String tyreEpc; - - /** 轮位描述 */ - @Excel(name = "轮位描述") - private String positionDesc; - public void setDetailId(Long detailId) { this.detailId = detailId; @@ -100,6 +56,7 @@ public class BizOrderTireDetail extends BaseEntity { return detailId; } + public void setOrderId(Long orderId) { this.orderId = orderId; @@ -109,6 +66,7 @@ public class BizOrderTireDetail extends BaseEntity { return orderId; } + public void setPositionId(Long positionId) { this.positionId = positionId; @@ -118,6 +76,7 @@ public class BizOrderTireDetail extends BaseEntity { return positionId; } + public void setTireId(Long tireId) { this.tireId = tireId; @@ -127,6 +86,7 @@ public class BizOrderTireDetail extends BaseEntity { return tireId; } + public void setTireCode(String tireCode) { this.tireCode = tireCode; @@ -136,6 +96,7 @@ public class BizOrderTireDetail extends BaseEntity { return tireCode; } + public void setTreadDepth(BigDecimal treadDepth) { this.treadDepth = treadDepth; @@ -145,6 +106,17 @@ public class BizOrderTireDetail extends BaseEntity { return treadDepth; } + + public void setTirePress(Long tirePress) + { + this.tirePress = tirePress; + } + + public Long getTirePress() + { + return tirePress; + } + public void setTireStatus(String tireStatus) { this.tireStatus = tireStatus; @@ -154,95 +126,6 @@ public class BizOrderTireDetail extends BaseEntity { return tireStatus; } - public void setCreateTime(Date createTime) - { - this.createTime = createTime; - } - - public Date getCreateTime() - { - return createTime; - } - - public String getTyreBrand() { - return tyreBrand; - } - - public void setTyreBrand(String tyreBrand) { - this.tyreBrand = tyreBrand; - } - - public String getTyreModel() { - return tyreModel; - } - - public void setTyreModel(String tyreModel) { - this.tyreModel = tyreModel; - } - - public String getTyreLevel() { - return tyreLevel; - } - - public void setTyreLevel(String tyreLevel) { - this.tyreLevel = tyreLevel; - } - - public String getTyrePattern() { - return tyrePattern; - } - - public void setTyrePattern(String tyrePattern) { - this.tyrePattern = tyrePattern; - } - - public String getGrooves() { - return grooves; - } - - public void setGrooves(String grooves) { - this.grooves = grooves; - } - - public String getPatternDepth() { - return patternDepth; - } - - public void setPatternDepth(String patternDepth) { - this.patternDepth = patternDepth; - } - - public String getTyreType() { - return tyreType; - } - - public void setTyreType(String tyreType) { - this.tyreType = tyreType; - } - - public String getSelfNo() { - return selfNo; - } - - public void setSelfNo(String selfNo) { - this.selfNo = selfNo; - } - - public String getTyreEpc() { - return tyreEpc; - } - - public void setTyreEpc(String tyreEpc) { - this.tyreEpc = tyreEpc; - } - - public String getPositionDesc() { - return positionDesc; - } - - public void setPositionDesc(String positionDesc) { - this.positionDesc = positionDesc; - } @Override public String toString() { @@ -253,19 +136,13 @@ public class BizOrderTireDetail extends BaseEntity .append("tireId", getTireId()) .append("tireCode", getTireCode()) .append("treadDepth", getTreadDepth()) + .append("tirePress", getTirePress()) .append("tireStatus", getTireStatus()) - .append("createTime", getCreateTime()) .append("createBy", getCreateBy()) - .append("tyreBrand", getTyreBrand()) - .append("tyreModel", getTyreModel()) - .append("tyreLevel", getTyreLevel()) - .append("tyrePattern", getTyrePattern()) - .append("grooves", getGrooves()) - .append("patternDepth", getPatternDepth()) - .append("tyreType", getTyreType()) - .append("selfNo", getSelfNo()) - .append("tyreEpc", getTyreEpc()) - .append("positionDesc", getPositionDesc()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) .toString(); } -} \ No newline at end of file +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/MaintenanceOrderDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/MaintenanceOrderDTO.java new file mode 100644 index 00000000..8f7a91a1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/MaintenanceOrderDTO.java @@ -0,0 +1,14 @@ +package com.ruoyi.system.domain; + +import lombok.Data; + +import java.util.List; + +@Data +public class MaintenanceOrderDTO { + // 原来的工单对象 + private BizMaintenanceOrder order; + + // 原来的轮胎详情对象(如果是列表,可以用 List) + private List tireDetails; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/TyreStatVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TyreStatVO.java new file mode 100644 index 00000000..eca53e5b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/TyreStatVO.java @@ -0,0 +1,34 @@ +package com.ruoyi.system.domain; + +import lombok.Data; + +@Data +public class TyreStatVO { + /** 所属部门 */ + private String deptName; + /** 所属场站 */ + private String factoryName; + + /** 可用轮胎库存 - 新胎 */ + private Integer newTyre; + /** 可用轮胎库存 - 周转胎 */ + private Integer rotateTyre; + /** 可用轮胎库存 - 翻新胎 */ + private Integer remoldTyre; + /** 可用轮胎库存 - 修补胎 */ + private Integer repairTyre; + + /** 在车轮胎 */ + private Integer onCarTyre; + + /** 维护中/待处理库存 - 待鉴定 */ + private Integer pendingAppraise; + /** 维护中/待处理库存 - 待修补 */ + private Integer pendingRepair; + /** 维护中/待处理库存 - 待翻新 */ + private Integer pendingRemold; + /** 维护中/待处理库存 - 待报废 */ + private Integer pendingScrap; + /** 维护中/待处理库存 - 报废 */ + private Integer scrapped; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BizOrderTireDetailMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BizOrderTireDetailMapper.java index 2d54f859..bfdda768 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BizOrderTireDetailMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/BizOrderTireDetailMapper.java @@ -4,81 +4,58 @@ import java.util.List; import com.ruoyi.system.domain.BizOrderTireDetail; /** - * 工单轮胎执行明细表Mapper接口 + * 工单轮胎执行明细Mapper接口 * - * @author yangwanli - * @date 2026-04-15 + * @author ruoyi + * @date 2026-04-17 */ public interface BizOrderTireDetailMapper { /** - * 查询工单轮胎执行明细表 + * 查询工单轮胎执行明细 * - * @param detailId 工单轮胎执行明细表主键 - * @return 工单轮胎执行明细表 + * @param detailId 工单轮胎执行明细主键 + * @return 工单轮胎执行明细 */ - public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId); + public BizOrderTireDetail selectBizOrderTireDetailByDetailId(Long detailId); /** -дь цайхщ - * @param bizOrderTireDetail 工单轮胎执行明细表 - * @return 工单轮胎执行明细表集合 + * 查询工单轮胎执行明细列表 + * + * @param bizOrderTireDetail 工单轮胎执行明细 + * @return 工单轮胎执行明细集合 */ public List selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail); /** - * 新增工单轮胎执行明细表 + * 新增工单轮胎执行明细 * - * @param bizOrderTireDetail 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 * @return 结果 */ public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail); /** - * 修改工单轮胎执行明细表 + * 修改工单轮胎执行明细 * - * @param bizOrderTireDetail 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 * @return 结果 */ public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail); /** - * 删除工单轮胎执行明细表 + * 删除工单轮胎执行明细 * - * @param detailId 工单轮胎执行明细表主キキ + * @param detailId 工单轮胎执行明细主键 * @return 结果 */ - public int deleteBizOrderTireDetailById(Long detailId); + public int deleteBizOrderTireDetailByDetailId(Long detailId); /** - * 批量删除工单轮胎执行明细表 + * 批量删除工单轮胎执行明细 * * @param detailIds 需要删除的数据主键集合 * @return 结果 */ - public int deleteBizOrderTireDetailByIds(String[] detailIds); - - /** - * 根据工单ID查询轮胎明细列表 - * - * @param orderId 工单ID - * @return 轮胎明细列表 - */ - public List selectTireDetailByOrderId(Long orderId); - - /** - * 批量插入轮胎明细 - * - * @param tireDetails 轮胎明细列表 - * @return 结果 - */ - public int batchInsertTireDetail(List tireDetails); - - /** - * 根据工单ID批量删除轮胎明细 - * - * @param orderId 工单ID - * @return 结果 - */ - public int deleteTireDetailByOrderId(Long orderId); -} \ No newline at end of file + public int deleteBizOrderTireDetailByDetailIds(String[] detailIds); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBizOrderTireDetailService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBizOrderTireDetailService.java index 4de3c6ed..d03e9ba8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IBizOrderTireDetailService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IBizOrderTireDetailService.java @@ -4,91 +4,58 @@ import java.util.List; import com.ruoyi.system.domain.BizOrderTireDetail; /** - * 工单轮胎执行明细表Service接口 + * 工单轮胎执行明细Service接口 * - * @author yangwanli - * @date 2026-04-15 + * @author ruoyi + * @date 2026-04-17 */ public interface IBizOrderTireDetailService { /** - * 查询工单轮胎执行明细表 + * 查询工单轮胎执行明细 * - * @param detailId 工单轮胎执行明细表主键 - * @return 工单轮胎执行明细表 + * @param detailId 工单轮胎执行明细主键 + * @return 工单轮胎执行明细 */ - public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId); + public BizOrderTireDetail selectBizOrderTireDetailByDetailId(Long detailId); /** - * 查询工单轮胎执行明细表列表 + * 查询工单轮胎执行明细列表 * - * @param bizOrderTireDetail 工单轮胎执行明细表 - * @return 工单轮胎执行明细表集合 + * @param bizOrderTireDetail 工单轮胎执行明细 + * @return 工单轮胎执行明细集合 */ public List selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail); /** - * 新增工单轮胎执行明细表 + * 新增工单轮胎执行明细 * - * @param bizOrderTireDetail 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 * @return 结果 */ public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail); /** - * 修改工单轮胎执行明细表 + * 修改工单轮胎执行明细 * - * @param bizOrderTireDetail 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 * @return 结果 */ public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail); /** - * 批量删除工单轮胎执行明细表 + * 批量删除工单轮胎执行明细 * - * @param detailIds 需要删除的工单轮胎执行明细表主键集合 + * @param detailIds 需要删除的工单轮胎执行明细主键集合 * @return 结果 */ - public int deleteBizOrderTireDetailByIds(String detailIds); + public int deleteBizOrderTireDetailByDetailIds(String detailIds); /** - * 删除工单轮胎执行明细表信息 + * 删除工单轮胎执行明细信息 * - * @param detailId 工单轮胎执行明细表主键 + * @param detailId 工单轮胎执行明细主键 * @return 结果 */ - public int deleteBizOrderTireDetailById(Long detailId); - - /** - * 根据工单ID查询轮胎明细列表 - * - * @param orderId 工单ID - * @return 轮胎明细列表 - */ - public List selectTireDetailByOrderId(Long orderId); - - /** - * 批量插入轮胎明细 - * - * @param tireDetails 轮胎明细列表 - * @return 结果 - */ - public int batchInsertTireDetail(List tireDetails); - - /** - * 根据工单ID删除轮胎明细 - * - * @param orderId 工单ID - * @return 结果 - */ - public int deleteTireDetailByOrderId(Long orderId); - - /** - * 保存轮胎明细列表 - * - * @param orderId 工单ID - * @param tireDetails 轮胎明细列表 - * @return 结果 - */ - public int saveTireDetails(Long orderId, List tireDetails); -} \ No newline at end of file + public int deleteBizOrderTireDetailByDetailId(Long detailId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BizOrderTireDetailServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BizOrderTireDetailServiceImpl.java index bbf51f24..503243dd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BizOrderTireDetailServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/BizOrderTireDetailServiceImpl.java @@ -1,23 +1,19 @@ package com.ruoyi.system.service.impl; import java.util.List; - import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.ShiroUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - import com.ruoyi.system.mapper.BizOrderTireDetailMapper; import com.ruoyi.system.domain.BizOrderTireDetail; import com.ruoyi.system.service.IBizOrderTireDetailService; import com.ruoyi.common.core.text.Convert; /** - * 工单轮胎执行明细表Service业务层处理 + * 工单轮胎执行明细Service业务层处理 * - * @author yangwanli - * @date 2026-04-15 + * @author ruoyi + * @date 2026-04-17 */ @Service public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService @@ -26,22 +22,22 @@ public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService private BizOrderTireDetailMapper bizOrderTireDetailMapper; /** - * 查询工单轮胎执行明细表 + * 查询工单轮胎执行明细 * - * @param detailId 工单轮胎执行明细表主键 - * @return 工单轮胎执行明细表 + * @param detailId 工单轮胎执行明细主键 + * @return 工单轮胎执行明细 */ @Override - public BizOrderTireDetail selectBizOrderTireDetailById(Long detailId) + public BizOrderTireDetail selectBizOrderTireDetailByDetailId(Long detailId) { - return bizOrderTireDetailMapper.selectBizOrderTireDetailById(detailId); + return bizOrderTireDetailMapper.selectBizOrderTireDetailByDetailId(detailId); } /** - * 查询工单轮胎执行明细表列表 + * 查询工单轮胎执行明细列表 * - * @param bizOrderTireDetail 工单轮胎执行明细表 - * @return 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 + * @return 工单轮胎执行明细 */ @Override public List selectBizOrderTireDetailList(BizOrderTireDetail bizOrderTireDetail) @@ -50,117 +46,52 @@ public class BizOrderTireDetailServiceImpl implements IBizOrderTireDetailService } /** - * 新增工单轮胎执行明细表 + * 新增工单轮胎执行明细 * - * @param bizOrderTireDetail 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 * @return 结果 */ @Override public int insertBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail) { bizOrderTireDetail.setCreateTime(DateUtils.getNowDate()); - bizOrderTireDetail.setCreateBy(ShiroUtils.getLoginName()); return bizOrderTireDetailMapper.insertBizOrderTireDetail(bizOrderTireDetail); } /** - * 修改工单轮胎执行明细表 + * 修改工单轮胎执行明细 * - * @param bizOrderTireDetail 工单轮胎执行明细表 + * @param bizOrderTireDetail 工单轮胎执行明细 * @return 结果 */ @Override public int updateBizOrderTireDetail(BizOrderTireDetail bizOrderTireDetail) { + bizOrderTireDetail.setUpdateTime(DateUtils.getNowDate()); return bizOrderTireDetailMapper.updateBizOrderTireDetail(bizOrderTireDetail); } /** - * 批量删除工单轮胎执行明细表 + * 批量删除工单轮胎执行明细 * - * @param detailIds 需要删除的工单轮胎执行明细表主键 + * @param detailIds 需要删除的工单轮胎执行明细主键 * @return 结果 */ @Override - public int deleteBizOrderTireDetailByIds(String detailIds) + public int deleteBizOrderTireDetailByDetailIds(String detailIds) { - return bizOrderTireDetailMapper.deleteBizOrderTireDetailByIds(Convert.toStrArray(detailIds)); + return bizOrderTireDetailMapper.deleteBizOrderTireDetailByDetailIds(Convert.toStrArray(detailIds)); } /** - * 删除工单轮胎执行明细表信息 + * 删除工单轮胎执行明细信息 * - * @param detailId 工单轮胎执行明细表主键 + * @param detailId 工单轮胎执行明细主键 * @return 结果 */ @Override - public int deleteBizOrderTireDetailById(Long detailId) + public int deleteBizOrderTireDetailByDetailId(Long detailId) { - return bizOrderTireDetailMapper.deleteBizOrderTireDetailById(detailId); + return bizOrderTireDetailMapper.deleteBizOrderTireDetailByDetailId(detailId); } - - /** - * 根据工单ID查询轮胎明细列表 - * - * @param orderId 工单ID - * @return 轮胎明细列表 - */ - @Override - public List selectTireDetailByOrderId(Long orderId) - { - return bizOrderTireDetailMapper.selectTireDetailByOrderId(orderId); - } - - /** - * 批量插入轮胎明细 - * - * @param tireDetails 轮胎明细列表 - * @return 结果 - */ - @Override - public int batchInsertTireDetail(List 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 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; - } -} \ No newline at end of file +} diff --git a/ruoyi-system/src/main/resources/mapper/tyre/BizMaintenanceOrderMapper.xml b/ruoyi-system/src/main/resources/mapper/tyre/BizMaintenanceOrderMapper.xml index 32b21d70..62fa6422 100644 --- a/ruoyi-system/src/main/resources/mapper/tyre/BizMaintenanceOrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/tyre/BizMaintenanceOrderMapper.xml @@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -55,9 +56,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -36,51 +30,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and order_id = #{orderId} and position_id = #{positionId} and tire_id = #{tireId} - and tire_code like concat('%', #{tireCode}, '%') + and tire_code = #{tireCode} and tread_depth = #{treadDepth} + and tire_press = #{tirePress} and tire_status = #{tireStatus} - where detail_id = #{detailId} - - - - + + insert into biz_order_tire_detail - detail_id, - order_id, + order_id, position_id, tire_id, tire_code, tread_depth, + tire_press, tire_status, - create_time, create_by, + create_time, + update_by, + update_time, + remark, - #{detailId}, #{orderId}, - #{positionId}, - #{tireId}, - #{tireCode}, - #{treadDepth}, - #{tireStatus}, - #{createTime}, - #{createBy}, + #{positionId}, + #{tireId}, + #{tireCode}, + #{treadDepth}, + #{tirePress}, + #{tireStatus}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, @@ -92,32 +82,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tire_id = #{tireId}, tire_code = #{tireCode}, tread_depth = #{treadDepth}, + tire_press = #{tirePress}, tire_status = #{tireStatus}, - create_time = #{createTime}, create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, where detail_id = #{detailId} - + delete from biz_order_tire_detail where detail_id = #{detailId} - + delete from biz_order_tire_detail where detail_id in #{detailId} - - insert into biz_order_tire_detail (order_id, position_id, tire_id, tire_code, tread_depth, tire_status, create_time, create_by) values - - (#{item.orderId}, #{item.positionId}, #{item.tireId}, #{item.tireCode}, #{item.treadDepth}, #{item.tireStatus}, #{item.createTime}, #{item.createBy}) - - - - - delete from biz_order_tire_detail where order_id = #{orderId} - \ No newline at end of file