|
|
|
@ -1,33 +1,31 @@
|
|
|
|
package com.ruoyi.web.controller.tyre;
|
|
|
|
package com.ruoyi.web.controller.tyre;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
|
import com.ruoyi.common.config.RuoYiConfig;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
|
import com.ruoyi.system.domain.*;
|
|
|
|
import com.ruoyi.system.domain.*;
|
|
|
|
import com.ruoyi.system.service.*;
|
|
|
|
import com.ruoyi.system.service.*;
|
|
|
|
import com.sun.jna.platform.win32.OaIdl;
|
|
|
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import com.ruoyi.common.annotation.Log;
|
|
|
|
|
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import static com.ruoyi.common.utils.file.FileUploadUtils.extractFilename;
|
|
|
|
import static com.ruoyi.common.utils.file.FileUploadUtils.extractFilename;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -38,8 +36,7 @@ import static com.ruoyi.common.utils.file.FileUploadUtils.extractFilename;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Controller
|
|
|
|
@Controller
|
|
|
|
@RequestMapping("/tyre/order")
|
|
|
|
@RequestMapping("/tyre/order")
|
|
|
|
public class BizMaintenanceOrderController extends BaseController
|
|
|
|
public class BizMaintenanceOrderController extends BaseController {
|
|
|
|
{
|
|
|
|
|
|
|
|
private String prefix = "tyre/order";
|
|
|
|
private String prefix = "tyre/order";
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
@ -56,11 +53,12 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ISysAttachmentService iSysAttachmentService;
|
|
|
|
private ISysAttachmentService iSysAttachmentService;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IRecordTyreMileageService recordTyreMileageService;
|
|
|
|
|
|
|
|
|
|
|
|
@RequiresPermissions("system:order:view")
|
|
|
|
@RequiresPermissions("system:order:view")
|
|
|
|
@GetMapping()
|
|
|
|
@GetMapping()
|
|
|
|
public String order()
|
|
|
|
public String order() {
|
|
|
|
{
|
|
|
|
|
|
|
|
return prefix + "/order";
|
|
|
|
return prefix + "/order";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -70,8 +68,7 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@RequiresPermissions("system:order:list")
|
|
|
|
@RequiresPermissions("system:order:list")
|
|
|
|
@PostMapping("/list")
|
|
|
|
@PostMapping("/list")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public TableDataInfo list(BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public TableDataInfo list(BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
startPage();
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
|
|
|
|
return getDataTable(list);
|
|
|
|
return getDataTable(list);
|
|
|
|
@ -83,13 +80,16 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@RequiresPermissions("system:order:list")
|
|
|
|
@RequiresPermissions("system:order:list")
|
|
|
|
@PostMapping("/listMaintenanceOrder")
|
|
|
|
@PostMapping("/listMaintenanceOrder")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public TableDataInfo listMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public TableDataInfo listMaintenanceOrder(BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
startPage();
|
|
|
|
startPage();
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderListTwo(bizMaintenanceOrder);
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderListTwo(bizMaintenanceOrder);
|
|
|
|
return getDataTable(list);
|
|
|
|
return getDataTable(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 新增维保工单
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 导出维保工单列表
|
|
|
|
* 导出维保工单列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -97,16 +97,12 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.EXPORT)
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.EXPORT)
|
|
|
|
@PostMapping("/export")
|
|
|
|
@PostMapping("/export")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult export(BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public AjaxResult export(BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
|
|
|
|
ExcelUtil<BizMaintenanceOrder> util = new ExcelUtil<BizMaintenanceOrder>(BizMaintenanceOrder.class);
|
|
|
|
ExcelUtil<BizMaintenanceOrder> util = new ExcelUtil<BizMaintenanceOrder>(BizMaintenanceOrder.class);
|
|
|
|
return util.exportExcel(list, "维保工单数据");
|
|
|
|
return util.exportExcel(list, "维保工单数据");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 新增维保工单
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增维保工单
|
|
|
|
* 新增维保工单
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -127,8 +123,7 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.INSERT)
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.INSERT)
|
|
|
|
@PostMapping("/add")
|
|
|
|
@PostMapping("/add")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult addSave(BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public AjaxResult addSave(BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(bizMaintenanceOrderService.insertBizMaintenanceOrder(bizMaintenanceOrder));
|
|
|
|
return toAjax(bizMaintenanceOrderService.insertBizMaintenanceOrder(bizMaintenanceOrder));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -137,8 +132,7 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequiresPermissions("system:order:edit")
|
|
|
|
@RequiresPermissions("system:order:edit")
|
|
|
|
@GetMapping("/edit/{orderId}")
|
|
|
|
@GetMapping("/edit/{orderId}")
|
|
|
|
public String edit(@PathVariable("orderId") Long orderId, ModelMap mmap)
|
|
|
|
public String edit(@PathVariable("orderId") Long orderId, ModelMap mmap) {
|
|
|
|
{
|
|
|
|
|
|
|
|
BizMaintenanceOrder bizMaintenanceOrder = bizMaintenanceOrderService.selectBizMaintenanceOrderByOrderId(orderId);
|
|
|
|
BizMaintenanceOrder bizMaintenanceOrder = bizMaintenanceOrderService.selectBizMaintenanceOrderByOrderId(orderId);
|
|
|
|
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
|
|
|
|
mmap.put("bizMaintenanceOrder", bizMaintenanceOrder);
|
|
|
|
// 查询同车牌上一张已完成维保工单;“维保前”按业务口径取上一单的维保后结果,不能再混入当前车辆实时装胎状态。
|
|
|
|
// 查询同车牌上一张已完成维保工单;“维保前”按业务口径取上一单的维保后结果,不能再混入当前车辆实时装胎状态。
|
|
|
|
@ -164,8 +158,7 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.UPDATE)
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.UPDATE)
|
|
|
|
@PostMapping("/edit")
|
|
|
|
@PostMapping("/edit")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult editSave(BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public AjaxResult editSave(BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(bizMaintenanceOrderService.updateBizMaintenanceOrder(bizMaintenanceOrder));
|
|
|
|
return toAjax(bizMaintenanceOrderService.updateBizMaintenanceOrder(bizMaintenanceOrder));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -176,35 +169,34 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.DELETE)
|
|
|
|
@Log(title = "维保工单", businessType = BusinessType.DELETE)
|
|
|
|
@PostMapping("/remove")
|
|
|
|
@PostMapping("/remove")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult remove(String ids)
|
|
|
|
public AjaxResult remove(String ids) {
|
|
|
|
{
|
|
|
|
|
|
|
|
return toAjax(bizMaintenanceOrderService.deleteBizMaintenanceOrderByOrderIds(ids));
|
|
|
|
return toAjax(bizMaintenanceOrderService.deleteBizMaintenanceOrderByOrderIds(ids));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/PDAGetMaintenanceOrder")
|
|
|
|
@PostMapping("/PDAGetMaintenanceOrder")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult PDAGetMaintenanceOrder(@RequestBody BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public AjaxResult PDAGetMaintenanceOrder(@RequestBody BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
|
|
|
|
List<BizMaintenanceOrder> list = bizMaintenanceOrderService.selectBizMaintenanceOrderList(bizMaintenanceOrder);
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
return AjaxResult.success(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* PDA添加保存工单
|
|
|
|
* PDA添加保存工单
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param bizMaintenanceOrder
|
|
|
|
* @param bizMaintenanceOrder
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/PDAAddMaintenanceOrder")
|
|
|
|
@PostMapping("/PDAAddMaintenanceOrder")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public AjaxResult PDAAddMaintenanceOrder(@RequestBody BizMaintenanceOrder bizMaintenanceOrder)
|
|
|
|
public AjaxResult PDAAddMaintenanceOrder(@RequestBody BizMaintenanceOrder bizMaintenanceOrder) {
|
|
|
|
{
|
|
|
|
|
|
|
|
String orderNo = orderNoCreate();
|
|
|
|
String orderNo = orderNoCreate();
|
|
|
|
bizMaintenanceOrder.setOrderNo(orderNo);
|
|
|
|
bizMaintenanceOrder.setOrderNo(orderNo);
|
|
|
|
return toAjax(bizMaintenanceOrderService.insertBizMaintenanceOrder(bizMaintenanceOrder));
|
|
|
|
return toAjax(bizMaintenanceOrderService.insertBizMaintenanceOrder(bizMaintenanceOrder));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private IRecordTyreMileageService recordTyreMileageService;
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* PDA保存执行工单的方法
|
|
|
|
* PDA保存执行工单的方法
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param json
|
|
|
|
* @param json
|
|
|
|
* @param files
|
|
|
|
* @param files
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
@ -212,8 +204,7 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
@PostMapping("/PDASaveMaintenanceOrder")
|
|
|
|
@PostMapping("/PDASaveMaintenanceOrder")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public AjaxResult PDASaveMaintenanceOrder(String json, List<MultipartFile> files)
|
|
|
|
public AjaxResult PDASaveMaintenanceOrder(String json, List<MultipartFile> files) {
|
|
|
|
{
|
|
|
|
|
|
|
|
MaintenanceOrderDTO bizMaintenanceOrder = JSONObject.parseObject(json, MaintenanceOrderDTO.class);
|
|
|
|
MaintenanceOrderDTO bizMaintenanceOrder = JSONObject.parseObject(json, MaintenanceOrderDTO.class);
|
|
|
|
// 2. 校验参数
|
|
|
|
// 2. 校验参数
|
|
|
|
if (bizMaintenanceOrder == null || bizMaintenanceOrder.getOrder() == null) {
|
|
|
|
if (bizMaintenanceOrder == null || bizMaintenanceOrder.getOrder() == null) {
|
|
|
|
@ -221,6 +212,12 @@ public class BizMaintenanceOrderController extends BaseController
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BizMaintenanceOrder order = bizMaintenanceOrder.getOrder();
|
|
|
|
BizMaintenanceOrder order = bizMaintenanceOrder.getOrder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BigDecimal inputMileage = order.getInputMileage();
|
|
|
|
|
|
|
|
if (inputMileage == null|| inputMileage.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
|
|
|
|
return error("请输入里程");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Long orderId = order.getOrderId();
|
|
|
|
Long orderId = order.getOrderId();
|
|
|
|
|
|
|
|
|
|
|
|
// 3. 执行更新操作
|
|
|
|
// 3. 执行更新操作
|
|
|
|
|