parent
d1808fe7af
commit
d3da7ad0e8
|
|
@ -3,9 +3,11 @@ package tqq9.lc123.cloud.app.plugin.form.sys;
|
||||||
|
|
||||||
import kd.bos.bill.AbstractBillPlugIn;
|
import kd.bos.bill.AbstractBillPlugIn;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.dataentity.utils.StringUtils;
|
||||||
import kd.bos.entity.datamodel.events.ChangeData;
|
import kd.bos.entity.datamodel.events.ChangeData;
|
||||||
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
||||||
import tqq9.lc123.cloud.app.plugin.utils.BaseDataMatchUtils;
|
import kd.bos.orm.query.QFilter;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
@ -20,7 +22,8 @@ public class GetGoodsByMaterialBillPlugin extends AbstractBillPlugIn {
|
||||||
private static Set<String> materialFieldNameSet_1;
|
private static Set<String> materialFieldNameSet_1;
|
||||||
private static Set<String> materialFieldNameSet_2;
|
private static Set<String> materialFieldNameSet_2;
|
||||||
private static Set<String> materialFieldNameSet_3;
|
private static Set<String> materialFieldNameSet_3;
|
||||||
static{
|
|
||||||
|
static {
|
||||||
materialFieldNameSet_1 = Stream.of("pm_purorderbill", "pm_receiptnotice", "im_purinbill", "sm_salorder", "sm_delivernotice", "im_saloutbill",
|
materialFieldNameSet_1 = Stream.of("pm_purorderbill", "pm_receiptnotice", "im_purinbill", "sm_salorder", "sm_delivernotice", "im_saloutbill",
|
||||||
"im_otheroutbill", "tqq9_otherinapply", "im_otherinbill", "im_adjustbill", "tqq9_shortagebill").collect(Collectors.toSet());//material
|
"im_otheroutbill", "tqq9_otherinapply", "im_otherinbill", "im_adjustbill", "tqq9_shortagebill").collect(Collectors.toSet());//material
|
||||||
materialFieldNameSet_2 = Stream.of("ar_busbill", "ar_finarbill", "ap_payapply", "ar_busbill", "ar_finarbill").collect(Collectors.toSet());//e_material
|
materialFieldNameSet_2 = Stream.of("ar_busbill", "ar_finarbill", "ap_payapply", "ar_busbill", "ar_finarbill").collect(Collectors.toSet());//e_material
|
||||||
|
|
@ -36,41 +39,54 @@ public class GetGoodsByMaterialBillPlugin extends AbstractBillPlugIn {
|
||||||
String materialFieldName = "material";
|
String materialFieldName = "material";
|
||||||
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
DynamicObject dataEntity = this.getModel().getDataEntity(true);
|
||||||
String dataEntityName = dataEntity.getDataEntityType().getName();
|
String dataEntityName = dataEntity.getDataEntityType().getName();
|
||||||
if(materialFieldNameSet_1.contains(dataEntityName)){
|
if (materialFieldNameSet_1.contains(dataEntityName)) {
|
||||||
materialFieldName = "material";
|
materialFieldName = "material";
|
||||||
}else if (materialFieldNameSet_2.contains(dataEntityName)){
|
} else if (materialFieldNameSet_2.contains(dataEntityName)) {
|
||||||
materialFieldName = "e_material";
|
materialFieldName = "e_material";
|
||||||
}else if (materialFieldNameSet_3.contains(dataEntityName)){
|
} else if (materialFieldNameSet_3.contains(dataEntityName)) {
|
||||||
materialFieldName = "tqq9_materiel";
|
materialFieldName = "tqq9_materiel";
|
||||||
}
|
}
|
||||||
|
if (materialFieldName.equals(name)) {
|
||||||
if(materialFieldName.equals(name) || "lotnumber".equals(name) || "producedate".equals(name) || "expirydate".equals(name)){
|
|
||||||
DynamicObject material = (DynamicObject) this.getModel().getValue(materialFieldName, rowIndex);
|
DynamicObject material = (DynamicObject) this.getModel().getValue(materialFieldName, rowIndex);
|
||||||
String lotnumber = (String) this.getModel().getValue("lotnumber", rowIndex);
|
if (material != null) {
|
||||||
Date producedate = (Date) this.getModel().getValue("producedate", rowIndex);
|
String number=null;
|
||||||
Date expirydate = (Date) this.getModel().getValue("expirydate", rowIndex);
|
if (StringUtils.equals("bd_material", material.getDynamicObjectType().getName())) {
|
||||||
if(material != null){
|
number = material.getString("number");
|
||||||
DynamicObject[] goodsArr = BaseDataMatchUtils.materialMatchGoods(material.getString("number"), lotnumber, producedate, expirydate, false);
|
}else{
|
||||||
if (goodsArr!=null&&goodsArr.length>0) {
|
DynamicObject masterid = material.getDynamicObject("masterid");
|
||||||
this.getModel().setValue("tqq9_goods", goodsArr[0], rowIndex);
|
number = masterid.getString("number");
|
||||||
}
|
}
|
||||||
|
QFilter f1 = new QFilter("tqq9_mater.number", "=", number);
|
||||||
|
QFilter f5 = new QFilter("tqq9_isauto", "=", true);
|
||||||
|
DynamicObject[] goodsA = BusinessDataServiceHelper.load("tqq9_goodspackage",
|
||||||
|
"id,number,name,tqq9_mater.baseunit,tqq9_mater.modelnum,tqq9_isauto",
|
||||||
|
new QFilter[]{f1, f5});
|
||||||
|
if (goodsA != null && goodsA.length > 0) {
|
||||||
|
this.getModel().setValue("tqq9_goods", goodsA[0], rowIndex);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 形态转换单子明细
|
// 形态转换单子明细
|
||||||
if("im_adjustbill".equals(dataEntityName) ){
|
if ("im_adjustbill".equals(dataEntityName)) {
|
||||||
int parentRowIndex = changeSet[0].getParentRowIndex();
|
int parentRowIndex = changeSet[0].getParentRowIndex();
|
||||||
if ("material1".equals(name) || "lotnumber".equals(name) || "producedate".equals(name) || "expirydate".equals(name)){
|
if ("material1".equals(name) || "lotnumber".equals(name) || "producedate".equals(name) || "expirydate".equals(name)) {
|
||||||
DynamicObject material = (DynamicObject) this.getModel().getValue("material1", rowIndex);
|
DynamicObject material = (DynamicObject) this.getModel().getValue("material1", rowIndex);
|
||||||
String lotnumber = (String) this.getModel().getValue("lotnumber", rowIndex);
|
String lotnumber = (String) this.getModel().getValue("lotnumber", rowIndex);
|
||||||
Date producedate = (Date) this.getModel().getValue("producedate", rowIndex);
|
Date producedate = (Date) this.getModel().getValue("producedate", rowIndex);
|
||||||
Date expirydate = (Date) this.getModel().getValue("expirydate", rowIndex);
|
Date expirydate = (Date) this.getModel().getValue("expirydate", rowIndex);
|
||||||
if(material != null){
|
if (material != null) {
|
||||||
DynamicObject[] goodsArr = BaseDataMatchUtils.materialMatchGoods(material.getString("number"), lotnumber, producedate, expirydate, false);
|
QFilter f1 = new QFilter("tqq9_mater.number", "=", material.getString("number"));
|
||||||
this.getModel().setValue("tqq9_goods", goodsArr[0], rowIndex, parentRowIndex);
|
QFilter f5 = new QFilter("tqq9_isauto", "=", true);
|
||||||
|
DynamicObject[] goodsA = BusinessDataServiceHelper.load("tqq9_goodspackage",
|
||||||
|
"id,number,name,tqq9_mater.baseunit,tqq9_mater.modelnum,tqq9_isauto",
|
||||||
|
new QFilter[]{f1, f5});
|
||||||
|
if (goodsA != null && goodsA.length > 0) {
|
||||||
|
this.getModel().setValue("tqq9_goods", goodsA[0], rowIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -142,13 +142,15 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
||||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商反审核失败," + message);
|
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商反审核失败," + message);
|
||||||
}
|
}
|
||||||
String message = unauditResult.getMessage();
|
String message = unauditResult.getMessage();
|
||||||
String simpleMessage = unauditResult.getInteractionContext().getSimpleMessage();
|
if(unauditResult.getInteractionContext().getSimpleMessage()!=null){
|
||||||
if (message != null) {
|
String simpleMessage = unauditResult.getInteractionContext().getSimpleMessage();
|
||||||
|
if (message != null) {
|
||||||
|
stringBuilder.append(",").append(simpleMessage);
|
||||||
|
}
|
||||||
|
} if (message != null) {
|
||||||
stringBuilder.append(",").append(message);
|
stringBuilder.append(",").append(message);
|
||||||
}
|
}
|
||||||
if (message != null) {
|
|
||||||
stringBuilder.append(",").append(simpleMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
List<Object> successPkIds = unauditResult.getSuccessPkIds();
|
List<Object> successPkIds = unauditResult.getSuccessPkIds();
|
||||||
DynamicObject[] bd_suppliers1 = new DynamicObject[successPkIds.size()];
|
DynamicObject[] bd_suppliers1 = new DynamicObject[successPkIds.size()];
|
||||||
|
|
@ -166,13 +168,16 @@ public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
|
||||||
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商提交失败," + message);
|
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商提交失败," + message);
|
||||||
}
|
}
|
||||||
String message = sumbitResult.getMessage();
|
String message = sumbitResult.getMessage();
|
||||||
String simpleMessage = sumbitResult.getInteractionContext().getSimpleMessage();
|
if(sumbitResult.getInteractionContext().getSimpleMessage()!=null){
|
||||||
|
String simpleMessage = sumbitResult.getInteractionContext().getSimpleMessage();
|
||||||
|
if (message != null) {
|
||||||
|
stringBuilder.append(",").append(simpleMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
stringBuilder.append(",").append(message);
|
stringBuilder.append(",").append(message);
|
||||||
}
|
}
|
||||||
if (message != null) {
|
|
||||||
stringBuilder.append(",").append(simpleMessage);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (stringBuilder.length() > 0) {
|
if (stringBuilder.length() > 0) {
|
||||||
this.getView().showErrorNotification(stringBuilder.substring(1));
|
this.getView().showErrorNotification(stringBuilder.substring(1));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue