| | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | { |
| | | "target-org": "OlympusStageEnv" |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" afterScriptsLoaded="{!c.scriptsLoaded}" /> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <div class="slds-spinner_container height100vh"> |
| | | <!-- add by Deloitte-Link 2023-6-19 --> |
| | | <div class="weeklyReportSpinner"> |
| | | <div class="slds-spinner_container"> |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | <span class="slds-assistive-text">Loading</span> |
| | | <span id="aa" class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | |
| | | |
| | | <div class="slds-truncate"> |
| | | <a href="{!'/partner/s/agency-contact/' + item.Id}" style="position: relative;"> |
| | | {!item.Name} |
| | | <span class="encrypt">{!item.Name}</span> |
| | | <span class="decrypt">{!item.awsdata.name}</span> |
| | | </a> |
| | | </div> |
| | | </th> |
| | |
| | | .THIS tr:hover .encrypt{ |
| | | display: none; |
| | | } |
| | | |
| | | /* add by Deloitte-Link 2023-6-19 start*/ |
| | | .THIS .weeklyReportSpinner{ |
| | | top:100px; |
| | | } |
| | | |
| | | .THIS .slds-spinner_container{ |
| | | position: absolute; |
| | | top:100px; |
| | | } |
| | | /* add by Deloitte-Link 2023-6-19 end*/ |
| | |
| | | <fieldset class="slds-form--compound"> |
| | | <div class="slds-form-element__group"> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-2" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-2"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >医院</label |
| | | > |
| | | <!-- <force:inputField value="{!v.record.Agency_Hospital__c}" aura:id="input-hos"/> --> |
| | |
| | | </div> --> |
| | | <h4 class="slds-section__title">产品目标</h4> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">消化科</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGIChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GI4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GI4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGIChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GI4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GI4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGIChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GI4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GI4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">ET耗材</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryETChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ET4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_ET4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryETChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ET4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_ET4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryETChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ET4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_ET4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">呼吸科</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryBFChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_BF4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_BF4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryBFChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_BF4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_BF4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryBFChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_BF4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_BF4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">普外科</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGSChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GS4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GS4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGSChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GS4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GS4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGSChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GS4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GS4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">泌尿科</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryUROChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_URO4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_URO4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryUROChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_URO4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_URO4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryUROChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_URO4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_URO4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">妇科</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGYNChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GYN4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GYN4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGYNChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GYN4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GYN4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryGYNChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_GYN4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_GYN4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">耳鼻喉科</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryENTChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ENT4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_ENT4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryENTChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ENT4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_ENT4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryENTChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_ENT4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_ENT4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | <div class="slds-form-element__row"> |
| | | <div |
| | | class="slds-size--1-of-7 slds-grid--align-center" |
| | | > |
| | | <div class="slds-size--1-of-7 slds-grid--align-center"> |
| | | <div style="margin-top: 32px">其他</div> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分1</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryOTHChange1}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_OTH4_1" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_OTH4_1" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分2</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryOTHChange2}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_OTH4_2" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_OTH4_2" class="slds-select" /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >产品区分3</label |
| | | > |
| | | <ui:inputSelect |
| | |
| | | change="{!c.productcategoryOTHChange3}" |
| | | /> |
| | | </div> |
| | | <div |
| | | class="slds-form-element slds-size--1-of-7" |
| | | > |
| | | <label |
| | | class="slds-form-element__label" |
| | | for="input-hos" |
| | | <div class="slds-form-element slds-size--1-of-7"> |
| | | <label class="slds-form-element__label" for="input-hos" |
| | | >金额目标(不含税)</label |
| | | > |
| | | <ui:inputText |
| | | aura:id="select_OTH4_3" |
| | | class="slds-select" |
| | | /> |
| | | <ui:inputText aura:id="select_OTH4_3" class="slds-select" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | display: none; |
| | | } |
| | | .THIS select { |
| | | <<<<<<< HEAD |
| | | --lwc-lineHeightButton: 36px; |
| | | --lwc-heightInput: 36px; |
| | | min-height: 0px !important; |
| | | height: 36px !important; |
| | | } |
| | | ======= |
| | | --lwc-lineHeightButton:36px; |
| | | --lwc-heightInput:36px; |
| | | min-height: 0px !important; |
| | | height: 36px !important; |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | ({ |
| | | <<<<<<< HEAD |
| | | doinit: function (component, event, helper) { |
| | | component.set('v.OCMTerm', this.getOCMTerm()); |
| | | if (component.get('v.recordId')) { |
| | |
| | | var state = response.getState(); |
| | | console.log('state1:' + state); |
| | | if (state === 'SUCCESS') { |
| | | ======= |
| | | doinit : function(component, event, helper) { |
| | | component.set("v.OCMTerm", this.getOCMTerm()); |
| | | if (component.get("v.recordId")) { |
| | | component.set("v.button_text", "编辑"); |
| | | var recordId = component.get("v.recordId"); |
| | | var action = component.get("c.getHospital"); |
| | | action.setParams({recordId: recordId}); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | console.log("state1:"+state); |
| | | if(state === "SUCCESS") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var ah = response.getReturnValue(); |
| | | var select_ah = ah.Id; |
| | | var select_ah_name = ah.Name; |
| | | // component.set('v.record.Agency_Hospital__c', select_ah); |
| | | //add by Deloitte 2023-6-8 |
| | | <<<<<<< HEAD |
| | | let agency = component.get('v.record'); |
| | | agency.Agency_Hospital__c = select_ah; |
| | | // component.set("v.record", agency); |
| | |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | ======= |
| | | let agency = component.get("v.record"); |
| | | agency.Agency_Hospital__c = select_ah; |
| | | // component.set("v.record", agency); |
| | | // alert(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v.values'))); |
| | | if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | console.log("flag1"); |
| | | var values = [{ |
| | | type: 'Agency_Hospital_Link__c', |
| | | id: select_ah, |
| | | label: select_ah_name, |
| | | icon : { |
| | | url:'/img/icon/t4v35/custom/custom24_120.png', |
| | | backgroundColor:'dc71d1', |
| | | alt:'Agency_Hospital_Link__c' |
| | | } |
| | | }]; |
| | | // component.find('input-hos').get("v.body")[0].set('v.values', values); |
| | | //add by Deloitte 2023-6-8 |
| | | if(component.find('input-hos').get("v.body") && component.find('input-hos').get("v.body").length>0){ |
| | | component.find('input-hos').get("v.body")[0].set('v.values', values); |
| | | } |
| | | } else { |
| | | // component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name); |
| | | //add by Deloitte 2023-6-8 |
| | | if(component.find('input-hos').get("v.body") && component.find('input-hos').get("v.body").length>0){ |
| | | component.find('input-hos').get("v.body")[0].set('v.selectedLabel', select_ah_name); |
| | | } |
| | | } |
| | | |
| | | } else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "错误", |
| | | "type":"error", |
| | | "message": errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | var action = component.get('c.getProductList'); |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | ======= |
| | | var action = component.get("c.getProductList"); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | console.log("state2:"+state); |
| | | if(state === "SUCCESS") { |
| | | var opts = response.getReturnValue(); |
| | | // alert(JSON.stringify(opts["GI"])); |
| | | component.find("select_GI1").set("v.options", JSON.parse(JSON.stringify(opts["GI"]))); |
| | | component.find("select_GI2").set("v.options", JSON.parse(JSON.stringify(opts["GI"]))); |
| | | component.find("select_GI3").set("v.options", JSON.parse(JSON.stringify(opts["GI"]))); |
| | | |
| | | component.find("select_GS1").set("v.options", JSON.parse(JSON.stringify(opts["GS"]))); |
| | | component.find("select_GS2").set("v.options", JSON.parse(JSON.stringify(opts["GS"]))); |
| | | component.find("select_GS3").set("v.options", JSON.parse(JSON.stringify(opts["GS"]))); |
| | | |
| | | component.find("select_GYN1").set("v.options", JSON.parse(JSON.stringify(opts["GYN"]))); |
| | | component.find("select_GYN2").set("v.options", JSON.parse(JSON.stringify(opts["GYN"]))); |
| | | component.find("select_GYN3").set("v.options", JSON.parse(JSON.stringify(opts["GYN"]))); |
| | | |
| | | component.find("select_URO1").set("v.options", JSON.parse(JSON.stringify(opts["URO"]))); |
| | | component.find("select_URO2").set("v.options", JSON.parse(JSON.stringify(opts["URO"]))); |
| | | component.find("select_URO3").set("v.options", JSON.parse(JSON.stringify(opts["URO"]))); |
| | | |
| | | component.find("select_ENT1").set("v.options", JSON.parse(JSON.stringify(opts["ENT"]))); |
| | | component.find("select_ENT2").set("v.options", JSON.parse(JSON.stringify(opts["ENT"]))); |
| | | component.find("select_ENT3").set("v.options", JSON.parse(JSON.stringify(opts["ENT"]))); |
| | | |
| | | component.find("select_OTH1").set("v.options", JSON.parse(JSON.stringify(opts["OTH"]))); |
| | | component.find("select_OTH2").set("v.options", JSON.parse(JSON.stringify(opts["OTH"]))); |
| | | component.find("select_OTH3").set("v.options", JSON.parse(JSON.stringify(opts["OTH"]))); |
| | | |
| | | component.find("select_ET1").set("v.options", JSON.parse(JSON.stringify(opts["ET"]))); |
| | | component.find("select_ET2").set("v.options", JSON.parse(JSON.stringify(opts["ET"]))); |
| | | component.find("select_ET3").set("v.options", JSON.parse(JSON.stringify(opts["ET"]))); |
| | | |
| | | component.find("select_BF1").set("v.options", JSON.parse(JSON.stringify(opts["BF"]))); |
| | | component.find("select_BF2").set("v.options", JSON.parse(JSON.stringify(opts["BF"]))); |
| | | component.find("select_BF3").set("v.options", JSON.parse(JSON.stringify(opts["BF"]))); |
| | | } else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | title: "错误", |
| | | type:"error", |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | toggle_report: function (component, event, helper) { |
| | | ======= |
| | | toggle_report : function(component, event, helper) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | $A.util.toggleClass(modal_window, 'disp_none'); |
| | | $A.util.toggleClass(modal_bg, 'disp_none'); |
| | | |
| | | <<<<<<< HEAD |
| | | if ( |
| | | $A.util.hasClass(modal_window, 'disp_none') && |
| | | !component.get('v.recordId') |
| | |
| | | title: '成功', |
| | | type: 'success', |
| | | message: '保存成功' |
| | | ======= |
| | | if ($A.util.hasClass(modal_window, 'disp_none') && !component.get("v.recordId")) { |
| | | $A.get('e.force:refreshView').fire(); |
| | | } |
| | | }, |
| | | |
| | | productcategoryChange : function(component, event, helper, dept, index) { |
| | | var cmpId = 'select_'+dept; |
| | | var myId; |
| | | var o1Id; |
| | | var o2Id; |
| | | if (index == 1) { |
| | | myId = cmpId + '1'; |
| | | o1Id = cmpId + '2'; |
| | | o2Id = cmpId + '3'; |
| | | } else if (index == 2){ |
| | | myId = cmpId + '2'; |
| | | o1Id = cmpId + '1'; |
| | | o2Id = cmpId + '3'; |
| | | } else { |
| | | myId = cmpId + '3'; |
| | | o1Id = cmpId + '1'; |
| | | o2Id = cmpId + '2'; |
| | | } |
| | | |
| | | var product_category_id = component.find(myId).get('v.value'); |
| | | var pcId1 = component.find(o1Id).get('v.value'); |
| | | var pcId2 = component.find(o2Id).get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find(myId).set('v.value',''); |
| | | } |
| | | }, |
| | | |
| | | selectHos : function(component, event, helper) { |
| | | |
| | | var accid = component.get("v.record.Agency_Hospital__c"); |
| | | var action = component.get("c.getDeptAmount"); |
| | | action.setParams({ hospitalId : accid }); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var amountMap = response.getReturnValue(); |
| | | var GIProduct_Category1 = ''; |
| | | var GIProduct_Category2 = ''; |
| | | var GIProduct_Category3 = ''; |
| | | var GIAim_Price__c1 = ''; |
| | | var GIAim_Price__c2 = ''; |
| | | var GIAim_Price__c3 = ''; |
| | | if (amountMap.GI.length > 0) { |
| | | GIProduct_Category1 = amountMap.GI[0].Product_Category__c; |
| | | if (amountMap.GI.length > 1) { |
| | | GIProduct_Category2 = amountMap.GI[1].Product_Category__c; |
| | | } |
| | | if (amountMap.GI.length > 2) { |
| | | GIProduct_Category3 = amountMap.GI[2].Product_Category__c; |
| | | } |
| | | GIAim_Price__c1 = amountMap.GI[0].Aim_Price__c; |
| | | GIAim_Price__c2 = amountMap.GI[1].Aim_Price__c; |
| | | GIAim_Price__c3 = amountMap.GI[2].Aim_Price__c; |
| | | console.warn(GIAim_Price__c1+"-"+GIAim_Price__c2+"-"+GIAim_Price__c3); |
| | | |
| | | } |
| | | component.find('select_GI1').set('v.value',GIProduct_Category1); |
| | | component.find('select_GI2').set('v.value',GIProduct_Category2); |
| | | component.find('select_GI3').set('v.value',GIProduct_Category3); |
| | | component.find('select_GI4_1').set('v.value',GIAim_Price__c1); |
| | | component.find('select_GI4_2').set('v.value',GIAim_Price__c2); |
| | | component.find('select_GI4_3').set('v.value',GIAim_Price__c3); |
| | | |
| | | |
| | | var ETProduct_Category1 = ''; |
| | | var ETProduct_Category2 = ''; |
| | | var ETProduct_Category3 = ''; |
| | | var ETAim_Price__c1 = ''; |
| | | var ETAim_Price__c2 = ''; |
| | | var ETAim_Price__c3 = ''; |
| | | if (amountMap.ET.length > 0) { |
| | | ETProduct_Category1 = amountMap.ET[0].Product_Category__c; |
| | | if (amountMap.ET.length > 1) { |
| | | ETProduct_Category2 = amountMap.ET[1].Product_Category__c; |
| | | } |
| | | if (amountMap.ET.length > 2) { |
| | | ETProduct_Category3 = amountMap.ET[2].Product_Category__c; |
| | | } |
| | | ETAim_Price__c1 = amountMap.ET[0].Aim_Price__c; |
| | | ETAim_Price__c2 = amountMap.ET[1].Aim_Price__c; |
| | | ETAim_Price__c3 = amountMap.ET[2].Aim_Price__c; |
| | | } |
| | | component.find('select_ET1').set('v.value',ETProduct_Category1); |
| | | component.find('select_ET2').set('v.value',ETProduct_Category2); |
| | | component.find('select_ET3').set('v.value',ETProduct_Category3); |
| | | component.find('select_ET4_1').set('v.value',ETAim_Price__c1); |
| | | component.find('select_ET4_2').set('v.value',ETAim_Price__c2); |
| | | component.find('select_ET4_3').set('v.value',ETAim_Price__c3); |
| | | |
| | | |
| | | var BFProduct_Category1 = ''; |
| | | var BFProduct_Category2 = ''; |
| | | var BFProduct_Category3 = ''; |
| | | var BFAim_Price__c1 = ''; |
| | | var BFAim_Price__c2 = ''; |
| | | var BFAim_Price__c3 = ''; |
| | | if (amountMap.BF.length > 0) { |
| | | BFProduct_Category1 = amountMap.BF[0].Product_Category__c; |
| | | if (amountMap.BF.length > 1) { |
| | | BFProduct_Category2 = amountMap.BF[1].Product_Category__c; |
| | | } |
| | | if (amountMap.BF.length > 2) { |
| | | BFProduct_Category3 = amountMap.BF[2].Product_Category__c; |
| | | } |
| | | BFAim_Price__c1 = amountMap.BF[0].Aim_Price__c; |
| | | BFAim_Price__c2 = amountMap.BF[1].Aim_Price__c; |
| | | BFAim_Price__c3 = amountMap.BF[2].Aim_Price__c; |
| | | } |
| | | component.find('select_BF1').set('v.value',BFProduct_Category1); |
| | | component.find('select_BF2').set('v.value',BFProduct_Category2); |
| | | component.find('select_BF3').set('v.value',BFProduct_Category3); |
| | | component.find('select_BF4_1').set('v.value',BFAim_Price__c1); |
| | | component.find('select_BF4_2').set('v.value',BFAim_Price__c2); |
| | | component.find('select_BF4_3').set('v.value',BFAim_Price__c3); |
| | | |
| | | |
| | | var OTHProduct_Category1 = ''; |
| | | var OTHProduct_Category2 = ''; |
| | | var OTHProduct_Category3 = ''; |
| | | var OTHAim_Price__c1 = ''; |
| | | var OTHAim_Price__c2 = ''; |
| | | var OTHAim_Price__c3 = ''; |
| | | if (amountMap.OTH.length > 0) { |
| | | |
| | | OTHProduct_Category1 = amountMap.OTH[0].Product_Category__c; |
| | | if (amountMap.OTH.length > 1) { |
| | | OTHProduct_Category2 = amountMap.OTH[1].Product_Category__c; |
| | | } |
| | | if (amountMap.OTH.length > 2) { |
| | | OTHProduct_Category3 = amountMap.OTH[2].Product_Category__c; |
| | | } |
| | | OTHAim_Price__c1 = amountMap.OTH[0].Aim_Price__c; |
| | | OTHAim_Price__c2 = amountMap.OTH[1].Aim_Price__c; |
| | | OTHAim_Price__c3 = amountMap.OTH[2].Aim_Price__c; |
| | | } |
| | | component.find('select_OTH1').set('v.value',OTHProduct_Category1); |
| | | component.find('select_OTH2').set('v.value',OTHProduct_Category2); |
| | | component.find('select_OTH3').set('v.value',OTHProduct_Category3); |
| | | component.find('select_OTH4_1').set('v.value',OTHAim_Price__c1); |
| | | component.find('select_OTH4_2').set('v.value',OTHAim_Price__c2); |
| | | component.find('select_OTH4_3').set('v.value',OTHAim_Price__c3); |
| | | |
| | | var GSProduct_Category1 = ''; |
| | | var GSProduct_Category2 = ''; |
| | | var GSProduct_Category3 = ''; |
| | | var GSPAim_Price__c1 = ''; |
| | | var GSPAim_Price__c2 = ''; |
| | | var GSPAim_Price__c3 = ''; |
| | | if (amountMap.GS.length > 0) { |
| | | GSProduct_Category1 = amountMap.GS[0].Product_Category__c; |
| | | if (amountMap.GS.length > 1) { |
| | | GSProduct_Category2 = amountMap.GS[1].Product_Category__c; |
| | | } |
| | | if (amountMap.GS.length > 2) { |
| | | GSProduct_Category3 = amountMap.GS[2].Product_Category__c; |
| | | } |
| | | GSPAim_Price__c1 = amountMap.GS[0].Aim_Price__c; |
| | | GSPAim_Price__c2 = amountMap.GS[1].Aim_Price__c; |
| | | GSPAim_Price__c3= amountMap.GS[2].Aim_Price__c; |
| | | } |
| | | component.find('select_GS1').set('v.value',GSProduct_Category1); |
| | | component.find('select_GS2').set('v.value',GSProduct_Category2); |
| | | component.find('select_GS3').set('v.value',GSProduct_Category3); |
| | | component.find('select_GS4_1').set('v.value',GSPAim_Price__c1); |
| | | component.find('select_GS4_2').set('v.value',GSPAim_Price__c2); |
| | | component.find('select_GS4_3').set('v.value',GSPAim_Price__c3); |
| | | |
| | | var UROProduct_Category1 = ''; |
| | | var UROProduct_Category2 = ''; |
| | | var UROProduct_Category3 = ''; |
| | | var UROAim_Price__c1 = ''; |
| | | var UROAim_Price__c2 = ''; |
| | | var UROAim_Price__c3 = ''; |
| | | if (amountMap.URO.length > 0) { |
| | | |
| | | UROProduct_Category1 = amountMap.URO[0].Product_Category__c; |
| | | if (amountMap.URO.length > 1) { |
| | | UROProduct_Category2 = amountMap.URO[1].Product_Category__c; |
| | | } |
| | | if (amountMap.URO.length > 2) { |
| | | UROProduct_Category3 = amountMap.URO[2].Product_Category__c; |
| | | } |
| | | UROAim_Price__c1 = amountMap.URO[0].Aim_Price__c; |
| | | UROAim_Price__c2 = amountMap.URO[1].Aim_Price__c; |
| | | UROAim_Price__c3 = amountMap.URO[2].Aim_Price__c; |
| | | } |
| | | component.find('select_URO1').set('v.value',UROProduct_Category1); |
| | | component.find('select_URO2').set('v.value',UROProduct_Category2); |
| | | component.find('select_URO3').set('v.value',UROProduct_Category3); |
| | | component.find('select_URO4_1').set('v.value',UROAim_Price__c1); |
| | | component.find('select_URO4_2').set('v.value',UROAim_Price__c2); |
| | | component.find('select_URO4_3').set('v.value',UROAim_Price__c3); |
| | | |
| | | |
| | | var GYNProduct_Category1 = ''; |
| | | var GYNProduct_Category2 = ''; |
| | | var GYNProduct_Category3 = ''; |
| | | var GYNAim_Price__c1 = ''; |
| | | var GYNAim_Price__c2 = ''; |
| | | var GYNAim_Price__c3 = ''; |
| | | if (amountMap.GYN.length > 0) { |
| | | |
| | | GYNProduct_Category1 = amountMap.GYN[0].Product_Category__c; |
| | | if (amountMap.GYN.length > 1) { |
| | | GYNProduct_Category2 = amountMap.GYN[1].Product_Category__c; |
| | | } |
| | | if (amountMap.GYN.length > 2) { |
| | | GYNProduct_Category3 = amountMap.GYN[2].Product_Category__c; |
| | | } |
| | | GYNAim_Price__c1= amountMap.GYN[0].Aim_Price__c; |
| | | GYNAim_Price__c2 = amountMap.GYN[1].Aim_Price__c; |
| | | GYNAim_Price__c3 = amountMap.GYN[2].Aim_Price__c; |
| | | } |
| | | component.find('select_GYN1').set('v.value',GYNProduct_Category1); |
| | | component.find('select_GYN2').set('v.value',GYNProduct_Category2); |
| | | component.find('select_GYN3').set('v.value',GYNProduct_Category3); |
| | | component.find('select_GYN4_1').set('v.value',GYNAim_Price__c1); |
| | | component.find('select_GYN4_2').set('v.value',GYNAim_Price__c2); |
| | | component.find('select_GYN4_3').set('v.value',GYNAim_Price__c3); |
| | | |
| | | |
| | | var ENTProduct_Category1 = ''; |
| | | var ENTProduct_Category2 = ''; |
| | | var ENTProduct_Category3 = ''; |
| | | var ENTAim_Price__c1 = ''; |
| | | var ENTAim_Price__c2 = ''; |
| | | var ENTAim_Price__c3 = ''; |
| | | if (amountMap.ENT.length > 0) { |
| | | |
| | | ENTProduct_Category1 = amountMap.ENT[0].Product_Category__c; |
| | | if (amountMap.ENT.length > 1) { |
| | | ENTProduct_Category2 = amountMap.ENT[1].Product_Category__c; |
| | | } |
| | | if (amountMap.ENT.length > 2) { |
| | | ENTProduct_Category3 = amountMap.ENT[2].Product_Category__c; |
| | | } |
| | | ENTAim_Price__c1 = amountMap.ENT[0].Aim_Price__c; |
| | | ENTAim_Price__c2 = amountMap.ENT[1].Aim_Price__c; |
| | | ENTAim_Price__c3 = amountMap.ENT[2].Aim_Price__c; |
| | | } |
| | | component.find('select_ENT1').set('v.value',ENTProduct_Category1); |
| | | component.find('select_ENT2').set('v.value',ENTProduct_Category2); |
| | | component.find('select_ENT3').set('v.value',ENTProduct_Category3); |
| | | component.find('select_ENT4_1').set('v.value',ENTAim_Price__c1); |
| | | component.find('select_ENT4_2').set('v.value',ENTAim_Price__c2); |
| | | component.find('select_ENT4_3').set('v.value',ENTAim_Price__c3); |
| | | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | console.log(JSON.stringify(component.find('input-hos').get("v.body")[0].get('v'))); |
| | | }, |
| | | |
| | | getOCMTerm : function() { |
| | | var today = new Date(); |
| | | var year = today.getFullYear(); |
| | | var month = today.getMonth(); |
| | | |
| | | if (month < 3) year -= 1; |
| | | var thisYearOCMPeriod = String(year - 1867) + 'P'; |
| | | |
| | | return thisYearOCMPeriod; |
| | | }, |
| | | |
| | | createTarget : function(component, event, helper) { |
| | | var action = component.get("c.createSFTarget"); |
| | | // alert(component.get("v.GIAmount")); |
| | | |
| | | |
| | | |
| | | var p1_1 = component.find('select_GI4_1').get('v.value') ; |
| | | var p1_2 = component.find('select_GI4_2').get('v.value') ; |
| | | var p1_3 = component.find('select_GI4_3').get('v.value') ; |
| | | |
| | | if (p1_1 == undefined || p1_1 == "") { |
| | | p1_1 = 0; |
| | | } |
| | | if (p1_2 == undefined || p1_2 == "") { |
| | | p1_2 = 0; |
| | | } |
| | | if (p1_3 == undefined || p1_3 == "") { |
| | | p1_3 = 0; |
| | | } |
| | | console.warn(p1_1+"-"+p1_2+"-"+p1_3); |
| | | |
| | | var p2_1 = component.find('select_ET4_1').get('v.value') ; |
| | | var p2_2 = component.find('select_ET4_2').get('v.value') ; |
| | | var p2_3 = component.find('select_ET4_3').get('v.value') ; |
| | | if (p2_1 == undefined || p2_1 == "") { |
| | | p2_1 = 0; |
| | | } |
| | | if (p2_2 == undefined || p2_2 == "") { |
| | | p2_2 = 0; |
| | | } |
| | | if (p2_3 == undefined || p2_3 == "") { |
| | | p2_3 = 0; |
| | | } |
| | | |
| | | |
| | | var p3_1 = component.find('select_BF4_1').get('v.value') ; |
| | | var p3_2 = component.find('select_BF4_2').get('v.value') ; |
| | | var p3_3 = component.find('select_BF4_3').get('v.value') ; |
| | | if (p3_1 == undefined || p3_1 == "") { |
| | | p3_1 = 0; |
| | | } |
| | | if (p3_2 == undefined || p3_2 == "") { |
| | | p3_2 = 0; |
| | | } |
| | | if (p3_3 == undefined || p3_3 == "") { |
| | | p3_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p4_1 = component.find('select_OTH4_1').get('v.value') ; |
| | | var p4_2 = component.find('select_OTH4_2').get('v.value') ; |
| | | var p4_3 = component.find('select_OTH4_3').get('v.value') ; |
| | | if (p4_1 == undefined || p4_1 == "") { |
| | | p4_1 = 0; |
| | | } |
| | | if (p4_2 == undefined || p4_2 == "") { |
| | | p4_2 = 0; |
| | | } |
| | | if (p4_3 == undefined || p4_3 == "") { |
| | | p4_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p5_1 = component.find('select_GS4_1').get('v.value') ; |
| | | var p5_2 = component.find('select_GS4_2').get('v.value') ; |
| | | var p5_3 = component.find('select_GS4_3').get('v.value') ; |
| | | if (p5_1 == undefined || p5_1 == "") { |
| | | p5_1 = 0; |
| | | } |
| | | if (p5_2 == undefined || p5_2 == "") { |
| | | p5_2 = 0; |
| | | } |
| | | if (p5_3 == undefined || p5_3 == "") { |
| | | p5_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p6_1 = component.find('select_URO4_1').get('v.value') ; |
| | | var p6_2 = component.find('select_URO4_2').get('v.value') ; |
| | | var p6_3 = component.find('select_URO4_3').get('v.value') ; |
| | | if (p6_1 == undefined || p6_1 == "") { |
| | | p6_1 = 0; |
| | | } |
| | | if (p6_2 == undefined || p6_2 == "") { |
| | | p6_2 = 0; |
| | | } |
| | | if (p6_3 == undefined || p6_3 == "") { |
| | | p6_3 = 0; |
| | | } |
| | | |
| | | var p7_1 = component.find('select_GYN4_1').get('v.value') ; |
| | | var p7_2 = component.find('select_GYN4_2').get('v.value') ; |
| | | var p7_3 = component.find('select_GYN4_3').get('v.value') ; |
| | | if (p7_1 == undefined || p7_1 == "") { |
| | | p7_1 = 0; |
| | | } |
| | | if (p7_2 == undefined || p7_2 == "") { |
| | | p7_2 = 0; |
| | | } |
| | | if (p7_3 == undefined || p7_3 == "") { |
| | | p7_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | var p8_1 = component.find('select_ENT4_1').get('v.value') ; |
| | | var p8_2 = component.find('select_ENT4_2').get('v.value') ; |
| | | var p8_3 = component.find('select_ENT4_3').get('v.value') ; |
| | | if (p8_1 == undefined || p8_1 == "") { |
| | | p8_1 = 0; |
| | | } |
| | | if (p8_2 == undefined || p8_2 == "") { |
| | | p8_2 = 0; |
| | | } |
| | | if (p8_3 == undefined || p8_3 == "") { |
| | | p8_3 = 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | action.setParams({ |
| | | "hospitalId" : component.get("v.record.Agency_Hospital__c"), |
| | | "GIProduct" : [component.find('select_GI1').get('v.value'),component.find('select_GI2').get('v.value'),component.find('select_GI3').get('v.value'),p1_1,p1_2,p1_3], |
| | | "ETProduct" : [component.find('select_ET1').get('v.value'),component.find('select_ET2').get('v.value'),component.find('select_ET3').get('v.value'),p2_1, p2_2,p2_3 ], |
| | | "BFProduct" : [component.find('select_BF1').get('v.value'),component.find('select_BF2').get('v.value'),component.find('select_BF3').get('v.value'),p3_1 ,p3_2 ,p3_3 ], |
| | | "OTHProduct" : [component.find('select_OTH1').get('v.value'),component.find('select_OTH2').get('v.value'),component.find('select_OTH3').get('v.value'),p4_1,p4_2 ,p4_3], |
| | | "GSProduct" : [component.find('select_GS1').get('v.value'),component.find('select_GS2').get('v.value'),component.find('select_GS3').get('v.value'),p5_1,p5_2,p5_3], |
| | | "UROProduct" : [component.find('select_URO1').get('v.value'),component.find('select_URO2').get('v.value'),component.find('select_URO3').get('v.value'),p6_1,p6_2 ,p6_2 ], |
| | | "GYNProduct" : [component.find('select_GYN1').get('v.value'),component.find('select_GYN2').get('v.value'),component.find('select_GYN3').get('v.value'),p7_1,p7_2 ,p7_3 ], |
| | | "ENTProduct" : [component.find('select_ENT1').get('v.value'),component.find('select_ENT2').get('v.value'),component.find('select_ENT3').get('v.value'),p8_1 ,p8_2 ,p8_3], |
| | | "OCMTerm" : component.get("v.OCMTerm") |
| | | }); |
| | | action.setCallback(this, function(response) { |
| | | console.warn(response); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | $A.util.toggleClass(modal_window, 'disp_none'); |
| | | $A.util.toggleClass(modal_bg, 'disp_none'); |
| | | |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | title: "成功", |
| | | type:"success", |
| | | message: "保存成功" |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | $A.get('e.force:refreshView').fire(); |
| | | <<<<<<< HEAD |
| | | } else if (state === 'INCOMPLETE') { |
| | | var toastEvent = $A.get('e.force:showToast'); |
| | | toastEvent.setParams({ |
| | |
| | | toastEvent.fire(); |
| | | } |
| | | }); |
| | | ======= |
| | | } else if (state === "INCOMPLETE") { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | title: "未完成!", |
| | | type:"error", |
| | | message: "未完成" |
| | | }); |
| | | toastEvent.fire(); |
| | | } else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | title: "错误", |
| | | type:"error", |
| | | message: errors[0].message |
| | | }); |
| | | toastEvent.fire(); |
| | | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | title: "警告!", |
| | | message: message, |
| | | type:"warning", |
| | | duration : "10000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | error : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | title: "错误!", |
| | | message: message, |
| | | type:"error", |
| | | duration : "10000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | <<<<<<< HEAD |
| | | <aura:component |
| | | controller="DealerPersonnelController" |
| | | ======= |
| | | <!-- |
| | | * @Author: Thhto 997058689@qq.com |
| | | * @Date: 2022-07-08 10:47:25 |
| | | * @LastEditors: Thhto 997058689@qq.com |
| | | * @LastEditTime: 2023-02-03 15:25:46 |
| | | * @FilePath: \ceshihuanj\force-app\main\default\aura\DealerPersonnelInformationImport\DealerPersonnelInformationImport.cmp |
| | | * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE |
| | | --> |
| | | <aura:component controller="DealerPersonnelController" |
| | | >>>>>>> LEXCommunityLiJun |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | | access="global" |
| | | > |
| | |
| | | </div> |
| | | </aura:renderIf> |
| | | <!-- 批量添加周报 start--> |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-modal slds-fade-in-open slds-hide" |
| | | aura:id="errorDiv" |
| | |
| | | > |
| | | <ui:inputText aura:id="articleURL" /> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | ======= |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div |
| | | class="slds-notify slds-notify_toast slds-theme_error" |
| | |
| | | > |
| | | <div class="slds-m-left_xx-large"> |
| | | <div |
| | | <<<<<<< HEAD |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large" |
| | | > |
| | | <lightning:icon |
| | |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.errorMessage} |
| | | </h2> |
| | | ======= |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <!-- DB202301262139 SFDC经销商人员导入功能改进 start --> |
| | | <!-- <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> --> |
| | | <pre class="slds-text-heading_small ">{!v.errorMessage}</pre> |
| | | <!-- DB202301262139 SFDC经销商人员导入功能改进 end --> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01"> |
| | | <<<<<<< HEAD |
| | | <ui:inputText aura:id="articleURL" /> |
| | | <div class="demo-only" style="height: 8rem"> |
| | | ======= |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div |
| | | class="slds-notify slds-notify_toast slds-theme_success" |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | <div> |
| | | <div class="slds-modal__header"> |
| | | ======= |
| | | <div > |
| | | <div class="slds-modal__header "> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 客户人员批量导入 |
| | |
| | | </center> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <<<<<<< HEAD |
| | | <ui:outputRichText |
| | | class="uiOutputRichText slds-m--around-large" |
| | | value="{!v.TableContent}" |
| | |
| | | variant="brand" |
| | | onclick="{!c.cancel}" |
| | | /> |
| | | ======= |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button aura:id="save_con" label="保存" variant="brand" onclick="{!c.processFileContent}" disabled="false" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.cancel}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | <aura:if isTrue="{!v.showErrorInfo}"> |
| | | <div |
| | |
| | | onclick="{!c.exportErrorInfo}" |
| | | /> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-p-around--large slds-align--absolute-center" |
| | | > |
| | |
| | | hideCheckboxColumn="true" |
| | | minColumnWidth="120" |
| | | /> |
| | | ======= |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div style="height: 300px;overflow-x:scroll"> |
| | | <lightning:datatable keyField="id" data="{! v.errorData }" columns="{! v.errorColumns }" |
| | | hideCheckboxColumn="true"/> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | </aura:if> |
| | |
| | | reader.onloadend = function () {}; |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | isNumber: function(str) { |
| | | return /^\d+$/.test(str); |
| | | }, |
| | | saveRecords: function (component, event, helper) { |
| | | component.set('v.login', true); |
| | | var action = component.get('c.processData'); |
| | |
| | | for (var i = 0; i < ress.length; i++) { |
| | | res1 += ress[i].substr(7) + '\n'; |
| | | if (ress[i] != '') { |
| | | <<<<<<< HEAD |
| | | let errorData = {}; |
| | | let index = errorDataRow.indexOf( |
| | | ress[i].substr(7).substring(1, 2) |
| | | ); |
| | | ======= |
| | | let errorData = {} |
| | | if(!this.isNumber(ress[i].substr(7).substring(1, 2))){ |
| | | continue |
| | | } |
| | | let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2)); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (index == -1) { |
| | | errorData.errorRow = ress[i] |
| | | .substr(7) |
| | | .substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | <<<<<<< HEAD |
| | | errorData.errorInfo = ress[i] |
| | | .substr(7) |
| | | .substring(6); |
| | |
| | | } else { |
| | | errorDatas[index].errorInfo += |
| | | '; ' + ress[i].substr(7).substring(6); |
| | | ======= |
| | | errorData.errorInfo = ress[i].substr(7).substring(5); |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | |
| | | .get('v.fileContentData') |
| | | .split('\n'); |
| | | let errorColumns = [ |
| | | <<<<<<< HEAD |
| | | { |
| | | label: '错误行', |
| | | fieldName: 'errorRow', |
| | |
| | | initialWidth: 300, |
| | | wrapText: true |
| | | } |
| | | ======= |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 }, |
| | | { label: '错误信息', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true,initialWidth: 300,wrapText: true } |
| | | >>>>>>> LEXCommunityLiJun |
| | | ]; |
| | | for ( |
| | | var i = 0; |
| | |
| | | i++ |
| | | ) { |
| | | errorColumns.push({ |
| | | <<<<<<< HEAD |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true |
| | | ======= |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | >>>>>>> LEXCommunityLiJun |
| | | }); |
| | | } |
| | | |
| | | for (var i = 0; i < errorDatas.length; i++) { |
| | | let data = fileContentData[errorDatas[i].errorRow]; |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | <<<<<<< HEAD |
| | | for (var j = 0; j < data.split(',').length; j++) { |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | ======= |
| | | if(data){ |
| | | for(var j = 0; j < data.split(',').length; j++){ |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | console.log('errorDatas = ' + JSON.stringify(errorDatas)); |
| | |
| | | component.set('v.errorMessage', res1 + '请修改后重新上传'); |
| | | this.showErrorToast(component); |
| | | component.set('v.login', false); |
| | | component.find('save_con').set('v.disabled', true); |
| | | } else { |
| | | // this.success('导入成功'); |
| | | component.set('v.successMessage', '导入成功'); |
| | | this.showSuccessToast01(component); |
| | | component.set('v.showMain', true); |
| | | component.set('v.login', false); |
| | | component.find('save_con').set('v.disabled', false); |
| | | } |
| | | } else if (state === 'INCOMPLETE') { |
| | | component.set('v.login', false); |
| | |
| | | //弹出 错误提示 |
| | | showErrorToast: function (component) { |
| | | $A.util.removeClass(component.find('errorDiv'), 'slds-hide'); |
| | | <<<<<<< HEAD |
| | | window.setTimeout( |
| | | $A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 4000 |
| | | ======= |
| | | window.setTimeout($A.getCallback(function () { |
| | | $A.util.addClass(component.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 7000 |
| | | >>>>>>> LEXCommunityLiJun |
| | | ); |
| | | }, |
| | | success: function (message) { |
| | |
| | | downloadCSV: function (component, csv) { |
| | | var link = document.createElement('a'); |
| | | // 设置字符集和文件头 |
| | | <<<<<<< HEAD |
| | | let bom = '\uFEFF'; |
| | | link.href = |
| | | 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | ======= |
| | | var bom = "\uFEFF"; |
| | | link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | //link.href = URL.createObjectURL(csvFile); |
| | | >>>>>>> LEXCommunityLiJun |
| | | link.download = 'data.csv'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| 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 |
| | |
| | | <!-- |
| | | @description : |
| | | @author : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | @group : |
| | | @last modified on : 07-08-2022 |
| | | @last modified by : ChangeMeIn@UserSettingsUnder.SFDoc |
| | | --> |
| | | <aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId,lightning:actionOverride,lightning:isUrlAddressable" access="global" |
| | | controller="NewAgencyContactController"> |
| | | |
| | | <aura:attribute name = "recordId" type = "Id" default = ""/> |
| | | <aura:attribute name="title" type="string"/> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:attribute name="layout" type="LayoutDescriberHelper.LayoutWrapper"/> |
| | | <aura:attribute name="record_data" type="Map"/> |
| | | <aura:attribute name="section_names" type="List"/> |
| | | <aura:attribute name="showSpinner" type="Boolean" default = "False"/> |
| | | <aura:attribute name="staticResource" type="Map"/> |
| | | <aura:attribute name="pi_fields_map" type="Map"/> |
| | | <aura:attribute name="isClone" type="Boolean" default = "False"/> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <aura:registerEvent name="NewAgencyContactEvent" type="c:NewAgencyContactEvent"/> |
| | | <aura:attribute name="agencyHospitalId" type="String"/> |
| | | |
| | | <div class="slds-modal__container"> |
| | | <!-- header --> |
| | | <header class="slds-modal__header"> |
| | | <h2 id="modal-heading-01" class="slds-modal__title slds-hyphenate"> |
| | | {!v.title} |
| | | </h2> |
| | | </header> |
| | | |
| | | <div class="slds-modal__content slds-p-around_medium"> |
| | | <aura:if isTrue="{!v.showSpinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:if> |
| | | |
| | | |
| | | <lightning:recordEditForm objectApiName="Agency_Contact__c" onload="{!c.handleLoad}"> |
| | | |
| | | <lightning:accordion activeSectionName="{! v.section_names }" allowMultipleSectionsOpen="true" class="greyyyy" > |
| | | <aura:iteration items="{!v.layout}" var="section"> |
| | | <aura:if isTrue="{! section.editHeading }"> |
| | | <lightning:accordionSection name="{! section.label }" label="{! section.label }"> |
| | | |
| | | <aura:iteration items="{! section.layoutColumns}" var="col"> |
| | | <aura:iteration items="{! col.layoutItems}" var="field"> |
| | | <aura:if isTrue="{! field.behavior != 'Readonly' }"> |
| | | <lightning:inputField required="{! field.behavior == 'Required' }" aura:id="field" fieldName="{! field.field}" value="{! field.value}" /> |
| | | |
| | | </aura:if> |
| | | </aura:iteration> |
| | | |
| | | </aura:iteration> |
| | | |
| | | |
| | | </lightning:accordionSection> |
| | | </aura:if> |
| | | </aura:iteration> |
| | | </lightning:accordion> |
| | | </lightning:recordEditForm> |
| | | |
| | | <div style="text-align:center;margin: 5px;"> |
| | | <lightning:button class="slds-button slds-button_neutral" label="取消" onclick="{! c.cancelClick }" /> |
| | | <lightning:button class="slds-button slds-button_brand" variant="brand" label="保存" onclick="{! c.saveClick }" /> |
| | | |
| | | </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 |
| | |
| | | .THIS { |
| | | } |
| | | |
| | | .THIS .greyyyy .slds-button_reset{ |
| | | display: flex; |
| | | align-items: center; |
| | | background: var(--lwc-colorBackground,rgb(243, 242, 242)); |
| | | cursor: pointer; |
| | | width: 100%; |
| | | height: 2rem; |
| | | text-align: left; |
| | | color: currentColor; |
| | | font-size: inherit; |
| | | padding: 0 var(--lwc-spacingXSmall,0.5rem); |
| | | } |
| 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 |
| | |
| | | ({ |
| | | doInit : function(component, event, helper) { |
| | | let rid = component.get('v.recordId'); |
| | | let pid = null; |
| | | if(!rid){ |
| | | pid = window.location.href.replace("https://","").split("/")[4]; |
| | | } |
| | | 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 record_type_id = null; |
| | | let pageref = component.get("v.pageReference") |
| | | if(!record_type_id && pageref){ |
| | | record_type_id = pageref.state.recordTypeId |
| | | } |
| | | component.set("v.showSpinner", true); |
| | | helper.CallBackAction(component,'Init',{ |
| | | rid : rid, |
| | | pid : null, |
| | | //rid : component.get('v.recordId'), |
| | | record_type_id : record_type_id, |
| | | },function(data){ |
| | | debugger |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | if(rv.IsSuccess){ |
| | | let layout = JSON.parse(rv.Data.layout); |
| | | let fields = rv.Data.fields; |
| | | let staticResource = JSON.parse(rv.Data.staticResource); |
| | | let staticResourceV2 = JSON.parse(rv.Data.staticResourceV2); |
| | | let section_names = []; |
| | | section_names = layout.map(s=>s.label); |
| | | component.set('v.section_names',section_names); |
| | | |
| | | let m = {}; |
| | | for(let f of staticResource.PIDetails){ |
| | | m[f.SF_Field_API_Name__c] = f; |
| | | } |
| | | component.set('v.pi_fields_map',m); |
| | | |
| | | |
| | | |
| | | var agencyHospitalId = component.get("v.agencyHospitalId"); |
| | | console.log('agencyHospitalId = ' + agencyHospitalId); |
| | | if(rv.Data && rv.Data.data && rv.Data.data.AWS_Data_Id__c){ |
| | | helper.AwsGet(staticResource.queryUrl, { |
| | | dataId : rv.Data.data.AWS_Data_Id__c |
| | | }, function(data){ |
| | | console.log('data = ' + data); |
| | | |
| | | for(let f of staticResource.PIDetails){ |
| | | |
| | | if(data.object && data.object.hasOwnProperty(f.AWS_Field_API__c)){ |
| | | rv.Data.data[f.SF_Field_API_Name__c] = data.object[f.AWS_Field_API__c]; |
| | | if(data.object.hasOwnProperty(f.AWS_Encrypted_Field_API__c) && data.object[f.AWS_Encrypted_Field_API__c]){ |
| | | rv.Data.data[f.SF_Field_Encrypted_API__c] = data.object[f.AWS_Encrypted_Field_API__c]; |
| | | } |
| | | } |
| | | } |
| | | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(rv.Data.data.hasOwnProperty(item.field)){ |
| | | item.value = rv.Data.data[item.field]; |
| | | } |
| | | if(fields.hasOwnProperty(item.field)){ |
| | | item.fi = fields[item.field]; |
| | | } |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | item.value = agencyHospitalId; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set('v.record_data',rv.Data.data); |
| | | component.set('v.layout',layout); |
| | | }, staticResource.token); |
| | | }else{ |
| | | |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(rv.Data && fields.hasOwnProperty(item.field) && fields[item.field].References && fields[item.field].References.map(m=>m.value).indexOf(rv.Data.pidType) > -1){ |
| | | item.value = pid; |
| | | } |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | item.value = agencyHospitalId; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | component.set('v.layout',layout); |
| | | } |
| | | |
| | | |
| | | component.set('v.fields',fields); |
| | | component.set('v.staticResource',staticResource); |
| | | component.set('v.staticResourceV2',staticResourceV2); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | |
| | | }else{ |
| | | |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | handleLoad: function(component, event, helper) { |
| | | console.log('recordEditForm handleSuccess') |
| | | component.set("v.showSpinner", false); |
| | | }, |
| | | saveClick : function(component, event, helper){ |
| | | |
| | | let staticResource = component.get('v.staticResource'); |
| | | //let staticResourceV2 = component.get('v.staticResourceV2'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | | |
| | | let isClone = component.get('v.isClone'); |
| | | let url = staticResource.newUrl; |
| | | //let urlV2 = staticResourceV2.newUrl; |
| | | let payloadPi = {}; |
| | | if (record_id && !isClone) { |
| | | url = staticResource.updateUrl; |
| | | //urlV2 = staticResourceV2.updateUrl; |
| | | payloadPi['dataId'] = component.get('v.record_data').AWS_Data_Id__c; |
| | | } |
| | | let layout = component.get('v.layout'); |
| | | |
| | | let pi_fields_map = component.get('v.pi_fields_map'); |
| | | |
| | | let hospitalId = ''; |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | hospitalId = item.value; |
| | | } |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | |
| | | payloadPi[pi_fields_map[item.field].AWS_Field_API__c] = item.value; |
| | | } |
| | | |
| | | if (item.behavior == "Required" && !item.value ) { |
| | | let fs = component.find("field"); |
| | | for(let fi in fs){ |
| | | let f = fs[fi]; |
| | | if(!f.get('v.value')){ |
| | | f.reset(); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | component.set("v.showSpinner", true); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : hospitalId |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | payloadPi['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | payloadPi['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | helper.AwsPost(url+'V2', [payloadPi], function(result){ |
| | | //如果返回是129表示重复了,报错 |
| | | if(result.status == '129'){ |
| | | helper.ShowToast({ |
| | | "message" : '该客户人员名字已存在,在'+hospitalName+'医院,请修改', |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | return |
| | | } |
| | | |
| | | let obj = result.object[0]; |
| | | let data = {}; |
| | | if(record_id && !isClone){ |
| | | data.Id = record_id; |
| | | }else{ |
| | | data.AWS_Data_Id__c = obj.dataId; |
| | | } |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | | for(let item of c.layoutItems){ |
| | | if(item.field && item.behavior != "Readonly"){ |
| | | if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | //data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | }else{ |
| | | data[item.field] = item.value; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | $A.getCallback(function(){ |
| | | helper.CallBackAction(component,'Save',{ |
| | | data : data, |
| | | transId : result.txId |
| | | },function(data){ |
| | | component.set("v.showSpinner", false); |
| | | if(data.getState() == "SUCCESS"){ |
| | | var rv = data.getReturnValue(); |
| | | console.log(rv); |
| | | var sfId = null; |
| | | if(rv.IsSuccess){ |
| | | sfId = rv.Data.recordId; |
| | | } |
| | | |
| | | helper.AwsPost(staticResource.transactionUrl,{ |
| | | txId: result.txId, |
| | | sfRecordId:sfId, |
| | | isSuccess: rv.IsSuccess ? 1 : 0 |
| | | },function(data){ |
| | | if(rv.IsSuccess){ |
| | | helper.ShowToast({ |
| | | "message" : "成功", |
| | | "type" : "success" |
| | | }); |
| | | helper.closeAgencyContact(component); |
| | | |
| | | // if (record_id && !isClone){ |
| | | |
| | | // helper.closeAgencyContact(component); |
| | | // //$A.get('e.force:refreshView').fire(); |
| | | // }else{ |
| | | // var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | // sObjectEvent.setParams({ |
| | | // "recordId": sfId |
| | | // }) |
| | | // sObjectEvent.fire(); |
| | | // } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : rv.Message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | },staticResource.token); |
| | | |
| | | |
| | | }else{ |
| | | |
| | | helper.ShowToast({ |
| | | "message" : "Init error", |
| | | "type" : "error" |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | })(); |
| | | |
| | | }, staticResource.token); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | component.set("v.showSpinner", false); |
| | | } |
| | | }); |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // helper.AwsPost(urlV2, [payloadPi], function(result){ |
| | | |
| | | // let obj = result.object[0]; |
| | | // let data = {}; |
| | | // if(record_id && !isClone){ |
| | | // data.Id = record_id; |
| | | // }else{ |
| | | // data.AWS_Data_Id__c = obj.dataId; |
| | | // } |
| | | // for(let s of layout){ |
| | | // for(let c of s.layoutColumns){ |
| | | // for(let item of c.layoutItems){ |
| | | // if(item.field && item.behavior != "Readonly"){ |
| | | // if(pi_fields_map.hasOwnProperty(item.field)){ |
| | | // data[item.field] = obj[pi_fields_map[item.field].AWS_Field_API__c]; |
| | | // data[pi_fields_map[item.field].SF_Field_Encrypted_API__c] = obj[pi_fields_map[item.field].AWS_Encrypted_Field_API__c]; |
| | | // }else{ |
| | | // data[item.field] = item.value; |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // $A.getCallback(function(){ |
| | | // helper.CallBackAction(component,'Save',{ |
| | | // data : data, |
| | | // transId : result.txId |
| | | // },function(data){ |
| | | // component.set("v.showSpinner", false); |
| | | // if(data.getState() == "SUCCESS"){ |
| | | // var rv = data.getReturnValue(); |
| | | // console.log(rv); |
| | | // var sfId = null; |
| | | // if(rv.IsSuccess){ |
| | | // sfId = rv.Data.recordId; |
| | | // } |
| | | |
| | | // helper.AwsPost(staticResource.transactionUrl,{ |
| | | // txId: result.txId, |
| | | // sfRecordId:sfId, |
| | | // isSuccess: rv.IsSuccess ? 1 : 0 |
| | | // },function(data){ |
| | | // if(rv.IsSuccess){ |
| | | // helper.ShowToast({ |
| | | // "message" : "成功", |
| | | // "type" : "success" |
| | | // }); |
| | | // helper.closeAgencyContact(component); |
| | | |
| | | // // if (record_id && !isClone){ |
| | | |
| | | // // helper.closeAgencyContact(component); |
| | | // // //$A.get('e.force:refreshView').fire(); |
| | | // // }else{ |
| | | // // var sObjectEvent = $A.get("e.force:navigateToSObject"); |
| | | // // sObjectEvent.setParams({ |
| | | // // "recordId": sfId |
| | | // // }) |
| | | // // sObjectEvent.fire(); |
| | | // // } |
| | | // }else{ |
| | | // helper.ShowToast({ |
| | | // "message" : rv.Message, |
| | | // "type" : "error" |
| | | // }); |
| | | // } |
| | | // },staticResource.token); |
| | | |
| | | |
| | | // }else{ |
| | | |
| | | // helper.ShowToast({ |
| | | // "message" : "Init error", |
| | | // "type" : "error" |
| | | // }); |
| | | |
| | | // } |
| | | // }); |
| | | // })(); |
| | | |
| | | // }, staticResource.token); |
| | | }, |
| | | cancelClick : function(component, event, helper){ |
| | | helper.closeAgencyContact(component); |
| | | }, |
| | | |
| | | scriptsLoaded : function(component, event, helper){} |
| | | }) |
| New file |
| | |
| | | ({ |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | | if(callback){ |
| | | action.setCallback(this,function(data){ |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | ShowToast : function(paras){ |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams(paras); |
| | | toastEvent.fire(); |
| | | }, |
| | | AwsPost : function(postURL, data ,callback,token){ |
| | | let payloadForNewPI = ''; |
| | | if(typeof(data) == 'string'){ |
| | | payloadForNewPI = data; |
| | | }else{ |
| | | payloadForNewPI = JSON.stringify(data); |
| | | } |
| | | |
| | | AWSService.post(postURL,payloadForNewPI,function(result) { |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | },token); |
| | | }, |
| | | AwsGet : function(url, data ,callback,token){ |
| | | |
| | | if(typeof(data) == 'string'){ |
| | | url += data; |
| | | }else{ |
| | | let i = 0; |
| | | for(let p in data){ |
| | | url += (i++) ? '&' : '?'; |
| | | url += p + '=' + data[p]; |
| | | } |
| | | } |
| | | |
| | | AWSService.get(url,function(result){ |
| | | //this.insertCalloutLog(this.insertModule,postURL,JSON.stringify(payloadForNewPI),JSON.stringify(result),this.successStatus); |
| | | if(callback) callback(result); |
| | | },token); |
| | | }, |
| | | closeAgencyContact : function(component){ |
| | | var cmpEvent = component.getEvent("NewAgencyContactEvent"); |
| | | cmpEvent.setParams({ |
| | | "showNewAgencyContact":false}); |
| | | cmpEvent.fire(); |
| | | } |
| | | }) |
| New file |
| | |
| | | ({ |
| | | |
| | | // Your renderer method overrides go here |
| | | |
| | | }) |
| | |
| | | <aura:attribute name="isClone" type="Boolean" default="False" /> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <<<<<<< HEAD |
| | | <aura:attribute name="isModalOpen" type="boolean" default="false" /> |
| | | <aura:attribute name="searchKeyWord" type="string" default="" /> |
| | | <aura:attribute name="contactAWSIds" type="List" /> |
| | |
| | | event="c:NewAgencyContactEvent" |
| | | action="{!c.closeAgencyContact}" |
| | | /> |
| | | ======= |
| | | <aura:attribute name="isModalOpen" type="boolean" default="false"/> |
| | | <aura:attribute name="searchKeyWord" type="string" default=""/> |
| | | <aura:attribute name="contactAWSIds" type="List"/> |
| | | <aura:attribute name="login" type="Boolean" default="false"/> |
| | | <aura:attribute name="show" type="Boolean" default="false"/> |
| | | <aura:attribute name="showNewAgencyContact" type="Boolean" default="false"/> |
| | | <aura:handler name="NewAgencyContactEvent" event="c:NewAgencyContactEvent" action="{!c.closeAgencyContact}"/> |
| | | <aura:attribute name="agencyHospitalId" type="String" default = ""/> |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | <div class="{! v.container_class}"> |
| | | <!-- header --> |
| | |
| | | <aura:if isTrue="{!v.showSpinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:if> |
| | | <<<<<<< HEAD |
| | | <lightning:recordEditForm objectApiName="Agency_Opportunity__c"> |
| | | <lightning:accordion |
| | | activeSectionName="{! v.section_names }" |
| | | allowMultipleSectionsOpen="true" |
| | | class="greyyyy" |
| | | > |
| | | ======= |
| | | <lightning:recordEditForm objectApiName="Agency_Opportunity__c" onload="{!c.handleLoad}"> |
| | | <lightning:accordion activeSectionName="{! v.section_names }" allowMultipleSectionsOpen="true" class="greyyyy" > |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:iteration items="{!v.layout}" var="section"> |
| | | <aura:if isTrue="{! section.editHeading }"> |
| | | <lightning:accordionSection |
| | |
| | | </lightning:layout> |
| | | <div id="QueryResult" style="margin-top: 20px"></div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | |
| | | <aura:if isTrue="{!v.showNewAgencyContact}"> |
| | | <section |
| | |
| | | </section> |
| | | <div class="slds-backdrop slds-backdrop_open"></div> |
| | | </aura:if> |
| | | ======= |
| | | |
| | | <!-- <aura:if isTrue="{!v.showNewAgencyContact}"> |
| | | <section role="dialog" tabindex="-1" aria-modal="true" aria-labelledby="modal-heading-01" class="slds-modal slds-fade-in-open" aura:id="NewAgencyContact" id="NewAgencyContact"> |
| | | <c:NewAgencyContact2 /> |
| | | </section> |
| | | </aura:if> --> |
| | | |
| | | <aura:if isTrue="{!v.showNewAgencyContact}"> |
| | | <section role="dialog" tabindex="-1" aria-modal="true" aria-labelledby="modal-heading-01" |
| | | class="slds-modal slds-fade-in-open" aura:id="NewAgencyContact" |
| | | id="NewAgencyContact" aria-describedby="modal-content-id-2" style="z-index: 9999;"> |
| | | <c:NewAgencyContact2 agencyHospitalId="{!v.agencyHospitalId}"/> |
| | | </section> |
| | | <div class="slds-backdrop2 slds-backdrop_open2"></div> |
| | | </aura:if> |
| | | |
| | | </div> |
| | | </section> |
| | | <div class="slds-backdrop slds-backdrop_open"></div> |
| | | |
| | | </aura:if> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </aura:component> |
| | |
| | | .THIS .slds-spinner_container { |
| | | position: revert; |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | .THIS .slds-backdrop2 { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba(0, 0, 0, 0.6); /* 遮罩层的半透明背景色 */ |
| | | } |
| | | .THIS .slds-backdrop_open2 { |
| | | z-index: 9003; /* 遮罩层的层级,需要确保比模态框的层级高 */ |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | type: 'error' |
| | | }); |
| | | } |
| | | <<<<<<< HEAD |
| | | } else { |
| | | component.set('v.showSpinner', false); |
| | | ======= |
| | | // component.set('v.fields',fields); |
| | | // component.set('v.staticResource',staticResource); |
| | | //component.set("v.showSpinner", false); |
| | | }else{ |
| | | component.set("v.showSpinner", false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | helper.ShowToast({ |
| | | message: 'Init error', |
| | | type: 'error' |
| | | }); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | ); |
| | | }, |
| | | saveClick: function (component, event, helper) { |
| | | ======= |
| | | }); |
| | | }, |
| | | handleLoad: function(component, event, helper) { |
| | | console.log('recordEditForm handleSuccess') |
| | | component.set("v.showSpinner", false); |
| | | }, |
| | | saveClick : function(component, event, helper){ |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | let staticResource = component.get('v.staticResource'); |
| | | let record_id = component.get('v.recordId'); |
| | | let record_type_id = component.get('v.recordTypeId'); |
| | |
| | | message: '请先选择经销商医院', |
| | | type: 'warning' |
| | | }); |
| | | <<<<<<< HEAD |
| | | return; |
| | | ======= |
| | | return |
| | | }else if(item.field == 'Agency_Hospital__c' && item.value){ |
| | | component.set('v.agencyHospitalId',item.value) |
| | | console.log('v.agencyHospitalId item.value = ' + item.value) |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | |
| | | let myTableDiv = document.getElementById('QueryResult'); |
| | | let table = document.createElement('TABLE'); |
| | | table.border = '1'; |
| | | <<<<<<< HEAD |
| | | table.id = 'table'; |
| | | table.setAttribute( |
| | | 'class', |
| | |
| | | let headerTR = document.createElement('TR'); |
| | | headerTR.setAttribute('class', 'slds-line-height_reset'); |
| | | let colsHeader = ['姓名', '医院', '医生区分(职务)', '分类']; |
| | | ======= |
| | | table.id = 'customTable'; |
| | | table.setAttribute('class','slds-table slds-table_cell-buffer slds-table_bordered'); |
| | | let tableBody = document.createElement('TBODY'); |
| | | table.appendChild(tableBody); |
| | | let headerTR = document.createElement('TR'); |
| | | headerTR.setAttribute('class','slds-line-height_reset'); |
| | | let colsHeader = [' ','姓名','医院', '医生区分(职务)','分类']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | tableBody.appendChild(headerTR); |
| | | for (let i = 0; i < colsHeader.length; i++) { |
| | | let td = document.createElement('TH'); |
| | |
| | | let tr = document.createElement('TR'); |
| | | tableBody.appendChild(tr); |
| | | let contactInfoTemp = contactInfoList[i]; |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | //再加一列选择button |
| | | debugger |
| | | let td = document.createElement('TD'); |
| | | td.width = '75'; |
| | | td.id = contactsInfo[contactInfoTemp.AWSDataId].Id; |
| | | console.log('contactInfoTemp = ' + JSON.stringify(contactInfoTemp)) |
| | | // 创建按钮元素 |
| | | var button = document.createElement('button'); |
| | | button.classList.add('slds-button','slds-button_neutral'); |
| | | button.id = contactInfoTemp.sfRecordId != null ? contactInfoTemp.sfRecordId : ''; |
| | | // 设置按钮的文本内容 |
| | | var buttonText = document.createTextNode('选择'); |
| | | button.appendChild(buttonText); |
| | | button.addEventListener("click", function (obj) { |
| | | that.redirectToParentPage(component, event, helper, obj); |
| | | }); |
| | | button.value = contactInfoTemp[cols[0]] != null ? contactInfoTemp[cols[0]] : '' |
| | | td.appendChild(button); |
| | | tr.appendChild(td); |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (let j = 0; j < cols.length; j++) { |
| | | let td = document.createElement('TD'); |
| | | td.width = '75'; |
| | |
| | | } |
| | | } else { |
| | | td.id = contactInfoTemp.sfRecordId; |
| | | <<<<<<< HEAD |
| | | } |
| | | td.appendChild( |
| | | document.createTextNode( |
| | |
| | | ); |
| | | }); |
| | | } |
| | | ======= |
| | | } |
| | | td.appendChild(document.createTextNode(contactInfoTemp[cols[j]]!=null?contactInfoTemp[cols[j]]:'')); |
| | | // if (cols[j] == 'Name') { |
| | | // td.addEventListener("click", function (obj) { |
| | | // that.redirectToParentPage(component, event, helper,obj); |
| | | // }); |
| | | // } |
| | | >>>>>>> LEXCommunityLiJun |
| | | tr.appendChild(td); |
| | | } |
| | | } |
| | | that.resetTable(); |
| | | myTableDiv.appendChild(table); |
| | | component.find('button').set('v.disabled', false); |
| | | }, |
| | | <<<<<<< HEAD |
| | | redirectToParentPage: function (component, event, helper, obj) { |
| | | let agencyContactName = obj.currentTarget.innerText; |
| | | ======= |
| | | redirectToParentPage : function(component, event, helper,obj){ |
| | | let agencyContactName = obj.currentTarget.value; |
| | | >>>>>>> LEXCommunityLiJun |
| | | let id = obj.currentTarget.id; |
| | | component.set('v.ac_name', agencyContactName); |
| | | let layout = component.get('v.layout'); |
| | |
| | | } |
| | | component.set('v.isModalOpen', false); |
| | | }, |
| | | <<<<<<< HEAD |
| | | resetTable: function () { |
| | | let queryResult = document.getElementById('QueryResult'); |
| | | let table = document.getElementsByTagName('table'); |
| | |
| | | for (var i = 1; i < table.length; i++) { |
| | | queryResult.removeChild(table[i]); |
| | | } |
| | | ======= |
| | | resetTable : function(){ |
| | | // let queryResult = document.getElementById('QueryResult'); |
| | | // let table = document.getElementById('customTable'); |
| | | // console.log('table:' + table); |
| | | // if(table.length > 1){ |
| | | // for(var i=1;i<table.length;i++){ |
| | | // queryResult.removeChild(table[i]) |
| | | // } |
| | | // } |
| | | let customTable = document.getElementById('customTable'); |
| | | if(customTable){ |
| | | customTable.parentNode.removeChild(customTable); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }, |
| | | preparePayloadForSearchAgencyContact: function (component, event, helper) { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | component.set('v.showSpinner',true); |
| | | let searchPayload = new Object(); |
| | | let searchAgencyContactName = component.get('v.searchKeyWord'); |
| | | searchPayload.dataIds = rv.Data; |
| | |
| | | agencyHospitalId: agencyHospitalId, |
| | | accountId: accountId |
| | | }); |
| | | <<<<<<< HEAD |
| | | searchAgencyContacts.setCallback( |
| | | this, |
| | | function (response) { |
| | |
| | | ]; |
| | | } |
| | | } |
| | | ======= |
| | | component.set('v.showSpinner',false); |
| | | return |
| | | } |
| | | for(var i=0;i<data.object.length;i++){ |
| | | if(data.object[i].dataId){ |
| | | 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; |
| | | contactInfo.pi = true; |
| | | awsDataIds.push(contactInfo.AWSDataId); |
| | | contactInfo.sfRecordId = ''; |
| | | contactInfoList.push(contactInfo); |
| | | } |
| | | } |
| | | //let AWSIdToSFIdMapValue = {}; |
| | | debugger |
| | | var searchAgencyContacts = component.get('c.searchAgencyContacts'); |
| | | searchAgencyContacts.setParams({ |
| | | "awsAgencyContactIds" : JSON.stringify(awsDataIds), |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | // 延迟执行一段代码 |
| | | setTimeout(function() { |
| | | // 需要延迟执行的代码 |
| | | // 创建一个鼠标点击事件 |
| | | var event = new MouseEvent('click', { |
| | | bubbles: true, |
| | | cancelable: true, |
| | | view: window |
| | | }); |
| | | |
| | | // 触发元素的点击事件 |
| | | var element = document.getElementById('NewAgencyContact'); |
| | | for(var i = 0;i<100;i++){ |
| | | element.dispatchEvent(event); |
| | | } |
| | | }, 1000); // 延迟 1000 毫秒(即 1 秒) |
| | | searchAgencyContacts.setCallback(that,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var rv = response.getReturnValue(); |
| | | if(rv.IsSuccess){ |
| | | let contactsInfo = ''; |
| | | if(rv.Data){ |
| | | contactsInfo = JSON.parse(rv.Data.replace(/("\;)/g,"\"")); |
| | | if(Object.keys(contactsInfo).length>0){ |
| | | for(let i=0;i<contactInfoList.length;i++){ |
| | | let contactFromSF = contactsInfo[contactInfoList[i]['AWSDataId']]; |
| | | if(contactFromSF){ |
| | | contactInfoList[i].sfRecordId = contactFromSF['Id']; |
| | | 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']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | |
| | | ); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ); |
| | | $A.enqueueAction(searchAgencyContacts); |
| | |
| | | }, |
| | | token |
| | | ); |
| | | ======= |
| | | that.refreshTable(component, event, helper,cols,contactInfoList,contactsInfo); |
| | | component.set('v.showSpinner',false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(searchAgencyContacts); |
| | | }else{ |
| | | component.set('v.showSpinner',false); |
| | | } |
| | | },token); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | <<<<<<< HEAD |
| | | <aura:component |
| | | controller="RetrospectiveWeeklyReportController" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens" |
| | |
| | | default="{sobjectType:'Ag |
| | | ency_Contact__c'}" |
| | | /> |
| | | ======= |
| | | <aura:component controller="RetrospectiveWeeklyReportController" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens" |
| | | access="global"> |
| | | <ltng:require styles="{!$Resource.multilineToastCSS}" /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}" /> |
| | | <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord" /> |
| | | <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}" /> |
| | | <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}" /> |
| | | <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Ag |
| | | ency_Contact__c'}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:attribute name="successMessage" type="String" /> |
| | | <aura:attribute name="etEng" type="String" /> |
| | | <aura:attribute name="errorMessage" type="String" /> |
| | |
| | | <aura:attribute name="docmap" type="Map" /> |
| | | <aura:attribute name="login" type="Boolean" default="false" /> |
| | | <aura:attribute name="loginEdit" type="Boolean" default="false" /> |
| | | <<<<<<< HEAD |
| | | <aura:attribute |
| | | name="modal_import_spinner" |
| | | type="Boolean" |
| | | default="false" |
| | | /> |
| | | ======= |
| | | <aura:attribute name="modal_import_spinner" type="Boolean" default="false" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:attribute name="loadOpp" type="Boolean" default="false" /> |
| | | <aura:attribute name="reportPageData" type="Map" /> |
| | | <aura:attribute name="selectbody" type="String" /> |
| | |
| | | <!-- 使用产品1(产品型号) --> |
| | | <aura:attribute name="UseProduct1" type="string" default="" /> |
| | | <aura:attribute name="UseProduct1s" type="string" default="" /> |
| | | <<<<<<< HEAD |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.UseProduct1}" |
| | | action="{!c.UseProduct1Change}" |
| | | /> |
| | | ======= |
| | | <aura:handler name="change" value="{!v.UseProduct1}" action="{!c.UseProduct1Change}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:attribute name="UseProduct1List" type="Map" /> |
| | | <aura:attribute name="UseProduct1Id" type="string" default="" /> |
| | | <!-- 使用产品2 --> |
| | | <aura:attribute name="UseProduct2" type="string" default="" /> |
| | | <aura:attribute name="UseProduct2s" type="string" default="" /> |
| | | <<<<<<< HEAD |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.UseProduct2}" |
| | | action="{!c.UseProduct2Change}" |
| | | /> |
| | | ======= |
| | | <aura:handler name="change" value="{!v.UseProduct2}" action="{!c.UseProduct2Change}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:attribute name="UseProduct2List" type="Map" /> |
| | | <aura:attribute name="UseProduct2Id" type="string" default="" /> |
| | | <!-- 使用产品3 --> |
| | | <aura:attribute name="UseProduct3" type="string" default="" /> |
| | | <aura:attribute name="UseProduct3s" type="string" default="" /> |
| | | <<<<<<< HEAD |
| | | <aura:handler |
| | | name="change" |
| | | value="{!v.UseProduct3}" |
| | | action="{!c.UseProduct3Change}" |
| | | /> |
| | | ======= |
| | | <aura:handler name="change" value="{!v.UseProduct3}" action="{!c.UseProduct3Change}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:attribute name="UseProduct3List" type="Map" /> |
| | | <aura:attribute name="UseProduct3Id" type="string" default="" /> |
| | | <!--SWAG-CF58C3 fy start --> |
| | |
| | | <aura:attribute name="allselectlistAgencyPerson" type="Map" /> |
| | | <!--SWAG-CF58C3 fy end --> |
| | | |
| | | <<<<<<< HEAD |
| | | <aura:attribute name="doctor_list" type="Map" /> |
| | | <!-- <aura:attribute name="doctor_title" type="String" /> --> |
| | | <aura:attribute name="opportunity_list" type="Map" /> |
| | |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | | ======= |
| | | |
| | | <aura:attribute name="doctor_list" type="Map" /> |
| | | <!-- <aura:attribute name="doctor_title" type="String" /> --> |
| | | <aura:attribute name="opportunity_list" type="Map" /> |
| | | <aura:attribute name="edit_copy_select_report_id" type="String" /> |
| | | <aura:attribute name="create_agency_report_id" type="String" /> |
| | | <aura:attribute name="reports" type="List" /> |
| | | <aura:attribute name="reports_now" type="List" /> |
| | | <aura:attribute name="reports_now_count" type="Integer" /> |
| | | <aura:attribute name="mode" type="String" /> |
| | | <aura:attribute name="select_report_data" type="Map" /> |
| | | <aura:attribute name="select_report_data_radio" type="Map" /> |
| | | <aura:attribute name="default_select_doctor_id" type="String" /> |
| | | <aura:attribute name="default_select_doctor_id2" type="String" /> |
| | | <aura:attribute name="default_select_opportunity_id" type="String" /> |
| | | <aura:attribute name="report_count" type="Integer" /> |
| | | <aura:attribute name="dialog_type" type="String" /> |
| | | <aura:attribute name="truthy" type="Boolean" default="false" /> |
| | | <aura:attribute name="list_message" type="String" default="搜索" /> |
| | | <aura:attribute name="confirm_status" type="Integer" default="0" /> |
| | | <aura:attribute name="modal_confirm_title" type="String" /> |
| | | <aura:attribute name="modal_confirm_text" type="String" /> |
| | | <!-- <aura:attribute name="new_falg" type="String" /> --> |
| | | <!-- fy --> |
| | | <aura:attribute name="UserProType" type="String" /> |
| | | <!-- 科室 --> |
| | | <aura:attribute name="opportunity_cfilter" type="String" /> |
| | | <aura:attribute name="update_select_report_data_id" type="String" default="" /> |
| | | <!-- 批量添加日报 start--> |
| | | <aura:attribute name="reports_date" type="List" /> |
| | | <aura:attribute name="TableContent" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TableContent2" type="String" description=" Show the Result class" /> |
| | | <aura:attribute name="TargetFileName" type="String" description="Name of the file" /> |
| | | <aura:attribute name="tableheaders" type="Object[]" /> |
| | | <aura:attribute name="fileContentData" type="String" /> |
| | | <aura:attribute name="filename" type="String" /> |
| | | <aura:attribute name="NumOfRecords" type="Integer" default="1000" /> |
| | | <aura:attribute name="showMain" type="Boolean" default="true" /> |
| | | <aura:attribute name="IsEventDefault" type="Boolean" default="true" /> |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | <aura:attribute name="errorData" type="Object" /> |
| | | <aura:attribute name="errorColumns" type="List" /> |
| | | <!-- show Error information --> |
| | | <aura:attribute name="showErrorInfo" type="Boolean" default="false" /> |
| | | <!-- end DTT-zhj 增加错误信息table 2023-05-16--> |
| | | |
| | | <aura:attribute name="PIConfig" type="Map" /> |
| | | |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | <!-- 批量添加日报 end--> |
| | | <!--ロード中...--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | |
| | | <div class="slds-spinner__dot-b"></div> |
| | | </div> |
| | | </div> --> |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-spinner_container" |
| | | id="spinner" |
| | | style="position: fixed; top: 123px" |
| | | > |
| | | ======= |
| | | <div class="slds-spinner_container" id="spinner" style="position: fixed;top:123px;"> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <div |
| | | role="status" |
| | | class="slds-spinner slds-spinner_medium slds-spinner_brand" |
| | |
| | | </aura:renderIf> |
| | | <div aura:id="report" id="report"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <<<<<<< HEAD |
| | | <div style="width: 150px"></div> |
| | | <div |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12 fontSize" |
| | |
| | | press="{!c.export_condition}" |
| | | class="buttonFontSize" |
| | | /> |
| | | ======= |
| | | <div style="width: 150px;"></div> |
| | | <div |
| | | class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12 fontSize"> |
| | | 周 |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 fontSize"> |
| | | <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}" /> |
| | | </div> |
| | | <!-- 代理店担当者 --> |
| | | <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12" |
| | | style="display: none;"> |
| | | {!v.fieldsmap.Person_In_Charge2__c} |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12" |
| | | style="display: none;"> |
| | | <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select" |
| | | change="{!c.select_agency_change}" /> |
| | | </div> |
| | | <div style="width: 100px;"> |
| | | </div> |
| | | <div class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12" |
| | | style="display: contents;"> |
| | | <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" class="buttonFontSize" /> |
| | | </div> |
| | | <div style="width: 400px;" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12"> |
| | | <ui:button aura:id="copy_button" label="复制" press="{!c.copy_button}" disabled="true" |
| | | class="buttonFontSize" /> |
| | | <ui:button aura:id="delete_button" label="删除" press="{!c.delete_button}" disabled="true" |
| | | class="buttonFontSize" /> |
| | | <ui:button aura:id="import" label="导入" press="{!c.import}" class="buttonFontSize" /> |
| | | <ui:button aura:id="export" label="导出" press="{!c.export_condition}" class="buttonFontSize" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <!-- <ui:button aura:id="returnbutton" label="返回" press="{!c.return_main_page}" /> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="report_list" class="report_list_area"> |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-table--edit_container slds-is-relative" |
| | | style="padding-left: 50px" |
| | |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.WorkMark__c}</span |
| | | > |
| | | ======= |
| | | <div class="slds-table--edit_container slds-is-relative" style="padding-left: 50px;"> |
| | | <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid" style="width:66.75rem;"> |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps fontSize" style="width:250px"> |
| | | <span class="slds-truncate" title="Name">日报编号</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Person_In_Charge2__c}</span> |
| | | <!-- {!v.fieldsmap.Person_In_Charge2__c} 担当--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize" style="width:250px"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | <!-- {!v.fieldsmap.Department_Cateogy__c} 科室--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name">拜访人</span> |
| | | <!-- {!v.fieldsmap.doctor2__c} 拜访人 --> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.DealerPersonnel__c}</span> |
| | | <!-- {!v.fieldsmap.visitor_title__c} 职位--> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps fontSize"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkMark__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <!-- {!v.fieldsmap.visitor_title__c} 职位--> |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <<<<<<< HEAD |
| | | <aura:iteration |
| | | items="{!v.reports}" |
| | | var="item" |
| | |
| | | class="slds-grid slds-grid--align-spread" |
| | | style="word-wrap: break-word" |
| | | > |
| | | ======= |
| | | <aura:iteration items="{!v.reports}" var="item" indexVar="index"> |
| | | <tr class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}" |
| | | change="{!c.change_report_radio}" /> |
| | | <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small" |
| | | alternativeText="edit" value="{!index}" onclick="{!c.edit_button}" /> |
| | | |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Person_In_Charge2__r.Name}">{!item.Person_In_Charge2__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td scope="row" tabindex="0" class="slds-cell-edit fontSize"> |
| | | <div class="slds-grid slds-grid--align-spread" style="word-wrap: break-word;"> |
| | | >>>>>>> LEXCommunityLiJun |
| | | {!item.Agency_Hospital__r.Name} |
| | | </div> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}" |
| | | >{!item.Department_Cateogy_text__c}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}">{!item.Department_Cateogy_text__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}" |
| | |
| | | <span class="decrypt" |
| | | >{!item.doctor2__r.awsdata.name}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.name}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.DealerPersonnel__r.Name}" |
| | | >{!item.DealerPersonnel__r.Name}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" |
| | | title="{!item.DealerPersonnel__r.Name}">{!item.DealerPersonnel__r.Name}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit fontSize"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.WorkMark__c}" |
| | |
| | | checked="{!item.WorkMark__c}" |
| | | disabled="true" |
| | | /> |
| | | ======= |
| | | <span class="slds-truncate" title="{!item.WorkMark__c}"> |
| | | <lightning:input type="checkbox" checked="{!item.WorkMark__c}" |
| | | disabled="true" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </span> |
| | | </td> |
| | |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.report_count > 0}"> |
| | | <aura:set attribute="else"> |
| | | <<<<<<< HEAD |
| | | <div class="no_data_area">{!v.list_message}</div> |
| | | ======= |
| | | <div class="no_data_area"> |
| | | {!v.list_message} |
| | | </div> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </aura:set> |
| | | </aura:renderIf> |
| | | </div> |
| | | <!-- 批量添加日报 start--> |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="modal_import" |
| | | role="dialog" |
| | |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.successMessage} |
| | | </h2> |
| | | ======= |
| | | <div aura:id="modal_import" role="dialog" tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <aura:renderIf isTrue="{!v.modal_import_spinner}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv01"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_success" role="alert"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="Success" iconName="utility:success" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.successMessage}</h2> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <<<<<<< HEAD |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | |
| | | columns="{! v.errorColumns }" |
| | | hideCheckboxColumn="true" |
| | | /> |
| | | ======= |
| | | <div class="slds-modal__container "> |
| | | <div class="slds-modal__header "> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">日报批量导入</h2> |
| | | <ui:button aura:id="close_button" label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1 buttonFontSize" |
| | | press="{!c.close_import}" /> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium fontSize"> |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | | <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" /> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large fontSize" |
| | | value="{!v.TableContent}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="保存" variant="brand" onclick="{!c.processFileContent}" |
| | | class="buttonFontSize" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.cancel}" class="buttonFontSize" /> |
| | | </div> |
| | | <aura:if isTrue="{!v.showErrorInfo}"> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="导出错误信息" variant="brand" onclick="{!c.exportErrorInfo}" /> |
| | | </div> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div style="height: 300px;overflow-x:scroll"> |
| | | <lightning:datatable keyField="id" data="{! v.errorData }" |
| | | columns="{! v.errorColumns }" hideCheckboxColumn="true" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | </aura:if> |
| | | </aura:set> |
| | | <<<<<<< HEAD |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | |
| | | variant="brand" |
| | | onclick="{!c.close_export}" |
| | | /> |
| | | ======= |
| | | |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <!-- 批量添加日报 end--> |
| | | |
| | | <!-- 批量导出日报 start--> |
| | | <div aura:id="modal_export" role="dialog" tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">日报批量导出</h2> |
| | | <ui:button aura:id="close_button" label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}" /> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"> |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日开始日期 |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " |
| | | aura:id="input-report-date1" /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日结束日期 |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " |
| | | aura:id="input-report-date2" /> |
| | | </div> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.select_repores_date}" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.close_export}" /> |
| | | </div> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}" /> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.exportDate}" /> |
| | | <lightning:button label="取消" variant="brand" onclick="{!c.close_export}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="modal_exportbg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.successMessage} |
| | | </h2> |
| | | ======= |
| | | <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <!-- 批量导出日报 end--> |
| | | <div aura:id="modal_window" role="dialog" tabindex="-1" |
| | | class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="successDiv"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_success" role="alert"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="Success" iconName="utility:success" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.successMessage}</h2> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-modal slds-fade-in-open slds-hide" |
| | | aura:id="errorDiv" |
| | |
| | | <h2 class="slds-text-heading_small"> |
| | | {!v.errorMessage} |
| | | </h2> |
| | | ======= |
| | | <div class="slds-modal slds-fade-in-open slds-hide" aura:id="errorDiv" style="z-index: 10001"> |
| | | <!-- <ui:inputText aura:id="articleURL" /> --> |
| | | <div class="demo-only" style="height: 8rem;"> |
| | | <div class="slds-notify_container slds-is-relative"> |
| | | <div class="slds-notify slds-notify_toast slds-theme_error" role="status"> |
| | | <div class=" slds-m-left_xx-large"> |
| | | <div |
| | | class="slds-notify__content slds-m-left_small slds-align_absolute-center slds-m-left_xx-large"> |
| | | <lightning:icon alternativeText="error" iconName="utility:error" size="small" |
| | | class="buttonColor slds-m-right_small" /> |
| | | <h2 class="slds-text-heading_small ">{!v.errorMessage}</h2> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-modal__content slds-grow slds-p-around--medium" |
| | | style="position: relative" |
| | |
| | | class="close_button slds-button slds-button--neutral slds-order--1" |
| | | press="{!c.toggle_report}" |
| | | /> |
| | | ======= |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium" style="position: relative;"> |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 100%;" /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium"> |
| | | 日报({!v.selected_date} {!v.selected_agency_person})</h2> |
| | | <ui:button aura:id="close_button" label="关闭" |
| | | class="close_button slds-button slds-button--neutral slds-order--1" |
| | | press="{!c.toggle_report}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | <div class="slds-box slds-theme--shade"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div |
| | | <<<<<<< HEAD |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | 活动日 |
| | |
| | | > |
| | | {!hospital.Hospital_Name_readonly__c} |
| | | </div> |
| | | ======= |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"> |
| | | 活动日 |
| | | <lightning:input type="date" value="{!v.data.Report_Date__c}" aura:id="input-report-date" |
| | | variant="label-hidden" /> |
| | | </div> |
| | | <!-- 医院 --> |
| | | <div aura:id="hospital_list" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | data-select="single"> |
| | | <!-- label="医院" --> |
| | | 医院 |
| | | <lightning:input aura:id="hospital_input_text" class="field" value="{!v.hospital}" |
| | | updateOn="keyup" variant="label-hidden" /> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | | <ul class="slds-lookup__list" role="listbox"> |
| | | <aura:iteration var="hospital" items="{!v.hospitalList}"> |
| | | <li role="presentation" onclick="{!c.selectHos}" |
| | | data-accName="{!hospital.Hospital_Name_readonly__c}" |
| | | data-accId="{!hospital.Hospital__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | {!hospital.Hospital_Name_readonly__c}</div> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </span> |
| | | </li> |
| | |
| | | </div> |
| | | <!-- 科室分类 --> |
| | | <div |
| | | <<<<<<< HEAD |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | {!v.fieldsmap.Department_Cateogy__c} |
| | |
| | | class="slds-select" |
| | | change="{!c.doctor_change}" |
| | | /> |
| | | ======= |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"> |
| | | {!v.fieldsmap.Department_Cateogy__c} |
| | | <!-- <ui:inputText aura:id="select_department" class="slds-select" |
| | | change="{!c.select_department}"/> --> |
| | | <lightning:input type="text" onchange="{!c.select_department}" aura:id="select_department" |
| | | variant="label-hidden" /> |
| | | </div> |
| | | <!-- 经销商人员 change="{!c.select_DealerPersonnel}" --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | style="width: 145px;"> |
| | | {!v.fieldsmap.DealerPersonnel__c} |
| | | <ui:inputSelect aura:id="select_DealerPersonnel" class="slds-select" /> |
| | | </div> |
| | | <!-- 活动区分 --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"> |
| | | {!v.fieldsmap.WorkRecord__c} |
| | | <ui:inputSelect aura:id="select_purpose_type" class="slds-select" |
| | | change="{!c.select_purpose_type}" /> |
| | | </div> |
| | | <!-- 拜访人 {!v.fieldsmap.doctor2__c}--> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | style="width: 145px;"> |
| | | 拜访人 |
| | | <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | <!-- <p hidden="hidden"> --> |
| | | |
| | | <div |
| | | <<<<<<< HEAD |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7" |
| | | > |
| | | <br /> |
| | |
| | | disabled="true" |
| | | aura:id="new_con" |
| | | /> |
| | | ======= |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-7 slds-large-size--1-of-7"> |
| | | <br /> |
| | | <ui:button label="新建" class="slds-button" press="{!c.createCon}" disabled="true" |
| | | aura:id="new_con" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | |
| | | <!-- </p> --> |
| | | <hr /> |
| | | <!-- 产品分类(第三分类) change="{!c.select_ProductClassification}" --> |
| | | <div |
| | | <<<<<<< HEAD |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | > |
| | | 产品分类(第三分类) |
| | |
| | | > |
| | | {!UseProduct1.Asset_Model_No__c} |
| | | </div> |
| | | ======= |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"> |
| | | 产品分类(第三分类) |
| | | <ui:inputSelect aura:id="select_ProductClassification" class="slds-select" |
| | | change="{!c.selectProductClassification}" /> |
| | | </div> |
| | | <!-- 使用产品1(产品型号) UseProduct1__c --> |
| | | <div aura:id="UseProduct1_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | data-select="single"> |
| | | <!-- label="使用产品1(产品型号)" --> |
| | | 使用产品1(产品型号) |
| | | <lightning:input aura:id="UseProduct1_TEXT" class="field" value="{!v.UseProduct1}" |
| | | updateOn="keyup" variant="label-hidden" /> |
| | | <div class="slds-lookup__menu" id="lookup-11"> |
| | | <ul class="slds-lookup__list" role="listbox" style="max-height:230px;"> |
| | | <aura:iteration var="UseProduct1" items="{!v.UseProduct1List}"> |
| | | <li role="presentation" onclick="{!c.seletUseProduct1Change}" |
| | | data-accid="{!UseProduct1.Id}" |
| | | data-accName="{!UseProduct1.Asset_Model_No__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | {!UseProduct1.Asset_Model_No__c}</div> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </span> |
| | | </li> |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 使用产品2 UseProduct2__c --> |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="UseProduct2_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | |
| | | > |
| | | {!UseProduct2.Asset_Model_No__c} |
| | | </div> |
| | | ======= |
| | | <div aura:id="UseProduct2_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | data-select="single"> |
| | | <!-- label="使用产品2" --> |
| | | 使用产品2 |
| | | <lightning:input aura:id="UseProduct2_TEXT" class="field" value="{!v.UseProduct2}" |
| | | updateOn="keyup" variant="label-hidden" /> |
| | | <div class="slds-lookup__menu" id="lookup-22"> |
| | | <ul class="slds-lookup__list" role="listbox" style="max-height:230px;"> |
| | | <aura:iteration var="UseProduct2" items="{!v.UseProduct2List}"> |
| | | <li role="presentation" onclick="{!c.seletUseProduct2Change}" |
| | | data-accid="{!UseProduct2.Id}" |
| | | data-accName="{!UseProduct2.Asset_Model_No__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | {!UseProduct2.Asset_Model_No__c}</div> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </span> |
| | | </li> |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 使用产品3 UseProduct3__c --> |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="UseProduct3_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | |
| | | > |
| | | {!UseProduct3.Asset_Model_No__c} |
| | | </div> |
| | | ======= |
| | | <div aura:id="UseProduct3_List" |
| | | class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | data-select="single"> |
| | | <!-- label="使用产品3" --> |
| | | 使用产品3 |
| | | <lightning:input aura:id="UseProduct3_TEXT" class="field" value="{!v.UseProduct3}" |
| | | updateOn="keyup" variant="label-hidden" /> |
| | | <div class="slds-lookup__menu" id="lookup-33"> |
| | | <ul class="slds-lookup__list" role="listbox" style="max-height:230px;"> |
| | | <aura:iteration var="UseProduct3" items="{!v.UseProduct3List}"> |
| | | <li role="presentation" onclick="{!c.seletUseProduct3Change}" |
| | | data-accid="{!UseProduct3.Id}" |
| | | data-accName="{!UseProduct3.Asset_Model_No__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" |
| | | role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text"> |
| | | {!UseProduct3.Asset_Model_No__c}</div> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </span> |
| | | </li> |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 效果/进度 EffectProgress__c--> |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="product_category_select1" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | |
| | | aura:id="select_EffectProgress" |
| | | class="slds-select" |
| | | /> |
| | | ======= |
| | | <div aura:id="product_category_select1" |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"> |
| | | {!v.fieldsmap.EffectProgress__c} |
| | | <ui:inputSelect aura:id="select_EffectProgress" class="slds-select" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | <hr /> |
| | | <!-- 产品1同类耗材科室月使用量 ConsumptionOfConsumables__c--> |
| | | <div |
| | | <<<<<<< HEAD |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5" |
| | | > |
| | | {!v.fieldsmap.ConsumptionOfConsumables__c} |
| | |
| | | value="{!v.oppdata.Close_Forecasted_Date__c}" |
| | | class="" |
| | | /> |
| | | ======= |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5"> |
| | | {!v.fieldsmap.ConsumptionOfConsumables__c} |
| | | <!-- <ui:inputText aura:id="select_ConsumptionOfConsumables" class="slds-select" |
| | | change="{!c.select_ConsumptionOfConsumables}" /> --> |
| | | <lightning:input type="text" onchange="{!c.select_ConsumptionOfConsumables}" |
| | | aura:id="select_ConsumptionOfConsumables" variant="label-hidden" /> |
| | | </div> |
| | | <!-- 术士分类 WarlockClassification__c --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.WarlockClassification__c} |
| | | <ui:inputSelect aura:id="select_OtherBrandConsumables" class="slds-select" /> |
| | | </div> |
| | | <!-- 已采用其他品牌 ProductCcategory__c --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.ProductCcategory__c} |
| | | <ui:inputSelect aura:id="select_ProductCcategory" class="slds-select" |
| | | change="{!c.selectpurposetype}" /> |
| | | </div> |
| | | <!-- 其他品牌产品类别 --> |
| | | <div aura:id="result" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.productCategories__c} |
| | | <ui:inputSelect aura:id="select_productCategories" class="slds-select" /> |
| | | </div> |
| | | <!-- 产品用量 warlocksNumber__c --> |
| | | <div |
| | | class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> |
| | | {!v.fieldsmap.warlocksNumber__c} |
| | | <!-- <ui:inputText aura:id="select_warlocksNumber" class="slds-select" |
| | | change="{!c.select_warlocksNumber}" /> --> |
| | | <lightning:input type="text" onchange="{!c.select_warlocksNumber}" |
| | | aura:id="select_warlocksNumber" variant="label-hidden" /> |
| | | </div> |
| | | <!-- 支援需求 WorkMark__c--> |
| | | <div style="padding-left: 12px;"> |
| | | {!v.fieldsmap.WorkMark__c} |
| | | <lightning:input type="checkbox" aura:id="select_WorkMark" /> |
| | | </div> |
| | | <div aura:id="input-opportunity-stage" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.StageName__c} |
| | | <ui:inputSelect aura:id="select_stageName" class="slds-select" /> |
| | | </div> |
| | | <div aura:id="input-opportunity-amount1" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.Amount__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 医院采购预算(不含税,元)--> |
| | | <lightning:inputField value="{!v.oppdata.Amount__c}" class="" /> |
| | | |
| | | </div> |
| | | <div aura:id="input-opportunity-amount2" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.OCMSale_Price__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 订货金额(不含税,元) --> |
| | | <lightning:inputField value="{!v.oppdata.OCMSale_Price__c}" class="" /> |
| | | </div> |
| | | <div aura:id="input-opportunity-date" |
| | | class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12"> |
| | | {!v.fieldsmap.Close_Forecasted_Date__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> 预测与OCSM签约日 --> |
| | | <lightning:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class="" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | <hr /> |
| | | </div> |
| | | </div> |
| | | <div class="save_button_area"> |
| | | <<<<<<< HEAD |
| | | <ui:button |
| | | aura:id="save_button" |
| | | label="保存并新建" |
| | |
| | | title="Name" |
| | | >{!v.fieldsmap.WorkRecord__c}</span |
| | | > |
| | | ======= |
| | | <ui:button aura:id="save_button" label="保存并新建" |
| | | class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}" /> |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.reports_now_count > 0}"> |
| | | <div class="mt40 slds-box slds-theme--shade"> |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <table |
| | | class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" |
| | | role="grid"> |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name"></span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" |
| | | title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span> |
| | | <!-- 客户人员 --> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" |
| | | title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.WorkRecord__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <<<<<<< HEAD |
| | | <aura:iteration |
| | | items="{!v.reports_now}" |
| | | var="item" |
| | |
| | | title="{!item.WorkRecord__c}" |
| | | >{!item.WorkRecord__c}</span |
| | | > |
| | | ======= |
| | | <aura:iteration items="{!v.reports_now}" var="item" indexVar="index"> |
| | | <tr aura:id="modal_data_list_tr" class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}">{!item.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.Department_Cateogy_text__c}">{!item.Department_Cateogy_text__c}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}">{!item.doctor2__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.visitor_title__c}">{!item.visitor_title__c}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" |
| | | title="{!item.WorkRecord__c}">{!item.WorkRecord__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </td> |
| | | </tr> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="modal_bg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | |
| | | <h2 id="header43" class="slds-text-heading--medium"> |
| | | {!v.modal_confirm_title} |
| | | </h2> |
| | | ======= |
| | | |
| | | |
| | | <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | |
| | | <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43" |
| | | class="disp_none slds-modal slds-fade-in-open"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <p>{!v.modal_confirm_text}</p> |
| | | </div> |
| | | <div class="slds-modal__footer"> |
| | | <<<<<<< HEAD |
| | | <ui:button |
| | | label="是" |
| | | class="slds-button slds-button--brand" |
| | |
| | | fieldName="Doctor_Division1__c" |
| | | aura:id="newOpportunityField" |
| | | /> |
| | | ======= |
| | | <ui:button label="是" class="slds-button slds-button--brand" press="{!c.yes_button}" /> |
| | | <ui:button label="否" class="slds-button slds-button--neutral" press="{!c.no_button}" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | |
| | | <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest" |
| | | class="disp_none slds-modal slds-fade-in-open"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headertest" class="slds-text-heading--medium">新建.拜访人</h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c" |
| | | onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}"> |
| | | <lightning:messages aura:id="OppMessage" /> |
| | | <!-- onload="{!c.showRequiredFields}" --> |
| | | <aura:renderIf isTrue="{!v.truthy}"> |
| | | <lightning:inputField fieldName="Name" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </aura:renderIf> |
| | | <br /> |
| | | <br /> |
| | |
| | | <br /> |
| | | <br /> |
| | | <div class="save_button_area"> |
| | | <<<<<<< HEAD |
| | | <lightning:button |
| | | class="slds-m-top_small" |
| | | type="button" |
| | |
| | | label="保存" |
| | | onclick="{!c.handleSubmit}" |
| | | /> |
| | | ======= |
| | | <lightning:button class="slds-m-top_small" type="button" label="取消" |
| | | onclick="{!c.createCancel}" /> |
| | | <lightning:button class="slds-m-top_small" type="button" label="保存" |
| | | onclick="{!c.handleSubmit}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </lightning:recordEditForm> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | </aura:component> |
| | | ======= |
| | | |
| | | |
| | | </aura:component> |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | |
| | | .THIS .no_data_area { |
| | | text-align: center; |
| | | <<<<<<< HEAD |
| | | margin: 0.5em 0; |
| | | ======= |
| | | margin: .5em 0; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | |
| | | .THIS.report_list_area { |
| | |
| | | } |
| | | |
| | | .THIS .customRequired:before { |
| | | <<<<<<< HEAD |
| | | content: '*'; |
| | | ======= |
| | | content: "*"; |
| | | >>>>>>> LEXCommunityLiJun |
| | | margin: 0 0.125rem 0 0.125rem; |
| | | color: rgb(194, 57, 52); |
| | | float: left; |
| | |
| | | .THIS td { |
| | | white-space: normal; |
| | | overflow-wrap: break-word; |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | }, |
| | | |
| | | showRequiredFields: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | $A.util.removeClass(component.find('newOpportunityField'), 'none'); |
| | | $A.util.removeClass(component.find('newOpportunityField'), 'none'); |
| | | ======= |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | handleSuccess: function (component, event, helper) { |
| | |
| | | handleSubmit: function (component, event, helper) { |
| | | event.preventDefault(); // stop form submission |
| | | var showValidationError = false; |
| | | <<<<<<< HEAD |
| | | var fields = component.find('newOpportunityField'); |
| | | var vaildationFailReason = ''; |
| | | let agencyReport = Object.create(null); |
| | |
| | | } |
| | | } |
| | | ); |
| | | ======= |
| | | var fields = component.find("newOpportunityField"); |
| | | var vaildationFailReason = ''; |
| | | let agencyReport = Object.create(null); |
| | | fields.forEach(function (field) { |
| | | if (field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))) { |
| | | showValidationError = true; |
| | | vaildationFailReason = "分类不能为空!"; |
| | | } else if (field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))) { |
| | | showValidationError = true; |
| | | if (vaildationFailReason != '') { |
| | | vaildationFailReason += "医生区分(职务)不能为空!"; |
| | | } else { |
| | | vaildationFailReason = "医生区分(职务)不能为空!"; |
| | | } |
| | | |
| | | } |
| | | //SWAG-CF58C3 fy start |
| | | if (field.get("v.fieldName") === 'Name') { |
| | | agencyReport['name'] = field.get("v.value"); |
| | | } else if (field.get("v.fieldName") === 'Type__c') { |
| | | agencyReport['type'] = field.get("v.value"); |
| | | } else if (field.get("v.fieldName") === 'Doctor_Division1__c') { |
| | | agencyReport['doctorDivision1'] = field.get("v.value"); |
| | | } |
| | | //SWAG-CF58C3 fy end |
| | | }); |
| | | if (!showValidationError) { |
| | | //SWAG-CF58C3 fy start |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component, 'searchAgencyDataId', { |
| | | hospitalId: agencyHospitalid |
| | | }, function (data) { |
| | | if (data.getState() == "SUCCESS") { |
| | | var data = data.getReturnValue(); |
| | | if (data.IsSuccess == true) { |
| | | let agencyContactIds = '' |
| | | if (data.Message == '' && data.Data && data.Data.length > 0) { |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for (var i = 0; i < data.Data.length; i++) { |
| | | if (data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ',' + data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | } else { |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var requestData = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set('v.login', true); |
| | | helper.insert_agencycontact(component, token, newUrl, requestData, agencyHospitalid, helper, hospitalName); |
| | | } else { |
| | | helper.ShowToast({ |
| | | "message": data.message, |
| | | "type": "error" |
| | | }); |
| | | } |
| | | } else { |
| | | helper.ShowToast({ |
| | | "message": 'searchAgency失败', |
| | | "type": "error" |
| | | }); |
| | | } |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // var arr = new Array(); |
| | | // arr.push(agencyReport); |
| | |
| | | // var newUrl = component.get('v.AWSinsert'); |
| | | // component.set('v.login',true); |
| | | // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | <<<<<<< HEAD |
| | | //SWAG-CF58C3 fy end |
| | | ======= |
| | | //SWAG-CF58C3 fy end |
| | | >>>>>>> LEXCommunityLiJun |
| | | // helper.newlyBuild(component, event, helper); |
| | | } else { |
| | | component.find('OppMessage').setError(vaildationFailReason); |
| | |
| | | |
| | | yes_button: function (component, event, helper) { |
| | | component.set('v.confirm_status', 1); |
| | | <<<<<<< HEAD |
| | | helper.close_confirm( |
| | | component, |
| | | component.get('v.modal_confirm_title'), |
| | | component.get('v.modal_confirm_text') |
| | | ); |
| | | ======= |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | no_button: function (component, event, helper) { |
| | | component.set('v.confirm_status', 2); |
| | | <<<<<<< HEAD |
| | | helper.close_confirm( |
| | | component, |
| | | component.get('v.modal_confirm_title'), |
| | | component.get('v.modal_confirm_text') |
| | | ); |
| | | ======= |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | toggle_report: function (component, event, helper) { |
| | |
| | | }, |
| | | |
| | | select_agency_change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | debugger; |
| | | ======= |
| | | debugger |
| | | >>>>>>> LEXCommunityLiJun |
| | | helper.select_agency_change(component, event, helper); |
| | | }, |
| | | |
| | | hosChange: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var hospital_name = event.getParam('value'); |
| | | var hospital_nameld = component.get('v.UseProduct1s'); |
| | | ======= |
| | | var hospital_name = event.getParam("value"); |
| | | var hospital_nameld = component.get("v.UseProduct1s"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (hospital_name.match(/(\S+\s)+/)) { |
| | | if (hospital_nameld != hospital_name) { |
| | | helper.searchHos(component, event, helper); |
| | |
| | | }, |
| | | //使用产品1 |
| | | UseProduct1Change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var UseProduct1Name = event.getParam('value'); |
| | | var UseProduct1Nameold = component.get('v.UseProduct1s'); |
| | | debugger; |
| | | ======= |
| | | var UseProduct1Name = event.getParam("value"); |
| | | var UseProduct1Nameold = component.get("v.UseProduct1s"); |
| | | debugger |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (UseProduct1Name.match(/(\S+\s)+/)) { |
| | | if (UseProduct1Name != UseProduct1Nameold) { |
| | | helper.searchUseProduct1(component, event, helper); |
| | |
| | | }, |
| | | //使用产品2 |
| | | UseProduct2Change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var UseProduct2Name = event.getParam('value'); |
| | | var UseProduct2Nameold = component.get('v.UseProduct2s'); |
| | | ======= |
| | | var UseProduct2Name = event.getParam("value"); |
| | | var UseProduct2Nameold = component.get("v.UseProduct2s"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (UseProduct2Name.match(/(\S+\s)+/)) { |
| | | if (UseProduct2Name != UseProduct2Nameold) { |
| | | helper.searchUseProduct2(component, event, helper); |
| | |
| | | }, |
| | | //使用产品3 |
| | | UseProduct3Change: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var UseProduct3Name = event.getParam('value'); |
| | | var UseProduct3Nameold = component.get('v.UseProduct3s'); |
| | | ======= |
| | | var UseProduct3Name = event.getParam("value"); |
| | | var UseProduct3Nameold = component.get("v.UseProduct3s"); |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (UseProduct3Name.match(/(\S+\s)+/)) { |
| | | if (UseProduct3Name != UseProduct3Nameold) { |
| | | helper.searchUseProduct3(component, event, helper); |
| | |
| | | helper.seletUseProduct3Change(component, event, helper); |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | select_department: function (component, event, helper) { |
| | | helper.setOpportunity_cfilter(component); |
| | | }, |
| | |
| | | helper.readFile(component, helper, files[0]); |
| | | }, |
| | | CreateRecord: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var files = event.getSource().get('v.files'); |
| | | helper.readFile(component, helper, files[0]); |
| | | component.set('v.showErrorInfo', false); |
| | | ======= |
| | | var files = event.getSource().get("v.files"); |
| | | helper.readFile(component, helper, files[0]); |
| | | component.set("v.showErrorInfo", false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | processFileContent: function (component, event, helper) { |
| | | helper.saveRecords(component, event, helper); |
| | | <<<<<<< HEAD |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | cancel: function (component, event, helper) { |
| | | component.set('v.showMain', true); |
| | | ======= |
| | | component.set("v.showErrorInfo", false); |
| | | }, |
| | | |
| | | cancel: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | |
| | | import: function (component, event, helper) { |
| | | helper.showImport(component); |
| | | }, |
| | | exportDate: function (component, event, helper) { |
| | | <<<<<<< HEAD |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('导出数据' + stockData); |
| | | var csv = helper.convertArrayOfObjectsToCSV(component, stockData); |
| | |
| | | hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv] |
| | | document.body.appendChild(hiddenElement); // Required for FireFox browser |
| | | hiddenElement.click(); // using click() js function to download csv file |
| | | ======= |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log('导出数据' + stockData); |
| | | var csv = helper.convertArrayOfObjectsToCSV(component, stockData); |
| | | if (csv == null) { return; } |
| | | |
| | | var universalBOM = "\uFEFF"; |
| | | var hiddenElement = document.createElement('a'); |
| | | hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv); |
| | | hiddenElement.target = '_self'; // |
| | | hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv] |
| | | document.body.appendChild(hiddenElement); // Required for FireFox browser |
| | | hiddenElement.click(); // using click() js function to download csv file |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | export_condition: function (component, event, helper) { |
| | | helper.showExport(component); |
| | |
| | | }, |
| | | export: function (component, event, helper) { |
| | | console.log('进入export'); |
| | | <<<<<<< HEAD |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('查出的数据' + stockData); |
| | | }, |
| | |
| | | }, |
| | | close_export: function (component, event, helper) { |
| | | component.set('v.showMain', true); |
| | | ======= |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log('查出的数据' + stockData); |
| | | }, |
| | | close_import: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | helper.close_import(component); |
| | | }, |
| | | close_export: function (component, event, helper) { |
| | | component.set("v.showMain", true); |
| | | >>>>>>> LEXCommunityLiJun |
| | | helper.close_export(component); |
| | | }, |
| | | select_ConsumptionOfConsumables: function (component, event, helper) { |
| | |
| | | var errorDiv01 = component.find('errorDiv01'); |
| | | $A.util.addClass(errorDiv01, 'slds-hide'); |
| | | } |
| | | <<<<<<< HEAD |
| | | }); |
| | | ======= |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | <<<<<<< HEAD |
| | | <aura:component |
| | | controller="WeeklyReportCmp" |
| | | implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" |
| | |
| | | <aura:attribute name="report_count" type="Integer" /> |
| | | <aura:attribute name="dialog_type" type="String" /> |
| | | <aura:attribute name="truthy" type="Boolean" default="false" /> |
| | | ======= |
| | | <aura:component controller="WeeklyReportCmp" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction,forceCommunity:availableForAllPageTypes" access="global" > |
| | | <ltng:require styles="{!$Resource.multilineToastCSS}" /> |
| | | <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> |
| | | <aura:handler event="c:strike_evt" action="{!c.createAopp}" name="strike_evt_addNewRecord"/> |
| | | <aura:attribute name="data" type="Agency_Report__c" default="{sobjectType:'Agency_Report__c'}"/> |
| | | <aura:attribute name="oppdata" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}"/> |
| | | <aura:attribute name="acondata" type="Agency_Contact__c" default="{sobjectType:'Agency_Contact__c'}"/> |
| | | <!-- <aura:attribute name="oppdata_old" type="Agency_Opportunity__c" default="{sobjectType:'Agency_Opportunity__c'}"/> --> |
| | | <aura:attribute name="Close_Forecasted_Date__c_o" type="Date"/> |
| | | <aura:attribute name="Amount__c_o" type="String"/> |
| | | <aura:attribute name="OCMSale_Price__c_o" type="String"/> |
| | | <aura:attribute name="StageName__c_o" type="String"/> |
| | | <aura:attribute name="fieldsmap" type="Map"/> |
| | | <aura:attribute name="alldata" type="List"/> |
| | | <aura:attribute name="allselectlist" type="Map"/> |
| | | <aura:attribute name="doclist" type="List"/> |
| | | <aura:attribute name="docmap" type="Map"/> |
| | | <aura:attribute name="login" type="Boolean" default="false"/> |
| | | <aura:attribute name="loginEdit" type="Boolean" default="false" /> |
| | | <aura:attribute name="loadOpp" type="Boolean" default="false"/> |
| | | <aura:attribute name="reportPageData" type="Map"/> |
| | | <aura:attribute name="selectbody" type="String"/> |
| | | <aura:attribute name="report_date_list" type="Map"/> |
| | | <aura:attribute name="selected_date" type="String"/> |
| | | <aura:attribute name="selected_agency_person" type="String"/> |
| | | <aura:attribute name="agency_report_header" type="String"/> |
| | | <aura:attribute name="agency_report_header_id" type="String"/> |
| | | <aura:attribute name="result" type="String" default=""/> |
| | | <aura:attribute name="hospital" type="string" default=""/> |
| | | <aura:attribute name="hospitalId" type="string" default=""/> |
| | | <aura:attribute name="hospitalLinkId" type="string" default=""/> |
| | | <aura:handler name="change" value="{!v.hospital}" action="{!c.hosChange}"/> |
| | | <aura:attribute name="hospitalList" type="Map" /> |
| | | <aura:attribute name="doctor_list" type="Map"/> |
| | | <aura:attribute name="doctor_title" type="String"/> |
| | | <aura:attribute name="opportunity_list" type="Map"/> |
| | | <aura:handler name="change" value="{!v.data.Opportunity__c}" action="{!c.opportunityChange}"/> |
| | | <aura:attribute name="edit_copy_select_report_id" type="String"/> |
| | | <aura:attribute name="create_agency_report_id" type="String"/> |
| | | <aura:attribute name="reports" type="List"/> |
| | | <aura:attribute name="reports_now" type="List"/> |
| | | <aura:attribute name="reports_now_count" type="Integer"/> |
| | | <aura:attribute name="mode" type="String"/> |
| | | <aura:attribute name="select_report_data" type="Map"/> |
| | | <aura:attribute name="select_report_data_radio" type="Map"/> |
| | | <aura:attribute name="default_select_doctor_id" type="String"/> |
| | | <aura:attribute name="default_select_opportunity_id" type="String"/> |
| | | <aura:attribute name="report_count" type="Integer"/> |
| | | <aura:attribute name="dialog_type" type="String"/> |
| | | <aura:attribute name="truthy" type="Boolean" default="false"/> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <aura:attribute name="list_message" type="String" default="搜索" /> |
| | | <aura:attribute name="confirm_status" type="Integer" default="0" /> |
| | | <aura:attribute name="modal_confirm_title" type="String" /> |
| | |
| | | <aura:handler name="change" value="{!v.data.Product_Category2__c}" action="{!c.productcategoryChange2}"/> |
| | | <aura:handler name="change" value="{!v.data.Product_Category3__c}" action="{!c.productcategoryChange3}"/> --> |
| | | <!-- <aura:handler name="change" value="{!v.oppdata.StageName__c}" action="{!c.stageNameChange}"/> --> |
| | | <<<<<<< HEAD |
| | | <aura:attribute |
| | | name="update_select_report_data_id" |
| | | type="String" |
| | | default="" |
| | | /> |
| | | ======= |
| | | <aura:attribute name="update_select_report_data_id" type="String" default=""/> |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | <!-- 批量添加周报 start--> |
| | | <aura:attribute name="reports_date" type="List" /> |
| | | <!-- <aura:attribute name="reports_date1" type="Date" /> |
| | | <aura:attribute name="reports_date2" type="Date" /> --> |
| | | <<<<<<< HEAD |
| | | <aura:attribute |
| | | name="TableContent" |
| | | type="String" |
| | |
| | | <aura:attribute name="awsurl" type="Map" /> |
| | | <aura:attribute name="contactawsurl" type="Map" /> |
| | | <aura:attribute name="allselectlistAgencyPerson" type="Map" /> |
| | | ======= |
| | | <aura:attribute name="TableContent" type="String" description=" Show the Result class"/> |
| | | <aura:attribute name="TableContent2" type="String" description=" Show the Result class"/> |
| | | <aura:attribute name="TargetFileName" type="String" description="Name of the file"/> |
| | | <aura:attribute name="tableheaders" type="Object[]" /> |
| | | <aura:attribute name="fileContentData" type="String"/> |
| | | <aura:attribute name="filename" type="String"/> |
| | | <!-- It will display 100 records . Change for your requirement--> |
| | | <aura:attribute name="NumOfRecords" type="Integer" default="1000"/> |
| | | <aura:attribute name="showMain" type="Boolean" default="true"/> |
| | | <!-- PIPL update Yin Mingjie 21/02/2022 start --> |
| | | <aura:attribute name="AWStoken" type="String"/> |
| | | <aura:attribute name="AWSsearch" type="String"/> |
| | | <aura:attribute name="AWSinsert" type="String"/> |
| | | <aura:attribute name="AWStransactionURL" type="String"/> |
| | | <aura:attribute name="AWSDoctor2Map" type="String"/> |
| | | <aura:attribute name="awsurl" type="Map"/> |
| | | <aura:attribute name="contactawsurl" type="Map"/> |
| | | <aura:attribute name="allselectlistAgencyPerson" type="Map"/> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <!-- PIPL update Yin Mingjie 21/02/2022 end --> |
| | | |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | |
| | | <!-- 批量添加周报 end--> |
| | | <ltng:require scripts="{! $Resource.AWSService+'/AWSService.js' }" /> |
| | | <ltng:require scripts="{! $Resource.jquery183minjs }" /> |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | <!--ロード中...--> |
| | | <aura:renderIf isTrue="{!v.login}"> |
| | | <aura:renderIf isTrue="{!!v.loginEdit}"> |
| | | <!-- add by Deloitte-Link 2023-6-19 --> |
| | | <div class="weeklyReportSpinner"> |
| | | <div class="slds-spinner_container"> |
| | | <<<<<<< HEAD |
| | | <div |
| | | class="slds-spinner--brand slds-spinner slds-spinner--medium" |
| | | role="alert" |
| | | > |
| | | ======= |
| | | <div class="slds-spinner--brand slds-spinner slds-spinner--medium" role="alert"> |
| | | >>>>>>> LEXCommunityLiJun |
| | | <span id="aa" class="slds-assistive-text">Loading</span> |
| | | <div class="slds-spinner__dot-a"></div> |
| | | <div class="slds-spinner__dot-b"></div> |
| | |
| | | </div> |
| | | </aura:renderIf> |
| | | </aura:renderIf> |
| | | <<<<<<< HEAD |
| | | |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | |
| | | <span class="slds-truncate" title="Name" |
| | | >{!v.fieldsmap.Purpose_Type__c}</span |
| | | > |
| | | ======= |
| | | |
| | | <div aura:id="report" id="report" class="contents_wrapper"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded"> |
| | | <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"> |
| | | 周 |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <ui:inputSelect aura:id="select_date" class="slds-select" change="{!c.select_date_change}"/> |
| | | </div> |
| | | |
| | | <!-- 代理店担当者 --> |
| | | <div class="tr mt5 slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"> |
| | | {!v.fieldsmap.Person_In_Charge2__c} |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <ui:inputSelect aura:id="select_agency_person" class="slds-select agency_person_select" change="{!c.select_agency_change}"/> |
| | | </div> |
| | | <div class="tr slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-12 slds-large-size--1-of-12"> |
| | | <ui:button aura:id="new_button" label="新建" press="{!c.new_report}" disabled="true"/> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> |
| | | <ui:button aura:id="copy_button" label="复制" press="{!c.copy_button}" disabled="true"/> |
| | | <!-- <ui:button aura:id="import" label="导入" press="{!c.import}" /> --> |
| | | <ui:button aura:id="import" label="导入" press="{!c.import}" /> |
| | | |
| | | <!-- <input type="file" class="file" aura:id="file" onchange="{!c.CreateRecord}" style="position:absolute;filter:alpha(opacity=0);" size="1" hidden="true" /> --> |
| | | <!-- <ui:button aura:id="import" label="导出" press="{!c.export}"/> --> |
| | | <ui:button aura:id="export" label="导出" press="{!c.export_condition}"/> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div aura:id="report_list" class="report_list_area" > |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" role="grid" style="width:66.75rem;"> |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps" style="width: 250px;font-size: 13px;"> |
| | | <span class="slds-truncate" title="Name">周报编号</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Person_In_Charge2__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 250px;font-size: 13px;"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;"> |
| | | <!-- PIPL update Yin Mingjie 21/02/2022 start |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__r}</span> |
| | | PIPL update Yin Mingjie 21/02/2022 end--> |
| | | <span class="slds-truncate" title="Name" style="width: 100px;font-size: 13px;">{!v.fieldsmap.Agency_Contact__c}</span> |
| | | |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps" style="width: 100px;font-size: 13px;"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Purpose_Type__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <<<<<<< HEAD |
| | | <aura:iteration |
| | | items="{!v.reports}" |
| | | var="item" |
| | |
| | | class="slds-truncate" |
| | | title="{!item.Person_In_Charge2__r.Name}" |
| | | > |
| | | ======= |
| | | <aura:iteration items="{!v.reports}" var="item" indexVar="index"> |
| | | <tr class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <ui:inputRadio class="report_radio" name="report_radio" label="{!item.Name}" change="{!c.change_report_radio}"/> |
| | | <lightning:buttonIcon class="edit_button" iconName="utility:edit" size="small" alternativeText="edit" value="{!index}" onclick="{!c.edit_button}"/> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Person_In_Charge2__r.Name}"> |
| | | >>>>>>> LEXCommunityLiJun |
| | | {!item.Person_In_Charge2__r.Name} |
| | | <!-- <span class="decrypt">{!item.Person_In_Charge2__r.awsdata.lastName}</span> --> |
| | | </span> |
| | |
| | | </th> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Department_Cateogy__c}" |
| | | >{!item.Department_Cateogy__c}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.doctor2__r.Name}" |
| | |
| | | <span class="decrypt" |
| | | >{!item.doctor2__r.awsdata.name}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.name}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.visitor_title__c}" |
| | |
| | | <span class="decrypt" |
| | | >{!item.doctor2__r.awsdata.doctorDivision1}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" title="{!item.visitor_title__c}"> |
| | | <span class="encrypt">{!item.visitor_title__c}</span> |
| | | <span class="decrypt">{!item.doctor2__r.awsdata.doctorDivision1}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <<<<<<< HEAD |
| | | <span |
| | | class="slds-truncate" |
| | | title="{!item.Purpose_Type__c}" |
| | | >{!item.Purpose_Type__c}</span |
| | | > |
| | | ======= |
| | | <span class="slds-truncate" title="{!item.Purpose_Type__c}">{!item.Purpose_Type__c}</span> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </span> |
| | | </td> |
| | | </tr> |
| | |
| | | </div> |
| | | <aura:renderIf isTrue="{!v.report_count > 0}"> |
| | | <aura:set attribute="else"> |
| | | <<<<<<< HEAD |
| | | <div class="no_data_area">{!v.list_message}</div> |
| | | </aura:set> |
| | | </aura:renderIf> |
| | |
| | | variant="brand" |
| | | onclick="{!c.close_export}" |
| | | /> |
| | | ======= |
| | | <div class="no_data_area"> |
| | | {!v.list_message} |
| | | </div> |
| | | </aura:set> |
| | | </aura:renderIf> |
| | | </div> |
| | | |
| | | <!-- <ui:button aura:id="test_button" label="test" class="fade animation_on" press="{!c.test}"/>--> |
| | | <!-- 批量添加周报 start--> |
| | | <div aura:id="modal_import" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div class="slds-modal__container "> |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 80%;top:50px;" /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header "> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">周报批量导入</h2> |
| | | <ui:button aura:id="close_button" label="关闭" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_import}"/> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium " > |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div> |
| | | <!-- <input type="file" class="file" aura:id="file" onchange="{!c.CreateRecord}" value="导入" /> --> |
| | | <lightning:input type="file" class="file" uara:id="file" onchange="{!c.CreateRecord}" /> |
| | | <!-- <ui:button label="Create Accounts" press="{!c.CreateRecord}"/> --> |
| | | </div> |
| | | <aura:set attribute="else"> |
| | | <!-- <ui:outputRichText class="uiOutputRichText slds-m-around-large" value="{!v.TargetFileName}"/> --> |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent}"/> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="保存" variant="brand" onclick="{!c.processFileContent}" |
| | | /> |
| | | <lightning:button label="取消" variant="brand" |
| | | onclick="{!c.cancel}" /> |
| | | </div> |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | <aura:if isTrue="{!v.showErrorInfo}"> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="导出错误信息" variant="brand" onclick="{!c.exportErrorInfo}" /> |
| | | </div> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <div style="height: 300px;overflow-x:scroll"> |
| | | <lightning:datatable keyField="id" data="{! v.errorData }" |
| | | columns="{! v.errorColumns }" hideCheckboxColumn="true" /> |
| | | </div> |
| | | </div> |
| | | </aura:if> |
| | | <!-- start DTT-zhj 增加错误信息table 2023-05-16--> |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_importbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <!-- 批量添加周报 end--> |
| | | |
| | | <!-- 批量导出周报 start--> |
| | | <div aura:id="modal_export" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" > |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">周报批量导出</h2> |
| | | <ui:button aura:id="close_button" label="关闭" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.close_export}"/> |
| | | </div> |
| | | <div class="slds-modal__content slds-scrollable slds-grow slds-p-around--medium"> |
| | | <aura:if isTrue="{!v.showMain}"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded" > |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日开始日期 |
| | | |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " aura:id="input-report-date1" /> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | 活动日结束日期 |
| | | <lightning:input type="Date" class="slds-input slds-input_bare " aura:id="input-report-date2" /> |
| | | </div> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-4"> |
| | | </div> |
| | | |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.select_repores_date}" |
| | | /> |
| | | <lightning:button label="取消" variant="brand" |
| | | onclick="{!c.close_export}" /> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </div> |
| | | <!-- <div> |
| | |
| | | onclick="{!c.close_export}" /> |
| | | </div> --> |
| | | <aura:set attribute="else"> |
| | | <<<<<<< HEAD |
| | | <ui:outputRichText |
| | | class="uiOutputRichText slds-m--around-large" |
| | | value="{!v.TableContent2}" |
| | |
| | | onclick="{!c.close_export}" |
| | | /> |
| | | </div> |
| | | ======= |
| | | <ui:outputRichText class="uiOutputRichText slds-m--around-large" value="{!v.TableContent2}"/> |
| | | <div class="slds-p-around--large slds-align--absolute-center"> |
| | | <lightning:button label="确认" variant="brand" onclick="{!c.exportDate}" |
| | | /> |
| | | <lightning:button label="取消" variant="brand" |
| | | onclick="{!c.close_export}" /> |
| | | </div> |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | </aura:set> |
| | | </aura:if> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | <div |
| | | aura:id="modal_exportbg" |
| | | class="disp_none slds-backdrop slds-backdrop--open" |
| | |
| | | > |
| | | {!hospital.Hospital_Name_readonly__c} |
| | | </div> |
| | | ======= |
| | | <div aura:id="modal_exportbg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | <!-- 批量导出周报 end--> |
| | | |
| | | <div aura:id="modal_window" role="dialog" tabindex="-1" class="disp_none slds-modal slds-fade-in-open slds-modal--large" aria-labelledby="headerTarget"> |
| | | <div class="slds-modal__container" > |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 80%;top:50px;" /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header"> |
| | | <h4 id="headerTarget" class="slds-float--left"></h4> |
| | | <h2 id="headerTarget" class="slds-text-heading--medium">周报({!v.selected_date} {!v.selected_agency_person})</h2> |
| | | <ui:button aura:id="close_button" label="关闭" class="close_button slds-button slds-button--neutral slds-order--1" press="{!c.toggle_report}"/> |
| | | </div> |
| | | <div class="slds-modal__content slds-grow slds-p-around--medium"> |
| | | <div class="slds-box slds-theme--shade"> |
| | | <div class="slds-grid slds-wrap slds-grid--pull-padded" > |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop" > |
| | | 活动日 |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <!-- <force:inputField value="{!v.data.Report_Date__c}" aura:id="input-report-date"/> --> |
| | | <lightning:input type="date" value="{!v.data.Report_Date__c}" aura:id="input-report-date" |
| | | variant="label-hidden" /> |
| | | </div> |
| | | <!-- 医院 --> |
| | | <div aura:id="hospital_list" class="slds-form-element slds-lookup slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-5 marginTop" data-select="single"> |
| | | <!-- <ui:inputText aura:id="hospital_input_text" label="医院" class="field" value="{!v.hospital}" updateOn="keyup"/> --> |
| | | 医院 |
| | | <lightning:input aura:id="hospital_input_text" class="field" value="{!v.hospital}" variant="label-hidden" updateOn="keyup"/> |
| | | <div class="slds-lookup__menu" id="lookup-66"> |
| | | <ul class="slds-lookup__list" role="listbox"> |
| | | <aura:iteration var="hospital" items="{!v.hospitalList}"> |
| | | <li role="presentation" onclick="{!c.selectHos}" data-accName="{!hospital.Hospital_Name_readonly__c}" data-accId="{!hospital.Hospital__c}"> |
| | | <span class="slds-lookup__item-action slds-media" id="lookup-option-498" role="option"> |
| | | <div class="slds-media__body"> |
| | | <div class="slds-lookup__result-text">{!hospital.Hospital_Name_readonly__c}</div> |
| | | >>>>>>> LEXCommunityLiJun |
| | | </div> |
| | | </span> |
| | | </li> |
| | |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <<<<<<< HEAD |
| | | |
| | | <!-- 科室分类 --> |
| | | <div |
| | |
| | | </div> |
| | | </div> |
| | | </aura:component> |
| | | ======= |
| | | |
| | | <!-- 科室分类 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop"> |
| | | {!v.fieldsmap.Department_Cateogy__c} |
| | | <ui:inputSelect aura:id="select_department" class="slds-select" change="{!c.select_department}"/> |
| | | </div> |
| | | |
| | | <!-- 先生 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop"> |
| | | {!v.fieldsmap.doctor2__c} |
| | | <ui:inputSelect aura:id="select_doctor" class="slds-select" change="{!c.doctor_change}"/> |
| | | </div> |
| | | |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-12 marginTop"> |
| | | <br/> |
| | | <ui:button label="新建" class="slds-button" press="{!c.createCon}" disabled="true" aura:id="new_con"/> |
| | | </div> |
| | | |
| | | <!-- 职位 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-8 marginTop"> |
| | | {!v.fieldsmap.visitor_title__c} |
| | | <div>{!v.doctor_title}</div> |
| | | </div> |
| | | <!-- 活动区分 --> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop"> |
| | | {!v.fieldsmap.Purpose_Type__c} |
| | | <ui:inputSelect aura:id="select_purpose_type" class="slds-select" change="{!c.select_purpose_type}"/> |
| | | </div> |
| | | <!-- 询价 --> |
| | | <div aura:id="input-opportunity-opp" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--4-of-12 slds-large-size--4-of-12 marginTop"> |
| | | {!v.fieldsmap.Opportunity__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <!-- <force:inputField value="{!v.data.Opportunity__c}" aura:id="input-opportunity"/> --> |
| | | <c:strike_lookup label="" |
| | | object="Agency_Opportunity__c" |
| | | searchField="Name" |
| | | placeholder="搜索经销商询价..." |
| | | iconName="standard:opportunity" |
| | | subtitleField="Department_Cateogy__c,Agency_Opportunity_No__c,Change_To_Opportunity__r.Name" |
| | | order="StageName__c" |
| | | limit="5" |
| | | loadingMessage="Loading..." |
| | | errorMessage="Invalid input" |
| | | allowNewRecords = "true" |
| | | overrideNewEvent = "true" |
| | | showRecentRecords ="true" |
| | | value="{!v.data.Opportunity__c}" |
| | | filter="{!v.opportunity_cfilter}" |
| | | subTitleFormat="{0}+{1}+{2}"/> |
| | | </div> |
| | | <div aura:id="input-opportunity-blank" class="lds-p-horizontal--small slds-size--1-of-1 slds-medium-size--8-of-12 slds-large-size--8-of-12 marginTop"> |
| | | </div> |
| | | <div aura:id="input-opportunity-stage" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"> |
| | | {!v.fieldsmap.StageName__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <ui:inputSelect aura:id="select_stageName" class="slds-select"/> |
| | | <!-- <force:inputField value="{!v.oppdata.StageName__c}" aura:id="input-oppstage" /> --> |
| | | </div> |
| | | <div aura:id="input-opportunity-amount1" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"> |
| | | {!v.fieldsmap.Amount__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.oppdata.Amount__c}" class=""/> |
| | | </div> |
| | | <div aura:id="input-opportunity-amount2" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"> |
| | | {!v.fieldsmap.OCMSale_Price__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.oppdata.OCMSale_Price__c}" class=""/> |
| | | </div> |
| | | <div aura:id="input-opportunity-date" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--2-of-12 slds-large-size--2-of-12 marginTop"> |
| | | {!v.fieldsmap.Close_Forecasted_Date__c} |
| | | <!-- <ui:inputSelect aura:id="select_opportunity" class="slds-select"/> --> |
| | | <force:inputField value="{!v.oppdata.Close_Forecasted_Date__c}" class=""/> |
| | | </div> |
| | | <!-- 製品分類 --> |
| | | <div aura:id="product_category_select1" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"> |
| | | {!v.fieldsmap.Product_Category1__c} |
| | | <!-- <force:inputField value="{!v.data.Product_Category1__c}" aura:id="input-product-category1"/> --> |
| | | <ui:inputSelect aura:id="select_Product1" class="slds-select" change="{!c.productcategoryChange1}"/> |
| | | </div> |
| | | <div aura:id="product_category_select2" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"> |
| | | {!v.fieldsmap.Product_Category2__c} |
| | | <!-- <force:inputField value="{!v.data.Product_Category2__c}" aura:id="input-product-category2"/> --> |
| | | <ui:inputSelect aura:id="select_Product2" class="slds-select" change="{!c.productcategoryChange2}"/> |
| | | </div> |
| | | <div aura:id="product_category_select3" class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"> |
| | | {!v.fieldsmap.Product_Category3__c} |
| | | <!-- <force:inputField value="{!v.data.Product_Category3__c}" aura:id="input-product-category3"/> --> |
| | | <ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/> |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> |
| | | <!-- 支援需求 change="{!c.SupportNeeds__c}"--> |
| | | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6 marginTop"> |
| | | {!v.fieldsmap.SupportNeeds__c} |
| | | <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" /> |
| | | </div> |
| | | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end--> |
| | | <div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12 marginTop"> |
| | | {!v.fieldsmap.Result__c} |
| | | <ui:inputSelect aura:id="select_result" class="slds-select"/> |
| | | <!-- <ui:inputText label="结果" class="bcolor" value="{!v.result}"/> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="save_button_area"> |
| | | <ui:button aura:id="save_button" label="保存并新建" class="save_button slds-button slds-button--brand slds-order--3" press="{!c.save_report}"/> |
| | | </div> |
| | | |
| | | <aura:renderIf isTrue="{!v.reports_now_count > 0}"> |
| | | <div class="mt40 slds-box slds-theme--shade"> |
| | | <div class="slds-table--edit_container slds-is-relative"> |
| | | <table class="slds-table slds-table--edit slds-table--bordered slds-table--fixed-layout slds-no-cell-focus" role="grid"> |
| | | <thead> |
| | | <tr class="slds-line-height--reset"> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name"></span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">医院</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Department_Cateogy__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.doctor2__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.visitor_title__c}</span> |
| | | </th> |
| | | <th class="table_header slds-text-title--caps"> |
| | | <span class="slds-truncate" title="Name">{!v.fieldsmap.Purpose_Type__c}</span> |
| | | </th> |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <aura:iteration items="{!v.reports_now}" var="item" indexVar="index"> |
| | | <tr aura:id="modal_data_list_tr" class="slds-hint-parent"> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Agency_Hospital__r.Name}">{!item.Agency_Hospital__r.Name}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Department_Cateogy__c}">{!item.Department_Cateogy__c}</span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.doctor2__r.Name}"> |
| | | <span class="encrypt">{!item.doctor2__r.Name}</span> |
| | | <span class="decrypt">{!item.doctor2NameOrigin}</span> |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.visitor_title__c}"> |
| | | <span class="encrypt">{!item.visitor_title__c}</span> |
| | | <span class="decrypt">{!item.visitorTitleOrigin}</span> |
| | | </span> |
| | | </span> |
| | | </td> |
| | | <td role="gridcell" class="slds-cell-edit"> |
| | | <span class="slds-grid slds-grid--align-spread"> |
| | | <span class="slds-truncate" title="{!item.Purpose_Type__c}">{!item.Purpose_Type__c}</span> |
| | | </span> |
| | | </td> |
| | | </tr> |
| | | </aura:iteration> |
| | | </tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </aura:renderIf> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | |
| | | <div aura:id="modal_confirm" role="dialog" tabindex="-2" aria-labelledby="header43" class="disp_none slds-modal slds-fade-in-open"> |
| | | <div class="slds-modal__container"> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="header43" class="slds-text-heading--medium">{!v.modal_confirm_title}</h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <p>{!v.modal_confirm_text}</p> |
| | | </div> |
| | | <div class="slds-modal__footer"> |
| | | <ui:button label="是" class="slds-button slds-button--brand" press="{!c.yes_button}"/> |
| | | <ui:button label="否" class="slds-button slds-button--neutral" press="{!c.no_button}" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div aura:id="modal_confirm_bg" class="disp_none slds-backdrop slds-backdrop--open"></div> |
| | | |
| | | <div aura:id="modal_newAC" role="dialog" tabindex="-3" aria-labelledby="headertest" class="disp_none slds-modal slds-fade-in-open"> |
| | | <div class="slds-modal__container"> |
| | | <aura:renderIf isTrue="{!v.loginEdit}"> |
| | | <lightning:spinner alternativeText="Loading" size="medium" style="width: 100%; height: 80%;top:50px;" /> |
| | | </aura:renderIf> |
| | | <div class="slds-modal__header"> |
| | | <h2 id="headertest" class="slds-text-heading--medium">新建.客户人员</h2> |
| | | </div> |
| | | <div class="slds-modal__content slds-p-around--medium"> |
| | | <lightning:recordEditForm aura:id="recordEditForm" objectApiName="Agency_Contact__c" onsuccess="{!c.handleSuccess}" onload="{!c.showRequiredFields}" onsubmit="{!c.handleSubmit}"> |
| | | <lightning:messages aura:id="OppMessage" /> |
| | | <!-- onload="{!c.showRequiredFields}" --> |
| | | <aura:renderIf isTrue="{!v.truthy}"> |
| | | <lightning:inputField fieldName="Name" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Type__c" aura:id="newOpportunityField" /> |
| | | <lightning:inputField fieldName="Doctor_Division1__c" aura:id="newOpportunityField" /> |
| | | <!-- <lightning:inputField class="customRequired none" aura:id="Input_type__c" fieldName="Type__c"/> |
| | | <lightning:inputField class="customRequired none" aura:id="Input_Doctor_Division1__c" fieldName="Doctor_Division1__c"/> --> |
| | | </aura:renderIf> |
| | | <br/> |
| | | <br/> |
| | | <br/> |
| | | <br/> |
| | | <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="保存" /> |
| | | </div> |
| | | |
| | | |
| | | </lightning:recordEditForm> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </aura:component> |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | } |
| | | .THIS .no_data_area { |
| | | text-align: center; |
| | | <<<<<<< HEAD |
| | | margin: 0.5em 0; |
| | | ======= |
| | | margin: .5em 0; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | .THIS.report_list_area { |
| | | margin: 40px 0 20px 0px; |
| | |
| | | .THIS .animation_on { |
| | | opacity: 1; |
| | | } |
| | | <<<<<<< HEAD |
| | | .THIS .divbotuser { |
| | | width: fit-content; |
| | | } |
| | |
| | | } |
| | | |
| | | .THIS tr:hover .encrypt { |
| | | ======= |
| | | .THIS .divbotuser{ |
| | | width:fit-content; |
| | | } |
| | | |
| | | .THIS .toastMessage.forceActionsText{ |
| | | white-space : pre-line !important; |
| | | } |
| | | |
| | | .THIS .slds-file-selector__dropzone .slds-file-selector__text{ |
| | | display: none; |
| | | } |
| | | |
| | | .THIS .slds-input:focus, .THIS .slds-input:active { |
| | | border-color: rgb(216, 221, 230); |
| | | box-shadow: none; |
| | | } |
| | | |
| | | .THIS .customRequired{ |
| | | font-weight: 400; |
| | | } |
| | | .THIS .customRequired:before{ |
| | | content: "*"; |
| | | margin: 0 0.125rem 0 0.125rem; |
| | | color: rgb(194, 57, 52); |
| | | float: left; |
| | | } |
| | | .THIS .none{ |
| | | display:none; |
| | | } |
| | | |
| | | .THIS tr .decrypt{ |
| | | display: none; |
| | | } |
| | | |
| | | .THIS tr:hover .decrypt{ |
| | | display: unset; |
| | | } |
| | | |
| | | .THIS tr:hover .encrypt{ |
| | | >>>>>>> LEXCommunityLiJun |
| | | display: none; |
| | | } |
| | | |
| | | /* add by Deloitte-Link 2023-6-19 start*/ |
| | | <<<<<<< HEAD |
| | | .THIS .weeklyReportSpinner { |
| | | top: 100px; |
| | | } |
| | |
| | | } |
| | | .THIS .custom-input .uiInput { |
| | | height: 2rem; |
| | | ======= |
| | | .THIS .weeklyReportSpinner{ |
| | | top:100px; |
| | | } |
| | | |
| | | .THIS .weeklyReportSpinnerEdit{ |
| | | top:50px; |
| | | } |
| | | |
| | | .THIS .slds-spinner_container{ |
| | | position: absolute; |
| | | top:100px; |
| | | } |
| | | |
| | | .THIS .slds-spinner_containerEdit{ |
| | | position: absolute; |
| | | top:50px; |
| | | } |
| | | |
| | | .THIS .marginTop{ |
| | | margin-top: 10px; |
| | | } |
| | | .THIS .custom-input .uiInput { |
| | | height: 2rem; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | /* add by Deloitte-Link 2023-6-19 end*/ |
| | |
| | | ({ |
| | | <<<<<<< HEAD |
| | | doInit: function (component, event, helper) { |
| | | console.log('zhj 新方案weeklyReport'); |
| | | if (window.location.href.endsWith('weekly-report')) { |
| | | ======= |
| | | doInit : function(component, event, helper) { |
| | | console.log('zhj 新方案weeklyReport'); |
| | | if (window.location.href.endsWith("weekly-report")) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | helper.doinit(component, event, helper); |
| | | } else { |
| | | helper.hideCmp(component, event, helper); |
| | | } |
| | | <<<<<<< HEAD |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | | createAopp: function (component, event, helper) { |
| | | ======= |
| | | component.set("v.showErrorInfo", false); |
| | | }, |
| | | |
| | | createAopp : function(component, event, helper) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var addRecordEvent = $A.get('e.force:createRecord'); |
| | | addRecordEvent.setParams({ |
| | | entityApiName: 'Agency_Opportunity__c', |
| | | recordTypeId: '012100000006KW7' |
| | | }); |
| | | addRecordEvent.fire(); |
| | | <<<<<<< HEAD |
| | | component.set('v.showErrorInfo', false); |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | handleSubmit: function (component, event, helper) { |
| | | ======= |
| | | component.set("v.showErrorInfo", false); |
| | | }, |
| | | |
| | | new_report : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | component.set('v.data.Report_Date__c', ''); |
| | | helper.new_report(component, event, helper); |
| | | }, |
| | | |
| | | copy_button : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存并新建'); |
| | | helper.copy_button(component, event, helper); |
| | | }, |
| | | |
| | | change_report_radio : function(component, event, helper) { |
| | | helper.change_report_radio(component, event, helper); |
| | | }, |
| | | |
| | | edit_button : function(component, event, helper) { |
| | | component.find('save_button').set('v.label', '保存'); |
| | | helper.edit_button(component, event, helper); |
| | | }, |
| | | |
| | | createCon : function(component, event, helper) { |
| | | helper.createCon(component, event, helper); |
| | | }, |
| | | |
| | | showRequiredFields: function(component, event, helper){ |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | $A.util.removeClass(component.find("newOpportunityField"), "none"); |
| | | }, |
| | | |
| | | handleSuccess : function(component, event, helper) { |
| | | helper.handleSuccess(component, event, helper); |
| | | }, |
| | | |
| | | handleSubmit : function(component, event, helper) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | /* |
| | | var params = event.getParams(); |
| | | params.fields["Agency_Hospital__c"] = component.get('v.hospitalLinkId'); |
| | |
| | | // vivek 添加验证 start |
| | | // helper.handleFormSubmit(component); |
| | | var showValidationError = false; |
| | | <<<<<<< HEAD |
| | | var fields = component.find('newOpportunityField'); |
| | | var vaildationFailReason = ''; |
| | | // var vaildationFailReason2 = ''; |
| | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }); |
| | | |
| | | ======= |
| | | var fields = component.find("newOpportunityField"); |
| | | var vaildationFailReason = ''; |
| | | // var vaildationFailReason2 = ''; |
| | | // var currentDate = new Date().toJSON().slice(0,10); |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | let agencyReport = Object.create(null); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | | fields.forEach(function (field) { |
| | | if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | showValidationError = true; |
| | | vaildationFailReason = "分类不能为空!"; |
| | | }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | showValidationError = true; |
| | | if(vaildationFailReason != ''){ |
| | | vaildationFailReason += "医生区分(职务)不能为空!"; |
| | | }else{ |
| | | vaildationFailReason = "医生区分(职务)不能为空!"; |
| | | } |
| | | |
| | | } |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | if(field.get("v.fieldName") === 'Name'){ |
| | | agencyReport['name'] = field.get("v.value"); |
| | | }else if(field.get("v.fieldName") === 'Type__c'){ |
| | | agencyReport['type'] = field.get("v.value"); |
| | | }else if(field.get("v.fieldName") === 'Doctor_Division1__c'){ |
| | | agencyReport['doctorDivision1'] = field.get("v.value"); |
| | | } |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (!showValidationError) { |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | /* |
| | |
| | | |
| | | var agencyHospitalid = component.get('v.hospitalLinkId'); |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | <<<<<<< HEAD |
| | | debugger; |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | |
| | | } |
| | | } |
| | | ); |
| | | ======= |
| | | debugger |
| | | let hospitalName = ''; |
| | | //调用后端searchAgencyDataId方法查询出医院下面所有客户人员dataid |
| | | helper.CallBackAction(component,'searchAgencyDataId',{ |
| | | hospitalId : agencyHospitalid |
| | | },function(data){ |
| | | if(data.getState() == "SUCCESS"){ |
| | | var data = data.getReturnValue(); |
| | | if(data.IsSuccess == true){ |
| | | let agencyContactIds = '' |
| | | if(data.Message == '' && data.Data && data.Data.length > 0){ |
| | | hospitalName = data.Data[0].Agency_Hospital__r.Name; |
| | | for(var i=0;i<data.Data.length;i++){ |
| | | if(data.Data[i].AWS_Data_Id__c) |
| | | agencyContactIds += ','+data.Data[i].AWS_Data_Id__c; |
| | | } |
| | | agencyContactIds = agencyContactIds.substring(1); |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | }else{ |
| | | agencyReport['agencyContactIds'] = agencyContactIds; |
| | | } |
| | | var arr = new Array(); |
| | | arr.push(agencyReport); |
| | | var requestData = JSON.stringify(arr); |
| | | // helper.set_aws_url(component,data,agencyHospitalid); |
| | | |
| | | var token = component.get('v.AWStoken'); |
| | | var newUrl = component.get('v.AWSinsert') + 'V2'; |
| | | |
| | | component.set('v.loginEdit',true); |
| | | helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName); |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : data.message, |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }else{ |
| | | helper.ShowToast({ |
| | | "message" : 'searchAgency失败', |
| | | "type" : "error" |
| | | }); |
| | | } |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | // var arr = new Array(); |
| | | // arr.push(agencyReport); |
| | |
| | | |
| | | // var token = component.get('v.AWStoken'); |
| | | // var newUrl = component.get('v.AWSinsert'); |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | // component.set('v.login',true); |
| | | // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper); |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | <<<<<<< HEAD |
| | | } else { |
| | | ======= |
| | | }else{ |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('OppMessage').setError(vaildationFailReason); |
| | | } |
| | | // var eventFields = event.getParam("fields"); |
| | |
| | | // component.find('recordEditForm').submit(eventFields); |
| | | // vivek 添加验证 end |
| | | }, |
| | | <<<<<<< HEAD |
| | | |
| | | createCancel: function (component, event, helper) { |
| | | helper.createCancel(component, event, helper); |
| | |
| | | }, |
| | | |
| | | import: function (component, event, helper) { |
| | | ======= |
| | | |
| | | createCancel : function(component, event, helper) { |
| | | helper.createCancel(component, event, helper); |
| | | }, |
| | | |
| | | yes_button : function(component, event, helper) { |
| | | component.set('v.confirm_status', 1); |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | }, |
| | | |
| | | no_button : function(component, event, helper) { |
| | | component.set('v.confirm_status', 2); |
| | | helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text')); |
| | | }, |
| | | |
| | | toggle_report : function(component, event, helper) { |
| | | helper.toggle_report(component); |
| | | }, |
| | | |
| | | save_report : function(component, event, helper) { |
| | | helper.save_report(component, event, helper); |
| | | }, |
| | | |
| | | select_date_change : function(component, event, helper) { |
| | | helper.select_date_change(component, event, helper); |
| | | }, |
| | | |
| | | select_agency_change : function(component, event, helper) { |
| | | helper.select_agency_change(component, event, helper); |
| | | }, |
| | | |
| | | hosChange : function(component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | if (hospital_name.match(/(\S+\s)+/)) { |
| | | helper.searchHos(component, event, helper); |
| | | } else { |
| | | helper.hideSearch(component, event, helper); |
| | | } |
| | | }, |
| | | |
| | | selectHos : function(component, event, helper) { |
| | | helper.selectHos(component, event, helper); |
| | | helper.setOpportunity_cfilter(component); |
| | | }, |
| | | select_department : function(component, event, helper) { |
| | | helper.select_department(component, event, helper); |
| | | helper.setOpportunity_cfilter(component); |
| | | }, |
| | | select_purpose_type : function(component, event, helper) { |
| | | helper.select_purpose_type(component, event, helper); |
| | | }, |
| | | |
| | | doctor_change : function(component, event, helper) { |
| | | helper.doctor_change(component, event, helper); |
| | | }, |
| | | |
| | | opportunityChange : function(component, event, helper) { |
| | | helper.opportunityChange(component, event, helper); |
| | | }, |
| | | |
| | | productcategoryChange1 : function(component, event, helper) { |
| | | helper.productcategoryChange1(component, event, helper); |
| | | }, |
| | | productcategoryChange2 : function(component, event, helper) { |
| | | helper.productcategoryChange2(component, event, helper); |
| | | }, |
| | | productcategoryChange3 : function(component, event, helper) { |
| | | helper.productcategoryChange3(component, event, helper); |
| | | }, |
| | | stageNameChange : function(component, event, helper) { |
| | | helper.stageNameChange(component, event, helper); |
| | | }, |
| | | onDragOver : function(component, event, helper) { |
| | | event.preventDefault(); |
| | | }, |
| | | |
| | | onDrop : function(component, event, helper) { |
| | | event.stopPropagation(); |
| | | event.preventDefault(); |
| | | event.dataTransfer.dropEffect='copy'; |
| | | var files=event.dataTransfer.files; |
| | | helper.readFile(component,helper,files[0]); |
| | | }, |
| | | CreateRecord : function(component, event, helper){ |
| | | var files = event.getSource().get("v.files"); |
| | | // var fileInput = component.find("file").getElement(); |
| | | // var file = fileInput.files[0]; |
| | | helper.readFile(component,helper,files[0]); |
| | | component.set("v.showErrorInfo", false); |
| | | }, |
| | | |
| | | processFileContent : function(component,event,helper){ |
| | | helper.saveRecords(component,event,helper); |
| | | component.set("v.showErrorInfo", false); |
| | | }, |
| | | |
| | | cancel : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | }, |
| | | |
| | | import : function(component,event,helper){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | // component.find('file').click(); |
| | | // console.log('lll'+component.find('file')); |
| | | helper.showImport(component); |
| | | }, |
| | | <<<<<<< HEAD |
| | | exportDate: function (component, event, helper) { |
| | | var stockData = component.get('v.reports_date'); |
| | | console.log('导出数据' + stockData); |
| | |
| | | |
| | | select_repores_date: function (component, event, helper) { |
| | | helper.select_repores_date(component, event, helper); |
| | | ======= |
| | | exportDate : function(component,event,helper){ |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log('导出数据'+stockData); |
| | | var csv = helper.convertArrayOfObjectsToCSV(component,stockData); |
| | | if (csv == null){return;} |
| | | |
| | | // ####--code for create a temp. <a> html tag [link tag] for download the CSV file--#### |
| | | var universalBOM = "\uFEFF"; |
| | | var hiddenElement = document.createElement('a'); |
| | | hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM+csv); |
| | | hiddenElement.target = '_self'; // |
| | | hiddenElement.download = 'ExportData.csv'; // CSV file Name* you can change it.[only name not .csv] |
| | | document.body.appendChild(hiddenElement); // Required for FireFox browser |
| | | hiddenElement.click(); // using click() js function to download csv file |
| | | // helper.showExport(component); |
| | | |
| | | }, |
| | | |
| | | export_condition : function(component,event,helper){ |
| | | helper.showExport(component); |
| | | }, |
| | | |
| | | select_repores_date : function(component,event,helper){ |
| | | helper.select_repores_date(component,event,helper); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // var stockData = component.get("v.reports_date"); |
| | | // console.log('查出的数据'+stockData); |
| | | // helper.showExportDate(component,stockData); |
| | | // this.export(component,event,helper); |
| | | }, |
| | | <<<<<<< HEAD |
| | | export: function (component, event, helper) { |
| | | console.log('进入export'); |
| | | var stockData = component.get('v.reports_date'); |
| | |
| | | helper.exportErrorInfoHelper(component); |
| | | } |
| | | }); |
| | | ======= |
| | | export : function(component,event,helper){ |
| | | console.log('进入export'); |
| | | var stockData = component.get("v.reports_date"); |
| | | console.log('查出的数据'+stockData); |
| | | // helper.showExportDate(component,stockData); |
| | | // helper.showExport(component); |
| | | }, |
| | | close_import : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | helper.close_import(component); |
| | | }, |
| | | close_export : function(component,event,helper){ |
| | | component.set("v.showMain",true); |
| | | helper.close_export(component); |
| | | }, |
| | | exportErrorInfo: function(component,event,helper){ |
| | | helper.exportErrorInfoHelper(component); |
| | | }, |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | ({ |
| | | <<<<<<< HEAD |
| | | doinit: function (component, event, helper) { |
| | | this.report_date_list(component, event, helper, 5); |
| | | component.set('v.login', true); |
| | |
| | | }, |
| | | |
| | | doctor_change: function (component, event, helper) { |
| | | ======= |
| | | doinit : function(component, event, helper) { |
| | | this.report_date_list(component, event, helper, 5); |
| | | component.set('v.login',true); |
| | | var action = component.get('c.getalldata'); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var res = response.getReturnValue(); |
| | | component.set('v.alldata',res.reports); |
| | | component.set('v.fieldsmap',res.fieldsMap); |
| | | component.set('v.allselectlist',res.allselectlist); |
| | | component.set('v.doclist',res.doclist); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); |
| | | // this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | component.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c)); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c)); |
| | | component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set('v.dialog_type', '新建'); |
| | | component.set('v.awsurl', res.awsurl);// 20220222 PI改造 by Bright |
| | | component.set('v.contactawsurl', res.contactawsurl);// 20220222 PI改造 by Bright |
| | | |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | this.error('doinit failed.'); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | search_contact : function(component, event, helper, resobj) { |
| | | let contactData = Object.create(null); |
| | | var dataArr = new Array(); |
| | | for (let i = 0; i < resobj.length; i++) { |
| | | if (resobj[i].awsid != null && resobj[i].awsid != ''){ |
| | | contactData[resobj[i].awsid] = resobj[i]; |
| | | dataArr.push(resobj[i].awsid); |
| | | } |
| | | } |
| | | let obj= Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | | this.search_contact_url(component, 'Contact', (result)=>{ |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | if(result.status == '0'){ |
| | | if(result.object != null){ |
| | | this.to_contact_list(result,contactData,component); |
| | | }else{ |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status1 : ' + result.status); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | },component); |
| | | |
| | | }); |
| | | }, |
| | | |
| | | to_contact_list : function(result,retMap,component) { |
| | | var resls = result.object; |
| | | var res = []; |
| | | var space = {}; |
| | | space['label'] = ''; |
| | | space['selected'] = true; |
| | | space['value'] = ''; |
| | | res.push(space); |
| | | |
| | | for (var i = 0; i < resls.length; i++) { |
| | | var t = {}; |
| | | t['label'] = resls[i].lastName; |
| | | t['selected'] = false; |
| | | t['Doctor_Division1__c'] = resls[i].doctorDivision1; |
| | | t['value'] = retMap[resls[i].dataId].value; |
| | | res.push(t); |
| | | } |
| | | component.find('select_agency_person').set('v.options',res); |
| | | component.set('v.allselectlistAgencyPerson',res); |
| | | component.set('v.loginEdit',false); |
| | | }, |
| | | |
| | | search_contact_url : function(component, sobject, callback) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | | "sobj" : sobject, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var result = response.getReturnValue(); |
| | | if(callback)callback(result); |
| | | } |
| | | else{ |
| | | this.error('AWS url/token error.'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | | select_department : function(component, event, helper) { |
| | | var dc = component.find("select_department").get("v.value"); |
| | | dc = dc ? '%'+dc+'%' : ''; |
| | | var purpose_type = component.find("select_purpose_type").get("v.value"); |
| | | if (purpose_type) { |
| | | if (purpose_type.substr(-3) == 'OPD') { |
| | | purpose_type = 'OPD'; |
| | | } else if (purpose_type.substr(-3) == 'SIS') { |
| | | purpose_type = 'SIS'; |
| | | } else { |
| | | purpose_type = ''; |
| | | } |
| | | } |
| | | if (dc != '' || purpose_type != '') { |
| | | |
| | | var action = component.get('c.getProductList'); |
| | | action.setParams({ |
| | | "dc" : dc, |
| | | "opdsis" : purpose_type, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | |
| | | var res = response.getReturnValue(); |
| | | component.find('select_Product1').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | component.find('select_Product2').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | component.find('select_Product3').set("v.options", JSON.parse(JSON.stringify(res))); |
| | | } |
| | | else{ |
| | | this.error('getProductList failed.'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } else { |
| | | component.find('select_Product1').set('v.options', []); |
| | | component.find('select_Product2').set('v.options', []); |
| | | component.find('select_Product3').set('v.options', []); |
| | | } |
| | | }, |
| | | |
| | | get_reports : function(component, event, helper, date_str, person_str) { |
| | | if (!date_str) { |
| | | return false; |
| | | } |
| | | |
| | | date_str = this.get_date_string(date_str); |
| | | |
| | | var action = component.get('c.getReports'); |
| | | action.setParams({ |
| | | "date_str" : date_str, |
| | | "person_str" : person_str, |
| | | }); |
| | | |
| | | component.set('v.login',true); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var res = response.getReturnValue(); |
| | | component.set('v.reports', res.reports); |
| | | |
| | | // 20220222 PI改造 by Bright--start |
| | | let dataIds = []; |
| | | let dataIds1 = []; |
| | | let mm = {}; |
| | | let b = false; |
| | | let b1 = false; |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) { |
| | | dataIds.push(rep.doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | |
| | | if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c) { |
| | | dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | let Foo = null; |
| | | Foo = function(){ |
| | | if(b && b1){ |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) { |
| | | rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c)) { |
| | | rep.Person_In_Charge2__r.awsdata = mm[rep.Person_In_Charge2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | |
| | | $A.getCallback(()=>component.set('v.reports', res.reports))(); |
| | | }else{ |
| | | console.log('b='+b + ',b1='+b1+',continue'); |
| | | setTimeout(Foo,100); |
| | | } |
| | | } |
| | | |
| | | if(dataIds.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | helper.search_core(awsurl.token,awsurl.searchUrl,JSON.stringify({ |
| | | "dataIds":dataIds |
| | | }),(result)=>{ |
| | | if(result.status == '0'){ |
| | | |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b = true; |
| | | Foo(); |
| | | }else{ |
| | | //this.error('AWS search status2 : ' + result.status); |
| | | this.success('请重新刷新页面进行解密'); |
| | | } |
| | | },component); |
| | | }else{ |
| | | b = true; |
| | | } |
| | | |
| | | |
| | | |
| | | if(dataIds1.length > 0){ |
| | | let contactawsurl = component.get('v.contactawsurl'); |
| | | helper.search_core(contactawsurl.token,contactawsurl.searchUrl,JSON.stringify({ |
| | | "dataIds":dataIds1 |
| | | }),(result)=>{ |
| | | if(result.status == '0'){ |
| | | |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b1 = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status3 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | | b1 = true; |
| | | } |
| | | // 20220222 PI改造 by Bright--end |
| | | |
| | | component.set('v.report_count', res.reports.length); |
| | | |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get('v.update_select_report_data_id'); |
| | | |
| | | if (report_id != "") { |
| | | for (i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | | component.set('v.select_report_data', res.reports[i]); |
| | | break; |
| | | } |
| | | } |
| | | component.set('v.update_select_report_data_id', ''); |
| | | } |
| | | |
| | | if (res.reports.length > 0) { |
| | | component.set('v.list_message', ''); |
| | | } else { |
| | | component.set('v.list_message', 'no_data'); |
| | | } |
| | | component.set('v.login',false); |
| | | } |
| | | else{ |
| | | this.error('get_reports failed.'); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | get_reports_edit : function(component, event, helper, date_str, person_str) { |
| | | if (!date_str) { |
| | | return false; |
| | | } |
| | | |
| | | date_str = this.get_date_string(date_str); |
| | | |
| | | var action = component.get('c.getReports'); |
| | | action.setParams({ |
| | | "date_str" : date_str, |
| | | "person_str" : person_str, |
| | | }); |
| | | |
| | | component.set('v.loginEdit',true); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var res = response.getReturnValue(); |
| | | component.set('v.reports', res.reports); |
| | | |
| | | // 20220222 PI改造 by Bright--start |
| | | let dataIds = []; |
| | | let dataIds1 = []; |
| | | let mm = {}; |
| | | let b = false; |
| | | let b1 = false; |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c) { |
| | | dataIds.push(rep.doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | |
| | | if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c) { |
| | | dataIds1.push(rep.Person_In_Charge2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | let Foo = null; |
| | | Foo = function(){ |
| | | if(b && b1){ |
| | | for (const rep of res.reports) { |
| | | if (rep.doctor2__r && rep.doctor2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.doctor2__r.AWS_Data_Id__c)) { |
| | | rep.doctor2__r.awsdata = mm[rep.doctor2__r.AWS_Data_Id__c]; |
| | | } |
| | | if (rep.Person_In_Charge2__r && rep.Person_In_Charge2__r.AWS_Data_Id__c && mm.hasOwnProperty(rep.Person_In_Charge2__r.AWS_Data_Id__c)) { |
| | | rep.Person_In_Charge2__r.awsdata = mm[rep.Person_In_Charge2__r.AWS_Data_Id__c]; |
| | | } |
| | | } |
| | | |
| | | $A.getCallback(()=>component.set('v.reports', res.reports))(); |
| | | }else{ |
| | | console.log('b='+b + ',b1='+b1+',continue'); |
| | | setTimeout(Foo,100); |
| | | } |
| | | } |
| | | |
| | | if(dataIds.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | helper.search_core(awsurl.token,awsurl.searchUrl,JSON.stringify({ |
| | | "dataIds":dataIds |
| | | }),(result)=>{ |
| | | if(result.status == '0'){ |
| | | |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b = true; |
| | | Foo(); |
| | | }else{ |
| | | //this.error('AWS search status2 : ' + result.status); |
| | | this.success('请重新刷新页面进行解密'); |
| | | } |
| | | },component); |
| | | }else{ |
| | | b = true; |
| | | } |
| | | |
| | | |
| | | |
| | | if(dataIds1.length > 0){ |
| | | let contactawsurl = component.get('v.contactawsurl'); |
| | | helper.search_core(contactawsurl.token,contactawsurl.searchUrl,JSON.stringify({ |
| | | "dataIds":dataIds1 |
| | | }),(result)=>{ |
| | | if(result.status == '0'){ |
| | | |
| | | for (const m of result.object) { |
| | | mm[m.dataId] = m; |
| | | } |
| | | b1 = true; |
| | | Foo(); |
| | | }else{ |
| | | this.error('AWS search status3 : ' + result.status); |
| | | } |
| | | },component); |
| | | }else{ |
| | | b1 = true; |
| | | } |
| | | // 20220222 PI改造 by Bright--end |
| | | |
| | | component.set('v.report_count', res.reports.length); |
| | | |
| | | // 更新保存後のselect_data用 |
| | | var report_id = component.get('v.update_select_report_data_id'); |
| | | |
| | | if (report_id != "") { |
| | | for (i = 0; i < res.reports.length; i++) { |
| | | if (res.reports[i]['Id'] == report_id) { |
| | | component.set('v.select_report_data', res.reports[i]); |
| | | break; |
| | | } |
| | | } |
| | | component.set('v.update_select_report_data_id', ''); |
| | | } |
| | | |
| | | if (res.reports.length > 0) { |
| | | component.set('v.list_message', ''); |
| | | } else { |
| | | component.set('v.list_message', 'no_data'); |
| | | } |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | else{ |
| | | this.error('get_reports failed.'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | select_date_change : function(component, event, helper) { |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | this.new_button_disabled(component, event, helper); |
| | | |
| | | component.set('v.select_report_data_radio', ''); |
| | | component.find('copy_button').set('v.disabled', true); |
| | | }, |
| | | |
| | | select_agency_change : function(component, event, helper) { |
| | | var select_value = component.find('select_agency_person').get('v.value'); |
| | | var new_label = this.get_agency_person_name(component, select_value); |
| | | component.set('v.selected_agency_person', new_label); |
| | | |
| | | this.get_reports(component, event, helper, component.find('select_date').get('v.value'), select_value); |
| | | this.new_button_disabled(component, event, helper); |
| | | |
| | | component.set('v.select_report_data_radio', ''); |
| | | component.find('copy_button').set('v.disabled', true); |
| | | }, |
| | | |
| | | get_agency_person_name : function(component, agency_person_value) { |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | var allselectlist = component.get('v.allselectlist.AgencyPerson__c'); |
| | | // var allselectlist = component.get('v.allselectlistAgencyPerson'); |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | var new_label = ''; |
| | | for (var i = 0; i < allselectlist.length; i++) { |
| | | if (agency_person_value == allselectlist[i].value) { |
| | | new_label = allselectlist[i].label; |
| | | break; |
| | | } |
| | | } |
| | | return new_label; |
| | | }, |
| | | |
| | | new_button_disabled : function(component, event, helper) { |
| | | var select_date = component.find('select_date').get('v.value'); |
| | | var select_agency = component.find('select_agency_person').get('v.value'); |
| | | if (select_date && select_agency) { |
| | | component.find('new_button').set('v.disabled', false); |
| | | } else { |
| | | component.find('new_button').set('v.disabled', true); |
| | | } |
| | | }, |
| | | |
| | | toggle_report : function(component) { |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | if ($A.util.hasClass(modal_window, 'disp_none')) { |
| | | // OPEN |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | component.set('v.loginEdit',true); |
| | | if (component.get('v.mode') == 'edit' || component.get('v.mode') == 'copy') { |
| | | var select_data = ''; |
| | | if (component.get('v.mode') == 'edit') { |
| | | select_data = component.get('v.select_report_data'); |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | select_data = component.get('v.select_report_data_radio'); |
| | | } |
| | | |
| | | 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++) { |
| | | if (reports[i]['Agency_Hospital__c'] == select_data['Agency_Hospital__c']) { |
| | | Agency_Hospital_text = reports[i]['Agency_Hospital__r']['Name']; |
| | | Agency_Hospital_parent_id = reports[i]['Agency_Hospital__r']['Hospital__c']; |
| | | } |
| | | } |
| | | component.set('v.hospital', Agency_Hospital_text); |
| | | component.set('v.hospitalId', Agency_Hospital_parent_id); |
| | | component.set('v.hospitalLinkId', select_data['Agency_Hospital__c']); |
| | | component.find('new_con').set('v.disabled', false); |
| | | } |
| | | |
| | | // 科室 |
| | | if (select_data['Department_Cateogy__c'] != '') { |
| | | this.set_selected(component, 'select_department', select_data['Department_Cateogy__c']); |
| | | } |
| | | // 拜访人 |
| | | component.set('v.default_select_doctor_id', select_data['doctor2__c']); |
| | | this.set_doctor_list(component); |
| | | |
| | | // 活动区分 |
| | | if (select_data['Purpose_Type__c'] != '') { |
| | | this.set_selected(component, 'select_purpose_type', select_data['Purpose_Type__c']); |
| | | this.select_purpose_type(component); |
| | | } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 |
| | | if (select_data['SupportNeeds__c'] != '') { |
| | | this.set_selected(component, 'SupportNeeds__c', select_data['SupportNeeds__c']); |
| | | } |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 結果 |
| | | if (select_data['Result__c'] != '' && typeof select_data['Result__c'] !== "undefined") { |
| | | component.find('select_result').set('v.value', select_data['Result__c']); |
| | | } |
| | | |
| | | // 询价 |
| | | var report_id = component.get('v.edit_copy_select_report_id'); |
| | | if (report_id != "") { |
| | | var select_opp = ''; |
| | | var select_product_category1 = ''; |
| | | var select_product_category2 = ''; |
| | | var select_product_category3 = ''; |
| | | var reportDate; |
| | | var i = 0; |
| | | for (i = 0; i < reports.length; i++) { |
| | | if (report_id == reports[i]["Id"]) { |
| | | select_opp = reports[i]["Opportunity__c"]; |
| | | select_product_category1 = reports[i]["Product_Category1__c"]; |
| | | select_product_category2 = reports[i]["Product_Category2__c"]; |
| | | select_product_category3 = reports[i]["Product_Category3__c"]; |
| | | reportDate = reports[i]["Report_Date__c"]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | // 询价 |
| | | if (select_opp != null && select_opp != '') { |
| | | var select_opp_name = component.get('v.reports')[i].OppName__c; |
| | | component.set('v.data.Opportunity__c', select_opp); |
| | | if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | var values = [{ |
| | | type: 'Agency_Opportunity__c', |
| | | id: select_opp, |
| | | label: select_opp_name, |
| | | icon : { |
| | | url:'/img/icon/t4v35/custom/custom12_120.png', |
| | | backgroundColor:'dc71d1', |
| | | alt:'Agency_Opportunity__c' |
| | | } |
| | | }]; |
| | | component.set('v.data.Opportunity__c', select_opp); |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | } else { |
| | | component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', select_opp_name); |
| | | } |
| | | } |
| | | |
| | | // 产品区分 |
| | | if (select_product_category1 != null && select_product_category1 != '') { |
| | | component.find('select_Product1').set('v.value', select_product_category1); |
| | | } |
| | | if (select_product_category2 != null && select_product_category2 != '') { |
| | | component.find('select_Product2').set('v.value', select_product_category2); |
| | | } |
| | | if (select_product_category3 != null && select_product_category3 != '') { |
| | | component.find('select_Product3').set('v.value', select_product_category3); |
| | | } |
| | | |
| | | if (reportDate != null) { |
| | | console.log('reportDate = ' + reportDate); |
| | | component.set('v.data.Report_Date__c', reportDate); |
| | | } |
| | | |
| | | component.set('v.edit_copy_select_report_id', ""); |
| | | } |
| | | } |
| | | setTimeout(function() { |
| | | component.set('v.loginEdit',false); |
| | | }, 1000); |
| | | } else { |
| | | // CLOSE |
| | | |
| | | var select_report_data = component.get('v.select_report_data'); |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | | var Product_Category1__c = component.find('select_Product1').get('v.value'); |
| | | var Product_Category2__c = component.find('select_Product2').get('v.value'); |
| | | var Product_Category3__c = component.find('select_Product3').get('v.value'); |
| | | var Result__c = component.find('select_result').get('v.value'); |
| | | |
| | | if (select_report_data !== null) { |
| | | if (typeof select_report_data['Opportunity__c'] === "undefined") { |
| | | select_report_data['Opportunity__c'] = ""; |
| | | } |
| | | if (typeof select_report_data['Product_Category1__c'] === "undefined") { |
| | | select_report_data['Product_Category1__c'] = ""; |
| | | } |
| | | if (typeof select_report_data['Product_Category2__c'] === "undefined") { |
| | | select_report_data['Product_Category2__c'] = ""; |
| | | } |
| | | if (typeof select_report_data['Product_Category3__c'] === "undefined") { |
| | | select_report_data['Product_Category3__c'] = ""; |
| | | } |
| | | if (typeof select_report_data['Result__c'] === "undefined") { |
| | | select_report_data['Result__c'] = ""; |
| | | } |
| | | } |
| | | |
| | | if (component.get('v.mode') == 'new') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建周报?'; |
| | | |
| | | if (!Report_Date__c && |
| | | !Agency_Hospital__c && |
| | | !Department_Cateogy__c && |
| | | !doctor2__c && |
| | | !Purpose_Type__c && |
| | | !SupportNeeds__c&&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | !Opportunity__c && |
| | | !Product_Category1__c && |
| | | !Product_Category2__c && |
| | | !Product_Category3__c && |
| | | !Result__c) |
| | | { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'copy') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃新建周报?'; |
| | | |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['Purpose_Type__c'] == Purpose_Type__c && |
| | | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | select_report_data['Opportunity__c'] == Opportunity__c && |
| | | select_report_data['Product_Category1__c'] == Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == Product_Category2__c && |
| | | select_report_data['Product_Category3__c'] == Product_Category3__c && |
| | | select_report_data['Result__c'] == Result__c) |
| | | { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } else if (component.get('v.mode') == 'edit') { |
| | | var confirm_title = '警告!' |
| | | var confirm_text = '放弃编辑周报?'; |
| | | |
| | | if (select_report_data['Report_Date__c'] == Report_Date__c && |
| | | select_report_data['Agency_Hospital__c'] == Agency_Hospital__c && |
| | | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && |
| | | select_report_data['doctor2__c'] == doctor2__c && |
| | | select_report_data['Purpose_Type__c'] == Purpose_Type__c && |
| | | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 |
| | | select_report_data['Opportunity__c'] == Opportunity__c && |
| | | select_report_data['Product_Category1__c'] == Product_Category1__c && |
| | | select_report_data['Product_Category2__c'] == Product_Category2__c && |
| | | select_report_data['Product_Category3__c'] == Product_Category3__c && |
| | | select_report_data['Result__c'] == Result__c) |
| | | { |
| | | this.allclear(component); |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | } else { |
| | | this.close_confirm(component, confirm_title, confirm_text); |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | |
| | | close_confirm : function(component, title, text) { |
| | | var confirm_status = component.get('v.confirm_status'); |
| | | component.set('v.modal_confirm_title', title); |
| | | component.set('v.modal_confirm_text', text); |
| | | var modal_window = component.find('modal_window'); |
| | | var modal_bg = component.find('modal_bg'); |
| | | var modal_confirm = component.find('modal_confirm'); |
| | | var modal_confirm_bg = component.find('modal_confirm_bg'); |
| | | |
| | | if (confirm_status == 0) { |
| | | $A.util.addClass(modal_window, 'disp_none'); |
| | | $A.util.addClass(modal_bg, 'disp_none'); |
| | | $A.util.removeClass(modal_confirm, 'disp_none'); |
| | | $A.util.removeClass(modal_confirm_bg, 'disp_none'); |
| | | } else if (confirm_status == 1) { |
| | | // 是 |
| | | $A.util.addClass(modal_confirm, 'disp_none'); |
| | | $A.util.addClass(modal_confirm_bg, 'disp_none'); |
| | | component.set('v.mode', ''); |
| | | this.allclear(component); |
| | | component.set('v.reports_now', ""); |
| | | component.set('v.reports_now_count', 0); |
| | | component.set('v.confirm_status', 0); |
| | | } else if (confirm_status == 2) { |
| | | // 否 |
| | | $A.util.removeClass(modal_window, 'disp_none'); |
| | | $A.util.removeClass(modal_bg, 'disp_none'); |
| | | $A.util.addClass(modal_confirm, 'disp_none'); |
| | | $A.util.addClass(modal_confirm_bg, 'disp_none'); |
| | | component.set('v.confirm_status', 0); |
| | | } |
| | | }, |
| | | |
| | | new_report : function(component, event, helper) { |
| | | component.set('v.mode', 'new'); |
| | | component.set('v.dialog_type', '新建'); |
| | | var select_date = component.find('select_date').get('v.value'); |
| | | var select_agency = component.find('select_agency_person').get('v.value'); |
| | | component.set('v.selected_date', select_date); |
| | | var name = component.get('v.selected_agency_person'); |
| | | var ret = this.create_report_header(component, name, select_agency, select_date); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | this.set_aws_url(component,'Agency_Contact__c') |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | }, |
| | | |
| | | copy_button : function(component, event, helper) { |
| | | this.allclear(component); |
| | | component.set('v.mode', 'copy'); |
| | | component.set('v.dialog_type', '新建'); |
| | | var select_report_data = component.get('v.select_report_data_radio'); |
| | | component.set('v.loadOpp', true); |
| | | // 週 |
| | | var now = new Date(); |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1)); |
| | | var select_date = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(); |
| | | this.set_selected(component, 'select_date', select_date); |
| | | component.set('v.selected_date', select_date); |
| | | |
| | | // 担当 |
| | | var select_agency = select_report_data['Person_In_Charge2__c']; |
| | | var new_label = this.get_agency_person_name(component, select_agency); |
| | | component.set('v.selected_agency_person', new_label); |
| | | this.set_selected(component, 'select_agency_person', select_agency); |
| | | |
| | | this.new_button_disabled(component, event, helper); |
| | | |
| | | var name = component.get('v.selected_agency_person'); |
| | | |
| | | component.set('v.edit_copy_select_report_id', select_report_data['Id']); |
| | | component.set('v.select_report_data', select_report_data); |
| | | |
| | | var ret = this.create_report_header(component, name, select_agency, select_date); |
| | | }, |
| | | |
| | | change_report_radio : function(component, event, helper) { |
| | | var reports = component.get('v.reports'); |
| | | for (var i = 0; i < reports.length; i++) { |
| | | if (reports[i].Name == event.getSource().get('v.label')) { |
| | | component.set('v.select_report_data_radio', reports[i]); |
| | | component.find('copy_button').set('v.disabled', false); |
| | | break; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | edit_button : function(component, event, helper) { |
| | | component.set('v.login', true); |
| | | this.allclear(component); |
| | | component.set('v.loadOpp', true); |
| | | var index = event.getSource().get('v.value'); |
| | | component.set('v.select_report_data', component.get('v.reports')[index]); |
| | | component.set('v.mode', 'edit'); |
| | | component.set('v.dialog_type', '编辑'); |
| | | |
| | | var select_date = component.get('v.reports')[index].Submit_date__c; |
| | | var select_agency = component.get('v.reports')[index].Person_In_Charge2__c; |
| | | var text_tmp = select_date.split('-'); |
| | | var select_date_text = text_tmp[0] + '/' + Number(text_tmp[1]) + '/' + Number(text_tmp[2]); |
| | | component.set('v.selected_date', select_date_text); |
| | | var name = component.get('v.reports')[index].Person_In_Charge2__r.Name; |
| | | |
| | | this.set_selected(component, 'select_agency_person', select_agency); |
| | | this.new_button_disabled(component, event, helper); |
| | | |
| | | var new_label = this.get_agency_person_name(component, select_agency); |
| | | component.set('v.selected_agency_person', new_label); |
| | | |
| | | component.set('v.edit_copy_select_report_id', component.get('v.reports')[index].Id); |
| | | |
| | | var ret = this.create_report_header(component, name, select_agency, select_date); |
| | | }, |
| | | |
| | | save_report : function(component, event, helper) { |
| | | |
| | | // 20220222 PI改造 by Bright--start |
| | | let doctor2Name = ''; |
| | | let visitortitle = ''; |
| | | for(let op of component.find('select_doctor').get('v.options')){ |
| | | if (op.selected) { |
| | | doctor2Name = op.label; |
| | | visitortitle = op.Doctor_Division1__c; |
| | | } |
| | | } |
| | | // 20220222 PI改造 by Bright--end |
| | | |
| | | |
| | | component.find('save_button').set('v.disabled', true); |
| | | |
| | | var Report_Date__c = component.get('v.data.Report_Date__c'); |
| | | // alert('Report_Date__c'+Report_Date__c); |
| | | var Person_In_Charge2__c = ""; |
| | | var Submit_date__c = ""; |
| | | if (component.get('v.mode') == 'edit') { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = component.get('v.select_report_data').Submit_date__c; |
| | | // alert('Submit_date__c'+Submit_date__c); |
| | | |
| | | |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.get('v.select_report_data').Person_In_Charge2__c; |
| | | } else { |
| | | // 周 Submit_date__c |
| | | Submit_date__c = this.get_date_string(component.find('select_date').get('v.value')); |
| | | // alert('Submit_date__c'+Submit_date__c); |
| | | |
| | | // 担当 Person_In_Charge2__c |
| | | Person_In_Charge2__c = component.find('select_agency_person').get('v.value'); |
| | | } |
| | | // Agency_Report_Header__c |
| | | var Agency_Report_Header__c = component.get('v.agency_report_header_id'); |
| | | |
| | | // 医院 Agency_Hospital__c (Agency_Hospital_Link__c) |
| | | var Agency_Hospital__c = component.get('v.hospitalLinkId'); |
| | | |
| | | // 科室 Department_Cateogy__c |
| | | var Department_Cateogy__c = component.find('select_department').get('v.value'); |
| | | |
| | | // 拜访人 doctor2__c |
| | | var doctor2__c = component.find('select_doctor').get('v.value'); |
| | | |
| | | // 活动区分 Purpose_Type__c |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 SupportNeeds__c |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 询价 Opportunity__c |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | | |
| | | var StageName__c = component.find('select_stageName').get('v.value'); |
| | | var Amount__c = component.get('v.oppdata.Amount__c') != null ? component.get('v.oppdata.Amount__c').toString() : ''; |
| | | var OCMSale_Price__c = component.get('v.oppdata.OCMSale_Price__c') != null ? component.get('v.oppdata.OCMSale_Price__c').toString() : ''; |
| | | var Close_Forecasted_Date__c = component.get('v.oppdata.Close_Forecasted_Date__c'); |
| | | |
| | | var StageName__c_o = component.get('v.StageName__c_o'); |
| | | var Amount__c_o = component.get('v.Amount__c_o'); |
| | | var OCMSale_Price__c_o = component.get('v.OCMSale_Price__c_o'); |
| | | var Close_Forecasted_Date__c_o = component.get('v.Close_Forecasted_Date__c_o'); |
| | | if (StageName__c_o == undefined) StageName__c_o = ''; |
| | | if (Amount__c_o == undefined) Amount__c_o = ''; |
| | | if (OCMSale_Price__c_o == undefined) OCMSale_Price__c_o = ''; |
| | | if (Close_Forecasted_Date__c_o == undefined) Close_Forecasted_Date__c_o = ''; |
| | | if (StageName__c == StageName__c_o && OCMSale_Price__c_o == OCMSale_Price__c && Amount__c == Amount__c_o && Close_Forecasted_Date__c == Close_Forecasted_Date__c_o) { |
| | | StageName__c = ''; |
| | | Amount__c = ''; |
| | | OCMSale_Price__c = ''; |
| | | Close_Forecasted_Date__c = ''; |
| | | } |
| | | |
| | | // 产品区分 Product_Category__c (ProductTypes__c) |
| | | var Product_Category1__c = component.find('select_Product1').get('v.value'); |
| | | var Product_Category2__c = component.find('select_Product2').get('v.value'); |
| | | var Product_Category3__c = component.find('select_Product3').get('v.value'); |
| | | |
| | | // 結果 Result__c |
| | | var Result__c = component.find('select_result').get('v.value'); |
| | | |
| | | // バリデーション |
| | | var error = []; |
| | | if (!Report_Date__c) { error.push("活动日 不存在"); } |
| | | if (!Submit_date__c) { error.push("周 不存在"); } |
| | | var rDate = new Date(Report_Date__c); |
| | | var sDate = new Date(Submit_date__c); |
| | | sDate.setDate(sDate.getDate() - 1); |
| | | if (rDate < sDate) {error.push('活动日必须是本周!'); } |
| | | sDate.setDate(sDate.getDate() + 7); |
| | | if (rDate >= sDate) {error.push('活动日必须是本周!'); } |
| | | |
| | | if (!Person_In_Charge2__c) { error.push("担当 不存在"); } |
| | | if (!Agency_Report_Header__c) { this.error("Report Header Id 不存在"); } |
| | | if (!Agency_Hospital__c) { error.push("医院 不存在"); } |
| | | if (!Department_Cateogy__c) { error.push("科室 不存在"); } |
| | | if (!doctor2__c) { error.push("拜访人 不存在"); } |
| | | if (!Purpose_Type__c) { error.push("活动区分 不存在"); } |
| | | // if (!SupportNeeds__c) { error.push("支援需求 不存在"); } |
| | | if (!Opportunity__c) { Opportunity__c = ""; } |
| | | if (!Product_Category1__c) { error.push("产品区分1 不存在"); } |
| | | if (Purpose_Type__c && (Purpose_Type__c.substr(-3) == 'SIS' || Purpose_Type__c.substr(-3) == 'OPD')) { |
| | | if (!Result__c) { error.push("结果 不存在"); } |
| | | } |
| | | for (var i = 0; i < error.length; i++) { |
| | | this.warning(error[i]); |
| | | } |
| | | if (error.length > 0) { |
| | | component.find('save_button').set('v.disabled', false); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // 保存処理 |
| | | component.set('v.loginEdit',true); |
| | | if (component.get('v.mode') == 'edit') { |
| | | var Agency_Report__c = component.get('v.select_report_data').Id; |
| | | var action = component.get('c.editAgencyReport'); |
| | | debugger |
| | | // alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c); |
| | | action.setParams({ |
| | | "Agency_Report_Id" : Agency_Report__c, |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | | "Person_In_Charge2" : Person_In_Charge2__c, |
| | | "doctor" : doctor2__c, |
| | | "Submit_date" : Submit_date__c, |
| | | "Product_Category1" : Product_Category1__c, |
| | | "Product_Category2" : Product_Category2__c, |
| | | "Product_Category3" : Product_Category3__c, |
| | | "Result" : Result__c, |
| | | "Opportunity" : Opportunity__c, |
| | | "StageName" : StageName__c, |
| | | "oppAmount" : Amount__c, |
| | | "oppOCMPrice" : OCMSale_Price__c, |
| | | "Close_Forecasted_Date" : Close_Forecasted_Date__c, |
| | | "Report_Date" : Report_Date__c, |
| | | }); |
| | | |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | this.success('编辑保存成功'); |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | |
| | | var select_agency_list = component.get('v.allselectlist').AgencyPerson__c; |
| | | for (var i = 0; i < select_agency_list.length; i++) { |
| | | if (select_agency_list[i].value == component.get('v.select_report_data').Person_In_Charge2__c) { |
| | | select_agency_list[i].selected = true; |
| | | } else { |
| | | select_agency_list[i].selected = false; |
| | | } |
| | | } |
| | | component.find('select_agency_person').set('v.options', select_agency_list); |
| | | |
| | | component.set('v.update_select_report_data_id', report_id); |
| | | this.get_reports_edit(component, event, helper, component.get('v.select_report_data').Submit_date__c, component.get('v.select_report_data').Person_In_Charge2__c); |
| | | |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | else{ |
| | | // var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | | // alert(JSON.stringify(error[0].fieldErrors)); |
| | | // alert(JSON.stringify(error[0].fieldErrors.next())); |
| | | // alert(JSON.stringify(error[0].fieldErrors.next()[0])); |
| | | // if (this.error(response.getError()[0].message)) |
| | | // else () { |
| | | // error[0].fieldErrors[0] |
| | | // } |
| | | this.error('save_report failed.'); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } else { |
| | | /* Save (New & Copy) */ |
| | | |
| | | var action = component.get('c.saveAgencyReport'); |
| | | debugger; |
| | | // alert(SupportNeeds__c); |
| | | action.setParams({ |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | | "Person_In_Charge2" : Person_In_Charge2__c, |
| | | "doctor" : doctor2__c, |
| | | "Submit_date" : Submit_date__c, |
| | | "Product_Category1" : Product_Category1__c, |
| | | "Product_Category2" : Product_Category2__c, |
| | | "Product_Category3" : Product_Category3__c, |
| | | "Result" : Result__c, |
| | | "Opportunity" : Opportunity__c, |
| | | "StageName" : StageName__c, |
| | | "oppAmount" : Amount__c, |
| | | "oppOCMPrice" : OCMSale_Price__c, |
| | | "Close_Forecasted_Date" : Close_Forecasted_Date__c, |
| | | "Report_Date" : Report_Date__c, |
| | | }); |
| | | |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | this.success('保存成功'); |
| | | var report_id = response.getReturnValue(); |
| | | component.set('v.create_agency_report_id', report_id); |
| | | |
| | | this.get_reports_edit(component, event, helper, component.find('select_date').get('v.value'), component.find('select_agency_person').get('v.value')); |
| | | |
| | | // モーダルウィンドウ内の一覧用 |
| | | var action2 = component.get('c.getReportsById'); |
| | | action2.setParams({ |
| | | "report_id" : report_id, |
| | | }); |
| | | action2.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var res = response.getReturnValue(); |
| | | var reports_now = component.get('v.reports_now'); |
| | | var reports_now_count = 0; |
| | | if (reports_now.length > 0 && reports_now != "") { |
| | | reports_now_count = reports_now.length; |
| | | } |
| | | |
| | | // Save&New時のウィンドウ内データ一覧 |
| | | if (res.length > 0) { |
| | | // 20220222 PI改造 by Bright--start |
| | | res[0].doctor2NameOrigin = doctor2Name; |
| | | res[0].visitorTitleOrigin = visitortitle; |
| | | // 20220222 PI改造 by Bright--end |
| | | reports_now[reports_now_count] = res[0]; |
| | | |
| | | reports_now.sort(function(a,b) { |
| | | if(a.Name>b.Name) return -1; |
| | | if(a.Name < b.Name) return 1; |
| | | return 0; |
| | | }); |
| | | |
| | | component.set('v.reports_now', reports_now); |
| | | component.set('v.reports_now_count', reports_now.length); |
| | | var data_list = component.find('modal_data_list_tr'); |
| | | } |
| | | } |
| | | else{ |
| | | this.error('get_reports_now failed.'); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action2); |
| | | |
| | | this.allclear(component); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | else{ |
| | | var error = response.getError(); |
| | | // alert(JSON.stringify(error)); |
| | | this.error('saveAgencyReport failed.'); |
| | | component.find('save_button').set('v.disabled', false); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }, |
| | | |
| | | allclear : function(component) { |
| | | var clear = [{label:'', value:'', selected:true}]; |
| | | component.set('v.hospital', ''); |
| | | component.set('v.hospitalId', ''); |
| | | component.set('v.hospitalLinkId', ''); |
| | | component.find('new_con').set('v.disabled', true); |
| | | component.find('select_doctor').set('v.options', clear); |
| | | component.set('v.doctor_title', ''); |
| | | component.find('select_department').set('v.options', this.conv_selected(component.get('v.allselectlist.Department_Cateogy__c'))); |
| | | component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.Purpose_Type__c'))); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(component.get('v.allselectlist.SupportNeeds__c'))); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | component.find('select_Product1').set('v.value',''); |
| | | component.find('select_Product2').set('v.value',''); |
| | | component.find('select_Product3').set('v.value',''); |
| | | console.log('reportDate = 空'); |
| | | component.set('v.data.Report_Date__c', ''); |
| | | component.set('v.oppdata.Close_Forecasted_Date__c', ''); |
| | | component.set('v.oppdata.Amount__c', ''); |
| | | component.set('v.oppdata.OCMSale_Price__c', ''); |
| | | component.set('v.oppdata.StageName__c', ''); |
| | | // component.set('v.oppdata', ''); |
| | | component.set('v.Close_Forecasted_Date__c_o', ''); |
| | | component.set('v.Amount__c_o', ''); |
| | | component.set('v.OCMSale_Price__c_o', ''); |
| | | component.set('v.StageName__c_o', ''); |
| | | $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.find('input-opportunity').set("v.body",[]); |
| | | // if (component.find('input-product-category1')) |
| | | // component.find('input-product-category1').get("v.body")[0].set('v.values', values); |
| | | // if (component.find('input-product-category2')) |
| | | // component.find('input-product-category2').get("v.body")[0].set('v.values', values); |
| | | // if (component.find('input-product-category3')) |
| | | // component.find('input-product-category3').get("v.body")[0].set('v.values', values); |
| | | component.find('select_result').set('v.value', ''); |
| | | this.select_purpose_type(component); |
| | | }, |
| | | |
| | | report_date_list : function(component, event, helper, count) { |
| | | var ret_obj = []; |
| | | var now = new Date(); |
| | | for (var i = 0; i < count; i++) { |
| | | |
| | | var start_day = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() + 1 - (i * 7))); |
| | | var end_day = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (7 - now.getDay()) - (i * 7)); |
| | | |
| | | var start_day_show = new Date(now.getFullYear(), now.getMonth(), (now.getDate() - now.getDay() - (i * 7))); |
| | | var end_day_show = new Date(now.getFullYear(), now.getMonth(), now.getDate() + (6 - now.getDay()) - (i * 7)); |
| | | var date_text = start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate() + '~' + end_day.getFullYear() + '/' + (end_day.getMonth() + 1) + '/' + end_day.getDate(); |
| | | if (i == 0) { |
| | | ret_obj.push({ |
| | | selected : true, |
| | | value : start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label : start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | }); |
| | | } else { |
| | | ret_obj.push({ |
| | | selected : false, |
| | | value : start_day.getFullYear() + '/' + (start_day.getMonth() + 1) + '/' + start_day.getDate(), |
| | | label : start_day_show.getFullYear() + '/' + (start_day_show.getMonth() + 1) + '/' + start_day_show.getDate() + '~' + end_day_show.getFullYear() + '/' + (end_day_show.getMonth() + 1) + '/' + end_day_show.getDate(), |
| | | }); |
| | | } |
| | | } |
| | | |
| | | component.find('select_date').set('v.options', ret_obj); |
| | | component.set('v.report_date_list', ret_obj); |
| | | }, |
| | | |
| | | create_report_header : function(component, name, s_agency, s_date) { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | this.error('get_date_string failed.'); |
| | | return false; |
| | | } |
| | | |
| | | var head_key = this.create_header_input_key(s_agency, s_date); |
| | | component.set('v.agency_report_header', head_key); |
| | | if (head_key == false) { |
| | | this.error('create_header_input_key failed.'); |
| | | return false; |
| | | } |
| | | |
| | | var key2 = s_date.replace(/-/g, ''); |
| | | var action = component.get('c.createReportHeader'); |
| | | |
| | | action.setParams({ |
| | | "name" : name, |
| | | "s_date" : s_date, |
| | | "s_agency" : s_agency, |
| | | "head_key" : head_key, |
| | | }); |
| | | |
| | | component.set('v.login',true); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var res = response.getReturnValue(); |
| | | component.set('v.agency_report_header_id', res); |
| | | component.set('v.login',false); |
| | | this.toggle_report(component); |
| | | } |
| | | else{ |
| | | this.error('createReportHeader callback failed.'); |
| | | component.set('v.login',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | create_header_input_key : function(agency_id, s_date) { |
| | | if (typeof(s_date) != 'string') { |
| | | s_date = this.get_date_string(s_date); |
| | | if (s_date == false) { |
| | | this.error('get_date_string in create_header_input_key.') |
| | | return false; |
| | | } |
| | | } |
| | | if (!agency_id || !s_date) { |
| | | return false; |
| | | } |
| | | |
| | | s_date = s_date.replace(/-/g, ''); |
| | | var headkey = agency_id + ":" + s_date; |
| | | |
| | | return headkey; |
| | | }, |
| | | |
| | | /* typeof is not cool |
| | | * @ret : String, Boolean, Date, Error, Array, Function, Null, Undefined, etc |
| | | */ |
| | | object_type : function(obj) { |
| | | var obj_type = Object.prototype.toString.call(obj).slice(8, -1); |
| | | return obj_type; |
| | | }, |
| | | |
| | | // create yyyy-mm-dd string |
| | | get_date_string : function(val) { |
| | | if (typeof(val) == 'string') { |
| | | if (val.match(/^\d{4}\/\d{1,2}\/\d{1,2}$/)) { |
| | | val = val.replace(/[\/]/g, '-'); |
| | | var tmp = val.split('-'); |
| | | if (tmp[1].length == 1) { |
| | | tmp[1] = '0' + tmp[1]; |
| | | } |
| | | if (tmp[2].length == 1) { |
| | | tmp[2] = '0' + tmp[2]; |
| | | } |
| | | val = tmp[0] + '-' + tmp[1] + '-' + tmp[2]; |
| | | } else if (val.match(/^\d{4}-\d{1,2}-\d{1,2}$/)) { |
| | | //ok |
| | | } else { |
| | | return false; |
| | | } |
| | | } else if (this.object_type(val) == 'Date') { |
| | | var mm = val.getMonth() + 1; |
| | | if (String(mm).length == 1) { |
| | | mm = '0' + mm; |
| | | } |
| | | |
| | | var dd = ''; |
| | | if (String(val.getDate()).length == 1) { |
| | | dd = '0' + val.getDate(); |
| | | } else { |
| | | dd = val.getDate(); |
| | | } |
| | | |
| | | val = val.getFullYear() + '-' + mm + '-' + dd; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | return val; |
| | | }, |
| | | |
| | | searchHos : function(component, event, helper) { |
| | | var hospital_name = event.getParam("value"); |
| | | var action = component.get("c.getHospitalList"); |
| | | debugger; |
| | | action.setParams({"hospital_name": hospital_name}); |
| | | |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if(state === "SUCCESS") { |
| | | var hospital_list = component.find('hospital_list'); |
| | | var hosList = response.getReturnValue(); |
| | | if (hosList.length > 0) { |
| | | $A.util.addClass(hospital_list, 'slds-is-open'); |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | | component.set("v.hospitalList", response.getReturnValue()); |
| | | } else { |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | hideSearch : function(component, event, helper) { |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | }, |
| | | |
| | | selectHos : function(component, event, helper) { |
| | | debugger |
| | | var hospital_list = component.find('hospital_list'); |
| | | $A.util.removeClass(hospital_list, 'slds-is-open'); |
| | | var accname = event.currentTarget.dataset.accname; |
| | | var accid = event.currentTarget.dataset.accid; |
| | | var hospital_data = component.get('v.hospitalList'); |
| | | for (var i = 0; i < hospital_data.length; i++) { |
| | | if (hospital_data[i].Hospital__c == accid) { |
| | | 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); |
| | | } |
| | | } |
| | | component.set("v.hospital", accname); |
| | | component.set("v.hospitalId", accid); |
| | | this.set_doctor_list(component); |
| | | this.opportunityChange(component, event, helper); |
| | | }, |
| | | |
| | | select_purpose_type : function(component) { |
| | | var purpose_type = component.find('select_purpose_type').get('v.value'); |
| | | if (purpose_type != null && purpose_type != undefined && purpose_type.substr(-3) == 'OPD' || purpose_type.substr(-3) == 'SIS') { |
| | | var result = component.find('result'); |
| | | $A.util.removeClass(result, 'disp_none'); |
| | | } else { |
| | | component.find('select_result').set('v.value', ''); |
| | | var result = component.find('result'); |
| | | $A.util.addClass(result, 'disp_none'); |
| | | } |
| | | this.select_department(component, null, null); |
| | | }, |
| | | |
| | | doctor_change : function(component, event, helper) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var doctor_value = component.find('select_doctor').get('v.value'); |
| | | var doctor_list = component.get('v.doctor_list'); |
| | | var flg = false; |
| | | for (var i = 0; i < doctor_list.length; i++) { |
| | | if (doctor_list[i].value == doctor_value) { |
| | | <<<<<<< HEAD |
| | | component.set( |
| | | 'v.doctor_title', |
| | | doctor_list[i].Doctor_Division1__c |
| | | ); |
| | | ======= |
| | | component.set('v.doctor_title', doctor_list[i].Doctor_Division1__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | flg = true; |
| | | break; |
| | | } |
| | |
| | | } |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | <<<<<<< HEAD |
| | | set_aws_url: function (component, sobject) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | |
| | | } else { |
| | | this.error('AWS url/token error.'); |
| | | component.set('v.loginEdit', false); |
| | | ======= |
| | | set_aws_url : function(component,sobject) { |
| | | var action = component.get('c.getAwsurl'); |
| | | action.setParams({ |
| | | "sobj" : sobject, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var awsmap = this.conv_selected(response.getReturnValue()); |
| | | component.set('v.AWStoken',awsmap.token); |
| | | component.set('v.AWSinsert',awsmap.newUrl); |
| | | component.set('v.AWSsearch',awsmap.searchUrl); |
| | | component.set('v.AWStransactionURL',awsmap.transactionURL); |
| | | } |
| | | else{ |
| | | this.error('AWS url/token error.'); |
| | | component.set('v.loginEdit',false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | insert_agencycontact: function ( |
| | | component, |
| | | token, |
| | |
| | | helper, |
| | | hospitalName |
| | | ) { |
| | | ======= |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper,hospitalName) { |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | // AWSService.insert(newUrl,payload,function(result){ |
| | | // if(result.status == '0'){ |
| | | // $A.getCallback(function(){ |
| | |
| | | // component.find('OppMessage').setError('AWS insert error.'); |
| | | // } |
| | | // },token); |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | fetch(newUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | <<<<<<< HEAD |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | |
| | | console.log(acMap); |
| | | if (acMap.AgencyContactId != '') { |
| | | //确认事务 |
| | | ======= |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | if(result.status == '0'){ |
| | | $A.getCallback(function(){ |
| | | helper.to_agencycontact(component,result,agencyHospitalid); |
| | | })(); |
| | | }else{ |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.loginEdit',false); |
| | | if(result.status == '129'){ |
| | | component.find('OppMessage').setError('该客户人员名字已存在,在'+hospitalName+'医院,请修改'); |
| | | }else{ |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | } |
| | | } |
| | | }).catch(error => { |
| | | console.log('AWS insert error:' + error) |
| | | component.set('v.loginEdit',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | |
| | | }, |
| | | |
| | | to_agencycontact : function(component,result,agencyHospitalid) { |
| | | var action = component.get('c.saveAgencyContact'); |
| | | action.setParams({ |
| | | "name" : result.object[0].name, |
| | | //"nameEncrypt" : result.object[0].nameEncrypt, |
| | | "type" : result.object[0].type, |
| | | //"typeEncrypt" : result.object[0].typeEncrypt, |
| | | "doctorDivision1" : result.object[0].doctorDivision1, |
| | | //"doctorDivision1Encrypt" : result.object[0].doctorDivision1Encrypt, |
| | | "agencyHospitalid" : agencyHospitalid, |
| | | "awsid" : result.object[0].dataId, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var acMap = this.conv_selected(response.getReturnValue()); |
| | | console.log(acMap); |
| | | if(acMap.AgencyContactId != ''){ |
| | | //确认事务 |
| | | >>>>>>> LEXCommunityLiJun |
| | | var token = component.get('v.AWStoken'); |
| | | var confirmUrl = component.get('v.AWStransactionURL'); |
| | | |
| | |
| | | data['sfRecordId'] = ''; |
| | | data['txId'] = result.txId; |
| | | |
| | | <<<<<<< HEAD |
| | | this.to_confirm( |
| | | component, |
| | | token, |
| | |
| | | } else { |
| | | this.error('agency contact insert error.'); |
| | | component.set('v.loginEdit', false); |
| | | ======= |
| | | this.to_confirm(component,token,confirmUrl,JSON.stringify(data)); |
| | | }else if(acMap.errormsg != ''){ |
| | | this.error(acMap.errormsg); |
| | | component.set('v.loginEdit',false); |
| | | }else { |
| | | this.error('agency contact insert id error.'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | } |
| | | else{ |
| | | this.error('agency contact insert error.'); |
| | | component.set('v.loginEdit',false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | to_confirm: function (component, token, confirmUrl, payload) { |
| | | ======= |
| | | to_confirm : function(component,token,confirmUrl,payload) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | fetch(confirmUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | <<<<<<< HEAD |
| | | }) |
| | | .then((data) => { |
| | | return data.json(); |
| | |
| | | var retMap = this.conv_selected(response.getReturnValue()); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | this.AWS_search(retMap, component); |
| | | ======= |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | if(result.status == '0' && result.hasOwnProperty('success') && result.success){ |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | this.success('.客户人员已创建。'); |
| | | this.set_doctor_list(component); |
| | | }else { |
| | | this.error('AWS confirm error.'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }).catch(error => { |
| | | this.error('AWS confirm error.'); |
| | | component.set('v.loginEdit',false); |
| | | }); |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | | set_doctor_list : function(component) { |
| | | var hospital_id = component.get('v.hospitalLinkId'); |
| | | if (hospital_id) { |
| | | component.set('v.loginEdit',true); |
| | | var action = component.get('c.getDoctorList'); |
| | | action.setParams({ |
| | | "hospital_id" : hospital_id, |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | var retMap = this.conv_selected(response.getReturnValue()); |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | this.AWS_search(retMap,component); |
| | | >>>>>>> LEXCommunityLiJun |
| | | /* |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | if (default_doctor != '' && res.length > 0) { |
| | |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.login',false); |
| | | */ |
| | | <<<<<<< HEAD |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | } else { |
| | | this.error('set_doctor_list failed.'); |
| | | component.set('v.loginEdit', false); |
| | | ======= |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | } |
| | | else{ |
| | | this.error('set_doctor_list failed.'); |
| | | component.set('v.loginEdit',false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | |
| | | }, |
| | | |
| | | // PIPL update Yin Mingjie 21/02/2022 start |
| | | <<<<<<< HEAD |
| | | AWS_search: function (retMap, component) { |
| | | ======= |
| | | AWS_search : function(retMap,component) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var token = retMap.sre.token; |
| | | var searchUrl = retMap.sre.searchUrl; |
| | | |
| | | var dataArr = new Array(); |
| | | for (const key in retMap) { |
| | | <<<<<<< HEAD |
| | | if (key == 'sre') { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | ======= |
| | | if (key == 'sre') {continue;} |
| | | dataArr.push(key); |
| | | } |
| | | if(dataArr.length == 0){ |
| | | component.set('v.loginEdit',false); |
| | | this.warning('没有找到符合条件的客户人员'); |
| | | return; |
| | | } |
| | | let obj= Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var data = JSON.stringify(obj); |
| | | this.search_agency_contact(token,searchUrl,data,retMap,component); |
| | | }, |
| | | |
| | | search_agency_contact : function(token,searchUrl,payload,retMap,component) { |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | if(result.status == '0'){ |
| | | this.to_doctor_list(result,retMap,component); |
| | | }else{ |
| | | this.error('AWS search status4 : ' + result.status); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | },component); |
| | | // fetch(searchUrl, { |
| | | // method: 'POST', |
| | | // body: payload, |
| | | // headers: { |
| | | // 'Content-Type': 'application/json', |
| | | // 'pi-token': token |
| | | // } |
| | | // }).then((data) => { |
| | | // return data.json(); |
| | | // }).then((result) => { |
| | | |
| | | // }).catch(error => { |
| | | // this.error('AWS search error.'); |
| | | // component.set('v.login',false); |
| | | // }); |
| | | }, |
| | | search_core : function(token,searchUrl,payload,callback,component) { |
| | | console.log('token = ' + token); |
| | | console.log('searchUrl = ' + searchUrl); |
| | | console.log('payload = ' + payload); |
| | | fetch(searchUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | | headers: { |
| | | 'Content-Type': 'application/json', |
| | | 'pi-token': token |
| | | } |
| | | }).then((data) => { |
| | | return data.json(); |
| | | }).then((result) => { |
| | | component.set('v.loginEdit',false); |
| | | if(callback)callback(result); |
| | | }).catch(error => { |
| | | console.log('error = ' + JSON.stringify(error)); |
| | | this.error('AWS search error.'); |
| | | component.set('v.loginEdit',false); |
| | | }); |
| | | }, |
| | | |
| | | to_doctor_list : function(result,retMap,component) { |
| | | var resls = result.object; |
| | | var res = []; |
| | | var space = {}; |
| | | space['label'] = ''; |
| | | space['selected'] = true; |
| | | space['value'] = ''; |
| | | res.push(space); |
| | | |
| | | for (var i = 0; i < resls.length; i++) { |
| | | var t = {}; |
| | | t['label'] = resls[i].name; |
| | | t['selected'] = false; |
| | | t['Doctor_Division1__c'] = resls[i].doctorDivision1; |
| | | t['value'] = retMap[resls[i].dataId].value; |
| | | res.push(t); |
| | | } |
| | | |
| | | var default_doctor = component.get('v.default_select_doctor_id'); |
| | | if (default_doctor != '' && res.length > 0) { |
| | | var doctor_title = ''; |
| | | for (var i = 0; i < res.length; i++) { |
| | | if (res[i].value == default_doctor) { |
| | | res[i].selected = true; |
| | | doctor_title = res[i].Doctor_Division1__c; |
| | | } else { |
| | | res[i].selected = false; |
| | | } |
| | | } |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | component.find('select_doctor').set('v.options', res); |
| | | component.set('v.doctor_title', doctor_title); |
| | | } else { |
| | |
| | | component.set('v.doctor_title', res[0].Doctor_Division1__c); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.loginEdit', false); |
| | | ======= |
| | | |
| | | component.set('v.default_select_doctor_id', ''); |
| | | component.set('v.doctor_list', res); |
| | | component.set('v.loginEdit',false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | }, |
| | | // PIPL update Yin Mingjie 21/02/2022 end |
| | | |
| | |
| | | // } |
| | | // options.splice(remove,1); |
| | | // }, |
| | | <<<<<<< HEAD |
| | | |
| | | opportunityChange: function (component, event, helper) { |
| | | debugger; |
| | |
| | | 'disp_none' |
| | | ); |
| | | } else if (opp_id != '') { |
| | | ======= |
| | | |
| | | 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'); |
| | | $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'); |
| | | } else if (opp_id == 'MALFORMED_ID') { |
| | | 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'); |
| | | } else if (opp_id != "") { |
| | | >>>>>>> LEXCommunityLiJun |
| | | var hospital_link_id = component.get('v.hospitalLinkId'); |
| | | if (hospital_link_id == '') { |
| | | this.warning('医院不存在'); |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | <<<<<<< HEAD |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | ======= |
| | | $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'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // } else { |
| | | <<<<<<< HEAD |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | return false; |
| | |
| | | action.setCallback(this, function (response) { |
| | | var state = response.getState(); |
| | | if (state == 'SUCCESS') { |
| | | ======= |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | return false; |
| | | } |
| | | var action = component.get('c.selectOpportunityByIdAndHospitalLinkId'); |
| | | action.setParams({ |
| | | "opportunity_id" : opp_id, |
| | | "agency_hospital_link_id" : component.get('v.hospitalLinkId'), |
| | | }); |
| | | |
| | | component.set('v.loginEdit',true); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | | if(state == 'SUCCESS'){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | var res = response.getReturnValue(); |
| | | if (res.length <= 0) { |
| | | if (component.get('v.data.Opportunity__c')) { |
| | |
| | | } |
| | | // ToDo需要测试手机上能运行不 |
| | | component.set('v.data.Opportunity__c', ''); |
| | | <<<<<<< HEAD |
| | | $A.util.addClass( |
| | | component.find('input-opportunity-stage'), |
| | | 'disp_none' |
| | |
| | | component.find('input-opportunity-blank'), |
| | | 'disp_none' |
| | | ); |
| | | ======= |
| | | $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'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // if ($A.get("$Browser.formFactor") == 'DESKTOP') { |
| | | // var values = []; |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // } else { |
| | | <<<<<<< HEAD |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | component.set('v.loginEdit', false); |
| | | ======= |
| | | // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | // } |
| | | component.set('v.loginEdit',false); |
| | | >>>>>>> LEXCommunityLiJun |
| | | return false; |
| | | } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy start |
| | |
| | | // // var values = []; |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.values', values); |
| | | // // } else { |
| | | <<<<<<< HEAD |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | ======= |
| | | // // component.find('input-opportunity').get("v.body")[0].set('v.selectedLabel', ''); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // // } |
| | | // component.set('v.login',false); |
| | | // return false; |
| | | // } |
| | | //SWAG-CKH5M8 【委托】周报关联询价,可选择询价范围调整 fy end |
| | | <<<<<<< HEAD |
| | | else { |
| | | component.set('v.loadOpp', false); |
| | | component.set('v.oppdata', res[0]); |
| | |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | ======= |
| | | else { |
| | | component.set('v.loadOpp', false); |
| | | component.set('v.oppdata',res[0]); |
| | | this.set_selected(component, 'select_stageName', res[0].StageName__c); |
| | | component.set('v.Close_Forecasted_Date__c_o', res[0].Close_Forecasted_Date__c); |
| | | component.set('v.Amount__c_o', res[0].Amount__c); |
| | | component.set('v.OCMSale_Price__c_o', res[0].OCMSale_Price__c); |
| | | component.set('v.StageName__c_o', res[0].StageName__c); |
| | | |
| | | $A.util.removeClass(component.find('input-opportunity-stage'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-amount1'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-amount2'), 'disp_none'); |
| | | $A.util.removeClass(component.find('input-opportunity-date'), 'disp_none'); |
| | | $A.util.addClass(component.find('input-opportunity-blank'), 'disp_none'); |
| | | } |
| | | |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | else{ |
| | | this.error('selectOpportunityByIdAndHospitalLinkId failed.'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | } |
| | | }, |
| | | |
| | | productcategoryChange1 : function(component, event, helper) { |
| | | var product_category_id = component.find('select_Product1').get('v.value'); |
| | | var pcId1 = component.find('select_Product2').get('v.value'); |
| | | var pcId2 = component.find('select_Product3').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find('select_Product1').set('v.value',''); |
| | | } |
| | | }, |
| | | productcategoryChange2 : function(component, event, helper) { |
| | | var product_category_id = component.find('select_Product2').get('v.value'); |
| | | var pcId1 = component.find('select_Product1').get('v.value'); |
| | | var pcId2 = component.find('select_Product3').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find('select_Product2').set('v.value',''); |
| | | } |
| | | }, |
| | | productcategoryChange3 : function(component, event, helper) { |
| | | var product_category_id = component.find('select_Product3').get('v.value'); |
| | | var pcId1 = component.find('select_Product1').get('v.value'); |
| | | var pcId2 = component.find('select_Product2').get('v.value'); |
| | | var p1bool = pcId1 != '' && pcId1 != null && pcId1 != undefined; |
| | | var p2bool = pcId2 != '' && pcId2 != null && pcId2 != undefined; |
| | | var p0bool = product_category_id != '' && product_category_id != null && product_category_id != undefined; |
| | | if ((p1bool && p0bool && product_category_id == pcId1) || (p2bool && p0bool && product_category_id == pcId2)) { |
| | | this.warning('不能选择同样的产品区分'); |
| | | component.find('select_Product3').set('v.value',''); |
| | | } |
| | | }, |
| | | |
| | | conv_selected : function(obj) { |
| | | for (var i = 0; i < obj.length; i++) { |
| | | if (obj[i].selected) { |
| | | if (obj[i].selected == 'true') { |
| | | obj[i].selected = true; |
| | | } else { |
| | | obj[i].selected = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | return obj; |
| | | }, |
| | | |
| | | set_selected : function (component, aura_id_name, value) { |
| | | var select_tmp = component.find(aura_id_name).get('v.options'); |
| | | if (select_tmp) { |
| | | for (var i = 0; i < select_tmp.length; i++) { |
| | | if (select_tmp[i].value == value) { |
| | | select_tmp[i].selected = true; |
| | | } else { |
| | | select_tmp[i].selected = false; |
| | | } |
| | | } |
| | | component.find(aura_id_name).set('v.options', select_tmp); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | }, |
| | | |
| | | success : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title" : "成功!", |
| | | "message" : message, |
| | | "type" : "success", |
| | | "duration" : "5000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | warning : function(message) { |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | toastEvent.setParams({ |
| | | "title": "警告!", |
| | | "message": message, |
| | | "type":"warning", |
| | | "duration" : "10000" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | error : function(message) { |
| | | // $('toastMessage.forceToastManager').css('white-space', 'pre-wrap'); |
| | | var toastEvent = $A.get("e.force:showToast"); |
| | | |
| | | toastEvent.setParams({ |
| | | "title": "错误!", |
| | | "message": message, |
| | | "type":"error", |
| | | "duration" : "sticky" |
| | | }); |
| | | toastEvent.fire(); |
| | | }, |
| | | |
| | | createCon : function(component, event, helper) { |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.removeClass(modal_newAC, 'disp_none'); |
| | | component.set('v.truthy', true); |
| | | // var modal_newAC = component.find('modal_newAC') |
| | | // $A.util.removeClass(modal_newAC, 'disp_none'); |
| | | }, |
| | | |
| | | // vivek start 添加验证 |
| | | // handleFormSubmit : function(component) { |
| | | // var showValidationError = false; |
| | | // var fields = component.find("newOpportunityField"); |
| | | // var vaildationFailReason = ''; |
| | | // var currentDate = new Date().toJSON().slice(0,10); |
| | | |
| | | // fields.forEach(function (field) { |
| | | // if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | // showValidationError = true; |
| | | // vaildationFailReason = "分类不能为空!"; |
| | | // }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){ |
| | | // showValidationError = true; |
| | | // vaildationFailReason = "医生区分(职务)不能为空!"; |
| | | // } |
| | | // }); |
| | | |
| | | // if (showValidationError) { |
| | | // component.find('OppMessage').setError(vaildationFailReason); |
| | | // } |
| | | // }, |
| | | // vivek end 添加验证 |
| | | |
| | | hideCmp : function(component, event, helper) { |
| | | var div1 = component.find('report') |
| | | var div2 = component.find('report_list') |
| | | $A.util.addClass(div1, 'disp_none'); |
| | | $A.util.addClass(div2, 'disp_none'); |
| | | }, |
| | | |
| | | handleSuccess : function(component, event, helper) { |
| | | var insertId = event.getParams().response.Id; |
| | | var displayValue = event.getParams().response.fields.Name.value; |
| | | event.setParams({}); |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $A.util.addClass(modal_newAC, 'disp_none'); |
| | | this.success('.客户人员已创建。'); |
| | | this.set_doctor_list(component); |
| | | }, |
| | | |
| | | createCancel : function(component, event, helper) { |
| | | component.set('v.truthy', false); |
| | | var modal_newAC = component.find('modal_newAC') |
| | | $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 = ''; |
| | | if (hosId != '' && hosId != null) { |
| | | opportunity_cfilter = ' Agency_Hospital__r.Hospital__c=' + '\'' + hosId + '\''; |
| | | } |
| | | if (Department_Cateogy__c != '' && Department_Cateogy__c != null) { |
| | | if (opportunity_cfilter != '' && opportunity_cfilter != null) { |
| | | opportunity_cfilter += ' AND '; |
| | | } |
| | | opportunity_cfilter += 'Department_Cateogy__c=' + '\'' + Department_Cateogy__c + '\''; |
| | | } |
| | | component.set('v.opportunity_cfilter', opportunity_cfilter); |
| | | component.set('v.data.Opportunity__c', null); |
| | | }, |
| | | readFile: function(component, helper, file) { |
| | | if (!file) return; |
| | | // console.log('file'+file.name); |
| | | if(!file.name.match(/\.(csv||CSV)$/)){ |
| | | return alert('only support csv files'); |
| | | }else{ |
| | | |
| | | reader = new FileReader(); |
| | | reader.onerror =function errorHandler(evt) { |
| | | switch(evt.target.error.code) { |
| | | case evt.target.error.NOT_FOUND_ERR: |
| | | alert('File Not Found!'); |
| | | break; |
| | | case evt.target.error.NOT_READABLE_ERR: |
| | | alert('File is not readable'); |
| | | break; |
| | | case evt.target.error.ABORT_ERR: |
| | | break; // noop |
| | | default: |
| | | alert('An error occurred reading this file.'); |
| | | }; |
| | | } |
| | | //reader.onprogress = updateProgress; |
| | | reader.onabort = function(e) { |
| | | alert('File read cancelled'); |
| | | }; |
| | | reader.onloadstart = function(e) { |
| | | |
| | | var output = '<ui type=\"disc\"><li><strong>'+file.name +'</strong> ('+file.type+')- '+file.size+'bytes, last modified: '+file.lastModifiedDate.toLocaleDateString()+'</li></ui>'; |
| | | component.set("v.filename",file.name); |
| | | component.set("v.TargetFileName",output); |
| | | |
| | | }; |
| | | reader.onload = function(e) { |
| | | var data=e.target.result; |
| | | component.set("v.fileContentData",data); |
| | | console.log("file data"+JSON.stringify(data)); |
| | | // console.log("file data"+encodeURI(JSON.stringify(data),"utf-8")); |
| | | var allTextLines = data.split(/\r\n|\n/); |
| | | var dataRows=allTextLines.length-1; |
| | | var headers = allTextLines[0].split(','); |
| | | |
| | | // console.log("Rows length::"+dataRows); |
| | | |
| | | |
| | | var numOfRows=component.get("v.NumOfRecords"); |
| | | if(dataRows > numOfRows+1 || dataRows == 1 || dataRows== 0){ |
| | | |
| | | alert("File Rows between 1 to "+numOfRows+" ."); |
| | | component.set("v.showMain",true); |
| | | |
| | | } |
| | | else{ |
| | | var lines = []; |
| | | var filecontentdata; |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | content += '<th scope=\"col"\>'+'行号'+'</th>'; |
| | | for(i=0;i<headers.length; i++){ |
| | | content += '<th scope=\"col"\>'+headers[i]+'</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | for (var i=1; i<allTextLines.length; i++) { |
| | | filecontentdata = allTextLines[i].split(','); |
| | | if(filecontentdata[0]!=''){ |
| | | content +="<tr>"; |
| | | content +="<td>"+i+"</td>"; |
| | | for(var j=0;j<filecontentdata.length;j++){ |
| | | content +='<td>'+filecontentdata[j]+'</td>'; |
| | | } |
| | | content +="</tr>"; |
| | | } |
| | | } |
| | | content += "</table>"; |
| | | console.log(content); |
| | | component.set("v.TableContent",content); |
| | | component.set("v.showMain",false); |
| | | } |
| | | } |
| | | reader.readAsText(file,'gb2312'); |
| | | |
| | | } |
| | | var reader = new FileReader(); |
| | | reader.onloadend = function() { |
| | | |
| | | }; |
| | | reader.readAsDataURL(file); |
| | | }, |
| | | |
| | | saveRecords : function(component,event,helper){ |
| | | debugger |
| | | component.set('v.loginEdit',true); |
| | | //fy 导入 20220424 start |
| | | var action1 = component.get("c.processDataAWSId"); |
| | | action1.setParams({ |
| | | fileData : component.get("v.fileContentData"), |
| | | }); |
| | | debugger |
| | | action1.setCallback(this, function(response) { |
| | | console.log('response = ' + JSON.stringify(response)); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var ress = response.getReturnValue(); |
| | | console.log('ress = ' + JSON.stringify(ress)); |
| | | if(ress){ |
| | | var valur =ress.split('error1'); |
| | | if(valur.length<=1){ |
| | | var res = JSON.parse(response.getReturnValue()); |
| | | console.log('res = ' + JSON.stringify(res)); |
| | | var dataArr = new Array(); |
| | | var dataMap = new Map(); |
| | | res.forEach(item => { |
| | | if(item.AWS_Data_Id__c){ |
| | | dataArr.push(item.AWS_Data_Id__c); |
| | | //dataMap.set(item.AWS_Data_Id__c,item.Name_Encrypted__c); |
| | | dataMap.set(item.AWS_Data_Id__c,item.AWS_Data_Id__c); //zhj 新方案改造 2022-12-21 |
| | | } |
| | | }); |
| | | let obj= Object.create(null); |
| | | obj['dataIds'] = dataArr; |
| | | var payload = JSON.stringify(obj); |
| | | console.log('payload zhj = ' + JSON.stringify(payload)); |
| | | |
| | | this.search_contact_url(component, 'Agency_Contact__c', (result)=>{ |
| | | var token = result.token; |
| | | var searchUrl = result.searchUrl; |
| | | this.search_core(token,searchUrl,payload,(result)=>{ |
| | | if(result.status == '0'){ |
| | | if(result.object != null&&result.object.length != 0){ |
| | | // var resultjson = JSON.stringify(result.object); |
| | | // if(resultjson){ |
| | | // debugger |
| | | // console.warn('001'); |
| | | // component.set('v.login',true); |
| | | // this.ImportMethod(component,resultjson); |
| | | // } |
| | | component.set('v.loginEdit',true); |
| | | this.saveRecordsEditFile(component,dataMap,result.object,helper); |
| | | }else{ |
| | | this.error('AWS 查询数据为空 ' ); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }else{ |
| | | this.error('AWS search status6 : ' + result.status); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | },component); |
| | | // var resultjson =null; |
| | | // this.ImportMethod(component,resultjson); |
| | | |
| | | }); |
| | | // var resultjson =null; |
| | | // this.ImportMethod(component,resultjson); |
| | | }else{ |
| | | this.error(valur[1]+'\n'+"请修改后重新上传"); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(action1); |
| | | //fy 导入 20220424 end |
| | | // var action = component.get("c.processData"); |
| | | // var selectDate = component.find('select_date').get('v.value'); |
| | | // var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | // var sss=component.get("v.fileContentData"); |
| | | // action.setParams({ |
| | | // fileData : component.get("v.fileContentData"), |
| | | // //selectDateselectDate :component.find('select_date').get('v.value'), |
| | | // sobjectName:'Account', //Any object |
| | | // fields:fieldsList |
| | | // }); |
| | | // action.setCallback(this, function(response) { |
| | | // var state = response.getState(); |
| | | // if (state === "SUCCESS") { |
| | | |
| | | // var res = response.getReturnValue(); |
| | | // var res1 = ''; |
| | | // console.log("[[[[[["+res); |
| | | // if(res != 'success'){ |
| | | // debugger |
| | | // var ress = res.split('='); |
| | | // console.log(ress); |
| | | // for (var i=0; i<ress.length; i++) { |
| | | // res1 += ress[i].substr(7)+'\n'; |
| | | // } |
| | | // // $('.forceToastManager').css('white-space', 'pre-wrap'); |
| | | // console.log("=="+res1); |
| | | // this.error(res1+"请修改后重新上传"); |
| | | // component.set('v.login',false); |
| | | // }else{ |
| | | // component.set("v.showMain",true); |
| | | // this.success("导入成功"); |
| | | // // alert('saved successfully'); |
| | | // component.set('v.login',false); |
| | | // } |
| | | |
| | | // } |
| | | // else if (state === "INCOMPLETE") { |
| | | // // do something |
| | | // component.set('v.login',false); |
| | | // } |
| | | // else if (state === "ERROR") { |
| | | // var errors = response.getError(); |
| | | // if (errors) { |
| | | // if (errors[0] && errors[0].message) { |
| | | // console.log("Error message: " + |
| | | // errors[0].message); |
| | | // component.set('v.login',false); |
| | | // } |
| | | // } else { |
| | | // console.log("Unknown error"); |
| | | // component.set('v.login',false); |
| | | // } |
| | | // } |
| | | // }); |
| | | // $A.enqueueAction(action); |
| | | |
| | | },isNumber: function(str) { |
| | | return /^\d+$/.test(str); |
| | | },ImportMethod : function(component,fileStr){ |
| | | debugger |
| | | var actionss = component.get("c.processData"); |
| | | var selectDate = component.find('select_date').get('v.value'); |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | var sss=component.get("v.fileContentData"); |
| | | actionss.setParams({ |
| | | // fileData : component.get("v.fileContentData"), |
| | | fileData : fileStr, |
| | | // selectDateselectDate :component.find('select_date').get('v.value'), |
| | | sobjectName:'Account', //Any object |
| | | fields:fieldsList |
| | | // Agency_ContactListjson:resultjson |
| | | }); |
| | | actionss.setCallback(this, function(response) { |
| | | console.log('002'); |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | var res1 = ''; |
| | | console.log("[[[[[["+res); |
| | | if(res != 'success'){ |
| | | var ress = res.split('='); |
| | | console.log(ress); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | for (var i=0; i<ress.length; i++) { |
| | | res1 += ress[i].substr(7)+'\n'; |
| | | if (ress[i] != '') { |
| | | let errorData = {} |
| | | if(!this.isNumber(ress[i].substr(7).substring(1, 2))){ |
| | | continue |
| | | } |
| | | let index = errorDataRow.indexOf(ress[i].substr(7).substring(1, 2)); |
| | | if (index == -1) { |
| | | errorData.errorRow = ress[i].substr(7).substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = ress[i].substr(7).substring(5).replace('=',''); |
| | | if(errorData.errorInfo == '拜访人不存在'){ |
| | | console.log('errorData.errorRow = ' + errorData.errorRow) |
| | | errorData.errorInfo ='拜访人 ' + fileContentData[errorData.errorRow].split(',')[4] + '不存在'; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | if(ress[i].substr(7).substring(5) == '拜访人不存在'){ |
| | | errorDatas[index].errorInfo += '; ' + '拜访人 ' + fileContentData[errorDatas[index].errorRow].split(',')[4] + '不存在'; |
| | | }else{ |
| | | errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | let errorColumns = [ |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 }, |
| | | { label: '错误信息', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true } |
| | | ]; |
| | | for (var i = 0; i < fileContentData[0].split(',').length; i++) { |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | }); |
| | | } |
| | | |
| | | for (var i = 0; i < errorDatas.length; i++) { |
| | | let data = fileContentData[errorDatas[i].errorRow]; |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | if(data){ |
| | | for (var j = 0; j < data.split(',').length; j++) { |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | } |
| | | } |
| | | } |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set("v.showErrorInfo", true); |
| | | console.log("=="+res1); |
| | | this.error(res1+"请修改后重新上传"); |
| | | component.set('v.loginEdit',false); |
| | | }else{ |
| | | component.set("v.showMain",true); |
| | | this.success("导入成功"); |
| | | // alert('saved successfully'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | |
| | | } |
| | | else if (state === "INCOMPLETE") { |
| | | // do something |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | else if (state === "ERROR") { |
| | | var errors = response.getError(); |
| | | if (errors) { |
| | | if (errors[0] && errors[0].message) { |
| | | console.log("Error message: " + |
| | | errors[0].message); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | } else { |
| | | console.log("Unknown error"); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | } |
| | | }); |
| | | $A.enqueueAction(actionss); |
| | | },saveRecordsEditFile : function(component,dataMap,searchData,helper){ |
| | | var searchDataMap = new Map(); |
| | | for (var i = 0; i < searchData.length; i++) { |
| | | var sd = searchData[i]; |
| | | if(sd.name) |
| | | searchDataMap.set(sd.name.replace(' ',''),sd.dataId); |
| | | } |
| | | console.log('searchDataMap='+searchDataMap); |
| | | var error = ''; |
| | | var fileData = component.get("v.fileContentData"); |
| | | var files = fileData.split('\n'); |
| | | |
| | | var fileStr = files[0]; |
| | | fileStr += '\n'; |
| | | |
| | | for (var i = 1; i < files.length-1; i++) { |
| | | var filelist = files[i].split(','); |
| | | var fileName = filelist[4]; |
| | | |
| | | if (searchDataMap.get(fileName.replace(' ',''))) { |
| | | var nameDataId = searchDataMap.get(fileName.replace(' ','')); |
| | | if (dataMap.get(nameDataId)) { |
| | | filelist[4] = dataMap.get(nameDataId); //zhj 新方案改造 filelist[4]不再存的nameEncrpt 2022-12-21 |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人SF不存在'; |
| | | error += '='; |
| | | } |
| | | }else { |
| | | error += 'error1 第'+i+'行数据拜访人AWS不存在'; |
| | | error += '='; |
| | | } |
| | | fileStr += filelist.toString(); |
| | | fileStr += '\n'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | }, |
| | | |
| | | <<<<<<< HEAD |
| | | productcategoryChange1: function (component, event, helper) { |
| | | var product_category_id = component |
| | | .find('select_Product1') |
| | |
| | | } |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | |
| | | ======= |
| | | if (error != '') { |
| | | console.log('zhj error = ' + error); |
| | | let errorArray = error.split('error1'); |
| | | let errorDatas = []; |
| | | let errorDataRow = []; |
| | | debugger |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | console.log('errorArray = ' + JSON.stringify(errorArray)) |
| | | for (var i in errorArray) { |
| | | if (errorArray[i] != '') { |
| | | let errorData = {} |
| | | if(!this.isNumber(errorArray[i].trim().substring(1, 2))){ |
| | | continue |
| | | } |
| | | let index = errorDataRow.indexOf(errorArray[i].trim().substring(1, 2)); |
| | | if (index == -1) { |
| | | errorData.errorRow = errorArray[i].trim().substring(1, 2); |
| | | errorDataRow.push(errorData.errorRow); |
| | | errorData.errorInfo = errorArray[i].trim().substring(5,errorArray[i].trim().length).replace('=',''); |
| | | if(errorData.errorInfo == '拜访人AWS不存在'){ |
| | | errorData.errorInfo ='拜访人 ' + fileContentData[errorData.errorRow].split(',')[4] + '不存在'; |
| | | } |
| | | errorDatas.push(errorData); |
| | | } else { |
| | | if(errorArray[i].trim().substring(5) == '拜访人AWS不存在'){ |
| | | errorData[index].errorInfo = '; ' + '拜访人 ' + fileContentData[errorDatas[index].errorRow].split(',')[4] + '不存在'; |
| | | }else{ |
| | | errorDatas[index].errorInfo += '; ' + errorArray[i].trim().substring(5,errorArray[i].trim().length); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var fileContentData = component.get("v.fileContentData").split('\n'); |
| | | let errorColumns = [ |
| | | { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 }, |
| | | { label: '错误信息', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true } |
| | | ]; |
| | | for (var i = 0; i < fileContentData[0].split(',').length; i++) { |
| | | errorColumns.push({ |
| | | label: fileContentData[0].split(',')[i], |
| | | fieldName: 'field' + i, |
| | | type: 'text', |
| | | hideDefaultActions: true, |
| | | wrapText: true, |
| | | initialWidth: 120 |
| | | }); |
| | | } |
| | | |
| | | for (var i = 0; i < errorDatas.length; i++) { |
| | | let data = fileContentData[errorDatas[i].errorRow]; |
| | | console.log('data = ' + JSON.stringify(data)); |
| | | for (var j = 0; j < data.split(',').length; j++) { |
| | | let label = 'field' + j; |
| | | errorDatas[i][label] = data.split(',')[j]; |
| | | } |
| | | } |
| | | console.log('errorDatas =' + JSON.stringify(errorDatas)) |
| | | component.set('v.errorColumns', errorColumns); |
| | | component.set('v.errorData', errorDatas); |
| | | component.set("v.showErrorInfo", true); |
| | | |
| | | |
| | | |
| | | console.log('error = ' + error); |
| | | component.set('v.errorMessage', error); |
| | | |
| | | this.error(error); |
| | | console.log('error='+error); |
| | | component.set('v.loginEdit',false); |
| | | return; |
| | | } |
| | | |
| | | console.log('fileStr='+fileStr); |
| | | $A.getCallback(function(){ |
| | | debugger |
| | | helper.ImportMethod(component,fileStr); |
| | | })(); |
| | | |
| | | }, |
| | | convertArrayOfObjectsToCSV : function(component,objectRecords){ |
| | | var csvStringResult, counter, keys, columnDivider, lineDivider,thkeys; |
| | | if (objectRecords == null || !objectRecords.length) { |
| | | return null; |
| | | } |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | csvStringResult = ''; |
| | | csvStringResult += thkeys.join(columnDivider); |
| | | csvStringResult += lineDivider; |
| | | console.log("进入导出helper"); |
| | | for(var i=0; i < objectRecords.length; i++){ |
| | | counter = 0; |
| | | for(var sTempkey in keys) { |
| | | var skey = keys[sTempkey]; |
| | | if(counter > 0){ |
| | | csvStringResult += columnDivider; |
| | | } |
| | | if(typeof objectRecords[i][skey] === "undefined"){ |
| | | csvStringResult += '"'+''+'"'; |
| | | continue; |
| | | } |
| | | if(skey == 'Person_In_Charge2__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Person_In_Charge2__r.Name+'"'; |
| | | }else if(skey == 'Agency_Hospital__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Agency_Hospital__r.Name+'"'; |
| | | }else if(skey == 'doctor2__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].doctor2__r.Name+'"'; |
| | | }else if(skey == 'Product_Category1__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category1__r.Name+'"'; |
| | | }else if(skey == 'Product_Category2__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"'; |
| | | } |
| | | else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | } |
| | | else{ |
| | | csvStringResult += '"'+ objectRecords[i][skey]+'"'; |
| | | } |
| | | counter++; |
| | | |
| | | } // inner for loop close |
| | | console.log("导出循环结束"); |
| | | csvStringResult += lineDivider; |
| | | }// outer main for loop close |
| | | |
| | | // return the CSV formate String |
| | | return csvStringResult; |
| | | }, |
| | | showExportDate : function(component,objectRecords){ |
| | | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; |
| | | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | | content += "<thead><tr class=\"slds-text-title--caps\">"; |
| | | for(i=0;i<headers.length; i++){ |
| | | content += '<th scope=\"col"\>'+headers[i]+'</th>'; |
| | | } |
| | | content += "</tr></thead>"; |
| | | for(var i=0; i < objectRecords.length; i++){ |
| | | console.log('for'+content); |
| | | content += '<tr>'; |
| | | // content += '<td>'+(i+1)+'</td>'; |
| | | for(var sTempkey in keys) { |
| | | console.log('for1'+sTempkey); |
| | | var skey = keys[sTempkey]; |
| | | if(typeof objectRecords[i][skey] === "undefined"){ |
| | | content += '<td>'+''+'</td>'; |
| | | continue; |
| | | } |
| | | console.log('for2'+objectRecords[i].Person_In_Charge2__r.Name); |
| | | if(skey == 'Person_In_Charge2__c'){ |
| | | content += '<td>'+ objectRecords[i].Person_In_Charge2__r.Name+'</td>'; |
| | | }else if(skey == 'Agency_Hospital__c'){ |
| | | content += '<td>'+ objectRecords[i].Agency_Hospital__r.Name+'</td>'; |
| | | }else if(skey == 'doctor2__c'){ |
| | | content += '<td>'+ objectRecords[i].doctor2__r.Name+'</td>'; |
| | | }else if(skey == 'Product_Category1__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category1__r.Name+'</td>'; |
| | | }else if(skey == 'Product_Category2__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category2__r.Name+'</td>'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>'; |
| | | } |
| | | else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | } |
| | | else{ |
| | | content += '<td>'+ objectRecords[i][skey]+'</td>'; |
| | | } |
| | | } // inner for loop close |
| | | content += '</tr>' |
| | | }// outer main for loop close |
| | | content += '</table>'; |
| | | console.log("helper循环结束"+content); |
| | | component.set("v.TableContent2",content); |
| | | component.set("v.showMain",false); |
| | | }, |
| | | |
| | | select_repores_date : function(component,event,helper){ |
| | | component.set('v.loginEdit',true); |
| | | var reportsdate1 = component.find('input-report-date1').get('v.value'); |
| | | var reportsdate2 = component.find('input-report-date2').get('v.value'); |
| | | console.log('输入的开始日期'+reportsdate1+'输入的结束日期'+reportsdate2); |
| | | var action = component.get("c.getReportsByDate"); |
| | | console.log('输入的开始日期1'); |
| | | action.setParams({ |
| | | date1 : reportsdate1, |
| | | date2: reportsdate2 |
| | | }); |
| | | console.log('输入的开始日期2'); |
| | | action.setCallback(this, function(response) { |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | |
| | | var res = response.getReturnValue(); |
| | | console.log('输入的开始日期3'+res); |
| | | component.set('v.loginEdit',false); |
| | | |
| | | // PI 改造 By Bright 20220328 |
| | | if(true){ |
| | | let awsids = []; |
| | | for (let ri in res) { |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c){ |
| | | awsids.push(res[ri].doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | if(awsids.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | |
| | | AWSService.search(awsurl.searchUrl,{ |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)){ |
| | | res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name; |
| | | res[ri].visitor_title__c = m[res[ri].doctor2__r.AWS_Data_Id__c].doctorDivision1; |
| | | |
| | | } |
| | | } |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set('v.loginEdit', false); |
| | | }, awsurl.token); |
| | | }else{ |
| | | helper.showExportDate(component, res); |
| | | } |
| | | } |
| | | |
| | | |
| | | component.set('v.reports_date', res); |
| | | |
| | | }else{ |
| | | alert('导出失败,请检查活动日'); |
| | | component.set('v.loginEdit',false); |
| | | } |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | }, |
| | | |
| | | showImport : function(component){ |
| | | // console.log('进入'); |
| | | // component.find('file').click(); |
| | | var modalimport = component.find('modal_import'); |
| | | var modalimportbg = component.find('modal_importbg'); |
| | | $A.util.removeClass(modalimport, 'disp_none'); |
| | | $A.util.removeClass(modalimportbg,'disp_none'); |
| | | }, |
| | | |
| | | showExport : function(component) { |
| | | var modalimport = component.find('modal_export'); |
| | | var modalimportbg = component.find('modal_exportbg'); |
| | | $A.util.removeClass(modalimport, 'disp_none'); |
| | | $A.util.removeClass(modalimportbg,'disp_none'); |
| | | }, |
| | | |
| | | close_import : function(component){ |
| | | var modalimport = component.find('modal_import'); |
| | | var modalimportbg = component.find('modal_importbg'); |
| | | $A.util.addClass(modalimport, 'disp_none'); |
| | | $A.util.addClass(modalimportbg,'disp_none'); |
| | | }, |
| | | |
| | | close_export : function(component){ |
| | | var modalimport = component.find('modal_export'); |
| | | var modalimportbg = component.find('modal_exportbg'); |
| | | $A.util.addClass(modalimport, 'disp_none'); |
| | | $A.util.addClass(modalimportbg,'disp_none'); |
| | | }, |
| | | |
| | | //zhj MEBG新方案改造 2022-11-29 start |
| | | CallBackAction : function(component,action_name,para,callback) { |
| | | var action = component.get("c." + action_name.trimStart().replace("c.","")); |
| | | if(para){ |
| | | action.setParams(para); |
| | | } |
| | | if(callback){ |
| | | action.setCallback(this,function(data){ |
| | | callback(data); |
| | | }); |
| | | } |
| | | |
| | | $A.enqueueAction(action); |
| | | }, |
| | | //zhj MEBG新方案改造 2022-11-29 end |
| | | |
| | | //zhj 导出错误信息 2023-05-16 start |
| | | exportErrorInfoHelper: function (component) { |
| | | var errorData = component.get('v.errorData'); |
| | | var errorColumns = component.get('v.errorColumns'); |
| | | |
| | | var datas = []; |
| | | let errorColumnsArray = []; |
| | | for(var i in errorColumns){ |
| | | errorColumnsArray.push(errorColumns[i].label); |
| | | } |
| | | datas.push(errorColumnsArray); |
| | | //datas.push(errorColumns); |
| | | |
| | | for (var i in errorData) { |
| | | let data = []; |
| | | data.push(errorData[i].errorRow) |
| | | data.push(errorData[i].errorInfo) |
| | | for(var j = 0 ; j < Object.keys(errorData[i]).length - 2 ; j++){ |
| | | data.push(errorData[i]['field' + j]) |
| | | } |
| | | datas.push(data); |
| | | } |
| | | |
| | | console.log('datas = ' + JSON.stringify(datas)); |
| | | var csv = this.convertToCSV(component, datas); |
| | | console.log('csv = ' + JSON.stringify(csv)) |
| | | this.downloadCSV(component, csv); |
| | | }, |
| | | |
| | | convertToCSV: function (component, data) { |
| | | console.log('enter convertToCSV') |
| | | console.log('data = ' + data); |
| | | var csv = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var row = data[i]; |
| | | console.log('row = ' + JSON.stringify(row)); |
| | | for (var j = 0; j < row.length; j++) { |
| | | var val = ''; |
| | | val = row[j] === null ? '' : row[j].toString(); |
| | | console.log('val = ' + val); |
| | | if (val.indexOf(',') !== -1 || val.indexOf('"') !== -1 || val.indexOf('\n') !== -1) { |
| | | //val = '"' + val.replace(/"/g,'""') + '"'; |
| | | } |
| | | if (j > 0) { |
| | | csv += ','; |
| | | } |
| | | csv += val; |
| | | } |
| | | csv += '\n'; |
| | | } |
| | | return csv; |
| | | }, |
| | | |
| | | downloadCSV: function (component, csv) { |
| | | var link = document.createElement('a'); |
| | | // 设置字符集和文件头 |
| | | var bom = "\uFEFF"; |
| | | link.href = 'data:text/csv;charset=utf-8,' + encodeURIComponent(bom + csv); |
| | | link.download = 'data.csv'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | }, |
| | | //zhj 导出错误信息 2023-05-16 end |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | // searchAgencyContact : function(res) { |
| | | // var agencyContacts = []; |
| | | // for (let idx = 0; idx < res.length; idx++) { |
| | |
| | | // var data = this.search(searchUrl,data,token); |
| | | // return data;searchUrl,requestSearchPayload,token |
| | | // }, |
| | | <<<<<<< HEAD |
| | | }); |
| | | ======= |
| | | }) |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | private class ArriveGoodsControllerTest { |
| | | <<<<<<< HEAD |
| | | //选择等待入库,包括01 和241 |
| | | @isTest |
| | | static void arriveWithID() { |
| | |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | ======= |
| | | |
| | | //选择等待入库,包括01 和241 |
| | | @isTest |
| | | static void arriveWithID() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'N3047730', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | |
| | | // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size()); |
| | | // System.assertEquals(2, Controller.consumableInventory.size()); |
| | | Controller.ArriveGoodsConfim(); |
| | | <<<<<<< HEAD |
| | | List<Consumable_order_details2__c> ins = [ |
| | | SELECT Id, Name |
| | | FROM Consumable_order_details2__c |
| | | ]; |
| | | ======= |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // System.assertEquals(3, ins.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //产品直接入库,包括01 和241 |
| | | @isTest |
| | | static void arriveWithoutID() { |
| | |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | ======= |
| | | |
| | | //产品直接入库,包括01 和241 |
| | | @isTest |
| | | static void arriveWithoutID() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',ProductCode_Ext__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='N3047731',ProductCode_Ext__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test01', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'N3047731', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test01',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n241N30477311115120017181000105ZK250BXJRA\n241Test021115120017181000105ZK250\n01049531702003111115120017181000105ZK250'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | <<<<<<< HEAD |
| | | List<Consumable_order_details2__c> ins = [ |
| | | SELECT Id, Name |
| | | FROM Consumable_order_details2__c |
| | | WHERE Bar_Code__c IN ('01049531702003111115120017181000105ZK250BXJRF', '241N30477311115120017181000105ZK250BXJRA') |
| | | ]; |
| | | ======= |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c WHERE Bar_Code__c in ('01049531702003111115120017181000105ZK250BXJRF','241N30477311115120017181000105ZK250BXJRA')]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // System.assertEquals(2, ins.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | //整体到货 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void ArriveTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void ArriveTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | insert new List<Product2__c>{ pro1 }; |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | |
| | | Orderdet3.SerialLotNo__c = '5ZK'; |
| | | //Orderdet3.Box_Piece__c = '个'; |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | <<<<<<< HEAD |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | ======= |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.Box_Piece__c = '盒'; |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | |
| | | Orderdet5.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | <<<<<<< HEAD |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 }; |
| | | ======= |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5}; |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | //整体到货 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void ArriveTest1() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void ArriveTest1() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | Orderdet3.SerialLotNo__c = '5ZK'; |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | <<<<<<< HEAD |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | ======= |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | Orderdet4.SerialLotNo__c = '5ZK'; |
| | | //Orderdet4.Box_Piece__c = '盒'; |
| | |
| | | Orderdet5.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | <<<<<<< HEAD |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 }; |
| | | ======= |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5}; |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | } |
| | | } |
| | | |
| | |
| | | Orderdet6.TracingCode__c = 'BXJRF'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6 }; |
| | | ======= |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //返品 |
| | | @isTest |
| | | static void productReturn() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | //返品订单 |
| | | |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.TracingCode__c = 'BXJRF'; |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.Arrive_date__c = Date.today(); |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI'; |
| | | Orderdet2.TracingCode__c = 'BXJRF'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Consumable_Sale_order__c = Order1.Id; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ'; |
| | | Orderdet3.Box_Piece__c ='盒'; |
| | | Orderdet3.TracingCode__c = 'BXJRF'; |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN'; |
| | | Orderdet4.Box_Piece__c ='个'; |
| | | Orderdet4.TracingCode__c = 'BXJRF'; |
| | | //quxiao |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001005'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet5.Cancellation_Date__c = Date.today(); |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | Orderdet5.Box_Piece__c ='盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRF'; |
| | | //fanpin |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001006'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet6.Consumable_Return_order__c = Order2.Id; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet6.Box_Piece__c ='个'; |
| | | Orderdet6.TracingCode__c = 'BXJRF'; |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name); |
| | | //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name); |
| | | Controller.GoodsReturnCheck(); |
| | | <<<<<<< HEAD |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '多发'; |
| | | controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1; |
| | | ======= |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c='多发'; |
| | | controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1; |
| | | >>>>>>> LEXCommunityLiJun |
| | | //System.assertEquals(1, controller.ShowGoodsofReturnList.size()); |
| | | Controller.UpdateGoodsOfReturn(); |
| | | Controller.ToReturnGoodsPage(); |
| | | Controller.geterrorsize(); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | //返品 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void productReturn_new() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void productReturn_new() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id]; |
| | | //system.assertEquals('qeee',coc.Dealer_Info__r.name); |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_001001'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //发货明细 |
| | | //fahuo |
| | | /*Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet3.Consumable_Sale_order__c = Order1.Id; |
| | | <<<<<<< HEAD |
| | | Orderdet3.Box_Piece__c = '盒'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | ======= |
| | | Orderdet3.Box_Piece__c ='盒'; |
| | | Orderdet3.Used_date__c= Date.today(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | <<<<<<< HEAD |
| | | Orderdet4.Box_Piece__c = '个'; |
| | | ======= |
| | | Orderdet4.Box_Piece__c ='个'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | |
| | | Orderdet5.Cancellation_Flag__c = true; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | <<<<<<< HEAD |
| | | Orderdet5.Box_Piece__c = '个'; |
| | | Orderdet5.TracingCode__c = 'BXJRZ'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet3, Orderdet4, Orderdet5 }; |
| | | ======= |
| | | Orderdet5.Box_Piece__c ='个'; |
| | | Orderdet5.TracingCode__c = 'BXJRZ'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new Consumable_order_details2__c[] {Orderdet3,Orderdet4,Orderdet5}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | Controller.SearchPro(); |
| | | // System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.assertEquals(2, controller.ShowGoodsofReturnList.size()); |
| | | <<<<<<< HEAD |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c = '多发'; |
| | | controller.ShowGoodsofReturnList[1].esd.Return_reason__c = '多发'; |
| | | controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c = 1; |
| | | Controller.UpdateGoodsOfReturn(); |
| | | |
| | | list<String> list1 = new List<String>(); |
| | | ======= |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c='多发'; |
| | | controller.ShowGoodsofReturnList[1].esd.Return_reason__c='多发'; |
| | | controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1; |
| | | Controller.UpdateGoodsOfReturn(); |
| | | |
| | | list<String> list1 = new list<String>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | list1.add(Controller.barcode = '01234567898'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | |
| | | list1.add(Controller.barcode = '0112345678901231106789012105625001234'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | //直接到货 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void arrivedirect() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void arrivedirect() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c); |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //产品注册证 |
| | | 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_contrast__c prcc = new Product_Register_contrast__c( |
| | | // Name = 'Test20181204', |
| | | // Register_new__c = '314', |
| | | // Register_old__c = '36815' |
| | | // ); |
| | | //insert prcc; |
| | | //产品-产品注册证关系 prod01 |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = prod01.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c( |
| | | Product2__c = prod02.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc2; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet3.Consumable_Sale_order__c = Order1.Id; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ'; |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN'; |
| | | //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id]; |
| | | //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c); |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | |
| | | //直接到货 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void arrivedirect241() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void arrivedirect241() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | Orderdet7.TracingCode__c = '20170808'; |
| | | |
| | | Orderdet7 = new Consumable_order_details2__c(); |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //产品注册证 |
| | | 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_contrast__c prcc = new Product_Register_contrast__c( |
| | | // Name = 'Test20181204', |
| | | // Register_new__c = '314', |
| | | // Register_old__c = '36815' |
| | | // ); |
| | | //insert prcc; |
| | | //产品-产品注册证关系 prod01 |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = prod01.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c( |
| | | Product2__c = prod02.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc2; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order1; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '到货'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order2.Deliver_date__c = Date.today(); |
| | | Order2.Order_date__c = Date.today(); |
| | | insert Order2; |
| | | Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order2.Deliver_date__c = Date.today(); |
| | | Order2.Order_date__c = Date.today(); |
| | | Order2.ReturnGs_Upload_Date__c = Date.today(); |
| | | insert Order2; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.Arrive_date__c = Date.today(); |
| | | Orderdet1.Rrturn_count__c =1; |
| | | Orderdet1.TracingCode__c = '20170808'; |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order2.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order2.Id; |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI'; |
| | | Orderdet2.Arrive_date__c = Date.today(); |
| | | Orderdet2.TracingCode__c = '20170808'; |
| | | |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001002'; |
| | | Orderdet3.Consumable_order_minor__c = Order2.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order2.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR2'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = '20170808'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001003'; |
| | | Orderdet4.Consumable_order_minor__c = Order2.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order2.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet4.Consumable_Sale_order__c = Order2.Id; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR3'; |
| | | Orderdet4.Used_date__c =Date.today(); |
| | | Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001003'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet4.Consumable_Sale_order__c = Order2.Id; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJ13'; |
| | | Orderdet4.Used_date__c =Date.today(); |
| | | Orderdet4.TracingCode__c = '20170808'; |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001003'; |
| | | Orderdet5.Consumable_order_minor__c = Order2.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.Consumable_Arrived_order__c = Order2.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet5.Consumable_Sale_order__c = Order2.Id; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ'; |
| | | Orderdet5.Arrive_date__c = Date.today().addDays(1); |
| | | Orderdet5.Send_Date__c = null; |
| | | Orderdet5.Used_date__c = null; |
| | | Orderdet5.Lose_Flag__c = false; |
| | | Orderdet5.Return_date__c= null; |
| | | Orderdet5.Cancellation_Date__c= Date.today().addDays(1); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = '20170808'; |
| | | |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001004'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet6.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR4'; |
| | | Orderdet6.Send_Date__c = Date.today(); |
| | | Orderdet6.Return_date__c= null; |
| | | Orderdet6.Box_Piece__c = '盒'; |
| | | Orderdet6.Rrturn_count__c =1; |
| | | Orderdet6.TracingCode__c = '20170808'; |
| | | |
| | | // 单位为个的Barcode对应的出库单 |
| | | Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet7.Name = 'OCM_01_001004'; |
| | | Orderdet7.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet7.Consumable_Product__c = pro1.Id; |
| | | Orderdet7.Asset_Model_No__c = 'Test01'; |
| | | Orderdet7.Consumable_Arrived_order__c = Order1.Id; |
| | | <<<<<<< HEAD |
| | | Orderdet7.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7'; |
| | |
| | | Controller.SearchPro(); |
| | | // System.assertEquals(1, controller.consumableInventory.size()); |
| | | |
| | | ======= |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet7.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR1'; |
| | | Orderdet7.Send_Date__c = Date.today(); |
| | | Orderdet7.Box_Piece__c = '个'; |
| | | Orderdet7.Used_date__c = Date.today(); |
| | | Orderdet7.Return_date__c= null; |
| | | Orderdet7.RemoveBox_No__c =1; |
| | | Orderdet7.Consumable_ZS_order__c= Order1.Id; |
| | | Orderdet7.Rrturn_count__c =1; |
| | | Orderdet7.TracingCode__c = '20170808'; |
| | | |
| | | Orderdet7 = new Consumable_order_details2__c(); |
| | | Orderdet7.Name = 'OCM_01_001004'; |
| | | Orderdet7.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet7.Consumable_Product__c = pro1.Id; |
| | | Orderdet7.Asset_Model_No__c = 'Test01'; |
| | | Orderdet7.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet7.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7'; |
| | | Orderdet7.Send_Date__c = Date.today(); |
| | | Orderdet7.Box_Piece__c = '个'; |
| | | Orderdet7.Used_date__c = Date.today(); |
| | | Orderdet7.Return_date__c= null; |
| | | Orderdet7.RemoveBox_No__c =1; |
| | | Orderdet7.Consumable_ZS_order__c= Order1.Id; |
| | | Orderdet7.Rrturn_count__c =0; |
| | | Orderdet7.TracingCode__c = '20170808'; |
| | | |
| | | Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c(); |
| | | Orderdet8.Name = 'OCM_01_001004'; |
| | | Orderdet8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet8.Consumable_Product__c = pro1.Id; |
| | | Orderdet8.Asset_Model_No__c = 'Test01'; |
| | | Orderdet8.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet8.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR9'; |
| | | Orderdet8.Send_Date__c = Date.today(); |
| | | Orderdet8.Box_Piece__c = '个'; |
| | | Orderdet8.Used_date__c = Date.today(); |
| | | Orderdet8.Return_date__c= null; |
| | | Orderdet8.RemoveBox_No__c =1; |
| | | Orderdet8.Consumable_ZS_order__c= Order1.Id; |
| | | Orderdet8.Rrturn_count__c =null; |
| | | Orderdet8.RemoveBox_date__c = Date.today(); |
| | | Orderdet8.Intra_Trade_List_RMB__c = 1; |
| | | Orderdet8.Sterilization_limit__c = Date.today(); |
| | | Orderdet8.SerialLotNo__c ='11批次'; |
| | | Orderdet8.TracingCode__c = '20170808'; |
| | | Orderdet8.Arrive_date__c = Date.today(); |
| | | |
| | | Consumable_order_details2__c Orderdet9 = new Consumable_order_details2__c(); |
| | | Orderdet9.Name = 'OCM_01_001004'; |
| | | Orderdet9.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet9.Consumable_Product__c = pro1.Id; |
| | | Orderdet9.Asset_Model_No__c = 'Test01'; |
| | | Orderdet9.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet9.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR8'; |
| | | Orderdet9.Send_Date__c = Date.today(); |
| | | Orderdet9.Box_Piece__c = '个'; |
| | | Orderdet9.Used_date__c = Date.today(); |
| | | Orderdet9.Return_date__c= null; |
| | | Orderdet9.Consumable_ZS_order__c= Order1.Id; |
| | | Orderdet9.Arrive_date__c = Date.today(); |
| | | Orderdet9.Rrturn_count__c =10; |
| | | Orderdet9.TracingCode__c = '20170808'; |
| | | Consumable_order_details2__c lose = new Consumable_order_details2__c(); |
| | | lose.Name = 'OCM_01_001004'; |
| | | lose.Consumable_order_minor__c = Order1.Id; |
| | | lose.Consumable_Product__c = pro1.Id; |
| | | lose.Asset_Model_No__c = 'Test01'; |
| | | lose.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | lose.Consumable_Shipment_order__c = Order1.Id; |
| | | lose.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | lose.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR5'; |
| | | lose.Send_Date__c = null; |
| | | lose.Arrive_date__c = null; |
| | | lose.Used_date__c = null; |
| | | lose.Box_Piece__c = '盒'; |
| | | lose.TracingCode__c = '20170808'; |
| | | Consumable_order_details2__c lose1 = new Consumable_order_details2__c(); |
| | | lose1.Name = 'OCM_01_001004'; |
| | | lose1.Consumable_order_minor__c = Order1.Id; |
| | | lose1.Consumable_Product__c = pro1.Id; |
| | | lose1.Asset_Model_No__c = 'Test01'; |
| | | lose1.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | lose1.Consumable_Shipment_order__c = Order1.Id; |
| | | lose1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | lose1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR6'; |
| | | lose1.Send_Date__c = null; |
| | | lose1.Arrive_date__c = Date.today(); |
| | | lose1.Used_date__c = null; |
| | | lose1.Box_Piece__c = '盒'; |
| | | lose1.TracingCode__c = '20170808'; |
| | | Consumable_order_details2__c lose2 = new Consumable_order_details2__c(); |
| | | lose2.Name = 'OCM_01_001004'; |
| | | lose2.Consumable_order_minor__c = Order2.Id; |
| | | lose2.Consumable_Product__c = pro1.Id; |
| | | lose2.Asset_Model_No__c = 'Test01'; |
| | | lose2.Consumable_Arrived_order__c = Order2.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | lose2.Consumable_Shipment_order__c = Order2.Id; |
| | | lose2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | lose2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJR7'; |
| | | lose2.Send_Date__c = null; |
| | | lose2.Arrive_date__c = Date.today(); |
| | | lose2.Used_date__c = null; |
| | | lose2.Box_Piece__c = '盒'; |
| | | lose2.Intra_Trade_List_RMB__c = 1; |
| | | lose2.Direct_Arrive_Product__c = true; |
| | | lose2.Sterilization_limit__c = Date.today(); |
| | | lose2.SerialLotNo__c ='11批次'; |
| | | lose2.TracingCode__c = '20170808'; |
| | | |
| | | //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id]; |
| | | //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c); |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7,Orderdet8,Orderdet9,lose,lose1,lose2}; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJ13\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJR2\n01049531702003111115120017181000105ZK250BXJR3\n01049531702003111115120017181000105ZK250BXJR4\n01049531702003111115120017181000105ZK250BXJR1\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXJR9\n01049531702003111115120017181000105ZK250BXJR8\n01049531702003111115120017181000105ZK250BXJR5\n01049531702003111115120017181000105ZK250BXJR6\n01049531702003111115120017181000105ZK250BXJR7\n01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXAAB'; |
| | | Controller.SearchPro(); |
| | | // System.assertEquals(1, controller.consumableInventory.size()); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //返品 明细2不存在的对应的到货订单明细 |
| | | @isTest |
| | | static void productReturn_oldbarcode() { |
| | |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.TracingCode__c = 'BXSYS'; |
| | | |
| | | ======= |
| | | |
| | | //返品 明细2不存在的对应的到货订单明细 |
| | | @isTest |
| | | static void productReturn_oldbarcode() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | |
| | | //返品订单 |
| | | |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //没出库,没销售,就是在库 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet1.Arrive_date__c = date.today(); |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.TracingCode__c = 'BXSYS'; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | |
| | | Orderdet5.Cancellation_Date__c = Date.today(); |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | <<<<<<< HEAD |
| | | Orderdet5.Box_Piece__c = '个'; |
| | | ======= |
| | | Orderdet5.Box_Piece__c ='个'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet5.TracingCode__c = 'BXSYS'; |
| | | //fanpin |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | |
| | | Orderdet6.Consumable_Return_order__c = Order2.Id; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | <<<<<<< HEAD |
| | | Orderdet6.Box_Piece__c = '个'; |
| | | ======= |
| | | Orderdet6.Box_Piece__c ='个'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet6.TracingCode__c = 'BXSYS'; |
| | | |
| | | //发货明细 |
| | |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333'; |
| | | Orderdet7.TracingCode__c = 'BXSYS'; |
| | | |
| | | <<<<<<< HEAD |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5, Orderdet6, Orderdet7 }; |
| | | ======= |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | |
| | | controller.getinventorysize(); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | } |
| | | } |
| | | @isTest |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | |
| | | } |
| | | } |
| | | @isTest |
| | | static void barcodecheck() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert MyUser_Test; |
| | | } |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | list<String> list1 = new List<String>(); |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='8232',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | list<String> list1 = new list<String>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | list1.clear(); |
| | | list1.add(Controller.barcode = '2413456250BBBBA'); |
| | | Controller.inventoryEntry(list1); |
| | |
| | | } |
| | | } |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void barcodechkeck_2() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void barcodechkeck_2() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert MyUser_Test; |
| | | } |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | RegisterNoClass_New__c = '6815', |
| | | RegisterNoStatus__c = '有效' |
| | | ); |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='2344',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='82324',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //产品注册证 |
| | | 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 = '有效' |
| | | ); |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert prc; |
| | | //新旧关系对照表 |
| | | //Product_Register_contrast__c prcc = new Product_Register_contrast__c( |
| | |
| | | // ); |
| | | //insert prcc; |
| | | //产品-产品注册证关系 prod01 |
| | | <<<<<<< HEAD |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c(Product2__c = prod01.Id, Product_Register__c = prc.Id); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c(Product2__c = prod02.Id, Product_Register__c = prc.Id); |
| | | ======= |
| | | Product_Register_Link__c prlc = new Product_Register_Link__c( |
| | | Product2__c = prod01.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | insert prlc; |
| | | //产品-产品注册证关系 prod02 |
| | | Product_Register_Link__c prlc2 = new Product_Register_Link__c( |
| | | Product2__c = prod02.Id, |
| | | Product_Register__c = prc.Id |
| | | ); |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert prlc2; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //List<Product2> proList = [select name,Estimation_Entry_Possibility__c from Product2 where id = :prod01.Id]; |
| | | //System.assertEquals('○', proList[0].Estimation_Entry_Possibility__c); |
| | | <<<<<<< HEAD |
| | | List<Product2__c> product2InStore = [ |
| | | SELECT Id, Name, Name__c, Intra_Trade_List_RMB__c, Asset_Model_No__c, OT_CODE__c |
| | | FROM Product2__c |
| | |
| | | ]; |
| | | //System.assertEquals(1, product2InStore.size()); |
| | | list<String> list1 = new List<String>(); |
| | | ======= |
| | | List<Product2__c> product2InStore = [SELECT Id, Name,Name__c,Intra_Trade_List_RMB__c,Asset_Model_No__c,OT_CODE__c |
| | | FROM Product2__c |
| | | WHERE Estimation_Entry_Possibility__c = '○' |
| | | AND Pro2_Dealer_Object__c = true |
| | | AND OT_CODE__c ='test' ]; |
| | | //System.assertEquals(1, product2InStore.size()); |
| | | list<String> list1 = new list<String>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | list1.clear(); |
| | | list1.add(Controller.barcode = '2413456250BBBBA'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | |
| | | list1.add(Controller.barcode = '241test111204121778900034567890250BBBBQ'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | list1.clear(); |
| | | list1.add(Controller.barcode = '0111234101204120118901231712a4001234250BBBBR'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | |
| | | list1.clear(); |
| | | list1.add(Controller.barcode = '011123410120412017120100250AAAAA'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | //自动出库 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void addSaleOrderAuto() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void addSaleOrderAuto() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | Orderdets8.SerialLotNo__c = '5ZK'; |
| | | insert Orderdets8; |
| | | |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_02_001'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '订单'; |
| | | Order2.Dealer_Info__c = myAccount1.Id; |
| | | Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | insert Order2; |
| | | //发错库 已到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order2.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYS'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.Arrive_date__c = Date.today(); |
| | | Orderdets8.TracingCode__c = 'BXSYS'; |
| | | Orderdets8.SerialLotNo__c = '5ZK'; |
| | | insert Orderdets8; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | |
| | | // UPDATE TCM TEST1 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void methodTest1() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void methodTest1() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | Orderdet2.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet2; |
| | | |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.Arrive_date__c=Date.today(); |
| | | // Orderdet1.Send_Date__c=Date.today(); |
| | | // Orderdet1.Used_date__c=Date.today(); |
| | | Orderdet1.TracingCode__c = 'BXJRF'; |
| | | Orderdet1.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet1; |
| | | |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001001'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF'; |
| | | Orderdet2.Arrive_date__c=Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRF'; |
| | | Orderdet2.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet2; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ESetid=' + Order1.Id); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | |
| | | // System.assertEquals(1, Controller.ConsumableorderdetailsRecords.size()); |
| | | // System.assertEquals(2, Controller.consumableInventory.size()); |
| | | Controller.ArriveGoodsConfim(); |
| | | <<<<<<< HEAD |
| | | List<Consumable_order_details2__c> ins = [ |
| | | SELECT Id, Name |
| | | FROM Consumable_order_details2__c |
| | | ]; |
| | | ======= |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // System.assertEquals(3, ins.size()); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //返品 |
| | | @isTest |
| | | static void methodTest2() { |
| | |
| | | list1.add(Controller.barcode = '012345678901234A67'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | ======= |
| | | |
| | | //返品 |
| | | @isTest |
| | | static void methodTest2() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | //Consumable_order__c coc = [select Dealer_Info__r.name from Consumable_order__c where Id =:Order1.Id]; |
| | | //system.assertEquals('qeee',coc.Dealer_Info__r.name); |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_001001'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Box_Piece__c ='盒'; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Box_Piece__c ='盒'; |
| | | Orderdet2.Arrive_date__c = Date.today(); |
| | | //Orderdet2.Send_Date__c = Date.today(); |
| | | //Orderdet2.Used_date__c= Date.today(); |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet3.Consumable_Sale_order__c = Order1.Id; |
| | | Orderdet3.Box_Piece__c ='盒'; |
| | | Orderdet3.Used_date__c= Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet3.TracingCode__c = 'BXJRF'; |
| | | Orderdet3.SerialLotNo__c = '5ZK'; |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet4.Box_Piece__c ='个'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN'; |
| | | Orderdet4.TracingCode__c = 'BXJRN'; |
| | | Orderdet4.SerialLotNo__c = '5ZK'; |
| | | //quxiao |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001005'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet5.Cancellation_Date__c = Date.today(); |
| | | Orderdet5.Cancellation_Flag__c = true; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | Orderdet5.Box_Piece__c ='个'; |
| | | Orderdet5.TracingCode__c = 'BXJRZ'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new Consumable_order_details2__c[] {Orderdet1,Orderdet3,Orderdet4,Orderdet5}; |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | //排序 |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRR'; |
| | | Controller.SearchPro(); |
| | | System.assertEquals(1, controller.ConsumableorderdetailsRecordserror.size()); |
| | | // System.assertEquals(2, controller.ShowGoodsofReturnList.size()); |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c='多发'; |
| | | // controller.ShowGoodsofReturnList[1].esd.Return_reason__c='多发'; |
| | | // controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1; |
| | | Controller.UpdateGoodsOfReturn(); |
| | | |
| | | list<String> list1 = new list<String>(); |
| | | list1.add(Controller.barcode = '01234567898'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | list1.clear(); |
| | | list1.add(Controller.barcode = '012345678901234A67'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | list1.clear(); |
| | | list1.add(Controller.barcode = '0123456789012345117AA01'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | |
| | | list1.add(Controller.barcode = '0112345678901231106789012105625001234'); |
| | | Controller.inventoryEntryNoESetId(list1); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | //整体到货 |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void ArrivejancodeTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店' |
| | | ]; |
| | | ======= |
| | | static void ArrivejancodeTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | <<<<<<< HEAD |
| | | Profile prof = [ |
| | | SELECT Id |
| | | FROM Profile |
| | |
| | | UserPro_Type__c = 'ET' |
| | | ); |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | ======= |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | <<<<<<< HEAD |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | | Name = 'Test01', |
| | |
| | | insert new List<Product2>{ prod01, prod02 }; |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | insert new List<Product2__c>{ pro1 }; |
| | | ======= |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | // insert myAccount1; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | |
| | | Orderdet3.SerialLotNo__c = '5ZK'; |
| | | //Orderdet3.Box_Piece__c = '个'; |
| | | |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | <<<<<<< HEAD |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | ======= |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.Box_Piece__c = '盒'; |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | |
| | | Orderdet5.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | <<<<<<< HEAD |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4, Orderdet5 }; |
| | | ======= |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | Orderdet5.SerialLotNo__c = '5ZK'; |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5}; |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | |
| | | System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecords[0].esd.Name); |
| | | // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | //发错货 入库 |
| | | @isTest |
| | | static void ArriveotheragencyTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | Account myAccount3 = new Account(name='Testaccount003',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert myAccount3; |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_02_001'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '订单'; |
| | | Order2.Dealer_Info__c = myAccount3.Id; |
| | | Order2.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order2.Order_ProType__c = 'ET'; |
| | | insert Order2; |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order2.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYS'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXSYS'; |
| | | Orderdets8.SerialLotNo__c = '5ZK'; |
| | | Orderdets8.ownerid = MyUser_Test.id; |
| | | insert Orderdets8; |
| | | |
| | | //发错库 已到货 |
| | | Consumable_order_details2__c Orderdets9 = new Consumable_order_details2__c(); |
| | | Orderdets9.Name = 'OCM_01_001012'; |
| | | Orderdets9.Consumable_order_minor__c = Order2.Id; |
| | | Orderdets9.Consumable_Product__c = pro1.Id; |
| | | Orderdets9.Asset_Model_No__c = 'Test01'; |
| | | Orderdets9.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets9.Bar_Code__c = '01049531702003111115120017181000105ZK250BXSYQ'; |
| | | Orderdets9.Consumable_Arrived_order__c = Order2.Id; |
| | | Orderdets9.Arrive_date__c = Date.today(); |
| | | Orderdets9.Box_Piece__c = '盒'; |
| | | Orderdets9.TracingCode__c = 'BXSYQ'; |
| | | Orderdets9.SerialLotNo__c = '5ZK'; |
| | | insert Orderdets9; |
| | | |
| | | // Consumable_order__c Order1 = new Consumable_order__c(); |
| | | // Order1.Name = 'OCM_01_001'; |
| | | // Order1.Order_status__c = '批准'; |
| | | // Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | // Order1.Order_ProType__c = 'ET'; |
| | | // Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | // insert Order1; |
| | | // //订单明细 |
| | | // //fahuo |
| | | // Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | // Orderdet.Name = 'OCM_01_00101'; |
| | | // Orderdet.Consumable_order__c = Order1.Id; |
| | | // Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | // Orderdet.Consumable_Product__c = pro1.Id; |
| | | // Orderdet.Consumable_count__c = 4; |
| | | // insert Orderdet; |
| | | |
| | | // //到货正确信息 |
| | | // Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | // Orderdet1.Name = 'OCM_01_001002'; |
| | | // Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | // Orderdet1.Consumable_Product__c = pro1.Id; |
| | | // Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | // Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | // Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | // Orderdet1.Box_Piece__c = '盒'; |
| | | // Orderdet1.TracingCode__c = 'BXJRA'; |
| | | // Orderdet1.SerialLotNo__c = '5ZK'; |
| | | // //没到货 |
| | | // Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | // Orderdet2.Name = 'OCM_01_001003'; |
| | | // Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | // Orderdet2.Consumable_Product__c = pro1.Id; |
| | | // Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | // Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | // Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | // Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | // Orderdet2.Box_Piece__c = '盒'; |
| | | // Orderdet2.TracingCode__c = 'BXJRB'; |
| | | // Orderdet2.SerialLotNo__c = '5ZK'; |
| | | // //销售产品 |
| | | // Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | // Orderdet3.Name = 'OCM_01_001004'; |
| | | // Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | // Orderdet3.Consumable_Product__c = pro1.Id; |
| | | // Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | // Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | // //Orderdet3.IsArrival__c = true; |
| | | // Orderdet3.Consumable_Sale_order__c = Order1.Id; |
| | | // Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | // Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | // Orderdet3.Used_date__c = Date.today(); |
| | | // Orderdet3.Arrive_date__c = Date.today(); |
| | | // Orderdet3.Box_Piece__c = '盒'; |
| | | // Orderdet3.TracingCode__c = 'BXJRC'; |
| | | // Orderdet3.SerialLotNo__c = '5ZK'; |
| | | // //Orderdet3.Box_Piece__c = '个'; |
| | | |
| | | |
| | | // //出库产品 |
| | | // Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | // Orderdet4.Name = 'OCM_01_001005'; |
| | | // Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | // Orderdet4.Consumable_Product__c = pro1.Id; |
| | | // Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | // Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | // Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | // Orderdet4.Send_Date__c = Date.today(); |
| | | // Orderdet4.Arrive_date__c = Date.today(); |
| | | // Orderdet4.Box_Piece__c = '盒'; |
| | | // Orderdet4.TracingCode__c = 'BXJRD'; |
| | | // Orderdet4.SerialLotNo__c = '5ZK'; |
| | | // //Orderdet4.Box_Piece__c = '盒'; |
| | | // //Orderdet4.Return_date__c = null; |
| | | |
| | | // //已到货产品 |
| | | // Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | // Orderdet5.Name = 'OCM_01_001006'; |
| | | // Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | // Orderdet5.Consumable_Product__c = pro1.Id; |
| | | // Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | // Orderdet5.Consumable_Arrived_order__c = Order1.Id; |
| | | // Orderdet5.Consumable_Shipment_order__c = Order1.Id; |
| | | // Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | // Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | // Orderdet5.Arrive_date__c = Date.today(); |
| | | // Orderdet5.Box_Piece__c = '盒'; |
| | | // Orderdet5.TracingCode__c = 'BXJRE'; |
| | | // Orderdet5.SerialLotNo__c = '5ZK'; |
| | | // insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5}; |
| | | |
| | | |
| | | |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | | System.Test.setCurrentPage(page); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | //排序 |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXSYS\n01049531702003111115120017181000105ZK250BXSYQ'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | |
| | | // System.assertEquals(2, controller.ConsumableorderdetailsRecordserror.size()); |
| | | System.Test.stopTest(); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | //返品 |
| | | @isTest |
| | | static void addInventoryDetails1() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | //返品订单 |
| | | |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //fahuo |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.TracingCode__c = 'BXJRF'; |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.Arrive_date__c = Date.today(); |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI'; |
| | | Orderdet2.TracingCode__c = 'BXJRF'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet3.IsArrival__c = true; |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Consumable_Sale_order__c = Order1.Id; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ'; |
| | | Orderdet3.Box_Piece__c ='盒'; |
| | | Orderdet3.TracingCode__c = 'BXJRF'; |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | //Orderdet4.IsArrival__c = true; |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRN'; |
| | | Orderdet4.Box_Piece__c ='个'; |
| | | Orderdet4.TracingCode__c = 'BXJRF'; |
| | | //quxiao |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001005'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet5.Cancellation_Date__c = Date.today(); |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | Orderdet5.Box_Piece__c ='盒'; |
| | | Orderdet5.TracingCode__c = 'BXJRF'; |
| | | //fanpin |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001006'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet6.Consumable_Return_order__c = Order2.Id; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet6.Box_Piece__c ='个'; |
| | | Orderdet6.TracingCode__c = 'BXJRF'; |
| | | |
| | | // 丢失 |
| | | Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c(); |
| | | Orderdet7.Name = 'OCM_01_001002'; |
| | | Orderdet7.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet7.Consumable_Product__c = pro1.Id; |
| | | Orderdet7.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet7.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet7.Lose_Flag__c = true; |
| | | Orderdet7.Arrive_date__c = Date.today(); |
| | | Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJQT'; |
| | | Orderdet7.Box_Piece__c ='个'; |
| | | Orderdet7.TracingCode__c = 'BXJQT'; |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7}; |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=ReG'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | //排序 |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJRN\n01049531702003111115120017181000105ZK250BXJRZ\n01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXJRI\n01049531702003111115120017181000105ZK250BXJQT'; |
| | | Controller.SearchPro(); |
| | | //System.assertEquals(1, controller.ShowGoodsofReturnList.size()); |
| | | //System.assertEquals('OCM_01_001003', controller.ShowGoodsofReturnList[0].esd.Name); |
| | | //System.assertEquals('OCM_01_001004', controller.ShowGoodsofReturnList[1].esd.Name); |
| | | // System.assertEquals(5, controller.ConsumableorderdetailsRecordserror.size()); //tcm |
| | | //System.assertEquals('Test01', controller.ConsumableorderdetailsRecordserror[1].Prod.Name__c); |
| | | //System.assertEquals('OCM_01_001002', controller.ConsumableorderdetailsRecordserror[2].esd.Name); |
| | | //System.assertEquals('OCM_02_001001', controller.ConsumableorderdetailsRecordserror[3].esd.Name); |
| | | // Controller.GoodsReturnCheck(); |
| | | controller.ShowGoodsofReturnList[0].esd.Return_reason__c='多发'; |
| | | controller.ShowGoodsofReturnList[0].esd.Rrturn_count__c =1; |
| | | //System.assertEquals(1, controller.ShowGoodsofReturnList.size()); |
| | | Controller.UpdateGoodsOfReturn(); |
| | | Controller.ToReturnGoodsPage(); |
| | | Controller.geterrorsize(); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | |
| | | @isTest |
| | | static void makeRecordsVieweTest() { |
| | | Integer count = 1001; |
| | | List<ArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<ArriveGoodsController.ConsumableorderdetailsInfo>(); |
| | | for(Integer i = 0; i < 1001; i++){ |
| | | conList.add(new ArriveGoodsController.ConsumableorderdetailsInfo()); |
| | | } |
| | | ArriveGoodsController arr = new ArriveGoodsController(); |
| | | arr.makeRecordsView(conList); |
| | | ArriveGoodsController arr1 = new ArriveGoodsController('',''); |
| | | } |
| | | |
| | | @isTest |
| | | static void compareToTest() { |
| | | ArriveGoodsController.ConsumableorderdetailsInfo c1 = new ArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | ArriveGoodsController.ConsumableorderdetailsInfo c2 = new ArriveGoodsController.ConsumableorderdetailsInfo(); |
| | | c1.compareTo(c2); |
| | | } |
| | | |
| | | @isTest |
| | | static void searchProTest1() { |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | System.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='N3047730',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='N3047731',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.Cancellation_Date__c = null; |
| | | Orderdet1.TracingCode__c = 'BXJRF'; |
| | | Orderdet1.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet1; |
| | | System.debug('Orderdet1:'+Orderdet1); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001001'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181234105ZK250BXJRF'; |
| | | Orderdet1.Cancellation_Date__c = null; |
| | | Orderdet2.TracingCode__c = 'BXJRF'; |
| | | Orderdet2.SerialLotNo__c = '5ZK'; |
| | | insert Orderdet2; |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?ArrType=Arr'); |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | List<Consumable_order_details2__c> ins = [SELECT Id,Name FROM Consumable_order_details2__c]; |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | public class ArriveGoodsControllerTestV2 { |
| | | <<<<<<< HEAD |
| | | @isTest |
| | | static void myUnitTest() { |
| | | // // TO DO: implement unit test |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | @isTest |
| | | static void myUnitTest() { |
| | | // // TO DO: implement unit test |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c =1; |
| | | Order1.Delivery_detail_count__c=1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c= Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8}; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | //排序 |
| | | Controller.barcode = ''; |
| | | Controller.SearchPro(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123'; |
| | | Controller.SearchPro(); |
| | | |
| | | // System.assertEquals(3, controller.ConsumableorderdetailsRecordsdummy.size()); //tcm |
| | | Controller.ArriveGoodsConfim(); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | <<<<<<< HEAD |
| | | global without sharing class Batch_FixAttachmentToFiles implements Database.Batchable<sObject> { |
| | | // Id batchJobId = Database.executeBatch(new Batch_FixAttachmentToFiles('Consumable_order__c',Datetime.newInstance(2023, 1, 1, 8, 0, 0),Datetime.newInstance(2024, 1, 1, 8, 0, 0)),2000); |
| | | private Datetime creStartDate = null; |
| | | private Datetime creEndDate = null; |
| | | private String objectApiName = null; |
| | | private Set<String> parentIds = new Set<String>(); //Add by Li Jun 20230703 |
| | | ======= |
| | | global without sharing class Batch_FixAttachmentToFiles implements Database.Batchable<sObject>{ |
| | | // Id batchJobId = Database.executeBatch(new Batch_FixAttachmentToFiles('Consumable_order__c',Datetime.newInstance(2023, 1, 1, 8, 0, 0),Datetime.newInstance(2024, 1, 1, 8, 0, 0)),2000); |
| | | private Datetime creStartDate = null; |
| | | private Datetime creEndDate = null; |
| | | private String objectApiName = null; |
| | | private Set<String> parentIds = new Set<String>();//Add by Li Jun 20230703 |
| | | >>>>>>> LEXCommunityLiJun |
| | | public Batch_FixAttachmentToFiles(String objectType, Datetime startTime, Datetime endTime) { |
| | | creStartDate = startTime; |
| | | creEndDate = endTime; |
| | |
| | | public Batch_FixAttachmentToFiles(Set<String> parentIds) { |
| | | this.parentIds = parentIds; |
| | | } |
| | | <<<<<<< HEAD |
| | | //Add by Li Jun 20230703 End |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | String queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE Parent.Type =:objectApiName AND CreatedDate >=:creStartDate AND CreatedDate <:creEndDate Order by CreatedDate ASC'; |
| | | if (parentIds.size() > 0) { |
| | | ======= |
| | | //Add by Li Jun 20230703 End |
| | | global Database.QueryLocator start(Database.BatchableContext BC) { |
| | | String queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE Parent.Type =:objectApiName AND CreatedDate >=:creStartDate AND CreatedDate <:creEndDate Order by CreatedDate ASC'; |
| | | if(parentIds.size() > 0){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | queryObject = 'SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById FROM Attachment WHERE ParentId in:parentIds'; |
| | | } |
| | | return Database.getQueryLocator(queryObject); |
| | |
| | | |
| | | global void execute(Database.BatchableContext BC, List<Attachment> scope) { |
| | | List<ContentVersion> insertContents = new List<ContentVersion>(); |
| | | <<<<<<< HEAD |
| | | Map<string, id> nameParentMaps = new Map<string, id>(); |
| | | Set<String> attachmentIds = new Set<String>(); |
| | | for (Attachment att : scope) { |
| | |
| | | insertContents.add(cVersion); |
| | | } |
| | | if (insertContents.isEmpty()) { |
| | | ======= |
| | | Map<string,id> nameParentMaps = new Map<string,id>(); |
| | | Set<String> attachmentIds = new Set<String>(); |
| | | for (Attachment att : scope) { |
| | | nameParentMaps.put(att.Id, att.ParentId); |
| | | attachmentIds.add(att.Id); |
| | | ContentVersion cVersion = new ContentVersion(); |
| | | cVersion.ContentLocation = 'S'; //S-Document is in Salesforce. E-Document is outside of Salesforce. L-Document is on a Social Netork. |
| | | cVersion.PathOnClient = att.Id; //File name with extention |
| | | cVersion.Origin = 'C'; //C-Content Origin. H-Chatter Origin. |
| | | cVersion.Title = att.Name; //Name of the file |
| | | cVersion.VersionData = att.Body; //File content |
| | | insertContents.add(cVersion); |
| | | } |
| | | if(insertContents.isEmpty()){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | return; |
| | | } |
| | | //Insert insertContents; |
| | | List<Database.SaveResult> saveResultsContents = Database.insert(insertContents, false); |
| | | <<<<<<< HEAD |
| | | insertLog(saveResultsContents, attachmentIds); |
| | | set<Id> contentIds = new Set<Id>(); |
| | | for (ContentVersion cv : insertContents) { |
| | |
| | | cDocLink.ContentDocumentId = cv.ContentDocumentId; //Add ContentDocumentId |
| | | cDocLink.LinkedEntityId = nameParentMaps.get(cv.Title); //Add attachment parentId |
| | | cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission. |
| | | ======= |
| | | insertLog(saveResultsContents,attachmentIds); |
| | | set<Id> contentIds = new set<Id>(); |
| | | for(ContentVersion cv : insertContents){ |
| | | contentIds.add(cv.id); |
| | | } |
| | | List<ContentVersion> conDocuments = [SELECT ContentDocumentId, Title,PathOnClient FROM ContentVersion WHERE Id in: contentIds]; |
| | | List<ContentDocumentLink> insertDocLinks = new List<ContentDocumentLink>(); |
| | | for(ContentVersion cv : conDocuments){ |
| | | ContentDocumentLink cDocLink = new ContentDocumentLink(); |
| | | cDocLink.ContentDocumentId = cv.ContentDocumentId; //Add ContentDocumentId |
| | | cDocLink.LinkedEntityId = nameParentMaps.get(cv.PathOnClient); //Add attachment parentId |
| | | cDocLink.ShareType = 'V'; //V - Viewer permission. C - Collaborator permission. I - Inferred permission. |
| | | >>>>>>> LEXCommunityLiJun |
| | | cDocLink.Visibility = 'AllUsers'; |
| | | insertDocLinks.add(cDocLink); |
| | | } |
| | | //Insert insertDocLinks; |
| | | List<Database.SaveResult> saveResultsLinks = Database.insert(insertDocLinks, false); |
| | | <<<<<<< HEAD |
| | | insertLog(saveResultsLinks, attachmentIds); |
| | | } |
| | | |
| | | global void insertLog(List<Database.SaveResult> saveResults, Set<String> attachmentIds) { |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | List<Map<String, String>> logMapList = new List<Map<String, String>>(); |
| | | ======= |
| | | insertLog(saveResultsLinks,attachmentIds); |
| | | } |
| | | |
| | | global void insertLog(List<Database.SaveResult> saveResults,Set<String> attachmentIds) { |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | List<Map<String,String>> logMapList = new List<Map<String,String>>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (Database.SaveResult result : saveResults) { |
| | | String recordId = result.getId(); |
| | | if (!result.isSuccess()) { |
| | | for (Database.Error error : result.getErrors()) { |
| | | <<<<<<< HEAD |
| | | Map<String, String> logMap = new Map<String, String>(); |
| | | String errorMsg = error.getMessage(); |
| | | logMap.put('recordId', recordId); |
| | | logMap.put('errorMsg', errorMsg); |
| | | ======= |
| | | Map<String,String> logMap = new Map<String,String>(); |
| | | String errorMsg = error.getMessage(); |
| | | logMap.put('recordId',recordId); |
| | | logMap.put('errorMsg',errorMsg); |
| | | >>>>>>> LEXCommunityLiJun |
| | | logMapList.add(logMap); |
| | | } |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | if (logMapList.size() > 0) { |
| | | Map<String, String> attachmentIdMap = new Map<String, String>(); |
| | | attachmentIdMap.put('attachmentIds', JSON.serialize(attachmentIds)); |
| | |
| | | global void finish(Database.BatchableContext BC) { |
| | | } |
| | | } |
| | | ======= |
| | | if(logMapList.size() > 0){ |
| | | Map<String,String> attachmentIdMap = new Map<String,String>(); |
| | | attachmentIdMap.put('attachmentIds',JSON.serialize(attachmentIds)); |
| | | logMapList.add(attachmentIdMap); |
| | | traLog.Response__c = JSON.serialize(logMapList); |
| | | traLog.Module__c = 'Attachment COnvert Transaction '; |
| | | Insert traLog; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | global void finish(Database.BatchableContext BC) { |
| | | |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest(SeeAllData=true) |
| | | private class Batch_FixAttachmentToFilesTest { |
| | | <<<<<<< HEAD |
| | | @isTest(SeeAllData=true) |
| | | static void testInit() { |
| | | String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | |
| | | Attachment attach = new Attachment(); |
| | | attach.Name = 'A-65224941-20200923--1.docx'; |
| | | Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body'); |
| | | ======= |
| | | |
| | | @isTest(SeeAllData=true) |
| | | static void testInit() { |
| | | String rectCo = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | Account accountItem1 = new Account(Name='Testaccount001',RecordTypeId = rectCo); |
| | | insert accountItem1; |
| | | |
| | | Consumable_order__c consOrder = new Consumable_order__c(); |
| | | consOrder.Name = 'test01'; |
| | | consOrder.Order_status__c = '批准'; |
| | | consOrder.Deliver_date__c = Date.today(); |
| | | consOrder.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | consOrder.Order_type__c = '订单'; |
| | | consOrder.Order_ProType__c = 'ENG'; |
| | | consOrder.Dealer_Info__c = accountItem1.Id; |
| | | consOrder.Delivery_detail_count__c = 5; |
| | | insert consOrder; |
| | | |
| | | List<Attachment> attachList = new List<Attachment>(); |
| | | Attachment attach = new Attachment(); |
| | | attach.Name='A-65224941-20200923--1.docx'; |
| | | Blob bodyBlob= Blob.valueOf('Unit Test Attachment Body'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | attach.body = bodyBlob; |
| | | attach.ParentId = consOrder.Id; |
| | | attachList.add(attach); |
| | | insert attachList; |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | Set<String> Id = new Set<String>(); |
| | | String objectType; |
| | | Datetime creStartDate; |
| | | Datetime creEndDate; |
| | | <<<<<<< HEAD |
| | | |
| | | List<Attachment> attachmentList = [ |
| | | SELECT Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById |
| | |
| | | ORDER BY CreatedDate ASC |
| | | LIMIT 1 |
| | | ]; |
| | | ======= |
| | | |
| | | List<Attachment> attachmentList = [Select Id, Name, OwnerId, ParentId, Parent.Name, Parent.Type, Body, CreatedDate, CreatedById |
| | | From Attachment |
| | | Where Id =:attachList[0].Id |
| | | Order by CreatedDate ASC |
| | | Limit 1]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (Attachment att : attachmentList) { |
| | | Id.add(att.ParentId); |
| | | objectType = att.Parent.Name; |
| | |
| | | creEndDate = att.CreatedDate.addDays(1); |
| | | } |
| | | System.Test.startTest(); |
| | | <<<<<<< HEAD |
| | | Database.executeBatch(new Batch_FixAttachmentToFiles(objectType, creStartDate, creEndDate), 1); |
| | | Database.executeBatch(new Batch_FixAttachmentToFiles(Id), 1); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | ======= |
| | | Database.executeBatch(new Batch_FixAttachmentToFiles(objectType,creStartDate,creEndDate),1); |
| | | Database.executeBatch(new Batch_FixAttachmentToFiles(Id),1); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | public with sharing class DealerInquiryModifyStateController { |
| | | public List<OpportunityInfo> oppRecords { get; set; } |
| | | // ページレイアウトの情報を取得 |
| | | <<<<<<< HEAD |
| | | private Map<String, Map<String, String>> editLayoutItemRWMap = new Map<String, Map<String, String>>(); |
| | | ======= |
| | | private Map<String, Map<String, String>> editLayoutItemRWMap = New Map<String, Map<String, String>>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // private Map<String, Map<String, String>> editLayoutItemRWMapRt = null; |
| | | public List<OpportunityInfo> OPPORTList { get; set; } |
| | | /*****************検索用******************/ |
| | | |
| | | /*******************检索属性值*******************/ |
| | | |
| | | <<<<<<< HEAD |
| | | public String accSearch { get; set; } //经销商医院 |
| | | public String aooSearch { get; set; } //担当人 |
| | | public String numtext1 { get; set; } //数据字段01 |
| | | public String numtext { get; set; } //数据字段03 |
| | | ======= |
| | | public String accSearch { get; set; }//经销商医院 |
| | | public String aooSearch { get; set; }//担当人 |
| | | public String numtext1 { get; set; } //数据字段01 |
| | | public String numtext { get; set; }//数据字段03 |
| | | >>>>>>> LEXCommunityLiJun |
| | | public String numtext2 { get; set; } //数据字段02 |
| | | public String timetext1 { get; set; } //日期01 |
| | | public String timetext2 { get; set; } //日期02 |
| | | public Agency_Opportunity__c tmpAO { get; set; } //检索日期用 |
| | | public Agency_Opportunity__c tmpBO { get; set; } //检索日期用 |
| | | <<<<<<< HEAD |
| | | public String limits { get; set; } //日期03 |
| | | ======= |
| | | public String limits { get; set; }//日期03 |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | public List<SelectOption> dateOpts { get; private set; } |
| | | public List<SelectOption> textOpts { get; private set; } |
| | |
| | | public String preSortKey { get; set; } |
| | | public Boolean sortOrderAsc { get; set; } |
| | | public String[] sortOrder { get; set; } |
| | | <<<<<<< HEAD |
| | | public String[] columus = new List<String>{ 'Id' }; |
| | | public String[] selColumus = null; |
| | | public Set<String> columusSet = new Set<String>{ 'Id' }; |
| | | ======= |
| | | public String[] columus = new String[] {'Id'}; |
| | | public String[] selColumus = null; |
| | | public Set<String> columusSet = new Set<String> {'Id'}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | // 项目set 字段标签 |
| | | public List<String> titleLeft { get; private set; } |
| | | public List<String> titleRight { get; private set; } |
| | | // 项目set 字段名 |
| | | <<<<<<< HEAD |
| | | public List<List<String>> columnsLeftApi { get; private set; } // 参照項目用 |
| | | public List<List<String>> columnsRightApi { get; private set; } // 参照項目用 |
| | | public List<String> columnLeftCss { get; private set; } // css 用 |
| | | public List<String> columnRightCss { get; private set; } // css 用 |
| | | public Map<String, String> columnLeftRW { get; private set; } // r,w,wm用 |
| | | public Map<String, String> columnRightRW { get; private set; } // r,w,wm用 |
| | | ======= |
| | | public List<List<String>> columnsLeftApi { get; private set; } // 参照項目用 |
| | | public List<List<String>> columnsRightApi { get; private set; } // 参照項目用 |
| | | public List<String> columnLeftCss { get; private set; } // css 用 |
| | | public List<String> columnRightCss { get; private set; } // css 用 |
| | | public Map<String, String> columnLeftRW { get; private set; } // r,w,wm用 |
| | | public Map<String, String> columnRightRW { get; private set; } // r,w,wm用 |
| | | >>>>>>> LEXCommunityLiJun |
| | | private String strColumus; |
| | | private String strRtColumus; |
| | | |
| | | //add by Link 2023-6-2 |
| | | <<<<<<< HEAD |
| | | public String remindMsg { get; set; } |
| | | |
| | | @TestVisible |
| | | private String accTypeForSort = null; |
| | | ======= |
| | | public String remindMsg{get;set;} |
| | | |
| | | @TestVisible private String accTypeForSort = null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | private static Integer oppLimit = 500; |
| | | |
| | | public DealerInquiryModifyStateController() { |
| | |
| | | textOpts.add(new SelectOption('Oly_Inquiry_Stage__c', 'Oly询价阶段')); |
| | | //精琢科技 zxk 2021-08-25 end |
| | | textOpts.add(new SelectOption('Hospital_City_Master__c', '市')); |
| | | <<<<<<< HEAD |
| | | |
| | | // textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.Salesdepartment_HP__c', '销售本部')); |
| | | // textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.State_Master__r.Name', '省')); |
| | |
| | | limits = '20'; |
| | | } |
| | | |
| | | ======= |
| | | |
| | | // textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.Salesdepartment_HP__c', '销售本部')); |
| | | // textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.State_Master__r.Name', '省')); |
| | | // textOpts.add(new SelectOption('Agency_Hospital__r.Hospital__r.City_Master__r.Name', '市')); |
| | | //日期字段下拉列表 |
| | | timeOpts = new List<SelectOption>(); |
| | | timeOpts.add(new SelectOption('', '--无--')); |
| | | timeOpts.add(new SelectOption('Created_Day__c', '创建日')); |
| | | timeOpts.add(new SelectOption('Bid_Planned_Date__c', '预测招标日')); |
| | | timeOpts.add(new SelectOption('Forecasted_Bid_Date__c', '预测中标日')); |
| | | timeOpts.add(new SelectOption('Close_Forecasted_Date__c', '预测与OLY签约日')); |
| | | timeOpts.add(new SelectOption('Lost_Opportunity_Date__c', '失单日期')); |
| | | timeOpts.add(new SelectOption('Deleted_Reason_Date__c', '取消日期')); |
| | | //数据字段中间连接符号 |
| | | equalOpts = new List<SelectOption>(); |
| | | equalOpts.add(new SelectOption('=', '等于')); |
| | | equalOpts.add(new SelectOption('<>', '不等于')); |
| | | equalOpts.add(new SelectOption('<', '<')); |
| | | equalOpts.add(new SelectOption('>', '>')); |
| | | equalOpts.add(new SelectOption('<=', '<=')); |
| | | equalOpts.add(new SelectOption('>=', '>=')); |
| | | equalOpts.add(new SelectOption('contains', '包含')); |
| | | equalOpts.add(new SelectOption('notcontains', '不包含')); |
| | | equalOpts.add(new SelectOption('starts with', '起始字符')); |
| | | //日期字段连接符号 |
| | | //timeequalOpts = new List<SelectOption>(); |
| | | //timeequalOpts.add(new SelectOption('=', '等于')); |
| | | //timeequalOpts.add(new SelectOption('<>', '不等于')); |
| | | //timeequalOpts.add(new SelectOption('<', '<')); |
| | | //timeequalOpts.add(new SelectOption('>', '>')); |
| | | //timeequalOpts.add(new SelectOption('<=', '<=')); |
| | | //timeequalOpts.add(new SelectOption('>=', '>=')); |
| | | //数据显示条数 |
| | | limitOpts = new List<SelectOption>(); |
| | | limitOpts.add(new SelectOption('10', '10')); |
| | | limitOpts.add(new SelectOption('20', '20')); |
| | | limitOpts.add(new SelectOption('50', '50')); |
| | | limitOpts.add(new SelectOption('100', '100')); |
| | | limitOpts.add(new SelectOption('200', '200')); |
| | | limitOpts.add(new SelectOption('1000', '全部')); |
| | | //数据显示默认条数 |
| | | limits = '20'; |
| | | } |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | public PageReference init() { |
| | | remindMsg = ''; |
| | | PartnerSoapSforceCom.Soap soap = new PartnerSoapSforceCom.Soap(); |
| | |
| | | layoutItem.layoutComponents.add(layoutComponent); |
| | | // return dlr; |
| | | } else { |
| | | <<<<<<< HEAD |
| | | dlr = soap.describeLayout('Agency_Opportunity__c', null, null); |
| | | ======= |
| | | dlr = soap.describeLayout('Agency_Opportunity__c', null, null); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // dlr = soap.describeLayout('asdas', null, null); |
| | | } |
| | | |
| | |
| | | for (PartnerSoapSforceCom.DescribeLayoutSection section : layout.editLayoutSections) { |
| | | for (PartnerSoapSforceCom.DescribeLayoutRow row : section.layoutRows) { |
| | | for (PartnerSoapSforceCom.DescribeLayoutItem item : row.layoutItems) { |
| | | <<<<<<< HEAD |
| | | if ( |
| | | item.layoutComponents != null && |
| | | item.layoutComponents.size() > 0 && |
| | | String.isBlank(item.layoutComponents[0].value) == false |
| | | ) { |
| | | ======= |
| | | if (item.layoutComponents != null && item.layoutComponents.size() > 0 |
| | | && String.isBlank(item.layoutComponents[0].value) == false) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | rtnInner.put(item.layoutComponents[0].value, 'r'); |
| | | if (item.editableForUpdate) { |
| | | rtnInner.put(item.layoutComponents[0].value, 'w'); |
| | |
| | | return null; |
| | | } |
| | | //用于获取经销商询价字段集和询价字段集以及相应的读写权限 |
| | | <<<<<<< HEAD |
| | | @TestVisible |
| | | private void setLayoutRWInfo() { |
| | | if (this.sortOrder == null) { |
| | | selColumus = new List<String>{}; |
| | | ======= |
| | | @TestVisible private void setLayoutRWInfo() { |
| | | if (this.sortOrder == null) { |
| | | selColumus = new String[] {}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | strColumus = ''; |
| | | ID accRecordTypeId = accTypeForSort; |
| | | |
| | |
| | | strRtColumus = strRtColumus + ',' + s; |
| | | } |
| | | columnRightCss.add(s.replace('.', '_')); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | strColumus = String.join(columus, ','); |
| | | System.debug('======-======-======strColumus' + strColumus); |
| | | System.debug('======-======-======strRtColumus' + strRtColumus); |
| | | this.sortOrderAsc = true; |
| | | <<<<<<< HEAD |
| | | this.sortOrder = new List<String>(selColumus.size()); |
| | | for (Integer i = 0; i < selColumus.size(); i++) |
| | | this.sortOrder[i] = ' '; |
| | | ======= |
| | | this.sortOrder = new String[selColumus.size()]; |
| | | for (Integer i = 0; i < selColumus.size(); i++) this.sortOrder[i] = ' '; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | //用于拼接SOQL语句 根据不同检索条件拼接不同SOQL语句。 |
| | |
| | | // System.debug('pppqqq333'+querySoql); |
| | | // AND Ownerid in ( '+querySoql+')' |
| | | |
| | | <<<<<<< HEAD |
| | | String soql = |
| | | 'SELECT Change_To_Opportunity__r.Id , Agency_Hospital__r.Name , Product_Category1__r.Name , Product_Category2__r.Name , Product_Category3__r.Name , Agency_Person__r.Name , Agency__r.Name , Change_To_Opportunity__r.Name ,' + |
| | | strColumus + |
| | | ',' + |
| | | strRtColumus + |
| | | ' FROM Agency_Opportunity__c WHERE recordType.DeveloperName = \'Opportunity\' '; |
| | | ======= |
| | | String soql = 'SELECT Change_To_Opportunity__r.Id , Agency_Hospital__r.Name , Product_Category1__r.Name , Product_Category2__r.Name , Product_Category3__r.Name , Agency_Person__r.Name , Agency__r.Name , Change_To_Opportunity__r.Name ,' + |
| | | strColumus + ',' + strRtColumus + |
| | | ' FROM Agency_Opportunity__c WHERE recordType.DeveloperName = \'Opportunity\' '; |
| | | >>>>>>> LEXCommunityLiJun |
| | | //数据字段:经销商医院 +SOQL |
| | | if (!String.isBlank(accSearch)) { |
| | | accSearch = accSearch.trim(); |
| | | // soql += 'AND Agency__r.Name ' + ' LIKE \'%' + accSearch + '%\' '; |
| | | <<<<<<< HEAD |
| | | soql += 'AND Agency_Hospital__r.Name ' + ' LIKE \'%' + accSearch + '%\' '; |
| | | ======= |
| | | soql += 'AND Agency_Hospital__r.Name ' + ' LIKE \'%' + accSearch + '%\' '; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //数据字段:担当人 +SOQL |
| | | if (!String.isBlank(aooSearch)) { |
| | |
| | | //数据字段:03 手动填写项 准备调用makeTextSql; |
| | | if (!String.isBlank(numtext)) { |
| | | String newNumtext = numtext.trim(); |
| | | <<<<<<< HEAD |
| | | String str = makeTextSql(numtext1, numtext2, newNumtext); |
| | | ======= |
| | | String str = makeTextSql(numtext1, numtext2, newNumtext); |
| | | >>>>>>> LEXCommunityLiJun |
| | | soql += str; |
| | | System.debug('+++++++++++++=============++++++++++++++++++' + soql); |
| | | } |
| | |
| | | soql += ' order by LastModifiedDate desc limit ' + Integer.valueOf(limits); |
| | | } else { |
| | | if (Integer.valueOf(this.sortKey) <= titleLeft.size() + 7) { |
| | | <<<<<<< HEAD |
| | | soql += |
| | | ' order by ' + |
| | | this.selColumus[Integer.valueOf(this.sortKey)] + |
| | |
| | | (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + |
| | | ' limit ' + |
| | | Integer.valueOf(limits); |
| | | ======= |
| | | soql += ' order by ' + this.selColumus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits); |
| | | } else { |
| | | soql += ' order by Change_To_Opportunity__r.' + this.selColumus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | system.debug(soql); |
| | |
| | | // System.debug('pppqqq111'+userlist1); |
| | | |
| | | List<Agency_Opportunity__c> InfoList = Database.query(soql); |
| | | <<<<<<< HEAD |
| | | System.debug('+++++++-------------------' + InfoList); |
| | | ======= |
| | | System.debug('+++++++-------------------'+InfoList); |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | // List<Agency_Opportunity__c> InfoList = ControllerUtil.DatabaseQuery(soql); |
| | | // System.debug('InfoList[0].Change_To_Opportunity_T__c'+InfoList[0].Change_To_Opportunity_T__c); |
| | |
| | | str = '\'' + agc.Change_To_Opportunity__r.Id + '\''; |
| | | } else if (agc.Change_To_Opportunity__r.Id != null) { |
| | | str += ',\'' + agc.Change_To_Opportunity__r.Id + '\''; |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | for (Agency_Opportunity__c info : InfoList) { |
| | |
| | | remindMsg = '取得最近的 ' + oppCount + ' 条数据'; |
| | | } else if (!String.isBlank(this.sortKey)) { |
| | | if (oppCount > oppLimit) { |
| | | <<<<<<< HEAD |
| | | ApexPages.addmessage( |
| | | new ApexPages.message(ApexPages.severity.INFO, '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件') |
| | | ); |
| | | ======= |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件')); |
| | | >>>>>>> LEXCommunityLiJun |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '数据超过' + oppLimit + '件,只显示前' + oppLimit + '件'; |
| | | } else { |
| | |
| | | String cSql = ''; |
| | | soql += ' AND ('; |
| | | for (Integer icount = 0; icount < vals.size(); icount++) { |
| | | <<<<<<< HEAD |
| | | //精琢科技 zxk 2021-08-25 start |
| | | String val = vals[icount]; |
| | | if (equalOpts == 'contains') { |
| | | cSql = this.makeTextSqlStr(textOpts, equalOpts, val); |
| | | soql += cSql; |
| | | |
| | | ======= |
| | | |
| | | //精琢科技 zxk 2021-08-25 start |
| | | String val = vals[icount]; |
| | | if (equalOpts == 'contains') { |
| | | cSql = this.makeTextSqlStr(textOpts, equalOpts, val); |
| | | soql += cSql; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (icount < vals.size() - 1) { |
| | | soql += ' OR '; |
| | | } |
| | |
| | | soql += ' AND '; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | //精琢科技 zxk 2021-08-25 end |
| | | |
| | | ======= |
| | | |
| | | } |
| | | //精琢科技 zxk 2021-08-25 end |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | // String val = vals[icount]; |
| | | // cSql = this.makeTextSqlStr(textOpts, equalOpts, val); |
| | | // system.debug(cSql); |
| | |
| | | else if (equalOpts == '=' || equalOpts == '<>') { |
| | | soql += 'AND ' + textOpts + equalOpts + '\'' + numtext + '\''; |
| | | } |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //精琢科技 zxk 2021-08-25 start |
| | | //起始字符 |
| | | else if (equalOpts == 'starts with' && numtext.contains(' ')) { |
| | |
| | | for (Integer icount = 0; icount < vals.size(); icount++) { |
| | | String val = vals[icount]; |
| | | if (equalOpts == 'starts with') { |
| | | <<<<<<< HEAD |
| | | soql += ' ' + textOpts + ' LIKE \'%' + val + '%\''; |
| | | if (icount < vals.size() - 1) { |
| | | soql += ' OR '; |
| | | ======= |
| | | soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ; |
| | | if (icount < vals.size() - 1) { |
| | | soql += ' OR '; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | soql += ')'; |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | //精琢科技 zxk 2021-08-25 end |
| | | |
| | |
| | | return soql; |
| | | } |
| | | //检索条件:数据字段1,数据字段2,数据字段3均满足,并且进入makeTextSql()之后,内含数据字段包含多种时进入此方法。 |
| | | <<<<<<< HEAD |
| | | @TestVisible |
| | | private String makeTextSqlStr(String textOpts, String equalOpts, String val) { |
| | | ======= |
| | | @TestVisible private String makeTextSqlStr(String textOpts, String equalOpts, String val) { |
| | | >>>>>>> LEXCommunityLiJun |
| | | String soql = ''; |
| | | if (!String.isBlank(textOpts)) { |
| | | String tmpVal = val; |
| | | if (!String.isBlank(tmpVal)) { |
| | | if (equalOpts == 'contains' || equalOpts == 'notcontains') { |
| | | if (equalOpts == 'contains') { |
| | | <<<<<<< HEAD |
| | | soql += ' ' + textOpts + ' LIKE \'%' + val + '%\''; |
| | | } else if (equalOpts == 'notcontains') { |
| | | soql += ' ( NOT ' + textOpts + ' LIKE \'%' + val + '%\' ) '; |
| | |
| | | soql += ' AND ' + textOpts + ' = ' + val; |
| | | } else if (equalOpts == '<>') { |
| | | soql += ' AND ' + textOpts + ' <> ' + val; |
| | | ======= |
| | | soql += ' ' + textOpts + ' LIKE \'%' + val + '%\'' ; |
| | | } else if (equalOpts == 'notcontains') { |
| | | soql += ' ( NOT ' + textOpts + ' LIKE \'%' + val + '%\' ) ' ; |
| | | } |
| | | } else if (equalOpts == '=' || equalOpts == '<>') { |
| | | if (equalOpts == '=') { |
| | | soql += ' AND ' + textOpts + ' = ' + val ; |
| | | } else if (equalOpts == '<>') { |
| | | soql += ' AND ' + textOpts + ' <> ' + val ; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } else { |
| | |
| | | setLayoutRWInfo(); |
| | | searchOppInner(); |
| | | return null; |
| | | <<<<<<< HEAD |
| | | } |
| | | //页面内容有修改时,页面判断后传值给changeFlg以及changeFlgRt属性,点击保存时调用此方法,进行保存。 |
| | | public PageReference save() { |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | } |
| | | //页面内容有修改时,页面判断后传值给changeFlg以及changeFlgRt属性,点击保存时调用此方法,进行保存。 |
| | | public PageReference save() { |
| | | //system.debug('oppRecords[1].opp:' + oppRecords[1].opp +' oppRecords[1].AgcOpp:' + oppRecords[1].AgcOpp ); |
| | | try { |
| | | List<Agency_Opportunity__c> updTarget = new List<Agency_Opportunity__c>(); |
| | | // List<Opportunity> updOpps = new List<Opportunity>(); |
| | | for (OpportunityInfo oi : oppRecords) { |
| | | if (oi.changeFlg == '1') { |
| | | oi.changeFlg = '0'; |
| | | updTarget.add(oi.AgcOpp); |
| | | |
| | | } |
| | | // if (oi.changeFlgRt == '1' && oi.opp.id != null) { |
| | | // oi.changeFlgRt = '0'; |
| | | // updOpps.add(oi.opp); |
| | | // } |
| | | } |
| | | if (updTarget.size() > 0) { |
| | | system.debug('updTarget.size:' + updTarget.size() ); |
| | | update updTarget; |
| | | } |
| | | // if (updOpps.size() > 0) { |
| | | // update updOpps; |
| | | // } |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '保存完了')); |
| | | //add by Link 2023-6-2 |
| | | remindMsg = '保存完了'; |
| | | } catch (Exception e) { |
| | | //ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, '请确定科室分类和产品区分的关系')); |
| | | } |
| | | if (saveType == '1') { |
| | | searchOppInner(); |
| | | saveType = ''; |
| | | } else if (saveType == '2') { |
| | | sortTable(); |
| | | saveType = ''; |
| | | } else { |
| | | } |
| | | return null; |
| | | } |
| | | //全部展开调用此方法 |
| | | public PageReference sortTable() { |
| | | oppRecords = new List<OpportunityInfo>(); |
| | | if (this.sortKey == this.preSortKey) { |
| | | if (String.isBlank(this.sortKey) == false) { |
| | | // 方向が変わるのみ |
| | | this.sortOrderAsc = !this.sortOrderAsc; |
| | | this.sortOrder[Integer.valueOf(this.sortKey)] = (this.sortOrderAsc == true ? '↑' : '↓'); |
| | | } |
| | | } else { |
| | | this.sortOrderAsc = true; |
| | | if (String.isBlank(this.preSortKey) == false) { |
| | | this.sortOrder[Integer.valueOf(this.preSortKey)] = ' '; |
| | | } |
| | | this.sortOrder[Integer.valueOf(this.sortKey)] = (this.sortOrderAsc == true ? '↑' : '↓'); |
| | | } |
| | | this.preSortKey = this.sortKey; |
| | | |
| | | setLayoutRWInfo(); |
| | | searchOppInner(); |
| | | return null; |
| | | } |
| | | |
| | | //自定义类OpportunityInfo,用于创建虚拟字段,合并输出。 |
| | | class OpportunityInfo { |
| | | // public Opportunity opp { get; set; } |
| | | public Agency_Opportunity__c opp { get; set; } |
| | | public Boolean canEdit { get; private set; } |
| | | public Boolean hasError { get; private set; } |
| | | public Boolean hasFieldError { get; private set; } |
| | | public Integer lineNo { get; private set; } |
| | | public String changeFlg { get; set; } |
| | | public String changeFlgRt { get; set; } |
| | | public Boolean ifLock { get; set; } |
| | | //public String accType { get; private set; } |
| | | public Agency_Opportunity__c AgcOpp { get; set; } |
| | | public OpportunityInfo(Agency_Opportunity__c record, Agency_Opportunity__c oppo) { |
| | | opp = oppo; |
| | | canEdit = true; |
| | | hasError = false; |
| | | hasFieldError = false; |
| | | lineNo = 0; |
| | | changeFlg = '0'; |
| | | changeFlgRt = '0'; |
| | | ifLock = Approval.isLocked(record); |
| | | AgcOpp = record; |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | private class DealerInquiryModifyStateControllerTest { |
| | | <<<<<<< HEAD |
| | | @TestSetup |
| | | static void init() { |
| | | List<RecordType> rectCo = [ |
| | |
| | | FROM RecordType |
| | | WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '診療科 消化科' |
| | | ]; |
| | | ======= |
| | | @TestSetup static void init() { |
| | | 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 = '診療科 消化科']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (rectDpt.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | // テストデータ |
| | | <<<<<<< HEAD |
| | | |
| | | Account company = new Account(); |
| | | company.RecordTypeId = rectCo[0].Id; |
| | |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = company.Id; |
| | | ======= |
| | | |
| | | Account company = new Account(); |
| | | company.RecordTypeId = rectCo[0].Id; |
| | | company.Name = 'NFM007TestCompany'; |
| | | insert company; |
| | | Account section = new Account(); |
| | | section.RecordTypeId = rectSct[0].Id; |
| | | section.Name = '*'; |
| | | section.Department_Class_Label__c = '消化科'; |
| | | section.ParentId = company.Id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | section.Hospital_Department_Class__c = company.Id; |
| | | insert section; |
| | | // Test.startTest(); |
| | | Account depart = new Account(); |
| | | depart.RecordTypeId = rectDpt[0].Id; |
| | | <<<<<<< HEAD |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'NFM007TestDepart'; |
| | | depart.ParentId = section.Id; |
| | |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = Date.today(); |
| | | ======= |
| | | depart.Name = '*'; |
| | | depart.Department_Name__c = 'NFM007TestDepart'; |
| | | depart.ParentId = section.Id; |
| | | depart.Department_Class__c = section.Id; |
| | | depart.Hospital__c = company.Id; |
| | | insert depart; |
| | | |
| | | 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-NFM007_1'; |
| | | opp.Trade__c = '内貿'; |
| | | opp.StageName = '引合'; |
| | | opp.CloseDate = Date.today(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | opp.Stock_apply_status__c = '申请中'; |
| | | insert opp; |
| | | Test.startTest(); |
| | |
| | | contact1.LastName = 'test1医院'; |
| | | contact1.Agency_User__c = true; |
| | | insert contact1; |
| | | <<<<<<< HEAD |
| | | List<Contact> contactlist = [ |
| | | SELECT Id, FirstName |
| | | FROM Contact |
| | |
| | | // |
| | | User user = new User(); |
| | | Profile p = [SELECT Id FROM Profile WHERE Name = '901_经销商活动系统']; |
| | | ======= |
| | | List<Contact> contactlist = [select Id, FirstName |
| | | from Contact |
| | | ]; |
| | | |
| | | System.assertEquals('責任者', contactlist[0].FirstName); |
| | | |
| | | |
| | | |
| | | // |
| | | User user = new User(); |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact1.Id; |
| | | user.FirstName = 'ユーザー'; |
| | |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | user.SalesManager__c = UserInfo.getUserId(); |
| | | <<<<<<< HEAD |
| | | System.runAs(new User(Id = UserInfo.getUserId())) { |
| | | insert user; |
| | | } |
| | |
| | | FROM User |
| | | WHERE LastName = 'テスト' |
| | | ]; |
| | | ======= |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert user; |
| | | } |
| | | List<user> users = [select Id, Name, LastName, FirstName from User where LastName = 'テスト']; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // |
| | | |
| | | Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | |
| | | // |
| | | |
| | | //System.assertEquals('テスト',users[0].LastName); |
| | | <<<<<<< HEAD |
| | | System.assertEquals('ユーザー', users[0].FirstName); |
| | | |
| | | Id rtId = [ |
| | |
| | | WHERE IsActive = TRUE AND SobjectType = 'Agency_Opportunity__c' AND DeveloperName = 'Opportunity' |
| | | ] |
| | | .Id; |
| | | ======= |
| | | System.assertEquals('ユーザー', users[0].FirstName ); |
| | | |
| | | Id rtId = [select Id, DeveloperName from RecordType where IsActive = true and SobjectType = 'Agency_Opportunity__c' and DeveloperName = 'Opportunity'].Id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // Schema.SobjectType.Agency_Opportunity__c.getRecordTypeInfosByName().get('询价').getRecordTypeId(); |
| | | Agency_opportunity__c agency_opportunity = new Agency_opportunity__c(); |
| | | agency_opportunity.RecordTypeId = rtId; |
| | |
| | | agency_opportunity.StageName__c = '还没申请预算'; |
| | | agency_opportunity.OwnerId = user.Id; |
| | | agency_opportunity.Change_To_Opportunity_T__c = '::CF-HQ290I'; |
| | | <<<<<<< HEAD |
| | | agency_opportunity.Sales_Manager__c = UserInfo.getUserId(); |
| | | |
| | | insert agency_opportunity; |
| | |
| | | |
| | | static testMethod void myUnitTest_SortKey() { |
| | | Test.startTest(); |
| | | ======= |
| | | agency_opportunity.Sales_Manager__c =UserInfo.getUserId(); |
| | | |
| | | insert agency_opportunity; |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | static testMethod void myUnitTest_SortKey() { |
| | | Test.startTest(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Test.setMock(WebServiceMock.class, new NFMTest_Mock()); |
| | | Test.stopTest(); |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | <<<<<<< HEAD |
| | | |
| | | // 初始化测试 |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | |
| | | ======= |
| | | |
| | | |
| | | // 初始化测试 |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | controller.init(); |
| | | //System.assertEquals(1, controller.oppRecords.size());验证预期值和结果值正确性 |
| | | // 排序测试 |
| | |
| | | // Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_AccSearchAndAoosearch() { |
| | | <<<<<<< HEAD |
| | | Test.startTest(); |
| | | ======= |
| | | Test.startTest(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Test.setMock(WebServiceMock.class, new NFMTest_Mock()); |
| | | Test.stopTest(); |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | // Test.startTest(); |
| | | <<<<<<< HEAD |
| | | |
| | | controller.init(); |
| | | //文本输入框检索 |
| | | //1:经销商医院 |
| | | controller.accSearch = '洪洞县中医院'; |
| | | controller.chick(); |
| | | //2:担当人 |
| | | controller.aooSearch = '王契琪'; |
| | | controller.chick(); |
| | | // Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_numtext_Equals() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | // 检索数据字段测试 |
| | | //1:检索经销商编码 = 151P-00001327 |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '='; |
| | | controller.numtext = '151P-00001327'; |
| | | controller.chick(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '<>'; |
| | | controller.numtext = '151P-00001327'; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_numtext_Starts_with() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '<'; |
| | | controller.numtext = '151P-00001327'; |
| | | controller.chick(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'starts with'; |
| | | controller.numtext = '151P-00001327'; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_contains() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | //2:检索经销商编码 包含 151P |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'contains'; |
| | | controller.numtext = '151P'; |
| | | controller.chick(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'notcontains'; |
| | | controller.numtext = '151P'; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_null_contains() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | //3:检索条件含空格 |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'contains'; |
| | | controller.numtext = '151P 150P'; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_null_notcontains() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'notcontains'; |
| | | controller.numtext = '151P 150P'; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_AllNull_contains() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'contains'; |
| | | controller.numtext = ' '; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_AllNull_notcontains() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = 'notcontains'; |
| | | controller.numtext = ' '; |
| | | controller.chick(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '='; |
| | | controller.numtext = ' '; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_tarts_with() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | Test.startTest(); |
| | | controller.init(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '<>'; |
| | | controller.numtext = ' '; |
| | | controller.chick(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = ' starts with '; |
| | | controller.numtext = ' '; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTest_Equals_D() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | //4:检索条件含逗号 |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '='; |
| | | controller.numtext = '151P-00001327,151P-00001343'; |
| | | controller.chick(); |
| | | controller.numtext1 = 'Agency_Opportunity_No__c'; |
| | | controller.numtext2 = '<>'; |
| | | controller.numtext = '151P-00001327,151P-00001343'; |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void myUnitTestTime01() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | | System.Test.setCurrentPage(page); |
| | | DealerInquiryModifyStateController controller = new DealerInquiryModifyStateController(); |
| | | // 初始化测试 |
| | | Test.startTest(); |
| | | controller.init(); |
| | | //检索日期测试 |
| | | controller.tmpAO = new Agency_Opportunity__c(); |
| | | controller.tmpBO = new Agency_Opportunity__c(); |
| | | controller.timetext1 = 'Created_Day__c'; |
| | | controller.timetext2 = '='; |
| | | controller.tmpAO.MaxActivityDate__c = date.valueOf('2018-12-12'); |
| | | ======= |
| | | |
| | | controller.init(); |
| | | //文本输入框检索 |
| | |
| | | controller.chick(); |
| | | // Test.startTest(); |
| | | controller.tmpAO.MaxActivityDate__c = date.valueOf('2018-12-02'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-12-12'); |
| | | controller.chick(); |
| | | |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-12-09'); |
| | | controller.chick(); |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-19'); |
| | | controller.chick(); |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09'); |
| | | controller.chick(); |
| | | <<<<<<< HEAD |
| | | // Test.startTest(); |
| | | controller.tmpAO.MaxActivityDate__c = date.valueOf('2018-12-02'); |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-12-12'); |
| | | controller.chick(); |
| | | |
| | |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09'); |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | ======= |
| | | Test.stopTest(); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | static testMethod void myUnitTestTime02() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | |
| | | controller.tmpBO.MaxActivityDate__c = date.valueOf('2018-02-09'); |
| | | controller.chick(); |
| | | Test.stopTest(); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | static testMethod void myUnitTestTimeSave() { |
| | | PageReference page = new PageReference('/apex/DealerInquiryModifyState'); |
| | |
| | | controller.init(); |
| | | Test.stopTest(); |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | private class LexArriveGoodsControllerTest { |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void test1() { |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | System.Test.stopTest(); |
| | | ======= |
| | | static void test1(){ |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Account myAccount1 = new Account(Name='Testaccount001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999996'); |
| | | Account myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900',Product_Limit_Date__c = 'Test01|2|4,Test02|3|5'); |
| | | insert new Account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c =1; |
| | | Order1.Delivery_detail_count__c=1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c= Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8}; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id); |
| | | String arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.searchProduct('', arrControllerStr); |
| | | re = LexArriveGoodsController.searchProduct('01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123', arrControllerStr); |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | System.Test.stopTest(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void test2() { |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | |
| | | '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222', |
| | | arrControllerStr |
| | | ); |
| | | ======= |
| | | static void test2(){ |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | |
| | | Account myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | Account myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =30,RecordTypeId = rectCo[0].Id); |
| | | insert new account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | |
| | | //返品订单 |
| | | |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01_002'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount1.id; |
| | | Order2.RecordTypeid = System.Label.Dealer_Returned_Label; |
| | | insert Order1; |
| | | insert Order2; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //没出库,没销售,就是在库 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet1.Arrive_date__c = date.today(); |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet1.TracingCode__c = 'BXSYS'; |
| | | |
| | | //daohuo |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.Arrive_date__c = date.today(); |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRI'; |
| | | Orderdet2.TracingCode__c = 'BXSYS'; |
| | | //sale |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001003'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet3.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet3.Arrive_date__c = date.today(); |
| | | Orderdet3.Used_date__c = date.today(); |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRJ'; |
| | | Orderdet3.TracingCode__c = 'BXSYS'; |
| | | //出库 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001004'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet4.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet4.Consumable_Shipment_order__c = Order1.Id; |
| | | Orderdet4.Send_Date__c = date.today(); |
| | | Orderdet4.Arrive_date__c = date.today(); |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BX222'; |
| | | Orderdet4.TracingCode__c = 'BXSYS'; |
| | | //quxiao |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001005'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet5.Cancellation_Date__c = Date.today(); |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRZ'; |
| | | Orderdet5.Box_Piece__c ='个'; |
| | | Orderdet5.TracingCode__c = 'BXSYS'; |
| | | //fanpin |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001006'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet6.Consumable_Return_order__c = Order2.Id; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet6.Box_Piece__c ='个'; |
| | | Orderdet6.TracingCode__c = 'BXSYS'; |
| | | |
| | | Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c(); |
| | | Orderdet7.Name = 'OCM_01_001001'; |
| | | Orderdet7.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet7.Consumable_Product__c = pro1.Id; |
| | | Orderdet7.Asset_Model_No__c = 'Pro001'; |
| | | Orderdet7.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet7.Bar_Code__c = '01049531702003111115120017181000105ZK250BX333'; |
| | | Orderdet7.TracingCode__c = 'BXSYS'; |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdet7}; |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | System.Test.startTest(); |
| | | Controller.init(); |
| | | Controller.barcode = '01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222'; |
| | | Controller.SearchPro(); |
| | | Controller.ArriveGoodsConfim(); |
| | | Controller.UpdateGoodsOfReturn(); |
| | | controller.getinventorysize(); |
| | | LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr',''); |
| | | String arrControllerStr = re.arrGoodCon; |
| | | re = LexArriveGoodsController.searchProduct('01049531702003111115120017181000105ZK250BXAAA\n01049531702003111115120017181000105ZK250BXJRJ\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BX123\n01049531702003111115120017181000105ZK250BX222', arrControllerStr); |
| | | >>>>>>> LEXCommunityLiJun |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | LexArriveGoodsController.updateGoodsOfReturn(re.arrGoodCon, JSON.serialize(re.showGoodsofReturnList)); |
| | |
| | | List<LexArriveGoodsController.ConsumableorderdetailsInfo> conList = new List<LexArriveGoodsController.ConsumableorderdetailsInfo>(); |
| | | conList.add(con); |
| | | LexArriveGoodsController.changeType2(conList); |
| | | <<<<<<< HEAD |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | public class LexArriveGoodsControllerTest1 { |
| | | <<<<<<< HEAD |
| | | static void test1() { |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | static void test1(){ |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | |
| | | Account myAccount1 = new Account(Name='Testaccount001',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999996'); |
| | | Account myAccount2 = new Account(Name='Testaccount002',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900',Product_Limit_Date__c = 'Test01|2|4,Test02|3|5'); |
| | | insert new Account[]{myAccount1,myAccount2}; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | user MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',UserPro_Type__c = 'ET'); |
| | | System.runAs(new User(Id = UserInfo.getUserId())){ |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | // User MyUser_Test = [select id,Contact.accountid from User WHERE ProfileId = :prof.Id and IsActive = true and UserPro_Type__c = 'ET' limit 1 ]; |
| | | // Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | // insert new Product2[] {prod01,prod02}; |
| | | system.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',RecordTypeId = '01210000000aMAFAA2',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | // Order1.Dealer_Info__c = myAccount1.id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Total_num__c = 3; |
| | | Order1.OrderNumber_arrived__c =1; |
| | | Order1.Delivery_detail_count__c=1; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | //订单明细 |
| | | //fahuo |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = Order1.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = pro1.Id; |
| | | Orderdet.Consumable_count__c = 40; |
| | | insert Orderdet; |
| | | |
| | | //发货明细 |
| | | //到货正确信息 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001002'; |
| | | Orderdet1.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet1.Consumable_Product__c = pro1.Id; |
| | | Orderdet1.Asset_Model_No__c = 'Test01'; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet1.TracingCode__c = 'BXJRA'; |
| | | |
| | | //取消产品 |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001003'; |
| | | Orderdet2.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet2.Consumable_Product__c = pro1.Id; |
| | | Orderdet2.Asset_Model_No__c = 'Test01'; |
| | | //Orderdet2.Consumable_Arrived_order__c = Order1.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRB'; |
| | | Orderdet2.Cancellation_Date__c= Date.today(); |
| | | Orderdet2.TracingCode__c = 'BXJRB'; |
| | | //销售产品 |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c(); |
| | | Orderdet3.Name = 'OCM_01_001004'; |
| | | Orderdet3.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet3.Consumable_Product__c = pro1.Id; |
| | | Orderdet3.Asset_Model_No__c = 'Test01'; |
| | | Orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRC'; |
| | | Orderdet3.Used_date__c = Date.today(); |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.TracingCode__c = 'BXJRC'; |
| | | //Orderdet3.Box_Piece__c = '盒'; |
| | | |
| | | |
| | | //出库产品 |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | | Orderdet4.Name = 'OCM_01_001005'; |
| | | Orderdet4.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet4.Consumable_Product__c = pro1.Id; |
| | | Orderdet4.Asset_Model_No__c = 'Test01'; |
| | | Orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet4.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRD'; |
| | | Orderdet4.Send_Date__c = Date.today(); |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.TracingCode__c = 'BXJRD'; |
| | | |
| | | //已到货产品 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001006'; |
| | | Orderdet5.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet5.Consumable_Product__c = pro1.Id; |
| | | Orderdet5.Asset_Model_No__c = 'Test01'; |
| | | Orderdet5.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet5.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRE'; |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | Orderdet5.TracingCode__c = 'BXJRE'; |
| | | |
| | | //发货明细 |
| | | //管理编码包含数字 |
| | | Consumable_order_details2__c Orderdet6 = new Consumable_order_details2__c(); |
| | | Orderdet6.Name = 'OCM_01_001002'; |
| | | Orderdet6.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet6.Consumable_Product__c = pro1.Id; |
| | | Orderdet6.Asset_Model_No__c = 'Test01'; |
| | | Orderdet6.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet6.Bar_Code__c = '01049531702003111115120017181000105ZK250BX123'; |
| | | Orderdet6.TracingCode__c = 'BX123'; |
| | | |
| | | //发错库 未到货 |
| | | Consumable_order_details2__c Orderdets8 = new Consumable_order_details2__c(); |
| | | Orderdets8.Name = 'OCM_01_001011'; |
| | | Orderdets8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdets8.Consumable_Product__c = pro1.Id; |
| | | Orderdets8.Asset_Model_No__c = 'Test01'; |
| | | Orderdets8.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdets8.Bar_Code__c = '01049531702003111115120017181000105ZK250BXsys'; |
| | | Orderdets8.Box_Piece__c = '盒'; |
| | | Orderdets8.TracingCode__c = 'BXsys'; |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2,Orderdet3,Orderdet4,Orderdet5,Orderdet6,Orderdets8}; |
| | | |
| | | List<Consumable_orderdetails__c> cod1 = [select Id from Consumable_orderdetails__c WHERE Consumable_order__c = :Order1.Id]; |
| | | System.assertEquals(1, cod1.size()); |
| | | |
| | | PageReference page = new PageReference('/apex/ArriveGoods?Esetid=' + Order1.Id); |
| | | |
| | | System.Test.setCurrentPage(page); |
| | | ArriveGoodsController Controller = new ArriveGoodsController(); |
| | | //初始化测试 |
| | | System.Test.startTest(); |
| | | LexArriveGoodsController.Results re = LexArriveGoodsController.init('Arr', Order1.Id); |
| | | String arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.searchProduct('', arrControllerStr); |
| | | re = LexArriveGoodsController.searchProduct('01049531702003111115120017181000105ZK250BXJRA\n01049531702003111115120017181000105ZK250BXsys\n01049531702003111115120017181000105ZK250BXsun\n01049531702003111115120017181000105ZK250BXJRB\n01049531702003111115120017181000105ZK250BXJRC\n01049531702003111115120017181000105ZK250BX111\n01049531702003111115120017181000105ZK250BXJRD\n01049531702003111115120017181000105ZK250BXJRE\n01049531702003111115120017181000105ZK250BXJRF\n01049531702003111115120017181000105ZK250BXJRG\n01049531702003111115120017181000105ZK250BX123', arrControllerStr); |
| | | arrControllerStr = re.arrGoodCon; |
| | | LexArriveGoodsController.arriveGoodsConfim(arrControllerStr); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | return results; |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | public class Results { |
| | | @AuraEnabled |
| | | public String result; |
| | |
| | | public Boolean isNoteStay; |
| | | } |
| | | } |
| | | ======= |
| | | public class Results { |
| | | @AuraEnabled |
| | | public String result; |
| | | @AuraEnabled |
| | | public String errorMsg; |
| | | @AuraEnabled |
| | | public String agencyProType; |
| | | @AuraEnabled |
| | | public String category1; |
| | | @AuraEnabled |
| | | public Date cate2; |
| | | @AuraEnabled |
| | | public String eSetId; |
| | | @AuraEnabled |
| | | public String accountId; |
| | | @AuraEnabled |
| | | public List<String> title; |
| | | @AuraEnabled |
| | | public List<Consumable_order__c> raesList; |
| | | @AuraEnabled |
| | | public String userWorkLocation; |
| | | @AuraEnabled |
| | | public Integer totalNum; |
| | | @AuraEnabled |
| | | public Integer orderNumberArrived; |
| | | @AuraEnabled |
| | | public Integer deliveryDetailCount; |
| | | @AuraEnabled |
| | | public Integer orderNumberNotarrive; |
| | | @AuraEnabled |
| | | public Integer moreThanSevenDays; |
| | | @AuraEnabled |
| | | public Boolean isNoteStay; |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @istest |
| | | public class LexArriveGoodsMainControllerTest { |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexArriveGoodsMainControllerTest1() { |
| | | ======= |
| | | static void lexArriveGoodsMainControllerTest1(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | Order_ProType__c = 'ET' |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1, Order2 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | Consumable_order__c Order2 = new Consumable_order__c( |
| | | Name='OCM_01_002', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[] {Order1, Order2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | createDetail1.name = 'Too002'; |
| | | createDetail1.Consumable_Product__c = pro2.id; |
| | | <<<<<<< HEAD |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | ======= |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail1.Dealer_Custom_Price__c = 999.00; |
| | | createDetail1.Consumable_count__c = 4; |
| | | createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail1; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001002', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | //Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001004', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | LexArriveGoodsMainController.init(); |
| | | LexArriveGoodsMainController.searchConsumableorderdetails('Too001', null, myAccount1.Id, '北京', 'ET'); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | public class LexArriveGsDetailsControllerTest { |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void test1() { |
| | | ======= |
| | | static void test1(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Account myAccount2; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | ); |
| | | insert myUser_Test; |
| | | System.runAs(MyUser_Test) { |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | insert myAccount2; |
| | | core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | myUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert myUser_Test; |
| | | System.runAs(MyUser_Test){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | StaticParameter.ConsumableAssetHanderTrigger = true; |
| | | Consumable_order__c order1 = new Consumable_order__c(); |
| | | order1.Name = 'OCM_01_001'; |
| | |
| | | order1.Order_type__c = '订单'; |
| | | order1.Dealer_Info__c = myAccount2.Id; |
| | | order1.RecordTypeid = System.Label.RT_ConOrder_Arrive; |
| | | <<<<<<< HEAD |
| | | insert order1; |
| | | |
| | | ======= |
| | | insert order1; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | Consumable_order__c olyorder = new Consumable_order__c(); |
| | | olyorder.Name = 'OCM_01_001'; |
| | | olyorder.Order_status__c = '批准'; |
| | | olyorder.Order_type__c = '订单'; |
| | | olyorder.Dealer_Info__c = myAccount2.Id; |
| | | olyorder.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | <<<<<<< HEAD |
| | | insert olyorder; |
| | | |
| | | ======= |
| | | insert olyorder; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //订单明细 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '22222'; |
| | | <<<<<<< HEAD |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 }; |
| | | LexArriveGsDetailsController.init(order1.Id); |
| | |
| | | LexArriveGsDetailsController.consumableorderdetailsRecords.size(), |
| | | order1.Id |
| | | ); |
| | | ======= |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2}; |
| | | LexArriveGsDetailsController.init(order1.Id); |
| | | LexArriveGsDetailsController.proSale(JSON.serialize(LexArriveGsDetailsController.coc), LexArriveGsDetailsController.coc.Arrive_Order__r.Total_num__c, LexArriveGsDetailsController.consumableorderdetailsRecords.size(), order1.Id); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void test2() { |
| | | ======= |
| | | static void test2(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Account myAccount2; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | ); |
| | | insert myUser_Test; |
| | | System.runAs(MyUser_Test) { |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | insert myAccount2; |
| | | core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | myUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert myUser_Test; |
| | | System.runAs(MyUser_Test){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | StaticParameter.ConsumableAssetHanderTrigger = true; |
| | | Consumable_order__c order1 = new Consumable_order__c(); |
| | | order1.Name = 'OCM_01_001'; |
| | |
| | | order1.Order_type__c = '订单'; |
| | | order1.RecordTypeid = System.Label.RT_ConOrder_Arrive; |
| | | order1.IsShipment__c = true; |
| | | <<<<<<< HEAD |
| | | insert order1; |
| | | ======= |
| | | insert order1; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | Consumable_order__c olyorder = new Consumable_order__c(); |
| | | olyorder.Name = 'OCM_01_001'; |
| | |
| | | olyorder.Dealer_Info__c = myAccount2.Id; |
| | | olyorder.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | olyorder.IsShipment__c = true; |
| | | <<<<<<< HEAD |
| | | insert olyorder; |
| | | |
| | | //订单明细 |
| | |
| | | Orderdet2.Bar_Code__c = '22222'; |
| | | |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2 }; |
| | | ======= |
| | | insert olyorder; |
| | | |
| | | |
| | | //订单明细 |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c(); |
| | | Orderdet1.Name = 'OCM_01_001001'; |
| | | Orderdet1.Consumable_order_minor__c = olyorder.Id; |
| | | Orderdet1.Consumable_Arrived_order__c = order1.Id; |
| | | //Orderdet1.IsArrival__c = true; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet1.Bar_Code__c = '11111'; |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001002'; |
| | | Orderdet2.Consumable_order_minor__c = olyorder.Id; |
| | | Orderdet2.Consumable_Arrived_order__c = order1.Id; |
| | | //Orderdet2.IsArrival__c = true; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | Orderdet2.Bar_Code__c = '22222'; |
| | | |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | LexArriveGsDetailsController.init(order1.Id); |
| | | LexArriveGsDetailsController.proSale(JSON.serialize(LexArriveGsDetailsController.coc), 1, 1, order1.Id); |
| | | } |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | public with sharing class LexCancelRemoveBoxController { |
| | | //经销商产品分类 |
| | | <<<<<<< HEAD |
| | | public static String agencyProType { get; set; } |
| | | ======= |
| | | public static String agencyProType {get;set;} |
| | | >>>>>>> LEXCommunityLiJun |
| | | public static String userPro_Typestr = null; |
| | | public static String barcode { get; set; } |
| | | /*****************画面表示Bean******************/ |
| | |
| | | public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordserror { get; set; } |
| | | //拆盒明细 |
| | | public static List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy { get; set; } |
| | | <<<<<<< HEAD |
| | | public static boolean saveFLGbln { get; set; } |
| | | //错误信息 |
| | | public static String alertMessage { get; set; } |
| | | //拆盒明细件数 |
| | | public static Integer getinventorysize() { |
| | | ======= |
| | | public static boolean saveFLGbln {get;set;} |
| | | //错误信息 |
| | | public static String alertMessage {set;get;} |
| | | //拆盒明细件数 |
| | | public static Integer getinventorysize(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | return ConsumableorderdetailsRecordsdummy.size(); |
| | | } |
| | | public static Map<String, String> ExistIdMap = new Map<String, String>(); |
| | | public static Map<String, String> ErrorIdMap = new Map<String, String>(); |
| | | public static Map<String, String> AllMap = new Map<String, String>(); |
| | | <<<<<<< HEAD |
| | | public static List<String> BarCodeListP = new List<String>(); |
| | | //不符合的barcode和型号 |
| | | public static list<String> notInlist = new List<String>(); |
| | | public static String baseUrl { get; private set; } |
| | | ======= |
| | | public static List<String> BarCodeListP = new List<String>(); |
| | | //不符合的barcode和型号 |
| | | public static list<String> notInlist = new list<String>(); |
| | | public static String baseUrl {get;private set;} |
| | | >>>>>>> LEXCommunityLiJun |
| | | private static String accountid = null; |
| | | private static String accountName = null; |
| | | //public String[] proidList =new String[]{}; |
| | | // 登录者工作地 |
| | | private static String userWorkLocation; |
| | | |
| | | <<<<<<< HEAD |
| | | public LexCancelRemoveBoxController() { |
| | | ======= |
| | | public LexCancelRemoveBoxController(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | baseUrl = URL.getSalesforceBaseUrl().toExternalForm(); |
| | | ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>(); |
| | | ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>(); |
| | | consumableInventory = new List<ConsumableorderdetailsInfo>(); |
| | | <<<<<<< HEAD |
| | | saveFLGbln = false; |
| | | ======= |
| | | saveFLGbln = FALSE; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | |
| | | @AuraEnabled |
| | |
| | | res.entity = data; |
| | | |
| | | String userId = UserInfo.getUserId(); |
| | | <<<<<<< HEAD |
| | | List<user> Useracc = new List<user>(); |
| | | Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | |
| | | data.put('accountName', accountName); |
| | | data.put('userWorkLocation', userWorkLocation); |
| | | data.put('agencyProType', agencyProType); |
| | | ======= |
| | | List<user> Useracc = New List<user>(); |
| | | Useracc = [SELECT accountid, Work_Location__c,UserPro_Type__c FROM user WHERE id =:userId]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | | if(String.isBlank(Useracc[0].UserPro_Type__c)){ |
| | | agencyProType = 'ET'; |
| | | } |
| | | userPro_Typestr = '%' + agencyProType + '%'; |
| | | List<account> accountInfo = [SELECT Name FROM account WHERE id =:accountid]; |
| | | //String view_product = accountInfo[0].view_product__c; |
| | | accountName = accountInfo[0].Name; |
| | | //proidList = view_product.split(','); |
| | | data.put('accountName',accountName); |
| | | data.put('userWorkLocation',userWorkLocation); |
| | | data.put('agencyProType',agencyProType); |
| | | >>>>>>> LEXCommunityLiJun |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | System.debug('res = ' + res); |
| | | return res; |
| | | <<<<<<< HEAD |
| | | } |
| | | |
| | | // 将页面或取得BarCode去掉重复的,转换成List |
| | |
| | | } |
| | | List<String> outPut = new List<String>(); |
| | | for (String B : Buff) { |
| | | ======= |
| | | |
| | | } |
| | | |
| | | // 将页面或取得BarCode去掉重复的,转换成List |
| | | public static List<String> ParseBarCode(String Code){ |
| | | String[] Cache = new String[]{}; |
| | | Cache = Code.split('\n'); |
| | | Set <String> Buff = new Set<String>(); |
| | | for(String A : Cache){ |
| | | Buff.add(A); |
| | | } |
| | | List<String> outPut = new List<String>(); |
| | | for(String B :Buff){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | B = B.trim(); |
| | | outPut.add(B); |
| | | } |
| | |
| | | |
| | | //获取明细 |
| | | @AuraEnabled |
| | | <<<<<<< HEAD |
| | | public static ResponseBodyLWC searchConsumableorderdetails( |
| | | String barcode, |
| | | String accountName, |
| | |
| | | ) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String, object> data = new Map<String, object>(); |
| | | ======= |
| | | public static ResponseBodyLWC searchConsumableorderdetails(String barcode,String accountName,String userWorkLocation,String agencyProType) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String,object> data = new Map<String,object>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | res.entity = data; |
| | | userPro_Typestr = '%' + agencyProType + '%'; |
| | | barcode = barcode; |
| | |
| | | ConsumableorderdetailsRecordserror = new List<ConsumableorderdetailsInfo>(); |
| | | ConsumableorderdetailsRecordsdummy = new List<ConsumableorderdetailsInfo>(); |
| | | |
| | | <<<<<<< HEAD |
| | | notInlist = new List<String>(); |
| | | BarCodeListP = ParseBarCode(barcode); |
| | | Consumable_order_details2__c p = new Consumable_order_details2__c(); |
| | |
| | | //判断barcode是否为空 |
| | | if (barcode == null || barcode == '') { |
| | | return new ResponseBodyLWC('Error', 500, '请输入BarCode号', ''); |
| | | ======= |
| | | |
| | | |
| | | notInlist = new list<String>(); |
| | | BarCodeListP = ParseBarCode(barcode); |
| | | Consumable_order_details2__c p = new Consumable_order_details2__c(); |
| | | List<Consumable_order_details2__c> Ins = New List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> reSet = new List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> reSet1 = new List<Consumable_order_details2__c>(); |
| | | saveFLGbln = FALSE; |
| | | alertMessage=''; |
| | | |
| | | //判断barcode是否为空 |
| | | if(barcode == null || barcode ==''){ |
| | | return new ResponseBodyLWC('Error',500, '请输入BarCode号', ''); |
| | | >>>>>>> LEXCommunityLiJun |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'请输入BarCode号。')); |
| | | // return; |
| | | } |
| | |
| | | // ConsumableorderdetailsRecordsdummy.clear(); |
| | | |
| | | // 产品类型不同 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品类型' + reSet1[i].Product_Type__c + '与产品类型' + agencyProType + '不符,不能拆盒'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c,Product_Type__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c = : userWorkLocation |
| | | AND (not Product_Type__c like : userPro_Typestr) |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品类型'+ reSet1[i].Product_Type__c +'与产品类型'+ agencyProType +'不符,不能拆盒'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | //没有拆盒 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品没有拆盒'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c= false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '盒' |
| | | //AND ProductPacking_list_manual__c > 1 |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; //没出库,没销售,在库,没有拆盒 |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品没有拆盒'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | //已出货,未到货 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品还未到货'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = FALSE |
| | | AND Dealer_Shipment__c= FALSE |
| | | AND Dealer_Saled__c = FALSE |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '盒' |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品还未到货'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | //拆盒已出货 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品存在出货履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Shipment__c = true |
| | | AND Dealer_Arrive__c = true |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c != null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品存在出货履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | //拆盒已销售 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品存在销售履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Saled__c = true |
| | | AND Dealer_Arrive__c = true |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c != null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品存在销售履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | //拆盒返品 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品存在返品履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Returned__c = true |
| | | AND Return_date__c != null |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c != null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品存在返品履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //拆盒后盘点过(盘点日期不为空) |
| | | reSet1 = [ |
| | | SELECT |
| | |
| | | String str = '该商品存在盘点履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | |
| | | //拆盒后盘点过(盘点日期不为空) |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Inventory_date__c != null |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c != null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品存在盘点履历'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | //不同工作地 |
| | | <<<<<<< HEAD |
| | | reSet1 = [ |
| | | SELECT |
| | | Id, |
| | |
| | | String str = '该商品属于' + reSet1[i].Arrive_Owner_Work_Location__c + ',不能取消拆盒'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i], str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c, reSet1[i].Bar_Code__c); |
| | | ======= |
| | | reSet1 = [SELECT Id, Name,Consumable_Product__r.Name__c, |
| | | Consumable_Product__c,Consumable_Product__r.Name, Sterilization_limit__c, |
| | | Deliver_date__c,Bar_Code__c, |
| | | Arrive_date__c,Send_Date__c,Consumable_order_minor__r.Name,Consumable_order_minor__c, |
| | | recordtypeid,Consumable_order_minor__r.Arrive_Order__c, Arrive_Owner_Work_Location__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c !=: userWorkLocation |
| | | ORDER BY Name ]; |
| | | if(reSet1.size() > 0){ |
| | | for (Integer i = 0; i < reSet1.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet1[i].Bar_Code__c)){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | }else{ |
| | | String str = '该商品属于' + reSet1[i].Arrive_Owner_Work_Location__c + ',不能取消拆盒'; |
| | | ConsumableorderdetailsRecordserror.add(new ConsumableorderdetailsInfo(reSet1[i],str)); |
| | | ErrorIdMap.put(reSet1[i].Bar_Code__c,reSet1[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | reSet = [ |
| | | SELECT |
| | | Id, |
| | |
| | | } else { |
| | | ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i])); |
| | | ExistIdMap.put(reSet[i].Bar_Code__c, reSet[i].Bar_Code__c); |
| | | ======= |
| | | reSet = [SELECT Id, |
| | | Name, |
| | | Intra_Trade_List_RMB__c, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__c, |
| | | Consumable_Product__r.Name, |
| | | Consumable_Product__r.Name__c, |
| | | Sterilization_limit__c, |
| | | Deliver_date__c, |
| | | Bar_Code__c, |
| | | Arrive_date__c, |
| | | Send_Date__c, |
| | | Consumable_order_minor__r.Name, |
| | | Consumable_order_minor__c, |
| | | Dealer_Arrive__c, |
| | | Guarantee_period_for_products__c, |
| | | CFDA_Status__c, |
| | | ProductPacking_list_manual__c, |
| | | Report_Product_Approbation__c, |
| | | Report_Product_Expiration__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c != null |
| | | AND Bar_Code__c in :BarCodeListP |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Product_Type__c like : userPro_Typestr |
| | | ]; |
| | | if(reSet.size()>0){ |
| | | for (Integer i = 0; i < reSet.size(); i++) { |
| | | if(ErrorIdMap.containsKey(reSet[i].Bar_Code__c) ){ |
| | | // 跳过错误的消耗品明细 |
| | | continue; |
| | | } |
| | | else if(ExistIdMap.containsKey(reSet[i].Bar_Code__c) ){ |
| | | // 跳过已经处理的消耗品明细 |
| | | continue; |
| | | } |
| | | else{ |
| | | ConsumableorderdetailsRecordsdummy.add(new ConsumableorderdetailsInfo(reSet[i])); |
| | | ExistIdMap.put(reSet[i].Bar_Code__c,reSet[i].Bar_Code__c); |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | } |
| | |
| | | AllMap.putAll(ExistIdMap); |
| | | |
| | | //得到不存在的BarCode |
| | | <<<<<<< HEAD |
| | | for (Integer i = 0; i < BarCodeListP.size(); i++) { |
| | | if (ExistIdMap.containsKey(BarCodeListP[i])) { |
| | | continue; |
| | |
| | | data.put('ConsumableorderdetailsRecordsdummy', JSON.serialize(ConsumableorderdetailsRecordsdummy)); |
| | | data.put('ConsumableorderdetailsRecordserror', JSON.serialize(ConsumableorderdetailsRecordserror)); |
| | | data.put('dataSize', ConsumableorderdetailsRecordsdummy.size()); |
| | | ======= |
| | | for(Integer i = 0; i < BarCodeListP.size(); i++){ |
| | | if(ExistIdMap.containsKey(BarCodeListP[i])){ |
| | | continue; |
| | | }else if(ErrorIdMap.containsKey(BarCodeListP[i])){ |
| | | continue; |
| | | }else{ |
| | | notInlist.add(BarCodeListP[i]); |
| | | } |
| | | } |
| | | if(notInlist.size()>0){ |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'BarCode'+ notInlist + '不存在。')); |
| | | return new ResponseBodyLWC('Error',500, 'BarCode'+ notInlist + '不存在。', ''); |
| | | } |
| | | data.put('ConsumableorderdetailsRecordsdummy',JSON.serialize(ConsumableorderdetailsRecordsdummy)); |
| | | data.put('ConsumableorderdetailsRecordserror',JSON.serialize(ConsumableorderdetailsRecordserror)); |
| | | data.put('dataSize',ConsumableorderdetailsRecordsdummy.size()); |
| | | >>>>>>> LEXCommunityLiJun |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | System.debug('res = ' + res); |
| | | return res; |
| | | <<<<<<< HEAD |
| | | } |
| | | |
| | | //取消拆盒确认 |
| | |
| | | return null; |
| | | } |
| | | } |
| | | ======= |
| | | |
| | | } |
| | | |
| | | //取消拆盒确认 |
| | | @AuraEnabled |
| | | public static ResponseBodyLWC cancelRemoveBoxConfirm(String saveConsumableorderdetailsRecordsdummy,String accountName,String userWorkLocation,String agencyProType) { |
| | | ResponseBodyLWC res = new ResponseBodyLWC(); |
| | | Map<String,object> data = new Map<String,object>(); |
| | | res.entity = data; |
| | | |
| | | userPro_Typestr = '%' + agencyProType + '%'; |
| | | accountName = accountName; |
| | | userWorkLocation =userWorkLocation; |
| | | List<ConsumableorderdetailsInfo> ConsumableorderdetailsRecordsdummy = (List<ConsumableorderdetailsInfo>)JSON.deserialize(saveConsumableorderdetailsRecordsdummy,List<ConsumableorderdetailsInfo>.class); |
| | | |
| | | |
| | | List<Consumable_order_details2__c> ins = New List<Consumable_order_details2__c>(); |
| | | |
| | | Savepoint sp = Database.setSavepoint(); |
| | | if(ConsumableorderdetailsRecordsdummy.size()<1){ |
| | | // ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'不存在取消拆盒明细')); |
| | | return new ResponseBodyLWC('Error',500, '不存在取消拆盒明细', ''); |
| | | // return null; |
| | | } |
| | | |
| | | List<String> BarCodeList = new List<String>(); |
| | | for (ConsumableorderdetailsInfo tmp : ConsumableorderdetailsRecordsdummy) { |
| | | BarCodeList.add(tmp.esd.Bar_Code__c); |
| | | } |
| | | |
| | | try{ |
| | | //取得通番大于001的在库明细 |
| | | List<Consumable_order_details2__c> orderDetails2del = [SELECT |
| | | Id, |
| | | Box_Piece__c, |
| | | RemoveBox_date__c, |
| | | RemoveBox_No__c, |
| | | Bar_Code__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rentx 2020-10-13 end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c != null |
| | | AND RemoveBox_No__c > 1 |
| | | AND Bar_Code__c in :BarCodeList |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Product_Type__c like : userPro_Typestr |
| | | ]; |
| | | |
| | | List<Consumable_order_details2__c> orderlistdel = new List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> orderlistupd= new List<Consumable_order_details2__c>(); |
| | | |
| | | for (Consumable_order_details2__c detail2tmp : orderDetails2del) { |
| | | Consumable_order_details2__c delDetails2 = new Consumable_order_details2__c(); |
| | | delDetails2.Id = detail2tmp.Id; |
| | | |
| | | //删除通番大于001的明细2 |
| | | //delete delDetails2; |
| | | orderlistdel.add(delDetails2); |
| | | } |
| | | |
| | | //取得通番001的在库明细 |
| | | List<Consumable_order_details2__c> orderDetails2 = [SELECT |
| | | Id, |
| | | Box_Piece__c, |
| | | RemoveBox_date__c, |
| | | RemoveBox_No__c, |
| | | Bar_Code__c, |
| | | //add by rentx 2020-10-13 start |
| | | ContractNo_text__c |
| | | /*,ContractNo__c*/ |
| | | //add by rebtx 2020-10-13 end |
| | | // tcm start |
| | | ,Consumable_order_minor__r.ContractNo__c |
| | | // tcm end |
| | | FROM Consumable_order_details2__c |
| | | WHERE Dealer_Arrive__c = true |
| | | AND Dealer_Shipment__c = false |
| | | AND Dealer_Saled__c = false |
| | | AND Dealer_Returned__c = false |
| | | AND Lose_Flag__c = false |
| | | AND Box_Piece__c = '个' |
| | | AND RemoveBox_date__c !=null |
| | | AND RemoveBox_No__c = 1 |
| | | AND Bar_Code__c in :BarCodeList |
| | | AND Dealer_Info_text__c = :accountName |
| | | AND Arrive_Owner_Work_Location__c =: userWorkLocation |
| | | AND Product_Type__c like : userPro_Typestr |
| | | ]; |
| | | |
| | | for (Consumable_order_details2__c detail2tmp : orderDetails2) { |
| | | Consumable_order_details2__c updDetails2 = new Consumable_order_details2__c(); |
| | | updDetails2.Id = detail2tmp.Id; |
| | | updDetails2.Box_Piece__c = '盒'; |
| | | updDetails2.RemoveBox_date__c = null; |
| | | updDetails2.RemoveBox_No__c = null; |
| | | |
| | | // tcm start |
| | | if (String.isBlank(detail2tmp.Consumable_order_minor__r.ContractNo__c)) { |
| | | updDetails2.ContractNo_text__c= detail2tmp.ContractNo_text__c; |
| | | }else { |
| | | updDetails2.ContractNo_text__c= detail2tmp.Consumable_order_minor__r.ContractNo__c; |
| | | } |
| | | // updDetails2.ContractNo_text__c = detail2tmp.ContractNo__c; |
| | | // tcm end |
| | | |
| | | //通番001のデータの管理単位を盒に戻し、通番をクリア |
| | | //update updDetails2; |
| | | orderlistupd.add(updDetails2); |
| | | } |
| | | |
| | | if(orderlistdel.size()>0){ |
| | | delete orderlistdel; |
| | | } |
| | | |
| | | if(orderlistupd.size()>0){ |
| | | update orderlistupd; |
| | | } |
| | | saveFLGbln = true; |
| | | alertMessage = '取消拆盒完成'; |
| | | data.put('saveFLGbln',saveFLGbln); |
| | | res.status = 'Success'; |
| | | res.code = 200; |
| | | res.msg = alertMessage; |
| | | System.debug('res = ' + res); |
| | | return res; |
| | | // return null; |
| | | }catch(Exception e){ |
| | | Database.rollback(sp); |
| | | ApexPages.addMessages(e); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | @TestVisible |
| | | class ConsumableorderdetailsInfo implements Comparable { |
| | |
| | | //public String tracingCodeNo { get; set; } |
| | | public String oldConsumableCount { get; set; } |
| | | public String ErrorReason { get; set; } |
| | | <<<<<<< HEAD |
| | | public ConsumableorderdetailsInfo(Consumable_order_details2__c e, string str) { |
| | | esd = e; |
| | | Prod = e.Consumable_Product__r; |
| | |
| | | oldConsumableCount = e.name; |
| | | } |
| | | /* |
| | | ======= |
| | | public ConsumableorderdetailsInfo(Consumable_order_details2__c e,string str) { |
| | | esd = e; |
| | | Prod = e.Consumable_Product__r; |
| | | oldConsumableCount = e.name; |
| | | ErrorReason = str; |
| | | } |
| | | public ConsumableorderdetailsInfo(Consumable_order_details2__c e) { |
| | | esd = e; |
| | | Prod = e.Consumable_Product__r; |
| | | oldConsumableCount = e.name; |
| | | } |
| | | /* |
| | | >>>>>>> LEXCommunityLiJun |
| | | public ConsumableorderdetailsInfo(Product2__c e,String barCode,Date sterilizationlimit,String serialNoorLot,String tracingCode) { |
| | | esd = new Consumable_order_details2__c(); |
| | | ProductName = e.Name__c; |
| | |
| | | return null; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @IsTest |
| | | private class LexCancelRemoveBoxControllerTest { |
| | | <<<<<<< HEAD |
| | | static testMethod void testMethod1() { |
| | | ======= |
| | | static testMethod void testMethod1(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | user myUser_test; |
| | | Account myAccount2; |
| | | <<<<<<< HEAD |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | List<RecordType> rectCo = [ |
| | |
| | | insert Order1; |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>(); |
| | | |
| | | ======= |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | |
| | | myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); |
| | | insert MyUser_Test; |
| | | } |
| | | System.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',JANCODE__c = '04953170200311',Dealer_special_Object__c = true,Packing_list_manual__c = 5,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',JANCODE__c = '04953170200312',Dealer_special_Object__c = true,Packing_list_manual__c = 5,Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',JANCODE__c = '04953170200313',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02,prod03}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id); |
| | | insert new Product2__c[] {pro1, pro2,pro3}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>(); |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //daoku |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c(); |
| | | Orderdet2.Name = 'OCM_01_001001'; |
| | |
| | | Orderdet2.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRF'; |
| | | Orderdet2.Used_date__c = null; |
| | | Orderdet2.Lose_Flag__c = false; |
| | | <<<<<<< HEAD |
| | | Orderdet2.Return_date__c = null; |
| | | Orderdet2.Send_Date__c = null; |
| | | ======= |
| | | Orderdet2.Return_date__c= null; |
| | | Orderdet2.Send_Date__c= null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet2.Box_Piece__c = '盒'; |
| | | conList.add(Orderdet2); |
| | | // insert Orderdet2; |
| | |
| | | Orderdet3.Arrive_date__c = Date.today(); |
| | | Orderdet3.Send_Date__c = Date.today(); |
| | | Orderdet3.Box_Piece__c = '个'; |
| | | <<<<<<< HEAD |
| | | Orderdet3.RemoveBox_date__c = Date.today(); |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet3.Used_date__c = null; |
| | |
| | | Orderdet3.Return_date__c = null; |
| | | conList.add(Orderdet3); |
| | | // insert Orderdet3; |
| | | ======= |
| | | Orderdet3.RemoveBox_date__c= Date.today(); |
| | | Orderdet3.Bar_Code__c = '01049531702003111115120017181000105ZK250BXJRA'; |
| | | Orderdet3.Used_date__c = null; |
| | | Orderdet3.Lose_Flag__c = false; |
| | | Orderdet3.Return_date__c= null; |
| | | conList.add(Orderdet3); |
| | | // insert Orderdet3; |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //sale |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c(); |
| | |
| | | Orderdet4.Asset_Model_No__c = 'Test02'; |
| | | Orderdet4.Arrive_date__c = Date.today(); |
| | | Orderdet4.Box_Piece__c = '个'; |
| | | <<<<<<< HEAD |
| | | Orderdet4.RemoveBox_date__c = Date.today(); |
| | | Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS'; |
| | | Orderdet4.Lose_Flag__c = false; |
| | |
| | | // insert Orderdet4; |
| | | conList.add(Orderdet4); |
| | | |
| | | ======= |
| | | Orderdet4.RemoveBox_date__c= Date.today(); |
| | | Orderdet4.Bar_Code__c = '011495317020843711170400172003311074K250CXSDS'; |
| | | Orderdet4.Lose_Flag__c = false; |
| | | Orderdet4.Return_date__c= null; |
| | | Orderdet4.Used_date__c= Date.today(); |
| | | // insert Orderdet4; |
| | | conList.add(Orderdet4); |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //ProductPacking_list_manual__c=1 |
| | | Consumable_order_details2__c Orderdet5 = new Consumable_order_details2__c(); |
| | | Orderdet5.Name = 'OCM_01_001004'; |
| | |
| | | Orderdet5.Arrive_date__c = Date.today(); |
| | | //Orderdet5.Used_date__c = Date.today(); |
| | | Orderdet5.Box_Piece__c = '盒'; |
| | | <<<<<<< HEAD |
| | | Orderdet5.RemoveBox_date__c = Date.today(); |
| | | Orderdet5.Used_date__c = null; |
| | | Orderdet5.Lose_Flag__c = false; |
| | | Orderdet5.Return_date__c = null; |
| | | Orderdet5.Send_Date__c = null; |
| | | ======= |
| | | Orderdet5.RemoveBox_date__c= Date.today(); |
| | | Orderdet5.Used_date__c = null; |
| | | Orderdet5.Lose_Flag__c = false; |
| | | Orderdet5.Return_date__c= null; |
| | | Orderdet5.Send_Date__c=null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet5.Bar_Code__c = '010495317014059411170400172203311074K250DCWQW'; |
| | | // insert Orderdet5; |
| | | conList.add(Orderdet5); |
| | | |
| | | //pandian |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c(); |
| | | ======= |
| | | Consumable_order_details2__c Orderdet7 = new Consumable_order_details2__c(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet7.Name = 'OCM_01_001004'; |
| | | Orderdet7.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet7.Consumable_Product__c = pro2.Id; |
| | |
| | | Orderdet7.Box_Piece__c = '盒'; |
| | | Orderdet7.Lose_Flag__c = false; |
| | | Orderdet7.Bar_Code__c = '010495317014059411170400172203311074K250DBVUD'; |
| | | <<<<<<< HEAD |
| | | Orderdet7.RemoveBox_date__c = Date.today(); |
| | | Orderdet7.Inventory_date__c = Date.today(); |
| | | // insert Orderdet7; |
| | | conList.add(Orderdet7); |
| | | |
| | | Consumable_order_details2__c Orderdet8 = new Consumable_order_details2__c(); |
| | | ======= |
| | | Orderdet7.RemoveBox_date__c= Date.today(); |
| | | Orderdet7.Inventory_date__c= Date.today(); |
| | | // insert Orderdet7; |
| | | conList.add(Orderdet7); |
| | | |
| | | Consumable_order_details2__c Orderdet8= new Consumable_order_details2__c(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Orderdet8.Name = 'OCM_01_001004'; |
| | | Orderdet8.Consumable_order_minor__c = Order1.Id; |
| | | Orderdet8.Consumable_Product__c = pro2.Id; |
| | |
| | | Orderdet8.Bar_Code__c = '1683272847250250WZIOF'; |
| | | Orderdet8.Used_date__c = null; |
| | | Orderdet8.Lose_Flag__c = false; |
| | | <<<<<<< HEAD |
| | | Orderdet8.Return_date__c = null; |
| | | Orderdet8.RemoveBox_date__c = Date.today(); |
| | | Orderdet8.Send_Date__c = null; |
| | | Orderdet8.RemoveBox_No__c = 3; |
| | | ======= |
| | | Orderdet8.Return_date__c= null; |
| | | Orderdet8.RemoveBox_date__c=Date.today(); |
| | | Orderdet8.Send_Date__c=null; |
| | | Orderdet8.RemoveBox_No__c =3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | conList.add(Orderdet8); |
| | | insert conList; |
| | | // insert Orderdet8; |
| | | |
| | | <<<<<<< HEAD |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController.init(); |
| | | // LexCancelRemoveBoxController.getinventorysize(); |
| | |
| | | |
| | | } |
| | | static testMethod void testMethod2() { |
| | | ======= |
| | | |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController.init(); |
| | | // LexCancelRemoveBoxController.getinventorysize(); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('1683272847250250WZIOF','捷尔医疗(海南)有限公司','深圳','ENG'); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('','捷尔医疗(海南)有限公司','深圳','ENG'); |
| | | LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList),'捷尔医疗(海南)有限公司','深圳','ENG'); |
| | | |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | |
| | | } |
| | | static testMethod void testMethod2(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | user myUser_test; |
| | | Account myAccount2; |
| | | <<<<<<< HEAD |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | List<RecordType> rectCo = [ |
| | |
| | | con.Bar_Code__c = '1682414917514250XSCYW'; |
| | | conList.add(con); |
| | | |
| | | ======= |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | |
| | | myAccount2 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount2; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount2.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c ='重庆'); |
| | | insert MyUser_Test; |
| | | } |
| | | System.runAs(MyUser_Test){ |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '到货'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.RecordTypeid = '01210000000c9dqAAA'; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | insert Order1; |
| | | |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>(); |
| | | List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>(); |
| | | Consumable_order_details2__c con = new Consumable_order_details2__c(); |
| | | con.Consumable_Arrived_order__c = Order1.Id; |
| | | con.Send_Date__c = null; |
| | | con.Used_date__c = null; |
| | | con.Return_date__c = null; |
| | | con.Lose_Flag__c = false; |
| | | con.Box_Piece__c = '个'; |
| | | con.RemoveBox_date__c = Date.today(); |
| | | con.Arrive_date__c = Date.today(); |
| | | con.RemoveBox_No__c = 2; |
| | | con.Bar_Code__c = '1682414917514250XSCYW'; |
| | | conList.add(con); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | Consumable_order_details2__c con1 = new Consumable_order_details2__c(); |
| | | con1.Consumable_Arrived_order__c = Order1.Id; |
| | | con1.Send_Date__c = null; |
| | |
| | | con.RemoveBox_No__c = 1; |
| | | con1.Bar_Code__c = '1682414917514250XSCYW'; |
| | | conList.add(con1); |
| | | <<<<<<< HEAD |
| | | insert (conList); |
| | | System.debug('conList' + conList); |
| | | System.Test.startTest(); |
| | |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | ======= |
| | | insert(conList); |
| | | System.debug('conList'+conList); |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList),'Testaccount002','重庆','ET'); |
| | | LexCancelRemoveBoxController.cancelRemoveBoxConfirm(JSON.serialize(conList1),'Testaccount002','重庆','ET'); |
| | | System.Test.stopTest(); |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | static testMethod void testMethod3(){ |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | User myUser_test; |
| | | Account myAccount2; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | myAccount2 = new Account(name='Testaccount003',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2'); |
| | | insert myAccount2; |
| | | Contact core = new Contact(email='wan@salesforce.com', firstname='wan',lastname='Plumbers',accountid=myAccount2.id); |
| | | insert core; |
| | | myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | System.debug('MyUser_Test'+MyUser_Test); |
| | | } |
| | | System.runAs(MyUser_Test){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test01',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test02',Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test03',Manual_Entry__c = false); |
| | | Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=2,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test04',Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test05',Manual_Entry__c = false); |
| | | Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test06',Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id); |
| | | Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id); |
| | | insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '订单'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.RecordTypeid = System.Label.RT_ConOrder_Delivery; |
| | | Order1.Order_ProType__c = 'ENG'; |
| | | insert Order1; |
| | | //出货 |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '订单'; |
| | | Order2.Dealer_Info__c = myAccount2.Id; |
| | | Order2.RecordTypeid = '012100000006Jx9AAE'; |
| | | Order2.Order_ProType__c = 'ENG'; |
| | | insert Order2; |
| | | |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c> (); |
| | | List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> (); |
| | | List<Consumable_order_details2__c> conList2 = new List<Consumable_order_details2__c> (); |
| | | //产品类型不同 |
| | | Consumable_order_details2__c con = new Consumable_order_details2__c(); |
| | | con.Name = 'OCM_01_001001'; |
| | | con.Consumable_order_minor__c = Order1.Id; |
| | | con.Consumable_Product__c = pro2.Id; |
| | | con.Asset_Model_No__c = 'Test01'; |
| | | con.Arrive_date__c = Date.today(); |
| | | con.Bar_Code__c = '10061'; |
| | | con.Used_date__c = null; |
| | | con.Lose_Flag__c = false; |
| | | con.Return_date__c= null; |
| | | con.Send_Date__c= null; |
| | | con.Box_Piece__c = '盒'; |
| | | conList.add(con); |
| | | insert conList; |
| | | |
| | | //产品类型不同 |
| | | Consumable_order_details2__c con1 = new Consumable_order_details2__c(); |
| | | con1.Consumable_Product__c = pro2.Id; |
| | | con1.Consumable_order_minor__c = Order1.Id; |
| | | con1.Bar_Code__c = '10011'; |
| | | con1.Arrive_date__c = Date.today(); |
| | | conList1.add(con1); |
| | | //没有拆盒 |
| | | Consumable_order_details2__c con2 = new Consumable_order_details2__c(); |
| | | con2.Send_Date__c =null; |
| | | con2.Used_date__c = null; |
| | | con2.Lose_Flag__c = false; |
| | | con2.Box_Piece__c = '盒'; |
| | | con2.Consumable_Product__c = pro2.Id; |
| | | con2.Consumable_order_minor__c = Order1.Id; |
| | | con2.Bar_Code__c = '10021'; |
| | | con2.Arrive_date__c = Date.today(); |
| | | con2.RemoveBox_date__c = null; |
| | | conList1.add(con2); |
| | | insert conList1; |
| | | |
| | | //已出货 未到货 |
| | | Consumable_order_details2__c con3 = new Consumable_order_details2__c(); |
| | | con3.Arrive_date__c = null; |
| | | con3.Send_Date__c =null; |
| | | con3.Used_date__c = null; |
| | | con3.Return_date__c = null; |
| | | con3.Lose_Flag__c = false; |
| | | con3.Box_Piece__c = '盒'; |
| | | con3.Consumable_Arrived_order__c = Order2.Id; |
| | | con3.Consumable_Product__c = pro2.Id; |
| | | con3.Bar_Code__c = '10031'; |
| | | conList2.add(con3); |
| | | //拆盒已出货 |
| | | Consumable_order_details2__c con4 = new Consumable_order_details2__c(); |
| | | con4.Arrive_date__c = Date.today(); |
| | | con4.Send_Date__c = Date.today(); |
| | | con4.Return_date__c = null; |
| | | con4.Used_date__c = null; |
| | | con4.Lose_Flag__c = false; |
| | | con4.Box_Piece__c = '个'; |
| | | con4.RemoveBox_date__c = Date.today(); |
| | | con4.Consumable_Arrived_order__c = Order2.Id; |
| | | con4.Consumable_Product__c = pro2.Id; |
| | | con4.Bar_Code__c = '10041'; |
| | | conList2.add(con4); |
| | | insert conList2; |
| | | |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController.barcode = '1004\n1003\n1002\n1001'; |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','重庆','ET'); |
| | | String str = '该商品存在盘点履历'; |
| | | String errorReason = ''; |
| | | LexCancelRemoveBoxController.ConsumableorderdetailsInfo c2 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con,str); |
| | | c2.esd = con; |
| | | c2.Prod = con.Consumable_product__r; |
| | | c2.oldConsumableCount = con.name; |
| | | c2.ErrorReason = str; |
| | | LexCancelRemoveBoxController.ConsumableorderdetailsInfo c1 = new LexCancelRemoveBoxController.ConsumableorderdetailsInfo(con2); |
| | | c1.esd = con; |
| | | c1.Prod = con.Consumable_product__r; |
| | | c1.oldConsumableCount = con.name; |
| | | c1.compareTo(c2); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | static testMethod void testMethod4(){ |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | User myUser_test; |
| | | Account myAccount2; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET Email)']; |
| | | myAccount2 = new Account(name='Testaccount003',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '2'); |
| | | insert myAccount2; |
| | | Contact core = new Contact(email='wan@salesforce.com', firstname='wan',lastname='Plumbers',accountid=myAccount2.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newWang',Email='newWang@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUserWang', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUserWang@testorg.com',Work_Location__c ='重庆'); |
| | | insert MyUser_Test; |
| | | System.debug('MyUser_Test'+MyUser_Test); |
| | | } |
| | | System.runAs(MyUser_Test){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test01',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test02',Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test03',Manual_Entry__c = false); |
| | | Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=2,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test04',Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test05',Manual_Entry__c = false); |
| | | Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,SFDA_Expiration_Date__c= Date.today(),Category5__c = 'test06',Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id); |
| | | Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id); |
| | | insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3}; |
| | | List<Consumable_order__c> orderList = new List<Consumable_order__c>(); |
| | | //销售 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '销售'; |
| | | Order1.Dealer_Info__c = myAccount2.Id; |
| | | Order1.RecordTypeid = '01210000000c9duAAA'; |
| | | Order1.Order_ProType__c = 'ENG'; |
| | | orderList.add(Order1); |
| | | //返品 |
| | | Consumable_order__c Order2 = new Consumable_order__c(); |
| | | Order2.Name = 'OCM_01'; |
| | | Order2.Order_status__c = '批准'; |
| | | Order2.Order_type__c = '返品'; |
| | | Order2.Dealer_Info__c = myAccount2.Id; |
| | | Order2.RecordTypeid = '012100000006Jx4AAE'; |
| | | Order2.Order_ProType__c = 'ENG'; |
| | | orderList.add(Order2); |
| | | //盘点 |
| | | Consumable_order__c Order3 = new Consumable_order__c(); |
| | | Order3.Name = 'OCM_01'; |
| | | Order3.Order_status__c = '批准'; |
| | | Order3.Order_type__c = '盘点'; |
| | | Order3.Dealer_Info__c = myAccount2.Id; |
| | | Order3.RecordTypeid = '01210000000c9dsAAA'; |
| | | Order3.Order_ProType__c = 'ENG'; |
| | | orderList.add(Order3); |
| | | //发货 |
| | | Consumable_order__c Order4 = new Consumable_order__c(); |
| | | Order4.Name = 'OCM_0122'; |
| | | Order4.Order_status__c = '批准'; |
| | | Order4.Order_type__c = '订单'; |
| | | Order4.Dealer_Info__c = myAccount2.Id; |
| | | Order4.RecordTypeid = '01210000000c9drAAA'; |
| | | Order4.Order_ProType__c = 'ET'; |
| | | Order4.ContractNo__c = ''; |
| | | orderList.add(Order4); |
| | | insert orderList; |
| | | |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c> (); |
| | | List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c> (); |
| | | List<Consumable_order_details2__c> conList2 = new List<Consumable_order_details2__c> (); |
| | | //拆盒已销售 |
| | | Consumable_order_details2__c con4 = new Consumable_order_details2__c(); |
| | | con4.Arrive_date__c = Date.today(); |
| | | con4.Deliver_date__c = Date.today(); |
| | | con4.Sterilization_limit__c = Date.today(); |
| | | con4.Send_Date__c = null; |
| | | con4.Return_date__c = null; |
| | | con4.Used_date__c = Date.today(); |
| | | con4.Lose_Flag__c = false; |
| | | con4.Box_Piece__c = '个'; |
| | | con4.RemoveBox_date__c = Date.today(); |
| | | con4.RecordTypeId = '01210000000kUDKAA2'; |
| | | con4.Consumable_Product__c = pro2.Id; |
| | | con4.Bar_Code__c = '100611'; |
| | | conList.add(con4); |
| | | insert conList; |
| | | |
| | | //拆盒返品 |
| | | Consumable_order_details2__c con5 = new Consumable_order_details2__c(); |
| | | con5.Arrive_date__c = Date.today(); |
| | | con5.Return_date__c = Date.today(); |
| | | con5.Deliver_date__c = Date.today(); |
| | | con5.Send_Date__c = null; |
| | | con5.Sterilization_limit__c = Date.today(); |
| | | con5.Used_date__c = Date.today(); |
| | | con5.Box_Piece__c = '个'; |
| | | con5.RemoveBox_date__c = Date.today(); |
| | | con5.RecordTypeId = '01210000000kUDPAA2'; |
| | | con5.Consumable_Product__c = pro2.Id; |
| | | con5.Consumable_order_minor__c = Order4.Id; |
| | | con5.Bar_Code__c = '10061'; |
| | | conList1.add(con5); |
| | | insert conList1; |
| | | |
| | | //拆盒后盘点过 |
| | | Consumable_order_details2__c con6 = new Consumable_order_details2__c(); |
| | | con6.Inventory_date__c = Date.today(); |
| | | con6.Box_Piece__c = '个'; |
| | | con6.RemoveBox_date__c = Date.today(); |
| | | con6.Send_Date__c = null; |
| | | con6.Deliver_date__c = Date.today(); |
| | | con6.Sterilization_limit__c = Date.today(); |
| | | con6.RecordTypeId = '01210000000kUDKAA2'; |
| | | con6.Consumable_Arrived_order__c = Order3.Id; |
| | | con6.Consumable_Product__c = pro2.Id; |
| | | con6.Bar_Code__c = '10078'; |
| | | conList2.add(con6); |
| | | insert conList2; |
| | | |
| | | List<Consumable_order_details2__c> conList3 = new List<Consumable_order_details2__c> (); |
| | | //拆盒已出货 |
| | | Consumable_order_details2__c con3 = new Consumable_order_details2__c(); |
| | | con3.Arrive_date__c = Date.today(); |
| | | con3.Send_Date__c = Date.today(); |
| | | con3.Return_date__c = null; |
| | | con3.Used_date__c = null; |
| | | con3.Lose_Flag__c = false; |
| | | con3.Box_Piece__c = '个'; |
| | | con3.Deliver_date__c = Date.today(); |
| | | con3.RemoveBox_date__c = Date.today(); |
| | | con3.RecordTypeId = '01210000000kUDKAA2'; |
| | | con3.Consumable_Product__c = pro2.Id; |
| | | con3.Consumable_order_minor__c = Order4.Id; |
| | | con3.Bar_Code__c = '100999'; |
| | | con3.Sterilization_limit__c = Date.today(); |
| | | conList3.add(con3); |
| | | insert conList3; |
| | | |
| | | |
| | | //reset |
| | | // Consumable_order_details2__c con1 = new Consumable_order_details2__c(); |
| | | // con1.Intra_Trade_List_RMB__c = 1000; |
| | | // con1.Asset_Model_No__c = 'test'; |
| | | // con1.Sterilization_limit__c = Date.today(); |
| | | // con1.Deliver_date__c = Date.today(); |
| | | // con1.Arrive_date__c = Date.today(); |
| | | // con1.Send_Date__c = null; |
| | | // con1.Used_date__c = null; |
| | | // con1.Return_date__c = null; |
| | | // con1.Lose_Flag__c = false; |
| | | // con1.Box_Piece__c = '个'; |
| | | |
| | | // con1.Consumable_order_minor__c = Order4.Id; |
| | | // con1.Guarantee_period_for_products__c = Date.today(); |
| | | // con1.Consumable_Product__c = pro2.Id; |
| | | // con1.Bar_Code__c = '1009999'; |
| | | // conList2.add(con1); |
| | | // insert conList2; |
| | | |
| | | // List<Consumable_order_details2__c> conList3 = new List<Consumable_order_details2__c> (); |
| | | // Consumable_order_details2__c con9 = new Consumable_order_details2__c(); |
| | | // con9.RemoveBox_date__c = Date.today(); |
| | | // con9.Bar_Code__c = '100112'; |
| | | // con9.Arrive_date__c = Date.today(); |
| | | // con9.Send_Date__c = null; |
| | | // con9.Used_date__c = null; |
| | | // con9.Return_date__c = null; |
| | | // con9.Lose_Flag__c = false; |
| | | // con9.Box_Piece__c = '个'; |
| | | // con9.RemoveBox_No__c = 9; |
| | | // conList3.add(con9); |
| | | // LexCancelRemoveBoxController.searchConsumableorderdetails('100112','Testaccount003','重庆','ET'); |
| | | |
| | | |
| | | |
| | | //orderDetails2 |
| | | // Consumable_order_details2__c con00 = new Consumable_order_details2__c(); |
| | | // con00.Box_Piece__c = '个'; |
| | | // con00.RemoveBox_date__c = Date.today(); |
| | | // con00.RemoveBox_No__c = 1; |
| | | // con00.ContractNo_text__c = ''; |
| | | // con00.Consumable_order_minor__c = Order4.Id; |
| | | // con00.Bar_Code__c = '10099999989'; |
| | | // conList3.add(con00); |
| | | |
| | | // insert conList3; |
| | | System.Test.startTest(); |
| | | LexCancelRemoveBoxController CancelRemoveBoxController = new LexCancelRemoveBoxController(); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10099\n1009999\n100999','Testaccount003','重庆','ET'); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','北京','ET'); |
| | | LexCancelRemoveBoxController.searchConsumableorderdetails('100611\n10078\n10061\n10051\n10041\n10031\n10021\n10011','Testaccount003','重庆','ET'); |
| | | System.Test.stopTest(); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | private class LexConInvoiceListTest { |
| | | static testMethod void conInvoiceListTestinit() { |
| | | user myUser_test; |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | private class LexConInvoiceListTest |
| | | { |
| | | static testMethod void conInvoiceListTestinit(){ |
| | | user myUser_test; |
| | | Account myAccount2; |
| | | Account myAccount1; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | system.runAs(thisUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectHos.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ); |
| | | myAccount2 = new Account(name='testaccount002',RecordTypeId = rectHos[0].Id ); |
| | | insert myAccount1; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '北京'); |
| | | insert myUser_test; |
| | | |
| | | } |
| | | system.runAs(myUser_test){ |
| | | Consumable_order__c TestList1 = new Consumable_order__c(Name='Test1',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='草案中',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='发票',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET'); |
| | | Consumable_order__c TestList2 = new Consumable_order__c(Name='Test2',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='提交',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='发票',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[]{TestList1,TestList2}; |
| | | LexConInvoiceList.init(); |
| | | // ConInvoiceListController CDC = new ConInvoiceListController(); |
| | | // CDC.init(); |
| | | // System.assertEquals('Test1', CDC.raesList[0].name); |
| | | // System.assertEquals('Test2', CDC.raesList[1].name); |
| | | // CDC.SortLimited(); |
| | | // System.assertEquals('Test1', CDC.raesList[0].name); |
| | | // System.assertEquals('Test2', CDC.raesList[1].name); |
| | | } |
| | | } |
| | | //检索 |
| | | static testMethod void invoiceCodeSearchTest(){ |
| | | user myUser_test; |
| | | Account myAccount2; |
| | | Account myAccount1; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | system.runAs(thisUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectHos.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ); |
| | | myAccount2 = new Account(name='testaccount002',RecordTypeId = rectHos[0].Id ); |
| | | insert myAccount1; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '北京'); |
| | | insert myUser_test; |
| | | |
| | | } |
| | | |
| | | system.runAs(myUser_test){ |
| | | Consumable_order__c TestList1 = new Consumable_order__c(Name='Test1',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='草案中',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='发票',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET'); |
| | | Consumable_order__c TestList2 = new Consumable_order__c(Name='Test2',Invoice_Date__c=Date.today(),Dealer_info__c=myAccount1.Id,Invoice_status__c='提交',Order_ForHospital__c =myAccount2.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='发票',recordtypeid = System.Label.RT_ConOrder_Invoice,Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[]{TestList1,TestList2}; |
| | | LexConInvoiceList CDC = new LexConInvoiceList(); |
| | | LexConInvoiceList.init(); |
| | | LexConInvoiceList.invoiceCodeSearch(Date.today(),Date.today(),'提交','test','test1','0010l00001ajxZ2AAI','北京','ET'); |
| | | // CDC.init(); |
| | | // System.assertEquals('Test1', CDC.raesList[0].name); |
| | | // System.assertEquals('Test2', CDC.raesList[1].name); |
| | | // CDC.coc.Invoice_status__c = '提交'; |
| | | // CDC.invoiceCodeSearch(); |
| | | // System.assertEquals(1, CDC.raesList.size()); |
| | | // CDC.clearUp(); |
| | | // System.assertEquals(2, CDC.raesList.size()); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | } |
| | | userId = UserInfo.getUserId(); |
| | | List<user> Useracc = new List<user>(); |
| | | <<<<<<< HEAD |
| | | Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c |
| | | FROM user |
| | |
| | | FROM Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountId |
| | | ]; |
| | | ======= |
| | | Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c FROM user WHERE id = :userId]; |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | | if (String.isBlank(Useracc[0].UserPro_Type__c)) { |
| | | agencyProType = 'ET'; |
| | | } |
| | | coc = new Consumable_order__c(); |
| | | |
| | | Dealerelationship = [ |
| | | SELECT Dealer_subordinate__c, Dealer_subordinate__r.Name |
| | | FROM Dealer_elationship__c |
| | | WHERE Dealer_principal__c = :accountid |
| | | ]; |
| | | List<Agency_Hospital_Link__c> AgencyHospitalLink = new List<Agency_Hospital_Link__c>(); |
| | | AgencyHospitalLink = [ |
| | | SELECT Id, Name, Hospital__c, Hospital__r.Id, Hospital__r.Name, Agency__c |
| | | FROM Agency_Hospital_Link__c |
| | | WHERE Agency__c = :accountId |
| | | ]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | // 新規 |
| | | if (invoiceId == null || invoiceId == '') { |
| | | if (deliveryId == null || deliveryId == '') { |
| | |
| | | // attachmentRecoeds.add(new InvoiceOrderInfo(attachmentinfo[i])); |
| | | // } |
| | | // } |
| | | <<<<<<< HEAD |
| | | List<ContentDocumentLink> links = [ |
| | | SELECT Id, ContentDocumentId |
| | | FROM ContentDocumentLink |
| | | WHERE LinkedEntityId = :invoiceId |
| | | ]; |
| | | ======= |
| | | List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :invoiceId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (links != null && links.size() > 0) { |
| | | List<String> documentIds = new List<String>(); |
| | | for (ContentDocumentLink link : links) { |
| | |
| | | FROM ContentVersion |
| | | WHERE ContentDocumentId IN :documentIds |
| | | ]; |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (cvInfo.size() > 0) { |
| | | for (Integer i = 0; i < cvInfo.size(); i++) { |
| | | attachmentRecoeds.add(new InvoiceOrderInfo(cvInfo[i])); |
| | |
| | | invoiceHead.Order_ForDealer__c = SecondDealer; |
| | | } |
| | | invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c; |
| | | <<<<<<< HEAD |
| | | if (Test.isRunningTest()) { |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | ======= |
| | | if(Test.isRunningTest()){ |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | insert invoiceHead; |
| | | invoiceId = invoiceHead.Id; |
| | |
| | | invoiceHead.Order_ForDealer__c = SecondDealer; |
| | | } |
| | | invoiceHead.Order_ForDealerText__c = coc.Order_ForDealerText__c; |
| | | <<<<<<< HEAD |
| | | if (Test.isRunningTest()) { |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | ======= |
| | | if(Test.isRunningTest()){ |
| | | invoiceHead.Order_ForHospital__c = null; |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | insert invoiceHead; |
| | | System.debug('invoiceHead = ' + invoiceHead); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | private class LexConInvoiceViewControllerTest { //新建发票 以及编辑发票 invoiceId<>null |
| | | ======= |
| | | private class LexConInvoiceViewControllerTest |
| | | { //新建发票 以及编辑发票 invoiceId<>null |
| | | >>>>>>> LEXCommunityLiJun |
| | | public static user myUser_test; |
| | | public static Account myAccount1; |
| | | public static Account hosp1; |
| | |
| | | public static Account agency2; |
| | | @testSetup |
| | | static void setupTestData() { |
| | | <<<<<<< HEAD |
| | | User thisUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser) { |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证']; |
| | |
| | | invoiceorder.Name = 'invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c = '草案中'; |
| | | ======= |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | // Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证']; |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectHos.size() == 0) { |
| | | return; |
| | | } |
| | | //二级经销商SecondDealer |
| | | agency1 = new Account(name='Testhosp001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id); |
| | | agency2 = new Account(name='Testhosp002',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id); |
| | | //经销商 |
| | | myAccount1 = new Account(name='Testaccount002',Dealer_discount__c =20,RecordTypeId = rectCo[0].Id); |
| | | insert agency1; |
| | | insert agency2; |
| | | insert myAccount1; |
| | | //客户名HospitalInfo |
| | | hosp1 = new Account(name='Testhosp001',Dealer_discount__c =10,RecordTypeId = rectHos[0].Id); |
| | | Account hosp2 = new Account(name='Testhosp002',Dealer_discount__c =10,RecordTypeId = rectHos[0].Id); |
| | | insert hosp1; |
| | | |
| | | Dealer_elationship__c dealerelationship = new Dealer_elationship__c(Dealer_principal__c = myAccount1.id,Dealer_subordinate__c = agency1.id); |
| | | insert dealerelationship; |
| | | Dealer_elationship__c dealerelationship1 = new Dealer_elationship__c(Dealer_principal__c = myAccount1.id,Dealer_subordinate__c = agency2.id); |
| | | insert dealerelationship1; |
| | | |
| | | Agency_Hospital_Link__c agencyHospitalLink1 = new Agency_Hospital_Link__c(Hospital__c = hosp1.id,Agency__c = myAccount1.id); |
| | | insert agencyHospitalLink1; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c ='重庆'); |
| | | insert MyUser_Test; |
| | | } |
| | | |
| | | |
| | | } |
| | | static testMethod void conInvoiceViewTestedit_1(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | |
| | | |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | System.Test.startTest(); |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = invoiceorder.Id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Consumable_product__c = pro1.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3}; |
| | | |
| | | |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds),invoiceorder.Id); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.deleteButton(testList1.Id,testList1); |
| | | LexConInvoiceViewController.deleteButton('234567',testList1); |
| | | // LexConInvoiceViewController.saveFile(invoiceorder.Id,'Test','TmFtZSxTdW1tb25zRm9yRGlyY3Rpb25fX2MsSG9zcGl0YWxDb2RlLE9yZGVyX0Zvckhvc3BpdGFsX19jLE9yZGVyX0ZvckN1c3RvbWVyVGV4dF9fYyxPcmRlcl9Gb3JEZWFsZXJfX2MsQmFyX0NvZGVfX2MsU2hpcG1lbnRfQ291bnRfX2MsRGVsaXZlcnlfTGlzdF9STUJfX2MsQm94X1BpZWNlX19jLFVuaXRwcmljZV9Ub19hZ2VuY3lfX2MsT3V0Ym91bmRfRGF0ZV9fYyxMb3NlX3JlYXNvbl9fYw0KREItRlkyMDI0LTA2LVozMTAwMDIs55u05o6l6ZSA5ZSu57uZ5Yy76ZmiLDgxMDU2NDAs5a6955S45Lic5qGl5bq35aSN5Yy76ZmiLOa2iOWMluenkSwsMTY4NjIwMzI1NDQ2ODI1MFZWR0lVLDEsMjAwMCznm5IsMjAsMjAyMy82Lzgs5Lii5aSx5Y6f5ZugDQpEQi1GWTIwMjQtMDYtWjMxMDAwMyznm7TmjqXplIDllK7nu5nljLvpmaIsODEwNTY0MCzlrr3nlLjkuJzmoaXlurflpI3ljLvpmaIs5raI5YyW56eRLCwxNjg2MjAzMjU2MDk4MjUwUkVKT1EsMSwzMDAwLOebkiwyMCwyMDIzLzYvOCzkuKLlpLHljp%2Flm6ANCkRCLUZZMjAyNC0wNi1aMzEwMDA0LOebtOaOpemUgOWUrue7meWMu%2BmZoiw4MTA1NjQwLOWuveeUuOS4nOahpeW6t%2BWkjeWMu%2BmZoizmtojljJbnp5EsLDE2ODYyMDMyNTc2NTcyNTBHU0ZTQiwxLDQwMDAs55uSLDIwLDIwMjMvNi84LOS4ouWkseWOn%2BWboA0K'); |
| | | try{ |
| | | LexConInvoiceViewController.saveFile(invoiceorder.Id,'Test',''); |
| | | }catch(Exception e){ |
| | | system.debug('Test'); |
| | | |
| | | } |
| | | LexConInvoiceViewController.outbound = testList2; |
| | | LexConInvoiceViewController.getInvoiceName(); |
| | | // LexConInvoiceViewController.shipmentAccount = '222'; |
| | | Map<String, Decimal> ordermx1defaultMap = new Map<String, Decimal>(); |
| | | LexConInvoiceViewController.ordermx1defaultMap = ordermx1defaultMap; |
| | | Map<String, String> deleteMap = new Map<String, String>(); |
| | | LexConInvoiceViewController.deleteOutboundorder(deleteMap,''); |
| | | // LexConInvoiceViewController.invoiceOrderRecoedsCount |
| | | LexConInvoiceViewController.orderby = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' }; |
| | | LexConInvoiceViewController.sortKey = 'test'; |
| | | LexConInvoiceViewController.preSortKey = 'test'; |
| | | LexConInvoiceViewController.sortOrderAsc = false; |
| | | LexConInvoiceViewController.sortOrder = new List<String>{ 'Outbound_Date__c', 'Name', 'ShipmentAccount__c' }; |
| | | List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>(); |
| | | List<String> chukudanID = new List<String>(); |
| | | chukudanID.add(testList2.Id); |
| | | chukudanID.add(testList1.Id); |
| | | LexConInvoiceViewController.newinvoicedetails1(chukudanID); |
| | | Map<String, String> insertDetMap = new Map<String, String>(); |
| | | insertDetMap.put('Outboundorder_Code_link__c',testList1.Id); |
| | | // LexConInvoiceViewController.outOrderchange(insertDetMap); |
| | | LexConInvoiceViewController.getdefaultMapinfo(chukudanID); |
| | | |
| | | |
| | | |
| | | |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | //新建发票 invoiceId=null |
| | | |
| | | static testMethod void conInvoiceViewTestedit_2(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | // invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | |
| | | System.Test.startTest(); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | |
| | | |
| | | // LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | //新建发票 invoiceId=null error check |
| | | |
| | | static testMethod void conInvoiceViewTestedit_3(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert new Product2__c[] {pro1}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | System.Test.startTest(); |
| | | |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | |
| | | |
| | | |
| | | // LexConInvoiceViewController.init(); |
| | | |
| | | LexConInvoiceViewController.invoiceId =invoiceorder.Id; |
| | | // LexConInvoiceViewController.coc.SummonsForDirction__c = '直接销售给医院'; |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | System.debug('===>hosp1.id'+hosp1.id); |
| | | LexConInvoiceViewController.invoiceId =null; |
| | | System.Test.stopTest(); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | //新建发票 以及编辑发票invoiceId== NULL and deliveryId== NULL |
| | | static testMethod void conInvoiceViewTestinit(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | //Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | //Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | //insert new Consumable_order__c[]{testList1,testList2}; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable2; |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Shipment_Count__c = 1; |
| | | orderdet3.Consumable_product__c = pro2.Id; |
| | | |
| | | //出库单2明细2 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test1_002002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList2.id; |
| | | orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Shipment_Count__c = 1; |
| | | orderdet4.Consumable_product__c = pro2.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4}; |
| | | //附件 |
| | | Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c(); |
| | | caic.Attachment_ID__c = acc.Id; |
| | | caic.Accessories_type__c = '发票和明细'; |
| | | caic.Invoice_code__c = invoiceorder.id; |
| | | insert caic; |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | //contest.deliveryId=testList1.id; |
| | | System.Test.startTest(); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | //新建发票 以及编辑发票invoiceId== NULL and deliveryId<> NULL |
| | | static testMethod void conInvoiceViewTestinit_1(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | //Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | //Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | //insert new Consumable_order__c[]{testList1,testList2}; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable2; |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Shipment_Count__c = 1; |
| | | orderdet3.Consumable_product__c = pro2.Id; |
| | | |
| | | //出库单2明细2 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test1_002002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList2.id; |
| | | orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Shipment_Count__c = 1; |
| | | orderdet4.Consumable_product__c = pro2.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4}; |
| | | //附件 |
| | | Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c(); |
| | | caic.Attachment_ID__c = acc.Id; |
| | | caic.Accessories_type__c = '发票和明细'; |
| | | caic.Invoice_code__c = invoiceorder.id; |
| | | insert caic; |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.id); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | |
| | | // contest.deliveryId=testList1.id; |
| | | System.Test.startTest(); |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | |
| | | //新建发票 以及编辑发票invoiceId<> NULL |
| | | static testMethod void conInvoiceViewTestinit_2(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | //Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | //Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | //insert new Consumable_order__c[]{testList1,testList2}; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable2; |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Shipment_Count__c = 1; |
| | | orderdet3.Consumable_product__c = pro2.Id; |
| | | |
| | | //出库单2明细2 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test1_002002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList2.id; |
| | | orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Shipment_Count__c = 1; |
| | | orderdet4.Consumable_product__c = pro2.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4}; |
| | | //附件 |
| | | Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c(); |
| | | caic.Attachment_ID__c = acc.Id; |
| | | caic.Accessories_type__c = '发票和明细'; |
| | | caic.Invoice_code__c = invoiceorder.id; |
| | | insert caic; |
| | | // PageReference page = new PageReference('/apex/ConInvoiceView?KeyWords=Redirect'); |
| | | // page.setRedirect(true); |
| | | // System.Test.setCurrentPage(page); |
| | | |
| | | // ConInvoiceViewController conTest = new ConInvoiceViewController(); |
| | | // contest.deliveryId=testList1.id; |
| | | // conTest.invoiceId =invoiceorder.Id; |
| | | System.Test.startTest(); |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | |
| | | |
| | | |
| | | |
| | | // conTest.init(); |
| | | |
| | | //System.assertEquals(false, conTest.getdone()); |
| | | //System.assertEquals(false, conTest.getExistOutbound()); |
| | | //System.assertEquals('invoice01', conTest.getInvoiceName()); |
| | | //System.assertEquals(2, conTest.invoiceOrderRecoedsCount); |
| | | // conTest.InvoiceorderSearch(); |
| | | |
| | | // conTest.SortLimited(); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | static testMethod void conInvoiceViewTestoutOrderchange(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | System.Test.startTest(); |
| | | insert testList1; |
| | | insert testList2; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2}; |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | |
| | | static testMethod void conInvoiceViewTestgetdefaultMapinfo(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | // invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | System.Test.startTest(); |
| | | insert testList1; |
| | | insert testList2; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2}; |
| | | |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | //从出库单直接开票 |
| | | static testMethod void conInvoiceViewRedirectTest(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | <<<<<<< HEAD |
| | | invoiceorder.Dealer_Info__c = acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | System.debug('===>hosp1.id' + hosp1.id); |
| | | LexConInvoiceViewController.invoiceId = null; |
| | | ======= |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | //Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | //Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | testList1.Order_date__c = Date.today().addDays(2); |
| | | testList2.Order_date__c = Date.today().addDays(2); |
| | | testList1.Deliver_date__c = Date.today(); |
| | | testList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | //insert new Consumable_order__c[]{testList1,testList2}; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable2; |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | |
| | | //出库单1明细2 |
| | | Consumable_orderdetails__c orderdet2 = new Consumable_orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Shipment_Count__c = 1; |
| | | orderdet3.Consumable_product__c = pro2.Id; |
| | | |
| | | //出库单2明细2 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test1_002002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList2.id; |
| | | orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Shipment_Count__c = 1; |
| | | orderdet4.Consumable_product__c = pro2.Id; |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4}; |
| | | //附件 |
| | | Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c(); |
| | | caic.Attachment_ID__c = acc.Id; |
| | | caic.Accessories_type__c = '发票和明细'; |
| | | caic.Invoice_code__c = invoiceorder.id; |
| | | insert caic; |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?deliveryId='+testList1.Id+'&KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds),invoiceorder.Id); |
| | | // LexConInvoiceViewController.saveAttachment(JSON.serialize(caic),invoiceorder.Id); |
| | | >>>>>>> LEXCommunityLiJun |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //新建发票 以及编辑发票invoiceId== NULL and deliveryId== NULL |
| | | static testMethod void conInvoiceViewTestinit() { |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = testList1.Id; |
| | | ======= |
| | | |
| | | //提交 |
| | | static testMethod void conInvoiceViewTestapproval(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false,Packing_list_manual__c = 5); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | //Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | //Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',Order_ForHospital__c =hosp1.Id,SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Order_ForDealer__c = agency1.Id, Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c(Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | RecordTypeId = System.Label.RT_ConOrder_Sale, |
| | | Dealer_info__c=acc.Id); |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | RecordTypeId = System.Label.RT_ConOrder_Sale, |
| | | Dealer_info__c=acc.Id); |
| | | testList1.Order_date__c = Date.today().addDays(2); |
| | | testList2.Order_date__c = Date.today().addDays(2); |
| | | testList1.Deliver_date__c = Date.today(); |
| | | testList2.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | //insert new Consumable_order__c[]{testList1,testList2}; |
| | | |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable2',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable2; |
| | | //出库单1明细1 |
| | | Consumable_Orderdetails__c orderdet1 = new Consumable_Orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | orderdet1.Invoiced_Count__c = 10; |
| | | orderdet1.Delivery_List_RMB__c = 200; |
| | | orderdet1.Box_Piece__c = '盒'; |
| | | orderdet1.Invoice_Unit__c = '个'; |
| | | // orderdet1.Shipment_Count__c = 50; |
| | | // orderdet1.Invoiced_Procount__c = 5; |
| | | // orderdet1.RrturnPro_count__c = 5; |
| | | |
| | | |
| | | |
| | | |
| | | Consumable_Orderdetails__c orderdet12 = new Consumable_Orderdetails__c(); |
| | | orderdet12.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet12.Consumable_order__c = testList1.Id; |
| | | orderdet12.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet12.Consumable_count__c = 1; |
| | | orderdet12.Consumable_product__c = pro1.Id; |
| | | orderdet12.Invoiced_Count__c = 30; |
| | | orderdet12.Delivery_List_RMB__c = 200; |
| | | //出库单1明细2 |
| | | Consumable_Orderdetails__c orderdet2 = new Consumable_Orderdetails__c(); |
| | | orderdet2.Name = 'Test1_001002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet2.Consumable_order__c = invoiceorder.Id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | //出库单2明细1 |
| | | <<<<<<< HEAD |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.id; |
| | | ======= |
| | | Consumable_Orderdetails__c orderdet3 = new Consumable_Orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = invoiceorder.Id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Shipment_Count__c = 1; |
| | | orderdet3.Consumable_product__c = pro2.Id; |
| | | |
| | | <<<<<<< HEAD |
| | | //出库单2明细2 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | ======= |
| | | //出库单2明细2 |
| | | Consumable_Orderdetails__c orderdet4 = new Consumable_Orderdetails__c(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | orderdet4.Name = 'Test1_002002'; |
| | | //orderdet2.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList2.id; |
| | |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Shipment_Count__c = 1; |
| | | orderdet4.Consumable_product__c = pro2.Id; |
| | | <<<<<<< HEAD |
| | | insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3, orderdet4 }; |
| | | //附件 |
| | | Consumable_accessories_invoice__c caic = new Consumable_accessories_invoice__c(); |
| | | ======= |
| | | insert new Consumable_Orderdetails__c[]{orderdet1,orderdet2,orderdet3,orderdet4,orderdet12}; |
| | | |
| | | List<String> conorList = new List<String>(); |
| | | conorList.add(testList1.Id); |
| | | |
| | | // List<Consumable_Orderdetails__c> outOrderdet1List1 = new List<Consumable_Orderdetails__c>(); |
| | | // outOrderdet1List1.add(orderdet1); |
| | | |
| | | List<Consumable_Orderdetails__c> outOrderdet1List = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Consumable_order__r.Name, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Shipment_Count__c, |
| | | RrturnPro_count__c, |
| | | Delivery_List_RMB__c, |
| | | InvoicedProCost_RMB__c, |
| | | Invoiced_Procount__c, |
| | | Invoiced_Count__c, |
| | | Invoice_Unitprice__c, |
| | | InvoiceProNot_count__c, |
| | | Invoice_Cost_RMB__c, |
| | | Invoice_No__c, |
| | | Box_Piece__c, |
| | | Invoice_Unit__c, |
| | | ProductPacking_list_manual__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Id = :orderdet1.Id |
| | | ]; |
| | | |
| | | System.debug('outOrderdet1List'+outOrderdet1List); |
| | | List<Consumable_Orderdetails__c> outOrderdet1List1 = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Consumable_order__r.Name, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Shipment_Count__c, |
| | | RrturnPro_count__c, |
| | | Delivery_List_RMB__c, |
| | | InvoicedProCost_RMB__c, |
| | | Invoiced_Procount__c, |
| | | Invoiced_Count__c, |
| | | Invoice_Unitprice__c, |
| | | InvoiceProNot_count__c, |
| | | Invoice_Cost_RMB__c, |
| | | Invoice_No__c, |
| | | Box_Piece__c, |
| | | Invoice_Unit__c, |
| | | ProductPacking_list_manual__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Id = :orderdet12.Id |
| | | ]; |
| | | |
| | | Map<String, Consumable_Orderdetails__c> tempCocMap = new Map<String, Consumable_Orderdetails__c>(); |
| | | Map<String, Consumable_Orderdetails__c> tempCocMap1 = new Map<String, Consumable_Orderdetails__c>(); |
| | | for (Consumable_Orderdetails__c cocTemp : outOrderdet1List) { |
| | | if(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c!=null){ |
| | | tempCocMap.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp); |
| | | } |
| | | } |
| | | for (Consumable_Orderdetails__c cocTemp : outOrderdet1List1) { |
| | | if(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c!=null){ |
| | | tempCocMap1.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp); |
| | | } |
| | | } |
| | | |
| | | System.debug('tempCocMap===>'+tempCocMap); |
| | | //附件 |
| | | Consumable_accessories_invoice__c caic= new Consumable_accessories_invoice__c(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | caic.Attachment_ID__c = acc.Id; |
| | | caic.Accessories_type__c = '发票和明细'; |
| | | caic.Invoice_code__c = invoiceorder.id; |
| | | insert caic; |
| | | <<<<<<< HEAD |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | |
| | | agency1.id, |
| | | invoiceOrderRecoeds |
| | | ); |
| | | ======= |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.approval(conorList,tempCocMap,invoiceorder.id); |
| | | LexConInvoiceViewController.approval(conorList,tempCocMap1,invoiceorder.id); |
| | | >>>>>>> LEXCommunityLiJun |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //新建发票 以及编辑发票invoiceId== NULL and deliveryId<> NULL |
| | | static testMethod void conInvoiceViewTestinit_1() { |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | |
| | | invoiceorder.Name = 'invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c = '草案中'; |
| | | ======= |
| | | //提交发票 |
| | | static testMethod void conInvoice_approval(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | Oly_TriggerHandler.bypass('Oly_TriggerHandler'); |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | |
| | | |
| | | //出库单1 |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | recordtypeid = System.Label.RT_ConOrder_Sale, |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | // Order_ForHospital__c=hosp1.Id, |
| | | Dealer_Info__c = acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001'; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Sale; |
| | | orderdet1.Shipment_Count__c = 1; |
| | | orderdet1.Delivery_List_RMB__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | orderdet1.Shipment_Count__c = 50; |
| | | orderdet1.Invoiced_Procount__c = 5; |
| | | orderdet1.RrturnPro_count__c = 5; |
| | | insert orderdet1; |
| | | List<String> conorList = new List<String>(); |
| | | conorList.add(testList1.Id); |
| | | //出库单1明细2 |
| | | Consumable_order_details2__c orderdet2 = new Consumable_order_details2__c(); |
| | | orderdet2.Name = 'Test1_001001'; |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery; |
| | | orderdet2.Consumable_Sale_order__c = testList1.Id; |
| | | orderdet2.Deliver_date__c = Date.today(); |
| | | orderdet2.Arrive_date__c = Date.today(); |
| | | orderdet2.Used_date__c = Date.today(); |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | insert orderdet2; |
| | | |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | // invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | insert invoiceorder; |
| | | |
| | | //发票明细1 |
| | | Consumable_orderdetails__c invoicedet1 = new Consumable_orderdetails__c(); |
| | | invoicedet1.Name = 'invoice01_01'; |
| | | invoicedet1.Consumable_order__c = invoiceorder.Id; |
| | | invoicedet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | invoicedet1.Invoiced_Count__c = 1; |
| | | invoicedet1.Invoice_Unitprice__c = 1; |
| | | invoicedet1.Consumable_product__c = pro1.Id; |
| | | invoicedet1.Invoicedet1_OD_link__c = testList1.Id; |
| | | insert invoicedet1; |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | List<Consumable_Orderdetails__c> outOrderdet1List = [ |
| | | SELECT |
| | | Id, |
| | | Name, |
| | | Consumable_order__c, |
| | | Consumable_order__r.Name, |
| | | Asset_Model_No__c, |
| | | Consumable_Product__r.Asset_Model_No__c, |
| | | Shipment_Count__c, |
| | | RrturnPro_count__c, |
| | | Delivery_List_RMB__c, |
| | | InvoicedProCost_RMB__c, |
| | | Invoiced_Procount__c, |
| | | Invoiced_Count__c, |
| | | Invoice_Unitprice__c, |
| | | InvoiceProNot_count__c, |
| | | Invoice_Cost_RMB__c, |
| | | Invoice_No__c, |
| | | Box_Piece__c, |
| | | Invoice_Unit__c, |
| | | ProductPacking_list_manual__c |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE Id = :orderdet1.Id |
| | | ]; |
| | | Map<String, Consumable_Orderdetails__c> tempCocMap1 = new Map<String, Consumable_Orderdetails__c>(); |
| | | for (Consumable_Orderdetails__c cocTemp : outOrderdet1List) { |
| | | if(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c!=null){ |
| | | tempCocMap1.put(cocTemp.Consumable_order__c + cocTemp.Asset_Model_No__c, cocTemp); |
| | | } |
| | | } |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',orderdet1.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = acc.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,acc.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,acc.id,invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.approval(conorList,tempCocMap1,invoiceorder.id); |
| | | LexConInvoiceViewController.approval(conorList,tempCocMap1,'2345678'); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // conTest.init(); |
| | | |
| | | // System.assertEquals(1, conTest.invoiceOrderRecoeds.size()); |
| | | // conTest.approval(); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-08-26 start |
| | | //新建发票 以及编辑发票 invoiceId<>null |
| | | static testMethod void rentestreopen(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='提交'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | <<<<<<< HEAD |
| | | invoiceorder.Dealer_Info__c = acc.Id; |
| | | insert invoiceorder; |
| | | |
| | |
| | | Invoice_Code_link__c = invoiceorder.Id |
| | | ); |
| | | insert order_LinkTable2; |
| | | ======= |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList3 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList3.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | TestList3.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | insert testList3; |
| | | System.Test.startTest(); |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | Consumable_order_LinkTable__c order_LinkTable3 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList3.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | insert order_LinkTable2; |
| | | insert order_LinkTable3; |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | <<<<<<< HEAD |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test1_002001'; |
| | |
| | | Invoice_Code_link__c = invoiceorder.Id |
| | | ); |
| | | insert order_LinkTable1; |
| | | ======= |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2}; |
| | | |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test3_001002'; |
| | | //orderdet3.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.Id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Consumable_product__c = pro1.Id; |
| | | insert orderdet3; |
| | | |
| | | //出库单3明细1 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test3_001002'; |
| | | //orderdet4.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList3.Id; |
| | | orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Consumable_product__c = pro1.Id; |
| | | insert orderdet4; |
| | | |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&reopen=isreopen&KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | |
| | | |
| | | |
| | | |
| | | // ConInvoiceViewController conTest = new ConInvoiceViewController(); |
| | | |
| | | // conTest.init(); |
| | | |
| | | // conTest.invoiceId =invoiceorder.Id; |
| | | // conTest.coc.SummonsForDirction__c = '直接销售给医院'; |
| | | // conTest.HospitalInfo = hosp1.id; |
| | | // //conTest.SecondDealer = agency1.id; |
| | | // //conTest.coc.Order_ForDealer__c = agency1.id; |
| | | // conTest.coc.Name = 'invoice002'; |
| | | // conTest.coc.Order_ForCustomerText__c = 'AA'; |
| | | // conTest.coc.Order_ForHospital__c = hosp1.id; |
| | | // conTest.coc.Invoice_Date__c = Date.today(); |
| | | |
| | | |
| | | // //conTest.SortLimited(); |
| | | // //conTest.InvoiceorderSearch(); |
| | | // System.assertEquals(3, conTest.invoiceOrderRecoeds.size()); |
| | | // conTest.invoiceOrderRecoeds[0].esd.Order_ForCustomerText__c = 'AA'; |
| | | // conTest.invoiceOrderRecoeds[0].esd.Order_ForHospital__c =hosp1.Id; |
| | | // conTest.invoiceOrderRecoeds[0].esd.Order_ForDealer__c = agency1.id; |
| | | |
| | | // conTest.invoiceOrderRecoeds[1].esd.Order_ForCustomerText__c = 'AA'; |
| | | // conTest.invoiceOrderRecoeds[1].esd.Order_ForHospital__c =hosp1.Id; |
| | | // conTest.invoiceOrderRecoeds[1].esd.Order_ForDealer__c = agency1.id; |
| | | |
| | | |
| | | // conTest.invoiceOrderRecoeds[2].esd.Order_ForCustomerText__c = 'AA'; |
| | | // conTest.invoiceOrderRecoeds[2].esd.Order_ForHospital__c =hosp1.Id; |
| | | // conTest.invoiceOrderRecoeds[2].esd.Order_ForDealer__c = agency1.id; |
| | | |
| | | // conTest.invoiceOrderRecoeds[0].check= true; |
| | | // conTest.invoiceOrderRecoeds[1].check= false; |
| | | // conTest.invoiceOrderRecoeds[2].check= true; |
| | | |
| | | // conTest.save(); |
| | | // //System.assertEquals('123',conTest.testTmp); |
| | | // conTest.nvoiceorderremind(); |
| | | // conTest.saveAttachment(); |
| | | |
| | | // conTest.getdone(); |
| | | // conTest.getExistOutbound(); |
| | | // conTest.getInvoiceName(); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-08-26 end |
| | | //CHAN-BSS5SQ update by rentongxiao 2020-08-26 start |
| | | //新建发票 以及编辑发票 invoiceId<>null |
| | | static testMethod void rentestreopen001(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='提交'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | //invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | //invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList3 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList3.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | TestList3.Deliver_date__c = Date.today(); |
| | | insert testList1; |
| | | insert testList2; |
| | | insert testList3; |
| | | System.Test.startTest(); |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | Consumable_order_LinkTable__c order_LinkTable2 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList2.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | Consumable_order_LinkTable__c order_LinkTable3 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList3.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | insert order_LinkTable1; |
| | | insert order_LinkTable2; |
| | | insert order_LinkTable3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | |
| | | orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet2.Consumable_count__c = 1; |
| | | orderdet2.Consumable_product__c = pro1.Id; |
| | | <<<<<<< HEAD |
| | | insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2 }; |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.id, 'Redirect', testList2.Id); |
| | |
| | | testList3.Order_status__c = '草案中'; |
| | | testList3.Order_type__c = '传票'; |
| | | testList3.Dealer_info__c = acc.Id; |
| | | ======= |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2}; |
| | | |
| | | //出库单2明细1 |
| | | Consumable_orderdetails__c orderdet3 = new Consumable_orderdetails__c(); |
| | | orderdet3.Name = 'Test3_001002'; |
| | | //orderdet3.Consumable_principal__c = testList2.Id; |
| | | orderdet3.Consumable_order__c = testList2.Id; |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Consumable_product__c = pro1.Id; |
| | | insert orderdet3; |
| | | |
| | | //出库单3明细1 |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test3_001002'; |
| | | //orderdet4.Consumable_principal__c = testList2.Id; |
| | | orderdet4.Consumable_order__c = testList3.Id; |
| | | orderdet4.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet4.Consumable_count__c = 1; |
| | | orderdet4.Consumable_product__c = pro1.Id; |
| | | insert orderdet4; |
| | | |
| | | PageReference page = new PageReference('/apex/ConInvoiceView?invoiceId='+invoiceorder.Id+'&reopen=isreopen&KeyWords=Redirect'); |
| | | page.setRedirect(true); |
| | | System.Test.setCurrentPage(page); |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.id,'Redirect',testList2.Id); |
| | | LexConInvoiceViewController conTest = new LexConInvoiceViewController(); |
| | | LexConInvoiceViewController.HospitalInfo = hosp1.id; |
| | | LexConInvoiceViewController.SecondDealer = agency1.id; |
| | | LexConInvoiceViewController.invoiceId = invoiceorder.Id; |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'济宁任城儒济医院',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.InvoiceorderSearch(testList1,invoiceorder.Id,acc.Id,'重庆','ET',hosp1.id,agency1.id,invoiceOrderRecoeds); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | //新建发票 以及编辑发票 invoiceId<>null |
| | | static testMethod void allinit(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //准备数据 |
| | | // Consumable_order__c Id = deliveryId //出库单 |
| | | // Consumable_order__c |
| | | // WHERE Id = :invoiceId AND Order_type__c = '发票' |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | // invoiceorder.Order_ForHospital__c =hosp1.Id; |
| | | // invoiceorder.Order_ForDealer__c = agency1.Id; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | //出库单 |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='已提交',Order_type__c='传票', |
| | | Dealer_info__c=acc.Id,Order_ForCustomerText__c = ''); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Deliver_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | |
| | | Consumable_order__c testList3 = new Consumable_order__c(); |
| | | testList3.Summons_Sale_Status__c='出货'; |
| | | testList3.SummonsStatus_c__c='已完成'; |
| | | testList3.SummonsForDirction__c='直接销售给医院'; |
| | | testList3.Order_status__c='草案中'; |
| | | testList3.Order_type__c='传票'; |
| | | testList3.Dealer_info__c=acc.Id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | testList3.Order_ForCustomerText__c = '消化科'; |
| | | |
| | | insert testList1; |
| | | insert testList2; |
| | | insert testList3; |
| | | |
| | | <<<<<<< HEAD |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c( |
| | | Name = 'order_LinkTable1', |
| | | Outboundorder_Code_link__c = testList1.Id, |
| | | Invoice_Code_link__c = invoiceorder.Id |
| | | ); |
| | | ======= |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder.Id); |
| | | >>>>>>> LEXCommunityLiJun |
| | | insert order_LinkTable1; |
| | | |
| | | //出库单1明细1 |
| | |
| | | orderdet3.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet3.Consumable_count__c = 1; |
| | | orderdet3.Consumable_product__c = pro1.Id; |
| | | <<<<<<< HEAD |
| | | insert new List<Consumable_orderdetails__c>{ orderdet1, orderdet2, orderdet3 }; |
| | | ======= |
| | | insert new Consumable_orderdetails__c[]{orderdet1,orderdet2,orderdet3}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //发票附件 |
| | | Consumable_accessories_invoice__c cai = new Consumable_accessories_invoice__c(); |
| | |
| | | |
| | | System.Test.startTest(); |
| | | |
| | | <<<<<<< HEAD |
| | | LexConInvoiceViewController.init(invoiceorder.Id, '', testList1.Id); |
| | | LexConInvoiceViewController.init('', '', testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id, '', ''); |
| | |
| | | '', |
| | | invoiceOrderRecoedschangeLwc |
| | | ); |
| | | ======= |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',testList1.Id); |
| | | LexConInvoiceViewController.init('','',testList1.Id); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'',''); |
| | | LexConInvoiceViewController.init('','',''); |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.init('','Redirect',''); |
| | | LexConInvoiceViewController.init('','Redirect',testList1.Id); |
| | | System.debug('order==>'+LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | LexConInvoiceViewController.save(testList1,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList2,'Testhosp001','','',invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList3,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList2,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //保存 |
| | | // LexConInvoiceViewController.save(testList1,'测试医院',hosp1.Id,agency1.Id,'',testList1.Id,invoiceorder.Id,myAccount1.Id,'ET'); |
| | | System.Test.stopTest(); |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | static testMethod void allsave() { |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | |
| | | // LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,myAccount1.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'); |
| | | } |
| | | } |
| | | ======= |
| | | } |
| | | static testMethod void allsave(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | // invoiceorder.Order_ForHospital__c = ''; |
| | | // invoiceorder.Order_ForDealer__c = ''; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today()); |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | // LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList1.Id); |
| | | LexConInvoiceViewController.save(testList1,'Testhosp001',null,null,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList1,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.saveAttachment(JSON.serialize(LexConInvoiceViewController.attachmentRecoeds),invoiceorder.Id); |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | static testMethod void allsave1(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | // invoiceorder.Order_ForHospital__c = ''; |
| | | // invoiceorder.Order_ForDealer__c = ''; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today(),Order_ForCustomerText__c = '消化科'); |
| | | insert testList1; |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today(),Order_ForDealerText__c = 'Test'); |
| | | insert testList2; |
| | | |
| | | |
| | | LexConInvoiceViewController.init(invoiceorder.Id,'Redirect',testList2.Id); |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | String invoiceOrderRecoeds = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoeds); |
| | | List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>(); |
| | | for(LexConInvoiceViewController.InvoiceOrderInfo ass:LexConInvoiceViewController.invoiceOrderRecoeds){ |
| | | ass.check = true; |
| | | test1.add(ass); |
| | | } |
| | | System.debug('test1==>'+test1); |
| | | System.debug('invoiceOrderRecoedschangeLwc==>'+invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList1,'Testhosp001',hosp1.id,agency1.id,invoiceOrderRecoeds,testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList1,'Testhosp001','','',JSON.serialize(test1),testList1.Id,invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList1,'Testhosp001','','',JSON.serialize(test1),'',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList1,'青岛盈海医院',hosp1.id,agency1.id,'[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(testList1,'青岛盈海医院',hosp1.id,agency1.id,'[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | static testMethod void allsave2(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice01'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | // invoiceorder.Order_ForHospital__c = ''; |
| | | // invoiceorder.Order_ForDealer__c = ''; |
| | | invoiceorder.Dealer_Info__c=acc.Id; |
| | | //invoiceorder.Order_ProType__c = 'ET'; |
| | | insert invoiceorder; |
| | | |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today(),Order_ForDealerText__c = 'Test'); |
| | | insert testList2; |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | insert testList1; |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | //选择开票单 |
| | | LexConInvoiceViewController.save(testList2,'青岛盈海医院','',agency2.id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder.Id,acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | static testMethod void allsave3(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='202306164590'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder.Invoice_Note__c = '4444'; |
| | | invoiceorder.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | insert invoiceorder; |
| | | // invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today()); |
| | | insert testList2; |
| | | |
| | | List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>(); |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = invoiceorder.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | orderdet1.Shipment_Count__c = 10; |
| | | orderdet1.Invoiced_Procount__c = 4; |
| | | orderdet1.RrturnPro_count__c = 2; |
| | | conList.add(orderdet1); |
| | | |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | LexConInvoiceViewController.save(invoiceorder,'潍城现代门诊部','0011000001g0uyhAAA','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "潍城现代门诊部", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "潍城现代门诊部","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]','','',acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | LexConInvoiceViewController.save(invoiceorder,'潍城现代门诊部','0011000001g0uyhAAA',agency1.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "潍城现代门诊部", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "潍城现代门诊部","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,'',acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | |
| | | List<LexConInvoiceViewController.InvoiceOrderInfo> test1 = new List<LexConInvoiceViewController.InvoiceOrderInfo>(); |
| | | for(LexConInvoiceViewController.InvoiceOrderInfo ass:LexConInvoiceViewController.invoiceOrderRecoeds){ |
| | | ass.check = true; |
| | | test1.add(ass); |
| | | } |
| | | System.debug('test1==>'+test1); |
| | | LexConInvoiceViewController.save(invoiceorder,'潍城现代门诊部','0011000001g0uyhAAA','',JSON.serialize(test1),'','',acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | static testMethod void allsave4(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | Account hosp1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency1 = [SELECT Id FROM Account WHERE name='Testhosp001' LIMIT 1]; |
| | | Account agency2 = [SELECT Id FROM Account WHERE name='Testhosp002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='202306164590'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | // invoiceorder.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder.Invoice_Note__c = '4444'; |
| | | invoiceorder.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | insert invoiceorder; |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder1 = new Consumable_order__c(); |
| | | invoiceorder1.Name='202306164590'; |
| | | invoiceorder1.Invoice_Date__c = Date.today(); |
| | | invoiceorder1.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder1.Invoice_Note__c = '4444'; |
| | | invoiceorder1.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder1.Invoice_status__c='草案中'; |
| | | invoiceorder1.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | insert invoiceorder1; |
| | | |
| | | |
| | | |
| | | // invoiceorder = [select id,Name from Consumable_order__c where id =:invoiceorder.id]; |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today()); |
| | | |
| | | insert testList2; |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | //不需要输入科室 |
| | | LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','',agency1.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": true,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "潍城现代门诊部", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "潍城现代门诊部","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,'',acc.Id,'ET','',invoiceOrderRecoedschangeLwc); |
| | | |
| | | |
| | | |
| | | |
| | | //LexConInvoiceViewController.save(invoiceorder,'潍城现代门诊部','',agency2.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": false,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "潍城现代门诊部", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "潍城现代门诊部","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,invoiceorder.Id,myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc); |
| | | // LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','',agency2.Id,'[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}, {"check": false,"esd": {"Id": "a2K0l000000xAnwEAE","Order_ForHospital__c": "0011000001g0uyhAAA","Name": "a2K0l000000xAnw","Outbound_Date__c": "2023-05-12","ShipmentAccount__c": "潍城现代门诊部", "Shipment_total_amount__c": 2300,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 2300,"InvoiceNotPro_money__c": 2300,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "潍城现代门诊部","Id": "0011000001g0uyhAAA"} }, "needInvoiceCount": 0,"oldCheck": false, "Id": "a2K0l000000xAnwEAE"}]',testList2.Id,invoiceorder1.Id,myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc); |
| | | |
| | | } |
| | | } |
| | | |
| | | static testMethod void allsave5(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | List<Consumable_order__c> orderList = new List<Consumable_order__c>(); |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='202306164590'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | // invoiceorder.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder.Invoice_Note__c = '4444'; |
| | | invoiceorder.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | orderList.add(invoiceorder); |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder1 = new Consumable_order__c(); |
| | | invoiceorder1.Name='202306164590'; |
| | | invoiceorder1.Invoice_Date__c = Date.today(); |
| | | invoiceorder1.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder1.Invoice_Note__c = '4444'; |
| | | invoiceorder1.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder1.Invoice_status__c='草案中'; |
| | | invoiceorder1.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | orderList.add(invoiceorder1); |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today()); |
| | | orderList.add(testList2); |
| | | //出库单 |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | orderList.add(testList1); |
| | | insert orderList; |
| | | List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>(); |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = invoiceorder1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | orderdet1.Shipment_Count__c = 10; |
| | | orderdet1.Invoiced_Procount__c = 4; |
| | | orderdet1.RrturnPro_count__c = 2; |
| | | conList.add(orderdet1); |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c = testList1.Id,Invoice_Code_link__c =invoiceorder1.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c(); |
| | | upDateform.Name = 'Test1_001001'; |
| | | upDateform.Consumable_order__c = invoiceorder1.Id; |
| | | upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | upDateform.Consumable_count__c = 1; |
| | | upDateform.Consumable_product__c = pro1.Id; |
| | | upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c; |
| | | conList.add(upDateform); |
| | | insert conList; |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,invoiceorder1.Id,acc.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc); |
| | | // LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,'',myAccount1.Id,'ET','isreopen',invoiceOrderRecoedschangeLwc); |
| | | } |
| | | } |
| | | |
| | | static testMethod void allsave6(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | List<Consumable_order__c> orderList = new List<Consumable_order__c>(); |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='202306164590'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | // invoiceorder.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder.Invoice_Note__c = '4444'; |
| | | invoiceorder.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | orderList.add(invoiceorder); |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder1 = new Consumable_order__c(); |
| | | invoiceorder1.Name='202306164590'; |
| | | invoiceorder1.Invoice_Date__c = Date.today(); |
| | | invoiceorder1.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder1.Invoice_Note__c = '4444'; |
| | | invoiceorder1.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder1.Invoice_status__c='草案中'; |
| | | invoiceorder1.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | orderList.add(invoiceorder1); |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today()); |
| | | orderList.add(testList2); |
| | | //出库单 |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | orderList.add(testList1); |
| | | insert orderList; |
| | | List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>(); |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | conList.add(orderdet1); |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c =invoiceorder1.Id,Invoice_Code_link__c =invoiceorder1.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c(); |
| | | upDateform.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | upDateform.Consumable_order__c = invoiceorder1.Id; |
| | | upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | upDateform.Consumable_count__c = 1; |
| | | upDateform.Consumable_product__c = pro1.Id; |
| | | upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c; |
| | | upDateform.RrturnPro_count__c = 10; |
| | | conList.add(upDateform); |
| | | insert conList; |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]',testList1.Id,invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'); |
| | | LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'); |
| | | LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'); |
| | | } |
| | | } |
| | | |
| | | static testMethod void allsave7(){ |
| | | user curUser = [SELECT Id FROM User WHERE LastName = 'TestUser' LIMIT 1]; |
| | | Account acc = [SELECT Id FROM Account WHERE name='Testaccount002' LIMIT 1]; |
| | | system.runAs(curUser){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02}; |
| | | |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | List<Consumable_order__c> orderList = new List<Consumable_order__c>(); |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='202306164590'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | // invoiceorder.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder.Invoice_Note__c = '4444'; |
| | | invoiceorder.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder.Invoice_status__c='草案中'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | orderList.add(invoiceorder); |
| | | //发票信息 |
| | | Consumable_order__c invoiceorder1 = new Consumable_order__c(); |
| | | invoiceorder1.Name='202306164590'; |
| | | invoiceorder1.Invoice_Date__c = Date.today(); |
| | | invoiceorder1.Order_ForCustomerText__c = '消化科'; |
| | | invoiceorder1.Invoice_Note__c = '4444'; |
| | | invoiceorder1.RecordTypeid = '012100000006JxEAAU'; |
| | | invoiceorder1.Invoice_status__c='草案中'; |
| | | invoiceorder1.Order_type__c = '发票'; |
| | | // invoiceorder.Order_ForHospital__c = hosp1.Id; |
| | | orderList.add(invoiceorder1); |
| | | Consumable_order__c testList2 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id, |
| | | Invoice_Date__c = Date.today()); |
| | | orderList.add(testList2); |
| | | //出库单 |
| | | Consumable_order__c testList1 = new Consumable_order__c( |
| | | Name='Test1', |
| | | Summons_Sale_Status__c='出货', |
| | | SummonsStatus_c__c='已完成', |
| | | SummonsForDirction__c='直接销售给医院', |
| | | Order_status__c='草案中', |
| | | Order_type__c='传票', |
| | | Dealer_info__c=acc.Id); |
| | | orderList.add(testList1); |
| | | insert orderList; |
| | | List<Consumable_orderdetails__c> conList = new List<Consumable_orderdetails__c>(); |
| | | //出库单1明细1 |
| | | Consumable_orderdetails__c orderdet1 = new Consumable_orderdetails__c(); |
| | | orderdet1.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | orderdet1.Consumable_order__c = testList1.Id; |
| | | orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | orderdet1.Consumable_count__c = 1; |
| | | orderdet1.Consumable_product__c = pro1.Id; |
| | | conList.add(orderdet1); |
| | | |
| | | Consumable_order_LinkTable__c order_LinkTable1 = new Consumable_order_LinkTable__c(Name='order_LinkTable1',Outboundorder_Code_link__c =invoiceorder1.Id,Invoice_Code_link__c =invoiceorder1.Id); |
| | | insert order_LinkTable1; |
| | | Consumable_Orderdetails__c upDateform = new Consumable_Orderdetails__c(); |
| | | upDateform.Name = 'Test1_001001'; |
| | | //orderdet1.Consumable_principal__c = testList1.Id; |
| | | upDateform.Consumable_order__c = invoiceorder1.Id; |
| | | upDateform.RecordTypeId = System.Label.RT_ConOrderDetail1_Invoice; |
| | | upDateform.Consumable_count__c = 1; |
| | | upDateform.Consumable_product__c = pro1.Id; |
| | | upDateform.Consumable_order__c = order_LinkTable1.Outboundorder_Code_link__c; |
| | | upDateform.RrturnPro_count__c = 10; |
| | | conList.add(upDateform); |
| | | insert conList; |
| | | String invoiceOrderRecoedschangeLwc = JSON.serialize(LexConInvoiceViewController.invoiceOrderRecoedschange); |
| | | LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": true,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"},{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848,"Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false}]','',invoiceorder1.Id,acc.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'); |
| | | // LexConInvoiceViewController.save(invoiceorder1,'潍城现代门诊部','0011000001k1K9ZAAU','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]','',invoiceorder1.Id,myAccount1.Id,'ET','','[{"check": false,"esd": {"Id": "a2K0l000000x1KXEAY","Order_ForHospital__c": "0011000001k1K9ZAAU","Name": "DB-FY2024-04-Z316244","Outbound_Date__c": "2023-06-09","ShipmentAccount__c": "青岛盈海医院","Shipment_total_amount__c": 848,"RrturnPro_total_amount__c": 0,"Total_Invoiced_Procount__c": 0,"InvoiceNotPro_total_amount__c": 848,"InvoiceNotPro_money__c": 848, "Invoice_total_amount__c": 0,"Billed_Status__c": "还没开票","Order_ForHospital__r": {"Name": "青岛盈海医院","Id": "0011000001k1K9ZAAU"}},"needInvoiceCount": 0,"oldCheck": false,"Id": "a2K0l000000x1KXEAY"}]'); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | sumPrice = 0; |
| | | coc = new Consumable_order__c(); |
| | | //出库单信息 |
| | | <<<<<<< HEAD |
| | | coc = [ |
| | | SELECT Id, Name, Outbound_Date__c, Order_ForDealerText__c, Dealer_Info__c |
| | | FROM Consumable_order__c |
| | | WHERE Id = :orderId |
| | | ]; |
| | | ======= |
| | | coc = [SELECT Id, Name, Outbound_Date__c, Order_ForDealerText__c, Dealer_Info__c FROM Consumable_order__c WHERE Id = :orderId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | //发票信息 |
| | | invoicecode = [ |
| | | SELECT Id, Name, ShipmentAccount__c, Order_ForCustomerText__c, Order_ForDealerText__c, Dealer_Info__c |
| | |
| | | Invoice_UnitOptsMap.put('个', '个'); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | private class LexConInvoicedetailsControllerTest { |
| | | @isTest |
| | | <<<<<<< HEAD |
| | | static void all() { |
| | | User myUser_test; |
| | | Account myAccount1; |
| | |
| | | TestList1.Order_date__c = Date.today(); |
| | | TestList2.Deliver_date__c = Date.today(); |
| | | insert new List<Consumable_order__c>{ testList1, testList2 }; |
| | | ======= |
| | | static void all() { |
| | | User myUser_test; |
| | | Account myAccount1; |
| | | Account myAccount2; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | if (rectHos.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(Name='testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id ); |
| | | myAccount2 = new Account(Name='testaccount002',Dealer_discount__c =20,RecordTypeId = rectHos[0].Id ); |
| | | insert myAccount1; |
| | | insert myAccount2; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | //产品信息 |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false); |
| | | Product2 prod03 = new Product2(Name='Test03',ProductCode='Test03',Asset_Model_No__c = 'Test03',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false); |
| | | Product2 prod04 = new Product2(Name='Test04',ProductCode='Test04',Asset_Model_No__c = 'Test04',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=2,Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05',ProductCode='Test05',Asset_Model_No__c = 'Test05',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false); |
| | | Product2 prod06 = new Product2(Name='Test06',ProductCode='Test06',Asset_Model_No__c = 'Test06',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c=1,Manual_Entry__c = false); |
| | | insert new Product2[] {prod01, prod02,prod03,prod04, prod05, prod06}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod05.Id); |
| | | Product2__c pro6 = new Product2__c(Name='Pro006',OT_CODE_Text__c='Test006',Product2__c = prod06.Id); |
| | | insert new Product2__c[] {pro4, pro5,pro6,pro1, pro2, pro3}; |
| | | //发票 |
| | | Consumable_order__c invoiceorder = new Consumable_order__c(); |
| | | invoiceorder.Name='invoice02'; |
| | | invoiceorder.Order_type__c = '发票'; |
| | | invoiceorder.Invoice_status__c='已完成'; |
| | | invoiceorder.Invoice_Date__c = Date.today(); |
| | | invoiceorder.RecordTypeid = System.Label.RT_ConOrder_Invoice; |
| | | invoiceorder.Dealer_info__c= myAccount1.Id; |
| | | // createId.Order_ForHospital__c = myAccount2.Id; |
| | | invoiceorder.SummonsForDirction__c='直接销售给医院'; |
| | | invoiceorder.Order_status__c='草案中'; |
| | | insert invoiceorder; |
| | | |
| | | //出库单信息 |
| | | //出库单 |
| | | Consumable_order__c testList1 = new Consumable_order__c(Name='Test1',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院',Order_status__c='草案中',Order_type__c='传票',Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | Consumable_order__c testList2 = new Consumable_order__c(Name='Test2',Summons_Sale_Status__c='出货',SummonsStatus_c__c='已完成',SummonsForDirction__c='直接销售给医院',Order_status__c='已提交',Order_type__c='传票',Dealer_info__c=myAccount1.Id,ConInvoice_Code__c = invoiceorder.id); |
| | | TestList1.Order_date__c = Date.today().addDays(2); |
| | | TestList2.Order_date__c = Date.today().addDays(2); |
| | | TestList1.Order_date__c = Date.today(); |
| | | TestList2.Deliver_date__c=Date.today(); |
| | | insert new Consumable_order__c[]{testList1,testList2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | List<Consumable_Orderdetails__c> invoiceList = new List<Consumable_Orderdetails__c>(); |
| | | //发票明细1 |
| | |
| | | invoicedet1.Shipment_Count__c = 1; |
| | | invoicedet1.Invoice_Unitprice__c = 1; |
| | | invoicedet1.Delivery_List_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | invoicedet1.InvoicedProCost_RMB__c = 1; |
| | | invoicedet1.Invoice_Unit__c = '个'; |
| | | invoicedet1.Invoiced_Procount__c = 3; |
| | | invoicedet1.RrturnPro_count__c = 3; |
| | | ======= |
| | | invoicedet1.InvoicedProCost_RMB__c =1; |
| | | invoicedet1.Invoice_Unit__c = '个'; |
| | | invoicedet1.Invoiced_Procount__c = 3; |
| | | invoicedet1.RrturnPro_count__c =3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | invoiceList.add(invoicedet1); |
| | | |
| | | Consumable_orderdetails__c invoicedet2 = new Consumable_orderdetails__c(); |
| | |
| | | invoicedet2.Shipment_Count__c = 1; |
| | | invoicedet2.Invoice_Unitprice__c = 1; |
| | | invoicedet2.Delivery_List_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | invoicedet2.InvoicedProCost_RMB__c = 1; |
| | | invoicedet2.Invoice_Unit__c = '个'; |
| | | invoicedet2.Invoiced_Procount__c = 3; |
| | | invoicedet2.RrturnPro_count__c = 3; |
| | | ======= |
| | | invoicedet2.InvoicedProCost_RMB__c =1; |
| | | invoicedet2.Invoice_Unit__c = '个'; |
| | | invoicedet2.Invoiced_Procount__c = 3; |
| | | invoicedet2.RrturnPro_count__c =3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | invoiceList.add(invoicedet2); |
| | | |
| | | Consumable_orderdetails__c invoicedet3 = new Consumable_orderdetails__c(); |
| | |
| | | invoicedet3.Delivery_List_RMB__c = 2.0; |
| | | invoicedet3.Invoice_Unitprice__c = 1; |
| | | invoicedet3.InvoicedProCost_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | invoicedet3.Invoiced_Procount__c = 3; |
| | | invoicedet3.RrturnPro_count__c = 3; |
| | | ======= |
| | | invoicedet3.Invoiced_Procount__c = 3; |
| | | invoicedet3.RrturnPro_count__c =3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | invoiceList.add(invoicedet3); |
| | | insert invoiceList; |
| | | |
| | |
| | | orderdet1.Delivery_List_RMB__c = 2.0; |
| | | orderdet1.Invoice_Unitprice__c = 1; |
| | | orderdet1.InvoicedProCost_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | orderdet1.Invoiced_Procount__c = 3; |
| | | orderdet1.RrturnPro_count__c = 3; |
| | | ======= |
| | | orderdet1.Invoiced_Procount__c = 3; |
| | | orderdet1.RrturnPro_count__c =3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | orderdet1.Invoice_Unit__c = '个'; |
| | | codList.add(orderdet1); |
| | | |
| | |
| | | orderdet2.Delivery_List_RMB__c = 2.0; |
| | | orderdet2.Invoice_Unitprice__c = 1; |
| | | orderdet2.InvoicedProCost_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | orderdet2.Invoiced_Procount__c = 3; |
| | | orderdet2.RrturnPro_count__c = 3; |
| | | ======= |
| | | orderdet2.Invoiced_Procount__c = 3; |
| | | orderdet2.RrturnPro_count__c =3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | orderdet2.Invoice_Unit__c = '盒'; |
| | | codList.add(orderdet2); |
| | | |
| | |
| | | orderdet3.Delivery_List_RMB__c = 2.0; |
| | | orderdet3.Invoice_Unitprice__c = 1; |
| | | orderdet3.InvoicedProCost_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | orderdet3.Invoiced_Procount__c = 3; |
| | | orderdet3.RrturnPro_count__c = 3; |
| | | orderdet3.Invoice_Unit__c = '个'; |
| | | orderdet3.Invoiced_Count__c = 3; |
| | | codList.add(orderdet3); |
| | | |
| | | ======= |
| | | orderdet3.Invoiced_Procount__c = 3; |
| | | orderdet3.RrturnPro_count__c =3; |
| | | orderdet3.Invoice_Unit__c = '个'; |
| | | orderdet3.Invoiced_Count__c= 3; |
| | | codList.add(orderdet3); |
| | | |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | Consumable_orderdetails__c orderdet4 = new Consumable_orderdetails__c(); |
| | | orderdet4.Name = 'Test1_0010031'; |
| | | orderdet4.Consumable_order__c = testList1.Id; |
| | |
| | | orderdet4.Delivery_List_RMB__c = 2.0; |
| | | orderdet4.Invoice_Unitprice__c = 1; |
| | | orderdet4.InvoicedProCost_RMB__c = 1; |
| | | <<<<<<< HEAD |
| | | orderdet4.Invoiced_Procount__c = 3; |
| | | orderdet4.RrturnPro_count__c = 3; |
| | | orderdet4.Invoice_Unit__c = '盒'; |
| | | orderdet4.Invoiced_Count__c = 3; |
| | | ======= |
| | | orderdet4.Invoiced_Procount__c = 3; |
| | | orderdet4.RrturnPro_count__c =3; |
| | | orderdet4.Invoice_Unit__c = '盒'; |
| | | orderdet4.Invoiced_Count__c= 3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | codList.add(orderdet4); |
| | | |
| | | Consumable_orderdetails__c orderdet5 = new Consumable_orderdetails__c(); |
| | |
| | | orderdet5.Invoice_Unit__c = '个'; |
| | | orderdet5.Shipment_Count__c = 11; |
| | | orderdet5.Delivery_List_RMB__c = 2.0; |
| | | <<<<<<< HEAD |
| | | orderdet5.Invoiced_Procount__c = 3; |
| | | orderdet5.RrturnPro_count__c = 3; |
| | | orderdet5.Invoiced_Count__c = 3; |
| | | ======= |
| | | orderdet5.Invoiced_Procount__c = 3; |
| | | orderdet5.RrturnPro_count__c =3; |
| | | orderdet5.Invoiced_Count__c= 3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | codList.add(orderdet5); |
| | | |
| | | Consumable_orderdetails__c orderdet6 = new Consumable_orderdetails__c(); |
| | |
| | | orderdet6.Invoice_Unit__c = '盒'; |
| | | orderdet6.Shipment_Count__c = 11; |
| | | orderdet6.Delivery_List_RMB__c = 2.0; |
| | | <<<<<<< HEAD |
| | | orderdet6.Invoiced_Procount__c = 3; |
| | | orderdet6.RrturnPro_count__c = 3; |
| | | orderdet6.Invoiced_Count__c = 3; |
| | | ======= |
| | | orderdet6.Invoiced_Procount__c = 3; |
| | | orderdet6.RrturnPro_count__c =3; |
| | | orderdet6.Invoiced_Count__c= 3; |
| | | >>>>>>> LEXCommunityLiJun |
| | | codList.add(orderdet6); |
| | | |
| | | Consumable_orderdetails__c orderdet7 = new Consumable_orderdetails__c(); |
| | |
| | | orderdet7.Invoice_Unit__c = '个'; |
| | | orderdet7.Shipment_Count__c = 11; |
| | | orderdet7.Delivery_List_RMB__c = 2.0; |
| | | <<<<<<< HEAD |
| | | orderdet7.Invoiced_Procount__c = 3; |
| | | orderdet7.Invoiced_Count__c = 3; |
| | | orderdet7.RrturnPro_count__c = 3; |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | orderdet7.Invoiced_Procount__c = 3; |
| | | orderdet7.Invoiced_Count__c= 3; |
| | | orderdet7.RrturnPro_count__c =3; |
| | | codList.add(orderdet7); |
| | | insert codList; |
| | | |
| | | LexConInvoicedetailsController.init(testList1.Id,invoiceorder.Id); |
| | | //序列化Json |
| | | |
| | | |
| | | System.Test.startTest(); |
| | | System.debug('===>数据'+LexConInvoicedetailsController.consumableorderdetails1Records); |
| | | List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList = LexConInvoicedetailsController.consumableorderdetails1Records; |
| | | LexConInvoicedetailsController.save(JSON.serialize(LexConInvoicedetailsController.consumableorderdetails1Records),invoiceorder.Id,testList1.Id); |
| | | |
| | | List<LexConInvoicedetailsController.ConsumableorderdetailsInfo> inList1 = new List<LexConInvoicedetailsController.ConsumableorderdetailsInfo>(); |
| | | for(LexConInvoicedetailsController.ConsumableorderdetailsInfo ass:inList){ |
| | | ass.check= true; |
| | | ass.invoiceCount= 1; |
| | | ass.esd.Invoice_Unit__c = '个'; |
| | | inList1.add(ass); |
| | | } |
| | | LexConInvoicedetailsController.save(JSON.serialize(inList1),invoiceorder.Id,testList1.Id); |
| | | System.Test.stopTest(); |
| | | |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | pageSize = pageSizeLWC; |
| | | pageToken = pageTokenLWC > 2000 ? 2000 : pageTokenLWC; |
| | | |
| | | <<<<<<< HEAD |
| | | User Useracc = [ |
| | | SELECT accountid, UserPro_Type__c |
| | | FROM user |
| | | WHERE id = :UserInfo.getUserId() |
| | | ]; |
| | | ======= |
| | | User Useracc = [SELECT accountid, UserPro_Type__c FROM user WHERE id = :UserInfo.getUserId()]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | accountId = [SELECT id, Name FROM account WHERE id = :Useracc.accountid].id; |
| | | agencyProType = Useracc.UserPro_Type__c; |
| | | if (String.isBlank(Useracc.UserPro_Type__c)) { |
| | |
| | | Date thisDatetime2 = Date.newInstance(thisYear, 4, 1); |
| | | Date nextDatetime = Date.newInstance(nextYear, 4, 1); |
| | | |
| | | <<<<<<< HEAD |
| | | AggregateResult[] arList = null; |
| | | |
| | | System.debug('fiscalYear = ' + fiscalYear); |
| | |
| | | System.debug('accountList = ' + accountList); |
| | | System.debug('topInfo = ' + topInfo); |
| | | |
| | | ======= |
| | | //AggregateResult[] arList = null; |
| | | AggregateResult[] arList = new List<AggregateResult>(); |
| | | System.debug('fiscalYear = ' + fiscalYear); |
| | | if (fiscalYear == 'thisYear') { |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime); |
| | | Object saleAmountObject = saleAmountList[0].get('saleAmount'); |
| | | topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0'); |
| | | //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime); |
| | | } else if (fiscalYear == 'lastYear') { |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2); |
| | | //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | Object saleAmountObject = saleAmountList[0].get('saleAmount'); |
| | | topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0'); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2); |
| | | } else { |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime); |
| | | //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | Object saleAmountObject = saleAmountList[0].get('saleAmount'); |
| | | topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0'); |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime); |
| | | } |
| | | |
| | | // Map<String,Decimal> mapTemp = new Map<String,Decimal>(); |
| | | // for (AggregateResult ar : arList) { |
| | | // if(!mapTemp.get(String.valueOf(ar.get('hospitalName')))){ |
| | | // mapTemp.put(String.valueOf(ar.get('hospitalName'),Decimal.valueOf(String.valueOf(ar.get('thisAmount'))))); |
| | | // }else { |
| | | // Decimal decimal = mapTemp.get(String.valueOf(ar.get('hospitalName'))); |
| | | // decimal += Decimal.valueOf(String.valueOf(ar.get('thisAmount'))); |
| | | // mapTemp.put(String.valueOf(ar.get('hospitalName'),decimal)); |
| | | // } |
| | | // } |
| | | // System.debug('mapTemp = ' + mapTemp); |
| | | // //排序Decimal从大到小 |
| | | // List<Decimal> decimalList = new List<Decimal>(mapTemp.values()); |
| | | // decimalList.sort((a, b) => b.compareTo(a)); |
| | | // Map<String, Decimal> sortedMap = new Map<String, Decimal>(); |
| | | // for (String key : mapTemp.keySet()) { |
| | | // sortedMap.put(key, mapTemp.get(key)); |
| | | // } |
| | | |
| | | // System.debug('Sorted Map: ' + sortedMap); |
| | | |
| | | //查询客户信息(名称,省,县) |
| | | System.debug('arList = ' + arList); |
| | | List<String> accountList = new List<String>(); |
| | | for (AggregateResult ar : arList) { |
| | | System.debug('thisAmount = ' + String.valueOf(ar.get('thisAmount'))); |
| | | if(String.valueOf(ar.get('thisAmount')) != '0.0'){ |
| | | accountList.add(String.valueOf(ar.get('Order_ForHospital__c'))); |
| | | topInfo.deList.add(Decimal.valueOf(String.valueOf(ar.get('thisAmount')))); |
| | | } |
| | | } |
| | | |
| | | System.debug('accountList = ' + accountList); |
| | | System.debug('topInfo = ' + topInfo); |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | List<Account> acList = [ |
| | | SELECT |
| | | id, |
| | |
| | | Date thisDatetime2 = Date.newInstance(thisYear, 4, 1); |
| | | Date nextDatetime = Date.newInstance(nextYear, 4, 1); |
| | | |
| | | <<<<<<< HEAD |
| | | AggregateResult[] arList = null; |
| | | ======= |
| | | //AggregateResult[] arList = null; |
| | | AggregateResult[] arList = new List<AggregateResult>(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | System.debug('fiscalYear = ' + fiscalYear); |
| | | System.debug('thisYear = ' + thisYear); |
| | |
| | | if (fiscalYear == 'thisYear') { |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime, nextDatetime); |
| | | if (saleAmountList[0].get('saleAmount') != null) { |
| | | <<<<<<< HEAD |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | ======= |
| | | //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | Object saleAmountObject = saleAmountList[0].get('saleAmount'); |
| | | topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | } |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime, nextDatetime); |
| | | } else if (fiscalYear == 'lastYear') { |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, thisDatetime2); |
| | | if (saleAmountList[0].get('saleAmount') != null) { |
| | | <<<<<<< HEAD |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | ======= |
| | | //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | Object saleAmountObject = saleAmountList[0].get('saleAmount'); |
| | | topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | } |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, thisDatetime2); |
| | | } else { |
| | | AggregateResult[] saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(lastDatetime, nextDatetime); |
| | | if (saleAmountList[0].get('saleAmount') != null) { |
| | | <<<<<<< HEAD |
| | | topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | ======= |
| | | //topInfo.saleAmount = Decimal.valueOf(String.valueOf(saleAmountList[0].get('saleAmount'))); |
| | | Object saleAmountObject = saleAmountList[0].get('saleAmount'); |
| | | topInfo.saleAmount = saleAmountObject != null ? Decimal.valueOf(String.valueOf(saleAmountObject)) : Decimal.valueOf('0'); |
| | | >>>>>>> LEXCommunityLiJun |
| | | System.debug('topInfo.saleAmount = ' + topInfo.saleAmount); |
| | | } |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(lastDatetime, nextDatetime); |
| | |
| | | List<Account> allSelectAccount = Database.query(soql); |
| | | |
| | | totalCount = allSelectAccount.size(); |
| | | <<<<<<< HEAD |
| | | String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST' : 'NULLS LAST'; |
| | | ======= |
| | | String nullFL = sortOrder.toLowerCase() == 'asc' ? 'NULLS FIRST': 'NULLS LAST'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (String.isNotBlank(sortField)) { |
| | | soql += ' order by ' + sortField + ' ' + sortOrder + ' ' + nullFL; |
| | | } |
| | |
| | | deList = new List<Decimal>(); |
| | | } |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | public static Account account1 = new Account(); |
| | | public static Account account2 = new Account(); |
| | | public static Account account3 = new Account(); |
| | | <<<<<<< HEAD |
| | | public static Account consumable = new Account(); |
| | | public static Contact contact1 = new Contact(); |
| | | public static User user = new User(); |
| | |
| | | ); |
| | | } |
| | | } |
| | | ======= |
| | | public static Account consumable = new Account(); |
| | | public static Contact contact1 = new Contact(); |
| | | public static User user = new User(); |
| | | public static Agency_Hospital_Link__c agency_hospital_link = new Agency_Hospital_Link__c(); |
| | | |
| | | static testMethod void testMethod1(){ |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | List<Account> accList = new List<Account>(); |
| | | // 取引先 |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | // account1.Is_Active__c = '草案中'; |
| | | accList.add(account1); |
| | | |
| | | account2.Name = 'test2医院'; |
| | | account2.RecordTypeId = '01210000000QemG'; |
| | | // account2.Is_Active__c = '有効'; |
| | | accList.add(account2); |
| | | |
| | | account3.Name = 'test3医院'; |
| | | account3.RecordTypeId = '01210000000QemG'; |
| | | // account3.Is_Active__c = '申请中'; |
| | | accList.add(account3); |
| | | insert accList; |
| | | |
| | | consumable.Name = 'test1经销商'; |
| | | consumable.RecordTypeId = '01210000000Qem1'; |
| | | insert consumable; |
| | | |
| | | contact1.AccountId = account1.Id; |
| | | contact1.FirstName = '責任者'; |
| | | contact1.LastName = 'test1医院'; |
| | | insert contact1; |
| | | |
| | | // ユーザー |
| | | Profile p = [select Id from Profile where Name = '901_经销商社区普通权限']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact1.Id; |
| | | user.FirstName = 'ユーザー'; |
| | | user.LastName = 'テスト'; |
| | | user.Email = 'test_user@example.com'; |
| | | user.emailencodingkey='UTF-8'; |
| | | user.languagelocalekey='zh_CN'; |
| | | user.localesidkey='ja_JP'; |
| | | user.timezonesidkey='Asia/Shanghai'; |
| | | user.Username = 'test_user@example.com'; |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | insert user; |
| | | |
| | | // 代理店医院 |
| | | agency_hospital_link.Name = 'test1代理店医院'; |
| | | agency_hospital_link.Hospital__c = account1.Id; |
| | | agency_hospital_link.Agency__c = consumable.Id; |
| | | agency_hospital_link.OwnerId = user.Id; |
| | | insert agency_hospital_link; |
| | | |
| | | |
| | | |
| | | } |
| | | System.runAs(user){ |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c(); |
| | | Order1.Name = 'OCM_01_001'; |
| | | Order1.Order_status__c = '批准'; |
| | | Order1.Order_type__c = '到货'; |
| | | Order1.Dealer_Info__c = account1.Id; |
| | | Order1.RecordTypeid = '01210000000c9dqAAA'; |
| | | Order1.Order_ProType__c = 'ET'; |
| | | Order1.Order_ForHospital__c = account1.Id; |
| | | insert Order1; |
| | | |
| | | |
| | | |
| | | Consumable_Orderdetails__c con = new Consumable_Orderdetails__c(); |
| | | con.Consumable_order__c = Order1.Id; |
| | | insert con; |
| | | |
| | | |
| | | LexConsumableAccountController.init(2,1,'thisYear'); |
| | | LexConsumableAccountController.init(2,1,'lastYear'); |
| | | LexConsumableAccountController.init(2,1,'2023'); |
| | | LexConsumableAccountController.changeFiscalYearView('thisYear'); |
| | | LexConsumableAccountController.changeFiscalYearView('lastYear'); |
| | | // LexConsumableAccountController.changelistView('62. 医院_Hospital申请中的医院',consumable.Id,'ET',1,0,'Is_Active__c','ASC'); |
| | | // LexConsumableAccountController.changelistView('63. 医院_Hospital上周创建的医院',consumable.Id,'ET',1,0,'Is_Active__c','ASC'); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | static testMethod void testMethod2(){ |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | // 取引先 |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | // account1.Is_Active__c = '草案中'; |
| | | insert account1; |
| | | |
| | | account2.Name = 'test2医院'; |
| | | account2.RecordTypeId = '01210000000QemG'; |
| | | // account2.Is_Active__c = '有効'; |
| | | insert account2; |
| | | |
| | | account3.Name = 'test3医院'; |
| | | account3.RecordTypeId = '01210000000QemG'; |
| | | // account3.Is_Active__c = '申请中'; |
| | | insert account3; |
| | | |
| | | consumable.Name = 'test1经销商'; |
| | | consumable.RecordTypeId = '01210000000Qem1'; |
| | | insert consumable; |
| | | |
| | | contact1.AccountId = account1.Id; |
| | | contact1.FirstName = '責任者'; |
| | | contact1.LastName = 'test1医院'; |
| | | insert contact1; |
| | | |
| | | // ユーザー |
| | | Profile p = [select Id from Profile where Name = '901_经销商社区普通权限']; |
| | | user.ProfileId = p.Id; |
| | | user.ContactId = contact1.Id; |
| | | user.FirstName = 'ユーザー'; |
| | | user.LastName = 'テスト'; |
| | | user.Email = 'test_user@example.com'; |
| | | user.emailencodingkey='UTF-8'; |
| | | user.languagelocalekey='zh_CN'; |
| | | user.localesidkey='ja_JP'; |
| | | user.timezonesidkey='Asia/Shanghai'; |
| | | user.Username = 'test_user@example.com'; |
| | | user.Alias = 'テユ'; |
| | | user.CommunityNickname = 'テストユーザー'; |
| | | insert user; |
| | | |
| | | // 代理店医院 |
| | | agency_hospital_link.Name = 'test1代理店医院'; |
| | | agency_hospital_link.Hospital__c = account1.Id; |
| | | agency_hospital_link.Agency__c = consumable.Id; |
| | | agency_hospital_link.OwnerId = user.Id; |
| | | insert agency_hospital_link; |
| | | } |
| | | System.runAs(user){ |
| | | PageReference page = new PageReference('/apex/ConsumableAccount'); |
| | | System.Test.setCurrentPage(page); |
| | | ConsumableAccountController ca = new ConsumableAccountController(); |
| | | //ConsumableAccountController.getlistViewOptions(); |
| | | ca.init(); |
| | | |
| | | ca.filterName = '61. 医院_Hospital草案中的医院'; |
| | | ca.changelistView(); |
| | | |
| | | ca.filterName = '62. 医院_Hospital申请中的医院'; |
| | | ca.changelistView(); |
| | | |
| | | ca.filterName = '63. 医院_Hospital上周创建的医院'; |
| | | ca.changelistView(); |
| | | |
| | | ca.refreshPageSize(); |
| | | |
| | | ca.sortKey = '0'; |
| | | ca.accsort(); |
| | | |
| | | ca.sortKey = '1'; |
| | | LexConsumableAccountController.changelistView('62. 医院_Hospital申请中的医院',consumable.Id,'ET',1,0,'Is_Active__c','ASC'); |
| | | LexConsumableAccountController.changelistView('63. 医院_Hospital上周创建的医院',consumable.Id,'ET',1,0,'Is_Active__c','ASC'); |
| | | |
| | | |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @isTest |
| | | private class LexConsumableAccountInfoControllerTest { |
| | | <<<<<<< HEAD |
| | | @isTest |
| | | public static void test_method_one() { |
| | | // Implement test code |
| | | Account account1 = new Account(); |
| | | account1.Name = 'test1医院'; |
| | | ======= |
| | | |
| | | @isTest |
| | | public static void test_method_one() { |
| | | // Implement test code |
| | | Account account1 = new Account(); |
| | | account1.Name = 'test1医院'; |
| | | >>>>>>> LEXCommunityLiJun |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | //account1.Is_Active__c = '草案中'; |
| | | insert account1; |
| | | |
| | | <<<<<<< HEAD |
| | | LexConsumableAccountInfoController cai = new LexConsumableAccountInfoController(); |
| | | LexConsumableAccountInfoController.init(account1.Id); |
| | | LexConsumableAccountInfoController.init(''); |
| | | } |
| | | } |
| | | ======= |
| | | |
| | | LexConsumableAccountInfoController cai = new LexConsumableAccountInfoController(); |
| | | LexConsumableAccountInfoController.init(account1.Id); |
| | | LexConsumableAccountInfoController.init(''); |
| | | } |
| | | |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | public with sharing class LexConsumableAccountSOQL { |
| | | <<<<<<< HEAD |
| | | public static AggregateResult[] getAccountBySales(Datetime thisDatetime, Datetime nextDatetime) { |
| | | AggregateResult[] arList = new List<AggregateResult>( |
| | | [ |
| | |
| | | return saleAmountList; |
| | | } |
| | | } |
| | | ======= |
| | | public static AggregateResult[] getAccountBySales(Datetime thisDatetime ,Datetime nextDatetime){ |
| | | AggregateResult[] arList = new List<AggregateResult>([ |
| | | SELECT Consumable_order__r.Order_ForHospital__c,Consumable_order__r.Order_ForHospital__r.name hospitalName, |
| | | sum(Sale_amount__c) thisAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE |
| | | CreatedDate >= :thisDatetime |
| | | AND CreatedDate < :nextDatetime |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | GROUP BY Consumable_order__r.Order_ForHospital__c,Consumable_order__r.Order_ForHospital__r.name |
| | | ORDER BY sum(Sale_amount__c) DESC |
| | | LIMIT 10 |
| | | ]); |
| | | return arList; |
| | | } |
| | | |
| | | public static AggregateResult[] getAccountTotalSales(Datetime thisDatetime ,Datetime nextDatetime){ |
| | | AggregateResult[] saleAmountList = [ |
| | | SELECT sum(Sale_amount__c) saleAmount |
| | | FROM Consumable_Orderdetails__c |
| | | WHERE CreatedDate >= :thisDatetime |
| | | AND CreatedDate < :nextDatetime |
| | | AND Consumable_order__r.Order_ForHospital__r.name != '' |
| | | ]; |
| | | return saleAmountList; |
| | | } |
| | | |
| | | |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @isTest |
| | | private class LexConsumableAccountSOQLTest { |
| | | <<<<<<< HEAD |
| | | @testSetup |
| | | static void testInfo() { |
| | | User userTest; |
| | |
| | | Product2__c pro1 = new Product2__c(Name = 'Pro001', OT_CODE_Text__c = 'Test001', Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name = 'Pro002', OT_CODE_Text__c = 'Test002', Product2__c = prod02.Id); |
| | | insert new List<Product2__c>{ pro1, pro2 }; |
| | | ======= |
| | | @testSetup |
| | | static void testInfo(){ |
| | | User userTest; |
| | | Account accountItem; |
| | | User thisUser = [SELECT Id FROM User WHERE Id =:UserInfo.getUserId()]; |
| | | System.runAs(thisUser){ |
| | | List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = true AND SobjectType = 'Account' AND Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | Profile prof = [SELECT Id FROM Profile WHERE Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | accountItem = new Account(Name='Testaccount002', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, Product_Limit_Date__c = 'Test01|5|55,Test02|2|4', AgentCode_Ext__c = '9999900'); |
| | | insert accountItem; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountId = accountItem.id); |
| | | insert core; |
| | | userTest = New User(ContactId = core.id, Alias = 'newUser', Email='newuser@testorg.com', EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN', LocaleSidKey='zh_CN', ProfileId = prof.Id, TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com', UserPro_Type__c='ENG', Work_Location__c='北京'); |
| | | insert userTest; |
| | | } |
| | | |
| | | System.runAs(userTest){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Dealer_special_Object__c = true,SFDA_Approbation_No__c = '12124',Packing_list_manual__c = 1,SFDA_Expiration_Date__c= Date.today(),Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | Consumable_order__c createId = new Consumable_order__c(); |
| | | createId.Name = 'testMing1'; |
| | |
| | | createId.Delivery_detail_count__c = 5; |
| | | createId.orderPattern__c = 'hospitalorder'; |
| | | insert createId; |
| | | <<<<<<< HEAD |
| | | |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | List<Consumable_Orderdetails__c> coListTest = new List<Consumable_Orderdetails__c>(); |
| | | Consumable_Orderdetails__c conOrderDetail1 = new Consumable_Orderdetails__c(); |
| | | conOrderDetail1.Name = 'testConOrderDetail1'; |
| | | conOrderDetail1.Consumable_Arrivecount__c = 5; |
| | | <<<<<<< HEAD |
| | | conOrderDetail1.Unitprice_To_agency__c = 0; |
| | | ======= |
| | | conOrderDetail1.Unitprice_To_agency__c = 0; |
| | | >>>>>>> LEXCommunityLiJun |
| | | conOrderDetail1.Delivery_List_RMB__c = 99; |
| | | conOrderDetail1.Shipment_Count__c = 100; |
| | | conOrderDetail1.Consumable_product__c = pro1.id; |
| | |
| | | |
| | | Consumable_Orderdetails__c conOrderDetail2 = new Consumable_Orderdetails__c(); |
| | | conOrderDetail2.Name = 'testConOrderDetail2'; |
| | | <<<<<<< HEAD |
| | | conOrderDetail1.Unitprice_To_agency__c = 0; |
| | | ======= |
| | | conOrderDetail1.Unitprice_To_agency__c = 0; |
| | | >>>>>>> LEXCommunityLiJun |
| | | conOrderDetail1.Delivery_List_RMB__c = 99; |
| | | conOrderDetail2.Shipment_Count__c = 99; |
| | | conOrderDetail2.Consumable_product__c = pro2.id; |
| | |
| | | coListTest.add(conOrderDetail2); |
| | | insert coListTest; |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | @isTest |
| | | static void testGetAccountBySales() { |
| | |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | ======= |
| | | } |
| | | @isTest |
| | | static void testGetAccountBySales(){ |
| | | System.Test.startTest(); |
| | | DateTime thisDatetime = DateTime.newInstance(2023,1,1,00,00,00); |
| | | DateTime nextDatetime = DateTime.newInstance(2023,6,6,00,00,00); |
| | | AggregateResult[] arList = new List<AggregateResult>(); |
| | | arList = LexConsumableAccountSOQL.getAccountBySales(thisDatetime,nextDatetime); |
| | | System.Test.stopTest(); |
| | | } |
| | | @isTest |
| | | static void testGetAccountTotalSales(){ |
| | | System.Test.startTest(); |
| | | DateTime thisDatetime = DateTime.newInstance(2023,1,1,00,00,00); |
| | | DateTime nextDatetime = DateTime.newInstance(2023,6,6,00,00,00); |
| | | AggregateResult[] saleAmountList = new List<AggregateResult>(); |
| | | saleAmountList = LexConsumableAccountSOQL.getAccountTotalSales(thisDatetime,nextDatetime); |
| | | System.Test.stopTest(); |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | ESetId = esetId; |
| | | methodType = type; |
| | | if (String.isBlank(methodType) && String.isNotBlank(ESetId)) { |
| | | <<<<<<< HEAD |
| | | List<Consumable_order__c> oclist = [ |
| | | SELECT orderPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE id = :ESetid |
| | | ]; |
| | | ======= |
| | | List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | methodType = oclist.get(0).orderPattern__c; |
| | | } |
| | | statusEdit = keywordStr; |
| | |
| | | userId = UserInfo.getUserId(); |
| | | List<user> Useracc = new List<user>(); |
| | | //lt 20230517 安徽两票制 add ,OSHFLG__c |
| | | <<<<<<< HEAD |
| | | Useracc = [ |
| | | SELECT accountid, Work_Location__c, UserPro_Type__c, OSHFLG__c |
| | | FROM user |
| | | WHERE id = :userId |
| | | ]; |
| | | ======= |
| | | Useracc = [SELECT accountid, Work_Location__c, UserPro_Type__c, OSHFLG__c FROM user WHERE id = :userId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | accountid = Useracc[0].accountid; |
| | | userWorkLocation = Useracc[0].Work_Location__c; |
| | | agencyProType = Useracc[0].UserPro_Type__c; |
| | |
| | | // attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i])); |
| | | // } |
| | | // } |
| | | <<<<<<< HEAD |
| | | List<ContentDocumentLink> links = [ |
| | | SELECT Id, ContentDocumentId |
| | | FROM ContentDocumentLink |
| | | WHERE LinkedEntityId = :ESetId |
| | | ]; |
| | | ======= |
| | | List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :ESetId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | if (links != null && links.size() > 0) { |
| | | List<String> documentIds = new List<String>(); |
| | | for (ContentDocumentLink link : links) { |
| | |
| | | ESetId = eSetidStr; |
| | | try { |
| | | statusEdit = 'Redirect'; |
| | | <<<<<<< HEAD |
| | | List<Consumable_order__c> oclist = [ |
| | | SELECT orderPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE id = :ESetid |
| | | ]; |
| | | ======= |
| | | List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c; |
| | | results.result = 'Success'; |
| | | results.url = url; |
| | |
| | | returnOrder = true; |
| | | try { |
| | | statusEdit = 'Redirect'; |
| | | <<<<<<< HEAD |
| | | List<Consumable_order__c> oclist = [ |
| | | SELECT orderPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE id = :ESetid |
| | | ]; |
| | | ======= |
| | | List<Consumable_order__c> oclist = [SELECT orderPattern__c FROM Consumable_order__c WHERE id = :ESetid]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c; |
| | | results.result = 'Success'; |
| | | results.url = url; |
| | |
| | | cv.VersionData = EncodingUtil.base64Decode(base64Data); |
| | | cv.IsMajorVersion = true; |
| | | insert cv; |
| | | <<<<<<< HEAD |
| | | Consumable_order__c c = [ |
| | | SELECT Id |
| | | FROM Consumable_order__c |
| | | WHERE Id = :pId |
| | | ]; |
| | | ======= |
| | | Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :pId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | c.Consumable_pdf_insert_day__c = Date.today(); |
| | | update c; |
| | | results.result = 'Success'; |
| | |
| | | p.orderPattern__c = methodType; |
| | | } |
| | | insert p; |
| | | <<<<<<< HEAD |
| | | List<Consumable_order__c> Consumable_order = [ |
| | | SELECT Name, orderPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE id = :p.id |
| | | ]; |
| | | ======= |
| | | List<Consumable_order__c> Consumable_order = [SELECT Name, orderPattern__c FROM Consumable_order__c WHERE id = :p.id]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsview) { |
| | | Roll = Roll + 1; |
| | | if (ass.check == true) { |
| | |
| | | p.Offers_Price__c = bargainPrice; |
| | | } |
| | | update p; |
| | | <<<<<<< HEAD |
| | | List<Consumable_order__c> Consumable_order = [ |
| | | SELECT Name, orderPattern__c |
| | | FROM Consumable_order__c |
| | | WHERE id = :p.id |
| | | ]; |
| | | ======= |
| | | List<Consumable_order__c> Consumable_order = [SELECT Name, orderPattern__c FROM Consumable_order__c WHERE id = :p.id]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | List<Consumable_Orderdetails__c> qs = new List<Consumable_Orderdetails__c>(); |
| | | qs = [ |
| | | SELECT Id |
| | |
| | | public static Results deleteAtt(String contentVersionId, String cocId) { |
| | | Results results = new Results(); |
| | | try { |
| | | <<<<<<< HEAD |
| | | List<ContentVersion> cvInfo = [ |
| | | SELECT Id |
| | | FROM ContentVersion |
| | |
| | | FROM Consumable_order__c |
| | | WHERE Id = :cocId |
| | | ]; |
| | | ======= |
| | | List<ContentVersion> cvInfo = [SELECT Id FROM ContentVersion WHERE FirstPublishLocationId = :cocId]; |
| | | ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId]; |
| | | String contentDocumentId = conVersion.ContentDocumentId; |
| | | ContentDocument conDocument = [SELECT Id FROM ContentDocument WHERE Id = :contentDocumentId]; |
| | | delete conDocument; |
| | | if (cvInfo.size() <= 1) { |
| | | Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :cocId]; |
| | | >>>>>>> LEXCommunityLiJun |
| | | c.Consumable_pdf_insert_day__c = null; |
| | | update c; |
| | | } |
| | |
| | | @AuraEnabled |
| | | public String value; |
| | | } |
| | | <<<<<<< HEAD |
| | | } |
| | | ======= |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @istest |
| | | public class LexConsumableControllerTest { |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void ConsumableOrdertest1() { |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | |
| | | re.editAble |
| | | ); |
| | | LexConsumableController.sorder(order.Id, myAccount1.Id); |
| | | ======= |
| | | static void ConsumableOrdertest1(){ |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser){ |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8); |
| | | insert contract; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test){ |
| | | //产品数据 |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode='Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'CDS', |
| | | Category4__c = 'OER', |
| | | Category5__c = '其它', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test001', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode='Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'ENT', |
| | | Category4__c = 'Celon', |
| | | Category5__c = 'Celon', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test002', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode='Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'US', |
| | | Category4__c = 'ALOKA', |
| | | Category5__c = '体外超声', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name='MH-155:白平衡帽',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert proG; |
| | | System.debug('proG:'+proG); |
| | | System.debug('proG1:'+proG.Estimation_Entry_Possibility__c); |
| | | System.debug('prod07:'+prod01); |
| | | System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c); |
| | | Product2__c proH = new Product2__c(Name='MB-677:BNC电缆',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name='TooMAJ-643R:水囊鞘管003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id); |
| | | insert proF; |
| | | |
| | | |
| | | //订单 |
| | | Consumable_order__c order = new Consumable_order__c(); |
| | | order.Name = 'testMing'; |
| | | order.Order_status__c = '批准'; |
| | | order.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | order.Dealer_Info__c = myAccount1.id; |
| | | order.Inventory_date__c = Date.today(); |
| | | order.Order_type__c = '订单'; |
| | | order.Order_ProType__c = 'ET'; |
| | | order.orderPattern__c = 'agreementorder'; |
| | | insert order; |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = order.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = proG.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c(); |
| | | createDetail2 = new Consumable_order_details2__c(); |
| | | createDetail2.Consumable_Product__c = proG.id; |
| | | createDetail2.Asset_Model_No__c = 'Test01'; |
| | | createDetail2.Consumable_order_minor__c = order.id; |
| | | createDetail2.Consumable_Arrived_order__c = order.id; |
| | | createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | createDetail2.Asset_Model_No__c = proG.Asset_Model_No__c; |
| | | createDetail2.Bar_Code__c = '123'; |
| | | createDetail2.Box_Piece__c ='盒'; |
| | | createDetail2.Arrive_date__c = Date.today(); |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | insert createDetail2; |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.ConsumableorderdetailsInfo c1 = new LexConsumableController.ConsumableorderdetailsInfo(Orderdet); |
| | | ContentVersion v = new ContentVersion(); |
| | | LexConsumableController.ConsumableorderdetailsInfo c2 = new LexConsumableController.ConsumableorderdetailsInfo(v); |
| | | LexConsumableController l = new LexConsumableController(); |
| | | LexConsumableController.Results re = LexConsumableController.init('', order.Id, ''); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | LexConsumableController.sorder(order.Id,myAccount1.Id); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | @IsTest |
| | | static void ConsumableOrdertest2() { |
| | | user MyUser_Test; |
| | |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | ======= |
| | | @IsTest |
| | | static void ConsumableOrdertest2(){ |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser){ |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8); |
| | | insert contract; |
| | | |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test){ |
| | | //产品数据 |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode='Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'CDS', |
| | | Category4__c = 'OER', |
| | | Category5__c = '其它', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test001', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode='Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'ENT', |
| | | Category4__c = 'Celon', |
| | | Category5__c = 'Celon', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test002', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode='Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'US', |
| | | Category4__c = 'ALOKA', |
| | | Category5__c = '体外超声', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name='MH-155:白平衡帽',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert proG; |
| | | System.debug('proG:'+proG); |
| | | System.debug('proG1:'+proG.Estimation_Entry_Possibility__c); |
| | | System.debug('prod07:'+prod01); |
| | | System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c); |
| | | Product2__c proH = new Product2__c(Name='MB-677:BNC电缆',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name='TooMAJ-643R:水囊鞘管003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id); |
| | | insert proF; |
| | | |
| | | //创建医院 |
| | | 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 = '东京'; |
| | | insert hospital; |
| | | |
| | | //建一条医院特价产品 |
| | | hospitalprice__c hc = new hospitalprice__c(); |
| | | hc.hospital__c = hospital.Id; |
| | | hc.product__c = proG.Id; |
| | | hc.aph__c = '12332'; |
| | | hc.account__c = myAccount1.Id; |
| | | insert hc; |
| | | |
| | | //医院 |
| | | Consumable_order__c order1 = new Consumable_order__c(); |
| | | order1.Name = 'testMing1'; |
| | | order1.Order_status__c = '批准'; |
| | | order1.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | order1.Dealer_Info__c = myAccount1.id; |
| | | order1.Inventory_date__c = Date.today(); |
| | | order1.Order_type__c = '订单'; |
| | | order1.Order_ProType__c = 'ET'; |
| | | order1.orderPattern__c = 'hospitalorder'; |
| | | insert order1; |
| | | Consumable_orderdetails__c Orderdet1 = new Consumable_orderdetails__c(); |
| | | Orderdet1.Name = 'OCM_01_00102'; |
| | | Orderdet1.Consumable_order__c = order1.Id; |
| | | Orderdet1.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet1.Consumable_Product__c = proG.Id; |
| | | Orderdet1.Consumable_count__c = 4; |
| | | insert Orderdet1; |
| | | |
| | | Consumable_order_details2__c createDetail3 = new Consumable_order_details2__c(); |
| | | createDetail3 = new Consumable_order_details2__c(); |
| | | createDetail3.Consumable_Product__c = proG.id; |
| | | createDetail3.Asset_Model_No__c = 'Test02'; |
| | | createDetail3.Consumable_order_minor__c = order1.id; |
| | | createDetail3.Consumable_Arrived_order__c = order1.id; |
| | | createDetail3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | createDetail3.Asset_Model_No__c = proG.Asset_Model_No__c; |
| | | createDetail3.Bar_Code__c = '123'; |
| | | createDetail3.Box_Piece__c ='盒'; |
| | | createDetail3.Arrive_date__c = Date.today(); |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | insert createDetail3; |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re = LexConsumableController.init('', order1.Id, ''); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, hospital.Id, contract.Id, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, hospital.Id, contract.Id, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | @IsTest |
| | | static void ConsumableOrdertest3() { |
| | | user MyUser_Test; |
| | |
| | | re.proLimitAndDate, |
| | | re.editAble |
| | | ); |
| | | ======= |
| | | @IsTest |
| | | static void ConsumableOrdertest3(){ |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | Consumable_order__c order2; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser){ |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),Dealer_discount__c = 0.8); |
| | | insert contract; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | //产品数据 |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode='Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'CDS', |
| | | Category4__c = 'OER', |
| | | Category5__c = '其它', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test001', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode='Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'ENT', |
| | | Category4__c = 'Celon', |
| | | Category5__c = 'Celon', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test002', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode='Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'US', |
| | | Category4__c = 'ALOKA', |
| | | Category5__c = '体外超声', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name='MH-155:白平衡帽',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert proG; |
| | | System.debug('proG:'+proG); |
| | | System.debug('proG1:'+proG.Estimation_Entry_Possibility__c); |
| | | System.debug('prod07:'+prod01); |
| | | System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c); |
| | | Product2__c proH = new Product2__c(Name='MB-677:BNC电缆',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name='TooMAJ-643R:水囊鞘管003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id); |
| | | insert proF; |
| | | |
| | | Dealer_Product__c dpc = new Dealer_Product__c(); |
| | | dpc.Dealer_Contact__c = contract.id; |
| | | dpc.Dealer_Product2__c = proG.id; |
| | | dpc.Special_Discount__c = 45; |
| | | dpc.Campaign_StartDate__c = Date.today().addDays(-1); |
| | | dpc.Campaign_EndDate__c = Date.today().addDays(1); |
| | | insert dpc; |
| | | |
| | | Dealer_Product__c dpc2 = new Dealer_Product__c(); |
| | | dpc2.Dealer_Contact__c = contract.id; |
| | | dpc2.Dealer_Product2__c = proG.id; |
| | | dpc2.Special_Campaign_Price__c = 4500; |
| | | insert dpc2; |
| | | |
| | | Dealer_Product__c dpc1 = new Dealer_Product__c(); |
| | | dpc1.Dealer_Contact__c = contract.id; |
| | | dpc1.Dealer_Product2__c = proH.id; |
| | | dpc1.Special_Campaign_Price__c = 23456; |
| | | insert dpc1; |
| | | //促销 |
| | | order2 = new Consumable_order__c(); |
| | | order2.Name = 'testMing2'; |
| | | order2.Order_status__c = '批准'; |
| | | order2.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | order2.Dealer_Info__c = myAccount1.id; |
| | | order2.Inventory_date__c = Date.today(); |
| | | order2.Order_type__c = '订单'; |
| | | order2.Order_ProType__c = 'ET'; |
| | | order2.orderPattern__c = 'promotionorder'; |
| | | insert order2; |
| | | Consumable_orderdetails__c Orderdet2 = new Consumable_orderdetails__c(); |
| | | Orderdet2.Name = 'OCM_01_00103'; |
| | | Orderdet2.Consumable_order__c = order2.Id; |
| | | Orderdet2.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet2.Consumable_Product__c = proG.Id; |
| | | Orderdet2.Consumable_count__c = 4; |
| | | insert Orderdet2; |
| | | |
| | | Consumable_order_details2__c createDetail4 = new Consumable_order_details2__c(); |
| | | createDetail4 = new Consumable_order_details2__c(); |
| | | createDetail4.Consumable_Product__c = proG.id; |
| | | createDetail4.Asset_Model_No__c = 'Test03'; |
| | | createDetail4.Consumable_order_minor__c = order2.id; |
| | | createDetail4.Consumable_Arrived_order__c = order2.id; |
| | | createDetail4.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | createDetail4.Asset_Model_No__c = proG.Asset_Model_No__c; |
| | | createDetail4.Bar_Code__c = '123'; |
| | | createDetail4.Box_Piece__c ='盒'; |
| | | createDetail4.Arrive_date__c = Date.today(); |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | insert createDetail4; |
| | | } |
| | | |
| | | System.runAs(MyUser_Test){ |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re = LexConsumableController.init('', order2.Id, ''); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, re.contractId, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, re.contractId, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | LexConsumableController.searchConsumableorderdetails(re.userWorkLocation, re.agencyProType, re.accountName, re.accountid, re.hospitalId, contract.Id, 'testMing', '', '', '', re.category_Goods, re.specialCampaign, JSON.serialize(re.dealerProductId), re.methodType, JSON.serialize(re.consumableorderdetailsRecordsview), re.editAble, re.proLimitAndDate); |
| | | LexConsumableController.searchorderdetails(re.methodType, re.accountid, re.hospitalId, contract.Id, re.userWorkLocation, re.accountName, re.proLimitAndDate, re.editAble); |
| | | >>>>>>> LEXCommunityLiJun |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | @IsTest |
| | | static void ConsumableOrdertest4() { |
| | | user MyUser_Test; |
| | |
| | | insert order; |
| | | |
| | | cv = new ContentVersion(); |
| | | ======= |
| | | @IsTest |
| | | static void ConsumableOrdertest4(){ |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | Account contract; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser){ |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | List<RecordType> rectCo1 = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'AgencyContract']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | |
| | | RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus'); |
| | | insert olympus; |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | System.debug('account111:'+myAccount1); |
| | | contract = new Account(RecordTypeId=rectCo1[0].Id ,Name ='contractName',ParentId = myAccount1.id,Agent_Ref__c =myAccount1.id, Contract_Department_Class__c = 'ET',Contract_Decide_Start_Date__c=Date.today().addDays(-2), |
| | | Contract_Decide_End_Date__c = Date.today().addDays(2),ET_SP_Dealer__c = true); |
| | | insert contract; |
| | | System.debug('account111:'+contract); |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | System.runAs(MyUser_Test){ |
| | | //产品数据 |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode='Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'CDS', |
| | | Category4__c = 'OER', |
| | | Category5__c = '其它', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test001', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode='Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'ENT', |
| | | Category4__c = 'Celon', |
| | | Category5__c = 'Celon', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test002', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode='Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'US', |
| | | Category4__c = 'ALOKA', |
| | | Category5__c = '体外超声', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name='MH-155:白平衡帽',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | insert proG; |
| | | System.debug('proG:'+proG); |
| | | System.debug('proG1:'+proG.Estimation_Entry_Possibility__c); |
| | | System.debug('prod07:'+prod01); |
| | | System.debug('prod071:'+prod01.Estimation_Entry_Possibility__c); |
| | | Product2__c proH = new Product2__c(Name='MB-677:BNC电缆',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name='TooMAJ-643R:水囊鞘管003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id); |
| | | insert proF; |
| | | |
| | | |
| | | //订单 |
| | | Consumable_order__c order = new Consumable_order__c(); |
| | | order.Name = 'testMing'; |
| | | order.Order_status__c = '批准'; |
| | | order.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | order.Dealer_Info__c = myAccount1.id; |
| | | order.Inventory_date__c = Date.today(); |
| | | order.Order_type__c = '订单'; |
| | | order.Order_ProType__c = 'ET'; |
| | | order.orderPattern__c = 'agreementorder'; |
| | | insert order; |
| | | Consumable_orderdetails__c Orderdet = new Consumable_orderdetails__c(); |
| | | Orderdet.Name = 'OCM_01_00101'; |
| | | Orderdet.Consumable_order__c = order.Id; |
| | | Orderdet.RecordTypeId = System.Label.RT_ConOrderDetail1_Order; |
| | | Orderdet.Consumable_Product__c = proG.Id; |
| | | Orderdet.Consumable_count__c = 4; |
| | | insert Orderdet; |
| | | |
| | | Consumable_order_details2__c createDetail2 = new Consumable_order_details2__c(); |
| | | createDetail2 = new Consumable_order_details2__c(); |
| | | createDetail2.Consumable_Product__c = proG.id; |
| | | createDetail2.Asset_Model_No__c = 'Test01'; |
| | | createDetail2.Consumable_order_minor__c = order.id; |
| | | createDetail2.Consumable_Arrived_order__c = order.id; |
| | | createDetail2.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | createDetail2.Asset_Model_No__c = proG.Asset_Model_No__c; |
| | | createDetail2.Bar_Code__c = '123'; |
| | | createDetail2.Box_Piece__c ='盒'; |
| | | createDetail2.Arrive_date__c = Date.today(); |
| | | |
| | | Oly_TriggerHandler.bypass('ConsumableAssetHander'); |
| | | insert createDetail2; |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re = LexConsumableController.init('agreementorder', '', ''); |
| | | re.consumableorderdetailsRecordsview[0].check = true; |
| | | re.consumableorderdetailsRecordsview[0].esd.Consumable_count__c = 1; |
| | | String conId = contract.Id; |
| | | LexConsumableController.ordrCopy(contract.Name,JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,'',conId,re.agencyProType1,false); |
| | | LexConsumableController.save('',JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'',conId,re.agencyProType1,false); |
| | | LexConsumableController.save(contract.Name,JSON.serialize(re.coc),re.agencyProType,re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'','',re.agencyProType1,false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),re.methodType,re.ESetId,'',re.contractId,'ET',false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'agreementorder',re.ESetId,'',re.contractId,'ET',false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'promotionorder',re.ESetId,'',re.contractId,'ET',false); |
| | | LexConsumableController.save(':Testaccount001',JSON.serialize(re.coc),'ET',re.accountid,JSON.serialize(re.consumableorderdetailsRecordsview),JSON.serialize(re.contactDealer),'hospitalorder',re.ESetId,'',re.contractId,'ET',false); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | |
| | | @IsTest |
| | | static void ConsumableOrdertest5(){ |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | ContentVersion cv; |
| | | Consumable_order__c order; |
| | | insert n; |
| | | System.runAs(thisUser){ |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus'); |
| | | insert olympus; |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | order = new Consumable_order__c(); |
| | | order.Name = 'testMing'; |
| | | order.Order_status__c = '批准'; |
| | | order.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | order.Dealer_Info__c = myAccount1.id; |
| | | order.Inventory_date__c = Date.today(); |
| | | order.Order_type__c = '订单'; |
| | | order.Order_ProType__c = 'ET'; |
| | | order.orderPattern__c = 'agreementorder'; |
| | | insert order; |
| | | |
| | | cv = new ContentVersion(); |
| | | >>>>>>> LEXCommunityLiJun |
| | | cv.Title = 'test.txt'; |
| | | cv.PathOnClient = '/' + 'test.txt'; |
| | | cv.FirstPublishLocationId = order.Id; |
| | | cv.VersionData = EncodingUtil.base64Decode('VGVzdA=='); |
| | | cv.IsMajorVersion = true; |
| | | insert cv; |
| | | <<<<<<< HEAD |
| | | } |
| | | System.runAs(MyUser_Test) { |
| | | Product2 prod01 = new Product2( |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | |
| | | } |
| | | System.runAs(MyUser_Test){ |
| | | Product2 prod01 = new Product2(Name='Test01', |
| | | ProductCode='Test01', |
| | | Asset_Model_No__c = 'Test01', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'CDS', |
| | | Category4__c = 'OER', |
| | | Category5__c = '其它', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test001', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | |
| | | Product2 prod02 = new Product2(Name='Test02', |
| | | ProductCode='Test02', |
| | | Asset_Model_No__c = 'Test02', |
| | | SFDA_Status__c = '有効', |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'CDS', |
| | | Category4__c = 'OER', |
| | | Category5__c = 'Celon', |
| | | Dealer_special_Object__c = true, |
| | | SFDA_Approbation_No__c = 'Test002', |
| | | Packing_list_manual__c = 1, |
| | | SFDA_Expiration_Date__c= Date.today(), |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_Date2__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false |
| | | ); |
| | | |
| | | Product2 prod03 = new Product2(Name='Test03', |
| | | ProductCode='Test03', |
| | | Asset_Model_No__c = 'Test03', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'US', |
| | | Category4__c = 'ALOKA', |
| | | Category5__c = '体外超声', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | |
| | | Product2 prod04 = new Product2(Name='Test04', |
| | | ProductCode='Test04',Asset_Model_No__c = 'Test04', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = 'OCS', |
| | | Category4__c = '附属品', |
| | | Category5__c = 'OCS', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | Product2 prod05 = new Product2(Name='Test05', |
| | | ProductCode='Test05', |
| | | Asset_Model_No__c = 'Test05', |
| | | SFDA_Status__c = '有効', |
| | | Dealer_special_Object__c = true, |
| | | Product_Status__c = '正常销售', |
| | | SFDA_Approbated_Status__c = '有效', |
| | | Category3__c = '光源', |
| | | Category4__c = 'CLV', |
| | | Category5__c = 'S45', |
| | | Intra_Trade_List_RMB_1__c = 1000, |
| | | Intra_Trade_List_RMB_Date1__c = Date.today().addDays(-1), |
| | | Intra_Trade_List_RMB_End_Date1__c = Date.today().addDays(1), |
| | | Manual_Entry__c = false); |
| | | insert new Product2[] {prod01,prod02,prod03, prod04, prod05}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | Product2__c pro3 = new Product2__c(Name='Pro003',OT_CODE_Text__c='Test003',Product2__c = prod03.Id); |
| | | Product2__c pro4 = new Product2__c(Name='Pro004',OT_CODE_Text__c='Test004',Product2__c = prod04.Id); |
| | | Product2__c pro5 = new Product2__c(Name='Pro005',OT_CODE_Text__c='Test005',Product2__c = prod05.Id); |
| | | insert new Product2__c[] {pro1,pro2,pro3,pro4, pro5}; |
| | | |
| | | |
| | | |
| | | Test.startTest(); |
| | | LexConsumableController.Results re1 = LexConsumableController.categoryAllload('ET','CDS'); |
| | | LexConsumableController.Results re2 = LexConsumableController.categoryAllload('ENG','CDS'); |
| | | LexConsumableController.Results re3 = LexConsumableController.categoryAllload('','CDS'); |
| | | LexConsumableController.Results re4 = LexConsumableController.categoryload('ET','CDS','OER'); |
| | | LexConsumableController.Results re5 = LexConsumableController.categoryload('ENG','CDS','OER'); |
| | | LexConsumableController.Results re6 = LexConsumableController.categoryload('','CDS','OER'); |
| | | String pid = order.Id; |
| | | LexConsumableController.filesUpload(pid,'tset.txt','VGVzdA=='); |
| | | LexConsumableController.deleteAtt(cv.Id, pid); |
| | | LexConsumableController.backOrder(pid); |
| | | LexConsumableController.setEditAble(pid); |
| | | LexConsumableController.delConsumable(pid); |
| | | LexConsumableController.OffersPrice(); |
| | | Test.stopTest(); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| | |
| | | @istest |
| | | public class LexConsumableGoodsInfoTest { |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest1() { |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | |
| | | dataForProductCount5.Box_Piece__c = '盒'; |
| | | conList1.add(dataForProductCount5); |
| | | insert conList1; |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest1(){ |
| | | user MyUser_Test; |
| | | Account myAccount1; |
| | | User thisUser = [ select Id from User where Id = :UserInfo.getUserId()]; |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(thisUser){ |
| | | Profile prof1 = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | StaticParameter.EscapeConsumableOrderDetail2Trigger = true; |
| | | |
| | | RecordType rectCoO = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; |
| | | Account olympus = new Account(RecordTypeId = rectCoO.Id, AgentCode_Ext__c = '9999900', Name = 'olympus'); |
| | | insert olympus; |
| | | myAccount1 = new Account(name='Testaccount001',Dealer_discount__c =10,RecordTypeId = rectCo[0].Id,AgentCode_Ext__c = '8888888',Product_Limit_Date__c = 'Test07|3|100,Test08|10|50'); |
| | | insert myAccount1; |
| | | Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); |
| | | insert core; |
| | | MyUser_Test = New User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='TestUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof1.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com',Work_Location__c = '重庆'); |
| | | insert MyUser_Test; |
| | | |
| | | } |
| | | |
| | | system.runAs(MyUser_Test){ |
| | | //产品数据 |
| | | Product2 prod07 = new Product2(Name='Test07',ProductCode='Test07',Asset_Model_No__c = 'Test07',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false); |
| | | Product2 prod08 = new Product2(Name='Test08',ProductCode='Test08',Asset_Model_No__c = 'Test08',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false); |
| | | Product2 prod09 = new Product2(Name='Test09',ProductCode='Test09',Asset_Model_No__c = 'Test09',SFDA_Status__c = '有効',Dealer_special_Object__c = true,Packing_list_manual__c = 1,Manual_Entry__c = false); |
| | | insert new Product2[] {prod07,prod08,prod09}; |
| | | |
| | | //制作产品 |
| | | Product2__c proG = new Product2__c(Name='MH-155:白平衡帽',OT_CODE_Text__c='Test001',Product2__c = prod07.Id); |
| | | insert proG; |
| | | Product2__c proH = new Product2__c(Name='MB-677:BNC电缆',OT_CODE_Text__c='Test002',Product2__c = prod08.Id); |
| | | insert proH; |
| | | Product2__c proF = new Product2__c(Name='TooMAJ-643R:水囊鞘管003',OT_CODE_Text__c='Test003',Product2__c = prod09.Id); |
| | | insert proF; |
| | | |
| | | |
| | | //订单 |
| | | Consumable_order__c order = new Consumable_order__c(); |
| | | order.Name = 'testMing'; |
| | | order.Order_status__c = '批准'; |
| | | order.RecordTypeid = System.Label.RT_ConOrder_Order; |
| | | order.Dealer_Info__c = myAccount1.id; |
| | | order.Inventory_date__c = Date.today(); |
| | | order.Order_type__c = '订单'; |
| | | order.Order_ProType__c = 'ET'; |
| | | insert order; |
| | | //到货 |
| | | Consumable_order__c order2 = new Consumable_order__c(); |
| | | order2.Name = 'testMing1'; |
| | | order2.Order_status__c = '批准'; |
| | | order2.RecordTypeid = '01210000000c9dqAAA'; |
| | | order2.Dealer_Info__c = myAccount1.id; |
| | | order2.Order_type__c = '到货'; |
| | | order2.Order_ProType__c = 'ET'; |
| | | insert order2; |
| | | |
| | | List<Consumable_order_details2__c> conList = new List<Consumable_order_details2__c>(); |
| | | //制作Consumable_order_details__c-------ProductCount |
| | | // 销售 |
| | | Consumable_order_details2__c dataForProductCount7 = new Consumable_order_details2__c(); |
| | | dataForProductCount7.Bar_Code__c = '123456789298k250AAAAA'; |
| | | dataForProductCount7.Sterilization_limit__c = Date.today().addDays(2); |
| | | dataForProductCount7.Arrive_date__c = Date.today(); |
| | | dataForProductCount7.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | dataForProductCount7.Consumable_Product__c = proH.id; |
| | | dataForProductCount7.Asset_Model_No__c = proH.Asset_Model_No__c; |
| | | dataForProductCount7.Box_Piece__c = '盒'; |
| | | dataForProductCount7.Used_date__c = Date.today(); |
| | | dataForProductCount7.Consumable_order_minor__c = order.id; |
| | | |
| | | conList.add(dataForProductCount7); |
| | | // 在库 过期 盒 |
| | | Consumable_order_details2__c dataForProduct = new Consumable_order_details2__c(); |
| | | dataForProduct.Bar_Code__c = '123456789498k250BBBBB'; |
| | | dataForProduct.Sterilization_limit__c = Date.today().addDays(-2); |
| | | dataForProduct.Arrive_date__c = Date.today(); |
| | | dataForProduct.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | dataForProduct.Consumable_Product__c = proF.id; |
| | | dataForProduct.Asset_Model_No__c = proF.Asset_Model_No__c; |
| | | dataForProduct.Box_Piece__c = '盒'; |
| | | dataForProduct.Consumable_order_minor__c = order.id; |
| | | |
| | | conList.add(dataForProduct); |
| | | // 在库 过期 个 |
| | | Consumable_order_details2__c dataForProductCount3 = new Consumable_order_details2__c(); |
| | | dataForProductCount3.Bar_Code__c = '123456788398k250CCCCC'; |
| | | dataForProductCount3.Sterilization_limit__c = Date.today().addDays(-2); |
| | | dataForProductCount3.Arrive_date__c = Date.today(); |
| | | dataForProductCount3.RecordTypeid = System.Label.RT_ConOrderDetail2_Delivery; |
| | | dataForProductCount3.Consumable_Product__c = proG.id; |
| | | dataForProductCount3.Asset_Model_No__c = proG.Asset_Model_No__c; |
| | | dataForProductCount3.Box_Piece__c = '个'; |
| | | dataForProductCount3.RemoveBox_No__c = 1; |
| | | dataForProductCount3.Consumable_order_minor__c = order.id; |
| | | conList.add(dataForProductCount3); |
| | | insert conList; |
| | | |
| | | //过期库存汇总信息 add by Wang Xueqin |
| | | List<Consumable_order_details2__c> conList1 = new List<Consumable_order_details2__c>(); |
| | | Consumable_order_details2__c dataForProductCount4 = new Consumable_order_details2__c(); |
| | | dataForProductCount4.Bar_Code__c = '1001'; |
| | | dataForProductCount4.Arrive_date__c = Date.today(); |
| | | dataForProductCount4.Send_Date__c = null; |
| | | dataForProductCount4.Used_date__c = null; |
| | | dataForProductCount4.Return_date__c = null; |
| | | dataForProductCount4.Lose_Flag__c = false; |
| | | dataForProductCount4.Cancellation_Flag__c = false; |
| | | dataForProductCount4.Consumable_Product__c = proG.Id; |
| | | dataForProductCount4.Consumable_Arrived_order__c = order2.id; |
| | | dataForProductCount4.Used_account__c = myAccount1.Id; |
| | | dataForProductCount4.Sterilization_limit__c = Date.today().addDays(-2); |
| | | dataForProductCount4.Box_Piece__c = '盒'; |
| | | conList1.add(dataForProductCount4); |
| | | System.debug('conList1==>'+conList1); |
| | | //查询所有过期库存 |
| | | Consumable_order_details2__c dataForProductCount5 = new Consumable_order_details2__c(); |
| | | dataForProductCount5.Bar_Code__c = '1002'; |
| | | dataForProductCount5.Arrive_date__c = Date.today(); |
| | | dataForProductCount5.Send_Date__c = Date.today(); |
| | | dataForProductCount5.Used_date__c = Date.today(); |
| | | dataForProductCount5.Return_date__c = null; |
| | | dataForProductCount5.Lose_Flag__c = false; |
| | | dataForProductCount5.Cancellation_Flag__c = false; |
| | | dataForProductCount5.Consumable_Product__c = proG.Id; |
| | | dataForProductCount5.Consumable_Arrived_order__c = order2.id; |
| | | dataForProductCount5.Used_account__c = myAccount1.Id; |
| | | dataForProductCount5.Sterilization_limit__c = Date.today().addDays(-2); |
| | | dataForProductCount5.Box_Piece__c = '盒'; |
| | | conList1.add(dataForProductCount5); |
| | | insert conList1; |
| | | >>>>>>> LEXCommunityLiJun |
| | | Test.startTest(); |
| | | LexConsumableGoodsInfo.initMoreThan7(dataForProductCount7.Id); |
| | | LexConsumableGoodsInfo.initMoreThan7All('all'); |
| | |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest2() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest2(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | Order_ProType__c = 'ET' |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1, Order2 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | Consumable_order__c Order2 = new Consumable_order__c( |
| | | Name='OCM_01_002', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[] {Order1, Order2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | createDetail1.name = 'Too002'; |
| | | createDetail1.Consumable_Product__c = pro2.id; |
| | | <<<<<<< HEAD |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | ======= |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail1.Dealer_Custom_Price__c = 999.00; |
| | | createDetail1.Consumable_count__c = 4; |
| | | createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail1; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001002', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | //Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001004', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | LexConsumableGoodsInfo.initMoreThan7(Orderdet1.Id); |
| | | LexConsumableGoodsInfo.initMoreThan7All('all'); |
| | |
| | | LexConsumableGoodsInfo.initDeliveryDetAll('all'); |
| | | LexConsumableGoodsInfo.initTotalNum('1', 'all'); |
| | | LexConsumableGoodsInfo.initTotalNum(Orderdet1.Id, 'all'); |
| | | <<<<<<< HEAD |
| | | ======= |
| | | |
| | | >>>>>>> LEXCommunityLiJun |
| | | } |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest3() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest3(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | Order_ProType__c = 'ET' |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1, Order2 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | Consumable_order__c Order2 = new Consumable_order__c( |
| | | Name='OCM_01_002', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[] {Order1, Order2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | createDetail1.name = 'Too002'; |
| | | createDetail1.Consumable_Product__c = pro2.id; |
| | | <<<<<<< HEAD |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | ======= |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail1.Dealer_Custom_Price__c = 999.00; |
| | | createDetail1.Consumable_count__c = 4; |
| | | createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail1; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001002', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | //Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001004', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | LexConsumableGoodsInfo.initMoreThan7(Orderdet2.Id); |
| | | LexConsumableGoodsInfo.initMoreThan7All(''); |
| | |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest4() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest4(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | Order_ProType__c = 'ET' |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1, Order2 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | Consumable_order__c Order2 = new Consumable_order__c( |
| | | Name='OCM_01_002', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[] {Order1, Order2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | createDetail1.name = 'Too002'; |
| | | createDetail1.Consumable_Product__c = pro2.id; |
| | | <<<<<<< HEAD |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | ======= |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail1.Dealer_Custom_Price__c = 999.00; |
| | | createDetail1.Consumable_count__c = 4; |
| | | createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail1; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001002', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | //Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001004', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | LexConsumableGoodsInfo.initMoreThan7(Orderdet3.Id); |
| | | LexConsumableGoodsInfo.initNotArrDet(Orderdet3.Id); |
| | |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest5() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest5(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | Order_ProType__c = 'ET' |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1, Order2 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | Consumable_order__c Order2 = new Consumable_order__c( |
| | | Name='OCM_01_002', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c=myAccount1.Id, |
| | | Order_ProType__c = 'ET'); |
| | | insert new Consumable_order__c[] {Order1, Order2}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | Consumable_orderdetails__c createDetail1 = new Consumable_orderdetails__c(); |
| | | createDetail1.name = 'Too002'; |
| | | createDetail1.Consumable_Product__c = pro2.id; |
| | | <<<<<<< HEAD |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | ======= |
| | | createDetail1.Consumable_order__c = Order2.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail1.Dealer_Custom_Price__c = 999.00; |
| | | createDetail1.Consumable_count__c = 4; |
| | | createDetail1.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail1; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet2, Orderdet3, Orderdet4 }; |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet2 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001002', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | //Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | Consumable_order_details2__c Orderdet4 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001004', |
| | | Consumable_order_minor__c = Order2.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro2.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet2, Orderdet3, Orderdet4}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | LexConsumableGoodsInfo.initMoreThan7(Orderdet4.Id); |
| | | LexConsumableGoodsInfo.initNotArrDet(Orderdet4.Id); |
| | |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest6() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest6(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | LexConsumableGoodsInfo.ShowRecords sr = new LexConsumableGoodsInfo.ShowRecords(); |
| | | sr.prodModel = 'test'; |
| | | sr.recordCount = 1; |
| | |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest7() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest7(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | showFalseNotshowTrue__c = false |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京', |
| | | UserPro_Type__c = 'ET'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c = myAccount1.Id, |
| | | Delivery_detail_count__c = 1, |
| | | Order_ProType__c = 'ET', |
| | | showFalseNotshowTrue__c = false); |
| | | insert new Consumable_order__c[] {Order1}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | >>>>>>> LEXCommunityLiJun |
| | | Asset_Model_No__c = 'Test01', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery, |
| | | <<<<<<< HEAD |
| | | Cancellation_Flag__c = false |
| | | ); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001003', |
| | | ======= |
| | | Cancellation_Flag__c = false); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | >>>>>>> LEXCommunityLiJun |
| | | Asset_Model_No__c = 'Test01', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery, |
| | | <<<<<<< HEAD |
| | | Cancellation_Flag__c = false |
| | | ); |
| | | insert new List<Consumable_order_details2__c>{ Orderdet1, Orderdet3 }; |
| | | ======= |
| | | Cancellation_Flag__c = false); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet3}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | LexConsumableGoodsInfo.initNotArrDet(Order1.Id); |
| | | LexConsumableGoodsInfo.initNotArrDetAll('all'); |
| | | } |
| | | } |
| | | |
| | | @IsTest |
| | | <<<<<<< HEAD |
| | | static void lexConsumableGoodsInfoTest8() { |
| | | ======= |
| | | static void lexConsumableGoodsInfoTest8(){ |
| | | >>>>>>> LEXCommunityLiJun |
| | | User myUser_test = new User(); |
| | | Account myAccount1; |
| | | Contact core; |
| | | User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; |
| | | <<<<<<< HEAD |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay', IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser) { |
| | |
| | | showFalseNotshowTrue__c = false |
| | | ); |
| | | insert new List<Consumable_order__c>{ Order1 }; |
| | | ======= |
| | | NoteStay__c n = new NoteStay__c(Name = 'NoteStay',IsStay__c = true); |
| | | insert n; |
| | | System.runAs(currentUser){ |
| | | Profile prof = [select Id from Profile where Name ='901_经销商社区普通权限_2重验证(ET)']; |
| | | List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店']; |
| | | if (rectCo.size() == 0) { |
| | | return; |
| | | } |
| | | myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id ,AgentCode_Ext__c = '9999900'); |
| | | insert myAccount1; |
| | | core = new Contact(email='jplumber@salesforce.com', |
| | | firstname='Joe', |
| | | lastname='Plumber', |
| | | accountid=myAccount1.id); |
| | | insert core; |
| | | myUser_test = New User( |
| | | ContactId = core.id, |
| | | Alias = 'newUser', |
| | | Email='newuser@testorg.com', |
| | | EmailEncodingKey='UTF-8', |
| | | LastName='testUser', |
| | | LanguageLocaleKey='zh_CN', |
| | | LocaleSidKey='zh_CN', |
| | | ProfileId = prof.Id, |
| | | TimeZoneSidKey='Asia/Shanghai', |
| | | UserName='testUser@testorg.com', |
| | | Work_Location__c='北京', |
| | | UserPro_Type__c = 'ET'); |
| | | insert myUser_test; |
| | | } |
| | | System.runAs(myUser_test){ |
| | | Product2 prod01 = new Product2(Name='Test01',ProductCode='Test01',Asset_Model_No__c = 'Test01',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | Product2 prod02 = new Product2(Name='Test02',ProductCode='Test02',Asset_Model_No__c = 'Test02',SFDA_Status__c = '有効',Manual_Entry__c = false); |
| | | insert new Product2[]{prod01,prod02}; |
| | | Product2__c pro1 = new Product2__c(Name='Pro001',OT_CODE_Text__c='Test001',Product2__c = prod01.Id); |
| | | Product2__c pro2 = new Product2__c(Name='Pro002',OT_CODE_Text__c='Test002',Product2__c = prod02.Id); |
| | | insert new Product2__c[] {pro1, pro2}; |
| | | //订单 |
| | | Consumable_order__c Order1 = new Consumable_order__c( |
| | | Name='OCM_01_001', |
| | | RecordTypeId = System.Label.RT_ConOrder_Delivery, |
| | | Order_type__c ='订单', |
| | | Dealer_info__c = myAccount1.Id, |
| | | Delivery_detail_count__c = 1, |
| | | Order_ProType__c = 'ET', |
| | | showFalseNotshowTrue__c = false); |
| | | insert new Consumable_order__c[] {Order1}; |
| | | >>>>>>> LEXCommunityLiJun |
| | | |
| | | //明细1 |
| | | Consumable_orderdetails__c createDetail = new Consumable_orderdetails__c(); |
| | |
| | | createDetail.Consumable_Product__c = pro1.id; |
| | | createDetail.Dealer_Custom_Price__c = 999.00; |
| | | createDetail.Consumable_count__c = 3; |
| | | <<<<<<< HEAD |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | ======= |
| | | createDetail.Consumable_order__c = Order1.id; |
| | | >>>>>>> LEXCommunityLiJun |
| | | createDetail.RecordTypeid = System.Label.RT_ConOrderDetail1_Order; |
| | | insert createDetail; |
| | | |
| | | //订单明细 |
| | | <<<<<<< HEAD |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name = 'OCM_01_001001', |
| | | ======= |
| | | Consumable_order_details2__c Orderdet1 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001001', |
| | | >>>>>>> LEXCommunityLiJun |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Arrive_date__c = Date.today(), |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery, |
| | | <<<<<<< HEAD |
| | | Cancellation_Flag__c = false |
| | | ); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | |
| | | } |
| | | } |
| | | } |
| | | ======= |
| | | Cancellation_Flag__c = false); |
| | | Consumable_order_details2__c Orderdet3 = new Consumable_order_details2__c( |
| | | Name='OCM_01_001003', |
| | | Consumable_order_minor__c = Order1.Id, |
| | | Consumable_Product__c = pro1.id, |
| | | RecordTypeId = System.Label.RT_ConOrderDetail2_Delivery, |
| | | Cancellation_Flag__c = false); |
| | | insert new Consumable_order_details2__c[] {Orderdet1, Orderdet3}; |
| | | LexConsumableGoodsInfo.initNotArrDetAll('all'); |
| | | } |
| | | } |
| | | } |
| | | >>>>>>> LEXCommunityLiJun |
| force-app/main/default/classes/LexConsumableGoodsInfoTest.cls-meta.xml
force-app/main/default/classes/LexConsumableOrderManageController.cls
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls
force-app/main/default/classes/LexConsumableOrderManageControllerTest.cls-meta.xml
force-app/main/default/classes/LexInventoryController.cls
force-app/main/default/classes/LexInventoryControllerTest.cls
force-app/main/default/classes/LexInventoryControllerTest.cls-meta.xml
force-app/main/default/classes/LexInventoryListController.cls
force-app/main/default/classes/LexInventoryListControllerTest.cls
force-app/main/default/classes/LexInventoryListControllerTest.cls-meta.xml
force-app/main/default/classes/LexInventoryViewControllerTest.cls
force-app/main/default/classes/LexInventoryViewControllerTest.cls-meta.xml
force-app/main/default/classes/LexLicenceReminderControllerTest.cls
force-app/main/default/classes/LexLicenceReminderControllerTest.cls-meta.xml
force-app/main/default/classes/LexOutboundorderImportController.cls
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls
force-app/main/default/classes/LexOutboundorderImportControllerTest.cls-meta.xml
force-app/main/default/classes/LexOverdueStockController.cls
force-app/main/default/classes/LexOverdueStockControllerTest.cls
force-app/main/default/classes/LexOverdueStockControllerTest.cls-meta.xml
force-app/main/default/classes/LexProductLimitEditControllerTest.cls
force-app/main/default/classes/LexProductLimitEditControllerTest.cls-meta.xml
force-app/main/default/classes/LexRemoveBoxControllerTest.cls
force-app/main/default/classes/LexRemoveBoxControllerTest.cls-meta.xml
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls
force-app/main/default/classes/LexSaleAndDeliveryControllerTest.cls-meta.xml
force-app/main/default/classes/LexSaleOrderController.cls
force-app/main/default/classes/LexSaleOrderControllerTest.cls
force-app/main/default/classes/LexSaleOrderControllerTest.cls-meta.xml
force-app/main/default/classes/LexSearchContractControllerTest.cls
force-app/main/default/classes/LexSearchContractControllerTest.cls-meta.xml
force-app/main/default/classes/LexSearchHospitalControllerTest.cls
force-app/main/default/classes/LexSearchHospitalControllerTest.cls-meta.xml
force-app/main/default/classes/LexSummonsCreatController.cls
force-app/main/default/classes/LexSummonsCreatControllerTest.cls
force-app/main/default/classes/LexSummonsCreatControllerTest.cls-meta.xml
force-app/main/default/classes/LexTopPageControllerTest.cls
force-app/main/default/classes/LexTopPageControllerTest.cls-meta.xml
force-app/main/default/classes/LexUpAccountProLimit.cls
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls
force-app/main/default/classes/LexUpAccountProLimitControllerTest.cls-meta.xml
force-app/main/default/classes/LexUtilityTest.cls
force-app/main/default/classes/LexUtilityTest.cls-meta.xml
force-app/main/default/classes/LookupSearchResultTest.cls
force-app/main/default/classes/LookupSearchResultTest.cls-meta.xml
force-app/main/default/classes/ResponseBodyLWCTest.cls
force-app/main/default/classes/ResponseBodyLWCTest.cls-meta.xml
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls
force-app/main/default/classes/lexSearchAgencyHospitalControllerTest.cls-meta.xml
force-app/main/default/contentassets/OlympusCommunityLoginBG.asset-meta.xml
force-app/main/default/contentassets/OlympusCommunityLogo.asset-meta.xml
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.html
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js
force-app/main/default/lwc/customAccountUrlComp/customAccountUrlComp.js-meta.xml
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.html
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js
force-app/main/default/lwc/customDeleteReasonComp/customDeleteReasonComp.js-meta.xml
force-app/main/default/lwc/customMydrComp/customMydrComp.html
force-app/main/default/lwc/customMydrComp/customMydrComp.js
force-app/main/default/lwc/customMydrComp/customMydrComp.js-meta.xml
force-app/main/default/lwc/customOutputGood/customOutputGood.html
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.html
force-app/main/default/lwc/lexArriveGoods/lexArriveGoods.js
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.html
force-app/main/default/lwc/lexArriveGoodsMain/lexArriveGoodsMain.js
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.html
force-app/main/default/lwc/lexConInvoiceView/lexConInvoiceView.js
force-app/main/default/lwc/lexConsumable/lexConsumable.html
force-app/main/default/lwc/lexConsumable/lexConsumable.js
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.html
force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
force-app/main/default/lwc/lexCustomInventoryColor/lexCustomInventoryColor.html
force-app/main/default/lwc/lexInventory/lexInventory.html
force-app/main/default/lwc/lexInventory/lexInventory.js
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.html
force-app/main/default/lwc/lexSaleAndDelivery/lexSaleAndDelivery.js
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.css
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.html
force-app/main/default/lwc/lexSummonsCreat/lexSummonsCreat.js
force-app/main/default/lwc/lexTopPage/lexTopPage.html
force-app/main/default/lwc/lexTopPage/lexTopPage.js
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.html
force-app/main/default/lwc/lexinventoryViewLWC/lexinventoryViewLWC.js
force-app/main/default/lwc/paginator/paginator.html
force-app/main/default/lwc/paginator/paginator.js
force-app/main/default/pages/DealerInquiryModifyState.page
force-app/main/default/pages/DealerInquiryModifyState.page-meta.xml
force-app/main/default/permissionsets/Community_Consumable_LEX_PS.permissionset-meta.xml
force-app/main/default/reports/Store_Custom_ReportLink/X2_Lky.report-meta.xml
force-app/main/default/reports/Store_Custom_ReportLink/new_report_0iF.report-meta.xml
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger
force-app/main/default/triggers/ConsumableOrderDetail2Trigger.trigger-meta.xml
force-app/main/default/triggers/ContentDocumentLink.trigger
force-app/main/default/triggers/ContentDocumentTrigger.trigger
manifest/LEXC02packagelexcommunityupdate.xml
manifest/LEXC03report2.xml
manifest/packageForLex copy.xml |