| | |
| | | if (coc.Arrive_Order__c != null) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'无需到货确认,请直接出库。')); |
| | | // return; |
| | | return new ResponseBodyLWC('Error', 500, '无需到货确认,请直接出库。', ''); |
| | | return new ResponseBodyLWC('Error', 500, '无需到货确认,请直接出库', ''); |
| | | } |
| | | //判断barcode是否为空 |
| | | if (barcode == null || barcode == '') { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输BarCode号。')); |
| | | // return; |
| | | return new ResponseBodyLWC('Error', 500, '请输BarCode号。', ''); |
| | | return new ResponseBodyLWC('Error', 500, '请输BarCode号', ''); |
| | | } |
| | | list<String> exitlist = new List<String>(); |
| | | list<String> notexitlist = new List<String>(); |
| | |
| | | |
| | | //BarCodelist做成 |
| | | barCodeListP = ParseBarCode(barcode); |
| | | System.debug('barCodeListP:' + barCodeListP); |
| | | //针对所有商品到货确认 |
| | | reSet1 = [ |
| | | SELECT |
| | |
| | | AND Arrive_Owner_Work_Location__c = :userWorkLocation |
| | | ORDER BY RemoveBox_No__c DESC |
| | | ]; |
| | | System.debug('reSet1:' + reSet1); |
| | | List<Consumable_order_details2__c> newdet2 = new List<Consumable_order_details2__c>(); |
| | | Set<Id> proIds = new Set<Id>(); |
| | | |
| | |
| | | Integer idx = 0; |
| | | for (Consumable_order_details2__c cod2 : reSet1) { |
| | | if (cod2.Bar_Code__c == barcode) { |
| | | System.debug('cod2.Bar_Code__c:' + cod2.Bar_Code__c); |
| | | newdet2.add(cod2); |
| | | reSet1.remove(idx); |
| | | proIds.add(cod2.Consumable_product__c); |
| | |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Consumable_order_minor__r.Arrive_Order__c, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Isoverdue__c, |
| | |
| | | } else if (!checkBarcodeResult.containsKey(newdet2[j].Bar_Code__c)) { |
| | | Matcher n = Pattern.compile('[0-9]').matcher(newdet2[j].TracingCode__c); |
| | | if (n.find()) { |
| | | String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j], str)); |
| | | errorIdMap.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c); |
| | | continue; |
| | | if (newdet2[j].TracingCode__c.length() == 5) { |
| | | String tr = newdet2[j].TracingCode__c; |
| | | String Ctr = tr.substring(tr.length() - 3, tr.length()); |
| | | String Btr = tr.substring(tr.length() - 4, tr.length() - 3); |
| | | String Atr = tr.substring(tr.length() - 5, tr.length() - 4); |
| | | if (Pattern.compile('[0-9]').matcher(Atr).find() || Pattern.compile('[0-9]').matcher(Ctr).find()) { |
| | | String str = '管理编码有误,请检查条形码数据。'; |
| | | consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j], str)); |
| | | errorIdMap.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c); |
| | | continue; |
| | | } |
| | | } |
| | | // String str = '管理编码中有数字,请与管理员确认是否错误。'; |
| | | // consumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(newdet2[j], str)); |
| | | // errorIdMap.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c); |
| | | // continue; |
| | | } |
| | | checkBarcodeResult.put(newdet2[j].Bar_Code__c, newdet2[j].Bar_Code__c); |
| | | consumableorderdetailsRecords.add(new ConsumableorderdetailsInfo(newdet2[j])); |
| | |
| | | // 出货 |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC ProdElivery( |
| | | String ESetId, |
| | | String ESetIdLwc, |
| | | Consumable_order__c cocLwc, |
| | | String barcodeLwc, |
| | | String accountName, |
| | | String userWorkLocation, |
| | | String accountNameLwc, |
| | | String userWorkLocationLwc, |
| | | String consumableorderdetailsRecordsLwc, |
| | | List<Consumable_orderdetails__c> orderdetails, |
| | | Map<String, Decimal> orderpriceMap, |
| | | Map<String, Decimal> orderagencypriceMap |
| | | List<Consumable_orderdetails__c> orderdetailsLwc, |
| | | Map<String, Decimal> orderpriceMapLwc, |
| | | Map<String, Decimal> orderagencypriceMapLwc |
| | | ) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | | ESetId = ESetId; |
| | | ESetId = ESetIdLwc; |
| | | coc = cocLwc; |
| | | barcode = barcodeLwc; |
| | | accountName = accountName; |
| | | userWorkLocation = userWorkLocation; |
| | | accountName = accountNameLwc; |
| | | userWorkLocation = userWorkLocationLwc; |
| | | consumableorderdetailsRecords = (List<ConsumableorderdetailsInfo>) JSON.deserialize( |
| | | consumableorderdetailsRecordsLwc, |
| | | List<ConsumableorderdetailsInfo>.class |
| | | ); |
| | | orderdetails = orderdetails; |
| | | orderpriceMap = orderpriceMap; |
| | | orderdetails = orderdetailsLwc; |
| | | orderpriceMap = orderpriceMapLwc; |
| | | orderagencypriceMap = orderagencypriceMap; |
| | | BarcodeCntMap = new Map<String, Integer>(); |
| | | if (coc.Arrive_Order__r.IsShipment__c == true) { |
| | |
| | | // 销售 |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC ProSale( |
| | | String ESetId, |
| | | String ESetIdLwc, |
| | | Consumable_order__c cocLwc, |
| | | String barcodeLwc, |
| | | String accountName, |
| | | String userWorkLocation, |
| | | String accountNameLwc, |
| | | String userWorkLocationLwc, |
| | | String consumableorderdetailsRecordsLwc, |
| | | List<Consumable_orderdetails__c> orderdetails, |
| | | Map<String, Decimal> orderpriceMap, |
| | | Map<String, Decimal> orderagencypriceMap |
| | | List<Consumable_orderdetails__c> orderdetailsLwc, |
| | | Map<String, Decimal> orderpriceMapLwc, |
| | | Map<String, Decimal> orderagencypriceMapLwc |
| | | ) { |
| | | System.debug('enter ProSale'); |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | res.entity = data; |
| | | |
| | | ESetId = ESetId; |
| | | ESetId = ESetIdLwc; |
| | | coc = cocLwc; |
| | | barcode = barcodeLwc; |
| | | accountName = accountName; |
| | | userWorkLocation = userWorkLocation; |
| | | accountName = accountNameLwc; |
| | | userWorkLocation = userWorkLocationLwc; |
| | | consumableorderdetailsRecords = (List<ConsumableorderdetailsInfo>) JSON.deserialize( |
| | | consumableorderdetailsRecordsLwc, |
| | | List<ConsumableorderdetailsInfo>.class |
| | | ); |
| | | orderdetails = orderdetails; |
| | | orderpriceMap = orderpriceMap; |
| | | orderagencypriceMap = orderagencypriceMap; |
| | | orderdetails = orderdetailsLwc; |
| | | orderpriceMap = orderpriceMapLwc; |
| | | orderagencypriceMap = orderagencypriceMapLwc; |
| | | System.debug('ESetId = ' + ESetId); |
| | | System.debug('coc = ' + coc); |
| | | System.debug('barcode = ' + barcode); |
| | | System.debug('accountName = ' + accountName); |
| | | System.debug('userWorkLocation = ' + userWorkLocation); |
| | | System.debug('consumableorderdetailsRecords = ' + consumableorderdetailsRecords); |
| | | System.debug('orderdetails = ' + orderdetails); |
| | | System.debug('orderpriceMap = ' + orderpriceMap); |
| | | System.debug('orderagencypriceMap = ' + orderagencypriceMap); |
| | | BarcodeCntMap = new Map<String, Integer>(); |
| | | |
| | | if (consumableorderdetailsRecords.size() < 1) { |
| | |
| | | } |
| | | Getconsumableorderdetails2Nobox(); |
| | | |
| | | System.debug('BarcodeCntMap = ' + BarcodeCntMap); |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecords) { |
| | | String key = '' + ass.orderdetails2.Bar_Code__c; |
| | | Integer deliverycnt = BarcodeCntMap.get(key); |
| | |
| | | ) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '请输入产品 '+ ass.Prod.Name +' 的出货数量')); |
| | | // return null; |
| | | System.debug('ass.orderdetails2.Box_Piece__c = ' + ass.orderdetails2.Box_Piece__c); |
| | | System.debug('ass.outboundCount = ' + ass.outboundCount); |
| | | return new ResponseBodyLWC('Error', 500, '请输入产品 ' + ass.Prod.Name + ' 的出货数量', ''); |
| | | } |
| | | if (ass.outboundCount > deliverycnt) { |
| | |
| | | return consumableorderdetails2Nobox.size(); |
| | | } |
| | | |
| | | @TestVisible |
| | | class ConsumableorderdetailsInfo implements Comparable { |
| | | @AuraEnabled |
| | | public Consumable_orderdetails__c orderdetails1 { get; set; } |