From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/OpportunityPCLController2.cls | 1099 +++++++++++++++++++++++++++++++++------------------------
1 files changed, 634 insertions(+), 465 deletions(-)
diff --git a/force-app/main/default/classes/OpportunityPCLController2.cls b/force-app/main/default/classes/OpportunityPCLController2.cls
index b24853e..aed7c5b 100644
--- a/force-app/main/default/classes/OpportunityPCLController2.cls
+++ b/force-app/main/default/classes/OpportunityPCLController2.cls
@@ -2,14 +2,14 @@
public List<OppInfo> oppRecords { get; set; }
// 銉氥兗銈搞儸銈ゃ偄銈︺儓銇儏鍫便倰鍙栧緱
private Map<String, String> DESC_RW = null;
-
+
/*****************妞滅储鐢�******************/
public Contact con1 { get; set; }
public Contact con2 { get; set; }
-
+
public String accSearch { get; set; }
public String ownerSearch { get; set; }
-
+
public List<SelectOption> dateOpts { get; private set; }
public List<SelectOption> textOpts { get; private set; }
public List<SelectOption> equalOpts { get; private set; }
@@ -18,32 +18,32 @@
public List<SelectOption> textOpts3 { get; private set; }
public List<SelectOption> equalOpts3 { get; private set; }
public List<SelectOption> limitOpts { get; private set; }
-
+
public String dateField { get; set; }
-
+
public String text { get; set; }
public String condition { get; set; }
public String value { get; set; }
-
+
public String text2 { get; set; }
public String condition2 { get; set; }
public String value2 { get; set; }
-
+
public String text3 { get; set; }
public String condition3 { get; set; }
public String value3 { get; set; }
-
+
// TODO xudan 20140626 銉併偋銉冦偗锛氳浠枫�佹湭銉併偋銉冦偗锛氬叏閮紙寰岃棨瑕佹湜锛�
public Boolean onlyOpp { get; set; }
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm start
public Boolean OpptyWait { get; set; }
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
public String limits { get; set; }
-
+
/*****************鐢婚潰琛ㄧずBean******************/
public Integer oppCount { get; set; }
public String saveType { get; set; }
-
+
/*****************銈姐兗銉堛偔銉�******************/
public String sortKey { get; set; }
public String preSortKey { get; set; }
@@ -51,7 +51,7 @@
public String[] sortOrder { get; set; }
public String[] columus = new String[] {'Id'};
public Set<String> columusSet = new Set<String> {'Id'};
-
+
// 椤圭洰set 瀛楁鏍囩
public List<String> titleLeft { get; private set; }
public List<String> titleRight { get; private set; }
@@ -60,6 +60,11 @@
public List<List<String> > columnsRightApi { get; private set; } // 鍙傜収闋呯洰鐢�
public List<String> columnLeftCss { get; private set; } // css 鐢�
public List<String> columnRightCss { get; private set; } // css 鐢�
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� fy start
+ public List<String> columnRightCsscopy { get; private set; }
+ public List<String> titleRightcopy { get; private set; }
+ public List<List<String> > columnsRightApicopy { get; private set; }
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� fy end
public Map<String, String> columnLeftRW { get; private set; } // r,w,wm鐢�
public Map<String, String> columnRightRW { get; private set; } // r,w,wm鐢�
public List<String> columnMark { get; private set; } // Mark鐢�
@@ -67,9 +72,9 @@
private String strColumusForMoney; // 閲戦闆嗚▓soql鐢ㄩ爡鐩�
public Map<String, Decimal> columnMoneyMap { get; private set; }
public Map<String, Boolean> columnMoneyFlgMap { get; private set; }
-
+
public Integer ratingStartIdx { get; private set; } // Rating琛ㄧず銉┿儥銉伄闁嬪Idx
-
+
/*****************銈姐兗銉堟檪鍐嶆绱㈡潯浠讹紙鐢婚潰銇嬨倝銇叆鍔涙潯浠躲倰鐒¤銇欍倠銇熴倎锛�******************/
private String hpForSort = null;
private String ownerForSort = null;
@@ -92,16 +97,18 @@
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
private static Integer oppLimit = 1000;
private Boolean isForMoneyFlg = false;
-
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� fy start
+ public Boolean HideForecastOCSMflag { get; set; }
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� fy end
public OpportunityPCLController2() {
//Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
DESC_RW = SoapApi.getEditLayoutItemRW('Opportunity', new String[] {'01210000000QekKAAS'}).get('01210000000QekKAAS');
oppRecords = new List<OppInfo>();
-
+
// 鏃ヤ粯妞滅储鏉′欢銇瓹alendar鐢�
con1 = new Contact();
con2 = new Contact();
-
+
dateOpts = new List<SelectOption>();
dateOpts.add(new SelectOption('', '--鏃�--'));
dateOpts.add(new SelectOption('Bid_Planned_Date__c', '棰勬祴鎷涙爣鏃�'));
@@ -111,13 +118,13 @@
dateOpts.add(new SelectOption(' TenderBeginDate__c', '鎷涙爣鏃ワ紙鎷涙爣椤圭洰锛�'));
dateOpts.add(new SelectOption('Closing_Bid_Date_Bid__c', '涓爣鏃ワ紙鎷涙姇鏍囷級'));
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
- dateOpts.add(new SelectOption('Close_Forecasted_Date__c', '棰勬祴OCSM绛剧害鏃�'));
-
+ dateOpts.add(new SelectOption('Close_Forecasted_Date__c', '棰勬祴OCSM绛剧害鏃�(KPI)')); //20220506 lt update
+
//SWAG-C9NC23 銆愬鎵樸�慬閲嶈锛屼紭鍏堬紒]鍛ㄤ細璇环绠$悊琛ㄤ慨鏀� lt 20211217 start
dateOpts.add(new SelectOption('Close_Forecasted_Assume_Date__c', '棰勬祴OCSM绛剧害鏃�(鎷呭綋)'));
//SWAG-C9NC23 銆愬鎵樸�慬閲嶈锛屼紭鍏堬紒]鍛ㄤ細璇环绠$悊琛ㄤ慨鏀� lt 20211217 end
-
- dateOpts.add(new SelectOption('CloseDate', '棰勬祴鍙戣揣鏃�'));
+
+ dateOpts.add(new SelectOption('CloseDate', '棰勬祴鍙戣揣鏃�')); //20220506 lt update
dateOpts.add( new SelectOption('Created_Day__c', '鍒涘缓鏃�'));
dateOpts.add(new SelectOption('Last_Follow_Up_Date__c', '鏈�鍚庤窡杩涙棩'));//***********************
// 鏃ヤ粯妞滅储銇婧栥伄LastModifiedDate锛堟棩鏅傞爡鐩級銇娇銇堛仾銇勩�佹暟寮忛爡鐩倰鍒╃敤
@@ -138,17 +145,27 @@
dateOpts.add( new SelectOption('Situation_last_update_day__c', '鏈�鍚庢洿鏂版棩-璇环璺熻繘鎯呭喌'));
dateOpts.add( new SelectOption('Manager_feedback_last_update__c', '鏈�鍚庢洿鏂版棩-缁忕悊鍙嶉'));
dateOpts.add( new SelectOption('Follow_up_plan_last_update__c', '鏈�鍚庢洿鏂版棩-鎺ㄨ繘璁″垝'));
-
+ //杩涘彛璁鸿瘉 fy start
+ dateOpts.add( new SelectOption('ImportDemonstration_Filing_date__c', '杩涘彛璁鸿瘉鐢宠鏃�'));
+ dateOpts.add( new SelectOption('ImportDemonstration_Approval_date__c', '杩涘彛璁鸿瘉鎵瑰噯鏃�'));
+ dateOpts.add( new SelectOption('ImportDemonstration_Rejection_date__c', '杩涘彛璁鸿瘉椹冲洖鏃�'));
+ //杩涘彛璁鸿瘉 fy end
+
textOpts = new List<SelectOption>();
textOpts.add(new SelectOption('','--鏃�--'));
textOpts.add(new SelectOption('S:Name','璇环鍚嶇О'));
textOpts.add(new SelectOption('S:Opportunity_No__c',Schema.SObjectType.Opportunity.fields.Opportunity_No__c.label));
textOpts.add(new SelectOption('S:HP_Name__c','鍖婚櫌鍚�'));
+ textOpts.add(new SelectOption('S:Owner_Category__c','璇�'));// 20220907 XLIU-CHY4JL you
+
// TODO xudan 20140626 鐘舵��1銈掋儊銈с儍銈儨銉冦偗銈广伀銆併亾銇撹銈夈仾銇勶紵
textOpts.add(new SelectOption('S:Owner.Salesdepartment__c','鏈儴'));
textOpts.add(new SelectOption('S:Owner.Province__c','鐪�'));
textOpts.add(new SelectOption('S:Owner.Group__c','缁�'));
textOpts.add(new SelectOption('S:StageName__c','鐘舵��1'));
+ //DB202211286315 銆愬懆浼�-璇环绠$悊琛ㄣ�戠瓫閫夐」澧炲姞鈥滅姸鎬�2鈥� xxf 20221115 start
+ textOpts.add(new SelectOption('S:Status_Formula__c','鐘舵��2'));
+ //DB202211286315 銆愬懆浼�-璇环绠$悊琛ㄣ�戠瓫閫夐」澧炲姞鈥滅姸鎬�2鈥� xxf 20221115 end
textOpts.add(new SelectOption('S:Owner.Name','鎷呭綋浜�'));
textOpts.add(new SelectOption('S:OCM__c','OCSM鍒嗙被'));
textOpts.add(new SelectOption('S:Department_Name__c','绉戝鍚�'));
@@ -161,6 +178,12 @@
textOpts.add(new SelectOption('S:Competitor__c','璇环绛夌骇'));
//textOpts.add(new SelectOption('S:OPD_SIS_collect_evaluation_sight__r.Name',Schema.SObjectType.Opportunity.fields.OPD_SIS_collect_evaluation_sight__c.label));
textOpts.add(new SelectOption('S:Forecast_this_month__c','鏈湀棰勬祴'));
+ //DB202211121149 銆愬懆浼�-璇环绠$悊銆戝懆浼氳浠疯〃鎶娾�滆祫閲戞潵婧愨�濇坊鍔犲埌鈥滄暟鎹瓧娈碘�濅腑杩涜绛涢�� xxf 20221109 start
+ textOpts.add(new SelectOption('S:Fund_Basis__c','璧勯噾鏉ユ簮'));
+ //DB202211121149 銆愬懆浼�-璇环绠$悊銆戝懆浼氳浠疯〃鎶娾�滆祫閲戞潵婧愨�濇坊鍔犲埌鈥滄暟鎹瓧娈碘�濅腑杩涜绛涢�� xxf 20221109 end
+ //杩涘彛璁鸿瘉 fy start
+ textOpts.add(new SelectOption('t:if_NeedImportDemonstration__c','闇�瑕佽繘鍙h璇�'));
+ //杩涘彛璁鸿瘉 fy end
//textOpts.add(new SelectOption('N:Lapsed_Days__c',Schema.SObjectType.Opportunity.fields.Lapsed_Days__c.label));
//textOpts.add(new SelectOption('S:Rating01__c','1鏈堟湯璇环鐘舵��'));
//textOpts.add(new SelectOption('S:Rating02__c','2鏈堟湯璇环鐘舵��'));
@@ -174,10 +197,10 @@
//textOpts.add(new SelectOption('S:Rating10__c','10鏈堟湯璇环鐘舵��'));
//textOpts.add(new SelectOption('S:Rating11__c','11鏈堟湯璇环鐘舵��'));
//textOpts.add(new SelectOption('S:Rating12__c','12鏈堟湯璇环鐘舵��'));
-
+
textOpts2 = textOpts;
textOpts3 = textOpts;
-
+
equalOpts = new List<SelectOption>();
equalOpts.add(new SelectOption('equals','绛変簬'));
equalOpts.add(new SelectOption('notequals','涓嶇瓑浜�'));
@@ -188,10 +211,10 @@
equalOpts.add(new SelectOption('contains','鍖呭惈'));
equalOpts.add(new SelectOption('notcontains','涓嶅寘鍚�'));
equalOpts.add(new SelectOption('starts with','璧峰瀛楃'));
-
+
equalOpts2 = equalOpts;
equalOpts3 = equalOpts;
-
+
limitOpts = new List<SelectOption>();
limitOpts.add(new SelectOption('20','20'));
limitOpts.add(new SelectOption('50','50'));
@@ -199,42 +222,57 @@
limitOpts.add(new SelectOption('200','200'));
limitOpts.add(new SelectOption('500','500'));
limitOpts.add(new SelectOption('' + (oppLimit + 1), '鍏ㄩ儴'));
-
+
limits = '50';
-
+
ratingStartIdx = -1;
}
-
+
public PageReference init() {
+ System.debug('lt123 --- init start --- : ' + System.currentTimeMillis());
// xudan 20140626 鐘舵��1銈掋儊銈с儍銈儨銉冦偗銈广伀
onlyOpp = true;
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm start
OpptyWait = false;
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
//20140822銆�杩藉姞 by katsu start
+ System.debug('lt123 --- 鏌ser寮�濮� --- : ' + System.currentTimeMillis());
String uidParam = System.currentPageReference().getParameters().get('uid');
if (uidParam != null) {
- User u = [select Id, FirstName, LastName from User where Id = :uidParam];
- ownerSearch = u.LastName + ' ' + u.FirstName;
+ User u = [select Id, FirstName, LastName from User where Id = :uidParam];
+ ownerSearch = u.LastName + ' ' + u.FirstName;
}
+ System.debug('lt123 --- 鏌ser缁撴潫 --- : ' + System.currentTimeMillis());
String hpidParam = System.currentPageReference().getParameters().get('hpid');
if(hpidParam != null) {
- List<Account> hpAcc = ControllerUtil.selectAccountForTrigger(new String[] {hpidParam});
- if (hpAcc.size() > 0) {
- accSearch = hpAcc[0].name;
- }
+ List<Account> hpAcc = ControllerUtil.selectAccountForTrigger(new String[] {hpidParam});
+ if (hpAcc.size() > 0) {
+ accSearch = hpAcc[0].name;
}
+ }
+ System.debug('lt123 --- 璋冪敤searchOppSetParam()鍓� --- : ' + System.currentTimeMillis());
//20140822銆�杩藉姞 by katsu end
-
+
searchOppSetParam();
+ System.debug('lt123 --- 璋冪敤searchOppSetParam()鍚�,setLayoutRWInfo()鍓� --- : ' + System.currentTimeMillis());
setLayoutRWInfo();
+ System.debug('lt123 --- 璋冪敤setLayoutRWInfo()鍚� --- : ' + System.currentTimeMillis());
this.sortOrderAsc = true;
this.sortOrder = new String[columus.size()];
for (Integer i = 0; i < columus.size(); i++) this.sortOrder[i] = '銆�';
+ System.debug('lt123 --- 璋冪敤searchOppInner()鍓� --- : ' + System.currentTimeMillis());
searchOppInner();
+ System.debug('lt123 --- 璋冪敤searchOppInner()鍚� --- : ' + System.currentTimeMillis());
+ System.debug('columnMoneyFlgMapvalue:'+columnMoneyFlgMap);
+ System.debug('columnMoneyMapvalue:'+columnMoneyMap);
+ System.debug('columnRightCss:'+columnRightCss);
+ columnRightCsscopy =columnRightCss;
+ titleRightcopy = titleRight;
+ columnsRightApicopy = columnsRightApi;
+ System.debug('lt123 --- init end --- : ' + System.currentTimeMillis());
return null;
}
-
+
private void searchOppSetParam() {
hpForSort = accSearch;
ownerForSort = ownerSearch;
@@ -256,401 +294,458 @@
OpptyWaitForSort=OpptyWait;
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
}
-
+
private void setLayoutRWInfo() {
if (this.sortOrder == null) {
-
- List<String> columnsForMoney = new List<String>();
- Set<String> currencyFields = new Set<String>();
-
- // 鑾峰緱椤圭洰set
- Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe().get('Opportunity').getDescribe().fieldSets.getMap();
-
- // 鍚堣▓閲戦瑷堢畻鐢�
- Schema.FieldSet fs = fsMap.get('Opportunity_PCL_Sum');
- List<FieldSetMember> fsmList = fs.getFields();
- columnMoneyMap = new Map<String, Decimal>();
- columnMoneyFlgMap = new Map<String, Boolean>();
- for (FieldSetMember fsm : fsmList) {
- columnMoneyMap.put(fsm.getFieldPath(), 0);
+
+ List<String> columnsForMoney = new List<String>();
+ Set<String> currencyFields = new Set<String>();
+
+ // 鑾峰緱椤圭洰set
+ Map<String, Schema.FieldSet> fsMap = Schema.getGlobalDescribe().get('Opportunity').getDescribe().fieldSets.getMap();
+
+ // 鍚堣▓閲戦瑷堢畻鐢�
+ Schema.FieldSet fs = fsMap.get('Opportunity_PCL_Sum');
+ List<FieldSetMember> fsmList = fs.getFields();
+ columnMoneyMap = new Map<String, Decimal>();
+ columnMoneyFlgMap = new Map<String, Boolean>();
+ for (FieldSetMember fsm : fsmList) {
+ columnMoneyMap.put(fsm.getFieldPath(), 0);
+ }
+
+ // 宸� 鍥哄畾
+ fs = fsMap.get('Opportunity_PCL_L');
+ // 鑾峰緱椤圭洰set涓殑鎵�鏈夐」鐩�
+ fsmList = fs.getFields();
+ // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
+ titleLeft = new List<String>();
+ List<String> columnLeft = new List<String>();
+
+ columnLeftCss = new List<String>();
+ columnLeftRW = new Map<String, String>();
+ columnsLeftApi = new List<List<String> >();
+ for (FieldSetMember fsm : fsmList) {
+ titleLeft.add(fsm.getLabel());
+ columnLeft.add(fsm.getFieldPath());
+ List<String> splitFieldPath = fsm.getFieldPath().split('\\.');
+ columnsLeftApi.add(splitFieldPath);
+
+ if (String.valueOf(fsm.getType()) == 'CURRENCY') {
+ currencyFields.add(fsm.getFieldPath());
}
-
- // 宸� 鍥哄畾
- fs = fsMap.get('Opportunity_PCL_L');
- // 鑾峰緱椤圭洰set涓殑鎵�鏈夐」鐩�
- fsmList = fs.getFields();
- // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
- titleLeft = new List<String>();
- List<String> columnLeft = new List<String>();
-
- columnLeftCss = new List<String>();
- columnLeftRW = new Map<String, String>();
- columnsLeftApi = new List<List<String> >();
- for (FieldSetMember fsm : fsmList) {
- titleLeft.add(fsm.getLabel());
- columnLeft.add(fsm.getFieldPath());
- List<String> splitFieldPath = fsm.getFieldPath().split('\\.');
- columnsLeftApi.add(splitFieldPath);
-
- if (String.valueOf(fsm.getType()) == 'CURRENCY') {
- currencyFields.add(fsm.getFieldPath());
- }
- system.debug('splitFieldPath绛変簬'+splitFieldPath.size());
- if (DESC_RW == null) {
- columnLeftRW.put(fsm.getFieldPath(), 'r');
- } else if (splitFieldPath.size() == 1) {
- String rw = DESC_RW.get(fsm.getFieldPath());
- if (rw != null) {
- columnLeftRW.put(fsm.getFieldPath(), rw);
- } else {
- columnLeftRW.put(fsm.getFieldPath(), 'r');
- }
- } else {
- columnLeftRW.put(fsm.getFieldPath(), 'r');
- }
+ system.debug('splitFieldPath绛変簬'+splitFieldPath.size());
+ if (DESC_RW == null) {
+ columnLeftRW.put(fsm.getFieldPath(), 'r');
+ } else if (splitFieldPath.size() == 1) {
+ String rw = DESC_RW.get(fsm.getFieldPath());
+ if (rw != null) {
+ columnLeftRW.put(fsm.getFieldPath(), rw);
+ } else {
+ columnLeftRW.put(fsm.getFieldPath(), 'r');
}
- for (String s : columnLeft) {
- if (columusSet.contains(s) == false) {
- columus.add(s);
- if (currencyFields.contains(s)) {
- columnsForMoney.add('convertCurrency(' + s + ')');
- } else {
- columnsForMoney.add(s);
- }
- columusSet.add(s);
- }
- if (columnMoneyMap.containsKey(s)) {
- columnMoneyFlgMap.put(s.replace('.','_'), true);
- } else {
- columnMoneyFlgMap.put(s.replace('.','_'), false);
- }
- columnLeftCss.add(s.replace('.','_'));
+ } else {
+ columnLeftRW.put(fsm.getFieldPath(), 'r');
}
- fs = fsMap.get('Opportunity_PCL');
- // 鑾峰緱椤圭洰set涓殑鎵�鏈夐」鐩�
- fsmList = fs.getFields();
- // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
- titleRight = new List<String>();
- List<String> tmpColRight = new List<String>();
-
- columnRightCss = new List<String>();
- columnRightRW = new Map<String, String>();
- columnsRightApi = new List<List<String> >();
-
- Integer cnt = 0;
- for (FieldSetMember fsm : fsmList) {
- titleRight.add(fsm.getLabel());
- List<String> splitFieldPath = fsm.getFieldPath().split('\\.');
- columnsRightApi.add(splitFieldPath);
-
- if (String.valueOf(fsm.getType()) == 'CURRENCY') {
- currencyFields.add(fsm.getFieldPath());
- }
- // 銆�1鏈堟湯銆嶃倰瑷畾銇椼仧銈夈��12銉舵湀鍒嗐倰瑷畾銇ㄨ銇仚
- // 瑷畾銇爢鐣倓銆佹瑺鐣仾銇┿倰鑰冩叜銇涖仛
- if (splitFieldPath.size() == 1 && splitFieldPath[0] == 'Rating01__c') {
- ratingStartIdx = cnt;
- }
-
- if (DESC_RW == null) {
- columnRightRW.put(fsm.getFieldPath(), 'r');
- } else if (splitFieldPath.size() == 1) {
- String rw = DESC_RW.get(fsm.getFieldPath());
- if (rw != null) {
- columnRightRW.put(fsm.getFieldPath(), rw);
- } else {
- columnRightRW.put(fsm.getFieldPath(), 'r');
- }
- } else {
- columnRightRW.put(fsm.getFieldPath(), 'r');
- }
-
- tmpColRight.add(fsm.getFieldPath());
- cnt++;
+ }
+ for (String s : columnLeft) {
+ if (columusSet.contains(s) == false) {
+ columus.add(s);
+ if (currencyFields.contains(s)) {
+ columnsForMoney.add('convertCurrency(' + s + ')');
+ } else {
+ columnsForMoney.add(s);
}
- for (String s : tmpColRight) {
- if (columusSet.contains(s) == false) {
- columus.add(s);
- if (currencyFields.contains(s)) {
- columnsForMoney.add('convertCurrency(' + s + ')');
- } else {
- columnsForMoney.add(s);
- }
- columusSet.add(s);
-
- }
- if (columnMoneyMap.containsKey(s)) {
- columnMoneyFlgMap.put(s.replace('.','_'), true);
- } else {
- columnMoneyFlgMap.put(s.replace('.','_'), false);
- }
- columnRightCss.add(s.replace('.','_'));
+ columusSet.add(s);
}
-
- for (Integer i = 0; i < columnRightCss.size(); i++) {
- system.debug('columnRightCsssize绛変簬'+columnRightCss.size());
- system.debug('ratingStartIdx绛変簬'+ratingStartIdx);
- if (i == ratingStartIdx) {
- // 12銉舵湀銇棫Css
- Map<Integer, String> oldCssMap = new Map<Integer, String>();
- // 12銉舵湀銇棫銉┿儥銉�
- Map<Integer, String> oldLabelMap = new Map<Integer, String>();
- for (Integer m = 1; m <= 12; m++) {
- oldCssMap.put(m, columnRightCss[i + m - 1]);
- oldLabelMap.put(m, titleRight[i + m - 1]);
- }
- // 12銉舵湀
- for (Integer m = 1; m <= 12; m++) {
- Integer newM = makeRatingLabel(m);
- // 銉┿儥銉�
- titleRight[i + m - 1] = oldLabelMap.get(newM);
- // CSS
- columnRightCss[i + m - 1] = oldCssMap.get(newM);
- // Read/Write
- columnRightRW.put(columnRightCss[i + m - 1], 'r');
- // API
- columnsRightApi[i + m - 1] = new String[] { makeRatingAPI(m, Date.today().month()) };
- columus[columnLeftCss.size() + 1 + i + m - 1] = makeRatingAPI(m, Date.today().month());
- }
- break;
- }
+ if (columnMoneyMap.containsKey(s)) {
+ columnMoneyFlgMap.put(s.replace('.','_'), true);
+ } else {
+ columnMoneyFlgMap.put(s.replace('.','_'), false);
}
-
- // 銈姐兗銉堢敤
- this.sortOrderAsc = true;
- this.sortOrder = new String[columus.size()];
- for (Integer i = 0; i < columus.size(); i++) this.sortOrder[i] = '銆�';
-
- // Mark
- fs = fsMap.get('Opportunity_PCL_Mark');
- // 鑾峰緱椤圭洰set涓殑鎵�鏈夐」鐩�
- fsmList = fs.getFields();
- columnMark = new List<String>();
- for (FieldSetMember fsm : fsmList) {
- columnMark.add(fsm.getFieldPath());
+ columnLeftCss.add(s.replace('.','_'));
+ }
+ fs = fsMap.get('Opportunity_PCL');
+ // 鑾峰緱椤圭洰set涓殑鎵�鏈夐」鐩�
+ fsmList = fs.getFields();
+ // 鑾峰緱瀛楁鏍囩鍜屽瓧娈靛悕
+ titleRight = new List<String>();
+ List<String> tmpColRight = new List<String>();
+
+ columnRightCss = new List<String>();
+ columnRightRW = new Map<String, String>();
+ columnsRightApi = new List<List<String> >();
+
+ Integer cnt = 0;
+ for (FieldSetMember fsm : fsmList) {
+ titleRight.add(fsm.getLabel());
+ List<String> splitFieldPath = fsm.getFieldPath().split('\\.');
+ columnsRightApi.add(splitFieldPath);
+
+ if (String.valueOf(fsm.getType()) == 'CURRENCY') {
+ currencyFields.add(fsm.getFieldPath());
}
- for (String s : columnMark) {
- if (columusSet.contains(s) == false) {
- columus.add(s);
- columusSet.add(s);
- }
+ // 銆�1鏈堟湯銆嶃倰瑷畾銇椼仧銈夈��12銉舵湀鍒嗐倰瑷畾銇ㄨ銇仚
+ // 瑷畾銇爢鐣倓銆佹瑺鐣仾銇┿倰鑰冩叜銇涖仛
+ System.debug('splitFieldPath:'+splitFieldPath);
+ System.debug('splitFieldPath[0]:'+splitFieldPath[0]);
+ if (splitFieldPath.size() == 1 && splitFieldPath[0] == 'Rating01__c') {
+ ratingStartIdx = cnt;
}
-
- strColumus = String.join(columus, ',');
- strColumusForMoney = String.join(columnsForMoney, ',');
- system.debug('=====strColumus:' + strColumus);
+
+ if (DESC_RW == null) {
+ columnRightRW.put(fsm.getFieldPath(), 'r');
+ } else if (splitFieldPath.size() == 1) {
+ String rw = DESC_RW.get(fsm.getFieldPath());
+ if (rw != null) {
+ columnRightRW.put(fsm.getFieldPath(), rw);
+ } else {
+ columnRightRW.put(fsm.getFieldPath(), 'r');
+ }
+ } else {
+ columnRightRW.put(fsm.getFieldPath(), 'r');
+ }
+ tmpColRight.add(fsm.getFieldPath());
+ cnt++;
+ }
+ //SWAG-CFN8JP 銆愬鎵樸�� 銆愬鎵樸�戙�怓Y23璇环鏀瑰杽銆�-璇环棰勬祴鏃堕棿鏀瑰杽 fy start
+ if(columnRightRW.containsKey('Close_Forecasted_Assume_Date__c')){
+ columnRightRW.put('Close_Forecasted_Assume_Date__c', 'r');
+ }
+ if(columnRightRW.containsKey('Close_Forecasted_Date__c')){
+ columnRightRW.put('Close_Forecasted_Date__c', 'r');
+ }
+ //SWAG-CFN8JP 銆愬鎵樸�� 銆愬鎵樸�戙�怓Y23璇环鏀瑰杽銆�-璇环棰勬祴鏃堕棿鏀瑰杽 fy end
+ for (String s : tmpColRight) {
+ if (columusSet.contains(s) == false) {
+ columus.add(s);
+ if (currencyFields.contains(s)) {
+ columnsForMoney.add('convertCurrency(' + s + ')');
+ } else {
+ columnsForMoney.add(s);
+ }
+ columusSet.add(s);
+
+ }
+ if (columnMoneyMap.containsKey(s)) {
+ columnMoneyFlgMap.put(s.replace('.','_'), true);
+ } else {
+ columnMoneyFlgMap.put(s.replace('.','_'), false);
+ }
+ columnRightCss.add(s.replace('.','_'));
+ }
+
+ for (Integer i = 0; i < columnRightCss.size(); i++) {
+ system.debug('columnRightCsssize绛変簬'+columnRightCss.size());
+ system.debug('ratingStartIdx绛変簬'+ratingStartIdx);
+ if (i == ratingStartIdx) {
+ // 12銉舵湀銇棫Css
+ Map<Integer, String> oldCssMap = new Map<Integer, String>();
+ // 12銉舵湀銇棫銉┿儥銉�
+ Map<Integer, String> oldLabelMap = new Map<Integer, String>();
+ for (Integer m = 1; m <= 12; m++) {
+ oldCssMap.put(m, columnRightCss[i + m - 1]);
+ oldLabelMap.put(m, titleRight[i + m - 1]);
+ }
+ // 12銉舵湀
+ for (Integer m = 1; m <= 12; m++) {
+ Integer newM = makeRatingLabel(m);
+ // 銉┿儥銉�
+ titleRight[i + m - 1] = oldLabelMap.get(newM);
+ // CSS
+ columnRightCss[i + m - 1] = oldCssMap.get(newM);
+ // Read/Write
+ columnRightRW.put(columnRightCss[i + m - 1], 'r');
+ // API
+ columnsRightApi[i + m - 1] = new String[] { makeRatingAPI(m, Date.today().month()) };
+ columus[columnLeftCss.size() + 1 + i + m - 1] = makeRatingAPI(m, Date.today().month());
+ }
+ break;
+ }
+ }
+
+ // 銈姐兗銉堢敤
+ this.sortOrderAsc = true;
+ this.sortOrder = new String[columus.size()];
+ for (Integer i = 0; i < columus.size(); i++) this.sortOrder[i] = '銆�';
+
+ // Mark
+ fs = fsMap.get('Opportunity_PCL_Mark');
+ // 鑾峰緱椤圭洰set涓殑鎵�鏈夐」鐩�
+ fsmList = fs.getFields();
+ columnMark = new List<String>();
+ for (FieldSetMember fsm : fsmList) {
+ columnMark.add(fsm.getFieldPath());
+ }
+ for (String s : columnMark) {
+ if (columusSet.contains(s) == false) {
+ columus.add(s);
+ columusSet.add(s);
+ }
+ }
+
+ strColumus = String.join(columus, ',');
+ strColumusForMoney = String.join(columnsForMoney, ',');
+ system.debug('=====strColumus:' + strColumus);
}
}
-
+
private void searchOppInner() {
oppRecords = new List<OppInfo>();
-
+
String soql = this.makeSoql(false, hpForSort, ownerForSort,
- datefieldForSort, fromdForSort, todForSort, textForSort, conditionForSort, valueForSort,
- textForSort2, conditionForSort2, valueForSort2,
- textForSort3, conditionForSort3, valueForSort3,OpptyWaitForSort);
+ datefieldForSort, fromdForSort, todForSort, textForSort, conditionForSort, valueForSort,
+ textForSort2, conditionForSort2, valueForSort2,
+ textForSort3, conditionForSort3, valueForSort3,OpptyWaitForSort);
if (String.isBlank(this.sortKey)) {
- soql += ' order by LastModifiedDate desc limit ' + Integer.valueOf(limits);
+ soql += ' order by LastModifiedDate desc limit ' + Integer.valueOf(limits);
} else {
- soql += ' order by ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits);
+ soql += ' order by ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last') + ' limit ' + Integer.valueOf(limits);
}
-
+
String soqlForMoney = this.makeSoql(true, hpForSort, ownerForSort,
- datefieldForSort, fromdForSort, todForSort, textForSort, conditionForSort, valueForSort,
- textForSort2, conditionForSort2, valueForSort2,
- textForSort3, conditionForSort3, valueForSort3,OpptyWaitForSort);
+ datefieldForSort, fromdForSort, todForSort, textForSort, conditionForSort, valueForSort,
+ textForSort2, conditionForSort2, valueForSort2,
+ textForSort3, conditionForSort3, valueForSort3,OpptyWaitForSort);
if (String.isBlank(this.sortKey)) {
- soqlForMoney += ' order by LastModifiedDate desc limit ' + Integer.valueOf(System.Label.TotalLimit);
+ soqlForMoney += ' order by LastModifiedDate desc limit ' + Integer.valueOf(System.Label.TotalLimit);
} else {
- soqlForMoney += ' order by ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last')+ ' limit ' + Integer.valueOf(System.Label.TotalLimit);
+ soqlForMoney += ' order by ' + this.columus[Integer.valueOf(this.sortKey)] + ' ' + (this.sortOrderAsc == true ? 'asc nulls first' : 'desc nulls last')+ ' limit ' + Integer.valueOf(System.Label.TotalLimit);
}
system.debug('soql:' + soql);
List<Opportunity> queryList = Database.query(soql);
List<Opportunity> queryListForMoney = Database.query(soqlForMoney);
-
+
this.makeOppRecordsForView(queryList, queryListForMoney);
-
+
oppCount = oppRecords.size();
if (String.isBlank(this.sortKey)) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍙栧緱鏈�杩戠殑 ' + oppCount + ' 鏉℃暟鎹�'));
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍙栧緱鏈�杩戠殑 ' + oppCount + ' 鏉℃暟鎹�'));
} else {
- if (oppCount > oppLimit) {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�'));
- } else {
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍏辨湁 ' + oppCount + ' 鏉℃暟鎹�'));
- }
+ if (oppCount > oppLimit) {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鏁版嵁瓒呰繃' + oppLimit + '浠讹紝鍙樉绀哄墠' + oppLimit + '浠�'));
+ } else {
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '鍏辨湁 ' + oppCount + ' 鏉℃暟鎹�'));
+ }
}
}
-
+
public PageReference searchOpp() {
searchOppSetParam();
setLayoutRWInfo();
searchOppInner();
return null;
}
-
+
public PageReference sortTable() {
oppRecords = new List<OppInfo>();
-
+
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)] = '銆�';
- }
+ 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;
}
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� 澧炲姞淇濆瓨鐨勪慨鏀癸紝鍙繚瀛樺彲浠ヤ慨鏀圭殑瀛楁 start
+ private Opportunity makeUpdateOpp(Opportunity oppinline) {
+ Opportunity ret = new Opportunity();
+ ret.Id = oppinline.Id;
+ for (String leftkey : columnLeftRW.keySet()) {
+ if (!'r'.equals(columnLeftRW.get(leftkey))) {
+ ret.put(leftkey, oppinline.get(leftkey));
+ }
+ }
+ for (String rightkey : columnRightRW.keySet()) {
+ if (!'r'.equals(columnRightRW.get(rightkey))) {
+ ret.put(rightkey, oppinline.get(rightkey));
+ }
+ }
+ return ret;
+ }
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� 澧炲姞淇濆瓨鐨勪慨鏀癸紝鍙繚瀛樺彲浠ヤ慨鏀圭殑瀛楁 end
+
public PageReference save() {
try {
- List<Opportunity> updOpps = new List<Opportunity>();
-
- List<String> oppidList = new List<String>();
- Map<String, String> oppidMap = new Map<String, String>();
- for (OppInfo oi : oppRecords) {
- if (oi.changeFlg == '1') {
- if (oppidMap.containsKey(oi.rec.Id) == false) {
- oppidList.add(oi.rec.Id);
- }
- }
+ List<Opportunity> updOpps = new List<Opportunity>();
+
+ // List<String> oppidList = new List<String>();
+ // Map<String, String> oppidMap = new Map<String, String>();
+ // for (OppInfo oi : oppRecords) {
+ // if (oi.changeFlg == '1') {
+ // if (oppidMap.containsKey(oi.rec.Id) == false) {
+ // oppidList.add(oi.rec.Id);
+ // }
+ // }
+ // }
+
+ // Map<String, Opportunity> oppMap = new Map<String, Opportunity>();
+ // List<Opportunity> oppList = [select Id, Competitor__c from Opportunity where Id = :oppidList];
+ // for (Opportunity opp : oppList) {
+ // oppMap.put(opp.Id, opp);
+ // }
+
+ for (OppInfo oi : oppRecords) {
+ // 澶夋洿銉併偋銉冦偗
+ if (oi.changeFlg == '1') {
+ oi.changeFlg = '0';
+ // oi.rec.Competitor__c = oppMap.get(oi.rec.Id).Competitor__c;
+ // updOpps.add(oi.rec);
+ Opportunity up_opp = makeUpdateOpp(oi.rec);
+ // up_opp.Competitor__c = oppMap.get(oi.rec.Id).Competitor__c;
+ System.debug('up_opp: ' + up_opp);
+ updOpps.add(up_opp);
}
-
- Map<String, Opportunity> oppMap = new Map<String, Opportunity>();
- List<Opportunity> oppList = [select Id, Competitor__c from Opportunity where Id = :oppidList];
- for (Opportunity opp : oppList) {
- oppMap.put(opp.Id, opp);
- }
-
- for (OppInfo oi : oppRecords) {
- // 澶夋洿銉併偋銉冦偗
- if (oi.changeFlg == '1') {
- oi.changeFlg = '0';
- oi.rec.Competitor__c = oppMap.get(oi.rec.Id).Competitor__c;
- updOpps.add(oi.rec);
- }
- }
-
- if (updOpps.size() > 0) update updOpps;
- ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '淇濆瓨瀹屼簡'));
- } catch (Exception ex) {
- ApexPages.addMessages(ex);
- return null;
}
-
+
+ if (updOpps.size() > 0) update updOpps;
+ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO, '淇濆瓨瀹屼簡'));
+ } catch (Exception ex) {
+ ApexPages.addMessages(ex);
+ return null;
+ }
+
if (saveType == '1') {
- searchOpp();
- saveType = '';
+ searchOpp();
+ saveType = '';
} else if (saveType == '2') {
- sortTable();
- saveType = '';
+ sortTable();
+ saveType = '';
} else {
+ //杩涘彛璁鸿瘉 fy start
+ searchOpp();
+ //杩涘彛璁鸿瘉 fy end
}
return null;
}
-
+
public PageReference cancel() {
return new PageReference('/home/home.jsp');
}
-
+
private String makeSoql(Boolean isforMoneyFlg, String accStr, String ownerStr, //String dept, String rank, Boolean consumable,
- String datefield, Date fromd, Date tod, String txt, String con, String val,
- String txt2, String con2, String val2,
- String txt3, String con3, String val3,Boolean OpptyWait) {
+ String datefield, Date fromd, Date tod, String txt, String con, String val,
+ String txt2, String con2, String val2,
+ String txt3, String con3, String val3,Boolean OpptyWait) {
+ //杩涘彛璁鸿瘉 fy start
+ // if(txt=='if_NeedImportDemonstration__c'){
+ // if(val=='鏄�'){
+ // val = 'true';
+ // }else if(val=='鍚�'){
+ // val = 'false';
+ // }
+ // }
+ // if(txt2=='if_NeedImportDemonstration__c'){
+ // if(val2=='鏄�'){
+ // val2 = 'true';
+ // }else if(val2=='鍚�'){
+ // val2 = 'false';
+ // }
+ // }
+ // if(txt3=='if_NeedImportDemonstration__c'){
+ // if(val3=='鏄�'){
+ // val3 = 'true';
+ // }else if(val3=='鍚�'){
+ // val3 = 'false';
+ // }
+ // }
+ //杩涘彛璁鸿瘉 fy end
String soql ='';
if (isforMoneyFlg == false) {
- soql += 'select ' + strColumus + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\' or RecordType.DeveloperName = \'SI_Oppor\')';
- /* soql += 'select Id, Name, Hospital__r.Name, Hospital__c, StageName__c, Status_Formula__c,'
- + ' Opportunity_No__c, AccountId, Account.Name, OwnerId, Owner.Name, Opportunity_Category__c,'
- + ' Estimation_List_Price__c, Estimation_Id__c, Estimation_No__c, Last_Shipping_Scheduled_Date__c, Last_Shipping_Date__c,'
- + ' Last_Follow_Up_Date__c, CreatedDate, LastModified_Day__c, Closing_Bid_Date__c, Important_Rroduct_Flg__c,'//Owner.Brief_Name__c,
- + ' Rating01__c, Rating02__c, Rating03__c, Rating04__c, Rating05__c, Rating06__c,'
- + ' Rating07__c, Rating08__c, Rating09__c, Rating10__c, Rating11__c, Rating12__c,'
- + ' HP_Name__c, Sales_incharge__c, Wholesale_Price_F__c, Agency1__c, '//Estimation_List_Price_Formula__c, OCM_Agent1_Price_Formula__c,
- + ' Segment__c, Opp_Code__c, Open_Quotation__c, Competitor__c, Bid_Planned_Date__c,'
- + ' Close_Forecasted_Date__c, CloseDate, Follow_up_comment__c, Department_Name__c,'
- + ' Next_Action__c, Create_Activity__c, Nunber_of_visit__c, Number_of_OPD__c, Rating__c, '//Quotation_Number_SAP__c,, Discount_Rate__c
- + ' OCM__c, Amount_Without_Tax_F__c, Key_tipics_last_update_day__c, Update_situation__c , Last_opd_date__c,'
- + ' Stage2_last_update_day__c, Follow_up_plan_last_update__c, Closing_Bid_date_last_update_day__c, OPP_rank_Last_update_day__c, Situation_last_update_day__c, '
- + ' Opp_forecast_day_last_update_day__c, Tender_data_last_update_day__c, Forecast_amount_last_update_day__c, Forecast_shipping_day_last_update__c, Created_Day__c, '
- + ' Agency_Contract_Date1__c, Sales_Shop_Hospital_Contract__c, Manager_feedback__c, Forecast_this_month__c,'
- + ' Manager_feedback_last_update__c, Agency_Contract_Date_last_update__c, Agent_Hospital_Contract_day_last_update__c,'
- + ' Bid_Date__c, Bid_date_last_update_day__c, Collect_Customer_sign__c, Lapsed_Days__c, OPD_SIS_collect_evaluation_sight__c,'
- + ' Owner.Salesdepartment__c, Owner.Province__c, Owner.Group__c'
- + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\')';// and (stageName = \'寮曞悎\')';*/
+ soql += 'select ' + strColumus + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\' or RecordType.DeveloperName = \'SI_Oppor\')';
+ /* soql += 'select Id, Name, Hospital__r.Name, Hospital__c, StageName__c, Status_Formula__c,'
+ + ' Opportunity_No__c, AccountId, Account.Name, OwnerId, Owner.Name, Opportunity_Category__c,'
+ + ' Estimation_List_Price__c, Estimation_Id__c, Estimation_No__c, Last_Shipping_Scheduled_Date__c, Last_Shipping_Date__c,'
+ + ' Last_Follow_Up_Date__c, CreatedDate, LastModified_Day__c, Closing_Bid_Date__c, Important_Rroduct_Flg__c,'//Owner.Brief_Name__c,
+ + ' Rating01__c, Rating02__c, Rating03__c, Rating04__c, Rating05__c, Rating06__c,'
+ + ' Rating07__c, Rating08__c, Rating09__c, Rating10__c, Rating11__c, Rating12__c,Owner_Category__c,'
+ + ' HP_Name__c, Sales_incharge__c, Wholesale_Price_F__c, Agency1__c, '//Estimation_List_Price_Formula__c, OCM_Agent1_Price_Formula__c,
+ + ' Segment__c, Opp_Code__c, Open_Quotation__c, Competitor__c, Bid_Planned_Date__c,'
+ + ' Close_Forecasted_Date__c, CloseDate, Follow_up_comment__c, Department_Name__c,'
+ + ' Next_Action__c, Create_Activity__c, Nunber_of_visit__c, Number_of_OPD__c, Rating__c, '//Quotation_Number_SAP__c,, Discount_Rate__c
+ + ' OCM__c, Amount_Without_Tax_F__c, Key_tipics_last_update_day__c, Update_situation__c , Last_opd_date__c,'
+ + ' Stage2_last_update_day__c, Follow_up_plan_last_update__c, Closing_Bid_date_last_update_day__c, OPP_rank_Last_update_day__c, Situation_last_update_day__c, '
+ + ' Opp_forecast_day_last_update_day__c, Tender_data_last_update_day__c, Forecast_amount_last_update_day__c, Forecast_shipping_day_last_update__c, Created_Day__c, '
+ + ' Agency_Contract_Date1__c, Sales_Shop_Hospital_Contract__c, Manager_feedback__c, Forecast_this_month__c,'
+ + ' Manager_feedback_last_update__c, Agency_Contract_Date_last_update__c, Agent_Hospital_Contract_day_last_update__c,'
+ + ' Bid_Date__c, Bid_date_last_update_day__c, Collect_Customer_sign__c, Lapsed_Days__c, OPD_SIS_collect_evaluation_sight__c,'
+ + ' Owner.Salesdepartment__c, Owner.Province__c, Owner.Group__c'
+ + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\')';// and (stageName = \'寮曞悎\')';*/
} else {
- soql += 'select ' + strColumusForMoney + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\' or RecordType.DeveloperName = \'SI_Oppor\')';
- /* soql += 'select Id, Name, Hospital__r.Name, Hospital__c, StageName__c, Status_Formula__c,'
- + ' Opportunity_No__c, AccountId, Account.Name, OwnerId, Owner.Name, Opportunity_Category__c,'
- + ' convertCurrency(Estimation_List_Price__c), Estimation_Id__c, Estimation_No__c, Last_Shipping_Scheduled_Date__c, Last_Shipping_Date__c,'
- + ' Last_Follow_Up_Date__c, CreatedDate, LastModified_Day__c, Closing_Bid_Date__c, Important_Rroduct_Flg__c,'//Owner.Brief_Name__c,
- + ' Rating01__c, Rating02__c, Rating03__c, Rating04__c, Rating05__c, Rating06__c,'
- + ' Rating07__c, Rating08__c, Rating09__c, Rating10__c, Rating11__c, Rating12__c,'
- + ' HP_Name__c, Sales_incharge__c, convertCurrency(Wholesale_Price_F__c), Agency1__c, '//Estimation_List_Price_Formula__c, OCM_Agent1_Price_Formula__c,
- + ' Segment__c, Opp_Code__c, Open_Quotation__c, Competitor__c, Bid_Planned_Date__c,'
- + ' Close_Forecasted_Date__c, CloseDate, Follow_up_comment__c, Department_Name__c, '
- + ' Next_Action__c, Create_Activity__c, Nunber_of_visit__c, Number_of_OPD__c, Rating__c, '//Quotation_Number_SAP__c,, Discount_Rate__c
- + ' OCM__c, convertCurrency(Amount_Without_Tax_F__c), Key_tipics_last_update_day__c, Update_situation__c , Last_opd_date__c,'
- + ' Stage2_last_update_day__c, Follow_up_plan_last_update__c, Closing_Bid_date_last_update_day__c, OPP_rank_Last_update_day__c, Situation_last_update_day__c, '
- + ' Opp_forecast_day_last_update_day__c, Tender_data_last_update_day__c, Forecast_amount_last_update_day__c, Forecast_shipping_day_last_update__c, Created_Day__c, '
- + ' Agency_Contract_Date1__c, Sales_Shop_Hospital_Contract__c, Manager_feedback__c, Forecast_this_month__c,'
- + ' Manager_feedback_last_update__c, Agency_Contract_Date_last_update__c, Agent_Hospital_Contract_day_last_update__c,'
- + ' Bid_Date__c, Bid_date_last_update_day__c, Collect_Customer_sign__c, Lapsed_Days__c, OPD_SIS_collect_evaluation_sight__c,'
- + ' Owner.Salesdepartment__c, Owner.Province__c, Owner.Group__c'
- + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\')';// and (stageName = \'寮曞悎\')';*/
+ soql += 'select ' + strColumusForMoney + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\' or RecordType.DeveloperName = \'SI_Oppor\')';
+ /* soql += 'select Id, Name, Hospital__r.Name, Hospital__c, StageName__c, Status_Formula__c,'
+ + ' Opportunity_No__c, AccountId, Account.Name, OwnerId, Owner.Name, Opportunity_Category__c,'
+ + ' convertCurrency(Estimation_List_Price__c), Estimation_Id__c, Estimation_No__c, Last_Shipping_Scheduled_Date__c, Last_Shipping_Date__c,'
+ + ' Last_Follow_Up_Date__c, CreatedDate, LastModified_Day__c, Closing_Bid_Date__c, Important_Rroduct_Flg__c,'//Owner.Brief_Name__c,
+ + ' Rating01__c, Rating02__c, Rating03__c, Rating04__c, Rating05__c, Rating06__c,'
+ + ' Rating07__c, Rating08__c, Rating09__c, Rating10__c, Rating11__c, Rating12__c,Owner_Category__c,'
+ + ' HP_Name__c, Sales_incharge__c, convertCurrency(Wholesale_Price_F__c), Agency1__c, '//Estimation_List_Price_Formula__c, OCM_Agent1_Price_Formula__c,
+ + ' Segment__c, Opp_Code__c, Open_Quotation__c, Competitor__c, Bid_Planned_Date__c,'
+ + ' Close_Forecasted_Date__c, CloseDate, Follow_up_comment__c, Department_Name__c, '
+ + ' Next_Action__c, Create_Activity__c, Nunber_of_visit__c, Number_of_OPD__c, Rating__c, '//Quotation_Number_SAP__c,, Discount_Rate__c
+ + ' OCM__c, convertCurrency(Amount_Without_Tax_F__c), Key_tipics_last_update_day__c, Update_situation__c , Last_opd_date__c,'
+ + ' Stage2_last_update_day__c, Follow_up_plan_last_update__c, Closing_Bid_date_last_update_day__c, OPP_rank_Last_update_day__c, Situation_last_update_day__c, '
+ + ' Opp_forecast_day_last_update_day__c, Tender_data_last_update_day__c, Forecast_amount_last_update_day__c, Forecast_shipping_day_last_update__c, Created_Day__c, '
+ + ' Agency_Contract_Date1__c, Sales_Shop_Hospital_Contract__c, Manager_feedback__c, Forecast_this_month__c,'
+ + ' Manager_feedback_last_update__c, Agency_Contract_Date_last_update__c, Agent_Hospital_Contract_day_last_update__c,'
+ + ' Bid_Date__c, Bid_date_last_update_day__c, Collect_Customer_sign__c, Lapsed_Days__c, OPD_SIS_collect_evaluation_sight__c,'
+ + ' Owner.Salesdepartment__c, Owner.Province__c, Owner.Group__c'
+ + ' from Opportunity where (RecordType.DeveloperName = \'Opportunity\')';// and (stageName = \'寮曞悎\')';*/
}
// xudan 20140626 鐘舵��1銈掋儊銈с儍銈儨銉冦偗銈广伀
if (onlyOpp) {
- soql += ' and StageName__c = \'璇环\'';
+ soql += ' and StageName__c = \'璇环\'';
}
if (!String.isBlank(accStr)) {
- //soql += ' and Hospital__c = \'' + accStr + '\'';
- String[] vals = accStr.split(' ');
- for (String v : vals) {
- soql += ' and Hospital__r.Name like \'%' + String.escapeSingleQuotes(v.replaceAll('%', '\\%')) + '%\'';
- }
+ //soql += ' and Hospital__c = \'' + accStr + '\'';
+ String[] vals = accStr.split(' ');
+ for (String v : vals) {
+ soql += ' and Hospital__r.Name like \'%' + String.escapeSingleQuotes(v.replaceAll('%', '\\%')) + '%\'';
+ }
}
if (!String.isBlank(ownerStr)) {
- //soql += ' and OwnerId = \'' + ownerStr + '\'';
- String[] vals = ownerStr.split(' ');
- for (String v : vals) {
- soql += ' and Owner.Name like \'%' + String.escapeSingleQuotes(v.replaceAll('%', '\\%')) + '%\'';
- }
+ //soql += ' and OwnerId = \'' + ownerStr + '\'';
+ String[] vals = ownerStr.split(' ');
+ for (String v : vals) {
+ soql += ' and Owner.Name like \'%' + String.escapeSingleQuotes(v.replaceAll('%', '\\%')) + '%\'';
}
-
+ }
+
if (!String.isBlank(datefield)) {
- if (fromd != null) {
- soql += ' and ' + datefield + ' >= ' + String.valueOf(fromd).substring(0, 10);
- }
- if (tod != null) {
- soql += ' and (' + datefield + ' <= ' + String.valueOf(tod).substring(0, 10) + ' OR ' + datefield + ' = null)';
- }
+ if (fromd != null) {
+ soql += ' and ' + datefield + ' >= ' + String.valueOf(fromd).substring(0, 10);
+ }
+ if (tod != null) {
+ soql += ' and (' + datefield + ' <= ' + String.valueOf(tod).substring(0, 10) + ' OR ' + datefield + ' = null)';
+ }
}
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm start
if (OpptyWait) {
- soql+=' and StageName__c =\'璇环\' and SAP_Send_OK__c =false and Bool_Create_Day__c=true and Update_situation__c like \'%娌℃洿鏂�%\' and Close_Forecasted_Date__c <= 2022-03-31';
+ soql+=' and StageName__c =\'璇环\' and SAP_Send_OK__c =false and Bool_Create_Day__c=true and Update_situation__c like \'%娌℃洿鏂�%\' and Close_Forecasted_Date__c <= 2022-03-31';
}
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
-
+
// xudan 20140507 妞滅储銉偢銉冦偗淇
soql += this.makeTextSql(txt, con, val);
soql += this.makeTextSql(txt2, con2, val2);
soql += this.makeTextSql(txt3, con3, val3);
-
+
system.debug(soql);
return soql;
}
-
+
private void makeOppRecordsForView(List<Opportunity> queryList, List<Opportunity> queryListForMoney) {
Savepoint sp = Database.setSavepoint();
// TODO queryList 銇仱銇勩仸銆佹渶鍒濄伄oppLimit銇犮亼鏇存柊銇欍倢銇癘K銇с仚銆�
@@ -659,158 +754,191 @@
Database.rollback(sp);
// 鍚堣鍊兼竻绌�
for (String key : columnMoneyMap.keySet()) {
- columnMoneyMap.put(key, 0);
+ columnMoneyMap.put(key, 0);
}
-
+
for (Integer i = 0; i < queryListForMoney.size(); i++) {
- if(i<queryList.size()) {
- // limit銈掕秴銇堛仧鍫村悎鍓峫imit浠躲伄銇裤倰鍑恒仚
- if (i == oppLimit + 1) {
- // TODO 銉°儍銈汇兗銈歌〃绀�
- continue;
- }
- oppRecords.add(new OppInfo(queryList[i]));
- oppRecords[oppRecords.size() - 1].lineNo = oppRecords.size() - 1;
- if (!results[i].isSuccess()) {
- oppRecords[oppRecords.size() - 1].canEdit = false;
- // 绌烘洿鏂板け鏁椼伄鍫村悎銆佺法闆嗐仹銇嶃仾銇勩仺銇裤仾銇�
- // xudan 20140624 鏇存柊妯╅檺銇偍銉┿兗銇伩銉儍銈�
- if (results[i].getErrors()[0].getStatusCode() != null) {
- if (String.valueOf(results[i].getErrors()[0].getStatusCode()) == 'INSUFFICIENT_ACCESS_OR_READONLY') {
- oppRecords[oppRecords.size() - 1].hasError = true;
- // xudan 20140624 鏇存柊妯╅檺銈ㄣ儵銉笺仺銇汇亱銇偍銉┿兗銈掑尯鍒�
- } else {
- oppRecords[oppRecords.size() - 1].hasFieldError = true;
- }
- }
+ if(i<queryList.size()) {
+ // limit銈掕秴銇堛仧鍫村悎鍓峫imit浠躲伄銇裤倰鍑恒仚
+ if (i == oppLimit + 1) {
+ // TODO 銉°儍銈汇兗銈歌〃绀�
+ continue;
+ }
+ oppRecords.add(new OppInfo(queryList[i]));
+ oppRecords[oppRecords.size() - 1].lineNo = oppRecords.size() - 1;
+ if (!results[i].isSuccess()) {
+ oppRecords[oppRecords.size() - 1].canEdit = false;
+ // 绌烘洿鏂板け鏁椼伄鍫村悎銆佺法闆嗐仹銇嶃仾銇勩仺銇裤仾銇�
+ // xudan 20140624 鏇存柊妯╅檺銇偍銉┿兗銇伩銉儍銈�
+ if (results[i].getErrors()[0].getStatusCode() != null) {
+ if (String.valueOf(results[i].getErrors()[0].getStatusCode()) == 'INSUFFICIENT_ACCESS_OR_READONLY') {
+ oppRecords[oppRecords.size() - 1].hasError = true;
+ // xudan 20140624 鏇存柊妯╅檺銈ㄣ儵銉笺仺銇汇亱銇偍銉┿兗銈掑尯鍒�
+ } else {
+ oppRecords[oppRecords.size() - 1].hasFieldError = true;
}
}
-
- for (String key : columnMoneyMap.keySet()) {
- Decimal d = columnMoneyMap.get(key);
- d += queryListForMoney[i].get(key) == null ? 0 : Decimal.valueOf(String.valueOf(queryListForMoney[i].get(key)));
- columnMoneyMap.put(key, d);
}
+ }
+
+ for (String key : columnMoneyMap.keySet()) {
+ Decimal d = columnMoneyMap.get(key);
+ d += queryListForMoney[i].get(key) == null ? 0 : Decimal.valueOf(String.valueOf(queryListForMoney[i].get(key)));
+ columnMoneyMap.put(key, d);
+ }
}
}
-
+
private String makeTextSql(String txt1, String con, String val) {
String soql = '';
// contains銇牬鍚堛�佹棩鍫辩敾闈€伄鐥呴櫌妞滅储銈掔湡浼笺仐銆乻pace銇у垎銇戙仸銆乤nd妞滅储
// equals銇牬鍚堛�丼F妯欐簴銇绱€倰鐪熶技銇椼�併��,銆嶃仹鍒嗐亼銇︺�乷r妞滅储
if (!String.isBlank(txt1)) {
- if ((con == 'contains' || con == 'notcontains') && val.contains(' ')) {
- String[] vals = val.split(' ');
- String cSql = '';
- for (String v : vals) {
- cSql += this.makeTextSqlStr(txt1, con, v);
- }
- if (con == 'contains') {
- soql += cSql;
- } else {
- // notcontains
- cSql = cSql.replaceAll(' and ', ') and (NOT ');
- soql += cSql.substring(1) + ') ';
- }
- } else if ((con == 'equals' || con == 'notequals') && val.contains(',')) {
- String[] vals = val.split(',');
- if (vals.size() > 0) {
- String txt = txt1.substring(2); // S:Name 銆佹渶鍒濄伄锛掓枃瀛椼亴銈裤偆銉椼仹銇�
- soql += ' and ( ';
- for (String v : vals) {
- if (con == 'equals') {
- soql += txt + ' = \'' + v + '\' or ';
- } else {
- // notequals
- soql += txt + ' <> \'' + v + '\' and ';
- }
- }
- soql = soql.substring(0, soql.length() - 4);
- soql += ')';
- }
+ if ((con == 'contains' || con == 'notcontains') && val.contains(' ')) {
+ String[] vals = val.split(' ');
+ String cSql = '';
+ for (String v : vals) {
+ cSql += this.makeTextSqlStr(txt1, con, v);
+ }
+ if (con == 'contains') {
+ soql += cSql;
} else {
- String cSql = this.makeTextSqlStr(txt1, con, val);
- if (con != 'notcontains') {
- soql += this.makeTextSqlStr(txt1, con, val);
+ // notcontains
+ cSql = cSql.replaceAll(' and ', ') and (NOT ');
+ soql += cSql.substring(1) + ') ';
+ }
+ } else if ((con == 'equals' || con == 'notequals') && val.contains(',')) {
+ String[] vals = val.split(',');
+ if (vals.size() > 0) {
+ String txt = txt1.substring(2); // S:Name 銆佹渶鍒濄伄锛掓枃瀛椼亴銈裤偆銉椼仹銇�
+ soql += ' and ( ';
+ for (String v : vals) {
+ if (con == 'equals') {
+ soql += txt + ' = \'' + v + '\' or ';
} else {
- // notcontains
- cSql = cSql.substring(5); // ' and ' 銇�5鏂囧瓧銈掑銇�
- soql += ' and (NOT ' + cSql + ') ';
+ // notequals
+ soql += txt + ' <> \'' + v + '\' and ';
}
}
+ soql = soql.substring(0, soql.length() - 4);
+ soql += ')';
+ }
+ } else {
+ String cSql = this.makeTextSqlStr(txt1, con, val);
+ if (con != 'notcontains') {
+ soql += this.makeTextSqlStr(txt1, con, val);
+ } else {
+ // notcontains
+ cSql = cSql.substring(5); // ' and ' 銇�5鏂囧瓧銈掑銇�
+ soql += ' and (NOT ' + cSql + ') ';
+ }
+ }
}
return soql;
}
-
+
/**
* 鏂囧瓧鍒楁绱㈡枃銈掍綔鎴�
*/
private String makeTextSqlStr(String txt1, String con, String val) {
String soql = '';
if (!String.isBlank(txt1)) {
- String txt = txt1.substring(2);
- String colType = txt1.substring(0, 2);
- String tmpVal = val;
- // 绌虹櫧銇牬鍚�''銇仚銈�
- if (String.isBlank(tmpVal)) {
- if (con == 'equals') {
- //soql += ' and ' + txt + ' = ' + tmpVal;
- soql += ' and ' + txt + ' = null';
- } else if (con == 'notequals') {
- soql += ' and ' + txt + ' <> null';
- } else {
- // 绌虹櫧銇牬鍚堛�乧ontains, notcontains 銇� starts with銇劇瑕�
- }
+//DB202211121149 銆愬懆浼�-璇环绠$悊銆戝懆浼氳浠疯〃鎶娾�滆祫閲戞潵婧愨�濇坊鍔犲埌鈥滄暟鎹瓧娈碘�濅腑杩涜绛涢�� xxf 20221109 start
+ if (txt1 == 'S:Fund_Basis__c') {
+ if(val == '鍖婚櫌璧勯噾'){
+ val = val.replaceAll('鍖婚櫌璧勯噾', '鐥呴櫌璩囬噾');
+ }
+ if(val == '鏀垮簻鎷ㄦ'){
+ val = val.replaceAll('鏀垮簻鎷ㄦ', '鏀垮簻璩囬噾');
+ }
+ if(val == '鍥介檯璧勯噾'){
+ val = val.replaceAll('鍥介檯璧勯噾', '鍥介殯璩囬噾');
+ }
+ if(val == '閾惰璧勯噾'){
+ val = val.replaceAll('閾惰璧勯噾', '閵�琛岃硣閲�');
+ }
+ if(val == '鍏徃/涓汉鎶曡祫'){
+ val = val.replaceAll('鍏徃/涓汉鎶曡祫', '浼氱ぞ/鍊嬩汉璩囬噾');
+ }
+ if(val == '铻嶈祫绉熻祦'){
+ val = val.replaceAll('铻嶈祫绉熻祦', '铻嶈祫绉熻祦锛堛儶銉笺偣锛�');
+ }
+ }
+//DB202211121149 銆愬懆浼�-璇环绠$悊銆戝懆浼氳浠疯〃鎶娾�滆祫閲戞潵婧愨�濇坊鍔犲埌鈥滄暟鎹瓧娈碘�濅腑杩涜绛涢�� xxf 20221109 end
+ String txt = txt1.substring(2);
+ String colType = txt1.substring(0, 2);
+ String tmpVal = val;
+ //杩涘彛璁鸿瘉 fy start
+ if(txt=='if_NeedImportDemonstration__c'){
+ if(tmpVal=='鏄�'){
+ tmpVal = 'true';
+ }else if(tmpVal=='鍚�'){
+ tmpVal = 'false';
+ }else {
+ return soql;
+ }
+ }
+ //杩涘彛璁鸿瘉 fy end
+ // 绌虹櫧銇牬鍚�''銇仚銈�
+ if (String.isBlank(tmpVal)) {
+ if (con == 'equals') {
+ //soql += ' and ' + txt + ' = ' + tmpVal;
+ soql += ' and ' + txt + ' = null';
+ } else if (con == 'notequals') {
+ soql += ' and ' + txt + ' <> null';
} else {
- soql += ' and ' + txt;
- if (con == 'equals') {
- if (colType == 'S:') {
- soql += ' = \'' + tmpVal + '\'';
- } else {
- soql += ' = ' + tmpVal + ' ';
- }
- } else if (con == 'notequals') {
- if (colType == 'S:') {
- soql += ' <> \'' + tmpVal + '\'';
- } else {
- soql += ' <> ' + tmpVal + ' ';
- }
- } else if (con == 'contains' || con == 'notcontains') {
- soql += ' like \'%' + String.escapeSingleQuotes(tmpVal.replaceAll('%', '\\%')) + '%\'';
- } else if (con == 'starts with') {
- soql += ' like \'' + String.escapeSingleQuotes(tmpVal.replaceAll('%', '\\%')) + '%\'';
- } else {
- if (colType == 'S:') {
- soql += ' ' + con + '\'' + tmpVal + '\'';
- } else {
- soql += ' ' + con + ' ' + tmpVal + ' ';
- }
- }
+ // 绌虹櫧銇牬鍚堛�乧ontains, notcontains 銇� starts with銇劇瑕�
}
+ } else {
+ soql += ' and ' + txt;
+ if (con == 'equals') {
+ if (colType == 'S:') {
+ soql += ' = \'' + tmpVal + '\'';
+ } else {
+ soql += ' = ' + tmpVal + ' ';
+ }
+ } else if (con == 'notequals') {
+ if (colType == 'S:') {
+ soql += ' <> \'' + tmpVal + '\'';
+ } else {
+ soql += ' <> ' + tmpVal + ' ';
+ }
+ } else if (con == 'contains' || con == 'notcontains') {
+ soql += ' like \'%' + String.escapeSingleQuotes(tmpVal.replaceAll('%', '\\%')) + '%\'';
+ } else if (con == 'starts with') {
+ soql += ' like \'' + String.escapeSingleQuotes(tmpVal.replaceAll('%', '\\%')) + '%\'';
+ } else {
+ if (colType == 'S:') {
+ soql += ' ' + con + '\'' + tmpVal + '\'';
+ } else {
+ soql += ' ' + con + ' ' + tmpVal + ' ';
+ }
+ }
+ }
}
return soql;
}
-
+
/**
* 鐝惧湪銇湀銇仸銆佽〃绀恒仚銇广亶銉┿儥銉悕銈掍綔鎴�
*/
private Integer makeRatingLabel(Integer idx) {
Integer m = Date.today().month();
-
+
Integer val = idx - 1 + m;
if (val > 12) {
- val = val - 12;
+ val = val - 12;
}
return val;
}
-
+
/**
* 鐝惧湪銇湀銇仸銆丷ating銇偨銉笺儓鐣彿銈掍綔鎴�
*/
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm start
// private Integer makeRatingSortIdx(Integer idx) {
// Integer m = Date.today().month();
-
+
// Integer val = idx - 1 + m;
// if (val > 29) {
// val = val - 12;
@@ -818,26 +946,67 @@
// return val;
// }
//銆愬鎵樸�戙�愰噸瑕併�戝懆浼氱鐞嗚〃淇敼 tcm end
-
+
/**
* 鐝惧湪銇湀銇仸銆佸彇寰椼仚銇广亶API鍚嶃倰浣滄垚
*/
private String makeRatingAPI(Integer idx, Integer m) {
String rtn = '';
-
+
Integer val = idx - 1 + m;
if (val > 12) {
- val = val - 12;
+ val = val - 12;
}
if (val < 10) {
- rtn = '0' + val;
+ rtn = '0' + val;
} else {
- rtn = '' + val;
+ rtn = '' + val;
}
-
+
return 'Rating' + rtn + '__c';
}
+ //XLIU-CGF4TA 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� fy start
+ // public PageReference HideForecastOCSMSigningDate() {
+ // if(HideForecastOCSMflag){
+ // List<String> HidecolumnRightCss = new List<String>();
+ // List<String> HidetitleRight = new List<String>();
+ // List<List<String> > HidecolumnsRightApiList = new List<List<String> >();
+ // for(List<String> colrightapiList: columnsRightApicopy){
+ // List<String> HidecolumnsRightApi = new List<String>();
+ // for(String colrightapi :colrightapiList){
+ // if(colrightapi != 'Close_Forecasted_Date__c'&&colrightapi != 'Close_Forecasted_Assume_Date__c'&&colrightapi != 'CloseDate'){
+ // HidecolumnsRightApi.add(colrightapi);
+ // }
+ // }
+ // if(HidecolumnsRightApi.size()>0){
+ // HidecolumnsRightApiList.add(HidecolumnsRightApi);
+ // }
+ // }
+ // for(String colright: columnRightCsscopy){
+ // if(colright != 'Close_Forecasted_Date__c'&&colright != 'Close_Forecasted_Assume_Date__c'&&colright != 'CloseDate'){
+ // HidecolumnRightCss.add(colright);
+ // }
+ // }
+ // for(String titlr: titleRightcopy){
+ // if(titlr != '棰勬祴OCSM绛剧害鏃�(KPI)'&&titlr != '棰勬祴OCSM绛剧害鏃�(鎷呭綋)'&&titlr != '棰勬祴鍙戣揣鏃�'){
+ // HidetitleRight.add(titlr);
+ // }
+ // }
+ // columnsRightApi=HidecolumnsRightApiList;
+ // columnRightCss=HidecolumnRightCss;
+ // titleRight=HidetitleRight;
+ // }else{
+ // system.debug('娴嬭瘯1'+titleRightcopy);
+ // system.debug('娴嬭瘯2'+columnsRightApicopy);
+ // system.debug('娴嬭瘯3'+columnRightCsscopy);
+ // titleRight=titleRightcopy;
+ // columnsRightApi=columnsRightApicopy;
+ // columnRightCss=columnRightCsscopy;
+ // }
+ // return null;
+ // }
+ //SWAG-CGG7UK 銆愬鎵樸�� 銆愯浠风鐞嗘敼鍠勯渶姹傝瘎浼般�戣浠蜂腑鐨勮繘鍙h璇佸垽鏂� fy end
class OppInfo {
public Opportunity rec { get; set; }
public Boolean canEdit { get; private set; }
@@ -845,14 +1014,14 @@
public Boolean hasFieldError { get; private set; }
public Integer lineNo { get; private set; }
public String changeFlg { get; set; }
-
+
public OppInfo(Opportunity record) {
- rec = record;
- canEdit = true;
- hasError = false;
- hasFieldError = false;
- lineNo = 0;
- changeFlg = '0';
+ rec = record;
+ canEdit = true;
+ hasError = false;
+ hasFieldError = false;
+ lineNo = 0;
+ changeFlg = '0';
}
}
- }
\ No newline at end of file
+ }
\ No newline at end of file
--
Gitblit v1.9.1