From 0787d2b3c5d4b12af4218a32323250aa9891246a Mon Sep 17 00:00:00 2001
From: 张宇恒 <bxyun0@163.com>
Date: 星期五, 08 四月 2022 18:03:19 +0800
Subject: [PATCH] 小程序相关603、612、ChoiceAssetController
---
force-app/main/default/classes/NFM603Controller.cls | 185 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 182 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/NFM603Controller.cls b/force-app/main/default/classes/NFM603Controller.cls
index b62e5c9..693757a 100644
--- a/force-app/main/default/classes/NFM603Controller.cls
+++ b/force-app/main/default/classes/NFM603Controller.cls
@@ -41,6 +41,10 @@
public String QuotationGread; //鎶ヤ环绛夌骇(new)
public String detectionResult; //妫�娴嬬粨鏋�
public String cus_dn; //DN鍙�
+ //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 start
+ public String OTSRepairOrder;
+ //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 end
+
//閫佷慨鐗╂祦
public String deliveryLogisticsMode; //閫佷慨鐗╂祦鏂瑰紡
public String engineerSendDate; //宸ョ▼甯堜慨鐞嗗搧瀵勯�佹棩
@@ -216,6 +220,7 @@
RcSorcDate__c,
SorcAcceptDate__c,
SorcOgzDate__c,
+ RcOgzDate__c,
Returns_Product_waySAP__c,
DnNO__c,
OgzAcceptDate__c,
@@ -233,7 +238,10 @@
Repair_Final_Inspection_DateTime__c,
Repair_Shipped_DateTime__c,
Repair_Discount_approval_DateTime_form__c,
- Agreed_DateTime__c
+ Agreed_DateTime__c,
+ //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 start
+ OTSRepairOrder__c
+ //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 end
from Repair__c where id in: repairOrderIdList
];
}
@@ -248,6 +256,10 @@
// 澶囧搧鍑哄�熻褰� 鏌ユ壘澶囧搧鍑哄�熶竴瑙堟槑缁嗙殑 浜у搧鍨嬪彿
Map < id, List < SparePartsLendingRecord >> rentalMap = getrentalMap(repairIdList);
+ String downSDt = '';
+ String downEDt = '';
+ String upSDt = '';
+ String upEDt = '';
for (Repair__c repair: repairList) {
@@ -366,10 +378,44 @@
info.OgzAcceptDate = NFMUtil.formatDateTime2Str(repair.OgzAcceptDateTime__c);//OGZ鍙楃悊鏃ワ紙灏忕▼搴忥級
//update wangweipeng 2022/02/16 end
- info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.SorcOgzDate__c);
+ // info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.SorcOgzDate__c);RcOgzDate__c
+
+ //update zhangyuheng 2022/03/07
+ info.SorcOgzDate = NFMUtil.formatDate2StrDateTime(repair.RcOgzDate__c);
info.cus_dn = repair.DnNO__c;
+ //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 start
+ info.OTSRepairOrder = repair.OTSRepairOrder__c;
+ //淇悊澧炲姞OTS杩愬崟鍙峰瓧娈� thh 20220308 end
+
+ //鎶ヤ环鏃ャ�佸垵娆℃姤浠锋棩銆丷C淇悊鍝丷C鍙楃悊鏃ワ紙灏忕▼搴忥級鏃堕棿鍒ゆ柇 zyh 20220315 start
+ downSDt = DownStartDt();
+ downEDt = DownEndDt();
+ upSDt = UpStartDt();
+ upEDt = UpEndDt();
+ //瀹氫箟涓嬬彮鏃堕棿
+ if (String.valueOf(info.FirstQuotationDate) >= String.valueOf(downSDt) && String.valueOf(info.FirstQuotationDate) <= String.valueOf(downEDt)) {
+ info.FirstQuotationDate = DownDt();//鍒濇鎶ヤ环鏃�
+ }
+ if (String.valueOf(info.RCacceptanceDate) >= String.valueOf(downSDt) && String.valueOf(info.RCacceptanceDate) <= String.valueOf(downEDt)) {
+ info.RCacceptanceDate = DownDt();//4.淇悊鍝丷C鍙楃悊鏃�
+ }
+ if (String.valueOf(info.quotationDate) >= String.valueOf(downSDt) && String.valueOf(info.quotationDate) <= String.valueOf(downEDt)) {
+ info.quotationDate = DownDt();//鎶ヤ环鏃�
+ }
+ //瀹氫箟涓婄彮鏃堕棿
+ if (String.valueOf(info.FirstQuotationDate) >= String.valueOf(upSDt) && String.valueOf(info.FirstQuotationDate) <= String.valueOf(upEDt)) {
+ info.FirstQuotationDate = UpDt();//鍒濇鎶ヤ环鏃�
+ }
+ if (String.valueOf(info.RCacceptanceDate) >= String.valueOf(upSDt) && String.valueOf(info.RCacceptanceDate) <= String.valueOf(upEDt)) {
+ info.RCacceptanceDate = UpDt();//4.淇悊鍝丷C鍙楃悊鏃�
+ }
+ if (String.valueOf(info.quotationDate) >= String.valueOf(upSDt) && String.valueOf(info.quotationDate) <= String.valueOf(upEDt)) {
+ info.quotationDate = UpDt();//鎶ヤ环鏃�
+ }
+ //鎶ヤ环鏃ャ�佸垵娆℃姤浠锋棩銆丷C淇悊鍝丷C鍙楃悊鏃ワ紙灏忕▼搴忥級鏃堕棿鍒ゆ柇 zyh 20220315 end
repairs.add(info);
+ System.debug('repairs1:' + repairs);
}
logstr += '\nend';
if (repairs.size() > 0) {
@@ -513,7 +559,7 @@
public static Set < Id > NFM603_Ids = new Set < Id > ();
// public static Map<Id,Id> rprIdMap = new Map<Id,Id>();
-
+
public static void NFM603Trigger(List < Repair__c > newList, Map < Id, Repair__c > newMap, List < Repair__c > oldList, Map < Id, Repair__c > oldMap) {
List < String > rprIds = new List < String > ();
Map < Id, Id > rprIdMap = new Map < Id, Id > ();
@@ -545,6 +591,38 @@
rprIdMap.put(rpr.Id, rpr.Id);
}
}
+
+ // 2022/4/6 zhangyuheng update start
+ //OTS璁㈠崟鍙锋湁鍊硷紝鍙戦�丄WS
+ if ((oldrpr.OTSRepairOrder__c == null && String.isNotBlank(rpr.OTSRepairOrder__c)) || rpr.OTSRepairOrder__c != oldrpr.OTSRepairOrder__c) {
+ if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) {
+ NFM603Controller.NFM603_Ids.add(rpr.Id);
+ rprIdMap.put(rpr.Id, rpr.Id);
+ }
+ }
+ // 2022/4/6 zhangyuheng update end
+ // 2022/4/7 zhangyuheng update start
+ //閫佷慨鐗╂祦鍗曞彿鏈夊�硷紝鍙戦�丄WS
+ if ((oldrpr.DeliveryLogisticsNo__c == null && String.isNotBlank(rpr.DeliveryLogisticsNo__c)) || rpr.DeliveryLogisticsNo__c != oldrpr.DeliveryLogisticsNo__c) {
+ if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) {
+ NFM603Controller.NFM603_Ids.add(rpr.Id);
+ rprIdMap.put(rpr.Id, rpr.Id);
+ }
+ }
+ //鎶ヤ环閲戦鍙戠敓鏀瑰彉涓斿垵娆℃姤浠锋棩鏈夊�硷紝鍙戦�丄WS
+ if (((rpr.Discount_Price_formula__c != oldrpr.Discount_Price_formula__c) || rpr.Discount_Price_formula__c != null) && rpr.Repair_Firstestimated_Date_formula__c != null) {
+ if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) {
+ NFM603Controller.NFM603_Ids.add(rpr.Id);
+ rprIdMap.put(rpr.Id, rpr.Id);
+ }
+ }
+ if ((rpr.Returns_Product_waySAP__c != oldrpr.Returns_Product_waySAP__c) && rpr.Repair_Shipped_DateTime__c != null) {
+ if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) {
+ NFM603Controller.NFM603_Ids.add(rpr.Id);
+ rprIdMap.put(rpr.Id, rpr.Id);
+ }
+ }
+ // 2022/4/7 zhangyuheng update end
// 娴嬭瘯鐜娴嬭瘯鐢紝涓婄嚎鍓嶈娉ㄦ帀
if (rpr.Repair_Firstestimated_Date__c != oldrpr.Repair_Firstestimated_Date__c) {
if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) {
@@ -586,4 +664,105 @@
}
}
}
+
+ //鎶ヤ环鏃ャ�佸垵娆℃姤浠锋棩銆丷C淇悊鍝丷C鍙楃悊鏃ワ紙灏忕▼搴忥級鏃堕棿鏂规硶 zyh 20220315 start
+ //涓嬬彮寮�濮嬫椂闂�
+ public static String DownStartDt(){
+ String timenow = Datetime.now().format('yyyyMMddHHmmss');
+ String dt = NFMUtil.formatDate2Str(Date.today());
+ String rtn = null;
+ if (dt == null) {
+ return rtn;
+ }
+ rtn = String.valueOf(dt);
+ rtn = rtn.replaceAll('-', '');
+ if (rtn >= '40001231') {
+ rtn = '99991231';
+ } else if (rtn < '19000101') {
+ rtn = '19000101';
+ }
+ return rtn + '173001';
+ }
+ //涓嬬彮缁撴潫鏃堕棿
+ public static String DownEndDt(){
+ String dt = NFMUtil.formatDate2Str(Date.today());
+ String rtn = null;
+ if (dt == null) {
+ return rtn;
+ }
+ rtn = String.valueOf(dt);
+ rtn = rtn.replaceAll('-', '');
+ if (rtn >= '40001231') {
+ rtn = '99991231';
+ } else if (rtn < '19000101') {
+ rtn = '19000101';
+ }
+ return rtn + '235959';
+ }
+ //涓婄彮寮�濮嬫椂闂�
+ public static String UpStartDt(){
+ String dt = NFMUtil.formatDate2Str(Date.today());
+ String rtn = null;
+ if (dt == null) {
+ return rtn;
+ }
+ rtn = String.valueOf(dt);
+ rtn = rtn.replaceAll('-', '');
+ if (rtn >= '40001231') {
+ rtn = '99991231';
+ } else if (rtn < '19000101') {
+ rtn = '19000101';
+ }
+ return rtn + '000000';
+ }
+ //涓婄彮缁撴潫鏃堕棿
+ public static String UpEndDt(){
+ String dt = NFMUtil.formatDate2Str(Date.today());
+ String rtn = null;
+ if (dt == null) {
+ return rtn;
+ }
+ rtn = String.valueOf(dt);
+ rtn = rtn.replaceAll('-', '');
+ if (rtn >= '40001231') {
+ rtn = '99991231';
+ } else if (rtn < '19000101') {
+ rtn = '19000101';
+ }
+ return rtn + '084459';
+ }
+ //涓婄彮瀹氫箟鏃堕棿
+ public static String UpDt(){
+ String dt = NFMUtil.formatDate2Str(Date.today());
+ String rtn = null;
+ if (dt == null) {
+ return rtn;
+ }
+ rtn = String.valueOf(dt);
+ rtn = rtn.replaceAll('-', '');
+ if (rtn >= '40001231') {
+ rtn = '99991231';
+ } else if (rtn < '19000101') {
+ rtn = '19000101';
+ }
+ return rtn + '090000';
+ }
+ //涓嬬彮瀹氫箟鏃堕棿
+ public static String DownDt(){
+ String dt = NFMUtil.formatDate2Str(Date.today());
+ String rtn = null;
+ if (dt == null) {
+ return rtn;
+ }
+ rtn = String.valueOf(dt);
+ rtn = rtn.replaceAll('-', '');
+ if (rtn >= '40001231') {
+ rtn = '99991231';
+ } else if (rtn < '19000101') {
+ rtn = '19000101';
+ }
+ return rtn + '170000';
+ }
+ //鎶ヤ环鏃ャ�佸垵娆℃姤浠锋棩銆丷C淇悊鍝丷C鍙楃悊鏃ワ紙灏忕▼搴忥級鏃堕棿鏂规硶 zyh 20220315 end
+
}
\ No newline at end of file
--
Gitblit v1.9.1