1.成本调整单带出单位

2.付款单bug修复
This commit is contained in:
龚豆豆 2025-10-27 11:30:06 +08:00
parent f383fda1f6
commit 4c83d98db0
2 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,43 @@
package tqq9.lc123.cloud.app.api.plugin;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.openapi.api.plugin.ApiSavePlugin;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 单据操作插件
*/
public class CostAdjustSavePlugin implements ApiSavePlugin {
private final static Log logger = LogFactory.getLog(CostAdjustSavePlugin.class);
@Override
public List<Map<String, Object>> preHandleRequestData(List<Map<String, Object>> reqData) {
for (Map<String, Object> reqDatum : reqData) {
List<Map<String, Object>> entryentity = (List<Map<String, Object>>) reqDatum.get("entryentity");
for (Map<String, Object> entryMap : entryentity) {
HashMap material = (HashMap)entryMap.get("material");
String number = material.get("number").toString();
DynamicObject bd_material = BusinessDataServiceHelper.loadSingle("bd_material", new QFilter[]{new QFilter("number", QCP.equals, number)});
String baseunit_number = bd_material.getString("baseunit.number");
HashMap<String, String> baseunit = new HashMap<>();
baseunit.put("number", baseunit_number);
entryMap.put("baseunit",baseunit);
}
reqDatum.put("entryentity", entryentity);
}
return ApiSavePlugin.super.preHandleRequestData(reqData);
}
}

View File

@ -67,6 +67,8 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
this.getModel().setValue("tqq9_licenseno", substring, rowIndex); this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
} }
} }
this.getView().updateView();
} }
if (StringUtils.equals("tqq9_zczh", key)) { if (StringUtils.equals("tqq9_zczh", key)) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
@ -86,8 +88,9 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
this.getModel().setValue("tqq9_licenseno", substring, rowIndex); this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
} }
} }
this.getView().updateView();
} }
this.getView().updateView();
} }
} }