From 5677ab158fb78d1267c16bbbf29eb690e0b4039f Mon Sep 17 00:00:00 2001
From: qushaowei <qushaowei@163.com>
Date: 星期三, 13 十二月 2023 16:53:39 +0800
Subject: [PATCH] Merge branch 'master' of http://117.34.109.166:18448/r/mdc_430 into develop
---
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java
index 6af60f0..addae2c 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/MaintenanceThreeAcceptanceController.java
@@ -11,14 +11,18 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.eam.entity.DailyMaintenanceOrder;
+import org.jeecg.modules.eam.entity.Equipment;
import org.jeecg.modules.eam.entity.MaintenanceThreeAcceptance;
import org.jeecg.modules.eam.service.IDailyMaintenanceOrderService;
+import org.jeecg.modules.eam.service.IEamEquipmentService;
import org.jeecg.modules.eam.service.IMaintenanceThreeAcceptanceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -58,6 +62,9 @@
@Autowired
private IDailyMaintenanceOrderService dailyMaintenanceOrderService;
+
+ @Autowired
+ private IEamEquipmentService equipmentService;
/**
* 鍒嗛〉鍒楄〃鏌ヨ
@@ -95,6 +102,9 @@
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
String maintenanceOrderId = maintenanceThreeAcceptance.getMaintenanceOrderId();
+ String equipmentId = maintenanceThreeAcceptance.getEquipmentId();
+ String receipts = maintenanceThreeAcceptance.getReceipts();
+ int maintenanceCycle = Integer.parseInt(maintenanceThreeAcceptance.getMaintenanceCycle());
List<MaintenanceThreeAcceptance> maintenanceThreeAcceptances = maintenanceThreeAcceptance.getMaintenanceThreeAcceptances();
String checkStatus = "1";//涓夌骇淇濆吇楠屾敹鐘舵�侊紙1閫氳繃锛�2鏈�氳繃锛�
for (MaintenanceThreeAcceptance threeAcceptance : maintenanceThreeAcceptances) {
@@ -109,15 +119,27 @@
}
DailyMaintenanceOrder maintenanceOrder = dailyMaintenanceOrderService.getById(maintenanceOrderId);
+ if(StringUtils.isBlank(maintenanceOrder.getMaintenanceOrderUda5())){
+ maintenanceOrder.setMaintenanceOrderUda5(receipts);
+ }
maintenanceOrder.setInspectUser(sysUser.getRealname());
maintenanceOrder.setNotPassReason(maintenanceThreeAcceptance.getNotPassReason());
maintenanceOrder.setCheckStatus(checkStatus);
maintenanceOrder.setInspectDate(new Date());
// maintenanceOrder.setStatus("8");
dailyMaintenanceOrderService.updateById(maintenanceOrder);
+
+ if("1".equals(checkStatus)){
+ Equipment equipment = equipmentService.getById(equipmentId);
+ Date dayAfter = DateUtils.getYearAfter(new Date(), maintenanceCycle);
+ equipment.setNextThirdMaintenanceTime(dayAfter);
+ equipment.setThirdMaintenanceTime(new Date());
+ equipmentService.updateById(equipment);
+ }
+
return Result.OK("娣诲姞鎴愬姛锛�");
}
-
+
/**
* 缂栬緫
*
--
Gitblit v1.9.3