|
@@ -47,6 +47,11 @@ public class OrderStateChangeService extends BaseService {
|
|
|
// 更新报警记录状态
|
|
|
for (Object alarmRecord : alarmRecords) {
|
|
|
JSONObject alarmRecordObj = (JSONObject) alarmRecord;
|
|
|
+ // 如果报警记录中工单状态已经为处理完成,不再更新报警
|
|
|
+ if (workOrderDone((Integer) alarmRecordObj.get("orderState"))) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
alarmRecordObj.put("treatState", alarmTreatState);
|
|
|
alarmRecordObj.put("orderState", orderStateMessage.getOrder_state());
|
|
|
alarmRecordObj.put("userId", "system");
|
|
@@ -55,6 +60,36 @@ public class OrderStateChangeService extends BaseService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 判断工单状态是否为已完成
|
|
|
+ *
|
|
|
+ * @param workOrderState
|
|
|
+ * @return boolean
|
|
|
+ * @exception
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/9/14 6:02 下午
|
|
|
+ */
|
|
|
+ private boolean workOrderDone(Integer workOrderState) {
|
|
|
+ if (workOrderState == null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ switch (workOrderState){
|
|
|
+ case 7:
|
|
|
+ case 8:
|
|
|
+ case 9:
|
|
|
+ case 10:
|
|
|
+ return true;
|
|
|
+ default:
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// public static void main(String[] args) {
|
|
|
+// OrderStateChangeService orderStateChangeService = new OrderStateChangeService();
|
|
|
+// boolean b = orderStateChangeService.workOrderDone(8);
|
|
|
+// System.out.println(b);
|
|
|
+// }
|
|
|
+
|
|
|
+ /**
|
|
|
* @description: 根据工单id获取对应的报警记录
|
|
|
* @param: orderId
|
|
|
* @return: JSONArray
|