fix:询价单过滤
This commit is contained in:
parent
8fd73f664a
commit
cc363d3e8d
@ -9,7 +9,9 @@ import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|||||||
import kd.bos.entity.datamodel.IDataModel;
|
import kd.bos.entity.datamodel.IDataModel;
|
||||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
import kd.bos.entity.operate.result.OperationResult;
|
import kd.bos.entity.operate.result.OperationResult;
|
||||||
|
import kd.bos.form.FormShowParameter;
|
||||||
import kd.bos.form.IFormView;
|
import kd.bos.form.IFormView;
|
||||||
|
import kd.bos.form.ShowType;
|
||||||
import kd.bos.form.control.EntryGrid;
|
import kd.bos.form.control.EntryGrid;
|
||||||
import kd.bos.form.events.AfterDoOperationEventArgs;
|
import kd.bos.form.events.AfterDoOperationEventArgs;
|
||||||
import kd.bos.form.field.BasedataEdit;
|
import kd.bos.form.field.BasedataEdit;
|
||||||
@ -21,10 +23,7 @@ import kd.bos.orm.query.QFilter;
|
|||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.EventObject;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author power
|
* @author power
|
||||||
@ -45,13 +44,13 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
|
|||||||
OperationResult operationResult = e.getOperationResult();
|
OperationResult operationResult = e.getOperationResult();
|
||||||
switch (operateKey) {
|
switch (operateKey) {
|
||||||
case "optionaloperation":
|
case "optionaloperation":
|
||||||
FunctionalCommon.optionalOperation(model, view, "yem_optional", "optionaloperation");
|
optionalOperation(model, view, "yem_optional", "optionaloperation");
|
||||||
break;
|
break;
|
||||||
case "replaceoperation":
|
case "replaceoperation":
|
||||||
FunctionalCommon.optionalOperation(model, view, "yem_replace", "replaceoperation");
|
optionalOperation(model, view, "yem_replace", "replaceoperation");
|
||||||
break;
|
break;
|
||||||
case "retrofittingoperation":
|
case "retrofittingoperation":
|
||||||
FunctionalCommon.optionalOperation(model, view, "yem_retrofitting", "retrofittingoperation");
|
optionalOperation(model, view, "yem_retrofitting", "retrofittingoperation");
|
||||||
break;
|
break;
|
||||||
// case "submit":
|
// case "submit":
|
||||||
//// if (YEM.isNotEmpty(operationResult)) {
|
//// if (YEM.isNotEmpty(operationResult)) {
|
||||||
@ -66,6 +65,76 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 选装、替换、加装功能公共方法
|
||||||
|
* @author xwudd
|
||||||
|
* @param[1] model
|
||||||
|
* @param[2] view
|
||||||
|
* @param[3] formId 动态表单标识
|
||||||
|
* @param[4] operationNumber 服务标识
|
||||||
|
* return
|
||||||
|
* @time 2023/7/27 9:38
|
||||||
|
*/
|
||||||
|
|
||||||
|
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)){
|
||||||
|
currentRowIndex = model.getEntryCurrentRowIndex("yem_es_materialinfo");
|
||||||
|
}
|
||||||
|
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");
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 打开动态表单
|
||||||
|
* @author xwudd
|
||||||
|
* @param[1] formId 表单标识
|
||||||
|
* @param[2] map 传参 无参传null
|
||||||
|
* @param[3] view
|
||||||
|
* return
|
||||||
|
* @time 2023/8/29 11:19
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static void viewForm(String formId, Map<String, Object> map, IFormView view) {
|
||||||
|
FormShowParameter formShowParameter = new FormShowParameter();
|
||||||
|
formShowParameter.setFormId(formId);
|
||||||
|
formShowParameter.getOpenStyle().setShowType(ShowType.Modal);
|
||||||
|
if (YEM.isNotEmpty(map)) {
|
||||||
|
formShowParameter.setCustomParams(map);
|
||||||
|
}
|
||||||
|
view.showForm(formShowParameter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param isDisable
|
* @param isDisable
|
||||||
* @Description 禁用操作
|
* @Description 禁用操作
|
||||||
@ -236,16 +305,16 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
|
|||||||
DynamicObject yemImDetailedinfor = this.getModel().getEntryEntity("yem_im_detailedinfor").get(rowIndex);
|
DynamicObject yemImDetailedinfor = this.getModel().getEntryEntity("yem_im_detailedinfor").get(rowIndex);
|
||||||
DynamicObject yemProductmodel = yemImDetailedinfor.getDynamicObject("yem_productmodel");
|
DynamicObject yemProductmodel = yemImDetailedinfor.getDynamicObject("yem_productmodel");
|
||||||
BigDecimal yemQingdaounitprice = yemImDetailedinfor.getBigDecimal("yem_qingdaounitprice");
|
BigDecimal yemQingdaounitprice = yemImDetailedinfor.getBigDecimal("yem_qingdaounitprice");
|
||||||
if (yemQingdaounitprice.compareTo(BigDecimal.ZERO)==0){
|
if (yemQingdaounitprice.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (yemProductmodel!=null){
|
if (yemProductmodel != null) {
|
||||||
DynamicObject yemProducts = yemProductmodel.getDynamicObject("yem_products");
|
DynamicObject yemProducts = yemProductmodel.getDynamicObject("yem_products");
|
||||||
if (yemProducts!=null){
|
if (yemProducts != null) {
|
||||||
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_bd_productstree", "id,number,yem_costdifference"
|
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_bd_productstree", "id,number,yem_costdifference"
|
||||||
, new QFilter[]{new QFilter("id", QCP.equals, yemProducts.getLong("id"))});
|
, new QFilter[]{new QFilter("id", QCP.equals, yemProducts.getLong("id"))});
|
||||||
BigDecimal yemCostdifference = loadSingle.getBigDecimal("yem_costdifference");
|
BigDecimal yemCostdifference = loadSingle.getBigDecimal("yem_costdifference");
|
||||||
this.getModel().setValue("yem_unitprice",yemQingdaounitprice.subtract(yemCostdifference), rowIndex);
|
this.getModel().setValue("yem_unitprice", yemQingdaounitprice.subtract(yemCostdifference), rowIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -254,18 +323,18 @@ public class InquirylistEdit extends AbstractBillPlugIn implements BeforeF7Selec
|
|||||||
public void afterBindData(EventObject e) {
|
public void afterBindData(EventObject e) {
|
||||||
super.afterBindData(e);
|
super.afterBindData(e);
|
||||||
DynamicObjectCollection yemImDetailedinfor = (DynamicObjectCollection) this.getModel().getValue("yem_im_detailedinfor");
|
DynamicObjectCollection yemImDetailedinfor = (DynamicObjectCollection) this.getModel().getValue("yem_im_detailedinfor");
|
||||||
if (yemImDetailedinfor.size()>0){
|
if (yemImDetailedinfor.size() > 0) {
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>();
|
||||||
for (int i = 0; i < yemImDetailedinfor.size(); i++) {
|
for (int i = 0; i < yemImDetailedinfor.size(); i++) {
|
||||||
DynamicObject dynamicObject = yemImDetailedinfor.get(i);
|
DynamicObject dynamicObject = yemImDetailedinfor.get(i);
|
||||||
BigDecimal yemFobprice = dynamicObject.getBigDecimal("yem_fobprice");
|
BigDecimal yemFobprice = dynamicObject.getBigDecimal("yem_fobprice");
|
||||||
if (yemFobprice.compareTo(BigDecimal.ZERO)!=0){
|
if (yemFobprice.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
list.add(i);
|
list.add(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = list.size(); i!=0; i--) {
|
for (int i = list.size(); i != 0; i--) {
|
||||||
Integer integer = list.get(i-1);
|
Integer integer = list.get(i - 1);
|
||||||
this.getModel().deleteEntryRow("yem_im_detailedinfor",integer);
|
this.getModel().deleteEntryRow("yem_im_detailedinfor", integer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user