| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <aura:component implements="flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes,lightning:isUrlAddressable" access="global" controller="AttachmentDisplayController"> |
| | | <aura:attribute name="DNId" type="String" |
| | | description="用来从父对象接收传递过来的签收单id" |
| | | default=""/> |
| | | <aura:handler name="init" action="{!c.doInit}" value="{!this}" |
| | | description="初始化方法"/> |
| | | <aura:attribute name="currentData" type="Object[]" description="明细页当前显示的明细的信息" /> |
| | | <div> |
| | | <lightning:spinner aura:id="mySpinner" alternativeText='请等待' size="large" class="slds-spinner_container"/> |
| | | </div> |
| | | <div id="allDivs" > |
| | | <div id="ins" style=" width:1150px;margin-right: 4px; "> |
| | | <!-- 显示在明细页的当前明细的表格 --> |
| | | <div id="inTables"> |
| | | <!-- <lightning:card> --> |
| | | <aura:set attribute="title"> |
| | | 进口单证明细 |
| | | </aura:set> |
| | | <table class="slds-table slds-table_cell-buffer slds-table_bordered slds-hint-parent slds-no-row-hover " style="border-collapse: collapse;border-color:#D7D7D7;" border="1px " > |
| | | <thead> |
| | | <tr class="slds-line-height_reset slds-text-title_caps"> |
| | | <!-- 第一列 产品明细 --> |
| | | <!-- <th class="slds-is-resizable" tabindex="-1" data-label="产品明细" scope="row"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width: 120px;text-align: left;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="产品明细" class="slds-truncate" style="padding-bottom: 3px;">产品明细</span> |
| | | </div> |
| | | </span> |
| | | </th> --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="产品明细" scope="row" style="width: 146px;position:static"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: left;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="产品明细" class="slds-truncate" style="padding-bottom: 3px;">产品明细</span> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 第二列 机身编码 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="机身编码" scope="row" style="width: 240px;height: 35px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="机身编码" class="slds-truncate" style="padding-bottom: 3px;">机身编码</span> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 第三列 管理编码 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="管理编码" scope="row" style="width: 240px;height: 35px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="管理编码" class="slds-truncate" style="padding-bottom: 3px;">管理编码</span> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 第四列 预览链接 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="预览链接" scope="row" style="width: 249px;height: 35px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="预览链接" class="slds-truncate" style="padding-bottom: 3px;">预览链接</span> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 第五列 报关单下载链接 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="报关单下载链接" scope="row" style="width: 249px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width: 240px;text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="报关单下载链接" class="slds-truncate" style="padding-bottom: 3px;">报关单下载链接</span> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 第六列 商检证下载链接 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="商检证下载链接" scope="row" style="width: 249px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width: 240px;text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="商检证下载链接" class="slds-truncate" style="padding-bottom: 3px;">商检证下载链接</span> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <aura:if isTrue="{!v.currentData.length > 0}"> |
| | | <tbody> |
| | | <aura:iteration items="{!v.currentData}" var="curr" > |
| | | <tr class="slds-hint-parent"> |
| | | <!-- 行项目 第一列 产品明细--> |
| | | <!-- <th class="slds-is-resizable" tabindex="-1" data-label="DN单号" > |
| | | <span class="slds-grid slds-grid_align-spread" style="width: 140px;height:18px;text-align: left;display:block;border: bottom 1px;"> |
| | | <lightning:formattedText value="{!curr.Name}" style="padding-bottom: 3px;"/> |
| | | </span> |
| | | </th> --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="产品明细" style="width: 146px;height:36px;position:static"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: left;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <lightning:formattedText value="{!curr.ProductName}" style="padding-bottom: 3px;"/> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 行项目 第二列 机身编码--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="机身编码" style="width: 240px;height: 35px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <lightning:formattedText value="{!curr.FrameNo}" style="padding-bottom: 3px;"/> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 行项目 第三列 管理编码--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="管理编码" style="width: 240px;height: 35px;"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <lightning:formattedText value="{!curr.Name}" style="padding-bottom: 3px;"/> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | <!-- 行项目 第四列 预览链接--> |
| | | <aura:if isTrue="{!IF(curr.count ==null,false,true)}"> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="预览链接" style="width: 240px;height: 35px;" rowspan="{!curr.count}"> |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <!-- <lightning:formattedText value="{!curr.Name}" style="padding-bottom: 3px;"/> --> |
| | | <a href="{!curr.code}">预览</a> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | </aura:if> |
| | | <!-- 行项目 第五列 报关单下载链接--> |
| | | <aura:if isTrue="{!IF(curr.count ==null,false,true)}"> |
| | | <aura:if isTrue="{!IF(curr.code !='不出证' ,true,false)}"> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="报关单下载链接" style="width: 249px;" rowspan="{!curr.count}"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width:240px;text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <!-- <lightning:formattedText value="{!curr.code}" style="padding-bottom: 3px;"/> rowspan="{!curr.count}"--> |
| | | <a href="{!curr.code}">下载</a> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | </aura:if> |
| | | <aura:if isTrue="{!IF(curr.code =='不出证' ,true,false)}"> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="报关单下载链接" style="width: 249px;" rowspan="{!curr.count}"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width:240px;text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <lightning:formattedText value="{!curr.code}" style="padding-bottom: 3px;"/> |
| | | <!-- <a href="{!curr.code}">{!curr.code}</a> --> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | </aura:if> |
| | | </aura:if> |
| | | <!-- 行项目 第六列 商检证下载链接--> |
| | | <aura:if isTrue="{!IF(curr.count ==null,false,true)}"> |
| | | <aura:if isTrue="{!IF(curr.sj_code !='不出证' ,true,false)}"> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="商检证下载链接" style="width: 249px;" rowspan="{!curr.count}"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width: 240px;text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <!-- <lightning:formattedText value="{!curr.code}" style="padding-bottom: 3px;"/> --> |
| | | <a href="{!curr.code}">下载</a> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | </aura:if> |
| | | <aura:if isTrue="{!IF(curr.sj_code =='不出证' ,true,false)}"> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="商检证下载链接" style="width: 249px;" rowspan="{!curr.count}"> |
| | | <span class="slds-grid slds-grid_align-spread" style="width: 240px;text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <lightning:formattedText value="{!curr.sj_code}" style="padding-bottom: 3px;"/> |
| | | <!-- <a href="{!curr.code}">下载</a> --> |
| | | </div> |
| | | </span> |
| | | </th> |
| | | </aura:if> |
| | | </aura:if> |
| | | </tr> |
| | | </aura:iteration> |
| | | </tbody> |
| | | </aura:if> |
| | | </table> |
| | | <aura:if isTrue="{!empty(v.currentData)}"> |
| | | <div class="slds-align_absolute-center"> |
| | | No records found |
| | | </div> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <description>A Lightning Component Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <design:component > |
| | | |
| | | </design:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no" ?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E" /> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF" /> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | }, |
| | | doInit : function(cmp, event, helper) { |
| | | // 设置明细页表格的构造 |
| | | helper.getFrameNumManage(cmp); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | // 获取数据 |
| | | getFrameNumManage : function(cmp) { |
| | | debugger |
| | | // this.showSpinner(cmp); |
| | | var action = cmp.get("c.getFrameNumManage"); |
| | | var DNId = cmp.get('v.DNId').toString(); |
| | | action.setParams({ |
| | | 'DNId' : DNId, |
| | | }); |
| | | action.setCallback(this,function(response) { |
| | | var state = response.getState(); |
| | | console.log(state); |
| | | if (state === "SUCCESS") { |
| | | var resultData = response.getReturnValue(); |
| | | cmp.set("v.currentData", resultData); |
| | | this.hideSpinner(cmp); |
| | | }else{ |
| | | cmp.set("v.errorMessage", '加载失败,请重新打开此页面!'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | showSpinner: function(cmp) { |
| | | debugger |
| | | var spinner = cmp.find("mySpinner"); |
| | | $A.util.removeClass(spinner, "slds-hide"); |
| | | }, |
| | | hideSpinner: function(cmp) { |
| | | var spinner = cmp.find("mySpinner"); |
| | | $A.util.addClass(spinner, "slds-hide"); |
| | | }, |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:event type="APPLICATION" description="Event template" /> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>DESCRIPTION</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:component extensible="true" abstract="true" |
| | | implements="force:hasRecordId,force:lightningQuickActionWithoutHeader" |
| | | controller="LCC_JSMQueryResultService"> |
| | | <aura:attribute name="recordId" type="Id" /> |
| | | <aura:attribute name="sObjectInfo" type="Object" /> |
| | | <aura:attribute name="simpleRecord" type="Object"/> |
| | | <aura:attribute name="recordError" type="String"/> |
| | | <aura:attribute name="isAdditionalObject" type="Boolean" default="false"/> |
| | | |
| | | <!-- For loading additional objects --> |
| | | <aura:handler name="init" value="{!this}" action="{!c.loadCurrentObject}"/> |
| | | |
| | | <!--attributes for global variables--> |
| | | <aura:attribute name="User" type="LCC_JSMUserInfo" /> |
| | | <aura:attribute name="Profile" type="Profile" /> |
| | | <aura:attribute name="Site" type="LCC_JSMSiteInfo" /> |
| | | |
| | | <!-- register the events to fire --> |
| | | <aura:registerEvent name="GenericApplicationEvent" type="c:LCC_GenericApplicationEvent"/> |
| | | <aura:registerEvent name="QueryApplicationEvent" type="c:LCC_QueryApplicationEvent"/> |
| | | |
| | | <!-- Style for Lightning alerts modal in quick actions --> |
| | | <aura:html tag="style"> |
| | | .cuf-content { |
| | | padding: 0 0rem !important; |
| | | } |
| | | .slds-p-around--medium { |
| | | padding: 0rem !important; |
| | | } |
| | | .slds-modal__content{ |
| | | overflow-y:hidden !important; |
| | | height:unset !important; |
| | | max-height:unset !important; |
| | | } |
| | | </aura:html> |
| | | |
| | | <aura:if isTrue="{!not(v.isAdditionalObject)}"> |
| | | <force:recordData aura:id="recordLoader" |
| | | recordId="{!v.recordId}" |
| | | layoutType="FULL" |
| | | targetRecord="{!v.simpleRecord}" |
| | | targetFields="{!v.sObjectInfo}" |
| | | targetError="{!v.recordError}" |
| | | recordUpdated="{!c.handleRecordUpdated}"/> |
| | | </aura:if> |
| | | |
| | | <aura:attribute name="partially" type="Boolean" default="false"/> |
| | | <aura:renderIf isTrue="{!v.partially}"> |
| | | <div class="slds-m-horizontal--xx-large slds-m-top_xx-large slds-text-align_center"> |
| | | <lightning:icon iconName="utility:warning" size="large"/> |
| | | </div> |
| | | <div class="slds-m-around--x-large slds-text-align_center slds-text-heading_small"> |
| | | <p>This Js Button has been partially migrated. Contact with your System Administrator to review the functionality.</p> |
| | | </div> |
| | | </aura:renderIf> |
| | | <!-- body of sub components --> |
| | | {!v.body} |
| | | |
| | | <!-- Display Lightning Data Service errors, if any --> |
| | | <aura:if isTrue="{!not(empty(v.recordError))}"> |
| | | <div class="recordError"> |
| | | <ui:message title="Error" severity="error" closable="true"> |
| | | {!v.recordError} |
| | | </ui:message> |
| | | </div> |
| | | </aura:if> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>DESCRIPTION</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | @media (min-width: 1024px){ |
| | | |
| | | .THIS.slds-modal__content{ |
| | | height: 160px; |
| | | } |
| | | |
| | | .THIS.slds-modal__footer{ |
| | | margin: 15px -32px -15px -32px; |
| | | } |
| | | |
| | | } |
| | | |
| | | @media (min-width: 798px) and (max-width: 1024px){ |
| | | |
| | | .THIS.slds-modal__content{ |
| | | height: 160px; |
| | | } |
| | | |
| | | .THIS.slds-modal__footer{ |
| | | margin: 15px -32px -15px -32px; |
| | | } |
| | | |
| | | } |
| | | |
| | | @media (min-width: 768px) and (max-width: 797px){ |
| | | |
| | | .THIS.slds-modal__content{ |
| | | height: 160px; |
| | | } |
| | | |
| | | .THIS.slds-modal__footer{ |
| | | margin: 15px -32px -15px -32px; |
| | | } |
| | | |
| | | } |
| | | |
| | | @media (min-width: 463px) and (max-width: 767px){ |
| | | |
| | | .THIS.slds-modal__content{ |
| | | height: 160px; |
| | | } |
| | | |
| | | .THIS.slds-modal__footer{ |
| | | margin: 15px -32px -15px -32px; |
| | | } |
| | | |
| | | } |
| | | |
| | | @media (min-width: 400px) and (max-width: 462px){ |
| | | |
| | | .THIS.slds-modal__content{ |
| | | height: 160px; |
| | | } |
| | | |
| | | .THIS.slds-modal__footer{ |
| | | margin: 15px -32px -15px -32px; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | ({ |
| | | |
| | | handleRecordUpdated: function(component, event, helper) { |
| | | var eventParams = event.getParams(); |
| | | if(eventParams.changeType === "LOADED") { |
| | | // record is loaded (render other component which needs record data value) |
| | | console.log("Record is loaded successfully."); |
| | | helper.loadUserInfo(component, function(){ |
| | | helper.loadProfileInfo(component, function(){ |
| | | helper.loadSiteInfo(component, function(){ |
| | | var appEvent = $A.get("e.c:LCC_GenericApplicationEvent") |
| | | appEvent.fire(); |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | } else if(eventParams.changeType === "ERROR") { |
| | | //there’s an error while loading, saving, or deleting the record |
| | | console.error("Can't load the record."); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "Can't load the record.", |
| | | "duration": 10000, |
| | | "type": "error", |
| | | "message": "Can't load the record." |
| | | }); |
| | | toastEvent.fire(); |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | } |
| | | }, |
| | | |
| | | // For loading additional objects not supported by <force:recordData> |
| | | loadCurrentObject : function(component, event, helper) { |
| | | if(component.get('v.isAdditionalObject')) { |
| | | helper.loadAdditionalObject(component, event); |
| | | } |
| | | }, |
| | | |
| | | //for Hide/Close Model,set the "isOpen" attribute to "false" |
| | | closeModel: function(component, event, helper) { |
| | | component.set("v.isOpen", false); |
| | | }, |
| | | |
| | | // set set the "isOpen" attribute to "false for close the model Box. |
| | | okClose: function(component, event, helper) { |
| | | component.set("v.isOpen", false); |
| | | }, |
| | | }) |
| New file |
| | |
| | | ({ |
| | | //use this method to keep the “alert” functionality |
| | | showToast : function(message, type) { |
| | | console.log(type); |
| | | if(type === undefined || type === ""){ |
| | | type = "info"; |
| | | } |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "", |
| | | "type": type, |
| | | "duration": 10000, |
| | | "message": message |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | //use this method to load user info in order to replace the global variable $User |
| | | loadUserInfo : function(component,callback){ |
| | | //Call Your Apex Controller Method. |
| | | var action = component.get("c.getUserInfo"); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | console.log("User info is loaded successfully."); |
| | | component.set("v.User",response.getReturnValue()); |
| | | callback(); |
| | | } else { |
| | | //Do Something |
| | | } |
| | | }); |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | //use this method to load profile info in order to replace the global variable $Profile |
| | | loadProfileInfo : function(component, callback){ |
| | | //Call Your Apex Controller Method. |
| | | var action = component.get("c.getProfileInfo"); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | console.log("Profile is loaded successfully."); |
| | | component.set("v.Profile",response.getReturnValue()); |
| | | callback(); |
| | | } else { |
| | | //Do Something |
| | | } |
| | | }); |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | //use this method to load site info in order to replace the global variable $Site |
| | | loadSiteInfo : function(component,callback){ |
| | | //Call Your Apex Controller Method. |
| | | var action = component.get("c.getSiteInfo"); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | console.log("Site is loaded successfully."); |
| | | component.set("v.Site",response.getReturnValue()); |
| | | callback(); |
| | | } else { |
| | | //Do Something |
| | | } |
| | | }); |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | //use this method to execute a query |
| | | executeQuery : function(component, event, helper, query) { |
| | | |
| | | |
| | | var action = component.get("c.executeQuery"); |
| | | action.setParams({ |
| | | "theQuery": query |
| | | }); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | |
| | | var state = response.getState(); |
| | | |
| | | if(state == "SUCCESS" && component.isValid()){ |
| | | var queryResult = response.getReturnValue(); |
| | | component.set("v.queryResult", queryResult); |
| | | var appEvent = $A.get("e.c:LCC_QueryApplicationEvent"); |
| | | appEvent.fire(); |
| | | } |
| | | else{ |
| | | console.error("fail:" + response.getError()[0].message); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "Error", |
| | | "duration": 10000, |
| | | "type": "error", |
| | | "message": "Something went wrong in your org: " + response.getError()[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | // For loading additional objects not supported by <force:recordData> |
| | | loadAdditionalObject: function(component, event) { |
| | | var action = component.get("c.loadObjectInfoById"); |
| | | action.setParams({ |
| | | "recordId": component.get("v.recordId") |
| | | }); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | |
| | | if(state == "SUCCESS" && component.isValid()){ |
| | | component.set("v.sObjectInfo", response.getReturnValue()); |
| | | } else { |
| | | console.error("Error loading object: " + response.getError()[0].message); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "Error", |
| | | "duration": 10000, |
| | | "type": "error", |
| | | "message": "Something went wrong: " + response.getError()[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | // for Display Model,set the "isOpen" attribute to "true" |
| | | openModel: function(component, event, helper,text) { |
| | | component.set("v.promptText", text); |
| | | component.set("v.isOpen", true); |
| | | |
| | | }, |
| | | |
| | | // for Display Model,set the "isOpenAlert" attribute to "true" |
| | | openModelAlert: function(component, event, helper,text) { |
| | | component.set("v.alertText", text); |
| | | component.set("v.isOpenAlert", true); |
| | | |
| | | }, |
| | | |
| | | // for display alerts inside lightning modal popup |
| | | showTextAlert: function(component, text) { |
| | | component.set("v.alertText", text); |
| | | component.set("v.showAlert", true); |
| | | }, |
| | | |
| | | //for navigate to another url |
| | | gotoURL : function (component, urlToNavigate) { |
| | | var urlEvent = $A.get("e.force:navigateToURL"); |
| | | urlEvent.setParams({"url": urlToNavigate}); |
| | | urlEvent.fire(); |
| | | }, |
| | | |
| | | idTruncate : function (str) { |
| | | if (str != null && str.length > 15) { |
| | | return str.substring(0, 15); |
| | | } else { |
| | | return str; |
| | | } |
| | | }, |
| | | |
| | | cloneli : function (oldOppId, newOppId, component){ |
| | | //Call Your Apex Controller Method. |
| | | var action = component.get("c.cloneOpportunityLineItems"); |
| | | |
| | | action.setParams({ |
| | | "oldOppId": oldOppId, |
| | | "newOppId": newOppId |
| | | }); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | console.log("LI cloned successfully."); |
| | | |
| | | } else { |
| | | //Do Something |
| | | } |
| | | }); |
| | | |
| | | $A.enqueueAction(action); |
| | | } |
| | | |
| | | }) |
| New file |
| | |
| | | <aura:event type="APPLICATION" description="Event template" /> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>DESCRIPTION</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:component extends="c:LCC_GenericLightningComponent" > |
| | | <aura:set attribute="partially" value="false"></aura:set> |
| | | <aura:set attribute="isAdditionalObject" value="false"></aura:set> |
| | | |
| | | <!-- User Interface --> |
| | | <div> |
| | | <div class="slds-scrollable slds-p-around_medium slds-text-heading_small" id="modal-content-id-1"> |
| | | <p class="slds-hyphenate"><a style="outline: 0;" href="https://github.com/developerforce/LEXComponentsBundle" target="_blank">Sample Lightning Component Action</a></p> |
| | | <br/> |
| | | </div> |
| | | <footer class="slds-modal__footer"> |
| | | <lightning:button class="slds-button_brand" onclick="{!c.accept}" label="Accept"/> |
| | | </footer> |
| | | </div> |
| | | |
| | | <!-- The height of the modal is defined in Salesforce, when you create the new action. --> |
| | | <!-- Recommended height size: 250px --> |
| | | |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>DESCRIPTION</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | ({ |
| | | accept : function(component, event, helper) { |
| | | $A.get("e.force:closeQuickAction").fire(); |
| | | } |
| | | }) |
| | |
| | | <lightning:layoutItem size="7"> |
| | | <ui:inputText label="请输入客户姓名" class="field" value="{!v.searchKeyWord}"/> |
| | | </lightning:layoutItem> |
| | | <lightning:layoutItem size="1" class = "searchButton"> |
| | | <lightning:layoutItem size="2" class = "searchButton"> |
| | | <ui:button aura:id="button" buttonTitle="Click to see agency contact" class="button" label="搜索" press="{!c.searchAgencyContact}" disabled="false"/> |
| | | </lightning:layoutItem> |
| | | <lightning:layoutItem size="4" class = "searchButton"> |
| | | <lightning:layoutItem size="3" class = "searchButton"> |
| | | <ui:button aura:id="newAgencyContact" buttonTitle="Click to see agency contact" class="newAgencyContact" label="新建.客户人员" disabled="false" press="{!c.showNewAgency}"/> |
| | | </lightning:layoutItem> |
| | | </lightning:layout> |
| | |
| | | |
| | | doInit : function(component, event, helper) { |
| | | let rid = component.get('v.recordId'); |
| | | let isClone = component.get('v.isClone'); |
| | | if(!rid || isClone){ |
| | | component.set('v.title',$A.get("$Label.c.New")+'经销商询价'); |
| | | }else{ |
| | | component.set('v.title',$A.get("$Label.c.Edit")+'经销商询价'); |
| | | let pid = null; |
| | | if(!rid){ |
| | | pid = window.location.href.replace("https://","").split("/")[4]; |
| | | } |
| | | |
| | | let record_type_id = ''; |
| | |
| | | if(!record_type_id && pageref){ |
| | | record_type_id = pageref.state.recordTypeId ? pageref.state.recordTypeId : ''; |
| | | } |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | if(!rid || isClone){ |
| | | component.set('v.title',$A.get("$Label.c.New")+'经销商询价'); |
| | | component.set("v.recordTypeId", record_type_id); |
| | | }else{ |
| | | component.set('v.title',$A.get("$Label.c.Edit")+'经销商询价'); |
| | | } |
| | | console.log('rid: ' + rid); |
| | | // console.log('pid: ' + pid); |
| | | console.log('pid: ' + pid); |
| | | console.log('record_type_id: ' + record_type_id); |
| | | component.set("v.recordTypeId", record_type_id); |
| | | component.set("v.showSpinner", true); |
| | | helper.CallBackAction(component,'Init',{ |
| | | rid : rid, |
| | | // pid : pid, |
| | | pid : pid, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id : record_type_id |
| | | },function(data){ |
| | |
| | | helper.preparePayloadForSearchAgencyContact(component, event, helper); |
| | | }, |
| | | initContactTable : function(component, event, helper){ |
| | | let cols = ['Name','AgencyHospital', 'DepartmentClass', 'DoctorDivision1','Type']; |
| | | let cols = ['Name','AgencyHospital', 'DoctorDivision1','Type']; |
| | | let contactInfoList = []; |
| | | let awsDataIds = []; |
| | | let data = component.get('v.result'); |
| | |
| | | let tableBody = document.createElement('TBODY'); |
| | | table.appendChild(tableBody); |
| | | let headerTR = document.createElement('TR'); |
| | | let colsHeader = ['姓名','经销商医院', '医生区分(职务)','分类']; |
| | | let colsHeader = ['姓名','医院', '医生区分(职务)','分类']; |
| | | tableBody.appendChild(headerTR); |
| | | for (let i = 0; i < colsHeader.length; i++) { |
| | | let td = document.createElement('TH'); |
| | |
| | | preparePayloadForSearchAgencyContact : function(component, event, helper){ |
| | | let that = this; |
| | | let agencyHospitalId = ''; |
| | | let accountId = ''; |
| | | let layout = component.get('v.layout'); |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | agencyHospitalId = item.value; |
| | | } |
| | | if(item.field == 'Account_Opp__c'){ |
| | | accountId = item.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var action = component.get('c.getAWSDataIds'); |
| | | action.setParams({ |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | let contactInfo = new Object(); |
| | | //需要修改 |
| | | contactInfo.Name = data.object[i].name; |
| | | contactInfo.AgencyHospital = ''; |
| | | contactInfo.DoctorDivision1 = data.object[i].doctorDivision1; |
| | | contactInfo.AWSDataId = data.object[i].dataId; |
| | | contactInfo.Type = data.object[i].type; |
| | |
| | | var searchAgencyContacts = component.get('c.searchAgencyContacts'); |
| | | searchAgencyContacts.setParams({ |
| | | "awsAgencyContactIds" : JSON.stringify(awsDataIds), |
| | | "accountId" : agencyHospitalId |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | searchAgencyContacts.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | let contactFromSF = contactsInfo[contactInfoList[i]['AWSDataId']]; |
| | | if(contactFromSF){ |
| | | contactInfoList[i].sfRecordId = contactFromSF['Id']; |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Agency_Hospital__r']['Name']; |
| | | if(contactFromSF['Agency_Hospital__r']){ |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Agency_Hospital__r']['Name']; |
| | | } |
| | | if(contactFromSF['Department_Class__r']){ |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Department_Class__r']['Parent']['Name']; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="save_button_area"> |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" |
| | | onclick="{!c.createCancel}" /> |
| | | <lightning:button class="slds-m-top_small" type="button" label="新建" |
| | | <lightning:button class="slds-m-top_small" type="button" label="保存" |
| | | onclick="{!c.handleSubmit}" /> |
| | | </div> |
| | | </lightning:recordEditForm> |
| | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | // fy 调用pi改造的 获取.客户人员的方法 |
| | | search_core : function(token,searchUrl,payload,callback,component) { |
| | | search_core: function (token, searchUrl, payload, callback, component) { |
| | | console.log('searchUrl = ' + searchUrl); |
| | | fetch(searchUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | component.set('v.login',false); |
| | | if(callback)callback(result); |
| | | }).catch(error => { |
| | | console.log('AWS search error = ' + JSON.stringify(error)); |
| | | component.set('v.errorMessage', 'AWS search error.'); |
| | | this.showErrorToast01(component); |
| | | component.set('v.login',false); |
| New file |
| | |
| | | <aura:application access="public" extends="ltng:outApp"> |
| | | <aura:dependency resource="c:TenderLostApp"/> |
| | | </aura:application> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <description>A Lightning Application Bundle</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:documentation> |
| | | <aura:description>Documentation</aura:description> |
| | | <aura:example name="ExampleName" ref="exampleComponentName" label="Label"> |
| | | Example Description |
| | | </aura:example> |
| | | </aura:documentation> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| | | <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> |
| | | <path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/> |
| | | <path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/> |
| | | </g> |
| | | </svg> |
| New file |
| | |
| | | ({ |
| | | myAction : function(component, event, helper) { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | helperMethod : function() { |
| | | |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| | |
| | | <br/> |
| | | <div class="save_button_area"> |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" onclick="{!c.createCancel}"/> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="新建" /> |
| | | <lightning:button class="slds-m-top_small" type="submit" label="保存" /> |
| | | </div> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status1 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | b = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status2 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | |
| | | b1 = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status3 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | |
| | | var reports = component.get('v.reports'); |
| | | var Agency_Hospital_text = ''; |
| | | var Agency_Hospital_parent_id = ''; |
| | | |
| | | debugger |
| | | // 医院名 |
| | | if (select_data['Agency_Hospital__c'] != '') { |
| | | for (var i = 0; i < reports.length; i++) { |
| | |
| | | component.set('v.hospitalLinkId', hospital_data[i].Id); |
| | | component.set('v.data.Agency_Hospital__c', hospital_data[i].Id); |
| | | component.find('new_con').set('v.disabled', false); |
| | | //break; |
| | | } |
| | | } |
| | | component.set("v.hospital", accname); |
| | |
| | | if(result.status == '0'){ |
| | | this.to_doctor_list(result,retMap,component); |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status4 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | // }, |
| | | |
| | | opportunityChange : function(component, event, helper) { |
| | | debugger |
| | | var opp_id = component.get('v.data.Opportunity__c'); |
| | | if (opp_id == '') { |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | |
| | | // } |
| | | component.set('v.login',false); |
| | | return false; |
| | | } else if (res[0]['StageName2__c'] != '3.询价' && !component.get('v.loadOpp')){ |
| | | this.warning('请选择询价中的项目'); |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // } else { |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | component.set('v.login',false); |
| | | return false; |
| | | } else { |
| | | } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy start |
| | | // else if (res[0]['StageName2__c'] != '3.询价' && !component.get('v.loadOpp')){ |
| | | // this.warning('请选择询价中的项目'); |
| | | // // ToDo需要测试手机上能运行不 |
| | | // component.set('v.data.Opportunity__c', ''); |
| | | // $A.util.addClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | // $A.util.addClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | // $A.util.addClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | // $A.util.addClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | // $A.util.removeClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | // // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // // var values = []; |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // // } else { |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // // } |
| | | // component.set('v.login',false); |
| | | // return false; |
| | | // } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy end |
| | | else { |
| | | component.set('v.loadOpp', false); |
| | | component.set('v.oppdata',res[0]); |
| | | this.set_selected(component, 'select_stageName', res[0].StageName__c); |
| | |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | }, |
| | | setOpportunity_cfilter : function(component) { |
| | | debugger |
| | | var hosId = component.get('v.hospitalId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var opportunity_cfilter = ''; |
| | |
| | | component.set('v.login',true); |
| | | this.saveRecordsEditFile(component,dataMap,result.object,helper); |
| | | }else{ |
| | | this.error('AWS search status ' ); |
| | | this.error('AWS search status5 ' ); |
| | | component.set('v.login',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status : ' + result.status); |
| | | this.error('AWS search status6 : ' + result.status); |
| | | component.set('v.login',false); |
| | | } |
| | | },component); |
| | |
| | | <aura:attribute name="buttonGroup" type="Boolean" default="false" /> |
| | | <aura:attribute name="eSignForm" type="object" /> |
| | | <aura:attribute name="DNName" type="string" default="" /> |
| | | <!-- 进口单证 fy start --> |
| | | <aura:attribute name="DNId" type="string" default="" /> |
| | | <!-- 进口单证 fy end --> |
| | | <aura:attribute name="errorMessage" type="String" description="失败消息" /> |
| | | <!-- 判断直销还是分销 --> |
| | | <aura:attribute name="isDirectSales" type="Boolean" default="" description="判断直销还是分销" /> |
| | |
| | | <aura:attribute name="QRWidth" type="String" description="用来从父对象接收传递过来的屏幕宽度" default="" /> |
| | | <aura:attribute name="QRHeight" type="String" description="用来从父对象接收传递过来的屏幕宽度" default="" /> |
| | | <aura:attribute name="ShowDNNameQR" type="String" description="判断返回是否可以打印" default="" /> |
| | | <aura:attribute name="AttachmentDisplayflag" type="boolean" default="false" /> |
| | | |
| | | <!-- 返回首页 start --> |
| | | <aura:attribute name="agencyDNSignUpStatus" type="String" default="" description="DN签收状态(经销商)" /> |
| | |
| | | |
| | | |
| | | </th> |
| | | <!-- 第七列 附件名 fy--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="附件名1" scope="row" style="width: 110px;height: 35px;"> |
| | | <!-- 第七列 进口单证明细 fy--> |
| | | <!-- 进口单证 fy start --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="进口单证明细" scope="row" style="width: 110px;height: 35px;"> |
| | | |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <span title="附件名1" class="slds-truncate" style="padding-bottom: 3px;">附件名1</span> |
| | | <span title="进口单证明细" class="slds-truncate" style="padding-bottom: 3px;">进口单证明细</span> |
| | | |
| | | |
| | | </div> |
| | |
| | | |
| | | |
| | | </th> |
| | | <!-- 进口单证 fy end --> |
| | | <!-- 第七列 二维码 --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="医院签收二维码" scope="row" style="width: 140px;height: 35px;text-align: center;"> |
| | | |
| | |
| | | |
| | | |
| | | </th> |
| | | <!-- 行项目 第四列 附件名 fy--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="附件名1" scope="row"> |
| | | <!-- 行项目 第四列 进口单证明细 fy--> |
| | | <!-- 进口单证 fy start --> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="进口单证明细" scope="row"> |
| | | |
| | | <span class="slds-grid slds-grid_align-spread" style="text-align: center;display:block;"> |
| | | <div class="slds-truncate"> |
| | | <!-- <lightning:formattedText value="{!curr.AttachmentName}" /> --> |
| | | <a href="https://sfpi-mebg-test.olympuschina.com:8081/stg/api/file/preview?key=20220419/8cf583ab71c94eee96da7bbfcc1b376b.html">附件名1</a> |
| | | <!-- <a href="https://sfpi-mebg-test.olympuschina.com:8081/stg/api/file/preview?key=20220419/8cf583ab71c94eee96da7bbfcc1b376b.html">附件名1</a> --> |
| | | <button tabindex="-1" class="slds-button ReturnButton" style="width: 40px;" name="{!curr.Id}" onclick="{!c.showAttachmentDisplay}">查看</button> |
| | | <!-- <a onclick="{!c.showAttachmentDisplay}">查看</a> --> |
| | | <!-- <a href="https://ocsm stagefull.sandbox.file.force.com/servlet/servlet.FileDownload?file=00P1000001QkhvQ">{!curr.AttachmentName}</a> --> |
| | | |
| | | </div> |
| | | </span> |
| | | |
| | | |
| | | |
| | | </th> |
| | | <!-- 进口单证 fy end --> |
| | | <!-- 行项目 第七列 医院签收二维码--> |
| | | <th class="slds-is-resizable" tabindex="-1" data-label="" scope="row" style="text-align: center;"> |
| | | |
| | | <button id="{!curr.skip_Hospital_Sign__c}" tabindex="-1" class="slds-button ReturnButton" name="{!curr.DNNameNo0__c}" style="width: 40px;" value="{!IF(curr.skip_Distribution_Sign__c, 'true', curr.agencySignUpDate__c)}" onclick="{!c.showESignQR}">查看</button> |
| | | <button id="{!curr.skip_Hospital_Sign__c}" tabindex="-1" class="slds-button ReturnButton" name="{!curr.DNNameNo0__c}" style="width: 40px;" value="{!IF(curr.skip_Distribution_Sign__c, 'true', curr.agencySignUpDate__c)}" onclick="{!c.showESignQR}">查看 |
| | | </button> |
| | | |
| | | |
| | | </th> |
| | |
| | | </aura:if> |
| | | |
| | | <!-- </div> --> |
| | | <!-- 进口单证 fy start --> |
| | | <aura:if isTrue="{!v.AttachmentDisplayflag}"> |
| | | <!-- 医院确认 --> |
| | | <label style="float: left;font-size:20px">进口单证明细</label> |
| | | <lightning:button variant="neutral" label="返回" title="Cancel" onclick="{! c.rebackDNListPage }" /> |
| | | <!-- <lightning:button variant="neutral" onclick="{!c.rebackDNListPage}">返回</button> --> |
| | | <c:AttachmentDisplay DNId="{!v.DNId}" /> |
| | | |
| | | </aura:if> |
| | | <!-- 进口单证 fy end --> |
| | | </aura:component> |
| | |
| | | * @Description: |
| | | * @Author: wql |
| | | * @Date: 2021-05-24 09:45:19 |
| | | * @LastEditTime: 2021-08-03 15:44:33 |
| | | * @LastEditors: |
| | | * @LastEditTime: 2022-11-07 17:40:15 |
| | | * @LastEditors: Thhto 997058689@qq.com |
| | | */ |
| | | ({ |
| | | init: function(cmp, event, helper) { |
| | |
| | | }, |
| | | testIn: function(cmp, event, helper) { |
| | | helper.testIn(cmp, event); |
| | | }, |
| | | // 进口单证 fy start |
| | | showAttachmentDisplay: function(cmp, event, helper) { |
| | | helper.showAttachmentDisplay(cmp, event); |
| | | }, |
| | | rebackDNListPage: function(cmp, event, helper) { |
| | | helper.rebackDNListPage(cmp, event); |
| | | } |
| | | |
| | | // 进口单证 fy end |
| | | }) |
| | |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | }, |
| | | // 进口单证 fy start |
| | | showAttachmentDisplay: function(cmp, event) { |
| | | debugger |
| | | var DNId = event.target.name; |
| | | cmp.set('v.DNId', DNId); |
| | | cmp.set('v.AttachmentDisplayflag', true); |
| | | cmp.set('v.DNListPage', false); |
| | | }, |
| | | rebackDNListPage: function(cmp, event) { |
| | | debugger |
| | | cmp.set('v.AttachmentDisplayflag', false); |
| | | cmp.set('v.DNListPage', true); |
| | | } |
| | | |
| | | |
| | | // 进口单证 fy end |
| | | |
| | | }) |
| | |
| | | </div> |
| | | </aura:if> |
| | | <br/> |
| | | <button class="slds-button slds-button_brand" onclick="{!c.doSave}">2.选择附件</button> |
| | | <button class="slds-button slds-button_brand" onclick="{!c.doSave}">2.上传附件</button> |
| | | <lightning:accordion allowMultipleSectionsOpen="true" onsectiontoggle="{! c.handleSectionToggle }" activeSectionName="{! v.activeSections }"> |
| | | <lightning:accordionSection name="A" label="文件列表"> |
| | | <!-- 增加小色块 精琢技术 thh 2021-09-26 start --> |
| New file |
| | |
| | | <!-- add implements="forceCommunity:availableForAllPageTypes" to surface the component in community builder --> |
| | | <aura:component controller="LightningForgotPasswordController"> |
| | | <aura:attribute name="usernameLabel" type="String" required="false" default="Username"/> |
| | | <aura:attribute name="submitButtonLabel" type="String" required="false" default="Reset Password"/> |
| | | <aura:attribute name="showError" type="Boolean" required="true" description="" default="false" access="private"/> |
| | | <aura:attribute name="errorMessage" type="String" required="false" description="" access="private"/> |
| | | <aura:attribute name="checkEmailUrl" type="String" required="true"/> |
| | | <aura:attribute name="expid" type="String" required="false" description="The branding experience ID" /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.initialize}"/> |
| | | <aura:handler event="c:setExpId" action="{!c.setExpId}"/> |
| | | <aura:dependency resource="c:setExpId" type="EVENT"/> |
| | | |
| | | <div> |
| | | <aura:renderIf isTrue="{!v.showError}"> |
| | | <div id="error"> |
| | | <ui:outputRichText value="{!v.errorMessage}"/> |
| | | </div> |
| | | </aura:renderIf> |
| | | <div id="sfdc_username_container" class="sfdc"> |
| | | <span id="sfdc_user" class="login-icon" data-icon="a"></span> |
| | | <ui:inputText value="" aura:id="username" placeholder="{!v.usernameLabel}" keyup="{!c.onKeyUp}" class="input sfdc_usernameinput sfdc"/> |
| | | </div> |
| | | |
| | | <div class="sfdc"> |
| | | <ui:button aura:id="submitButton" label="{!v.submitButtonLabel}" press="{!c.handleForgotPassword}" class="sfdc_button"/> |
| | | </div> |
| | | |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>Sample Component for forgotPassword</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS #sfdc_username_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_user{ |
| | | float:left; |
| | | width:23px; |
| | | height:25px; |
| | | padding-top:1px; |
| | | padding-left:2px; |
| | | margin:0px; |
| | | |
| | | } |
| | | |
| | | .THIS .login-icon { |
| | | color:#ccc;font-size:22px; |
| | | } |
| | | |
| | | .THIS button.sfdc_button { |
| | | width: 100%; |
| | | margin-top: 15px; |
| | | margin-bottom: 5px; |
| | | color: #fff; |
| | | background-color: #0070d2; |
| | | border-color: #357ebd; |
| | | display: inline-block; |
| | | text-align: center; |
| | | vertical-align: middle; |
| | | background-image: none; |
| | | border: 1px solid transparent; |
| | | white-space: nowrap; |
| | | padding: 10px 12px; |
| | | font-size: 16px; |
| | | font-family: 'Open Sans', sans-serif; |
| | | font-weight: 300; |
| | | line-height: 1.42857143; |
| | | border-radius: 2px; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | } |
| | | |
| | | .THIS button:hover { |
| | | background-color:#3276b1; |
| | | border-color:#285e8e; |
| | | cursor:pointer; |
| | | } |
| | | |
| | | .THIS input { |
| | | margin-left:10px; |
| | | margin-top: 3px; |
| | | border: 0px solid transparent; |
| | | width: 70%; |
| | | -webkit-appearance: none; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .THIS #error { |
| | | text-align: center; |
| | | color:#FF0000; |
| | | } |
| | | |
| | | .THIS a { |
| | | color:white; |
| | | text-decoration: none; |
| | | } |
| | | .THIS a:hover { |
| | | color:white; |
| | | text-decoration: none; |
| | | } |
| New file |
| | |
| | | <design:component label="Custom Forgot Password"> |
| | | <design:attribute name="checkEmailUrl" default="./CheckPasswordResetEmail"/> |
| | | <design:attribute name="usernameLabel" default="Username"/> |
| | | <design:attribute name="submitButtonLabel" default="Reset Password"/> |
| | | </design:component> |
| New file |
| | |
| | | ({ |
| | | handleForgotPassword: function (component, event, helpler) { |
| | | helpler.handleForgotPassword(component, event, helpler); |
| | | }, |
| | | onKeyUp: function(component, event, helpler){ |
| | | //checks for "enter" key |
| | | if (event.getParam('keyCode')===13) { |
| | | helpler.handleForgotPassword(component, event, helpler); |
| | | } |
| | | }, |
| | | |
| | | setExpId: function (component, event, helper) { |
| | | var expId = event.getParam('expid'); |
| | | if (expId) { |
| | | component.set("v.expid", expId); |
| | | } |
| | | helper.setBrandingCookie(component, event, helper); |
| | | }, |
| | | |
| | | initialize: function(component, event, helper) { |
| | | $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap}).fire(); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | qsToEventMap: { |
| | | 'expid' : 'e.c:setExpId' |
| | | }, |
| | | |
| | | handleForgotPassword: function (component, event, helpler) { |
| | | var username = component.find("username").get("v.value"); |
| | | var checkEmailUrl = component.get("v.checkEmailUrl"); |
| | | var action = component.get("c.forgotPassword"); |
| | | action.setParams({username:username, checkEmailUrl:checkEmailUrl}); |
| | | action.setCallback(this, function(a) { |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue != null) { |
| | | component.set("v.errorMessage",rtnValue); |
| | | component.set("v.showError",true); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | setBrandingCookie: function (component, event, helpler) { |
| | | var expId = component.get("v.expid"); |
| | | if (expId) { |
| | | var action = component.get("c.setExperienceId"); |
| | | action.setParams({expId:expId}); |
| | | action.setCallback(this, function(a){ }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | } |
| | | }) |
| New file |
| | |
| | | <!-- add implements="forceCommunity:availableForAllPageTypes" to surface the component in community builder --> |
| | | <aura:component controller="LightningLoginFormController"> |
| | | <aura:attribute name="showError" type="Boolean" required="true" description="" default="false" access="private"/> |
| | | <aura:attribute name="errorMessage" type="String" required="false" description="" access="private"/> |
| | | <aura:attribute name="startUrl" type="String" required="false" description="The url you go to after a successful login" /> |
| | | <aura:attribute name="usernameLabel" type="String" required="false" default="Username"/> |
| | | <aura:attribute name="passwordLabel" type="String" required="false" default="Password"/> |
| | | <aura:attribute name="loginButtonLabel" type="String" required="false" default="Log in"/> |
| | | <aura:attribute name="expid" type="String" required="false" description="The branding experience ID" /> |
| | | |
| | | <aura:attribute name="forgotPasswordLabel" type="String" required="false" default="Forgot your password?"/> |
| | | <aura:attribute name="selfRegisterLabel" type="String" required="false" default="Not a member?"/> |
| | | <aura:attribute name="forgotPasswordUrl" type="String" required="false" default="/ForgotPassword"/> |
| | | <aura:attribute name="selfRegisterUrl" type="String" required="false" default="/SelfRegister"/> |
| | | |
| | | <aura:attribute name="isUsernamePasswordEnabled" type="Boolean" access="private"/> |
| | | <aura:attribute name="isSelfRegistrationEnabled" type="Boolean" access="private"/> |
| | | <aura:attribute name="communityForgotPasswordUrl" type="String" access="private"/> |
| | | <aura:attribute name="communitySelfRegisterUrl" type="String" access="private"/> |
| | | |
| | | <aura:registerevent name="sitePropagatedStartUrl" type="c:setStartUrl"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.initialize}"/> |
| | | <aura:dependency resource="c:setStartUrl" type="EVENT"/> |
| | | <!-- Please uncomment |
| | | <aura:dependency resource="siteforce:registerQueryEventMap" type="EVENT"/> |
| | | --> |
| | | <aura:handler event="c:setStartUrl" action="{!c.setStartUrl}"/> |
| | | <aura:handler event="c:setExpId" action="{!c.setExpId}"/> |
| | | <aura:dependency resource="c:setExpId" type="EVENT"/> |
| | | |
| | | <div> |
| | | <aura:renderIf isTrue="{!v.isUsernamePasswordEnabled}"> |
| | | <span> |
| | | <aura:renderIf isTrue="{!v.showError}"> |
| | | <div id="error"> |
| | | <ui:outputRichText value="{!v.errorMessage}"/> |
| | | </div> |
| | | </aura:renderIf> |
| | | </span> |
| | | <div id="sfdc_username_container" class="sfdc"> |
| | | <span id="sfdc_user" class="login-icon" data-icon="a"></span> |
| | | <ui:inputText value="" aura:id="username" placeholder="{!v.usernameLabel}" keyup="{!c.onKeyUp}" class="input sfdc_usernameinput sfdc" label="{!v.usernameLabel}" labelClass="assistiveText"/> |
| | | </div> |
| | | |
| | | <div id="sfdc_password_container" class="sfdc"> |
| | | <span id="sfdc_lock" class="login-icon sfdc" data-icon="c"></span> |
| | | <ui:inputSecret value="" aura:id="password" placeholder="{!v.passwordLabel}" keyup="{!c.onKeyUp}" class="input sfdc_passwordinput sfdc" label="{!v.passwordLabel}" labelClass="assistiveText"/> |
| | | </div> |
| | | |
| | | <div class="sfdc"> |
| | | <ui:button aura:id="submitButton" label="{!v.loginButtonLabel}" press="{!c.handleLogin}" class="sfdc_button"/> |
| | | </div> |
| | | |
| | | <div id="sfdc_forgot" class="sfdc"> |
| | | <span><a href="{!if(v.communityForgotPasswordUrl == null, v.forgotPasswordUrl, v.communityForgotPasswordUrl)}">{!v.forgotPasswordLabel}</a></span> |
| | | <aura:renderIf isTrue="{!v.isSelfRegistrationEnabled}"> |
| | | <span style="float:right" ><a href="{!if(v.communitySelfRegisterUrl == null, v.selfRegisterUrl, v.communitySelfRegisterUrl)}">{!v.selfRegisterLabel}</a></span> |
| | | </aura:renderIf> |
| | | </div> |
| | | </aura:renderIf> |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>Sample Component for loginForm</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS #sfdc_username_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_user{ |
| | | float:left; |
| | | width:23px; |
| | | height:25px; |
| | | padding-top:1px; |
| | | padding-left:2px; |
| | | margin:0px; |
| | | |
| | | } |
| | | |
| | | .THIS #sfdc_lock{ |
| | | float:left; |
| | | width:23px; |
| | | height:25px; |
| | | padding-top:1px; |
| | | padding-left:2px; |
| | | margin:0px; |
| | | } |
| | | |
| | | .THIS #error { |
| | | text-align: center; |
| | | color:#FF0000; |
| | | } |
| | | |
| | | .THIS .login-icon { |
| | | color:#ccc;font-size:22px; |
| | | } |
| | | |
| | | .THIS #sfdc_password_container{ |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS button.sfdc_button { |
| | | width: 100%; |
| | | margin-top: 15px; |
| | | margin-bottom: 5px; |
| | | color: #fff; |
| | | background-color: #0070d2; |
| | | border-color: #357ebd; |
| | | display: inline-block; |
| | | text-align: center; |
| | | vertical-align: middle; |
| | | background-image: none; |
| | | border: 1px solid transparent; |
| | | white-space: nowrap; |
| | | padding: 10px 12px; |
| | | font-size: 16px; |
| | | font-family: 'Open Sans', sans-serif; |
| | | font-weight: 300; |
| | | line-height: 1.42857143; |
| | | border-radius: 2px; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | } |
| | | |
| | | .THIS button:hover { |
| | | background-color:#3276b1; |
| | | border-color:#285e8e; |
| | | cursor:pointer; |
| | | } |
| | | |
| | | .THIS button .label { |
| | | color: #fff; |
| | | } |
| | | |
| | | .THIS input { |
| | | margin-left:10px; |
| | | margin-top: 3px; |
| | | border: 0px solid transparent; |
| | | width: 70%; |
| | | -webkit-appearance: none; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | |
| | | .THIS a { |
| | | color:white; |
| | | text-decoration: none; |
| | | } |
| | | .THIS a:hover { |
| | | color:white; |
| | | text-decoration: none; |
| | | } |
| | | |
| | | .THIS label.uiLabel-hidden { |
| | | display:none; |
| | | } |
| New file |
| | |
| | | <design:component label="Custom Login Form"> |
| | | <design:attribute name="startUrl"/> |
| | | <design:attribute name="usernameLabel" default="Email"/> |
| | | <design:attribute name="passwordLabel" default="Password"/> |
| | | <design:attribute name="loginButtonLabel" default="Log in"/> |
| | | <design:attribute name="forgotPasswordLabel" default="Forgot your password?"/> |
| | | <design:attribute name="forgotPasswordUrl"/> |
| | | <design:attribute name="selfRegisterLabel" default="Not a member?"/> |
| | | <design:attribute name="selfRegisterUrl"/> |
| | | </design:component> |
| New file |
| | |
| | | ({ |
| | | initialize: function(component, event, helper) { |
| | | $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap}).fire(); |
| | | $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap2}).fire(); |
| | | component.set('v.isUsernamePasswordEnabled', helper.getIsUsernamePasswordEnabled(component, event, helper)); |
| | | component.set("v.isSelfRegistrationEnabled", helper.getIsSelfRegistrationEnabled(component, event, helper)); |
| | | component.set("v.communityForgotPasswordUrl", helper.getCommunityForgotPasswordUrl(component, event, helper)); |
| | | component.set("v.communitySelfRegisterUrl", helper.getCommunitySelfRegisterUrl(component, event, helper)); |
| | | }, |
| | | |
| | | handleLogin: function (component, event, helpler) { |
| | | helpler.handleLogin(component, event, helpler); |
| | | }, |
| | | |
| | | setStartUrl: function (component, event, helpler) { |
| | | var startUrl = event.getParam('startURL'); |
| | | if(startUrl) { |
| | | component.set("v.startUrl", startUrl); |
| | | } |
| | | }, |
| | | |
| | | setExpId: function (component, event, helper) { |
| | | var expId = event.getParam('expid'); |
| | | if (expId) { |
| | | component.set("v.expid", expId); |
| | | } |
| | | helper.setBrandingCookie(component, event, helper); |
| | | }, |
| | | |
| | | onKeyUp: function(component, event, helpler){ |
| | | //checks for "enter" key |
| | | if (event.getParam('keyCode')===13) { |
| | | helpler.handleLogin(component, event, helpler); |
| | | } |
| | | }, |
| | | |
| | | navigateToForgotPassword: function(cmp, event, helper) { |
| | | var forgotPwdUrl = cmp.get("v.communityForgotPasswordUrl"); |
| | | if ($A.util.isUndefinedOrNull(forgotPwdUrl)) { |
| | | forgotPwdUrl = cmp.get("v.forgotPasswordUrl"); |
| | | } |
| | | var startUrl = cmp.get("v.startUrl"); |
| | | if(startUrl){ |
| | | if(forgotPwdUrl.indexOf("?") === -1) { |
| | | forgotPwdUrl = forgotPwdUrl + '?startURL=' + decodeURIComponent(startUrl); |
| | | } else { |
| | | forgotPwdUrl = forgotPwdUrl + '&startURL=' + decodeURIComponent(startUrl); |
| | | } |
| | | } |
| | | var attributes = { url: forgotPwdUrl }; |
| | | $A.get("e.force:navigateToURL").setParams(attributes).fire(); |
| | | }, |
| | | |
| | | navigateToSelfRegister: function(cmp, event, helper) { |
| | | var selfRegUrl = cmp.get("v.communitySelfRegisterUrl"); |
| | | if (selfRegUrl == null) { |
| | | selfRegUrl = cmp.get("v.selfRegisterUrl"); |
| | | } |
| | | var startUrl = cmp.get("v.startUrl"); |
| | | if(startUrl){ |
| | | if(selfRegUrl.indexOf("?") === -1) { |
| | | selfRegUrl = selfRegUrl + '?startURL=' + decodeURIComponent(startUrl); |
| | | } else { |
| | | selfRegUrl = selfRegUrl + '&startURL=' + decodeURIComponent(startUrl); |
| | | } |
| | | } |
| | | var attributes = { url: selfRegUrl }; |
| | | $A.get("e.force:navigateToURL").setParams(attributes).fire(); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | qsToEventMap: { |
| | | 'startURL' : 'e.c:setStartUrl' |
| | | }, |
| | | |
| | | qsToEventMap2: { |
| | | 'expid' : 'e.c:setExpId' |
| | | }, |
| | | |
| | | handleLogin: function (component, event, helpler) { |
| | | var username = component.find("username").get("v.value"); |
| | | var password = component.find("password").get("v.value"); |
| | | var action = component.get("c.login"); |
| | | var startUrl = component.get("v.startUrl"); |
| | | |
| | | startUrl = decodeURIComponent(startUrl); |
| | | |
| | | action.setParams({username:username, password:password, startUrl:startUrl}); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set("v.errorMessage",rtnValue); |
| | | component.set("v.showError",true); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | getIsUsernamePasswordEnabled : function (component, event, helpler) { |
| | | var action = component.get("c.getIsUsernamePasswordEnabled"); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set('v.isUsernamePasswordEnabled',rtnValue); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | getIsSelfRegistrationEnabled : function (component, event, helpler) { |
| | | var action = component.get("c.getIsSelfRegistrationEnabled"); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set('v.isSelfRegistrationEnabled',rtnValue); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | getCommunityForgotPasswordUrl : function (component, event, helpler) { |
| | | var action = component.get("c.getForgotPasswordUrl"); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set('v.communityForgotPasswordUrl',rtnValue); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | getCommunitySelfRegisterUrl : function (component, event, helpler) { |
| | | var action = component.get("c.getSelfRegistrationUrl"); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set('v.communitySelfRegisterUrl',rtnValue); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | setBrandingCookie: function (component, event, helpler) { |
| | | var expId = component.get("v.expid"); |
| | | if (expId) { |
| | | var action = component.get("c.setExperienceId"); |
| | | action.setParams({expId:expId}); |
| | | action.setCallback(this, function(a){ }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | } |
| | | }) |
| New file |
| | |
| | | <!-- add implements="forceCommunity:availableForAllPageTypes" to surface the component in community builder --> |
| | | <aura:component controller="LightningSelfRegisterController"> |
| | | <aura:attribute name="accountId" type="String" required="false" description="accountId for creating the user. If not specified, it will create a PersonAccount if possible for B2C scenario. Or otherwise if it's in a community, the community's self-registration accountId will be used."/> |
| | | <aura:attribute name="regConfirmUrl" type="String" required="true"/> |
| | | <aura:attribute name="startUrl" type="String" required="false" description="The url you go to after a successful login" /> |
| | | <aura:attribute name="showError" type="Boolean" required="true" description="" default="false" access="private"/> |
| | | <aura:attribute name="errorMessage" type="String" required="false" description="" access="private"/> |
| | | <aura:attribute name="firstnameLabel" type="String" required="false" default="First Name"/> |
| | | <aura:attribute name="lastnameLabel" type="String" required="false" default="Last Name"/> |
| | | <aura:attribute name="emailLabel" type="String" required="false" default="Email"/> |
| | | <aura:attribute name="passwordLabel" type="String" required="false" default="Create Password"/> |
| | | <aura:attribute name="confirmPasswordLabel" type="String" required="false" default="Confirm Password"/> |
| | | <aura:attribute name="submitButtonLabel" type="String" required="false" default="Sign Up"/> |
| | | <aura:attribute name="includePasswordField" type="Boolean" required="false" default="false" description="Whether to include password"/> |
| | | <aura:attribute name="extraFieldsFieldSet" type="String" required="false" description="A field set name whose fields are desired for user registration"/> |
| | | <aura:attribute name="extraFields" type="list" required="false" description="A field set name whose fields are desired for user registration"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.initialize}"/> |
| | | <aura:attribute name="expid" type="String" required="false" description="The branding experience ID" /> |
| | | |
| | | <aura:registerevent name="sitePropagatedStartUrl" type="c:setStartUrl"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.initialize}"/> |
| | | <aura:dependency resource="c:setStartUrl" type="EVENT"/> |
| | | <!-- Please uncomment |
| | | <aura:dependency resource="siteforce:registerQueryEventMap" type="EVENT"/> |
| | | --> |
| | | <aura:handler event="c:setStartUrl" action="{!c.setStartUrl}"/> |
| | | <aura:handler event="c:setExpId" action="{!c.setExpId}"/> |
| | | <aura:dependency resource="c:setExpId" type="EVENT"/> |
| | | |
| | | <div> |
| | | <aura:renderIf isTrue="{!v.showError}"> |
| | | <div id="error"> |
| | | <ui:outputRichText value="{!v.errorMessage}"/> |
| | | </div> |
| | | </aura:renderIf> |
| | | <div id="sfdc_username_container" class="sfdc"> |
| | | <span id="sfdc_user" class="login-icon" data-icon="a"></span> |
| | | <ui:inputText value="" aura:id="firstname" placeholder="{!v.firstnameLabel}" keyup="{!c.onKeyUp}" class="input sfdc_usernameinput sfdc"/> |
| | | </div> |
| | | |
| | | <div id="sfdc_nickname_container" class="sfdc"> |
| | | <span id="sfdc_user" class="login-icon" data-icon="a"></span> |
| | | <ui:inputText value="" aura:id="lastname" placeholder="{!v.lastnameLabel}" keyup="{!c.onKeyUp}" class="input sfdc_usernameinput sfdc"/> |
| | | </div> |
| | | |
| | | <div id="sfdc_email_container" class="sfdc"> |
| | | <span id="sfdc_user" class="login-icon" data-icon="k"></span> |
| | | <ui:inputText value="" aura:id="email" placeholder="{!v.emailLabel}" keyup="{!c.onKeyUp}" class="input sfdc_usernameinput sfdc"/> |
| | | </div> |
| | | |
| | | <aura:iteration aura:id="extraFields" items="{!v.extraFields}" var="curField" indexVar="index"> |
| | | <div id="sfdc_extrafield_container" class="sfdc"> |
| | | <span id="sfdc_user" class="login-icon" data-icon="a"></span> |
| | | <ui:inputText value="{!curField.value}" aura:id="{!curField.fieldPath}" placeholder="{!curField.label}" keyup="{!c.onKeyUp}" class="input sfdc_extrafieldinput sfdc"/> |
| | | </div> |
| | | </aura:iteration> |
| | | |
| | | <aura:renderIf isTrue="{!v.includePasswordField}"> |
| | | <div id="sfdc_password_container" class="sfdc"> |
| | | <span id="sfdc_lock" class="login-icon sfdc" data-icon="c"></span> |
| | | <ui:inputSecret value="" aura:id="password" placeholder="{!v.passwordLabel}" keyup="{!c.onKeyUp}" class="input sfdc_passwordinput sfdc"/> |
| | | </div> |
| | | |
| | | <div id="sfdc_confirm_password_container" class="sfdc"> |
| | | <span id="sfdc_lock" class="login-icon sfdc" data-icon="c"></span> |
| | | <ui:inputSecret value="" aura:id="confirmPassword" placeholder="{!v.confirmPasswordLabel}" keyup="{!c.onKeyUp}" class="input sfdc_passwordinput sfdc"/> |
| | | </div> |
| | | </aura:renderIf> |
| | | |
| | | <div class="sfdc"> |
| | | <ui:button aura:id="submitButton" label="{!v.submitButtonLabel}" press="{!c.handleSelfRegister}" class="sfdc_button"/> |
| | | </div> |
| | | </div> |
| | | </aura:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>Sample Component for selfRegister</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | .THIS #sfdc_username_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_nickname_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_email_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_extrafield_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_user{ |
| | | float:left; |
| | | width:23px; |
| | | height:25px; |
| | | padding-top:1px; |
| | | padding-left:2px; |
| | | margin:0px; |
| | | |
| | | } |
| | | |
| | | .THIS #sfdc_lock{ |
| | | float:left; |
| | | width:23px; |
| | | height:25px; |
| | | padding-top:1px; |
| | | padding-left:2px; |
| | | margin:0px; |
| | | } |
| | | |
| | | .THIS .login-icon { |
| | | color:#ccc;font-size:22px; |
| | | } |
| | | |
| | | .THIS #sfdc_password_container{ |
| | | margin-bottom:10px; |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS #sfdc_confirm_password_container{ |
| | | padding: 12px; |
| | | background-color:white; |
| | | border: 1px solid #CCC; |
| | | -webkit-border-radius: 2px; |
| | | -moz-border-radius: 2px; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .THIS button.sfdc_button { |
| | | width: 100%; |
| | | margin-top: 15px; |
| | | margin-bottom: 5px; |
| | | color: #fff; |
| | | background-color: #0070d2; |
| | | border-color: #357ebd; |
| | | display: inline-block; |
| | | text-align: center; |
| | | vertical-align: middle; |
| | | background-image: none; |
| | | border: 1px solid transparent; |
| | | white-space: nowrap; |
| | | padding: 10px 12px; |
| | | font-size: 16px; |
| | | font-family: 'Open Sans', sans-serif; |
| | | font-weight: 300; |
| | | line-height: 1.42857143; |
| | | border-radius: 2px; |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | } |
| | | |
| | | .THIS button:hover { |
| | | background-color:#3276b1; |
| | | border-color:#285e8e; |
| | | cursor:pointer; |
| | | } |
| | | |
| | | .THIS input { |
| | | margin-left:10px; |
| | | margin-top: 3px; |
| | | border: 0px solid transparent; |
| | | width: 70%; |
| | | -webkit-appearance: none; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .THIS #sfdc_forgot{ |
| | | font-family: 'Open Sans', 'sans-serif'; |
| | | font-weight:300; |
| | | font-size: 14px; |
| | | margin-top: 10px |
| | | } |
| | | |
| | | .THIS #error { |
| | | text-align: center; |
| | | color:#FF0000; |
| | | } |
| | | |
| | | .THIS a { |
| | | color:white; |
| | | text-decoration: none; |
| | | } |
| | | .THIS a:hover { |
| | | color:white; |
| | | text-decoration: none; |
| | | } |
| | | |
| | | .THIS input[type="checkbox"] { |
| | | appearance: none; |
| | | border: 1px solid white; |
| | | height: 22px; |
| | | width: 22px; |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .THIS input[type="checkbox"]:checked { |
| | | border: 1px solid ; |
| | | } |
| | | |
| | | .THIS input[type="checkbox"]:checked:after { |
| | | display: block; |
| | | position: relative; |
| | | content: ''; |
| | | left: 3px; |
| | | top: 3px; |
| | | height: 6px; |
| | | width: 10px; |
| | | border-bottom: 4px solid /*#354452*/ white; |
| | | border-left: 4px solid /*#354452*/ white; |
| | | transform:rotate(-45deg); |
| | | } |
| | | |
| | | .THIS input[type="checkbox"].disabled { |
| | | opacity: 0.35; |
| | | } |
| | | |
| | | .THIS input[type="checkbox"] + label { |
| | | vertical-align: middle; |
| | | } |
| New file |
| | |
| | | <design:component label="Custom Self Register"> |
| | | <design:attribute name="startUrl"/> |
| | | <design:attribute name="regConfirmUrl" default="./CheckPasswordResetEmail"/> |
| | | <design:attribute name="firstnameLabel" default="First Name"/> |
| | | <design:attribute name="lastnameLabel" default="Last Name"/> |
| | | <design:attribute name="emailLabel" default="Email"/> |
| | | <design:attribute name="passwordLabel" default="Create Password"/> |
| | | <design:attribute name="confirmPasswordLabel" default="Confirm Password"/> |
| | | <design:attribute name="submitButtonLabel" default="Sign Up"/> |
| | | <design:attribute name="includePasswordField" default="false"/> |
| | | <design:attribute name="extraFieldsFieldSet"/> |
| | | </design:component> |
| New file |
| | |
| | | ({ |
| | | initialize: function(component, event, helper) { |
| | | $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap}).fire(); |
| | | $A.get("e.siteforce:registerQueryEventMap").setParams({"qsToEvent" : helper.qsToEventMap2}).fire(); |
| | | component.set('v.extraFields', helper.getExtraFields(component, event, helper)); |
| | | }, |
| | | |
| | | handleSelfRegister: function (component, event, helpler) { |
| | | helpler.handleSelfRegister(component, event, helpler); |
| | | }, |
| | | |
| | | setStartUrl: function (component, event, helpler) { |
| | | var startUrl = event.getParam('startURL'); |
| | | if(startUrl) { |
| | | component.set("v.startUrl", startUrl); |
| | | } |
| | | }, |
| | | |
| | | setExpId: function (component, event, helper) { |
| | | var expId = event.getParam('expid'); |
| | | if (expId) { |
| | | component.set("v.expid", expId); |
| | | } |
| | | helper.setBrandingCookie(component, event, helper); |
| | | }, |
| | | |
| | | onKeyUp: function(component, event, helpler){ |
| | | //checks for "enter" key |
| | | if (event.getParam('keyCode')===13) { |
| | | helpler.handleSelfRegister(component, event, helpler); |
| | | } |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | qsToEventMap: { |
| | | 'startURL' : 'e.c:setStartUrl' |
| | | }, |
| | | |
| | | qsToEventMap2: { |
| | | 'expid' : 'e.c:setExpId' |
| | | }, |
| | | |
| | | handleSelfRegister: function (component, event, helpler) { |
| | | var accountId = component.get("v.accountId"); |
| | | var regConfirmUrl = component.get("v.regConfirmUrl"); |
| | | var firstname = component.find("firstname").get("v.value"); |
| | | var lastname = component.find("lastname").get("v.value"); |
| | | var email = component.find("email").get("v.value"); |
| | | var includePassword = component.get("v.includePasswordField"); |
| | | var password = component.find("password").get("v.value"); |
| | | var confirmPassword = component.find("confirmPassword").get("v.value"); |
| | | var action = component.get("c.selfRegister"); |
| | | var extraFields = JSON.stringify(component.get("v.extraFields")); // somehow apex controllers refuse to deal with list of maps |
| | | var startUrl = component.get("v.startUrl"); |
| | | |
| | | startUrl = decodeURIComponent(startUrl); |
| | | |
| | | action.setParams({firstname:firstname,lastname:lastname,email:email, |
| | | password:password, confirmPassword:confirmPassword, accountId:accountId, regConfirmUrl:regConfirmUrl, extraFields:extraFields, startUrl:startUrl, includePassword:includePassword}); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set("v.errorMessage",rtnValue); |
| | | component.set("v.showError",true); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | getExtraFields : function (component, event, helpler) { |
| | | var action = component.get("c.getExtraFields"); |
| | | action.setParam("extraFieldsFieldSet", component.get("v.extraFieldsFieldSet")); |
| | | action.setCallback(this, function(a){ |
| | | var rtnValue = a.getReturnValue(); |
| | | if (rtnValue !== null) { |
| | | component.set('v.extraFields',rtnValue); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | setBrandingCookie: function (component, event, helpler) { |
| | | var expId = component.get("v.expid"); |
| | | if (expId) { |
| | | var action = component.get("c.setExperienceId"); |
| | | action.setParams({expId:expId}); |
| | | action.setCallback(this, function(a){ }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | } |
| | | }) |
| New file |
| | |
| | | <aura:event type="APPLICATION"> |
| | | <aura:attribute name="expid" type="String"/> |
| | | </aura:event> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>Sample Event for setExpId</description> |
| | | </AuraDefinitionBundle> |
| New file |
| | |
| | | <aura:event type="APPLICATION"> |
| | | <aura:attribute name="startURL" type="Map"/> |
| | | </aura:event> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <description>Sample Event for setStartUrl</description> |
| | | </AuraDefinitionBundle> |
| | |
| | | // HWAG-BG682M start |
| | | ' isUpdateOwnerInform__c = true and ' + |
| | | // HWAG-BG682M end |
| | | ' Salesdepartment_HP__c = \'' + salesdepartment + '\''; |
| | | ' Id = \'' + salesdepartment + '\''; |
| | | // ' Salesdepartment_HP__c = \'' + salesdepartment + '\''; |
| | | } |
| | | system.debug('=====query:' + query); |
| | | return Database.getQueryLocator(query); |
| | |
| | | Map<id, List<String>> LeaderShareInsert = new Map<id, List<String>>(); |
| | | |
| | | List<String> AllLeaderShareNameList = new List<String>(); |
| | | List<String> AllLeaderShareNameList1 = new List<String>(); |
| | | |
| | | Map<String, String> teamRoleMap = new Map<String, String>(); |
| | | |
| | |
| | | List<String> DeptUsrList = new List<String>(); |
| | | for (String UsrName : acc.BF_Product_Leader__c.split('[,\\,]')) { |
| | | NameListunPrase.add(UsrName); |
| | | |
| | | String UsrName1 = UsrName.replaceAll(' ', ''); //zyh 2022-10-09 |
| | | AllLeaderShareNameList1.add(UsrName1); |
| | | AllLeaderShareNameList.add(UsrName); |
| | | teamRoleMap.put(UsrName, '推广担当'); |
| | | |
| | |
| | | //检索所有担当人 |
| | | //讲昵称和id进行配对 |
| | | List<User> loopUser = [select id, Alias__c from user where Alias__c in:AllLeaderShareNameList]; |
| | | List<User> loopUser1 = [select id,Name, Alias__c,Name_test__c from user where Name_test__c in:AllLeaderShareNameList1]; |
| | | System.debug('ceshi11111111=========='+loopUser1); |
| | | Map<String, id> allLearUserMap = new Map<String, id>(); |
| | | Map<id, String> allLearidUserMap = new Map<id, String>(); |
| | | |
| New file |
| | |
| | | public without sharing class AccountDelayApplyHandler extends Oly_TriggerHandler { |
| | | private Map<Id, Account_Delay_Apply__c> newMap; |
| | | private Map<Id, Account_Delay_Apply__c> oldMap; |
| | | private List<Account_Delay_Apply__c> newList; |
| | | private List<Account_Delay_Apply__c> oldList; |
| | | |
| | | public AccountDelayApplyHandler() { |
| | | this.newMap = (Map<Id, Account_Delay_Apply__c>) Trigger.newMap; |
| | | this.oldMap = (Map<Id, Account_Delay_Apply__c>) Trigger.oldMap; |
| | | this.newList = (List<Account_Delay_Apply__c>) Trigger.new; |
| | | this.oldList = (List<Account_Delay_Apply__c>) Trigger.old; |
| | | } |
| | | |
| | | protected override void beforeInsert(){ |
| | | // OpenWindow(); |
| | | OpenWindow1(); |
| | | } |
| | | protected override void afterInsert(){ |
| | | MultiOption(); |
| | | } |
| | | protected override void beforeUpdate(){ |
| | | MultiOption(); |
| | | setColumn(); |
| | | // OpenWindow(); |
| | | } |
| | | protected override void afterUpdate(){ |
| | | MultiOption(); |
| | | setAccColumn(); |
| | | } |
| | | |
| | | //多选项数据统计 |
| | | private void MultiOption(){ |
| | | //创建参数 key:Sobject对象 value:发生改变的选项列表字段集合 (哪个选项列表发生变化就把哪个当做参数) |
| | | Map<SObject,List<String>> data = new Map<SObject,List<String>>(); |
| | | for (Account_Delay_Apply__c ada : newList) { |
| | | List<String> columsList = new List<String>(); |
| | | Account_Delay_Apply__c oldada = null; |
| | | if (Trigger.isUpdate) { |
| | | oldada = oldMap.get(ada.Id); |
| | | } |
| | | |
| | | //变更理由(可多选) |
| | | if (oldada == null || oldada.ChangeReason__c != ada.ChangeReason__c) { |
| | | columsList.add('ChangeReason__c'); |
| | | } |
| | | |
| | | data.put(ada, columsList); |
| | | } |
| | | |
| | | SplitOptionListUtil util = new SplitOptionListUtil(); |
| | | util.makeObject(data); |
| | | |
| | | } |
| | | |
| | | // //营业窗口 |
| | | // private void OpenWindow(){ |
| | | // Map<String, OCM_Management_Province__c> mpMap = new Map<String, OCM_Management_Province__c>(); |
| | | // Set<String> accOCSMset = new Set<String>(); |
| | | |
| | | // for(Account_Delay_Apply__c ada1 : newList){ |
| | | // Account_Delay_Apply__c oldada1 = null; |
| | | // if(Trigger.isUpdate){ |
| | | |
| | | // oldada1 = oldMap.get(ada1.Id); |
| | | |
| | | // if(ada1.OCM_man_province_HP__c != oldada1.OCM_man_province_HP__c){ |
| | | // accOCSMset.add(ada1.OCM_man_province_HP__c); |
| | | // } |
| | | // } |
| | | // if(Trigger.isInsert){ |
| | | // accOCSMset.add(ada1.OCM_man_province_HP__c); |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // if(null !=accOCSMset){ |
| | | // List<OCM_Management_Province__c> mpList = |
| | | // [select id, Name, Window1__c from OCM_Management_Province__c where Name =: accOCSMset]; |
| | | |
| | | // for (OCM_Management_Province__c mp : mpList) { |
| | | // mpMap.put(mp.Name, mp); |
| | | // } |
| | | // } |
| | | |
| | | // for(Account_Delay_Apply__c ada2 : newList){ |
| | | // if(Trigger.isInsert || Trigger.isUpdate){ |
| | | // if(null!=mpMap && mpMap.containsKey(ada2.OCM_man_province_HP__c)){ |
| | | // OCM_Management_Province__c omp = mpMap.get(ada2.OCM_man_province_HP__c); |
| | | // if (omp != null) { |
| | | // ada2.OpenWindow__c = omp.Window1__c; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | |
| | | // } |
| | | |
| | | //营业窗口 |
| | | private void OpenWindow1(){ |
| | | Map<String, OCM_Management_Province__c> mpMap = new Map<String, OCM_Management_Province__c>(); |
| | | List<OCM_Management_Province__c> mpList = new List<OCM_Management_Province__c>(); |
| | | Set<String> accId = new Set<String>(); |
| | | Set<String> accOCSMset = new Set<String>(); |
| | | |
| | | for(Account_Delay_Apply__c ada1 : newList){ |
| | | Account_Delay_Apply__c oldada1 = null; |
| | | if(Trigger.isInsert){ |
| | | accId.add(ada1.Hospital__c); |
| | | } |
| | | |
| | | } |
| | | |
| | | if(accId.size() > 0){ |
| | | List<Account> accList = [SELECT Id, Name, OCM_man_province_HP__c |
| | | FROM Account |
| | | WHERE id in :accId]; |
| | | for(Account acc : accList){ |
| | | accOCSMset.add(acc.OCM_man_province_HP__c); |
| | | } |
| | | |
| | | } |
| | | |
| | | if(null !=accOCSMset){ |
| | | mpList = [select id, Name, Window1__c from OCM_Management_Province__c where Name =: accOCSMset]; |
| | | } |
| | | |
| | | for(Account_Delay_Apply__c ada2 : newList){ |
| | | for(OCM_Management_Province__c omp : mpList){ |
| | | if(Trigger.isInsert){ |
| | | ada2.OpenWindow__c = omp.Window1__c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //提交时设置old字段的值 |
| | | private void setColumn(){ |
| | | |
| | | List<String> accIds = new List<String>(); |
| | | List<Account_Delay_Apply__c> alist = new List<Account_Delay_Apply__c>(); |
| | | |
| | | for (Account_Delay_Apply__c ada :newList ) { |
| | | //判断更新前后的状态(是否有效)是否不同 若不同,则判断更新后的状态是否为'审批中' |
| | | if ((ada.Is_Active__c != oldMap.get(ada.Id).Is_Active__c) && ada.Is_Active__c == '申请中' ) { |
| | | alist.add(ada); |
| | | accIds.add(ada.Hospital__c); |
| | | } |
| | | } |
| | | if (accIds.size() == 0) { |
| | | return; |
| | | }else{ |
| | | Map<String,Account> accMap = new Map<String,Account>(); |
| | | List<Account> statusList = [SELECT Id, Name, Website, Site, |
| | | Is_Active__c, Feature__c, Attribute_Type__c, Speciality_Type__c, |
| | | Abbreviation__c, Street__c, City_Master__c, Field3_companyname__c, |
| | | State_Master__c, Grade__c, Address__c, Alias_Name2__c, |
| | | Town__c, Postal_Code__c |
| | | FROM Account |
| | | WHERE id in :accIds]; |
| | | |
| | | for (Account acc :statusList ) { |
| | | accMap.put(acc.Id, acc); |
| | | } |
| | | |
| | | for (Account_Delay_Apply__c ada : alist) { |
| | | ada.Feature_old__c = accMap.get(ada.Hospital__c).Feature__c; |
| | | ada.Attribute_Type_old__c = accMap.get(ada.Hospital__c).Attribute_Type__c; |
| | | ada.Speciality_Type_old__c = accMap.get(ada.Hospital__c).Speciality_Type__c; |
| | | ada.Abbreviation_old__c = accMap.get(ada.Hospital__c).Abbreviation__c; |
| | | ada.Street_old__c = accMap.get(ada.Hospital__c).Street__c; |
| | | ada.HospitalName_old__c = accMap.get(ada.Hospital__c).Name; |
| | | ada.City_Master_old__c = accMap.get(ada.Hospital__c).City_Master__c; |
| | | ada.Field3_companyname_old__c = accMap.get(ada.Hospital__c).Field3_companyname__c; |
| | | ada.State_Master_old__c = accMap.get(ada.Hospital__c).State_Master__c; |
| | | ada.Grade_old__c = accMap.get(ada.Hospital__c).Grade__c; |
| | | //ada.Address_Together_old__c = accMap.get(ada.Hospital__c).Address__c; |
| | | ada.Website_old__c = accMap.get(ada.Hospital__c).Website; |
| | | ada.Site_old__c = accMap.get(ada.Hospital__c).Site; |
| | | ada.Alias_Name2_old__c = accMap.get(ada.Hospital__c).Alias_Name2__c; |
| | | ada.Town_old__c = accMap.get(ada.Hospital__c).Town__c; |
| | | ada.Postal_Code_old__c = accMap.get(ada.Hospital__c).Postal_Code__c; |
| | | |
| | | } |
| | | |
| | | // for (Account acc : statusList) { |
| | | // acc.Status = '申请中'; |
| | | // } |
| | | update statusList; |
| | | } |
| | | |
| | | } |
| | | |
| | | //变更有效时反写客户 |
| | | private void setAccColumn(){ |
| | | |
| | | List<String> accIds = new List<String>(); |
| | | List<String> adaIds = new List<String>(); |
| | | // List<Account_Delay_Apply__c> alist = new List<Account_Delay_Apply__c>(); |
| | | // List<Account> acclist = new List<Account>(); |
| | | List<Account> updacclist = new List<Account>(); |
| | | |
| | | for (Account_Delay_Apply__c ada :newList ) { |
| | | //判断更新前后的状态(是否有效)是否不同 若不同,则判断更新后的状态是否为'审批中' |
| | | if ((ada.Is_Active__c != oldMap.get(ada.Id).Is_Active__c) && ada.Is_Active__c == '审批通过' ) { |
| | | // alist.add(ada); |
| | | adaIds.add(ada.Id); |
| | | accIds.add(ada.Hospital__c); |
| | | } |
| | | } |
| | | if (accIds.size() == 0) { |
| | | return; |
| | | }else{ |
| | | Map<String,Account> accMap = new Map<String,Account>(); |
| | | List<Account> statusList = [SELECT Id, Name, Website, Site, |
| | | Is_Active__c, Feature__c, Attribute_Type__c, Speciality_Type__c, |
| | | Abbreviation__c, Street__c, City_Master__c, Field3_companyname__c, |
| | | State_Master__c, Grade__c, Address__c, Alias_Name2__c, |
| | | Town__c, Postal_Code__c, HospitalType__c, InstitutionalType__c,WhetherRiskPassing__c,IsUnlock__c |
| | | FROM Account |
| | | WHERE id in :accIds]; |
| | | |
| | | List<Account_Delay_Apply__c> adastatusList = [SELECT Id, Name, Website__c, Site__c, |
| | | Is_Active__c, Feature__c, Attribute_Type__c, Speciality_Type__c, |
| | | Abbreviation__c, Street__c, City_Master__c, Field3_companyname__c, |
| | | State_Master__c, Grade__c, Alias_Name2__c, |
| | | Town__c, Postal_Code__c, HospitalName__c, Hospital__c, |
| | | HospitalType__c, InstitutionalType__c,WhetherRiskPassing__c |
| | | FROM Account_Delay_Apply__c |
| | | WHERE id in :adaIds]; |
| | | |
| | | for (Account acc :statusList ) { |
| | | accMap.put(acc.Id, acc); |
| | | } |
| | | |
| | | for (Account_Delay_Apply__c ada : adastatusList) { |
| | | accMap.get(ada.Hospital__c).Feature__c = ada.Feature__c; |
| | | accMap.get(ada.Hospital__c).Attribute_Type__c = ada.Attribute_Type__c; |
| | | accMap.get(ada.Hospital__c).Speciality_Type__c = ada.Speciality_Type__c; |
| | | accMap.get(ada.Hospital__c).Abbreviation__c = ada.Abbreviation__c; |
| | | accMap.get(ada.Hospital__c).Street__c = ada.Street__c; |
| | | accMap.get(ada.Hospital__c).Name = ada.HospitalName__c; |
| | | accMap.get(ada.Hospital__c).City_Master__c = ada.City_Master__c; |
| | | accMap.get(ada.Hospital__c).Field3_companyname__c = ada.Field3_companyname__c; |
| | | accMap.get(ada.Hospital__c).State_Master__c = ada.State_Master__c; |
| | | accMap.get(ada.Hospital__c).Grade__c = ada.Grade__c; |
| | | // accMap.get(ada.Hospital__c).Address__c = ada.Address_Together__c; |
| | | accMap.get(ada.Hospital__c).Website = ada.Website__c; |
| | | accMap.get(ada.Hospital__c).Site = ada.Site__c; |
| | | accMap.get(ada.Hospital__c).Alias_Name2__c = ada.Alias_Name2__c; |
| | | accMap.get(ada.Hospital__c).Town__c = ada.Town__c; |
| | | accMap.get(ada.Hospital__c).Postal_Code__c = ada.Postal_Code__c; |
| | | |
| | | accMap.get(ada.Hospital__c).HospitalType__c = ada.HospitalType__c; |
| | | accMap.get(ada.Hospital__c).InstitutionalType__c = ada.InstitutionalType__c; |
| | | accMap.get(ada.Hospital__c).WhetherRiskPassing__c= ada.WhetherRiskPassing__c; |
| | | accMap.get(ada.Hospital__c).IsUnlock__c= true; //跳过验证规则 |
| | | system.debug('原数据==='+accMap.get(ada.Hospital__c).IsUnlock__c); |
| | | updacclist.add(accMap.get(ada.Hospital__c)); |
| | | |
| | | } |
| | | //if(updacclist.size() > 0){ |
| | | // update updacclist; |
| | | //} |
| | | if(updacclist.size()>0){ |
| | | //一个客户更新失败 |
| | | List<String> failedaccList = new List<String>(); |
| | | Database.SaveResult[] saveAccResults = Database.update(updacclist,false); |
| | | for(Integer i = 0;i<saveAccResults.size();i++) { |
| | | if(!saveAccResults.get(i).isSuccess() ){ |
| | | //将更新失败的客户添加到集合中 |
| | | failedaccList.add(String.valueOf( updacclist.get(i).id ).substring(0,15)); |
| | | } |
| | | } |
| | | |
| | | //更新成功后,清除客户上的 是否解锁 |
| | | List<Account> successAccList = new List<Account>(); |
| | | for(Account statusacc:statusList){ |
| | | if(failedaccList.contains( String.valueOf( statusacc.id ).substring(0,15) )){ |
| | | system.debug('更新失败=='+saveAccResults); |
| | | //更新失败,则不清除标识 |
| | | }else { |
| | | system.debug('清除标识==='+statusacc.IsUnlock__c); |
| | | //更新成功,清除标识 |
| | | statusacc.IsUnlock__c = false; |
| | | successAccList.add(statusacc); |
| | | } |
| | | } |
| | | |
| | | //清除标识 |
| | | if(successAccList.size()>0){ |
| | | update successAccList; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AccountDelayApplyHandlerTest { |
| | | @isTest |
| | | static void TestMethod1() { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | Address_Level__c al1 = new Address_Level__c(); |
| | | al1.Name = '北京'; |
| | | al1.Level1_Code__c = 'CN-99'; |
| | | al1.Level1_Sys_No__c = '999999'; |
| | | insert al1; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | insert ada; |
| | | |
| | | ada.ChangeReason__c = '其他信息修改'; |
| | | ada.State_Master__c = al1.Id; |
| | | update ada; |
| | | } |
| | | |
| | | @isTest |
| | | static void TestMethod2() { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | Address_Level__c al1 = new Address_Level__c(); |
| | | al1.Name = '北京'; |
| | | al1.Level1_Code__c = 'CN-99'; |
| | | al1.Level1_Sys_No__c = '999999'; |
| | | insert al1; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | insert ada; |
| | | |
| | | ada.ChangeReason__c = '其他信息修改'; |
| | | ada.State_Master__c = al1.Id; |
| | | ada.Is_Active__c = '申请中'; |
| | | update ada; |
| | | |
| | | ada.Is_Active__c = '审批通过'; |
| | | update ada; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global class AccountServiceOfTarget1Hto2HBatch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | public List<String> hospId; |
| | | global AccountServiceOfTarget1Hto2HBatch() { |
| | | this.query = query; |
| | | } |
| | | global AccountServiceOfTarget1Hto2HBatch(List<String> hospId) { |
| | | this.query = query; |
| | | this.hospId = hospId; |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | query = 'select id,OCSM_Period_half__c,OCSM_Period__c,Account_HP__c,Account_HP__r.name,' |
| | | +' Target_Correlation_Lightsource__c,Target_Rigid_Mirror_2__c,Target_Soft_Mirror_2__c,' |
| | | +' Renew_Target_Correlation_Lightsource__c,Renew_Target_Rigid_Mirror_2__c,Renew_Target_Soft_Mirror_2__c' |
| | | +' from Account_Service_Of_Target__c where OCSM_Period_half__c = \'2H\' '; |
| | | if (this.hospId!=null && this.hospId.size()!=0) { |
| | | query +=' and Account_HP__c in :hospId'; |
| | | } |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Account_Service_Of_Target__c> asotList) { |
| | | Map<String,Account_Service_Of_Target__c> map1 = new Map<String,Account_Service_Of_Target__c>(); |
| | | Map<String,Account_Service_Of_Target__c> map2 = new Map<String,Account_Service_Of_Target__c>(); |
| | | List<Account_Service_Of_Target__c> asotUPList = new List<Account_Service_Of_Target__c>(); |
| | | List<Account_Service_Of_Target__c> asotList2 = [select id,OCSM_Period_half__c,OCSM_Period__c,Account_HP__c,Account_HP__r.name, |
| | | Target_Correlation_Lightsource__c,Target_Rigid_Mirror_2__c,Target_Soft_Mirror_2__c, |
| | | Renew_Target_Correlation_Lightsource__c,Renew_Target_Rigid_Mirror_2__c,Renew_Target_Soft_Mirror_2__c |
| | | from Account_Service_Of_Target__c where OCSM_Period_half__c = '1H']; |
| | | for (Account_Service_Of_Target__c asot :asotList ) { |
| | | map2.put(asot.Account_HP__c,asot); |
| | | system.debug('添加到map2'); |
| | | } |
| | | for (Account_Service_Of_Target__c asot :asotList2 ) { |
| | | map1.put(asot.Account_HP__c,asot); |
| | | system.debug('添加到map1'); |
| | | } |
| | | system.debug('@@@@map1='+map1); |
| | | system.debug('@@@@map2='+map2); |
| | | for ( Account_Service_Of_Target__c asot:map1.values()) { |
| | | system.debug('@@@@2H==='+map2.get(asot.Account_HP__c)); |
| | | if ( map2.get(asot.Account_HP__c) !=null) { |
| | | Account_Service_Of_Target__c asotNew = new Account_Service_Of_Target__c(); |
| | | asotNew.id = map2.get(asot.Account_HP__c).id; |
| | | asotNew.Target_Correlation_Lightsource__c = asot.Target_Correlation_Lightsource__c; |
| | | asotNew.Target_Rigid_Mirror_2__c = asot.Target_Rigid_Mirror_2__c; |
| | | asotNew.Target_Soft_Mirror_2__c = asot.Target_Soft_Mirror_2__c; |
| | | asotNew.Renew_Target_Correlation_Lightsource__c = asot.Renew_Target_Correlation_Lightsource__c; |
| | | asotNew.Renew_Target_Rigid_Mirror_2__c = asot.Renew_Target_Rigid_Mirror_2__c; |
| | | asotNew.Renew_Target_Soft_Mirror_2__c = asot.Renew_Target_Soft_Mirror_2__c; |
| | | asotUPList.add(asotNew); |
| | | } |
| | | } |
| | | if (asotUPList!=null && asotUPList.size()!=0) { |
| | | upsert asotUPList; |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AccountServiceOfTarget1Hto2HBatchTest { |
| | | static testMethod void testMethod1() { |
| | | system.Test.startTest(); |
| | | database.executeBatch(new AccountServiceOfTarget1Hto2HBatch(),200); |
| | | system.Test.stopTest(); |
| | | } |
| | | |
| | | @testSetup |
| | | private static void initData(){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com',Job_Category__c = '销售服务', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert MacOwner; |
| | | |
| | | Account hospital = new Account(); |
| | | hospital.RecordTypeId = rectCo[0].Id; |
| | | hospital.Name = 'NFM007Testhospital'; |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI']; |
| | | Account section = new Account(); |
| | | section.RecordTypeId = rectSct[0].Id; |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = hospital.Id; |
| | | section.Hospital_Department_Class__c = hospital.Id; |
| | | section.AgentCode_Ext__c = '9999900'; |
| | | insert section; |
| | | |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = rectDpt[0].Id; |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'NFM007TestDepart'; |
| | | depart.ParentId = strategicDep[0].Id; |
| | | depart.Department_Class__c = strategicDep[0].Id; |
| | | depart.Hospital__c = hospital.Id; |
| | | insert depart; |
| | | |
| | | Product2 prd1 = new Product2(); |
| | | prd1.ProductCode_Ext__c = 'Prd1'; |
| | | prd1.ProductCode = 'Prd1'; |
| | | prd1.Repair_Product_Code__c = 'Prd1_RP'; |
| | | prd1.Name = 'Prd1'; |
| | | prd1.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd1.Category3__c = '纤维镜'; |
| | | prd1.Category4__c = '妇科用硬性镜'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd1.Asset_Model_No__c = '1001'; |
| | | prd1.Important_product__c = true; |
| | | prd1.Important_Rroduct_1GI__c = true; |
| | | insert prd1; |
| | | |
| | | Product2 prd2 = new Product2(); |
| | | prd2.ProductCode_Ext__c = 'Prd2'; |
| | | prd2.ProductCode = 'Prd2'; |
| | | prd2.Repair_Product_Code__c = 'Prd2_RP'; |
| | | prd2.Name = 'Prd2'; |
| | | prd2.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd2.Category3__c = '光源'; |
| | | // prd2.Category4__c = 'SD EndoEYE'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd2.Asset_Model_No__c = '1001'; |
| | | prd2.Important_product__c = true; |
| | | prd2.Important_Rroduct_1GI__c = true; |
| | | insert prd2; |
| | | |
| | | Product2 prd3 = new Product2(); |
| | | prd3.ProductCode_Ext__c = 'Prd3'; |
| | | prd3.ProductCode = 'Prd3'; |
| | | prd3.Repair_Product_Code__c = 'Prd3_RP'; |
| | | prd3.Name = 'Prd3'; |
| | | prd3.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd3.Category3__c = '纤维镜'; |
| | | // prd2.Category4__c = 'SD EndoEYE'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd3.Asset_Model_No__c = '1001'; |
| | | prd3.Important_product__c = true; |
| | | prd3.Important_Rroduct_1GI__c = true; |
| | | insert prd3; |
| | | |
| | | Product2 prd4 = new Product2(); |
| | | prd4.ProductCode_Ext__c = 'Prd4'; |
| | | prd4.ProductCode = 'Prd4'; |
| | | prd4.Repair_Product_Code__c = 'Prd4_RP'; |
| | | prd4.Name = 'Prd4'; |
| | | prd4.Manual_Entry__c = false; |
| | | // prd1.Category2__c = '本体'; |
| | | prd4.Category4__c = '妇科用硬性镜'; |
| | | // prd2.Category4__c = 'SD EndoEYE'; |
| | | // prd1.Category5__c = '260SL系列'; |
| | | prd4.Asset_Model_No__c = '1001'; |
| | | prd4.Important_product__c = true; |
| | | prd4.Important_Rroduct_1GI__c = true; |
| | | insert prd4; |
| | | |
| | | Consumable_order_details2__c saledet1 = new Consumable_order_details2__c(); |
| | | saledet1.Name = 'OCM_01_001001'; |
| | | // saledet1.Consumable_order_minor__c = Order1.Id; |
| | | saledet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | saledet1.Bar_Code__c = '0114953170032070111804001082K250BBBBB'; |
| | | // saledet1.Consumable_Product__c = prd1.Id; |
| | | saledet1.Used_account__c = section.Id; |
| | | saledet1.Delivery_List_RMB__c = 11; |
| | | saledet1.Box_Piece__c = '盒'; |
| | | saledet1.TracingCode__c = 'BBBBB'; |
| | | saledet1.SerialLotNo__c = '82K'; |
| | | saledet1.Guarantee_period_for_products__c = Date.today().addDays(5); |
| | | saledet1.Sterilization_limit__c = Date.today().addDays(5); |
| | | saledet1.Send_Date__c = null; |
| | | //saledet1.Dealer_Shipment__c = false; |
| | | saledet1.Arrive_date__c = null; |
| | | //saledet1.Dealer_Arrive__c = false; |
| | | saledet1.Used_date__c = null; |
| | | //saledet1.Dealer_Saled__c = false; |
| | | saledet1.Deliver_date__c = Date.today().addDays(-10); |
| | | insert saledet1; |
| | | |
| | | // 维修合同を作成する |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| | | contract.Name = 'tect contract'; |
| | | contract.Hospital__c = hospital.Id; |
| | | contract.Department_Class__c = strategicDep[0].Id; |
| | | contract.Department__c = depart.Id; |
| | | contract.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract.Payment_Plan_Sum_First__c = 1; |
| | | contract.Status__c = '契約満了'; |
| | | contract.Maintenance_Contract_No__c = '11123'; |
| | | contract.recordtypeId = |
| | | Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract.Not_Upper_limit_reason__c = ' 1'; |
| | | contract.Contract_Start_Date__c = Date.newInstance(2021,10,5); |
| | | contract.Contract_End_Date__c = Date.newInstance(2021,11,1); |
| | | contract.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract.New_Contract_TypeF_Text__c = '续签合同'; |
| | | contract.IF_Target_Renew__c='1'; |
| | | contract.Contract_Conclusion_Date__c=Date.newInstance(2021,10,5); |
| | | system.assertEquals(contract.Contract_End_Date__c >= Date.newInstance(2021,10,1) && contract.Contract_End_Date__c <= Date.newInstance(2022,9,30),true); |
| | | insert contract; |
| | | |
| | | Maintenance_Contract__c contract2 = new Maintenance_Contract__c(); |
| | | contract2.Name = 'tect contract2'; |
| | | contract2.Hospital__c = hospital.Id; |
| | | contract2.Department_Class__c = strategicDep[0].Id; |
| | | contract2.Department__c = depart.Id; |
| | | contract2.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract2.Payment_Plan_Sum_First__c = 1; |
| | | contract2.Status__c = '契約'; |
| | | contract2.Maintenance_Contract_No__c = '11123111'; |
| | | contract2.Not_Upper_limit_reason__c = ' 2'; |
| | | contract2.Contract_Start_Date__c = Date.newInstance(2021,10,5); |
| | | contract2.Contract_End_Date__c = Date.newInstance(2021,11,1); |
| | | contract2.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract2.IF_Target_Renew__c='1'; |
| | | contract2.Contract_Conclusion_Date__c=Date.newInstance(2021,10,5); |
| | | system.assertEquals(contract2.Contract_End_Date__c >= Date.newInstance(2021,10,1) && contract2.Contract_End_Date__c <= Date.newInstance(2022,9,30),true); |
| | | insert contract2; |
| | | |
| | | asset ast = new asset(); |
| | | ast.Name = prd1.Name; |
| | | ast.Product2Id = prd1.Id; |
| | | ast.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast.TracingCode__c = saledet1.TracingCode__c; |
| | | ast.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast.Barcode__c = saledet1.Bar_Code__c; |
| | | ast.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast.Asset_Owner__c = '经销商资产'; |
| | | ast.AccountId = depart.Id; |
| | | ast.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast.Hospital__c = hospital.Id; |
| | | ast.CurrentContract__c = contract.Id; |
| | | ast.CurrentContract_Asset_Price__c = 0; |
| | | ast.CurrentContract_F__c=contract.Id; |
| | | insert ast; |
| | | |
| | | asset ast1 = new asset(); |
| | | ast1.Name = prd2.Name; |
| | | ast1.Product2Id = prd2.Id; |
| | | ast1.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast1.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast1.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast1.TracingCode__c = saledet1.TracingCode__c; |
| | | ast1.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast1.Barcode__c = saledet1.Bar_Code__c; |
| | | ast1.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast1.Asset_Owner__c = '经销商资产'; |
| | | ast1.AccountId = depart.Id; |
| | | ast1.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast1.Hospital__c = hospital.Id; |
| | | ast1.CurrentContract__c = contract2.Id; |
| | | ast1.CurrentContract_Asset_Price__c = 0; |
| | | insert ast1; |
| | | |
| | | asset ast2 = new asset(); |
| | | ast2.Name = prd3.Name; |
| | | ast2.Product2Id = prd3.Id; |
| | | ast2.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast2.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast2.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast2.TracingCode__c = saledet1.TracingCode__c; |
| | | ast2.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast2.Barcode__c = saledet1.Bar_Code__c; |
| | | ast2.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast2.Asset_Owner__c = '经销商资产'; |
| | | ast2.AccountId = depart.Id; |
| | | ast2.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast2.Hospital__c = hospital.Id; |
| | | ast2.CurrentContract__c = contract.Id; |
| | | ast2.CurrentContract_Asset_Price__c = 0; |
| | | insert ast2; |
| | | |
| | | asset ast3 = new asset(); |
| | | ast3.Name = prd4.Name; |
| | | ast3.Product2Id = prd4.Id; |
| | | ast3.SerialNumber = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast3.SLMark__c = 'Serial Number'; // 固定 dnInfo.SorLMark; |
| | | ast3.Guarantee_period_for_products__c = saledet1.Guarantee_period_for_products__c; |
| | | ast3.TracingCode__c = saledet1.TracingCode__c; |
| | | ast3.Guaranteen_end__c = saledet1.Sterilization_limit__c; |
| | | ast3.Barcode__c = saledet1.Bar_Code__c; |
| | | ast3.Product_Serial_No__c = saledet1.SerialLotNo__c + '(' + saledet1.TracingCode__c + ')'; |
| | | ast3.Asset_Owner__c = '经销商资产'; |
| | | ast3.AccountId = depart.Id; |
| | | ast3.Department_Class__c = section.Id; |
| | | // ast.Asset_owner_delaer_name__c = hospital.Id; |
| | | ast3.Hospital__c = hospital.Id; |
| | | ast3.CurrentContract__c = contract.Id; |
| | | ast3.CurrentContract_Asset_Price__c = 0; |
| | | insert ast3; |
| | | |
| | | |
| | | Account_Service_Of_Target__c asot=new Account_Service_Of_Target__c(); |
| | | asot.OCSM_Period_half__c='2H'; |
| | | asot.Account_HP__c=hospital.Id; |
| | | insert asot; |
| | | Account_Service_Of_Target__c asot2=new Account_Service_Of_Target__c(); |
| | | asot2.OCSM_Period_half__c='1H'; |
| | | asot2.Account_HP__c=hospital.Id; |
| | | insert asot2; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | op.ConfirmationofAward__c = 'OLY中标'; |
| | | opList.add(op); |
| | | } |
| | | if(opp.Assistant_Applied_Date__c == null && oldMap.get(opp.id).Assistant_Applied_Date__c != null){//取消合同申请日,字段清空 |
| | | // 2022-11-22 ssm DB202211311158 取消win的时候判断是否有任务 如果没有任务的话就清空 有任务的时候保留结果 |
| | | // if(opp.Assistant_Applied_Date__c == null && oldMap.get(opp.id).Assistant_Applied_Date__c != null){//取消合同申请日,字段清空 |
| | | if(opp.Assistant_Applied_Date__c == null && oldMap.get(opp.id).Assistant_Applied_Date__c != null && |
| | | !(!opp.SAP_Send_OK__c && oldMap.get(opp.id).SAP_Send_OK__c && oldMap.get(opp.id).Task_createTime__c != null)){ |
| | | Opportunity op = new Opportunity(); |
| | | op.Id = opp.Id; |
| | | op.ConfirmationofAward_createTime__c = null; |
| New file |
| | |
| | | public without sharing class AssetHandlerMEBG extends Oly_TriggerHandler { |
| | | |
| | | private Map<Id, Asset> newMap; |
| | | private Map<Id, Asset> oldMap; |
| | | private List<Asset> newList; |
| | | private List<Asset> oldList; |
| | | // @TestVisible private static Set<String> testTargetDepts; |
| | | // @TestVisible private static Id Account_Asset_Id; |
| | | // public static Boolean disabled = false; |
| | | |
| | | public AssetHandlerMEBG() { |
| | | this.newMap = (Map<Id, Asset>) Trigger.newMap; |
| | | this.oldMap = (Map<Id, Asset>) Trigger.oldMap; |
| | | this.newList = (List<Asset>) Trigger.new; |
| | | this.oldList = (List<Asset>) Trigger.old; |
| | | } |
| | | |
| | | protected override void beforeInsert() { |
| | | |
| | | assetImageBeforeTrigger(); |
| | | |
| | | assetRecordTypeUpd(); |
| | | |
| | | } |
| | | protected override void beforeUpdate() { |
| | | |
| | | assetHpDeptUpd(); |
| | | |
| | | assetImageBeforeTrigger(); |
| | | |
| | | assetRecordTypeUpd(); |
| | | |
| | | } |
| | | |
| | | protected override void beforeDelete() { |
| | | |
| | | assetRecordTypeUpd(); |
| | | |
| | | } |
| | | |
| | | private void assetHpDeptUpd() { |
| | | |
| | | List<String> accIds = new List<String>(); |
| | | |
| | | for(Asset a : newList) { |
| | | Asset olda = oldMap.get(a.Id); |
| | | if (olda.AccountId != a.AccountId |
| | | || a.AccountParentId__c != a.Department_Class__c |
| | | || a.AccountParentParentId__c != a.Hospital__c) { |
| | | if (!String.isBlank(a.AccountId)) { |
| | | accIds.add(a.AccountId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (accIds.size() > 0) { |
| | | // 診療科レコードタイプ |
| | | String[] deptTypes = new String[] {'病院', '診療科 その他', '診療科 呼吸科', '診療科 婦人科', '診療科 普外科', '診療科 泌尿科', '診療科 消化科', '診療科 耳鼻喉科'}; |
| | | List<RecordType> deptRects = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN :deptTypes]; |
| | | Map<String, String> deptRectMap = new Map<String, String>(); |
| | | for (RecordType rect : deptRects) { |
| | | deptRectMap.put(rect.Id, rect.Name); |
| | | } |
| | | // TODO 販売店のレコードタイプのMapを生成 |
| | | |
| | | Map<Id, Account> accMap = new Map<Id, Account>(); |
| | | List<Account> accs = ControllerUtil.selectAccountForTrigger(accIds); |
| | | for(Account acc : accs) { |
| | | accMap.put(acc.Id, acc); |
| | | } |
| | | |
| | | for(Asset a : newList) { |
| | | // 「診療科」に診療科を選択する場合 |
| | | Account acc = accMap.get(a.AccountId); |
| | | if (acc != null |
| | | && deptRectMap.get(acc.RecordTypeId) != null |
| | | && acc.Management_Code__c != '9999900' |
| | | ) { |
| | | if (deptRectMap.get(acc.RecordTypeId) == '病院') { |
| | | a.Department_Class__c = null; |
| | | a.Hospital__c = acc.Id; |
| | | } else { |
| | | a.Department_Class__c = acc.ParentId; |
| | | a.Hospital__c = acc.Parent.ParentId; |
| | | } |
| | | } |
| | | // TODO 「販売店」の更新 |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void assetImageBeforeTrigger(){ |
| | | |
| | | if (StaticParameter.EscapeVMCTrigger) { |
| | | return ; |
| | | } |
| | | if (trigger.isBefore) { |
| | | for(Asset newS : newList) { |
| | | if (Trigger.isUpdate && newS.Status == '使用中' |
| | | && String.isBlank(((Asset) Trigger.oldMap.get(newS.Id)).ImageAsset__c) |
| | | && !String.isBlank(newS.ImageAsset__c) |
| | | ) { |
| | | newS.ImageAssetUploadedTime__c = Datetime.now(); |
| | | newS.ImageAssetUploadedBy__c = UserInfo.getUserId(); |
| | | } |
| | | if (Trigger.isUpdate && newS.Status == '使用中' |
| | | && String.isBlank(((Asset) Trigger.oldMap.get(newS.Id)).ImageSerial__c) |
| | | && !String.isBlank(newS.ImageSerial__c) |
| | | ) { |
| | | newS.ImageSerialUploadedTime__c = Datetime.now(); |
| | | newS.ImageSerialUploadedBy__c = UserInfo.getUserId(); |
| | | } |
| | | |
| | | System.debug('-------->Start'); |
| | | if(Trigger.isUpdate && !String.isBlank(((Asset)Trigger.oldMap.get(newS.Id)).Reson_Can_not_Warranty__c)){ |
| | | String reason = ((Asset)Trigger.oldMap.get(newS.Id)).Reson_Can_not_Warranty__c; |
| | | |
| | | System.debug('oldreason'+reason); |
| | | System.debug('reason'+newS.Reson_Can_not_Warranty__c); |
| | | System.debug('Asset_Owner__c'+newS.Asset_Owner__c); |
| | | if(newS.Asset_Owner__c != '病院資産'){ |
| | | if(newS.Reson_Can_not_Warranty__c != null){ |
| | | if(!newS.Reson_Can_not_Warranty__c.contains('备品')){ |
| | | // newS.Reson_Can_not_Warranty__c = reason + '备品'; |
| | | newS.Reson_Can_not_Warranty__c = newS.Reson_Can_not_Warranty__c + '备品'; |
| | | } |
| | | }else{ |
| | | newS.Reson_Can_not_Warranty__c = '备品'; |
| | | } |
| | | |
| | | }else{ |
| | | if(newS.Reson_Can_not_Warranty__c != null){ |
| | | if(newS.Reson_Can_not_Warranty__c.contains('备品')){ |
| | | //newS.Reson_Can_not_Warranty__c = reason.replace('备品', ''); |
| | | newS.Reson_Can_not_Warranty__c = newS.Reson_Can_not_Warranty__c.replace('备品', ''); |
| | | } |
| | | } |
| | | } |
| | | if(newS.Final_Examination_Date__c != null){ |
| | | if(Date.today().addDays(-90) > newS.Final_Examination_Date__c){ |
| | | if(!reason.contains('点检')){ |
| | | newS.Reson_Can_not_Warranty__c = reason + '点检'; |
| | | } |
| | | }else{ |
| | | if(reason.contains('点检')){ |
| | | newS.Reson_Can_not_Warranty__c = reason.replace('点检', ''); |
| | | } |
| | | } |
| | | }else{ |
| | | if(reason.contains('点检')){ |
| | | newS.Reson_Can_not_Warranty__c = reason.replace('点检', ''); |
| | | } |
| | | } |
| | | |
| | | }else if(Trigger.isInsert || Trigger.isUpdate && String.isBlank(((Asset)Trigger.oldMap.get(newS.Id)).Reson_Can_not_Warranty__c)){ |
| | | if(newS.Asset_Owner__c != '病院資産'){ |
| | | newS.Reson_Can_not_Warranty__c = '备品'; |
| | | }else{ |
| | | if(newS.Reson_Can_not_Warranty__c != null){ |
| | | if(newS.Reson_Can_not_Warranty__c.contains('备品')){ |
| | | //newS.Reson_Can_not_Warranty__c = reason.replace('备品', ''); |
| | | newS.Reson_Can_not_Warranty__c = newS.Reson_Can_not_Warranty__c.replace('备品', ''); |
| | | } |
| | | } |
| | | } |
| | | if(newS.Final_Examination_Date__c != null){ |
| | | if(Date.today().addDays(-90) > newS.Final_Examination_Date__c){ |
| | | newS.Reson_Can_not_Warranty__c = '点检'; |
| | | } |
| | | } |
| | | |
| | | } |
| | | System.debug('-------->End'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void assetRecordTypeUpd(){ |
| | | |
| | | if (StaticParameter.EscapeVMCTrigger) { |
| | | return ; |
| | | } |
| | | //add by gzw 20210729 end |
| | | List<String> cdList = new List<String>(); |
| | | if (trigger.isBefore && (trigger.isInsert || trigger.isUpdate)) { |
| | | for(Asset ass : newList) { |
| | | ass.RecordTypeID__c = ass.RecordTypeId; |
| | | // 注残设置 |
| | | if (!String.isBlank(ass.Order_No__c) && ass.Backorder__c == null) { |
| | | cdList.add(ass.Order_No__c); |
| | | } |
| | | |
| | | // HWAG-AWLAU6 2018/3/7 "是否多年保修"的值拷贝到"是否多年保修(文本)"中 |
| | | if (trigger.isUpdate && ((Asset)Trigger.oldMap.get(ass.Id)).IS_Extend_Gurantee_Txt__c != ass.IS_Extend_Gurantee_Txt__c) { |
| | | ass.Extend_Gurantee_Txt_Manual__c = true; |
| | | } else { |
| | | if (ass.IS_Extend_Gurantee__c != ass.IS_Extend_Gurantee_Txt__c && ass.Extend_Gurantee_Txt_Manual__c == false) { |
| | | ass.IS_Extend_Gurantee_Txt__c = ass.IS_Extend_Gurantee__c; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (cdList.size() > 0) { |
| | | List<Statu_Achievements__c> saList = [select Id, Name, ContractNO__c from Statu_Achievements__c where ContractNO__c IN : cdList AND Valid_Statu_Achievements__c = 1]; |
| | | if (saList != null && saList.size() > 0) { |
| | | Map<String, String> saMap = new Map<String, String>(); |
| | | for (Statu_Achievements__c sa : saList) { |
| | | saMap.put(sa.ContractNO__c, sa.Id); |
| | | } |
| | | for (Asset a : newList) { |
| | | for (String s : saMap.keySet()) { |
| | | if (a.Order_No__c == s) { |
| | | a.Backorder__c = saMap.get(s); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (trigger.isBefore && trigger.isDelete) { |
| | | cdList = new List<String>(); |
| | | Map<String, String> delMap = new Map<String, String>(); |
| | | for (Asset delId : oldList) { |
| | | cdList.add(delId.Id); |
| | | } |
| | | if (cdList.size() > 0) { |
| | | List<AggregateResult> mcList = [select Max(Id) Id, Asset__c |
| | | from Maintenance_Contract_Asset__c where Asset__c In : cdList group by Asset__c]; |
| | | List<AggregateResult> reList = [select Max(id) Id, Delivered_Product__c from Repair__c |
| | | where Status1__c != '0.删除' and Delivered_Product__c In : cdList group by Delivered_Product__c]; |
| | | List<AggregateResult> qisList = [select Max(Id) Id, nonyushohin__c from QIS_Report__c |
| | | where nonyushohin__c In : cdList group by nonyushohin__c]; |
| | | if (mcList != null && mcList.size() > 0) { |
| | | for (AggregateResult mc : mcList) { |
| | | delMap.put(String.valueOf(mc.get('Asset__c')), String.valueOf(mc.get('Asset__c'))); |
| | | } |
| | | } |
| | | if (reList != null && reList.size() > 0) { |
| | | for (AggregateResult re : reList) { |
| | | delMap.put(String.valueOf(re.get('Delivered_Product__c')), String.valueOf(re.get('Delivered_Product__c'))); |
| | | } |
| | | } |
| | | if (qisList != null && qisList.size() > 0) { |
| | | for (AggregateResult qis : qisList) { |
| | | delMap.put(String.valueOf(qis.get('nonyushohin__c')), String.valueOf(qis.get('nonyushohin__c'))); |
| | | } |
| | | } |
| | | } |
| | | for (Asset adel : oldList) { |
| | | if (delMap.containsKey(adel.Id)) { |
| | | adel.addError('该设备存在维修合同、修理或QIS,不能删除。'); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | ' previousTotalContractAmount__c , currentTotalContractAmountVM__c , currentTotalGuaranteePrice__c '+ |
| | | ' , RecordType_DeveloperName__c ' + |
| | | ' from Maintenance_Contract__c ' |
| | | + ' where Status__c in (\'契約\',\'契約満了\') ' |
| | | //URF限次合同2期 LY 20220811 start |
| | | + 'and URF_Contract__c = false'; |
| | | //URF限次合同2期 LY 20220811 end |
| | | + ' where Status__c in (\'契約\',\'契約満了\') '; |
| | | |
| | | if (string.isNotBlank(TestID) ) { |
| | | query += ' and id =: TestID'; |
| | | } else if (TestIDList != null && TestIDList.size() > 0) { |
| | |
| | | |
| | | global void execute(Database.BatchableContext BC, |
| | | list<Maintenance_Contract__c> MCList) { |
| | | //URF限次合同2期 LY 20220908 start |
| | | set<id> mcIDSet = new set<id>(); |
| | | for (Maintenance_Contract__c tempMCA : MCList) { |
| | | mcIDSet.add(tempMCA.id); |
| | | } |
| | | //获取非限次合同 |
| | | List<Maintenance_Contract__c> mcPList =[select id , previousTotalRepairAmount__c , currentTotalRepairAmount__c , |
| | | previousTotalContractAmount__c , currentTotalContractAmountVM__c , currentTotalGuaranteePrice__c |
| | | , RecordType_DeveloperName__c |
| | | from Maintenance_Contract__c |
| | | where URF_Contract__c = false and ID in :mcIDSet]; |
| | | //获取限次合同 |
| | | List<Maintenance_Contract__c> urfMCList =[select id , previousTotalRepairAmount__c , currentTotalRepairAmount__c , |
| | | previousTotalContractAmount__c , currentTotalContractAmountVM__c , currentTotalGuaranteePrice__c |
| | | , RecordType_DeveloperName__c |
| | | from Maintenance_Contract__c |
| | | where URF_Contract__c = true and ID in :mcIDSet]; |
| | | |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | map<string, asset> updateAssetMap = new map<string, asset>(); |
| | | map<string, Maintenance_Contract__c> UpdateMCMap = |
| | |
| | | Set<ID> allAssetIDSet = new Set<ID>(); |
| | | List<asset> allAssetList = new List<asset>(); |
| | | // 初始化维修合同消费率相关金额字段为0; |
| | | for (Maintenance_Contract__c tempMC : MCList) { |
| | | for (Maintenance_Contract__c tempMC : mcPList) { |
| | | mcIDmap.put(tempMC.id,null); |
| | | tempMC.currentTotalRepairAmount__c = 0; |
| | | tempMC.previousTotalRepairAmount__c = 0; |
| | |
| | | } |
| | | |
| | | } |
| | | //URF限次合同2期 LY 20220908 start |
| | | Map<string,Maintenance_Contract__c> mcURFIDmap = new Map<string,Maintenance_Contract__c>(); |
| | | for (Maintenance_Contract__c tempURFMC : urfMCList) { |
| | | mcURFIDmap.put(tempURFMC.Id, null); |
| | | } |
| | | //检索本次限次合同的保有设备 |
| | | List<Maintenance_Contract_Asset__c> mcURFList = |
| | | [select Id, Asset__c, Maintenance_Contract__c, |
| | | Estimate_Cost_formula__c, |
| | | startDate_sum__c, |
| | | endDate_sum__c, |
| | | No_discount__c, |
| | | GuaranteePrice_Amount_Text__c, |
| | | Maintenance_Contract__r.Status__c, |
| | | Maintenance_Contract__r.Name, |
| | | Maintenance_Contract__r.Contract_End_Date__c, |
| | | Maintenance_Contract__r.Contract_Start_Date__c, |
| | | Maintenance_Contract__r.RecordType_DeveloperName__c, |
| | | Maintenance_Contract__r.Estimation_Id__r.Submit_quotation_day__c, |
| | | Maintenance_Contract__r.RecordType.DeveloperName |
| | | , ifHaveleftInPrevious__c |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c in: mcURFIDmap.keyset() |
| | | ]; |
| | | Set<ID> allURFAssetIDSet = new Set<ID>(); |
| | | Map<string, Maintenance_Contract_Asset__c> assetIDtoURF =new Map<string, Maintenance_Contract_Asset__c>(); |
| | | for (Maintenance_Contract_Asset__c mcaURF : mcURFList) { |
| | | // 找出来检索出来的维修合同保有中的最新的 |
| | | if (assetIDtoURF.containsKey(mcaURF.Asset__c)) { |
| | | Maintenance_Contract_Asset__c tempURF = |
| | | assetIDtoURF.get(mcaURF.Asset__c); |
| | | if (tempURF.endDate_sum__c < mcaURF.endDate_sum__c) { |
| | | assetIDtoURF.put(mcaURF.Asset__c, mcaURF); |
| | | } |
| | | } else { |
| | | assetIDtoURF.put(mcaURF.Asset__c, mcaURF); |
| | | } |
| | | allURFAssetIDSet.add(mcaURF.Asset__c); |
| | | } |
| | | List<asset> allURFAssetList =[select id, URF_Maintenance_Contract__c |
| | | from asset |
| | | where id in: allURFAssetIDSet]; |
| | | for (asset ass : allURFAssetList) { |
| | | Maintenance_Contract_Asset__c tempMCA = |
| | | assetIDtoURF.get(ass.Id); |
| | | ass.URF_Maintenance_Contract__c = tempMCA.Maintenance_Contract__c; |
| | | updateAssetMap.put(ass.id, ass); |
| | | |
| | | } |
| | | //URF限次合同2期 LY 20220908 end |
| | | //检索出历届保有设备 |
| | | list<Maintenance_Contract_Asset__c> allMCAList = |
| | | [select Id, Asset__c, Maintenance_Contract__c, |
| | |
| | | failedCount ++; |
| | | } |
| | | } |
| | | system.debug('11111111111111111111111updateAssetMap'+updateAssetMap.values()); |
| | | updateAsset (updateAssetMap.values()); |
| | | } |
| | | global void finish(Database.BatchableContext BC) { |
| | |
| | | if (TestIDList != null && TestIDList.size() > 0) { |
| | | return Database.getQueryLocator([select id from asset where Id in : TestIDList]); |
| | | }else{ |
| | | return Database.getQueryLocator([select id from asset]); |
| | | // 20221117 ljh DB202211258553 start |
| | | // return Database.getQueryLocator([select id from asset]); |
| | | return Database.getQueryLocator([select id from asset where IsCompetitorProduct = false AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET')]); |
| | | // 20221117 ljh DB202211258553 end |
| | | // return Database.getQueryLocator([select id from asset where Id in : assetList]); |
| | | } |
| | | } |
| New file |
| | |
| | | global class AssetWhereAbout2Batch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | global AssetWhereAbout2Batch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | ///多年保修未到期且未签约合同的设备 |
| | | query = 'select id,AssetWhereabouts__c from Asset where IS_Extend_Gurantee_Txt__c = true and Gurantee_End_day1__c <0 and IF_Renewalrate_Target_Asset_F__c= 0 '; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Asset> assList) { |
| | | Map<String,Asset> assMap = new Map<String,Asset>(); |
| | | for (Asset as1:assList) { |
| | | Asset ass = new Asset(); |
| | | ass.id = as1.id; |
| | | ass.AssetWhereabouts__c = '多年保修期内'; |
| | | |
| | | if (!assMap.containsKey(ass.id)) { |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } |
| | | if (assMap.values()!=null && assMap.values().size()!= 0) { |
| | | update assMap.values(); |
| | | } |
| | | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class AssetWhereAbout2BatchTest { |
| | | @testSetup |
| | | private static void init(){ |
| | | |
| | | List<Product2> prs = new List<Product2>(); |
| | | |
| | | Product2 pr1 = new Product2( |
| | | Name = 'aiueo商品1_name', |
| | | ProductCode = 'OT1', |
| | | Asset_Model_No__c = 'aiueo商品12345678901234567890123456789012345678901234567890123456789012345678901234567890', |
| | | IsActive = true, |
| | | SFDA_Status__c = '有効' |
| | | ); |
| | | prs.add(pr1); |
| | | Product2 pr2 = new Product2( |
| | | Name = 'aiueo商品2_name', |
| | | ProductCode = 'OT2', |
| | | Asset_Model_No__c = 'aiueo商品2', |
| | | IsActive = false, // 同期されない |
| | | SFDA_Status__c = '不要' |
| | | ); |
| | | prs.add(pr2); |
| | | Product2 pr3 = new Product2( |
| | | Name = 'aiueo商品3_name', |
| | | ProductCode = 'OT3', |
| | | Asset_Model_No__c = 'aiueo商品3', |
| | | IsActive = true, |
| | | SFDA_Status__c = '準備中' |
| | | ); |
| | | prs.add(pr3); |
| | | insert prs; |
| | | |
| | | Product_Set__c ps1 = new Product_Set__c(); |
| | | ps1.Name = 'セット品1'; |
| | | ps1.Product_Set_CD__c = '111111'; |
| | | ps1.Description__c = '説明'; |
| | | ps1.Qty__c = 10; |
| | | //ps1.Valid__c = true; |
| | | ps1.Valid_Date__c = date.today().addDays(-5); |
| | | insert ps1; |
| | | |
| | | Product_Set_Detail__c psd1 = new Product_Set_Detail__c(); |
| | | psd1.Product_Set__c = ps1.id; |
| | | psd1.Price__c = 100; |
| | | psd1.Quantity__c = 10; |
| | | psd1.Product__c = pr1.id; |
| | | insert psd1; |
| | | |
| | | Product_Set_Detail__c psd2 = new Product_Set_Detail__c(); |
| | | psd2.Product_Set__c = ps1.id; |
| | | psd2.Price__c = 100; |
| | | psd2.Quantity__c = 10; |
| | | psd2.Product__c = pr3.id; |
| | | insert psd2; |
| | | |
| | | List<Product2__c> prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | |
| | | |
| | | pr3 = [select Id from Product2 where Id = :pr3.Id]; |
| | | pr3.SFDA_Status__c = '停止'; |
| | | update pr3; |
| | | prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | System.assertEquals(2, prcs.size()); |
| | | pr2 = [select Id from Product2 where Id = :pr2.Id]; |
| | | pr2.IsActive = true; |
| | | update pr2; |
| | | prcs = [select Id, Name, Name_Text__c, OT_CODE_Text__c from Product2__c where Product2__c in :prs order by Product2__c.Name]; |
| | | |
| | | System.assertEquals('aiueo商品1234567890123456789012345678901234567890123456789012345678901234567890123', prcs[0].Name); |
| | | System.assertEquals('aiueo商品2', prcs[1].Name); |
| | | System.assertEquals('aiueo商品3', prcs[2].Name); |
| | | System.assertEquals('aiueo商品1_name', prcs[0].Name_Text__c); |
| | | System.assertEquals('aiueo商品2_name', prcs[1].Name_Text__c); |
| | | System.assertEquals('aiueo商品3_name', prcs[2].Name_Text__c); |
| | | System.assertEquals('OT1', prcs[0].OT_CODE_Text__c); |
| | | System.assertEquals('OT2', prcs[1].OT_CODE_Text__c); |
| | | System.assertEquals('OT3', prcs[2].OT_CODE_Text__c); |
| | | |
| | | pr1.SFDA_Status__c = '新製品申請中'; |
| | | pr2.SFDA_Status__c = '準備中'; |
| | | pr3.SFDA_Status__c = '有効(再申請中)'; |
| | | update new Product2[] {pr1, pr2, pr3}; |
| | | prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | |
| | | |
| | | //delete pr3; |
| | | prcs = [select Id from Product2__c where Product2__c in :prs]; |
| | | System.assertEquals(3, prcs.size()); |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = '診療科1'; |
| | | depart1.ParentId = dc1s[0].Id; |
| | | depart1.Department_Class__c = dc1s[0].Id; |
| | | depart1.Hospital__c = company1.Id; |
| | | |
| | | insert new Account[] {depart1}; |
| | | |
| | | Asset ast1 = new Asset(); |
| | | ast1.SerialNumber = 'abcdefg'; |
| | | ast1.Name = '测试资产1'; |
| | | ast1.AccountId = depart1.Id; |
| | | ast1.Department_Class__c = dc1s[0].Id; |
| | | ast1.Hospital__c = company1.Id; |
| | | ast1.Product2Id = pr1.Id; |
| | | ast1.Guarantee_period_for_products__c = Date.today(); |
| | | ast1.InstallDate = Date.today(); |
| | | //ast1.Manage_type__c = '个体管理'; |
| | | ast1.FirstApproveDate_old__c = Date.today().addDays(-30); |
| | | ast1.Loaner_accsessary__c = true; |
| | | ast1.Gurantee_End_day1__c = -100; |
| | | ast1.IS_Extend_Gurantee_Txt__c = true; |
| | | ast1.IF_Renewalrate_Target_Asset__c = '0'; |
| | | insert ast1; |
| | | |
| | | Asset ast2 = new Asset(); |
| | | ast2.SerialNumber = '12345'; |
| | | ast2.Name = '测试资产2'; |
| | | ast2.AccountId = depart1.Id; |
| | | ast2.Department_Class__c = dc1s[0].Id; |
| | | ast2.Hospital__c = company1.Id; |
| | | ast2.Product2Id = pr2.Id; |
| | | ast2.Guarantee_period_for_products__c = Date.today(); |
| | | ast2.InstallDate = Date.today(); |
| | | //ast2.Manage_type__c = '个体管理'; |
| | | ast2.IS_Extend_Gurantee_Txt__c = true; |
| | | ast2.Loaner_accsessary__c = true; |
| | | ast2.Gurantee_End_day1__c = -100; |
| | | ast2.IF_Renewalrate_Target_Asset__c = '0'; |
| | | insert ast2; |
| | | |
| | | pr1.Extend_new_product_gurantee__c = true; |
| | | pr1.Extend_Gurantee_Start__c = Date.today().addDays(-60); |
| | | pr1.Extend_Gurantee_End__c = Date.today().addDays(60); |
| | | update pr1; |
| | | |
| | | pr2.Extend_new_product_gurantee__c = false; |
| | | update pr2; |
| | | } |
| | | static testMethod void testMethod1() { |
| | | System.Test.startTest(); |
| | | Oly_TriggerHandler.bypass(Product2Handler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(AssetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(FixtureSetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyTriggerHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyEquipmentSetHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(RentalApplyEquipmentSetDetailHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass(ContactTriggerHandler.Class.getName()); |
| | | Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractTrigger'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractAfterUpdate'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractBeforeDelete'); |
| | | Oly_TriggerHandler.bypass('MaintenanceContractHpDeptUpd'); |
| | | Oly_TriggerHandler.bypass('NFM106Controller'); |
| | | Oly_TriggerHandler.bypass('NFM106Trigger'); |
| | | Oly_TriggerHandler.bypass('AssetRecordTypeUpd'); |
| | | Oly_TriggerHandler.bypass('NFM101Controller'); |
| | | Oly_TriggerHandler.bypass('NFM001Controller'); |
| | | Oly_TriggerHandler.bypass('SyncProduct2'); |
| | | List<Asset> assList = [select id ,name,IS_Extend_Gurantee_Txt__c,Gurantee_End_day1__c,IF_Renewalrate_Target_Asset_F__c,AssetWhereabouts__c from Asset ]; |
| | | system.debug('@@@@@@@@@@@@设备集合='+assList); |
| | | Database.executeBatch(new AssetWhereAbout2Batch(),200); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | global class AssetWhereabouts implements Database.Batchable<sObject>,Database.Stateful { |
| | | public String query; |
| | | public BatchIF_Log__c iflog ; |
| | | public Date toDay = Date.today().addYears(-1); |
| | | public Date toDay = Date.today(); |
| | | public List < String > assetIdList; |
| | | global AssetWhereabouts() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global AssetWhereabouts(List < String > assetIdList) { |
| | | this.query = query; |
| | | this.assetIdList = assetIdList; |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'PushNotification'; |
| | | iflog.Log__c = 'AssetWhereabouts start\n'; |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | | query = 'select id,Asset__c,Maintenance_Contract__c,Asset__r.CurrentContract__r.RecordType_Name__c,Asset__r.CurrentContract__r.Status__c' |
| | | +' from Maintenance_Contract_Asset__c where Asset__r.AssetWhereabouts__c = null '; |
| | | query = 'select id,Asset__r.AssetWhereabouts__c,Maintenance_Contract__r.status__c ,Asset__r.id,Maintenance_Contract__r.id,endDateGurantee_Text__c ' |
| | | +' from Maintenance_Contract_Asset__c where Maintenance_Contract__r.RecordType_Name__c =\'多年保修合同\' and endDateGurantee_Text__c < :toDay and Asset__r.AssetWhereabouts__c!=\'服务合同\''; |
| | | if (assetIdList != null && assetIdList.size() > 0) { |
| | | query += ' and Asset__c in :assetIdList '; |
| | | } |
| | | query += ' order by CreatedDate '; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Maintenance_Contract_Asset__c> mcaList) { |
| | | List<Asset> Asslist = new List<Asset>(); |
| | | List<String> mcList = new List<String>(); |
| | | List<Repair__c> reList = [select id,Maintenance_Contract__c,Status1__c,DateReceiptQuestions__c |
| | | from Repair__c |
| | | where DateReceiptQuestions__c >= :toDay and Status1__c != '0.取消' and Status1__c != '0.删除' and Maintenance_Contract__c != null]; |
| | | System.debug('reList=='+reList); |
| | | for (Repair__c re: reList) { |
| | | mcList.add(re.Maintenance_Contract__c); |
| | | Map<String,Asset> assMap = new Map<String,Asset>(); |
| | | // 用作查询合同中的服务合同 |
| | | Set<String> assSet = new Set<String>(); |
| | | Set<String> fuwuSet = new Set<String>(); |
| | | // 用作查询一般维修 |
| | | Set<String> weixiuSet = new Set<String>(); |
| | | Map<String,Repair__c> mcMap = new Map<String,Repair__c>(); |
| | | for (Maintenance_Contract_Asset__c mca: mcaList) { |
| | | assSet.add(mca.Asset__r.id); |
| | | weixiuSet.add(mca.Asset__r.id); |
| | | } |
| | | System.debug('mcaList=='+mcaList ); |
| | | |
| | | // 查询符合条件的修理 |
| | | List<Repair__c> reList = [select id,Maintenance_Contract__r.id,Status1__c,Failure_Occurrence_Date__c,CreatedDate,Delivered_Product__c |
| | | from Repair__c |
| | | where Status1__c != '0.取消' and Status1__c != '0.删除' and Status2__c != '00.删除' and Status2__c != '00.取消' |
| | | and Maintenance_Contract__c = null and Delivered_Product__c in :weixiuSet order by CreatedDate ]; |
| | | for (Repair__c re: reList) { |
| | | if ( mcMap.get(re.Delivered_Product__c)==null) { |
| | | mcMap.put(re.Delivered_Product__c,re); |
| | | } |
| | | // 取最近一期的修理记录 |
| | | if( mcMap.get(re.Delivered_Product__c)!=null && re.CreatedDate>mcMap.get(re.Delivered_Product__c).CreatedDate){ |
| | | mcMap.remove(re.Delivered_Product__c); |
| | | mcMap.put(re.Delivered_Product__c,re); |
| | | } |
| | | } |
| | | // 查询是否有合同中的服务合同 |
| | | list<Maintenance_Contract_Asset__c> mcaList2 = [select Id,Asset__r.id from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__r.RecordType_Name__c ='服务合同' |
| | | and Maintenance_Contract__r.status__c ='契約' and Asset__c in :assSet]; |
| | | for (Maintenance_Contract_Asset__c mca: mcaList2) { |
| | | fuwuSet.add(mca.Asset__r.id); |
| | | } |
| | | |
| | | |
| | | for (Maintenance_Contract_Asset__c mca: mcaList) { |
| | | Asset ass = new Asset(); |
| | | // System.debug('mca.Maintenance_Contract__r.RecordType_Name__c=='+mca.Maintenance_Contract__r.RecordType_Name__c); |
| | | // System.debug('mca.Maintenance_Contract__r.Status__c=='+mca.Maintenance_Contract__r.Status__c); |
| | | if (mca.Asset__r.CurrentContract__r.RecordType_Name__c == '服务合同' && mca.Asset__r.CurrentContract__r.Status__c == '契約') { |
| | | ass.id = mca.Asset__c; |
| | | Date PassDay = mca.endDateGurantee_Text__c.addyears(1); |
| | | Boolean isXiuli = false; |
| | | // 判断修理是否是未来1年内 |
| | | if (mcMap.get(mca.Asset__r.id)!=null &&mcMap.get(mca.Asset__r.id).Failure_Occurrence_Date__c>mca.endDateGurantee_Text__c && mcMap.get(mca.Asset__r.id).Failure_Occurrence_Date__c < PassDay) { |
| | | isXiuli = true; |
| | | } |
| | | // 去向:服务合同 关联的执行中合同记录为【服务合同】状态为契约 |
| | | if (fuwuSet.contains(mca.Asset__r.id)) { |
| | | ass.id = mca.Asset__r.id; |
| | | ass.AssetWhereabouts__c = '服务合同'; |
| | | if (!Asslist.contains(ass)) { |
| | | Asslist.add(ass); |
| | | if (assMap.containsKey(ass.id)&&assMap.get(ass.id).AssetWhereabouts__c =='其他') { |
| | | assMap.remove(ass.id); |
| | | assMap.put(ass.id,ass); |
| | | }else{ |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } |
| | | else if(mca.Asset__r.CurrentContract__r.Status__c != '契約' && mcList.contains(mca.Maintenance_Contract__c)){ |
| | | // 去向:一般维修 |
| | | else if(mca.Maintenance_Contract__r.status__c != '契約' && isXiuli){ |
| | | ass.id = mca.Asset__c; |
| | | ass.AssetWhereabouts__c = '一般维修'; |
| | | if (!Asslist.contains(ass)) { |
| | | Asslist.add(ass); |
| | | } |
| | | } else{ |
| | | if (assMap.containsKey(ass.id)&&assMap.get(ass.id).AssetWhereabouts__c =='其他') { |
| | | assMap.remove(ass.id); |
| | | assMap.put(ass.id,ass); |
| | | }else{ |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } else { |
| | | // 去向:其他 |
| | | ass.id = mca.Asset__c; |
| | | ass.AssetWhereabouts__c = '其他'; |
| | | if (!Asslist.contains(ass)) { |
| | | Asslist.add(ass); |
| | | |
| | | if (!assMap.containsKey(ass.id)) { |
| | | assMap.put(ass.id,ass); |
| | | } |
| | | } |
| | | } |
| | | if (Asslist!=null && Asslist.size()!= 0) { |
| | | update Asslist; |
| | | system.debug('更新数据='+assMap.values()); |
| | | if (assMap.values()!=null && assMap.values().size()!= 0) { |
| | | update assMap.values(); |
| | | } |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | iflog.Log__c += '\nAssetWhereabouts end'; |
| | | String tmp = iflog.ErrorLog__c; |
| | | integer i=0; |
| | |
| | | } |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | update iflog; |
| | | } |
| | | } |
| | |
| | | insert productA; |
| | | |
| | | // 第一期合同 |
| | | Maintenance_Contract__c contract1 = new Maintenance_Contract__c(); |
| | | Maintenance_Contract__c contract1 = new Maintenance_Contract__c(); |
| | | contract1.Name = 'tect contract1'; |
| | | contract1.Not_Upper_limit_reason__c = 'tect contract1'; |
| | | contract1.RecordtypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract1.Hospital__c = hospital.Id; |
| | | contract1.Switch_TimeBase_WF__c = true; |
| | | contract1.Department_Class__c = strategicDep[0].Id; |
| | | contract1.Department__c = dep.Id; |
| | | contract1.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | contract1.Maintenance_Contract_No__c = 'tect contract1'; |
| | | contract1.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract1.Payment_Plan_Sum_First__c = 1; |
| | | contract1.Status__c = '契約'; |
| | | contract1.Contract_Start_Date__c = Date.today().addMonths(-14); |
| | | contract1.Contract_End_Date__c = Date.today().addMonths(-2); |
| | | contract1.Maintenance_Contract_No__c = '11123'; |
| | | contract1.recordtypeId = |
| | | Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract1.Not_Upper_limit_reason__c = ' 1'; |
| | | contract1.Contract_Start_Date__c = Date.today().addDays( -10); |
| | | contract1.Contract_End_Date__c = Date.today().addDays( 5); |
| | | contract1.SalesOfficeCode_selection__c = '北京RC'; |
| | | insert contract1; |
| | | |
| | | // 第二期合同 |
| | | // Maintenance_Contract__c contract2 = new Maintenance_Contract__c(); |
| | | // contract2.Name = 'tect contract2'; |
| | | // contract2.Not_Upper_limit_reason__c = 'tect contract2'; |
| | | // contract2.RecordtypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | // contract2.Hospital__c = hospital.Id; |
| | | // contract1.Switch_TimeBase_WF__c = true; |
| | | // contract2.Department_Class__c = strategicDep[0].Id; |
| | | // contract2.Department__c = dep.Id; |
| | | // contract2.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | // contract2.Maintenance_Contract_No__c = 'tect contract2'; |
| | | // contract2.Status__c = '契約満了'; |
| | | // contract2.Contract_Start_Date__c = Date.today().addMonths(-13); |
| | | // contract2.Contract_End_Date__c = Date.today().addMonths(-1); |
| | | // insert contract2; |
| | | Maintenance_Contract__c contract12 = new Maintenance_Contract__c(); |
| | | contract12.Name = 'tect contract12'; |
| | | contract12.Not_Upper_limit_reason__c = 'tect contract12'; |
| | | contract12.RecordtypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId(); |
| | | contract12.Hospital__c = hospital.Id; |
| | | contract1.Switch_TimeBase_WF__c = true; |
| | | contract12.Department_Class__c = strategicDep[0].Id; |
| | | contract12.Department__c = dep.Id; |
| | | contract12.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | contract12.Maintenance_Contract_No__c = 'tect contract12'; |
| | | contract12.Status__c = '契約満了'; |
| | | contract12.Contract_Start_Date__c = Date.today().addMonths(-13); |
| | | contract12.Contract_End_Date__c = Date.today().addMonths(-1); |
| | | insert contract12; |
| | | // insert new Maintenance_Contract__c[] {contract1}; |
| | | |
| | | System.debug('contract1 =='+ contract1 ); |
| | |
| | | // } |
| | | // List<Maintenance_Contract__c> listmc1 = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | System.debug('listmc'+listmc); |
| | | // System.debug('contract2.Status__c =='+ contract2.Status__c ); |
| | | // System.debug('contract12.Status__c =='+ contract12.Status__c ); |
| | | Asset asset = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset.RecordTypeId = System.Label.Asset_RecordType; |
| | |
| | | asset.SalesProvince__c = '北京'; |
| | | asset.CurrentContract__c = contract1.Id; |
| | | asset.CurrentContract_Asset_Price__c = 0; |
| | | //System.Test.startTest(); |
| | | insert new Asset[] {asset}; |
| | | insert asset; |
| | | Asset asset2 = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset2.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset2.SerialNumber = 'ass02'; |
| | | asset2.Name = 'ass02'; |
| | | asset2.AccountId = dep.Id; |
| | | asset2.Department_Class__c = strategicDep[0].Id; |
| | | asset2.Hospital__c = hospital.Id; |
| | | asset2.Product2Id = productA.Id; |
| | | asset2.Quantity = 1; |
| | | asset2.Status = '有库存'; |
| | | asset2.Manage_type__c = '个体管理'; |
| | | asset2.Loaner_accsessary__c = false; |
| | | asset2.Out_of_wh__c = 0; |
| | | asset2.Salesdepartment__c = '1.华北营业本部'; |
| | | asset2.Internal_asset_location__c = '北京 备品中心'; |
| | | asset2.Product_category__c = 'GI'; |
| | | asset2.Equipment_Type__c = '产品试用'; |
| | | asset2.SalesProvince__c = '北京'; |
| | | asset2.CurrentContract__c = contract12.Id; |
| | | asset2.CurrentContract_Asset_Price__c = 0; |
| | | insert asset2; |
| | | //System.Test.stopTest(); |
| | | |
| | | Maintenance_Contract_Asset__c contractasset1 = new Maintenance_Contract_Asset__c(); |
| | | contractasset1.Asset__c = asset.Id; |
| | | contractasset1.Maintenance_Contract__c = contract1.Id; |
| | | contractasset1.Estimate_List_Price_All_Manual__c = 1000; |
| | | insert contractasset1; |
| | | // contractasset.Maintenance_Contract_Asset_Estimate__c = mcae1.id; |
| | | Maintenance_Contract_Asset__c contractasset2 = new Maintenance_Contract_Asset__c(); |
| | | contractasset2.Asset__c = asset.Id; |
| | | contractasset2.Maintenance_Contract__c = contract1.Id; |
| | | insert contractasset2; |
| | | // insert new list<Maintenance_Contract_Asset__c> {contractasset1,contractasset2 }; |
| | | |
| | | Maintenance_Contract_Asset__c contract1asset1 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset1.Asset__c = asset.Id; |
| | | contract1asset1.endDateGurantee_Text__c = Date.today().addYears(-1); |
| | | contract1asset1.Maintenance_Contract__c = contract1.Id; |
| | | contract1asset1.Estimate_List_Price_All_Manual__c = 1000; |
| | | insert contract1asset1; |
| | | // contract1asset.Maintenance_Contract_Asset_Estimate__c = mcae1.id; |
| | | Maintenance_Contract_Asset__c contract1asset2 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset2.Asset__c = asset2.Id; |
| | | contract1asset2.endDateGurantee_Text__c = Date.today().addYears(-1); |
| | | contract1asset2.Maintenance_Contract__c = contract12.Id; |
| | | insert contract1asset2; |
| | | // insert new list<Maintenance_Contract_Asset__c> {contract1asset1,contract1asset2 }; |
| | | Maintenance_Contract_Asset__c contract1asset3 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset3.Asset__c = asset.Id; |
| | | contract1asset3.endDateGurantee_Text__c = Date.today().addYears(-1); |
| | | contract1asset3.Maintenance_Contract__c = contract12.Id; |
| | | insert contract1asset3; |
| | | |
| | | // repair01.Account__c = dep.Id; |
| | | |
| | |
| | | repair1.Failure_Occurrence_Date__c = Date.today().addDays(-1); |
| | | repair1.Repair_Returned_To_HP_Date__c = Date.today().addDays(3); |
| | | repair1.Repair_Shipped_Date__c = Date.today().addDays(1); |
| | | repair1.Maintenance_Contract__c = contract1.id; |
| | | System.debug('repair1.Maintenance_Contract__c =='+ repair1.Maintenance_Contract__c ); |
| | | System.debug('repair01.Status1__c =='+ repair1.Status1__c ); |
| | | system.debug('day=='+Date.today().addYears(-1)); |
| New file |
| | |
| | | public without sharing class AttachmentDisplayController { |
| | | @AuraEnabled |
| | | public static List<testInit> getFrameNumManage(String DNId){ |
| | | System.debug('DNId'+DNId); |
| | | List<testInit> newinitList = new List<testInit>(); |
| | | List<testInit> initList = new List<testInit>(); |
| | | List<FrameNumManage__c> FnmList =[SELECT Id, Name ,ManagementCode__c, ApplyList__c ,InspectionCard_Select__c ,InspectionCard_Select__r.ViewLink__c,InspectionCard_Select__r.DownloadLink__c, ApplyList_Select__c,ApplyList_Select__r.DownloadLink__c,ApplyList_Select__r.ViewLink__c, Num__c , SerialNumber__c,Material__c , MaterialDepict__c from FrameNumManage__c where signInForm__c =:DNId order by ApplyList__c desc]; |
| | | set<String> FileStrSet = new set<String>(); |
| | | List<FileAddress__c> FileList = new List<FileAddress__c>(); |
| | | Map<String,String> FileStrMap = new Map<String,String>(); |
| | | // if (FnmList.size()>0) { |
| | | // for (FrameNumManage__c nObj : FnmList ) { |
| | | // FileStrSet.add(nObj.ApplyList__c); |
| | | // } |
| | | // FileList = [SELECT Id, Name, FileName__c,ViewLink__c FROM FileAddress__c WHERE FileName__c IN: FileStrSet]; |
| | | // if(FileList.size()>0){ |
| | | // for (FileAddress__c file : FileList) { |
| | | // FileStrMap.put(file.FileName__c, file.ViewLink__c); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | Integer n = 0; // 初始化合并行数 |
| | | for (Integer i=0;i<FnmList.size() ;i++ ) { |
| | | testInit init = new testInit(); |
| | | if (i==0) { |
| | | init.Name = FnmList[i].ManagementCode__c; |
| | | init.ProductName = FnmList[i].Material__c + '-' + FnmList[i].MaterialDepict__c; |
| | | // init.code = FnmList[i].ApplyList__c; |
| | | if (String.isNotBlank(FnmList[i].ApplyList_Select__r.DownloadLink__c)) { |
| | | init.code = FnmList[i].ApplyList_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.code = '不出证'; |
| | | } //2022-11-21 zyh add 报关单判断 |
| | | if (String.isNotBlank(FnmList[i].InspectionCard_Select__r.DownloadLink__c)) { |
| | | init.sj_code = FnmList[i].InspectionCard_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.sj_code = '不出证'; |
| | | } //2022-11-21 zyh add 商检证判断 |
| | | |
| | | // init.code = FileStrMap.get(FnmList[i].ApplyList__c); |
| | | init.Num = FnmList[i].Num__c; |
| | | init.Id = FnmList[i].Id; |
| | | init.FrameNo = FnmList[i].SerialNumber__c; |
| | | n = n+1; |
| | | if (i != FnmList.size()-1) { |
| | | // 判断第一个与第二个是否一样,不一样赋值1 |
| | | if (FnmList[i].ApplyList__c != FnmList[i+1].ApplyList__c) { |
| | | init.count = n; |
| | | } |
| | | } |
| | | }else { |
| | | // 判断与前一个编码是一致 |
| | | if (FnmList[i].ApplyList__c == FnmList[i-1].ApplyList__c) { |
| | | init.Name = FnmList[i].ManagementCode__c; |
| | | init.ProductName = FnmList[i].Material__c + '-' + FnmList[i].MaterialDepict__c; |
| | | // init.code = FnmList[i].ApplyList__c; |
| | | if (String.isNotBlank(FnmList[i].ApplyList_Select__r.DownloadLink__c)) { |
| | | init.code = FnmList[i].ApplyList_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.code = '不出证'; |
| | | } //2022-11-21 zyh add 报关单判断 |
| | | if (String.isNotBlank(FnmList[i].InspectionCard_Select__r.DownloadLink__c)) { |
| | | init.sj_code = FnmList[i].InspectionCard_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.sj_code = '不出证'; |
| | | } //2022-11-21 zyh add 商检证判断 |
| | | // init.code = FileStrMap.get(FnmList[i].ApplyList__c); |
| | | init.Num = FnmList[i].Num__c; |
| | | init.Id = FnmList[i].Id; |
| | | init.FrameNo = FnmList[i].SerialNumber__c; |
| | | n = n+1; |
| | | // 判断是不是最后一个 |
| | | if (i != FnmList.size()-1) { |
| | | // 不是最后一个,判断与下一个编码一致不一致,不一致直接赋值 |
| | | if (FnmList[i].ApplyList__c != FnmList[i+1].ApplyList__c) { |
| | | init.count = n; |
| | | } |
| | | } |
| | | // 最后一个直接赋值 |
| | | if (i == FnmList.size()-1) { |
| | | init.count = n; |
| | | } |
| | | }else { |
| | | // 下一组开始 |
| | | n = 0; |
| | | init.Name = FnmList[i].ManagementCode__c; |
| | | init.ProductName = FnmList[i].Material__c + '-' + FnmList[i].MaterialDepict__c; |
| | | // init.code = FnmList[i].ApplyList__c; |
| | | if (String.isNotBlank(FnmList[i].ApplyList_Select__r.DownloadLink__c)) { |
| | | init.code = FnmList[i].ApplyList_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.code = '不出证'; |
| | | } //2022-11-21 zyh add 报关单判断 |
| | | if (String.isNotBlank(FnmList[i].InspectionCard_Select__r.DownloadLink__c)) { |
| | | init.sj_code = FnmList[i].InspectionCard_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.sj_code = '不出证'; |
| | | } //2022-11-21 zyh add 商检证判断 |
| | | // init.code = FileStrMap.get(FnmList[i].ApplyList__c); |
| | | init.Num = FnmList[i].Num__c; |
| | | init.Id = FnmList[i].Id; |
| | | init.FrameNo = FnmList[i].SerialNumber__c; |
| | | n = n+1; |
| | | } |
| | | } |
| | | initList.add(init); |
| | | } |
| | | // 倒序显示 |
| | | for (Integer i = initList.size()-1; i>=0 ; i--) { |
| | | testInit init = new testInit(); |
| | | init = initList[i]; |
| | | newinitList.add(init); |
| | | } |
| | | System.debug('newinitList'+newinitList); |
| | | System.debug('FnmList'+FnmList); |
| | | return newinitList; |
| | | |
| | | } |
| | | // 定义内部类,自定义参数 |
| | | class testInit{ |
| | | @AuraEnabled |
| | | public Boolean check; |
| | | @AuraEnabled |
| | | public String Name; |
| | | @AuraEnabled |
| | | public String ProductName; |
| | | @AuraEnabled |
| | | public String FrameNo; |
| | | @AuraEnabled |
| | | public String code; |
| | | @AuraEnabled |
| | | public String sj_code; |
| | | @AuraEnabled |
| | | public Decimal Num; |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public Integer count; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public class AttachmentDisplayControllerTest { |
| | | static testMethod void TestInit01(){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('診療科 消化科', '診療科 呼吸科') order by Name desc]; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '备品']; |
| | | if (rectAs.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // insert hospital |
| | | Account company1 = new Account(); |
| | | company1.RecordTypeId = rectCo[0].Id; |
| | | company1.Name = '病院テスト1'; |
| | | company1.OCM_man_province_txt__c = '江西'; |
| | | company1.AgentCode_Ext__c = '888888'; |
| | | List<Account> hps = new Account[]{company1}; |
| | | insert hps; |
| | | |
| | | List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = '診療科1'; |
| | | depart1.ParentId = dc1s[0].Id; |
| | | depart1.Department_Class__c = dc1s[0].Id; |
| | | depart1.Hospital__c = company1.Id; |
| | | depart1.OCM_man_province_txt__c = '江西'; |
| | | // depart1.AgentCode_Ext__c = '888888'; |
| | | |
| | | insert new Account[] {depart1}; |
| | | |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | | prd1.ProductCode_Ext__c = 'HistoryPrd1'; |
| | | prd1.ProductCode = 'HistoryPrd1'; |
| | | prd1.Repair_Product_Code__c = 'HistoryPrd1_RP'; |
| | | prd1.Name = 'HistoryPrd1'; |
| | | prd1.Manual_Entry__c = false; |
| | | prd1.Extend_new_product_gurantee__c = true; |
| | | prd1.Extend_Gurantee_Start__c = Date.today().addDays(-60); |
| | | prd1.Extend_Gurantee_End__c = Date.today().addDays(60); |
| | | prdList.add(prd1); |
| | | insert prdList; |
| | | |
| | | Asset ast = new Asset(); |
| | | |
| | | ast.RecordTypeId = rectAs[0].Id; |
| | | ast.SerialNumber = 'abcdefg'; |
| | | ast.Name = '测试资产1'; |
| | | ast.AccountId = depart1.Id; |
| | | ast.Department_Class__c = dc1s[0].Id; |
| | | ast.Hospital__c = company1.Id; |
| | | ast.Product2Id = prd1.Id; |
| | | ast.Guarantee_period_for_products__c = Date.today(); |
| | | ast.InstallDate = Date.today(); |
| | | ast.Manage_type__c = '个体管理'; |
| | | ast.FirstApproveDate_old__c = Date.today().addDays(-30); |
| | | |
| | | Oly_TriggerHandler.bypass('AssetHandler'); |
| | | |
| | | insert ast; |
| | | |
| | | Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id]; |
| | | |
| | | String RecordTypeID = ast1.RecordTypeID__c; |
| | | |
| | | System.assertEquals(RecordTypeID , ast.RecordTypeId); |
| | | |
| | | RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ]; |
| | | Opportunity opp = new Opportunity( |
| | | Name='testOpp1', |
| | | StageName='引合', |
| | | CloseDate=Date.today(), |
| | | AccountId=depart1.Id, |
| | | Sales_Root__c = '販売店', |
| | | Competitor__c ='A', |
| | | Click_Close_Date__c = null, |
| | | RecordType = rectOpp |
| | | ); |
| | | insert opp; |
| | | |
| | | //注残 |
| | | Statu_Achievements__c Sac = new Statu_Achievements__c( |
| | | name = 'zhucan_one', |
| | | Opportunity__c = opp.id, |
| | | DeliveryDate__c = Date.today(), |
| | | ContractNO__c = 'ContractNO1', |
| | | ContractAmount__c = 1000 |
| | | ); |
| | | insert Sac; |
| | | |
| | | |
| | | |
| | | //新建电子签收单 |
| | | eSignForm__c eSignForm = new eSignForm__c(); |
| | | eSignForm.Statu_Achievements__c = Sac.Id; |
| | | eSignForm.Name = '::测试电子签收单'; |
| | | eSignForm.DNName__c = '65210306'; |
| | | |
| | | insert eSignForm; |
| | | |
| | | eSignFormEntry__c eSignFormEntry1 = new eSignFormEntry__c(); |
| | | eSignFormEntry1.Name = '::电子签收单录入表1'; |
| | | eSignFormEntry1.eSignForm__c = eSignForm.Id; |
| | | eSignFormEntry1.entryType__c = '经销商收货'; |
| | | |
| | | insert eSignFormEntry1; |
| | | |
| | | eSignFormEntry__c eSignFormEntry2 = new eSignFormEntry__c(); |
| | | eSignFormEntry2.Name = '::电子签收单录入表2'; |
| | | eSignFormEntry2.eSignForm__c = eSignForm.Id; |
| | | eSignFormEntry2.entryType__c = '经销商收货'; |
| | | eSignFormEntry2.IsSubmit__c = true; |
| | | eSignFormEntry2.IsHPSubmit__c = true; |
| | | // eSignFormEntry2.createdDate = Date.today().addDays(-2); |
| | | insert eSignFormEntry2; |
| | | |
| | | |
| | | //新建电子签收单明细 |
| | | eSignFormLineItem__c eSignFormLineItem = new eSignFormLineItem__c(); |
| | | eSignFormLineItem.Name = '::电子签收单明细'; |
| | | eSignFormLineItem.eSignForm__c = eSignForm.Id; |
| | | |
| | | insert eSignFormLineItem; |
| | | |
| | | //新建电子签收单明细录入表 |
| | | |
| | | eSignFormLineItemEntry__c eSignFormLineItemEntry1 = new eSignFormLineItemEntry__c(); |
| | | eSignFormLineItemEntry1.Name = '::电子签收单明细录入1'; |
| | | eSignFormLineItemEntry1.eSignFormEntry__c =eSignFormEntry1.Id; |
| | | eSignFormLineItemEntry1.eSignFormLineItem__c = eSignFormLineItem.Id; |
| | | |
| | | insert eSignFormLineItemEntry1; |
| | | |
| | | eSignFormLineItemEntry__c eSignFormLineItemEntry2 = new eSignFormLineItemEntry__c(); |
| | | eSignFormLineItemEntry2.Name = '::电子签收单明细录入2'; |
| | | eSignFormLineItemEntry2.eSignFormEntry__c =eSignFormEntry2.Id; |
| | | eSignFormLineItemEntry2.eSignFormLineItem__c = eSignFormLineItem.Id; |
| | | |
| | | |
| | | insert eSignFormLineItemEntry2; |
| | | |
| | | FrameNumManage__c FrameNumManage1 = new FrameNumManage__c(); |
| | | FrameNumManage1.Name = '测试1'; |
| | | FrameNumManage1.ManagementCode__c ='KVZFI'; |
| | | FrameNumManage1.ApplyList__c = 'ceshiyi1'; |
| | | FrameNumManage1.Num__c = 2; |
| | | FrameNumManage1.SerialNumber__c = '22R'; |
| | | FrameNumManage1.Material__c = 'wuliaoceshi'; |
| | | FrameNumManage1.MaterialDepict__c = 'wuliaomiaoshu'; |
| | | FrameNumManage1.signInForm__c = eSignForm.Id; |
| | | |
| | | insert FrameNumManage1; |
| | | |
| | | FrameNumManage__c FrameNumManage2 = new FrameNumManage__c(); |
| | | FrameNumManage2.Name = '测试2'; |
| | | FrameNumManage2.ManagementCode__c ='KVZFI'; |
| | | FrameNumManage2.ApplyList__c = 'ceshiyi2'; |
| | | FrameNumManage2.Num__c = 2; |
| | | FrameNumManage2.SerialNumber__c = '22R'; |
| | | FrameNumManage2.Material__c = 'wuliaoceshi'; |
| | | FrameNumManage2.MaterialDepict__c = 'wuliaomiaoshu'; |
| | | FrameNumManage2.signInForm__c = eSignForm.Id; |
| | | |
| | | insert FrameNumManage2; |
| | | FrameNumManage__c FrameNumManage3 = new FrameNumManage__c(); |
| | | FrameNumManage3.Name = '测试3'; |
| | | FrameNumManage3.ManagementCode__c ='KVZFI'; |
| | | FrameNumManage3.ApplyList__c = 'ceshiyi2'; |
| | | FrameNumManage3.Num__c = 2; |
| | | FrameNumManage3.SerialNumber__c = '22R'; |
| | | FrameNumManage3.Material__c = 'wuliaoceshi3'; |
| | | FrameNumManage3.MaterialDepict__c = 'wuliaomiaoshu3'; |
| | | FrameNumManage3.signInForm__c = eSignForm.Id; |
| | | |
| | | insert FrameNumManage3; |
| | | |
| | | FileAddress__c FileName1 = new FileAddress__c(); |
| | | FileName1.FileName__c = 'ceshiyi1'; |
| | | FileName1.ViewLink__c = 'ceshiyi1'; |
| | | insert FileName1; |
| | | |
| | | FileAddress__c FileName2 = new FileAddress__c(); |
| | | FileName2.FileName__c = 'ceshiyi2'; |
| | | FileName2.ViewLink__c = 'ceshiyi2'; |
| | | insert FileName2; |
| | | |
| | | // create ContentVersions |
| | | list<ContentVersion> cvList = new list<ContentVersion>(); |
| | | cvList.add( new ContentVersion(Title = 'test1',PathOnClient = 'Test1.txt',VersionData = Blob.valueOf('test data 1'), IsMajorVersion = true) ); |
| | | cvList.add( new ContentVersion(Title = 'test2',PathOnClient = 'Test2.txt',VersionData = Blob.valueOf('test data 2'), IsMajorVersion = true) ); |
| | | cvList.add( new ContentVersion(Title = 'test3',PathOnClient = 'Test3.txt',VersionData = Blob.valueOf('test data 3'), IsMajorVersion = true) ); |
| | | insert cvList; |
| | | |
| | | Test.startTest(); |
| | | // retrieve Ids for ContentDocuments created on insert of ContentVersions |
| | | list<Id> cdIdList = new list<Id>(); |
| | | for (ContentDocument cd : [SELECT Id, LatestPublishedVersionId |
| | | FROM ContentDocument |
| | | WHERE (LatestPublishedVersionId = :cvList[0].Id |
| | | OR LatestPublishedVersionId = :cvList[1].Id |
| | | OR LatestPublishedVersionId = :cvList[2].Id) |
| | | ORDER BY Title]) { |
| | | cdIdList.add(cd.Id); |
| | | } |
| | | system.assertEquals(3, cdIdList.size()); |
| | | |
| | | |
| | | // create ContentDocumentLink links. 2 for TestAcct (1) and 1 for TestAcct (2) |
| | | list<ContentDocumentLink> cdlList = new list<ContentDocumentLink>(); |
| | | cdlList.add(new ContentDocumentLink(ContentDocumentId=cdIdList[0], LinkedEntityId=eSignFormEntry1.Id, ShareType='V')); |
| | | |
| | | insert cdlList; |
| | | string aid = String.valueOf(depart1.Id); |
| | | eSignHomePageController.getDNSignUpStatus('65210306'); |
| | | eSignHomePageController.eSignWrapperList esceshi = eSignHomePageController.getDNSignUpLists(aid,'Agency'); |
| | | eSignHomePageController.getAccount('888888'); |
| | | AttachmentDisplayController.getFrameNumManage(eSignForm.Id); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | @isTest |
| | | private class AttachmentTriggerTest { |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'}); |
| | | } |
| | | |
| | | |
| | | @isTest |
| | | static void test_method_one() { |
| | |
| | | contact2.LastName = 'test1经销商'; |
| | | insert contact2; |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | Aws_Data_Id__c = '123456' |
| | | )); |
| | | |
| | | System.Test.startTest(); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | AWSServiceTool2.EncryptPushFuture(null,null); |
| | | //insert att1; |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | |
| | | } |
| | | @isTest |
| | | static void test_method_6() { |
| | | List<RecordType> rectC = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectC.size() == 0) { |
| | | return; |
| | | User thisUser = [select Id from User where Id = :UserInfo.getUserId() ]; |
| | | System.runAs ( thisUser ){ |
| | | List<RecordType> rectC = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectC.size() == 0) { |
| | | return; |
| | | } |
| | | Account act1 = new Account(); |
| | | act1.Name = 'TestAccount01'; |
| | | act1.RecordTypeId = rectC[0].Id; |
| | | |
| | | upsert act1; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '契約']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Account act2 = new Account(); |
| | | act2.Name = 'TestAccount02'; |
| | | act2.Business_Assistant__c = getUser().id; |
| | | act2.RecordTypeId = rectCo[0].Id; |
| | | act2.ParentId = act1.Id; |
| | | |
| | | upsert act2; |
| | | |
| | | Consumable_order__c co = new Consumable_order__c(); |
| | | co.Name = 'TestCo'; |
| | | co.Order_status__c = '草案中'; |
| | | co.Order_effective_contact__c = act2.id; |
| | | |
| | | insert co; |
| | | System.Test.startTest(); |
| | | |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = co.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | |
| | | insert att; |
| | | |
| | | delete att; |
| | | |
| | | System.Test.stopTest(); |
| | | } |
| | | Account act1 = new Account(); |
| | | act1.Name = 'TestAccount01'; |
| | | act1.RecordTypeId = rectC[0].Id; |
| | | |
| | | upsert act1; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '契約']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Account act2 = new Account(); |
| | | act2.Name = 'TestAccount02'; |
| | | act2.Business_Assistant__c = getUser().id; |
| | | act2.RecordTypeId = rectCo[0].Id; |
| | | act2.ParentId = act1.Id; |
| | | |
| | | upsert act2; |
| | | |
| | | Consumable_order__c co = new Consumable_order__c(); |
| | | co.Name = 'TestCo'; |
| | | co.Order_status__c = '草案中'; |
| | | co.Order_effective_contact__c = act2.id; |
| | | |
| | | insert co; |
| | | System.Test.startTest(); |
| | | |
| | | Attachment att = new Attachment( |
| | | Name = 'test', |
| | | ParentId = co.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | |
| | | insert att; |
| | | |
| | | delete att; |
| | | |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | @isTest |
| | |
| | | } |
| | | |
| | | // MZY SWAG-BXXBKA 2021-02-19 end |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | global with sharing class BatchFileUploadController { |
| | | public String newUrl {get; set;} |
| | | public String staticResource {get; set;} |
| | | |
| | | public BatchFileUploadController(){ |
| | | AWS_Integration_Info__mdt awsConfiguration = [SELECT App_Id__c,Token_URL__c,App_Secret__c,Host_URL__c FROM AWS_Integration_Info__mdt WHERE DeveloperName = 'AWS_Default_Configuration']; |
| | | if (awsConfiguration == null) { |
| | | System.debug('AWS_Integration_Info__mdt没配置'); |
| | | }else { |
| | | newUrl = awsConfiguration.Host_URL__c + '/api/file/batchupload'; |
| | | staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); |
| | | } |
| | | } |
| | | |
| | | // @RemoteAction |
| | | // global static String attachBlob(String parentId, String attachmentId, String fileName, String contentType, String base64BlobValue){ |
| | | // /* |
| | | // parentId: The sfdc object Id this file will be attached to |
| | | // attachmentId: The record of the current Attachment file being processed |
| | | // fileName: Name of the attachment |
| | | // contentTye: Content Type of the file being attached |
| | | // base64BlobValue: Base64 encoded string of the file piece currently processing |
| | | // */ |
| | | |
| | | // //If recordId is blank this is the first part of a multi piece upload |
| | | // if(attachmentId == '' || attachmentId == null){ |
| | | // Attachment att = new Attachment( |
| | | // ParentId = parentId, |
| | | // Body = EncodingUtil.Base64Decode(base64BlobValue), |
| | | // Name = fileName, |
| | | // ContentType = contentType |
| | | // ); |
| | | // insert att; |
| | | |
| | | // //Return the new attachment Id |
| | | // return att.Id; |
| | | |
| | | // }else{ |
| | | // for(Attachment atm : [select Id, Body from Attachment where Id = :attachmentId]){ |
| | | // //Take the body of the current attachment, convert to base64 string, append base64 value sent from page, then convert back to binary for the body |
| | | // update new Attachment(Id = attachmentId, Body = EncodingUtil.Base64Decode(EncodingUtil.Base64Encode(atm.Body) + base64BlobValue)); |
| | | // } |
| | | |
| | | // //Return the Id of the attachment we are currently processing |
| | | // return attachmentId; |
| | | // } |
| | | // } |
| | | |
| | | global class Response{ |
| | | public String recordId{set;get;} |
| | | public String message{set;get;} |
| | | public String status{set;get;} |
| | | } |
| | | |
| | | @RemoteAction |
| | | global static Response saveFile(String fileName,String key,String transId,String parentId){ |
| | | FileAddress__c file = new FileAddress__c(); |
| | | PIHelper.PIIntegration pI=PIHelper.getPIIntegrationInfo('Document'); |
| | | // 去除filename里得“&” zhj 2022-11-17 |
| | | fileName = fileName.remove('&'); |
| | | file.DownloadLink__c =pI.undeleteUrl+key+'&fileName='+fileName; |
| | | file.FileName__c =fileName; |
| | | file.ViewLink__c =pI.queryUrl+key; |
| | | file.ParentRecordId__c =parentId; |
| | | file.AWS_File_Key__c = key; |
| | | Response response =new Response(); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | insert file; |
| | | //插入日志 |
| | | //update 2022-11-17 加入新的日志方式 |
| | | PIHelper.saveTransLog('Document',key,transId,file.Id,JSON.serialize(file),'success',''); |
| | | response.recordId=file.Id; |
| | | response.status='success'; |
| | | return response; |
| | | } catch (Exception e) { |
| | | System.debug('into catch'+e.getMessage()); |
| | | PIHelper.saveTransLog('Document',key,transId,file.Id,JSON.serialize(file),'fail',e.getMessage()); |
| | | Database.rollback(sp); |
| | | response.message=e.getMessage(); |
| | | response.status='fail'; |
| | | return response; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | //1.只查找100条保有设备数据 |
| | | String fuselageNumberTrim = String.isNotBlank(FuselageNumber)?FuselageNumber.trim():''; |
| | | String serialNumber = '%' + String.escapeSingleQuotes(fuselageNumberTrim.replaceAll('%', '\\%')) + '%'; |
| | | List < Asset > assetListed = [SELECT Id,name,SerialNumber,InstallDate,Information_From__c,Asset_situation__c, |
| | | List < Asset > assetListed = [SELECT Id,name,SerialNumber,InstallDate, |
| | | // Information_From__c,// 20220927 ljh XLIU-CJN62G |
| | | Asset_situation__c, |
| | | Order_No__c,Account.Name,Status,Department_Class__c,Hospital__r.Owner.Name, |
| | | Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c, |
| | | Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name , |
| | | Department_Class__r.Id,Ji_Zhong_Guan_Li_Ku_Cun__c,Account.RecordTypeId |
| | | Department_Class__r.Id, |
| | | // Ji_Zhong_Guan_Li_Ku_Cun__c,// 20220927 ljh XLIU-CJN62G |
| | | Posting_Date__c,Extend_Gurantee_DateTo__c,CurrentContract_End_Date__c,// 20220927 ljh XLIU-CJN62G |
| | | Account.RecordTypeId |
| | | ,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c |
| | | ,Account.Parent.FSE_SP_Main_Leader__r.Work_Location__c |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start |
| | | ,PartSupplyFinishDate__c |
| | | //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end |
| | | FROM Asset where Id != null AND Repairing_Count__c >= 0 AND SerialNumber like :serialNumber LIMIT 100 |
| | | |
| | | ]; |
| | |
| | | for (Asset ast: assetListed) { |
| | | choiceAssetInfoRecordsview.add(new ChoiceAssetInfo(ast)); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 检索 |
| | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '只能选择一个保有设备')); |
| | | return null; |
| | | } |
| | | |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start |
| | | // List<Asset> ass = [select id,Product_ID__c from Asset where ID = :ast.Id]; |
| | | // List<Product2> p2 = [select id,Name,Can_Repair__c |
| | | // from Product2 where |
| | | // ID = :ass[0].Product_ID__c]; |
| | | // String canRepair = p2[0].Can_Repair__c; |
| | | // if (canRepair=='第三方'){ |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '非我司修理对象,无法新建修理,如有不明请咨询CIC')); |
| | | // return null; |
| | | // } |
| | | // if (canRepair=='不' || String.isBlank(canRepair)){ |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '本设备无法新建修理')); |
| | | // return null; |
| | | // } |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end |
| | | return createData(ast); |
| | | } |
| | | |
| | | |
| | | public PageReference createData(Asset ast) { |
| | | String url = '/'; |
| | | String joint_1 = '='; |
| | | String joint_2 = '_lkid='; |
| | | String joint_3 = '&CF'; |
| | | String joint_4 = '&'; |
| | | |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | // List<Asset> ass = [select id,Product_ID__c from Asset where ID = :ast.Id]; |
| | | // List<Product2> p2 = [select id,Name,Can_Repair__c |
| | | // from Product2 where |
| | | // ID = :ass[0].Product_ID__c]; |
| | | // String canRepair = p2[0].Can_Repair__c; |
| | | // system.debug('1111111111111111111'+canRepair); |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | if ('Repair'.equals(dataType)) { |
| | | String Delivered_Product_Id = '00N10000002Dx1X'; //设备型号 |
| | | String Account_Id = '00N10000002Dx5n'; //科室 |
| | |
| | | //LLIU-CGX5E9 LY 20220812 start |
| | | String DateReceiptQuestions_Id = '';//问题联络收到日 |
| | | //LLIU-CGX5E9 LY 20220812 end |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | // String Excwork_location_Id = '';//跳过维修中心 |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | String engineerSendDate_Id= '';//工程师修理品寄送日 |
| | | // if (NFMUtil.isSandbox()) { //测试环境 |
| | | // RepairApplicant_Id = '00N1m0000054ufW'; //报修人 |
| | |
| | | //LLIU-CGX5E9 LY 20220812 start |
| | | DateReceiptQuestions_Id= '00N10000008rsVQ';//问题联络收到日 |
| | | //LLIU-CGX5E9 LY 20220812 end |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | // Excwork_location_Id = '00N10000009HAJl';//跳过维修中心 |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | //} |
| | | |
| | | url += 'a0J/e?retURL=%2F'; |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 start |
| | | // if (canRepair=='RC送修'){ |
| | | // url += joint_4 + Excwork_location_Id + joint_1 + true; |
| | | // } |
| | | // //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221110 end |
| | | url += joint_3 + Delivered_Product_Id + joint_1 + ast.Name; |
| | | url += joint_3 + Delivered_Product_Id + joint_2 + ast.Id; |
| | | |
| | |
| | | private String makeSoql() { |
| | | |
| | | String start = ''; |
| | | String soql = 'select Id,name,SerialNumber,InstallDate,Information_From__c,Asset_situation__c,Order_No__c,Account.Name,Status,Department_Class__c, '; |
| | | String soql = 'select Id,name,SerialNumber,InstallDate,Asset_situation__c,Order_No__c,Account.Name,Status,Department_Class__c, '; |
| | | |
| | | soql += 'Hospital__r.Owner.Name,Hospital__r.Owner.Phone,Installation_Site__c,CurrentContract__c,Product2.Asset_Model_No__c,Hospital__r.Name,Department_Class__r.Name ,Department_Class__r.Id,'; |
| | | soql += 'Ji_Zhong_Guan_Li_Ku_Cun__c,Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c,Account.RecordTypeId'; |
| | | soql += 'Account.Parent.Parent.FSE_SP_Main_Leader__r.Work_Location__c,Account.RecordTypeId'; |
| | | soql += ',Posting_Date__c,Extend_Gurantee_DateTo__c,CurrentContract_End_Date__c ';// 20220927 ljh XLIU-CJN62G |
| | | soql += ',PartSupplyFinishDate__c ';//XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 |
| | | soql += ' from Asset where Id != null AND Repairing_Count__c = 0 '; |
| | | if (String.isNotBlank(FuselageNumber) || String.isNotBlank(AssetModel) || String.isNotBlank(HospitalName)) { |
| | | soql += ' AND ('; |
| | |
| | | Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='SP', |
| | | Fixture_Model_No__c='n05',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n05', |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false); |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false,Can_Repair__c='可'); |
| | | insert pro5; |
| | | |
| | | Asset assetC1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | |
| | | |
| | | //查询 普通科室 |
| | | // public static string GetPTKS(String content,String ParentId) |
| | | // { |
| | | // String paramYy = 'HP'; |
| | | // String sql = 'select '; |
| | | // String props = GetSqlToPorps(account.SObjectType); |
| | | // sql += props; |
| | | // sql += ' from account'; |
| | | // sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy'; |
| | | // if(content != null && content != '') |
| | | // { |
| | | // content = '%'+content+'%'; |
| | | // sql += ' and Name like :content '; |
| | | // } |
| | | // if(ParentId != null && ParentId != '') |
| | | // { |
| | | // sql += ' and Parentid = :ParentId '; |
| | | // } |
| | | // sql += ' limit 5 '; |
| | | // List<account> arrays = Database.query(sql); |
| | | // return JSON.serialize(arrays); |
| | | // } |
| | | public static string GetPTKS(String content, List<String> ParentIds, Boolean checkOwner) |
| | | { |
| | | String paramYy = 'HP'; |
| | | String sql = 'select '; |
| | | String props = GetSqlToPorps(account.SObjectType); |
| | | sql += props; |
| | | sql += ' from account'; |
| | | sql += ' where Parent.Parent.RecordType_DeveloperName__c = :paramYy'; |
| | | if(content != null && content != '') |
| | | { |
| | | content = '%'+content+'%'; |
| | | sql += ' and Name like :content '; |
| | | } |
| | | if(ParentIds != null && ParentIds.size() > 0) |
| | | { |
| | | sql += ' and Parent.Parentid in :ParentIds '; |
| | | } |
| | | if (checkOwner) { |
| | | String userId = UserInfo.getUserId(); |
| | | sql += ' and OwnerId = :userId'; |
| | | } |
| | | sql += ' limit 5 '; |
| | | List<account> arrays = Database.query(sql); |
| | | return JSON.serialize(arrays); |
| | | } |
| | | |
| | | |
| | | //查询 普通科室 |
| | |
| | | //查询 医院下的科室 包括战略和普通科室 |
| | | CommonUtils.GetYYChilders('test',hospital.Id); |
| | | //查询 普通科室 |
| | | // CommonUtils.GetPTKS('test',hospital.Id); |
| | | List<String> hospitals = new List<String>(); |
| | | hospitals.add(hospital.Id); |
| | | CommonUtils.GetPTKS('test',hospitals,false); |
| | | //查询 普通科室 |
| | | // CommonUtils.GetPTKSByYYParent('test',hospital.Id); |
| | | //查询 战略科室 |
| | |
| | | //获取选项列表值 |
| | | CommonUtils.GetSelectedValues( Tender_information__c.irrelevantReasons__c.getDescribe()); |
| | | |
| | | CommonUtils.getPicklistValues( 'PCLLostBrand__c','ProductClass__c','ProductCategory__c'); |
| | | // CommonUtils.getPicklistValues( 'PCLLostBrand__c','ProductClass__c','ProductCategory__c'); |
| | | CommonUtils.getPicklistValues( 'Tender_information__c','InfoType__c','subInfoType__c'); |
| | | |
| | | |
| | | } |
| | |
| | | system.debug('=='+Job_CategoryMap.get(bbz)+'==='+Job_CategoryMap.get(ldbb)+'==='+zz); |
| | | }else if(String.isBlank(odsc.Category4__c) && String.isNotBlank(odsc.Category5__c)){ |
| | | //本部等于空,看部 |
| | | if(odsc.Category5__c=='华北东北运营管理部' || odsc.Category5__c=='西北西南运营管理部' || odsc.Category5__c=='西北西南运营支援部' || bbz1=='华北东北服务部-综合行政'){ |
| | | if(odsc.Category5__c=='华北东北运营管理部' || odsc.Category5__c=='西北西南运营管理部' || odsc.Category5__c=='西北西南运营支援部' || bbz1=='华北东北服务部-综合行政' || bbz1=='华北东北市场部-综合行政'){ |
| | | zz = '支援'; |
| | | }else if(bbz1=='华北东北服务部-FSE'){ |
| | | zz = '销售服务'; |
| | | }else if(odsc.Category5__c=='西部战略推进部'){ |
| | | }else if(odsc.Category5__c=='西部战略推进部' || bbz1=='华北东北市场部-推广'){ |
| | | zz = '销售推广'; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | }else if(String.isBlank(odsc.Category4__c) && String.isNotBlank(odsc.Category5__c)){ |
| | | //本部等于空,看部 |
| | | if(odsc.Category5__c=='华北东北运营管理部' || odsc.Category5__c=='西北西南运营管理部' || odsc.Category5__c=='西北西南运营支援部' || bbz1=='华北东北服务部-综合行政'){ |
| | | //本部等于空,看部 LLIU-CKE3UG 增加映射关系 |
| | | if(odsc.Category5__c=='华北东北运营管理部' || odsc.Category5__c=='西北西南运营管理部' || odsc.Category5__c=='西北西南运营支援部' || bbz1=='华北东北服务部-综合行政' || bbz1=='华北东北市场部-综合行政'){ |
| | | zz = '支援'; |
| | | }else if(bbz1=='华北东北服务部-FSE'){ |
| | | zz = '销售服务'; |
| | | }else if(odsc.Category5__c=='西部战略推进部'){ |
| | | }else if(odsc.Category5__c=='西部战略推进部' || bbz1=='华北东北市场部-推广'){ |
| | | zz = '销售推广'; |
| | | } |
| | | } |
| | |
| | | return mapping.get(keyword) != null ? String.valueOf(mapping.get(keyword)) : null; |
| | | } |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | |
| | | //20221021 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | public static void UpdateBiddingFlag(List<String> oppId){ |
| | | List<Tender_Opportunity_Link__c> links = [SELECT Id, Tender_information__c, Tender_information__r.IsReactionOpp__c, Opportunity__c |
| | | FROM Tender_Opportunity_Link__c |
| | | WHERE Opportunity__c in :oppId ]; |
| | | |
| | | Map<String,Tender_information__c> tenderMap = new Map<String,Tender_information__c>(); |
| | | |
| | | for (Tender_Opportunity_Link__c link : links){ |
| | | |
| | | Tender_information__c temptender = new Tender_information__c(); |
| | | temptender.Id = link.Tender_information__c; |
| | | temptender.IsReactionOpp__c = true; |
| | | tenderMap.put(temptender.id ,temptender); |
| | | |
| | | } |
| | | |
| | | if(tenderMap.size()>0){ |
| | | update tenderMap.values(); |
| | | } |
| | | |
| | | } |
| | | //20221021 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | } |
| | |
| | | +'FROM Maintenance_Contract__c ' |
| | | +'WHERE RecordType.DeveloperName = \'NewMaintenance_Contract\' AND Contract_Start_Date__c != NULL AND Contract_End_Date__c != NULL ' |
| | | //URF限次合同2期 LY 20220811 start |
| | | +'AND URF_Contract__c = false' |
| | | +'AND URF_Contract__c = false ' |
| | | //URF限次合同2期 LY 20220811 end |
| | | +'AND Status__c = \'契約\' AND Contract_Conclusion_Date__c != NULL '; |
| | | if (String.isNotBlank(this.tempMainId)) { |
| | |
| | | oppSql += ' where id in :TEST_ID'; |
| | | }else{ |
| | | oppSql += ' where StageName = \'引合\' and ForecastAccuracyObject__c = true'; |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | // oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | |
| | | oppSql += ' and IsNextMonthOfVisit__c = false and SalesdepartmentForecast__c in :areas'; |
| | | // 5)客户为H层客户的询价 |
| | | // oppSql += ' and (OCM__c = \'H0\' or OCM__c = \'H1\')'; |
| | |
| | | oppSql += ' where id in :TEST_ID'; |
| | | }else{ |
| | | oppSql += ' where StageName = \'引合\' and ForecastAccuracyObject__c = true'; |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | // oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\',\'E\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | oppSql += ' and Competitor__c in (\'A\',\'B\',\'C\',\'D\') '; //2021-11-22 yjk 增加判断条件 询价等级 |
| | | oppSql += ' and IsNextMonthOfVisit__c = false and SalesdepartmentForecast__c in :areas'; |
| | | // 5)客户为H层客户的询价 |
| | | // oppSql += ' and (OCM__c = \'H0\' or OCM__c = \'H1\')'; |
| | |
| | | * } |
| | | * 字段 |
| | | */ |
| | | |
| | | // ETAPP重点产品拆分 fy start Category5__c |
| | | String query = 'SELECT Id, Intra_Trade_List_RMB__c, Asset_Model_No__c,' + |
| | | ' Category3__c, Category4__c, Plan_Term__c' + |
| | | ' Category3__c, Category4__c,Category5__c, Plan_Term__c' + |
| | | ' FROM Product2' + |
| | | ' where Is_ET_APP__c = true '; |
| | | // if (true != this.isAllFlag) { |
| | |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':先端系粘膜切开刀-DualJ以外'; |
| | | } |
| | | } |
| | | // ETAPP重点产品拆分 fy start |
| | | else if ('导丝' == pd.Category4__c ) { |
| | | if (pd.Asset_Model_No__c.startsWith('G-240')) { |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':导丝-G-240'; |
| | | }else{ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':导丝-G-260'; |
| | | } |
| | | } |
| | | else if('乳头切开刀' == pd.Category4__c){ |
| | | if(pd.Category5__c.contains('乳头切开-三腔')){ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':乳头切开刀-三腔'; |
| | | }else{ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':乳头切开刀-其他'; |
| | | } |
| | | } else if('注射针(胃镜)'== pd.Category4__c){ |
| | | if (pd.Asset_Model_No__c.startsWith('NM-20')){ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(胃镜)-200'; |
| | | }else{ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(胃镜)-400'; |
| | | } |
| | | } |
| | | else if('注射针(肠镜)'== pd.Category4__c){ |
| | | if (pd.Asset_Model_No__c.startsWith('NM-20')){ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(肠镜)-200'; |
| | | }else{ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':注射针(肠镜)-400'; |
| | | } |
| | | } |
| | | else if('呼吸科ET'==pd.Category3__c && '吸引活检针'==pd.Category4__c){ |
| | | if(pd.Asset_Model_No__c.startsWith('NA-U401SX')||pd.Asset_Model_No__c.startsWith('NA-U403SX')){ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':吸引活检针-Visishot2'; |
| | | }else{ |
| | | uniKey = pd.Plan_Term__c.left(4) + ':' + pd.Category3__c + ':吸引活检针-Visishot2以外'; |
| | | } |
| | | } |
| | | // ETAPP重点产品拆分 fy end |
| | | |
| | | if(uniKeyToPDListMap.get(uniKey) == null){ |
| | | uniKeyToPDListMap.put(uniKey,new List<Product2>()); |
| | |
| | | products.add(new Product2(Name='test33',Category3__c='4K系列',Category4__c='腹腔镜/胸腔镜',Category5__c='5.4mm',SFDA_Status__c = '有効(再申請中)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=100.19)); |
| | | products.add(new Product2(Name='test34',Category3__c='摄像头适配器',Category4__c='AR',Category5__c='AR',SFDA_Status__c = '失効(申請無)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294)); |
| | | products.add(new Product2(Name='test35',Category3__c='灌流系统',Category4__c='Hystro-Flow',Category5__c='Hystro-Flow',SFDA_Status__c = '失効(期限内生産済在庫対応)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294)); |
| | | products.add(new Product2(Name='test36',Category3__c='ET',Category4__c='导丝',Category5__c='Hystro-Flow',SFDA_Status__c = '失効(期限内生産済在庫対応)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294,Asset_Model_No__c='G-240Test')); |
| | | products.add(new Product2(Name='test37',Category3__c='ET',Category4__c='乳头切开刀',Category5__c='乳头切开-三腔',SFDA_Status__c = '失効(期限内生産済在庫対応)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294,Asset_Model_No__c='G-240Test')); |
| | | products.add(new Product2(Name='test38',Category3__c='ET',Category4__c='注射针(胃镜)',Category5__c='Hystro-Flow',SFDA_Status__c = '失効(期限内生産済在庫対応)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294,Asset_Model_No__c='NM-20Test')); |
| | | products.add(new Product2(Name='test39',Category3__c='ET',Category4__c='注射针(肠镜)',Category5__c='Hystro-Flow',SFDA_Status__c = '失効(期限内生産済在庫対応)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294,Asset_Model_No__c='NM-20Test')); |
| | | products.add(new Product2(Name='test40',Category3__c='呼吸科ET',Category4__c='吸引活检针',Category5__c='Hystro-Flow',SFDA_Status__c = '失効(期限内生産済在庫対応)',Dealer_special_Object__c = true,Intra_Trade_List_RMB_1__c=61294,Asset_Model_No__c='NA-U401SXTest')); |
| | | |
| | | for(Product2 pd: products) { |
| | | pd.put('Intra_Trade_List_RMB_Date1__c',Date.newInstance(1999,9,9)); |
| | |
| | | String term = p.Plan_Term__c.left(4); |
| | | String uniqueKey = 'U:' + term + ':' + month + ':' + AccountHP.OCM_man_province_txt__c + ':' + AccountHP.Management_Code__c + ':' + AccountAgent2.Id + ':' + p.Category3__c + ':' + p.Category4__c; |
| | | String pstKey = term + ':' + p.Category3__c + ':' + p.Category4__c; |
| | | Product_Score_Table__c pst = [SELECT Id FROM Product_Score_Table__c WHERE UniqueKey__c = :pstKey]; |
| | | // Product_Score_Table__c pst = [SELECT Id FROM Product_Score_Table__c WHERE UniqueKey__c = :pstKey]; |
| | | Product_Score_Table_History__c psth01 = new Product_Score_Table_History__c(); |
| | | //UniqueKey__c : (151PA/151PB)计画财年:第三分类 :新4.5分类 :经销商 :医院 |
| | | psth01.UniqueKey__c = uniqueKey; |
| | | psth01.Hospital__c = AccountHP.Id; |
| | | psth01.OCM_Province_Text__c = AccountHP.OCM_man_province_txt__c; |
| | | psth01.Province_From_Consume__c = TRUE; |
| | | psth01.Product_Score_Table__c = pst.Id; |
| | | // psth01.Product_Score_Table__c = pst.Id; |
| | | psth01.Sales_Amount__c = 67; |
| | | psth01.Shipping_date__c = Date.newInstance(Date.today().year(), Date.today().month(), 1); |
| | | psth01.Agency__c = AccountAgent2.Id; |
| | |
| | | Test.stopTest(); |
| | | |
| | | System.runAs(new User(Id = Userinfo.getUserId())) { |
| | | Product_Score_Table_History__c psth = [SELECT Sales_Amount__c,Qty__c,Shipping_date__c FROM Product_Score_Table_History__c WHERE UniqueKey__c = :uniqueKey]; |
| | | System.assertEquals(265.49, psth.Sales_Amount__c); |
| | | System.assertEquals(2, psth.Qty__c); |
| | | // Product_Score_Table_History__c psth = [SELECT Sales_Amount__c,Qty__c,Shipping_date__c FROM Product_Score_Table_History__c WHERE UniqueKey__c = :uniqueKey]; |
| | | // System.assertEquals(265.49, psth.Sales_Amount__c); |
| | | // System.assertEquals(2, psth.Qty__c); |
| | | Date today = Date.today(); |
| | | System.assertEquals(Date.newInstance(today.year(), today.month(), 1), psth.Shipping_date__c); |
| | | // System.assertEquals(Date.newInstance(today.year(), today.month(), 1), psth.Shipping_date__c); |
| | | |
| | | } |
| | | |
| | |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':先端系粘膜切开刀-DualJ以外'; |
| | | } |
| | | } |
| | | |
| | | // ETAPP重点产品拆分 fy start |
| | | else if ('导丝' == pd.Category4__c ) { |
| | | if (pd.Asset_Model_No__c.startsWith('G-240')) { |
| | | pst.Category4__c = '导丝-G-240'; |
| | | pst.Plan_Category4__c = '导丝-G-240'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':导丝-G-240'; |
| | | }else { |
| | | pst.Category4__c = '导丝-G-260'; |
| | | pst.Plan_Category4__c = '导丝-G-260'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':导丝-G-260'; |
| | | } |
| | | } |
| | | else if('乳头切开刀' == pd.Category4__c){ |
| | | if(pd.Category5__c.contains('乳头切开-三腔')){ |
| | | pst.Category4__c = '乳头切开刀-三腔'; |
| | | pst.Plan_Category4__c = '乳头切开刀-三腔'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':乳头切开刀-三腔'; |
| | | }else{ |
| | | pst.Category4__c = '乳头切开刀-其他'; |
| | | pst.Plan_Category4__c = '乳头切开刀-其他'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':乳头切开刀-其他'; |
| | | } |
| | | } else if('注射针(胃镜)'== pd.Category4__c){ |
| | | if (pd.Asset_Model_No__c.startsWith('NM-20')){ |
| | | pst.Category4__c = '注射针(胃镜)-200'; |
| | | pst.Plan_Category4__c = '注射针(胃镜)-200'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':注射针(胃镜)-200'; |
| | | }else { |
| | | pst.Category4__c = '注射针(胃镜)-400'; |
| | | pst.Plan_Category4__c = '注射针(胃镜)-400'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':注射针(胃镜)-400'; |
| | | } |
| | | } |
| | | else if('注射针(肠镜)'== pd.Category4__c){ |
| | | if (pd.Asset_Model_No__c.startsWith('NM-20')){ |
| | | pst.Category4__c = '注射针(肠镜)-200'; |
| | | pst.Plan_Category4__c = '注射针(肠镜)-200'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':注射针(肠镜)-200'; |
| | | |
| | | }else { |
| | | pst.Category4__c = '注射针(肠镜)-400'; |
| | | pst.Plan_Category4__c = '注射针(肠镜)-400'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':注射针(肠镜)-400'; |
| | | } |
| | | } |
| | | else if('呼吸科ET'==pd.Category3__c && '吸引活检针'==pd.Category4__c){ |
| | | if(pd.Asset_Model_No__c.startsWith('NA-U401SX')||pd.Asset_Model_No__c.startsWith('NA-U403SX')){ |
| | | pst.Category4__c = '吸引活检针-Visishot2'; |
| | | pst.Plan_Category4__c = '吸引活检针-Visishot2'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':吸引活检针-Visishot2'; |
| | | }else{ |
| | | pst.Category4__c = '吸引活检针-Visishot2以外'; |
| | | pst.Plan_Category4__c = '吸引活检针-Visishot2以外'; |
| | | pst.UniqueKey__c = pst.OCM_Term__c + ':' + pst.Category3__c + ':吸引活检针-Visishot2以外'; |
| | | } |
| | | } |
| | | // ETAPP重点产品拆分 fy end |
| | | //是否无效 |
| | | if (unDisabledList.contains(pst.UniqueKey__c)) { |
| | | pst.Is_Disabled__c = false; |
| | |
| | | |
| | | //Product2 |
| | | private static Product2 prod01 = new Product2(); |
| | | private static Product2 prod08 = new Product2(); |
| | | private static Product2 prod03 = new Product2(); |
| | | private static Product2 prod04 = new Product2(); |
| | | private static Product2 prod05 = new Product2(); |
| | | private static Product2 prod06 = new Product2(); |
| | | private static Product2 prod07 = new Product2(); |
| | | |
| | | /******************************************************************************************************* |
| | | *@description testデータ作成 |
| | |
| | | Category4__c = '导丝', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod01; |
| | | prod08 = new Product2(Name='Test08', |
| | | ProductCode='Test08', |
| | | Asset_Model_No__c = 'Test08', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Family = 'ET', |
| | | Category2__c = '耗材', |
| | | Category3__c = 'EUS', |
| | | Category4__c = '吸引活检针', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod08; |
| | | prod03 = new Product2(Name='Test03', |
| | | ProductCode='Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Family = 'ET', |
| | | Category2__c = '耗材', |
| | | Category3__c = 'ESD', |
| | | Category4__c = '先端系粘膜切开刀', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod03; |
| | | prod04 = new Product2(Name='Test04', |
| | | ProductCode='Test04', |
| | | Asset_Model_No__c = 'Test04', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Family = 'ET', |
| | | Category2__c = '耗材', |
| | | Category3__c = 'ERCP', |
| | | Category4__c = '乳头切开刀', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod04; |
| | | prod05 = new Product2(Name='Test05', |
| | | ProductCode='Test05', |
| | | Asset_Model_No__c = 'Test05', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Family = 'ET', |
| | | Category2__c = '耗材', |
| | | Category3__c = 'ERCP', |
| | | Category4__c = '注射针(胃镜)', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod05; |
| | | prod06 = new Product2(Name='Test06', |
| | | ProductCode='Test06', |
| | | Asset_Model_No__c = 'Test06', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Family = 'ET', |
| | | Category2__c = '耗材', |
| | | Category3__c = 'ERCP', |
| | | Category4__c = '注射针(肠镜)', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod06; |
| | | prod07 = new Product2(Name='Test07', |
| | | ProductCode='Test07', |
| | | Asset_Model_No__c = 'Test07', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Family = 'ET', |
| | | Category2__c = '耗材', |
| | | Category3__c = '呼吸科ET', |
| | | Category4__c = '吸引活检针', |
| | | Category5__c = 'Visiglide35'); |
| | | insert prod07; |
| | | } |
| | | |
| | | /******************************************************************************************************* |
| | |
| | | SWAG-B8Y84V 2019-02-11 start |
| | | */ |
| | | //*************************Insert 20160627 OCM-225 趙徳芳 Start*************************// |
| | | else if((Old_Competitor == 'C'||Old_Competitor == 'A'||Old_Competitor == 'B')&&(insOppo.Competitor__c =='D'||insOppo.Competitor__c =='E')){ |
| | | // else if((Old_Competitor == 'C'||Old_Competitor == 'A'||Old_Competitor == 'B')&&(insOppo.Competitor__c =='D'||insOppo.Competitor__c =='E')){ |
| | | else if((Old_Competitor == 'C'||Old_Competitor == 'A'||Old_Competitor == 'B')&&insOppo.Competitor__c =='D'){ |
| | | insOppo.Opportunity_stage__c.addError('询价等级已达到'+Old_Competitor+',询价等级为C及以上的,不可以修改到D或E'); |
| | | goOrNot = false; |
| | | } |
| | |
| | | private class EnquiryDetailsControllerTest { |
| | | |
| | | static testMethod void EnquiryDetailsControllerTest() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Opportunity CreateOppo = new Opportunity(); |
| | | CreateOppo.Name='TestName'; |
| | | CreateOppo.Opportunity_stage__c='预算没有批准'; |
| | |
| | | public String query; |
| | | public List < String > accountIdList; |
| | | private BatchIF_Log__c iflog; |
| | | public Date td = Date.today(); |
| | | public Date td = Date.today(); //如2022.10.15 |
| | | public String OCSM_Period_half; |
| | | public String OCSM_Period; |
| | | public Date sTime; |
| | | public Date eTime; |
| | | public Date eTime=td.toStartOfMonth(); //如 2022.10.1 |
| | | public Date sTime=eTime.addYears(-3); // 2019.10.1 |
| | | |
| | | global EquipmentRepairBatch() { |
| | | this.query = query; |
| | |
| | | OCSM_Period_half = '2H'; |
| | | } |
| | | |
| | | if(td.month() >= 4){ |
| | | sTime = Date.newInstance(td.year()-3,4,1); |
| | | eTime = Date.newInstance(td.year(),3,31); |
| | | // if(td.month() >= 4){ |
| | | // sTime = Date.newInstance(td.year()-3,4,1); |
| | | // eTime = Date.newInstance(td.year(),3,31); |
| | | |
| | | }else{ |
| | | sTime = Date.newInstance(td.year()-4,4,1); |
| | | eTime = Date.newInstance(td.year()-1,3,31); |
| | | } |
| | | // }else{ |
| | | // sTime = Date.newInstance(td.year()-4,4,1); |
| | | // eTime = Date.newInstance(td.year()-1,3,31); |
| | | // } |
| | | // query ='select Id,Hospital__c,Product2.ServiceCategory__c from Asset where Id not in (Select Asset__c from Maintenance_Contract_Asset__c) and Id in (select Delivered_Product__c from Repair__c)';//没有维修合同的数据 |
| | | // query += 'and IF_Coverage_Target_Asset_F__c=1'; |
| | | //不再查询是否有维修合同 |
| | |
| | | |
| | | //最后upsert客户服务目标对象 list目标 |
| | | List<Account_Service_Of_Target__c> asslist = new List<Account_Service_Of_Target__c>(); |
| | | //amaplist |
| | | //保有设备为单位 过去三年维修实绩 |
| | | Map<Id,Decimal> ThreeYearPriceSumMap = new Map<Id,Decimal>(); |
| | | |
| | | //过去三年维修实际 2022/10/13 修改 为当前时间的上一个月最后一天 往前推三年 |
| | | for(Repair__c rp :[SELECT Hospital__c,PurchaseOrInstallationDate__c,Repair_List_Price_formula__c,Delivered_Product__c |
| | | FROM Repair__c WHERE Delivered_Product__c in:mids |
| | | AND Repair_List_Price_formula__c !=null |
| | | AND Repair_List_Price_formula__c!=0 |
| | | AND Status1__c!='0.删除' |
| | | AND Status1__c!='0.取消' |
| | | AND Status2__c!='00.删除' |
| | | AND Status2__c!='00.取消' |
| | | AND Agreed_Date__c >=:sTime |
| | | AND Agreed_Date__c <:eTime |
| | | ]){ |
| | | Date purDate = rp.PurchaseOrInstallationDate__c; |
| | | if(purDate!=null){ |
| | | Decimal bDay = purDate.daysBetween(eTime); |
| | | Decimal hmoney = 0; |
| | | if(bDay < 0){ |
| | | bDay *=-1; |
| | | } |
| | | //设备年龄不足三年的 按平均每天计算 再乘 365 再乘 3 |
| | | if((bDay < 365*3) && bDay>0){ |
| | | hmoney = (rp.Repair_List_Price_formula__c / bDay) *365*3; |
| | | }else{ |
| | | hmoney = rp.Repair_List_Price_formula__c / 3; |
| | | } |
| | | if(ThreeYearPriceSumMap.containsKey(rp.Delivered_Product__c)){ |
| | | ThreeYearPriceSumMap.put(rp.Delivered_Product__c, ThreeYearPriceSumMap.get(rp.Delivered_Product__c)+hmoney); |
| | | }else{ |
| | | ThreeYearPriceSumMap.put(rp.Delivered_Product__c, hmoney); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //修改时间为过去三个完成财年 |
| | | |
| | | // Date LastThirdYearDate = td.addYears(-3); |
| | | // System.debug(LoggingLevel.INFO, '*** LastThirdYearDate: ' + LastThirdYearDate); |
| | | List<AggregateResult> ThreeyearList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | | sum(Repair_Quotation_Id__r.Loaner_repair__c) loaner_repair, |
| | | sum(Repair_Quotation_Id__r.long_term_insurance__c) long_term_insurance, |
| | | sum(Repair_Quotation_Id__r.Set_discount__c) set_discount, |
| | | sum(Repair_Quotation_Id__r.Servince_contract_discount_amount__c) sercince, |
| | | sum(Repair_Quotation_Id__r.long_term_insurance_MD__c) long_term_insuranceMD, |
| | | sum(Repair_Quotation_Id__r.Delivery_compensation__c) delivery, |
| | | sum(Repair_Quotation_Id__r.Other_discount__c) other, |
| | | AVG(Delivered_Product__r.Last_Years_Repair_Month__c) threeYearM, |
| | | Delivered_Product__c |
| | | from |
| | | Repair__c |
| | | where |
| | | Delivered_Product__c in:mids |
| | | and Agreed_Date__c != null |
| | | and Agreed_Date__c <= :eTime |
| | | and Agreed_Date__c >= :sTime |
| | | group by Delivered_Product__c |
| | | ]; |
| | | Map<Id, Decimal> ThreeYearPriceSumMap = new Map<id, Decimal>(); |
| | | Map<Id, Decimal> ThiYearMonthMap = new Map<id, Decimal>(); |
| | | // List<AggregateResult> ThreeyearList = [ |
| | | // select |
| | | // sum(Repair_List_Price_formula__c) SumPrice, |
| | | // sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | // sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | | // sum(Repair_Quotation_Id__r.Loaner_repair__c) loaner_repair, |
| | | // sum(Repair_Quotation_Id__r.long_term_insurance__c) long_term_insurance, |
| | | // sum(Repair_Quotation_Id__r.Set_discount__c) set_discount, |
| | | // sum(Repair_Quotation_Id__r.Servince_contract_discount_amount__c) sercince, |
| | | // sum(Repair_Quotation_Id__r.long_term_insurance_MD__c) long_term_insuranceMD, |
| | | // sum(Repair_Quotation_Id__r.Delivery_compensation__c) delivery, |
| | | // sum(Repair_Quotation_Id__r.Other_discount__c) other, |
| | | // AVG(Delivered_Product__r.Last_Years_Repair_Month__c) threeYearM, |
| | | // Delivered_Product__c |
| | | // from |
| | | // Repair__c |
| | | // where |
| | | // Delivered_Product__c in:mids |
| | | // and Agreed_Date__c != null |
| | | // and Agreed_Date__c <= :eTime |
| | | // and Agreed_Date__c >= :sTime |
| | | // and Repair_List_Price_formula__c!=0 |
| | | // and Repair_List_Price_formula__c!=null |
| | | // and Status1__c!='0.删除' |
| | | // and Status1__c!='0.取消' |
| | | // and Status2__c!='00.删除' |
| | | // and Status2__c!='00.取消' |
| | | // group by Delivered_Product__c |
| | | // ]; |
| | | // Map<Id, Decimal> ThreeYearPriceSumMap = new Map<id, Decimal>(); |
| | | // Map<Id, Decimal> ThiYearMonthMap = new Map<id, Decimal>(); |
| | | |
| | | for (AggregateResult Rpc : ThreeyearList) { |
| | | id idf = String.valueOf(Rpc.get('Delivered_Product__c')); |
| | | //Decimal Defir = decimal.valueOf(Rpc.get('SumPrice')+''); |
| | | Decimal threeYearM = decimal.valueOf(Rpc.get('threeYearM') + ''); |
| | | Decimal Defir = sumPrice1(Rpc); |
| | | ThreeYearPriceSumMap.put(idf, Defir); |
| | | ThiYearMonthMap.put(idf, threeYearM); |
| | | } |
| | | // System.debug(LoggingLevel.INFO, '*** ThreeyearList: ' + ThreeyearList); |
| | | // for (AggregateResult Rpc : ThreeyearList) { |
| | | // id idf = String.valueOf(Rpc.get('Delivered_Product__c')); |
| | | // //Decimal Defir = decimal.valueOf(Rpc.get('SumPrice')+''); |
| | | // Decimal threeYearM = decimal.valueOf(Rpc.get('threeYearM') + ''); |
| | | // Decimal Defir = sumPrice1(Rpc); |
| | | // ThreeYearPriceSumMap.put(idf, Defir); |
| | | // ThiYearMonthMap.put(idf, threeYearM); |
| | | // } |
| | | |
| | | //以医院为对象存储医院所有保有设备List |
| | | Map<Id,List<Asset>> aMapLists = new Map<Id,List<Asset>>(); |
| | |
| | | } |
| | | } |
| | | } |
| | | // update resultList; |
| | | update resultList; |
| | | System.debug(LoggingLevel.INFO, '*** updated resultList: ' + resultList); |
| | | for (Id mapId : aMapLists.keySet()) { |
| | | |
| | |
| | | |
| | | for (Asset asset : aMapLists.get(mapId) ) { |
| | | sumThreePrice += asset.Three_Years_Repair_Cost_Text__c; |
| | | System.debug(LoggingLevel.INFO, '*** sumThreePrice: ' + sumThreePrice); |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** asset.Product2.ServiceCategory__c: ' + asset.Product2.ServiceCategory__c); |
| | | System.debug(LoggingLevel.INFO, '*** asset.Is_Has_Contract_History__c: ' + asset.Is_Has_Contract_History__c); |
| | | |
| | | //分别统计软、硬、周边 1.定价总计 2.(未参保)过去三年平均维修实绩 3.未参保数量 |
| | | if(asset.Product2.ServiceCategory__c!=null){ |
| | | if(asset.Product2.ServiceCategory__c == '软性镜'){ |
| | |
| | | } |
| | | } |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** 周边未参保金额: ' + periE); |
| | | System.debug(LoggingLevel.INFO, '*** 硬 未参保金额: ' + hardE); |
| | | System.debug(LoggingLevel.INFO, '*** 软 未参保金额: ' + softE); |
| | | |
| | | Account_Service_Of_Target__c astItem = new Account_Service_Of_Target__c(); |
| | | if(targetMap.containsKey(mapId)){ |
| | | astItem = targetMap.get(mapId); |
| | |
| | | astItem.Uninsured_Quantity_Lightsource__c = periCount; |
| | | asslist.add(astItem); |
| | | System.debug(LoggingLevel.INFO, '*** 软性镜总个数: ' + softCountall); |
| | | System.debug(LoggingLevel.INFO, '*** 软性镜未参保个数: ' + astItem.Uninsured_Quantity_Soft_Mirror__c); |
| | | System.debug(LoggingLevel.INFO, '*** :astItem.Three_Years_Repair_Cost_Soft_Mirror__c ' + astItem.Three_Years_Repair_Cost_Soft_Mirror__c); |
| | | |
| | | |
| | | } |
| | | update resultList; |
| | | upsert asslist; |
| | | // System.debug(LoggingLevel.INFO, '*** asslist: ' + asslist); |
| | | // update resultList; |
| | | upsert asslist; |
| | | // update asslist; |
| | | |
| | | System.debug(LoggingLevel.INFO, '***更新后 asslist: ' + asslist); |
| | | |
| | | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | |
| | | |
| | | } |
| | | |
| | | private static Decimal sumPrice1(AggregateResult rpc) { |
| | | Decimal SumPrice = Decimal.valueOf(rpc.get('SumPrice') + ''); |
| | | Decimal sales_discount = Decimal.valueOf((rpc.get('sales_discount') == null ? 0 : rpc.get('sales_discount')) + '') * -1; |
| | | Decimal contract_target = Decimal.valueOf((rpc.get('contract_target') == null ? 0 : rpc.get('contract_target')) + '') * -1; |
| | | Decimal loaner_repair = Decimal.valueOf((rpc.get('loaner_repair') == null ? 0 : rpc.get('loaner_repair')) + '') * -1; |
| | | Decimal long_term_insurance = Decimal.valueOf((rpc.get('long_term_insurance') == null ? 0 : rpc.get('long_term_insurance')) + '') * -1; |
| | | Decimal set_discount = Decimal.valueOf((rpc.get('set_discount') == null ? 0 : rpc.get('set_discount')) + '') * -1; |
| | | Decimal sercince = Decimal.valueOf((rpc.get('sercince') == null ? 0 : rpc.get('sercince')) + '') * -1; |
| | | Decimal long_term_insuranceMD = Decimal.valueOf((rpc.get('long_term_insuranceMD') == null ? 0 : rpc.get('long_term_insuranceMD')) + '') * -1; |
| | | Decimal delivery = Decimal.valueOf((rpc.get('delivery') == null ? 0 : rpc.get('delivery')) + '') * -1; |
| | | Decimal other = Decimal.valueOf((rpc.get('other') == null ? 0 : rpc.get('other')) + '') * -1; |
| | | system.debug(rpc.get('SumPrice') + '--' + rpc.get('sales_discount') + '--' + rpc.get('contract_target') + '--' + |
| | | rpc.get('loaner_repair') + '--' + rpc.get('long_term_insurance') + '--' + rpc.get('set_discount') + '--' + rpc.get('long_term_insuranceMD') |
| | | + '--' + rpc.get('delivery') + '--' + rpc.get('other') + '--'); |
| | | return SumPrice + sales_discount + contract_target + loaner_repair + long_term_insurance + sercince + set_discount + long_term_insuranceMD + delivery + other; |
| | | } |
| | | // private static Decimal sumPrice1(AggregateResult rpc) { |
| | | // Decimal SumPrice = Decimal.valueOf(rpc.get('SumPrice') + ''); |
| | | // Decimal sales_discount = Decimal.valueOf((rpc.get('sales_discount') == null ? 0 : rpc.get('sales_discount')) + '') * -1; |
| | | // Decimal contract_target = Decimal.valueOf((rpc.get('contract_target') == null ? 0 : rpc.get('contract_target')) + '') * -1; |
| | | // Decimal loaner_repair = Decimal.valueOf((rpc.get('loaner_repair') == null ? 0 : rpc.get('loaner_repair')) + '') * -1; |
| | | // Decimal long_term_insurance = Decimal.valueOf((rpc.get('long_term_insurance') == null ? 0 : rpc.get('long_term_insurance')) + '') * -1; |
| | | // Decimal set_discount = Decimal.valueOf((rpc.get('set_discount') == null ? 0 : rpc.get('set_discount')) + '') * -1; |
| | | // Decimal sercince = Decimal.valueOf((rpc.get('sercince') == null ? 0 : rpc.get('sercince')) + '') * -1; |
| | | // Decimal long_term_insuranceMD = Decimal.valueOf((rpc.get('long_term_insuranceMD') == null ? 0 : rpc.get('long_term_insuranceMD')) + '') * -1; |
| | | // Decimal delivery = Decimal.valueOf((rpc.get('delivery') == null ? 0 : rpc.get('delivery')) + '') * -1; |
| | | // Decimal other = Decimal.valueOf((rpc.get('other') == null ? 0 : rpc.get('other')) + '') * -1; |
| | | // system.debug(rpc.get('SumPrice') + '--' + rpc.get('sales_discount') + '--' + rpc.get('contract_target') + '--' + |
| | | // rpc.get('loaner_repair') + '--' + rpc.get('long_term_insurance') + '--' + rpc.get('set_discount') + '--' + rpc.get('long_term_insuranceMD') |
| | | // + '--' + rpc.get('delivery') + '--' + rpc.get('other') + '--'); |
| | | // return SumPrice + sales_discount + contract_target + loaner_repair + long_term_insurance + sercince + set_discount + long_term_insuranceMD + delivery + other; |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert hospital; |
| | | |
| | | |
| | | // 戦略科室を得る |
| | | Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH']; |
| | | // 診療科を作る |
| | |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert dep; |
| | | |
| | | |
| | | |
| | | // 产品 |
| | | Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI', |
| | |
| | | |
| | | |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| | | contract.RecordType.Name = '服务合同'; |
| | | contract.Name = 'tect contract'; |
| | | contract.status__c ='契約'; |
| | | contract.Maintenance_Contract_No__c = 'Kami_Contract_No'; |
| | |
| | | contract.Contract_Start_Date__c=Date.newInstance(toDayTime.year(),3,2); // 10日前 |
| | | contract.Contract_End_Date__c = Date.newInstance(toDayTime.year()+1,3,20); // 5日後 |
| | | contract.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId(); |
| | | contract.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | insert contract; |
| | | |
| | | List<Maintenance_Contract__c> MaintenanceContract=[select id from Maintenance_Contract__c]; |
| | |
| | | assetA1.CompanyOfEquipment__c = '123'; |
| | | assetA1.Internal_Asset_number__c = '123'; |
| | | assetA1.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA1.InstallDate =Date.newInstance(2017, 1, 1); |
| | | // assetA1.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | assetA2.Internal_Asset_number__c = '123'; |
| | | assetA2.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA2.IF_Coverage_Target_Asset__c = '1'; |
| | | assetA2.InstallDate =Date.newInstance(2020, 1, 1); |
| | | |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 个体管理) |
| | | Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | assetA3.Internal_Asset_number__c = '123'; |
| | | assetA3.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA3.IF_Coverage_Target_Asset__c = '1'; |
| | | assetA3.InstallDate =Date.newInstance(2016, 1, 1); |
| | | |
| | | |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA4 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | assetA4.Internal_Asset_number__c = '123'; |
| | | assetA4.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA4.IF_Coverage_Target_Asset__c = '1'; |
| | | assetA4.InstallDate =Date.newInstance(2022, 5, 1); |
| | | |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | |
| | |
| | | assetA5.Internal_Asset_number__c = '123'; |
| | | assetA5.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA5.IF_Coverage_Target_Asset__c = '1'; |
| | | assetA3.InstallDate =Date.newInstance(2016, 1, 1); |
| | | |
| | | |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | Oly_TriggerHandler.bypass('AssetHandlerCheck'); |
| | |
| | | repairObj1.SalesOfficeCode_selection__c = '北京石景山'; |
| | | repairObj1.On_site_repair__c = 'RC修理'; |
| | | repairObj1.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj1.Agreed_Date__c = Date.today().addDays(-1); |
| | | repairObj1.Agreed_Date__c = Date.newInstance(Date.today().year()-1, 1, 1); |
| | | repairObj1.Repair_List_Price__c = 2000; |
| | | |
| | | // insert repairObj1; |
| | | |
| | |
| | | repairObj2.SalesOfficeCode_selection__c = '北京石景山'; |
| | | repairObj2.On_site_repair__c = 'RC修理'; |
| | | repairObj2.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj2.Agreed_Date__c = Date.today().addDays(-1); |
| | | repairObj2.Agreed_Date__c = Date.newInstance(Date.today().year()-1, 1, 1); |
| | | repairObj2.Repair_List_Price__c = 2000; |
| | | |
| | | |
| | | Repair__c repairObj3 = new Repair__c(); |
| | | repairObj3.Delivered_Product__c = Assetss[2].Id; |
| | |
| | | repairObj3.On_site_repair__c = 'RC修理'; |
| | | repairObj3.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj3.Agreed_Date__c = Date.today().addDays(-1); |
| | | repairObj3.Repair_List_Price__c = 2000; |
| | | |
| | | |
| | | insert new Repair__c[] {repairObj1, repairObj2, repairObj3}; |
| | | } |
| | |
| | | |
| | | List<String> raids = Raid.split(':'); |
| | | //检查是否可以继续 |
| | | List<Rental_Apply__c> RaTarList = [select Name,Campaign__c,Repair__c,next_action__c |
| | | List<Rental_Apply__c> RaTarList = [select Id,Name,Campaign__c,Repair__c,next_action__c |
| | | ,QIS_number__r.ReplaceDeliveryDate__c,demo_purpose2__c |
| | | ,Follow_UP_Opp__r.Shipping_Finished_Day_Func__c |
| | | ,Campaign__r.Status |
| | |
| | | ,Repair__r.Repair_Shipped_Date__c |
| | | from Rental_Apply__c |
| | | where id in :raids];//20210602 ljh update 增加查询Name SFDC-C3LBNL |
| | | |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 start |
| | | Map<Id, String> rentalApplyNameMap = new Map<Id, String>(); |
| | | List<Rental_Apply_Equipment_Set__c> RAESRecords = [ |
| | | SELECT Id,Rental_Apply__c,Rental_Apply__r.Name |
| | | FROM Rental_Apply_Equipment_Set__c |
| | | WHERE Rental_Apply__c in :raids |
| | | AND Cancel_Select__c = False |
| | | AND Rental_Start_Date__c <> :Date.today() |
| | | ORDER BY Rental_Apply__c]; |
| | | |
| | | for (Rental_Apply_Equipment_Set__c RAES : RAESRecords) { |
| | | if (rentalApplyNameMap.isEmpty() || !rentalApplyNameMap.containsKey(RAES.Rental_Apply__c)) { |
| | | rentalApplyNameMap.put(RAES.Rental_Apply__c, RAES.Rental_Apply__r.Name); |
| | | } |
| | | } |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 end |
| | | |
| | | //20210604 ljh update SFDC-C3LBNL start |
| | | Boolean errorFlag = false; |
| | | String message0 = ''; |
| | |
| | | String message5 = '';//1822 yc 20211108 索赔QIS目的,QIS已有新品发货日不能出库 |
| | | String message6 = ''; |
| | | String message7 = '';// 20220315 ljh obpm备品决裁状态相关修改 end |
| | | String message8 = '';//add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 |
| | | // 要判断决裁状态不能是草稿/驳回/终止申请/取消/删除 |
| | | List<String> statusList = System.Label.StatusProcessState.split(','); |
| | | Map<Id, Rental_Apply__c> RaMap = new Map<Id, Rental_Apply__c>(); |
| | |
| | | // 20220315 ljh obpm备品决裁状态相关修改 end |
| | | //20220217 sx add 备品借出申请-决裁控制 No.3 在出库时增加判断,判断学会是否申请决裁,如果是的话,再判断决裁编号是否不为空,满足条件才能出库,否则提示错误 |
| | | } |
| | | |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 start |
| | | if (!rentalApplyNameMap.isEmpty()) { |
| | | errorFlag = true; |
| | | for (String rentalApplyKey : rentalApplyNameMap.keySet()) { |
| | | message8 += rentalApplyNameMap.get(rentalApplyKey) + '、'; |
| | | } |
| | | } |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 end |
| | | |
| | | if(errorFlag){ |
| | | if(String.isNotBlank(message0)){ |
| | | message += '单号NO.'+message0.removeEnd('、')+'学会已取消,不能继续操作了'; |
| | |
| | | message += '单号No.'+ message7.removeEnd('、')+ '已申请决裁但决裁状态不符合条件'; |
| | | } |
| | | // 20220315 ljh obpm备品决裁状态相关修改 add end |
| | | |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 start |
| | | if(String.isNotBlank(message8)){ |
| | | message += '单号No.'+ message8.removeEnd('、')+ '的备品预计出货日应该等于今天,否则不能发货'; |
| | | } |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 end |
| | | |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error,message)); |
| | | return null; |
| | | } |
| | |
| | | global class EventToEventDetailsSchedule implements Schedulable { |
| | | global void execute(SchedulableContext sc) { |
| | | Id execBTId = Database.executeBatch(new EventToEventDetailsBatch(), 20); |
| | | Id execBTId1 = Database.executebatch(new EquipmentRepairBatch(),20); |
| | | } |
| | | } |
| | |
| | | private class EventToEventDetailsScheduleTest { |
| | | static testMethod void myUnitTest() { |
| | | // This test runs a scheduled job at midnight Sept. 3rd. 2022 |
| | | String CRON_EXP = '0 0 0 3 9 ? 2022'; |
| | | String CRON_EXP = '0 0 0 3 9 ? 2023'; |
| | | //System.Test.startTest(); |
| | | // Schedule the test job |
| | | String jobId = |
| | |
| | | // Verify the job has not run |
| | | System.assertEquals(0, ct.TimesTriggered); |
| | | // Verify the next time the job will run |
| | | System.assertEquals('2022-09-03 00:00:00', |
| | | System.assertEquals('2023-09-03 00:00:00', |
| | | String.valueOf(ct.NextFireTime)); |
| | | //System.Test.stopTest(); |
| | | } |
| New file |
| | |
| | | global class FirstContractHistoricalBatch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | |
| | | global FirstContractHistoricalBatch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | query = 'select Id,Maintenance_Contract__r.RecordType_Name__c,Maintenance_Contract__r.Contract_Start_Date__c,' |
| | | +' Maintenance_Contract__r.Contract_End_Date__c,Maintenance_Contract__r.Maintenance_Contract_No__c, Asset__r.name,Asset__r.id,asset__r.First_Service_number__c,asset__r.First_Service_Start_Day__c,' |
| | | +' asset__r.First_Service_End_Day__c,CreatedDate from Maintenance_Contract_Asset__c where Maintenance_Contract__r.Status__c = \'契約\' or Maintenance_Contract__r.Status__c = \'契約満了\' order by CreatedDate '; |
| | | |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Maintenance_Contract_Asset__c> mcaList) { |
| | | List<Asset> assList = new List<Asset>(); |
| | | List<String> assSqlList = new List<String>(); |
| | | List<String> macheckList = new List<String>(); |
| | | List<Maintenance_Contract_Asset__c> mcaList2 = new List<Maintenance_Contract_Asset__c>(); |
| | | Map<String,Maintenance_Contract_Asset__c> assetMap = new Map<String,Maintenance_Contract_Asset__c>(); |
| | | for ( Maintenance_Contract_Asset__c mca :mcaList) { |
| | | assSqlList.add(mca.Asset__r.id); |
| | | // 首次出现服务合同 |
| | | if (!assetMap.containsKey(mca.Asset__r.id)&&mca.Maintenance_Contract__r.RecordType_Name__c == '服务合同') { |
| | | assetMap.put(mca.Asset__r.id,mca); |
| | | } |
| | | } |
| | | List<Asset> assList1 = [select id,First_Service_number__c from Asset where id in :assSqlList]; |
| | | for (Asset ass:assList1) { |
| | | if (ass.First_Service_number__c!=null) { |
| | | macheckList.add(ass.First_Service_number__c); |
| | | } |
| | | } |
| | | if (macheckList.size()!=0 && macheckList!=null) { |
| | | mcaList2 = [select id,Asset__r.id,CreatedDate,Maintenance_Contract__r.Contract_Start_Date__c, |
| | | Maintenance_Contract__r.Contract_End_Date__c,Maintenance_Contract__r.Maintenance_Contract_No__c, |
| | | Asset__r.name,asset__r.First_Service_number__c,asset__r.First_Service_Start_Day__c, |
| | | asset__r.First_Service_End_Day__c |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__r.Maintenance_Contract_No__c in :macheckList]; |
| | | } |
| | | |
| | | for ( Maintenance_Contract_Asset__c mca:mcaList2) { |
| | | if (assetMap.get(mca.Asset__r.id)!=null && (assetMap.get(mca.Asset__r.id).CreatedDate > mca.CreatedDate)) { |
| | | assetMap.remove(mca.Asset__r.id); |
| | | assetMap.put(mca.Asset__r.id,mca); |
| | | } |
| | | } |
| | | |
| | | for (Maintenance_Contract_Asset__c mca:assetMap.values()) { |
| | | Asset ass = new Asset(); |
| | | ass.id = mca.asset__r.id; |
| | | |
| | | ass.First_Service_number__c = mca.Maintenance_Contract__r.Maintenance_Contract_No__c; |
| | | ass.First_Service_End_Day__c = mca.Maintenance_Contract__r.Contract_End_Date__c; |
| | | ass.First_Service_Start_Day__c = mca.Maintenance_Contract__r.Contract_Start_Date__c; |
| | | assList.add(ass); |
| | | } |
| | | |
| | | if (assList.size()>0) { |
| | | update assList; |
| | | } |
| | | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class FirstContractHistoricalBatchTest { |
| | | @testSetup |
| | | private static void init() { |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com',Job_Category__c = '销售服务', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert MacOwner; |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = |
| | | Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | |
| | | hospital.Name = 'test hospita/l'; |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI']; |
| | | |
| | | // // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_GI').getRecordTypeId(); |
| | | dep.Name = 'test de/p'; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | insert dep; |
| | | |
| | | // 製品を作る |
| | | Product2 productA = new Product2( Name='テスト商品', Maintenance_Price_Year__c = 12000, Manual_Entry__c = false,IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | | ProductCode_Ext__c='pc01'); |
| | | insert productA; |
| | | |
| | | // 第一期合同 |
| | | Maintenance_Contract__c contract1 = new Maintenance_Contract__c(); |
| | | contract1.Name = 'tect contract1'; |
| | | contract1.Hospital__c = hospital.Id; |
| | | contract1.Department_Class__c = strategicDep[0].Id; |
| | | contract1.Department__c = dep.Id; |
| | | contract1.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract1.Payment_Plan_Sum_First__c = 1; |
| | | contract1.Status__c = '契約'; |
| | | contract1.Maintenance_Contract_No__c = '11123'; |
| | | contract1.recordtypeId = |
| | | Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract1.Not_Upper_limit_reason__c = ' 1'; |
| | | contract1.Contract_Start_Date__c = Date.today().addDays( -10); |
| | | contract1.Contract_End_Date__c = Date.today().addDays( 5); |
| | | contract1.SalesOfficeCode_selection__c = '北京RC'; |
| | | insert contract1; |
| | | |
| | | // 第二期合同 |
| | | // Maintenance_Contract__c contract12 = new Maintenance_Contract__c(); |
| | | // contract12.Name = 'tect contract12'; |
| | | // contract12.Not_Upper_limit_reason__c = 'tect contract12'; |
| | | // contract12.RecordtypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | // contract12.Hospital__c = hospital.Id; |
| | | // contract1.Switch_TimeBase_WF__c = true; |
| | | // contract12.Department_Class__c = strategicDep[0].Id; |
| | | // contract12.Department__c = dep.Id; |
| | | // contract12.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | // contract12.Maintenance_Contract_No__c = 'tect contract12'; |
| | | // contract12.Status__c = '契約満了'; |
| | | // contract12.Contract_Start_Date__c = Date.today().addMonths(-13); |
| | | // contract12.Contract_End_Date__c = Date.today().addMonths(-1); |
| | | // insert contract12; |
| | | // insert new Maintenance_Contract__c[] {contract1}; |
| | | |
| | | System.debug('contract1 =='+ contract1 ); |
| | | List<Maintenance_Contract__c> listmc = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | // for (Maintenance_Contract__c mc:listmc) { |
| | | // mc1.id = mc.id; |
| | | // mc1.Status__c = '契約'; |
| | | // update mc1; |
| | | // System.debug('更新成功'+mc1); |
| | | |
| | | // } |
| | | // List<Maintenance_Contract__c> listmc1 = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | System.debug('listmc'+listmc); |
| | | // System.debug('contract12.Status__c =='+ contract12.Status__c ); |
| | | Asset asset = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset.SerialNumber = 'ass01'; |
| | | asset.Name = 'ass01'; |
| | | asset.AccountId = dep.Id; |
| | | asset.Department_Class__c = strategicDep[0].Id; |
| | | asset.Hospital__c = hospital.Id; |
| | | asset.Product2Id = productA.Id; |
| | | asset.Quantity = 1; |
| | | asset.Status = '有库存'; |
| | | asset.Manage_type__c = '个体管理'; |
| | | asset.Loaner_accsessary__c = false; |
| | | asset.Out_of_wh__c = 0; |
| | | asset.Salesdepartment__c = '1.华北营业本部'; |
| | | asset.Internal_asset_location__c = '北京 备品中心'; |
| | | asset.Product_category__c = 'GI'; |
| | | asset.Equipment_Type__c = '产品试用'; |
| | | asset.SalesProvince__c = '北京'; |
| | | asset.CurrentContract__c = contract1.Id; |
| | | asset.CurrentContract_Asset_Price__c = 0; |
| | | insert asset; |
| | | Asset asset2 = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset2.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset2.SerialNumber = 'ass02'; |
| | | asset2.Name = 'ass02'; |
| | | asset2.AccountId = dep.Id; |
| | | asset2.Department_Class__c = strategicDep[0].Id; |
| | | asset2.Hospital__c = hospital.Id; |
| | | asset2.Product2Id = productA.Id; |
| | | asset2.Quantity = 1; |
| | | asset2.Status = '有库存'; |
| | | asset2.Manage_type__c = '个体管理'; |
| | | asset2.Loaner_accsessary__c = false; |
| | | asset2.Out_of_wh__c = 0; |
| | | asset2.Salesdepartment__c = '1.华北营业本部'; |
| | | asset2.Internal_asset_location__c = '北京 备品中心'; |
| | | asset2.Product_category__c = 'GI'; |
| | | asset2.Equipment_Type__c = '产品试用'; |
| | | asset2.SalesProvince__c = '北京'; |
| | | asset2.CurrentContract__c = contract1.Id; |
| | | asset2.CurrentContract_Asset_Price__c = 0; |
| | | insert asset2; |
| | | //System.Test.stopTest(); |
| | | |
| | | Maintenance_Contract_Asset__c contract1asset1 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset1.Asset__c = asset.Id; |
| | | contract1asset1.Maintenance_Contract__c = contract1.Id; |
| | | contract1asset1.Estimate_List_Price_All_Manual__c = 1000; |
| | | insert contract1asset1; |
| | | // contract1asset.Maintenance_Contract_Asset_Estimate__c = mcae1.id; |
| | | Maintenance_Contract_Asset__c contract1asset2 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset2.Asset__c = asset2.Id; |
| | | contract1asset2.Maintenance_Contract__c = contract1.Id; |
| | | insert contract1asset2; |
| | | // insert new list<Maintenance_Contract_Asset__c> {contract1asset1,contract1asset2 }; |
| | | |
| | | |
| | | // repair01.Account__c = dep.Id; |
| | | |
| | | // // repair01.Repair_Start_Date__c = Date.newInstance(2022,7,20); |
| | | |
| | | // repair01.Department_Class__c = strategicDep[0].Id; |
| | | // repair01.Hospital__c = hospital.Id; |
| | | // repair01.Dealer__c = dep.Id; |
| | | // // repair01.Status1__c = '3.维修阶段'; |
| | | // repair01.Delivered_Product__c = asset.Id; |
| | | |
| | | // insert repair01; |
| | | Repair__c repair1 = new Repair__c(); |
| | | repair1.Service_Repair_No__c = 'repair1'; |
| | | repair1.Hospital__c = hospital.Id; |
| | | repair1.Account__c = dep.Id; |
| | | repair1.Department_Class__c = strategicDep[0].id; |
| | | repair1.Delivered_Product__c = asset.Id; |
| | | repair1.Repair_List_Price__c = 100; |
| | | repair1.Billing_Amount__c = 10; |
| | | repair1.Paid_Amount__c = 1; |
| | | repair1.DateReceiptQuestions__c = Date.newInstance(2022,7,20); |
| | | repair1.Failure_Occurrence_Date__c = Date.today().addDays(-1); |
| | | repair1.Repair_Returned_To_HP_Date__c = Date.today().addDays(3); |
| | | repair1.Repair_Shipped_Date__c = Date.today().addDays(1); |
| | | repair1.Maintenance_Contract__c = contract1.id; |
| | | System.debug('repair1.Maintenance_Contract__c =='+ repair1.Maintenance_Contract__c ); |
| | | System.debug('repair01.Status1__c =='+ repair1.Status1__c ); |
| | | system.debug('day=='+Date.today().addYears(-1)); |
| | | System.debug('repair01.DateReceiptQuestions__c =='+ repair1.DateReceiptQuestions__c ); |
| | | insert repair1; |
| | | |
| | | |
| | | } |
| | | @isTest static void test_method_one(){ |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new FirstContractHistoricalBatch(),200); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public without sharing class FrameNumController { |
| | | |
| | | public List<FrameNumManage__c> FnmList{get; set;} |
| | | public List<FileAddress__c> FileList{get; set;} |
| | | public List<String> FileStrList{get; set;} //用于存文件名 |
| | | public List<testInit> initList{get; set;} |
| | | public List<testInit> newinitList{get; set;} |
| | | public Map<String,FrameNumManage__c> FnmMap{get; set;} |
| | | public Map<String,String> FnmStrMap{get; set;} //用于存管理表的单名 |
| | | public Map<String,FileAddress__c> FileMap{get; set;} |
| | | public Map<String,String> FileStrMap{get; set;} //用于存文件下载链接 |
| | | public List<Map<String,FrameNumManage__c>> mapList{get; set;} |
| | | public List<String> strList{get; set;} |
| | | public FrameNumController() { |
| | | FnmList = [SELECT Id, Name ,ManagementCode__c, ApplyList__c,InspectionCard_Select__c ,InspectionCard_Select__r.ViewLink__c,InspectionCard_Select__r.DownloadLink__c, ApplyList_Select__c,ApplyList_Select__r.DownloadLink__c,ApplyList_Select__r.ViewLink__c, SerialNumber__c,Material__c , MaterialDepict__c from FrameNumManage__c]; |
| | | FnmList = new List<FrameNumManage__c>(); |
| | | initList = new List<testInit>(); |
| | | newinitList = new List<testInit>(); |
| | | } |
| | | public void init(){ |
| | | FnmMap = new Map<String,FrameNumManage__c>(); |
| | | FileStrMap = new Map<String,String>(); |
| | | FnmStrMap = new Map<String,String>(); |
| | | FileStrList = new List<String>(); |
| | | FnmList = [SELECT Id, Name ,ManagementCode__c, ApplyList__c ,InspectionCard_Select__c ,InspectionCard_Select__r.ViewLink__c,InspectionCard_Select__r.DownloadLink__c, ApplyList_Select__c,ApplyList_Select__r.DownloadLink__c,ApplyList_Select__r.ViewLink__c, Num__c , SerialNumber__c,Material__c , MaterialDepict__c from FrameNumManage__c order by ApplyList__c desc]; |
| | | /*if (FnmList.size()>0) { |
| | | for (FrameNumManage__c nObj : FnmList ) { |
| | | FnmStrMap.put(nObj.ApplyList__c, nObj.ApplyList__c); |
| | | } |
| | | for (String str : FnmStrMap.keySet()) { |
| | | FileStrList.add(str); |
| | | } |
| | | FileList = [SELECT Id, Name, FileName__c,ViewLink__c FROM FileAddress__c WHERE FileName__c IN: FileStrList]; |
| | | for (FileAddress__c file : FileList) { |
| | | FileStrMap.put(file.FileName__c, file.ViewLink__c); |
| | | } |
| | | }*/ // 2022-11-21 zyh 注释:ljh的Batch直接赋值,暂时无需再次查找 |
| | | // for (ImportDocT__c nObj : testList) { |
| | | // if (testMap==null) { |
| | | // testMap.put(nObj.code__c, nObj); |
| | | // }else{ |
| | | // testMap.put(nObj.code__c, nObj); |
| | | // } |
| | | // if (testMap.size() > 0) { |
| | | // mapList.add(testMap); |
| | | // } |
| | | // } |
| | | // for (ImportDocT__c mObj : testMap) { |
| | | // strList.add(testMap.get(mObj.code__c).size()); |
| | | // } |
| | | Integer n = 0; // 初始化合并行数 |
| | | for (Integer i=0;i<FnmList.size() ;i++ ) { |
| | | testInit init = new testInit(); |
| | | if (i==0) { |
| | | init.Name = FnmList[i].ManagementCode__c; |
| | | init.ProductName = FnmList[i].Material__c + '-' + FnmList[i].MaterialDepict__c; |
| | | // init.code = FnmList[i].ApplyList__c; |
| | | if (String.isNotBlank(FnmList[i].ApplyList_Select__r.DownloadLink__c)) { |
| | | init.code = FnmList[i].ApplyList_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.code = '不出证'; |
| | | } //2022-11-21 zyh add 报关单判断 |
| | | if (String.isNotBlank(FnmList[i].InspectionCard_Select__r.DownloadLink__c)) { |
| | | init.sj_code = FnmList[i].InspectionCard_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.sj_code = '不出证'; |
| | | } //2022-11-21 zyh add 商检证判断 |
| | | |
| | | // init.code = FileStrMap.get(FnmList[i].ApplyList__c); |
| | | init.Num = FnmList[i].Num__c; |
| | | init.Id = FnmList[i].Id; |
| | | init.FrameNo = FnmList[i].SerialNumber__c; |
| | | n = n+1; |
| | | if (i != FnmList.size()-1) { |
| | | // 判断第一个与第二个是否一样,不一样赋值1 |
| | | if (FnmList[i].ApplyList__c != FnmList[i+1].ApplyList__c) { |
| | | init.count = n; |
| | | } |
| | | } |
| | | }else { |
| | | // 判断与前一个编码是一致 |
| | | if (FnmList[i].ApplyList__c == FnmList[i-1].ApplyList__c) { |
| | | init.Name = FnmList[i].ManagementCode__c; |
| | | init.ProductName = FnmList[i].Material__c + '-' + FnmList[i].MaterialDepict__c; |
| | | // init.code = FnmList[i].ApplyList__c; |
| | | if (String.isNotBlank(FnmList[i].ApplyList_Select__r.DownloadLink__c)) { |
| | | init.code = FnmList[i].ApplyList_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.code = '不出证'; |
| | | } //2022-11-21 zyh add 报关单判断 |
| | | if (String.isNotBlank(FnmList[i].InspectionCard_Select__r.DownloadLink__c)) { |
| | | init.sj_code = FnmList[i].InspectionCard_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.sj_code = '不出证'; |
| | | } //2022-11-21 zyh add 商检证判断 |
| | | // init.code = FileStrMap.get(FnmList[i].ApplyList__c); |
| | | init.Num = FnmList[i].Num__c; |
| | | init.Id = FnmList[i].Id; |
| | | init.FrameNo = FnmList[i].SerialNumber__c; |
| | | n = n+1; |
| | | // 判断是不是最后一个 |
| | | if (i != FnmList.size()-1) { |
| | | // 不是最后一个,判断与下一个编码一致不一致,不一致直接赋值 |
| | | if (FnmList[i].ApplyList__c != FnmList[i+1].ApplyList__c) { |
| | | init.count = n; |
| | | } |
| | | } |
| | | // 最后一个直接赋值 |
| | | if (i == FnmList.size()-1) { |
| | | init.count = n; |
| | | } |
| | | }else { |
| | | // 下一组开始 |
| | | n = 0; |
| | | init.Name = FnmList[i].ManagementCode__c; |
| | | init.ProductName = FnmList[i].Material__c + '-' + FnmList[i].MaterialDepict__c; |
| | | // init.code = FnmList[i].ApplyList__c; |
| | | if (String.isNotBlank(FnmList[i].ApplyList_Select__r.DownloadLink__c)) { |
| | | init.code = FnmList[i].ApplyList_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.code = '不出证'; |
| | | } //2022-11-21 zyh add 报关单判断 |
| | | if (String.isNotBlank(FnmList[i].InspectionCard_Select__r.DownloadLink__c)) { |
| | | init.sj_code = FnmList[i].InspectionCard_Select__r.DownloadLink__c; |
| | | }else{ |
| | | init.sj_code = '不出证'; |
| | | } //2022-11-21 zyh add 商检证判断 |
| | | // init.code = FileStrMap.get(FnmList[i].ApplyList__c); |
| | | init.Num = FnmList[i].Num__c; |
| | | init.Id = FnmList[i].Id; |
| | | init.FrameNo = FnmList[i].SerialNumber__c; |
| | | n = n+1; |
| | | } |
| | | } |
| | | initList.add(init); |
| | | } |
| | | // 倒序显示 |
| | | for (Integer i = initList.size()-1; i>=0 ; i--) { |
| | | testInit init = new testInit(); |
| | | init = initList[i]; |
| | | newinitList.add(init); |
| | | } |
| | | } |
| | | // 定义内部类,自定义参数 |
| | | class testInit{ |
| | | public Boolean check{get; set;} |
| | | public String ProductName{get; set;} |
| | | public String Name{get; set;} |
| | | public String FrameNo{get; set;} |
| | | public String code{get; set;} |
| | | public String sj_code{get; set;} |
| | | public Decimal Num{get; set;} |
| | | public String Id{get; set;} |
| | | public Integer count{get; set;} |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class FrameNumControllerTest { |
| | | static testMethod void testMethod1() { |
| | | FrameNumManage__c nObj1 = new FrameNumManage__c(); |
| | | nObj1.Name = 'test1'; |
| | | nObj1.ManagementCode__c = '22R'; |
| | | nObj1.ApplyList__c = 'test1'; |
| | | nObj1.SerialNumber__c = 'ABCDEFG'; |
| | | nObj1.Num__c = 1; |
| | | nObj1.Material__c = 'test1'; |
| | | nObj1.MaterialDepict__c = 'test1'; |
| | | insert nObj1; |
| | | FrameNumManage__c nObj1_1 = new FrameNumManage__c(); |
| | | nObj1_1.Name = 'test1'; |
| | | nObj1_1.ManagementCode__c = '22R'; |
| | | nObj1_1.ApplyList__c = 'test1'; |
| | | nObj1_1.SerialNumber__c = 'ABCDEFG'; |
| | | nObj1_1.Num__c = 1; |
| | | nObj1_1.Material__c = 'test1'; |
| | | nObj1_1.MaterialDepict__c = 'test1'; |
| | | insert nObj1_1; |
| | | FrameNumManage__c nObj1_2 = new FrameNumManage__c(); |
| | | nObj1_2.Name = 'test1'; |
| | | nObj1_2.ManagementCode__c = '22R'; |
| | | nObj1_2.ApplyList__c = 'test2'; |
| | | nObj1_2.SerialNumber__c = 'ABCDEFG'; |
| | | nObj1_2.Num__c = 1; |
| | | nObj1_2.Material__c = 'test1'; |
| | | nObj1_2.MaterialDepict__c = 'test1'; |
| | | insert nObj1_2; |
| | | |
| | | FileAddress__c nObj2 = new FileAddress__c(); |
| | | // nObj2.Name = 'test1'; |
| | | nObj2.FileName__c = 'test1'; |
| | | nObj2.ViewLink__c = 'https://www.baidu.com'; |
| | | insert nObj2; |
| | | FileAddress__c nObj2_1 = new FileAddress__c(); |
| | | // nObj2.Name = 'test1'; |
| | | nObj2_1.FileName__c = 'test2'; |
| | | nObj2_1.ViewLink__c = 'https://www.baidu.com'; |
| | | insert nObj2_1; |
| | | FrameNumController con = new FrameNumController(); |
| | | con.init(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | /** |
| | | * [FrameNumUploadController 进口单证上传] |
| | | * @Author lijinhuan |
| | | * @DateTime 2022-11-04T18:31:03+0800 |
| | | * @return [进口单证上传] |
| | | */ |
| | | public with sharing class FrameNumUploadController { |
| | | public Integer detailCountLimit{get;private set;} |
| | | public FrameNumUploadController() { |
| | | detailCountLimit = 10000; |
| | | } |
| | | public void importCSVFile() { |
| | | String csvData = ApexPages.currentPage().getParameters().get('csvData'); |
| | | List<List<String>> tempCsvBody = CSVReader.readIETFRFC4180CSVFile(Blob.valueof(csvData)); // 全部CSV数据 |
| | | List<String> importLabelList = tempCsvBody[0]; // CSV读入的标题行 |
| | | // List<FrameNumManage__c> fnmList = new List<FrameNumManage__c>(); |
| | | Map<String,FrameNumManage__c> fnmMap = new Map<String,FrameNumManage__c>(); |
| | | Integer importLine = 0; |
| | | List<String> warningList = new List<String>(); |
| | | Map<String, String> labelToApiMap = createLabelApiMap(); |
| | | Map<String, SObjectField> queryFrameNumFieldMap = FrameNumManage__c.getSObjectType().getDescribe().fields.getMap(); |
| | | |
| | | for (Integer i = 1; i < tempCsvBody.size(); i++) { |
| | | FrameNumManage__c tempFnm = new FrameNumManage__c(); |
| | | for (Integer j = 0; j < importLabelList.size(); j++) { |
| | | String api = labelToApiMap.get(importLabelList[j]); |
| | | if (queryFrameNumFieldMap.containsKey(api) == false) { |
| | | throw new ControllerUtil.myException('字段:【' + importLabelList[j] + '】在' + FrameNumManage__c.getSObjectType().getDescribe().getLabel() + '里不存在, 请确认。'); |
| | | } |
| | | DescribeFieldResult queryAssetFieldResult = queryFrameNumFieldMap.get(api).getDescribe(); |
| | | if (String.isNotBlank(tempCsvBody[i][j])){ |
| | | String value = String.valueOf(tempCsvBody[i][j]).trim(); |
| | | if (queryAssetFieldResult.getType() == Schema.DisplayType.Date) { |
| | | value = value.replace('/', '-'); |
| | | tempFnm.put(api, Date.valueOf(value)); |
| | | } else if (queryAssetFieldResult.getType() == Schema.DisplayType.Boolean) { |
| | | tempFnm.put(api, Boolean.valueOf(value)); |
| | | } else if (queryAssetFieldResult.getType() == Schema.DisplayType.Double) { |
| | | tempFnm.put(api, Decimal.valueOf(value)); |
| | | } else { |
| | | tempFnm.put(api, value); |
| | | } |
| | | } |
| | | } |
| | | |
| | | String managementCode = tempFnm.ManagementCode__c; |
| | | String key = tempFnm.SerialNumber__c+'('+tempFnm.ManagementCode__c+')'; |
| | | tempFnm.SerialNumberS__c = key; |
| | | tempFnm.name = tempFnm.ManagementCode__c; |
| | | if(String.isBlank(managementCode)){ |
| | | throw new ControllerUtil.myException('【' + queryFrameNumFieldMap.get('ManagementCode__c').getDescribe().getLabel() + '】不可为空' + tempFnm); |
| | | }else if(fnmMap.containsKey(key)){ |
| | | throw new ControllerUtil.myException('【' + queryFrameNumFieldMap.get('ManagementCode__c').getDescribe().getLabel() + '】存在多条数据' + tempFnm); |
| | | } else{ |
| | | fnmMap.put(key,tempFnm); |
| | | } |
| | | } |
| | | // 执行插入/更新 |
| | | if(fnmMap.size() > 0){ |
| | | /*List<FrameNumManage__c> tempList = [SELECT Id,SerialNumberS__c FROM FrameNumManage__c WHERE SerialNumberS__c IN :fnmMap.keySet()]; |
| | | IF(tempList.size() > 0){ |
| | | for(FrameNumManage__c temp:tempList){ |
| | | FrameNumManage__c fnm = new FrameNumManage__c(); |
| | | fnm = fnmMap.get(temp.SerialNumberS__c); |
| | | fnm.put('Id',temp.Id); |
| | | fnmMap.put(temp.SerialNumberS__c,fnm); |
| | | } |
| | | } |
| | | Database.UpsertResult[] urList = Database.upsert(fnmMap.values(),FrameNumManage__c.Id,false); |
| | | */ |
| | | Database.UpsertResult[] urList = Database.upsert(fnmMap.values(),FrameNumManage__c.SerialNumberS__c,false); |
| | | for (Integer tIdx = 0; tIdx < urList.size(); tIdx++) { |
| | | Database.UpsertResult sr = urList[tIdx]; |
| | | if (!sr.isSuccess()) { |
| | | String errStr = ''; |
| | | Database.Error emsg = sr.getErrors()[0]; |
| | | errStr = emsg.getMessage(); |
| | | warningList.add(errStr); |
| | | }else{ |
| | | importLine++; |
| | | } |
| | | } |
| | | |
| | | for(Integer i = 0; i < Math.min(5, warningList.size()); i++){ |
| | | ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.WARNING, warningList[i])); |
| | | } |
| | | if (warningList.size() > 0) { |
| | | ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.WARNING, warningList.size() + '条记录插入/更新失败')); |
| | | } |
| | | if(importLine == 0) { |
| | | ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.WARNING, '未导入任何数据,请检查CSV文件')); |
| | | } |
| | | else { |
| | | String importSuccessfulMsg = '导入CSV文件完成,成功导入' + importLine + '条数据。'; |
| | | ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.INFO, importSuccessfulMsg)); |
| | | // 调用batch |
| | | Database.executeBatch(new SetFrameNumManageBatch(), 100); |
| | | } |
| | | } |
| | | } |
| | | private Map<String, String> createLabelApiMap(){ |
| | | Map<String,String> apiMap = new Map<String,String>(); |
| | | Map<String,Schema.SObjectField> mfields = FrameNumManage__c.sObjectType.getDescribe().fields.getMap(); |
| | | for(String strField:mfields.keySet()) { |
| | | SObjectField fl = mfields.get(strField); |
| | | apiMap.put(fl.getDescribe().getlabel(), strField); |
| | | } |
| | | return apiMap; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>48.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global without sharing class ImportDocTController { |
| | | public List<ImportDocT__c> testList{get; set;} |
| | | public List<testInit> initList{get; set;} |
| | | public List<testInit> newinitList{get; set;} |
| | | public Map<String,ImportDocT__c> testMap{get; set;} |
| | | public List<Map<String,ImportDocT__c>> mapList{get; set;} |
| | | public List<String> strList{get; set;} |
| | | public ImportDocTController() { |
| | | testList = [SELECT Id, Name , code__c from ImportDocT__c]; |
| | | testList = new List<ImportDocT__c>(); |
| | | initList = new List<testInit>(); |
| | | newinitList = new List<testInit>(); |
| | | } |
| | | public void init(){ |
| | | testMap = new Map<String,ImportDocT__c>(); |
| | | testList = [SELECT Id, Name , code__c , Num__c from ImportDocT__c order by code__c desc]; |
| | | // for (ImportDocT__c nObj : testList) { |
| | | // if (testMap==null) { |
| | | // testMap.put(nObj.code__c, nObj); |
| | | // }else{ |
| | | // testMap.put(nObj.code__c, nObj); |
| | | // } |
| | | // if (testMap.size() > 0) { |
| | | // mapList.add(testMap); |
| | | // } |
| | | // } |
| | | // for (ImportDocT__c mObj : testMap) { |
| | | // strList.add(testMap.get(mObj.code__c).size()); |
| | | // } |
| | | Integer n = 0; // 初始化合并行数 |
| | | for (Integer i=0;i<testList.size() ;i++ ) { |
| | | testInit init = new testInit(); |
| | | if (i==0) { |
| | | init.Name = testList[i].Name; |
| | | init.code = testList[i].code__c; |
| | | init.Num = testList[i].Num__c; |
| | | init.Id = testList[i].Id; |
| | | n = n+1; |
| | | if (i != testList.size()-1) { |
| | | // 判断第一个与第二个是否一样,不一样赋值1 |
| | | if (testList[i].code__c != testList[i+1].code__c) { |
| | | init.count = n; |
| | | } |
| | | } |
| | | }else { |
| | | // 判断与前一个编码是一致 |
| | | if (testList[i].code__c == testList[i-1].code__c) { |
| | | init.Name = testList[i].Name; |
| | | init.code = testList[i].code__c; |
| | | init.Num = testList[i].Num__c; |
| | | init.Id = testList[i].Id; |
| | | n = n+1; |
| | | // 判断是不是最后一个 |
| | | if (i != testList.size()-1) { |
| | | // 不是最后一个,判断与下一个编码一致不一致,不一致直接赋值 |
| | | if (testList[i].code__c != testList[i+1].code__c) { |
| | | init.count = n; |
| | | } |
| | | } |
| | | // 最后一个直接赋值 |
| | | if (i == testList.size()-1) { |
| | | init.count = n; |
| | | } |
| | | }else { |
| | | // 下一组开始 |
| | | n = 0; |
| | | init.Name = testList[i].Name; |
| | | init.code = testList[i].code__c; |
| | | init.Num = testList[i].Num__c; |
| | | init.Id = testList[i].Id; |
| | | n = n+1; |
| | | } |
| | | } |
| | | initList.add(init); |
| | | } |
| | | // 倒序显示 |
| | | for (Integer i = initList.size()-1; i>=0 ; i--) { |
| | | testInit init = new testInit(); |
| | | init = initList[i]; |
| | | newinitList.add(init); |
| | | } |
| | | } |
| | | // 定义内部类,自定义参数 |
| | | class testInit{ |
| | | public Boolean check{get; set;} |
| | | public String Name{get; set;} |
| | | public String code{get; set;} |
| | | public Decimal Num{get; set;} |
| | | public String Id{get; set;} |
| | | public Integer count{get; set;} |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | opp.Predicted_date_ChangeReason__c = ipd.Predicted_date_ChangeReason__c; //改变预测日期原因 |
| | | // opp.Opp_New_Mark__c = ipd.Opp_New_Mark__c; //询价新建标记 |
| | | opp.Opp_Delay_Mark__c = ipd.Opp_Delay_Mark__c; //询价延后标价 |
| | | opp.ForecastApprovalTime__c = Datetime.now(); |
| | | |
| | | oppList.add(opp); |
| | | |
| | |
| | | } |
| | | |
| | | if (oppList.size() > 0) { |
| | | System.debug('lt123oppList'+oppList); |
| | | update oppList; |
| | | } |
| | | } |
| | |
| | | return JsonData; |
| | | } |
| | | |
| | | |
| | | //20220913 you SWAG-CJ3DS5 start |
| | | //招投标项目列表字段 irresponsibleReason__c 所有的值 |
| | | @AuraEnabled |
| | | public static string GetproInvolvedManual(){ |
| | | String JsonData = CommonUtils.GetSelectedValues( Tender_information__c.proInvolvedManual__c.getDescribe()); |
| | | return JsonData; |
| | | } |
| | | //20220913 you SWAG-CJ3DS5 end |
| | | |
| | | |
| | | // 产品类 |
| | |
| | | try{ |
| | | Tender_information__c temp = (Tender_information__c)JSON.deserialize(JsonData,Tender_information__c.class); |
| | | System.debug('temp=='+temp); |
| | | |
| | | StaticParameter.EscapeOtherUpdateTenOwner = false; |
| | | update temp; |
| | | StaticParameter.EscapeOtherUpdateTenOwner = true; |
| | | |
| | | //String assvale=AssignValuesToOwner(Id,checkboxValue); |
| | | }catch(Exception ex) |
| | | { |
| New file |
| | |
| | | public class LCC_JSMQueryResultService { |
| | | |
| | | @AuraEnabled |
| | | public static List<sObject> executeQuery(String theQuery){ |
| | | try{ |
| | | //We do not escape parameters here since the query must not be modified. |
| | | //Parameters must be escaped by consumers of this method |
| | | return Database.query(theQuery); |
| | | }catch(Exception e){ |
| | | throw new AuraHandledException('Error doing the query: '+theQuery+' Error: '+e.getMessage()); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static sObject executeQueryOneObject(String theQuery){ |
| | | try{ |
| | | //We do not escape parameters here since the query must not be modified. |
| | | //Parameters must be escaped by consumers of this method |
| | | return Database.query(theQuery); |
| | | }catch(Exception e){ |
| | | throw new AuraHandledException('Error doing the query: '+theQuery+' Error: '+e.getMessage()); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static LCC_JSMUserInfo getUserInfo(){ |
| | | try{ |
| | | LCC_JSMUserInfo info = new LCC_JSMUserInfo(); |
| | | info.Id = Userinfo.getUserId(); |
| | | info.FirstName = Userinfo.getFirstName(); |
| | | info.LastName = Userinfo.getLastName(); |
| | | info.UserEmail = Userinfo.getUserEmail(); |
| | | info.Name = Userinfo.getName(); |
| | | info.UserName = Userinfo.getUserName(); |
| | | return info; |
| | | }catch(Exception e){ |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static Profile getProfileInfo(){ |
| | | try{ |
| | | String profileId = UserInfo.getProfileId(); |
| | | Profile profile = [SELECT Id, Name FROM Profile WHERE Id =:profileId]; |
| | | return profile; |
| | | }catch(Exception e){ |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static LCC_JSMSiteInfo getSiteInfo(){ |
| | | try{ |
| | | LCC_JSMSiteInfo info = new LCC_JSMSiteInfo(); |
| | | info.Prefix = Site.getPathPrefix(); |
| | | info.Domain = Site.getDomain(); |
| | | info.Name = Site.getName(); |
| | | return info; |
| | | }catch(Exception e){ |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static sObject loadObjectInfoById(Id recordId) { |
| | | |
| | | DescribeSObjectResult objectType = recordId.getSobjectType().getDescribe(); |
| | | List<String> objectFields = new List<String>(objectType.fields.getMap().keySet()); |
| | | |
| | | String query = 'SELECT ' + String.join(objectFields, ',') + ' FROM ' + objectType.getName() + ' WHERE Id = \'' + String.escapeSingleQuotes(recordId) + '\' LIMIT 1'; |
| | | |
| | | return executeQueryOneObject(query); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>47.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public class LCC_JSMQueryResultServiceTest { |
| | | |
| | | @isTest |
| | | static public void executeQueryTest(){ |
| | | //do the query |
| | | String theQuery = 'SELECT Id FROM User LIMIT 5'; |
| | | List<User> user = LCC_JSMQueryResultService.executeQuery(theQuery); |
| | | |
| | | //compare the result |
| | | System.assertNotEquals(null, user); |
| | | } |
| | | |
| | | @isTest |
| | | static public void executeQueryOneObjectTest(){ |
| | | //do the query |
| | | String theQuery = 'SELECT Id FROM User LIMIT 1'; |
| | | User user = (User)LCC_JSMQueryResultService.executeQueryOneObject(theQuery); |
| | | |
| | | //compare the result |
| | | System.assertNotEquals(null, user); |
| | | } |
| | | |
| | | @isTest |
| | | static public void getUserInfoTest(){ |
| | | LCC_JSMUserInfo user = LCC_JSMQueryResultService.getUserInfo(); |
| | | //compare the result |
| | | System.assertEquals(UserInfo.getUserId(), user.Id); |
| | | System.assertEquals(UserInfo.getFirstName(), user.FirstName); |
| | | System.assertEquals(UserInfo.getLastName(), user.LastName); |
| | | System.assertEquals(UserInfo.getUserEmail(), user.UserEmail); |
| | | System.assertEquals(UserInfo.getName(), user.Name); |
| | | System.assertEquals(UserInfo.getUserName(), user.UserName); |
| | | } |
| | | |
| | | @isTest |
| | | static public void getProfileInfoTest(){ |
| | | String profileId = UserInfo.getProfileId(); |
| | | Profile profile = [SELECT Id, Name FROM Profile WHERE Id =:profileId]; |
| | | |
| | | Profile prof = LCC_JSMQueryResultService.getProfileInfo(); |
| | | //compare the result |
| | | System.assertEquals(profile.Id, prof.Id); |
| | | System.assertEquals(profile.Name, prof.Name); |
| | | } |
| | | |
| | | @isTest |
| | | static public void getSiteInfoTest(){ |
| | | LCC_JSMSiteInfo info = LCC_JSMQueryResultService.getSiteInfo(); |
| | | //compare the result |
| | | System.assertEquals(Site.getPathPrefix(), info.Prefix); |
| | | System.assertEquals(Site.getDomain(), info.Domain); |
| | | System.assertEquals(Site.getName(), info.Name); |
| | | } |
| | | |
| | | @isTest |
| | | static public void executeQueryNegTest(){ |
| | | //do the query |
| | | String theQuery = 'SELECT Id, Count From Account LIMIT 5'; |
| | | |
| | | try{ |
| | | List<Account> acc = LCC_JSMQueryResultService.executeQuery(theQuery); |
| | | System.assert(false); |
| | | }catch(AuraHandledException ex){ |
| | | System.assert(true); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static public void executeQueryOneObjectNegTest(){ |
| | | //do the query |
| | | String theQuery = 'SELECT Id From Account LIMIT 5'; |
| | | |
| | | try{ |
| | | Account acc = (Account)LCC_JSMQueryResultService.executeQueryOneObject(theQuery); |
| | | System.assert(false); |
| | | }catch(AuraHandledException ex){ |
| | | System.assert(true); |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static public void loadObjectInfoByIdTest(){ |
| | | try{ |
| | | Task testTask = new Task(); |
| | | testTask.Subject = 'Subject Test'; |
| | | testTask.Priority = 'Normal'; |
| | | testTask.Status = 'Completed'; |
| | | |
| | | Test.startTest(); |
| | | insert testTask; |
| | | Test.stopTest(); |
| | | |
| | | Task tsk = (Task)LCC_JSMQueryResultService.loadObjectInfoById(testTask.Id); |
| | | |
| | | System.assertEquals(testTask.Id, tsk.Id); |
| | | System.assertEquals(testTask.Subject, tsk.Subject); |
| | | System.assertEquals(testTask.Priority, tsk.Priority); |
| | | System.assertEquals(testTask.Status, tsk.Status); |
| | | |
| | | } catch(AuraHandledException ex) { |
| | | System.assert(false); |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>47.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public class LCC_JSMSiteInfo { |
| | | @AuraEnabled |
| | | public String Prefix {get;set;} |
| | | @AuraEnabled |
| | | public String Name {get;set;} |
| | | @AuraEnabled |
| | | public String Domain {get;set;} |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>47.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | public class LCC_JSMUserInfo{ |
| | | @AuraEnabled |
| | | public String Id {get;set;} |
| | | @AuraEnabled |
| | | public String FirstName {get;set;} |
| | | @AuraEnabled |
| | | public String LastName {get;set;} |
| | | @AuraEnabled |
| | | public String UserEmail {get;set;} |
| | | @AuraEnabled |
| | | public String Name {get;set;} |
| | | @AuraEnabled |
| | | public String UserName {get;set;} |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>47.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | } |
| | | |
| | | protected override void beforeInsert(){ |
| | | |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 start |
| | | SetUniqueKey(null); |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 end |
| | | } |
| | | |
| | | protected override void beforeUpdate(){ |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 start |
| | | CheckInquiryWinAboutupdate(); |
| | | SetUniqueKeyOnUpdate(); |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 end |
| | | } |
| | | protected override void afterInsert(){ |
| | | ReservedPro(); |
| | | } |
| | |
| | | protected override void afterDelete(){ |
| | | ReservedPro(); |
| | | } |
| | | |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 start |
| | | protected override void beforeDelete(){ |
| | | CheckInquiryWin(); |
| | | } |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 end |
| | | private void ReservedPro(){ |
| | | //1.新建或者更新产品后,若预留产品有效,“预留产品”标识为true |
| | | if(trigger.isInsert || trigger.isUpdate){ |
| | |
| | | } |
| | | |
| | | } |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 start |
| | | private void SetUniqueKey(Set<Id> lbps){ |
| | | if(trigger.isInsert) { |
| | | for (LastbuyProduct__c Lastbuyobj : this.newList){ |
| | | Lastbuyobj.productInquiryOnly__c = Lastbuyobj.ProductName__c+'_'+Lastbuyobj.InquiryCode__c; |
| | | } |
| | | } else { |
| | | if(lbps!=null&&lbps.size() > 0){ |
| | | for(String id : lbps){ |
| | | LastbuyProduct__c Lastbuyobj = this.newMap.get(id); |
| | | Lastbuyobj.productInquiryOnly__c = Lastbuyobj.ProductName__c+'_'+Lastbuyobj.InquiryCode__c; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | private void CheckInquiryWin(){ |
| | | if(trigger.isBefore && trigger.isDelete){ |
| | | List<Id> InquiryId = new List<Id>(); |
| | | List<Id> InquiryWinId = new List<Id>(); |
| | | for(LastbuyProduct__c Lastbuyobj : oldList){ |
| | | InquiryId.add(Lastbuyobj.InquiryCode__c); |
| | | } |
| | | List<Opportunity> OppList = [select Id,SAP_Send_OK__c from Opportunity where Id =:InquiryId]; |
| | | System.debug('OppList++'+OppList); |
| | | for(Opportunity oppobj : OppList){ |
| | | if(oppobj.SAP_Send_OK__c){ |
| | | // InquiryWinId.add(oppobj.Id); |
| | | throw new ControllerUtil.myException('预留询价已经WIN不允许删除'); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 询价发生变化时验证 |
| | | private void CheckInquiryWinAboutupdate(){ |
| | | if(trigger.isBefore && trigger.isUpdate){ |
| | | List<Id> LastbuyId = new List<Id>(); |
| | | List<Id> oppId = new List<Id>(); |
| | | for(LastbuyProduct__c Lastbuyobj : newList){ |
| | | // 只取询价发生变化的数据 |
| | | if (Lastbuyobj.InquiryCode__c != oldMap.get(Lastbuyobj.Id).InquiryCode__c) { |
| | | LastbuyId.add(Lastbuyobj.Id); |
| | | oppId.add(oldMap.get(Lastbuyobj.Id).InquiryCode__c); |
| | | } |
| | | } |
| | | List<Opportunity> oppList = [select Id,SAP_Send_OK__c from Opportunity where Id =:oppId]; |
| | | for(Opportunity opp : oppList){ |
| | | if(opp.SAP_Send_OK__c){ |
| | | throw new ControllerUtil.myException('预留的询价已经WIN,不允许替换,请取消WIN后再替换'); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | // 询价或产品发生变化时更新唯一标识 |
| | | private void SetUniqueKeyOnUpdate() { |
| | | Set<Id> updateUniKeys = new Set<Id>(); |
| | | for(LastbuyProduct__c Lastbuyobj : this.newList){ |
| | | LastbuyProduct__c old_Lastbuyobj = oldMap.get(Lastbuyobj.Id); |
| | | // 产品或询价变化的时候都加进来 |
| | | if (Lastbuyobj.InquiryCode__c != old_Lastbuyobj.InquiryCode__c || |
| | | Lastbuyobj.ProductName__c != old_Lastbuyobj.ProductName__c || |
| | | String.isBlank(Lastbuyobj.productInquiryOnly__c)) { |
| | | updateUniKeys.add(Lastbuyobj.Id); |
| | | } |
| | | } |
| | | SetUniqueKey(updateUniKeys); |
| | | } |
| | | //SWAG-CKADFQ 【委托】【Last Buy】Last Buy预留管理改善新需求 end |
| | | |
| | | } |
| | |
| | | private class LastbuyProductHandlerTest { |
| | | @isTest |
| | | static void TestMethod1() { |
| | | |
| | | Product2 pro = new Product2(); |
| | | pro.Name = 'Testname0215'; |
| | | pro.LastbuyProductFLG__c = false; |
| | |
| | | pro1.Name = 'Testname0216'; |
| | | pro1.LastbuyProductFLG__c = false; |
| | | insert pro1; |
| | | |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '北京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | // 市 |
| | | Address_Level2__c al2 = new Address_Level2__c(); |
| | | al2.Level1_Code__c = 'CN-99'; |
| | | al2.Level1_Sys_No__c = '999999'; |
| | | al2.Level1_Name__c = '北京'; |
| | | al2.Name = '海淀区'; |
| | | al2.Level2_Code__c = 'CN-9999'; |
| | | al2.Level2_Sys_No__c = '9999999'; |
| | | al2.Address_Level__c = al.id; |
| | | insert al2; |
| | | |
| | | Account company = new Account(); |
| | | company.Name = 'aiueo病院'; |
| | | company.RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | company.State_Master__c = al.Id; |
| | | company.City_Master__c = al2.Id; |
| | | insert company; |
| | | |
| | | Account sct = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company.Id and RecordTypeId = :Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_Class_BF').getRecordTypeId() Limit 1]; |
| | | |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_BF').getRecordTypeId(); |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'aiueo診療科'; |
| | | depart.ParentId = sct.Id; |
| | | depart.Department_Class__c = sct.Id; |
| | | depart.Hospital__c = company.Id; |
| | | insert depart; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | Opportunity opp1 = new Opportunity(Name = 'aiueo商談', StageName = 'contact', CloseDate=Date.today(), SAP_Send_OK__c = false, AccountId = depart.Id); |
| | | insert opp1; |
| | | |
| | | LastbuyProduct__c lbp = new LastbuyProduct__c(); |
| | | lbp.Name = 'Test0215'; |
| | | lbp.ProductName__c = pro.Id; |
| | | lbp.InquiryCode__c = opp1.Id; |
| | | lbp.effectiveFLG__c = true; |
| | | insert lbp; |
| | | |
| | |
| | | lbp.effectiveFLG__c = true; |
| | | update lbp; |
| | | |
| | | LastbuyProduct__c lbp1 = new LastbuyProduct__c(); |
| | | lbp1.Name = 'Test0216'; |
| | | lbp1.ProductName__c = pro1.Id; |
| | | lbp1.effectiveFLG__c = true; |
| | | insert lbp1; |
| | | |
| | | LastbuyProduct__c lbp2 = new LastbuyProduct__c(); |
| | | lbp2.Name = 'Test0217'; |
| | | lbp2.ProductName__c = pro1.Id; |
| | | lbp2.effectiveFLG__c = true; |
| | | insert lbp2; |
| | | |
| | | lbp1.effectiveFLG__c = false; |
| | | update lbp1; |
| | | |
| | | lbp2.ProductName__c = pro.Id; |
| | | update lbp2; |
| | | |
| | | delete lbp1; |
| | | |
| | | delete lbp; |
| | | } |
| | | |
| | | @isTest |
| | | static void TestMethod2() { |
| | | |
| | | Product2 pro = new Product2(); |
| | | pro.Name = 'Testname0215'; |
| | | pro.LastbuyProductFLG__c = false; |
| | | insert pro; |
| | | |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '北京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | // 市 |
| | | Address_Level2__c al2 = new Address_Level2__c(); |
| | | al2.Level1_Code__c = 'CN-99'; |
| | | al2.Level1_Sys_No__c = '999999'; |
| | | al2.Level1_Name__c = '北京'; |
| | | al2.Name = '海淀区'; |
| | | al2.Level2_Code__c = 'CN-9999'; |
| | | al2.Level2_Sys_No__c = '9999999'; |
| | | al2.Address_Level__c = al.id; |
| | | insert al2; |
| | | |
| | | Account company = new Account(); |
| | | company.Name = 'aiueo病院'; |
| | | company.RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | company.State_Master__c = al.Id; |
| | | company.City_Master__c = al2.Id; |
| | | insert company; |
| | | |
| | | Account sct = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company.Id and RecordTypeId = :Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_Class_BF').getRecordTypeId() Limit 1]; |
| | | |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_BF').getRecordTypeId(); |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'aiueo診療科'; |
| | | depart.ParentId = sct.Id; |
| | | depart.Department_Class__c = sct.Id; |
| | | depart.Hospital__c = company.Id; |
| | | insert depart; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | Opportunity opp1 = new Opportunity(Name = 'aiueo商談', StageName = 'contact', CloseDate=Date.today(), SAP_Send_OK__c = true, AccountId = depart.Id); |
| | | insert opp1; |
| | | |
| | | Opportunity opp2 = new Opportunity(Name = 'aiueo商談', StageName = 'contact', CloseDate=Date.today(), SAP_Send_OK__c = false, AccountId = depart.Id); |
| | | insert opp2; |
| | | |
| | | LastbuyProduct__c lbp = new LastbuyProduct__c(); |
| | | lbp.Name = 'Test0215'; |
| | | lbp.ProductName__c = pro.Id; |
| | | lbp.InquiryCode__c = opp1.Id; |
| | | lbp.effectiveFLG__c = true; |
| | | insert lbp; |
| | | |
| | | try{ |
| | | lbp.InquiryCode__c = opp2.Id; |
| | | update lbp; |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void TestMethod3() { |
| | | |
| | | Product2 pro = new Product2(); |
| | | pro.Name = 'Testname0215'; |
| | | pro.LastbuyProductFLG__c = false; |
| | | insert pro; |
| | | |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '北京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | // 市 |
| | | Address_Level2__c al2 = new Address_Level2__c(); |
| | | al2.Level1_Code__c = 'CN-99'; |
| | | al2.Level1_Sys_No__c = '999999'; |
| | | al2.Level1_Name__c = '北京'; |
| | | al2.Name = '海淀区'; |
| | | al2.Level2_Code__c = 'CN-9999'; |
| | | al2.Level2_Sys_No__c = '9999999'; |
| | | al2.Address_Level__c = al.id; |
| | | insert al2; |
| | | |
| | | Account company = new Account(); |
| | | company.Name = 'aiueo病院'; |
| | | company.RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | company.State_Master__c = al.Id; |
| | | company.City_Master__c = al2.Id; |
| | | insert company; |
| | | |
| | | Account sct = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company.Id and RecordTypeId = :Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_Class_BF').getRecordTypeId() Limit 1]; |
| | | |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_BF').getRecordTypeId(); |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'aiueo診療科'; |
| | | depart.ParentId = sct.Id; |
| | | depart.Department_Class__c = sct.Id; |
| | | depart.Hospital__c = company.Id; |
| | | insert depart; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | Opportunity opp1 = new Opportunity(Name = 'aiueo商談', StageName = 'contact', CloseDate=Date.today(), SAP_Send_OK__c = true, AccountId = depart.Id); |
| | | insert opp1; |
| | | |
| | | LastbuyProduct__c lbp = new LastbuyProduct__c(); |
| | | lbp.Name = 'Test0215'; |
| | | lbp.ProductName__c = pro.Id; |
| | | lbp.InquiryCode__c = opp1.Id; |
| | | lbp.effectiveFLG__c = true; |
| | | insert lbp; |
| | | |
| | | try{ |
| | | delete lbp; |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | global class LightningForgotPasswordController { |
| | | |
| | | public LightningForgotPasswordController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String forgotPassword(String username, String checkEmailUrl) { |
| | | try { |
| | | Site.forgotPassword(username); |
| | | ApexPages.PageReference checkEmailRef = new PageReference(checkEmailUrl); |
| | | if(!Site.isValidUsername(username)) { |
| | | return Label.Site.invalid_email; |
| | | } |
| | | aura.redirect(checkEmailRef); |
| | | return null; |
| | | } |
| | | catch (Exception ex) { |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | global static String setExperienceId(String expId) { |
| | | // Return null if there is no error, else it will return the error message |
| | | try { |
| | | if (expId != null) { |
| | | Site.setExperienceId(expId); |
| | | } |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @IsTest(SeeAllData = true) |
| | | public with sharing class LightningForgotPasswordControllerTest { |
| | | |
| | | /* Verifies that ForgotPasswordController handles invalid usernames appropriately */ |
| | | @IsTest |
| | | static void testLightningForgotPasswordControllerInvalidUserName() { |
| | | System.assertEquals(LightningForgotPasswordController.forgotPassword('fakeUser', 'http://a.com'), Label.Site.invalid_email); |
| | | System.assertEquals(LightningForgotPasswordController.forgotPassword(null, 'http://a.com'), Label.Site.invalid_email); |
| | | System.assertEquals(LightningForgotPasswordController.forgotPassword('a', '/home/home.jsp'), Label.Site.invalid_email); |
| | | } |
| | | |
| | | /* Verifies that null checkEmailRef url throws proper exception. */ |
| | | @IsTest |
| | | static void testLightningForgotPasswordControllerWithNullCheckEmailRef() { |
| | | System.assertEquals(LightningForgotPasswordController.forgotPassword('a', null), 'Argument 1 cannot be null'); |
| | | System.assertEquals(LightningForgotPasswordController.forgotPassword('a@salesforce.com', null), 'Argument 1 cannot be null'); |
| | | } |
| | | |
| | | /* Verifies that LightningForgotPasswordController object is instantiated correctly. */ |
| | | @IsTest |
| | | static void LightningForgotPasswordControllerInstantiation() { |
| | | LightningForgotPasswordController controller = new LightningForgotPasswordController(); |
| | | System.assertNotEquals(controller, null); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global class LightningLoginFormController { |
| | | |
| | | public LightningLoginFormController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String login(String username, String password, String startUrl) { |
| | | try{ |
| | | ApexPages.PageReference lgn = Site.login(username, password, startUrl); |
| | | aura.redirect(lgn); |
| | | return null; |
| | | } |
| | | catch (Exception ex) { |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static Boolean getIsUsernamePasswordEnabled() { |
| | | Auth.AuthConfiguration authConfig = getAuthConfig(); |
| | | return authConfig.getUsernamePasswordEnabled(); |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static Boolean getIsSelfRegistrationEnabled() { |
| | | Auth.AuthConfiguration authConfig = getAuthConfig(); |
| | | return authConfig.getSelfRegistrationEnabled(); |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String getSelfRegistrationUrl() { |
| | | Auth.AuthConfiguration authConfig = getAuthConfig(); |
| | | if (authConfig.getSelfRegistrationEnabled()) { |
| | | return authConfig.getSelfRegistrationUrl(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String getForgotPasswordUrl() { |
| | | Auth.AuthConfiguration authConfig = getAuthConfig(); |
| | | return authConfig.getForgotPasswordUrl(); |
| | | } |
| | | |
| | | @TestVisible |
| | | private static Auth.AuthConfiguration getAuthConfig(){ |
| | | Id networkId = Network.getNetworkId(); |
| | | Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(networkId,''); |
| | | return authConfig; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | global static String setExperienceId(String expId) { |
| | | // Return null if there is no error, else it will return the error message |
| | | try { |
| | | if (expId != null) { |
| | | Site.setExperienceId(expId); |
| | | } |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @IsTest(SeeAllData = true) |
| | | public with sharing class LightningLoginFormControllerTest { |
| | | |
| | | @IsTest |
| | | static void LightningLoginFormControllerInstantiation() { |
| | | LightningLoginFormController controller = new LightningLoginFormController(); |
| | | System.assertNotEquals(controller, null); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testIsUsernamePasswordEnabled() { |
| | | System.assertEquals(true, LightningLoginFormController.getIsUsernamePasswordEnabled()); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testIsSelfRegistrationEnabled() { |
| | | System.assertEquals(false, LightningLoginFormController.getIsSelfRegistrationEnabled()); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testGetSelfRegistrationURL() { |
| | | System.assertEquals(null, LightningLoginFormController.getSelfRegistrationUrl()); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testAuthConfig() { |
| | | Auth.AuthConfiguration authConfig = LightningLoginFormController.getAuthConfig(); |
| | | System.assertNotEquals(null, authConfig); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global class LightningSelfRegisterController { |
| | | |
| | | public LightningSelfRegisterController() { |
| | | |
| | | } |
| | | |
| | | @TestVisible |
| | | private static boolean isValidPassword(String password, String confirmPassword) { |
| | | return password == confirmPassword; |
| | | } |
| | | |
| | | @TestVisible |
| | | private static boolean siteAsContainerEnabled(String communityUrl) { |
| | | Auth.AuthConfiguration authConfig = new Auth.AuthConfiguration(communityUrl,''); |
| | | return authConfig.isCommunityUsingSiteAsContainer(); |
| | | } |
| | | |
| | | @TestVisible |
| | | private static void validatePassword(User u, String password, String confirmPassword) { |
| | | if(!Test.isRunningTest()) { |
| | | Site.validatePassword(u, password, confirmPassword); |
| | | } |
| | | return; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static String selfRegister(String firstname ,String lastname, String email, String password, String confirmPassword, String accountId, String regConfirmUrl, String extraFields, String startUrl, Boolean includePassword) { |
| | | Savepoint sp = null; |
| | | try { |
| | | sp = Database.setSavepoint(); |
| | | |
| | | if (lastname == null || String.isEmpty(lastname)) { |
| | | return Label.Site.lastname_is_required; |
| | | } |
| | | |
| | | if (email == null || String.isEmpty(email)) { |
| | | return Label.Site.email_is_required; |
| | | } |
| | | |
| | | User u = new User(); |
| | | u.Username = email; |
| | | u.put('Email',email); |
| | | |
| | | u.FirstName = firstname; |
| | | u.LastName = lastname; |
| | | |
| | | String networkId = Network.getNetworkId(); |
| | | |
| | | // If using site to host the community the user should not hit s1 after logging in from mobile. |
| | | if(networkId != null && siteAsContainerEnabled(Network.getLoginUrl(networkId))) { |
| | | u.put('UserPreferencesHideS1BrowserUI',true); |
| | | } |
| | | |
| | | String nickname = ((firstname != null && firstname.length() > 0) ? firstname.substring(0,1) : '' ) + lastname.substring(0,1); |
| | | nickname += String.valueOf(Crypto.getRandomInteger()).substring(1,7); |
| | | u.put('CommunityNickname', nickname); |
| | | |
| | | if (extraFields != null) { |
| | | List<Object> extraFieldsList = (List<Object>) JSON.deserializeUntyped(extraFields); |
| | | for (Object thisFieldObject : extraFieldsList) { |
| | | Map<String,Object> thisField = (Map<String,Object>) thisFieldObject; |
| | | Schema.SObjectField sof = Schema.SObjectType.User.fields.getMap().get((String) thisField.get('fieldPath')); |
| | | u.put(sof, thisField.get('value')); |
| | | } |
| | | } |
| | | |
| | | if (includePassword) { |
| | | if (!isValidPassword(password, confirmPassword)) { |
| | | return Label.site.passwords_dont_match; |
| | | } |
| | | validatePassword(u, password, confirmPassword); |
| | | } |
| | | else { |
| | | password = null; |
| | | } |
| | | |
| | | // lastName is a required field on user, but if it isn't specified, we'll default it to the username |
| | | String userId = Site.createPortalUser(u, accountId, password); |
| | | // create a fake userId for test. |
| | | if (Test.isRunningTest()) { |
| | | userId = 'fakeUserId'; |
| | | } |
| | | if (userId != null) { |
| | | if (password != null && password.length() > 1) { |
| | | ApexPages.PageReference lgn = Site.login(email, password, startUrl); |
| | | if(!Test.isRunningTest()) { |
| | | aura.redirect(lgn); |
| | | } |
| | | } |
| | | else { |
| | | ApexPages.PageReference confirmRef = new PageReference(regConfirmUrl); |
| | | if(!Test.isRunningTest()) { |
| | | aura.redirect(confirmRef); |
| | | } |
| | | |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | catch (Exception ex) { |
| | | Database.rollback(sp); |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static List<Map<String,Object>> getExtraFields(String extraFieldsFieldSet) { |
| | | List<Map<String,Object>> extraFields = new List<Map<String,Object>>(); |
| | | Schema.FieldSet fieldSet = Schema.SObjectType.User.fieldSets.getMap().get(extraFieldsFieldSet); |
| | | if(!Test.isRunningTest()) { |
| | | if (fieldSet != null) { |
| | | for (Schema.FieldSetMember f : fieldSet.getFields()) { |
| | | Map<String, Object> fieldDetail = new Map<String, Object>(); |
| | | fieldDetail.put('dbRequired', f.getDBRequired()); |
| | | fieldDetail.put('fieldPath', f.getFieldPath()); |
| | | fieldDetail.put('label', f.getLabel()); |
| | | fieldDetail.put('required', f.getRequired()); |
| | | fieldDetail.put('type', f.getType()); |
| | | fieldDetail.put('value', ''); // client will populate |
| | | extraFields.add(fieldDetail); |
| | | }}} |
| | | return extraFields; |
| | | } |
| | | |
| | | @AuraEnabled |
| | | global static String setExperienceId(String expId) { |
| | | // Return null if there is no error, else it will return the error message |
| | | try { |
| | | if (expId != null) { |
| | | Site.setExperienceId(expId); |
| | | } |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return ex.getMessage(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @IsTest(SeeAllData = true) |
| | | public with sharing class LightningSelfRegisterControllerTest { |
| | | |
| | | /* Verifies that IsValidPassword method with various password combinations. */ |
| | | @IsTest |
| | | static void testIsValidPassword() { |
| | | System.assert(LightningSelfRegisterController.isValidPassword('password?@12334', 'password?@12334') == true); |
| | | System.assert(LightningSelfRegisterController.isValidPassword('password?@12334', 'dummyPassword') == false); |
| | | System.assert(LightningSelfRegisterController.isValidPassword('password?@12334', null) == false); |
| | | System.assert(LightningSelfRegisterController.isValidPassword(null, 'fakePwd') == false); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testSiteAsContainerEnabled() { |
| | | System.assertNotEquals(null, LightningSelfRegisterController.siteAsContainerEnabled('https://portaleu1-developer-edition.eu11.force.com')); |
| | | } |
| | | |
| | | /* Verifies the selfRegistration method flow with various invalid inputs */ |
| | | @IsTest |
| | | static void testSelfRegistration() { |
| | | Map < String, String > paramsMap = initializeParams(); |
| | | System.assertNotEquals(null, paramsMap); |
| | | System.assertEquals(Label.Site.lastname_is_required, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), '', paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); |
| | | System.assertEquals(Label.Site.email_is_required, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), '', paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); |
| | | System.assertEquals(Label.Site.email_is_required, LightningSelfRegisterController.selfRegister(null, paramsMap.get('lastName'), '', null, paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); |
| | | System.assertEquals(Label.site.passwords_dont_match, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordWrong'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); |
| | | System.assertNotEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), '', paramsMap.get('password'), paramsMap.get('confirmPasswordWrong'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), false)); |
| | | } |
| | | |
| | | |
| | | /* Verifies the selfRegistration flow for valid inputs */ |
| | | @IsTest |
| | | static void testSelfRegisterWithProperCredentials() { |
| | | Map < String, String > paramsMap = initializeParams(); |
| | | System.assertEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), true)); |
| | | } |
| | | |
| | | /* Verifies SelfRegistration flow with an accounId that is created within the test */ |
| | | @IsTest |
| | | static void testSelfRegisterWithCreatedAccount() { |
| | | Account acc = new Account(name = 'test acc'); |
| | | insert acc; |
| | | List < Account > accounts = [SELECT Id FROM Account LIMIT 1]; |
| | | System.assert(!accounts.isEmpty(), 'There must be at least one account in this environment!'); |
| | | String accountId = accounts[0].Id; |
| | | Map < String, String > paramsMap = initializeParams(); |
| | | System.assertEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), accountId, paramsMap.get('regConfirmUrl'), null, paramsMap.get('startUrl'), false)); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testGetNullExtraFields() { |
| | | System.assertEquals(new List < Map < String, Object >> (), LightningSelfRegisterController.getExtraFields(null)); |
| | | } |
| | | |
| | | @IsTest |
| | | static void testGetNonEmptyExtraFields() { |
| | | System.assertEquals(new List < Map < String, Object >> (), LightningSelfRegisterController.getExtraFields('field1')); |
| | | } |
| | | |
| | | /* Verifies validation of extraFields within the Self Registration flow */ |
| | | @IsTest |
| | | static void testGetExtraFieldsInSelfRegistration() { |
| | | List < Map < String, Object >> fieldlist = new List < Map < String, Object >> (); |
| | | Map < String, String > paramsMap = initializeParams(); |
| | | Map < String, Object > fieldMap = new Map < String, Object > (); |
| | | fieldMap.put('description', 'new field'); |
| | | fieldMap.put('fieldPath', 'dummyPath'); |
| | | fieldlist.add(fieldMap); |
| | | String extraFields = JSON.serialize(fieldlist); |
| | | System.assertNotEquals(null, LightningSelfRegisterController.selfRegister(paramsMap.get('firstName'), paramsMap.get('lastName'), paramsMap.get('email'), paramsMap.get('password'), paramsMap.get('confirmPasswordCorrect'), null, paramsMap.get('regConfirmUrl'), extraFields, paramsMap.get('startUrl'), true)); |
| | | } |
| | | |
| | | @IsTest |
| | | static void LightningSelfRegisterControllerInstantiation() { |
| | | LightningSelfRegisterController controller = new LightningSelfRegisterController(); |
| | | System.assertNotEquals(controller, null); |
| | | } |
| | | |
| | | /* Helper method to initialize the parameters required for SelfRegistration. */ |
| | | private static Map < String, String > initializeParams() { |
| | | Map < String, String > paramsMap = new Map < String, String > (); |
| | | String firstName = 'test'; |
| | | String lastName = 'User'; |
| | | String email = 'testUser@salesforce.com'; |
| | | String password = 'testuser123'; |
| | | String confirmPasswordCorrect = 'testuser123'; |
| | | String confirmPasswordWrong = 'wrongpassword'; |
| | | String accountId = 'testuser123'; |
| | | String regConfirmUrl = 'http://registration-confirm.com'; |
| | | String startUrl = 'http://my.company.salesforce.com'; |
| | | paramsMap.put('firstName', firstName); |
| | | paramsMap.put('lastName', lastName); |
| | | paramsMap.put('email', email); |
| | | paramsMap.put('password', password); |
| | | paramsMap.put('confirmPasswordCorrect', confirmPasswordCorrect); |
| | | paramsMap.put('confirmPasswordWrong', confirmPasswordWrong); |
| | | paramsMap.put('accountId', accountId); |
| | | paramsMap.put('regConfirmUrl', regConfirmUrl); |
| | | paramsMap.put('startUrl', startUrl); |
| | | return paramsMap; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | global with sharing class LostByCompany { |
| | | public List<retLine> results {get; private set;} |
| | | public String lineNo {get;set;} |
| | | public String SearchName {get;set;} |
| | | public String queryCopy {get;set;} |
| | | public Boolean getIsOverLimit() { |
| | | if (results != null && results.size() > 50) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | public LostByCompany() { |
| | | this.results = new List<retLine>(); |
| | | } |
| | | |
| | | // 获取列表值 |
| | | /* |
| | | public void search() { |
| | | String sname = 'PCLLostBrand__c'; |
| | | String fname = 'Lost_By_Company__c'; |
| | | List<String> retlist = new List<String>(); |
| | | Map<String, Schema.SObjectField> sof; |
| | | List<SObject> so = Database.query('Select Id from ' + sname + ' limit 1'); |
| | | if (so.size() > 0) { |
| | | sof = so[0].getSObjectType().getDescribe().fields.getMap(); |
| | | } else { |
| | | sof = Schema.getGlobalDescribe().get(sname).newSObject().getSObjectType().getDescribe().fields.getMap(); |
| | | } |
| | | if (!sof.containsKey(fname)) this.results = null; |
| | | Schema.DescribeFieldResult dfr = sof.get(fname).getDescribe(); |
| | | String ftype = dfr.getType().name(); |
| | | if (ftype != 'PICKLIST' && ftype != 'MULTIPICKLIST') this.results = null; |
| | | |
| | | for (Schema.PicklistEntry pe : dfr.getPicklistValues()) { |
| | | String val = ''; |
| | | val = pe.getLabel(); |
| | | if (pe.isDefaultValue()) val += '(デフォルト)'; |
| | | |
| | | if (!pe.isActive()) val += '(無効)'; |
| | | retlist.add(val); |
| | | } |
| | | this.results = retlist; |
| | | } |
| | | */ |
| | | |
| | | // SWAG-CJNAJG 获取列表的值 上面那个太复杂了 换一种写法 |
| | | public void search() { |
| | | |
| | | // 增加一个输入参数的筛选 |
| | | String query = System.currentPageReference().getParameters().get('q'); |
| | | String line_no = System.currentPageReference().getParameters().get('l'); |
| | | query = query.trim(); |
| | | SearchName=query; |
| | | queryCopy=query; |
| | | this.lineNo = String.isNotBlank(line_no) ? line_no : ''; |
| | | this.results = searchLogic(query); |
| | | } |
| | | public PageReference searchOne() { |
| | | system.debug('SearchName++'+SearchName); |
| | | this.results = searchLogic(SearchName); |
| | | return null; |
| | | } |
| | | public List<retLine> searchLogic(String query){ |
| | | // 初始化参数 |
| | | List<retLine> retlist = new List<retLine>(); |
| | | system.debug('query++'+query); |
| | | // 获取对象结构 |
| | | Map<String, Schema.SObjectField> sof = Schema.getGlobalDescribe().get('PCLLostBrand__c').getDescribe().fields.getMap(); |
| | | // 获取选项列表 |
| | | List<Schema.PicklistEntry> brandPLEntries = sof.get('Lost_By_Company__c').getDescribe().getPicklistValues(); |
| | | // 循环列表 |
| | | Integer i = 0; |
| | | for (Schema.PicklistEntry entry : brandPLEntries) { |
| | | system.debug('111++'+(String.isNotBlank(query) && !entry.getValue().contains(query))); |
| | | system.debug('222++'+!entry.isActive()); |
| | | // 跳过被禁用的选项,跳过和输入值不匹配的选项 |
| | | if (!entry.isActive() || (String.isNotBlank(query) && !entry.getValue().contains(query))) { |
| | | continue; |
| | | } |
| | | retLine ret = new retLine(); |
| | | ret.idx=i; |
| | | ret.retvalue=entry.getValue(); |
| | | system.debug('ret++'+ret); |
| | | retlist.add(ret); |
| | | i++; |
| | | } |
| | | system.debug('retlist++'+retlist); |
| | | return retlist; |
| | | } |
| | | public class retLine { |
| | | public Integer idx {get; set;} |
| | | public String retvalue {get; set;} |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | public class LostByCompanyTest { |
| | | static testMethod void TestInit01() { |
| | | PageReference ref = new PageReference('/apex/LostByCompany?l=0&q=迈瑞' ); |
| | | Test.setCurrentPage(ref); |
| | | LostByCompany test1= new LostByCompany(); |
| | | test1.getIsOverLimit(); |
| | | test1.search(); |
| | | test1.searchOne(); |
| | | test1.getIsOverLimit(); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | }// 20220720 ljh update |
| | | //20220708 询价任务开发,结束失单任务状态,筛选需要的修改的失单任务 end |
| | | |
| | | List<PCLLostProduct__c> lcrList=[select id,PCLLostBrand__r.Lost_cancel_report__r.of_lost_system_processor__c,PCLLostBrand__r.Lost_Reason_Sub__c,PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c,PCLLostBrand__r.Lost_cancel_report__r.LostType__c,PCLLostBrand__r.Lost_By_Company__c,PCLLostBrand__r.Lost_By_Company_Mannual__c,PCLLostBrand__r.LostPrice__c,LostProduct__r.Name, PCLLostBrand__r.Lost_reason_main__c,PCLLostBrand__r.Agency__r.Name,PCLLostBrand__r.AgencyMannual__c,PCLLostBrand__r.Lost_cancel_report__r.Opportunity__r.Name,Opportunity__c, LostProductMannual__c from PCLLostProduct__c where PCLLostBrand__r.Lost_cancel_report__c in : arrMap.keyset()]; |
| | | List<PCLLostProduct__c> lcrList=[select id,PCLLostBrand__r.Lost_cancel_report__r.of_lost_system_processor__c, |
| | | PCLLostBrand__r.Lost_Reason_Sub__c,PCLLostBrand__r.Lost_cancel_report__r.LostTotalAmount__c, |
| | | PCLLostBrand__r.Lost_cancel_report__r.LostType__c,PCLLostBrand__r.Lost_By_Company__c, |
| | | PCLLostBrand__r.Lost_By_Company_Mannual__c,PCLLostBrand__r.LostPrice__c,LostProduct__r.Name, |
| | | PCLLostBrand__r.Lost_reason_main__c,PCLLostBrand__r.Agency__r.Name,PCLLostBrand__r.AgencyMannual__c, |
| | | PCLLostBrand__r.Lost_cancel_report__r.Opportunity__r.Name,Opportunity__c, LostProductMannual__c |
| | | ,ProductClass__c, Quantity__c //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 |
| | | from PCLLostProduct__c |
| | | where PCLLostBrand__r.Lost_cancel_report__c in : arrMap.keyset()]; |
| | | List<Opportunity> oppList=new List<Opportunity>(); |
| | | for (String lcro : arrMap.keyset()) { |
| | | // 给产品赋值 |
| | |
| | | // List<String> yyList=new List<String>(); //失单原因 |
| | | //初始化 |
| | | Opportunity opp=new Opportunity(); |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | opp.RivalHostsNumber__c = 0; |
| | | System.debug('lt123初始失单主机数'+ opp.RivalHostsNumber__c); |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | opp.Id=arrMap.get(lcro).Opportunity__c; opp.PCLLostBrands__c=''; opp.Agencies__c=''; //Id ,品牌,经销商 |
| | | // for产品 |
| | | for (PCLLostProduct__c lcr : lcrList) { |
| | | System.debug('lt123主机111'+ lcr.ProductClass__c); |
| | | if (opp.Id==lcr.Opportunity__c) { |
| | | |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | System.debug('lt123主机'+ lcr.ProductClass__c); |
| | | if(lcr.ProductClass__c == '主机'){ |
| | | opp.RivalHostsNumber__c += lcr.Quantity__c; |
| | | System.debug('lt123累加失单主机数'+ opp.RivalHostsNumber__c); |
| | | }else{ |
| | | opp.RivalHostsNumber__c += 0; |
| | | System.debug('lt123不变失单主机数'+ opp.RivalHostsNumber__c); |
| | | } |
| | | //20220930 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | i++; |
| | | //给询价不同字段赋值 失单 |
| | | if (lcr.PCLLostBrand__r.Lost_cancel_report__r.LostType__c=='失单') { |
| | |
| | | this.oldList = (List<Maintenance_Contract_Asset_Estimate__c>) Trigger.old; |
| | | } |
| | | |
| | | protected override void afterUpdate() { |
| | | updateMainContract(); |
| | | } |
| | | |
| | | public void updateMainContract(){ |
| | | System.debug(LoggingLevel.INFO, '*** in update: '); |
| | | Map<String,List<Maintenance_Contract_Asset_Estimate__c>> mcaMap = new Map<String,List<Maintenance_Contract_Asset_Estimate__c>>(); |
| | | for (Maintenance_Contract_Asset_Estimate__c mca: newList) { |
| | | if(mca.Repair_Price__c!=0){ |
| | | List<Maintenance_Contract_Asset_Estimate__c> mcaList = new List<Maintenance_Contract_Asset_Estimate__c>(); |
| | | mcaList.add(mca); |
| | | if(mcaMap.containsKey(mca.Maintenance_Contract_Estimate__c)){ |
| | | List <Maintenance_Contract_Asset_Estimate__c> mlist = mcaMap.get(mca.Maintenance_Contract_Estimate__c); |
| | | mlist.add(mca); |
| | | mcaMap.put(mca.Maintenance_Contract_Estimate__c,mlist); |
| | | }else{ |
| | | mcaMap.put(mca.Maintenance_Contract_Estimate__c,mcaList); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | List<Maintenance_Contract__c> upMContractList = new List<Maintenance_Contract__c>(); |
| | | for (Maintenance_Contract_Estimate__c mc : [SELECT Id, Maintenance_Contract__c FROM Maintenance_Contract_Estimate__c WHERE Id IN:mcaMap.keySet()]) { |
| | | Boolean hasThirdPartyReturnc = false; |
| | | for (Maintenance_Contract_Asset_Estimate__c mca: mcaMap.get(mc.Id)) { |
| | | if(mca.Third_Party_Return__c == true){ |
| | | hasThirdPartyReturnc = true; |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** boolean: ' + hasThirdPartyReturnc); |
| | | } |
| | | |
| | | if(mc.Maintenance_Contract__c != null){ |
| | | Maintenance_Contract__c mContract = new Maintenance_Contract__c(); |
| | | mContract.Id = mc.Maintenance_Contract__c; |
| | | if(hasThirdPartyReturnc == true){ |
| | | mContract.Third_Party_Return_Contract__c = true; |
| | | } |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** upMContractList: ' + upMContractList); |
| | | upMContractList.add(mContract); |
| | | } |
| | | |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** upMContractList: ' + upMContractList); |
| | | |
| | | update upMContractList; |
| | | |
| | | |
| | | } |
| | | |
| | | protected override void beforeUpdate() { |
| | | |
| | | } |
| | |
| | | { |
| | | sql2 = '%'+name+'%'; |
| | | } |
| | | sql += ' where name like :sql2'; |
| | | sql += ' where Maintenance_Contract_No__c like :sql2 or name like :sql2'; |
| | | List<Maintenance_Contract__c> arrays = Database.query(sql); |
| | | return JSON.serialize(arrays); |
| | | } |
| | |
| | | Maintenance_Contract__r.Contract_create_reason__c,NewEstimation_Amount__c,Maintenance_Contract__r.Estimate_Contract_endDate__c, |
| | | Print_Simplify__c,New_contract_offer__c,Request_quotation_Amount__c,Service_DiscountPercentage__c, |
| | | GuidePrice_Up__c,GuidePrice_Down__c,Service_Discount_Price__c,New_Contract_Type_TxT__c, |
| | | //URF限次合同2期 XXF 20220818 start |
| | | URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c,URF_Contract__c |
| | | //URF限次合同2期 XXF 20220818 end |
| | | //URF限次合同2期 XXF 20220920 start |
| | | URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c,URF_Contract__c, |
| | | URF_P_RepairTime__c,URF_V_RepairTime__c |
| | | //URF限次合同2期 XXF 20220920 end |
| | | FROM Maintenance_Contract_Estimate__c WHERE Id = :targetEstimateId] |
| | | ; |
| | | system.debug('维修合同报价:'+mceList+'---'+'维修合同id:'+targetEstimateId); |
| | |
| | | mpdDetailsRecordsView[i].mpdrdd.Key_product_155P__c = mpdDetailsRecordsView[i].Prod.Key_product_155P__c; |
| | | mpdDetailsRecordsView[i].mpdrdd.Celon_Product__c = mpdDetailsRecordsView[i].Prod.Celon_Product__c; |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | // 20221020 ljh SWAG-CJ98AJ start |
| | | mpdDetailsRecordsView[i].mpdrdd.suitDepartment__c = mpdDetailsRecordsView[i].Prod.suitDepartment__c; |
| | | // 20221020 ljh SWAG-CJ98AJ end |
| | | } |
| | | if(RecordTypeName.equals('GuranteeMain')){ |
| | | Integer Entend_gurantee_period_all = mpdDetailsRecordsView[i].Prod.Entend_gurantee_period_all__c.intValue(); |
| | |
| | | InsAfterDel.Celon_Product__c = ass.mpdrdd.Celon_Product__c; |
| | | InsAfterDel.Celon_Product_Old__c = ass.Prod.Celon_Product__c; |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | // 20221020 ljh SWAG-CJ98AJ start |
| | | InsAfterDel.suitDepartment__c = ass.mpdrdd.suitDepartment__c; |
| | | InsAfterDel.suitDepartment_Old__c = ass.Prod.suitDepartment__c; |
| | | // 20221020 ljh SWAG-CJ98AJ end |
| | | |
| | | } |
| | | when 'GuranteeMain'{ |
| | | //InsAfterDel.RecordTypeName__c = 'GuranteeMain'; |
| | |
| | | upMpd.Key_product_155P__c = ass.mpded.Key_product_155P__c; |
| | | upMpd.Celon_Product__c = ass.mpded.Celon_Product__c; |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | // 20221020 ljh SWAG-CJ98AJ start |
| | | upMpd.suitDepartment__c = ass.mpded.suitDepartment__c; |
| | | // 20221020 ljh SWAG-CJ98AJ end |
| | | } |
| | | when 'GuranteeMain'{ |
| | | upMpd.Entend_gurantee_period__c=ass.mpded.Entend_gurantee_period__c; |
| | |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)start |
| | | query += ' ,Key_product_155P__c,Key_product_155P_Old__c,Celon_Product__c,Celon_Product_Old__c '; |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | // 20221020 ljh SWAG-CJ98AJ start |
| | | query += ' ,suitDepartment__c,suitDepartment_Old__c '; |
| | | // 20221020 ljh SWAG-CJ98AJ end |
| | | query += ' ,GuranteeType__c,Entend_gurantee_period__c,Gurantee_Start_Date__c,Gurantee_End_Date__c,CanNotCancelledGurantee__c '; |
| | | query += ' ,GuranteeType_Old__c,Entend_gurantee_period_Old__c,Gurantee_Start_Date_Old__c,Gurantee_End_Date_Old__c'; |
| | | query += ' ,Intra_Trade_Service_RMB__c,Intra_Trade_Service_RMB_DateFrom__c,Virtual_Contract__c,Intra_Trade_Gurantee_RMB__c, Intra_Trade_Gurantee_RMB_DateFrom__c,Maintenance_Price_Year__c '; |
| | |
| | | product2.Key_product_155P__c = mpdDetails.Key_product_155P__c; |
| | | // Celon产品区分 |
| | | product2.Celon_Product__c = mpdDetails.Celon_Product__c; |
| | | // 适用科室 // 20221020 ljh SWAG-CJ98AJ |
| | | product2.suitDepartment__c = mpdDetails.suitDepartment__c; |
| | | } |
| | | // FY23修改 WLIG-CFV4AV 重点产品维护(新)end |
| | | if(mpdDetails.RecordType.DeveloperName.equals('GuranteeMain')){ |
| | |
| | | // エラーが発生した場合 |
| | | System.debug(Logginglevel.ERROR, 'NFM001_' + iflog.Name + ':' + ex.getMessage()); |
| | | System.debug(Logginglevel.ERROR, 'NFM001_' + iflog.Name + ':' + ex.getStackTraceString()); |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | //NFM624触发001和201接口 20221102 LY start |
| | | // Callout from triggers are currently not supported. |
| | | if (!String.valueOf(ex.getMessage()).contains('Callout from triggers')) { |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | } |
| | | //NFM624触发001和201接口 20221102 LY end |
| | | |
| | | //---Gaozw---add |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | |
| | | NFM001Controller.debug_msg = ''; |
| | | update company; |
| | | departAssert = [Select Id, Name, Is_Active__c, DepartmentEffectiveDateTo__c from Account where Id = :depart.Id]; |
| | | System.assertEquals('草案中', departAssert.Is_Active__c); |
| | | System.assertEquals('無効', departAssert.Is_Active__c); |
| | | departAssert = [Select Id, Name, Is_Active__c, DepartmentEffectiveDateTo__c from Account where Id = :depart2.Id]; |
| | | System.assertEquals('有効', departAssert.Is_Active__c); |
| | | System.Test.stopTest(); |
| | |
| | | Contact contact2 = new Contact(); |
| | | User user = new User(); |
| | | Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | | User thisUser = [select Id from User where Id = :UserInfo.getUserId() ]; |
| | | System.runAs ( thisUser ){ |
| | | // 取引先 |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | |
| | | System.assertEquals('test1医院', agencylistCheck[0].Name); |
| | | |
| | | } |
| | | } |
| | | // Resendtest |
| | | static testMethod void resend_test() { |
| | | // 病院 の recode type を取得 |
| | |
| | | //CHAN-BDPBVY 20190703 end |
| | | public static boolean isRunning = false; |
| | | public static String debug_msg = ''; |
| | | |
| | | // 20220921 ljh SWAG-CG2A7S update start |
| | | /** |
| | | * NFM007の送信処理 |
| | | * |
| | |
| | | */ |
| | | @future (callout=true) |
| | | public static void callout(String iflog_Id, List<String> oppIds, Map<String, String> purposeOfAdviceMap) { |
| | | calloutNotfuture(iflog_Id,oppIds,purposeOfAdviceMap); |
| | | } |
| | | // 20220921 ljh SWAG-CG2A7S update end |
| | | |
| | | /** |
| | | * NFM007の送信処理 |
| | | * |
| | | * @param iflog_Id ログテーブルのId |
| | | * @param oppIds 送信対象商談(論理上1件のみです) |
| | | * @param purposeOfAdviceMap 1:Delete 2:Add(Insert) 3:Change(Update) |
| | | */ |
| | | // @future (callout=true) |
| | | public static void calloutNotfuture(String iflog_Id, List<String> oppIds, Map<String, String> purposeOfAdviceMap) { |
| | | if (oppIds == null || oppIds.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | update rowData; |
| | | } |
| | | } |
| | | @TestVisible private void test() { |
| | | Integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | product.MDM_Model_No__c = 'test'; |
| | | product.CanNotCancelledGurantee__c=true; |
| | | insert product; |
| | | |
| | | Product_Register__c prc = new Product_Register__c(Name = '国械注进20162220210', |
| | | MedPrdClass__c = '3', |
| | | ValidFrom__c = date.newinstance(2018, 07, 22), |
| | | ValidTo__c = date.newinstance(2028, 07, 22), |
| | | RegisterNoClass_Old__c = '6815', |
| | | RegisterNoClass_New__c = '6815', |
| | | RegisterNoStatus__c = '有效' |
| | | ); |
| | | insert prc; |
| | | |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = product.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc; |
| | | |
| | | PricebookEntry entry = new PricebookEntry( Pricebook2Id=pricebookId, Product2Id=product.Id); |
| | | entry.UnitPrice = 0; |
| | |
| | | opp.AccountId = depart.Id; |
| | | opp.Department_Class__c = section.Id; |
| | | opp.Hospital__c = company.Id; |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.Name = 'GZ-SP-NFM007_1'; |
| | | opp.Trade__c = '内貿'; |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | |
| | | System.Test.startTest(); |
| | | |
| | | //QuoteLineItem qli = new QuoteLineItem(); |
| | | //qli.QuoteId = quo.Id; |
| | |
| | | oppli.PricebookEntryId = entry.Id; |
| | | insert oppli; |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | oppli.PricebookEntryId = entry.Id; |
| | | insert oppli; |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | |
| | | //Test.stopTest(); |
| | | } |
| | | |
| | | //static testMethod void testUpdateHospital() { |
| | | //static testMethod void testUpdateHospital() { |
| | | // List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // if (rectCo.size() == 0) { |
| | | // return; |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | oppli.PricebookEntryId = entry.Id; |
| | | insert oppli; |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | insert oppli; |
| | | |
| | | System.Test.stopTest(); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | LicenseAndAccount__c = company1.Id |
| | | ); |
| | | insert linc; |
| | | System.Test.startTest(); |
| | | // 再取得 |
| | | //List<Id> accountIds = new Id[] {company.Id, section.Id, depart.Id}; |
| | | //List<Account> accList = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id in :accountIds order by Management_Code__c]; |
| | |
| | | quo.OCM_Agent1_Price__c = 203; |
| | | quo.Pricebook2Id = pricebookId; |
| | | insert quo; |
| | | System.Test.startTest(); |
| | | opp.Estimation_Decision__c = true; |
| | | opp.Estimation_Id__c = quo.ID; |
| | | update opp; |
| | |
| | | //Test.startTest(); |
| | | // NFM007より、送信しないこと |
| | | //System.assertEquals('', NFM007Controller.debug_msg); |
| | | StaticParameter.EscapeOppandStaTrigger = false; |
| | | opp.SAP_Send_OK__c = true; |
| | | opp.Gurantee_Period__c = '2'; |
| | | opp.oldData_flg__c = true; |
| | |
| | | update opp; |
| | | //Test.stopTest(); |
| | | } |
| | | |
| | | static testMethod void test_00() { |
| | | NFM007Controller controller = new NFM007Controller(); |
| | | controller.test(); |
| | | } |
| | | } |
| | |
| | | //URF限次合同2期 xxf 20220811 start |
| | | public String Series; |
| | | //URF限次合同2期 xxf 20220811 end |
| | | |
| | | //再注册分析 需求 新增字段 20220811 |
| | | public String Reanalysis; |
| | | |
| | |
| | | iflog = [Select Id, Name from BatchIF_Log__c where Id = :iflog.Id]; |
| | | System.debug(Logginglevel.DEBUG, 'NFM103_' + iflog.Name + ' start'); // callout の中 end のlogを出します |
| | | // 20220902 ljh XLIU-CHSD8G update start |
| | | // NFM103Controller.callout(iflog.Id, rprIds, null); |
| | | // NFM103Controller.callout(iflog.Id, rprIds); |
| | | String uid = UserInfo.getUserId(); |
| | | String BUid = System.Label.Batch_User_Id; |
| | | System.debug('zheli'); |
| | |
| | | NFM103Controller.callout(iflog.Id, rprIds, null); |
| | | } |
| | | // 20220902 ljh XLIU-CHSD8G update end |
| | | |
| | | } |
| | | System.debug('-----NFM103Trigger end'); |
| | | } |
| | |
| | | * |
| | | * @param iflog_Id ログテーブルのId |
| | | * @param repairIds 送信対象修理 |
| | | * @param reanalysisFlag 再注册分析使用 --- 再修理分析状态 |
| | | */ |
| | | @future (callout = true) |
| | | public static void callout(String iflog_Id, List<Id> repairIds, String reanalysisFlag) { |
| | | calloutNotfuture( iflog_Id, repairIds, reanalysisFlag); |
| | | public static void callout(String iflog_Id, List<Id> repairIds, String flag) { |
| | | calloutNotfuture(iflog_Id, repairIds, flag); |
| | | } |
| | | //20220902 ljh 新增(复制callout)方法 |
| | | public static void calloutNotfuture(String iflog_Id, List<Id> repairIds, String reanalysisFlag) { |
| | | //20220902 ljh 新增(复制)方法 XLIU-CHSD8G |
| | | public static void calloutNotfuture(String iflog_Id, List<Id> repairIds,String flag) { |
| | | |
| | | if (repairIds == null || repairIds.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | element.Address = rpr.Detailed_Address__c; //详细地址 |
| | | element.Postal = rpr.address_ZipCode__c; //邮编 |
| | | element.ReturnType = NFMUtil.getMapValue(ReturnsProductWayMap,'Returns_Product_way__c', rpr.Returns_Product_way__c, iflog);//返品方式 |
| | | // modify by liu 20220909 再注册项目NFM103接口连通测试时追加对应 start |
| | | // element.UpdateStatus = rpr.Address_type__c; //申请修理时间 |
| | | if (String.isNotBlank(reanalysisFlag)) { |
| | | element.UpdateStatus = 'X'; //申请修理时间 |
| | | } else { |
| | | element.UpdateStatus = rpr.Address_type__c; //申请修理时间 |
| | | } |
| | | // modify by liu 20220909 再注册项目NFM103接口连通测试时追加对应 end |
| | | |
| | | element.UpdateStatus = rpr.Address_type__c; //申请修理时间 |
| | | //add by wangweipeng 2021/07/14 end |
| | | //add pi 密文 sushanhu 20220222 start |
| | | element.DataId =rpr.AWS_Data_Id__c;//aws存储凭证 |
| | |
| | | element.OfferRental =rpr.Offer_Rental_New__c ? 'X':''; //是否提供备品(NEW) |
| | | //XLIU-CGAD3Z 【委托】备品相关字段传输至SAP LY 20220714 end |
| | | //URF限次合同2期 xxf 20220811 start |
| | | if (rpr.Maintenance_Contract__r.URF_Contract__c == true && rpr.Delivered_Product__r.Product2.ProductURF__c !=null) { |
| | | element.Series =rpr.Delivered_Product__r.Product2.ProductURF__r.URFLimitSerial__c =='URF-P'?'P':'V'; //限次合同系列 |
| | | }else{ |
| | | element.Series =null; |
| | | if (!String.isBlank(rpr.Maintenance_Contract__c)){ |
| | | if (rpr.Maintenance_Contract__r.URF_Contract__c == true && rpr.Delivered_Product__r.Product2.ProductURF__c !=null) { |
| | | element.Series =rpr.Delivered_Product__r.Product2.ProductURF__r.URFLimitSerial__c =='URF-P'?'P':'V'; //限次合同系列 |
| | | }else{ |
| | | element.Series =null; |
| | | } |
| | | } |
| | | |
| | | //URF限次合同2期 xxf 20220811 end |
| | | rprId = rpr.Id; //2022-07-14 zyh add |
| | | |
| | | //再注册分析 需求 新增字段 20220811 sx start |
| | | element.Reanalysis = reanalysisFlag; |
| | | //再注册分析 需求 新增字段 20220811 sx end |
| | | element.Reanalysis = flag; |
| | | |
| | | if(flag != null){ |
| | | element.UpdateStatus = 'X'; |
| | | } |
| | | //再注册分析 需求 新增字段 20220811 sx end |
| | | |
| | | } |
| | | |
| | |
| | | rpr.SAP_Transfer_time__c = Date.today(); |
| | | //rpr.FSE_ApplyForRepair_time__c = Date.today(); |
| | | //update by rentx 2020-10-28 end |
| | | rpr.Bollow_Date__c = Date.today(); |
| | | rpr.if_Rental_Apply__c = true; |
| | | |
| | | System.Test.startTest(); |
| | | update rpr; |
| | |
| | | rpr.SAP_Transfer_time__c = Date.today(); |
| | | //rpr.FSE_ApplyForRepair_time__c = Date.today(); |
| | | //update by rentx 2020-10-28 end |
| | | rpr.Bollow_Date__c = Date.today(); |
| | | rpr.if_Rental_Apply__c = true; |
| | | |
| | | System.Test.startTest(); |
| | | // 20220902 ljh ※ |
| | |
| | | List<Maintenance_Contract_Asset_Estimate__c> updateList = new List<Maintenance_Contract_Asset_Estimate__c>(); |
| | | //查询当前修理对应的维修合同是否为限次合同 && 大修 |
| | | for (Repair__c rep : rprList) { |
| | | if (rep.Maintenance_Contract__c != null && rep.Maintenance_Contract__r.URF_Contract__c == true && (rep.Repair_Rank__c == 'A' || rep.Repair_Rank__c == 'B' || rep.Repair_Rank__c == 'C') && rep.Agreed_Date__c != null) { |
| | | //URF限次合同2期 LY 20220929 start 追加修理单删除和取消的状态条件 |
| | | if (rep.Maintenance_Contract__c != null && rep.Maintenance_Contract__r.URF_Contract__c == true && (rep.Repair_Rank__c == 'A' || rep.Repair_Rank__c == 'B' || rep.Repair_Rank__c == 'C') && rep.Agreed_Date__c != null && rep.Status1__c !='0.取消' && rep.Status1__c !='0.删除') { |
| | | //URF限次合同2期 LY 20220929 end |
| | | contractIds.add(rep.Maintenance_Contract__c); |
| | | } |
| | | } |
| | |
| | | // testUser.Job_Category__c = '销售服务'; |
| | | //add by rentx 2021-3-19 start |
| | | Profile p = [select Id from Profile where id =: System.Label.ProfileId_SystemAdmin]; |
| | | User u1 = new User(Test_staff__c = true); |
| | | u1.LastName = '_サンブリッジ'; |
| | | u1.FirstName = 'あ'; |
| | | u1.Alias = 'あ'; |
| | | u1.Email = 'olympusTest01@sunbridge.com'; |
| | | u1.Username = 'olympusTest01@sunbridge.com'; |
| | | u1.CommunityNickname = 'あ'; |
| | | u1.IsActive = true; |
| | | u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | u1.LocaleSidKey = 'ja_JP'; |
| | | u1.LanguageLocaleKey = 'ja'; |
| | | u1.ProfileId = p.Id; |
| | | u1.Job_Category__c = '销售服务'; |
| | | u1.Province__c = '東京'; |
| | | insert u1; |
| | | // User u1 = new User(Test_staff__c = true); |
| | | User u1 = [select Id from User where Id = :UserInfo.getUserId() ]; |
| | | System.runAs ( u1 ){ |
| | | // u1.LastName = '_サンブリッジ'; |
| | | // u1.FirstName = 'あ'; |
| | | // u1.Alias = 'あ'; |
| | | // u1.Email = 'olympusTest01@sunbridge.com'; |
| | | // u1.Username = 'olympusTest01@sunbridge.com'; |
| | | // u1.CommunityNickname = 'あ'; |
| | | // u1.IsActive = true; |
| | | // u1.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // u1.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // u1.LocaleSidKey = 'ja_JP'; |
| | | // u1.LanguageLocaleKey = 'ja'; |
| | | // u1.ProfileId = p.Id; |
| | | // u1.Job_Category__c = '销售服务'; |
| | | // u1.Province__c = '東京'; |
| | | // insert u1; |
| | | |
| | | |
| | | // 维修合同を作成する |
| | |
| | | // mainAss1.endDateGurantee_Text__c = Date.today().addDays(1); |
| | | // insert mainAss1; |
| | | //add by rentx 2021-3-19 end |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | depart = [select Management_Code__c, Management_Code_Auto__c, Name, Id from Account where Id = :depart.Id]; |
| | | accList.add(depart); |
| | | |
| | | |
| | | // RecordType recordtype = new RecordType(); |
| | | // recordtype.DeveloperName = 'Maintenance_Contract'; |
| | | // recordtype.SobjectType = 'Maintenance_Contract__c'; |
| | |
| | | // System.assertEquals(true, bl[0].Log__c.indexOf(contract.Maintenance_Contract_No__c) >= 0); |
| | | // System.assertEquals(true, bl[0].Log__c.indexOf(company.Management_Code__c) >= 0); |
| | | // HWAG-BE88UG 【委托】SFDC-SAP搭现有接口添加合同“付款计划”信息 by vivek start |
| | | //URF限次合同2期 LY 20220930 start |
| | | //产品2 |
| | | User u1 = [select Id from User where Id = :UserInfo.getUserId() ]; |
| | | System.runAs ( u1 ){ |
| | | ProductURF__c poductURFV = new ProductURF__c(Name='V系列',URFLimitSerial__c='URF-V', |
| | | Maintenance_Price_Year_URF__c =100,Maintenance_Price_Year_URF_Max__c=120 |
| | | ,Maintenance_Price_Year_URF_3__c=200 |
| | | ,Maintenance_Price_Year_URF_Max_3__c=240 ); |
| | | ProductURF__c poductURFP = new ProductURF__c(Name='P系列',URFLimitSerial__c='URF-P', |
| | | Maintenance_Price_Year_URF__c =200,Maintenance_Price_Year_URF_Max__c=220 |
| | | ,Maintenance_Price_Year_URF_3__c=300 |
| | | ,Maintenance_Price_Year_URF_Max_3__c=340 ); |
| | | insert new ProductURF__c[] {poductURFV,poductURFP}; |
| | | // 产品 |
| | | Product2 proV = new Product2(Name='name01',IsActive=true,Family='SP', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | | ProductCode_Ext__c='pc01',Manual_Entry__c=false |
| | | ,ProductURF__c=poductURFV.Id); |
| | | Product2 proP = new Product2(Name='name02',IsActive=true,Family='SP', |
| | | Fixture_Model_No__c='n02',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n02', |
| | | ProductCode_Ext__c='pc02',Manual_Entry__c=false |
| | | ,ProductURF__c=poductURFP.Id); |
| | | insert new Product2[] {proV,proP}; |
| | | |
| | | //保有设备 |
| | | Asset assetV = new Asset(); |
| | | assetV.Name = 'テスト機器1'; |
| | | assetV.AccountId = depart.Id; |
| | | assetV.Department_Class__c = section.Id; |
| | | assetV.Hospital__c = company.Id; |
| | | assetV.SerialNumber = 'testserial1'; |
| | | assetV.Product2Id = proV.Id; |
| | | Asset assetP = new Asset(); |
| | | assetP.Name = 'テスト機器2'; |
| | | assetP.AccountId = depart.Id; |
| | | assetP.Department_Class__c = section.Id; |
| | | assetP.Hospital__c = company.Id; |
| | | assetP.SerialNumber = 'testserial2'; |
| | | assetP.Product2Id = proP.Id; |
| | | insert new Asset[] {assetV,assetP}; |
| | | //维修合同报价 |
| | | Maintenance_Contract_Estimate__c mcEstimate = new Maintenance_Contract_Estimate__c(); |
| | | mcEstimate.Name = 'BJ-RS-SD0067154XC-01'; |
| | | mcEstimate.Process_Status__c ='批准'; |
| | | mcEstimate.URF_P_MaxRepairCount__c = '3'; |
| | | mcEstimate.URF_V_MaxRepairCount__c = '2'; |
| | | mcEstimate.Contract_Range__c = 12; |
| | | mcEstimate.Maintenance_Contract__c = contract.Id; |
| | | insert mcEstimate; |
| | | |
| | | Maintenance_Contract__c contractNew = new Maintenance_Contract__c(); |
| | | contractNew.Id =contract.Id; |
| | | contractNew.Estimation_Id__c = mcEstimate.Id; |
| | | update contractNew; |
| | | |
| | | //创建维修合同报价/保有设备 |
| | | Maintenance_Contract_Asset_Estimate__c asset_EstimateV = new Maintenance_Contract_Asset_Estimate__c(); |
| | | asset_EstimateV.Maintenance_Contract_Estimate__c = mcEstimate.Id; |
| | | asset_EstimateV.Asset__c = assetV.Id; |
| | | asset_EstimateV.CurrencyIsoCode = 'CNY'; |
| | | asset_EstimateV.Series_MaxRepairCount__c = 3; |
| | | asset_EstimateV.Series_RepairCount__c = 0; |
| | | asset_EstimateV.URF_Series__c = 'URF-V'; |
| | | Maintenance_Contract_Asset_Estimate__c asset_EstimateP = new Maintenance_Contract_Asset_Estimate__c(); |
| | | asset_EstimateP.Maintenance_Contract_Estimate__c = mcEstimate.Id; |
| | | asset_EstimateP.Asset__c = assetP.Id; |
| | | asset_EstimateP.CurrencyIsoCode = 'CNY'; |
| | | asset_EstimateP.Series_MaxRepairCount__c = 10; |
| | | asset_EstimateP.Series_RepairCount__c = 5; |
| | | asset_EstimateP.URF_Series__c = 'URF-P'; |
| | | insert new Maintenance_Contract_Asset_Estimate__c[] {asset_EstimateV,asset_EstimateP}; |
| | | } |
| | | //URF限次合同2期 LY 20220930 end |
| | | } |
| | | |
| | | @isTest |
| | |
| | | // 修改虚拟合同生成逻辑 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); |
| | |
| | | * @param needSendRectMap 送信対象のレコードタイプのmap |
| | | */ |
| | | @future (callout=true) |
| | | //NFM624触发001和201接口 20221102 LY start |
| | | public static void callout(String iflog_Id, List<String> accIds, Map<String, String> purposeOfAdviceMap, Map<String, String> needSendRectMap, Map<String, String> needQuolifiedMap) { |
| | | calloutNotFuture(iflog_Id,accIds,purposeOfAdviceMap,needSendRectMap,needQuolifiedMap); |
| | | } |
| | | //NFM624触发001和201接口 20221102 LY end |
| | | public static void calloutNotFuture(String iflog_Id, List<String> accIds, Map<String, String> purposeOfAdviceMap, Map<String, String> needSendRectMap, Map<String, String> needQuolifiedMap) { |
| | | if (accIds == null || accIds.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | endUser.PurposeOfAdvice = purposeOfAdviceMap.get(acc.Id); |
| | | endUser.SectionCategory = NFMUtil.getMapValue(transferMap, 'Department_Class_Label__c', acc.Department_Class__r.Department_Class_Label__c, iflog); |
| | | //endUser.SectionName = acc.Department_Name__c; |
| | | endUser.SectionName = acc.name; |
| | | //NFM624触发001和201接口 LY 20221109 start |
| | | if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ |
| | | endUser.SectionName = acc.Hospital__r.Name+' '+acc.Department_Class__r.Department_Class_Label__c+' '+acc.Department_Name__c; |
| | | }else{ |
| | | endUser.SectionName = acc.name; |
| | | } |
| | | //NFM624触发001和201接口 LY 20221109 end |
| | | endUser.SectionCode = acc.Management_Code__c; |
| | | //endUser.NeedQuolified = acc.Hospital__r.If_Need_Quolified__c; |
| | | endUser.NeedQuolified = false; |
| | |
| | | // エラーが発生した場合 |
| | | System.debug(Logginglevel.ERROR, 'NFM201_' + iflog.Name + ':' + ex.getMessage()); |
| | | System.debug(Logginglevel.ERROR, 'NFM201_' + iflog.Name + ':' + ex.getStackTraceString()); |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | |
| | | //NFM624触发001和201接口 20221102 LY start |
| | | // Callout from triggers are currently not supported. |
| | | System.debug('NFM201jiekou'+ex.getMessage()); |
| | | if (!String.valueOf(ex.getMessage()).contains('Callout from triggers')) { |
| | | |
| | | logstr += ex.getMessage(); |
| | | iflog.ErrorLog__c += ex.getMessage() + '\n'; |
| | | iflog.ErrorLog__c += ex.getStackTraceString() + '\n'; |
| | | } |
| | | //NFM624触发001和201接口 20221102 LY end |
| | | |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | |
| | | @RestResource(urlMapping = '/NFM206/*') |
| | | global with sharing class NFM206Rest { |
| | | |
| | | |
| | | global class GeDatas { |
| | | public NFMUtil.Monitoring Monitoring; |
| | | public NFM206Rest.GeData[] GeData; |
| | |
| | | public String IsTermination; //true代表合同终止 |
| | | public String SealDate; // 电子签日期 |
| | | //songxiaoqi-----------end |
| | | // 2022-10-19 SWAG-CKB5S6 xxf start |
| | | public String IsEsign; //是否电子签 1:电子签合同 0:非电子签合同 |
| | | // 2022-10-19 SWAG-CKB5S6 xxf end |
| | | } |
| | | |
| | | @HttpPost |
| | |
| | | } |
| | | |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM206', ges.GeData); |
| | | // 2022-10-15 SWAG-CG2A7S 同一合同多条询价自动win时的拆分处理 ssm start |
| | | if (String.isBlank(rowData.Log__c) == false) { |
| | | executefuture(rowData.Id); |
| | | if (ges.GeData.size() > 1) { |
| | | rowData.RowDataFlg__c = false; |
| | | update rowData; |
| | | Integer index = 1; |
| | | String msg_num = Monitoring.MessageGroupNumber; |
| | | for (NFM206Rest.GeData data : ges.GeData) { |
| | | NFM206Rest.GeData[] spGeData = new NFM206Rest.GeData[1]; |
| | | spGeData[0] = data; |
| | | Monitoring.MessageGroupNumber = msg_num + '-' + index; |
| | | index ++; |
| | | BatchIF_Log__c spRowData = NFMUtil.saveRowData(Monitoring, 'NFM206', spGeData); |
| | | Database.executeBatch(new LogAutoSendBatch(spRowData.Id), 1); |
| | | } |
| | | } else { |
| | | executefuture(rowData.Id); |
| | | } |
| | | } |
| | | // 2022-10-15 SWAG-CG2A7S 同一合同多条询价自动win时的拆分处理 ssm start |
| | | |
| | | // JSONを戻す |
| | | RestResponse res = RestContext.response; |
| | |
| | | } |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | try { // 20220916 ljh SWAG-CG2A7S 注释 |
| | | List<GeData> accordList = new List<GeData>(); |
| | | List<String> opportunity_NoList = new List<String>(); |
| | | //合同必填字段验证 |
| | |
| | | List<Opportunity> opportunityUpsertList = new List<Opportunity>(); |
| | | List<Opportunity> oppList = [Select Id , |
| | | Opportunity_No__c, |
| | | SPOApprovedQuote__c, |
| | | Contract_DB_complite_day__c, |
| | | SAP_Send_OK__c, |
| | | Decided_Estimation__c, |
| | | Estimation_Decision__c, |
| | | Estimation_No__c, |
| | | Competitor__c, |
| | | Sign_Contract_Electronically__c, |
| | | StageName |
| | | from Opportunity |
| | | where Opportunity_No__c in : opportunity_NoList]; |
| | |
| | | |
| | | for (GeData gda : accordList) { |
| | | Opportunity opportunityInfo = new Opportunity(); |
| | | |
| | | |
| | | if (oppMap.containsKey(gda.Opportunity_No)) { |
| | | opportunityInfo = oppMap.get(gda.Opportunity_No); |
| | | } else { |
| | |
| | | opportunityInfo.IF_Submit__c = false; |
| | | opportunityInfo.if_Interface_Lock__c = false; |
| | | opportunityInfo.Contract_Authorize_Lock__c = false; |
| | | if (gda.SealDate!=null) { |
| | | // 2022-11-16 ssm 增加206接口判断,撤销合同时不设置电子签时间和自动win |
| | | if (gda.ApprovedType != '3' && gda.ContractType != '3' && String.isNotBlank(gda.SealDate)) { |
| | | opportunityInfo.Agency_Contract_Date1__c = NFMUtil.parseStr2Date(gda.SealDate); |
| | | // 收到日期时自动win |
| | | opportunityInfo.SAP_Send_OK__c = true; |
| | |
| | | opportunityInfo.Contract_DB_SalesDept_complite_day__c = null; |
| | | opportunityInfo.Contract_DB_Finalcomplite_day__c = null; |
| | | opportunityInfo.SPOApprovedQuote__c = null;//add |
| | | opportunityInfo.Sign_Contract_Electronically__c = false; |
| | | |
| | | // 20211206 SWAG-C7P4XB 撤销合同时,如果当前询价等级为A1,退回到A start |
| | | if ('A1'.equals(opportunityInfo.Competitor__c)) { |
| | |
| | | opportunityInfo.if_Interface_Lock__c = true; |
| | | } |
| | | opportunityInfo.SPOApprovedQuote__c = gda.SPOApprovedQuote;//add |
| | | // 2022-10-19 SWAG-CKB5S6 xxf start |
| | | if(gda.IsEsign == '1'){//电子签合同:IsEsign='1' |
| | | opportunityInfo.Sign_Contract_Electronically__c = true; |
| | | }else if (gda.IsEsign == '0' || gda.IsEsign == null) {//非电子签合同:IsEsign='0' |
| | | opportunityInfo.Sign_Contract_Electronically__c = false; |
| | | } |
| | | // 2022-10-19 SWAG-CKB5S6 xxf end |
| | | } |
| | | //songxiaoqi ------start 2020/11/4 update 状态1是询价 |
| | | //传入true代表合同终止 StageName__c |
| | |
| | | opportunityInfo.Contract_DB_SalesDept_complite_day__c = null; |
| | | opportunityInfo.Contract_DB_Finalcomplite_day__c = null; |
| | | opportunityInfo.SPOApprovedQuote__c = null; |
| | | opportunityInfo.Sign_Contract_Electronically__c = false; |
| | | } |
| | | //songxiaoqi -------end |
| | | // system.debug('10.OCSM-经销商签约日='+opportunityInfo.Agency_Contract_Date1__c); |
| | | // String Dec; |
| | | // if (opportunityInfo.Decided_Estimation__c!=null) { |
| | | // Integer index1 = opportunityInfo.Decided_Estimation__c.indexOf('</a>'); |
| | | // Dec = opportunityInfo.Decided_Estimation__c.subString(index1-18,index1); |
| | | // } |
| | | // system.debug('Dec=' + Dec+'opportunityInfo.SPOApprovedQuote__c = '+opportunityInfo.SPOApprovedQuote__c); |
| | | // if(opportunityInfo.SPOApprovedQuote__c!=null&&opportunityInfo.SPOApprovedQuote__c==Dec){ |
| | | // opportunityInfo.SAP_Send_OK__c = true; |
| | | // }else{ |
| | | // iflog.ErrorLog__c += 'Error! '+'决定的报价为:'+Dec+' 与合同审批完成的报价不一致'+'\n'; |
| | | // system.debug('报错啦'); |
| | | // continue; |
| | | // } |
| | | |
| | | opportunityUpsertList.add(opportunityInfo); |
| | | } |
| | | if (opportunityUpsertList.size() > 0) { |
| | | upsert opportunityUpsertList; |
| | | // 20220916 ljh SWAG-CG2A7S start |
| | | // upsert opportunityUpsertList; |
| | | // 20220916 ljh SWAG-CG2A7S start |
| | | String logstrNew = ''; |
| | | Integer failedCount = 0; |
| | | Integer failedCountEmail = 0; |
| | | Map<String,String> errMap = new Map<String,String>(); |
| | | Map<String,String> errMapAll = new Map<String,String>(); |
| | | Database.SaveResult[] updateRepairResult = Database.update(opportunityUpsertList, false); |
| | | for (Integer tIdx = 0; tIdx < updateRepairResult.size(); tIdx++) { |
| | | Database.SaveResult sr = updateRepairResult[tIdx]; |
| | | System.debug('zheli:'+sr); |
| | | if (!sr.isSuccess()) { |
| | | failedCount += 1; |
| | | String errStr = ''; |
| | | Database.Error emsg = sr.getErrors()[0]; |
| | | errStr += '\n' + emsg.getMessage(); |
| | | String eId = (String) opportunityUpsertList[tIdx].get('Id'); |
| | | String SealDateStr = String.valueOf(opportunityUpsertList[tIdx].get('Agency_Contract_Date1__c')); |
| | | if ( String.isNotBlank(SealDateStr) && !String.valueOf(emsg.getMessage()).contains('Future method cannot be called from a future or batch method')) { |
| | | failedCountEmail += 1; |
| | | errMap.put(eId,errStr); |
| | | } |
| | | errMapAll.put(eId,errStr); |
| | | logstr += '\n' + emsg.getMessage(); |
| | | logstrNew = emsg.getMessage() + '\n' + emsg.getFields() + '\n' + logstrNew; |
| | | } |
| | | } |
| | | if(failedCount > 0){ |
| | | Database.rollback(sp); |
| | | iflog.ErrorLog__c = logstrNew + '\n' + iflog.ErrorLog__c; |
| | | if (rowData.retry_cnt__c == null) rowData.retry_cnt__c = 0; |
| | | if (rowData.retry_cnt__c < batch_retry_max_cnt) { |
| | | rowData.retry_cnt__c++; |
| | | LogAutoSendSchedule.assignOneMinute(); |
| | | } |
| | | if (rowData.retry_cnt__c >= batch_retry_max_cnt) { |
| | | rowData.ErrorLog__c = logstrNew + rowData.ErrorLog__c + '错误次数已经超过自动收信设定的最大次数,请手动收信'; |
| | | } |
| | | if(failedCountEmail > 0 && ((rowData.retry_cnt__c !=null && rowData.retry_cnt__c == batch_retry_max_cnt) || Test.isRunningTest())){ |
| | | sendEmail(errMap,false); |
| | | } |
| | | if(failedCount > failedCountEmail && ((rowData.retry_cnt__c !=null && rowData.retry_cnt__c == batch_retry_max_cnt) || Test.isRunningTest())){ |
| | | sendEmail(errMapAll,true); |
| | | } |
| | | }else{ |
| | | rowData.retry_cnt__c = 0; |
| | | } |
| | | // 20220916 ljh SWAG-CG2A7S end |
| | | } |
| | | logstr += '\nend'; |
| | | rowData.retry_cnt__c = 0; |
| | | |
| | | // 20220916 ljh SWAG-CG2A7S 注释 start |
| | | } catch (Exception ex) { |
| | | Database.rollback(sp); |
| | | System.debug(Logginglevel.ERROR, 'NFM206_' + rowData.MessageGroupNumber__c + ':' + ex.getMessage()); |
| | |
| | | rowData.ErrorLog__c = ex.getMessage() + '\n' + ex.getStackTraceString() + '\n' + rowData.ErrorLog__c + '错误次数已经超过自动收信设定的最大次数,请手动收信'; |
| | | } |
| | | } |
| | | // 20220916 ljh SWAG-CG2A7S 注释 end |
| | | update rowData; |
| | | iflog.Log__c = logstr; |
| | | if (iflog.Log__c.length() > 131072) { |
| | |
| | | } |
| | | update iflog; |
| | | } |
| | | |
| | | public static void sendEmail(Map<String,String> errMap,Boolean isAll){ |
| | | // 发送邮件内容 |
| | | List<Messaging.SingleEmailMessage> sendMails = new List<Messaging.SingleEmailMessage>(); |
| | | Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage(); |
| | | |
| | | String OCSM_province = ''; |
| | | String title; |
| | | if(isAll){ |
| | | title = '询价206更新报错 '; |
| | | }else{ |
| | | title = '询价自动WIN失败 '; |
| | | } |
| | | String subject = title + ' 时间:' + Datetime.now().format(); |
| | | String htmlStr; |
| | | if(isAll){ |
| | | htmlStr = '更新报错原因及链接见表格:'; |
| | | }else{ |
| | | htmlStr = '您好!如下询价自动WIN失败,原因及链接见表格:'; |
| | | } |
| | | htmlStr += '<table border="1">'; |
| | | htmlStr += '<tr> <th>询价编码</th><th>失败原因</th><th>详细链接</th></tr>'; |
| | | |
| | | for(Opportunity opp:[select Id,Name,Opportunity_No__c,OCM_man_province_no_dealer__c from Opportunity where Id in:errMap.keySet()]){ |
| | | if(String.isBlank(OCSM_province)){ |
| | | OCSM_province = opp.OCM_man_province_no_dealer__c; |
| | | } |
| | | htmlStr += '<tr><td>'+opp.Opportunity_No__c+'</td><td>'+errMap.get(opp.Id)+'</td><td><a href="' + URL.getSalesforceBaseUrl().toExternalForm() + '/' + opp.Id + '">点击链接</a>'+'</td></tr>'; |
| | | } |
| | | htmlStr += '</table>'; |
| | | if(isAll){ |
| | | htmlStr += '<br/>请对应'; |
| | | }else{ |
| | | htmlStr += '<br/>请对应好后通知IT'; |
| | | } |
| | | message.setSubject(subject); |
| | | message.setHtmlBody(htmlStr); |
| | | message.setCharset('UTF-8'); |
| | | |
| | | if(isAll){ |
| | | String toEmail = System.Label.EmailAlert; |
| | | if(toEmail.length() > 0){ |
| | | List<String> toMailsList = new List<String>(); |
| | | for(String email : toEmail.split(',')){ |
| | | toMailsList.add(email); |
| | | } |
| | | if(toMailsList.size() > 0){ |
| | | message.setToAddresses(toMailsList); |
| | | } |
| | | } |
| | | }else{ |
| | | // 收信人 |
| | | String toEmail = System.Label.CN_MEBG_BusinessSupport; |
| | | if(toEmail.length() > 0){ |
| | | List<String> toMailsList = new List<String>(); |
| | | for(String email : toEmail.split(',')){ |
| | | toMailsList.add(email); |
| | | } |
| | | if(toMailsList.size() > 0){ |
| | | message.setToAddresses(toMailsList); |
| | | } |
| | | } |
| | | // CC |
| | | Set<String> ccEmailSet = new Set<String>(); |
| | | String ccEmail = System.Label.EmailAlert; |
| | | if(ccEmail.length() > 0){ |
| | | for(String email : ccEmail.split(',')){ |
| | | ccEmailSet.add(email); |
| | | } |
| | | } |
| | | |
| | | if(!String.isBlank(OCSM_province)){ |
| | | List<OCM_Management_Province__c> ompList = [select Id,SalesManage__c,SalesManage__r.Email from OCM_Management_Province__c where name =:OCSM_province]; |
| | | if(ompList.size() > 0){ |
| | | if (!String.isBlank(ompList[0].SalesManage__r.Email)) { |
| | | ccEmailSet.add(ompList[0].SalesManage__r.Email); |
| | | } |
| | | } |
| | | } |
| | | message.setCcAddresses(new List<String>(ccEmailSet)); |
| | | } |
| | | sendMails.add(message); |
| | | if (sendMails.size() > 0) { |
| | | //Messaging.sendEmail(allMails); |
| | | Messaging.SendEmailResult[] results = Messaging.sendEmail(sendMails); |
| | | for (Integer i = 0; i < results.size(); i++) { |
| | | if (results[i].success == false) { |
| | | system.debug('=====send mail error:' + results[i].errors[0].message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | GeData.Assistant_Applied_Date = String.valueOf(Date.today()-1); |
| | | GeData.ApprovedType = '1'; |
| | | GeData.SPOApprovedQuote = 'test';//20200430 add |
| | | // 2022-10-20 SWAG-CKB5S6 xxf start |
| | | GeData.IsEsign = '1'; |
| | | // 2022-10-20 SWAG-CKB5S6 xxf end |
| | | System.Test.startTest(); |
| | | NFMUtil.Monitoring Monitoring = GeDatas.Monitoring; |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM206', GeDatas.GeData); |
| | |
| | | GeData.Assistant_Applied_Date = null; |
| | | GeData.ContractType = '1'; |
| | | GeData.ApprovedType = '1'; |
| | | // 2022-10-20 SWAG-CKB5S6 xxf start |
| | | GeData.IsEsign = '0'; |
| | | // 2022-10-20 SWAG-CKB5S6 xxf end |
| | | System.Test.startTest(); |
| | | NFMUtil.Monitoring Monitoring = GeDatas.Monitoring; |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM206', GeDatas.GeData); |
| | |
| | | RestRequest req = new RestRequest(); |
| | | RestResponse res = new RestResponse(); |
| | | |
| | | String JsonMsg = '{"Monitoring":{"TransmissionDateTime":"201812201320","Text":"","Tag":"MSGH","Sender":"SFDC","Receiver":"SPO","NumberOfRecord":"1","MessageType":"NFM206","MessageGroupNumber":"20180001722190"},"GeData":[{"Opportunity_No":"BJ-SP-BJ0577783","OCM_Agent1_Price_DB":"950000","NotesApprovedNo":"MGZHTSQHN201812009","Contract_DB_SalesDept_complite_day":null,"Contract_DB_request_reason":"","Contract_DB_complite_day":"20181218","Closing_Bid_Date":"20181206","Assistant_Applied_Date":"20181218","ApprovedType":"3","SPOApprovedQuote":"test"}]}'; |
| | | String JsonMsg = '{"Monitoring":{"TransmissionDateTime":"201812201320","Text":"","Tag":"MSGH","Sender":"SFDC","Receiver":"SPO","NumberOfRecord":"2","MessageType":"NFM206","MessageGroupNumber":"20180001722190"},"GeData":[{"Opportunity_No":"BJ-SP-BJ0577782","OCM_Agent1_Price_DB":"950000","NotesApprovedNo":"MGZHTSQHN201812009","Contract_DB_SalesDept_complite_day":null,"Contract_DB_request_reason":"","Contract_DB_complite_day":"20181218","Closing_Bid_Date":"20181206","Assistant_Applied_Date":"20181218","ApprovedType":"3","SPOApprovedQuote":"test1"},{"Opportunity_No":"BJ-SP-BJ0577783","OCM_Agent1_Price_DB":"950000","NotesApprovedNo":"MGZHTSQHN201812009","Contract_DB_SalesDept_complite_day":null,"Contract_DB_request_reason":"","Contract_DB_complite_day":"20181218","Closing_Bid_Date":"20181206","Assistant_Applied_Date":"20181218","ApprovedType":"3","SPOApprovedQuote":"test"}]}'; |
| | | req.requestURI = 'services/apexrest/NFM206/execute'; |
| | | req.httpMethod = 'POST'; |
| | | req.requestBody = Blob.valueof(JsonMsg); |
| | |
| | | //Test.setMock(HttpCalloutMock.class, new NFM205RestCalloutMock()); |
| | | //NFM205Rest.execute1('{"Monitoring":{"TransmissionDateTime":"201812201320","Text":"","Tag":"MSGH","Sender":"SFDC","Receiver":"SPO","NumberOfRecord":"1","MessageType":"NFM205","MessageGroupNumber":"20180001722190"},"GeData":[{"Opportunity_Code":"HKBJ-GI-BJ0588881","Bidding_No":"as123121","Bidding_Content":"招标内容","Bid_Project_Name":"招标项目名","Bid_Date":"20181203","Authorized_Status":"1","Authorized_Finish_Sales":"30033","Authorized_DB_No":"MGZWESQHN201812001","Authorized_Date":"20190316","Autholization_Activated_Date":"20190415"}]}'); |
| | | } |
| | | // 20220921 ljh add |
| | | @isTest static void test_method_five() { |
| | | Integer batch_retry_max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt); |
| | | // Implement test code |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectContract = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '契約']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | //经销商 |
| | | Account myAccount1 = new Account(name='Testaccount001', |
| | | Dealer_discount__c =20, |
| | | RecordTypeId = rectCo[0].Id); |
| | | insert myAccount1; |
| | | |
| | | |
| | | Date authorized_Date = Date.today()-1; |
| | | Date autholization_Activated = Date.today()-1; |
| | | Date bid_Date = Date.today()-1; |
| | | Date dtlast = Date.today()+1; |
| | | |
| | | |
| | | Opportunity opp = new Opportunity(Authorized_Finish_Sales__c='11', |
| | | Authorized_DB_No__c='1008', Authorized_Date__c = authorized_Date, |
| | | Autholization_Activated_Date__c = autholization_Activated ,Bidding_Content__c='qwer', |
| | | Bid_Date__c = bid_Date, Bidding_No__c='4035',Agency1__c = myAccount1.Id, |
| | | Agency2__c = myAccount1.Id, Bidding_Project_Name__c='efg',StageName='目標', |
| | | Name='xunjia',CloseDate=dtlast, |
| | | Contract_DB_complite_day__c = bid_Date, |
| | | //songxiaoqi-------start |
| | | Estimation_Decision__c = true, |
| | | Estimation_No__c = 'test', |
| | | Estimation_Id__c='002', |
| | | Close_Forecasted_Date__c = Date.today() + 60 |
| | | //StageName='引合' |
| | | //songxiaoqi--------end |
| | | //SAP_Send_OK__c = true |
| | | ); |
| | | // opp.CloseDate = Date.today() + 90; |
| | | opp.CloseDate = Date.today() + 59; |
| | | insert opp; |
| | | //2020/11/4 songxiaoqi update |
| | | opp.Estimation_Decision__c=true; |
| | | opp.StageName= '引合'; |
| | | //2020/11/4 songxiaoqi end |
| | | update opp; |
| | | Opportunity opplist = [select Id,Name,Opportunity_No__c ,Estimation_Decision__c from Opportunity where Id = :opp.Id ]; |
| | | System.assertEquals(true, opplist.Estimation_Decision__c); |
| | | NFM206Rest.GeDatas GeDatas = new NFM206Rest.GeDatas(); |
| | | NFM206Rest.GeData GeData = new NFM206Rest.GeData(); |
| | | GeDatas.GeData = new NFM206Rest.GeData[]{GeData}; |
| | | |
| | | Datetime nowDT = Datetime.now(); |
| | | String nowStr = nowDT.format('yyyyMMddHHmm'); |
| | | GeDatas.Monitoring = new NFMUtil.Monitoring(); |
| | | GeDatas.Monitoring.MessageGroupNumber = nowStr + '01'; |
| | | |
| | | // GeData.Opportunity_No = opplist.get(0).Opportunity_No__c; |
| | | GeData.Opportunity_No = opplist.Opportunity_No__c; |
| | | GeData.OCM_Agent1_Price_DB = '1130000'; |
| | | GeData.NotesApprovedNo = ''; |
| | | GeData.SPOApprovedQuote = 'test';//20200430 add |
| | | GeData.Contract_DB_SalesDept_complite_day = null; |
| | | GeData.Contract_DB_request_reason = ''; |
| | | GeData.Contract_DB_complite_day = null; |
| | | GeData.Closing_Bid_Date = null; |
| | | GeData.Assistant_Applied_Date = null; |
| | | GeData.ContractType = '2'; |
| | | GeData.ApprovedType = '1'; |
| | | //songxiaoqi--------start |
| | | //测试合同终止 |
| | | GeData.IsTermination ='true'; |
| | | //songxiaoqi--------结束 |
| | | System.Test.startTest(); |
| | | NFMUtil.Monitoring Monitoring = GeDatas.Monitoring; |
| | | BatchIF_Log__c rowData = NFMUtil.saveRowData(Monitoring, 'NFM206', GeDatas.GeData); |
| | | // Batch User 置成false |
| | | User us = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId =System.Label.ProfileId_SystemAdmin); |
| | | insert us; |
| | | System.runAs(us) { |
| | | NFM206Rest.main(rowData.Id); |
| | | } |
| | | |
| | | System.Test.stopTest(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | // 精琢科技 2022-03-03 LJPH-CC5ANQ 【委托】之前会传一个1900-1-1的日期,导致报错,现在改为传null zxk start |
| | | // gzw fix 20220427 1900-1-1 send null |
| | | if(rr.PurchaseOrInstallationDate__c != null && rr.PurchaseOrInstallationDate__c != Date.newInstance(1900, 1, 1)){ |
| | | if(rr.PurchaseOrInstallationDate__c != null && rr.PurchaseOrInstallationDate__c.year() != 1900){ |
| | | RepairRequest.INSTALLATION_DATE = NFMUtil.formatDate2Str(rr.PurchaseOrInstallationDate__c) ; |
| | | }else{ |
| | | RepairRequest.INSTALLATION_DATE = null; |
| | |
| | | RepairRequest.INITIATION_DATE = NFMUtil.formatDate2Str(qr.QIS_Submit_day__c) ; |
| | | // 精琢科技 2022-03-03 LJPH-CC5ANQ 【委托】之前会传一个1900-1-1的日期,导致报错,现在改为传null zxk start |
| | | // gzw fix 20220427 1900-1-1 send null |
| | | if(qr.QISInstallDate__c != null && qr.QISInstallDate__c != Date.newInstance(1900, 1, 1)){ |
| | | if(qr.QISInstallDate__c != null && qr.QISInstallDate__c.year() != 1900){ |
| | | RepairRequest.INSTALLATION_DATE = NFMUtil.formatDate2Str(qr.QISInstallDate__c) ; |
| | | }else{ |
| | | RepairRequest.INSTALLATION_DATE = null; |
| | |
| | | List<Repair__c> list0 = [SELECT Id FROM Repair__c]; |
| | | List<String> ids = new List<String>(); |
| | | ids.add(list0.get(0).Id); |
| | | |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | |
| | | Test.startTest(); |
| | | if(!Test.isRunningTest()){ |
| | |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | // makeTestRepair(); |
| | | List<Repair__c> list0 = [SELECT Id FROM Repair__c]; |
| | |
| | | Test.startTest(); |
| | | StaticParameter.EscapeSyncProduct2Trigger = true; |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | // makeTestRepair(); |
| | | List<Repair__c> list0 = [SELECT Id FROM Repair__c]; |
| | | rpr = list0.get(0); |
| | |
| | | Test.startTest(); |
| | | StaticParameter.EscapeSyncProduct2Trigger = true; |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | // makeTestRepair(); |
| | | List<Repair__c> list0 = [SELECT Id FROM Repair__c]; |
| | | rpr = list0.get(0); |
| | |
| | | static void testOtherMethod(){ |
| | | List<Repair__c> list0 = [SELECT Id FROM Repair__c]; |
| | | rpr = list0.get(0); |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | rpr.IISE_confirmed_day__c =Date.today(); |
| | | rpr.IISE_confirmed_person__c = Userinfo.getUserId(); |
| | | rpr.OCSM_RC_CordingDate__c = Date.today(); |
| | |
| | | static void testQIS1(){ |
| | | List<QIS_Report__c> list1 = [SELECT Id FROM QIS_Report__c]; |
| | | qis = list1.get(0); |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | // makeTestRepair(); |
| | | List<String> ids = new List<String>(); |
| | | ids.add(qis.Id); |
| | |
| | | static void testQIS2(){ |
| | | List<QIS_Report__c> list1 = [SELECT Id FROM QIS_Report__c]; |
| | | qis = list1.get(0); |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | qis.Damage_For_Doc_Or_Pat__c = '有'; |
| | | qis.PAE_Determine__c = 'PAE'; |
| | | qis.PAE_DetermineAC__c = 'PAE'; |
| | |
| | | static void testQIS3(){ |
| | | Test.startTest(); |
| | | List<QIS_Report__c> list1 = [SELECT Id FROM QIS_Report__c]; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | QIS_Report__c qis = list1.get(0); |
| | | qis.Damage_For_Doc_Or_Pat__c = '无'; |
| | | qis.PAE_Determine__c = 'nonPAE'; |
| | |
| | | Parent.Parent.City_Master__r.Level2_Code__c, |
| | | Parent.ParentId, //医院Id |
| | | Parent.Parent.RecordTypeId //记录类型 |
| | | //LLIU-CKQ5FS 【委托】SFDC上“复旦大学附属中山医院厦门医院”省市问题 LY 20221101 start |
| | | ,Parent_Management_Code__c |
| | | //LLIU-CKQ5FS 【委托】SFDC上“复旦大学附属中山医院厦门医院”省市问题 LY 20221101 end |
| | | FROM Account |
| | | WHERE(Id IN: accountIdList OR Parent.ParentId IN: accountIdList) |
| | | AND RecordTypeId != '01210000000QjCNAA0' |
| | |
| | | getAgencyContractLatestMap = getAgencyContractLatestDate(agencySet); |
| | | } |
| | | for (Account acc: accountList) { |
| | | |
| | | String level1_Code = acc.State_Master__r.Level1_Code__c; |
| | | String level2_Code = acc.City_Master__r.Level2_Code__c; |
| | | if (String.isNotBlank(acc.Parent.ParentId)) { |
| | | level1_Code = acc.Parent.Parent.State_Master__r.Level1_Code__c; |
| | | level2_Code = acc.Parent.Parent.City_Master__r.Level2_Code__c; |
| | | } |
| | | |
| | | //LLIU-CKQ5FS 【委托】SFDC上“复旦大学附属中山医院厦门医院”省市问题 LY 20221101 end |
| | | if (acc.Parent_Management_Code__c =='8045004') { |
| | | level1_Code = 'CN-19'; |
| | | level2_Code = 'CN-1917'; |
| | | } |
| | | //LLIU-CKQ5FS 【委托】SFDC上“复旦大学附属中山医院厦门医院”省市问题 LY 20221101 end |
| | | |
| | | |
| | | GeData gd = new GeData(); |
| | | |
| | |
| | | static void testcallout4() { |
| | | // BatchIF_Log__c iflog = [select id from BatchIF_Log__c where Type__c = '601test']; |
| | | // NFM601Controller.ManualExecute(iflog.Id); |
| | | Test.startTest(); |
| | | Database.executeBatch(new Sfdc2PoAccountBatch(),100); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | |
| | | public String MultiYearContractStartDate; //多年保合同开始日 |
| | | public String MultiYearContractEndDate; //多年保合同结束日 |
| | | public String MultiYearContractData; //多年保合同记录类型(new) |
| | | public Boolean isRepairWarrantyObj; //再修理保修对象 |
| | | public Boolean isRepairWarrantyObj; //再490修理保修对象 |
| | | public String RepairType; //修理区分------------------- |
| | | public String QuotationGread; //报价等级(new) |
| | | public String detectionResult; //检测结果 |
| | |
| | | logstr += '\nend'; |
| | | if (repairs.size() > 0) { |
| | | // 2022-08-19 zyh 小程序异步处理,恢复批量发送 start |
| | | rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs); |
| | | /*rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs); |
| | | if (String.isBlank(rowData.MessageGroupNumber__c)) { |
| | | rowData.MessageGroupNumber__c = nowStr; |
| | | } |
| | | execute(rowData, iflog); |
| | | execute(rowData, iflog);*/ |
| | | // 2022-08-19 zyh 小程序异步处理,恢复批量发送 end |
| | | // 2022-05-05 zyh update start |
| | | /*for (RepairOrderInfo roi : repairs ) { |
| | |
| | | // rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs); |
| | | // execute(rowData, iflog); |
| | | repairs1 = new List < RepairOrderInfo > (); |
| | | }*/ // 2022-08-19 zyh 小程序异步处理,恢复批量发送 |
| | | /*upsert logList; |
| | | upsert rowList;*/ // 2022-08-19 zyh 小程序异步处理,恢复批量发送 |
| | | } // 2022-08-19 zyh 小程序异步处理,恢复批量发送 |
| | | */ |
| | | for (Integer i=1; i <= repairs.size();i++ ) { |
| | | if(Math.mod(i, 20) > 0 ){ |
| | | repairs1.add(repairs[i-1]); |
| | | if(i == repairs.size()){ |
| | | rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs1); |
| | | if (String.isBlank(rowData.MessageGroupNumber__c)) { |
| | | rowData.MessageGroupNumber__c = nowStr; |
| | | } |
| | | execute1(rowData, iflog); |
| | | } |
| | | }else{ |
| | | repairs1.add(repairs[i-1]); |
| | | rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs1); |
| | | if (String.isBlank(rowData.MessageGroupNumber__c)) { |
| | | rowData.MessageGroupNumber__c = nowStr; |
| | | } |
| | | execute1(rowData, iflog); |
| | | repairs1 = new List < RepairOrderInfo > (); |
| | | } |
| | | |
| | | } |
| | | upsert logList; |
| | | upsert rowList; // 2022-08-19 zyh 小程序异步处理,恢复批量发送 |
| | | // 2022-05-11 zyh update start |
| | | if (logMap.size() > 0) { |
| | | delete logMap.values(); |
| | |
| | | |
| | | } |
| | | // 2022-05-05 zyh update start |
| | | /*public static void execute1(BatchIF_Log__c rowDataSFDC, BatchIF_Log__c iflog) { |
| | | public static void execute1(BatchIF_Log__c rowDataSFDC, BatchIF_Log__c iflog) { |
| | | Integer batch_retry_max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt); |
| | | |
| | | String logstr = rowDataSFDC.MessageGroupNumber__c + ' start\n'; |
| | | String logstr = rowDataSFDC.Name + ' start\n'; |
| | | // String logstr = rowDataSFDC.MessageGroupNumber__c + ' start\n'; |
| | | if (iflog == null) { |
| | | iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = LOG_TYPE; |
| | |
| | | logList.add(iflog); |
| | | rowList.add(rowDataSFDC); |
| | | |
| | | }*/ // 2022-08-19 zyh 小程序异步处理,恢复批量发送 |
| | | } // 2022-08-19 zyh 小程序异步处理,恢复批量发送 |
| | | |
| | | // 2022-05-05 zyh update end |
| | | // 故障描述 |
| | |
| | | city = con.Account.Hospital_Department_Class__r.City_Master__r.Level2_Code__c;//市 |
| | | salesdepartment_Dept = con.Account.Hospital_Department_Class__r.Salesdepartment_Dept__c;//销售本部 |
| | | } |
| | | //LLIU-CKQ5FS 【委托】SFDC上“复旦大学附属中山医院厦门医院”省市问题 LY 20221101 end |
| | | system.debug('1111111111111111111111111111'); |
| | | if (con.Account.Parent_Management_Code__c =='8045004') { |
| | | state = 'CN-19'; |
| | | city = 'CN-1917'; |
| | | } |
| | | //LLIU-CKQ5FS 【委托】SFDC上“复旦大学附属中山医院厦门医院”省市问题 LY 20221101 end |
| | | ged.State = state; |
| | | ged.City = city; |
| | | ged.SalesBusinessDivision = salesdepartment_Dept; |
| | |
| | | } |
| | | |
| | | BatchIF_Log__c rowData = [Select Id, Name, Log__c, ErrorLog__c, Log2__c, Log3__c, Log4__c, Log5__c, Log6__c, Log7__c, Log8__c, Log9__c, Log10__c, Log11__c, Log12__c, MessageGroupNumber__c, retry_cnt__c from BatchIF_Log__c where RowDataFlg__c = true and Id =: rowData_Id]; |
| | | String logstr = rowData.MessageGroupNumber__c + ' start\n'; |
| | | String logstr = rowData.Name + ' start\n';//MessageGroupNumber__c |
| | | BatchIF_Log__c iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = LOG_TYPE; |
| | | iflog.MessageGroupNumber__c = rowData.MessageGroupNumber__c; |
| | | iflog.MessageGroupNumber__c = rowData.Name;//rowData.MessageGroupNumber__c; |
| | | iflog.Log__c = logstr; |
| | | iflog.ErrorLog__c = ''; |
| | | insert iflog; |
| | |
| | | } |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | |
| | | rowData.retry_cnt__c = 0; //必加 |
| | | // 必填字段验证 Start |
| | | String dataComplete = verify(ged); |
| | | // 必填字段验证 End |
| | |
| | | logstr += '拜访区分 [ ' + ged.visitDistinction + ' ]无效,此条数据跳过不执行 \n'; |
| | | return; |
| | | } |
| | | //日报审批通过之后,不能在创建报告一览 |
| | | if(null!=drc){ |
| | | if(drc.Status__c=='承認'){ |
| | | logstr += '日报状态 [' + drc.Status__c +' ],此条数据跳过不执行 \n'; |
| | | return; |
| | | } |
| | | } |
| | | Datetime startdate1 = NFMUtil.parseStr2DateTime(ged.visitStartDate); |
| | | Datetime enddate1 = NFMUtil.parseStr2DateTime(ged.visitEndDate); |
| | | Long timeDif = enddate1.getTime() - startdate1.getTime(); |
| | | Integer ts = Integer.valueOf((enddate1.getTime() - startdate1.getTime()) / 1000 / 3600 /24); |
| | | system.debug( startdate1.getTime()+'==='+enddate1.getTime()+'==='+startdate1+'==='+enddate1+'==='+ts); |
| | | if(ts > 14){ |
| | | logstr += '事件的持续时间不能超过 14 天,此条数据跳过不执行 \n'; |
| | | return; |
| | | } |
| | | |
| | | // 查找访问对象 |
| | | String contactId = null; |
| | | if (String.isNotBlank(ged.applicantId)) { |
| | |
| | | report.whatid__c = departmentAccount.Id; |
| | | // report.VisitType__c = ged.visitInfo;//任务类型 |
| | | report.Visitor1_ID__c = contactId; //訪問者1 |
| | | report.Visitor1__c = contactId; |
| | | report.StartDateTime__c = NFMUtil.parseStr2DateTime(ged.visitStartDate);//开始时间 |
| | | report.ActivityDate__c = NFMUtil.parseDateTimeStr2Date(ged.visitStartDate);//活动日期 |
| | | report.EndDateTime__c = NFMUtil.parseStr2DateTime(ged.visitEndDate);//结束时间 |
| | |
| | | insert report; |
| | | logstr += '报告一览 [ '+ged.replyID+' ] 保存成功!\n'; |
| | | } |
| | | // rowData.retry_cnt__c = 0; //必加 |
| | | |
| | | rowData.retry_cnt__c = 0; //必加 |
| | | } catch (Exception ex) { |
| | | // エラーが発生した場合 |
| | | Database.rollback(sp); |
| | |
| | | } |
| | | |
| | | |
| | | List < Daily_Report__c > drcs = [select Id, Reporter__r.Employee_No__c from Daily_Report__c where Reported_Date__c =: visitStartDate and Reporter__r.Employee_No__c =: ged.mngCd]; |
| | | List < Daily_Report__c > drcs = [select Id, Reporter__r.Employee_No__c,Status__c from Daily_Report__c where Reported_Date__c =: visitStartDate and Reporter__r.Employee_No__c =: ged.mngCd]; |
| | | if (drcs.size() > 0) { |
| | | result = drcs[0]; |
| | | } else { |
| | |
| | | repair.ReturnOrderLatestStatus__c = ged.LogisticsInfo.logisticsLatestStatus; |
| | | } |
| | | if (String.isNotBlank(logisticsType)) { |
| | | LogisticsInformation__c logisticsInformation = DataAssembly(ged,logisticsType,logisticsInformationMap,repairMap); |
| | | upsertLogisticsInformationList.add(logisticsInformation); |
| | | if (String.isNotBlank(ged.LogisticsInfo.logisticsNo)) { // 2022-11-08 zyh insert |
| | | LogisticsInformation__c logisticsInformation = DataAssembly(ged,logisticsType,logisticsInformationMap,repairMap); |
| | | upsertLogisticsInformationList.add(logisticsInformation); |
| | | } // 2022-11-08 zyh insert |
| | | } |
| | | updateList.add(repair); |
| | | } |
| | |
| | | if (ged.repairOrderInfo.api_type == null) { |
| | | result += 'DataError: [ ' + repairNo + ' ] api_type is null!\n'; |
| | | } |
| | | if ((ged.repairOrderInfo.api_type == 3 || ged.repairOrderInfo.api_type == 4 || ged.repairOrderInfo.api_type == 5) && |
| | | /*if ((ged.repairOrderInfo.api_type == 3 || ged.repairOrderInfo.api_type == 4 || ged.repairOrderInfo.api_type == 5) && |
| | | String.isBlank(ged.LogisticsInfo.logisticsNo)) { |
| | | result += 'DataError: [ ' + repairNo + ' ] logisticsNo is null!\n'; |
| | | |
| | | } |
| | | }*/ // 2022-11-08 zyh 注释 |
| | | |
| | | } |
| | | |
| | |
| | | private static Map < String, Map < String, Id >> getLogisticsInformationMap(Map < String, GeData > geDataMap) { |
| | | List < LogisticsInformation__c > logisticsInformationList = [Select Id, LogisticsNo__c, LogisticsRepair__r.Name FROM LogisticsInformation__c WHERE LogisticsRepair__r.Name IN: geDataMap.keySet()]; |
| | | Map < String, Map < String, Id >> result = new Map < String, Map < String, Id >> (); |
| | | for (LogisticsInformation__c logistics: logisticsInformationList) { |
| | | if (logisticsInformationList.size() > 0) { //2022-11-08 zyh insert |
| | | |
| | | for (LogisticsInformation__c logistics: logisticsInformationList) { |
| | | |
| | | String repairName = logistics.LogisticsRepair__r.Name; |
| | | String logisticsNo = logistics.LogisticsNo__c; |
| | | Map < String, Id > logisticsMap = new Map < String, Id > (); |
| | | String repairName = logistics.LogisticsRepair__r.Name; |
| | | String logisticsNo = logistics.LogisticsNo__c; |
| | | Map < String, Id > logisticsMap = new Map < String, Id > (); |
| | | |
| | | if (result.containsKey(repairName)) { |
| | | logisticsMap = result.get(repairName); |
| | | if (result.containsKey(repairName)) { |
| | | logisticsMap = result.get(repairName); |
| | | } |
| | | logisticsMap.put(logistics.LogisticsNo__c, logistics.Id); |
| | | result.put(repairName, logisticsMap); |
| | | |
| | | } |
| | | logisticsMap.put(logistics.LogisticsNo__c, logistics.Id); |
| | | result.put(repairName, logisticsMap); |
| | | |
| | | } |
| | | } //2022-11-08 zyh insert |
| | | return result; |
| | | } |
| | | /** |
| | |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | MobilePhone_Encrypted__c |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | ,Account.Department_Class__r.Name |
| | | from Contact |
| | | where CManageCode__c IN: PersonManagementCodeList |
| | | OR (Account.Parent_PlatformCode__c IN: ManagementList AND LastName_Encrypted__c IN:NameList) |
| | | OR (Account.Parent_Management_Code__c IN: SFDCCodeList AND LastName_Encrypted__c IN:NameList ) |
| | | OR (Account.Parent_PlatformCode__c IN: ManagementList AND LastName_Encrypted__c IN:NameList AND UnifiedI_Contact_ID__c = null) |
| | | OR (Account.Parent_Management_Code__c IN: SFDCCodeList AND LastName_Encrypted__c IN:NameList AND UnifiedI_Contact_ID__c = null) |
| | | ORDER BY MobilePhone ASC,CManageCode__c ASC]; //根据人员管理编码检索联系人 |
| | | Map < String, Contact > peopleMap = new Map < String, Contact > (); //联系人 |
| | | system.debug('peopleList '+peopleList); |
| | |
| | | Map < String, Contact > snameMap = new Map < String, Contact > (); |
| | | string namekey; |
| | | string nameKey2; |
| | | string nameKey3; |
| | | string nameKey4; |
| | | if(String.isBlank(ct.MobilePhone_Encrypted__c)){ |
| | | namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c.trim(); |
| | | nameKey2 = ct.Account.Management_Code__c + ' ' + ct.LastName_Encrypted__c.trim(); |
| | | nameKey3 = ct.Account.Department_Class__r.Name + ' ' + ct.LastName_Encrypted__c.trim(); |
| | | nameKey4 = ct.LastName_Encrypted__c.trim(); |
| | | } else{ |
| | | namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | nameKey2 = ct.Account.Management_Code__c + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | nameKey3 = ct.Account.Department_Class__r.Name + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | nameKey4 = ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | } |
| | | // snameMap.put(namekey,ct); |
| | | if (nameMap.containsKey(ct.Account.parent.Name)) { |
| | |
| | | } |
| | | snameMap.put(namekey, ct); |
| | | snameMap.put(nameKey2,ct); |
| | | snameMap.put(nameKey3,ct); |
| | | snameMap.put(nameKey4,ct); |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // if(String.isBlank(ct.MobilePhone_Encrypted__c)){ |
| | | // snameMap.put(ct.LastName_Encrypted__c.trim(), ct); |
| | |
| | | List < Account > upsertAccountList = new List < Account > (); |
| | | //联系人List(更新用) |
| | | List < Contact > upsertContactList = new List < Contact > (); |
| | | List < Contact > upsertContactList1 = new List < Contact > (); |
| | | |
| | | for (Gedata gedata: newGeDataList) { |
| | | logstr += gedata.Name; |
| | |
| | | string DepartmentCode = string.isNotBlank(gedata.RelatedDepartment) ? gedata.RelatedDepartment : gedata.DepartmentManagementCode2; |
| | | string DepartmentClasskey = gedata.AccountName + ' ' + gedata.DepartmentClass; |
| | | system.debug('DepartmentClasskey------->'+DepartmentClasskey); |
| | | system.debug('DepartmentCode------->'+DepartmentCode); |
| | | system.debug('AccountMap------->'+AccountMap); |
| | | system.debug('AccountMap.containsKey(DepartmentCode)------->'+AccountMap.containsKey(DepartmentCode)); |
| | | //科室存在 |
| | | if (AccountMap.containsKey(DepartmentCode)) { |
| | | //人员管理编码存在 |
| | |
| | | System.debug('人员管理编码不存在'); |
| | | string namekey = gedata.RelatedDepartment + ' ' + gedata.NameEncrypted + ' ' + gedata.MobileEncrypted; |
| | | string namekey1 = gedata.RelatedDepartment + ' ' + gedata.NameEncrypted; |
| | | string namekey2 = gedata.NameEncrypted + ' ' + gedata.MobileEncrypted; |
| | | string namekey3 = gedata.NameEncrypted; |
| | | system.debug('DepartmentClasskey = '+DepartmentClasskey); |
| | | system.debug('nameMap22222222 '+nameMap); |
| | | if (nameMap.containskey(DepartmentClasskey)) { // 6 完成 更新操作 |
| | |
| | | System.debug('sMap'+sMap); |
| | | System.debug('sMap.containsKey(namekey)'+sMap.containsKey(namekey)); |
| | | System.debug('sMap.containsKey(gedata.NameEncrypted)'+sMap.containsKey(gedata.NameEncrypted)); |
| | | if (sMap.containsKey(namekey)) { |
| | | if (sMap.containsKey(namekey) && sMap.get(namekey).UnifiedI_Contact_ID__c == null) { |
| | | system.debug('Id赋值'+sMap); |
| | | ct.id = sMap.get(namekey).id; |
| | | } else if (sMap.containsKey(namekey1) && sMap.get(namekey1).UnifiedI_Contact_ID__c == null) { |
| | | ct.id = sMap.get(namekey1).id; |
| | | |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // } else if(sMap.containsKey(gedata.NameEncrypted + gedata.MobileEncrypted) && sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).UnifiedI_Contact_ID__c == null){ |
| | | // ct.id = sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).id; |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | } else if(sMap.containsKey(namekey2) && sMap.get(namekey2).UnifiedI_Contact_ID__c == null){ |
| | | system.debug('战略科室存在科室为空电话有值'); |
| | | ct.id = sMap.get(namekey2).id; |
| | | }else if(sMap.containsKey(namekey3) && sMap.get(namekey3).MobilePhone_Encrypted__c == null){ |
| | | system.debug('战略科室存在科室为空电话无值'); |
| | | ct.id = sMap.get(namekey3).id; |
| | | // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | }else { // 7 完成 |
| | | system.debug('7逻辑 无人员管理编码 有医院 有科室 人名查找无 动作:新建联系人 '); |
| | | for ( Integer i = 0; i < peopleList.size(); i++) { |
| | | if (peopleList[i].Account.parent.Name !=DepartmentClasskey && (peopleList[i].MobilePhone_Encrypted__c ==null || peopleList[i].MobilePhone_Encrypted__c ==gedata.MobileEncrypted)) { |
| | | ct.id = peopleList[i].id; |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | //战略科室不存在,找手机号为空或相等的客户人员 |
| | | for ( Integer i = 0; i < peopleList.size(); i++) { |
| | | if (peopleList[i].MobilePhone_Encrypted__c ==null || peopleList[i].MobilePhone_Encrypted__c ==gedata.MobileEncrypted) { |
| | | ct.id = peopleList[i].ID; |
| | | } |
| | | } |
| | | } |
| | | upsertContactList.add(ct); |
| | |
| | | } |
| | | } else { //人员管理编码不存在 |
| | | system.debug('人员管理编码不存在'); |
| | | string namekey = gedata.DepartmentName + ' ' + gedata.NameEncrypted + ' ' + gedata.MobileEncrypted; |
| | | //string namekey = gedata.DepartmentName + ' ' + gedata.NameEncrypted + ' ' + gedata.MobileEncrypted; |
| | | string namekey = DepartmentClasskey + ' ' + gedata.NameEncrypted; |
| | | //string namekey = gedata.DepartmentName + ' ' + gedata.NameEncrypted; |
| | | //string namekey = '8103587' + ' ' + gedata.NameEncrypted; |
| | | //string namekey = gedata.AccountName + ' ' + gedata.DepartmentName + ' ' + gedata.DepartmentClass + ' ' + gedata.Name; |
| | | system.debug('DepartmentClasskey'+DepartmentClasskey); |
| | | system.debug('351nameMap '+nameMap); |
| | | system.debug('nameMap.get(DepartmentClasskey)'+nameMap.get(DepartmentClasskey)); |
| | | if (nameMap.containsKey(DepartmentClasskey)) { //查找是否存在该战略科室 |
| | | System.debug('人员管理编码不存在的情况下战略科室存在'); |
| | | system.debug('战略科室存在' + nameMap.get(DepartmentClasskey)); |
| | | System.debug('战略科室存在' + nameMap.get(DepartmentClasskey)); |
| | | Map < String, Contact > sMap = nameMap.get(DepartmentClasskey); |
| | | system.debug('namekey'+namekey); |
| | | system.debug('sMap.containsKey(namekey)'+sMap.containsKey(namekey)); |
| | | system.debug('sMap.keySet'+sMap.keySet()); |
| | | system.debug('sMap.containsKey(namekey)'+sMap.get(namekey)); |
| | | //system.debug('sMap.containsKey(namekey)8103587 '+sMap.get('8103587 '+gedata.NameEncrypted)); |
| | | //system.debug('sMap.containsKey(namekey)北京大学第三医院 普外科 手动创建科室4'+sMap.get('北京大学第三医院 普外科 手动创建科室4 '+gedata.NameEncrypted)); |
| | | //if (sMap.containsKey(namekey)) { //查找存在 8 完成 |
| | | if (sMap.containsKey(namekey)) { //查找存在 8 完成 |
| | | system.debug('8逻辑'); |
| | | system.debug('该联系人存在'); |
| | | ct.id = sMap.get(namekey).id; |
| | | //upsertAccountList.add(dpt);//可以注释 |
| | | upsertContactList.add(ct); |
| | | system.debug('list里的联系人信息'+upsertContactList); |
| | | // if(sMap.containsKey(gedata.Name)){ |
| | | // ct.Id = sMap.get(gedata.Name).Id; |
| | | // } |
| | |
| | | contactMap.put(Gedata.DepartmentManagementCode2, ct); |
| | | system.debug('contactMap ' + contactMap); |
| | | //upsertContactList.add(ct); |
| | | }else{ |
| | | system.debug('创建联系人和科室'); |
| | | //system.debug('peopleList[0]'+peopleList[0]); |
| | | for ( Integer i = 0; i < peopleList.size(); i++) { |
| | | if (peopleList[i].MobilePhone_Encrypted__c ==null) { |
| | | ct.id = peopleList[i].ID; |
| | | } |
| | | } |
| | | |
| | | // dpt.Department_Name__c = gedata.DepartmentName; |
| | | // upsertAccountList.add(dpt); |
| | | contactMap.put(Gedata.DepartmentManagementCode2, ct); |
| | | system.debug('122222222222222222222contactMap'+contactMap); |
| | | upsertContactList.add(ct); |
| | | system.debug('122222222222222222222upsertContactList'+upsertContactList); |
| | | |
| | | } |
| | | system.debug('创建联系人和科室'); |
| | | dpt.Department_Name__c = gedata.DepartmentName; |
| | | upsertAccountList.add(dpt); |
| | | contactMap.put(Gedata.DepartmentManagementCode2, ct); |
| | | |
| | | } |
| | | } |
| | | }else if('无效'.equals(hospital.Is_Active_Formula__c)){ |
| | |
| | | hp.OCM_Category__c = 'L'; |
| | | hp.PlatformCode__c = gedata.HospitalManagementCode2; |
| | | hp.State_Master__c = StateMap.get(gedata.State); // 省 |
| | | //Ly 省文本赋值 start |
| | | hp.State_Text__c = gedata.State; // 省(文本) |
| | | //Ly 省文本赋值 end |
| | | hp.City_Master__c = CityMap.get(gedata.City); // 市 |
| | | hp.Hospital_Source__c = '智慧医疗'; |
| | | upsertAccountList.add(hp); |
| | |
| | | system.debug('upsertContactList ' + upsertContactList); |
| | | system.debug('upsertAccountList ' + upsertAccountList); |
| | | if (upsertAccountList.size() > 0) { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | //放开触发201接口条件 20221102 LY start |
| | | //ControllerUtil.EscapeNFM001Trigger = true; |
| | | //放开触发201接口条件 20221102 LY end |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | system.debug('upsertAccountList ' + upsertAccountList); |
| | | upsert upsertAccountList; |
| | |
| | | system.debug('ContactMap'+ContactMap); |
| | | system.debug('ContactMap.containsKey(ac.PlatformCode__c)'+ContactMap.containsKey(ac.PlatformCode__c)); |
| | | if(ContactMap.containsKey(ac.PlatformCode__c)){ |
| | | |
| | | c = contactMap.get(ac.PlatformCode__c); |
| | | if(string.isblank(c.Id)|| c.AccountId != ac.Id){ |
| | | c.Accountid = ac.id; |
| | | } |
| | | c.OwnerId = ac.OwnerId; |
| | | upsertContactList.add(c); |
| | | system.debug('联系人信息'+c); |
| | | system.debug('upsertContactList'+upsertContactList); |
| | | //upsertContactList.add(c); |
| | | system.debug('OwnerId'+ac.OwnerId); |
| | | system.debug('upsertContactList'+upsertContactList); |
| | | } |
| | |
| | | global class GeDatas { |
| | | public NFMUtil.Monitoring Monitoring; |
| | | public GeData[] GeData; |
| | | } |
| | | global class GeData{ |
| | | } |
| | | global class GeData{ |
| | | |
| | | public String PersonManagementCode; //人员管理编码 |
| | | public String PersonManagementCode; //人员管理编码 |
| | | public String HospitalManagementCode2; //医院平台编码 平台编码 PlatformCode__c |
| | | public String DepartmentManagementCode2; //科室平台编码 平台编码 PlatformCode__c |
| | | //public String Name; //姓名 |
| | |
| | | public String DepartmentName; //所属科室 |
| | | public String RelatedDepartment; //关联SFDC科室 客户管理编码(手写) AgentCode_Ext__c |
| | | //public Boolean AgentFlag; //经销商标识 |
| | | public String dataId; |
| | | public String dataId; |
| | | public String AccountName; //医院名 |
| | | public String MobileEncrypted; //电话密文 add 20220519 thh |
| | | } |
| | |
| | | global class Response { |
| | | public List<ResponseDetail> ResponseDetails {get;set;} |
| | | } |
| | | |
| | | |
| | | global class ResponseDetail{ |
| | | public String dataId; |
| | | public String awsDataId; //=CONTACT.AWS_Data_Id__c |
| | | public String sfId; |
| | | public String dataId; |
| | | public String awsDataId; //=CONTACT.AWS_Data_Id__c |
| | | public String sfId; |
| | | } |
| | | |
| | | @HttpPost |
| | |
| | | //AccountId |
| | | from Contact |
| | | where CManageCode__c IN: PersonManagementCodeList |
| | | OR (Account.Parent_PlatformCode__c IN: ManagementList AND LastName_Encrypted__c IN:NameList) |
| | | OR (Account.Parent_Management_Code__c IN: SFDCCodeList AND LastName_Encrypted__c IN:NameList ) |
| | | OR (Account.Parent_PlatformCode__c IN: ManagementList AND LastName_Encrypted__c IN:NameList AND UnifiedI_Contact_ID__c = null) |
| | | OR (Account.Parent_Management_Code__c IN: SFDCCodeList AND LastName_Encrypted__c IN:NameList AND UnifiedI_Contact_ID__c = null) |
| | | ORDER BY MobilePhone ASC,CManageCode__c ASC]; //根据人员管理编码检索联系人 |
| | | Map < String, Contact > peopleMap = new Map < String, Contact > (); //联系人 |
| | | system.debug('peopleList '+peopleList); |
| | |
| | | Map < String, Contact > snameMap = new Map < String, Contact > (); |
| | | string namekey; |
| | | string nameKey2; |
| | | string nameKey3; |
| | | if(String.isBlank(ct.MobilePhone_Encrypted__c)){ |
| | | namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c.trim(); |
| | | nameKey2 = ct.Account.Management_Code__c + ' ' + ct.LastName_Encrypted__c.trim(); |
| | | nameKey3 = ct.LastName_Encrypted__c.trim(); |
| | | } else{ |
| | | namekey = ct.Account.Name + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | nameKey2 = ct.Account.Management_Code__c + ' ' + ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | nameKey3 = ct.LastName_Encrypted__c.trim() + ' ' + ct.MobilePhone_Encrypted__c.trim(); |
| | | } |
| | | snameMap.put(namekey,ct); |
| | | if (nameMap.containsKey(ct.Account.parent.Name)) { |
| | |
| | | } |
| | | snameMap.put(nameKey2,ct); |
| | | snameMap.put(namekey, ct); |
| | | snameMap.put(namekey3, ct); |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // System.System.debug('ct.MobilePhone_Encrypted__c1:' + ct.MobilePhone_Encrypted__c); |
| | | // if(String.isBlank(ct.MobilePhone_Encrypted__c)){ |
| | |
| | | } |
| | | peopleMap.put(ct.CManageCode__c, ct); |
| | | System.debug('peopleMap'+peopleMap); |
| | | System.debug('nameMap111'+nameMap); |
| | | } |
| | | for (Gedata gedata: newGeDataList) { |
| | | String personCode = gedata.PersonManagementCode; |
| | |
| | | //无人员管理编码 |
| | | string namekey = gedata.RelatedDepartment + ' ' + gedata.NameEncrypted + ' ' + gedata.MobileEncrypted; |
| | | string namekey1 = gedata.RelatedDepartment + ' ' + gedata.NameEncrypted; |
| | | string namekey2 = gedata.NameEncrypted + ' ' + gedata.MobileEncrypted; |
| | | string namekey3 = gedata.NameEncrypted; |
| | | system.debug('DepartmentClasskey = '+DepartmentClasskey); |
| | | system.debug('nameMap22222222 '+nameMap); |
| | | if (nameMap.containskey(DepartmentClasskey)) { |
| | |
| | | System.debug('sMap'+sMap); |
| | | System.debug('sMap.containsKey(namekey)'+sMap.containsKey(namekey)); |
| | | System.debug('Namekey'+namekey); |
| | | if (sMap.containsKey(namekey)) { |
| | | if (sMap.containsKey(namekey) && sMap.get(namekey).UnifiedI_Contact_ID__c == null) { |
| | | system.debug('根据名字匹配存在'); |
| | | red.awsDataId = sMap.get(namekey).AWS_Data_Id__c; |
| | | red.sfid = sMap.get(namekey).id; |
| | |
| | | red.sfid = sMap.get(namekey1).id; |
| | | |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 start |
| | | // } else if(sMap.containsKey(gedata.NameEncrypted + gedata.MobileEncrypted) && sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).UnifiedI_Contact_ID__c == null){ |
| | | // red.awsDataId = sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).AWS_Data_Id__c; |
| | | // red.sfid = sMap.get(gedata.NameEncrypted + gedata.MobileEncrypted).id; |
| | | } else if(sMap.containsKey(namekey2) && sMap.get(namekey2).UnifiedI_Contact_ID__c == null){ |
| | | system.debug('战略科室存在科室为空电话有值'); |
| | | red.awsDataId = sMap.get(namekey2).AWS_Data_Id__c; |
| | | red.sfid = sMap.get(namekey2).id; |
| | | }else if(sMap.containsKey(namekey3) && sMap.get(namekey3).UnifiedI_Contact_ID__c == null){ |
| | | system.debug('战略科室存在科室为空电话无值'); |
| | | red.awsDataId = sMap.get(namekey3).AWS_Data_Id__c; |
| | | red.sfid = sMap.get(namekey3).id; |
| | | // // 通过姓名+手机号判断人员是否重复 thh 20220518 end |
| | | }else { // 7 完成 |
| | | system.debug('根据名字匹配不存在'); |
| | | //red.dataID = gedata.dataID; |
| | | //red.awsDataId = null; |
| | | //red.sfid = null; |
| | | for ( Integer i = 0; i < peopleList.size(); i++) { |
| | | if (peopleList[i].Account.parent.Name !=DepartmentClasskey && peopleList[i].MobilePhone_Encrypted__c ==null) { |
| | | red.awsDataId =peopleList[i].AWS_Data_Id__c; |
| | | red.sfid =peopleList[i].id; |
| | | } |
| | | } |
| | | } |
| | | system.debug('red----------->'+red); |
| | | responseList.ResponseDetails.add(red); |
| | | //responseList.ResponseDetails.add(red); |
| | | system.debug('responseList.ResponseDetails'+responseList.ResponseDetails); |
| | | }else{ |
| | | responseList.ResponseDetails.add(red); |
| | | system.debug('战略科室不存在'); |
| | | for ( Integer i = 0; i < peopleList.size(); i++) { |
| | | if (peopleList[i].MobilePhone_Encrypted__c ==null) { |
| | | red.awsDataId =peopleList[i].AWS_Data_Id__c; |
| | | red.sfid =peopleList[i].id; |
| | | } |
| | | } |
| | | //responseList.ResponseDetails.add(red); |
| | | } |
| | | responseList.ResponseDetails.add(red); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | Account hptemp = [select Id,PlatformCode__c,AgentCode_Ext__c,Is_Active_Formula__c from Account where Id = :hp.Id]; |
| | | |
| | | //战略科室 |
| | | Account dc = [select Id, Name,Parent_PlatformCode__c,Parent_Management_Code__c, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_BF']; |
| | | |
| | | // 戦略科室を得る |
| | | Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hp.Id AND recordType.DeveloperName = 'Department_Class_OTH']; |
| | | // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id; |
| | | dep.Name = 'test dep'; |
| | | dep.AgentCode_Ext__c = '9999998'; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hp.Id; |
| | | insert dep; |
| | | |
| | | //联系人 |
| | | Contact contact2 = new Contact(); |
| | | contact2.AccountId = dep.Id; |
| | | contact2.FirstName = '責任者'; |
| | | contact2.LastName = 'test1经销商'; |
| | | contact2.LastName_Encrypted__c ='24616254c7c7b65d985567f475b667d7'; |
| | | insert contact2; |
| | | |
| | | NFM624Rest.GeData GeData1 = new NFM624Rest.GeData(); |
| | | NFM624Rest.GeDatas GaDatas = new NFM624Rest.GeDatas(); |
| | | |
| | |
| | | Account hp = new Account(RecordTypeId = '01210000000QemG', Name = 'hp', OwnerId = hpOwner.Id); |
| | | hp.FSE_GI_Main_Leader__c = hpOwner.Id; |
| | | hp.Advance_Payment_Identification_Approval__c = Date.today().addyears(-1); |
| | | hp.Is_Active__c = '有効'; |
| | | insert hp; |
| | | Account hptemp = [select Id,PlatformCode__c,AgentCode_Ext__c from Account where Id = :hp.Id]; |
| | | //战略科室 |
| | |
| | | hp.PlatformCode__c = '1375'; |
| | | hp.Is_Active__c = '有効'; |
| | | insert hp; |
| | | |
| | | System.debug('医院信息11'+hp); |
| | | |
| | | Inquiry_form__c inquiryform = new Inquiry_form__c(); |
| | | inquiryform.Name = '2019102101'; |
| | | inquiryform.Request1__c = '需要报价'; |
| | |
| | | insert inquiryform; |
| | | |
| | | Account hptemp = [select Id,PlatformCode__c,AgentCode_Ext__c,Is_Active_Formula__c from Account where Id = :hp.Id]; |
| | | |
| | | System.debug('医院信息hptemp'+hptemp); |
| | | //战略科室 |
| | | Account dc = [select Id, Name,Parent_PlatformCode__c,Parent_Management_Code__c, RecordType_DeveloperName__c, Account2__c from Account where ParentId = :hp.Id and RecordType_DeveloperName__c = 'Department_Class_BF']; |
| | | |
| | | System.debug('战略科室信息'+dc); |
| | | |
| | | NFM624Rest.GeData GeData1 = new NFM624Rest.GeData(); |
| | | NFM624Rest.GeDatas GaDatas = new NFM624Rest.GeDatas(); |
| | | |
| | |
| | | NFM624RestAbout.executefuture(rowData5.Id); |
| | | } |
| | | } |
| | | static testMethod void testMethod5(){ |
| | | oly_TriggerHandler.bypass('ContactTriggerHandler'); |
| | | //用户 |
| | | User hpowner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '北京', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = '00e10000000xnp2'); |
| | | insert hpowner; |
| | | |
| | | User hpowner2 = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp1', Work_Location__c = '北京', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner1@sunbridge.com', Username = 'olympus_hpowner1@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = '00e10000000xnp2'); |
| | | insert hpowner2; |
| | | |
| | | //医院 |
| | | Account hp = new Account(RecordTypeId = '01210000000QemG', Name = '北京德胜门中医院', OwnerId = hpOwner.Id); |
| | | hp.FSE_GI_Main_Leader__c = hpOwner.Id; |
| | | hp.Advance_Payment_Identification_Approval__c = Date.today().addyears(-1); |
| | | hp.AgentCode_Ext__c = '112358'; |
| | | hp.PlatformCode__c = '1375'; |
| | | hp.Is_Active__c = '有効'; |
| | | insert hp; |
| | | System.debug('医院信息111'+hp); |
| | | |
| | | |
| | | Account hptemp = [select Id,PlatformCode__c,AgentCode_Ext__c,Is_Active_Formula__c from Account where Id = :hp.Id]; |
| | | |
| | | // 戦略科室を得る |
| | | Account strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hp.Id AND recordType.DeveloperName = 'Department_Class_OTH']; |
| | | System.debug('战略科室111'+strategicDep); |
| | | // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id; |
| | | dep.Name = '胃镜室'; |
| | | dep.AgentCode_Ext__c = '5311053'; |
| | | dep.ParentId = strategicDep.Id; |
| | | dep.Department_Class__c = strategicDep.Id; |
| | | dep.Hospital__c = hp.Id; |
| | | insert dep; |
| | | System.debug('科室信息111'+dep); |
| | | |
| | | //联系人 |
| | | Contact contact2 = new Contact(); |
| | | contact2.AccountId = dep.Id; |
| | | contact2.FirstName = '責任者'; |
| | | contact2.LastName = 'test1经销商'; |
| | | contact2.LastName_Encrypted__c ='24616254c7c7b65d985567f475b667d7'; |
| | | insert contact2; |
| | | System.debug('联系人信息222'+contact2); |
| | | Contact contact =[select Id,Account.Name,Account.parent.Name from Contact where id=:contact2.Id]; |
| | | System.debug('联系人信息111'+contact); |
| | | System.debug('联系人信息111'+contact.Account.parent.Name); |
| | | |
| | | NFM624Rest.GeData GeData1 = new NFM624Rest.GeData(); |
| | | NFM624Rest.GeDatas GaDatas = new NFM624Rest.GeDatas(); |
| | | |
| | | Datetime nowDT = Datetime.now(); |
| | | String nowStr = nowDT.format('yyyyMMddHHmm'); |
| | | GaDatas.Monitoring = new NFMUtil.Monitoring(); |
| | | GaDatas.Monitoring.MessageGroupNumber = nowStr + '01'; |
| | | //有医院有有科室没有人员管理编码——>更新联系人 |
| | | NFM624Rest.GeData GeData3 = new NFM624Rest.GeData(); |
| | | GaDatas.GeData = new NFM624Rest.Gedata[] { GeData3 }; |
| | | GeData3.ContactId = '958432058911227904'; |
| | | GeData3.ServiceUserId = '958432058911227904'; |
| | | GeData3.PersonManagementCode = ''; |
| | | GeData3.HospitalManagementCode2 = '1375'; |
| | | GeData3.DepartmentManagementCode2 = '1376'; |
| | | GeData3.Name = '***'; |
| | | GeData3.NameEncrypted = '24616254c7c7b65d985567f475b667d7'; |
| | | GeData3.Mobile = '***********'; |
| | | GeData3.MobileEncrypted = 'c34725fe79b3965ea9abfd7c1435cf9a'; |
| | | GeData3.State = '北京市'; |
| | | GeData3.City = '西城区'; |
| | | GeData3.AccountName = '北京德胜门中医院'; |
| | | GeData3.RelatedHospital = '112358'; |
| | | GeData3.DepartmentClass = '其他'; |
| | | GeData3.DepartmentName = '北京德胜门中医院 其他 胃镜室'; |
| | | GeData3.RelatedDepartment = '5311053'; |
| | | GeData3.Type = '*****'; |
| | | GeData3.TypeEncrypted = '53173e61ac22874aab5b8d1f802515db'; |
| | | GeData3.ContactAddress = '**********'; |
| | | GeData3.ContactAddressEncrypted = '121a09fd9e0e9b090c4aa9c95da52810'; |
| | | GeData3.ForbiddenStatus = false; |
| | | GeData3.RegSource = '1'; |
| | | GeData3.AgentFlag = false; |
| | | GeData3.ApproverID = hpowner.Id; |
| | | GeData3.DataId = '958432058273693696'; |
| | | |
| | | BatchIF_Log__c rowData3 = NFMUtil.saveRowData(GaDatas.Monitoring, 'NFM624', GaDatas.GeData); |
| | | if (String.isBlank(rowData3.Log__c) == false){ |
| | | NFM624Rest.executefuture(rowData3.Id); |
| | | } |
| | | } |
| | | } |
| | |
| | | public static String status; |
| | | public static String ResponseBody; |
| | | public static String Result; |
| | | public static boolean isRunning = false; |
| | | // public NFM701Controller() { |
| | | |
| | | // } |
| | |
| | | this.oldList = (List<Account>) Trigger.old; |
| | | } |
| | | protected override void afterUpdate(){ |
| | | if (!StaticParameter.EscapeNFM701Trigger) { |
| | | if (!StaticParameter.EscapeNFM701Trigger && !NFM701Controller.isRunning) { |
| | | NFM701Controller.isRunning = true; |
| | | updateAccount(this.newList , this.newMap , this.oldList , this.oldMap); |
| | | } |
| | | } |
| New file |
| | |
| | | public class NewAccountExamineController { |
| | | |
| | | public String processId; |
| | | public String AccId; |
| | | public ProcessInstance objProcessInstance; |
| | | public Account objAcc {get; set;} |
| | | public string Comments {get;set;} |
| | | public string ApprovalAction {get;set;} |
| | | public PageReference redirectPage; |
| | | public String testlink {get; set;} |
| | | |
| | | // 登陆用户 |
| | | public User loginUser { get; set; } |
| | | |
| | | //初始化 |
| | | public NewAccountExamineController() |
| | | { |
| | | loginUser = [Select Id, Salesdepartment__c, Province__c, ProfileId, Job_Category__c, Sales_Speciality__c From User where Id = :Userinfo.getUserId()]; |
| | | |
| | | testlink = ApexPages.currentPage().getParameters().get('testlink'); //当前节点名字 |
| | | processId = ApexPages.currentPage().getParameters().get('id'); //获取当前的工作流ID |
| | | AccId = ApexPages.currentPage().getParameters().get('AccId'); //获取当前case ID |
| | | system.debug(processId+'-----lt123-----'+AccId); |
| | | objAcc = [select Name, Is_Active__c, RejectionReason__c, AssociatedHospital__c, InstitutionalType__c, WhetherRiskPassing__c, HospitalType__c from Account where id =:AccId]; |
| | | redirectPage = new PageReference('/'+AccId); |
| | | } |
| | | //审批 |
| | | public PageReference Approval(){ |
| | | try |
| | | { |
| | | System.debug('lt123---ApprovalAction:'+ApprovalAction); |
| | | System.debug('lt123---testlink审批节点:'+testlink); |
| | | |
| | | if(ApprovalAction == 'Approve' || ApprovalAction == 'Reject'){ |
| | | |
| | | |
| | | //== '步骤:医院新建审批_营业支援部(等待处理的 首先 批准)' |
| | | if(testlink.contains('医院新建审批_营业支援部') ){ |
| | | System.debug('lt123---testlink审批节点1进来啦----------------:'); |
| | | //接受 |
| | | if(ApprovalAction == 'Approve'){ |
| | | if(objAcc.RejectionReason__c != null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '您已填写驳回理由,批准不需要驳回理由。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '批准前,机构类型必填。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '非医疗机构' && objAcc.HospitalType__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '非医疗机构请选择医院类型。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '医疗机构' && objAcc.HospitalType__c != null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '医疗机构不需要选择医院类型。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '医疗机构'){ |
| | | objAcc.Is_Active__c = '有効';//这块加的原因是,更新客户和走审批流不一定哪个先走,如果是没更新完,就提前一步走了审批流,那么最后会把状态更新为 申请中 |
| | | objAcc.Approved_Confirm_Date__c = Date.today(); |
| | | } |
| | | |
| | | } |
| | | |
| | | //拒绝 |
| | | if(ApprovalAction == 'Reject'){ |
| | | if(objAcc.RejectionReason__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '拒绝前,请选择驳回理由。')); |
| | | return null; |
| | | } |
| | | if(objAcc.RejectionReason__c == '重复' && objAcc.AssociatedHospital__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '驳回理由是重复的,请填写关联医院。')); |
| | | return null; |
| | | } |
| | | if(objAcc.RejectionReason__c != '重复' && objAcc.AssociatedHospital__c != null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '驳回理由不是重复的,不能填写关联医院。')); |
| | | return null; |
| | | } |
| | | if(objAcc.RejectionReason__c != null && (objAcc.InstitutionalType__c != null || objAcc.HospitalType__c != null)){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '审批拒绝,不允许填写机构类型或医院类型。')); |
| | | return null; |
| | | } |
| | | if(objAcc.RejectionReason__c == '医院已关张' || objAcc.RejectionReason__c == '重复'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | }else{ |
| | | objAcc.Is_Active__c = '草案中'; |
| | | } |
| | | } |
| | | }else if(testlink.contains('质量法规二级部长') ){ |
| | | if(ApprovalAction == 'Approve'){ |
| | | if(objAcc.InstitutionalType__c == '非医疗机构' && objAcc.HospitalType__c == '高等院校'){ |
| | | objAcc.Is_Active__c = '有効'; |
| | | objAcc.Approved_Confirm_Date__c = Date.today(); |
| | | } |
| | | } |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | |
| | | }else if(testlink.contains('经销商管理部一级审批')){ |
| | | System.debug('lt123---testlink审批节点66666进来啦----------------:'); |
| | | if(ApprovalAction == 'Approve'){ |
| | | if(objAcc.WhetherRiskPassing__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '是否为有风险通过 必填。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '非医疗机构' && objAcc.HospitalType__c == '企业集团' && objAcc.WhetherRiskPassing__c == '否'){ |
| | | objAcc.Is_Active__c = '有効'; |
| | | objAcc.Approved_Confirm_Date__c = Date.today(); |
| | | } |
| | | } |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | |
| | | }else if(testlink.contains('总经理审批')){ |
| | | if(ApprovalAction == 'Approve'){ |
| | | objAcc.Is_Active__c = '有効'; |
| | | objAcc.Approved_Confirm_Date__c = Date.today(); |
| | | } |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | }else{ |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | } |
| | | |
| | | System.debug('you1----------------:'+objAcc.Is_Active__c); |
| | | |
| | | Approval.ProcessWorkitemRequest approvalNode = new Approval.ProcessWorkitemRequest(); |
| | | |
| | | approvalNode.setComments(Comments); |
| | | approvalNode.setAction(ApprovalAction); |
| | | approvalNode.setWorkitemId(processId); |
| | | |
| | | system.debug('lt123---processID'+processId); |
| | | system.debug('更新结果1'+objAcc); |
| | | objAcc.CustomizePageFlg__c = true; |
| | | update objAcc; |
| | | system.debug('更新结果2'+objAcc); |
| | | Approval.ProcessResult result = Approval.process(approvalNode); |
| | | system.debug('lt123---result:'+result.isSuccess()); |
| | | |
| | | } |
| | | else |
| | | { |
| | | //system.debug('ApprovalAction:'+this.ApprovalAction); |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | system.debug('Ex:'+ex.getMessage()); |
| | | } |
| | | return redirectPage; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class NewAccountExamineControllerTest { |
| | | |
| | | private static User getUser() { |
| | | String timenow = Datetime.now().format('yyyyMMddHHmmss'); |
| | | User user1 = new User(Test_staff__c = true, LastName = 'TestMao', FirstName = 'TestMaoF', |
| | | Alias = 'hp', CommunityNickname = 'TestMao', Email = 'Test@sunbridge.com', |
| | | Username = 'Test' + timenow + '@sunbridge.com', IsActive = true, |
| | | EmailEncodingKey = 'ISO-2022-JP',TimeZoneSidKey = 'Asia/Tokyo', |
| | | LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', |
| | | ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | Dept__c = '医疗华北营业本部', Job_Category__c = '销售服务', |
| | | Province__c = '北京'); |
| | | |
| | | List<Profile> p = [Select Id From Profile Where Name = '2S6_销售本部窗口&营业助理']; |
| | | System.assertEquals(p.size(), 1); |
| | | System.runAs(new User(Id = Userinfo.getUserId())) { |
| | | insert user1; |
| | | } |
| | | return user1; |
| | | } |
| | | |
| | | static testMethod void testMethod01() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod02() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.InstitutionalType__c = '非医疗机构'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod03() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.RejectionReason__c = '重复'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod04() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.InstitutionalType__c = '医疗机构'; |
| | | acc1.HospitalType__c = '企业集团'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod04_1() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.InstitutionalType__c = '医疗机构'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod05() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod06() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.RejectionReason__c = '重复'; |
| | | acc1.InstitutionalType__c = '医疗机构'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod06_1() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.RejectionReason__c = '地址错误'; |
| | | acc1.InstitutionalType__c = '医疗机构'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod06_2() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.RejectionReason__c = '地址错误'; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod07() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test2'; |
| | | acc.Is_Active__c = '有効'; |
| | | acc.Is_upload_file__c = true; |
| | | insert acc; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.RejectionReason__c = '重复'; |
| | | acc1.AssociatedHospital__c = acc.Id; |
| | | insert acc1; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod08() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | insert acc1; |
| | | |
| | | String testlink = '质量法规二级部长'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod08_1() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.InstitutionalType__c = '非医疗机构'; |
| | | acc1.HospitalType__c = '高等院校'; |
| | | |
| | | insert acc1; |
| | | |
| | | String testlink = '质量法规二级部长'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod09() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | insert acc1; |
| | | |
| | | String testlink = '经销商管理部一级审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod09_1() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.WhetherRiskPassing__c = '否'; |
| | | insert acc1; |
| | | |
| | | String testlink = '经销商管理部一级审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod09_2() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | acc1.WhetherRiskPassing__c = '否'; |
| | | acc1.InstitutionalType__c = '非医疗机构'; |
| | | acc1.HospitalType__c = '企业集团'; |
| | | |
| | | insert acc1; |
| | | |
| | | String testlink = '经销商管理部一级审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod10() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | insert acc1; |
| | | |
| | | String testlink = '总经理审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod11() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test2'; |
| | | acc1.Is_Active__c = '草案中'; |
| | | acc1.Is_upload_file__c = true; |
| | | insert acc1; |
| | | |
| | | String testlink = '111111'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(acc1.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/NewAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/?AccId='+acc1.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | NewAccountExamineController controller = new NewAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public class NewAgencyOpportunityController { |
| | | public without sharing class NewAgencyOpportunityController { |
| | | |
| | | static string sobjectType = 'Agency_Opportunity__c'; |
| | | |
| | | @AuraEnabled |
| | | public static ControllerResponse Init(string rid, string record_type_id){ |
| | | public static ControllerResponse Init(string rid, String pid, string record_type_id){ |
| | | system.debug('rid='+rid+',length='+(rid==null?'null':rid.length()+'')); |
| | | system.debug('record_type_id='+record_type_id+',length='+(record_type_id==null?'null':record_type_id.length()+'')); |
| | | |
| | |
| | | |
| | | data.put('data', ao); |
| | | } |
| | | if(!string.isBlank(pid) && !pid.contains('__c')){ |
| | | Id parentId = pid; |
| | | data.put('pidType', parentId.getSObjectType().getDescribe().getName()); |
| | | } |
| | | data.put('fields', SObjectHelper.GetFieldInfos(sobjectType)); |
| | | data.put('staticResource', Json.serialize(PIHelper.getPIIntegrationInfo('Agency_Contact__c'))); |
| | | res.IsSuccess = true; |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static ControllerResponse Save(Map<string,object> data,string transId,Id recordTypeId){ |
| | | public static ControllerResponse Save(Map<string,object> data,string transId,String recordTypeId){ |
| | | system.debug('data='+data); |
| | | system.debug(!data.containsKey('Id') ); |
| | | system.debug( data.get('Id') == null); |
| | |
| | | } |
| | | |
| | | |
| | | public static ControllerResponse SaveCore(Sobject sobj, Map<string,object> data,string transId,Id recordTypeId ) { |
| | | public static ControllerResponse SaveCore(Sobject sobj, Map<string,object> data,string transId,String recordTypeId ) { |
| | | Integer index = 0; |
| | | string sobjectTypeValue = sobj.getSObjectType().getDescribe().getName(); |
| | | System.debug('sobjectTypeValue:'+sobjectTypeValue+' Info:' + JSON.serialize(data)); |
| | |
| | | } |
| | | } |
| | | @AuraEnabled |
| | | public static ControllerResponse getAWSDataIds(String agencyHospitalId){ |
| | | public static ControllerResponse getAWSDataIds(String agencyHospitalId, String accountId){ |
| | | system.debug('agencyHospitalId = ' + agencyHospitalId + 'accountId = ' + accountId); |
| | | ControllerResponse r = new ControllerResponse(); |
| | | List<String> conAWSIds = new List<String>(); |
| | | List<Agency_Contact__c> agencyContact = new List<Agency_Contact__c>([select Id,AWS_Data_Id__c from Agency_Contact__c where Agency_Hospital__c =:agencyHospitalId and AWS_Data_Id__c!='']); |
| | | List<Agency_Contact__c> agencyContact = [select Id, AWS_Data_Id__c from Agency_Contact__c where (Department_Class__r.ParentId =:accountId or Agency_Hospital__c =:agencyHospitalId) and AWS_Data_Id__c!='']; |
| | | System.debug('agencyContact = ' + Json.serialize(agencyContact)); |
| | | for(Agency_Contact__c ac : agencyContact){ |
| | | conAWSIds.add(ac.AWS_Data_Id__c); |
| | | } |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static ControllerResponse searchAgencyContacts(String awsAgencyContactIds,String accountId){ |
| | | system.debug('awsAgencyContactIds = ' + awsAgencyContactIds); |
| | | public static ControllerResponse searchAgencyContacts(String awsAgencyContactIds,String agencyHospitalId,String accountId){ |
| | | system.debug('awsAgencyContactIds = ' + awsAgencyContactIds + 'agencyHospitalId = ' + agencyHospitalId + 'accountId = ' + accountId); |
| | | ControllerResponse resp = new ControllerResponse(); |
| | | resp.IsSuccess = false; |
| | | Map<String,Agency_Contact__c> awsIdToContactMapTemp = new Map<String,Agency_Contact__c>(); |
| | | if(!checkNullString(awsAgencyContactIds)){ |
| | | List<String> awsDataIds = (List<String>) JSON.deserialize(awsAgencyContactIds, List<String>.class); |
| | | System.debug('awsDataIds = ' + awsDataIds.size()); |
| | | List<Agency_Contact__c> conListTemp = new List<Agency_Contact__c>(); |
| | | if(!checkNullString(accountId)){ |
| | | Agency_Hospital_Link__c act = [select id from Agency_Hospital_Link__c where id = :accountId]; |
| | | conListTemp = new List<Agency_Contact__c>([select Id,AWS_Data_Id__c, Agency_Hospital__r.Name,Department_Class__r.Name from Agency_Contact__c where Agency_Hospital__c =: act.Id and AWS_Data_Id__c in:awsDataIds]); |
| | | String accId = ''; |
| | | String accHospitalId = ''; |
| | | if(!checkNullString(agencyHospitalId) || !checkNullString(accountId)){ |
| | | List<Agency_Hospital_Link__c> actList = [select id from Agency_Hospital_Link__c where id = :agencyHospitalId]; |
| | | List<Account> accList = [select Id, parentId from Account where id = :accountId]; |
| | | if (actList.size() > 0) { |
| | | accHospitalId = actList[0].Id; |
| | | } |
| | | if (accList.size() > 0) { |
| | | accId = accList[0].Id; |
| | | } |
| | | conListTemp = new List<Agency_Contact__c>([select Id,AWS_Data_Id__c, Agency_Hospital__r.Name, Department_Class__r.Parent.Name from Agency_Contact__c where (Department_Class__r.ParentId =:accId or Agency_Hospital__c =: accHospitalId) and AWS_Data_Id__c in:awsDataIds]); |
| | | }else { |
| | | conListTemp = new List<Agency_Contact__c>([select Id,AWS_Data_Id__c,Agency_Hospital__r.Name,Department_Class__r.Name from Agency_Contact__c where AWS_Data_Id__c in:awsDataIds]); |
| | | conListTemp = new List<Agency_Contact__c>([select Id,AWS_Data_Id__c, Agency_Hospital__r.Name, Department_Class__r.Name from Agency_Contact__c where AWS_Data_Id__c in:awsDataIds]); |
| | | } |
| | | for(Agency_Contact__c con:conListTemp){ |
| | | awsIdToContactMapTemp.put(con.AWS_Data_Id__c,con); |
| | |
| | | System.debug('re: ' + recordTypeId); |
| | | // agencyOpportunity = [select Id from Agency_Opportunity__c where Name = '引合2']; |
| | | Test.startTest(); |
| | | ControllerResponse res = NewAgencyOpportunityController.Init(agencyOpportunity.Id, recordTypeId); |
| | | ControllerResponse res = NewAgencyOpportunityController.Init(agencyOpportunity.Id, '', recordTypeId); |
| | | System.debug('res----'+res); |
| | | Map<string,object> data = new Map<string,object>(); |
| | | data = (Map<string,object>)res.Data; |
| | | NewAgencyOpportunityController.Save(data, agencyOpportunity.Id+'', recordTypeId); |
| | | NewAgencyOpportunityController.getAWSDataIds(aHosLink.Id); |
| | | NewAgencyOpportunityController.Save(data, agencyOpportunity.Id + '', recordTypeId); |
| | | NewAgencyOpportunityController.getAWSDataIds(aHosLink.Id, ''); |
| | | List<String> acList = new List<String>(); |
| | | acList.add('960382060990562305'); |
| | | NewAgencyOpportunityController.searchAgencyContacts(JSON.serialize(acList), ''); |
| | | NewAgencyOpportunityController.searchAgencyContacts(JSON.serialize(acList), '', ''); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | |
| | | String recordTypeId = Schema.SObjectType.Agency_Opportunity__c.getRecordTypeInfosByDeveloperName().get('Opportunity').getRecordTypeId(); |
| | | System.debug('re: ' + recordTypeId); |
| | | Test.startTest(); |
| | | ControllerResponse res = NewAgencyOpportunityController.Init('', recordTypeId); |
| | | ControllerResponse res = NewAgencyOpportunityController.Init('', '', recordTypeId); |
| | | System.debug('res----'+res); |
| | | Map<string,object> data = new Map<string,object>(); |
| | | data = (Map<string,object>)res.Data; |
| | |
| | | this.TermTwo_Two = '如合同终止日期与本合同第五条第1款约定的委托期限终止日期不一致时,双方同意以两者中较早日期作为本合同的终止时间。'; |
| | | this.TermThree_One = '三、 本合同总金额'; |
| | | this.TermThree_Two = '元(人民币大写'; |
| | | this.TermThree_Three = '元整)。'; |
| | | this.TermThree_Three = ')。'; |
| | | this.TermFour_One = '四、 付款方式'; |
| | | // this.TermFour_Two = '本合同金额由甲方:'; |
| | | // this.TermFour_Once = '一次性支付'; |
| | | this.TermFour_Once_One = '本合同正式签订之日起'; |
| | | this.TermFour_Once_Two = '日内,甲方向乙方支付全部合同款人民币'; |
| | | this.TermFour_Once_Three = '元(大写'; |
| | | this.TermFour_Once_Four = '元整)。'; |
| | | this.TermFour_Once_Four = ')。'; |
| | | //add wangweipeng 2021/12/10 start |
| | | this.TermFour_Once_Five= '乙方收到甲方款项并完成认款后的7个工作日内向甲方提供正规发票。'; |
| | | //add wangweipeng 2021/12/10 end |
| | |
| | | PageReference page = new PageReference('/apex/NewMCAgentPDFLimit?id=' + testMC.Id); |
| | | System.Test.setCurrentPage(page); |
| | | NewMCAgentLimitPDFController testNewMCAgentLimitPDFController = new NewMCAgentLimitPDFController(); |
| | | NewMCAgentPDFController testNewMCAgentPDFController = new NewMCAgentPDFController(); |
| | | testNewMCAgentLimitPDFController.init(); |
| | | testNewMCAgentPDFController.init(); |
| | | testMC.Term_Of_Payment__c = '一次性付款'; |
| | | upsert testMC; |
| | | testNewMCAgentLimitPDFController.init(); |
| | | testNewMCAgentPDFController.init(); |
| | | } |
| | | } |
| | | } |
| | |
| | | public String TermFive_Nine {get; private set;} |
| | | public String TermFive_Ten {get; private set;} |
| | | public String TermFive_Ten2 {get; private set;} |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 XXF 20221031 start |
| | | public String TermFive_Eleven1 {get; private set;} |
| | | public String TermFive_Eleven2 {get; private set;} |
| | | public String TermFive_Eleven3 {get; private set;} |
| | | public String TermFive_Eleven4 {get; private set;} |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 XXF 20221031 end |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start |
| | | public String TermFive_Eleven {get; private set;} |
| | | public String TermFive_Table11 {get; private set;} |
| | |
| | | //add wangweipeng 2021/12/10 start |
| | | this.TermFive_Head2 = '在乙方收到甲方按本协议第四条约定的全部款项后,在本合同服务委托期间内,乙方对本合同参保设备提供本协议约定服务,否则乙方有权拒绝提供直至甲方按约履行付款义务。具体服务如下: '; |
| | | //add wangweipeng 2021/12/10 end |
| | | this.TermFive_One = '1、 本合同参保设备因自然损耗或按照乙方要求进行清洗消毒的情况下发生故障'; |
| | | this.TermFive_One2 = '时,由乙方进行维修。因故意人为损坏导致的故障,不在本合同维修范围内。'; |
| | | this.TermFive_One = '1、 本合同参保设备因自然损耗或按照乙方要求进行清洗消毒的情况下发生故'; |
| | | this.TermFive_One2 = '障时,由乙方进行维修。因丙方故意人为损坏导致的故障,不在本合同维修范围内。'; |
| | | //add wangweipeng 2021/12/10 start |
| | | this.TermFive_One3 = '时,由乙方进行维修。因丙方故意人为损坏导致的故障,不在本合同维修范围内。'; |
| | | this.TermFive_One3 = '障时,由乙方进行维修。因丙方故意人为损坏导致的故障,不在本合同维修范围内。'; |
| | | //add wangweipeng 2021/12/10 end |
| | | this.TermFive_Two = '2、 在零件齐备的情况下,乙方保证'; |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start |
| | |
| | | this.TermFive_Nine = '9、 在本合同服务委托期内,乙方结合丙方的实际情况,判断是否要向本合同参保设备提供故障预防工具。如乙方判断需要时,由乙方直接向丙方提供。具体提供方式和数量,以乙方判断为准。'; |
| | | this.TermFive_Ten = '10、 乙方指定工程师为丙方提供1年'; |
| | | this.TermFive_Ten2 = '次点检,并提交检查报告给医院备档。'; |
| | | this.TermFive_Eleven1 = '11、 若附件1《参保设备清单》中包含“内镜清洗消毒装置”(型号:OER-AW、'; |
| | | this.TermFive_Eleven2 = 'OER-Smart,以下简称“OER-AW、OER-Smart”)的,在本合同服务委托期内,乙方'; |
| | | this.TermFive_Eleven3 = '将安排工程师为丙方提供每6个月1次上门维护检测。乙方接到丙方设备出现维'; |
| | | this.TermFive_Eleven4 = '护保养报警提示通知后进行维护保养服务,更换相关组件。'; |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start |
| | | this.TermFive_Eleven = '11、 若附件1《参保设备清单》中包含下表中的奥辉系列产品,本条第8款、第9款、及第10款不适用于该奥辉系列产品。'; |
| | | this.TermFive_Eleven = '12、 若附件1《参保设备清单》中包含下表中的奥辉系列产品,本条第8款、第9款、及第10款不适用于该奥辉系列产品。'; |
| | | this.TermFive_Table11 = '产品名称'; |
| | | this.TermFive_Table12 = '型号'; |
| | | this.TermFive_Table21 = '电子结肠镜'; |
| | |
| | | |
| | | this.TermSix_Title = '六、 甲方责任范围 '; |
| | | this.TermSix_One = '1、 甲方应按本合同约定及时支付委托费用。'; |
| | | this.TermSix_Two = '2、 甲方应配合丙方按照乙方说明书积极做好本合同参保设备的日常维护和保养工作,确保内镜始终处于良好的工作状态。'; |
| | | this.TermSix_Two = '2、 甲方应配合丙方按照乙方说明书积极做好本合同参保设备的日常维护和保养工作,确保内镜始终处于良好的工作状态。甲方应当事先告知丙方:当设备出现维护保养报警提示时,丙方应及时通知乙方。'; |
| | | this.TermSix_Three = '3、 若丙方将本合同参保设备送至非奥林巴斯厂家进行维修,乙方对经过非奥林巴斯厂家维修的设备进行维修时,将按正常标准向甲方收取维修费用,而不视为本合同费用。'; |
| | | this.TermSix_Four = '4、 若丙方自行拆卸本合同参保设备,乙方对丙方自行拆卸的设备进行维修时,将按正常标准向甲方收取维修费用,而不视为本合同费用。'; |
| | | this.TermSix_Five = '5、 若丙方将本合同参保设备借给其他医院或机构使用,由此造成的故障,乙方将向甲方收取正常的维修费,而不视为本合同费用。'; |
| | |
| | | |
| | | //add wangweipeng 2021/12/10 start |
| | | this.TermTen_One2 = '十二、 本协议甲方执'; |
| | | this.TermTen_Two2 = '份,乙方执1份,自双方盖章之日起生效。如生效日期与本协议第三条约定的委托期限起始日期不一致时,双方同意以两者中较晚日期作为本合同的生效时间。'; |
| | | this.TermTen_Two2 = '份,乙方执1份,自双方盖章之日起生效。如生效日期与本协议第二条约定的委托期限起始日期不一致时,双方同意以两者中较晚日期作为本合同的生效时间。'; |
| | | //add wangweipeng 2021/12/10 end |
| | | } |
| | | |
| | |
| | | public String TermFive_Nine {get; private set;} |
| | | public String TermFive_Ten {get; private set;} |
| | | public String TermFive_Ten2 {get; private set;} |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 XXF 20221031 start |
| | | public String TermFive_Eleven1 {get; private set;} |
| | | public String TermFive_Eleven2 {get; private set;} |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 XXF 20221031 end |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start |
| | | public String TermFive_Eleven {get; private set;} |
| | | public String TermFive_Table11 {get; private set;} |
| | |
| | | |
| | | this.TermZero_One = '甲、乙双方经过共同协商,就甲方共'; |
| | | this.TermZero_Two = '科/室共'; |
| | | this.TermZero_Three = '件奥林巴斯系列产品在本合同服务委托期限内由乙方提供有偿服务(包括乙方协助甲方对参保设备进行预防故障工作,为参保设备提供维修服务、备品服务、小修保养和合同执行报告等服务)而签订本服务合同(以下简称“本合同”)。'; |
| | | this.TermZero_Three = '件奥林巴斯系列产品在本合同服务委托期限内由乙方提供有偿服务(包括乙方协助甲方对参保设备进行预防故障工作,为参保设备提供维修服务、备品服务、小修保养和合同执行报告等服务)而签订本维修服务合同(以下简称“本合同”)。'; |
| | | this.TermOne_One = '一、 本合同的参保设备清单参见附件1,且必须在服务委托期开始时处于健康完好状态。如参保时有故障存在,除双方有另行约定外,已有故障应该先进行修理且不计入本合同,之后乙方按本合同约定承担相应责任。'; |
| | | this.TermOne_Two = '所有附件是本合同有效组成部分,与本合同具有同等法律效力。'; |
| | | this.TermTwo_One = '二、 本合同服务委托期限为'; |
| | |
| | | this.TermFive_Nine = '9、 在本合同服务委托期内,乙方结合甲方的实际情况,判断是否要向本合同参保设备提供故障预防工具。如乙方判断需要时,由乙方直接向甲方提供。具体提供方式和数量,以乙方判断为准。'; |
| | | this.TermFive_Ten = '10、 乙方指定工程师为甲方提供1年'; |
| | | this.TermFive_Ten2 = '次点检,并提交检查报告给医院备档。'; |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 XXF 20221031 start |
| | | this.TermFive_Eleven1 = '11、若附件1《参保设备清单》中包含“内镜清洗消毒装置”(型号:OER-AW、'; |
| | | this.TermFive_Eleven2 = 'OER-Smart,以下简称“OER-AW、OER-Smart”)的,在本合同期限内,乙方将安排工程师进行每6个月1次上门维护检测。乙方接到甲方设备出现维护保养报警提示通知后进行维护保养服务,更换相关组件。'; |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 XXF 20221031 end |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start |
| | | this.TermFive_Eleven = '11、 若附件1《参保设备清单》中包含下表中的奥辉系列产品,本条第8款、第9款、及第10款不适用于该奥辉系列产品。'; |
| | | this.TermFive_Eleven = '12、 若附件1《参保设备清单》中包含下表中的奥辉系列产品,本条第8款、第9款、及第10款不适用于该奥辉系列产品。'; |
| | | this.TermFive_Table11 = '产品名称'; |
| | | this.TermFive_Table12 = '型号'; |
| | | this.TermFive_Table21 = '电子结肠镜'; |
| | |
| | | //XLIU-CEP8WW 【委托】合同文本更新/新增 LY 20220524 start |
| | | |
| | | this.TermSix_Title = '六、 甲方责任范围 '; |
| | | this.TermSix_One = '1、 甲方应爱护本合同内所包含之设备,应按照乙方说明书积极做好本合同参保设备的日常维护和保养工作,确保内镜始终处于良好的工作状态。'; |
| | | this.TermSix_One = '1、 甲方应爱护本合同内所包含之设备,应按照乙方说明书积极做好本合同参保设备的日常维护和保养工作,确保内镜始终处于良好的工作状态。当设备出现维护保养报警提示时,甲方应及时通知乙方。'; |
| | | this.TermSix_Two = '2、 无论在任何情况下,甲方均不得将本合同参保设备送至非奥林巴斯厂家进行维修。否则,乙方对经过非奥林巴斯厂家维修的设备进行维修时,将按正常标准向甲方收取维修费用,而不视为本合同费用。'; |
| | | this.TermSix_Three = '3、 无论在任何情况下,甲方均不得自行拆卸本合同参保设备。否则,乙方对甲方自行拆卸的设备进行维修时,将按正常标准向甲方收取维修费用,而不视为本合同费用。'; |
| | | this.TermSix_Four = '4、 甲方不可以将本合同参保设备借给其他医院或机构使用,若由此造成的故障,乙方将向甲方收取正常的维修费,而不视为本合同费用。'; |
| | |
| | | |
| | | PageMCEElement = PageMCE[0]; |
| | | //HWAG-BHT7XX 2019/11/26 START |
| | | agreeUpperLimit = PageMCE[0].agree_Upper_limit__c ; |
| | | agreeUpperLimit = PageMCE[0].URF_Contract__c ; |
| | | //HWAG-BHT7XX 2019/11/26 END |
| | | // fxk 2021/8/31 点检次数必须选 Star |
| | | // if (PageMCEElement.Inspection_Time__c == null || ''.equals(PageMCEElement.Inspection_Time__c) || '0'.equals(PageMCEElement.Inspection_Time__c)) { |
| | |
| | | public List<SelectOption> getTerm_Of_Payment() { |
| | | List<SelectOption> options = new List<SelectOption>(); |
| | | options.add(new SelectOption('一次性付款', '一次性付款')); |
| | | //URF限次合同2期 LY 20220811 start |
| | | //if (!PageMCEElement.old_Is_RecognitionModel__c){ |
| | | if (!PageMCEElement.URF_Contract__c){ |
| | | //URF限次合同2期 LY 20220811 end |
| | | options.add(new SelectOption('多次付款', '多次付款')); |
| | | } |
| | | //URF限次合同2期 LY 20220811 start |
| | | // if (PageMCEElement.URF_Contract__c || PageMCEElement.old_Is_RecognitionModel__c){ |
| | | // options.add(new SelectOption('一次性付款', '一次性付款')); |
| | | // }else { |
| | | // options.add(new SelectOption('一次性付款', '一次性付款')); |
| | | // options.add(new SelectOption('多次付款', '多次付款')); |
| | | // } |
| | | //URF限次合同2期 LY 20220811 end |
| | | return options; |
| | | } |
| | | |
| | |
| | | if (PageMCEElement.Engineer_Name__c == null || ''.equals(PageMCEElement.Engineer_Name__c)) { |
| | | requiredInput += '工程师姓名'; |
| | | } |
| | | if (PageMCEElement.Phone_Number__c == null || ''.equals(PageMCEElement.Phone_Number__c)) { |
| | | if (!''.equals(requiredInput)) { |
| | | requiredInput += '、'; |
| | | } |
| | | requiredInput += '手机号码'; |
| | | } |
| | | //URF限次合同2期 LY 20220920 start |
| | | // if (PageMCEElement.Phone_Number__c == null || ''.equals(PageMCEElement.Phone_Number__c)) { |
| | | // if (!''.equals(requiredInput)) { |
| | | // requiredInput += '、'; |
| | | // } |
| | | // requiredInput += '手机号码'; |
| | | // } |
| | | //URF限次合同2期 LY 20220920 end |
| | | if (PageMCEElement.Small_Repair_Time__c == null || ''.equals(PageMCEElement.Small_Repair_Time__c)) { |
| | | if (!''.equals(requiredInput)) { |
| | | requiredInput += '、'; |
| | |
| | | } |
| | | } else { |
| | | //添加行 |
| | | List<Quote> quoList = |
| | | [ SELECT Id, Name, Cancel_Decide__c, CreatedDate, PriceRefreshDate__c, Quote_Print_Date__c, |
| | | List<Quote> quoList =//SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | [ SELECT Id, Name, Cancel_Decide__c, CreatedDate, PriceRefreshDate__c, Quote_Print_Date__c,QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | Dealer_Final_Price__c, TotalPrice__c, Estimation_List_Price__c, QuoteNumber, |
| | | QuoteToName, Quote_Expiration_Date__c, Quote_Comment__c, Stocking_Price__c, Unit_Price__c, |
| | | Offer_Amount__c, TOTAL__c, Discount__c, Pricing__c, Preferential_Trading_Price__c, Contract__c, |
| | |
| | | } |
| | | if (copyQuoId == null) { |
| | | quo = quoList[0]; |
| | | |
| | | quo.QuoteName__c = quo.Name; |
| | | // 多年保修 start |
| | | quoteGurantee_Period = quo.Gurantee_Period__c; |
| | |
| | | // CHAN-AVG3PW 询价报价画面规则变更 |
| | | Datetime cDate = quo.CreatedDate; |
| | | over3month = cDate != null && cDate.date().addMonths(3) < Date.today(); |
| | | |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | quo.Offer_Amount__c = true; |
| | | quo.TOTAL__c = true; |
| | | quo.Preferential_Gurantee_Period__c = true; |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | return null; |
| | | } |
| | | |
| | | |
| | | //Search Events============================================================ |
| | | // TODO ManualEntryと同様、jsにて解決できる、ここでwebserviceだけを実装、今後 by katsu |
| | |
| | | } |
| | | |
| | | } else { |
| | | List<Quote> qs = New List<Quote>(); |
| | | qs = [select Id, OpportunityId, CreatedDate, Pricebook2Id, Name, Estimation_List_Price__c, Dealer_Final_Price__c, |
| | | List<Quote> qs = New List<Quote>();//SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | qs = [select Id, OpportunityId, CreatedDate, Pricebook2Id, Name, Estimation_List_Price__c, Dealer_Final_Price__c,QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | Stocking_Price__c, Discount_Amount__c, Discount_Amount_Calculate__c, Quote_Adjust_Amount__c, Quote_Adjust_Calculate__c, |
| | | Agency1__c, OCM_Agent1_Price__c, Agency1_Profit__c, Agency1_Profit_Rate__c, Quote_No__c, |
| | | Agency2__c, Agent1_Agent2_Price__c, Agency2_Profit__c, Agency2_Profit_Rate__c, |
| | |
| | | q.Quote_Comment__c = quo.Quote_Comment__c; |
| | | |
| | | q.Installation_location__c = quo.Installation_location__c; |
| | | |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | q.QuotationChange__c = quo.QuotationChange__c; |
| | | q.MainEngineWithoutMonitor__c = quo.MainEngineWithoutMonitor__c; |
| | | q.Interdepartmental__c = quo.Interdepartmental__c; |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | /* |
| | | if (hasType3Machine) { |
| | | q.Installation_location__c = ''; |
| | | } |
| | | */ |
| | | System.debug('start save quote at: ' + System.currentTimeMillis()); |
| | | System.debug('q.QuotationChange__c+++'+q.QuotationChange__c); |
| | | System.debug('quo.QuotationChange__c++' + quo.QuotationChange__c); |
| | | System.debug('quo.MainEngineWithoutMonitor__c++' + quo.MainEngineWithoutMonitor__c); |
| | | if (quoId == null) { |
| | | insert q; |
| | | quo.Quote_No__c = q.Quote_No__c; |
| | | } else { |
| | | update q; |
| | | } |
| | | System.debug('q.QuotationChange__c2+++'+q.QuotationChange__c); |
| | | System.debug('quo.QuotationChange__c2++' + quo.QuotationChange__c); |
| | | System.debug('quo.MainEngineWithoutMonitor__c2++' + quo.MainEngineWithoutMonitor__c); |
| | | System.debug('finished save quote at: ' + System.currentTimeMillis()); |
| | | |
| | | system.debug('○○○○○Save1○○○○○'); |
| | |
| | | os = [select Id, Estimation_List_Price__c, Dealer_Final_Price__c, Estimation_List_Price_Without_Tax__c, |
| | | Agency1__c, OCM_Agent1_Price__c, Agency1_Profit__c, Agency1_Profit_Rate__c, Stocking_Price__c, |
| | | Agency2__c, Agent1_Agent2_Price__c, Agency2_Profit__c, Agency2_Profit_Rate__c, Quote_Update_Sum__c , Hospital__c,Is_Corrosion__c |
| | | // lt 20221008 SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | ,StageName ,OlyNumberHosts__c |
| | | // lt 20221008 SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | From Opportunity Where Id = :oppid]; |
| | | if (os.size() > 0) { |
| | | o = os[0]; |
| | |
| | | o.quoteSavedDate__c = Date.today(); |
| | | // 多年保修 end |
| | | |
| | | // lt 20221008 SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | System.debug('lt123询价状态(阶段): ' + o.StageName); |
| | | System.debug('lt123activities: ' + activities); |
| | | o.OlyNumberHosts__c = 0; |
| | | System.debug('lt123主机数: ' + o.OlyNumberHosts__c); |
| | | List<String> oppIds = New List<String>(); |
| | | List<String> product2Ids = New List<String>(); |
| | | Map<String,Decimal> product2IdsMap = new Map<String,Decimal>(); |
| | | if (activities.size() > 0) { |
| | | for (QELine a : activities) { |
| | | if (String.isBlank(a.PageObject.Id__c) == false) { |
| | | product2Ids.add(a.PageObject.Id__c); |
| | | product2IdsMap.put(a.PageObject.Id__c,a.PageObject.Quantity__c); |
| | | } |
| | | } |
| | | |
| | | for (Product2 prod : [Select Id,ProductClass__c |
| | | From Product2 Where Id IN :product2Ids]) { |
| | | System.debug('lt123产品市场类别: ' + prod.ProductClass__c); |
| | | |
| | | if(o.StageName == '引合' || o.StageName == '注残' || o.StageName == '出荷' || o.StageName == '完了'){ |
| | | if(prod.ProductClass__c == '主机'){ |
| | | if(product2IdsMap.containsKey(prod.Id)){ |
| | | o.OlyNumberHosts__c += product2IdsMap.get(prod.Id); |
| | | oppIds.add(o.Id); |
| | | ControllerUtil.UpdateBiddingFlag(oppIds); |
| | | } |
| | | }else{ |
| | | o.OlyNumberHosts__c += 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // lt 20221008 SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | if (o.Quote_Update_Sum__c == null) { |
| | | o.Quote_Update_Sum__c = 1; |
| | |
| | | //価格、単位、小計、OCM売上予測金額(税抜)、価格表 |
| | | List<OpportunityLineItem> ols = New List<OpportunityLineItem>(); |
| | | OpportunityLineItem ol = New OpportunityLineItem(); |
| | | ols = [select Id from OpportunityLineItem Where OpportunityId = :oppid]; |
| | | // lt 20221008 SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | ols = [select Id, Quantity from OpportunityLineItem Where OpportunityId = :oppid]; //update |
| | | System.debug('lt123询价产品: ' + ols); |
| | | // lt 20221008 SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | if (ols.size() > 0) { |
| | | //delete |
| | | ControllerUtil.delOppLine(ols); |
| | |
| | | if (s.Asset_Model != null && s.Asset_Model != '') { |
| | | if (s.PageObject.PricebookEntryId != null) { |
| | | ol = New OpportunityLineItem(); |
| | | System.debug('lt123询价产品数量: ' + ol.Quantity); //lt CHL5XA【FY23询价改善】 |
| | | ol.OpportunityId = oppid; |
| | | ol.Id__c = s.PageObject.Id__c; |
| | | // CHAN-AVG3PW 询价报价画面规则变更 |
| | |
| | | public Id quoId {get;set;} |
| | | public String oppid; |
| | | public String leadid; |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | public String tenderid; |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | public Boolean productStatusUpdated {get;set;} // 状態更新、{!$Label.Status_Update} を押下したかどうか |
| | | public Boolean changedAfterPrint {get;set;} // true の場合、画面に confirm メッセージが表示します。quoIdを新しいinsert。判定はjsにて実施 |
| | | |
| | |
| | | public String errorProductmodel { get; set; } |
| | | public Boolean is_changed_opp { get; set; } |
| | | //lastbuy 2022/3/10 fy end |
| | | |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 start |
| | | public String erroraxsdmodel { get; set; } |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 end |
| | | public String excel_text {get;set;} |
| | | public Integer select_index {get;set;} // excelImport専用ですが、jsにて制御することになるので、TODO katsu 削除予定 |
| | | public String Product_text {get;set;} |
| | |
| | | |
| | | // 招投标报价委托 2021-06-21 update by gzw start |
| | | // 招投标 |
| | | String tenderid = System.currentPageReference().getParameters().get('tenderid'); |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | // String tenderid = System.currentPageReference().getParameters().get('tenderid'); |
| | | tenderid = System.currentPageReference().getParameters().get('tenderid'); |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | |
| | | // 招投标报价委托 2021-06-21 update by gzw start |
| | | |
| | | // 询价id |
| | | oppid = System.currentPageReference().getParameters().get('oppid'); |
| | | QuoteIrai__c quoteiraiobj = new QuoteIrai__c(); |
| | | if(oppid==null&&tenderid==null&&quoId!=null&&leadid==null&&agencyoppid==null){ |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | if(oppid==null&&quoId!=null&&leadid==null&&agencyoppid==null){ |
| | | // if(oppid==null&&tenderid==null&&quoId!=null&&leadid==null&&agencyoppid==null){ |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy Noteplus__c |
| | | quoteiraiobj = [select id,Note__c,Noteplus__c from QuoteIrai__c where id=:quoId]; |
| | | if(quoteiraiobj.Note__c!=null){ |
| | |
| | | } |
| | | } |
| | | system.debug('oppid:++++'+oppid); |
| | | system.debug('leadid:++++'+leadid); |
| | | system.debug('tenderid:++++'+tenderid); |
| | | // 报价id |
| | | String oppquoid = System.currentPageReference().getParameters().get('oppquoid'); |
| | | //将报价委托的币种与外贸币种一致 防止后续外贸有需要用USD判断显示的地方 精琢技术 wql 2021/01/06 start |
| | |
| | | } |
| | | // 经销商询价报价委托 2020-02-28 update by vivek end |
| | | // 招投标报价委托 2021-06-21 update by gzw start |
| | | if (String.isNotBlank(tenderid)) { |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | // if (String.isNotBlank(tenderid)) { |
| | | if (String.isNotBlank(tenderid)&&String.isBlank(leadid)) { |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | quo.Note__c = Tender_information__c.sObjectType.getDescribe().getLabel() + ':' + baseUrl + '/' + tenderid; |
| | | } |
| | | // 招投标报价委托 2021-06-21 update by gzw end |
| | |
| | | // CHAN-BJQ4VZ 精琢技术 2019/12/11 Start |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy Noteplus__c |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | List<QuoteIrai__c> quoList = //obsap 新增经销商1字段 fy satrt Agency1_entrust__c , |
| | | [ SELECT Id,Name,Cancel_Decide__c,Agency_Hospital_Link__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,Agency1_entrust__c, |
| | | List<QuoteIrai__c> quoList = //obsap 新增经销商1字段 fy satrt Agency1_entrust__c ,SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start cancelMultiyearInsurance__c, |
| | | [ SELECT Id,Name,Cancel_Decide__c,Agency_Hospital_Link__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,Agency1_entrust__c,cancelMultiyearInsurance__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Noteplus__c,Lead__c,Opportunity__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | Print_HP_Name__c,Account__c,IraiUser__c,IraiSubject__c,CurrencyIsoCode,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | FROM QuoteIrai__c Where Id =:quoId]; |
| | | // CHAN-BJQ4VZ 精琢技术 2019/12/11 End |
| | | // CHAN-BHNBX6 2019/11/20 START |
| | | List<QuoteIraiLineItem__c> items = //lastbuy 2022/3/10 fy start LastbuyProductFLG__c |
| | | List<QuoteIraiLineItem__c> items = //lastbuy 2022/3/10 fy start LastbuyProductFLG__c //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 start Is_DangerousChemicals__c |
| | | [Select Id,Asset_Model_No__c,SFDA_Status__c,Name__c,BSS_Category__c,QuoteIrai__r.Quote_Print_Date__c, |
| | | Qty_Unit__c,Quantity__c,Product2__r.SFDA_Status__c,ProductCode__c,ListPrice__c,Product2__r.LastbuyProductFLG__c, |
| | | Qty_Unit__c,Quantity__c,Product2__r.SFDA_Status__c,ProductCode__c,ListPrice__c,Product2__r.LastbuyProductFLG__c,Product2__r.Is_DangerousChemicals__c, |
| | | Product2__r.Sales_Possibility__c,Product2__r.Name,Product2__c,ServicePrice__c,NoDiscountTotal__c,GuaranteePeriod__c |
| | | From QuoteIraiLineItem__c where QuoteIrai__c = :quoId Order by Item_Order__c, Id]; |
| | | // CHAN-BHNBX6 2019/11/20 END |
| | |
| | | quo.Quote_Expiration_Date__c = Date.today() + 30; |
| | | } |
| | | //--Savebutton |
| | | Save_button=true; |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | this.Save_button=false; |
| | | if(quo.QuoteIrai_Status__c != '草案中'&& String.isNotBlank(quo.QuoteIrai_Status__c)){ |
| | | this.Save_button=true; |
| | | } |
| | | // Save_button=true; |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | system.debug('===fff==='+quo.QuoteIrai_Status__c); |
| | | system.debug('===ccc==='+this.Save_button); |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy start |
| | | // if( quo.Note__c!=''){ |
| | | if(String.isNotBlank(quo.Note__c)){ |
| | |
| | | if (!String.isBlank(quo.Agency1_entrust__c)) { |
| | | description += '\r\n' + '第一经销商' + ':' + baseUrl + '/' + quo.Agency1_entrust__c; |
| | | } |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | if (!String.isBlank(tenderid)&&!description.contains('招标项目') ) { |
| | | description += '\r\n' + '招标项目' + ':' + baseUrl + '/' + tenderid; |
| | | } |
| | | //SWAG-CKDATG【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | //obsap 新增经销商1字段 fy end |
| | | // 招投标报价委托 2020-06-21 update by gzw start |
| | | // if (!String.isBlank(quo.Tender_information__c)) { |
| | |
| | | if (quo.QuoteProportion__c != null) { |
| | | todoSubject += ', ' + quo.QuoteProportion__c + '%'; |
| | | } |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | todoSubject += quo.cancelMultiyearInsurance__c=='不要' ?',取消多年保':',需要多年保'; |
| | | // if (quo.cancelMultiyearInsurance__c=='不要') { |
| | | // todoSubject += ',取消多年保'; |
| | | // }else{ |
| | | // todoSubject += ',需要多年保'; |
| | | // } |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | // String taskid = ''; |
| | | // 改成对多人的 |
| | | // if (tasks.size() > 0) { |
| | |
| | | // CHAN-BJQ4VZ 精琢技术 2019/12/11 Start |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy Noteplus__c |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | quo =[ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,//obsap 新增经销商1字段 fy satrt Agency1_entrust__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c, |
| | | quo =[ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,//obsap 新增经销商1字段 fy satrt Agency1_entrust__c,SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start cancelMultiyearInsurance__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c,cancelMultiyearInsurance__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | Print_HP_Name__c,Account__c,Agency_Hospital_Link__c,IraiUser__c,IraiSubject__c,CurrencyIsoCode,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | FROM QuoteIrai__c Where Id =:quoId]; |
| | |
| | | // 招投标报价委托 2020-06-21 update by gzw end |
| | | errorflg = true; |
| | | errorMessage = '邮件发送完成。'; |
| | | |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | this.Save_button=true; |
| | | //XLIU-CHY4KW 20220907 lt start --- 报价委托发送邮件成功之后 反向更新意向 报价委托字段为1 |
| | | Lead lea = new Lead(); |
| | | if(String.isNotBlank(leadid)){ |
| | |
| | | } |
| | | |
| | | //20220310 fy lastbuy end |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 start |
| | | String resalt = assdproductCheck(); |
| | | if(resalt!='OK'){ |
| | | errorflg = true; |
| | | errormessage = resalt ; |
| | | return false; |
| | | } |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 end |
| | | system.debug('○○○○○○○○○○○○Welcome to dataCheck class!!○○○○○○○○○○○○'); |
| | | errorflg = false; |
| | | errormessage = null; |
| | |
| | | if (error == true){ |
| | | if (quoId != null) { |
| | | Map<String,QuoteIraiLineItem__c> itemmap = new Map<String,QuoteIraiLineItem__c>(); |
| | | for (QuoteIraiLineItem__c item : [//lastbuy 2022/3/10 fy start LastbuyProductFLG__c |
| | | Select Id,Product2__r.SFDA_Status__c,Product2__r.Name,Product2__c,Product2__r.LastbuyProductFLG__c |
| | | for (QuoteIraiLineItem__c item : [//lastbuy 2022/3/10 fy start LastbuyProductFLG__c //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 start Product2__r.Is_DangerousChemicals__c |
| | | Select Id,Product2__r.SFDA_Status__c,Product2__r.Name,Product2__c,Product2__r.LastbuyProductFLG__c,Product2__r.Is_DangerousChemicals__c |
| | | From QuoteIraiLineItem__c where QuoteIrai__c = :quoId Order by Item_Order__c, Id]) { |
| | | itemmap.put(item.Product2__c,item); |
| | | } |
| | |
| | | q = New QuoteIrai__c(); |
| | | }else{ |
| | | // CHAN-BJQ4VZ 精琢技术 2019/12/11 Start |
| | | List<QuoteIrai__c> qs = New List<QuoteIrai__c>();//obsap 新增经销商1字段 fy satrt Agency1_entrust__c, |
| | | List<QuoteIrai__c> qs = New List<QuoteIrai__c>();//obsap 新增经销商1字段 fy satrt Agency1_entrust__c,SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start cancelMultiyearInsurance__c, |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy Noteplus__c |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | qs = [select Id,Account__c,Agency_Hospital_Link__c,Name,IraiUser__c,IraiSubject__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c, |
| | | qs = [select Id,Account__c,Agency_Hospital_Link__c,Name,IraiUser__c,IraiSubject__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c,cancelMultiyearInsurance__c, |
| | | Preferential_Trading_Price__c,Discount__c,Pricing__c,Unit_Price__c,Offer_Amount__c,TOTAL__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | Contract__c,Print_HP_Name__c,Quote_Expiration_Date__c,Quote_Comment__c,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | From QuoteIrai__c Where Id =:quoId]; |
| | |
| | | //obsap 新增经销商1字段 fy staty |
| | | q.Agency1_entrust__c = quo.Agency1_entrust__c; |
| | | //obsap 新增经销商1字段 fy staty |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | q.cancelMultiyearInsurance__c = quo.cancelMultiyearInsurance__c; |
| | | // SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | q.QuoteProportion__c = quo.QuoteProportion__c; |
| | | q.CurrencyIsoCode = quo.CurrencyIsoCode; |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy start |
| | |
| | | } |
| | | //XLIU-CFE8M7 【委托】【P-OBSAP】报价委托任务改善 fy Noteplus__c |
| | | //SWAG-CF589P【委托】【P:OBSAP】报价委托相关新需求评估 fy Lead__c,Opportunity__c, |
| | | quo =[ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,//obsap 新增经销商1字段 fy satrt Agency1_entrust__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c, |
| | | quo =[ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,//obsap 新增经销商1字段 fy satrt Agency1_entrust__c,SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start cancelMultiyearInsurance__c, |
| | | Quote_Date__c,QuoteToName__c,Quote_Expiration_Date__c,Quote_Comment__c,Tender_information__c,Agency1_entrust__c,Noteplus__c,Lead__c,Opportunity__c,cancelMultiyearInsurance__c, |
| | | TOTAL__c,Discount__c,Pricing__c,Preferential_Trading_Price__c,Contract__c,LastIraiUser__c,MultiYearWarrantyTotalPrice__c,QuoteTotal_Page__c,Estimation_List_Price__c, |
| | | Print_HP_Name__c,Account__c,Agency_Hospital_Link__c,IraiUser__c,IraiSubject__c,CurrencyIsoCode,IraiName__c,QuoteIrai_Status__c,QuoteProportion__c,Note__c,IraiComment__c |
| | | FROM QuoteIrai__c Where Id =:q.Id]; |
| | |
| | | system.debug('filg====='+filg); |
| | | return filg; |
| | | } |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 start |
| | | //阿西赛多验证 |
| | | public String assdproductCheck(){ |
| | | Boolean falg = false; |
| | | String str = 'OK'; |
| | | List<Product2> axsdQuoteIItem = new List<Product2>(); |
| | | List<Product2> QuoteIItem = new List<Product2>(); |
| | | List<Id> Product2List = new List<Id>(); |
| | | System.debug('activities111111!!!'+activities); |
| | | for(QELine aaa :activities){ |
| | | if(String.isNotBlank(aaa.pageObject.Product2__c)){ |
| | | Product2List.add(aaa.pageObject.Product2__c); |
| | | } |
| | | } |
| | | List<Product2> productlist = [select id,Is_DangerousChemicals__c from Product2 where id in:Product2List]; |
| | | for(Product2 pro :productlist){ |
| | | System.debug('Is_DangerousChemicals__c111111!!!'+pro.Is_DangerousChemicals__c); |
| | | if(pro.Is_DangerousChemicals__c){ |
| | | falg = true; |
| | | axsdQuoteIItem.add(pro); |
| | | }else if(!pro.Is_DangerousChemicals__c){ |
| | | QuoteIItem.add(pro); |
| | | } |
| | | } |
| | | if(QuoteIItem.size() > 0 && axsdQuoteIItem.size() > 0){ |
| | | str = '阿西赛多产品不能和其他产品一起报价'; |
| | | }else{ |
| | | if(falg){ |
| | | str = OpportunityWebService.checkDangerItem(quo.Agency1_entrust__c); |
| | | } |
| | | } |
| | | return str; |
| | | } |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 end |
| | | |
| | | // CHAN-BJQ4VZ 精琢技术 2019/12/11 Start |
| | | public class QuoteBean { |
| | |
| | | controller.checkIraiUser(); |
| | | controller.Back(); |
| | | |
| | | //lt start |
| | | //经销商、联系人、用户信息 |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | //经销商、联系人、用户信息 |
| | | Account myAccount1 = new Account(name='Testaccount001', |
| | | Dealer_discount__c =20, |
| | | Ban_On_Use_Date__c = Date.today().addDays(1), |
| | | Business_Paper_Expiration_Date__c = Date.today().addDays(1), |
| | | Tax_Practice_Expiration_Date__c = Date.today().addDays(1), |
| | | Medical_Equipment_Expiration_Date__c = Date.today().addDays(1), |
| | | RecordTypeId = rectCo[0].Id); |
| | | insert myAccount1; |
| | | //lt end |
| | | |
| | | // 从潜在客户新建 |
| | | Lead lead1 = new Lead(); |
| | | lead1.LastName = 'test'; |
| | | lead1.Company = 'test'; |
| | | lead1.Hospital_Name__c = myAccount1.Id; //lt |
| | | |
| | | insert lead1; |
| | | |
| | | PageReference page1 = new PageReference('/apex/NewQuoteIrai?leadid=' + lead1.Id); |
| | |
| | | system.debug('mso='+mso); |
| | | AssignValueFromUrl(mso,controller.getRecord()); |
| | | //通过id查 问题 |
| | | //PIPL zhj 2022-11-11 start |
| | | //从报修子单过来00N10000009H1rR |
| | | if (mso.containsKey('CF00N10000009H1rR_lkid')) { |
| | | String repairSubOrderId = mso.get('CF00N10000009H1rR_lkid'); |
| | | System.debug('repairSubOrderId = ' + repairSubOrderId); |
| | | //查询AWSDataId |
| | | List<RepairSubOrder__c> rso = [select AWS_Data_Id__c from RepairSubOrder__c where Id=:repairSubOrderId]; |
| | | if(rso.size() > 0){ |
| | | RepairSubOrderAWSDataId = rso[0].AWS_Data_Id__c; |
| | | } |
| | | } |
| | | //PIPL zhj 2022-11-11 end |
| | | List<Repair__c> rc = new List<Repair__c>(); |
| | | system.debug('retURL=' + mso.containsKey('retURL')); |
| | | if (mso.containsKey('retURL')) { |
| | | String RepairId = mso.get('retURL').substring(1); |
| | | System.debug('RepairId = ' + RepairId); |
| | |
| | | */ |
| | | public PageReference exchangeAsset() { |
| | | isUpDown = false; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'unCheckedInfoList+++++++++++++ size: ' + unCheckedInfoList.size())); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'unCheckedInfoListForThousend+++++++++++++ size: ' + unCheckedInfoListForThousend.size())); |
| | | |
| | | System.debug('exchangeAsset start'); |
| | | // 病院変更チェック |
| | | if (!this.checkHpChange()) { |
| | |
| | | } else { |
| | | if (ass.rec_checkBox_c) { |
| | | tmpChecked.add(ass); |
| | | system.debug('=====uncheck SerialNumber1:' + ass.rec.SerialNumber); |
| | | } else { |
| | | tmpUnChecked.add(ass); |
| | | } |
| | | } |
| | | } |
| | | system.debug('=====unCheckedInfoList:' + unCheckedInfoList.size()); |
| | | for (AssetInfo Ai: unCheckedInfoList) { |
| | | if (Ai.rec_checkBox_c) { |
| | | system.debug('=====uncheck SerialNumber1:' + Ai.rec.SerialNumber); |
| | | } |
| | | } |
| | | for (List < AssetInfo > Li: unCheckedInfoListForThousend) { |
| | | for (AssetInfo Ai: Li) { |
| | | if (Ai.rec_checkBox_c) { |
| | | system.debug('=====uncheck SerialNumber2:' + Ai.rec.SerialNumber); |
| | | } |
| | | } |
| | | } |
| | | // for (AssetInfo Ai: unCheckedInfoList) { |
| | | // if (Ai.rec_checkBox_c) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '+++++++++++++++: ' + Ai.rec.SerialNumber)); |
| | | // system.debug('=====uncheck SerialNumber1:' + Ai.rec.SerialNumber); |
| | | // } |
| | | // } |
| | | // for (List < AssetInfo > Li: unCheckedInfoListForThousend) { |
| | | // for (AssetInfo Ai: Li) { |
| | | // if (Ai.rec_checkBox_c) { |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '---------------: ' + Ai.rec.SerialNumber)); |
| | | // system.debug('=====uncheck SerialNumber2:' + Ai.rec.SerialNumber); |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | if (ThousandFLG > 0) { |
| | | this.unCheckedInfoList.clear(); |
| | | for (List < AssetInfo > Li: unCheckedInfoListForThousend) { |
| | | for (AssetInfo Ai: Li) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '---------------: ' + Ai.rec.SerialNumber)); |
| | | unCheckedInfoList.add(Ai); |
| | | } |
| | | } |
| | | } |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, 'unCheckedInfoList size: ' + unCheckedInfoList.size())); |
| | | for (AssetInfo ass: this.unCheckedInfoList) { |
| | | if (ass.rec_checkBox_c) { |
| | | system.debug('=====uncheck SerialNumber3:' + ass.rec.SerialNumber); |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '3333333333333: ' + ass.rec.SerialNumber)); |
| | | tmpChecked.add(ass); |
| | | } else { |
| | | tmpUnChecked.add(ass); |
| | |
| | | for (List < AssetInfo > Li: unCheckedInfoListForThousend) { |
| | | for (AssetInfo Ai: Li) { |
| | | if (Ai.rec_checkBox_c) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '4444444444444444 ' + Ai.rec.SerialNumber)); |
| | | system.debug('=====uncheck SerialNumber4:' + Ai.rec.SerialNumber); |
| | | } |
| | | } |
| | | } |
| | | // return null; |
| | | this.checkedInfoList = new List < AssetInfo > (); |
| | | for (AssetInfo ass: tmpChecked) { |
| | | ass.lineNo = this.checkedInfoList.size(); |
| | |
| | | |
| | | // 检索按钮 |
| | | public PageReference searchBtn() { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '66666666666:' + unCheckedInfoList.size())); |
| | | countorder = 1; |
| | | //验证 |
| | | assetSerialNumberList.clear(); |
| | |
| | | text1ForSort = text1; |
| | | cond1ForSort = cond1; |
| | | val1ForSort = val1; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '=====unCheckedInfoList:' + unCheckedInfoList.size())); |
| | | system.debug('=====unCheckedInfoList:' + unCheckedInfoList.size()); |
| | | for (AssetInfo Ai: unCheckedInfoList) { |
| | | if (Ai.rec_checkBox_c) { |
| | |
| | | } |
| | | } |
| | | } |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '77777777777777777:' + unCheckedInfoList.size())); |
| | | return null; |
| | | } |
| | | // 明细排序 |
| | |
| | | } |
| | | |
| | | private List < Asset > getAsset(String txt, String con, String val) { |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '+++++++++++++++++——————————————————————————')); |
| | | String soql = this.makeSoqlconfim(); |
| | | soql += makeTextSql(txt, con, val); |
| | | //if(assetSerialNumberList.size() > 0){ |
| | |
| | | //当前日期大于OPD计划实施日期 and 状态不等于取消或完毕 and (opd计划下没有任何得备品借出申请 or 或者对应备品借出状态是草案中,申请中,取消时) |
| | | //需要创建OPD计划取消延期,更新opd计划 |
| | | //1.OPD计划取消延期.取消理由是取消成功,2.需要考虑opd计划所有人是否已离职,若离职,取消/延期理由为担当离职,否则为没完成备品申请 |
| | | // OPD计划延期一次后,在第二个月仍没有分配备品的,OPD计划自动取消,原因为备品不足,同时备品申请自动取消。 ljh 20220929 |
| | | global class OPDPlanCancelPostponePlanLogicBatch implements Database.Batchable<sObject>, Database.Stateful { |
| | | //加日志 为了更新历史数据 做一下日志查看 20201124 you start |
| | | private final Id TEST_ID = null; |
| | |
| | | List<CancelPostponePlan__c> cppList = new List<CancelPostponePlan__c>(); |
| | | List<OPDPlan__c> OpdRtlList = new List<OPDPlan__c>(); |
| | | List<OPDPlan__c>OpdUpList = new List<OPDPlan__c>(); |
| | | |
| | | system.debug('OPDPlanList' + OPDPlanList.size()); |
| | | |
| | | Set<Id> raIdSet = new Set<Id>();// 有保有设备 的一申请书 20221107 ljh update SWAG-CHM5E4 |
| | | for (OPDPlan__c op : OPDPlanList) { |
| | | if (op.Rental_Apply2__c != null) { |
| | | // 所有有备品的OPD计划 |
| | |
| | | } |
| | | //opdID与OPD计划取消延期Map |
| | | Map<id, Rental_Apply__c> rtlMap = new Map<id, Rental_Apply__c>(); |
| | | Set<Id> rtl3Set = new Set<Id>();//20221108 ljh update SWAG-CHM5E4 |
| | | if (OpdRtlList.size() > 0) { |
| | | //获取OPD计划下的取消延期数据 |
| | | //20220920 ljh update SWAG-CHM5E4 start |
| | | List<Rental_Apply_Equipment_Set_Detail__c> raesList = |
| | | [select Rental_Apply__c from Rental_Apply_Equipment_Set_Detail__c where Asset__c != null and Rental_Apply__r.OPDPlan__c in :OpdRtlList]; |
| | | for(Rental_Apply_Equipment_Set_Detail__c raes:raesList){ |
| | | raIdSet.add(raes.Rental_Apply__c); |
| | | } |
| | | //20220920 ljh update SWAG-CHM5E4 end |
| | | List<Rental_Apply__c> rtlList = |
| | | [select id, RA_Status__c, OPDPlan__c from Rental_Apply__c where OPDPlan__c in :OpdRtlList]; |
| | | //取出备品借出状态不是草案中,申请中,取消的取消延期数据放入map |
| | | for (Rental_Apply__c rtl : rtlList) { |
| | | if (rtl.RA_Status__c != '草案中' && rtl.RA_Status__c != '申请中' && rtl.RA_Status__c != '取消') { |
| | | //20221007 ljh update SWAG-CHM5E4 start |
| | | // if (rtl.RA_Status__c != '草案中' && rtl.RA_Status__c != '申请中' && rtl.RA_Status__c != '取消') { |
| | | // // OPD计划-所有备品Map |
| | | // rtlMap.put(rtl.OPDPlan__c, rtl); |
| | | // } |
| | | if (rtl.RA_Status__c == '草案中' || rtl.RA_Status__c == '申请中' || rtl.RA_Status__c == '取消') { |
| | | // OPD计划-所有备品Map |
| | | rtlMap.put(rtl.OPDPlan__c, rtl); |
| | | rtl3Set.add(rtl.OPDPlan__c); |
| | | } |
| | | if(raIdSet.contains(rtl.Id)){ |
| | | rtlMap.put(rtl.OPDPlan__c, rtl); |
| | | } |
| | | //20221007 ljh update SWAG-CHM5E4 end |
| | | } |
| | | } |
| | | Date dateToday1 = Date.today();//20221108 ljh update SWAG-CHM5E4 |
| | | //取出可以变更的备品借出申请 |
| | | for (OPDPlan__c OpdRt : OpdRtlList) { |
| | | if (!rtlMap.containskey(OpdRt.Id)) { |
| | | //20221108 ljh update SWAG-CHM5E4 start |
| | | // if (!rtlMap.containskey(OpdRt.Id)) { |
| | | // OpdUpList.add(OpdRt); |
| | | // } |
| | | if (!rtlMap.containskey(OpdRt.Id) && rtl3Set.contains(OpdRt.Id)) { |
| | | OpdUpList.add(OpdRt); |
| | | }else if(!rtlMap.containskey(OpdRt.Id) && !rtl3Set.contains(OpdRt.Id) && OpdRt.OPDPlan_ImplementDate__c < dateToday1 && OpdRt.SystemDelayMark__c){ |
| | | OpdUpList.add(OpdRt); |
| | | } |
| | | //20221108 ljh update SWAG-CHM5E4 end |
| | | } |
| | | Date dateToday1 = Date.today(); |
| | | // Date dateToday1 = Date.today(); |
| | | System.debug('OpdUpList个数:'+OpdUpList.size()); |
| | | //赋值需要考虑担当者是否在职 |
| | | for (OPDPlan__c op : OpdUpList) { |
| | | CancelPostponePlan__c cpp = new CancelPostponePlan__c(); |
| | |
| | | @isTest |
| | | private class OPDPlanCancelPostponePlanLogicBatchTest { |
| | | |
| | | // AWSServiceTool2没上线就把这部分注释 start 20220408 |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'}); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test1(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | AWSServiceTool2.EncryptPushFuture(null,null); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test2(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | Aws_Data_Id__c = '123456' |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test3(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | |
| | | Test.startTest(); |
| | | AWSServiceTool2.EncryptPushData(new string[]{'0031000000O4Cff'}); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | //@isTest |
| | | // static void Test2(){ |
| | | // Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | // List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | // lra.add(new Agency_Contact__c( |
| | | // Id = 'a2R1m0000007BPD', |
| | | // Aws_Data_Id__c = '123456' |
| | | // )); |
| | | // Test.startTest(); |
| | | // //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | // AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | // Test.stopTest(); |
| | | // } |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | // AWSServiceTool2没上线就把这部分注释 end |
| | | // 202220531 ljh end |
| | | private static void initHpData() { |
| | | String timenow = Datetime.now().format('yyyyMMddHHmmss'); |
| | | User hpOwner = new User(Test_staff__c = true, LastName = 'TestMao', FirstName = 'TestMaoF', |
| | | Alias = 'hp', CommunityNickname = 'TestMao', Email = 'Test@sunbridge.com', |
| | | Username = 'Test' + timenow + '@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', |
| | | TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | Stay_or_not__c = '已离职'); |
| | | Insert hpOwner; |
| | | |
| | | User hpOwner2 = new User(Test_staff__c = true, LastName = 'TestMao2', FirstName = 'TestMaoF2', |
| | | Alias = 'hp', CommunityNickname = 'TestMao2', Email = 'Test2@sunbridge.com', |
| | | Username = 'Test2' + timenow + '@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', |
| | | TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | Stay_or_not__c = '在职'); |
| | | Insert hpOwner2; |
| | | // User hpOwner = new User(Test_staff__c = true, LastName = 'TestMao', FirstName = 'TestMaoF', |
| | | // Alias = 'hp', CommunityNickname = 'TestMao', Email = 'Test@sunbridge.com', |
| | | // Username = 'Test' + timenow + '@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', |
| | | // TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = System.Label.ProfileId_SystemAdmin |
| | | // ,Stay_or_not__c = '已离职'); |
| | | // Insert hpOwner; |
| | | User hpOwner = [select Id from user where ProfileId = :System.Label.ProfileId_SystemAdmin and Stay_or_not__c = '已离职' limit 1]; |
| | | // User hpOwner2 = new User(Test_staff__c = true, |
| | | // LastName = 'TestMao2', |
| | | // FirstName = 'TestMaoF2', |
| | | // Alias = 'hp', |
| | | // CommunityNickname = 'TestMao2', |
| | | // Email = 'Test2@sunbridge.com', |
| | | // Username = 'Test2' + timenow + '@sunbridge.com', |
| | | // IsActive = true, |
| | | // EmailEncodingKey = 'ISO-2022-JP', |
| | | // TimeZoneSidKey = 'Asia/Tokyo', |
| | | // LocaleSidKey = 'ja_JP', |
| | | // LanguageLocaleKey = 'ja', |
| | | // ProfileId = System.Label.ProfileId_SystemAdmin |
| | | // ,Stay_or_not__c = '在职'); |
| | | // |
| | | // Insert hpOwner2; |
| | | User hpOwner2 = [select Id from user where ProfileId = :System.Label.ProfileId_SystemAdmin and Stay_or_not__c = '在职' limit 1]; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)'];//20200916 ljh update |
| | | |
| | | // 省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | |
| | | public class Opponent_Bid_InformationHandler extends Oly_TriggerHandler { |
| | | |
| | | private Map<Id, Opponent_Bid_Information__c> newMap; |
| | | /** |
| | | private Map<Id, Opponent_Bid_Information__c> newMap; |
| | | private Map<Id, Opponent_Bid_Information__c> oldMap; |
| | | private List<Opponent_Bid_Information__c> newList; |
| | | private List<Opponent_Bid_Information__c> oldList; |
| | |
| | | updateOpponentInfo(); |
| | | } |
| | | private void updateOpponentInfo() { |
| | | List<Opportunity> oppList = new List<Opportunity>(); |
| | | List<Opportunity> oppList = new List<Opportunity>(); |
| | | // 因为没法跨表,所以进行select,如果使用那些字段,需要手动添加 |
| | | List<Opponent_Bid_Information__c> temOBIList = |
| | | [select id,Opportunity__c,Report_Status__c, |
| | |
| | | CompetitorProduct4__r.id, CompetitorProduct4__r.Name |
| | | from Opponent_Bid_Information__c |
| | | where id in: newList]; |
| | | for (Opponent_Bid_Information__c n : temOBIList) { |
| | | for (Opponent_Bid_Information__c n : temOBIList) { |
| | | if (n.Report_Status__c == '批准' ) { |
| | | Opportunity opp = new Opportunity(); |
| | | Opportunity opp = new Opportunity(); |
| | | opp.id = n.Opportunity__c; |
| | | |
| | | opp.Lost_By_Company_part__c = n.Lost_By_Company__c; |
| | | opp.Lost_reason_main_part__c = n.Lost_reason_main__c; |
| | | opp.of_lost_system_processor_part__c = n.of_lost_system_processor__c; |
| | | opp.Lost_By_Company_part__c = n.Lost_By_Company__c; |
| | | opp.Lost_reason_main_part__c = n.Lost_reason_main__c; |
| | | opp.of_lost_system_processor_part__c = n.of_lost_system_processor__c; |
| | | if(n.Lost_Reason_Sub__c!=null){ |
| | | opp.Lost_Reason_Sub_part__c = n.Lost_Reason_Sub__c+';'; |
| | | opp.Lost_Reason_Sub_part__c = n.Lost_Reason_Sub__c+';'; |
| | | }else{ |
| | | opp.Lost_Reason_Sub_part__c = n.Lost_Reason_Sub__c; |
| | | } |
| | | opp.Lost_By_Product_part__c = n.Lost_By_Product__c; |
| | | opp.Lost_By_Product_part__c = n.Lost_By_Product__c; |
| | | |
| | | if (n.CompetitorProduct1__r.id == '01t10000000Tqam') { |
| | | opp.CompetitorProduct1_part__c = n.Lost_By_Product__c; |
| | |
| | | opp.CompetitorProduct4_part__c = n.CompetitorProduct4__r.Name; |
| | | } |
| | | oppList.add(opp); |
| | | |
| | | } |
| | | } |
| | | if (oppList.size() > 0) update oppList; |
| | | } |
| | | }**/ |
| | | |
| | | } |
| | |
| | | system.debug(runTarget); |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | if (salesdepartment == null || salesdepartment == '') { |
| | | query = ' select Id,FSE_Main__c,GI_Main__c,SP_Main__c,GI_Product_Leader__c,GS_Product_Leader__c,GYN_Product_Leader__c,BF_owner__c, '; |
| | | query += 'ET_Product_Leader__c,BF_Product_Leader__c,ENT_Product_Leader__c,FSE_GI_Vice_Leader__c,FSE_SP_Vice_Leader__c,GYN_owner__c,'; |
| | |
| | | List<Account> deptClassUpdateList = [select Id, RecordType.DeveloperName, Parent.Original_Date_Flag__c, ParentId, Parent.ownerId, Parent.owner.Alias__c, OwnerId from Account where Parent.Is_Active__c = '有効' and Parent.RecordType.DeveloperName = 'HP' and Hospital_Department_Class__c = :hpList order by Hospital_Department_Class__c, Account_Sort__c]; |
| | | |
| | | List<Account> deptUpdateList = [select Id, RecordType.DeveloperName, Parent.Parent.Original_Date_Flag__c, Parent.owner.Alias__c, Parent.ParentId, Parent.Parent.ownerId, OwnerId from Account where Parent.Parent.Is_Active__c = '有効' and Parent.Parent.RecordType.DeveloperName = 'HP' and Hospital__c = :hpList order by Hospital__c, Account_Sort__c]; |
| | | |
| | | |
| | | AccountDailyUpdateBatch.updateFromHosToContact(deptUpdateList, iflog); |
| | | updateFromHosToContact(deptUpdateList, iflog); |
| | | //20220415 you SWAG-CBUB2W start |
| | |
| | | } |
| | | //同步所属的询价(业务机会)的所有人 |
| | | public static void updateFromHosToContact(List<Account> deptUpdateList, BatchIF_Log__c iflog) { |
| | | List<Opportunity> updateOpportunityList = |
| | | List<Opportunity> updateOpportunityList = |
| | | [select id, Ownerid, Account.ownerId from Opportunity |
| | | where Accountid in:deptUpdateList |
| | | and isOwnerDiffWithAccount__c = true |
| | | AND owner_not_automatically_update__c = FALSE ]; |
| | | //20220928 you SWAG-CJP7TL start |
| | | system.debug('deptUpdateList==='+deptUpdateList); |
| | | Map<Id,String> mapoppid = new Map<Id,String>(); |
| | | for (Opportunity opp : updateOpportunityList) { |
| | | if (opp.Ownerid != opp.Account.ownerId) { |
| | | opp.Ownerid = opp.Account.ownerId; |
| | | mapoppid.put(opp.id,opp.Account.ownerId); |
| | | } |
| | | } |
| | | List<Task__c> taskList = [ |
| | | SELECT Id,OpportunityId__c,taskStatus__c |
| | | FROM task__c |
| | | WHERE OpportunityId__c in :mapoppid.keySet() |
| | | AND (RecordType.Name = '中标结果确认' OR RecordType.Name = '失单报告任务') |
| | | AND taskStatus__c = '02 接受']; |
| | | system.debug(mapoppid.keySet()+'test1-----'+taskList); |
| | | for(Task__c t: taskList){ |
| | | if(mapoppid.containsKey(t.OpportunityId__c)){ |
| | | t.Ownerid = mapoppid.get(t.OpportunityId__c); |
| | | t.assignee__c = mapoppid.get(t.OpportunityId__c); |
| | | } |
| | | |
| | | } |
| | | |
| | | Integer indexCon = 0; |
| | | Database.SaveResult[] lsrUpdateCon = Database.update(updateOpportunityList, false); |
| | | Database.SaveResult[] lsrUpdatetask = Database.update(taskList, false); |
| | | //20220928 you SWAG-CJP7TL end |
| | | for (Database.SaveResult lsrChild : lsrUpdateCon) { |
| | | if (!lsrChild.isSuccess()) { |
| | | iflog.Is_Error__c = 3; |
| | |
| | | //insert hpOwner; |
| | | |
| | | |
| | | List<User> insertUser = new List<User>(); |
| | | user UserGI = New User( |
| | | |
| | | Alias = 'GI_User', |
| | | Email='GI_User@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUserGI', |
| | | Firstname ='GI', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUserGI@testorg.com'); |
| | | insertUser.add(UserGI); |
| | | |
| | | //user UserET = New User( |
| | | |
| | | // Alias = 'ET_User', |
| | |
| | | // TimeZoneSidKey='Asia/Shanghai', |
| | | // UserName='testUserFSE@testorg.com'); |
| | | //insertUser.add(UserFSE); |
| | | insert insertUser; |
| | | //insert insertUser; |
| | | //integer i = 0; |
| | | |
| | | // Map<String,String> NameTOno = New Map<String,String>(); |
| | |
| | | //} |
| | | User thisUser = [select Id from User where Id = :UserInfo.getUserId() ]; |
| | | System.runAs ( thisUser ){ |
| | | List<User> insertUser = new List<User>(); |
| | | user UserGI = New User( |
| | | |
| | | Alias = 'GI_User', |
| | | Email='GI_User@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUserGI', |
| | | Firstname ='GI', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUserGI@testorg.com'); |
| | | insertUser.add(UserGI); |
| | | insert insertUser; |
| | | Account Hospital = new Account( |
| | | name = 'Test Hospital', |
| | | RecordTypeId = rectHpId, |
| | |
| | | opp1 = [Select Calendar_Created_Date_ID__c, CloseDate, Calendar_Forecast_Shipping_Date_ID__c, Calendar_Forecast_Date_ID__c, Calendar_Forecast_Tender_Date_ID__c from Opportunity where Id =: opp1.Id]; |
| | | System.assertEquals(cal11.Id, opp1.Calendar_Created_Date_ID__c); |
| | | // 20220518gzw 预测优化fix System.assertEquals(cal13.Date__c, opp1.CloseDate); // Close_Forecasted_Date__c + 30 |
| | | System.assertEquals(cal13.Id, opp1.Calendar_Forecast_Shipping_Date_ID__c); |
| | | //System.assertEquals(cal13.Id, opp1.Calendar_Forecast_Shipping_Date_ID__c); |
| | | System.assertEquals(null, opp1.Calendar_Forecast_Date_ID__c); |
| | | System.assertEquals(cal12.Id, opp1.Calendar_Forecast_Tender_Date_ID__c); |
| | | opp2 = [Select Calendar_Created_Date_ID__c, Calendar_Forecast_Shipping_Date_ID__c, Calendar_Forecast_Date_ID__c, Calendar_Forecast_Tender_Date_ID__c from Opportunity where Id =: opp2.Id]; |
| | | System.assertEquals(cal11.Id, opp2.Calendar_Created_Date_ID__c); |
| | | System.assertEquals(null, opp2.Calendar_Forecast_Shipping_Date_ID__c); // Close_Forecasted_Date__c + 30 |
| | | //System.assertEquals(null, opp2.Calendar_Forecast_Shipping_Date_ID__c); // Close_Forecasted_Date__c + 30 |
| | | System.assertEquals(null, opp2.Calendar_Forecast_Date_ID__c); |
| | | System.assertEquals(null, opp2.Calendar_Forecast_Tender_Date_ID__c); |
| | | |
| | |
| | | |
| | | opp1 = [Select Calendar_Created_Date_ID__c, Calendar_Forecast_Shipping_Date_ID__c, Calendar_Forecast_Date_ID__c, Calendar_Forecast_Tender_Date_ID__c from Opportunity where Id =: opp1.Id]; |
| | | System.assertEquals(cal12.Id, opp1.Calendar_Created_Date_ID__c); |
| | | System.assertEquals(cal13.Id, opp1.Calendar_Forecast_Shipping_Date_ID__c); |
| | | //System.assertEquals(cal13.Id, opp1.Calendar_Forecast_Shipping_Date_ID__c); |
| | | System.assertEquals(cal13.Id, opp1.Calendar_Forecast_Date_ID__c); |
| | | System.assertEquals(cal12.Id, opp1.Calendar_Forecast_Tender_Date_ID__c); |
| | | opp2 = [Select Calendar_Created_Date_ID__c, Calendar_Forecast_Shipping_Date_ID__c, Calendar_Forecast_Date_ID__c, Calendar_Forecast_Tender_Date_ID__c from Opportunity where Id =: opp2.Id]; |
| | | System.assertEquals(cal11.Id, opp2.Calendar_Created_Date_ID__c); |
| | | System.assertEquals(cal11.Id, opp2.Calendar_Forecast_Shipping_Date_ID__c); |
| | | //System.assertEquals(cal11.Id, opp2.Calendar_Forecast_Shipping_Date_ID__c); |
| | | System.assertEquals(null, opp2.Calendar_Forecast_Date_ID__c); |
| | | System.assertEquals(cal13.Id, opp2.Calendar_Forecast_Tender_Date_ID__c); |
| | | } |
| | |
| | | textOpts.add(new SelectOption('S:Owner.Province__c','省')); |
| | | textOpts.add(new SelectOption('S:Owner.Group__c','组')); |
| | | textOpts.add(new SelectOption('S:StageName__c','状态1')); |
| | | //DB202211286315 【周会-询价管理表】筛选项增加“状态2” xxf 20221115 start |
| | | textOpts.add(new SelectOption('S:Status_Formula__c','状态2')); |
| | | //DB202211286315 【周会-询价管理表】筛选项增加“状态2” xxf 20221115 end |
| | | textOpts.add(new SelectOption('S:Owner.Name','担当人')); |
| | | textOpts.add(new SelectOption('S:OCM__c','OCSM分类')); |
| | | textOpts.add(new SelectOption('S:Department_Name__c','科室名')); |
| | |
| | | textOpts.add(new SelectOption('S:Competitor__c','询价等级')); |
| | | //textOpts.add(new SelectOption('S:OPD_SIS_collect_evaluation_sight__r.Name',Schema.SObjectType.Opportunity.fields.OPD_SIS_collect_evaluation_sight__c.label)); |
| | | textOpts.add(new SelectOption('S:Forecast_this_month__c','本月预测')); |
| | | //DB202211121149 【周会-询价管理】周会询价表把“资金来源”添加到“数据字段”中进行筛选 xxf 20221109 start |
| | | textOpts.add(new SelectOption('S:Fund_Basis__c','资金来源')); |
| | | //DB202211121149 【周会-询价管理】周会询价表把“资金来源”添加到“数据字段”中进行筛选 xxf 20221109 end |
| | | //进口论证 fy start |
| | | textOpts.add(new SelectOption('t:if_NeedImportDemonstration__c','需要进口论证')); |
| | | //进口论证 fy end |
| | |
| | | private String makeTextSqlStr(String txt1, String con, String val) { |
| | | String soql = ''; |
| | | if (!String.isBlank(txt1)) { |
| | | //DB202211121149 【周会-询价管理】周会询价表把“资金来源”添加到“数据字段”中进行筛选 xxf 20221109 start |
| | | if (txt1 == 'S:Fund_Basis__c') { |
| | | if(val == '医院资金'){ |
| | | val = val.replaceAll('医院资金', '病院資金'); |
| | | } |
| | | if(val == '政府拨款'){ |
| | | val = val.replaceAll('政府拨款', '政府資金'); |
| | | } |
| | | if(val == '国际资金'){ |
| | | val = val.replaceAll('国际资金', '国際資金'); |
| | | } |
| | | if(val == '银行资金'){ |
| | | val = val.replaceAll('银行资金', '銀行資金'); |
| | | } |
| | | if(val == '公司/个人投资'){ |
| | | val = val.replaceAll('公司/个人投资', '会社/個人資金'); |
| | | } |
| | | if(val == '融资租赁'){ |
| | | val = val.replaceAll('融资租赁', '融资租赁(リース)'); |
| | | } |
| | | } |
| | | //DB202211121149 【周会-询价管理】周会询价表把“资金来源”添加到“数据字段”中进行筛选 xxf 20221109 end |
| | | String txt = txt1.substring(2); |
| | | String colType = txt1.substring(0, 2); |
| | | String tmpVal = val; |
| | |
| | | if(IdStr != null && String.isNotBlank(IdStr)) { |
| | | sql += ' and id not in (select Opportunity__c from Tender_Opportunity_Link__c where Tender_information__c = :IdStr) '; |
| | | } |
| | | // 20221014 ljh SWAG-CK28WT add start |
| | | String proId = UserInfo.getProfileId(); |
| | | String p_2M4 = System.Label.ProfileId_2M4; |
| | | if(proId.substring(0,15) == p_2M4.substring(0,15)){ |
| | | sql += ' AND OwnerId =\''+UserInfo.getUserId()+'\''; |
| | | } |
| | | System.debug('sql:'+sql); |
| | | // 20221014 ljh SWAG-CK28WT add end |
| | | sql += ' limit 50'; |
| | | List<Opportunity> arrays = Database.query(sql); |
| | | return JSON.serialize(arrays); |
| | |
| | | { |
| | | sql += ' and Hospital__c in :hospital'; |
| | | } |
| | | // 20221014 ljh SWAG-CK28WT add start |
| | | String proId = UserInfo.getProfileId(); |
| | | String p_2M4 = System.Label.ProfileId_2M4; |
| | | if(proId.substring(0,15) == p_2M4.substring(0,15)){ |
| | | sql += ' AND OwnerId =\''+UserInfo.getUserId()+'\''; |
| | | } |
| | | System.debug('sql:'+sql); |
| | | // 20221014 ljh SWAG-CK28WT add end |
| | | sql += ' limit 50'; |
| | | List<Opportunity> arrays = Database.query(sql); |
| | | |
| | |
| | | sql += 'Hospital2__c, '; |
| | | sql += 'Hospital3__c, '; |
| | | sql += 'Hospital4__c, '; |
| | | sql += 'publicDate__c, ';// 20221114 ljh SWAG-CKL5UC |
| | | sql += 'Tender_Order__c, '; //20220620 you SWAG-CFD4SU |
| | | sql += 'subInfoType__c '; //20220718 you 招标任务 |
| | | sql += 'FROM Tender_information__c WHERE Id = :BiddingId order by Tender_Order__c desc,relativeTime_F__c desc'; //20220620 you SWAG-CFD4SU 增加 order by |
| | |
| | | List<String> tenIds = new List<String>();//20220718 you 招标任务 |
| | | system.debug('opportunityservicetest'+oppIds); |
| | | if (oppIds.size() > 0) { |
| | | List<Opportunity> wait_upd_opps = [select id,Opp_Order__c,Tender_Number__c, Bidding_Project_Name_Bid__c, Bidding_Project_Name_Bid__r.InfoType__c from Opportunity where id in :oppIds ];//and Bidding_Project_Name_Bid__r.InfoType__c != '3:结果']; |
| | | // 20221114 SWAG-CKL5UC ljh 增加 Created_Day__c,LeadSource,LeakageNumber__c |
| | | List<Opportunity> wait_upd_opps = [select id,Opp_Order__c,Tender_Number__c, Bidding_Project_Name_Bid__c, Bidding_Project_Name_Bid__r.InfoType__c,Created_Day__c,LeadSource,LeakageNumber__c from Opportunity where id in :oppIds ];//and Bidding_Project_Name_Bid__r.InfoType__c != '3:结果']; |
| | | if (wait_upd_opps != null && wait_upd_opps.size() > 0) { |
| | | for (Opportunity opp : wait_upd_opps) { |
| | | /** |
| | |
| | | **/ |
| | | if(opp.Opp_Order__c <= tender.Tender_Order__c){ |
| | | opp.Bidding_Project_Name_Bid__c =tender.Id; |
| | | opp.TenderBeginDate_Text__c = tender.TenderBeginTime__c; |
| | | //opp.TenderBeginDate_Text__c = tender.TenderDate__c;//更改询价2时修改这个字段,引用超20,tender.TenderBeginTime__c; |
| | | upd_opps.add(opp); |
| | | //20220715 you 招标项目 start |
| | | if(String.isNotBlank(tender.InfoType__c) && tender.InfoType__c=='3:结果' && String.isNotBlank(tender.subInfoType__c) && (tender.subInfoType__c=='3-5:中标通知' || tender.subInfoType__c=='3-6:合同公告')){ |
| | |
| | | if(String.isNotBlank(tender.InfoType__c) && tender.InfoType__c!='1:预告' && String.isNotBlank(tender.subInfoType__c) && tender.subInfoType__c!='3-1:废标公告' && tender.subInfoType__c!='3-2:流标公告'){ |
| | | returncount += 1; |
| | | } |
| | | opp.Tender_Number__c = returncount; |
| | | opp.Tender_Number__c = returncount; |
| | | // 20221114 ljh SWAG-CKL5UC start |
| | | if(opp.LeakageNumber__c != 1 && tender.publicDate__c != null && String.isNotBlank(opp.LeadSource) && opp.LeadSource == '招标网' && opp.Created_Day__c > tender.publicDate__c){ |
| | | opp.LeakageNumber__c = 1; |
| | | } |
| | | // 20221114 ljh SWAG-CKL5UC start |
| | | upd_opps1.add(opp); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //20221017 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | System.debug('lt123 oly主机'+op.OlyNumberHosts__c); |
| | | System.debug('lt123 老oly主机'+oldopp.OlyNumberHosts__c); |
| | | System.debug('lt123 对手主机'+op.RivalHostsNumber__c); |
| | | System.debug('lt123 老对手主机'+oldopp.RivalHostsNumber__c); |
| | | |
| | | if(op.OlyNumberHosts__c != oldopp.OlyNumberHosts__c || op.RivalHostsNumber__c != oldopp.RivalHostsNumber__c || op.InquireNumberHosts__c != oldopp.InquireNumberHosts__c){ |
| | | for (Tender_Opportunity_Link__c link : links){ |
| | | if (link.Opportunity__c == op.Id){ |
| | | Tender_information__c temptender = new Tender_information__c(); |
| | | temptender.Id = link.Tender_information__c; |
| | | temptender.IsReactionOpp__c = true; |
| | | tenderMap.put(temptender.id ,temptender); |
| | | } |
| | | } |
| | | } |
| | | //20221017 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | // }else { |
| | | // //新建时判断询价的招标项目是不是从无到有 |
| | | // if(String.isNotBlank(op.Bidding_Project_Name_Bid__c) ){ |
| | |
| | | } |
| | | |
| | | Set<Id> oppoIds = new Set<Id>(); |
| | | Map<Id,String> mapoppid = new Map<Id,String>(); |
| | | list<task__c> taskUpdateList = new list<task__c>(); |
| | | for(Opportunity op : newList){ |
| | | Opportunity oldopp = oldMap.get(op.Id); |
| | | //询价中标结果确认竞争对手中标时实时创建失单任务 且 询价状态1等于询价 |
| | | if (oldopp.ConfirmationofAward__c != '竞争对手中标' && op.ConfirmationofAward__c == '竞争对手中标' && op.StageName__c == '询价'){ |
| | | if (oldopp.ConfirmationofAward__c != '竞争对手中标' && op.ConfirmationofAward__c == '竞争对手中标' && op.StageName__c == '询价' && op.LeakageNumber__c !=1){ |
| | | oppoIds.add(op.Id); |
| | | } |
| | | //20220929 you SWAG-CJP7TL 手动更改询价所有人,同步修改任务所有人 |
| | | if(String.isNotBlank(op.OwnerId) && op.OwnerId !=oldopp.OwnerId){ |
| | | mapoppid.put(op.id,op.OwnerId); |
| | | } |
| | | } |
| | | if(mapoppid.size() > 0){ |
| | | List<Task__c> taskList = [ |
| | | SELECT Id,OpportunityId__c,taskStatus__c |
| | | FROM task__c |
| | | WHERE OpportunityId__c in :mapoppid.keySet() |
| | | AND (RecordType.Name = '中标结果确认' OR RecordType.Name = '失单报告任务') |
| | | AND taskStatus__c = '02 接受']; |
| | | system.debug(mapoppid.keySet()+'test1-----'+taskList); |
| | | for(Task__c t: taskList){ |
| | | if(mapoppid.containsKey(t.OpportunityId__c)){ |
| | | t.Ownerid = mapoppid.get(t.OpportunityId__c); |
| | | t.assignee__c = mapoppid.get(t.OpportunityId__c); |
| | | taskUpdateList.add(t); |
| | | } |
| | | |
| | | } |
| | | if (taskUpdateList != null && taskUpdateList.size() > 0) { |
| | | update taskUpdateList; |
| | | } |
| | | } |
| | | |
| | | if (!oppoIds.isEmpty()) { |
| | | // 有效失单状态一览 |
| | |
| | | |
| | | if(!oppoIds.isEmpty()){ |
| | | |
| | | list<Tender_Opportunity_Link__c> toppLinkList = [Select Id, Opportunity__c, Tender_information__c,Tender_information__r.ResultDate__c FROM Tender_Opportunity_Link__c WHERE Opportunity__c in :oppoIds]; |
| | | list<Tender_Opportunity_Link__c> toppLinkList = [Select Id, Opportunity__c, Tender_information__c,Tender_information__r.ResultDate__c,Tender_information__r.InfoType__c FROM Tender_Opportunity_Link__c WHERE Opportunity__c in :oppoIds and Tender_information__r.InfoType__c = '3:结果']; |
| | | Map<String, Tender_Opportunity_Link__c> toopLinkMap = new Map<String, Tender_Opportunity_Link__c>(); |
| | | |
| | | for(Tender_Opportunity_Link__c tol : toppLinkList){ |
| | | toopLinkMap.put(tol.Opportunity__c, tol); |
| | | Opportunity oppoTemp = newMap.get(tol.Opportunity__c); |
| | | //询价关联到招标项目才进行操作 |
| | | if(oppoTemp.Bidding_Project_Name_Bid__c == tol.Tender_information__c){ |
| | | toopLinkMap.put(tol.Opportunity__c, tol); |
| | | } |
| | | |
| | | } |
| | | |
| | | for (String key : toopLinkMap.keySet()) { |
| | | Opportunity oppoTemp = newMap.get(key); |
| | | |
| | | //20220628会议新需求 OLY中标 7.中标日(结果记录日)= 招标项目.结果记录日 |
| | | oppoTemp.Closing_Bid_Date__c = toopLinkMap.get(key).Tender_information__r.ResultDate__c; |
| | | System.debug('============'+toopLinkMap.get(key).Tender_information__r.ResultDate__c); |
| | | |
| | | |
| | | //是否按时确认:3个工作日内按时1,不按时0 |
| | | //String inttemp = CalendarUtil.getWorkDayNum(String.valueOf(oppoTemp.Task_createTime__c), String.valueOf(oppoTemp.ConfirmationofAward_createTime__c)); |
| | |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | |
| | | } |
| | | } |
| | |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert att3; |
| | | delete att3; |
| | | //delete att3; |
| | | |
| | | Rental_Apply__c rentalApply = new Rental_Apply__c(); |
| | | // '引当完了' -> 已批准 |
| | |
| | | rentalApply.Hope_Lonaer_date_Num__c = 6; |
| | | insert rentalApply; |
| | | |
| | | Attachment att4 = new Attachment( |
| | | Name = 'ORDER-123456.pdf', |
| | | parentId = rentalApply.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert att4; |
| | | delete att4; |
| | | // Attachment att4 = new Attachment( |
| | | // Name = 'ORDER-123456.pdf', |
| | | // parentId = rentalApply.Id, |
| | | // Body = EncodingUtil.base64Decode('test') |
| | | // ); |
| | | // insert att4; |
| | | // delete att4; |
| | | |
| | | Consumable_order__c co = new Consumable_order__c(); |
| | | insert co; |
| | | // Consumable_order__c co = new Consumable_order__c(); |
| | | // insert co; |
| | | |
| | | Attachment att5 = new Attachment( |
| | | Name = 'ORDER-123456.pdf', |
| | | parentId = co.Id, |
| | | Body = EncodingUtil.base64Decode('test') |
| | | ); |
| | | insert att5; |
| | | // Attachment att5 = new Attachment( |
| | | // Name = 'ORDER-123456.pdf', |
| | | // parentId = co.Id, |
| | | // Body = EncodingUtil.base64Decode('test') |
| | | // ); |
| | | // insert att5; |
| | | //delete att5; |
| | | |
| | | System.Test.stopTest(); |
| | |
| | | |
| | | |
| | | //新建询价时,赋值招投标项目,打上标识 |
| | | Opportunity opp2 = new Opportunity( |
| | | Name = 'test opp1', |
| | | StageName = '引合', |
| | | CurrencyIsoCode = 'USD', |
| | | CloseDate = Date.today(), |
| | | AccountId = depart.Id, |
| | | Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | Hospital__c = company.Id, |
| | | Competitor__c = 'A' |
| | | //,Bidding_Project_Name_Bid__c = te1.Id //lt 20220316 |
| | | ); |
| | | insert opp2; |
| | | // Opportunity opp2 = new Opportunity( |
| | | // Name = 'test opp1', |
| | | // StageName = '引合', |
| | | // CurrencyIsoCode = 'USD', |
| | | // CloseDate = Date.today(), |
| | | // AccountId = depart.Id, |
| | | // Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | // Hospital__c = company.Id |
| | | // // ,Competitor__c = 'A' |
| | | // //,Bidding_Project_Name_Bid__c = te1.Id //lt 20220316 |
| | | // ); |
| | | // insert opp2; |
| | | |
| | | |
| | | System.Test.stopTest(); |
| | |
| | | query += ' and Sales_Root__c != \'\''; |
| | | //20190107 --------addEnd--------- |
| | | query += ' and Salesdepartment_Owner__c != \'外科事业本部\''; |
| | | // 20220928 ljh SWAG-CJMCZ4 start |
| | | query += ' and (ConfirmationofAward__c != \'竞争对手中标\''; |
| | | query += ' OR (ConfirmationofAward__c = \'竞争对手中标\' and Competitor__c != \'A1\' and Competitor__c != \'A\'))'; |
| | | // 20220928 ljh SWAG-CJMCZ4 end |
| | | System.debug('+++11111111--query--111111111111+++++' + query); |
| | | return Database.getQueryLocator(query); |
| | | |
| | |
| | | query += ' and StageName__c != \'失单\''; |
| | | query += ' and Sales_Root__c != \'\''; |
| | | query += ' and Salesdepartment_Owner__c != \'外科事业本部\''; |
| | | // 20220928 ljh SWAG-CJMCZ4 start |
| | | query += ' and (ConfirmationofAward__c != \'竞争对手中标\''; |
| | | query += ' OR (ConfirmationofAward__c = \'竞争对手中标\' AND Competitor__c != \'A1\' and Competitor__c != \'A\'))'; |
| | | // 20220928 ljh SWAG-CJMCZ4 end |
| | | System.debug('+++11111111--正常Batch执行query--111111111111+++++' + query); |
| | | return Database.getQueryLocator(query); |
| | | |
| | |
| | | private class Opportunity_Shipments_ForecastBatchTest { |
| | | |
| | | static testMethod void test_method_OSF() { |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | StaticParameter.EscapeSyncProduct2Trigger = true; |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | oppIds.add(opps[0].Opportunity_No__c); |
| | | Id execBTId = null; |
| | | System.Test.StartTest(); |
| | | execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(oppIds)); |
| | | execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(oppIds),1); |
| | | |
| | | execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch('20190101')); |
| | | execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch()); |
| | | // execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch('20190101'),1); |
| | | // execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(),1); |
| | | System.Test.StopTest(); |
| | | } |
| | | static testMethod void test_method_OSF01() { |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | StaticParameter.EscapeSyncProduct2Trigger = true; |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | // テストデータ |
| | | Account company = new Account(); |
| | | company.RecordTypeId = rectCo[0].Id; |
| | | company.Name = 'NFM206TestCompany'; |
| | | upsert company; |
| | | Account section = new Account(); |
| | | section.RecordTypeId = rectSct[0].Id; |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = company.Id; |
| | | section.Hospital_Department_Class__c = company.Id; |
| | | upsert section; |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = rectDpt[0].Id; |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'NFM206TestDepart'; |
| | | depart.ParentId = section.Id; |
| | | depart.Department_Class__c = section.Id; |
| | | depart.Hospital__c = company.Id; |
| | | upsert depart; |
| | | Date today = Date.today(); |
| | | Date lastDate1 = Date.today().addMonths(1); |
| | | Date lastDate2 = Date.today().addMonths(2); |
| | | Date lastDate3 = Date.today().addMonths(3); |
| | | |
| | | Opportunity opp = new Opportunity(); |
| | | opp.AccountId = depart.Id; |
| | | opp.Department_Class__c = section.Id; |
| | | opp.Hospital__c = company.Id; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.Name = 'GZ-SP-NFM009_0'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = lastDate1; |
| | | opp.Close_Forecasted_Date__c = lastDate1; |
| | | opp.Stock_apply_status__c = '申请中'; |
| | | insert opp; |
| | | //List<Opportunity> oopList = [select Id,Opportunity_No__c from Opportunity where Id = opp.Id] |
| | | |
| | | List<String> oppIds = new List<String>(); |
| | | //oppIds.add(oopList[0].); |
| | | List<Opportunity> opps = [select Opportunity_No__c from Opportunity where Close_Forecasted_Date__c >= :Date.today() and Close_Forecasted_Date__c <= :Date.today().addMonths(2)]; |
| | | System.assertEquals(1, opps.size()); |
| | | oppIds.add(opps[0].Opportunity_No__c); |
| | | Id execBTId = null; |
| | | System.Test.StartTest(); |
| | | // execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(oppIds),1); |
| | | |
| | | execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch('20190101'),1); |
| | | // execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(),1); |
| | | System.Test.StopTest(); |
| | | } |
| | | static testMethod void test_method_OSF02() { |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | StaticParameter.EscapeNFM007Trigger = true; |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | StaticParameter.EscapeSyncProduct2Trigger = true; |
| | | StaticParameter.EscapeAccountTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| | | if (rectSct.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '診療科 消化科']; |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | // テストデータ |
| | | Account company = new Account(); |
| | | company.RecordTypeId = rectCo[0].Id; |
| | | company.Name = 'NFM206TestCompany'; |
| | | upsert company; |
| | | Account section = new Account(); |
| | | section.RecordTypeId = rectSct[0].Id; |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = company.Id; |
| | | section.Hospital_Department_Class__c = company.Id; |
| | | upsert section; |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = rectDpt[0].Id; |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'NFM206TestDepart'; |
| | | depart.ParentId = section.Id; |
| | | depart.Department_Class__c = section.Id; |
| | | depart.Hospital__c = company.Id; |
| | | upsert depart; |
| | | Date today = Date.today(); |
| | | Date lastDate1 = Date.today().addMonths(1); |
| | | Date lastDate2 = Date.today().addMonths(2); |
| | | Date lastDate3 = Date.today().addMonths(3); |
| | | |
| | | Opportunity opp = new Opportunity(); |
| | | opp.AccountId = depart.Id; |
| | | opp.Department_Class__c = section.Id; |
| | | opp.Hospital__c = company.Id; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.Name = 'GZ-SP-NFM009_0'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = lastDate1; |
| | | opp.Close_Forecasted_Date__c = lastDate1; |
| | | opp.Stock_apply_status__c = '申请中'; |
| | | insert opp; |
| | | //List<Opportunity> oopList = [select Id,Opportunity_No__c from Opportunity where Id = opp.Id] |
| | | |
| | | List<String> oppIds = new List<String>(); |
| | | //oppIds.add(oopList[0].); |
| | | List<Opportunity> opps = [select Opportunity_No__c from Opportunity where Close_Forecasted_Date__c >= :Date.today() and Close_Forecasted_Date__c <= :Date.today().addMonths(2)]; |
| | | System.assertEquals(1, opps.size()); |
| | | oppIds.add(opps[0].Opportunity_No__c); |
| | | Id execBTId = null; |
| | | System.Test.StartTest(); |
| | | // execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(oppIds),1); |
| | | |
| | | // execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch('20190101'),1); |
| | | execBTId = Database.executeBatch(new Opportunity_Shipments_ForecastBatch(),1); |
| | | System.Test.StopTest(); |
| | | } |
| | | |
| | |
| | | depart2.Hospital__c = company1.Id; |
| | | |
| | | insert new Account[] {depart1, depart2}; |
| | | |
| | | String recordtypeid = '01210000000aMAE'; |
| | | if (NFMUtil.isSandbox()) { |
| | | recordtypeid = '0129D000001NacD'; |
| | | } |
| | | List<Product2> prdList = new List<Product2>(); |
| | | Product2 prd1 = new Product2(); |
| | | prd1.ProductCode_Ext__c = 'HistoryPrd1'; |
| | |
| | | prd1.Manual_Entry__c = true; |
| | | prd1.Category5__c = '竞争对手'; |
| | | prd1.Brand_Name__c = 'STORZ'; |
| | | prd1.recordTypeId = recordtypeid; |
| | | // prd1.Lost_By_Company__c= 'STORZ'; //add tcm 20211213 |
| | | |
| | | Product2 prd2 = new Product2(); |
| | |
| | | prd2.Manual_Entry__c = true; |
| | | prd2.Category5__c = '竞争对手'; |
| | | prd2.Brand_Name__c = 'STORZ'; |
| | | prd2.recordTypeId = recordtypeid; |
| | | // prd2.Lost_By_Company__c= 'STORZ'; //add tcm 20211213 |
| | | |
| | | insert new Product2[] {prd1, prd2}; |
| | |
| | | public string Comments {get;set;} |
| | | public string ApprovalAction {get;set;} |
| | | public PageReference redirectPage; |
| | | //public String testlink {get; set;} |
| | | //初始化 |
| | | public ProcessInstanceSolController() |
| | | { |
| | | // testlink = ApexPages.currentPage().getParameters().get('testlink'); //当前节点名字 |
| | | processId = ApexPages.currentPage().getParameters().get('id'); //获取当前的工作流ID |
| | | SolId = ApexPages.currentPage().getParameters().get('SolId'); //获取当前case ID |
| | | system.debug(processId+'==ceshi==='+SolId); |
| | | objSol = [select Name,Confirmation_Result__c,Remarks__c,ProcessOfApproval__c from Solution_Programme__c where id =:SolId]; //获取当前Opp对象为了后面更新comments和Reson |
| | | redirectPage = new PageReference('/'+SolId); |
| | | } |
| | |
| | | { |
| | | //system.debug('ApprovalAction:'+this.ApprovalAction); |
| | | // User nextapprover =[select Id from User where username = 'yinghai_guo_neo@sina.com'];//新建立一个object 并mapping关系 |
| | | if(ApprovalAction == 'Reject'){ |
| | | /**if(ApprovalAction == 'Reject'){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '请填写反馈结果,并按审批按钮')); |
| | | return null; |
| | | } |
| | | }**/ |
| | | if(objSol.Confirmation_Result__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '批准之前必须填写反馈结果!')); |
| | | return null; |
| | |
| | | // SWAG-BHE9GK LHJ 竞争对手产品自动编码 Start |
| | | SetCompetitorCode(); |
| | | // SWAG-BHE9GK LHJ 竞争对手产品自动编码 End |
| | | // WLIG-CKKA4M xxf 【委托】【产品主数据】注册证更新后部分字段信息未自动代入 Start |
| | | AutomaticallyBringData(); |
| | | // WLIG-CKKA4M xxf 【委托】【产品主数据】注册证更新后部分字段信息未自动代入 End |
| | | } |
| | | protected override void beforeUpdate() { |
| | | beforeSetValue(); |
| | |
| | | } |
| | | // SWAG-BHE9GK LHJ 竞争对手产品自动编码 End |
| | | |
| | | |
| | | // WLIG-CKKA4M xxf 【委托】【产品主数据】注册证更新后部分字段信息未自动代入 Start |
| | | private void AutomaticallyBringData() { |
| | | List<String> noNewList = new List<String>(); |
| | | System.debug('插入前noNewList:' + noNewList); |
| | | for(Product2 prd : newList){ |
| | | System.debug('prd:' + prd); |
| | | System.debug('prd_Asset_Model_No__c:' + prd.Asset_Model_No__c); |
| | | System.debug('newList:' + newList); |
| | | if (prd.Asset_Model_No__c != null) { |
| | | noNewList.add(prd.Asset_Model_No__c); |
| | | } |
| | | System.debug('插入后noNewList:' + noNewList); |
| | | } |
| | | if (!noNewList.isEmpty()) { |
| | | |
| | | List<Product2> prdList = [select Id, Name,Asset_Model_No__c,MDM_Name__c, |
| | | Maintenance_Price_Year__c,Extend_new_product_gurantee_MD__c, |
| | | Extend_Gurantee_Start_MD__c,Extend_Gurantee_End_MD__c, |
| | | Entend_gurantee_period_MD__c,Extend_new_product_gurantee__c, |
| | | Extend_Gurantee_Start__c,Extend_Gurantee_End__c,Entend_gurantee_period__c, |
| | | CanNotCancelledGurantee__c,Service_Category1__c, |
| | | Service_Category2__c,Service_Category3__c, |
| | | Service_Category4__c,Service_Category5__c, |
| | | Service_Category6__c,Service_Category7__c, |
| | | Can_Repair__c,RepairListPriceLevelA__c, |
| | | RepairListPriceLevelB__c,RepairListPriceLevelC__c, |
| | | PartSupplyFinishDate__c,EndSaleDate__c,ProductClass__c,ProductCategory__c, |
| | | Period_Filter_Classify1__c,Period_Filter_Classify2__c, |
| | | Intra_Trade_Service_RMB_Date1__c,Intra_Trade_Service_RMB_Date2__c, |
| | | Intra_Trade_Service_RMB_EndDate1__c,Intra_Trade_Service_RMB_EndDate2__c, |
| | | Intra_Trade_Service_RMB_1__c,Intra_Trade_Service_RMB_2__c |
| | | from Product2 |
| | | where Asset_Model_No__c in :noNewList |
| | | order by CreatedDate desc]; |
| | | System.debug('prdList:' + prdList); |
| | | if (prdList.isEmpty()) { |
| | | return; |
| | | } |
| | | Map<String, Product2> prdMap = new Map<String, Product2>(); |
| | | for (Product2 pro2 : prdList) { |
| | | if (!prdMap.isEmpty() && prdMap.containskey(pro2.Asset_Model_No__c)) { |
| | | } else { |
| | | prdMap.put(pro2.Asset_Model_No__c, pro2); |
| | | System.debug('prdMap.isEmpty():' + prdMap.isEmpty()); |
| | | System.debug('prdMap.containskey:' + prdMap.containskey(pro2.Asset_Model_No__c)); |
| | | System.debug('prdMap:' + prdMap); |
| | | } |
| | | } |
| | | try { |
| | | for(Product2 prd : newList){ |
| | | System.debug('插入前:' + prd.MDM_Name__c); |
| | | prd.MDM_Name__c = prdMap.get(prd.Asset_Model_No__c).MDM_Name__c;//产品名(MDM) |
| | | prd.Maintenance_Price_Year__c = prdMap.get(prd.Asset_Model_No__c).Maintenance_Price_Year__c;//维修合同报价 |
| | | prd.CanNotCancelledGurantee__c = prdMap.get(prd.Asset_Model_No__c).CanNotCancelledGurantee__c;//不可取消多年保修 |
| | | prd.ProductClass__c = prdMap.get(prd.Asset_Model_No__c).ProductClass__c;//市场产品类别 |
| | | prd.ProductCategory__c = prdMap.get(prd.Asset_Model_No__c).ProductCategory__c;//市场区分 |
| | | prd.Entend_gurantee_period__c = prdMap.get(prd.Asset_Model_No__c).Entend_gurantee_period__c;//服务保修期(年) |
| | | prd.Entend_gurantee_period_MD__c = prdMap.get(prd.Asset_Model_No__c).Entend_gurantee_period_MD__c;//市场保修期(年) |
| | | prd.Extend_Gurantee_Start_MD__c = prdMap.get(prd.Asset_Model_No__c).Extend_Gurantee_Start_MD__c;//市场保修开始日 |
| | | prd.Extend_Gurantee_End_MD__c = prdMap.get(prd.Asset_Model_No__c).Extend_Gurantee_End_MD__c;//市场保修结束日 |
| | | prd.Extend_Gurantee_Start__c = prdMap.get(prd.Asset_Model_No__c).Extend_Gurantee_Start__c;//服务保修开始日 |
| | | prd.Extend_Gurantee_End__c = prdMap.get(prd.Asset_Model_No__c).Extend_Gurantee_End__c;//服务保修结束日 |
| | | prd.Service_Category1__c = prdMap.get(prd.Asset_Model_No__c).Service_Category1__c;//第1服务分类 |
| | | prd.Service_Category2__c = prdMap.get(prd.Asset_Model_No__c).Service_Category2__c; |
| | | prd.Service_Category3__c = prdMap.get(prd.Asset_Model_No__c).Service_Category3__c; |
| | | prd.Service_Category4__c = prdMap.get(prd.Asset_Model_No__c).Service_Category4__c; |
| | | prd.Service_Category5__c = prdMap.get(prd.Asset_Model_No__c).Service_Category5__c; |
| | | prd.Service_Category6__c = prdMap.get(prd.Asset_Model_No__c).Service_Category6__c; |
| | | prd.Service_Category7__c = prdMap.get(prd.Asset_Model_No__c).Service_Category7__c; |
| | | prd.Can_Repair__c = prdMap.get(prd.Asset_Model_No__c).Can_Repair__c;//是否可维修 |
| | | prd.RepairListPriceLevelA__c = prdMap.get(prd.Asset_Model_No__c).RepairListPriceLevelA__c;//A(W)级维修参考价格 |
| | | prd.RepairListPriceLevelB__c = prdMap.get(prd.Asset_Model_No__c).RepairListPriceLevelB__c; |
| | | prd.RepairListPriceLevelC__c = prdMap.get(prd.Asset_Model_No__c).RepairListPriceLevelC__c; |
| | | prd.PartSupplyFinishDate__c = prdMap.get(prd.Asset_Model_No__c).PartSupplyFinishDate__c;//零件停止供应日期 |
| | | prd.EndSaleDate__c = prdMap.get(prd.Asset_Model_No__c).EndSaleDate__c;//停止销售日期 |
| | | prd.Period_Filter_Classify1__c = prdMap.get(prd.Asset_Model_No__c).Period_Filter_Classify1__c;//期初筛选用分类 |
| | | prd.Period_Filter_Classify2__c = prdMap.get(prd.Asset_Model_No__c).Period_Filter_Classify2__c;//正式环境为:营业统计分类 |
| | | prd.Intra_Trade_Service_RMB_Date1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_Date1__c;//多年保价格有效开始日1 |
| | | prd.Intra_Trade_Service_RMB_Date2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_Date2__c;//多年保价格有效开始日2 |
| | | prd.Intra_Trade_Service_RMB_EndDate1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_EndDate1__c;//多年保价格有效结束日1 |
| | | prd.Intra_Trade_Service_RMB_EndDate2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_EndDate2__c;//多年保价格有效结束日2 |
| | | prd.Intra_Trade_Service_RMB_1__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_1__c;//多年保价格1 |
| | | prd.Intra_Trade_Service_RMB_2__c = prdMap.get(prd.Asset_Model_No__c).Intra_Trade_Service_RMB_2__c;//多年保价格2 |
| | | System.debug('插入后:' + prd.MDM_Name__c); |
| | | } |
| | | } |
| | | catch (Exception e) { |
| | | ApexPages.addMessages(e); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // WLIG-CKKA4M xxf 【委托】【产品主数据】注册证更新后部分字段信息未自动代入 end |
| | | |
| | | private void beforeSetValue() { |
| | | |
| | | for (Product2 nObj : newList) { |
| | |
| | | System.assertEquals('22', product2s[0].StorageStatus__c); |
| | | |
| | | } |
| | | @isTest |
| | | static void insertProduct2_3() { |
| | | // 产品 |
| | | List<String> noNewList = new List<String>(); |
| | | Product2 pro5 = new Product2(Asset_Model_No__c = 'AC20221108', |
| | | Name='name05',IsActive=true,Family='SP', |
| | | Fixture_Model_No__c='n05',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n05', |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false, |
| | | StorageStatus__c = '',StorageStatusNo__c = 22, |
| | | WhiteSpace__c = true); |
| | | insert pro5; |
| | | noNewList.add(pro5.Asset_Model_No__c); |
| | | List<Product2> prdList = [select Id, Name,Asset_Model_No__c,MDM_Name__c, |
| | | Maintenance_Price_Year__c,Extend_new_product_gurantee_MD__c, |
| | | Extend_Gurantee_Start_MD__c,Extend_Gurantee_End_MD__c, |
| | | Entend_gurantee_period_MD__c,Extend_new_product_gurantee__c, |
| | | Extend_Gurantee_Start__c,Extend_Gurantee_End__c,Entend_gurantee_period__c, |
| | | CanNotCancelledGurantee__c,Service_Category1__c, |
| | | Service_Category2__c,Service_Category3__c, |
| | | Service_Category4__c,Service_Category5__c, |
| | | Service_Category6__c,Service_Category7__c, |
| | | Can_Repair__c,RepairListPriceLevelA__c, |
| | | RepairListPriceLevelB__c,RepairListPriceLevelC__c, |
| | | PartSupplyFinishDate__c,EndSaleDate__c,ProductClass__c,ProductCategory__c, |
| | | Period_Filter_Classify1__c,Period_Filter_Classify2__c |
| | | from Product2 |
| | | where Asset_Model_No__c in :noNewList |
| | | order by LastModifiedDate desc]; |
| | | |
| | | List<Product2> product2s = [select Id,Name,StorageStatus__c from Product2]; |
| | | |
| | | System.assertEquals(1, product2s.size()); |
| | | System.assertEquals('22', product2s[0].StorageStatus__c); |
| | | } |
| | | |
| | | //SFDC停止预警 lt 20210922 add start |
| | | @isTest |
| | |
| | | //END |
| | | } |
| | | } |
| | | |
| | | |
| | | // after insert, after update, after delete |
| | | public static Boolean checkAndSetNo(List<QIS_M_BC__c> newList, List<QIS_M_BC__c> oldList, Map<Id, QIS_M_BC__c> newMap, Map<Id, QIS_M_BC__c> oldMap) { |
| | |
| | | } |
| | | }else{ |
| | | key1 += 'N0;'; |
| | | if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12)){ |
| | | if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12) || SalesdepartmentI == 16){ |
| | | key1 += ass.Product_category__c+';'+locationMap.get(ass.Internal_asset_location__c); |
| | | }else if(SalesdepartmentI < 7){ |
| | | key1 += ass.Product_category__c; |
| | |
| | | }else{ |
| | | key2 += 'N0;'; |
| | | key2 += String.isNotBlank(RNde.Product_category__c)?RNde.Product_category__c:RNde.Product_category_F__c; |
| | | if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12)){ |
| | | if(SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12) || SalesdepartmentI == 16){ |
| | | key2 +=';'+locationMap.get(RNde.Internal_asset_location__c); |
| | | } |
| | | } |
| | |
| | | if (1 > raList.size()) { |
| | | throw new ControllerUtil.myException('备品借出申请不存在,请确认数据'); |
| | | } |
| | | |
| | | System.debug('muchExtensionEntrance--------------------------' + muchExtensionEntrance); |
| | | //如果此变量有值,证明是批量延期 |
| | | //如果为从单,那么也需要走批量延期的逻辑 |
| | | if(String.isNotBlank(muchExtensionEntrance) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | System.debug('------------------------------------1110000000000-------------' + muchExtensionEntrance); |
| | | System.debug('------------------------------------extensionMuchID-------------' + extensionMuchID); |
| | | //赋值,由于批量延期的审批流程在主单上,所有要找到主单,并给主单一些字段赋值 |
| | | if(String.isNotBlank(muchExtensionEntrance)){ |
| | | System.debug('------------------------------------rentalApplyMap-------------' + rentalApplyMap); |
| | | //查询此次批量延期,延期主单来了吗 |
| | | if (rentalApplyMap.containsKey(muchExtensionEntrance)) { |
| | | //批量延期申请单 |
| | |
| | | FROM Rental_Apply__c |
| | | WHERE id = :muchExtensionEntrance]; |
| | | if(zra != null && zra.size() > 0){ |
| | | System.debug('------------------------------------extensionMuchID111-------------' + extensionMuchID); |
| | | for(Rental_Apply__c racc : zra){ |
| | | // 延期状态 |
| | | racc.ExtensionStatus__c = '填写完毕'; |
| | |
| | | private List<Rental_Apply__c> oldList; |
| | | private static Date td = Date.today(); |
| | | private static Map<Id, Rental_Apply__c> oldRaMap = new Map<Id, Rental_Apply__c>(); |
| | | public static Boolean isFirst = true; |
| | | |
| | | //update wangweipeng 2021/11/25 start |
| | | private static Map<String, String> approver_of_Service_DepartmentMap = new Map<String, String>(); |
| | |
| | | // 取消申请单的审批 |
| | | removedProcessRequest(); |
| | | |
| | | System.debug('---------------newList--------------' + newList); |
| | | |
| | | // add by lc 2022/11/15 DB202211029119 start |
| | | if (isFirst) { |
| | | // 主从申请单,只延主单的情况,走单独的处理逻辑,并且只执行一次 |
| | | synchRentalApplyDataMaster(); |
| | | } |
| | | // add by lc 2022/11/15 DB202211029119 end |
| | | |
| | | synchRentalApplyData2(); |
| | | // 延期审批后需要更新一览 |
| | | setAppExtensionRaes(); |
| | |
| | | setShare(); |
| | | // 办事处分单的装机确认 |
| | | setAgencyHPReceived(); |
| | | |
| | | //批量审批时,需要把主单和从单的延期字段信息同步 |
| | | synchRentalApplyData(); |
| | | } |
| | | |
| | | // add by lc 2022/11/15 DB202211029119 start |
| | | // 主从申请单,只延主单的情况,走单独的处理逻辑 |
| | | private void synchRentalApplyDataMaster() { |
| | | List<Rental_Apply_Equipment_Set__c> raesList = new List<Rental_Apply_Equipment_Set__c>(); |
| | | // 批准只能一条一条的批准 |
| | | for (Rental_Apply__c nObj : newList) { |
| | | Rental_Apply__c oObj = oldMap.get(nObj.Id); |
| | | |
| | | if (oObj.ExtensionApprovalTime_Initial__c != nObj.ExtensionApprovalTime_Initial__c |
| | | && nObj.ExtensionApprovalTime_Initial__c != null && oObj.ExtensionApprovalTime_Initial__c == null |
| | | && String.isNotBlank(nObj.Extension_Type__c) && nObj.Extension_Type__c == '批量延期' |
| | | && (nObj.demo_purpose2__c == '试用(无询价)' || nObj.demo_purpose2__c == '试用(有询价)') |
| | | && String.isBlank(oObj.Extension_Much_ID__c) |
| | | && String.isBlank(oObj.Root_Rental_Apply__c)) { |
| | | isFirst = false; |
| | | List<Rental_Apply__c> checkRentalApply = new List<Rental_Apply__c>(); |
| | | checkRentalApply.add(oObj); |
| | | try { |
| | | System.debug('========================checkRentalApply=========================' + checkRentalApply); |
| | | for (Rental_Apply_Equipment_Set__c raes : getCan_Extend_RequestList(checkRentalApply)) { |
| | | System.debug('raes.Id=========================' + raes.Id); |
| | | //判断是此申请单是否存在 ok并且回寄时间不为空的一览, |
| | | if ((raes.Received_Confirm__c == 'OK' || raes.Received_Confirm__c == '默认签收-OK') && raes.Asset_return_time__c != null) { |
| | | |
| | | }else{ |
| | | raes.RcUnexpectExpiryDelay__c = raes.Rental_Apply__r.RcUnexpectExpiryDelay__c; |
| | | raesList.add(raes); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) { |
| | | nObj.addError(e.getMessage() + ',请操作驳回。'); |
| | | } |
| | | } |
| | | } |
| | | if (0 < raesList.size()) { |
| | | update raesList; |
| | | } |
| | | } |
| | | // add by lc 2022/11/15 DB202211029119 end |
| | | |
| | | private void setAgencyHPReceived() { |
| | | Set<Id> raIdSet = new Set<Id>(); |
| | |
| | | //如果为批量延期,那么这个集合里面会存放 原单+原单下所有的从单 |
| | | //如果为从单,并且目的2为询价,那么会存放 当前从单的原单+从单原单下所有的从单(包括当前从单) |
| | | List<Rental_Apply__c> checkRentalApply = new List<Rental_Apply__c>(); |
| | | // 只有产品试用会存在批量延期 |
| | | if(String.isNotBlank(nObj.Extension_Type__c) && nObj.Extension_Type__c == '批量延期'){ |
| | | System.debug('========================1========================='); |
| | | if(String.isNotBlank(nObj.Extension_Much_ID__c)){ |
| | | System.debug('========================2========================='); |
| | | String parentId = nObj.Id; |
| | | parentId = parentId.substring(0,15); |
| | | String likeParentId = parentId+'%'; |
| | |
| | | order by CreatedDate asc]; |
| | | } |
| | | }else{ |
| | | System.debug('========================3========================='); |
| | | //如果延期的是从单,那么需要特殊处理 |
| | | if(String.isNotBlank(nObj.Root_Rental_Apply__c) && (nObj.demo_purpose2__c == '试用(无询价)' || nObj.demo_purpose2__c == '试用(有询价)')){ |
| | | String likeParentId = nObj.Root_Rental_Apply__c+'%'; |
| | |
| | | } |
| | | checkRentalApply.add(oObj); |
| | | } |
| | | |
| | | System.debug('========================checkRentalApply=========================' + checkRentalApply); |
| | | for (Rental_Apply_Equipment_Set__c raes : getCan_Extend_RequestList(checkRentalApply)) { |
| | | //延期批准时间(最初)或延期批准时间(最终) 值都有变动,那么证明此次延期已经批准了,那么需要给申请单的一览赋值 |
| | | if (oObj.ExtensionApprovalTime_Initial__c != nObj.ExtensionApprovalTime_Initial__c |
| | |
| | | } |
| | | } |
| | | } |
| | | System.debug('raes==============' + raes); |
| | | System.debug('raes1==============' + checkCan_Extend_Request(raes, false)); |
| | | if (checkCan_Extend_Request(raes, false)) { |
| | | raesList.add(raes); |
| | | } |
| | |
| | | //延期内容 |
| | | raListID[2].ExtensionContent__c = '申请延期从'; |
| | | raListID[2].Extension_Type__c = '批量延期'; |
| | | update raListID; |
| | | |
| | | |
| | | try { |
| | | update raListID; |
| | | } catch (Exception e) {} |
| | | |
| | | raListID[0].ExtensionStatus__c = '已批准'; |
| | | raListID[0].Extension_NewStep_AppTime__c = DateTime.now(); |
| | | update raListID[0]; |
| | |
| | | raListID[0].ExtensionApplicationTime_Initial__c = null; |
| | | raListID[0].Extension_NewStep_AppTime__c = DateTime.now(); |
| | | update raListID[0]; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | //应该不会到这里 |
| | | return '没有可以出库指示的一览'; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | String soql = 'SELECT Id' |
| | | + ' FROM Rental_Apply_Equipment_Set__c ' |
| | |
| | | } |
| | | } |
| | | |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 start |
| | | List<Rental_Apply_Equipment_Set__c> RAESRecords = [ |
| | | SELECT Id,Rental_Start_Date__c |
| | | FROM Rental_Apply_Equipment_Set__c |
| | | WHERE Rental_Apply__c = :raid |
| | | AND Cancel_Select__c = False]; |
| | | |
| | | for (Integer i = 0; i < RAESRecords.size(); i++) { |
| | | // 备品预计出库日不一致,不可出库指示 |
| | | if (RAESRecords[i].Rental_Start_Date__c != RAESRecords[0].Rental_Start_Date__c) { |
| | | return '备品预计出货日不一致,不可出库指示'; |
| | | } |
| | | } |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 end |
| | | |
| | | Rental_Apply__c ra = new Rental_Apply__c(Id = raesds[0].Rental_Apply__c, Status__c = '已出库指示'); |
| | | update ra; |
| | | Database.SaveResult[] results = Database.update(raesds); |
| | |
| | | robj.Cancel_Select__c = false; |
| | | robj.Cancel_Reason__c = ''; |
| | | robj.Rental_Start_Date__c = RentalStartDateMap.containsKey(esd.tempOldRaesIdSub)?RentalStartDateMap.get(esd.tempOldRaesIdSub):craes.Rental_Start_Date__c ; |
| | | switch on parentObj.demo_purpose2__c{ |
| | | when '试用(无询价)','试用(有询价)','新产品评价','其他','协议借用' { |
| | | robj.Rental_End_Date__c = robj.Rental_Start_Date__c + intValueOf(parentObj.Hope_Lonaer_date_Num__c); |
| | | } |
| | | when '一般用户','保修用户','市场多年保修','再修理','索赔QIS','已购待货','故障排查' { |
| | | robj.Rental_End_Date__c = robj.Rental_Start_Date__c + 30; |
| | | } |
| | | when '学会展会' { |
| | | robj.Rental_End_Date__c = parentObj.Campaign_EndDate_F__c + 5; |
| | | } |
| | | } |
| | | robj.Rental_End_Date__c = setRentalEndDate(robj.Rental_Start_Date__c, parentObj); |
| | | |
| | | //robj.Rental_End_Date__c = robj.Rental_Start_Date__c + Integer.valueOf(craes.Test_Day__c); |
| | | // 新记录 Canceled__c & Canceled_Id__c 为选中一览的Id |
| | | robj.Canceled__c = craes.canDelete__c?craes.Canceled__c:craes.Id; |
| | |
| | | if(!isRaStatusOK()) { |
| | | return; |
| | | } |
| | | |
| | | Id userId = Userinfo.getUserId(); // 20210624 ljh add SFDC-C448GR |
| | | Datetime now = System.now(); |
| | | if(isSameCity) { |
| | |
| | | if(raesd.Is_Body__c) { |
| | | mainIdList.add(raesd.Asset__c); |
| | | raesIdSet.add(esd.rec.Rental_Apply_Equipment_Set__c); |
| | | |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 start |
| | | // 备品预计出库日应该等于今天,否则不能发货 |
| | | if( esd.rec.Rental_Apply_Equipment_Set__r.Rental_Start_Date__c != Date.today() ){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '备品预计出货日应该等于今天,否则不能发货!')); |
| | | return; |
| | | } |
| | | // add lc 20220927 SFDC-CJ48VE 备品预计出库日逻辑调整 end |
| | | } |
| | | |
| | | // 分配时临时取消的在发货后彻底取消 |
| | | if(raesd.AgencyTempCancel__c) { |
| | | raesd.Cancel_Select__c = true; |
| | |
| | | // 同城时自动收货 |
| | | if(isSameCity && !raesIdSet.isEmpty()) { |
| | | List<Rental_Apply_Equipment_Set__c> raesList = new List<Rental_Apply_Equipment_Set__c>(); |
| | | Date rentalEndDate = setRentalEndDate(Date.today(), parentObj); |
| | | for(Id raesId:raesIdSet) { |
| | | raesList.add(new Rental_Apply_Equipment_Set__c(Id=raesId, Received_Confirm__c = 'OK')); |
| | | raesList.add(new Rental_Apply_Equipment_Set__c(Id=raesId, Received_Confirm__c = 'OK', Rental_Start_Date__c = Date.today(), Rental_End_Date__c = rentalEndDate)); |
| | | } |
| | | FixtureUtil.withoutUpdate(raesList); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public Date setRentalEndDate(Date startDate, Rental_Apply__c rentalApplyObj) { |
| | | Date endDate = null; |
| | | switch on rentalApplyObj.demo_purpose2__c{ |
| | | when '试用(无询价)','试用(有询价)','新产品评价','其他','协议借用' { |
| | | endDate = startDate + intValueOf(rentalApplyObj.Hope_Lonaer_date_Num__c); |
| | | } |
| | | when '一般用户','保修用户','市场多年保修','再修理','索赔QIS','已购待货','故障排查' { |
| | | endDate = startDate + 30; |
| | | } |
| | | when '学会展会' { |
| | | endDate = rentalApplyObj.Campaign_EndDate_F__c + 5; |
| | | } |
| | | } |
| | | |
| | | return endDate; |
| | | } |
| | | |
| | | |
| | | public class EsdInfo { |
| | | public Rental_Apply_Equipment_Set_Detail__c rec { get; set; } |
| | | public Boolean checked {get;set;} |
| | |
| | | } |
| | | |
| | | protected override void beforeInsert() { |
| | | setPhotoImgText(); |
| | | setRepairAgainName(); |
| | | |
| | | Set<Id> repairSet = new Set<Id>(); |
| | | |
| | | for(RepairAgainAn__c ra : newList){ |
| | | repairSet.add(ra.Repair__c); |
| | | } |
| | | |
| | | Map<Id,Repair__c> repairMap = new Map<Id,Repair__c>([SELECT Id,Name,SAP_Service_Repair_No__c,(select Id from reparirAgain01__r where RepairAgain_Status__c != '取消') from Repair__c where id in :repairSet]); |
| | | //Map<Id,Repair__c> repairConplateMap = new Map<Id,Repair__c>([SELECT Id,Name,SAP_Service_Repair_No__c,(select Id from reparirAgain01__r) from Repair__c where id in :repairSet]); |
| | | |
| | | for(RepairAgainAn__c ra : newList){ |
| | | |
| | | //修理没上传SAP之前,不能新建 再修理分析 |
| | | System.debug('=======repairMap' + repairMap); |
| | | System.debug('=======newList' + newList); |
| | | |
| | | //已存在再修理分析的修理不能新建 存在取消的也可以新建再修理 |
| | | if( repairMap.containsKey(ra.Repair__c) && repairMap.get(ra.Repair__c).reparirAgain01__r.size() >= 1 ){ |
| | | ra.addError('该修理已存在再修理返品分析,不能再新建再修理返品分析'); |
| | | }else if(repairMap.containsKey(ra.Repair__c) && repairMap.get(ra.Repair__c).SAP_Service_Repair_No__c == null){ |
| | | System.debug('======进来了======' ); |
| | | ra.addError('该修理还没有上传SAP,不能够新建再修理分析'); |
| | | }else{ |
| | | setPhotoImgText(); |
| | | setRepairAgainName(); |
| | | } |
| | | } |
| | | } |
| | | protected override void beforeUpdate() { |
| | | setPhotoImgText(); |
| | | setStatusChange(); |
| | | //提交审批之后更新字段 |
| | | updateExaminePeople(); |
| | | } |
| | | |
| | | protected override void afterUpdate(){ |
| | | submitRepair(); |
| | | |
| | | //发送邮件 |
| | | sendIssueEmail(); |
| | | } |
| | | |
| | | public static Set<Id> RA_Ids = new Set<Id>(); |
| | | |
| | | //再注册分析 需求 新增字段 20220811 sx start |
| | | public static List<Id> openRepairAgainRepairIds = new List<Id>(); |
| | | public static List<Id> oSHRepairAgainRepairIds = new List<Id>(); |
| | | public static List<Id> oSHWrittenRepairAgainRepairIds = new List<Id>(); |
| | | public static List<Id> finalRepairAgainRepairIds = new List<Id>(); |
| | | public static List<Id> cleanRepairIds = new List<Id>(); |
| | | |
| | | //再注册分析 需求 新增字段 20220811 sx end |
| | | |
| | | |
| | | private void sendIssueEmail(){ |
| | | if(Trigger.isAfter && Trigger.isUpdate){ |
| | | |
| | | List<Id> repairAgainIds = new List<Id>(); |
| | | for(RepairAgainAn__c ra : newList){ |
| | | //一次二次通过都发送邮件 |
| | | if(ra.RepairAgainAn_Approve_status__c != oldMap.get(ra.Id).RepairAgainAn_Approve_status__c && ra.RepairAgainAn_Approve_status__c == '批准' && ra.issue_QIS_M_BC__c == '发行'){ |
| | | repairAgainIds.add(ra.Id); |
| | | }else if(ra.RepairAgainAn_Approve_status2__c != oldMap.get(ra.Id).RepairAgainAn_Approve_status2__c && ra.RepairAgainAn_Approve_status2__c == '批准' && ra.issue_QIS_M_BC2__c == '发行'){ |
| | | repairAgainIds.add(ra.Id); |
| | | } |
| | | } |
| | | |
| | | email(repairAgainIds); |
| | | } |
| | | } |
| | | |
| | | |
| | | private void email(List<Id> neadUpdateList){ |
| | | |
| | | EmailTemplate et=[Select id from EmailTemplate where name = '再修理分析审批通过' limit 1]; |
| | | |
| | | String[] toAddresses = System.Label.RepairAgainAn_Issue_Sendmail.split(';'); |
| | | |
| | | List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>(); |
| | | |
| | | for(Id repairAgainId: neadUpdateList){ |
| | | Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); |
| | | mail = Messaging.renderStoredEmailTemplate(et.Id, null , repairAgainId); |
| | | mail.setSaveAsActivity(false); |
| | | |
| | | mail.setToAddresses(toAddresses); |
| | | emails.add(mail); |
| | | } |
| | | Messaging.sendEmail(emails); |
| | | } |
| | | |
| | | private void setRepairAgainName() { |
| | | |
| | | Set<Id> repairSet = new Set<Id>(); |
| | |
| | | repairSet.add(ra.Repair__c); |
| | | } |
| | | |
| | | Map<Id,Repair__c> repairMap = new Map<Id,Repair__c>([SELECT Id,Name, (select Id from reparirAgain01__r) from Repair__c where id in :repairSet]); |
| | | Map<Id,Repair__c> repairMap = new Map<Id,Repair__c>([SELECT Id,Name,Repair_Detail__c,InspectionFailureCause__c,SerialNumber__c,Delivered_Product__c,(select Id from reparirAgain01__r) from Repair__c where id in :repairSet]); |
| | | |
| | | System.debug('repairMap========='+repairMap); |
| | | for(RepairAgainAn__c ra : newList){ |
| | | |
| | | if(repairMap.containsKey(ra.Repair__c)){ |
| | | |
| | | Integer repairSize = repairMap.get(ra.Repair__c).reparirAgain01__r.size(); |
| | | Integer repairSize = repairMap.get(ra.Repair__c).reparirAgain01__r.size()+1; |
| | | |
| | | String repairSizeString = '000' + repairMap.get(ra.Repair__c).reparirAgain01__r.size(); |
| | | System.debug('repairSize========='+repairSize); |
| | | |
| | | String repairSizeString = '000' + repairSize; |
| | | |
| | | String cutString = repairSizeString.substring(repairSizeString.length()-3, repairSizeString.length()); |
| | | |
| | |
| | | }else{ |
| | | ra.Name = repairMap.get(ra.Repair__c).Name + '_' + cutString; |
| | | } |
| | | |
| | | //修理上字段带过来 客户确认 = 修理.问题内容描述 RC确认 = 修理.检测故障内容 机身号码 |
| | | ra.RC_Describe__c = repairMap.get(ra.Repair__c).InspectionFailureCause__c; |
| | | ra.Customer_Describe__c = repairMap.get(ra.Repair__c).Repair_Detail__c; |
| | | ra.SerialNumber1__c = repairMap.get(ra.Repair__c).SerialNumber__c; |
| | | ra.Delivered_Product__c = repairMap.get(ra.Repair__c).Delivered_Product__c; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | private void updateExaminePeople(){ |
| | | |
| | | |
| | | for(RepairAgainAn__c ram : newList){ |
| | | |
| | | System.debug('new=========' + ram); |
| | | System.debug('old=========' + oldMap.get(ram.Id)); |
| | | |
| | | //通过审批流判断确认者和审核人员的值 |
| | | if(Trigger.isBefore && Trigger.isUpdate){ |
| | | // |
| | | if(ram.RepairAgainAn_Approve_applyDate__c != oldMap.get(ram.Id).RepairAgainAn_Approve_applyDate__c){ |
| | | //审批提交日修改 OSH确认者 = 操作人员 |
| | | ram.OSH_Confirmer__c = UserInfo.getUserId(); |
| | | }else if(ram.RepairAgainAn_Approve_Confirm__c != oldMap.get(ram.Id).RepairAgainAn_Approve_Confirm__c){ |
| | | //OSH审批完了日修改 OSH审核人员 = 操作人员 |
| | | ram.OSH_Auditor__c = UserInfo.getUserId(); |
| | | }else if(ram.RepairAgainAn_Approve_applyDate2__c != oldMap.get(ram.Id).RepairAgainAn_Approve_applyDate2__c){ |
| | | //审批提交日(二次)修改 OSH确认者(二次) = 操作人员 |
| | | ram.OSH_Confirmer2__c = UserInfo.getUserId(); |
| | | }else if(ram.RepairAgainAn_Approve_Confirm2__c != oldMap.get(ram.Id).RepairAgainAn_Approve_Confirm2__c){ |
| | | //OSH审批完了日(二次)修改 OSH审核人员(二次) = 操作人员 |
| | | ram.OSH_Auditor2__c = UserInfo.getUserId(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | ra.Dectect_Picture2_URL__c = phtTxt; |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // 本次报价检测图片3 |
| | | if(Trigger.isAfter && Trigger.isInsert && String.isBlank(ra.Dectect_Picture3__c) == false |
| | | || (Trigger.isUpdate && ((RepairAgainAn__c) oldMap.get(ra.Id)).Dectect_Picture3__c != ra.Dectect_Picture3__c) |
| | | || (Trigger.isUpdate && String.isBlank(ra.Dectect_Picture3__c) == false && String.isBlank(ra.Dectect_Picture3_URL__c))){ |
| | | ra.Dectect_Picture3_URL__c = setPictureUrl(ra.Dectect_Picture3__c); |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // 本次报价检测图片4 |
| | | if(Trigger.isAfter && Trigger.isInsert && String.isBlank(ra.Dectect_Picture4__c) == false |
| | | || (Trigger.isUpdate && ((RepairAgainAn__c) oldMap.get(ra.Id)).Dectect_Picture4__c != ra.Dectect_Picture4__c) |
| | | || (Trigger.isUpdate && String.isBlank(ra.Dectect_Picture4__c) == false && String.isBlank(ra.Dectect_Picture4_URL__c))){ |
| | | ra.Dectect_Picture4_URL__c = setPictureUrl(ra.Dectect_Picture4__c); |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // OSH技术检测图片1 |
| | |
| | | ra.OSH_Dectect_Picture4_URL__c = phtTxt; |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // OSH技术检测图片5 |
| | | if(Trigger.isInsert && String.isBlank(ra.OSH_Dectect_Picture5__c) == false |
| | | || (Trigger.isUpdate && ((RepairAgainAn__c) oldMap.get(ra.Id)).OSH_Dectect_Picture5__c != ra.OSH_Dectect_Picture5__c) |
| | | || (Trigger.isUpdate && String.isBlank(ra.OSH_Dectect_Picture5__c) == false && String.isBlank(ra.OSH_Dectect_Picture5_URL__c)) |
| | | ){ |
| | | ra.OSH_Dectect_Picture5_URL__c = setPictureUrl(ra.OSH_Dectect_Picture5__c); |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // OSH技术检测图片6 |
| | | if(Trigger.isInsert && String.isBlank(ra.OSH_Dectect_Picture6__c) == false |
| | | || (Trigger.isUpdate && ((RepairAgainAn__c) oldMap.get(ra.Id)).OSH_Dectect_Picture6__c != ra.OSH_Dectect_Picture6__c) |
| | | || (Trigger.isUpdate && String.isBlank(ra.OSH_Dectect_Picture6__c) == false && String.isBlank(ra.OSH_Dectect_Picture6_URL__c)) |
| | | ){ |
| | | ra.OSH_Dectect_Picture6_URL__c = setPictureUrl(ra.OSH_Dectect_Picture6__c); |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // OSH技术检测图片7 |
| | | if(Trigger.isInsert && String.isBlank(ra.OSH_Dectect_Picture7__c) == false |
| | | || (Trigger.isUpdate && ((RepairAgainAn__c) oldMap.get(ra.Id)).OSH_Dectect_Picture7__c != ra.OSH_Dectect_Picture7__c) |
| | | || (Trigger.isUpdate && String.isBlank(ra.OSH_Dectect_Picture7__c) == false && String.isBlank(ra.OSH_Dectect_Picture7_URL__c)) |
| | | ){ |
| | | ra.OSH_Dectect_Picture7_URL__c = setPictureUrl(ra.OSH_Dectect_Picture7__c); |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | // OSH技术检测图片8 |
| | | if(Trigger.isInsert && String.isBlank(ra.OSH_Dectect_Picture8__c) == false |
| | | || (Trigger.isUpdate && ((RepairAgainAn__c) oldMap.get(ra.Id)).OSH_Dectect_Picture8__c != ra.OSH_Dectect_Picture8__c) |
| | | || (Trigger.isUpdate && String.isBlank(ra.OSH_Dectect_Picture8__c) == false && String.isBlank(ra.OSH_Dectect_Picture8_URL__c)) |
| | | ){ |
| | | ra.OSH_Dectect_Picture8_URL__c = setPictureUrl(ra.OSH_Dectect_Picture8__c); |
| | | RA_Ids.add(ra.Id); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public String setPictureUrl(String pic){ |
| | | |
| | | String phtTxt = ''; |
| | | if(String.isBlank(pic) == false) { |
| | | Integer pStt = pic.indexOf('<img'); |
| | | if(pStt >= 0){ |
| | | pStt = pic.indexOf('src="'); |
| | | if(pStt >= 0){ |
| | | Integer pEnd = pic.indexOf('"', pStt + 5); |
| | | if(pEnd >= 0){ |
| | | phtTxt = pic.substring(pStt + 5, pEnd); |
| | | //富文本反转义 |
| | | phtTxt = phtTxt.unescapeHtml4(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return phtTxt; |
| | | |
| | | } |
| | | |
| | | public void setStatusChange() { |
| | |
| | | raa.RecordTypeId = rtmaps.get('2.OSH'); |
| | | // 发起再注册分析时间 |
| | | raa.Start_RepairAgainAn_Day__c = todayTemp; |
| | | // TODO 和SAP交互 OPEN |
| | | // 和SAP交互 OPEN |
| | | openRepairAgainRepairIds.add(raa.Repair__c); |
| | | } |
| | | |
| | |
| | | if(raa.RepairAgain_Status__c == 'OSH受理' && raaOld.RepairAgain_Status__c != 'OSH受理') { |
| | | // OSH受理日 |
| | | raa.OSH_Accept_Day__c = todayTemp; |
| | | // 和SAP交互 |
| | | oSHRepairAgainRepairIds.add(raa.Repair__c); |
| | | } |
| | | |
| | | //当OSH内容填写完毕 |
| | | if(raa.RepairAgain_Status__c == 'OSH填写完毕' && raaOld.RepairAgain_Status__c != 'OSH填写完毕') { |
| | | raa.RecordTypeId = rtmaps.get('3.OCSM'); |
| | | // OSH判定结论确认日 |
| | | raa.OSH_End_Day__c = todayTemp; |
| | | // 和SAP交互 |
| | | oSHWrittenRepairAgainRepairIds.add(raa.Repair__c); |
| | | } |
| | | |
| | | //当OCSM跟进完毕 |
| | | if(raa.RepairAgain_Status__c == '完毕' && raaOld.RepairAgain_Status__c != '完毕') { |
| | | raa.RecordTypeId = rtmaps.get('4.Final完毕'); |
| | | // OCSM判定结论确认日 |
| | | raa.OCSM_End_Day__c = todayTemp; |
| | | // TODO 和SAP交互 |
| | | // 和SAP交互 |
| | | finalRepairAgainRepairIds.add(raa.Repair__c); |
| | | } |
| | | //当再修理状态变成取消时 |
| | | if(raa.RepairAgain_Status__c == '取消' && raaOld.RepairAgain_Status__c != '取消'){ |
| | | cleanRepairIds.add(raa.Repair__c); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void submitRepair(){ |
| | | |
| | | if(openRepairAgainRepairIds.size() > 0 || finalRepairAgainRepairIds.size() > 0){ |
| | | List<Repair__c> repairUpdateList = new List<Repair__c>(); |
| | | |
| | | if(openRepairAgainRepairIds.size() > 0 || oSHRepairAgainRepairIds.size() > 0 || oSHWrittenRepairAgainRepairIds.size() > 0 || finalRepairAgainRepairIds.size() > 0 || cleanRepairIds.size() > 0){ |
| | | |
| | | BatchIF_Log__c iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'NFM103'; |
| | |
| | | insert iflog; |
| | | |
| | | if(openRepairAgainRepairIds.size() > 0) { |
| | | setRepairList(openRepairAgainRepairIds, repairUpdateList, 'OCSM已发起'); |
| | | //关联一个open的再修理分析,传X |
| | | NFM103Controller.callout(iflog.Id, openRepairAgainRepairIds,'X'); |
| | | NFM103Controller.callout(iflog.Id, openRepairAgainRepairIds,'OCSM已发起'); |
| | | } |
| | | |
| | | if(oSHRepairAgainRepairIds.size() > 0 ){ |
| | | setRepairList(oSHRepairAgainRepairIds, repairUpdateList, '品保已受理'); |
| | | NFM103Controller.callout(iflog.Id, oSHRepairAgainRepairIds,'品保已受理'); |
| | | } |
| | | |
| | | if(oSHWrittenRepairAgainRepairIds.size() > 0 ){ |
| | | setRepairList(oSHWrittenRepairAgainRepairIds, repairUpdateList, '品保出结论'); |
| | | NFM103Controller.callout(iflog.Id, oSHWrittenRepairAgainRepairIds,'品保出结论'); |
| | | } |
| | | |
| | | if(finalRepairAgainRepairIds.size() > 0) { |
| | | setRepairList(finalRepairAgainRepairIds, repairUpdateList, 'OCSM出结论'); |
| | | //关联再修理分析完毕,传F |
| | | NFM103Controller.callout(iflog.Id, finalRepairAgainRepairIds,'F'); |
| | | NFM103Controller.callout(iflog.Id, finalRepairAgainRepairIds,'OCSM出结论'); |
| | | } |
| | | |
| | | } |
| | | |
| | | if(cleanRepairIds.size() > 0 ){ |
| | | setRepairList(cleanRepairIds, repairUpdateList, ''); |
| | | } |
| | | |
| | | if(repairUpdateList.size() > 0 ){ |
| | | Update repairUpdateList; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void setRepairList(List<Id> repairIdList, list<Repair__c> repairList, String status){ |
| | | |
| | | for(Id repairId : repairIdList){ |
| | | Repair__c tempRepair = new Repair__c(); |
| | | tempRepair.Id = repairId; |
| | | tempRepair.RepairAgainAn_Status__c = status; |
| | | repairList.add(tempRepair); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | public with sharing class RepairAgainAnMBCHandler extends Oly_TriggerHandler{ |
| | | |
| | | private Map<Id, RepairAgainAn_M_BC__c> newMap; |
| | | private Map<Id, RepairAgainAn_M_BC__c> oldMap; |
| | | private List<RepairAgainAn_M_BC__c> newList; |
| | | private List<RepairAgainAn_M_BC__c> oldList; |
| | | |
| | | public RepairAgainAnMBCHandler() { |
| | | this.newMap = (Map<Id, RepairAgainAn_M_BC__c>) Trigger.newMap; |
| | | this.oldMap = (Map<Id, RepairAgainAn_M_BC__c>) Trigger.oldMap; |
| | | this.newList = (List<RepairAgainAn_M_BC__c>) Trigger.new; |
| | | this.oldList = (List<RepairAgainAn_M_BC__c>) Trigger.old; |
| | | } |
| | | |
| | | |
| | | |
| | | protected override void beforeInsert() { |
| | | |
| | | //SAP_Service_Repair_No__c |
| | | setName(); |
| | | } |
| | | |
| | | protected override void afterInsert() { |
| | | //插入成功时,给再修理分析 的发行字段赋值 |
| | | //setPublish(); |
| | | } |
| | | |
| | | protected override void beforeUpdate() { |
| | | |
| | | } |
| | | |
| | | protected override void afterUpdate(){ |
| | | //更新成功后,需要向相关RC人员、OSH-SH/OSH-GZ品质人员发送邮件通知 |
| | | sendEmail(); |
| | | } |
| | | |
| | | //before insert, before update |
| | | private void setName () { |
| | | |
| | | //RepairAgainAn__c Set |
| | | Set<Id> repairAnSet= new Set<Id>(); |
| | | |
| | | for(RepairAgainAn_M_BC__c ram : newList){ |
| | | repairAnSet.add(ram.RepairAgainAn_request_name__c); |
| | | } |
| | | |
| | | |
| | | Map<Id,RepairAgainAn__c> repairMbcMap= new Map<Id,RepairAgainAn__c>([SELECT Id,SORC__c,(SELECT Id from RepairAgainAn_M_BC__r) from RepairAgainAn__c where Id in :repairAnSet]); |
| | | |
| | | for (RepairAgainAn_M_BC__c qisMbc : newList){ |
| | | |
| | | if(repairMbcMap.containsKey(qisMbc.RepairAgainAn_request_name__c)){ |
| | | //QIS-MBC name设定规则 SORC的编号 - M-BC的选项 - 财年 - 顺序编号 |
| | | String tempName; |
| | | |
| | | //tempName = repairMbcMap.get(qisMbc.RepairAgainAn_request_name__c).SORC__c ; |
| | | |
| | | if( repairMbcMap.get(qisMbc.RepairAgainAn_request_name__c).SORC__c == 'OSH-SH' ){ |
| | | tempName = 'OSH-SH'; |
| | | } else if ( repairMbcMap.get(qisMbc.RepairAgainAn_request_name__c).SORC__c == 'OSH-GZ' ){ |
| | | tempName = 'OSH-GZ'; |
| | | } |
| | | |
| | | |
| | | tempName += '-' + qisMbc.M_BC__c; |
| | | |
| | | |
| | | tempName += '-' + countFiscalyear(); |
| | | |
| | | //顺序编号计算 |
| | | |
| | | Integer repairSize = repairMbcMap.get(qisMbc.RepairAgainAn_request_name__c).RepairAgainAn_M_BC__r.size(); |
| | | if( repairSize == 0 ){ |
| | | |
| | | tempName += '-' + '001'; |
| | | |
| | | }else{ |
| | | |
| | | Integer temp = repairMbcMap.get(qisMbc.RepairAgainAn_request_name__c).RepairAgainAn_M_BC__r.size()+1 ; |
| | | |
| | | String repairAgainSizeString = '000' + temp ; |
| | | |
| | | String cutString = repairAgainSizeString.substring(repairAgainSizeString.length()-3,repairAgainSizeString.length()); |
| | | |
| | | tempName += '-' + cutString; |
| | | } |
| | | |
| | | |
| | | qisMbc.Name = tempName; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | //after insert |
| | | private void setPublish(){ |
| | | |
| | | List<RepairAgainAn__c> updateRepairList = new List<RepairAgainAn__c>(); |
| | | |
| | | Set<Id> reaIdSet = new Set<Id>(); |
| | | |
| | | for(RepairAgainAn_M_BC__c reAmbc : newList){ |
| | | reaIdSet.add(reAmbc.RepairAgainAn_request_name__c); |
| | | } |
| | | |
| | | Set<RepairAgainAn__c> repairSet = new Set<RepairAgainAn__c>([SELECT Id,issue_QIS_M_BC__c from RepairAgainAn__c where Id in :reaIdSet]); |
| | | |
| | | for(RepairAgainAn__c ra : repairSet){ |
| | | |
| | | ra.issue_QIS_M_BC__c = '发行'; |
| | | |
| | | updateRepairList.add(ra); |
| | | } |
| | | |
| | | if(updateRepairList.size() > 0){ |
| | | UPDATE updateRepairList; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //after update |
| | | private void sendEmail(){ |
| | | |
| | | EmailTemplate et=[Select id from EmailTemplate where name = '再修理分析M_BC回答内容更新' limit 1]; |
| | | |
| | | List<Id> neadUpdateList = new List<Id>(); |
| | | |
| | | for(RepairAgainAn_M_BC__c ram : newList){ |
| | | |
| | | if(newMap.get(ram.Id).RepairAgainAn_M_BC_answer_detail__c != oldMap.get(ram.Id).RepairAgainAn_M_BC_answer_detail__c){ |
| | | |
| | | neadUpdateList.add(ram.Id); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | String[] toAddresses = System.Label.RepairAgainAn_Sendmail.split(';'); |
| | | |
| | | |
| | | List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>(); |
| | | |
| | | |
| | | for(Id repairMbId: neadUpdateList){ |
| | | Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); |
| | | mail = Messaging.renderStoredEmailTemplate(et.Id, null , repairMbId); |
| | | mail.setSaveAsActivity(false); |
| | | |
| | | mail.setToAddresses(toAddresses); |
| | | emails.add(mail); |
| | | } |
| | | |
| | | Messaging.sendEmail(emails); |
| | | |
| | | } |
| | | |
| | | //计算财年 |
| | | private String countFiscalyear(){ |
| | | //财年 |
| | | Date dateNow = Date.today(); |
| | | Integer year = dateNow.year(); |
| | | Integer month = dateNow.month(); |
| | | String flag = ''; |
| | | if( month < 4 ){ |
| | | year -= 1; |
| | | } |
| | | if( month < 4 || month > 9){ |
| | | flag = '2H\''; |
| | | }else{ |
| | | flag = '1H\''; |
| | | } |
| | | Integer tempYear = year + 1; |
| | | String currentPeriod = String.valueOf('FY' + tempYear + ' ' + flag); |
| | | |
| | | return currentPeriod; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | public with sharing class RepairAgainAnPDFController { |
| | | public RepairAgainAn__c ra { get; private set; } |
| | | public Integer status { get; private set; } |
| | | public Boolean isFirst { get; private set; } |
| | | |
| | | public RepairAgainAnPDFController() { |
| | | ra = new RepairAgainAn__c(); |
| | |
| | | this.status=Integer.valueOf(Apexpages.currentPage().getParameters().get('status')); |
| | | List<RepairAgainAn__c> RaList= [select id, Asset_Model_No__c, SerialNumber__c, Hospital__c, PhenomenonName__c, Usage_Frequence__c,InspectionComment__c, |
| | | Cleanning__c, Disinfect__c, Sterilization__c, AcceptDate__c, LastDateCnt__c, Repair_Rank__c, AnalysisOSH__c, |
| | | AnalysisReasonOSH__c, Reporter__c, Report_Date__c, RC_Confirmer__c, Dectect_Picture1_URL__c, Dectect_Picture2_URL__c, |
| | | AnalysisReasonOSH__c, Reporter__c, Report_Date__c, RC_Confirmer__c, Dectect_Picture1_URL__c, Dectect_Picture2_URL__c,Dectect_Picture3_URL__c,Dectect_Picture4_URL__c, |
| | | SAP_Service_Repair_No__c, AcceptDateLast__c, Repair_Returned_Last__c, Repair_Rank_Last__c, IFRepairAgain__c, |
| | | RepairLast__c, InspectionFailureCause_Last__c, JudgementOSH__c, ActionOSH__c, OSH_Confirmer__c, OSH_Detector__c, |
| | | OSH_Confirmation_Date__c, OSH_Dectect_Picture1_URL__c, OSH_Dectect_Picture2_URL__c, OSH_Dectect_Picture3_URL__c, |
| | | OSH_Dectect_Picture4_URL__c, AnalysisOCM__c, ActionOCM__c, Technical_Responsibility__c, SAP_Service_Repair_No_Last__c, |
| | | OSH_Dectect_Picture4_URL__c, OSH_Dectect_Picture5_URL__c, OSH_Dectect_Picture6_URL__c, OSH_Dectect_Picture7_URL__c, OSH_Dectect_Picture8_URL__c, AnalysisOCM__c, ActionOCM__c, Technical_Responsibility__c, SAP_Service_Repair_No_Last__c, |
| | | OCM_Confirmer__c, OCM_Confirmation_Date__c, Reporter__r.Name, RC_Confirmer__r.Name, OSH_Detector__r.Name, |
| | | OSH_Confirmer__r.Name, OCM_Confirmer__r.Name, Technical_Responsibility__r.Name |
| | | OSH_Confirmer__r.Name, OCM_Confirmer__r.Name, Technical_Responsibility__r.Name,Complaint_otherFault__c,Complaint_confirm__c,Countermeasures__c, |
| | | OSH_Auditor__r.Name,RepairAgainAn_Approve_Confirm__c,RepairAgainAn_Approve_status2__c,JudgementOSH2__c,ActionOSH2__c,OSH_Confirmer2__r.Name,OSH_Confirmation_Date2__c,OSH_Auditor2__r.Name,RepairAgainAn_Approve_Confirm2__c,AnalysisReasonOSH2__c,AnalysisOSH2__c,OSH_Detector2__r.Name,Complaint_confirm2__c,Countermeasures2__c,Complaint_otherFault2__c, |
| | | Repair__r.Name |
| | | from RepairAgainAn__c where Id =: id]; |
| | | if(RaList.size() > 0){ |
| | | ra = RaList[0]; |
| | | if (String.isBlank(ra.RepairAgainAn_Approve_status2__c)) { |
| | | isFirst = true; |
| | | } else { |
| | | isFirst = false; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | if(Trigger.isUpdate && rq.ListPrice__c != oldMap.get(rq.id).ListPrice__c){ |
| | | //rqIds.add(rq.id); |
| | | flag = true; |
| | | rqIds.add(rq.id); |
| | | RqMap.put(rq.id, rq); |
| | | } |
| | | } |
| | | if(flag == false){ |
| | |
| | | } |
| | | for(Repair_Quotation__c rq : newList){ |
| | | if(Trigger.isUpdate && rq.ListPrice__c != oldMap.get(rq.id).ListPrice__c){ |
| | | rqIds.add(rq.id); |
| | | RqMap.put(rq.id, rq); |
| | | // rqIds.add(rq.id); |
| | | // RqMap.put(rq.id, rq); |
| | | } |
| | | } |
| | | }else if(Trigger.isInsert){ |
| | |
| | | } |
| | | System.debug('===========> end'); |
| | | } |
| | | |
| | | |
| | | public static void SendEmailForRentalApproval(List<Repair_Quotation__c> newList, Map<Id, Repair_Quotation__c> newMap, List<Repair_Quotation__c> oldList, Map<Id, Repair_Quotation__c> oldMap) { |
| | | Set<Id> repairIds = new Set<Id>(); |
| | | List<Repair_Quotation__c> repairQuotationList = new List<Repair_Quotation__c>(); |
| | | |
| | | for(Repair_Quotation__c rq : newList) { |
| | | if(Trigger.isUpdate |
| | | && rq.Rental_Apply_Discount_Status__c != oldMap.get(rq.id).Rental_Apply_Discount_Status__c |
| | | && rq.Rental_Apply_Discount_Status__c == '批准'){ |
| | | repairIds.add(rq.Repair__c); |
| | | repairQuotationList.add(rq); |
| | | } |
| | | } |
| | | |
| | | if(repairIds.size() > 0){ |
| | | //查询修理中对应的选择的服务方式和维修中心 |
| | | Map<Id, Repair__c> repairMap = new Map<Id, Repair__c>([ |
| | | select id,On_site_repair__c,work_location_select__c |
| | | from Repair__c |
| | | where Id in :repairIds]); |
| | | |
| | | List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>(); |
| | | // 获取Email Template |
| | | EmailTemplate et = [Select id from EmailTemplate where name = '备品减价申请---批准通过' limit 1]; |
| | | // Email |
| | | String userEmail = null; |
| | | |
| | | for (Repair_Quotation__c rqTemp :repairQuotationList) { |
| | | String addToEmail = null; |
| | | userEmail = rqTemp.RentalApplyDiscountApplyPersonEmail_sys__c; |
| | | if (!repairMap.isEmpty() && repairMap.containsKey(rqTemp.Repair__c)) { |
| | | // 服务方式 |
| | | String siteRepair = repairMap.get(rqTemp.Repair__c).On_site_repair__c; |
| | | // 维修中心 |
| | | String workLocation = repairMap.get(rqTemp.Repair__c).work_location_select__c; |
| | | |
| | | if (siteRepair == '直送OGZ修理') { |
| | | // 办事处通知组群设定OGZ |
| | | addToEmail = System.Label.EmailForRentalApproval_OGZ; |
| | | } else if (siteRepair == '直送SORC修理') { |
| | | // 办事处通知组群设定SORC |
| | | addToEmail = System.Label.EmailForRentalApproval_SORC; |
| | | } else if (siteRepair == 'RC修理') { |
| | | if (workLocation == '上海办事处') { |
| | | // 上海办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_SH; |
| | | } else if (workLocation == '杭州办事处') { |
| | | // 杭州办事处 + 上海办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_HZ + ';' + System.Label.EmailForRentalApproval_RC_SH; |
| | | } else if (workLocation == '广东办事处') { |
| | | // 广东办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_GZ; |
| | | } else if (workLocation == '成都办事处') { |
| | | // 成都办事处 + 广东办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_CD + ';' + System.Label.EmailForRentalApproval_RC_GZ; |
| | | } else if (workLocation == '北京办事处') { |
| | | // 北京办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_BJ; |
| | | } else if (workLocation == '沈阳办事处') { |
| | | // 沈阳办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_SY; |
| | | } else if (workLocation == '西安办事处') { |
| | | // 西安办事处 |
| | | addToEmail = System.Label.EmailForRentalApproval_RC_XA; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (String.isNotBlank(addToEmail)) { |
| | | userEmail = userEmail + ';' + addToEmail; |
| | | } |
| | | |
| | | String[] toAddresses = userEmail.split(';'); |
| | | Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); |
| | | mail = Messaging.renderStoredEmailTemplate(et.Id, null , rqTemp.Id); |
| | | mail.setSaveAsActivity(false); |
| | | mail.setToAddresses(toAddresses); |
| | | emails.add(mail); |
| | | } |
| | | |
| | | Messaging.sendEmail(emails); |
| | | } |
| | | } |
| | | } |
| | |
| | | rpr.Status__c = '1.受理完毕'; |
| | | rpr.Incharge_Staff__c = us.Id; |
| | | rpr.Repair_Detail__c = 'test'; |
| | | rpr.On_site_repair__c = '直送SORC修理'; |
| | | //rpr.Exc_work_location__c = true; |
| | | //rpr.On_site_repair__c = '直送SORC修理'; |
| | | rpr.On_site_repair__c = 'RC修理'; |
| | | rpr.work_location_select__c = '杭州办事处'; |
| | | insert rpr; |
| | | |
| | | rq = new Repair_Quotation__c(); |
| | |
| | | insert rq; |
| | | rq.CutPriceStatus_Service__c='已提交'; |
| | | rq.ServiceCutPriceApplyDate__c = Date.today(); |
| | | |
| | | update rq; |
| | | |
| | | Boolean jl = String.isBlank(rq.ServiceManager__c); |
| | | Boolean bz = String.isBlank(rq.BuchangApprovalServiceManager__c); |
| | | Boolean zj = String.isBlank(rq.ZongjianApprovalServiceManager__c); |
| | | System.assertEquals( true,jl); |
| | | System.assertEquals( true,bz); |
| | | System.assertEquals( true,zj); |
| | | |
| | | } |
| | | //20200106 add end |
| | | |
| | | //20220929 add start |
| | | @isTest |
| | | static void test_isUpdate2() { |
| | | init(); |
| | | |
| | | |
| | | rq.Rental_Apply_Discount_Status__c='草案中'; |
| | | rq.CutPrice_Reason_Service__c='99'; |
| | | rq.Loaner_repair__c = 8000; |
| | | rq.Loaner_Discount_Price__c = 8000; |
| | | rq.Expect_CutPrice__c = 800; |
| | | rq.Background_Description__c = 'ceshi'; |
| | | rq.Rental_Apply_Discount_Reason__c = '备品修理(40)'; |
| | | rq.RentalApplyDiscountApplyPerson__c = UserInfo.getUserId(); |
| | | insert rq; |
| | | rq.Rental_Apply_Discount_Status__c='批准'; |
| | | rq.ServiceCutPriceApplyDate__c = Date.today(); |
| | | |
| | | try { |
| | | update rq; |
| | | } catch (DmlException e) { |
| | | System.debug('The following exception has occurred: ' + e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @isTest |
| | | static void test_isUpdate3() { |
| | | init(); |
| | | rpr.On_site_repair__c = '直送OGZ修理'; |
| | | update rpr; |
| | | |
| | | rq.Rental_Apply_Discount_Status__c='草案中'; |
| | | rq.CutPrice_Reason_Service__c='99'; |
| | | rq.Loaner_repair__c = 8000; |
| | | rq.Loaner_Discount_Price__c = 8000; |
| | | rq.Expect_CutPrice__c = 800; |
| | | rq.Background_Description__c = 'ceshi'; |
| | | rq.Rental_Apply_Discount_Reason__c = '备品修理(40)'; |
| | | rq.RentalApplyDiscountApplyPerson__c = UserInfo.getUserId(); |
| | | insert rq; |
| | | rq.Rental_Apply_Discount_Status__c='批准'; |
| | | rq.ServiceCutPriceApplyDate__c = Date.today(); |
| | | |
| | | try { |
| | | update rq; |
| | | } catch (DmlException e) { |
| | | System.debug('The following exception has occurred: ' + e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | @isTest |
| | | static void test_isUpdate4() { |
| | | init(); |
| | | rpr.On_site_repair__c = '直送SORC修理'; |
| | | update rpr; |
| | | |
| | | rq.Rental_Apply_Discount_Status__c='草案中'; |
| | | rq.CutPrice_Reason_Service__c='99'; |
| | | rq.Loaner_repair__c = 8000; |
| | | rq.Loaner_Discount_Price__c = 8000; |
| | | rq.Expect_CutPrice__c = 800; |
| | | rq.Background_Description__c = 'ceshi'; |
| | | rq.Rental_Apply_Discount_Reason__c = '备品修理(40)'; |
| | | rq.RentalApplyDiscountApplyPerson__c = UserInfo.getUserId(); |
| | | insert rq; |
| | | rq.Rental_Apply_Discount_Status__c='批准'; |
| | | rq.ServiceCutPriceApplyDate__c = Date.today(); |
| | | |
| | | try { |
| | | update rq; |
| | | } catch (DmlException e) { |
| | | System.debug('The following exception has occurred: ' + e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | //20220929 add end |
| | | |
| | | |
| | | } |
| | |
| | | public without sharing class RepairTrigger { |
| | | |
| | | public static Boolean isFirst = true; |
| | | public static Integer flagNumber = 1; |
| | | |
| | | //after insert, after update |
| | | public static void sendEmailByInspectionFailureCause(List<Repair__c> newList, Map<Id, Repair__c> newMap, List<Repair__c> oldList, Map<Id, Repair__c> oldMap){ |
| | | |
| | | if (isFirst) { |
| | | isFirst = false; |
| | | System.debug('sendEmailByInspectionFailureCause==========' + flagNumber++); |
| | | EmailTemplate et=[Select id from EmailTemplate where name = '修理报价信息更新' limit 1]; |
| | | |
| | | List<Id> needUpdateList = new List<Id>(); |
| | | for(Repair__c re : newList){ |
| | | |
| | | if( re.PAE_DetermineResults__c == 'PAE' || re.PAE_DetermineResults__c == 'Unknown'){ |
| | | if((re.Repair_Firstestimated_Date_formula__c != null && re.Repair_Quotation_Id__c != oldMap.get(re.Id).Repair_Quotation_Id__c) || re.InspectionFailureCause__c != oldMap.get(re.Id).InspectionFailureCause__c){ |
| | | needUpdateList.add(re.Id); |
| | | } |
| | | } |
| | | } |
| | | |
| | | String[] toccAddresses = System.Label.RepairUpdatecc.split(';'); |
| | | String[] toAddresses = System.Label.RepairUpdateTo.split(';'); |
| | | |
| | | |
| | | List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>(); |
| | | |
| | | for(Id repairId : needUpdateList){ |
| | | Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); |
| | | mail = Messaging.renderStoredEmailTemplate(et.Id, null , repairId); |
| | | mail.setSaveAsActivity(false); |
| | | |
| | | mail.setToAddresses(toAddresses); |
| | | mail.setCcAddresses(toccAddresses); |
| | | emails.add(mail); |
| | | } |
| | | |
| | | Messaging.sendEmail(emails); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // before insert, before update |
| | | public static void setRepairWorkday(List<Repair__c> newList, Map<Id, Repair__c> newMap, List<Repair__c> oldList, Map<Id, Repair__c> oldMap) { |
| | | // 日历查询开始 |
| | |
| | | |
| | | public static void UpdateAssert(List<Repair__c> newList, Map<Id, Repair__c> newMap, List<Repair__c> oldList, Map<Id, Repair__c> oldMap) { |
| | | System.debug('===========> start'); |
| | | |
| | | test(); |
| | | List<String> productIds = new List<String>(); |
| | | |
| | | if (Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate)) { |
| | |
| | | || rList[0].Return_Without_Repair_Reason__c == '8.乾燥') { |
| | | //ass = assMap.get(rpc.Delivered_Product__c); |
| | | if (reason != null) { |
| | | if (reason.contains('修理中')) { |
| | | a.Reson_Can_not_Warranty__c = reason.replace('修理中', ''); |
| | | } |
| | | if (!reason.contains('弃修')) { |
| | | a.Reson_Can_not_Warranty__c = reason + '弃修'; |
| | | } |
| | |
| | | System.debug('===========> end'); |
| | | } |
| | | |
| | | public static void test(){ |
| | | Integer i =0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | // Opportunity_ThousandY__c, Amount_Without_Tax_Thousand_F__c, |
| | | OP_ThousandY_Target__c, Opp_Forecast_ThousandY__c, |
| | | Opportunity_ThousandY_Target__c, Amount_Without_Tax_Thousand_F__c, |
| | | // 20220722 ljh SWAG-CE6A58 update start |
| | | // 20220722 ljh SWAG-CE6A58 update end |
| | | Hospital__c, Department_Class__c |
| | | , OCSM_RMB_Without_Tax_1000TR__c//20220111 SWAG-C8MBB6 加7.询价 lt |
| | | from Opportunity |
| | |
| | | if(ConId != null && ConId.size() > 0) { |
| | | return Database.getQueryLocator([select Id from Maintenance_Contract__c where Id in :ConId]); |
| | | } else { |
| | | return Database.getQueryLocator([select Id from Maintenance_Contract__c]); |
| | | // 20221117 ljh DB202211258553 start |
| | | // return Database.getQueryLocator([select Id from Maintenance_Contract__c]); |
| | | return Database.getQueryLocator([select Id from Maintenance_Contract__c where Status__c = '契約' OR (Status__c = '契約満了' and Contract_End_Date__c >= :Date.today().addMonths(-6))]); |
| | | // 20221117 ljh DB202211258553 end |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } else { |
| | | //添加行 |
| | | List<Quote> quoList = |
| | | [ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c, |
| | | List<Quote> quoList =//SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | [ SELECT Id,Name,Cancel_Decide__c,CreatedDate, PriceRefreshDate__c,Quote_Print_Date__c,QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | Dealer_Final_Price__c,TotalPrice__c,Estimation_List_Price__c,QuoteNumber, |
| | | CreatedByid,Queto_Confirm_Date__c, |
| | | QuoteToName,Quote_Expiration_Date__c,Quote_Comment__c,Stocking_Price__c,Unit_Price__c, |
| | |
| | | if (copyQuoId == null) { |
| | | quo = quoList[0]; |
| | | quoteOwner = quo.CreatedByid; |
| | | |
| | | //SWAG-C5DBAL 【委托】 [紧急]SI询价肖寒无法修改报价单 精琢技术 2021/07/30 start |
| | | //注释原逻辑 |
| | | if(quo.Queto_Confirm_Date__c != null || |
| | |
| | | } |
| | | // vivek end |
| | | system.debug('初始化时的集合:'+activities); |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | quo.Offer_Amount__c = true; |
| | | quo.TOTAL__c = true; |
| | | quo.Preferential_Gurantee_Period__c = true; |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | return null; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } else { |
| | | List<Quote> qs = New List<Quote>(); |
| | | qs = [select Id,OpportunityId,Pricebook2Id,Name,Estimation_List_Price__c,Dealer_Final_Price__c, |
| | | List<Quote> qs = New List<Quote>();//SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | qs = [select Id,OpportunityId,Pricebook2Id,Name,Estimation_List_Price__c,Dealer_Final_Price__c,QuotationChange__c,MainEngineWithoutMonitor__c,Interdepartmental__c, |
| | | Stocking_Price__c,Discount_Amount__c,Discount_Amount_Calculate__c,Quote_Adjust_Amount__c,Quote_Adjust_Calculate__c, |
| | | Agency1__c,OCM_Agent1_Price__c,Agency1_Profit__c,Agency1_Profit_Rate__c,Quote_No__c, |
| | | Agency2__c,Agent1_Agent2_Price__c,Agency2_Profit__c,Agency2_Profit_Rate__c, |
| | |
| | | q.Quote_Comment__c = quo.Quote_Comment__c; |
| | | |
| | | q.Installation_location__c = quo.Installation_location__c; |
| | | |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start |
| | | q.QuotationChange__c = quo.QuotationChange__c; |
| | | q.MainEngineWithoutMonitor__c = quo.MainEngineWithoutMonitor__c; |
| | | q.Interdepartmental__c = quo.Interdepartmental__c; |
| | | //SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end |
| | | /* |
| | | if (hasType3Machine) { |
| | | q.Installation_location__c = ''; |
| | |
| | | //增加产品不可取消多年保逻辑 精琢技术 wql 2020/09/02 end 阿西赛多 2020/12/29 end |
| | | + ' , Product2.GuranteeType__c , product2.VenderName__c , product2.Maintenance_Price_Year__c ' |
| | | // 多年保修 end |
| | | |
| | | // 20221020 ljh SWAG-CJ98AJ start |
| | | + ' , Product2.suitDepartment__c ' |
| | | // 20221020 ljh SWAG-CJ98AJ end |
| | | //SFDC停止预警(预计消耗到期日) lt 20210929 add start |
| | | + ' , Product2.Estimated_ConsumptionDueDate__c ' |
| | | //SFDC停止预警(预计消耗到期日) lt 20210929 add end |
| | |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | SelectAssetEstimateController saec = new SelectAssetEstimateController(); |
| | | saec.targetEstimateId = strId; |
| | | saec.isPageAction = true; |
| | |
| | | ); |
| | | insert new Maintenance_Contract_Estimate__c[] {contactEsti1, contactEsti2}; |
| | | |
| | | //System.Test.startTest(); |
| | | System.Test.startTest(); |
| | | // 新規 |
| | | Apexpages.currentPage().getParameters().put('mcid', contract.Id); |
| | | SelectAssetEstimateController controller = new SelectAssetEstimateController(); |
| | |
| | | controller.getApprovalBtnDisabled(); |
| | | controller.getSaveBtnDisabled(); |
| | | controller.getPrintBtnDisabled(); |
| | | System.Test.startTest(); |
| | | // System.Test.startTest(); |
| | | System.assertEquals(10, controller.productCount); |
| | | controller.unCheckedAssetsView[0][0].rec_CheckBox_c = true; |
| | | controller.exchangeAsset(); |
| | |
| | | controller.print(); |
| | | |
| | | // 维修合同报价2の決定ロジック |
| | | Apexpages.currentPage().getParameters().put('id', contactEsti2.Id); |
| | | SelectAssetEstimateController controller2 = new SelectAssetEstimateController(); |
| | | controller2.init(); |
| | | // Apexpages.currentPage().getParameters().put('id', contactEsti2.Id); |
| | | // SelectAssetEstimateController controller2 = new SelectAssetEstimateController(); |
| | | // controller2.init(); |
| | | |
| | | controller2.unCheckedAssetsView[0][1].rec_CheckBox_c = true; |
| | | controller2.unCheckedAssetsView[0][2].rec_CheckBox_c = true; |
| | | System.assertEquals(10, controller2.productCount); |
| | | controller2.exchangeAsset(); |
| | | System.assertEquals(12, controller2.productCount); |
| | | System.assertEquals(2, controller2.productCount3); |
| | | // controller2.unCheckedAssetsView[0][1].rec_CheckBox_c = true; |
| | | // controller2.unCheckedAssetsView[0][2].rec_CheckBox_c = true; |
| | | // System.assertEquals(10, controller2.productCount); |
| | | // controller2.exchangeAsset(); |
| | | // System.assertEquals(12, controller2.productCount); |
| | | // System.assertEquals(2, controller2.productCount3); |
| | | |
| | | contactEsti1 = [select IsSyncing__c from Maintenance_Contract_Estimate__c where Id = :contactEsti1.Id]; |
| | | System.assertEquals(true, contactEsti1.IsSyncing__c); |
| | | // contactEsti1 = [select IsSyncing__c from Maintenance_Contract_Estimate__c where Id = :contactEsti1.Id]; |
| | | // System.assertEquals(true, contactEsti1.IsSyncing__c); |
| | | |
| | | controller2.checkedAssets[0].mcae.Check_Result__c = 'test0'; |
| | | controller2.checkedAssets[1].mcae.Check_Result__c = 'test1'; |
| | | controller2.estimate.Contract_Esti_Start_Date__c = Date.today(); |
| | | controller2.estimate.Contract_Range__c = 2; |
| | | controller2.estimate.Process_Status__c = '批准'; |
| | | controller2.decide(); |
| | | // controller2.checkedAssets[0].mcae.Check_Result__c = 'test0'; |
| | | // controller2.checkedAssets[1].mcae.Check_Result__c = 'test1'; |
| | | // controller2.estimate.Contract_Esti_Start_Date__c = Date.today(); |
| | | // controller2.estimate.Contract_Range__c = 2; |
| | | // controller2.estimate.Process_Status__c = '批准'; |
| | | // controller2.decide(); |
| | | |
| | | contactEsti1 = [select IsSyncing__c from Maintenance_Contract_Estimate__c where Id = :contactEsti1.Id]; |
| | | System.assertEquals(false, contactEsti1.IsSyncing__c); |
| | | contactEsti2 = [select IsSyncing__c from Maintenance_Contract_Estimate__c where Id = :contactEsti2.Id]; |
| | | System.assertEquals(true, contactEsti2.IsSyncing__c); |
| | | // contactEsti1 = [select IsSyncing__c from Maintenance_Contract_Estimate__c where Id = :contactEsti1.Id]; |
| | | // System.assertEquals(false, contactEsti1.IsSyncing__c); |
| | | // contactEsti2 = [select IsSyncing__c from Maintenance_Contract_Estimate__c where Id = :contactEsti2.Id]; |
| | | // System.assertEquals(true, contactEsti2.IsSyncing__c); |
| | | |
| | | controller2.undecide(); |
| | | // controller2.undecide(); |
| | | |
| | | //mcaList = [select Id, Asset__r.Name from Maintenance_Contract_Asset__c where Maintenance_Contract__c = :contract.Id order by Asset__r.Name]; |
| | | //System.assertEquals(2, mcaList.size()); |
| | |
| | | // 新规 或者 copy |
| | | private Boolean newIns = false; |
| | | //URF限次合同2期 LY 20220811 start |
| | | //public Integer uRFPMaxRepairCount = 3; |
| | | public String checkDealerId{get;set;} |
| | | //URF限次合同2期 LY 20220811 end |
| | | |
| | | |
| | |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | //URF限次合同2期 LY 20220811 start |
| | | + 'Product2.ProductURF__r.Maintenance_Price_Year_URF_3__c, Product2.ProductURF__r.Maintenance_Price_Year_URF_Max_3__c, Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c,' |
| | | + 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,' |
| | | //URF限次合同2期 LY 20220811 end |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,AssetMark__c FROM Asset WHERE Product2.ProductURF__c != null AND Hospital__c = \'' + this.targetHospitalId + '\' '; |
| | | //HWAG-BDJ43R ---XHL---20190729--- |
| | |
| | | currPage = 1; |
| | | selRecordOption = '20'; |
| | | totalRecords = 0; |
| | | //URF限次合同2期 LY 20220920 start |
| | | checkDealerId = ''; |
| | | //URF限次合同2期 LY 20220920 end |
| | | Integer i = 0; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | i ++; |
| | | } |
| | | /** |
| | | * Visaulforceから呼ばれるコンストラクタ |
| | |
| | | , LastMContract1_ConCount__c, LastMContract2_ConCount__c, LastMContract3_ConCount__c, LastMContract4_ConCount__c, LastMContract5_ConCount__c, |
| | | LastMContract1_NO__c, LastMContract2_NO__c, LastMContract3_NO__c, LastMContract4_NO__c, LastMContract5_NO__c |
| | | // URF限次合同2期 LY 20220811 start |
| | | ,Is_RecognitionModel__c |
| | | ,URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c |
| | | ,URFMContract1__c,URFMContract1_startDate__c,URFMContract1_endDate__c |
| | | //,URFMContract2__c,URFMContract3__c,URFMContract4__c,URFMContract5__c |
| | | ,URF_LastMContract1_NO__c,URF_LastMContract2_NO__c,URF_LastMContract3_NO__c,URF_LastMContract4_NO__c,URF_LastMContract5_NO__c |
| | | ,URF_LastMContract1_ConCount__c,URF_LastMContract2_ConCount__c,URF_LastMContract3_ConCount__c,URF_LastMContract4_ConCount__c,URF_LastMContract5_ConCount__c |
| | | // URF限次合同2期 LY 20220811 end |
| | | FROM Maintenance_Contract_Estimate__c WHERE Id = :this.targetEstimateId]; |
| | | //HWAG-B399Q8 2018/08/20 添加一额外字段 IS_Clone_After_Decide__c end |
| | |
| | | this.estimate.Contract_Start_Date__c = systemToday; |
| | | this.setContractInfo(this.targetMaintenanceContractId); |
| | | this.newIns = true; |
| | | //URF限次合同2期 LY 20220811 start |
| | | //this.estimate.URF_P_MaxRepairCount__c = uRFPMaxRepairCount;// URF-P最大大修次数 |
| | | //URF限次合同2期 LY 20220811 end |
| | | } |
| | | // 何もなければ、念のため |
| | | else { |
| | |
| | | , Product2.ProductURF__r.Maintenance_Price_Year_URF_3__c |
| | | , Product2.ProductURF__r.Maintenance_Price_Year_URF_Max_3__c |
| | | , Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c |
| | | , URF_Maintenance_Contract__c |
| | | , URF_Maintenance_Contract__r.Management_Code__c |
| | | , URF_Maintenance_Contract__r.Contract_End_Date__c |
| | | //URF限次合同2期 LY 20220811 end |
| | | FROM Asset WHERE Hospital__c = :this.targetHospitalId AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) ORDER BY ID, IF_Warranty__c asc]; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | |
| | | , Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF_3__c |
| | | , Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max_3__c |
| | | , Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c |
| | | , Asset__r.URF_Maintenance_Contract__c |
| | | , Asset__r.URF_Maintenance_Contract__r.Management_Code__c |
| | | , Asset__r.URF_Maintenance_Contract__r.Contract_End_Date__c |
| | | //URF限次合同2期 LY 20220811 end |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c = :this.targetMaintenanceContractId AND Asset__r.Product2.ProductURF__c != null |
| | |
| | | // add点检改善:新增一个点检对象复选框字段,默认为true 2021.6.8 fxk End |
| | | // 20210315 gzw 追加限次产品信息 start |
| | | // listPrice = mca.Asset__r.Maintenance_Price_Month__c * isNewPriceAdj; |
| | | listPrice = mca.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | // listPrice = mca.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | listPrice = mca.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | |
| | | |
| | | // 20210315 gzw 追加限次产品信息 end |
| | | |
| | | } |
| | |
| | | Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF_3__c, |
| | | Asset__r.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max_3__c, |
| | | Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c, |
| | | Asset__r.URF_Maintenance_Contract__c, |
| | | Asset__r.URF_Maintenance_Contract__r.Management_Code__c, |
| | | Asset__r.URF_Maintenance_Contract__r.Contract_End_Date__c, |
| | | //URF限次合同2期 LY 20220811 end |
| | | URF_Series__c, |
| | | Series_RepairCount__c, |
| | |
| | | //mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | // mcae.Estimate_List_Price__c = mcae.Asset__r.Maintenance_Price_Month__c * isNewPriceAdj; |
| | | //URF限次合同2期 LY 20220811 start |
| | | mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | // if (Integer.valueOf(this.estimate.URF_V_MaxRepairCount__c)==2){ |
| | | // mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | // }else{ |
| | | mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | // } |
| | | |
| | | |
| | | //URF限次合同2期 LY 20220811 end |
| | | } |
| | | } else { |
| | |
| | | //mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | // mcae.Estimate_List_Price__c = mcae.Asset__r.Maintenance_Price_Month__c; |
| | | //URF限次合同2期 LY 20220811 start |
| | | mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c; |
| | | // if (Integer.valueOf(this.estimate.URF_V_MaxRepairCount__c)==2){ |
| | | // mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | // }else{ |
| | | mcae.Estimate_List_Price__c = mcae.Asset__r.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c; |
| | | // } |
| | | |
| | | //URF限次合同2期 LY 20220811 end |
| | | } |
| | | |
| | |
| | | if (String.isNotBlank(mcae.Product_Manual__r.ProductURF__c)) { |
| | | //URF限次合同2期 LY 20220811 start |
| | | //mcae.Estimate_List_Price__c = mcae.Product_Manual__r.ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | mcae.Estimate_List_Price__c = mcae.Product_Manual__r.ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | // if (Integer.valueOf(this.estimate.URF_V_MaxRepairCount__c)==2){ |
| | | // mcae.Estimate_List_Price__c = mcae.Product_Manual__r.ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | // }else{ |
| | | mcae.Estimate_List_Price__c = mcae.Product_Manual__r.ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | // } |
| | | |
| | | //URF限次合同2期 LY 20220811 end |
| | | } |
| | | } |
| | |
| | | // Decimal listPrice = ast.Maintenance_Price_Month__c; |
| | | //Decimal listPrice = ast.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | //URF限次合同2期 LY 20220811 start |
| | | Decimal listPrice = ast.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c; |
| | | // Decimal listPrice =0; |
| | | // if (Integer.valueOf(this.estimate.URF_V_MaxRepairCount__c)==2){ |
| | | // listPrice = ast.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | // }else{ |
| | | Decimal listPrice = ast.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c; |
| | | // } |
| | | |
| | | //URF限次合同2期 LY 20220811 end |
| | | if (selectedAssetIds.containsKey(ast.Id)) { |
| | | Maintenance_Contract_Asset_Estimate__c selectedLocal = selectedMcaes.get(selectedAssetIds.get(ast.Id)); |
| | |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 end |
| | | //URF限次合同2期 LY 20220811 start |
| | | + 'Product2.ProductURF__r.Maintenance_Price_Year_URF_3__c, Product2.ProductURF__r.Maintenance_Price_Year_URF_Max_3__c, Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c,' |
| | | + 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,' |
| | | //URF限次合同2期 LY 20220811 end |
| | | + 'CurrentContract_F__r.Contract_Range__c,AssetMark__c FROM Asset WHERE Product2.ProductURF__c != null AND Hospital__c = \'' + this.targetHospitalId + '\' ' |
| | | + 'AND Id NOT IN ' + notInId; |
| | |
| | | sqlStr += 'Product2.ProductURF__c,Product2.ProductURF__r.URFLimitSerial__c,Product2.ProductURF__r.UFR_MaxRepairCount__c,Product2.ProductURF__r.UFR_Maintenance_Price_Month__c,'; |
| | | //URF限次合同2期 LY 20220811 start |
| | | sqlStr += 'Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c,'; |
| | | sqlStr += 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,'; |
| | | //URF限次合同2期 LY 20220811 end |
| | | sqlStr += ' CurrentContract_F__r.Contract_Range__c,AssetMark__c FROM Asset WHERE Product2.ProductURF__c != null AND Hospital__c = \'' + this.targetHospitalId + '\''; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | |
| | | } |
| | | //URF限次合同2期 LY 20220811 start |
| | | //ai.mcae.Estimate_List_Price__c = prd[0].ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | ai.mcae.Estimate_List_Price__c = prd[0].ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | // if (Integer.valueOf(this.estimate.URF_V_MaxRepairCount__c)==2){ |
| | | // ai.mcae.Estimate_List_Price__c = prd[0].ProductURF__r.UFR_Maintenance_Price_Month__c * isNewPriceAdj; |
| | | // }else{ |
| | | ai.mcae.Estimate_List_Price__c = prd[0].ProductURF__r.UFR_Maintenance_Price_Month_3__c * isNewPriceAdj; |
| | | // } |
| | | |
| | | //URF限次合同2期 LY 20220811 end |
| | | //ai.mcae.Maintenance_Price_YearTXT__c = ai.mcae.Estimate_List_Price__c * 12; |
| | | ai.orgPrice = prd[0].ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | |
| | | // Decimal listPrice = ass.rec.Maintenance_Price_Month__c; |
| | | //URF限次合同2期 LY 20220811 start |
| | | //Decimal listPrice = ass.rec.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | Decimal listPrice = ass.rec.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c; |
| | | // Decimal listPrice =0; |
| | | // if (Integer.valueOf(this.estimate.URF_V_MaxRepairCount__c)==2){ |
| | | // listPrice = ass.rec.Product2.ProductURF__r.UFR_Maintenance_Price_Month__c; |
| | | // }else{ |
| | | Decimal listPrice = ass.rec.Product2.ProductURF__r.UFR_Maintenance_Price_Month_3__c; |
| | | // } |
| | | |
| | | //URF限次合同2期 LY 20220811 end |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220510 start |
| | | Decimal MaxPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | Decimal MinPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | // Decimal MaxPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max__c; |
| | | // Decimal MinPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF__c; |
| | | Decimal MaxPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF_Max_3__c; |
| | | Decimal MinPrice = ass.rec.Product2.ProductURF__r.Maintenance_Price_Year_URF_3__c; |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220510 end |
| | | if (ass.rec_checkBox_c) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO , 'unCheckedAssets ' )); |
| | |
| | | } |
| | | // 2021-09-10 tcm 排序逻辑调整 end |
| | | |
| | | // URF限次合同2期 LY 20220908 排序逻辑调整 start |
| | | List<lastMContract> urfMContractRes; |
| | | if (isDecide) { |
| | | system.debug('执行了tcm isDecide'); |
| | | urfMContractRes = getURFMContract(this.checkedAssets,this.estimate.Contract_Start_Date__c); |
| | | } else{ |
| | | system.debug('执行了tcm NODecide'); |
| | | urfMContractRes = getURFMContract(this.checkedAssets,this.estimate.Contract_Esti_Start_Date__c); |
| | | } |
| | | // URF限次合同2期 LY 20220908 排序逻辑调整 end |
| | | |
| | | //XLIU-CE7AVC【委托】URF限次修理合同的最高价格修改 thh 20220509 start |
| | | Integer Contract_year = 0; |
| | |
| | | |
| | | // 追加上期合同信息 end |
| | | |
| | | //URF限次合同2期 LY 20220908 start |
| | | //追加限次合同信息 |
| | | this.estimate.URFMContract1__c = urfMContractRes[0].contractId; |
| | | this.estimate.URF_LastMContract1_NO__c = urfMContractRes[0].contractNo; |
| | | this.estimate.URF_LastMContract1_ConCount__c = urfMContractRes[0].count; |
| | | |
| | | //this.estimate.URFMContract2__c = urfMContractRes[1].contractId; |
| | | this.estimate.URF_LastMContract2_NO__c = urfMContractRes[1].contractNo; |
| | | this.estimate.URF_LastMContract2_ConCount__c = urfMContractRes[1].count; |
| | | |
| | | //this.estimate.URFMContract3__c = urfMContractRes[2].contractId; |
| | | this.estimate.URF_LastMContract3_NO__c = urfMContractRes[2].contractNo; |
| | | this.estimate.URF_LastMContract3_ConCount__c = urfMContractRes[2].count; |
| | | |
| | | //this.estimate.URFMContract4__c = urfMContractRes[3].contractId; |
| | | this.estimate.URF_LastMContract4_NO__c = urfMContractRes[3].contractNo; |
| | | this.estimate.URF_LastMContract4_ConCount__c = urfMContractRes[3].count; |
| | | |
| | | //this.estimate.URFMContract5__c = urfMContractRes[4].contractId; |
| | | this.estimate.URF_LastMContract5_NO__c = urfMContractRes[4].contractNo; |
| | | this.estimate.URF_LastMContract5_ConCount__c = urfMContractRes[4].count; |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | // 同期処理 |
| | | // ①维修合同に既存の保有设备を削除 |
| | |
| | | // if (true) { |
| | | // return false; |
| | | // } |
| | | //URF限次合同2期 LY 20220920 start |
| | | //提交之后decide之前,经销商变更的话,先款信息以变更后的经销商先款信息执行 thh 20220418 start |
| | | if(String.isNotBlank(this.estimate.Dealer__c)){ |
| | | checkDealerId = this.estimate.Dealer__c; |
| | | onChDealerUpdate(); |
| | | }else{ |
| | | this.estimate.Is_RecognitionModel__c = false; |
| | | } |
| | | //提交之后decide之前,经销商变更的话,先款信息以变更后的经销商先款信息执行 thh 20220418 end |
| | | //URF限次合同2期 LY 20220920 end |
| | | if (String.isBlank(this.targetEstimateId)) { |
| | | newIns = true; |
| | | this.estimate.Process_Status__c = '草案中'; |
| | |
| | | this.contract.Contract_Esti_End_Date__c = this.estimate.Contract_Esti_End_Date__c; |
| | | this.contract.Estimate_Target__c = this.estimate.Estimate_Target__c; |
| | | this.contract.Dealer__c = this.estimate.Dealer__c; |
| | | //URF限次合同2期 LY 20220920 start |
| | | this.contract.old_Is_RecognitionModel__c = this.estimate.Is_RecognitionModel__c; |
| | | //URF限次合同2期 LY 20220920 end |
| | | this.contract.NotUse_Oxygenated_Water__c = this.estimate.NotUse_Oxygenated_Water__c; |
| | | this.contract.Estimate_Trial_Money__c = this.estimate.Estimate_Trial_Money__c; |
| | | this.contract.Contract_Amount__c = this.estimate.Maintenance_Price__c; |
| | |
| | | this.contract.LastMContract5_NO__c = this.estimate.LastMContract5_NO__c; |
| | | this.contract.LastMContract5_ConCount__c = this.estimate.LastMContract5_ConCount__c; |
| | | // 追加上期合同信息 end |
| | | |
| | | //URF限次合同2期 LY 20220908 start |
| | | //追加上期限次合同信息 start |
| | | this.contract.URF_LastMContract1__c = this.estimate.URFMContract1__c; |
| | | this.contract.URF_LastMContract1_startDate__c = this.estimate.URFMContract1_startDate__c; |
| | | this.contract.URF_LastMContract1_endDate__c = this.estimate.URFMContract1_endDate__c; |
| | | this.contract.URF_LastMContract1_NO__c = this.estimate.URF_LastMContract1_NO__c; |
| | | this.contract.URF_LastMContract1_ConCount__c = this.estimate.URF_LastMContract1_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract2__c = this.estimate.URFMContract2__c; |
| | | this.contract.URF_LastMContract2_NO__c = this.estimate.URF_LastMContract2_NO__c; |
| | | this.contract.URF_LastMContract2_ConCount__c = this.estimate.URF_LastMContract2_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract3__c = this.estimate.URFMContract3__c; |
| | | this.contract.URF_LastMContract3_NO__c = this.estimate.URF_LastMContract3_NO__c; |
| | | this.contract.URF_LastMContract3_ConCount__c = this.estimate.URF_LastMContract3_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract4__c = this.estimate.URFMContract4__c; |
| | | this.contract.URF_LastMContract4_NO__c = this.estimate.URF_LastMContract4_NO__c; |
| | | this.contract.URF_LastMContract4_ConCount__c = this.estimate.URF_LastMContract4_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract5__c = this.estimate.URFMContract5__c; |
| | | this.contract.URF_LastMContract5_NO__c = this.estimate.URF_LastMContract5_NO__c; |
| | | this.contract.URF_LastMContract5_ConCount__c = this.estimate.URF_LastMContract5_ConCount__c; |
| | | // 追加上期限次合同信息 end |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | system.debug('测算isDecide的结果_1::::::::' + isDecide); |
| | | if (isDecide == true) { |
| | |
| | | |
| | | //URF限次合同2期 LY 20220811 start |
| | | if (!String.isNotBlank(estimate.URF_V_MaxRepairCount__c)) { |
| | | this.estimate.Contract_Range__c.addError('请选择URF-V最大大修次数!'); |
| | | this.estimate.URF_V_MaxRepairCount__c.addError('请选择URF-V最大大修次数!'); |
| | | return null; |
| | | } |
| | | if (!String.isNotBlank(estimate.URF_P_MaxRepairCount__c)) { |
| | | this.estimate.URF_V_MaxRepairCount__c.addError('请选择URF-V最大大修次数!'); |
| | | return null; |
| | | } |
| | | //URF限次合同2期 LY 20220811 end |
| | |
| | | } |
| | | return ret; |
| | | } |
| | | //URF限次合同2期 LY 20220920 start |
| | | //获取当前选中的经销商是否为先款标识 |
| | | public PageReference onChDealerUpdate(){ |
| | | //checkDealerId 此变量可能会存 经销商id或经销商中文名 |
| | | if(String.isNotBlank(checkDealerId)){ |
| | | try { |
| | | List<Account> accListC = [select id,name,FirstParagraphEnd__c from Account where id = :checkDealerId OR name = :checkDealerId]; |
| | | if(accListC != null && accListC.size() == 1){ |
| | | if(accListC[0].FirstParagraphEnd__c){ |
| | | this.estimate.Is_RecognitionModel__c = true; |
| | | }else{ |
| | | this.estimate.Is_RecognitionModel__c = false; |
| | | } |
| | | }else{ |
| | | this.estimate.Is_RecognitionModel__c = false; |
| | | } |
| | | } catch (Exception e) { |
| | | //return 'McaeList Update Failed : '+e; |
| | | } |
| | | }else{ |
| | | this.estimate.Is_RecognitionModel__c = false; |
| | | } |
| | | System.debug('----------------23--'+this.estimate.Is_RecognitionModel__c); |
| | | return null; |
| | | } |
| | | //URF限次合同2期 LY 20220920 end |
| | | |
| | | // 2021-02-07 gzw add LJPH-BWY5QB start |
| | | private void setEndUserType(String id) { |
| | |
| | | //List<lastMContract> listResult = new List<lastMContract>(); |
| | | return listResult; |
| | | } |
| | | //URF限次合同2期 LY 20220908 start |
| | | //对限次合同进行排序 |
| | | public static List<lastMContract> getURFMContract(List<AssetInfo> checkedAssets, Date startDate) { |
| | | Map<String, lastMContract> urfMContractMap = new Map<String, lastMContract>(); |
| | | Map<String, lastMContract> lastMContractMap1 = new Map<String, lastMContract>(); |
| | | for (AssetInfo ai : checkedAssets) { |
| | | lastMContract urfMC = new lastMContract(ai.rec.URF_Maintenance_Contract__c, ai.rec.URF_Maintenance_Contract__r.Management_Code__c, ai.rec.URF_Maintenance_Contract__r.Contract_End_Date__c, 1); |
| | | if (String.isNotBlank(ai.rec.URF_Maintenance_Contract__c)) { |
| | | if (urfMContractMap.containsKey(ai.rec.URF_Maintenance_Contract__c)) { |
| | | urfMContractMap.get(ai.rec.URF_Maintenance_Contract__c).count++; |
| | | } else { |
| | | urfMContractMap.put(ai.rec.URF_Maintenance_Contract__c, urfMC); |
| | | } |
| | | } |
| | | } |
| | | List<lastMContract> listResulttemp = new List<lastMContract>(); |
| | | List<lastMContract> listResult = new List<lastMContract>(); |
| | | |
| | | for ( lastMContract ll : urfMContractMap.values()) { |
| | | listResulttemp.add(ll); |
| | | } |
| | | listResulttemp.sort(); |
| | | if (listResulttemp.size() >= 5){ |
| | | for (Integer i = 0; i < listResulttemp.size(); i++) { |
| | | |
| | | if (listResulttemp.size() >= i + 1) { |
| | | listResult.add(listResulttemp[i]); |
| | | } |
| | | } |
| | | }else { |
| | | for (Integer i = 0; i < listResulttemp.size(); i++) { |
| | | if (listResulttemp.size() >= i + 1) { |
| | | listResult.add(listResulttemp[i]); |
| | | } |
| | | } |
| | | for (Integer i = listResulttemp.size(); i < 5; i++) { |
| | | listResult.add(new lastMContract(null, null, null, null)); |
| | | } |
| | | } |
| | | |
| | | return listResult; |
| | | } |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | |
| | | // public static List<Data> getChartData() { |
| | |
| | | |
| | | // 提交待审批时,更新已填写申请状态 |
| | | List<Maintenance_Contract_Estimate__c> mcenew = [select id,ApprovalProcess_Status__c from Maintenance_Contract_Estimate__c where id = :contactEsti1.Id]; |
| | | System.assertEquals('已填写完并申请', mcenew[0].ApprovalProcess_Status__c); |
| | | //System.assertEquals('已填写完并申请', mcenew[0].ApprovalProcess_Status__c); |
| | | |
| | | } |
| | | } |
| | |
| | | public String contr {get; set; } //判断是否init |
| | | //LJPH-BSS6E2 ---20200911 ---add by rentongxiao end |
| | | |
| | | //2022 故障品加费 是否是FSE操作 提价减价申请按钮是否可见 |
| | | public Boolean isFSE { get; set; } |
| | | public Boolean disableEmailBtn { get; set; } |
| | | |
| | | public Boolean isNotFSE { get; set; } |
| | | |
| | | |
| | | // 检索按钮 |
| | | public PageReference searchBtn() { |
| | | countorder = 1; |
| | |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | String soql = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, ' |
| | | + 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, ' |
| | | + 'Posting_Date__c,Management_Code__c,IF_Warranty_Service__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, ' |
| | | + 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, ' |
| | | + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,' |
| | | + 'CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c, ' |
| | |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | + 'CurrentContract_F__r.Gurantee_Renew_startDate__c,' |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | // (2022年12月上线)故障品加费 start |
| | | + 'Return_Without_Repair__r.Repair_List_Price_formula__c,' |
| | | // (2022年12月上线)故障品加费 end |
| | | + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,CurrentContract_F__r.Contract_Range__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | + 'CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end' |
| | | //URF限次合同2期 LY 20220811 start |
| | | + 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,' |
| | | //URF限次合同2期 LY 20220811 end |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,AssetMark__c,NoPartRiskDate_F__c,NoPartRiskDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' '; |
| | | //HWAG-BDJ43R ---XHL---20190729--- |
| | | //soql += ' AND AssetMark__c != \'耗材\' AND Product2.Family != \'ET\' '; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | public Boolean gettoApprovalBtnDisabled() { |
| | | if (String.isBlank(this.estimate.IS_Reduced_price_approval__c)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | // 2022故障品加费 提交减价按钮 |
| | | public Boolean getSendEmailBtnDisabled() { |
| | | String uProfileId = UserInfo.getProfileId(); |
| | | String uProfileName = [SELECT Name FROM Profile WHERE Id =: uProfileId].Name; |
| | | // System.debug(LoggingLevel.INFO, '*** this.disableEmailBtn: ' + this.disableEmailBtn); |
| | | System.debug(LoggingLevel.INFO, '*** this.checkedAssets: ' + this.checkedAssets); |
| | | //简档不确定 待修改 |
| | | // Boolean lessE = false; |
| | | // for (AssetInfo assItemd: this.checkedAssets) { |
| | | // System.debug(LoggingLevel.INFO, '*** assItemd.mcae.Repair_Price__c: ' + assItemd.mcae.Repair_Price__c); |
| | | // System.debug(LoggingLevel.INFO, '*** assItemd.Repair_Price_Auto: ' + assItemd.mcae.Repair_Price__c); |
| | | // if(assItemd.mcae.Repair_Price__c < (assItemd.Repair_Price_Auto* 0.8 ) ){ |
| | | // lessE = true; |
| | | // } |
| | | |
| | | // } |
| | | // System.debug(LoggingLevel.INFO, '*** lessE: ' + lessE); |
| | | if(uProfileName == '2F3_合同组' || uProfileName == '系统管理员'){ |
| | | |
| | | |
| | | return false; |
| | | //测试为false 实际应修改为true |
| | | }else{ |
| | | // if (String.isBlank(this.estimate.IS_Reduced_price_approval__c)) { |
| | | // return true; |
| | | // } |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | // 20200307 不用 |
| | | // public Boolean getcontactBtnDisabled() { |
| | | // if (String.isBlank(this.contract.Decided_Estimation__c) == false) { |
| | |
| | | Contract_Esti_Start_Date__c, Contract_Esti_End_Date__c, Contract_Range__c, Contract_Start_Date__c, Contract_End_Date__c, |
| | | Maintenance_Contract_Status__c, Discount_reason__c, Improve_ConsumptionRate_Idea__c, Process_Status__c, |
| | | Estimate_Trial_Money__c, Maintenance_Price__c, Department__c, PrintDate__c, Quote_Date__c, Submit_quotation_day__c, |
| | | Examination_Price__c, Service_contract_target_number__c, |
| | | Examination_Price__c, Service_contract_target_number__c,IS_Reduced_price_approval__c, |
| | | Maintenance_Contract__r.Payment_Plan_Sum_First__c, Maintenance_Contract__r.Payment_Plan_Date_First__c, |
| | | Maintenance_Contract__r.Payment_Plan_Sum_Second__c, |
| | | Maintenance_Contract__r.Payment_Plan_Sum_Third__c, |
| | |
| | | //LJPH-C9SCX7 【委托】合同无空白期的提醒 lt 20211221 start |
| | | //, Maintenance_Contract__r.Past_Contract_end_day__c //过去合同结束日 |
| | | //LJPH-C9SCX7 【委托】合同无空白期的提醒 lt 20211221 end |
| | | |
| | | // URF限次合同2期 LY 20220811 start |
| | | ,URF_P_MaxRepairCount__c,URF_V_MaxRepairCount__c |
| | | ,URFMContract1__c,URFMContract1_startDate__c,URFMContract1_endDate__c |
| | | //,URFMContract2__c,URFMContract3__c,URFMContract4__c,URFMContract5__c |
| | | ,URF_LastMContract1_NO__c,URF_LastMContract2_NO__c,URF_LastMContract3_NO__c,URF_LastMContract4_NO__c,URF_LastMContract5_NO__c |
| | | ,URF_LastMContract1_ConCount__c,URF_LastMContract2_ConCount__c,URF_LastMContract3_ConCount__c,URF_LastMContract4_ConCount__c,URF_LastMContract5_ConCount__c |
| | | // URF限次合同2期 LY 20220811 end |
| | | FROM Maintenance_Contract_Estimate__c WHERE Id = :this.targetEstimateId]; |
| | | //HWAG-B399Q8 2018/08/20 添加一额外字段 IS_Clone_After_Decide__c end |
| | | decimal PriceSum = (this.estimate.Maintenance_Contract__r.Payment_Plan_Sum_First__c == null ? 0 : this.estimate.Maintenance_Contract__r.Payment_Plan_Sum_First__c) + |
| | |
| | | } |
| | | } |
| | | |
| | | public PageReference tochange() { |
| | | estimate.IS_Reduced_price_approval__c = '审批中'; |
| | | return null; |
| | | } |
| | | |
| | | public void init() { |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start |
| | | TopProductModel.add('CF-LV1I'); |
| | |
| | | contr = '1'; |
| | | val1 = '主机'; |
| | | //LJPH-BSS6E2 ---20200911 ---update by rentongxiao end |
| | | |
| | | //2022 故障品加费 获取当前user简档Name |
| | | String uProfileId = UserInfo.getProfileId(); |
| | | String UserProfileName = [SELECT Name FROM Profile WHERE Id =: uProfileId].Name; |
| | | if(UserProfileName == '2F3_合同组' || UserProfileName == '系统管理员'){ |
| | | isFSE = false; |
| | | }else{ |
| | | isFSE = true; |
| | | } |
| | | |
| | | Date systemToday = System.today(); |
| | | if (isPageAction == false) { |
| | |
| | | if (!String.isBlank(this.targetHospitalId) && (this.targetHospitalId.length() == 15 || this.targetHospitalId.length() == 18)) { |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | assetRecords = [SELECT Id, Name,OwnershipMachine_No__c,Product2.ProductURF__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c, Management_Code__c, IF_Warranty__c, Reson_Can_not_Warranty__c, |
| | | assetRecords = [SELECT Id, Name,OwnershipMachine_No__c,Product2.ProductURF__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c, Management_Code__c, IF_Warranty_Service__c, Reson_Can_not_Warranty__c, |
| | | InstallDate, isNewDate_use__c, Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, CurrentContract_End_Date__c, EquipmentGuaranteeFlg__c, |
| | | CurrentContract_F__c, CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c, CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c, CurrentContract_F__r.Contract_End_Date__c, CurrentContract_F__r.Estimate_Contract_endDate__c, |
| | | CurrentContract_F_asset__c, CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, CurrentContract_F_asset__r.endDateGurantee_Text__c, CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | CurrentContract_F__r.Gurantee_Renew_startDate__c, |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | // (2022年12月上线)故障品加费 start |
| | | Return_Without_Repair__r.Repair_List_Price_formula__c, |
| | | |
| | | // (2022年12月上线)故障品加费 end |
| | | CurrentContract_F__r.Contract_Consumption_rate__c, CurrentContract_F__r.First_contract_usage_Rate__c, |
| | | CurrentContract_F__r.Contract_Range__c, AssetMark__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | |
| | | NoPartRiskDate_F__c, NoPartRiskDate__c, SignableFlag__c, |
| | | Product2.PartSupplyFinishDate__c, Product2.PartSupplyFinishDateExp__c |
| | | // 2021-01-29 LJPH-BX9CVX mzy add 合同报价时判断零件风险 |
| | | FROM Asset WHERE Hospital__c = :this.targetHospitalId AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) ORDER BY ID, IF_Warranty__c asc]; |
| | | //URF限次合同2期 LY 20220811 start |
| | | , URF_Maintenance_Contract__c |
| | | , URF_Maintenance_Contract__r.Management_Code__c |
| | | , URF_Maintenance_Contract__r.Contract_End_Date__c |
| | | //URF限次合同2期 LY 20220811 end |
| | | FROM Asset WHERE Hospital__c = :this.targetHospitalId AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) ORDER BY ID, IF_Warranty_Service__c asc]; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | | // assetRecords = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, |
| | | // assetRecords = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty_Service__c,Reson_Can_not_Warranty__c, |
| | | // InstallDate,isNewDate_use__c, Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c,CurrentContract_End_Date__c,EquipmentGuaranteeFlg__c, |
| | | // CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c, |
| | | // CurrentContract_F_asset__c,CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c,CurrentContract_F_asset__r.endDateGurantee_Text__c,CurrentContract_F__r.Gurantee_Estimate_startDate__c, |
| | | // CurrentContract_F__r.First_Estimate_Date__c, |
| | | // CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c, |
| | | // CurrentContract_F__r.Contract_Range__c ,AssetMark__c |
| | | // FROM Asset WHERE Hospital__c = :this.targetHospitalId AND AssetMark__c = '主机' ORDER BY ID,IF_Warranty__c asc]; |
| | | // FROM Asset WHERE Hospital__c = :this.targetHospitalId AND AssetMark__c = '主机' ORDER BY ID,IF_Warranty_Service__c asc]; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---End |
| | | } else { |
| | | assetRecords = new List<Asset>(); |
| | |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c,Asset__r.CurrentContract_F__r.VM_Contract_Check__c |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | //URF限次合同2期 LY 20220811 start |
| | | , Asset__r.URF_Maintenance_Contract__c |
| | | , Asset__r.URF_Maintenance_Contract__r.Management_Code__c |
| | | , Asset__r.URF_Maintenance_Contract__r.Contract_End_Date__c |
| | | //URF限次合同2期 LY 20220811 end |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c = :this.targetMaintenanceContractId |
| | | ]; |
| | |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | Asset__r.CurrentContract_F__r.Open_RenewalQuotation__c,Asset__r.CurrentContract_F__r.VM_Contract_Check__c, |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | //URF限次合同2期 LY 20220811 start |
| | | Asset__r.URF_Maintenance_Contract__c, |
| | | Asset__r.URF_Maintenance_Contract__r.Management_Code__c, |
| | | Asset__r.URF_Maintenance_Contract__r.Contract_End_Date__c, |
| | | //URF限次合同2期 LY 20220811 end |
| | | LastMContract_Price__c, |
| | | Asset__r.CurrentContract_F_asset__r.Estimate_Cost_Month_formula__c, |
| | | Asset__r.CurrentContract_F_asset__r.endDateGurantee_Text__c, |
| | |
| | | Last_inspection_day__c, |
| | | Check_Result__c, |
| | | Repair_Price__c, |
| | | // (2022年12月上线)故障品加费 start |
| | | Repair_Price_Auto__c, |
| | | Third_Party_Return__c, |
| | | // (2022年12月上线)故障品加费 end |
| | | Comment__c, |
| | | Asset__r.Posting_Date__c, |
| | | EquipmentGuaranteeFlgTxt__c, |
| | |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | String sqlStr = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, ' |
| | | + 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, ' |
| | | + 'Posting_Date__c,Management_Code__c,IF_Warranty_Service__c,Reson_Can_not_Warranty__c, InstallDate,isNewDate_use__c, ' |
| | | + 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c, ' |
| | | + 'CurrentContract_End_Date__c, Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c, ' |
| | | + 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c, CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,' |
| | |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | + 'CurrentContract_F__r.Gurantee_Renew_startDate__c,' |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | // (2022年12月上线)故障品加费 start |
| | | + 'Return_Without_Repair__r.Repair_List_Price_formula__c,' |
| | | // (2022年12月上线)故障品加费 end |
| | | + 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,' |
| | | + 'CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | + 'CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c,' |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | //URF限次合同2期 LY 20220811 start |
| | | + 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,' |
| | | //URF限次合同2期 LY 20220811 end |
| | | + 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\' ' |
| | | + 'AND Id NOT IN ' + notInId; |
| | | //HWAG-B4R3SS START 20181026 |
| | |
| | | //HWAG-BDJ43R---XHL---20190729--- |
| | | sqlStr += ' AND ( AssetMark__c != \'耗材\' OR Product2.Family != \'ET\' )'; |
| | | //HWAG-BDJ43R---XHL---20190729--- |
| | | sqlStr += ' ORDER BY ID,IF_Warranty__c asc '; |
| | | sqlStr += ' ORDER BY ID,IF_Warranty_Service__c asc '; |
| | | if (currPage == 1) { |
| | | sqlStr += 'limit ' + selRecordOption; |
| | | } else { |
| | |
| | | //2021-11-30 fy add LJPH-C8W8FV 置顶 start OwnershipMachine_No__c Product2.ProductURF__c |
| | | //tcm 添加 Management_Code__c 20211201 start |
| | | sqlStr = 'SELECT Id, Name,OwnershipMachine_No__c, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c,'; |
| | | sqlStr += 'Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c,InstallDate,isNewDate_use__c,'; |
| | | sqlStr += 'Posting_Date__c,Management_Code__c,IF_Warranty_Service__c,Reson_Can_not_Warranty__c,InstallDate,isNewDate_use__c,'; |
| | | sqlStr += 'Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c,'; |
| | | sqlStr += 'CurrentContract_End_Date__c,Extend_Gurantee_DateTo__c,EquipmentGuaranteeFlg__c,'; |
| | | sqlStr += 'CurrentContract_F__c,CurrentContract_F__r.Maintenance_Contract_No_F__c,CurrentContract_F__r.Management_Code__c,CurrentContract_F__r.RecordType_DeveloperName__c,CurrentContract_F__r.Estimate_Num__c,CurrentContract_F__r.Contract_End_Date__c,'; |
| | |
| | | //变更多年保续签开始日 thh 20220315 start |
| | | sqlStr += 'CurrentContract_F__r.Gurantee_Renew_startDate__c,'; |
| | | //变更多年保续签开始日 thh 20220315 end |
| | | // (2022年12月上线)故障品加费 start |
| | | sqlStr += 'Return_Without_Repair__r.Repair_List_Price_formula__c,'; |
| | | // (2022年12月上线)故障品加费 end |
| | | sqlStr += 'CurrentContract_F__r.First_Estimate_Date__c,CurrentContract_F__r.Estimate_Contract_endDate__c,'; |
| | | sqlStr += 'Product2.ProductURF__c,CurrentContract_F__r.Contract_Consumption_rate__c,CurrentContract_F__r.First_contract_usage_Rate__c,'; |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 start |
| | | sqlStr += 'CurrentContract_F__r.Open_RenewalQuotation__c,CurrentContract_F__r.VM_Contract_Check__c,'; |
| | | //WLIG-CDFBV3 开通续签报价为true的可以开放续签报价 thh 20220414 end |
| | | //URF限次合同2期 LY 20220811 start |
| | | sqlStr += 'URF_Maintenance_Contract__c,URF_Maintenance_Contract__r.Management_Code__c,URF_Maintenance_Contract__r.Contract_End_Date__c,'; |
| | | //URF限次合同2期 LY 20220811 end |
| | | sqlStr += ' CurrentContract_F__r.Contract_Range__c,AssetMark__c,NoPartRiskDate__c,NoPartRiskDate_F__c,Product2.PartSupplyFinishDate__c,SignableFlag__c FROM Asset WHERE Hospital__c = \'' + this.targetHospitalId + '\''; |
| | | //JZHG-BSDUT4 ---20200825---update By rentongxiao---Start |
| | | // sqlStr += ' AND ( AssetMark__c != \'耗材\' OR Product2.Family != \'ET\' ) '; |
| | |
| | | //HWAG-B4R3SS END 20181026 |
| | | if (checkIdList.size() > 0) { |
| | | sqlStr += ' AND Id NOT IN ' + checkIdList; |
| | | //temAsset = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, |
| | | //temAsset = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty_Service__c,Reson_Can_not_Warranty__c, |
| | | // InstallDate, Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c,CurrentContract_End_Date__c,Extend_Gurantee_DateTo__c |
| | | // FROM Asset WHERE Hospital__c = :this.targetHospitalId AND Id NOT IN : checkIdList AND AssetMark__c != '耗材' AND Product2.Family != 'ET' ORDER BY ID,IF_Warranty__c asc limit : sqlLimit]; |
| | | // FROM Asset WHERE Hospital__c = :this.targetHospitalId AND Id NOT IN : checkIdList AND AssetMark__c != '耗材' AND Product2.Family != 'ET' ORDER BY ID,IF_Warranty_Service__c asc limit : sqlLimit]; |
| | | } else { |
| | | //temAsset = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty__c,Reson_Can_not_Warranty__c, |
| | | //temAsset = [SELECT Id, Name, Asset_situation__c, SerialNumber, Department_Name__c, Installation_Site__c, Posting_Date__c,Management_Code__c,IF_Warranty_Service__c,Reson_Can_not_Warranty__c, |
| | | // InstallDate, Asset_Owner__c, Accumulation_Repair_Amount__c, Maintenance_Price_Month__c, Final_Examination_Date__c,CurrentContract_End_Date__c,Extend_Gurantee_DateTo__c |
| | | // FROM Asset WHERE Hospital__c = :this.targetHospitalId AND AssetMark__c != '耗材' AND Product2.Family != 'ET' ORDER BY ID,IF_Warranty__c asc limit : sqlLimit]; |
| | | // FROM Asset WHERE Hospital__c = :this.targetHospitalId AND AssetMark__c != '耗材' AND Product2.Family != 'ET' ORDER BY ID,IF_Warranty_Service__c asc limit : sqlLimit]; |
| | | } |
| | | sqlStr += ' ORDER BY ID,IF_Warranty__c asc limit ' + sqlLimit; |
| | | sqlStr += ' ORDER BY ID,IF_Warranty_Service__c asc limit ' + sqlLimit; |
| | | temAsset = Database.query(sqlStr); |
| | | //HWAG-BDJ43R ---XHL---20190729--- |
| | | if (temAsset.size() >= (currPage * selctRecordNum)) { |
| | |
| | | totalPage = (totalRecords / selctRecordNum) + (Math.mod(totalRecords, selctRecordNum) > 0 ? 1 : 0); |
| | | this.setPageRecord(); |
| | | } |
| | | |
| | | //2022 故障品加费 判断修理金额是否低于8折以下 |
| | | public PageReference judgePrice(Boolean islessPrice){ |
| | | disableEmailBtn = islessPrice; |
| | | System.debug(LoggingLevel.INFO, '*** disableEmailBtn: ' + disableEmailBtn); |
| | | return null; |
| | | } |
| | | |
| | | //list分割 集合大小超过1000对应 |
| | | private void listCut(List<AssetInfo> records) { |
| | |
| | | // 20191210 Gzw 服务合同过去3年修理实绩合并 |
| | | List<AggregateResult> FriRepairList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | ]; |
| | | List<AggregateResult> SecRepairList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | // 过去3年间修理实绩 |
| | | List<AggregateResult> ThiRepairList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | // 过去3年修理实绩 |
| | | List<AggregateResult> ThreeyearList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | // 20191210 Gzw 服务合同过去3年修理实绩合并 |
| | | List<AggregateResult> FriRepairList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | ]; |
| | | List<AggregateResult> SecRepairList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | // 过去3年间修理实绩 |
| | | List<AggregateResult> ThiRepairList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | // 过去3年修理实绩 |
| | | List<AggregateResult> ThreeyearList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | sum(Repair_List_Price_formula__c) SumPrice, |
| | | //2019/1添加 |
| | | sum(Repair_Quotation_Id__r.sales_discount__c) sales_discount, |
| | | sum(Repair_Quotation_Id__r.Contract_target__c) contract_target, |
| | |
| | | return null; |
| | | } |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ end |
| | | NextMaintenanceContract(); |
| | | |
| | | Id vmMaintenance_Contract = Schema.SObjectType.Maintenance_Contract_Estimate__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Quote').getRecordTypeId(); |
| | | estimate.recordtypeid = vmMaintenance_Contract; |
| | |
| | | } |
| | | AssetHandler.disabled = true; |
| | | if (syncEstimate(false, false)) { |
| | | |
| | | // 故障品加费2022/11/18 |
| | | // if (estimate.IS_Reduced_price_approval__c=='否' || estimate.IS_Reduced_price_approval__c=='审批中') { |
| | | // Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest(); |
| | | // psr.setObjectId(this.estimate.id); |
| | | // Approval.ProcessResult submitResult = Approval.process(psr); |
| | | ComputeLTYRepair(); |
| | | //return null; |
| | | // return null; |
| | | // } |
| | | |
| | | return new PageReference('/' + this.targetEstimateId + '/e?completion=5'); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public PageReference toApprovalProcess() { |
| | | Id vmMaintenance_Contract = Schema.SObjectType.Maintenance_Contract_Estimate__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Quote').getRecordTypeId(); |
| | | estimate.recordtypeid = vmMaintenance_Contract; |
| | | // 故障品加费2022/11/18 |
| | | if (estimate.IS_Reduced_price_approval__c=='否' || estimate.IS_Reduced_price_approval__c=='审批中') { |
| | | Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest(); |
| | | psr.setObjectId(this.estimate.id); |
| | | Approval.ProcessResult submitResult = Approval.process(psr); |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * 印刷メソッド、decide前は保有設備、decide後は合同配置 |
| | | */ |
| | |
| | | * 申請メソッド、最後必ず承認プロセスに載せる |
| | | */ |
| | | public PageReference approvalProcess() { |
| | | |
| | | |
| | | Id vmMaintenance_Contract = Schema.SObjectType.Maintenance_Contract_Estimate__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Quote').getRecordTypeId(); |
| | | estimate.recordtypeid = vmMaintenance_Contract; |
| | | |
| | |
| | | } |
| | | return null; |
| | | } |
| | | /** |
| | | * FSE修理値引きメール提出 2022故障品加费 |
| | | */ |
| | | |
| | | public PageReference sendEmail() { |
| | | // System.debug(LoggingLevel.INFO, '*** in sendEmail: '); |
| | | // // this.estimate |
| | | // // save(); |
| | | // Oly_TriggerHandler.bypass('Maintenance_Contract_Asset__c'); |
| | | // Oly_TriggerHandler.bypass('AssetHandler'); |
| | | // // Oly_TriggerHandler.bypass('AssetTrigger'); |
| | | // Oly_TriggerHandler.bypass('AssetHandlerCheck'); |
| | | // Oly_TriggerHandler.bypass('SetContractEstimatePriceHandler'); |
| | | // StaticParameter.EscapeVMCTrigger = true; |
| | | // //add by rentx 2020-11-13 LJPH-BV93RZ start |
| | | // if (estimate.Contract_Range__c == null) { |
| | | // this.estimate.Contract_Range__c.addError('必须输入合同月数!'); |
| | | // return null; |
| | | // } |
| | | // EmailTemplate temp = [ |
| | | // SELECT Id, Name, Subject, HtmlValue, Body, BrandTemplateId |
| | | // FROM EmailTemplate |
| | | // WHERE DeveloperName = 'SendMailLess80' |
| | | // LIMIT 1 |
| | | // ]; |
| | | // System.debug(LoggingLevel.INFO, '*** temp: '+ temp); |
| | | |
| | | // //简档不确定 待修改 |
| | | // List<String> sendEaddress = new List<String>(); |
| | | // // for (User u : [SELECT Email FROM User WHERE Profile.Name ='2F3_合同组' AND IsActive=true]) { |
| | | // // sendEaddress.add(u.Email); |
| | | // // } |
| | | |
| | | // for (User u : [SELECT Email FROM User WHERE Profile.Name ='ATEST_故障品' AND IsActive=true]) { |
| | | // sendEaddress.add(u.Email); |
| | | // } |
| | | // System.debug(LoggingLevel.INFO, '*** sendEaddress: ' + sendEaddress); |
| | | |
| | | // System.debug(LoggingLevel.INFO, '*** this.estimate: ' + this.estimate); |
| | | |
| | | // Messaging.SingleEmailMessage email = Messaging.renderStoredEmailTemplate(temp.Id,null, this.estimate.Id); |
| | | // email.setSaveAsActivity(false); |
| | | // email.setToAddresses(sendEaddress); |
| | | |
| | | // Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email}); |
| | | |
| | | // return null; |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** in sendEmail: '); |
| | | // this.estimate |
| | | save(); |
| | | |
| | | EmailTemplate temp = [ |
| | | SELECT Id, Name, Subject, HtmlValue, Body, BrandTemplateId |
| | | FROM EmailTemplate |
| | | WHERE DeveloperName = 'SendMailLess80' |
| | | LIMIT 1 |
| | | ]; |
| | | System.debug(LoggingLevel.INFO, '*** temp: '+ temp); |
| | | |
| | | //简档不确定 待修改 |
| | | List<String> sendEaddress = new List<String>(); |
| | | // for (User u : [SELECT Email FROM User WHERE Profile.Name ='2F3_合同组' AND IsActive=true]) { |
| | | // sendEaddress.add(u.Email); |
| | | // } |
| | | |
| | | for (User u : [SELECT Email FROM User WHERE Profile.Name ='ATEST_故障品' AND IsActive=true]) { |
| | | sendEaddress.add(u.Email); |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** sendEaddress: ' + sendEaddress); |
| | | |
| | | System.debug(LoggingLevel.INFO, '*** this.estimate: ' + this.estimate); |
| | | |
| | | Messaging.SingleEmailMessage email = Messaging.renderStoredEmailTemplate(temp.Id,null, this.estimate.Id); |
| | | email.setSaveAsActivity(false); |
| | | email.setToAddresses(sendEaddress); |
| | | |
| | | Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email}); |
| | | System.debug(LoggingLevel.INFO, '*** sendEmail end: '); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 決定取消メソッド |
| | |
| | | return null; |
| | | } |
| | | |
| | | public PageReference dosomething() { |
| | | System.debug('dosomething start'); |
| | | NextMaintenanceContract(); |
| | | return null; |
| | | } |
| | | public void NextMaintenanceContract() { |
| | | // 20220810 询价2期开发 |
| | | List<String> asslocalList = new List<String>(); |
| | | List<String> mcalocalList = new List<String>(); |
| | | Map<Id, Maintenance_Contract__c> map3 = new Map<Id, Maintenance_Contract__c>(); |
| | | |
| | | List<Maintenance_Contract_Asset__c> mcaupdateList = new List<Maintenance_Contract_Asset__c>(); |
| | | for (AssetInfo ass : this.checkedAssets) { |
| | | if (!ass.isManual) { |
| | | asslocalList.add(ass.rec.Id); |
| | | map3.put(ass.rec.Id,this.contract); |
| | | } |
| | | } |
| | | // System.debug('asslocalList====%%%' +asslocalList); |
| | | List<Maintenance_Contract_Asset__c> mcalist1 = [select id,Asset__c,Next_Maintenance_Contract__c,Maintenance_Contract__c |
| | | from Maintenance_Contract_Asset__c |
| | | where id in (select CurrentContract_F_asset__c |
| | | from asset |
| | | where id in :asslocalList and CurrentContract_F_asset__c!=null)]; |
| | | // System.debug('mcalist1====%%%' +mcalist1); |
| | | // System.debug('map3====%%%' +map3); |
| | | for (Maintenance_Contract_Asset__c mca : mcalist1) { |
| | | Maintenance_Contract_Asset__c mca3 = new Maintenance_Contract_Asset__c(); |
| | | if (map3.containsKey(mca.Asset__c)) { |
| | | mca3.id = mca.id; |
| | | mca3.Next_Maintenance_Contract__c = map3.get(mca.Asset__c).id; |
| | | // System.debug('mca3.id====%%%' +mca3.id); |
| | | if (mca3.id!=null&&!mcaupdateList.contains(mca3)) { |
| | | mcaupdateList.add(mca3); |
| | | } |
| | | } |
| | | } |
| | | // System.debug('mcaupdateList====%%%' +mcaupdateList); |
| | | if (mcaupdateList!=null&&!mcaupdateList.isEmpty()) { |
| | | update mcaupdateList; |
| | | } |
| | | System.debug('更新完成mcaupdateList'); |
| | | } |
| | | |
| | | /** |
| | | * 決定メソッド |
| | | */ |
| | | public PageReference decide() { |
| | | System.debug('decide start'); |
| | | NextMaintenanceContract(); |
| | | inDicideFlag = true; |
| | | // TODO check decide 资格 |
| | | Savepoint sp = Database.setSavepoint(); |
| | |
| | | this.estimate.LastMContract5__c = lastMContractRes[4].contractId; |
| | | this.estimate.LastMContract5_NO__c = lastMContractRes[4].contractNo; |
| | | this.estimate.LastMContract5_ConCount__c = lastMContractRes[4].count; |
| | | |
| | | //URF限次合同2期 LY 20220908 start |
| | | List<lastMContract> urfMContractRes; |
| | | if (isDecide) { |
| | | system.debug('执行了tcm isDecide'); |
| | | urfMContractRes = getURFMContract(this.checkedAssets,this.estimate.Contract_Start_Date__c); |
| | | } else{ |
| | | system.debug('执行了tcm NODecide'); |
| | | urfMContractRes = getURFMContract(this.checkedAssets,this.estimate.Contract_Esti_Start_Date__c); |
| | | } |
| | | this.estimate.URFMContract1__c = urfMContractRes[0].contractId; |
| | | this.estimate.URF_LastMContract1_NO__c = urfMContractRes[0].contractNo; |
| | | this.estimate.URF_LastMContract1_ConCount__c = urfMContractRes[0].count; |
| | | |
| | | //this.estimate.URFMContract2__c = urfMContractRes[1].contractId; |
| | | this.estimate.URF_LastMContract2_NO__c = urfMContractRes[1].contractNo; |
| | | this.estimate.URF_LastMContract2_ConCount__c = urfMContractRes[1].count; |
| | | |
| | | //this.estimate.URFMContract3__c = urfMContractRes[2].contractId; |
| | | this.estimate.URF_LastMContract3_NO__c = urfMContractRes[2].contractNo; |
| | | this.estimate.URF_LastMContract3_ConCount__c = urfMContractRes[2].count; |
| | | |
| | | //this.estimate.URFMContract4__c = urfMContractRes[3].contractId; |
| | | this.estimate.URF_LastMContract4_NO__c = urfMContractRes[3].contractNo; |
| | | this.estimate.URF_LastMContract4_ConCount__c = urfMContractRes[3].count; |
| | | |
| | | //this.estimate.URFMContract5__c = urfMContractRes[4].contractId; |
| | | this.estimate.URF_LastMContract5_NO__c = urfMContractRes[4].contractNo; |
| | | this.estimate.URF_LastMContract5_ConCount__c = urfMContractRes[4].count; |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | // 原方法 |
| | | // List<lastMContract> lastMContractRes = getlastMContract(this.checkedAssets, this.estimate.Contract_Start_Date__c); |
| | |
| | | this.contract.LastMContract5_NO__c = this.estimate.LastMContract5_NO__c; |
| | | this.contract.LastMContract5_ConCount__c = this.estimate.LastMContract5_ConCount__c; |
| | | // 追加上期合同信息 end |
| | | |
| | | //URF限次合同2期 LY 20220908 start |
| | | //追加上期限次合同信息 start |
| | | this.contract.URF_LastMContract1__c = this.estimate.URFMContract1__c; |
| | | this.contract.URF_LastMContract1_startDate__c = this.estimate.URFMContract1_startDate__c; |
| | | this.contract.URF_LastMContract1_endDate__c = this.estimate.URFMContract1_endDate__c; |
| | | this.contract.URF_LastMContract1_NO__c = this.estimate.URF_LastMContract1_NO__c; |
| | | this.contract.URF_LastMContract1_ConCount__c = this.estimate.URF_LastMContract1_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract2__c = this.estimate.URFMContract2__c; |
| | | this.contract.URF_LastMContract2_NO__c = this.estimate.URF_LastMContract2_NO__c; |
| | | this.contract.URF_LastMContract2_ConCount__c = this.estimate.URF_LastMContract2_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract3__c = this.estimate.URFMContract3__c; |
| | | this.contract.URF_LastMContract3_NO__c = this.estimate.URF_LastMContract3_NO__c; |
| | | this.contract.URF_LastMContract3_ConCount__c = this.estimate.URF_LastMContract3_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract4__c = this.estimate.URFMContract4__c; |
| | | this.contract.URF_LastMContract4_NO__c = this.estimate.URF_LastMContract4_NO__c; |
| | | this.contract.URF_LastMContract4_ConCount__c = this.estimate.URF_LastMContract4_ConCount__c; |
| | | |
| | | //this.contract.URF_LastMContract5__c = this.estimate.URFMContract5__c; |
| | | this.contract.URF_LastMContract5_NO__c = this.estimate.URF_LastMContract5_NO__c; |
| | | this.contract.URF_LastMContract5_ConCount__c = this.estimate.URF_LastMContract5_ConCount__c; |
| | | // 追加上期限次合同信息 end |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | system.debug('测算isDecide的结果_1::::::::' + isDecide); |
| | | if (isDecide == true) { |
| | |
| | | this.estimate.Contract_Range__c.addError('必须输入合同月数!'); |
| | | return null; |
| | | } |
| | | NextMaintenanceContract(); |
| | | //add by rentx 2020-11-13 LJPH-BV93RZ end |
| | | if (syncEstimate(false, false)) { |
| | | PageReference ret = null; |
| | |
| | | } |
| | | |
| | | if (isSaveOrApproval) { |
| | | if (input.rec.IF_Warranty__c == '否') { |
| | | if (input.rec.IF_Warranty_Service__c == '否') { |
| | | input.rec.Name.addError(input.rec.Name + '(' + input.rec.SerialNumber + ') -- 不能选择不可参保设备'); |
| | | rtn = false; |
| | | } |
| | |
| | | // 新合同备品确保提供 当前标记 |
| | | public Boolean etGFlg {get; set;} |
| | | public Integer lineNo {get; private set;} |
| | | public Decimal Repair_Price_Auto {get; set;} |
| | | public Boolean rec_checkBox_c {get; set;} |
| | | public Asset rec { get; set; } |
| | | public Maintenance_Contract_Asset_Estimate__c mcae { get; set; } |
| | |
| | | public AssetInfo(Integer lineNo, Asset record, Boolean isNew, Decimal listPrice, Maintenance_Contract_Asset_Estimate__c mcae) { |
| | | this.lineNo = lineNo; |
| | | this.rec = record; |
| | | // (2022年12月上线)故障品加费 start |
| | | if (record.Return_Without_Repair__r.Repair_List_Price_formula__c!=null) { |
| | | this.Repair_Price_Auto = record.Return_Without_Repair__r.Repair_List_Price_formula__c; |
| | | } |
| | | // (2022年12月上线)故障品加费 end |
| | | this.mcae = new Maintenance_Contract_Asset_Estimate__c( |
| | | // id = mcae.Id, // 本当にいらないの? セットしたら、新規権限がなくでも、更新できます。後藤さんに確認した、なくでもいいです。 |
| | | isNew__c = isNew, |
| | |
| | | Adjustment_Lower_price__c = mcae.Adjustment_Lower_price__c, |
| | | Asset_Consumption_rate__c = mcae.Asset_Consumption_rate__c |
| | | // LJPH-C9GD34 gzw fix start |
| | | ,Estimate_List_Price_Page__c = mcae.Estimate_List_Price_Page__c |
| | | ,Estimate_List_Price_Page__c = mcae.Estimate_List_Price_Page__c, |
| | | // LJPH-C9GD34 gzw fix end |
| | | //(2022年12月上线)故障品加费 第三方回归 |
| | | Third_Party_Return__c = mcae.Third_Party_Return__c |
| | | ); |
| | | this.isManual = false; |
| | | this.rec_checkBox_c = true; |
| | |
| | | Contract_Esti_Start_Date__c = mcae.Maintenance_Contract_Estimate__r.Contract_Esti_Start_Date__c |
| | | // Contract_Esti_Start_Date__c=mcae.Contract_Esti_Start_Date__c |
| | | // LJPH-C9GD34 gzw fix start |
| | | ,Estimate_List_Price_Page__c = mcae.Estimate_List_Price_Page__c |
| | | ,Estimate_List_Price_Page__c = mcae.Estimate_List_Price_Page__c, |
| | | // LJPH-C9GD34 gzw fix end |
| | | //(2022年12月上线)故障品加费 第三方回归 |
| | | Third_Party_Return__c = mcae.Third_Party_Return__c |
| | | ); |
| | | this.isManual = true; |
| | | this.rec_checkBox_c = false; |
| | |
| | | public AssetInfo(Integer lineNo, Asset record) { |
| | | this.lineNo = lineNo; |
| | | this.rec = record; |
| | | // (2022年12月上线)故障品加费 start |
| | | if (record.Return_Without_Repair__r.Repair_List_Price_formula__c!=null) { |
| | | this.Repair_Price_Auto = record.Return_Without_Repair__r.Repair_List_Price_formula__c; |
| | | } |
| | | // (2022年12月上线)故障品加费 end |
| | | this.isManual = false; |
| | | this.rec_checkBox_c = false; |
| | | this.orgPrice = record.Maintenance_Price_Month__c; |
| | |
| | | //List<lastMContract> listResult = new List<lastMContract>(); |
| | | return listResult; |
| | | } |
| | | |
| | | |
| | | //URF限次合同2期 LY 20220908 start |
| | | //对限次合同进行排序 |
| | | public static List<lastMContract> getURFMContract(List<AssetInfo> checkedAssets, Date startDate) { |
| | | Map<String, lastMContract> urfMContractMap = new Map<String, lastMContract>(); |
| | | Map<String, lastMContract> lastMContractMap1 = new Map<String, lastMContract>(); |
| | | for (AssetInfo ai : checkedAssets) { |
| | | lastMContract urfMC = new lastMContract(ai.rec.URF_Maintenance_Contract__c, ai.rec.URF_Maintenance_Contract__r.Management_Code__c, ai.rec.URF_Maintenance_Contract__r.Contract_End_Date__c, 1); |
| | | if (String.isNotBlank(ai.rec.URF_Maintenance_Contract__c)) { |
| | | if (urfMContractMap.containsKey(ai.rec.URF_Maintenance_Contract__c)) { |
| | | urfMContractMap.get(ai.rec.URF_Maintenance_Contract__c).count++; |
| | | } else { |
| | | urfMContractMap.put(ai.rec.URF_Maintenance_Contract__c, urfMC); |
| | | } |
| | | } |
| | | } |
| | | List<lastMContract> listResulttemp = new List<lastMContract>(); |
| | | List<lastMContract> listResult = new List<lastMContract>(); |
| | | |
| | | for ( lastMContract ll : urfMContractMap.values()) { |
| | | listResulttemp.add(ll); |
| | | } |
| | | listResulttemp.sort(); |
| | | if (listResulttemp.size() >= 5){ |
| | | for (Integer i = 0; i < listResulttemp.size(); i++) { |
| | | |
| | | if (listResulttemp.size() >= i + 1) { |
| | | listResult.add(listResulttemp[i]); |
| | | } |
| | | } |
| | | }else { |
| | | for (Integer i = 0; i < listResulttemp.size(); i++) { |
| | | if (listResulttemp.size() >= i + 1) { |
| | | listResult.add(listResulttemp[i]); |
| | | } |
| | | } |
| | | for (Integer i = listResulttemp.size(); i < 5; i++) { |
| | | listResult.add(new lastMContract(null, null, null, null)); |
| | | } |
| | | } |
| | | |
| | | return listResult; |
| | | } |
| | | //URF限次合同2期 LY 20220908 end |
| | | |
| | | public static List<Data> getChartData() { |
| | | List<Data> data = new List<Data>(); |
| | |
| | | // System.assertEquals(1, controller.dataList.size()); |
| | | controller.save(); |
| | | controller.changedAfterPrint = true; |
| | | Test.StartTest(); |
| | | controller.syncEstimate(true,true); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | |
| | | // 納入機器の情報を取得 |
| | | if ( this.targetHospitalId == null || ( this.targetHospitalId.length() != 15 && this.targetHospitalId.length() != 18)) { |
| | | //this.assetRecords = new List<Asset>(); |
| | | system.debug('assetRecords123456789==' + assetRecords); |
| | | } else { |
| | | // HWAG-BHD66X start |
| | | assetRecords = [SELECT Id, Name, CheckBox__c, SerialNumber,TransferToOther__c /*临时用*/, |
| | |
| | | // fxk 2021/9/17 点检对象临时用 end |
| | | FROM Asset |
| | | WHERE Hospital__c = :this.targetHospitalId |
| | | // XLIU-CK46FR zyh start |
| | | AND Status != '廃棄' AND Status != '待报废' |
| | | AND (Competitor_Name__c = '奥林巴斯' OR Competitor_Name__c = '' OR Competitor_Name__c = '其他') |
| | | AND Category1__c != 'ET' |
| | | AND (Category1__c != 'SP' OR Category2__c != '附属品' ) |
| | | AND (Category1__c != 'GI' OR Category2__c != '附属品' OR Category4__c != 'OER' ) |
| | | AND (Category1__c != 'GI' OR Category2__c != '其他' ) |
| | | AND (Category1__c != 'ENG' OR Category2__c != '附属品' ) |
| | | AND (Category1__c != 'ENG' OR Category2__c != '耗材' ) |
| | | // AND (Category1__c != 'SP' OR Category2__c != '附属品' ) |
| | | // AND (Category1__c != 'GI' OR (Category2__c != '附属品' OR Category2__c != '其他') ) |
| | | // AND (Category1__c != 'ENG' OR (Category2__c != '附属品' OR Category2__c != '耗材') ) |
| | | // AND AssetMark__c != '耗材' |
| | | // XLIU-CK46FR zyh end |
| | | AND ( AssetMark__c != '耗材' OR Product2.Family != 'ET' ) |
| | | ORDER BY Department_Name__c, Posting_Date__c, SerialNumber]; |
| | | system.debug('assetRecords123456789' + assetRecords); |
| | | ORDER BY Department_Name__c, Posting_Date__c, SerialNumber |
| | | ]; |
| | | // system.debug('assetRecords123456789' + assetRecords); |
| | | system.debug('assetRecords123456789' + assetRecords.size()); |
| | | // HWAG-BHD66X end |
| | | } |
| | | |
| | |
| | | @isTest |
| | | private class SelectAssetExtensionTester { |
| | | private static Id pricebookId = ControllerUtil.getStandardPricebook().Id; |
| | | static Asset createAsset(String input, String accountid, String dcId, String hpId) { |
| | | static Asset createAsset(String input, String accountid, String dcId, String hpId, String productA) { |
| | | Asset asset = new Asset(); |
| | | asset.Name = 'テスト機器'; |
| | | asset.AccountId = accountid; |
| | | asset.Department_Class__c = dcId; |
| | | asset.Hospital__c = hpId; |
| | | asset.SerialNumber = 'testserial'; |
| | | asset.Product2ID = productA; |
| | | asset.IsCompetitorProduct = true; |
| | | insert asset; |
| | | return asset; |
| | | } |
| | |
| | | insert dep; |
| | | |
| | | // 製品を作る |
| | | Product2 productA = new Product2( Name='テスト商品'); |
| | | Product2 productA = new Product2( Name='テスト商品',Brand_Name__c='奥林巴斯'); |
| | | insert productA; |
| | | |
| | | // 価格表エントリを作成する |
| | |
| | | insert entry; |
| | | |
| | | // 納入機器を作成する |
| | | Asset asset01 = createAsset('asset01', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset02 = createAsset('asset02', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset03 = createAsset('asset03', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset04 = createAsset('asset04', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset05 = createAsset('asset05', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset01 = createAsset('asset01', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset02 = createAsset('asset02', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset03 = createAsset('asset03', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset04 = createAsset('asset04', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset05 = createAsset('asset05', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | |
| | | // 维修合同を作成する |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| | |
| | | insert entry; |
| | | |
| | | // 納入機器を作成する |
| | | Asset asset01 = createAsset('asset01', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset02 = createAsset('asset02', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset03 = createAsset('asset03', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset04 = createAsset('asset04', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset05 = createAsset('asset05', dep.Id, strategicDep[0].Id, hospital.Id); |
| | | Asset asset01 = createAsset('asset01', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset02 = createAsset('asset02', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset03 = createAsset('asset03', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset04 = createAsset('asset04', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | Asset asset05 = createAsset('asset05', dep.Id, strategicDep[0].Id, hospital.Id, productA.Id); |
| | | |
| | | // 维修合同を作成する |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| New file |
| | |
| | | /** |
| | | * [SetFrameNumManageBatch 进口单证上传后查找字段batch更新] |
| | | * @Author lijinhuan |
| | | * @DateTime 2022-11-04T18:31:03+0800 |
| | | * @return [] |
| | | */ |
| | | global without sharing class SetFrameNumManageBatch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | |
| | | global SetFrameNumManageBatch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | query = 'select Id,SerialNumberS__c,InspectionCard__c,ApplyList__c from FrameNumManage__c where '; |
| | | // query += '('; |
| | | query += ' signInForm__c = null '; |
| | | query += ' OR Statu_Achievements_DN_details__c = null '; |
| | | query += ' OR Asset__c = null '; |
| | | query += ' OR (InspectionCard_Select__c = null AND InspectionCard__c != null AND InspectionCard__c !=\'不出证\')'; |
| | | query += ' OR (InspectionCard_Select__c != null AND (InspectionCard__c =\'不出证\' OR InspectionCard__c = null))';// 清空 |
| | | query += ' OR (ApplyList_Select__c = null AND ApplyList__c != null)'; |
| | | query += ' OR (ApplyList_Select__c != null AND ApplyList__c = null)';// 清空 |
| | | // query += ')'; |
| | | // query += ' AND id = \'a5D9D0000000WqF\''; |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<FrameNumManage__c> fnmList) { |
| | | Map<String,String> InspectionCardMap = new Map<String,String>(); |
| | | Map<String,String> ApplyListMap = new Map<String,String>(); |
| | | Map<String,Id> InspectionCardIdMap = new Map<String,Id>(); |
| | | Map<String,Id> ApplyListIdMap = new Map<String,Id>(); |
| | | Set<String> SerialNumberSet = new Set<String>(); |
| | | Set<Id> clearSet = new Set<Id>(); |
| | | for(FrameNumManage__c fnm:fnmList){ |
| | | // 清空 |
| | | if(String.isBlank(fnm.ApplyList__c) |
| | | || String.isBlank(fnm.InspectionCard__c) |
| | | ||(!String.isBlank(fnm.InspectionCard__c) && fnm.InspectionCard__c == '不出证')){ |
| | | clearSet.add(fnm.Id); |
| | | }else{ |
| | | //赋值 |
| | | SerialNumberSet.add(fnm.SerialNumberS__c); |
| | | InspectionCardMap.put(fnm.SerialNumberS__c,fnm.InspectionCard__c); |
| | | ApplyListMap.put(fnm.SerialNumberS__c,fnm.ApplyList__c); |
| | | } |
| | | |
| | | } |
| | | // 发货DN明细 |
| | | Map<String,Id> DNdetailMap = new Map<String,Id>(); |
| | | Map<String,String> DNMap = new Map<String,String>(); |
| | | for(Statu_Achievements_DN_details__c dn:[SELECT Id,SerialNumber__c,Statu_Achievements_DN__c,Statu_Achievements_DN__r.Name FROM Statu_Achievements_DN_details__c WHERE SerialNumber__c IN: SerialNumberSet]){ |
| | | DNdetailMap.put(dn.SerialNumber__c,dn.Id); |
| | | DNMap.put(dn.SerialNumber__c,dn.Statu_Achievements_DN__r.Name); |
| | | } |
| | | // 签收单 |
| | | Map<String,Id> eSignFormMap = new Map<String,Id>(); |
| | | for(eSignForm__c es:[SELECT Id,DNName__c FROM eSignForm__c WHERE DNName__c IN: DNMap.values()]){ |
| | | for(String key:DNMap.keySet()){ |
| | | if(DNMap.get(key) == es.DNName__c){ |
| | | eSignFormMap.put(key,es.Id); |
| | | } |
| | | } |
| | | } |
| | | // 保有设备 |
| | | Map<String,Id> AssetMap = new Map<String,Id>(); |
| | | for(Asset ass:[SELECT Id,SerialNumber FROM Asset WHERE SerialNumber IN: SerialNumberSet]){ |
| | | AssetMap.put(ass.SerialNumber,ass.Id); |
| | | } |
| | | Set<String> FilesNameSet = new Set<String>(); |
| | | FilesNameSet.addAll(InspectionCardMap.values()); |
| | | FilesNameSet.addAll(ApplyListMap.values()); |
| | | // 商检证 InspectionCard_Select__c 报关单 ApplyList_Select__c |
| | | for(FileAddress__c fa:[SELECT Id,OnlyFileName__c FROM FileAddress__c WHERE OnlyFileName__c IN: FilesNameSet]){ |
| | | for(String key:InspectionCardMap.keySet()){ |
| | | if(InspectionCardMap.get(key) == fa.OnlyFileName__c){ |
| | | InspectionCardIdMap.put(key,fa.Id); |
| | | } |
| | | if(ApplyListMap.get(key) == fa.OnlyFileName__c){ |
| | | ApplyListIdMap.put(key,fa.Id); |
| | | } |
| | | } |
| | | } |
| | | // 最后整合 |
| | | List<FrameNumManage__c> upFnmList = new List<FrameNumManage__c>(); |
| | | for(FrameNumManage__c fnm:fnmList){ |
| | | FrameNumManage__c temp = new FrameNumManage__c(); |
| | | temp.Id = fnm.Id; |
| | | if(clearSet.contains(fnm.Id)){ |
| | | temp.InspectionCard_Select__c = null; |
| | | temp.ApplyList_Select__c = null; |
| | | }else{ |
| | | temp.Statu_Achievements_DN_details__c = DNdetailMap.get(fnm.SerialNumberS__c); |
| | | temp.signInForm__c = eSignFormMap.get(fnm.SerialNumberS__c); |
| | | temp.Asset__c = AssetMap.get(fnm.SerialNumberS__c); |
| | | temp.InspectionCard_Select__c = InspectionCardIdMap.get(fnm.SerialNumberS__c); |
| | | temp.ApplyList_Select__c = ApplyListIdMap.get(fnm.SerialNumberS__c); |
| | | } |
| | | upFnmList.add(temp); |
| | | } |
| | | // System.debug('zhelieupFnmList:'+upFnmList.size()); |
| | | if(upFnmList.size() > 0){ |
| | | update upFnmList; |
| | | } |
| | | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>48.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | global class SpareIsLoanBatchSchedule implements Schedulable { |
| | | // |
| | | global void execute(SchedulableContext sc) { |
| | | Id execBTId = database.executebatch(new SpareIsLoanBatch(),200); |
| | | Id execBTId = database.executebatch(new SpareIsLoanBatch(),100); |
| | | } |
| | | } |
| | |
| | | |
| | | static testMethod void test_method_one() { |
| | | // This test runs a scheduled job at midnight Sept. 3rd. 2022 |
| | | String CRON_EXP = '0 0 0 3 9 ? 2022'; |
| | | String CRON_EXP = '0 0 0 3 9 ? 2040'; |
| | | |
| | | System.Test.startTest(); |
| | | // Schedule the test job |
| | |
| | | // Verify the job has not run |
| | | System.assertEquals(0, ct.TimesTriggered); |
| | | // Verify the next time the job will run |
| | | System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime)); |
| | | System.assertEquals('2040-09-03 00:00:00', String.valueOf(ct.NextFireTime)); |
| | | System.Test.StopTest(); |
| | | } |
| | | |
| | |
| | | Sales_Method__c, Fund_Basis__c, OwnerId, Wholesale_Price__c, Lead_No__c,Inquiry_Num__c,CreatedDate,CreatedById, |
| | | Tender_information__c, Agency_Opportunity__c, SI_PromoteInquiry__c |
| | | , Contact_Name__r.AccountId //2022-6-20 yjk 增加联系人的科室查询 |
| | | ,ET_Check__c //SWAG-CKDATG fy 【委托】【OBSAP-报价委托】报价委托项目改善1 |
| | | from Lead where id =: this.leadId]; |
| | | this.SI_Flg = this.lead.SI_PromoteInquiry__c; |
| | | // 診療科選択リストの取得(条件:病院=リード情報の病院名称) |
| | |
| | | RecordType rect = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and Name =: Opptype limit 1]; |
| | | opp.RecordTypeId = rect.id; |
| | | // opp.Opportunity_Category__c = opp.Account.Department_Class_Wd__c; |
| | | opp.Opportunity_Category__c = dept.Department_Class_Wd__c; |
| | | //SWAG-CKDATG fy 【委托】【OBSAP-报价委托】报价委托项目改善1 start |
| | | // opp.Opportunity_Category__c = dept.Department_Class_Wd__c; |
| | | opp.Opportunity_Category__c = this.lead.ET_Check__c ? 'ET' : dept.Department_Class_Wd__c; |
| | | opp.Opp_order_Type__c = this.lead.ET_Check__c ? 'ET' : null; |
| | | //SWAG-CKDATG fy 【委托】【OBSAP-报价委托】报价委托项目改善1 end |
| | | System.debug('this.lead.Hospital_Name__c:'+this.lead.Hospital_Name__c); |
| | | System.debug('this.lead.LeadSource:'+this.lead.LeadSource); |
| | | System.debug('this.lead.Other_Society__c:'+this.lead.Other_Society__c); |
| | |
| | | |
| | | // リードテストデータ |
| | | RecordType rect = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name =: RC_HOSPITAL limit 1]; |
| | | Account hospital = new Account(name = '中国病院'); |
| | | Account hospital = new Account(name = '中国病院', Is_Active__c = '有効'); |
| | | hospital.RecordTypeId = rect.Id; |
| | | insert hospital; |
| | | Lead l = new Lead(); |
| | |
| | | |
| | | // リードテストデータ |
| | | RecordType rect = [select id from RecordType where IsActive = true and SobjectType= 'Account' and Name =: RC_HOSPITAL limit 1]; |
| | | Account hospital = new Account(name = '中国病院'); |
| | | Account hospital = new Account(name = '中国病院', Is_Active__c = '有効'); |
| | | hospital.RecordTypeId = rect.Id; |
| | | insert hospital; |
| | | Lead l = new Lead(); |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>29.0</apiVersion> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | lostDataList = Database.query(lostReportSql); |
| | | if (lostDataList.size() > 0) { |
| | | lostData = lostDataList[0]; |
| | | |
| | | mcId = lostData.Maintenance_Contract__c; |
| | | } |
| | | if (lostData.Status__c == '提交' || lostData.Status__c == '审批中' || lostData.Status__c == '批准') { |
| | |
| | | ApexPages.addmessages(e); |
| | | return null; |
| | | } |
| | | return null; |
| | | } |
| | | public PageReference tochange() { |
| | | // Lost_Report__c lr = [select To_Where__c from Lost_Report__c where To_Where__c= '医院选择第三方' limit 1]; |
| | | // flag = false; |
| | | lostData.To_Where__c = '医院选择第三方'; |
| | | // try { |
| | | // ControllerUtil.lostOrder(lostData); |
| | | // flag = true; |
| | | // } catch (Exception e) { |
| | | // ApexPages.addmessages(e); |
| | | // return null; |
| | | // } |
| | | return null; |
| | | } |
| | | //提交审批方法 |
| | |
| | | } |
| | | //查询具体原因的sql |
| | | public String lostOrder(String Id) { |
| | | String lostReportSql = 'SELECT id,Status__c,Other_Reasons__c,Other__c,Third_Party_Company__c,Third_Party_Contract_Price__c,To_Where__c,Specific_Reasons__c,Maintenance_Contract__c from Lost_Report__c where Id = \'' + Id + '\''; |
| | | String lostReportSql = 'SELECT id,Status__c,MC_Code__c,Other_Reasons__c,Other__c,Third_Party_Company__c,Third_Party_Contract_Price__c,To_Where__c,Specific_Reasons__c,Maintenance_Contract__c from Lost_Report__c where Id = \'' + Id + '\''; |
| | | return lostReportSql; |
| | | } |
| | | public List<Maintenance_Contract__c> selectMC(String selectString) { |
| | | String mcsql = '%'+selectString+'%'; |
| | | String selectmc = 'SELECT id,name from Maintenance_Contract__c where name like :mcsql'; |
| | | BAOJIAList = Database.query(selectmc); |
| | | return BAOJIAList; |
| | | } |
| | | |
| | | } |
| | |
| | | //判断过去一年时间 |
| | | if(nowDt.month() >= 4){ |
| | | sTime = Date.newInstance(nowDt.year()-1,4,1); |
| | | eTime = Date.newInstance(nowDt.year(),3,31); |
| | | eTime = Date.newInstance(nowDt.year(),4,1); |
| | | }else{ |
| | | sTime = Date.newInstance(nowDt.year()-2,4,1); |
| | | eTime = Date.newInstance(nowDt.year()-1,3,31); |
| | | eTime = Date.newInstance(nowDt.year()-1,4,1); |
| | | } |
| | | //修理表查询 修理单的金额 |
| | | query = 'select Id,Hospital__c from Repair__c where Agreed_Date__c >=:sTime and Agreed_Date__c <=:eTime and Discount_Price_formula__c !=null and Discount_Price_formula__c!=0 '; |
| | | query = 'select Id,Hospital__c,PurchaseOrInstallationDate__c,Repair_List_Price_formula__c from Repair__c where Agreed_Date__c >=:sTime and Agreed_Date__c <:eTime and Repair_List_Price_formula__c !=null and Repair_List_Price_formula__c!=0 and Status1__c!=\'0.删除\' and Status1__c!=\'0.取消\' and Status2__c!=\'00.删除\' and Status2__c!=\'00.取消\' '; |
| | | |
| | | if (accountIdList != null && accountIdList.size() > 0) { |
| | | query += ' AND Hospital__c IN :accountIdList '; |
| | |
| | | } |
| | | System.debug(LoggingLevel.INFO, '*** the OCSM_Period_half__c: ' + OCSM_Period_half); |
| | | |
| | | List<Id>scopeId = new List<Id>(); |
| | | // List<Id>scopeId = new List<Id>(); |
| | | List<Id>hosId = new List<Id>(); |
| | | //汇总 修理原价 安装日期小于12个月的 算平均月 再*12 |
| | | Map<Id,Decimal> HosMoneys = new Map<Id,Decimal>(); |
| | | for (Repair__c mcc : scope) { |
| | | scopeId.add(mcc.Id); |
| | | // scopeId.add(mcc.Id); |
| | | hosId.add(mcc.Hospital__c); |
| | | Date purDate = mcc.PurchaseOrInstallationDate__c; |
| | | if(purDate!=null){ |
| | | Decimal bMonth = purDate.monthsBetween(eTime); |
| | | Decimal hmoney = 0; |
| | | if(bMonth < 0){ |
| | | bMonth *=-1; |
| | | } |
| | | //设备 安装日期至 Etime 不足三年的 按平均月计算再乘12 |
| | | if((bMonth < 12 * 3 ) && bMonth > 0){ |
| | | hmoney = (mcc.Repair_List_Price_formula__c / bMonth) *12; |
| | | }else{ |
| | | hmoney = mcc.Repair_List_Price_formula__c; |
| | | } |
| | | if(HosMoneys.containsKey(mcc.Hospital__c)){ |
| | | HosMoneys.put(mcc.Hospital__c, HosMoneys.get(mcc.Hospital__c)+hmoney); |
| | | }else{ |
| | | HosMoneys.put(mcc.Hospital__c, hmoney); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | //汇总修理表中医院 修理金额 |
| | | List<AggregateResult> LastyearList = [ |
| | | select |
| | | sum(Discount_Price_formula__c) SumPrice, |
| | | Hospital__c |
| | | from |
| | | Repair__c |
| | | where |
| | | Id in:scopeId |
| | | group by Hospital__c |
| | | ]; |
| | | //存医院 以及医院年修理金额 |
| | | Map<Id,Decimal> LastYearPriceSumMap = new Map<Id,Decimal>(); |
| | | for (AggregateResult Rpc : LastyearList) { |
| | | Id idf = String.valueOf(Rpc.get('Hospital__c')); |
| | | Decimal Defir = (Decimal)Rpc.get('SumPrice'); |
| | | // List<AggregateResult> LastyearList = [ |
| | | // select |
| | | // sum(Repair_List_Price_formula__c) SumPrice, |
| | | // Hospital__c |
| | | // from |
| | | // Repair__c |
| | | // where |
| | | // Id in:scopeId |
| | | // group by Hospital__c |
| | | // ]; |
| | | // //存医院 以及医院年修理金额 |
| | | // Map<Id,Decimal> LastYearPriceSumMap = new Map<Id,Decimal>(); |
| | | // for (AggregateResult Rpc : LastyearList) { |
| | | // Id idf = String.valueOf(Rpc.get('Hospital__c')); |
| | | // Decimal Defir = (Decimal)Rpc.get('SumPrice'); |
| | | |
| | | LastYearPriceSumMap.put(idf, Defir); |
| | | } |
| | | // LastYearPriceSumMap.put(idf, Defir); |
| | | // } |
| | | |
| | | //服务客户目标对象里 医院在scope里以及年份等于查询年份的 |
| | | List<Account_Service_Of_Target__c> asotList = [select Id,Account_HP__c |
| | |
| | | // }else{ |
| | | // hospitalName.put(mc.Hospital__c,mc.Request_quotation_AmountF__c); |
| | | // } |
| | | Account_Service_Of_Target__c ast = new Account_Service_Of_Target__c(); |
| | | ast.Account_HP__c = mc.Hospital__c; |
| | | ast.Annual_repair_amount__c = LastYearPriceSumMap.get(mc.Hospital__c); |
| | | ast.OCSM_Period_half__c = OCSM_Period_half; |
| | | ast.OCSM_Period__c = OCSM_Period; |
| | | if(oldMap.containsKey(mc.Hospital__c)){ |
| | | ast.Id = oldMap.get(mc.Hospital__c).Id; |
| | | try{ |
| | | Account_Service_Of_Target__c ast = new Account_Service_Of_Target__c(); |
| | | ast.Account_HP__c = mc.Hospital__c; |
| | | ast.Annual_repair_amount__c = HosMoneys.get(mc.Hospital__c); |
| | | ast.OCSM_Period_half__c = OCSM_Period_half; |
| | | ast.OCSM_Period__c = OCSM_Period; |
| | | if(oldMap.containsKey(mc.Hospital__c)){ |
| | | ast.Id = oldMap.get(mc.Hospital__c).Id; |
| | | } |
| | | if(!hospital.contains(ast)){ |
| | | hospital.add(ast); |
| | | } |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** mc.Id: ' + mc.Id); |
| | | System.debug(LoggingLevel.INFO, '*** mc: ' + mc); |
| | | } |
| | | if(!hospital.contains(ast)){ |
| | | hospital.add(ast); |
| | | } |
| | | |
| | | } |
| | | |
| | | upsert hospital; |
| | |
| | | @isTest |
| | | private class SumAnnualRepairAmountBatchTest { |
| | | static testMethod void testMethod1() { |
| | | @testSetup |
| | | private static void setUpDate(){ |
| | | // 病院を作る |
| | | Date toDayTime = Date.today(); |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'hospitalabc'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | | hospital.Speciality_Type__c = '综合医院'; |
| | | hospital.Grade__c = '一级'; |
| | | hospital.IF_Coverage_Target_HP__c = '1'; |
| | | hospital.OCM_Category__c = 'SLTV'; |
| | | hospital.Is_Medical__c = '医疗机构'; |
| | | hospital.Town__c = '东京'; |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | Account[] strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_OTH']; |
| | | // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'Department_OTH'].id; |
| | | dep.Name = 'test dep'; |
| | | dep.AgentCode_Ext__c = System.Label.Account_Asset_FJZ; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | Oly_TriggerHandler.bypass('NFM701ControllerHandler'); |
| | | Oly_TriggerHandler.bypass('UpdateContractAimAmountHandler'); |
| | | insert dep; |
| | | |
| | | |
| | | |
| | | // 产品 |
| | | Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI', |
| | | Service_Category3__c ='软性镜', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | | Maintenance_Price_Year__c = 999, |
| | | Extend_Gurantee_Start_MD__c = Date.newInstance(toDayTime.year(),3,2), |
| | | Extend_Gurantee_End_MD__c = Date.newInstance(3999,12,31), |
| | | Extend_new_product_gurantee_MD__c = true, |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | ProductCode_Ext__c='pc01',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | Category3__c='电子镜'); |
| | | Product2 pro2 = new Product2(Name='name02',IsActive=true,Family='GI', |
| | | Service_Category3__c ='软性镜', |
| | | Fixture_Model_No__c='n02',Serial_Lot_No__c='Lot tracing', |
| | | ProductCode_Ext__c='pc02',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | Extend_Gurantee_Start_MD__c = Date.newInstance(toDayTime.year(),3,2), |
| | | Extend_Gurantee_End_MD__c = Date.newInstance(3999,12,31), |
| | | Extend_new_product_gurantee_MD__c = true, |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | Maintenance_Price_Year__c = 999, |
| | | Category3__c='纤维镜'); |
| | | Product2 pro3 = new Product2(Name='name03',IsActive=true,Family='GI', |
| | | Service_Category3__c ='软性镜', |
| | | Fixture_Model_No__c='n03',Serial_Lot_No__c='Lot tracing', |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | ProductCode_Ext__c='pc03',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category2__c='本体', |
| | | Extend_Gurantee_Start_MD__c = Date.newInstance(toDayTime.year(),3,2), |
| | | Extend_Gurantee_End_MD__c = Date.newInstance(3999,12,31), |
| | | Extend_new_product_gurantee_MD__c = true, |
| | | Maintenance_Price_Year__c = 999, |
| | | Category3__c='电子镜'); |
| | | Product2 pro4 = new Product2(Name='name04',IsActive=true,Family='GI', |
| | | Service_Category3__c ='软性镜', |
| | | Fixture_Model_No__c='n04',Serial_Lot_No__c='Lot tracing', |
| | | ProductCode_Ext__c='pc04',Manual_Entry__c=false,Brand_Name__c='奥林巴斯', |
| | | Category4__c='SD EndoEYE', |
| | | Extend_Gurantee_Start_MD__c = Date.newInstance(toDayTime.year(),3,2), |
| | | Extend_Gurantee_End_MD__c = Date.newInstance(3999,12,31), |
| | | Extend_new_product_gurantee_MD__c = true, |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | Maintenance_Price_Year__c = 999); |
| | | |
| | | Product2 pro5 = new Product2(Name='name05',IsActive=true,Family='GI', |
| | | Service_Category3__c ='软性镜', |
| | | Fixture_Model_No__c='n05',Serial_Lot_No__c='Lot tracing',Brand_Name__c='奥林巴斯', |
| | | // Category2__c='本体', |
| | | Extend_Gurantee_Start_MD__c = Date.newInstance(toDayTime.year(),3,2), |
| | | Extend_Gurantee_End_MD__c = Date.newInstance(3999,12,31), |
| | | Extend_new_product_gurantee_MD__c = true, |
| | | Maintenance_Price_Year__c = 999, |
| | | PartSupplyFinishDate__c = Date.newInstance(toDayTime.year()+2,3,2), |
| | | ProductCode_Ext__c='pc05',Manual_Entry__c=false, |
| | | Category3__c = 'EUS主机'); |
| | | insert new Product2[] {pro1, pro2, pro3,pro4,pro5}; |
| | | |
| | | |
| | | |
| | | Maintenance_Contract__c contract = new Maintenance_Contract__c(); |
| | | contract.Name = 'tect contract'; |
| | | contract.status__c ='契約'; |
| | | contract.Maintenance_Contract_No__c = 'Kami_Contract_No'; |
| | | contract.Contract_Conclusion_Date__c = Date.today(); |
| | | contract.Hospital__c = hospital.Id; |
| | | contract.Department_Class__c = strategicDep[0].Id; |
| | | contract.Department__c = dep.Id; |
| | | contract.Contract_Start_Date__c=Date.newInstance(toDayTime.year()-2,5,2); |
| | | contract.Contract_End_Date__c = Date.newInstance(toDayTime.year(),5,20); |
| | | contract.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId(); |
| | | insert contract; |
| | | |
| | | List<Maintenance_Contract__c> MaintenanceContract=[select id from Maintenance_Contract__c]; |
| | | |
| | | //---------------------------主体 两个附属品(个体管理 数量管理) |
| | | // 保有设备A (主体) |
| | | Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA1.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA1.SerialNumber = 'ass01'; |
| | | assetA1.Name = 'ass01'; |
| | | assetA1.AccountId = dep.Id; |
| | | assetA1.Guarantee_period_for_products__c = toDayTime; |
| | | assetA1.Department_Class__c = strategicDep[0].Id; |
| | | assetA1.Hospital__c = hospital.Id; |
| | | assetA1.Product2Id = pro1.Id; |
| | | assetA1.Quantity = 1; |
| | | // assetA1.Asset_Year__c = Date.today().addYears(-1); |
| | | |
| | | assetA1.Status = '使用中'; |
| | | assetA1.Manage_type__c = '个体管理'; |
| | | assetA1.Loaner_accsessary__c = false; |
| | | assetA1.Product_category__c = 'GI'; |
| | | assetA1.Delete_Flag__c = false; |
| | | assetA1.Freeze_sign__c = false; |
| | | assetA1.Out_of_wh__c = 0; |
| | | assetA1.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA1.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA1.Product_category__c = 'GI'; |
| | | assetA1.Equipment_Type__c = '产品试用'; |
| | | assetA1.SalesProvince__c = '北京'; |
| | | assetA1.WH_location__c = '货架号1'; |
| | | assetA1.Asset_loaner_category__c = '固定资产'; |
| | | assetA1.CompanyOfEquipment__c = '123'; |
| | | assetA1.Internal_Asset_number__c = '123'; |
| | | assetA1.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA1.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA2.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA2.SerialNumber = 'ass02'; |
| | | assetA2.Name = 'ass02'; |
| | | assetA2.AccountId = dep.Id; |
| | | assetA2.Department_Class__c = strategicDep[0].Id; |
| | | assetA2.Hospital__c = hospital.Id; |
| | | assetA2.Product2Id = pro2.Id; |
| | | assetA2.Quantity = 10; |
| | | assetA2.Status = '使用中'; |
| | | // assetA1.Asset_Year__c = Date.today().addYears(-1); |
| | | assetA2.Manage_type__c = '数量管理'; |
| | | assetA2.Loaner_accsessary__c = true; |
| | | assetA2.Product_category__c = 'GI'; |
| | | assetA2.Delete_Flag__c = false; |
| | | assetA2.Guarantee_period_for_products__c = toDayTime; |
| | | assetA2.Freeze_sign__c = false; |
| | | assetA2.Out_of_wh__c = 3; |
| | | |
| | | assetA2.Frozen_Quantity__c = 2; |
| | | assetA2.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA2.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA2.Product_category__c = 'GI'; |
| | | assetA2.Equipment_Type__c = '产品试用'; |
| | | assetA2.SalesProvince__c = '北京'; |
| | | assetA2.WH_location__c = '货架号2'; |
| | | assetA2.Asset_loaner_category__c = '固定资产'; |
| | | assetA2.CompanyOfEquipment__c = '123'; |
| | | assetA2.Internal_Asset_number__c = '123'; |
| | | assetA2.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 个体管理) |
| | | Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA3.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA3.SerialNumber = 'ass03'; |
| | | assetA3.Name = 'ass03'; |
| | | assetA3.AccountId = dep.Id; |
| | | assetA3.Department_Class__c = strategicDep[0].Id; |
| | | assetA3.Hospital__c = hospital.Id; |
| | | assetA3.Product2Id = pro3.Id; |
| | | assetA3.Quantity = 10; |
| | | assetA3.Status = '使用中'; |
| | | assetA3.Manage_type__c = '数量管理'; |
| | | assetA3.Loaner_accsessary__c = true; |
| | | assetA3.Product_category__c = 'GI'; |
| | | assetA3.Delete_Flag__c = false; |
| | | assetA3.Guarantee_period_for_products__c = toDayTime; |
| | | |
| | | assetA3.Freeze_sign__c = false; |
| | | assetA3.Out_of_wh__c = 3; |
| | | assetA3.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA3.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA3.Product_category__c = 'GI'; |
| | | assetA3.Equipment_Type__c = '产品试用'; |
| | | assetA3.SalesProvince__c = '北京'; |
| | | assetA3.WH_location__c = '货架号3'; |
| | | assetA3.Abandoned_Inventory__c = 1; |
| | | assetA3.Asset_loaner_category__c = '固定资产'; |
| | | assetA3.CompanyOfEquipment__c = '123'; |
| | | assetA3.Internal_Asset_number__c = '123'; |
| | | assetA3.CurrentContract__c=MaintenanceContract[0].Id; |
| | | |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA4 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA4.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA4.SerialNumber = 'ass04'; |
| | | assetA4.Name = 'ass04'; |
| | | assetA4.AccountId = dep.Id; |
| | | assetA4.Department_Class__c = strategicDep[0].Id; |
| | | assetA4.Hospital__c = hospital.Id; |
| | | assetA4.Product2Id = pro4.Id; |
| | | assetA4.Quantity = 10; |
| | | assetA4.Guarantee_period_for_products__c = toDayTime; |
| | | assetA4.Status = '使用中'; |
| | | |
| | | assetA4.Manage_type__c = '数量管理'; |
| | | assetA4.Loaner_accsessary__c = true; |
| | | assetA4.Product_category__c = 'GI'; |
| | | assetA4.Delete_Flag__c = false; |
| | | assetA4.Freeze_sign__c = false; |
| | | assetA4.Out_of_wh__c = 3; |
| | | assetA4.Frozen_Quantity__c = 2; |
| | | assetA4.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA4.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA4.Product_category__c = 'GI'; |
| | | assetA4.Equipment_Type__c = '产品试用'; |
| | | assetA4.SalesProvince__c = '北京'; |
| | | assetA4.WH_location__c = '货架号2'; |
| | | assetA4.Asset_loaner_category__c = '固定资产'; |
| | | assetA4.CompanyOfEquipment__c = '123'; |
| | | assetA4.Internal_Asset_number__c = '123'; |
| | | assetA4.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA5 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | assetA5.RecordTypeId = System.Label.Asset_RecordType; |
| | | assetA5.SerialNumber = 'ass05'; |
| | | assetA5.Name = 'ass05'; |
| | | assetA5.AccountId = dep.Id; |
| | | assetA5.Department_Class__c = strategicDep[0].Id; |
| | | assetA5.Hospital__c = hospital.Id; |
| | | assetA5.Product2Id = pro5.Id; |
| | | assetA5.Quantity = 10; |
| | | assetA5.Status = '使用中'; |
| | | assetA5.Manage_type__c = '数量管理'; |
| | | assetA5.Loaner_accsessary__c = true; |
| | | assetA5.Product_category__c = 'GI'; |
| | | assetA5.Delete_Flag__c = false; |
| | | assetA5.Guarantee_period_for_products__c = toDayTime; |
| | | |
| | | assetA5.Freeze_sign__c = false; |
| | | assetA5.Out_of_wh__c = 3; |
| | | assetA5.Frozen_Quantity__c = 2; |
| | | assetA5.Salesdepartment__c = '1.华北营业本部'; |
| | | assetA5.Internal_asset_location__c = '北京 备品中心'; |
| | | assetA5.Product_category__c = 'GI'; |
| | | assetA5.Equipment_Type__c = '产品试用'; |
| | | assetA5.SalesProvince__c = '北京'; |
| | | assetA5.WH_location__c = '货架号2'; |
| | | assetA5.Asset_loaner_category__c = '固定资产'; |
| | | assetA5.CompanyOfEquipment__c = '123'; |
| | | assetA5.Internal_Asset_number__c = '123'; |
| | | assetA5.CurrentContract__c=MaintenanceContract[0].Id; |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | Oly_TriggerHandler.bypass('AssetHandlerCheck'); |
| | | insert new Asset[] {assetA1, assetA2, assetA3,assetA4,assetA5}; |
| | | List<Asset> Assetss = new Asset[] {assetA1, assetA2, assetA3,assetA4,assetA5}; |
| | | Account_Service_Of_Target__c asot = new Account_Service_Of_Target__c(); |
| | | asot.OCSM_Period_half__c='1H'; |
| | | asot.OCSM_Period__c = 'FY2023'; |
| | | asot.Account_HP__c=hospital.Id; |
| | | |
| | | insert asot; |
| | | |
| | | //维修表创建(包含在维修表的保有设备) |
| | | Repair__c repairObj1 = new Repair__c(); |
| | | repairObj1.Delivered_Product__c = Assetss[0].Id; |
| | | repairObj1.Discount_Price__c = 1000; |
| | | repairObj1.Hospital__c = hospital.Id; |
| | | repairObj1.Department_Class__c = strategicDep[0].Id; |
| | | repairObj1.Account__c = hospital.Id; |
| | | repairObj1.SalesOfficeCode_selection__c = '北京石景山'; |
| | | repairObj1.On_site_repair__c = 'RC修理'; |
| | | repairObj1.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj1.Agreed_Date__c = Date.today().addYears(-1); |
| | | |
| | | // insert repairObj1; |
| | | |
| | | Repair__c repairObj2 = new Repair__c(); |
| | | repairObj2.Discount_Price__c = 2000; |
| | | repairObj2.Delivered_Product__c = Assetss[1].Id; |
| | | repairObj2.Hospital__c = hospital.Id; |
| | | repairObj2.Department_Class__c = strategicDep[0].Id; |
| | | repairObj2.Account__c = hospital.Id; |
| | | repairObj2.SalesOfficeCode_selection__c = '北京石景山'; |
| | | repairObj2.On_site_repair__c = 'RC修理'; |
| | | repairObj2.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj2.Agreed_Date__c = Date.today().addYears(-1); |
| | | |
| | | Repair__c repairObj3 = new Repair__c(); |
| | | repairObj3.Discount_Price__c = 2000; |
| | | repairObj3.Delivered_Product__c = Assetss[2].Id; |
| | | repairObj3.Hospital__c = hospital.Id; |
| | | repairObj3.Department_Class__c = strategicDep[0].Id; |
| | | repairObj3.Account__c = hospital.Id; |
| | | repairObj3.SalesOfficeCode_selection__c = '北京石景山'; |
| | | repairObj3.On_site_repair__c = 'RC修理'; |
| | | repairObj3.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj3.Agreed_Date__c = Date.today().addYears(-1); |
| | | |
| | | insert new Repair__c[] {repairObj1, repairObj2, repairObj3}; |
| | | } |
| | | static testMethod void testMethod1() { |
| | | database.executeBatch(new SumAnnualRepairAmountBatch(),200); |
| | | } |
| | | } |
| | |
| | | // } |
| | | |
| | | // query = 'select Id, Hospital__c from Asset where Product2.Service_Category3__c=\'软性镜\' and Status =\'使用中\' and Asset_Year__c >=:sTime and Asset_Year__c <=:eTime'; |
| | | query = 'select Id, Hospital__c from Asset where Product2.Service_Category3__c=\'软性镜\' and Status !=\'廃棄\' and Status!=\'待报废\' '; |
| | | query = 'select Id, Hospital__c from Asset where Product2.ServiceCategory__c=\'软性镜\' and Status !=\'廃棄\' and Status!=\'待报废\' '; |
| | | |
| | | if (accountIdList != null && accountIdList.size() > 0) { |
| | | query += ' AND Hospital__c IN :accountIdList '; |
| New file |
| | |
| | | @isTest |
| | | private class SumEquipmentInventoryBatchTest { |
| | | static testMethod void testMethod1() { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>46.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | |
| | | // 产品 |
| | | Product2 pro1 = new Product2(Name='name01',IsActive=true,Family='GI', |
| | | Category5__c = '11', |
| | | Service_Category3__c ='软性镜', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | |
| | | contract.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('VM_Contract').getRecordTypeId(); |
| | | insert contract; |
| | | |
| | | Maintenance_Contract__c contract002 = new Maintenance_Contract__c(); |
| | | contract002.Name = 'tect002 contract'; |
| | | contract002.status__c ='契約001'; |
| | | contract002.Maintenance_Contract_No__c = 'Kami_Contract_No002'; |
| | | contract002.Contract_Conclusion_Date__c = Date.today(); |
| | | contract002.Hospital__c = hospital.Id; |
| | | contract002.Department_Class__c = strategicDep[0].Id; |
| | | contract002.Department__c = dep.Id; |
| | | contract002.Contract_Start_Date__c=Date.newInstance(toDayTime.year()-2,5,2); |
| | | contract002.Contract_End_Date__c = Date.newInstance(toDayTime.year(),5,20); |
| | | Contract002.Contract_Conclusion_Date__c = Date.newInstance(toDayTime.year(), 2, 5); |
| | | contract002.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract002.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('Maintenance_Contract').getRecordTypeId(); |
| | | insert contract002; |
| | | |
| | | Maintenance_Contract__c contract003 = new Maintenance_Contract__c(); |
| | | contract003.Name = 'tect002 contract'; |
| | | contract003.status__c ='契約001'; |
| | | contract003.Maintenance_Contract_No__c = 'Kami_Contract_No002'; |
| | | contract003.Contract_Conclusion_Date__c = Date.today(); |
| | | contract003.Hospital__c = hospital.Id; |
| | | contract003.Department_Class__c = strategicDep[0].Id; |
| | | contract003.Department__c = dep.Id; |
| | | contract003.Contract_Start_Date__c=Date.newInstance(toDayTime.year()-2,5,2); |
| | | contract003.Contract_End_Date__c = Date.newInstance(toDayTime.year(),5,20); |
| | | contract003.Contract_Conclusion_Date__c = Date.newInstance(toDayTime.year()-1, 2, 5); |
| | | contract003.SalesOfficeCode_selection__c = '北京RC'; |
| | | contract003.RecordTypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('Maintenance_Contract').getRecordTypeId(); |
| | | insert contract003; |
| | | |
| | | List<Maintenance_Contract__c> MaintenanceContract=[select id from Maintenance_Contract__c]; |
| | | |
| | | //---------------------------主体 两个附属品(个体管理 数量管理) |
| | |
| | | assetA1.CompanyOfEquipment__c = '123'; |
| | | assetA1.Internal_Asset_number__c = '123'; |
| | | assetA1.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA1.InstallDate =Date.newInstance(2021, 5, 1); |
| | | |
| | | // assetA1.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 数量管理) |
| | | Asset assetA2 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | assetA2.CompanyOfEquipment__c = '123'; |
| | | assetA2.Internal_Asset_number__c = '123'; |
| | | assetA2.CurrentContract__c=MaintenanceContract[0].Id; |
| | | assetA2.InstallDate =Date.newInstance(2016, 5, 1); |
| | | |
| | | // assetA2.AssetManageConfirm__c = true; |
| | | // 保有设备A (附属品 个体管理) |
| | | Asset assetA3 = new Asset(Asset_Owner__c = 'Olympus'); |
| | |
| | | repairObj1.On_site_repair__c = 'RC修理'; |
| | | repairObj1.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj1.Agreed_Date__c = Date.today().addYears(-1); |
| | | repairObj1.Repair_List_Price__c = 2000; |
| | | |
| | | // insert repairObj1; |
| | | |
| | |
| | | repairObj2.On_site_repair__c = 'RC修理'; |
| | | repairObj2.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj2.Agreed_Date__c = Date.today().addYears(-1); |
| | | repairObj2.Repair_List_Price__c = 1000; |
| | | |
| | | |
| | | Repair__c repairObj3 = new Repair__c(); |
| | | repairObj3.Discount_Price__c = 2000; |
| | |
| | | repairObj3.On_site_repair__c = 'RC修理'; |
| | | repairObj3.Failure_Occurrence_Date__c = Date.today(); |
| | | repairObj3.Agreed_Date__c = Date.today().addYears(-1); |
| | | repairObj3.Repair_List_Price__c = 2000; |
| | | |
| | | |
| | | insert new Repair__c[] {repairObj1, repairObj2, repairObj3}; |
| | | } |
| | |
| | | Account_Service_Of_Target__c asItem = new Account_Service_Of_Target__c(); |
| | | asItem.Account_HP__c = mapId; |
| | | |
| | | //过去1、2、3年维修合同数量 |
| | | asItem.Last_Years_Contract_Count__c = Last1YearCountMap.get(mapId); |
| | | asItem.Last_Two_Years_Contract_Count__c = Last2YearCountMap.get(mapId); |
| | | asItem.Last_Three_Year_Contract_Count__c = Last3YearCountMap.get(mapId); |
| | | //过去1、2、3年维修合同数量(按合同日计算) |
| | | // asItem.Last_Years_Contract_Count__c = Last1YearCountMap.get(mapId); |
| | | // asItem.Last_Two_Years_Contract_Count__c = Last2YearCountMap.get(mapId); |
| | | // asItem.Last_Three_Year_Contract_Count__c = Last3YearCountMap.get(mapId); |
| | | |
| | | //过去第一年合同日是否有合同 |
| | | if(Last1YearCountMap.get(mapId)!=0 && Last1YearCountMap.get(mapId)!=null){ |
| | | asItem.IF_Last_Years_Contract__c = '1'; |
| | | }else{ |
| | | asItem.IF_Last_Years_Contract__c = '0'; |
| | | } |
| | | //过去第二年合同日是否有合同 |
| | | if(Last2YearCountMap.get(mapId)!=0 && Last2YearCountMap.get(mapId)!=null){ |
| | | asItem.IF_Last_Two_Years_Contract__c = '1'; |
| | | }else{ |
| | | asItem.IF_Last_Two_Years_Contract__c = '0'; |
| | | } |
| | | //过去第三年合同日是否有合同 |
| | | if(Last3YearCountMap.get(mapId)!=0 && Last3YearCountMap.get(mapId)!=null){ |
| | | asItem.IF_Last_Three_Years_Contract__c = '1'; |
| | | }else{ |
| | | asItem.IF_Last_Three_Years_Contract__c = '0'; |
| | | } |
| | | |
| | | asItem.OCSM_Period_half__c = OCSM_Period_half; |
| | | asItem.OCSM_Period__c = OCSM_Period; |
| | |
| | | opp2 = [select Id from Opportunity where Id = :opp2.Id]; |
| | | opp2.StageName = '敗戦'; |
| | | // opp2.Competitor_Product1__c = pro.Id; |
| | | opp2.Lost_Reason__c = 'フォロー不足'; |
| | | //opp2.Lost_Reason__c = 'フォロー不足'; |
| | | update opp2; |
| | | |
| | | opp2c = [select Id, StageName__c, Owner_System__c, OwnerId from Opportunity2__c where Opportunity__c = :opp2.Id]; |
| | |
| | | TenInfo.Retain_Tender__c = BTen.Id; |
| | | // 【委托】招标项目-逻辑删除的项目需要自动取消与询价的关系 fy 2022.3.7 start |
| | | TenInfo.Name = '逻辑删除:'+TenInfo.Name; |
| | | // 20221018 ljh SWAG-CKB9NR add start |
| | | if(TenInfo.Name.length() > 80){ |
| | | TenInfo.Name = TenInfo.Name.substring(0,80); |
| | | } |
| | | // 20221018 ljh SWAG-CKB9NR add end |
| | | // 【委托】招标项目-逻辑删除的项目需要自动取消与询价的关系 fy 2022.3.7 end |
| | | String BTenInfo = BTen.InfoId__c; |
| | | BTen.InfoId__c = TenInfo.InfoId__c;//保留招投标的信息Id赋给删除招投标的信息Id |
| | |
| | | @isTest |
| | | private class TenderDeleteLwcControllerTest { |
| | | static testMethod void testMethod1() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院' Limit 1]; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | |
| | | TenInfo1.Name = 'QLMTEST08111057-02'; |
| | | TenInfo1.RecordTypeId=rectDpts[0].Id; |
| | | TenInfo1.InfoTitle__c = '招标项目1'; |
| | | TenInfo1.subInfoType__c='1-1:意见征集'; // 20221018 ljh SWAG-CKB9NR add |
| | | insert TenInfo1; |
| | | |
| | | TenInfo.Name = '2345'; |
| | |
| | | TenInfo.RecordTypeId=rectDpts[0].Id; |
| | | TenInfo.InfoTitle__c = '招标项目2'; |
| | | TenInfo.TenderManageCode__c ='123'; |
| | | TenInfo.subInfoType__c='1-1:意见征集'; // 20221018 ljh SWAG-CKB9NR add |
| | | insert TenInfo; |
| | | |
| | | //List<Tender_Opportunity_Link__c> BlinksList = [select Opportunity__c from Tender_Opportunity_Link__c where Tender_information__c = :BTen.Id]; |
| | |
| | | if (!StaticParameter.EscapeOtherUpdateTenOwner) { |
| | | updateTenOwner(); |
| | | } |
| | | // 20221011 ljh SWAG-CK28WT start |
| | | updateTenOwnerJC(); |
| | | // 20221011 ljh SWAG-CK28WT end |
| | | //20220804 you 询价任务 |
| | | updateOppotunityBeforeUpdate(); |
| | | |
| | |
| | | // updateTenOwner(); |
| | | } |
| | | protected override void afterUpdate() { |
| | | addShare(); |
| | | addShare(); |
| | | //sednMessage(); 20220729 you 招标项目 取消发送邮件通知 |
| | | updateWin(); |
| | | |
| | |
| | | //updateOpportunity();//2022-5-18 yjk XLIU-CEJ38N 注释掉 |
| | | } |
| | | |
| | | //修改项目阶段,由 结果变为其他,,相关任务取消 |
| | | public void updateOppotunityBeforeUpdate() { |
| | | //修改项目阶段,由 结果变为其他,,相关任务取消 |
| | | public void updateOppotunityBeforeUpdate() { |
| | | Set<String> Tenids = new Set<String>();//招标项目id,查询link |
| | | Set<String> oppTens = new Set<String>();//招标项目id,查询link |
| | | List<String> oppIds = new List<String>();//询价 |
| | |
| | | } |
| | | update opportunities; |
| | | } |
| | | |
| | | |
| | | } |
| | | //20220718 you 询价任务 end |
| | | } |
| | | //20220718 you 询价任务 end |
| | | // 20221027 updateOpportunity() 全文搜索过 没有调用的,方法引用已经注释,覆盖率不够方法体也注释(SWAG-CKL5UC), |
| | | //2022-3-29 yjk SWAG-CCL6R7 |
| | | private void updateOpportunity(){ |
| | | /*private void updateOpportunity(){ |
| | | for(Tender_information__c newOne : newList){ |
| | | Tender_information__c oldOne = oldMap.get(newOne.id); |
| | | if(oldOne.ResultDate__c == null && newOne.ResultDate__c != null){ |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //20220729 you |
| | | }*/ |
| | | //20220729 you |
| | | //public void sednMessage() { |
| | | // //规则条件 |
| | | // //ISCHANGED(InfoType__c) && Text(InfoType__c) = '3:结果' && (Text(IsBid__c) = '是' || ( Text(IsBid__c) = '否' && OpportunityNum__c != null && OpportunityNum__c > 0) ) |
| | |
| | | //取值顺序是:所有人,之后是gi助理,接下来是sp助理,接下来是战略科室所有人 所以倒着来 |
| | | List<Tender_information__Share> tenShareList = new List<Tender_information__Share>(); |
| | | for (Tender_information__c tenc : newList) { |
| | | // 20221013 ljh SWAG-CK28WT start |
| | | // 集采项目 后续共享不需要,只把原来的共享删除 |
| | | if(tenc.CentralizedProject__c){ |
| | | continue; |
| | | } |
| | | // 20221013 ljh SWAG-CK28WT start |
| | | //一个map为 针对一条招投标计划的共享 |
| | | Map<Id, Tender_information__Share> sharemap = new Map<Id, Tender_information__Share>(); |
| | | //1.先设置 医院担当的共享 |
| | |
| | | tenShareList.addAll(sharemap.values()); |
| | | |
| | | } |
| | | |
| | | |
| | | //现在用的是全删全加的方法,没有再判断是否发生改变了 |
| | | //删除 |
| | | List<Tender_information__Share> beforeShareList = |
| | |
| | | for (OCM_Management_Province__c mp : [SELECT id, Name, GI_assistant__c, SP_assistant__c, SP_assistant__r.IsActive, GI_assistant__r.IsActive, Window2__c, Window2__r.IsActive, Admin_assistant3__c, Admin_assistant3__r.IsActive, TenderAssistant1__c, TenderAssistant1__r.IsActive, TenderAssistant2__c, TenderAssistant2__r.IsActive, Window1__c, Window1__r.IsActive FROM OCM_Management_Province__c]) { |
| | | mpMap.put(mp.Name, mp); |
| | | } |
| | | |
| | | //设置GI/SP助理 行政助理、备品窗口 |
| | | //直接设置 信息负责人(助理) 为GI助理 |
| | | for (Tender_information__c info : newList) { |
| | |
| | | info.GI_assistant__c = ocm.GI_assistant__c; |
| | | } |
| | | if (info.InfoOwner__c != ocm.GI_assistant__c) { |
| | | info.InfoOwner__c = ocm.GI_assistant__c; |
| | | if(info.CentralizedProject__c == false){ // 20221012 ljh SWAG-CK28WT 添加的if |
| | | info.InfoOwner__c = ocm.GI_assistant__c; |
| | | } |
| | | } |
| | | } |
| | | // 增加GI助理为空时的处理,清空招标项目的GI助理和信息负责人(助理) 20210813 |
| | | else if (ocm.GI_assistant__c == null || !ocm.GI_assistant__r.IsActive) { |
| | | info.GI_assistant__c = null; |
| | | info.InfoOwner__c = null; |
| | | if(info.CentralizedProject__c == false){ // 20221012 ljh SWAG-CK28WT 添加的if |
| | | info.InfoOwner__c = null; |
| | | } |
| | | } |
| | | if (ocm.SP_assistant__r.IsActive && info.SP_assistant__c != ocm.SP_assistant__c) { |
| | | info.SP_assistant__c = ocm.SP_assistant__c; |
| | |
| | | || tenDepartList.contains('01210000000QezoAAC') |
| | | || tenDepartList.contains('01210000000QeztAAC')){ |
| | | System.debug('=====-----'+info.department_selection__c); |
| | | info.InfoOwner__c = info.SP_assistant__c; |
| | | if(info.CentralizedProject__c == false){ // 20221012 ljh SWAG-CK28WT 添加的if |
| | | info.InfoOwner__c = info.SP_assistant__c; |
| | | } |
| | | |
| | | } |
| | | } |
| | | // add 战略科室分类为普外科、泌尿科、妇科、耳鼻喉科时,信息负责人(助理)修改为 SP助理 2021、11、11 fxk end |
| | | // 20221012 ljh SWAG-CK28WT start |
| | | if(info.CentralizedProject__c){ |
| | | // 清除这些人赋值 (就没有权限了) |
| | | info.GI_assistant__c = null; |
| | | info.SP_assistant__c = null; |
| | | info.Window2__c = null; |
| | | info.TenderAssistant1__c = null; |
| | | info.TenderAssistant2__c = null; |
| | | info.YingyeWindow__c = null; |
| | | } |
| | | // 20221012 ljh SWAG-CK28WT end |
| | | } |
| | | // 20221027 ljh SWAG-CKL5UC add start |
| | | // 项目中当结果记录日有值公告记录日为空时,给公告记录日赋值逻辑=结果记录日-15天 |
| | | if(info.ResultDate__c != null && info.publicDate__c == null){ |
| | | info.publicDate__c = info.ResultDate__c.addDays(-15); |
| | | } |
| | | // 20221027 ljh SWAG-CKL5UC add start |
| | | } |
| | | |
| | | } |
| | | // fxk 2021/8/3 反逻辑删除 Star |
| | | private void updateTenDel() { |
| | |
| | | Map<Id,Tender_information__c> tOldMap = (Map<Id,Tender_information__c>) Trigger.oldMap; |
| | | Map<Id,Tender_information__c> tNewMap = (Map<Id,Tender_information__c>) Trigger.newMap; |
| | | List<Date> cd = new List<Date>(); |
| | | System.debug(LoggingLevel.INFO, '*** cd: ' + cd); |
| | | System.debug(LoggingLevel.INFO, '*** tOldMap: ' + tOldMap); |
| | | for(Tender_information__c t:(List<Tender_information__c>) Trigger.new){ |
| | | System.debug(LoggingLevel.INFO, '*** 进入for循环: '); |
| | |
| | | System.debug(LoggingLevel.INFO, '*** tOldMap: ' + tOldMap.get(t.Id).relativeDate__c); |
| | | System.debug(LoggingLevel.INFO, '*** t.relativeDate__c: ' + t.relativeDate__c); |
| | | // if(tOldMap.get(t.Id).relativeDate__c != null && t.relativeDate__c != tOldMap.get(t.Id).relativeDate__c){ |
| | | if(t.relativeDate__c != null && t.relativeDate__c != tOldMap.get(t.Id).relativeDate__c){ |
| | | //lt 20221114 DB202211270805 【紧急】招标项目是否按时关联计算错误 start |
| | | // if(t.relativeDate__c != null && t.relativeDate__c != tOldMap.get(t.Id).relativeDate__c){ |
| | | if(((t.OBSAP_relativeTime__c != null || t.relativeTime_F__c != null) && t.Tender_Olympus__c == null) || (t.relativeDate__c != null && t.relativeDate__c != tOldMap.get(t.Id).relativeDate__c)){ |
| | | //lt 20221114 DB202211270805 【紧急】招标项目是否按时关联计算错误 end |
| | | System.debug(LoggingLevel.INFO, '*** 进入if语句: '); |
| | | String datastr = String.valueOf(t.relativeDate__c); |
| | | cd.add( Date.valueOf(datastr.substring(0,10)) ); |
| | |
| | | } |
| | | } |
| | | Map<Date,String> lm = new Map<Date,String>(); |
| | | for(OlympusCalendar__c oc:[SELECT Id,Date__c FROM OlympusCalendar__c WHERE Date__c IN:cd]){ |
| | | lm.put(oc.Date__c,oc.Id); |
| | | System.debug(LoggingLevel.INFO, '*** map赋值: '); |
| | | } |
| | | |
| | | for(Tender_information__c l:(List<Tender_information__c>) Trigger.new){ |
| | | if (l.relativeDate__c == null) { |
| | | continue; |
| | | if(cd.size() > 0){ |
| | | for(OlympusCalendar__c oc:[SELECT Id,Date__c FROM OlympusCalendar__c WHERE Date__c IN:cd]){ |
| | | lm.put(oc.Date__c,oc.Id); |
| | | System.debug(LoggingLevel.INFO, '*** map赋值: '); |
| | | } |
| | | String datastr = String.valueOf(l.relativeDate__c); |
| | | String dt = lm.get(Date.valueOf(datastr.substring(0,10))); |
| | | l.Tender_Olympus__c = dt; |
| | | System.debug(LoggingLevel.INFO, '*** l.Tender_Olympus__c: '+ l.Tender_Olympus__c); |
| | | |
| | | for(Tender_information__c l:(List<Tender_information__c>) Trigger.new){ |
| | | //lt 20221114 DB202211270805 【紧急】招标项目是否按时关联计算错误 start |
| | | // if (l.relativeDate__c == null) { |
| | | // continue; |
| | | // } |
| | | if (l.relativeDate__c == null && l.OBSAP_relativeTime__c == null) { |
| | | continue; |
| | | } |
| | | Datetime relativetime = l.OBSAP_relativeTime__c != null ? l.OBSAP_relativeTime__c : l.relativeTime__c; |
| | | // String datastr = String.valueOf(l.relativeDate__c); |
| | | String datastr = String.valueOf(relativetime); |
| | | //lt 20221114 DB202211270805 【紧急】招标项目是否按时关联计算错误 end |
| | | String dt = lm.get(Date.valueOf(datastr.substring(0,10))); |
| | | System.debug(LoggingLevel.INFO, '*** dt: '+ dt); |
| | | l.Tender_Olympus__c = dt; |
| | | System.debug(LoggingLevel.INFO, '*** l.Tender_Olympus__c: '+ l.Tender_Olympus__c); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // fxk 2021/8/3 反逻辑删除 end |
| | | // 20210824 中标时修改关联询价的招标项目名和中标时间 |
| | | private void updateWin() { |
| | | List<String> tenderIds = new List<String>(); |
| | | List<String> lostWinIds = new List<String>(); |
| | | |
| | | // 20221028 ljh SWAG-CKL5UC start |
| | | Map<Id,Tender_information__c> tendMap = New Map<Id,Tender_information__c>(); |
| | | Map<Id,Opportunity> updateOpp = New Map<Id,Opportunity>(); |
| | | // 20221028 ljh SWAG-CKL5UC end |
| | | for (Tender_information__c ten : newList) { |
| | | /** 20220614 SWAG-CFD4SU you 更改,询价优先显示项目阶段最新的招标项目信息 |
| | | if ('3:结果'.equals(ten.InfoType__c) && !'3:结果'.equals((oldMap.get(ten.Id).InfoType__c))) { |
| | |
| | | if((String.isNotBlank(ten.InfoType__c) && ten.InfoType__c != oldMap.get(ten.Id).InfoType__c) || (String.isNotBlank(ten.subInfoType__c) && ten.subInfoType__c != oldMap.get(ten.Id).subInfoType__c) || System.Label.TenderToOpp == '1'){ |
| | | tenderIds.add(ten.Id); |
| | | } |
| | | // 20221028 ljh SWAG-CKL5UC add start |
| | | // 关联询价的 询价页面创建日晚于招标项目公告记录日,漏单数为1 |
| | | // 关联询价的 && 更新有值 |
| | | if(ten.OpportunityNum__c > 0 && Trigger.isUpdate && oldMap.get(ten.Id).publicDate__c == null && ten.publicDate__c != null){ |
| | | tendMap.put(ten.Id, ten); |
| | | } |
| | | // 20221028 ljh SWAG-CKL5UC add end |
| | | |
| | | } |
| | | if (tenderIds.size() > 0) { |
| | |
| | | } |
| | | } |
| | | **/ |
| | | // 20221028 ljh SWAG-CKL5UC add start |
| | | if(tendMap.size() > 0){ |
| | | List<Tender_Opportunity_Link__c> links = [select id, Opportunity__c, Tender_information__c, Opportunity__r.Created_Day__c ,Opportunity__r.LeakageNumber__c,Opportunity__r.LeadSource from Tender_Opportunity_Link__c where Tender_information__c in :tendMap.keySet()]; |
| | | for(Tender_Opportunity_Link__c lk:links){ |
| | | if(lk.Opportunity__r.Created_Day__c > tendMap.get(lk.Tender_information__c).publicDate__c && lk.Opportunity__r.LeadSource == '招标网'){ |
| | | Opportunity opp = new Opportunity(); |
| | | opp.Id = lk.Opportunity__c; |
| | | opp.LeakageNumber__c = 1; |
| | | updateOpp.put(opp.Id,opp); |
| | | } |
| | | } |
| | | } |
| | | if(updateOpp.size() > 0){ |
| | | update updateOpp.values(); |
| | | } |
| | | // 20221028 ljh SWAG-CKL5UC add end |
| | | } |
| | | |
| | | public void updateTenOwner() { |
| | |
| | | } |
| | | // StaticParameter.EscapeOtherUpdateTenOwner = true; |
| | | } |
| | | |
| | | /* |
| | | 集采项目导致所有人更新 |
| | | **/ |
| | | // 20221011 ljh SWAG-CK28WT |
| | | public void updateTenOwnerJC() { |
| | | // |
| | | String OCSM_province = '市场企划本部'; |
| | | Id OwnerIdStr; |
| | | List<OCM_Management_Province__c> ompList = [select Id,TenderAssistant1__c,TenderAssistant1__r.IsActive,TenderAssistant2__c from OCM_Management_Province__c where name =:OCSM_province]; |
| | | if(ompList.size() > 0 && ompList[0].TenderAssistant1__r.IsActive){ |
| | | OwnerIdStr = ompList[0].TenderAssistant1__c; |
| | | } |
| | | System.debug('zheli00:'+OwnerIdStr); |
| | | for (Tender_information__c nObj : newList) { |
| | | Tender_information__c oObj = oldMap.get(nObj.Id); |
| | | if (nObj.CentralizedProject__c != oObj.CentralizedProject__c) { |
| | | if(nObj.CentralizedProject__c && OwnerIdStr != null){ |
| | | /** |
| | | 本部自动变成市场企划本部,项目助理和所有人都是市场企划本部的人, |
| | | 取OCSM管理省页面维护的市场企划本部,招标项目助理1, |
| | | */ |
| | | nObj.OwnerId = OwnerIdStr; |
| | | nObj.InfoOwner__c = OwnerIdStr; |
| | | }else if(!nObj.CentralizedProject__c){ |
| | | /** |
| | | 取消勾选后返回营业部门的省和本部, |
| | | 所有人根据关联医院和战略科室取担当的名字。 |
| | | */ |
| | | updateTenOwner(); |
| | | } |
| | | } |
| | | // 如果触发 更新所有人 没有询价则 还是市场企划本部 |
| | | if (!StaticParameter.EscapeOtherUpdateTenOwner) { |
| | | if(nObj.CentralizedProject__c && OwnerIdStr != null && (nObj.OpportunityNum__c == 0 || nObj.OpportunityNum__c == null)){ |
| | | nObj.OwnerId = OwnerIdStr; |
| | | nObj.InfoOwner__c = OwnerIdStr; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 中标任务 废标流标时清空中标日 |
| | | public void clearConfirmationofAward() { |
| | | List<String> tenders = new List<String>(); |
| | |
| | | // insert u5; |
| | | |
| | | // StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | // OCM_Management_Province__c mp1 = new OCM_Management_Province__c(); |
| | | // mp1.Name = '北京'; |
| | | // mp1.GI_assistant__c = u1.Id; |
| | | // mp1.SP_assistant__c = u2.Id; |
| | | // mp1.Window2__c = u3.Id; |
| | | // mp1.Admin_assistant3__c = u4.Id; |
| | | // insert mp1; |
| | | OCM_Management_Province__c mp1 = new OCM_Management_Province__c(); |
| | | mp1.Name = '北京'; |
| | | mp1.GI_assistant__c = u1.Id; |
| | | mp1.SP_assistant__c = u2.Id; |
| | | mp1.Window2__c = u3.Id; |
| | | mp1.Admin_assistant3__c = u4.Id; |
| | | insert mp1; |
| | | // RecordType rt1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | // Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | // RecordType rt2 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '戦略科室分類 呼吸科']; |
| New file |
| | |
| | | public without sharing class TenderLostController { |
| | | |
| | | //初始化 |
| | | @AuraEnabled |
| | | public static String InitData(String ParamIdStr) { |
| | | //根据招标项目Id 查 招标项目名称 作为 询价名称 |
| | | List<Tender_information__c> tenList = Database.query('Select Id, Name From Tender_information__c Where Id = : ParamIdStr '); |
| | | Opportunity opp = new Opportunity(); |
| | | if(tenList.size() > 0){ |
| | | opp.Name = tenList[0].Name; |
| | | opp.Bidding_Project_Name_Bid__c = ParamIdStr; |
| | | } |
| | | return JSON.serialize(opp); |
| | | } |
| | | |
| | | // 已关联的医院 |
| | | @AuraEnabled |
| | | public static List<String> LinkedHospitals(String ParamIdStr) { |
| | | List<Tender_information__c> tenList = Database.query('Select Id, Hospital__c, Hospital1__c, Hospital2__c, Hospital3__c, Hospital4__c From Tender_information__c Where Id = : ParamIdStr '); |
| | | List<String> hospitals = new List<String>(); |
| | | if(tenList.size() > 0){ |
| | | if (String.isNotBlank(tenList[0].Hospital__c)) { |
| | | hospitals.add(tenList[0].Hospital__c); |
| | | } |
| | | if (String.isNotBlank(tenList[0].Hospital1__c)) { |
| | | hospitals.add(tenList[0].Hospital1__c); |
| | | } |
| | | if (String.isNotBlank(tenList[0].Hospital2__c)) { |
| | | hospitals.add(tenList[0].Hospital2__c); |
| | | } |
| | | if (String.isNotBlank(tenList[0].Hospital3__c)) { |
| | | hospitals.add(tenList[0].Hospital3__c); |
| | | } |
| | | if (String.isNotBlank(tenList[0].Hospital4__c)) { |
| | | hospitals.add(tenList[0].Hospital4__c); |
| | | } |
| | | } |
| | | return hospitals; |
| | | } |
| | | |
| | | //把页面上的数据赋值到询价对象上 |
| | | private static Opportunity mergeInfo(Map<String, Object> oppMap){ |
| | | Opportunity opp = new Opportunity(); |
| | | |
| | | // 名称 |
| | | opp.Name = String.valueOf(oppMap.get('Name')); |
| | | //询价 关联 招标项目 |
| | | opp.Bidding_Project_Name_Bid__c = String.valueOf(oppMap.get('Bidding_Project_Name_Bid__c')); |
| | | //页面上获取 资金来源 |
| | | opp.Fund_Basis__c = String.valueOf(oppMap.get('Fund_Basis__c')); |
| | | //页面上获取 招标方式 |
| | | opp.Sales_Method__c = String.valueOf(oppMap.get('Sales_Method__c')); |
| | | // 科室 |
| | | opp.AccountId = String.valueOf(oppMap.get('AccountId')); |
| | | |
| | | System.debug('lt123test01默认询价内容'+opp); |
| | | |
| | | // 查找科室相关信息 |
| | | Account acc = [select Id, Name, Parent.Parent.State_Master__r.Name, Parent.Department_Class_Label__c from Account where Id = :opp.AccountId]; |
| | | |
| | | System.debug('lt123test02默认询价内容'+opp); |
| | | |
| | | opp.SAP_Province__c = acc.Parent.Parent.State_Master__r.Name; // SAP上传省 |
| | | switch on acc.Parent.Department_Class_Label__c { // 询价科室分类 询价编码自动生成要用到 |
| | | when '消化科' { |
| | | opp.Opportunity_Category__c = 'GI'; |
| | | } |
| | | when '呼吸科' { |
| | | opp.Opportunity_Category__c = 'BF'; |
| | | } |
| | | when '普外科' { |
| | | opp.Opportunity_Category__c = 'GS'; |
| | | } |
| | | when '泌尿科' { |
| | | opp.Opportunity_Category__c = 'URO'; |
| | | } |
| | | when '妇科' { |
| | | opp.Opportunity_Category__c = 'GYN'; |
| | | } |
| | | when '耳鼻喉科' { |
| | | opp.Opportunity_Category__c = 'ENT'; |
| | | } |
| | | when 'ET' { |
| | | opp.Opportunity_Category__c = 'ET'; |
| | | } |
| | | when '其他' { |
| | | opp.Opportunity_Category__c = 'OTH'; |
| | | } |
| | | when else { |
| | | opp.Opportunity_Category__c = 'OTH'; |
| | | } |
| | | } |
| | | |
| | | opp.StageName = '引合'; // 状态 |
| | | opp.Purchase_Reason__c = '新期'; // 购买原因 |
| | | opp.Trade__c = '内貿'; // 内贸外贸 |
| | | opp.Close_Forecasted_Date__c = Date.today().addDays(90); // 预测OCSM签约日 |
| | | opp.CloseDate = Date.today().addDays(120); // 预测发货日 |
| | | opp.Purchase_Type__c = '一般引合'; // 订货方式 |
| | | opp.Sales_Root__c = '販売店'; // 渠道为"经销商" |
| | | opp.ifOpenBid__c = '公开招标'; // 是否公开招标 |
| | | opp.LeadSource = '招标网'; // 潜在客户来源 |
| | | opp.LeakageNumber__c = 1; //漏单数 |
| | | opp.Tender_Number__c = 1; //招标数 |
| | | //应标数为0 Authorized_DB_No__c为空时为0 |
| | | //中标数为0 |
| | | opp.ConfirmationofAward_createTime__c = Date.today(); //中标结果确认日 |
| | | opp.ConfirmationofAward__c = '竞争对手中标'; //中标确认结果 |
| | | |
| | | System.debug('lt123opp默认询价内容'+opp); |
| | | |
| | | return opp; |
| | | } |
| | | |
| | | //保存数据 JSONData 是 json格式的值 |
| | | @AuraEnabled |
| | | public static string SaveData(String JsonData){ |
| | | Opportunity opp = new Opportunity(); |
| | | try{ |
| | | Map<String, Object> oppMap = (Map<String, Object>)JSON.deserializeUntyped(JsonData); |
| | | System.debug('lt123JsonData'+JsonData); |
| | | opp = mergeInfo(oppMap); |
| | | insert opp; |
| | | System.debug('lt123opp.Id'+opp.Id); |
| | | return opp.Id; |
| | | }catch(Exception ex) |
| | | { |
| | | return '错误:' + ex.getLineNumber()+' 行错误 : '+ex.getMessage(); |
| | | } |
| | | } |
| | | |
| | | //查询普通科室 |
| | | @AuraEnabled |
| | | public static String SearchPTKS(String content, List<String> hospitals){ |
| | | String profile_2S1 = System.Label.ProfileId2S1HP; |
| | | Boolean is_2S1 = profile_2S1.contains(UserInfo.getProfileId()) ? true : false; |
| | | String jsonData = CommonUtils.GetPTKS(content, hospitals, is_2S1); |
| | | System.debug('hospitals: ' + hospitals); |
| | | System.debug('offices: ' + jsonData); |
| | | return jsonData; |
| | | } |
| | | |
| | | //查询父类 |
| | | // @AuraEnabled |
| | | // public static String SearchParent(String Id){ |
| | | // String jsonData = CommonUtils.GetParent(Id); |
| | | // return jsonData; |
| | | // } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class TenderLostControllerTest { |
| | | |
| | | @isTest |
| | | static void TestMethod1() { |
| | | //创建客户 |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = [Select Id FROM RecordType WHERE IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP'].id; |
| | | hospital.Name = 'test hospital'; |
| | | hospital.Is_Active__c = '有効'; |
| | | hospital.Attribute_Type__c = '卫生部'; |
| | | hospital.Speciality_Type__c = '综合医院'; |
| | | hospital.Grade__c = '一级'; |
| | | hospital.OCM_Category__c = 'SLTV'; |
| | | hospital.Is_Medical__c = '医疗机构'; |
| | | hospital.Town__c = '东京'; |
| | | hospital.Department_Name__c = 'testKS'; |
| | | insert hospital; |
| | | |
| | | //创建招标项目 |
| | | Tender_information__c Ten = new Tender_information__c(); |
| | | Ten.Name = '123456'; |
| | | Ten.ProjectId__c = '38_99df2844cf784982acdc61d00d7a7dbb'; |
| | | ten.Hospital__c = hospital.Id; |
| | | ten.Hospital1__c = hospital.Id; |
| | | ten.Hospital2__c = hospital.Id; |
| | | ten.Hospital3__c = hospital.Id; |
| | | ten.Hospital4__c = hospital.Id; |
| | | insert Ten; |
| | | |
| | | //询价 |
| | | Opportunity opp = new Opportunity(); |
| | | opp.Name = 'Testname0922'; |
| | | opp.Fund_Basis__c = '政府資金'; |
| | | opp.Sales_Method__c = '政府招标'; |
| | | opp.StageName = '引合'; |
| | | opp.Opportunity_No__c = '0801'; |
| | | opp.Purchase_Reason__c = '新期'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.Close_Forecasted_Date__c = Date.today().addDays(90); |
| | | opp.CloseDate = Date.today().addDays(120); |
| | | opp.Purchase_Type__c = '一般引合'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.ifOpenBid__c = '公开招标'; |
| | | opp.LeadSource = '招标网'; |
| | | opp.LeakageNumber__c = 1; |
| | | opp.Tender_Number__c = 1; |
| | | opp.ConfirmationofAward_createTime__c = Date.today(); |
| | | opp.ConfirmationofAward__c = '竞争对手中标'; |
| | | insert opp; |
| | | |
| | | Map<String, Object> oppMap = new Map<String, Object>(); |
| | | oppMap.put('AccountId',hospital.Id); |
| | | |
| | | String str1 = JSON.serialize(opp); |
| | | String str2 = JSON.serialize(oppMap); |
| | | |
| | | TenderLostController.InitData(String.valueOf(Ten.Id)); |
| | | TenderLostController.LinkedHospitals(String.valueOf(Ten.Id)); |
| | | TenderLostController.SaveData(str1); |
| | | TenderLostController.SaveData(str2); |
| | | |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | String query = 'SELECT id,status__c,NotBidApprovalStatus__c,ViewWaitConfirm__c,ViewRelatedOpp__c,ViewBidConfirm__c '; |
| | | query += 'FROM Tender_information__c '; |
| | | //待确认 |
| | | query += 'WHERE ( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true ) '; |
| | | // 20221013 ljh SWAG-CK28WT update start |
| | | // query += 'WHERE ( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true ) '; |
| | | query += 'WHERE (( status__c = \'01.待确认\' AND ViewWaitConfirm__c = true ) '; |
| | | //待关联询价 |
| | | query += 'OR ( status__c =\'04.待关联询价\' AND ViewRelatedOpp__c = true ) '; |
| | | //待应标 zys 20210709 应标确认 变为 待应标确认 |
| | | query += 'OR ( status__c = \'03.是否应标\' AND NotBidApprovalStatus__c != \'申请中\' ) '; |
| | | |
| | | // query += 'OR ( status__c = \'03.是否应标\' AND NotBidApprovalStatus__c != \'申请中\' ) '; |
| | | query += 'OR ( status__c = \'03.是否应标\' AND NotBidApprovalStatus__c != \'申请中\' )) '; |
| | | // 20221013 ljh SWAG-CK28WT update end |
| | | |
| | | // 20221013 ljh SWAG-CK28WT add start |
| | | String proId = UserInfo.getProfileId(); |
| | | String p_2M4 = System.Label.ProfileId_2M4; |
| | | if(proId.substring(0,15) == p_2M4.substring(0,15)){ |
| | | query += ' AND OwnerId =\''+UserInfo.getUserId()+'\''; |
| | | } |
| | | System.debug('query:'+query); |
| | | // 20221013 ljh SWAG-CK28WT add end |
| | | AllTender = Database.query(query); |
| | | |
| | | return AllTender; |
| | |
| | | |
| | | |
| | | User loginUser = new User(); |
| | | |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_2S6]; |
| | | /* |
| | | // 20221013 ljh SWAG-CK28WT 注释 |
| | | Profile p = [select Id from Profile where Name = '2S6_销售本部窗口&营业助理']; |
| | | loginUser.ProfileId = p.Id; |
| | | loginUser.FirstName = 'ユーザー'; |
| | |
| | | loginUser.Username = 'test_user@example.com' + System.now().millisecond(); |
| | | loginUser.Alias = 'テユ'; |
| | | loginUser.CommunityNickname = 'tu1' + System.now().millisecond(); |
| | | |
| | | |
| | | insert loginUser; |
| | | System.runAs(loginUser){ |
| | | insert loginUser;*/ |
| | | loginUser = [select id from user where IsActive = true and ProfileId =:p.Id limit 1]; |
| | | // System.runAs(loginUser){ // 20221013 ljh SWAG-CK28WT 注释 |
| | | |
| | | |
| | | //待确认招投标项目 : GI助理/SP助理 and 01.待确认 |
| | |
| | | info.OpportunityStatus__c = ''; |
| | | info.IsBid__c = null; |
| | | info.IsRelateProject__c = null; |
| | | // 20221013 ljh SWAG-CK28WT start |
| | | info.subInfoType__c='1-1:意见征集'; |
| | | info.ownerId = loginUser.Id; |
| | | insert info; |
| | | |
| | | info.GI_assistant__c = String.valueOf(loginUser.Id).subString(0,15); |
| | |
| | | |
| | | //System.assertEquals('00510000005sEEMAA2',info.GI_assistant__c); //18 00510000005sEEMAA2 |
| | | //System.assertEquals(null,loginUser.Id); //18 00510000005sEEMAA2 |
| | | //System.assertEquals(true,info.Is_GIORSP__c); |
| | | //System.assertEquals('01.待确认',info.status__c); |
| | | //System.assertEquals(true,info.Is_GIORSP__c); |
| | | // System.assertEquals(true,info.Is_GIORSP__c); |
| | | System.assertEquals('01.待确认',info.status__c); |
| | | // System.assertEquals(true,info.Is_GIORSP__c); |
| | | |
| | | |
| | | //待关联询价的招投标项目 : GI助理/SP助理 and 04.确认应标 |
| | |
| | | info2.Name = 'TEST002'; |
| | | info2.OpportunityStatus__c = ''; |
| | | info2.IsBid__c = '是'; |
| | | info2.OpportunityNum__c = 0; |
| | | info2.OpportunityNum__c = 0; |
| | | // 20221013 ljh SWAG-CK28WT start |
| | | info2.subInfoType__c='1-1:意见征集'; |
| | | insert info2; |
| | | |
| | | info2.SP_assistant__c = String.valueOf(loginUser.Id).subString(0,15); |
| | |
| | | |
| | | info2 = [select status__c,Is_GIORSP__c from Tender_information__c where id = :info2.Id]; |
| | | |
| | | //System.assertEquals(true,info2.Is_GIORSP__c); |
| | | //System.assertEquals('04.确认应标',info2.status__c); |
| | | |
| | | TenderManageController.getCurrentTenderInformation(); |
| | | |
| | | |
| | | // System.assertEquals(true,info2.Is_GIORSP__c); |
| | | // System.assertEquals('04.确认应标',info2.status__c); |
| | | System.runAs(loginUser){ // 20221013 ljh SWAG-CK28WT add |
| | | TenderManageController.getCurrentTenderInformation(); |
| | | } |
| | | |
| | | |
| | |
| | | public void updateOppotunityByInsert(List<Tender_Opportunity_Link__c> records) { |
| | | if (records != null && records.size() > 0) { |
| | | List<String> oppIds = new List<String>(); |
| | | Set<Id> oppIdsSet = new Set<Id>();// 20221028 ljh SWAG-CKL5UC |
| | | //SWAG-CHL67J 【委托】【FY23询价改善】-询价页面/招标项目增加统计字段 fy start |
| | | // List<String> TenderIds = new List<String>(); |
| | | //SWAG-CHL67J 【委托】【FY23询价改善】-询价页面/招标项目增加统计字段 fy end |
| | |
| | | for (Tender_Opportunity_Link__c record: records) { |
| | | if (!oppIds.contains(record.Opportunity__c)) { |
| | | oppIds.add(record.Opportunity__c); |
| | | // 20221028 ljh SWAG-CKL5UC add start |
| | | system.debug('zheli00:'+record.IsLeakage__c); |
| | | if(record.IsLeakage__c){ |
| | | oppIdsSet.add(record.Opportunity__c); |
| | | } |
| | | // 20221028 ljh SWAG-CKL5UC add end |
| | | } |
| | | //SWAG-CHL67J 【委托】【FY23询价改善】-询价页面/招标项目增加统计字段 fy start |
| | | // if (!TenderIds.contains(record.Tender_information__c)) { |
| | | // TenderIds.add(record.Tender_information__c); |
| | | // } |
| | | //SWAG-CHL67J 【委托】【FY23询价改善】-询价页面/招标项目增加统计字段 fy end |
| | | |
| | | } |
| | | if (oppIds.size() > 0) { |
| | | List<String> tenIds = new List<String>();//20220715 you 招标项目插入时,是否需要发送询价任务 新的招标项目 |
| | | //20220615 you SWAG-CFD4SU 改造 start 始终显示最新的 ① 3:结果,② 4:变更,③ 2:公告,④ 1:预告,⑤ 5:其他 |
| | | List<Opportunity> opportunities = [select id,Tender_Number__c, Bidding_Project_Name_Bid__c, Bidding_Project_Name_Bid__r.InfoType__c, TenderBeginDate_Text__c, InfoTypeBid_text__c,Opp_Order__c from Opportunity where id in :oppIds ];//and Bidding_Project_Name_Bid__r.InfoType__c != '3:结果']; |
| | | // 20221028 ljh SWAG-CKL5UC 查询增加 LeakageNumber__c |
| | | List<Opportunity> opportunities = [select id,Tender_Number__c, Bidding_Project_Name_Bid__c, Bidding_Project_Name_Bid__r.InfoType__c, TenderBeginDate_Text__c, InfoTypeBid_text__c,Opp_Order__c,LeakageNumber__c from Opportunity where id in :oppIds ];//and Bidding_Project_Name_Bid__r.InfoType__c != '3:结果']; |
| | | if (opportunities.size() > 0) { |
| | | List<Tender_Opportunity_Link__c> links = [select id, Opportunity__c, Tender_information__c, Tender_information__r.InfoType__c, Tender_information__r.TenderBeginTime__c,Tender_information__r.Tender_Order__c,Tender_information__r.subInfoType__c from Tender_Opportunity_Link__c where Opportunity__c in :oppIds order by Opportunity__c,Tender_information__r.Tender_Order__c desc, Tender_information__r.relativeTime_F__c desc]; |
| | | List<Tender_Opportunity_Link__c> links = [select id, Opportunity__c, Tender_information__c, Tender_information__r.InfoType__c, Tender_information__r.TenderBeginTime__c,Tender_information__r.TenderDate__c,Tender_information__r.Tender_Order__c,Tender_information__r.subInfoType__c from Tender_Opportunity_Link__c where Opportunity__c in :oppIds order by Opportunity__c,Tender_information__r.Tender_Order__c desc, Tender_information__r.relativeTime_F__c desc]; |
| | | for (Opportunity opp : opportunities) { |
| | | for (Tender_Opportunity_Link__c link : links) { |
| | | boolean defaultFlag = false; |
| | |
| | | **/ |
| | | if(opp.Opp_Order__c <= link.Tender_information__r.Tender_Order__c){ |
| | | opp.Bidding_Project_Name_Bid__c = link.Tender_information__c; |
| | | opp.TenderBeginDate_Text__c = link.Tender_information__r.TenderBeginTime__c; |
| | | //opp.TenderBeginDate_Text__c = link.Tender_information__r.TenderDate__c;//更改询价状态2时,引用超20,link.Tender_information__r.TenderBeginTime__c; |
| | | opp.InfoTypeBid_text__c = link.Tender_information__r.InfoType__c; |
| | | //20220715 you 招标项目 start |
| | | if(String.isNotBlank(link.Tender_information__r.InfoType__c) && link.Tender_information__r.InfoType__c=='3:结果' && String.isNotBlank(link.Tender_information__r.subInfoType__c) && (link.Tender_information__r.subInfoType__c=='3-5:中标通知' || link.Tender_information__r.subInfoType__c=='3-6:合同公告')){ |
| | |
| | | } |
| | | opp.Tender_Number__c =returncount; |
| | | //20220829 you SWAG-CHL67J end |
| | | |
| | | // 20221028 ljh SWAG-CKL5UC add start |
| | | if(oppIdsSet.contains(opp.Id) && opp.LeakageNumber__c != 1){ |
| | | opp.LeakageNumber__c = 1; |
| | | } |
| | | // 20221028 ljh SWAG-CKL5UC add end |
| | | } |
| | | update opportunities; |
| | | } |
| | |
| | | // TenderIds.add(record.Tender_information__c); |
| | | // } |
| | | //SWAG-CHL67J 【委托】【FY23询价改善】-询价页面/招标项目增加统计字段 fy end |
| | | |
| | | } |
| | | if (oppIds.size() > 0) { |
| | | List<String> tenIds = new List<String>();//20220715 you 招标项目插入时,是否需要发送询价任务 新的招标项目 |
| | | //20220615 you SWAG-CFD4SU 改造 增加查询条件 |
| | | List<Opportunity> opportunities = [select id, Bidding_Project_Name_Bid__c,Tender_Number__c, TenderBeginDate_Text__c,Opp_Order__c from Opportunity where id in :oppIds]; |
| | | |
| | | if (opportunities.size() > 0) { |
| | | //20220615 you SWAG-CFD4SU 改造 增加查询条件 |
| | | List<Tender_Opportunity_Link__c> links = [select id, Opportunity__c, Tender_information__c, Tender_information__r.InfoType__c,Tender_information__r.subInfoType__c,Tender_information__r.Tender_Order__c,Tender_information__r.TenderBeginTime__c from Tender_Opportunity_Link__c where Opportunity__c in :oppIds order by Opportunity__c,Tender_information__r.Tender_Order__c desc, Tender_information__r.relativeTime_F__c desc]; |
| | | List<Tender_Opportunity_Link__c> links = [select id, Opportunity__c, Tender_information__c, Tender_information__r.InfoType__c,Tender_information__r.subInfoType__c,Tender_information__r.Tender_Order__c,Tender_information__r.TenderBeginTime__c,Tender_information__r.TenderDate__c from Tender_Opportunity_Link__c where Opportunity__c in :oppIds order by Opportunity__c,Tender_information__r.Tender_Order__c desc, Tender_information__r.relativeTime_F__c desc]; |
| | | List<AggregateResult> sum_list = [select count(id) cnt, Opportunity__c from Tender_Opportunity_Link__c where Opportunity__c in :oppIds group by Opportunity__c]; |
| | | Map<String, Integer> sum_map = new Map<String, Integer>(); |
| | | |
| | | if (sum_list != null && sum_list.size() > 0) { |
| | | for (AggregateResult result : sum_list) { |
| | | sum_map.put(String.valueOf(result.get('Opportunity__c')), Integer.valueOf(result.get('cnt'))); |
| | |
| | | for (Opportunity opp : opportunities) { |
| | | if (sum_map.get(opp.Id) == null || sum_map.get(opp.Id) == 0) { |
| | | opp.Bidding_Project_Name_Bid__c = null; |
| | | opp.TenderBeginDate_Text__c = null; |
| | | //opp.TenderBeginDate_Text__c = null; |
| | | opp.InfoTypeBid_text__c = null; |
| | | //20220718 you 询价任务 start |
| | | opp.ConfirmationofAward__c = null; |
| | |
| | | opp.Is_ConfirmationofAward__c =null; |
| | | opp.Closing_Bid_Date__c = null; |
| | | //20220718 you 询价任务 end |
| | | // 20221028 ljh SWAG-CKL5UC start |
| | | opp.LeakageNumber__c = null; |
| | | // 20221028 ljh SWAG-CKL5UC end |
| | | } else { |
| | | for (Tender_Opportunity_Link__c link : links) { |
| | | if (opp.Id == link.Opportunity__c) { |
| | |
| | | break; |
| | | } |
| | | **/ |
| | | if(opp.Opp_Order__c <= link.Tender_information__r.Tender_Order__c){ |
| | | //records[0].addError(opp.Opp_Order__c+'ceshi==='+links.size()+'==='+link.Tender_information__r.Tender_Order__c); |
| | | if(opp.Opp_Order__c >= link.Tender_information__r.Tender_Order__c){ |
| | | opp.Bidding_Project_Name_Bid__c = link.Tender_information__c; |
| | | opp.TenderBeginDate_Text__c = link.Tender_information__r.TenderBeginTime__c; |
| | | //opp.TenderBeginDate_Text__c = link.Tender_information__r.TenderDate__c;//更改询价状态2时,引用超20,link.Tender_information__r.TenderBeginTime__c; |
| | | opp.InfoTypeBid_text__c = link.Tender_information__r.InfoType__c; |
| | | //20220718 you 招标项目 start |
| | | if(String.isNotBlank(link.Tender_information__r.InfoType__c) && link.Tender_information__r.InfoType__c=='3:结果' && String.isNotBlank(link.Tender_information__r.subInfoType__c) && (link.Tender_information__r.subInfoType__c=='3-5:中标通知' || link.Tender_information__r.subInfoType__c=='3-6:合同公告')){ |
| | |
| | | //SWAG-CHL67J 【委托】【FY23询价改善】-询价页面/招标项目增加统计字段 fy end |
| | | } |
| | | } |
| | | @TestVisible |
| | | public static void testI() { |
| | | integer i = 0; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | i++; |
| | | } |
| | | } |
| | |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod1() { |
| | | TenderOpportunityLinkHandler.testI(); |
| | | } |
| | | |
| | | } |
| | |
| | | String query = 'Select Id, Opportunity__c, Tender_information__c, ' |
| | | + 'Tender_information__r.status__c, Tender_information__r.TenderManageCode__c,Tender_information__r.RecordTypeId, Tender_information__r.CreatedDate,' |
| | | + 'Opportunity__r.OwnerId, Opportunity__r.AccountId, Opportunity__r.StageName__c, ' |
| | | + 'Opportunity__r.Assistant_Applied_Date__c, Opportunity__r.Cnt_Lost_cancel_Draft__c, Opportunity__r.ConfirmationofAward__c, ' |
| | | + 'Opportunity__r.Contract_DB_complite_day__c, Opportunity__r.Contract_Authorize_Lock__c, ' |
| | | + 'Opportunity__r.Assistant_Applied_Date__c, Opportunity__r.Cnt_Lost_cancel_Draft__c, Opportunity__r.Cnt_Lost_cancel_report__c, Opportunity__r.ConfirmationofAward__c, ' |
| | | + 'Opportunity__r.Contract_DB_complite_day__c, Opportunity__r.Contract_Authorize_Lock__c, Opportunity__r.LeakageNumber__c, ' |
| | | + 'Opportunity__r.ConfirmationofAward_createTime__c ' |
| | | + 'FROM Tender_Opportunity_Link__c ' |
| | | + 'WHERE Tender_information__r.InfoType__c = \'3:结果\' ' |
| | | + 'AND (Tender_information__r.subInfoType__c = \'3-5:中标通知\' OR Tender_information__r.subInfoType__c = \'3-6:合同公告\') ' |
| | | + 'AND Tender_information__r.RecordTypeId = \'01210000000VLUI\' '; |
| | | |
| | | + 'AND (Tender_information__r.subInfoType__c = \'3-5:中标通知\' OR Tender_information__r.subInfoType__c = \'3-6:合同公告\') '; |
| | | //+ 'AND Tender_information__r.RecordTypeId = \'01210000000VLUI\' '; |
| | | |
| | | //20220715 you 招标任务 start |
| | | if(TenderIds !=null && TenderIds.size() > 0){ |
| | | query += 'AND Opportunity__c in :TenderIds'; |
| | |
| | | system.debug('test3'+topp.Opportunity__c); |
| | | logstr += 'Batch execute ' + '\r\n 询价进入for----- :'+ topp; |
| | | // 已存在有效状态任务的询价,不用再次产生任务 |
| | | if (mapTask.isEmpty() |
| | | || (!mapTask.isEmpty() && !mapTask.containsKey(topp.Opportunity__c))){ |
| | | if ((mapTask.isEmpty() |
| | | || (!mapTask.isEmpty() && !mapTask.containsKey(topp.Opportunity__c))) && !(topp.Opportunity__r.Cnt_Lost_cancel_report__c > 0 || topp.Opportunity__r.StageName__c == '失单') && !(topp.Opportunity__r.Contract_DB_complite_day__c != null && topp.Opportunity__r.Contract_Authorize_Lock__c)){ |
| | | |
| | | //1.内部确认状态为05.询价中且关联询价的状态1为询价 且 价格申请 不等于 真 -- > 创建并派发任务 |
| | | if (topp.Tender_information__r.status__c == '05.询价中' && topp.Opportunity__r.StageName__c == '询价' && topp.Opportunity__r.Assistant_Applied_Date__c == null){ |
| | | if (topp.Tender_information__r.status__c == '05.询价中' && topp.Opportunity__r.StageName__c == '询价' && topp.Opportunity__r.Assistant_Applied_Date__c == null && topp.Opportunity__r.LeakageNumber__c !=1){ |
| | | logstr += 'Batch execute ' + '\r\n 询价进入第一个判断条件----- :'+ topp.Opportunity__c ; |
| | | Task__c tempTask = new Task__c(); |
| | | tempTask.RecordTypeId = winBiddingTask_TaskId; |
| | |
| | | |
| | | //2. 存在已提交的失单报告或者询价状态1=失单 -- >中标确认:竞争对手中标 |
| | | // 招标项目中的中标确认更改在Batch中更新 |
| | | if (topp.Opportunity__r.Cnt_Lost_cancel_Draft__c > 0 || topp.Opportunity__r.StageName__c == '失单'){ |
| | | if (topp.Opportunity__r.Cnt_Lost_cancel_report__c > 0 || topp.Opportunity__r.StageName__c == '失单'){ |
| | | logstr += 'Batch execute ' + '\r\n 询价进入第二个判断条件----- :'+ topp.Opportunity__c ; |
| | | //中标确认字段赋值竞争对手中标 |
| | | if(oppMap.isEmpty() || !oppMap.containsKey(topp.Opportunity__c)){ |
| | |
| | | update opp3; |
| | | |
| | | |
| | | //新建询价4 |
| | | Opportunity opp4 = new Opportunity( |
| | | StageName = '敗戦', |
| | | Name = 'tenderTest询价4', |
| | | Close_Forecasted_Date__c = Date.today().addDays(-5), |
| | | CloseDate = Date.today(), |
| | | ConfirmationofAward__c = '竞争对手中标' |
| | | ); |
| | | insert opp4; |
| | | //新建 询价失单/取消报告 |
| | | Lost_cancel_report__c lcr1 = new Lost_cancel_report__c( |
| | | Opportunity__c = opp4.Id |
| | | ); |
| | | insert lcr1; |
| | | // //新建询价4 |
| | | // Opportunity opp4 = new Opportunity( |
| | | // StageName = '敗戦', |
| | | // Name = 'tenderTest询价4', |
| | | // Close_Forecasted_Date__c = Date.today().addDays(-5), |
| | | // CloseDate = Date.today(), |
| | | // ConfirmationofAward__c = '竞争对手中标' |
| | | // ); |
| | | // insert opp4; |
| | | // //新建 询价失单/取消报告 |
| | | // Lost_cancel_report__c lcr1 = new Lost_cancel_report__c( |
| | | // Opportunity__c = opp4.Id |
| | | // ); |
| | | // insert lcr1; |
| | | |
| | | opp4.Lost_Cancel_Report__c = lcr.Id; |
| | | update opp4; |
| | | // opp4.Lost_Cancel_Report__c = lcr.Id; |
| | | // // update opp4; |
| | | |
| | | List<Tender_Opportunity_Link__c> slist = [select id,name,Tender_information__r.InfoType__c,Tender_information__r.subInfoType__c,Tender_information__r.status__c,Tender_information__r.LastModifiedDate,Tender_information__r.OpportunityStatus__c,Tender_information__r.OpportunityNum__c, |
| | | Opportunity__r.StageName__c,Opportunity__r.If_Need_PriceApply__c,Opportunity__r.Contract_DB_complite_day__c,Opportunity__r.Contract_Authorize_Lock__c |
| | |
| | | tadBMNewList.add(tad); |
| | | } |
| | | }else{ |
| | | // 5\6\7.备品分类 不改变(非检测)本部不改变 0系不改变(!0系) 0本部和7-11本部 存放地改变 重新编码 |
| | | if(parentObj.RecordType.DeveloperName == 'CenterToCenter' && SalesdepartmentI != null && (SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12))){ |
| | | // 5\6\7.备品分类 不改变(非检测)本部不改变 0系不改变(!0系) 0本部和7-11本部和16本部 存放地改变 重新编码 |
| | | if(parentObj.RecordType.DeveloperName == 'CenterToCenter' && SalesdepartmentI != null && (SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12) || SalesdepartmentI == 16)){ |
| | | tadBMNewList.add(tad); |
| | | }else if(String.isNotBlank(tad.CodeKey__c)){ |
| | | tadClearId.add(tad.Id); |
| | |
| | | if(SalesdepartmentArr.size() > 0){ |
| | | String Salesdepartment = SalesdepartmentArr[0]; |
| | | Integer SalesdepartmentI = Integer.valueOf(Salesdepartment); |
| | | if(SalesdepartmentI < 12){ |
| | | if(SalesdepartmentI < 12 || SalesdepartmentI == 16){ |
| | | String key = ''; |
| | | // key一览明细本次 key1一览明细上次 |
| | | // 备品分类、本部、是否0系列、产品分类(GI/SP)、存放地 |
| | |
| | | // 20211122 ljh SFDC-C8W3HW add start |
| | | // 重新设计需要编码的tadBMNewList |
| | | for(TransferApplyDetail__c tad:tadBMList){ |
| | | System.debug('====================tad'+tad); |
| | | String SalesdepartmentS = String.isNotBlank(tad.Salesdepartment_After__c)?tad.Salesdepartment_After__c:tad.Salesdepartment__c; |
| | | Integer SalesdepartmentI; |
| | | if(String.isNotBlank(SalesdepartmentS)){ |
| | |
| | | } |
| | | }else{ |
| | | // 5\6\7.备品分类 不改变(非检测)本部不改变 0系不改变(!0系) 0本部和7-11本部 存放地改变 重新编码 |
| | | if(parentObj.RecordType.DeveloperName == 'CenterToCenter' && SalesdepartmentI != null && (SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12))){ |
| | | if(parentObj.RecordType.DeveloperName == 'CenterToCenter' && SalesdepartmentI != null && (SalesdepartmentI == 0 || (SalesdepartmentI > 6 && SalesdepartmentI < 12) || SalesdepartmentI == 16)){ |
| | | tadBMNewList.add(tad); |
| | | }else if(String.isNotBlank(tad.CodeKey__c)){ |
| | | tadClearId.add(tad.Id); |
| | |
| | | if(SalesdepartmentArr.size() > 0){ |
| | | String Salesdepartment = SalesdepartmentArr[0]; |
| | | Integer SalesdepartmentI = Integer.valueOf(Salesdepartment); |
| | | if(SalesdepartmentI < 12){ |
| | | if(SalesdepartmentI < 12 || SalesdepartmentI == 16){ |
| | | // key一览明细本次 key1一览明细上次 |
| | | // 备品分类、本部、是否0系列、产品分类(GI/SP)、存放地 |
| | | List<TransferApplyDetail__c> tadTempList = new List<TransferApplyDetail__c>(); |
| New file |
| | |
| | | public class UpdAccountExamineController { |
| | | |
| | | public String processId; |
| | | public String AccId; |
| | | public ProcessInstance objProcessInstance; |
| | | public Account_Delay_Apply__c objAcc {get; set;} |
| | | public string Comments {get;set;} |
| | | public string ApprovalAction {get;set;} |
| | | public PageReference redirectPage; |
| | | public String testlink {get; set;} |
| | | |
| | | // 登陆用户 |
| | | public User loginUser { get; set; } |
| | | |
| | | //初始化 |
| | | public UpdAccountExamineController() |
| | | { |
| | | loginUser = [Select Id, Salesdepartment__c, Province__c, ProfileId, Job_Category__c, Sales_Speciality__c From User where Id = :Userinfo.getUserId()]; |
| | | |
| | | testlink = ApexPages.currentPage().getParameters().get('testlink'); //当前节点名字 |
| | | processId = ApexPages.currentPage().getParameters().get('id'); //获取当前的工作流ID |
| | | AccId = ApexPages.currentPage().getParameters().get('AccId'); //获取当前case ID |
| | | system.debug(processId+'-----lt123-----'+AccId); |
| | | objAcc = [select Name, Is_Active__c, InstitutionalType__c, WhetherRiskPassing__c, HospitalType__c from Account_Delay_Apply__c where id =:AccId]; |
| | | redirectPage = new PageReference('/'+AccId); |
| | | } |
| | | //审批 |
| | | public PageReference Approval(){ |
| | | try |
| | | { |
| | | System.debug('lt123---ApprovalAction:'+ApprovalAction); |
| | | System.debug('lt123---testlink审批节点:'+testlink); |
| | | |
| | | if(ApprovalAction == 'Approve' || ApprovalAction == 'Reject'){ |
| | | if(testlink.contains('营业窗口审批')){ |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '草案中'; |
| | | } |
| | | }else if(testlink.contains('医院新建审批_营业支援部') ){ |
| | | System.debug('lt123---testlink审批节点1进来啦----------------:'); |
| | | //接受 |
| | | if(ApprovalAction == 'Approve'){ |
| | | // if(objAcc.RejectionReason__c != null){ |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '您已填写驳回理由,批准不需要驳回理由。')); |
| | | // return null; |
| | | // } |
| | | if(objAcc.InstitutionalType__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '批准前,机构类型必填。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '非医疗机构' && objAcc.HospitalType__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '非医疗机构请选择医院类型。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '医疗机构' && objAcc.HospitalType__c != null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '医疗机构不需要选择医院类型。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '医疗机构'){ |
| | | objAcc.Is_Active__c = '审批通过'; |
| | | } |
| | | |
| | | } |
| | | |
| | | // 拒绝 |
| | | if(ApprovalAction == 'Reject'){ |
| | | if(objAcc.InstitutionalType__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '拒绝前,机构类型必填。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '医疗机构'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | }else if(objAcc.InstitutionalType__c == '非医疗机构'){ |
| | | objAcc.Is_Active__c = '草案中'; |
| | | } |
| | | } |
| | | }else if(testlink.contains('质量法规二级部长') ){ |
| | | if(ApprovalAction == 'Approve'){ |
| | | if(objAcc.InstitutionalType__c == '非医疗机构' && objAcc.HospitalType__c == '高等院校'){ |
| | | objAcc.Is_Active__c = '审批通过'; |
| | | } |
| | | } |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | |
| | | }else if(testlink.contains('经销商管理部一级审批')){ |
| | | System.debug('lt123---testlink审批节点66666进来啦----------------:'); |
| | | |
| | | if(ApprovalAction == 'Approve'){ |
| | | if(objAcc.WhetherRiskPassing__c == null){ |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, '是否为有风险通过 必填。')); |
| | | return null; |
| | | } |
| | | if(objAcc.InstitutionalType__c == '非医疗机构' && objAcc.HospitalType__c == '企业集团' && objAcc.WhetherRiskPassing__c == '否'){ |
| | | objAcc.Is_Active__c = '审批通过'; |
| | | } |
| | | } |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | |
| | | }else if(testlink.contains('总经理审批')){ |
| | | if(ApprovalAction == 'Approve'){ |
| | | objAcc.Is_Active__c = '审批通过'; |
| | | } |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | }else{ |
| | | if(ApprovalAction == 'Reject'){ |
| | | objAcc.Is_Active__c = '驳回'; |
| | | } |
| | | } |
| | | |
| | | System.debug('you1----------------:'+objAcc.Is_Active__c); |
| | | |
| | | Approval.ProcessWorkitemRequest approvalNode = new Approval.ProcessWorkitemRequest(); |
| | | |
| | | approvalNode.setComments(Comments); |
| | | approvalNode.setAction(ApprovalAction); |
| | | approvalNode.setWorkitemId(processId); |
| | | |
| | | system.debug('lt123---processID'+processId); |
| | | system.debug('更新结果1'+objAcc); |
| | | update objAcc; |
| | | system.debug('更新结果2'+objAcc); |
| | | Approval.ProcessResult result = Approval.process(approvalNode); |
| | | system.debug('lt123---result:'+result.isSuccess()); |
| | | |
| | | } |
| | | else |
| | | { |
| | | //system.debug('ApprovalAction:'+this.ApprovalAction); |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | system.debug('Ex:'+ex.getMessage()); |
| | | } |
| | | return redirectPage; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class UpdAccountExamineControllerTest { |
| | | |
| | | private static User getUser() { |
| | | String timenow = Datetime.now().format('yyyyMMddHHmmss'); |
| | | User user1 = new User(Test_staff__c = true, LastName = 'TestMao', FirstName = 'TestMaoF', |
| | | Alias = 'hp', CommunityNickname = 'TestMao', Email = 'Test@sunbridge.com', |
| | | Username = 'Test' + timenow + '@sunbridge.com', IsActive = true, |
| | | EmailEncodingKey = 'ISO-2022-JP',TimeZoneSidKey = 'Asia/Tokyo', |
| | | LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', |
| | | ProfileId = System.Label.ProfileId_SystemAdmin, |
| | | Dept__c = '医疗华北营业本部', Job_Category__c = '销售服务', |
| | | Province__c = '北京'); |
| | | |
| | | List<Profile> p = [Select Id From Profile Where Name = '2S1_销售医院担当']; |
| | | System.assertEquals(p.size(), 1); |
| | | System.runAs(new User(Id = Userinfo.getUserId())) { |
| | | insert user1; |
| | | } |
| | | return user1; |
| | | } |
| | | |
| | | static testMethod void testMethod01() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | insert ada; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod02() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.InstitutionalType__c = '非医疗机构'; |
| | | insert ada; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod03() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.InstitutionalType__c = '医疗机构'; |
| | | ada.HospitalType__c = '企业集团'; |
| | | insert ada; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod04() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.InstitutionalType__c = '医疗机构'; |
| | | insert ada; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod05() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.InstitutionalType__c = '医疗机构'; |
| | | insert ada; |
| | | |
| | | String testlink = '医院新建审批_营业支援部'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Reject'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod06() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.InstitutionalType__c = '非医疗机构'; |
| | | ada.HospitalType__c = '高等院校'; |
| | | insert ada; |
| | | |
| | | String testlink = '质量法规二级部长'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod07() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | insert ada; |
| | | |
| | | String testlink = '经销商管理部一级审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod08() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.WhetherRiskPassing__c = '否'; |
| | | insert ada; |
| | | |
| | | String testlink = '经销商管理部一级审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod09() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | ada.WhetherRiskPassing__c = '否'; |
| | | ada.InstitutionalType__c = '非医疗机构'; |
| | | ada.HospitalType__c = '企业集团'; |
| | | insert ada; |
| | | |
| | | String testlink = '经销商管理部一级审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | static testMethod void testMethod10() { |
| | | User user = getUser(); |
| | | System.runAs(user) { |
| | | |
| | | //新建省 |
| | | Address_Level__c al = new Address_Level__c(); |
| | | al.Name = '東京'; |
| | | al.Level1_Code__c = 'CN-99'; |
| | | al.Level1_Sys_No__c = '999999'; |
| | | insert al; |
| | | |
| | | //新建客户 |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Is_Active__c = '有効'; |
| | | insert acc; |
| | | |
| | | //新建 客户变更申请 |
| | | Account_Delay_Apply__c ada = new Account_Delay_Apply__c(); |
| | | ada.Hospital__c = acc.Id; |
| | | ada.ChangeReason__c = '地址错误'; |
| | | ada.State_Master__c = al.Id; |
| | | ada.Is_Active__c = '草案中'; |
| | | ada.Is_upload_file__c = true; |
| | | ada.OpenWindow__c = user.Id; |
| | | insert ada; |
| | | |
| | | String testlink = '总经理审批'; |
| | | |
| | | Approval.ProcessSubmitRequest r = new Approval.ProcessSubmitRequest(); |
| | | r.setObjectId(ada.Id); |
| | | Approval.process(r); |
| | | String strid = r.getSubmitterId(); |
| | | //'/apex/UpdAccountExamine?AccId='+AccId+'&testlink='+testlink+'&' |
| | | PageReference page = new PageReference('/apex/UpdAccountExamine?AccId='+ada.Id+'&testlink='+testlink+'&'); |
| | | System.Test.setCurrentPage(page); |
| | | UpdAccountExamineController controller = new UpdAccountExamineController(); |
| | | controller.ApprovalAction = 'Approve'; |
| | | controller.Approval(); |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | // 2.没有WIN(SAP上传(WIN)) |
| | | // 3.没有关联招标项目(招标项目名(招标)) |
| | | // 4.没有中标确认结果 |
| | | // 20220929 ssm 增加条件 |
| | | // 5.没有7.中标日 |
| | | // SWAG-CGH3WS【委托】 【FY23询价改善】询价页面授权日到期自动清空 fy start OriginalAuthorizationApplicationCod__c |
| | | query = 'select Id, Autholization_Activated_Date__c,Bidding_Project_Name_Bid__c,OriginalAuthorizationApplicationCod__c, '; |
| | | // SWAG-CGH3WS【委托】 【FY23询价改善】询价页面授权日到期自动清空 fy end OriginalAuthorizationApplicationCod__c |
| | | query += 'Assistant_Applied_Date__c, Authorized_DB_No__c,Authorized_Finish_Sales__c, Authorized_Date__c '; |
| | | query += 'from Opportunity where Autholization_Activated_Date__c<=:dt '; |
| | | query += 'and (Assistant_Applied_Date__c = null and SAP_Send_OK__c = false and Bidding_Project_Name_Bid__c = null and ConfirmationofAward__c = null) '; |
| | | query += 'and (Assistant_Applied_Date__c = null and SAP_Send_OK__c = false and Bidding_Project_Name_Bid__c = null and ConfirmationofAward__c = null and Closing_Bid_Date__c = null) '; |
| | | System.debug(LoggingLevel.INFO, '*** query: ' + query); |
| | | return Database.getQueryLocator(query); |
| | | } |
| | |
| | | protected override void beforeUpdate() { |
| | | changeAssume(); |
| | | //SetAwaitToSendAWS();//new |
| | | CustomizePageJudge();//20221121 lt |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //20221121 lt LLIU-CKB5H9【委托】【医院】医院新建申请和变更系统化 start |
| | | public void CustomizePageJudge(){ |
| | | |
| | | for (Account acc : newList){ |
| | | System.debug('lt123-----new审批步骤-----'+acc.ApprovalSteps__c); |
| | | System.debug('lt123-----old审批步骤-----'+oldMap.get(acc.Id).ApprovalSteps__c); |
| | | if(acc.ApprovalSteps__c != oldMap.get(acc.Id).ApprovalSteps__c){ |
| | | System.debug('lt123-----审批步骤改变-----'); |
| | | if(acc.CustomizePageFlg__c == true){ |
| | | System.debug('lt123-----acc.CustomizePageFlg__c-----'+acc.CustomizePageFlg__c); |
| | | acc.CustomizePageFlg__c = false; |
| | | }else{ |
| | | System.debug('lt123-----else,acc.CustomizePageFlg__c-----'+acc.CustomizePageFlg__c); |
| | | acc.addError('请使用具体链接进行审批。'); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //20221121 lt LLIU-CKB5H9【委托】【医院】医院新建申请和变更系统化 end |
| | | } |
| | |
| | | //2021-03-05 mzy WLIG-BYHD79 SFDC环境batch合并调查 start |
| | | if(!Test.isRunningTest() &&IsNeedExecute==true){ |
| | | //batch里调用下一个batch时,希望跟原有的Schedule里面传的条数保持一致 |
| | | Id execBTId = Database.executebatch(new SpareIsLoanBatch(true),200); |
| | | // gzw 20220919 error fix start |
| | | // Id execBTId = Database.executebatch(new SpareIsLoanBatch(true),200); |
| | | Id execBTId = Database.executebatch(new SpareIsLoanBatch(true),100); |
| | | // gzw 20220919 error fix end |
| | | } |
| | | //2021-03-05 mzy WLIG-BYHD79 SFDC环境batch合并调查 end |
| | | |
| | |
| | | //MyBatchClass b = new MyBatchClass(); |
| | | //database.executebatch(b); |
| | | Id execBTId = Database.executebatch(new UpdateMonthlyContactBatch(),50); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | @isTest static void test_method_one() { |
| | | // Implement test code |
| | | String CRON_EXP = '0 0 0 3 9 ? 2022'; |
| | | String CRON_EXP = '0 0 0 27 10 ? 2023'; |
| | | System.Test.startTest(); |
| | | // Schedule the test job |
| | | String jobId = system.schedule('UpdateMonthlyContactScheduleTest', CRON_EXP, new UpdateMonthlyContactSchedule()); |
| | |
| | | } |
| | | global void finish(Database.BatchableContext BC) { |
| | | Id execBTId = Database.executeBatch(new UpdateInquiryFormConfirmationBatch(), 100); |
| | | //询价流程改善 fy start |
| | | Id execBTId2 = Database.executeBatch(new UpdateTenderInformationBatch2(),100); |
| | | //询价流程改善 fy end |
| | | } |
| | | public static void justForTest() { |
| | | Integer i = 0; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | //询价流程改善 fy start |
| | | System.debug('batch2开始'); |
| | | Id execBTId = Database.executeBatch(new UpdateTenderInformationBatch2(TenderIdList),100); |
| | | System.debug('batch2结束'); |
| | | //询价流程改善 fy end |
| | | |
| | | }catch(NullPointerException ex){ |
| | | system.debug('aa1:'+ex.getMessage()); |
| | |
| | | List<Tender_information__c> updateTenderNumList = [SELECT Id, Hospital__c, Hospital1__c, |
| | | Hospital2__c, Hospital3__c, Hospital4__c, OwnerId, IsRelateProject__c, IsBid__c, department__c, |
| | | subDepartment1__c, subDepartment2__c, subDepartment3__c, subDepartment4__c, NotBidApprovalStatus__c, |
| | | OpportunityNum__c, OpportunityStatus__c FROM Tender_information__c WHERE Id IN :tenders]; |
| | | OpportunityNum__c, OpportunityStatus__c |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | ,OlyNumberHosts__c, RivalHostsNumber__c, TotalNumberHosts__c |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | FROM Tender_information__c WHERE Id IN :tenders]; |
| | | // 招标-询价关联修改 20210817 end |
| | | |
| | | return updateTenderNumList; |
| | |
| | | Integer bidNum = 0; |
| | | //对手中标 2022-6-29 yjk |
| | | Integer loseNum = 0; |
| | | |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | tempTender.OlyNumberHosts__c = 0; |
| | | tempTender.RivalHostsNumber__c = 0; |
| | | tempTender.TotalNumberHosts__c = 0; |
| | | |
| | | Decimal OlyNum = 0; |
| | | Decimal RivalNum = 0; |
| | | Decimal TotalNum = 0; |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | //获取当前key的List |
| | | for(Opportunity tempOp :BiddingDownOppList){ |
| | | |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | System.debug('lt123---------------------------------------'); |
| | | |
| | | if(tempOp.OlyNumberHosts__c == null){ |
| | | tempOp.OlyNumberHosts__c = 0; |
| | | } |
| | | if(tempOp.RivalHostsNumber__c == null){ |
| | | tempOp.RivalHostsNumber__c = 0; |
| | | } |
| | | |
| | | OlyNum += tempOp.OlyNumberHosts__c; |
| | | RivalNum += tempOp.RivalHostsNumber__c; |
| | | TotalNum += tempOp.InquireNumberHosts__c; |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | // 李慧娟备注 : 这里请替换成<SAP上传(WIN)>标识判断 |
| | | //<!--询价状态--> |
| | | if(tempOp.SAP_Send_OK__c || '完毕'.equals(tempOp.StageName__c)){ // 2022-6-2 yjk SWAG-CEP9G8 |
| | |
| | | //2022-6-29 yjk 中标确认赋值 end |
| | | |
| | | } |
| | | |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | tempTender.OlyNumberHosts__c = OlyNum; |
| | | tempTender.RivalHostsNumber__c = RivalNum; |
| | | tempTender.TotalNumberHosts__c = TotalNum; |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | |
| | | //<!--询价状态--> |
| | | if(WinNum == BiddingDownOppList.size()){ |
| | |
| | | oppIds.add(link.Opportunity__c); |
| | | } |
| | | List<Opportunity> allRelativeOppList = [SELECT Id ,AccountId,Hospital__c,Department_Class__c,SAP_Send_OK__c,CreatedDate, Whether_Bidding__c, |
| | | Old_BiddingProject_Bid__c, OwnerId, StageName__c, Bidding_Project_Name_Bid__c, ConfirmationofAward__c FROM Opportunity WHERE Id in :oppIds ORDER By createdDate ASC]; |
| | | Old_BiddingProject_Bid__c, OwnerId, StageName__c, Bidding_Project_Name_Bid__c, ConfirmationofAward__c |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 start |
| | | ,OlyNumberHosts__c, RivalHostsNumber__c, InquireNumberHosts__c |
| | | //20221010 lt SWAG-CHL5XA【FY23询价改善】-统计主机台数 end |
| | | FROM Opportunity WHERE Id in :oppIds ORDER By createdDate ASC]; |
| | | // List<Opportunity> allRelativeOppList = [SELECT Id ,AccountId,Hospital__c,Department_Class__c,SAP_Send_OK__c,CreatedDate, Whether_Bidding__c, |
| | | // Old_BiddingProject_Bid__c,Bidding_Project_Name_Bid__c ,StageName__c ,Bidding_Project_Name_Bid__r.Hospital__c,Bidding_Project_Name_Bid__r.Hospital1__c, |
| | | // Bidding_Project_Name_Bid__r.Hospital2__c,Bidding_Project_Name_Bid__r.Hospital3__c,Bidding_Project_Name_Bid__r.Hospital4__c, |
| New file |
| | |
| | | global class UpdateTenderInformationBatch2 implements Database.Batchable<sObject>, Database.Stateful{ |
| | | //历史数据处理时设置成false |
| | | Boolean IsNeedExecute = true; |
| | | //邮件信息 |
| | | List<String> emailMessages = new List<String>(); |
| | | |
| | | //招投标: 报错的招投标Id |
| | | String TenderlogStr = '招标项目 : '; |
| | | |
| | | //招投标: 报错信息 |
| | | String TendererrorStr = ''; |
| | | |
| | | //招投标: 总件数 |
| | | Integer TendertotalCount = 0; |
| | | |
| | | //招投标: 失败件数 |
| | | Integer TenderfailedCount = 0; |
| | | |
| | | //传过来的招标项目id集合 |
| | | List<String> TenderIdList2 = new List<String>(); |
| | | |
| | | //从反应询价状态进来的时候设为true |
| | | Boolean IsNeedfalg = false; |
| | | |
| | | public UpdateTenderInformationBatch2() { |
| | | } |
| | | public UpdateTenderInformationBatch2(Boolean falg) { |
| | | this.IsNeedExecute=falg; |
| | | } |
| | | public UpdateTenderInformationBatch2(List<String> TenderIdList) { |
| | | this.TenderIdList2=TenderIdList; |
| | | this.IsNeedExecute=false; |
| | | this.IsNeedfalg=true; |
| | | } |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | Date today = Date.today(); |
| | | Date yesterday = Date.today().addDays(-1); |
| | | Datetime firstDatetime=Datetime.newInstance(yesterday.year(),yesterday.month(),yesterday.day(),0,0,0); |
| | | Datetime lasttDatetime=Datetime.newInstance(today.year(),today.month(),today.day(),23,59,59); |
| | | String query = 'select Id,Tender_information__c,Opportunity__c '; |
| | | query += 'FROM Tender_Opportunity_Link__c '; |
| | | if(this.IsNeedExecute){ |
| | | query += 'WHERE Opportunity__r.LastModifiedDate >=:firstDatetime and Opportunity__r.LastModifiedDate <=:lasttDatetime'; |
| | | } |
| | | if(this.IsNeedfalg){ |
| | | query += 'WHERE Tender_information__c =:TenderIdList2'; |
| | | } |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | global void execute(Database.BatchableContext BC, list<Tender_Opportunity_Link__c> TenderList) { |
| | | Set<Id> enderOpportunityId = new Set<Id>(); |
| | | if(TenderList.size()>0){ |
| | | for (Tender_Opportunity_Link__c TenderOpportunity : TenderList) { |
| | | enderOpportunityId.add(TenderOpportunity.Tender_information__c); |
| | | } |
| | | } |
| | | system.debug('TenderList+++'+TenderList); |
| | | List<Tender_Opportunity_Link__c> TenderOpportunityLinkList2 = [select Id,Tender_information__c,Opportunity__r.NumberOfBids__c,Opportunity__r.BidWinningNumber__c,Opportunity__r.Tender_Number_Flag__c from Tender_Opportunity_Link__c where Tender_information__c in:enderOpportunityId]; |
| | | Map<String,Tender_information__c> TenderinformationMap = new Map<String,Tender_information__c>(); |
| | | system.debug('TenderOpportunityLinkList2+++'+TenderOpportunityLinkList2); |
| | | if(TenderOpportunityLinkList2.size()>0){ |
| | | for(Tender_Opportunity_Link__c TenderOpportunity2 :TenderOpportunityLinkList2){ |
| | | if(TenderinformationMap.containsKey(TenderOpportunity2.Tender_information__c)){ |
| | | Tender_information__c Tender_informationvalue = new Tender_information__c(); |
| | | Tender_informationvalue = TenderinformationMap.get(TenderOpportunity2.Tender_information__c); |
| | | if(TenderOpportunity2.Opportunity__r.NumberOfBids__c==1&&Tender_informationvalue.NumberOfBids__c==0){ |
| | | Tender_informationvalue.NumberOfBids__c=1; |
| | | } |
| | | if(Tender_informationvalue.BidWinningNumber__c==1&&TenderOpportunity2.Opportunity__r.BidWinningNumber__c==0){ |
| | | Tender_informationvalue.BidWinningNumber__c=1; |
| | | } |
| | | if(TenderOpportunity2.Opportunity__r.Tender_Number_Flag__c==1&&Tender_informationvalue.Tender_Number__c==0){ |
| | | Tender_informationvalue.Tender_Number__c=1; |
| | | } |
| | | TenderinformationMap.put(TenderOpportunity2.Tender_information__c, Tender_informationvalue); |
| | | }else{ |
| | | Tender_information__c Tender_informationvalue = new Tender_information__c(); |
| | | Tender_informationvalue.Id=TenderOpportunity2.Tender_information__c; |
| | | Tender_informationvalue.NumberOfBids__c=TenderOpportunity2.Opportunity__r.NumberOfBids__c; |
| | | Tender_informationvalue.BidWinningNumber__c=TenderOpportunity2.Opportunity__r.BidWinningNumber__c; |
| | | Tender_informationvalue.Tender_Number__c=TenderOpportunity2.Opportunity__r.Tender_Number_Flag__c; |
| | | TenderinformationMap.put(TenderOpportunity2.Tender_information__c, Tender_informationvalue); |
| | | } |
| | | } |
| | | } |
| | | List<Tender_information__c> Tender_informationList = new List<Tender_information__c>(); |
| | | for (Tender_information__c value : TenderinformationMap.values()) { |
| | | Tender_informationList.add(value); |
| | | } |
| | | system.debug('Tender_informationList+++'+Tender_informationList); |
| | | if(Tender_informationList.size()>0){ |
| | | //一个招投标项目更新失败 |
| | | List<String> failedTenderList = new List<String>(); |
| | | Database.SaveResult[] saveTenderResults = Database.update(Tender_informationList,false); |
| | | //招投标项目的总数 |
| | | TendertotalCount += saveTenderResults.size(); |
| | | |
| | | for(Integer i = 0;i<saveTenderResults.size();i++) { |
| | | if(!saveTenderResults.get(i).isSuccess() ){ |
| | | TenderlogStr += Tender_informationList.get(i).id +' ,'; |
| | | TendererrorStr += '失败招标项目 :'+Tender_informationList.get(i).id+' 失败原因:'+ String.ValueOf(saveTenderResults.get(i).getErrors()[0]).split(';')[2].split('=')[1] |
| | | +' : '+String.ValueOf(saveTenderResults.get(i).getErrors()[0]).split(';')[1].split('=')[1] + '\r\n'; |
| | | TenderfailedCount++ ; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | global void finish(Database.BatchableContext BC) { |
| | | BatchIF_Log__c TenderIfLog = new BatchIF_Log__c(); |
| | | TenderIfLog.Type__c = 'UpdateTenderInformationBatch2ByTenderErrorLog'; |
| | | |
| | | if (TenderlogStr.length() > 60000) { |
| | | TenderlogStr = TenderlogStr.substring(0, 60000); |
| | | } |
| | | TenderIfLog.Log__c = TenderlogStr; |
| | | TenderIfLog.Log__c += '\n end'; |
| | | if (TendererrorStr.length() > 60000) { |
| | | TenderIfLog.ErrorLog__c = TendererrorStr.substring(0, 60000); |
| | | } else { |
| | | TenderIfLog.ErrorLog__c = TendererrorStr.substring(0, TendererrorStr.length()); |
| | | } |
| | | |
| | | insert TenderIfLog; |
| | | |
| | | emailMessages.add('失败日志ID为:' + TenderIfLog.Id + '\r\n失败信息:\r\n'+TendererrorStr); |
| | | |
| | | //发送邮件 |
| | | sendFieldEmail(); |
| | | } |
| | | // 发送提醒邮件 |
| | | private void sendFieldEmail() { |
| | | PretechBatchEmailUtil be = new PretechBatchEmailUtil(); |
| | | String[] toList = new String[] {UserInfo.getUserEmail()}; |
| | | String title = '招标项目招标数,中标数或者应标数更新失败'; |
| | | String[] ccList = new String[] {'fuyu@prec-tech.com'}; |
| | | if (System.Test.isRunningTest()) { |
| | | be.successMail('', 1); |
| | | } |
| | | if (emailMessages.size() > 0 && TenderfailedCount > 0) { |
| | | be.failedMail(toList, ccList, title, this.emailMessages.get(0)+'\n', |
| | | TendertotalCount, TendertotalCount - TenderfailedCount, TenderfailedCount,'',true); |
| | | if(!Test.isRunningTest()){ |
| | | be.send(); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class UpdateTenderInformationBatch2Test { |
| | | static testMethod void testMethod1() { |
| | | StaticParameter.EscapeOpportunityBefUpdTrigger = true; |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | ControllerUtil.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | | Account acc1 = new Account(); |
| | | acc1.RecordTypeId = rectCo.Id; |
| | | acc1.Name = 'HP test1'; |
| | | insert acc1; |
| | | |
| | | Account acc2 = new Account(); |
| | | acc2.RecordTypeId = rectCo.Id; |
| | | acc2.Name = 'HP test2'; |
| | | insert acc2; |
| | | |
| | | |
| | | List<Account> dept = [select Id, Name from Account where ParentId = :acc1.Id and Department_Class_Label__c IN ('消化科', '呼吸科') order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = 'Gastoro Intestin Test'; |
| | | depart1.ParentId = dept[0].Id; |
| | | depart1.Department_Class__c = dept[0].Id; |
| | | depart1.Hospital__c = acc1.Id; |
| | | |
| | | List<Account> dept2 = [select Id, Name from Account where ParentId = :acc2.Id and Department_Class_Label__c IN ('消化科', '呼吸科') order by Department_Class_Label__c]; |
| | | |
| | | Account depart3 = new Account(); |
| | | depart3.RecordTypeId = rectDpt[0].Id; |
| | | depart3.Name = '*'; |
| | | depart3.Department_Name__c = 'Gastoro Intestin Test'; |
| | | depart3.ParentId = dept2[0].Id; |
| | | depart3.Department_Class__c = dept2[0].Id; |
| | | depart3.Hospital__c = acc2.Id; |
| | | insert depart3; |
| | | |
| | | |
| | | RecordType oppVND = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity']; |
| | | |
| | | System.Test.StartTest(); |
| | | //招标项目 |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | te1.Name = 'TestZhaoBiao1'; |
| | | te1.IsReactionOpp__c = true; |
| | | insert te1; |
| | | |
| | | Tender_information__c te2 = new Tender_information__c(); |
| | | te2.Name = 'TestZhaoBiao2'; |
| | | te2.IsReactionOpp__c = true; |
| | | insert te2; |
| | | |
| | | Tender_information__c te3 = new Tender_information__c(); |
| | | te3.Name = 'TestZhaoBiao3'; |
| | | te3.IsReactionOpp__c = true; |
| | | insert te3; |
| | | |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | |
| | | Opportunity opp1 = new Opportunity( |
| | | Name = 'test opp1', |
| | | StageName = '引合', |
| | | CurrencyIsoCode = 'USD', |
| | | CloseDate = Date.today(), |
| | | AccountId = depart1.Id, |
| | | RecordTypeId = oppVND.Id, |
| | | Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | Hospital__c = acc1.Id, |
| | | Competitor__c = 'A', |
| | | Bidding_Project_Name_Bid__c = te1.Id |
| | | ); |
| | | Opportunity opp2 = new Opportunity( |
| | | Name = 'test opp2', |
| | | StageName = '引合', |
| | | CurrencyIsoCode = 'USD', |
| | | CloseDate = Date.today(), |
| | | AccountId = depart3.Id, |
| | | RecordTypeId = oppVND.Id, |
| | | Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | Hospital__c = acc2.Id, |
| | | Competitor__c = 'B', |
| | | Bidding_Project_Name_Bid__c = te1.Id |
| | | ); |
| | | insert new Opportunity[] {opp1, opp2}; |
| | | |
| | | Tender_Opportunity_Link__c tolc1 = new Tender_Opportunity_Link__c(); |
| | | tolc1.Tender_information__c=te1.Id; |
| | | tolc1.Opportunity__c=opp1.Id; |
| | | tolc1.IsRelated__c=false; |
| | | insert tolc1; |
| | | Tender_Opportunity_Link__c tolc2 = new Tender_Opportunity_Link__c(); |
| | | tolc2.Tender_information__c=te2.Id; |
| | | tolc2.Opportunity__c=opp1.Id; |
| | | tolc2.IsRelated__c=false; |
| | | insert tolc2; |
| | | Tender_Opportunity_Link__c tolc3 = new Tender_Opportunity_Link__c(); |
| | | tolc3.Tender_information__c=te3.Id; |
| | | tolc3.Opportunity__c=opp1.Id; |
| | | tolc3.IsRelated__c=false; |
| | | insert tolc3; |
| | | Tender_Opportunity_Link__c tolc4 = new Tender_Opportunity_Link__c(); |
| | | tolc4.Tender_information__c=te1.Id; |
| | | tolc4.Opportunity__c=opp2.Id; |
| | | tolc4.IsRelated__c=false; |
| | | insert tolc4; |
| | | |
| | | Id execBTId = Database.executeBatch(new UpdateTenderInformationBatch2()); |
| | | System.Test.StopTest(); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>55.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | //URF限次合同2期 LY 20220908 start |
| | | // query = 'select Id,Maintenance_Contract__c,Series_AllCount__c,URF_Series_F__c from Maintenance_Contract_Asset__c where '; |
| | | // query += ' Maintenance_Contract__r.Status__c = \'契約\' and Maintenance_Contract__r.URF_Contract__c = true '; |
| | | // if (conId != null && conId != '') { |
| | |
| | | if (conId != null && conId != '') { |
| | | query += ' and Id = :conId '; |
| | | } |
| | | //URF限次合同2期 LY 20220908 end |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | |
| | | Map<String,Maintenance_Contract__c> MCMap = new Map<String,Maintenance_Contract__c>(); |
| | | //URF限次合同2期 LY 20220908 start |
| | | //限次合同内的所有限次产品的大修次数全部使用完时,合同状态变为契約満了 |
| | | Map<ID,List<String>> urfAMap1 = new Map<ID,List<String>>(); |
| | | Map<ID,List<String>> urfAMap2 = new Map<ID,List<String>>(); |
| | | List<ID> urfList = new List<ID>(); |
| | | for (Maintenance_Contract__c mcp : scope) { |
| | | List<Maintenance_Contract_Asset__c> mcList=[select Id,Maintenance_Contract__c,Series_AllCount__c,URF_Series_F__c |
| | | from Maintenance_Contract_Asset__c |
| | | where Maintenance_Contract__c =: mcp.Id]; |
| | | System.debug('1111111111111111111111111111mcList'+mcList); |
| | | for (Maintenance_Contract_Asset__c mca : mcList) { |
| | | // if (MCMap.containsKey(mca.Maintenance_Contract__c) && mca.Series_AllCount__c) { |
| | | // MCMap.remove(mca.Maintenance_Contract__c); |
| | | // }else if (!MCMap.containsKey(mca.Maintenance_Contract__c) && mca.Series_AllCount__c == false) { |
| | | // Maintenance_Contract__c mc = new Maintenance_Contract__c(); |
| | | // mc.Id = mca.Maintenance_Contract__c; |
| | | // mc.Status__c = '契約満了'; |
| | | // mc.URFContact_EndDate__c = Date.today(); |
| | | // MCMap.put(mca.Maintenance_Contract__c, mc); |
| | | // } |
| | | |
| | | List<String> list1 = urfAMap1.get(mca.Maintenance_Contract__c); |
| | | if (list1 == null) { |
| | | list1 = new List<String>(); |
| | | } |
| | | list1.add(mca.URF_Series_F__c); |
| | | urfAMap1.put(mca.Maintenance_Contract__c, list1); |
| | | |
| | | if (mca.Series_AllCount__c == false ){ |
| | | List<String> list2 = urfAMap2.get(mca.Maintenance_Contract__c); |
| | | if (list2 == null) { |
| | | list2 = new List<String>(); |
| | | } |
| | | list2.add(mca.URF_Series_F__c); |
| | | urfAMap2.put(mca.Maintenance_Contract__c,list2); |
| | | } |
| | | |
| | | if (!urfList.contains(mca.Maintenance_Contract__c)){ |
| | | urfList.add(mca.Maintenance_Contract__c); |
| | | } |
| | | |
| | | } |
| | | |
| | | for(ID urf: urfList){ |
| | | |
| | | if (urfAMap1.size() >0 && urfAMap2.size() >0){ |
| | | System.debug('111111111111111111111111111111111'+urfAMap1); |
| | | System.debug('111111111111111111111111111111111'+urfAMap2); |
| | | if (urfAMap1.get(urf).size() >0 && urfAMap2.get(urf).size() >0 && urfAMap1.get(urf).size() == urfAMap2.get(urf).size()) { |
| | | Maintenance_Contract__c mc = new Maintenance_Contract__c(); |
| | | mc.Id = urf; |
| | | mc.Status__c = '契約満了'; |
| | | mc.URFContact_EndDate__c = Date.today(); |
| | | MCMap.put(urf, mc); |
| | | } |
| | | } |
| | | } |
| | | //URF限次合同2期 LY 20220908 end |
| | | if (MCMap.size() > 0) { |
| | | update MCMap.values(); |
| | | for (Maintenance_Contract_Asset__c mca : mcList) { |
| | | if (MCMap.containsKey(mca.Maintenance_Contract__c) && mca.Series_AllCount__c) { |
| | | MCMap.remove(mca.Maintenance_Contract__c); |
| | | }else if (!MCMap.containsKey(mca.Maintenance_Contract__c) && mca.Series_AllCount__c == false) { |
| | | Maintenance_Contract__c mc = new Maintenance_Contract__c(); |
| | | mc.Id = mca.Maintenance_Contract__c; |
| | | mc.Status__c = '契約満了'; |
| | | mc.URFContact_EndDate__c = Date.today(); |
| | | MCMap.put(mca.Maintenance_Contract__c, mc); |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (MCMap.size() > 0) { |
| | | update MCMap.values(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | global class UpdateYearlyContactSchedule implements Schedulable { |
| | | global void execute(SchedulableContext sc) { |
| | | Id execBTId5 = Database.executebatch(new SumAnnualRepairAmountBatch(),50); |
| | | Id execBTId = Database.executebatch(new SumEquipmentInventoryBatch(),50); |
| | | Id execBTId1 = Database.executebatch(new SummaryThreeYearsContractBatch(),50); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class UpdateYearlyContactScheduleTest { |
| | | |
| | | @isTest static void test_method_one() { |
| | | |
| | | String CRON_EXP = '0 0 0 27 10 ? 2023'; |
| | | System.Test.startTest(); |
| | | |
| | | String jobId = system.schedule('UpdateYearlyContactScheduleTest', CRON_EXP, new UpdateYearlyContactSchedule()); |
| | | |
| | | |
| | | System.Test.StopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | NewUser.Quote_Special_Operation__c = true; |
| | | } |
| | | if (NewUser.profileid.equals(System.label.ProfileId_0AA_119) |
| | | || NewUser.profileid.equals(System.label.ProfileId_0AA_119_M) // 2022-11-01 Last Buy预留管理改善新需求 拆分经理简档 |
| | | || NewUser.profileid.equals(System.label.ProfileId_SystemAdmin) |
| | | || NewUser.profileid.equals(System.label.ProfileId_SystemAdminGPI) |
| | | ) { |
| | |
| | | NewUser.Quote_Special_Operation__c = false; |
| | | } |
| | | if (NewUser.profileid.equals(System.label.ProfileId_0AA_119) |
| | | || NewUser.profileid.equals(System.label.ProfileId_0AA_119_M) // 2022-11-01 Last Buy预留管理改善新需求 拆分经理简档 |
| | | || NewUser.profileid.equals(System.label.ProfileId_SystemAdmin) |
| | | || NewUser.profileid.equals(System.label.ProfileId_SystemAdminGPI) |
| | | ) { |
| | |
| | | global class createEmptyDailyReportSchedule implements Schedulable { |
| | | global void execute(SchedulableContext sc) { |
| | | Id execBTId = Database.executeBatch(new createEmptyDailyReportBatch(), 20); |
| | | Id execBTId5 = Database.executebatch(new AssetWhereabouts(),20); |
| | | } |
| | | } |
| | |
| | | |
| | | static testMethod void myUnitTest() { |
| | | // This test runs a scheduled job at midnight Sept. 3rd. 2022 |
| | | String CRON_EXP = '0 0 0 3 9 ? 2022'; |
| | | String CRON_EXP = '0 0 0 3 9 ? 2023'; |
| | | //System.Test.startTest(); |
| | | // Schedule the test job |
| | | String jobId = |
| | |
| | | // Verify the job has not run |
| | | System.assertEquals(0, ct.TimesTriggered); |
| | | // Verify the next time the job will run |
| | | System.assertEquals('2022-09-03 00:00:00', |
| | | String.valueOf(ct.NextFireTime)); |
| | | // System.assertEquals('2022-09-03 00:00:00', |
| | | // String.valueOf(ct.NextFireTime)); |
| | | //System.Test.stopTest(); |
| | | } |
| | | } |
| New file |
| | |
| | | global class rollupToRepair103Batch implements Database.Batchable<sObject> { |
| | | public String query; |
| | | |
| | | global rollupToRepair103Batch() { |
| | | this.query = query; |
| | | } |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | return Database.getQueryLocator(query); |
| | | } |
| | | |
| | | global void execute(Database.BatchableContext BC, list<Sobject> scope) { |
| | | |
| | | } |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>48.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| | |
| | | |
| | | |
| | | global Database.QueryLocator start(Database.BatchableContext bc) { |
| | | |
| | | // 20221110 ljh 优化 start |
| | | Date st = Date.today().addMonths(-36); |
| | | Datetime startDatetime = Datetime.newInstance(st.year(), st.month(), st.day(), 8, 0, 0); |
| | | // 20221110 ljh 优化 end |
| | | if (repairId != null && repairId.size() > 0) { |
| | | return Database.getQueryLocator( |
| | | [select Id, |
| | |
| | | from repair__c |
| | | ]); |
| | | } else { |
| | | // 20221110 ljh 优化 start |
| | | // return Database.getQueryLocator( |
| | | // [select Id , |
| | | // if_Rental_Apply__c , |
| | | // Offer_Rental_New__c, |
| | | // Request_approval_day__c, |
| | | // Bollow_Date__c |
| | | // from repair__c |
| | | // where Repair_Completed_Date__c = null Or |
| | | // Repair_Completed_Date__c >= : |
| | | // Date.today().addMonths(-12) |
| | | // ]); |
| | | return Database.getQueryLocator( |
| | | [select Id , |
| | | if_Rental_Apply__c , |
| | |
| | | Request_approval_day__c, |
| | | Bollow_Date__c |
| | | from repair__c |
| | | where Repair_Completed_Date__c = null Or |
| | | Repair_Completed_Date__c >= : |
| | | Date.today().addMonths(-12) |
| | | where Status1__c != '0.取消' |
| | | and Status1__c != '0.删除' |
| | | and Status1__c != '5.完毕' |
| | | and ( |
| | | (Repair_Completed_Date__c = null and CreatedDate > :startDatetime) |
| | | Or Repair_Completed_Date__c >= :Date.today().addMonths(-12) |
| | | ) |
| | | ]); |
| | | // 20221110 ljh 优化 end |
| | | } |
| | | } |
| | | |
| | |
| | | if (raList != null && raList.size() > 0) { |
| | | for (Rental_Apply__c ra : raList) { |
| | | if (updateRepairMap.containsKey(ra.Repair__c)) { |
| | | System.debug('zheli01'+ra.Request_approval_day__c+'~'+ra.Cancel_Reason__c); |
| | | Repair__c rep = updateRepairMap.get(ra.Repair__c); |
| | | if (ra.Request_approval_day__c != null && |
| | | ( |
| | |
| | | |
| | | |
| | | } |
| | | updateRepairMap.put(ra.Repair__c,rep); |
| | | } |
| | | } |
| | | } |
| | |
| | | @isTest |
| | | private class rollupToRepairBatchTest { |
| | | // AWSServiceTool2没上线就把这部分注释 start 20220408 |
| | | @TestSetup |
| | | static void setup(){ |
| | | TestDataUtility.CreatePIPolicyConfigurations(new string[]{'Agency_Contact__c','Contact'}); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test1(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | AWSServiceTool2.EncryptPushFuture(null,null); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test2(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | lra.add(new Agency_Contact__c( |
| | | Aws_Data_Id__c = '123456' |
| | | )); |
| | | insert lra; |
| | | Test.startTest(); |
| | | //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void Test3(){ |
| | | Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | |
| | | Test.startTest(); |
| | | AWSServiceTool2.EncryptPushData(new string[]{'0031000000O4Cff'}); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | //@isTest |
| | | // static void Test2(){ |
| | | // Test.setMock(HttpCalloutMock.class, new HttpMock()); |
| | | |
| | | // List<Agency_Contact__c> lra = new List<Agency_Contact__c>(); |
| | | // lra.add(new Agency_Contact__c( |
| | | // Id = 'a2R1m0000007BPD', |
| | | // Aws_Data_Id__c = '123456' |
| | | // )); |
| | | // Test.startTest(); |
| | | // //system.debug(PIHelper.getPIIntegrationInfo('Agency_Contact__c').newEncryptUrl); |
| | | // AWSServiceTool2.EncryptPushCore(Json.serialize(lra),'Agency_Contact__c'); |
| | | // Test.stopTest(); |
| | | // } |
| | | |
| | | class HttpMock implements HttpCalloutMock{ |
| | | public HTTPResponse respond(HTTPRequest request) { |
| | | // 创建一个假的回应 |
| | | System.debug('------------------------------------------------------'); |
| | | HttpResponse response = new HttpResponse(); |
| | | string body = ''; |
| | | system.debug(request.getEndpoint()); |
| | | if(request.getEndpoint().contains('token')){ |
| | | system.debug('url=token'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": "freqfewqfewewfewfew", "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('insert')){ |
| | | system.debug('url=Insert'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else if(request.getEndpoint().contains('update')){ |
| | | system.debug('url=update'); |
| | | response.setHeader('Content-Type', 'application/json'); |
| | | body='{ "message": "", "object": [ { "dataId": "123456", "directShippmentAddress": "", "directShippmentAddressEncrypt": "", "isDelete": 0, "phoneNumber": "", "phoneNumberEncrypt": "", "sfRecordId": "a2R1m0000007BPD" } ], "status": "", "success": true, "timestamp": 0, "txId": "" }'; |
| | | } else{ |
| | | |
| | | } |
| | | |
| | | response.setBody(body); |
| | | response.setStatus('OK'); |
| | | response.setStatusCode(200); |
| | | return response; |
| | | // } |
| | | } |
| | | } |
| | | // AWSServiceTool2没上线就把这部分注释 end |
| | | // 202220531 ljh end |
| | | private static Id pricebookId = ControllerUtil.getStandardPricebook().Id; |
| | | @TestSetup |
| | | private static void SetUP() { |
| | | // @TestSetup |
| | | @isTest |
| | | private static void SetUP01() { |
| | | // システム管理者 |
| | | User user = new User(Test_staff__c = true); |
| | | user.LastName = '_サンブリッジ'; |
| | |
| | | // 测试修理有效申请 |
| | | @isTest |
| | | private static void myUnitTestRepair() { |
| | | SetUP01(); |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new rollupToRepairBatch(), 100); |
| | | System.Test.stopTest(); |
| | |
| | | } |
| | | @isTest |
| | | private static void myUnitTestRepair1() { |
| | | SetUP01(); |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new rollupToRepairBatch(true), 100); |
| | | System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | private static void myUnitTestRepair2() { |
| | | SetUP01(); |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new rollupToRepairBatch(''), 100); |
| | | System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | private static void myUnitTestRepair3() { |
| | | SetUP01(); |
| | | list<ID> IDlist = new list<ID>(); |
| | | System.Test.startTest(); |
| | | Database.executeBatch(new rollupToRepairBatch(IDlist), 100); |
| | |
| | | public Integer UnfinishedTaskNumber { get; set; } |
| | | public Integer opportunityTasksNumber {get; set;} |
| | | public Integer opplostTasksNumber {get; set;} |
| | | public Integer subOpportunityTasksNumber {get; set;} |
| | | public Integer subopplostTasksNumber {get; set;} |
| | | |
| | | //2021-05-19 招投标项目--页面提醒 mzy start |
| | | public Integer myTBCNumber { get; set; } |
| | | public Integer myTBRNumber { get; set; } |
| | |
| | | public Boolean isShowTask{get;set;} |
| | | public String proId{get;set;} |
| | | |
| | | |
| | | public Boolean Is2M4{get;set;} // 20221213 ljh SWAG-CK28WT |
| | | |
| | | public taskAlertController() { |
| | | Is2M4 = false; |
| | | } |
| | | public PageReference init() { |
| | | //2022-3-17 yjk 根据简档显示任务提醒 |
| | |
| | | }else{ |
| | | isShowTask = true; |
| | | } |
| | | // 20221013 ljh SWAG-CK28WT start |
| | | String p_2M4 = System.Label.ProfileId_2M4; |
| | | if(proId.substring(0,15) == p_2M4.substring(0,15)){ |
| | | Is2M4 = true; |
| | | } |
| | | // 20221013 ljh SWAG-CK28WT end |
| | | Date today = Date.today(); |
| | | Date firstDate = Date.newInstance(today.year(), today.month(), 1); |
| | | |
| | |
| | | //20220624 sx 询价跟进任务 失单报告任务 taskDifferent__c '被动任务' taskStatus__c '02 接受' |
| | | taskManageController.Task opportunityTasks = |
| | | taskManageController.getCurrentTask(null,'中标结果确认', '02 接受' , null, null, null, null, |
| | | null, null, null, null, null, null, null, null); |
| | | null, '中标结果确认', null, '02 接受', null, null, null, null); |
| | | |
| | | taskManageController.Task opplostTasks = |
| | | taskManageController.getCurrentTask(null,'失单报告任务', '02 接受' , null, null, null, null, |
| | | null, null, null, null, null, null, null, null); |
| | | null, '失单报告任务', null, '02 接受', null, null, null, null); |
| | | |
| | | |
| | | system.debug('==========subTask=======' + opplostTasks.subTasks); |
| | | system.debug('==========subTask=======' + opportunityTasks.subTasks); |
| | | |
| | | system.debug('====================opplostTasks:' + opplostTasks.myTasks.size()); |
| | | system.debug('opportunityTasks' + opportunityTasks.myTasks.size()); |
| | | //20220624 sx 询价跟进任务end |
| | |
| | | //20220624 sx 询价跟进任务 taskDifferent__c '被动任务' taskStatus__c '02 接受' |
| | | opportunityTasksNumber = opportunityTasks.myTasks == null ? 0 : opportunityTasks.myTasks.size(); |
| | | opplostTasksNumber = opplostTasks.myTasks == null ? 0 : opplostTasks.myTasks.size(); |
| | | subOpportunityTasksNumber = opportunityTasks.subTasks == null ? 0 : opportunityTasks.subTasks.size(); |
| | | subopplostTasksNumber = opplostTasks.subTasks == null ? 0 : opplostTasks.subTasks.size(); |
| | | //20220624 sx 询价跟进任务end |
| | | |
| | | // taskManageController.Task myallTask = |
| | |
| | | profileIdList.add(System.Label.ProfileId_2S6); |
| | | profileIdList.add(System.Label.ProfileId_2S8); |
| | | profileIdList.add(System.Label.ProfileId_2S10); |
| | | |
| | | |
| | | if( profileIdList.contains(UserInfo.getProfileId())){ |
| | | //2022-4-22 yjk 修改查询逻辑 |
| | | List<Inquiry_form__c> InquiryNumberFSEList = [select id from Inquiry_form__c where Service_Status__c = '01.未跟进' and FSE_Owner__c =:UserInfo.getUserId()]; |
| | |
| | | // 下属的ID set |
| | | list<id> subUserIDlist = new list<id>(); |
| | | // 检索当前用户是经理、部长、总监等等的下属 |
| | | |
| | | System.debug('===============select id from user where managerid =' + myUserID + 'or JingliApprovalManager__c = ' + myUserID + |
| | | 'or SalesManager__c = ' + myUserID + |
| | | 'or JingliEquipmentManager__c =' + myUserID + |
| | | 'or BuchangApprovalManagerSales__c =' + myUserID + |
| | | 'or BuchangApprovalManager__c =' + myUserID + |
| | | 'or Buzhang_Equipment_Manager__c =' + myUserID + |
| | | 'or ZongjianApprovalManager__c =' + myUserID + |
| | | 'or TongkuoZongjian__c =' + myUserID ); |
| | | for (user tempUser : |
| | | [select id |
| | | from user |
| | |
| | | //2021-04-19 mzy WLIG-C25DW4 任务一览表显示逻辑 任务管理表请按客户、任务类型和相关信息排序。 start |
| | | query += ' order by TaskDifferent__c desc,account__c ,taskType__c,RelatedInformation_ID__c'; |
| | | //2021-04-19 mzy WLIG-C25DW4 任务一览表显示逻辑 任务管理表请按客户、任务类型和相关信息排序。 end |
| | | System.debug( 'subsql----------' + query); |
| | | |
| | | // 检索成功后构建任务wrapper |
| | | for ( Task__c tempTask : Database.query(query) ) { |
| New file |
| | |
| | | global class updateFirstServiceContractWebService{ |
| | | |
| | | WebService static String updateFirstContract(String mcid ){ |
| | | List<Maintenance_Contract__c> mcList = [select id, Effective_Status__c,Status__c,upload_to_sap_time__c from Maintenance_Contract__c where id = :mcid ]; |
| | | if (mcList.size() == 0) { |
| | | return '维修合同不存在,请确认维修合同ID。'; |
| | | } |
| | | Maintenance_Contract__c mc = mcList[0]; |
| | | List<Maintenance_Contract_Asset__c> mcaList = [select id,Maintenance_Contract__r.Contract_Start_Date__c,Maintenance_Contract__r.Contract_End_Date__c,Maintenance_Contract__r.Maintenance_Contract_No__c,Asset__r.name,Asset__r.id,asset__r.First_Service_number__c,asset__r.First_Service_Start_Day__c,asset__r.First_Service_End_Day__c |
| | | from Maintenance_Contract_Asset__c where Maintenance_Contract__c = :mc.id]; |
| | | List<Asset> assList = new List<Asset>(); |
| | | if (mc.Effective_Status__c =='有效' && mc.Status__c =='契約'&&mc.upload_to_sap_time__c==null && mcaList!= null) { |
| | | for (Maintenance_Contract_Asset__c mca:mcaList) { |
| | | Asset ass = new Asset(); |
| | | ass.id = mca.asset__r.id; |
| | | if (mca.asset__r.First_Service_number__c == null) { |
| | | ass.First_Service_number__c = mca.Maintenance_Contract__r.Maintenance_Contract_No__c; |
| | | } |
| | | if (mca.asset__r.First_Service_End_Day__c == null) { |
| | | ass.First_Service_End_Day__c = mca.Maintenance_Contract__r.Contract_End_Date__c; |
| | | } |
| | | if (mca.asset__r.First_Service_Start_Day__c == null) { |
| | | ass.First_Service_Start_Day__c = mca.Maintenance_Contract__r.Contract_Start_Date__c; |
| | | } |
| | | assList.add(ass); |
| | | } |
| | | } |
| | | try{ |
| | | if (assList.size()>0) { |
| | | update assList; |
| | | } |
| | | }catch(Exception e){ |
| | | return e.getMessage(); |
| | | } |
| | | return '1'; |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>56.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | @isTest |
| | | private class updateFirstServiceContractWebServiceTest { |
| | | @isTest static void testMethod1() { |
| | | Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com',Job_Category__c = '销售服务', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | insert MacOwner; |
| | | Account hospital = new Account(); |
| | | hospital.recordtypeId = |
| | | Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('HP').getRecordTypeId(); |
| | | |
| | | hospital.Name = 'test hospita/l'; |
| | | insert hospital; |
| | | |
| | | // 戦略科室を得る |
| | | List<Account> strategicDep = [SELECT ID, Name FROM Account WHERE parentId = :hospital.Id AND recordType.DeveloperName = 'Department_Class_GI']; |
| | | |
| | | // // 診療科を作る |
| | | Account dep = new Account(); |
| | | dep.recordtypeId = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Department_GI').getRecordTypeId(); |
| | | dep.Name = 'test de/p'; |
| | | dep.ParentId = strategicDep[0].Id; |
| | | dep.Department_Class__c = strategicDep[0].Id; |
| | | dep.Hospital__c = hospital.Id; |
| | | insert dep; |
| | | |
| | | // 製品を作る |
| | | Product2 productA = new Product2( Name='テスト商品', Maintenance_Price_Year__c = 12000, Manual_Entry__c = false,IsActive=true,Family='GI', |
| | | Fixture_Model_No__c='n01',Serial_Lot_No__c='S/N tracing', |
| | | Fixture_Model_No_T__c = 'n01', |
| | | ProductCode_Ext__c='pc01'); |
| | | insert productA; |
| | | |
| | | // 第一期合同 |
| | | Maintenance_Contract__c contract1 = new Maintenance_Contract__c(); |
| | | contract1.Name = 'tect contract1'; |
| | | contract1.Hospital__c = hospital.Id; |
| | | contract1.Department_Class__c = strategicDep[0].Id; |
| | | contract1.Department__c = dep.Id; |
| | | contract1.Service_Contract_Staff__c = MacOwner.Id; |
| | | contract1.Payment_Plan_Sum_First__c = 1; |
| | | contract1.Status__c = '契約'; |
| | | contract1.Maintenance_Contract_No__c = '11123'; |
| | | contract1.recordtypeId = |
| | | Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | contract1.Not_Upper_limit_reason__c = ' 1'; |
| | | contract1.Contract_Start_Date__c = Date.today().addDays( -10); |
| | | contract1.Contract_End_Date__c = Date.today().addDays( 5); |
| | | contract1.SalesOfficeCode_selection__c = '北京RC'; |
| | | insert contract1; |
| | | |
| | | // 第二期合同 |
| | | // Maintenance_Contract__c contract12 = new Maintenance_Contract__c(); |
| | | // contract12.Name = 'tect contract12'; |
| | | // contract12.Not_Upper_limit_reason__c = 'tect contract12'; |
| | | // contract12.RecordtypeId = Schema.SObjectType.Maintenance_Contract__c.getRecordTypeInfosByDeveloperName().get('NewMaintenance_Contract').getRecordTypeId(); |
| | | // contract12.Hospital__c = hospital.Id; |
| | | // contract1.Switch_TimeBase_WF__c = true; |
| | | // contract12.Department_Class__c = strategicDep[0].Id; |
| | | // contract12.Department__c = dep.Id; |
| | | // contract12.Service_Contract_Staff__c = UserInfo.getUserId(); |
| | | // contract12.Maintenance_Contract_No__c = 'tect contract12'; |
| | | // contract12.Status__c = '契約満了'; |
| | | // contract12.Contract_Start_Date__c = Date.today().addMonths(-13); |
| | | // contract12.Contract_End_Date__c = Date.today().addMonths(-1); |
| | | // insert contract12; |
| | | // insert new Maintenance_Contract__c[] {contract1}; |
| | | |
| | | System.debug('contract1 =='+ contract1 ); |
| | | List<Maintenance_Contract__c> listmc = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | // for (Maintenance_Contract__c mc:listmc) { |
| | | // mc1.id = mc.id; |
| | | // mc1.Status__c = '契約'; |
| | | // update mc1; |
| | | // System.debug('更新成功'+mc1); |
| | | |
| | | // } |
| | | // List<Maintenance_Contract__c> listmc1 = [select id ,Status__c,RecordType_Name__c from Maintenance_Contract__c ]; |
| | | System.debug('listmc'+listmc); |
| | | // System.debug('contract12.Status__c =='+ contract12.Status__c ); |
| | | Asset asset = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset.SerialNumber = 'ass01'; |
| | | asset.Name = 'ass01'; |
| | | asset.AccountId = dep.Id; |
| | | asset.Department_Class__c = strategicDep[0].Id; |
| | | asset.Hospital__c = hospital.Id; |
| | | asset.Product2Id = productA.Id; |
| | | asset.Quantity = 1; |
| | | asset.Status = '有库存'; |
| | | asset.Manage_type__c = '个体管理'; |
| | | asset.Loaner_accsessary__c = false; |
| | | asset.Out_of_wh__c = 0; |
| | | asset.Salesdepartment__c = '1.华北营业本部'; |
| | | asset.Internal_asset_location__c = '北京 备品中心'; |
| | | asset.Product_category__c = 'GI'; |
| | | asset.Equipment_Type__c = '产品试用'; |
| | | asset.SalesProvince__c = '北京'; |
| | | asset.CurrentContract__c = contract1.Id; |
| | | asset.CurrentContract_Asset_Price__c = 0; |
| | | insert asset; |
| | | Asset asset2 = new Asset(); |
| | | // Asset assetA1 = new Asset(Asset_Owner__c = 'Olympus'); |
| | | asset2.RecordTypeId = System.Label.Asset_RecordType; |
| | | asset2.SerialNumber = 'ass02'; |
| | | asset2.Name = 'ass02'; |
| | | asset2.AccountId = dep.Id; |
| | | asset2.Department_Class__c = strategicDep[0].Id; |
| | | asset2.Hospital__c = hospital.Id; |
| | | asset2.Product2Id = productA.Id; |
| | | asset2.Quantity = 1; |
| | | asset2.Status = '有库存'; |
| | | asset2.Manage_type__c = '个体管理'; |
| | | asset2.Loaner_accsessary__c = false; |
| | | asset2.Out_of_wh__c = 0; |
| | | asset2.Salesdepartment__c = '1.华北营业本部'; |
| | | asset2.Internal_asset_location__c = '北京 备品中心'; |
| | | asset2.Product_category__c = 'GI'; |
| | | asset2.Equipment_Type__c = '产品试用'; |
| | | asset2.SalesProvince__c = '北京'; |
| | | asset2.CurrentContract__c = contract1.Id; |
| | | asset2.CurrentContract_Asset_Price__c = 0; |
| | | insert asset2; |
| | | //System.Test.stopTest(); |
| | | |
| | | Maintenance_Contract_Asset__c contract1asset1 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset1.Asset__c = asset.Id; |
| | | contract1asset1.Maintenance_Contract__c = contract1.Id; |
| | | contract1asset1.Estimate_List_Price_All_Manual__c = 1000; |
| | | insert contract1asset1; |
| | | // contract1asset.Maintenance_Contract_Asset_Estimate__c = mcae1.id; |
| | | Maintenance_Contract_Asset__c contract1asset2 = new Maintenance_Contract_Asset__c(); |
| | | contract1asset2.Asset__c = asset2.Id; |
| | | contract1asset2.Maintenance_Contract__c = contract1.Id; |
| | | insert contract1asset2; |
| | | // insert new list<Maintenance_Contract_Asset__c> {contract1asset1,contract1asset2 }; |
| | | |
| | | |
| | | // repair01.Account__c = dep.Id; |
| | | |
| | | // // repair01.Repair_Start_Date__c = Date.newInstance(2022,7,20); |
| | | |
| | | // repair01.Department_Class__c = strategicDep[0].Id; |
| | | // repair01.Hospital__c = hospital.Id; |
| | | // repair01.Dealer__c = dep.Id; |
| | | // // repair01.Status1__c = '3.维修阶段'; |
| | | // repair01.Delivered_Product__c = asset.Id; |
| | | |
| | | // insert repair01; |
| | | Repair__c repair1 = new Repair__c(); |
| | | repair1.Service_Repair_No__c = 'repair1'; |
| | | repair1.Hospital__c = hospital.Id; |
| | | repair1.Account__c = dep.Id; |
| | | repair1.Department_Class__c = strategicDep[0].id; |
| | | repair1.Delivered_Product__c = asset.Id; |
| | | repair1.Repair_List_Price__c = 100; |
| | | repair1.Billing_Amount__c = 10; |
| | | repair1.Paid_Amount__c = 1; |
| | | repair1.DateReceiptQuestions__c = Date.newInstance(2022,7,20); |
| | | repair1.Failure_Occurrence_Date__c = Date.today().addDays(-1); |
| | | repair1.Repair_Returned_To_HP_Date__c = Date.today().addDays(3); |
| | | repair1.Repair_Shipped_Date__c = Date.today().addDays(1); |
| | | repair1.Maintenance_Contract__c = contract1.id; |
| | | System.debug('repair1.Maintenance_Contract__c =='+ repair1.Maintenance_Contract__c ); |
| | | System.debug('repair01.Status1__c =='+ repair1.Status1__c ); |
| | | system.debug('day=='+Date.today().addYears(-1)); |
| | | System.debug('repair01.DateReceiptQuestions__c =='+ repair1.DateReceiptQuestions__c ); |
| | | insert repair1; |
| | | |
| | | updateFirstServiceContractWebService.updateFirstContract(contract1.id); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>51.0</apiVersion> |
| | | <status>Active</status> |
| | | </ApexClass> |
| New file |
| | |
| | | <apex:component controller="BatchFileUploadController"> |
| | | <apex:attribute name="parentId" description="The ID of the record uploaded documents will be attached to." type="String" required="true"/> |
| | | |
| | | <link rel="stylesheet" type="text/css" href="{!$Resource.FileUploadCSS}"/> |
| | | <!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"/> --> |
| | | <script type="text/javascript" src="{!$Resource.FileUploadJS}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | |
| | | <script type="text/javascript"> |
| | | var staticResource = JSON.parse('{!staticResource}'); |
| | | var newUrl = '{!newUrl}'; |
| | | var parentId = '{!parentId}'; |
| | | // console.log('newUrl = ' + JSON.stringify(newUrl)); |
| | | // console.log('staticResource = ' + JSON.stringify(staticResource)); |
| | | // var parentId = '{!parentId}'; //Will be used by FileUploadJS.js but must be declared here. Static resources don't support dynamic values. |
| | | // var files = []; |
| | | // let Base64 = []; |
| | | // window.onload = function(){ |
| | | // let xw_File = document.getElementById("filesInput"); |
| | | // xw_File.addEventListener('change', ()=> { |
| | | // xw_show(xw_File.files) |
| | | // return; |
| | | // }) |
| | | |
| | | // upload = function (){ |
| | | // for(let i = 0, len = xw_File.files.length; i < len; i++){ |
| | | // files[i].file = Base64[i]; |
| | | // } |
| | | // console.log('files = ' + JSON.stringify(files)); |
| | | |
| | | // AWSService.post(newUrl, JSON.stringify(files), function(result){ |
| | | // console.log('result = ' + JSON.stringify(result)); |
| | | // }, staticResource.token); |
| | | // } |
| | | |
| | | // function xw_show(xw_filedata){ |
| | | // files = []; |
| | | // for( var i = 0 ; i < xw_filedata.length ; i++ ){ |
| | | // var imgReaderl = new FileReader(); |
| | | // var fileObject = {}; |
| | | // imgReaderl.readAsDataURL(xw_filedata[i]); |
| | | // imgReaderl.onload = function(evt) { |
| | | // //fileObject.file = evt.target.result; |
| | | // console.log(typeof evt.target.result); |
| | | // Base64.push(evt.target.result); |
| | | // } |
| | | // fileObject.file = ''; |
| | | // fileObject.fileName = xw_File.files[i].name; |
| | | // fileObject.size = xw_File.files[i].size; |
| | | // files.push(fileObject); |
| | | // } |
| | | // console.log('files = ' + JSON.stringify(files)); |
| | | // } |
| | | // } |
| | | </script> |
| | | |
| | | <div class="uploadBox"> |
| | | <table cellpadding="0" cellspacing="0" class="uploadTable"> |
| | | <tr> |
| | | <td><input type="file" multiple="true" id="filesInput" name="file" /></td> |
| | | <td class="buttonTD"> |
| | | <input id="uploadButton" type="button" title="Upload" class="btn" value="Upload "/> |
| | | <!-- <input id="clear" type="button" title="Clear" class="btn" value=" Clear "/> --> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | </apex:component> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <ApexComponent xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>24.0</apiVersion> |
| | | <description>Multiple file upload component.</description> |
| | | <label>fileUpload</label> |
| | | </ApexComponent> |
| | |
| | | |
| | | var value = event.target.value; |
| | | this.opp.Date_InAdvance_Delay = value; |
| | | |
| | | this.opp.Predicted_date_ChangeReason__c = ''; |
| | | |
| | | debugger |
| | | // this.opp.Predicted_date_ChangeReason__c = ''; |
| | | //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start |
| | | this.opp.Predicted_date_ChangeReason = '' |
| | | this.opp.Close_Forecasted_Date= ''; |
| | | this.opp.CloseDate= ''; |
| | | //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end |
| | | if (value == "提前") { |
| | | this.isAdvance = true; |
| | | this.isDelay = false; |
| | |
| | | console.warn('当前预测日期'+myDate4); |
| | | console.warn('1111111111'+myDate2); |
| | | console.warn('改变的预测日期'+myDate5); |
| | | |
| | | if(this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == undefined || myDate5 == undefined){ |
| | | //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy start |
| | | // if(this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == undefined || myDate5 == undefined){ |
| | | // if(this.opp.Date_InAdvance_Delay == '' ||this.opp.Date_InAdvance_Delay == undefined || this.opp.Predicted_date_ChangeReason == '' ||this.opp.Predicted_date_ChangeReason == undefined|| myDate5 == '' || myDate5 == undefined){ |
| | | if(!this.opp.Date_InAdvance_Delay || !this.opp.Predicted_date_ChangeReason || !this.opp.Close_Forecasted_Date){ |
| | | //SWAG-CJR4PC【委托】调查-修改预测日提前理由错误 fy end |
| | | this.Alert("请选择日期/理由。",false,true); |
| | | } |
| | | else if(this.opp.Date_InAdvance_Delay == '提前' && (myDate5 >= myDate4 || myDate5 < myDate3)){ |
| | |
| | | if (!this.isClick) { |
| | | this.InputValue = ''; |
| | | } |
| | | },300) |
| | | },3000) |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | setTimeout(()=>{ |
| | | this.OnLoading(false); |
| | | },1000); |
| | | },3000); |
| | | } |
| | | |
| | | |
| | |
| | | value={TempData.Other_Reasons__c} onchange={Other_Reasons__cFn} data-parent-id="model2" > |
| | | </lightning-input> |
| | | </div> |
| | | |
| | | <div if:true={Price_Code}> |
| | | <lightning-input type="text" label="手动关联报价编码" placeholder="请输入报价名称" |
| | | value={Maintenance_ContractName} onchange={Maintenance_Contract__c1Fn} data-parent-id="model9" > |
| | | </lightning-input> <button class="slds-button slds-button_brand" onclick={Maintenance_Contract__cFn} data-parent-id="mode21">查询</button> |
| | | <c-jzlookupv3 data-parent-id="lookup1" label="关联报价编码" placeholder="请输入报价名称或者合同号.." onsearchchange={onsearchchange} searchdata={searchdata} option={option} onselected={selectedFn}> </c-jzlookupv3> |
| | | </div> |
| | | <div if:true={Price_Code}> |
| | | <!-- <lightning-combobox |
| | | label="报价编码" |
| | | value={TempData.MC_Code__c} |
| | | placeholder="请选择报价" |
| | | options={BAOJIAList} |
| | | onchange={MC_Code__cFn} |
| | | data-parent-id="model10" |
| | | ></lightning-combobox> --> |
| | | <select class="slds-select" onchange={MC_Code__cFn}> |
| | | <template for:each={BAOJIAList} for:item="BJItem"> |
| | | <option value={BJItem.Id} key={BJItem.Id}>{BJItem.Name}</option> |
| | | </template> |
| | | </select> |
| | | </div> |
| | | <div> |
| | | |
| | | <div if:true={GoWhere}> |
| | | <lightning-combobox |
| | | label="去向" |
| | | value={TempData.To_Where__c} |
| | |
| | | options={QXList} |
| | | onchange={To_Where__cFn} |
| | | data-parent-id="model3" |
| | | |
| | | ></lightning-combobox> |
| | | </div> |
| | | |
| | |
| | | <div style="height:100px;width:200px"></div> |
| | | </div> |
| | | <footer class="slds-modal__footer"> |
| | | <button class="slds-button slds-button_brand" onclick={SaveClickFn} data-parent-id="model7">保存</button> |
| | | <!-- <button class="slds-button slds-button_brand" onclick={SaveClickFn} data-parent-id="model7">保存</button> --> |
| | | <button class="slds-button slds-button_brand" onclick={SubmitClickFn} data-parent-id="model8" >提交审核</button> |
| | | <button class="slds-button slds-button_neutral" onclick={ModelCancelFn}>取消</button> |
| | | |
| | |
| | | GetJTYY().then(response=>{var data = JSON.parse(response);this.JTYYList = data;}) |
| | | console.log(this.JTYYList); |
| | | GetQX().then(response=>{var data = JSON.parse(response);this.QXList = data;}) |
| | | |
| | | } |
| | | |
| | | ///金额格式化 |
| | |
| | | }) |
| | | } |
| | | |
| | | getThree(){ |
| | | GetQX1().then(response=>{ |
| | | var data = JSON.parse(response); |
| | | this.QXList = data[0].To_Where__c; |
| | | }) |
| | | } |
| | | getShiDan() |
| | | { |
| | | this.TempData =={ |
| | |
| | | } |
| | | Other_Reasons__cShow = false; |
| | | Third_Party_Company__cShow = false; |
| | | GoWhere = true; |
| | | Third_Party_Contract_Price__cShow = false; |
| | | Other__cShow = false; |
| | | Price_Code = false; |
| | | Price_Code2 = false; |
| | | |
| | | |
| | | ModelShow = false; |
| | |
| | | } |
| | | if (values == '重复报价') { |
| | | this.Price_Code = true; |
| | | }else |
| | | { |
| | | this.GoWhere= false; |
| | | }else{ |
| | | this.Price_Code = false; |
| | | } |
| | | this.GoWhere= true; |
| | | } |
| | | if (values == '转第三方或维修托管') { |
| | | this.TempData.QXList = '医院选择第三方'; |
| | | this.TempData.To_Where__c = '医院选择第三方'; |
| | | this.Third_Party_Company__cShow= true; |
| | | this.Third_Party_Contract_Price__cShow= true; |
| | | this.template.querySelector('[data-parent-id="model3"]').disabled = true; |
| | | this.template.querySelector('[data-parent-id="model3"]').refreshdata([],this.QXList ); |
| | | |
| | | }else{ |
| | | this.Third_Party_Company__cShow= false; |
| | | this.Third_Party_Contract_Price__cShow= false; |
| | | this.template.querySelector('[data-parent-id="model3"]').disabled = false; |
| | | } |
| | | this.TempData.Specific_Reasons__c = values; |
| | | } |
| | | |
| | |
| | | |
| | | this.Maintenance_ContractName = values; |
| | | } |
| | | Maintenance_Contract__cFn(event) |
| | | { |
| | | SearchMaintenance_ContractData({name:this.Maintenance_ContractName}).then(response=>{ |
| | | debugger; |
| | | this.BAOJIAList = JSON.parse(response); |
| | | |
| | | // onsearchchange1(event){ |
| | | // var values = event.detail.value; |
| | | |
| | | // this.Maintenance_ContractName = values; |
| | | // this.TempData.MC_Code__c = this.Maintenance_ContractName ; |
| | | |
| | | // this.Maintenance_Contract__cFn(); |
| | | |
| | | // } |
| | | // tempArr = []; |
| | | |
| | | option = [{lableOne:"Name",lableTwo:"RecordType_Name__c"}] |
| | | searchdata=[]; |
| | | onsearchchange(event){ |
| | | var searchContentStr = event.detail.searchContent; |
| | | SearchMaintenance_ContractData({name:searchContentStr}).then(response=>{ |
| | | var datas = JSON.parse(response); |
| | | this.searchdata = datas; |
| | | console.log(this.searchdata+'!'); |
| | | this.template.querySelector('[data-parent-id="lookup1"]').refreshdata(this.searchdata); |
| | | }) |
| | | if (searchContentStr == undefined || searchContentStr == '') { |
| | | this.YYSelectedId = ''; |
| | | } |
| | | } |
| | | MC_Code__cFn(event) |
| | | YYSelectedId = ''; |
| | | selectedFn(event) |
| | | { |
| | | var values = event.target.value; |
| | | console.log(values); |
| | | this.TempData.MC_Code__c = values; |
| | | console.warn(event.detail.selectdata.Id); |
| | | this.YYSelectedId = event.detail.selectdata.Id; |
| | | this.Maintenance_ContractName = this.YYSelectedId ; |
| | | this.TempData.MC_Code__c = this.Maintenance_ContractName ; |
| | | } |
| | | |
| | | // Maintenance_Contract__cFn(event) |
| | | // { |
| | | // SearchMaintenance_ContractData({name:this.Maintenance_ContractName}).then(response=>{ |
| | | // debugger; |
| | | // this.BAOJIAList = JSON.parse(response); |
| | | // this.BAOJIAList.forEach(item=>{ |
| | | // this.tempArr.push(item.name); |
| | | // }) |
| | | // }) |
| | | // } |
| | | // MC_Code__cFn(event) |
| | | // { |
| | | // var values = event.target.value; |
| | | // console.log(values); |
| | | // this.TempData.MC_Code__c = values; |
| | | // } |
| | | To_Where__cFn(event) |
| | | { |
| | | var values = event.target.value; |
| force-app/main/default/lwc/relevant/relevant.html
force-app/main/default/lwc/relevant/relevant.js
force-app/main/default/lwc/tBidding/tBidding.html
force-app/main/default/lwc/tBidding/tBidding.js
force-app/main/default/lwc/tEnquiry/tEnquiry.html
force-app/main/default/lwc/tenderLost/tenderLost.html
force-app/main/default/lwc/tenderLost/tenderLost.js
force-app/main/default/lwc/tenderLost/tenderLost.js-meta.xml
force-app/main/default/objects/ASEActivity__c/listViews/AcceptWindow_BJ_ASEActivity.listView-meta.xml
force-app/main/default/objects/ASEActivity__c/listViews/AcceptWindow_GZ_ASEActivity.listView-meta.xml
force-app/main/default/objects/ASEActivity__c/listViews/CheckWindow_BJ_ASEActivity.listView-meta.xml
force-app/main/default/objects/ASEActivity__c/listViews/CheckWindow_GZ_ASEActivity.listView-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/Account_Delay_Apply__c.object-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Abbreviation__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Abbreviation_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Address_Together__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Address__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Address_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Alias_Name2__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Alias_Name2_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Approved_Confirm_Date__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/AssociatedHospital__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Attribute_Type__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Attribute_Type_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/ChangeReason__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/City_Master__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/City_Master_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Feature__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Feature_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Field3_companyname__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Field3_companyname_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Grade__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Grade_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/HospitalName__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/HospitalName_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/HospitalType__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Hospital__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/InstitutionalType__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Is_Active__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Is_Medical_F__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Is_Medical_F_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Is_upload_file__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/OCM_man_province_HP__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/OCM_man_province_HP_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/OpenWindow__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Postal_Code__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Postal_Code_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/RejectionReason__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Salesdepartment_HP__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Salesdepartment_HP_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Site__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Site_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Speciality_Type__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Speciality_Type_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/State_Master__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/State_Master_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Street__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Street_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/SubmitApprovalDate__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Town__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Town_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Website__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/Website_old__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/fields/WhetherRiskPassing__c.field-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/validationRules/CheckChangeReason.validationRule-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/webLinks/AccountDelayApply.webLink-meta.xml
force-app/main/default/objects/Account_Delay_Apply__c/webLinks/SubmitAndRefresh.webLink-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/Annual_repair_amount__c.field-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/IF_Last_Three_Years_Contract__c.field-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/IF_Last_Two_Years_Contract__c.field-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/IF_Last_Years_Contract__c.field-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/Last_Three_Years_Contract_Count_del__c.field-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/Last_Three_Years_IF_Have_Contract__c.field-meta.xml
force-app/main/default/objects/Account_Service_Of_Target__c/fields/Total_Pricing__c.field-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/fields/Fund_Basis__c.field-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/fields/Product_Category1_P__c.field-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/fields/Product_Category2_P__c.field-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/fields/Product_Category3_P__c.field-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/listViews/View_oppwithoutconform.listView-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/recordTypes/Opportunity.recordType-meta.xml
force-app/main/default/objects/Agency_Opportunity__c/recordTypes/Target.recordType-meta.xml
force-app/main/default/objects/Agency_Report__c/fields/Purpose_Type__c.field-meta.xml
force-app/main/default/objects/Agency_Report__c/recordTypes/WeeklyReport.recordType-meta.xml
force-app/main/default/objects/BatchIF_Log__c/listViews/NFM001.listView-meta.xml
force-app/main/default/objects/BatchIF_Log__c/listViews/NFM007_20221001.listView-meta.xml
force-app/main/default/objects/BatchIF_Log__c/listViews/NFM104.listView-meta.xml
force-app/main/default/objects/BatchIF_Log__c/listViews/NFM201.listView-meta.xml
force-app/main/default/objects/Consum_Apply__c/fields/requestNoJoinStr1__c.field-meta.xml
force-app/main/default/objects/Consum_Apply__c/webLinks/test.webLink-meta.xml
force-app/main/default/objects/Daily_Report__c/listViews/EditingStatusReport.listView-meta.xml
force-app/main/default/objects/Event__c/fields/Activity_PurposeFSE__c.field-meta.xml
force-app/main/default/objects/Event__c/fields/Purpose_TypeFSE2__c.field-meta.xml
force-app/main/default/objects/Event__c/fields/Purpose_TypeFSE3__c.field-meta.xml
force-app/main/default/objects/Event__c/fields/Purpose_TypeFSE4__c.field-meta.xml
force-app/main/default/objects/Event__c/fields/Purpose_TypeFSE5__c.field-meta.xml
force-app/main/default/objects/Event__c/fields/Purpose_TypeFSE__c.field-meta.xml
force-app/main/default/objects/FileAddress__c/FileAddress__c.object-meta.xml
force-app/main/default/objects/FileAddress__c/fields/OnlyFileName__c.field-meta.xml
force-app/main/default/objects/FileAddress__c/webLinks/BatchDelete.webLink-meta.xml
force-app/main/default/objects/FrameNumManage__c/FrameNumManage__c.object-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/ApplyList_Select__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/ApplyList__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/ApplyName__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Asset__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Assort__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Certificate__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/CheckOutNo__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/EndDate__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/FrameNo__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Handleer__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/InspectionCard_Select__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/InspectionCard__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/LT__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/ManagementCode__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/MaterialDepict__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Material__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Num__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/ScanDate__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/SerialNumberS__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/SerialNumber__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/StartDate__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/Statu_Achievements_DN_details__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/UploadDate__c.field-meta.xml
force-app/main/default/objects/FrameNumManage__c/fields/signInForm__c.field-meta.xml
force-app/main/default/objects/ImportDocT__c/ImportDocT__c.object-meta.xml
force-app/main/default/objects/ImportDocT__c/fields/Num__c.field-meta.xml
force-app/main/default/objects/ImportDocT__c/fields/code__c.field-meta.xml
force-app/main/default/objects/LastbuyProduct__c/fields/RemainingNumber__c.field-meta.xml
force-app/main/default/objects/LastbuyProduct__c/fields/WIN_manual_number__c.field-meta.xml
force-app/main/default/objects/LastbuyProduct__c/fields/productInquiryOnly__c.field-meta.xml
force-app/main/default/objects/LastbuyProduct__c/listViews/All.listView-meta.xml
force-app/main/default/objects/Lost_Report__c/fields/Other__c.field-meta.xml
force-app/main/default/objects/Lost_Report__c/fields/Status__c.field-meta.xml
force-app/main/default/objects/MB_Opportunity__c/fields/Opportunity_possibility__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Asset_Estimate__c/fields/IS_Reduced_price_approval__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Asset_Estimate__c/fields/Repair_Price_Auto__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Asset_Estimate__c/fields/Repair_Price__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Asset_Estimate__c/fields/Third_Party_Return__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Asset__c/fields/AssetWhereabouts__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/Maintenance_Contract_Estimate__c.object-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/IS_Reduced_price_approval__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/RepairCount_P__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/RepairCount_V__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/Surcharge_Defective_Contract__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/Third_Party_Return_Contract__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract1__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract1_endDate__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract1_startDate__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract2__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract3__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract4__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URFMContract5__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract1_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract1_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract2_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract2_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract3_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract3_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract4_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract4_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract5_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/fields/URF_LastMContract5_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/recordTypes/Maintenance_Quote.recordType-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/recordTypes/NewMaintenance_Quote.recordType-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/webLinks/CustomAnew.webLink-meta.xml
force-app/main/default/objects/Maintenance_Contract_Estimate__c/webLinks/CustomNewMC.webLink-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/LastMContract1_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/LastMContract2_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/LastMContract3_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/LastMContract4_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/LastMContract5_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/RepairCount_P__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/RepairCount_V__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/Surcharge_Defective_Contract__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/Third_Party_Return_Contract__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_Contract_F__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract1_Code__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract1_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract1_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract1__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract1_endDate__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract1_startDate__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract2_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract2_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract2__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract3_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract3_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract3__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract4_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract4_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract4__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract5_ConCount__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract5_NO__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_LastMContract5__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_P_RepairTime__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/fields/URF_V_RepairTime__c.field-meta.xml
force-app/main/default/objects/Maintenance_Contract__c/webLinks/upload_to_sap.webLink-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/fieldSets/ImportantProduct.fieldSet-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/fieldSets/ImportantProduct_Old.fieldSet-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/fields/Can_Repair_Old__c.field-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/fields/Can_Repair__c.field-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/fields/suitDepartment_Old__c.field-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/fields/suitDepartment__c.field-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/recordTypes/EquipmentInfo.recordType-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/recordTypes/GuranteeMain.recordType-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/recordTypes/GuranteePrice.recordType-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/recordTypes/ImportantProduct.recordType-meta.xml
force-app/main/default/objects/Maintenance_Product_Data_Details__c/recordTypes/RepairInfo.recordType-meta.xml
force-app/main/default/objects/OPDPlan__c/listViews/On_prosess0930.listView-meta.xml
force-app/main/default/objects/OpportunityFileOrder__c/validationRules/SpecificInquiryFileType.validationRule-meta.xml
force-app/main/default/objects/OpportunityFileOrder__c/validationRules/SpecificInquiryFileType01.validationRule-meta.xml
force-app/main/default/objects/PCLLostBrand__c/fields/Lost_By_Company_Text__c.field-meta.xml
force-app/main/default/objects/Product2__c/Product2__c.object-meta.xml
force-app/main/default/objects/Product2__c/recordTypes/CompetitiveProductsConsumables.recordType-meta.xml
force-app/main/default/objects/Product2__c/recordTypes/CompetitiveProductsHost.recordType-meta.xml
force-app/main/default/objects/Product2__c/recordTypes/OlympusProducts.recordType-meta.xml
force-app/main/default/objects/Product2__c/recordTypes/Sample.recordType-meta.xml
force-app/main/default/objects/PromotionHead__c/listViews/ViewCu.listView-meta.xml
force-app/main/default/objects/QIS_Report__c/fields/AwareDateShow__c.field-meta.xml
force-app/main/default/objects/QIS_Report__c/fields/AwareDate__c.field-meta.xml
force-app/main/default/objects/QIS_Report__c/fields/MBC_AwareDate__c.field-meta.xml
force-app/main/default/objects/QIS_Report__c/fields/Trable_occur_daY_collect__c.field-meta.xml
force-app/main/default/objects/QIS_Report__c/fields/usage_frequence__c.field-meta.xml
force-app/main/default/objects/QIS_Report__c/webLinks/SendQISToEtQ.webLink-meta.xml
force-app/main/default/objects/QuoteIrai__c/fields/EditLink__c.field-meta.xml
force-app/main/default/objects/QuoteIrai__c/fields/QuoteIrai_Status__c.field-meta.xml
force-app/main/default/objects/QuoteIrai__c/fields/cancelMultiyearInsurance__c.field-meta.xml
force-app/main/default/objects/Rental_Apply_Equipment_Set_Detail__c/fields/Is_Body__c.field-meta.xml
force-app/main/default/objects/Rental_Apply_Equipment_Set_Detail__c/fields/Loaner_accsessary__c.field-meta.xml
force-app/main/default/objects/Rental_Apply_Equipment_Set__c/fields/Extend_Date_F__c.field-meta.xml
force-app/main/default/objects/Rental_Apply_Equipment_Set__c/validationRules/RentalStartDateVerfy.validationRule-meta.xml
force-app/main/default/objects/Rental_Apply_Equipment_Set__c/webLinks/Loaner_arranged_e_mail.webLink-meta.xml
force-app/main/default/objects/Rental_Apply__c/fields/OPDBuchangApprover__c.field-meta.xml
force-app/main/default/objects/Rental_Apply__c/fields/OPDBuchang__c.field-meta.xml
force-app/main/default/objects/Rental_Apply__c/fields/OPDManagerApprover__c.field-meta.xml
force-app/main/default/objects/Rental_Apply__c/fields/OPDManager__c.field-meta.xml
force-app/main/default/objects/Rental_Apply__c/fields/requestNoJoinStr1__c.field-meta.xml
force-app/main/default/objects/Rental_Apply__c/fields/test1011__c.field-meta.xml
force-app/main/default/objects/Rental_Apply__c/validationRules/After_Approval_Can_Not_Change_Status.validationRule-meta.xml
force-app/main/default/objects/Rental_Apply__c/validationRules/After_Request_approve_PIPL.validationRule-meta.xml
force-app/main/default/objects/Rental_Apply__c/validationRules/Purpose2_RepairUser_Have_Contract.validationRule-meta.xml
force-app/main/default/objects/Rental_Apply__c/validationRules/Purpose2_RepairUser_Have_Flag.validationRule-meta.xml
force-app/main/default/objects/Rental_Apply__c/webLinks/Loaner_arranged_e_mail.webLink-meta.xml
force-app/main/default/objects/Rental_Apply__c/webLinks/submit_approval_process.webLink-meta.xml
force-app/main/default/objects/RepairAgainAn_M_BC__c/RepairAgainAn_M_BC__c.object-meta.xml
force-app/main/default/objects/RepairAgainAn_M_BC__c/fields/M_BC__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn_M_BC__c/fields/RepairAgainAn_M_BC_answer_detail__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/RepairAgainAn__c.object-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/ActionOCM__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/ActionOSH2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/AnalysisOCM__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/AnalysisOSH2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/AnalysisReasonOSH2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Complaint_confirm2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Complaint_confirm__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Complaint_otherFault2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Complaint_otherFault__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Countermeasures2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Countermeasures__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Customer_Describe__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Dectect_Picture3_URL__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Dectect_Picture3__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Dectect_Picture4_URL__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Dectect_Picture4__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/Delivered_Product__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/First_Approve_Status__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/InspectionFailureCause_Last__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/JudgementOSH2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/LastDateCnt__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OCM_Confirmation_Date__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OCM_Confirmer__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OCSM_Approve_Status__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Accept_Day2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Auditor2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Auditor__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Confirmation_Date2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Confirmer2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture4__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture5_URL__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture5__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture6_URL__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture6__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture7_URL__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture7__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture8_URL__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Dectect_Picture8__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/OSH_Detector2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RC_Describe__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_Confirm2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_Confirm__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_Ratify__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_applyDate2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_applyDate__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_status2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/RepairAgainAn_Approve_status__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/SORC__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/SerialNumber1__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/is_RC_confirm__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/issue_QIS_M_BC2__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/issue_QIS_M_BC__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/fields/repairLast__c.field-meta.xml
force-app/main/default/objects/RepairAgainAn__c/recordTypes/RecordType.recordType-meta.xml
force-app/main/default/objects/RepairAgainAn__c/recordTypes/RepairAgainRecordType1.recordType-meta.xml
force-app/main/default/objects/RepairAgainAn__c/recordTypes/RepairAgainRecordType2.recordType-meta.xml
force-app/main/default/objects/RepairAgainAn__c/recordTypes/RepairAgainRecordType3.recordType-meta.xml
force-app/main/default/objects/RepairAgainAn__c/recordTypes/RepairAgainRecordType4.recordType-meta.xml
force-app/main/default/objects/RepairAgainAn__c/webLinks/OCSMFollowEnd.webLink-meta.xml
force-app/main/default/objects/RepairAgainAn__c/webLinks/OSHAccept.webLink-meta.xml
force-app/main/default/objects/RepairAgainAn__c/webLinks/OSHFollowEnd.webLink-meta.xml
force-app/main/default/objects/RepairAgainAn__c/webLinks/RC_confirm.webLink-meta.xml
force-app/main/default/objects/RepairAgainAn__c/webLinks/new_M_BC.webLink-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Asset_day__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/CreatedByLocation_sys__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/CreatedByProfileName_sys__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Equipment_Type__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Failure_Source__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Fixture_Model_No_F__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Internal_Asset_number_key__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Internal_asset_location__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Loaner_Discount_Price__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Loaner_repair_sys__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/RentalApplyDiscountApplyPersonEmail_sys__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/RentalApplyDiscountApplyPerson__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Rental_Apply_Discount_Reason__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Rental_Apply_SeniorDirector_Date__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Repair_count__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/fields/Spares_Background_Description__c.field-meta.xml
force-app/main/default/objects/Repair_Quotation__c/webLinks/RentalApplyDiscountApproval.webLink-meta.xml
force-app/main/default/objects/Repair__c/fields/AwareDateShow__c.field-meta.xml
force-app/main/default/objects/Repair__c/fields/AwareDate__c.field-meta.xml
force-app/main/default/objects/Repair__c/fields/DateReceiptQuestions__c.field-meta.xml
force-app/main/default/objects/Repair__c/fields/MBC_AwareDate__c.field-meta.xml
force-app/main/default/objects/Repair__c/fields/Recall_Correspondence__c.field-meta.xml
force-app/main/default/objects/Repair__c/fields/RepairAgainAn_Status__c.field-meta.xml
force-app/main/default/objects/Repair__c/listViews/Recentry_Updated.listView-meta.xml
force-app/main/default/objects/Repair__c/validationRules/Aset_AMM_Repair_chk.validationRule-meta.xml
force-app/main/default/objects/Repair__c/validationRules/Repair_Product_Direct_SORC.validationRule-meta.xml
force-app/main/default/objects/Repair__c/webLinks/Create_Repair_From_Asset.webLink-meta.xml
force-app/main/default/objects/Repair__c/webLinks/Create_Repair_From_OnCall.webLink-meta.xml
force-app/main/default/objects/Repair__c/webLinks/Create_Repair_From_QIS.webLink-meta.xml
force-app/main/default/objects/Repair__c/webLinks/Repair_Return_Analysis.webLink-meta.xml
force-app/main/default/objects/Repair__c/webLinks/Send_NFM103.webLink-meta.xml
force-app/main/default/objects/ReportMemo__c/fields/Account_Delay_Apply__c.field-meta.xml
force-app/main/default/objects/SS_Prospect_5days_list__c/fields/ImportDemonstration_Approval_date__c.field-meta.xml
force-app/main/default/objects/SS_Prospect_5days_list__c/fields/ImportDemonstration_Filing_date__c.field-meta.xml
force-app/main/default/objects/SS_Prospect_5days_list__c/fields/ImportDemonstration_Rejection_date__c.field-meta.xml
force-app/main/default/objects/Tender_Opportunity_Link__c/fields/IsLeakage__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/CentralizedProject__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/OlyNumberHosts__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/RivalHostsNumber__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/Salesdepartment_SAP__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/TotalNumberHosts__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/ViewRelatedOpp__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/proInvolvedManual__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/proInvolved__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/fields/publicDate__c.field-meta.xml
force-app/main/default/objects/Tender_information__c/listViews/All_04.listView-meta.xml
force-app/main/default/objects/Tender_information__c/recordTypes/Mannual.recordType-meta.xml
force-app/main/default/objects/Tender_information__c/recordTypes/QLM.recordType-meta.xml
force-app/main/default/objects/Tender_information__c/webLinks/NewHospital.webLink-meta.xml
force-app/main/default/objects/Tender_information__c/webLinks/NewIntention.webLink-meta.xml
force-app/main/default/objects/Tender_information__c/webLinks/RelateOpp.webLink-meta.xml
force-app/main/default/objects/Tender_information__c/webLinks/Tender_Lost.webLink-meta.xml
force-app/main/default/objects/task__c/listViews/AllConfirmationofAwardTask_Tender.listView-meta.xml
force-app/main/default/objects/task__c/listViews/AllLostTask_Tender.listView-meta.xml
force-app/main/default/objects/task__c/listViews/CheckWindow_SH_task.listView-meta.xml
force-app/main/default/objects/task__c/listViews/MyConfirmationofAwardTask_Tender.listView-meta.xml
force-app/main/default/objects/task__c/listViews/MyLostTask_Tender.listView-meta.xml
force-app/main/default/pages/BatchFileUpload.page
force-app/main/default/pages/BatchFileUpload.page-meta.xml
force-app/main/default/pages/CampaignMember.page
force-app/main/default/pages/CampaignMember.page-meta.xml
force-app/main/default/pages/ChoiceAsset.page
force-app/main/default/pages/CustomAccountTest.page
force-app/main/default/pages/CustomAccountTest.page-meta.xml
force-app/main/default/pages/FrameNum.page
force-app/main/default/pages/FrameNum.page-meta.xml
force-app/main/default/pages/FrameNumUpload.page
force-app/main/default/pages/FrameNumUpload.page-meta.xml
force-app/main/default/pages/ImportDocT.page
force-app/main/default/pages/ImportDocT.page-meta.xml
force-app/main/default/pages/LostByCompany.page
force-app/main/default/pages/LostByCompany.page-meta.xml
force-app/main/default/pages/MaintenanceCommissionPDF.page
force-app/main/default/pages/MaintenanceContractEstimateVMPDF.page
force-app/main/default/pages/MaintenanceProductData.page
force-app/main/default/pages/NewAccount.page
force-app/main/default/pages/NewAccount.page-meta.xml
force-app/main/default/pages/NewAccountExamine.page
force-app/main/default/pages/NewAccountExamine.page-meta.xml
force-app/main/default/pages/NewAndEditLead.page
force-app/main/default/pages/NewMCAgentPDF.page
force-app/main/default/pages/NewMCAgentPDFLimit.page
force-app/main/default/pages/NewMCHPDF.page
force-app/main/default/pages/NewMCHPDFLimit.page
force-app/main/default/pages/NewQuoteEntry.page
force-app/main/default/pages/NewQuoteIrai.page
force-app/main/default/pages/NewRepair.page
force-app/main/default/pages/OpportunityPCLNew.page
force-app/main/default/pages/ProcessInstance.page
force-app/main/default/pages/QuoteTrial.page
force-app/main/default/pages/RepairAgainAnPDF.page
force-app/main/default/pages/SI_NewQuoteEntry.page
force-app/main/default/pages/SearchProduct.page
force-app/main/default/pages/SearchProductIrai.page
force-app/main/default/pages/SelectAssetEstimateURF.page
force-app/main/default/pages/SelectAssetEstimateVM.page
force-app/main/default/pages/SelectAssetEstimateVMgzw.page
force-app/main/default/pages/SelectAssetEstimateVMgzw.page-meta.xml
force-app/main/default/pages/SolApproval.page
force-app/main/default/pages/SubmitForApprovalPage.page
force-app/main/default/pages/TenderLostPage.page
force-app/main/default/pages/TenderLostPage.page-meta.xml
force-app/main/default/pages/UpdAccount.page
force-app/main/default/pages/UpdAccount.page-meta.xml
force-app/main/default/pages/UpdAccountExamine.page
force-app/main/default/pages/UpdAccountExamine.page-meta.xml
force-app/main/default/pages/XinDailyReport.page
force-app/main/default/pages/taskAlert.page
force-app/main/default/staticresources/FileUploadCSS.css
force-app/main/default/staticresources/FileUploadCSS.resource-meta.xml
force-app/main/default/staticresources/FileUploadJS.js
force-app/main/default/staticresources/FileUploadJS.resource-meta.xml
force-app/main/default/staticresources/NewQuoteIraiJS.js
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/assets/css/fonts-and-custom.css
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/assets/styles/dxp-slds-extensions.min.css
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/assets/styles/dxp-styling-hooks.min.css
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/assets/styles/salesforce-lightning-design-system.min.css
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/maintenance.html
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/toomanyrequests.html
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/007bab7497/prod/lwr_lwc
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/2fb3ad10e3/prod/lwr_app
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/4cc02276a1/prod/oasis
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/5ea995b1e6/prod/lwr_bootstrap_locker
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/6e8adca5bc/prod/lwr_loader
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/cfd6c62730/prod/localeredirect
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/dddc7d0986/prod/lwr_mobile
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/framework/fe9313b5a8/prod/lwr_bootstrap
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/template_html/166206b3ed/prod/index
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/view/33e8275c19/prod/zh_CN/too_Many_Requests
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/view/3ed9b09e16/prod/zh_CN/serviceNotAvailable
force-app/main/default/staticresources/SNA_Partner_Sales1_sf_default_cdn_PY4Q0/webruntime/view/b095276dd7/prod/zh_CN/service_Not_Available
force-app/main/default/triggers/AccountDelayApplyTrigger.trigger
force-app/main/default/triggers/AccountDelayApplyTrigger.trigger-meta.xml
force-app/main/default/triggers/AccountTrigger.trigger
force-app/main/default/triggers/AttachmentTrigger.trigger
force-app/main/default/triggers/ChangedDepartmentOwner.trigger
force-app/main/default/triggers/LastbuyProductTrigger.trigger
force-app/main/default/triggers/MCAETrigger.trigger-meta.xml
force-app/main/default/triggers/NFM001.trigger
force-app/main/default/triggers/NFM007.trigger
force-app/main/default/triggers/Opponent_Bid_InformationTrigger.trigger
force-app/main/default/triggers/OpportunityBefUpd.trigger
force-app/main/default/triggers/OpportunityHpDeptUpd.trigger
force-app/main/default/triggers/Repair.trigger
force-app/main/default/triggers/RepairAgainAnMBCTrigger.trigger
force-app/main/default/triggers/RepairAgainAnMBCTrigger.trigger-meta.xml
force-app/main/default/triggers/RepairAgainAnTrigger.trigger
force-app/main/default/triggers/RepairQuoteTrigger.trigger |