parent
f383fda1f6
commit
4c83d98db0
|
|
@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -67,8 +67,10 @@ 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();
|
||||||
ChangeData[] changeSet = e.getChangeSet();
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
ChangeData changeData = changeSet[0];
|
ChangeData changeData = changeSet[0];
|
||||||
|
|
@ -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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue