From 80a3f59e2d3df07805bc67e329300b8de90a5b3a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 11 七月 2023 14:13:08 +0800
Subject: [PATCH] Merge branch 'LEXCommunityLiJun' into LEXUpgrade2023-Deloitte

---
 force-app/main/default/classes/LexArriveGoodsController.cls |  113 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/force-app/main/default/classes/LexArriveGoodsController.cls b/force-app/main/default/classes/LexArriveGoodsController.cls
index b2c79cc..5eeaf1f 100644
--- a/force-app/main/default/classes/LexArriveGoodsController.cls
+++ b/force-app/main/default/classes/LexArriveGoodsController.cls
@@ -1,5 +1,4 @@
 public without sharing class LexArriveGoodsController {
-    
     //鍒濆鍖�
     @AuraEnabled
     public static Results init(String arrType, String eSetId) {
@@ -26,20 +25,20 @@
     public static Results searchProduct(String barcode, String arrControllerStr) {
         Results results = new Results();
         try {
-            System.debug('arrControllerStr:'+arrControllerStr);
-            ArriveGoodsController arrController = (ArriveGoodsController)JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
+            System.debug('arrControllerStr:' + arrControllerStr);
+            ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
             arrController.barcode = barcode;
             arrController.returnError = null;
             arrController.warningList = new List<String>();
             arrController.errorList = new List<String>();
             arrController.SearchPro();
             results.arrGoodCon = JSON.serialize(arrController);
-            if(arrController.returnError != null && arrController.returnError != ''){
+            if (arrController.returnError != null && arrController.returnError != '') {
                 results.result = 'Fail';
                 results.errorMsgList = arrController.errorList;
                 results.warningMsgList = arrController.warningList;
                 results.errorMsg = arrController.returnError;
-            }else {
+            } else {
                 results.coc = arrController.coc;
                 results.saveFLGbln = arrController.saveFLGbln;
                 results.returnFLGbln = arrController.ReturnFLGbln;
@@ -64,57 +63,20 @@
     public static Results arriveGoodsConfim(String arrControllerStr) {
         Results results = new Results();
         try {
-            ArriveGoodsController arrController = (ArriveGoodsController)JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
+            ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
             arrController.returnError = null;
             arrController.warningList = new List<String>();
             arrController.errorList = new List<String>();
             Pagereference page = arrController.ArriveGoodsConfim();
             results.arrGoodCon = JSON.serialize(arrController);
-            if(arrController.returnError != null && arrController.returnError != ''){
+            if (arrController.returnError != null && arrController.returnError != '') {
                 results.result = 'Fail';
                 results.errorMsgList = arrController.errorList;
                 results.warningMsgList = arrController.warningList;
                 results.errorMsg = arrController.returnError;
-            }else {
-                if(arrController.urlType == 'UnabletoEdit'){
-                    results.url = '/lexarrivegsdetails?EsetId='+arrController.arriveId;
-                }
-                results.errorMsgList = arrController.errorList;
-                results.warningMsgList = arrController.warningList;
-                results.result = 'Success';
-            }
-        } catch (Exception e) {
-            results.result = 'Fail';
-            results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
-        }
-        return results;
-    }
-    
-    //鐧诲綍杩斿搧
-    @AuraEnabled
-    public static Results updateGoodsOfReturn(String arrControllerStr, String showGoodsofReturnListStr) {
-        Results results = new Results();
-        try {
-            List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>)JSON.deserialize(showGoodsofReturnListStr, List<ConsumableorderdetailsInfo>.class);
-            ArriveGoodsController arrController = (ArriveGoodsController)JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
-            arrController.ShowGoodsofReturnList = changeType2(showGoodsofReturnList);
-            arrController.returnError = null;
-            arrController.warningList = new List<String>();
-            arrController.errorList = new List<String>();
-            StaticParameter.ConsumableOrderTrigger = true; //Add by Li Jun for bypass ConsumableOrderTrigger 20230616
-            Pagereference page = arrController.UpdateGoodsOfReturn();
-            results.arrGoodCon = JSON.serialize(arrController);
-            if(arrController.returnError != null && arrController.returnError != ''){
-                results.result = 'Fail';
-                results.errorMsgList = arrController.errorList;
-                results.warningMsgList = arrController.warningList;
-                results.errorMsg = arrController.returnError;
-            }else {
-                if(arrController.urlType == 'ToReturnGoodsPage'){
-                    results.url = '/detail/'+arrController.return_Order_id;
-                }
-                if(arrController.urlType == 'ToInventoryGoodsPage'){
-                    results.url = '/detail/'+arrController.inventory_Order_id;
+            } else {
+                if (arrController.urlType == 'UnabletoEdit') {
+                    results.url = '/lexarrivegsdetails?EsetId=' + arrController.arriveId;
                 }
                 results.errorMsgList = arrController.errorList;
                 results.warningMsgList = arrController.warningList;
@@ -127,10 +89,50 @@
         return results;
     }
 
-    public static List<ConsumableorderdetailsInfo> changeType1(List<ArriveGoodsController.ConsumableorderdetailsInfo> conList){
+    //鐧诲綍杩斿搧
+    @AuraEnabled
+    public static Results updateGoodsOfReturn(String arrControllerStr, String showGoodsofReturnListStr) {
+        Results results = new Results();
+        try {
+            List<ConsumableorderdetailsInfo> showGoodsofReturnList = (List<ConsumableorderdetailsInfo>) JSON.deserialize(
+                showGoodsofReturnListStr,
+                List<ConsumableorderdetailsInfo>.class
+            );
+            ArriveGoodsController arrController = (ArriveGoodsController) JSON.deserialize(arrControllerStr, ArriveGoodsController.class);
+            arrController.ShowGoodsofReturnList = changeType2(showGoodsofReturnList);
+            arrController.returnError = null;
+            arrController.warningList = new List<String>();
+            arrController.errorList = new List<String>();
+            StaticParameter.ConsumableOrderTrigger = true; //Add by Li Jun for bypass ConsumableOrderTrigger 20230616
+            Pagereference page = arrController.UpdateGoodsOfReturn();
+            results.arrGoodCon = JSON.serialize(arrController);
+            if (arrController.returnError != null && arrController.returnError != '') {
+                results.result = 'Fail';
+                results.errorMsgList = arrController.errorList;
+                results.warningMsgList = arrController.warningList;
+                results.errorMsg = arrController.returnError;
+            } else {
+                if (arrController.urlType == 'ToReturnGoodsPage') {
+                    results.url = '/detail/' + arrController.return_Order_id;
+                }
+                if (arrController.urlType == 'ToInventoryGoodsPage') {
+                    results.url = '/detail/' + arrController.inventory_Order_id;
+                }
+                results.errorMsgList = arrController.errorList;
+                results.warningMsgList = arrController.warningList;
+                results.result = 'Success';
+            }
+        } catch (Exception e) {
+            results.result = 'Fail';
+            results.errorMsg = e.getLineNumber() + '---' + e.getMessage();
+        }
+        return results;
+    }
+
+    public static List<ConsumableorderdetailsInfo> changeType1(List<ArriveGoodsController.ConsumableorderdetailsInfo> conList) {
         List<ConsumableorderdetailsInfo> conList1 = new List<ConsumableorderdetailsInfo>();
-        if(conList != null){
-            for(ArriveGoodsController.ConsumableorderdetailsInfo con : conList){
+        if (conList != null) {
+            for (ArriveGoodsController.ConsumableorderdetailsInfo con : conList) {
                 ConsumableorderdetailsInfo con1 = new ConsumableorderdetailsInfo();
                 con1.esd = con.esd;
                 con1.Prod = con.Prod;
@@ -153,10 +155,10 @@
         return conList1;
     }
 
-    public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2(List<ConsumableorderdetailsInfo> conList){
+    public static List<ArriveGoodsController.ConsumableorderdetailsInfo> changeType2(List<ConsumableorderdetailsInfo> conList) {
         List<ArriveGoodsController.ConsumableorderdetailsInfo> conList1 = new List<ArriveGoodsController.ConsumableorderdetailsInfo>();
-        if(conList != null){
-            for(ConsumableorderdetailsInfo con : conList){
+        if (conList != null) {
+            for (ConsumableorderdetailsInfo con : conList) {
                 ArriveGoodsController.ConsumableorderdetailsInfo con1 = new ArriveGoodsController.ConsumableorderdetailsInfo();
                 con1.esd = con.esd;
                 con1.Prod = con.Prod;
@@ -244,8 +246,7 @@
         @AuraEnabled
         public String ReportProductExpirationDate { get; set; }
 
-        public ConsumableorderdetailsInfo(){
-
+        public ConsumableorderdetailsInfo() {
         }
 
         // 鎺掑簭
@@ -253,4 +254,4 @@
             return null;
         }
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1