From 36d15f189de2e83ce2576715dac30c3c260388dd Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 14:47:50 +0800
Subject: [PATCH] fixconflict

---
 force-app/main/default/classes/LexCancelRemoveBoxController.cls |  560 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 560 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/classes/LexCancelRemoveBoxController.cls b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
index a1d4c44..6e8b89a 100644
--- a/force-app/main/default/classes/LexCancelRemoveBoxController.cls
+++ b/force-app/main/default/classes/LexCancelRemoveBoxController.cls
@@ -1,6 +1,10 @@
 public with sharing class LexCancelRemoveBoxController {
     //缁忛攢鍟嗕骇鍝佸垎绫�
+<<<<<<< HEAD
     public static String agencyProType { get; set; }
+=======
+    public static String agencyProType {get;set;}
+>>>>>>> LEXCommunityLiJun
     public static String userPro_Typestr = null;
     public static String barcode { get; set; }
     /*****************鐢婚潰琛ㄧずBean******************/
@@ -9,32 +13,55 @@
     public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; }
     //鎷嗙洅鏄庣粏
     public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; }
+<<<<<<< HEAD
     public static boolean saveFLGbln { get; set; }
     //閿欒淇℃伅
     public static String alertMessage { get; set; }
     //鎷嗙洅鏄庣粏浠舵暟
     public static Integer getinventorysize() {
+=======
+    public static boolean saveFLGbln {get;set;}
+    //閿欒淇℃伅
+    public static String alertMessage {set;get;}
+    //鎷嗙洅鏄庣粏浠舵暟
+    public static Integer getinventorysize(){
+>>>>>>> LEXCommunityLiJun
         return ConsumableorderdetailsRecordsdummy.size();
     }
     public static Map<String, String> ExistIdMap = new Map<String, String>();
     public static Map<String, String> ErrorIdMap = new Map<String, String>();
     public static Map<String, String> AllMap = new Map<String, String>();
+<<<<<<< HEAD
     public static List<String> BarCodeListP = new List<String>();
     //涓嶇鍚堢殑barcode鍜屽瀷鍙�
     public static list<String> notInlist = new List<String>();
     public static String baseUrl { get; private set; }
+=======
+    public static  List<String> BarCodeListP = new List<String>();
+    //涓嶇鍚堢殑barcode鍜屽瀷鍙�
+    public static list<String> notInlist = new list<String>();
+    public static  String baseUrl {get;private set;}
+>>>>>>> LEXCommunityLiJun
     private static String accountid = null;
     private static String accountName = null;
     //public String[] proidList =new String[]{};
     // 鐧诲綍鑰呭伐浣滃湴
     private static String userWorkLocation;
 
+<<<<<<< HEAD
     public LexCancelRemoveBoxController() {
+=======
+    public LexCancelRemoveBoxController(){
+>>>>>>> LEXCommunityLiJun
         baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
         ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
         ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
         consumableInventory = new List<ConsumableorderdetailsInfo>();
+<<<<<<< HEAD
         saveFLGbln = false;
+=======
+        saveFLGbln = FALSE;
+>>>>>>> LEXCommunityLiJun
     }
 
     @AuraEnabled
@@ -44,6 +71,7 @@
         res.entity = data;
 
         String userId = UserInfo.getUserId();
+<<<<<<< HEAD
         List<user> Useracc = new List<user>();
         Useracc = [
             SELECT accountid, Work_Location__c, UserPro_Type__c
@@ -68,10 +96,29 @@
         data.put('accountName', accountName);
         data.put('userWorkLocation', userWorkLocation);
         data.put('agencyProType', agencyProType);
+=======
+        List<user> Useracc = New List<user>();
+        Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId];
+        accountid = Useracc[0].accountid;
+        userWorkLocation = Useracc[0].Work_Location__c;
+        agencyProType = Useracc[0].UserPro_Type__c;
+        if(String.isBlank(Useracc[0].UserPro_Type__c)){
+            agencyProType = 'ET';
+        }
+        userPro_Typestr = '%' + agencyProType + '%';
+        List<account> accountInfo = [SELECT Name FROM account WHERE id =:accountid];
+        //String view_product = accountInfo[0].view_product__c;
+        accountName = accountInfo[0].Name;
+        //proidList = view_product.split(',');
+        data.put('accountName',accountName);
+        data.put('userWorkLocation',userWorkLocation);
+        data.put('agencyProType',agencyProType);
+>>>>>>> LEXCommunityLiJun
         res.status = 'Success';
         res.code = 200;
         System.debug('res = ' + res);
         return res;
+<<<<<<< HEAD
     }
 
     // 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
@@ -84,6 +131,21 @@
         }
         List<String> outPut = new List<String>();
         for (String B : Buff) {
+=======
+
+    }
+
+    // 灏嗛〉闈㈡垨鍙栧緱BarCode鍘绘帀閲嶅鐨勶紝杞崲鎴怢ist
+    public static List<String> ParseBarCode(String Code){
+        String[] Cache = new String[]{};
+        Cache = Code.split('\n');
+        Set <String> Buff = new Set<String>();
+        for(String A : Cache){
+            Buff.add(A);
+        }
+        List<String> outPut = new List<String>();
+        for(String B :Buff){
+>>>>>>> LEXCommunityLiJun
             B = B.trim();
             outPut.add(B);
         }
@@ -92,6 +154,7 @@
 
     //鑾峰彇鏄庣粏
     @AuraEnabled
+<<<<<<< HEAD
     public static ResponseBodyLWC searchConsumableorderdetails(
         String barcode,
         String accountName,
@@ -100,6 +163,11 @@
     ) {
         ResponseBodyLWC res = new ResponseBodyLWC();
         Map<String, object> data = new Map<String, object>();
+=======
+    public static ResponseBodyLWC searchConsumableorderdetails(String barcode,String accountName,String userWorkLocation,String agencyProType) {
+        ResponseBodyLWC res = new ResponseBodyLWC();
+        Map<String,object> data = new Map<String,object>();
+>>>>>>> LEXCommunityLiJun
         res.entity = data;
         userPro_Typestr = '%' + agencyProType + '%';
         barcode = barcode;
@@ -109,6 +177,7 @@
         ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>();
         ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>();
 
+<<<<<<< HEAD
         notInlist = new List<String>();
         BarCodeListP = ParseBarCode(barcode);
         Consumable_order_details2__c p = new Consumable_order_details2__c();
@@ -121,6 +190,22 @@
         //鍒ゆ柇barcode鏄惁涓虹┖
         if (barcode == null || barcode == '') {
             return new ResponseBodyLWC('Error', 500, '璇疯緭鍏arCode鍙�', '');
+=======
+
+
+        notInlist = new list<String>();
+        BarCodeListP = ParseBarCode(barcode);
+        Consumable_order_details2__c p = new Consumable_order_details2__c();
+        List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>();
+        List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>();
+        List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>();
+        saveFLGbln = FALSE;
+        alertMessage='';
+
+        //鍒ゆ柇barcode鏄惁涓虹┖
+        if(barcode == null || barcode ==''){
+            return new ResponseBodyLWC('Error',500, '璇疯緭鍏arCode鍙�', '');
+>>>>>>> LEXCommunityLiJun
             // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'璇疯緭鍏arCode鍙枫��'));
             // return;
         }
@@ -132,6 +217,7 @@
         // ConsumableorderdetailsRecordsdummy.clear();
 
         // 浜у搧绫诲瀷涓嶅悓
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -172,11 +258,39 @@
                     String str = '璇ュ晢鍝佺被鍨�' + reSet1[i].Product_Type__c + '涓庝骇鍝佺被鍨�' + agencyProType + '涓嶇,涓嶈兘鎷嗙洅';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,Product_Type__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = true
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    AND   Arrive_Owner_Work_Location__c = : userWorkLocation
+                    AND (not Product_Type__c like : userPro_Typestr)
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佺被鍨�'+ reSet1[i].Product_Type__c +'涓庝骇鍝佺被鍨�'+ agencyProType +'涓嶇,涓嶈兘鎷嗙洅';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
         //娌℃湁鎷嗙洅
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -219,11 +333,43 @@
                     String str = '璇ュ晢鍝佹病鏈夋媶鐩�';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                         /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = true
+                    AND  Dealer_Shipment__c= false
+                    AND  Dealer_Saled__c = false
+                    AND  Dealer_Returned__c = false
+                    AND  Lose_Flag__c = false
+                    AND  Box_Piece__c = '鐩�'
+                    //AND  ProductPacking_list_manual__c > 1
+                    AND  Bar_Code__c in :BarCodeListP
+                    AND  Dealer_Info_text__c = :accountName
+                    ORDER BY Name ];  //娌″嚭搴擄紝娌¢攢鍞紝鍦ㄥ簱锛屾病鏈夋媶鐩�
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佹病鏈夋媶鐩�';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
         //宸插嚭璐э紝鏈埌璐�
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -265,11 +411,42 @@
                     String str = '璇ュ晢鍝佽繕鏈埌璐�';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = FALSE
+                    AND  Dealer_Shipment__c= FALSE
+                    AND  Dealer_Saled__c = FALSE
+                    AND  Dealer_Returned__c = false
+                    AND  Lose_Flag__c = false
+                    AND  Box_Piece__c = '鐩�'
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佽繕鏈埌璐�';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
         //鎷嗙洅宸插嚭璐�
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -311,11 +488,42 @@
                     String str = '璇ュ晢鍝佸瓨鍦ㄥ嚭璐у饱鍘�';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Shipment__c = true
+                    AND   Dealer_Arrive__c = true
+                    AND   Dealer_Returned__c = false
+                    AND   Lose_Flag__c = false
+                    AND   Box_Piece__c = '涓�'
+                    AND   RemoveBox_date__c != null
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佸瓨鍦ㄥ嚭璐у饱鍘�';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
         //鎷嗙洅宸查攢鍞�
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -357,11 +565,42 @@
                     String str = '璇ュ晢鍝佸瓨鍦ㄩ攢鍞饱鍘�';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Saled__c = true
+                    AND   Dealer_Arrive__c = true
+                    AND   Dealer_Returned__c = false
+                    AND   Lose_Flag__c = false
+                    AND   Box_Piece__c = '涓�'
+                    AND   RemoveBox_date__c != null
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佸瓨鍦ㄩ攢鍞饱鍘�';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
         //鎷嗙洅杩斿搧
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -401,10 +640,39 @@
                     String str = '璇ュ晢鍝佸瓨鍦ㄨ繑鍝佸饱鍘�';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Returned__c = true
+                    AND   Return_date__c != null
+                    AND   Box_Piece__c = '涓�'
+                    AND   RemoveBox_date__c != null
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佸瓨鍦ㄨ繑鍝佸饱鍘�';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
+<<<<<<< HEAD
         //鎷嗙洅鍚庣洏鐐硅繃(鐩樼偣鏃ユ湡涓嶄负绌�)
         reSet1 = [
             SELECT
@@ -444,11 +712,41 @@
                     String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+
+        //鎷嗙洅鍚庣洏鐐硅繃(鐩樼偣鏃ユ湡涓嶄负绌�)
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Inventory_date__c != null
+                    AND   Box_Piece__c = '涓�'
+                    AND   RemoveBox_date__c != null
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佸瓨鍦ㄧ洏鐐瑰饱鍘�';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
         //涓嶅悓宸ヤ綔鍦�
+<<<<<<< HEAD
         reSet1 = [
             SELECT
                 Id,
@@ -487,10 +785,37 @@
                     String str = '璇ュ晢鍝佸睘浜�' + reSet1[i].Arrive_Owner_Work_Location__c + ',涓嶈兘鍙栨秷鎷嗙洅';
                     ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str));
                     ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c);
+=======
+        reSet1 = [SELECT Id,  Name,Consumable_Product__r.Name__c,
+                        Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c,
+                        Deliver_date__c,Bar_Code__c,
+                        Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c,
+                        recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = true
+                    AND   Bar_Code__c in :BarCodeListP
+                    AND   Dealer_Info_text__c = :accountName
+                    AND   Arrive_Owner_Work_Location__c !=: userWorkLocation
+                    ORDER BY Name ];
+        if(reSet1.size() > 0){
+            for (Integer i = 0; i < reSet1.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }else{
+                    String str = '璇ュ晢鍝佸睘浜�' + reSet1[i].Arrive_Owner_Work_Location__c + ',涓嶈兘鍙栨秷鎷嗙洅';
+                    ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str));
+                    ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
 
+<<<<<<< HEAD
         reSet = [
             SELECT
                 Id,
@@ -542,6 +867,58 @@
                 } else {
                     ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
                     ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c);
+=======
+        reSet = [SELECT Id,
+                        Name,
+                        Intra_Trade_List_RMB__c,
+                        Asset_Model_No__c,
+                        Consumable_Product__c,
+                        Consumable_Product__r.Name,
+                        Consumable_Product__r.Name__c,
+                        Sterilization_limit__c,
+                        Deliver_date__c,
+                        Bar_Code__c,
+                        Arrive_date__c,
+                        Send_Date__c,
+                        Consumable_order_minor__r.Name,
+                        Consumable_order_minor__c,
+                        Dealer_Arrive__c,
+                        Guarantee_period_for_products__c,
+                        CFDA_Status__c,
+                        ProductPacking_list_manual__c,
+                        Report_Product_Approbation__c,
+                        Report_Product_Expiration__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = true
+                    AND Dealer_Shipment__c = false
+                    AND Dealer_Saled__c = false
+                    AND Dealer_Returned__c = false
+                    AND Lose_Flag__c = false
+                    AND Box_Piece__c = '涓�'
+                    AND RemoveBox_date__c != null
+                    AND Bar_Code__c in :BarCodeListP
+                    AND Dealer_Info_text__c = :accountName 
+                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
+                    AND  Product_Type__c like : userPro_Typestr
+                ];
+        if(reSet.size()>0){
+            for (Integer i = 0; i < reSet.size(); i++) {
+                if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){
+                    // 璺宠繃閿欒鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }
+                else if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) ){
+                    // 璺宠繃宸茬粡澶勭悊鐨勬秷鑰楀搧鏄庣粏
+                    continue;
+                }
+                else{
+                    ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i]));
+                    ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c);
+>>>>>>> LEXCommunityLiJun
                 }
             }
         }
@@ -549,6 +926,7 @@
         AllMap.putAll(ExistIdMap);
 
         //寰楀埌涓嶅瓨鍦ㄧ殑BarCode
+<<<<<<< HEAD
         for (Integer i = 0; i < BarCodeListP.size(); i++) {
             if (ExistIdMap.containsKey(BarCodeListP[i])) {
                 continue;
@@ -565,10 +943,29 @@
         data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy));
         data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror));
         data.put('dataSize', ConsumableorderdetailsRecordsdummy.size());
+=======
+        for(Integer i = 0; i < BarCodeListP.size(); i++){
+            if(ExistIdMap.containsKey(BarCodeListP[i])){
+                continue;
+            }else if(ErrorIdMap.containsKey(BarCodeListP[i])){
+                continue;
+            }else{
+                notInlist.add(BarCodeListP[i]);
+            }
+        }
+        if(notInlist.size()>0){
+                // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��'));
+                return new ResponseBodyLWC('Error',500, 'BarCode'+ notInlist + '涓嶅瓨鍦ㄣ��', '');
+        }
+        data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy));
+        data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror));
+        data.put('dataSize',ConsumableorderdetailsRecordsdummy.size());
+>>>>>>> LEXCommunityLiJun
         res.status = 'Success';
         res.code = 200;
         System.debug('res = ' + res);
         return res;
+<<<<<<< HEAD
     }
 
     //鍙栨秷鎷嗙洅纭
@@ -720,6 +1117,150 @@
             return null;
         }
     }
+=======
+
+    }
+
+    //鍙栨秷鎷嗙洅纭
+    @AuraEnabled
+    public static ResponseBodyLWC cancelRemoveBoxConfirm(String saveConsumableorderdetailsRecordsdummy,String accountName,String userWorkLocation,String agencyProType) {
+        ResponseBodyLWC res = new ResponseBodyLWC();
+        Map<String,object> data = new Map<String,object>();
+        res.entity = data;
+
+        userPro_Typestr = '%' + agencyProType + '%';
+        accountName = accountName;
+        userWorkLocation =userWorkLocation;
+        List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class);
+
+
+        List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>();
+        
+        Savepoint sp = Database.setSavepoint();
+        if(ConsumableorderdetailsRecordsdummy.size()<1){
+            // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�'));
+            return new ResponseBodyLWC('Error',500, '涓嶅瓨鍦ㄥ彇娑堟媶鐩掓槑缁�', '');
+            // return null;
+        }
+
+        List<String> BarCodeList = new List<String>();
+        for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy)  {
+            BarCodeList.add(tmp.esd.Bar_Code__c);
+        }
+
+        try{
+            //鍙栧緱閫氱暘澶т簬001鐨勫湪搴撴槑缁�
+            List<Consumable_order_details2__c> orderDetails2del =  [SELECT 
+                        Id,
+                        Box_Piece__c,
+                        RemoveBox_date__c,
+                        RemoveBox_No__c,
+                        Bar_Code__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rentx 2020-10-13 end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = true
+                    AND Dealer_Shipment__c = false
+                    AND Dealer_Saled__c = false
+                    AND Dealer_Returned__c = false
+                    AND Lose_Flag__c = false
+                    AND Box_Piece__c = '涓�'
+                    AND RemoveBox_date__c != null
+                    AND RemoveBox_No__c > 1
+                    AND Bar_Code__c in :BarCodeList
+                    AND Dealer_Info_text__c = :accountName 
+                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
+                    AND  Product_Type__c like : userPro_Typestr
+                ];
+
+            List<Consumable_order_details2__c> orderlistdel = new List<Consumable_order_details2__c>();
+            List<Consumable_order_details2__c> orderlistupd= new List<Consumable_order_details2__c>();
+            
+            for (Consumable_order_details2__c detail2tmp : orderDetails2del) {
+                Consumable_order_details2__c delDetails2 = new Consumable_order_details2__c();
+                delDetails2.Id                           = detail2tmp.Id;
+
+                //鍒犻櫎閫氱暘澶т簬001鐨勬槑缁�2
+                //delete delDetails2;
+                orderlistdel.add(delDetails2);
+            }
+
+            //鍙栧緱閫氱暘001鐨勫湪搴撴槑缁�
+            List<Consumable_order_details2__c> orderDetails2 =  [SELECT 
+                        Id,
+                        Box_Piece__c,
+                        RemoveBox_date__c,
+                        RemoveBox_No__c,
+                        Bar_Code__c,
+                        //add by rentx 2020-10-13 start
+                        ContractNo_text__c
+                        /*,ContractNo__c*/
+                        //add by rebtx 2020-10-13 end
+                    // tcm start
+                    ,Consumable_order_minor__r.ContractNo__c
+                    // tcm end
+                    FROM Consumable_order_details2__c
+                    WHERE Dealer_Arrive__c = true
+                    AND Dealer_Shipment__c = false
+                    AND Dealer_Saled__c = false
+                    AND Dealer_Returned__c = false
+                    AND Lose_Flag__c = false
+                    AND Box_Piece__c = '涓�'
+                    AND RemoveBox_date__c !=null
+                    AND RemoveBox_No__c = 1
+                    AND Bar_Code__c in :BarCodeList
+                    AND Dealer_Info_text__c = :accountName 
+                    AND Arrive_Owner_Work_Location__c =: userWorkLocation
+                    AND  Product_Type__c like : userPro_Typestr
+                ];
+
+            for (Consumable_order_details2__c detail2tmp : orderDetails2) {
+                Consumable_order_details2__c updDetails2 = new Consumable_order_details2__c();
+                updDetails2.Id                           = detail2tmp.Id;
+                updDetails2.Box_Piece__c                 = '鐩�';
+                updDetails2.RemoveBox_date__c            = null;
+                updDetails2.RemoveBox_No__c              = null;
+
+                // tcm start
+                if (String.isBlank(detail2tmp.Consumable_order_minor__r.ContractNo__c)) {
+                    updDetails2.ContractNo_text__c= detail2tmp.ContractNo_text__c;
+                }else {
+                    updDetails2.ContractNo_text__c= detail2tmp.Consumable_order_minor__r.ContractNo__c;
+                }
+                // updDetails2.ContractNo_text__c       = detail2tmp.ContractNo__c;
+                // tcm end
+
+                //閫氱暘001銇儑銉笺偪銇鐞嗗崢浣嶃倰鐩掋伀鎴汇仐銆侀�氱暘銈掋偗銉偄
+                //update updDetails2;
+                orderlistupd.add(updDetails2);
+            }
+
+            if(orderlistdel.size()>0){
+                delete orderlistdel;
+            }
+
+            if(orderlistupd.size()>0){
+                update orderlistupd;
+            }
+            saveFLGbln = true;
+            alertMessage = '鍙栨秷鎷嗙洅瀹屾垚';
+            data.put('saveFLGbln',saveFLGbln);
+            res.status = 'Success';
+            res.code = 200;
+            res.msg = alertMessage;
+            System.debug('res = ' + res);
+            return res;
+            // return null;
+        }catch(Exception e){
+            Database.rollback(sp);
+            ApexPages.addMessages(e);
+            return null;
+        }
+    }
+
+>>>>>>> LEXCommunityLiJun
 
     @TestVisible
     class ConsumableorderdetailsInfo implements Comparable {
@@ -733,6 +1274,7 @@
         //public String tracingCodeNo { get; set; }
         public String oldConsumableCount { get; set; }
         public String ErrorReason { get; set; }
+<<<<<<< HEAD
         public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) {
             esd = e;
             Prod = e.Consumable_Product__r;
@@ -745,6 +1287,20 @@
             oldConsumableCount = e.name;
         }
         /*
+=======
+        public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) {
+            esd                = e;
+            Prod               = e.Consumable_Product__r;
+            oldConsumableCount = e.name;
+            ErrorReason        = str;
+        }
+        public ConsumableorderdetailsInfo(Consumable_order_details2__c e) {
+            esd                = e;
+            Prod               = e.Consumable_Product__r;
+            oldConsumableCount = e.name;
+        }
+/*
+>>>>>>> LEXCommunityLiJun
         public ConsumableorderdetailsInfo(Product2__c e,String barCode,Date sterilizationlimit,String serialNoorLot,String tracingCode) {
             esd = new Consumable_order_details2__c();
             ProductName = e.Name__c;
@@ -770,4 +1326,8 @@
             return null;
         }
     }
+<<<<<<< HEAD
 }
+=======
+}
+>>>>>>> LEXCommunityLiJun

--
Gitblit v1.9.1