fix:询价单替换

This commit is contained in:
ljw 2024-09-20 21:28:50 +08:00
parent 8c13ff38a2
commit fe50c336ee

View File

@ -80,37 +80,40 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
public static void optionalOperation(IDataModel model, IFormView view, String formId, String operationNumber) {
String name = model.getDataEntity().getDataEntityType().getName();
int currentRowIndex = -1;
if("yem_es_salesorder".equals(name)||"yem_es_xsalesorder".equals(name)){
if ("yem_es_salesorder".equals(name) || "yem_es_xsalesorder".equals(name)) {
currentRowIndex = model.getEntryCurrentRowIndex("yem_es_materialinfo");
}
if("yem_im_clientdemand".equals(name) || "yem_im_inquirylist".equals(name)){
if ("yem_im_clientdemand".equals(name) || "yem_im_inquirylist".equals(name)) {
currentRowIndex = model.getEntryCurrentRowIndex("yem_im_detailedinfor");
}
DynamicObject billType = (DynamicObject) model.getValue("yem_billtype");
DynamicObjectCollection yem_im_detailedinfor = model.getEntryEntity("yem_im_detailedinfor");
Map<String, Object> map = new HashMap<>();
List<Long> ids = new ArrayList();
DynamicObject productModel = (DynamicObject) model.getValue("yem_productmodel", currentRowIndex);
DynamicObject products = yem_im_detailedinfor.get(0).getDynamicObject("yem_productmodel.yem_products");
for (DynamicObject dynamicObject : yem_im_detailedinfor) {
DynamicObject productModel = (DynamicObject)model.getValue("yem_productmodel",currentRowIndex);
DynamicObject products = dynamicObject.getDynamicObject("yem_productmodel.yem_products");
DynamicObjectCollection yem_multiconfig = dynamicObject.getDynamicObjectCollection("yem_multiconfig");
if (yem_multiconfig != null) {
Map<String, Object> map = new HashMap<>();
List<Long> ids = new ArrayList();
// int multiConfigRows = model.getEntryRowCount("yem_multiconfig");
for (DynamicObject object : yem_multiconfig) {
// String configurType = (String) model.getValue("yem_configurtype", i);
Long configEntryId = object.getLong("yem_configentryid");
ids.add(configEntryId);
}
map.put("billTypeNumber", billType.getString("number"));
map.put("products", products.getPkValue());
map.put("operationNumber", operationNumber);
map.put("type", "B");
map.put("ids", ids);
map.put("productModel", productModel);
viewForm(formId, map, view);
}
}
map.put("billTypeNumber", billType.getString("number"));
map.put("products", products.getPkValue());
map.put("operationNumber", operationNumber);
map.put("type", "B");
map.put("ids", ids);
map.put("productModel", productModel);
viewForm(formId, map, view);
}