From 5b5c1e16deaa3a9d6d0ed1ffca390655ed103df7 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 14 七月 2023 14:56:14 +0800
Subject: [PATCH] lex community
---
force-app/main/default/classes/LexConsumableController.cls | 74 ++++++------------------------------
1 files changed, 13 insertions(+), 61 deletions(-)
diff --git a/force-app/main/default/classes/LexConsumableController.cls b/force-app/main/default/classes/LexConsumableController.cls
index 853872e..870954c 100644
--- a/force-app/main/default/classes/LexConsumableController.cls
+++ b/force-app/main/default/classes/LexConsumableController.cls
@@ -207,11 +207,7 @@
ESetId = esetId;
methodType = type;
if (String.isBlank(methodType) && String.isNotBlank(ESetId)) {
- 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];
methodType = oclist.get(0).orderPattern__c;
}
statusEdit = keywordStr;
@@ -236,11 +232,7 @@
userId = UserInfo.getUserId();
List<user> Useracc = new List<user>();
//lt 20230517 瀹夊窘涓ょエ鍒� add ,OSHFLG__c
- 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];
accountid = Useracc[0].accountid;
userWorkLocation = Useracc[0].Work_Location__c;
agencyProType = Useracc[0].UserPro_Type__c;
@@ -559,11 +551,7 @@
// attachmentRecoeds.add(new ConsumableorderdetailsInfo(attachmentinfo[i]));
// }
// }
- List<ContentDocumentLink> links = [
- SELECT Id, ContentDocumentId
- FROM ContentDocumentLink
- WHERE LinkedEntityId = :ESetId
- ];
+ List<ContentDocumentLink> links = [SELECT Id, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :ESetId];
if (links != null && links.size() > 0) {
List<String> documentIds = new List<String>();
for (ContentDocumentLink link : links) {
@@ -1491,11 +1479,7 @@
ESetId = eSetidStr;
try {
statusEdit = 'Redirect';
- 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];
String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c;
results.result = 'Success';
results.url = url;
@@ -1515,11 +1499,7 @@
returnOrder = true;
try {
statusEdit = 'Redirect';
- 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];
String url = '/lexconsumable?ESetid=' + ESetid + '&KeyWords=' + statusEdit + '&type=' + oclist.get(0).orderPattern__c;
results.result = 'Success';
results.url = url;
@@ -1543,11 +1523,7 @@
cv.VersionData = EncodingUtil.base64Decode(base64Data);
cv.IsMajorVersion = true;
insert cv;
- 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];
c.Consumable_pdf_insert_day__c = Date.today();
update c;
results.result = 'Success';
@@ -1912,11 +1888,7 @@
p.orderPattern__c = methodType;
}
insert p;
- 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];
for (ConsumableorderdetailsInfo ass : consumableorderdetailsRecordsview) {
Roll = Roll + 1;
if (ass.check == true) {
@@ -2009,11 +1981,7 @@
p.Offers_Price__c = bargainPrice;
}
update p;
- 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];
List<Consumable_Orderdetails__c> qs = new List<Consumable_Orderdetails__c>();
qs = [
SELECT Id
@@ -2099,29 +2067,13 @@
public static Results deleteAtt(String contentVersionId, String cocId) {
Results results = new Results();
try {
- List<ContentVersion> cvInfo = [
- SELECT Id
- FROM ContentVersion
- WHERE FirstPublishLocationId = :cocId
- ];
- ContentVersion conVersion = [
- SELECT ContentDocumentId
- FROM ContentVersion
- WHERE Id = :contentVersionId
- ];
+ 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
- ];
+ 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
- ];
+ Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id = :cocId];
c.Consumable_pdf_insert_day__c = null;
update c;
}
@@ -2360,4 +2312,4 @@
@AuraEnabled
public String value;
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.1