|
@@ -1,8 +1,6 @@
|
|
package fi.em.formPlugin;
|
|
package fi.em.formPlugin;
|
|
-import com.aliyun.odps.security.User;
|
|
|
|
import kd.bos.exception.KDBizException;
|
|
import kd.bos.exception.KDBizException;
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
import kd.bos.form.plugin.AbstractFormPlugin;
|
|
-import kd.bos.form.plugin.AbstractMobFormPlugin;
|
|
|
|
import kd.sdk.plugin.Plugin;
|
|
import kd.sdk.plugin.Plugin;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -18,21 +16,17 @@ import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
* @author cjz
|
|
* @author cjz
|
|
* @date 2024/7/25 15:13
|
|
* @date 2024/7/25 15:13
|
|
* @description:报销单移动端初始化表单
|
|
* @description:报销单移动端初始化表单
|
|
*/
|
|
*/
|
|
|
|
|
|
-public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements Plugin {
|
|
+public class ReimbursementMobFormPlugin extends AbstractFormPlugin implements Plugin {
|
|
- private final static String KEY_OK = "btnok";
|
|
+ private final static String KEY_OK = "nckd_btnok";
|
|
- private final static String KEY_CANCEL = "btncancel";
|
|
+ private final static String KEY_CANCEL = "nckd_btncancel";
|
|
- private final static String KEY_SEARCH = "search";
|
|
+ private final static String FORMID_ENTRY = "nckd_clearloanentry";
|
|
- private final static String FORMID_ENTRY = "nckd_entryentity";
|
|
|
|
private static String er_prepaybill = "er_prepaybill";
|
|
private static String er_prepaybill = "er_prepaybill";
|
|
-
|
|
|
|
|
|
|
|
* 页面点击事件
|
|
* 页面点击事件
|
|
*
|
|
*
|
|
@@ -53,13 +47,11 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
EntryGrid entryGrid = this.getView().getControl(FORMID_ENTRY);
|
|
EntryGrid entryGrid = this.getView().getControl(FORMID_ENTRY);
|
|
|
|
|
|
int[] selectRows = entryGrid.getSelectRows();
|
|
int[] selectRows = entryGrid.getSelectRows();
|
|
-
|
|
|
|
|
|
|
|
if (selectRows.length <= 0) {
|
|
if (selectRows.length <= 0) {
|
|
this.getView().showMessage("请先选择一条数据!");
|
|
this.getView().showMessage("请先选择一条数据!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
JSONArray infoJa = SerializationUtils.fromJsonString(listStr, JSONArray.class);
|
|
JSONArray infoJa = SerializationUtils.fromJsonString(listStr, JSONArray.class);
|
|
for (int i = 0; i < selectRows.length; i++) {
|
|
for (int i = 0; i < selectRows.length; i++) {
|
|
JSONObject reJo = infoJa.getJSONObject(selectRows[i]);
|
|
JSONObject reJo = infoJa.getJSONObject(selectRows[i]);
|
|
@@ -67,7 +59,6 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
}
|
|
}
|
|
HashMap<String, String> map = new HashMap<>();
|
|
HashMap<String, String> map = new HashMap<>();
|
|
map.put("reJaStr", reJa.toJSONString());
|
|
map.put("reJaStr", reJa.toJSONString());
|
|
-
|
|
|
|
|
|
|
|
this.getView().returnDataToParent(map);
|
|
this.getView().returnDataToParent(map);
|
|
}
|
|
}
|
|
@@ -81,7 +72,6 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
this.getView().close();
|
|
this.getView().close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void registerListener(EventObject e) {
|
|
public void registerListener(EventObject e) {
|
|
@@ -89,7 +79,6 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
|
|
|
|
this.addClickListeners(KEY_OK, KEY_CANCEL);
|
|
this.addClickListeners(KEY_OK, KEY_CANCEL);
|
|
}
|
|
}
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public void afterCreateNewData(EventObject e) {
|
|
public void afterCreateNewData(EventObject e) {
|
|
super.afterBindData(e);
|
|
super.afterBindData(e);
|
|
@@ -109,36 +98,26 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
QFilter nckd_orgamountFilter = new QFilter("costdept.number", QCP.equals, costdeptNumber);
|
|
QFilter nckd_orgamountFilter = new QFilter("costdept.number", QCP.equals, costdeptNumber);
|
|
nckd_orgamountFilter.and("billstatus", QCP.equals, "E");
|
|
nckd_orgamountFilter.and("billstatus", QCP.equals, "E");
|
|
nckd_orgamountFilter.and("creator.number",QCP.equals,creatorNumber);
|
|
nckd_orgamountFilter.and("creator.number",QCP.equals,creatorNumber);
|
|
-
|
|
|
|
DynamicObject[] nckd_orgamountaccount = BusinessDataServiceHelper.
|
|
DynamicObject[] nckd_orgamountaccount = BusinessDataServiceHelper.
|
|
load(er_prepaybill, "id,number", new QFilter[]{nckd_orgamountFilter});
|
|
load(er_prepaybill, "id,number", new QFilter[]{nckd_orgamountFilter});
|
|
-
|
|
|
|
for (int c=0;c<nckd_orgamountaccount.length;c++){
|
|
for (int c=0;c<nckd_orgamountaccount.length;c++){
|
|
|
|
|
|
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(nckd_orgamountaccount[c].getPkValue(), nckd_orgamountaccount[c].getDynamicObjectType().getName());
|
|
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle(nckd_orgamountaccount[c].getPkValue(), nckd_orgamountaccount[c].getDynamicObjectType().getName());
|
|
-
|
|
|
|
String billno= dynamicObject.getString("billno");
|
|
String billno= dynamicObject.getString("billno");
|
|
|
|
|
|
for (DynamicObject entryentity : dynamicObject.getDynamicObjectCollection("expenseentryentity")) {
|
|
for (DynamicObject entryentity : dynamicObject.getDynamicObjectCollection("expenseentryentity")) {
|
|
-
|
|
|
|
|
|
|
|
DynamicObject entrycostdept = entryentity.getDynamicObject("entrycostdept");
|
|
DynamicObject entrycostdept = entryentity.getDynamicObject("entrycostdept");
|
|
-
|
|
|
|
|
|
|
|
DynamicObject expenseitem=entryentity.getDynamicObject("expenseitem");
|
|
DynamicObject expenseitem=entryentity.getDynamicObject("expenseitem");
|
|
-
|
|
|
|
|
|
|
|
BigDecimal expenseamount=entryentity.getBigDecimal("expenseamount");
|
|
BigDecimal expenseamount=entryentity.getBigDecimal("expenseamount");
|
|
-
|
|
|
|
|
|
|
|
BigDecimal exporiusedamount=entryentity.getBigDecimal("exporiusedamount");
|
|
BigDecimal exporiusedamount=entryentity.getBigDecimal("exporiusedamount");
|
|
-
|
|
|
|
|
|
|
|
BigDecimal orgiexpebalanceamount=entryentity.getBigDecimal("orgiexpebalanceamount");
|
|
BigDecimal orgiexpebalanceamount=entryentity.getBigDecimal("orgiexpebalanceamount");
|
|
-
|
|
|
|
|
|
|
|
String remark=entryentity.getString("remark");
|
|
String remark=entryentity.getString("remark");
|
|
-
|
|
|
|
|
|
|
|
int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
|
|
int rowIndex = this.getModel().createNewEntryRow(FORMID_ENTRY);
|
|
|
|
|
|
@@ -148,7 +127,7 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
this.getModel().setValue("nckd_expenseamount",expenseamount,rowIndex);
|
|
this.getModel().setValue("nckd_expenseamount",expenseamount,rowIndex);
|
|
this.getModel().setValue("nckd_exporiusedamount",exporiusedamount,rowIndex);
|
|
this.getModel().setValue("nckd_exporiusedamount",exporiusedamount,rowIndex);
|
|
this.getModel().setValue("nckd_unexporiusedamount",orgiexpebalanceamount,rowIndex);
|
|
this.getModel().setValue("nckd_unexporiusedamount",orgiexpebalanceamount,rowIndex);
|
|
- this.getModel().setValue("nckd_remarke",remark,rowIndex);
|
|
+ this.getModel().setValue("nckd_remark",remark,rowIndex);
|
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
JSONObject obj = new JSONObject();
|
|
|
|
|
|
@@ -166,7 +145,4 @@ public class ReimbursementMobFormPlugin extends AbstractMobFormPlugin implements
|
|
String listStr = SerializationUtils.toJsonString(resdate);
|
|
String listStr = SerializationUtils.toJsonString(resdate);
|
|
this.getPageCache().put(pageId, listStr);
|
|
this.getPageCache().put(pageId, listStr);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|