Compare commits

..

No commits in common. "b42bc3afb8f873a777b276bff22f9d2dcd15a583" and "65ee65cd30e95ced83adeed577f5d1354dcd6656" have entirely different histories.

1 changed files with 0 additions and 108 deletions

View File

@ -1,108 +0,0 @@
package shkd.repc.resm.formplugin;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.entity.ILocaleString;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.sdk.plugin.Plugin;
import java.util.EventObject;
import java.util.Iterator;
/**
* 单据界面插件
*/
public class BringScoreDescribeSummaryPlugin extends AbstractBillPlugIn implements Plugin {
/*
* 考察任务-考察任务汇总评分时将我的考察中评分说明带到考察结果中
* */
@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
String openType = (String) this.getView().getFormShowParameter().getCustomParam("opentype");
String billStatus = this.getModel().getDataEntity().getString("billstatus");
DynamicObject dataEntity = this.getModel().getDataEntity();
DynamicObject examTaskSummary = QueryServiceHelper.queryOne("resm_examtask_summary", "id", (new QFilter("evaltask", "=", dataEntity.getPkValue())).toArray());
if (examTaskSummary == null) {
if (!StringUtils.isEmpty(openType) && "sumup".equals(openType) && "ORDERED".equals(billStatus)) {
DynamicObject[] myEvals = BusinessDataServiceHelper.load("resm_myexam", "creator.name,evalrole,entry_evalscore.score,entry_evalscore.evalindex,entry_evalscore.coredesc,entry_evalscore.qeug_scoredesc,entry_evalscore.evalator,entry_evalscore.evalator.name,opinionplus", new QFilter[]{new QFilter("evaltask", "=", dataEntity.getPkValue())});
DynamicObjectCollection evalDetailEntry = this.getModel().getEntryEntity("entry_evaldetail");
for (int i = 0; i < evalDetailEntry.size(); ++i) {
DynamicObject evalDetailEntryRow = (DynamicObject) evalDetailEntry.get(i);
String myEvalDesc = "";
DynamicObject evaluatorBill = BusinessDataServiceHelper.loadSingle("resm_evaluator", "evalentryid,entry_evaluator.user,entry_evaluator.role,entry_evaluator.user.name,entry_evaluator.weight", new QFilter[]{new QFilter("evalentryid", "=", String.valueOf(evalDetailEntryRow.getPkValue()))});
if (evaluatorBill != null) {
for (int j = 0; j < myEvals.length; ++j) {
DynamicObject myEval = myEvals[j];
DynamicObjectCollection evalScoreEntry = myEval.getDynamicObjectCollection("entry_evalscore");
label93:
for(int k = 0; k < evalScoreEntry.size(); ++k) {
DynamicObject evalScoreEntryRow = (DynamicObject)evalScoreEntry.get(k);
if (evalDetailEntryRow.getDynamicObject("evalindex") != null && evalScoreEntryRow.getDynamicObject("evalindex") != null && evalDetailEntryRow.getDynamicObject("evalindex").getPkValue().equals(evalScoreEntryRow.getDynamicObject("evalindex").getPkValue())) {
DynamicObjectCollection evaluatorEntry = evaluatorBill.getDynamicObjectCollection("entry_evaluator");
Iterator var22 = evaluatorEntry.iterator();
while(true) {
while(true) {
if (!var22.hasNext()) {
continue label93;
}
DynamicObject evaluatorEntryRow = (DynamicObject)var22.next();
if (evaluatorEntryRow.getDynamicObject("user") != null && evalScoreEntryRow.getDynamicObject("evalator") != null) {
if (evaluatorEntryRow.getDynamicObject("user").getPkValue().equals(evalScoreEntryRow.getDynamicObject("evalator").getPkValue())) {
myEvalDesc = myEvalDesc + this.assembleUserMyEvalDesc(evalScoreEntryRow, evaluatorEntryRow);
}
} else if (myEval.getDynamicObject("evalrole") != null && evaluatorEntryRow.getDynamicObject("role") != null && evaluatorEntryRow.getDynamicObject("role").getPkValue().equals(myEval.getDynamicObject("evalrole").getPkValue())) {
myEvalDesc = myEvalDesc + this.assembleRoleMyEvalDesc(myEval, evalScoreEntryRow, evaluatorEntryRow);
}
}
}
}
}
}
}
this.getModel().setValue("qeug_myevaldesc", this.trimDescValue(myEvalDesc), i);
}
}
}
}
protected String assembleUserMyEvalDesc(DynamicObject evalScoreEntryRow, DynamicObject evaluatorEntryRow) {
String result = evaluatorEntryRow.getDynamicObject("user").getString("name") + "";
ILocaleString localeString = evalScoreEntryRow.getLocaleString("qeug_scoredesc");
if (localeString != null && !localeString.isEmpty() && localeString.getLocaleValue() != null && !localeString.getLocaleValue().isEmpty()) {
result = result + localeString.getLocaleValue();
return result + "\n";
} else {
return "";
}
}
protected String assembleRoleMyEvalDesc(DynamicObject myEval, DynamicObject evalScoreEntryRow, DynamicObject evaluatorEntryRow) {
String result = myEval.getString("creator.name") + "";
ILocaleString localeString = evalScoreEntryRow.getLocaleString("qeug_scoredesc");
if (localeString != null && !localeString.isEmpty() && localeString.getLocaleValue() != null && !localeString.getLocaleValue().isEmpty()) {
result = result + localeString.getLocaleValue();
return result + "\n";
} else {
return "";
}
}
protected String trimDescValue(String desc) {
return desc.isEmpty() ? "" : desc.substring(0, desc.lastIndexOf("") < 0 ? desc.length() - 1 : desc.lastIndexOf(""));
}
}