19626
2023-05-09 3d312e60e65de7bd0194c50ae26d11c7a4d4fc73
review update
11个文件已修改
117 ■■■■ 已修改文件
.vscode/settings.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/LightingButtonConstant.cls 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/MonthlyReportController.cls 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/classes/ReportController.cls 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vscode/settings.json
@@ -3,5 +3,6 @@
    "**/node_modules": true,
    "**/bower_components": true,
    "**/.sfdx": true
  }
  },
  "editor.suggest.snippetsPreventQuickSuggestions": false
}
force-app/main/default/classes/LightingButtonConstant.cls
@@ -86,6 +86,9 @@
    public static final String CN_NO = '否';
    public static final String VOC_NAME = 'VOC';
    public static final String OK = 'OK';
    public static final String LU_SHENG_NAME = '陆 胜';
    public static final String HU_DI_AN_NAME = '胡 迪安';
    public static final String SYSTEM_PROFILE_NAME = '系统管理员';
    public static final String SOBJECT_NAME_OF_REPORT_SHARE ='Report__Share';
    public static final String  SOBJECT_NAME_OF_VOC_SHARE = 'VOCShare__c';
    public static final String REPAIR_FIELD_DOJ_STATUS_NOT_OBJECT = '非对象';
force-app/main/default/classes/MonthlyReportController.cls
@@ -5,7 +5,8 @@
        InitData res = new initData();
        try{
            Monthly_Report__c report = [SELECT     OwnerId,Id,Next_week_plan__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1];
            res.OwnerId = report.OwnerId;
            res.ownerId = report.OwnerId;
            res.userId = UserInfo.getUserId();
            res.Id = report.Id;
            res.nextWeekPlan = report.Next_week_plan__c;
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
@@ -73,7 +74,7 @@
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String OwnerId;
        public String ownerId;
        @AuraEnabled
        public String ownerEmail;
        @AuraEnabled
@@ -92,5 +93,7 @@
        public String drSumUrl;
        @AuraEnabled
        public String userEmail;
        @AuraEnabled
        public String userId;
    }
}
force-app/main/default/classes/ReportController.cls
@@ -10,6 +10,10 @@
            Report__c report = [select Status__c from Report__c where Id = :recordId];
            res.status = report.Status__c;
            res.profileId = UserInfo.getProfileId();
            res.userId = UserInfo.getUserId();
            res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME);
            res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME);
            res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME);
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        } catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -26,6 +30,10 @@
            res.isVOC = report.IsVOC__c;
            res.personId = report.Responsible_Person__r.Id;
            res.profileId = UserInfo.getProfileId();
            res.userId = UserInfo.getUserId();
            res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME);
            res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME);
            res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME);
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        } catch (Exception e) {
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -218,10 +226,10 @@
    //给提交相应的js提供初始化数据
    @AuraEnabled
    public static String updateForSubmitButton(String reocrdId){
    public static String updateForSubmitButton(String recordId){
        try {
            Report__c rac = new Report__c();
            rac.Id = reocrdId;
            rac.Id = recordId;
            rac.Status__c = LightingButtonConstant.RECORD_TYPE_NAME_BY_SUBMIT;
            rac.Submit_time__c = Datetime.now();
            rac.Submit_report_day__c = Date.today();
@@ -539,6 +547,26 @@
            return eMessage.substring(left,right);
        }
    }
    @AuraEnabled
    public static string getUserIdByName(String name){
        User user = null;
        try {
            user = [select Id from User where Name =:name];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return user.Id;
    }
    @AuraEnabled
    public static string getProfileIdByName(String name){
        Profile profile = null;
        try {
            profile = [select Id from Profile where Name =:name];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return profile.Id;
    }
    public class InitData{
        @AuraEnabled
        public String status;
@@ -576,7 +604,12 @@
        public String DeveloperName;
        @AuraEnabled
        public String userId;
        @AuraEnabled
        public String luShengId;
        @AuraEnabled
        public String huDiAnId;
        @AuraEnabled
        public String systemProfileId;
        
force-app/main/default/lwc/lexCancelSubmit/lexCancelSubmit.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-04-07 09:02:03
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 11:17:24
 * @LastEditTime: 2023-05-09 17:42:28
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -19,6 +19,7 @@
    @api recordId;//OwnerId
    ownerId;
    monthlyReportId;
    userId;
    IsLoading = true;
@@ -46,9 +47,9 @@
            console.log(result);
            if (result != null) {
                this.ownerId = result.ownerId;
                this.userId = result.userId;
                this.monthlyReportId = result.Id;
                this.cancelSubmit();
                console.log("end");
                //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Monthly_Report__c/" + this.monthlyReportId + "/view");
            }
        }).catch(error => {
@@ -69,8 +70,7 @@
        updateRecord({fields: { Id: recordId }});
    }
    cancelSubmit () {
        //需要完善
        if(this.ownerId == UserInfo_Owner.Id) {
        if(this.ownerId == this.userId) {
            cancel({
                recordId: this.recordId
            }).then(result=>{
force-app/main/default/lwc/lexOCSMNoToReportForReport/lexOCSMNoToReportForReport.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-28 15:59:44
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 11:24:51
 * @LastEditTime: 2023-05-09 15:20:58
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -13,6 +13,7 @@
import updateForOCSMNoToReportButton  from '@salesforce/apex/ReportController.updateForOCSMNoToReportButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import insertAwareDate from '@salesforce/apex/ReportController.updateForOCSMNoToReportButton';
export default class LexOCSMNoToReportForReport extends LightningElement {
    @api recordId;
    IsLoading = true;
@@ -78,6 +79,7 @@
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
        this.AwareDate = Date.now();
        if(this.AwareDate != undefined ){
           updateForOCSMNoToReportButton({
                recordId: this.recordId
force-app/main/default/lwc/lexVOCAnswer/lexVOCAnswer.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 14:05:59
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 11:30:45
 * @LastEditTime: 2023-05-09 10:21:25
 */
import { LightningElement, wire, track, api } from "lwc";
import { CurrentPageReference } from "lightning/navigation";
@@ -70,6 +70,7 @@
  update() {
    if (this.status != "已分配") {
      this.showToast("不是已分配不能点击", "error");
      this.dispatchEvent(new CloseActionScreenEvent());
      return;
    }
    updateForVOCAnswerButton({
@@ -78,7 +79,6 @@
      if (result) {
        this.showToast(result,"error");
      } else {
        this.showToast("成功", "success");
        this.updateRecordView(this.recordId);
      }
      this.Isloading = false;
force-app/main/default/lwc/lexVOCCheck/lexVOCCheck.js
@@ -6,7 +6,8 @@
import VOCCheck  from '@salesforce/apex/ReportController.updateForVOCCheckButton';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import getUserIdByName from '@salesforce/apex/ReportController.getUserIdByName';
import getProfileIdByName from '@salesforce/apex/ReportController.getProfileIdByName';
export default class LexVOCCheck extends LightningElement {
    
    @api recordId;
@@ -14,6 +15,10 @@
    isVOC;
    personId;
    profileId;
    userId;
    systemProfileId;
    luShengId;
    huDiAnId;
    Isloading = true;
    @wire(CurrentPageReference)
@@ -40,11 +45,14 @@
        }).then(result => {
            console.log(result);
            if (result != null) {  
                this.userId = result.userId;
                this.status = result.status;
                this.isVOC = result.isVOC;
                this.personId = result.personId;
                this.profileId = result.profileId;
                this.systemProfileId = result.systemProfileId;
                this.luShengId = result.luShengId;
                this.huDiAnId = result.huDiAnId;
                console.log(this.status); 
                this.check();
                //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
@@ -68,10 +76,23 @@
        });
        this.dispatchEvent(event);
      }
    getUserId(userName){
        getUserIdByName({
            name : userName
        }).then(reuslt=>{
            return reuslt;
        });
    }
    getProfileId(profileName){
        getProfileIdByName({
            name : profileName
        }).then(reuslt=>{
            return reuslt;
        });
    }
    check (){
        // 陆胜,胡迪安,系统管理员可点(需要调整)
        if (UserInfo_Owner.Id != "00510000000gWAE" && UserInfo_Owner.Id != "00510000004reg2" && this.profileId != "00e10000000Y3o5AAC") {
        if (this.userId != this.luShengId && this.userId != this.huDiAnId && this.profileId != this.systemProfileId) {
                this.showToast("你没有判定VOC的权限","error");
                this.dispatchEvent(new CloseActionScreenEvent());
                return;
@@ -96,7 +117,6 @@
                if(result){
                    this.showToast(result,"error");
                }else{
                    this.showToast("成功","success");
                    this.updateRecordView(this.recordId);
                }
                this.Isloading = false;   
force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 14:08:56
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 11:33:01
 * @LastEditTime: 2023-05-09 10:04:33
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -94,7 +94,6 @@
                this.showToast(result,"error");
            }else{
                this.updateRecordView(this.recordId);
                this.showToast("成功","success");
            }
            this.Isloading = false;
            this.dispatchEvent(new CloseActionScreenEvent());
force-app/main/default/lwc/lexVOCFinish/lexVOCFinish.js
@@ -4,14 +4,13 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 14:11:17
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 11:34:01
 * @LastEditTime: 2023-05-09 17:10:14
 */
import { api, wire,LightningElement } from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import init  from '@salesforce/apex/ReportController.initForVOCFinishButton';
import update  from '@salesforce/apex/ReportController.updateForVOCFinishButton';
import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
import { updateRecord } from 'lightning/uiRecordApi';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class LexVOCFinish extends LightningElement {
@@ -19,6 +18,10 @@
    status;
    IsLoading = true;
    profileId;
    luShengId;
    userId;
    huDiAnId;
    systemProfileId;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference) {
@@ -45,6 +48,10 @@
            if (result != null) {
                this.status = result.status;
                this.profileId = result.profileId;
                this.userId = result.userId;
                this.luShengId = result.luShengId;
                this.huDiAnId = result.huDiAnId;
                this.systemProfileId = result.systemProfileId;
                this.VOCFinish();
            }
        }).catch(error => {
@@ -70,7 +77,7 @@
    }
    VOCFinish () {
        if (UserInfo_Owner.Id != "00510000000gWAE" && UserInfo_Owner.Id != "00510000004reg2" && this.profileId != "00e10000000Y3o5AAC") {
        if (this.userId != this.luShengId && this.userId != this.huDiAnId && this.profileId != this.systemProfileId) {
            this.showToast("你没有完毕VOC的权限","error");
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
force-app/main/default/lwc/lexVOCSubmit/lexVOCSubmit.js
@@ -4,7 +4,7 @@
 * @Author: chen jing wu
 * @Date: 2023-03-27 13:39:23
 * @LastEditors: chen jing wu
 * @LastEditTime: 2023-04-11 11:35:31
 * @LastEditTime: 2023-05-09 10:15:43
 */
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
@@ -81,7 +81,6 @@
                if(result){
                    this.showToast(result,"error");
                }else{
                    this.showToast("成功","success");
                    this.updateRecordView(this.recordId);
                }
                this.IsLoading = false;