| | |
| | | // 登录者工作地 |
| | | private static String userWorkLocation; |
| | | public static String agencyProType { get; set; } |
| | | public static String agencyProType1 {get;set;} //lt 20230526 安徽两票制 add |
| | | private static Boolean OSHFLG;//lt 20230517 安徽两票制 add |
| | | public static String methodType { get; set; } |
| | | public static String hospitalName { get; set; } |
| | | public static String hospitalId { get; set; } |
| | |
| | | if (selectedIdMap.containsKey(consumableorderdetailsRecords[i].Prod.Id)) { |
| | | addNo++; |
| | | //continue; |
| | | } else if (consumableorderdetailsRecordsview.size() >= pageLimit + size) { |
| | | break; |
| | | } else { |
| | | } |
| | | // else if (consumableorderdetailsRecordsview.size() >= pageLimit + size) { |
| | | // break; |
| | | // } |
| | | else { |
| | | if (consumableorderdetailsRecords[i].check == false) { |
| | | consumableorderdetailsRecords[i].esd = orderdetails1; |
| | | } |
| | |
| | | consumableorderdetailsRecordsview.add(consumableorderdetailsRecords[i]); |
| | | addNo++; |
| | | } |
| | | if (addNo >= size) |
| | | break; |
| | | // if (addNo >= size) |
| | | // break; |
| | | } |
| | | return consumableorderdetailsRecordsview; |
| | | } |
| | |
| | | } |
| | | userId = UserInfo.getUserId(); |
| | | List<user> Useracc = new List<user>(); |
| | | Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId]; |
| | | //lt 20230517 安徽两票制 add ,OSHFLG__c |
| | | Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c,OSHFLG__c FROM user WHERE id = :userId ]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | | agencyProType1 = Useracc[0].UserPro_Type__c; //lt 20230526 安徽两票制 add |
| | | //lt 20230526 安徽两票制 start |
| | | OSHFLG = Useracc[0].OSHFLG__c; //lt 20230517 安徽两票制 add |
| | | if(OSHFLG){ |
| | | agencyProType1 = 'OSH'; |
| | | } |
| | | else if(String.isBlank(Useracc[0].UserPro_Type__c)){ |
| | | agencyProType1 = 'ET'; |
| | | } |
| | | //lt 20230526 安徽两票制 end |
| | | if (String.isBlank(Useracc[0].UserPro_Type__c)) { |
| | | agencyProType = 'ET'; |
| | | } |
| | |
| | | RecordType.DeveloperName = 'AgencyContract' |
| | | AND Contract_Decide_Start_Date__c <= :dateToday |
| | | AND Contract_Decide_End_Date__c >= :dateToday |
| | | AND Contact_Type__c LIKE :agencyProType |
| | | AND Agent_Ref__c = :accountid |
| | | and Contact_Type__c like :agencyProType1//lt 20230517 安徽两票制 add 1 |
| | | and Agent_Ref__c =:accountid |
| | | and OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | for (Account contract : contractList) { |
| | | contactDealer.add(contract.Id); |
| | |
| | | FROM Account |
| | | WHERE |
| | | ParentId = :accountid |
| | | AND Contact_Type__c LIKE :agencyProType |
| | | AND Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1 |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | if (contract.size() == 1) { |
| | | contractName = contract[0].Name; |
| | |
| | | results.attachmentRecoeds = attachmentRecoeds; |
| | | results.cansee = cansee; |
| | | results.agencyProType = agencyProType; |
| | | results.agencyProType1 = agencyProType1; |
| | | results.OSHFLG = OSHFLG; |
| | | results.userWorkLocation = userWorkLocation; |
| | | results.accountName = accountName; |
| | | results.category_Goods = category_Goods; |
| | |
| | | if (selectedIdMap.containsKey(consumableorderdetailsRecords[i].Prod.Id)) { |
| | | addNo++; |
| | | //continue; |
| | | } else if (consumableorderdetailsRecordsview.size() >= pageLimit + size) { |
| | | break; |
| | | } else { |
| | | } |
| | | // else if (consumableorderdetailsRecordsview.size() >= pageLimit + size) { |
| | | // break; |
| | | // } |
| | | else { |
| | | if (consumableorderdetailsRecords[i].check == false) { |
| | | consumableorderdetailsRecords[i].esd = orderdetails1; |
| | | } |
| | | consumableorderdetailsRecordsview.add(consumableorderdetailsRecords[i]); |
| | | addNo++; |
| | | } |
| | | if (addNo >= size){ |
| | | break; |
| | | } |
| | | // if (addNo >= size){ |
| | | // break; |
| | | // } |
| | | } |
| | | return consumableorderdetailsRecordsview; |
| | | } |
| | |
| | | String consumableorderdetailsRecordsviewStr, |
| | | String contactDealerStr, |
| | | String methodTypeStr, |
| | | String hospitalIdStr |
| | | String hospitalIdStr, |
| | | String contractIdStr, |
| | | String agencyProType1Str, |
| | | Boolean OSHFLGStr |
| | | ) { |
| | | ESetId = ''; |
| | | return save(contractNameStr,cocStr,agencyProTypeStr,accountidStr,consumableorderdetailsRecordsviewStr,contactDealerStr,methodTypeStr,ESetId,hospitalIdStr); |
| | | return save(contractNameStr,cocStr,agencyProTypeStr,accountidStr,consumableorderdetailsRecordsviewStr,contactDealerStr,methodTypeStr,ESetId,hospitalIdStr,contractIdStr,agencyProType1Str,OSHFLGStr); |
| | | } |
| | | |
| | | //保存按钮 |
| | |
| | | String contactDealerStr, |
| | | String methodTypeStr, |
| | | String eSetIdStr, |
| | | String hospitalIdStr |
| | | String hospitalIdStr, |
| | | String contractIdStr, |
| | | String agencyProType1Str, |
| | | Boolean OSHFLGStr |
| | | ){ |
| | | Results results = new Results(); |
| | | errorMsgList = new List<String>(); |
| | |
| | | methodType = methodTypeStr; |
| | | ESetId = eSetIdStr; |
| | | hospitalId = hospitalIdStr; |
| | | contractId = contractIdStr; |
| | | agencyProType1 = agencyProType1Str; |
| | | OSHFLG = OSHFLGStr; |
| | | coc = (Consumable_order__c)JSON.deserialize(cocStr, Consumable_order__c.class); |
| | | contactDealer = (List<String>)JSON.deserialize(contactDealerStr, List<String>.class); |
| | | consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsviewStr, List<ConsumableorderdetailsInfo>.class); |
| | |
| | | FROM account |
| | | WHERE |
| | | Name = :contractName |
| | | AND Id =: contractId //lt 20230517 安徽两票制 add |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND Contact_Type__c LIKE :agencyProType |
| | | AND Agent_Ref__c = :accountid |
| | | AND Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1 |
| | | AND Agent_Ref__c =:accountid |
| | | AND OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | if (contract.size() <= 0) { |
| | | // coc.Order_effective_contact__c.addError('不存在的合同,请重新确认。'); |
| | |
| | | FROM Account |
| | | WHERE |
| | | Name = :contractName |
| | | AND Id =: contractId //lt 20230517 安徽两票制 add |
| | | AND Contact_Type__c like :agencyProType1 //lt 20230517 安徽两票制 add 1 |
| | | AND Contact_Type__c LIKE :agencyProType |
| | | AND Contract_Decide_Start_Date__c <= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND Contract_Decide_End_Date__c >= :Date.Today() |
| | | AND OSH_Dealer__c =: OSHFLG //lt 20230517 安徽两票制 add |
| | | ]; |
| | | if (at.size() > 0 && at[0].Dealer_discount__c != null) { |
| | | disCount = at[0].Dealer_discount__c; |
| | |
| | | public List<String> proLimitAndDate; |
| | | @AuraEnabled |
| | | public Boolean isNoteStay; |
| | | @AuraEnabled |
| | | public Boolean OSHFLG; |
| | | @AuraEnabled |
| | | public String agencyProType1; |
| | | } |
| | | |
| | | public class CusOption { |