其他出库申请选择批号带出生产日期,到期日期、生产商、许可证、注册证
This commit is contained in:
parent
a70eca0b22
commit
fdcdab5ee7
|
|
@ -13,12 +13,13 @@ 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.Date;
|
||||||
import java.util.EventObject;
|
import java.util.EventObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他出库申请界面插件
|
* 其他出库申请界面插件
|
||||||
*/
|
*/
|
||||||
public class OtherOutApplyBillPlugin extends AbstractBillPlugIn {
|
public class OtherOutApplyBillPlugin extends AbstractBillPlugIn {
|
||||||
@Override
|
@Override
|
||||||
public void registerListener(EventObject e) {
|
public void registerListener(EventObject e) {
|
||||||
super.registerListener(e);
|
super.registerListener(e);
|
||||||
|
|
@ -92,14 +93,14 @@ public class OtherOutApplyBillPlugin extends AbstractBillPlugIn {
|
||||||
if (StringUtils.equals("tqq9_materiel", name)) {
|
if (StringUtils.equals("tqq9_materiel", name)) {
|
||||||
ChangeData[] changeSet = e.getChangeSet();
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
DynamicObject newValue = (DynamicObject) changeSet[0].getNewValue();//物料库存信息
|
DynamicObject newValue = (DynamicObject) changeSet[0].getNewValue();//物料库存信息
|
||||||
if(newValue != null){
|
if (newValue != null) {
|
||||||
DynamicObject masterid = newValue.getDynamicObject("masterid");//物料
|
DynamicObject masterid = newValue.getDynamicObject("masterid");//物料
|
||||||
if(masterid != null){
|
if (masterid != null) {
|
||||||
QFilter purinbillF = new QFilter("billentry.material.id", QCP.equals, newValue.getLong("id"));
|
QFilter purinbillF = new QFilter("billentry.material.id", QCP.equals, newValue.getLong("id"));
|
||||||
purinbillF = purinbillF.and("billstatus", QCP.equals, "C");
|
purinbillF = purinbillF.and("billstatus", QCP.equals, "C");
|
||||||
//price
|
//price
|
||||||
DynamicObject[] purinbills = BusinessDataServiceHelper.load("im_purinbill", "id,billno,billentry.material,billentry.price", purinbillF.toArray(), "auditdate desc");
|
DynamicObject[] purinbills = BusinessDataServiceHelper.load("im_purinbill", "id,billno,billentry.material,billentry.price", purinbillF.toArray(), "auditdate desc");
|
||||||
if(purinbills != null && purinbills.length > 0){
|
if (purinbills != null && purinbills.length > 0) {
|
||||||
DynamicObject purinbill = purinbills[0];
|
DynamicObject purinbill = purinbills[0];
|
||||||
DynamicObjectCollection billentry = purinbill.getDynamicObjectCollection("billentry");
|
DynamicObjectCollection billentry = purinbill.getDynamicObjectCollection("billentry");
|
||||||
for (DynamicObject dynamicObject : billentry) {
|
for (DynamicObject dynamicObject : billentry) {
|
||||||
|
|
@ -114,8 +115,59 @@ public class OtherOutApplyBillPlugin extends AbstractBillPlugIn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (StringUtils.equals("tqq9_lotnumber", name)) {
|
||||||
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
|
int rowIndex = changeSet[0].getRowIndex();
|
||||||
|
String lotNumber = (String) changeSet[0].getNewValue();
|
||||||
|
DynamicObject tqq9_materiel = (DynamicObject) this.getModel().getValue("tqq9_materiel");
|
||||||
|
if (StringUtils.isNotBlank(lotNumber) && null != tqq9_materiel) {
|
||||||
|
DynamicObject[] objects = BusinessDataServiceHelper.load("im_inv_realbalance",
|
||||||
|
"id,keycol,material,lotnum,producedate,expirydate,tqq9_goods,tqq9_registration"
|
||||||
|
, new QFilter[]{new QFilter("lotnum", QCP.equals, lotNumber), new QFilter("material", QCP.equals, tqq9_materiel.getDynamicObject("masterid").getLong("id"))});
|
||||||
|
if (null != objects && objects.length > 0) {
|
||||||
|
if (objects.length == 1) {
|
||||||
|
DynamicObject object = objects[0];
|
||||||
|
Date producedate = object.getDate("producedate");
|
||||||
|
Date expirydate = object.getDate("expirydate");
|
||||||
|
DynamicObject tqq9_registration = object.getDynamicObject("tqq9_registration");
|
||||||
|
StringBuilder tqq9_cs = new StringBuilder();
|
||||||
|
StringBuilder tqq9_licenseno = new StringBuilder();
|
||||||
|
if (null != tqq9_registration) {
|
||||||
|
tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration",
|
||||||
|
"id,number,tqq9_entry.tqq9_e_supplier,tqq9_entry.tqq9_e_supno,tqq9_proxy,tqq9_proxyno"
|
||||||
|
, new QFilter[]{new QFilter("id", QCP.equals, tqq9_registration.getLong("id"))});
|
||||||
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
|
for (int i = 0; i < tqq9_entry.size(); i++) {
|
||||||
|
DynamicObject dynamicObject = tqq9_entry.get(i);
|
||||||
|
DynamicObject tqq9_e_supplier = dynamicObject.getDynamicObject("tqq9_e_supplier");
|
||||||
|
if (null != tqq9_e_supplier) {
|
||||||
|
tqq9_cs.append(tqq9_e_supplier.getString("name"));
|
||||||
|
if (i != tqq9_entry.size() - 1) {
|
||||||
|
tqq9_cs.append("#");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String tqq9_e_supno = dynamicObject.getString("tqq9_e_supno");
|
||||||
|
if (StringUtils.isNotBlank(tqq9_e_supno)) {
|
||||||
|
tqq9_licenseno.append(tqq9_e_supno);
|
||||||
|
if (i != tqq9_entry.size() - 1) {
|
||||||
|
tqq9_licenseno.append("#");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.getModel().setValue("tqq9_producedate", producedate, rowIndex);
|
||||||
|
this.getModel().setValue("tqq9_expirydate", expirydate, rowIndex);
|
||||||
|
this.getModel().setValue("tqq9_cs", tqq9_cs.toString(), rowIndex);
|
||||||
|
this.getModel().setValue("tqq9_licenseno", tqq9_licenseno.toString(), rowIndex);
|
||||||
|
this.getModel().setValue("tqq9_zczh", tqq9_registration, rowIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue