|
@@ -2,6 +2,7 @@ package fi.em.formPlugin;
|
|
|
import com.aliyun.odps.security.User;
|
|
|
import kd.bos.exception.KDBizException;
|
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
|
+import kd.fi.er.mservice.ext.IErService4Ext;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -22,15 +23,15 @@ import java.util.*;
|
|
|
|
|
|
* @author cjz
|
|
|
* @date 2024/7/25 15:13
|
|
|
- * @description:报销单初始化表单
|
|
|
+ * @description:报预付借款单单初始化表单
|
|
|
*/
|
|
|
|
|
|
public class ReimbursementFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
|
private final static String KEY_OK = "btnok";
|
|
|
private final static String KEY_CANCEL = "btncancel";
|
|
|
- private final static String KEY_SEARCH = "search";
|
|
|
private final static String FORMID_ENTRY = "nckd_entryentity";
|
|
|
private static String er_prepaybill = "er_prepaybill";
|
|
|
+ private static String nckd_er_prepaybill_ext="nckd_er_prepaybill_ext";
|
|
|
|
|
|
|
|
|
* 页面点击事件
|
|
@@ -72,7 +73,7 @@ public class ReimbursementFormPlugin extends AbstractFormPlugin implements Plugi
|
|
|
}
|
|
|
this.getView().close();
|
|
|
} else if (StringUtils.equals(source.getKey(), KEY_CANCEL)) {
|
|
|
-
|
|
|
+
|
|
|
this.getView().returnDataToParent(null);
|
|
|
this.getView().close();
|
|
|
} else {
|
|
@@ -108,57 +109,58 @@ public class ReimbursementFormPlugin extends AbstractFormPlugin implements Plugi
|
|
|
QFilter nckd_orgamountFilter = new QFilter("costdept.number", QCP.equals, costdeptNumber);
|
|
|
nckd_orgamountFilter.and("billstatus", QCP.equals, "E");
|
|
|
nckd_orgamountFilter.and("creator.number",QCP.equals,creatorNumber);
|
|
|
-
|
|
|
DynamicObject[] nckd_orgamountaccount = BusinessDataServiceHelper.
|
|
|
- load(er_prepaybill, "id,number", new QFilter[]{nckd_orgamountFilter});
|
|
|
+ load(er_prepaybill, "id", new QFilter[]{nckd_orgamountFilter});
|
|
|
|
|
|
for (int c=0;c<nckd_orgamountaccount.length;c++){
|
|
|
|
|
|
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(nckd_orgamountaccount[c].getPkValue(), nckd_orgamountaccount[c].getDynamicObjectType().getName());
|
|
|
-
|
|
|
+
|
|
|
String billno= dynamicObject.getString("billno");
|
|
|
|
|
|
for (DynamicObject entryentity : dynamicObject.getDynamicObjectCollection("expenseentryentity")) {
|
|
|
-
|
|
|
|
|
|
DynamicObject entrycostdept = entryentity.getDynamicObject("entrycostdept");
|
|
|
-
|
|
|
|
|
|
DynamicObject expenseitem=entryentity.getDynamicObject("expenseitem");
|
|
|
-
|
|
|
|
|
|
BigDecimal expenseamount=entryentity.getBigDecimal("expenseamount");
|
|
|
-
|
|
|
|
|
|
- BigDecimal exporiusedamount=entryentity.getBigDecimal("exporiusedamount");
|
|
|
-
|
|
|
-
|
|
|
- BigDecimal orgiexpebalanceamount=entryentity.getBigDecimal("orgiexpebalanceamount");
|
|
|
-
|
|
|
+ BigDecimal exporiusedamount=entryentity.getBigDecimal("nckd_unsettleamount_et");
|
|
|
+
|
|
|
+ BigDecimal orgiexpebalanceamount=entryentity.getBigDecimal("nckd_unsettleamount_et");
|
|
|
|
|
|
String remark=entryentity.getString("remark");
|
|
|
|
|
|
-
|
|
|
- int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
|
|
|
-
|
|
|
- this.getModel().setValue("nckd_billno",billno,rowIndex);
|
|
|
- this.getModel().setValue("nckd_entrycostdept",entrycostdept,rowIndex);
|
|
|
- this.getModel().setValue("nckd_expenseitem",expenseitem,rowIndex);
|
|
|
- this.getModel().setValue("nckd_expenseamount",expenseamount,rowIndex);
|
|
|
- this.getModel().setValue("nckd_exporiusedamount",exporiusedamount,rowIndex);
|
|
|
- this.getModel().setValue("nckd_unexporiusedamount",orgiexpebalanceamount,rowIndex);
|
|
|
- this.getModel().setValue("nckd_remarke",remark,rowIndex);
|
|
|
-
|
|
|
- JSONObject obj = new JSONObject();
|
|
|
-
|
|
|
- obj.put("nckd_billno",billno);
|
|
|
- obj.put("nckd_entrycostdept",entrycostdept.getString("number"));
|
|
|
- obj.put("nckd_expenseitem",expenseitem.getString("number"));
|
|
|
- obj.put("nckd_expenseamount",expenseamount);
|
|
|
- obj.put("nckd_exporiusedamount",exporiusedamount);
|
|
|
- obj.put("nckd_unexporiusedamount",orgiexpebalanceamount);
|
|
|
- obj.put("nckd_remark",remark);
|
|
|
- resdate.add(obj);
|
|
|
+ Long id=entryentity.getLong("id");
|
|
|
+
|
|
|
+ if (orgiexpebalanceamount.compareTo(BigDecimal.ZERO)>0)
|
|
|
+ {
|
|
|
+
|
|
|
+ int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
|
|
|
+
|
|
|
+ this.getModel().setValue("nckd_bigintfield",id,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_billno",billno,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_entrycostdept",entrycostdept,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_expenseitem",expenseitem,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_expenseamount",expenseamount,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_exporiusedamount",exporiusedamount,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_unexporiusedamount",orgiexpebalanceamount,rowIndex);
|
|
|
+ this.getModel().setValue("nckd_remarke",remark,rowIndex);
|
|
|
+
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+
|
|
|
+ obj.put("nckd_billno",billno);
|
|
|
+ obj.put("nckd_entrycostdept",entrycostdept.getString("number"));
|
|
|
+ obj.put("nckd_expenseitem",expenseitem.getString("number"));
|
|
|
+ obj.put("nckd_expenseamount",expenseamount);
|
|
|
+ obj.put("nckd_exporiusedamount",exporiusedamount);
|
|
|
+ obj.put("nckd_unexporiusedamount",orgiexpebalanceamount);
|
|
|
+ obj.put("nckd_remark",remark);
|
|
|
+ obj.put("nckd_bigintfield",id);
|
|
|
+ resdate.add(obj);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
String pageId = this.getView().getPageId();
|
|
@@ -167,5 +169,4 @@ public class ReimbursementFormPlugin extends AbstractFormPlugin implements Plugi
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|