新增设备单据列表插件
This commit is contained in:
parent
8fc7c0678d
commit
ad4ca8b63e
|
|
@ -32,6 +32,7 @@ import kd.fi.gl.util.DateUtil;
|
|||
import kd.sdk.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import zcgj.zcdev.zcdev.pr.task.EquipmentCardTaskPlugin;
|
||||
import zcgj.zcdev.zcdev.pr.task.NewEquipmentCardTaskPlugin;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -88,10 +89,18 @@ public class EquipmentCardListPlugin extends AbstractListPlugin implements Plugi
|
|||
}else if(itemKey.equals("zcgj_assetorg")){//同步使用组织
|
||||
Set<Long> setIds = getSelectOrderIds(this.getSelectedRows());
|
||||
DynamicObject[] equipments = BusinessDataServiceHelper.load("eceq_equipment_card", "billno,billname,equipstatus,org,zcgj_headusedepts,useorg", new QFilter[]{new QFilter("id", "in", setIds)});
|
||||
DynamicObject[] equipinfo = BusinessDataServiceHelper.load("eceq_equipinfo", "useorg", new QFilter[]{new QFilter("id", "in", setIds)});
|
||||
DynamicObjectCollection collection = new DynamicObjectCollection();
|
||||
for (DynamicObject equipment : equipments) {
|
||||
DynamicObject org = equipment.getDynamicObject("org");
|
||||
equipment.set("useorg",org);
|
||||
long equipmentId = equipment.getLong("id");
|
||||
for (DynamicObject dynamicObject : equipinfo) {
|
||||
long equipinfoId = dynamicObject.getLong("id");
|
||||
DynamicObject useorg = dynamicObject.getDynamicObject("useorg");//设备使用组织为空
|
||||
if (equipmentId == equipinfoId && useorg == null) {
|
||||
equipment.set("useorg",org);
|
||||
}
|
||||
}
|
||||
collection.add(equipment);
|
||||
}
|
||||
SaveServiceHelper.save(collection.toArray(new DynamicObject[]{}));
|
||||
|
|
|
|||
Loading…
Reference in New Issue