| | |
| | | // 修改虚拟合同生成逻辑 gzw 20210324 end |
| | | from Product2 |
| | | where ProductCode_Ext__c in :productCodeList]; |
| | | //修改 OER-SMART 产品不生成虚拟维修合同 |
| | | // and Category5__c = 'OER-SMART' |
| | | Map<String, Product2> prdsMap = new Map<String, Product2>(); |
| | | for (Product2 prd : prdList) { |
| | | prdsMap.put(prd.ProductCode_Ext__c, prd); |
| | |
| | | List<Opportunity> oppList = [Select Id, Purchase_Type__c, Opportunity_No__c, Strategic_department_Class_Name__c, |
| | | Sales_Root__c, SAP_Province__c, Trade__c, Agency1__c, Agency1__r.Name, |
| | | Agency1__r.OCM_man_province_txt__c, Opportunity_Category__c |
| | | // ,SAP_Province__c //20230323 lt DB202303088261 两票制 add |
| | | From Opportunity Where Opportunity_No__c IN :inquiryNoList]; |
| | | // update by gzw 2020-04-27 start |
| | | Map<String, Opportunity> oppMap = new Map<String, Opportunity>(); |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | netProviston : netProviston * Decimal.valueOf(Label.Account_Exc); |
| | | } |
| | | // 20210108 gzw add 虚拟合同号追加 end |
| | | |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | // if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | // delAst.OSHFLG__c = true ; |
| | | // } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | |
| | | // CHAN-BGYE7C end |
| | | // CHAN-BJX9EQ Start |
| | | delAst.NMPA_Approbation_No__c = dnInfo.NMPA_NO; |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | orderdetInfo.Sterilization_limit__c = null; |
| | | }else{ |
| | | orderdetInfo.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | orderdetInfo.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // orderdetInfo.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | | } else { |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | |
| | | ) { |
| | | continue; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | /* 原代码 |
| | | iflog.ErrorLog__c += 'Warning! Asset' + '[' + dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '] Exist. This asset is skipped.\n'; |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | } |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | //astUpdateMap.put(ast.Product_Serial_No__c, ast); |
| | | logstr += dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')' + ' '; |
| | |
| | | ) { |
| | | continue; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | |
| | | //原代码: |
| | |
| | | && Integer.valueOf(dnInfo.ValidTo.substring(0, 4)) <= Integer.valueOf(Date.today().Year())) { |
| | | rac.Sterilization_limit__c = null; |
| | | }else{ |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | } |
| | | // rac.Sterilization_limit__c = NFMUtil.parseStr2Date(dnInfo.ValidTo); |
| | | // gzw DB202301244151 保修期限验证日期可行性调整 end |
| | |
| | | |
| | | if (astsMap.get(ast.Product_Serial_No__c ) == null) { |
| | | ast = new Asset(); |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | logstr += dnInfo.SorLMark == 'S' ? dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo : dnInfo.OTCode + ':' + dnInfo.SerialNoorLotNo + '(' + dnInfo.TracingCode + ')'; |
| | | } else { |
| | |
| | | iflog.ErrorLog__c += 'Warning! Asset' + '[' + errMes + '] Exist. This asset is skipped.\n'; |
| | | continue; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 Start |
| | | if(oppMap.get(InquiryNoStr).SAP_Province__c == 'OSH-安徽省'){ |
| | | ast.OSHFLG__c = true ; |
| | | } |
| | | //20230323 lt DB202303088261 两票制 End |
| | | astList.add(ast); |
| | | // CHAN-BUY3GV end |
| | | // 原代码 |