Compare commits
7 Commits
4cb081c782
...
26dd984ff8
Author | SHA1 | Date | |
---|---|---|---|
![]() |
26dd984ff8 | ||
![]() |
f90e7f8d58 | ||
![]() |
28e8697e2d | ||
![]() |
7dd1363193 | ||
![]() |
7ea350de04 | ||
f9511ecb94 | |||
56b8060d6a |
@ -26,7 +26,7 @@ public class CMMPTableAuditvalidator extends AbstractValidator {
|
||||
this.addErrorMessage(dataEntitie, String.format("部件详情第【"+seq+"】行未匹配【系统编码】,请重试!"));
|
||||
}
|
||||
boolean yem_isassatlasdet = dynamicObject.getBoolean("yem_isassatlasdet");
|
||||
if (!yemIsnormal) {
|
||||
if (!yem_isassatlasdet) {
|
||||
this.addErrorMessage(dataEntitie, String.format("部件详情第【"+seq+"】行未匹配【图册明细】,请重试!"));
|
||||
}
|
||||
}
|
||||
|
@ -288,16 +288,16 @@ public class StorageTransEdit_wl extends AbstractBillPlugIn {
|
||||
boonle = false;
|
||||
i++;
|
||||
}
|
||||
if (yemCutdate == null) {
|
||||
string = string + i + ". 截单日期为空,请稍后重试!\n";
|
||||
boonle = false;
|
||||
i++;
|
||||
}
|
||||
if (yemPortinterception == null) {
|
||||
string = string + i + ". 截港日期为空,请稍后重试!\n";
|
||||
boonle = false;
|
||||
i++;
|
||||
}
|
||||
// if (yemCutdate == null) {
|
||||
// string = string + i + ". 截单日期为空,请稍后重试!\n";
|
||||
// boonle = false;
|
||||
// i++;
|
||||
// }
|
||||
// if (yemPortinterception == null) {
|
||||
// string = string + i + ". 截港日期为空,请稍后重试!\n";
|
||||
// boonle = false;
|
||||
// i++;
|
||||
// }
|
||||
if (null == yemCfscompnay) {
|
||||
string = string + i + ". 货代公司为空,请稍后重试!\n";
|
||||
boonle = false;
|
||||
|
@ -4,6 +4,8 @@ import com.google.common.collect.Maps;
|
||||
import com.yem.wm.utils.FunctionalCommon;
|
||||
import com.yem.wm.utils.YEM;
|
||||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.extplugin.sample.AbstractFormPlugin;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.FormShowParameter;
|
||||
@ -12,6 +14,7 @@ import kd.bos.form.ShowType;
|
||||
import kd.bos.form.events.BeforeDoOperationEventArgs;
|
||||
import kd.bos.form.events.ClosedCallBackEvent;
|
||||
import kd.bos.form.operate.FormOperate;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@ -42,8 +45,10 @@ public class ServiceRepairFormPlugin extends AbstractBillPlugIn {
|
||||
super.closedCallBack(e);
|
||||
IFormView view = this.getView();
|
||||
String actionId = e.getActionId();
|
||||
IDataModel model = this.getModel();
|
||||
DynamicObject dataEntity = model.getDataEntity(true);
|
||||
if ("voidreason".equals(actionId)) {
|
||||
view.invokeOperation("save");
|
||||
SaveServiceHelper.save(new DynamicObject[]{dataEntity});
|
||||
view.invokeOperation("refresh");
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
package com.yem.wm.im.transportCosts.Op;
|
||||
|
||||
import com.yem.wm.im.transferorder.vaildator.TransFerOrderSubmitMustInputValidator;
|
||||
import com.yem.wm.im.transportCosts.validator.TransportCostsSaveValidator;
|
||||
import com.yem.wm.utils.DynamicObjectUtil;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
|
||||
/**
|
||||
* @author ljw
|
||||
* @date 2024/8/31 15:54
|
||||
* @description TransportCostsSaveOp
|
||||
*/
|
||||
public class TransportCostsSaveOp extends AbstractOperationServicePlugIn {
|
||||
@Override
|
||||
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||
super.onAddValidators(e);
|
||||
e.addValidator(new TransportCostsSaveValidator());
|
||||
}
|
||||
}
|
@ -6,19 +6,14 @@ import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.datamodel.IDataModel;
|
||||
import kd.bos.entity.datamodel.events.ChangeData;
|
||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||
import kd.bos.form.IFormView;
|
||||
import kd.bos.form.control.Control;
|
||||
import kd.bos.form.field.BasedataEdit;
|
||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||
import kd.bos.ksql.util.StringUtil;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.EventObject;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 装箱核算运输费用
|
||||
@ -102,7 +97,50 @@ public class TransportCostsFormPlugIn extends AbstractBillPlugIn implements Befo
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "yem_from":
|
||||
yemFrom(e);
|
||||
break;
|
||||
case"yem_reach":
|
||||
yemReach(e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 至不允许小于等于从
|
||||
* @param e
|
||||
*/
|
||||
private void yemReach(PropertyChangedArgs e) {
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
int rowIndex = changeData.getRowIndex();
|
||||
if (rowIndex - 1 < 0) {
|
||||
return;
|
||||
}
|
||||
int parentRowIndex = changeData.getParentRowIndex();
|
||||
BigDecimal newValue = (BigDecimal) changeData.getNewValue();
|
||||
DynamicObjectCollection yemBdLogistics = this.getModel().getEntryEntity("yem_bd_logistics");
|
||||
BigDecimal bigDecimal = yemBdLogistics.get(parentRowIndex).getDynamicObjectCollection("yem_subentryentity").get(rowIndex - 1).getBigDecimal("yem_from");
|
||||
if (bigDecimal.compareTo(newValue) >= 0) {
|
||||
this.getView().showMessage("!!!!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从不能小于前一行的至
|
||||
* @param e
|
||||
*/
|
||||
private void yemFrom(PropertyChangedArgs e) {
|
||||
ChangeData changeData = e.getChangeSet()[0];
|
||||
int rowIndex = changeData.getRowIndex();
|
||||
if (rowIndex - 1 < 0) {
|
||||
return;
|
||||
}
|
||||
int parentRowIndex = changeData.getParentRowIndex();
|
||||
BigDecimal newValue = (BigDecimal) changeData.getNewValue();
|
||||
DynamicObjectCollection yemBdLogistics = this.getModel().getEntryEntity("yem_bd_logistics");
|
||||
BigDecimal bigDecimal = yemBdLogistics.get(parentRowIndex).getDynamicObjectCollection("yem_subentryentity").get(rowIndex - 1).getBigDecimal("yem_reach");
|
||||
if (bigDecimal.compareTo(newValue) > 0) {
|
||||
this.getView().showMessage("!!!!");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.yem.wm.im.transportCosts.validator;
|
||||
|
||||
import com.yem.wm.utils.DynamicObjectUtil;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.ExtendedDataEntity;
|
||||
import kd.bos.entity.validate.AbstractValidator;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
|
||||
/**
|
||||
* @author ljw
|
||||
* @date 2024/8/31 16:11
|
||||
* @description TransportCostsSaveValidator
|
||||
*/
|
||||
public class TransportCostsSaveValidator extends AbstractValidator {
|
||||
@Override
|
||||
public void validate() {
|
||||
ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
|
||||
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
|
||||
DynamicObject eDataEntity = extendedDataEntity.getDataEntity();
|
||||
DynamicObjectCollection dynamicObjectCollection = eDataEntity.getDynamicObjectCollection("yem_bd_logistics");
|
||||
long aLong = eDataEntity.getLong("id");
|
||||
for (DynamicObject dynamicObject : dynamicObjectCollection) {
|
||||
DynamicObject yemShippingmethod = dynamicObject.getDynamicObject("yem_shippingmethod");
|
||||
DynamicObject yemExpenseitems = dynamicObject.getDynamicObject("yem_expenseitems");
|
||||
DynamicObject yemPort = dynamicObject.getDynamicObject("yem_port");
|
||||
QFilter qFilter = new QFilter("id", QCP.not_equals, aLong);
|
||||
if (yemExpenseitems!=null){
|
||||
long yem_expenseitems = yemExpenseitems.getLong("id");
|
||||
qFilter.and("yem_bd_logistics.yem_expenseitems.id", QCP.equals, yem_expenseitems);
|
||||
}else {
|
||||
this.addMessage(extendedDataEntity,"费用项目不允许为空");
|
||||
return;
|
||||
}
|
||||
if (yemPort!=null){
|
||||
long yem_port = yemPort.getLong("id");
|
||||
qFilter.and("yem_bd_logistics.yem_port.id", QCP.equals, yem_port);
|
||||
}else {
|
||||
this.addMessage(extendedDataEntity,"运输方式不允许为空");
|
||||
return;
|
||||
}
|
||||
if (yemShippingmethod!=null){
|
||||
long yem_padexpense = yemShippingmethod.getLong("id");
|
||||
qFilter.and("yem_bd_logistics.yem_shippingmethod.id", QCP.equals, yem_padexpense);
|
||||
}else {
|
||||
this.addMessage(extendedDataEntity,"港口不允许为空");
|
||||
return;
|
||||
}
|
||||
String selectfield = DynamicObjectUtil.getSelectfields("yem_bd_transportcosts", false);
|
||||
String selectfields = DynamicObjectUtil.getEntrySelectfields(selectfield, "yem_bd_transportcosts", "yem_bd_logistics", false);
|
||||
DynamicObject dynamicObject1 = BusinessDataServiceHelper.loadSingle("yem_bd_transportcosts", selectfields, new QFilter[]{qFilter});
|
||||
if (dynamicObject1 != null) {
|
||||
this.addMessage(extendedDataEntity,"运输方式+费用项目+港口唯一");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user