feat:合同提交云之家,特殊处理
This commit is contained in:
parent
9aa561d258
commit
72dd84a8fb
@ -0,0 +1,58 @@
|
||||
package com.yem.wm.bc.bill.op;
|
||||
|
||||
import com.yem.wm.utils.YunzhijiaUtils;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
||||
import kd.bos.exception.KDBizException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 合同提交云之家特殊处理,事务结束之后在进行同步操作
|
||||
* @Date: 2024/12/25 17:34
|
||||
* @Created: by ZZSLL
|
||||
*/
|
||||
|
||||
public class YemBillSubmitToYZJEndTransactionOp extends AbstractOperationServicePlugIn {
|
||||
|
||||
@Override
|
||||
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||
super.onPreparePropertys(e);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endOperationTransaction(EndOperationTransactionArgs e) {
|
||||
super.endOperationTransaction(e);
|
||||
DynamicObject[] entities = e.getDataEntities();
|
||||
List<DynamicObject> passDataEntity = new ArrayList<>();
|
||||
OperationResult result = this.operationResult;
|
||||
if (!result.isSuccess()) {
|
||||
return;
|
||||
}
|
||||
StringBuilder errMsg = new StringBuilder();
|
||||
for (DynamicObject entity : entities) {
|
||||
String billType = entity.getDataEntityType().getName();
|
||||
if (!"yem_es_salesorder".equals(billType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
YunzhijiaUtils.submit2YZJ(result, passDataEntity, entity);
|
||||
|
||||
if (result.isSuccess()) {
|
||||
passDataEntity.add(entity);
|
||||
} else {
|
||||
String message = result.getMessage();
|
||||
errMsg.append(message).append("\n ");
|
||||
}
|
||||
}
|
||||
|
||||
if (errMsg.length() > 0) {
|
||||
throw new KDBizException("提交云之家失败!错误信息:" + errMsg);
|
||||
}
|
||||
}
|
||||
}
|
@ -29,7 +29,7 @@ public class YemBillSubmitToYZJOp extends AbstractOperationServicePlugIn {
|
||||
@Override
|
||||
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||
super.onPreparePropertys(e);
|
||||
e.getFieldKeys().add("billno");
|
||||
e.getFieldKeys().addAll(this.billEntityType.getAllFields().keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -39,6 +39,12 @@ public class YemBillSubmitToYZJOp extends AbstractOperationServicePlugIn {
|
||||
List<DynamicObject> passDataEntitys = new ArrayList<>();
|
||||
for (DynamicObject dynamicObject : dataEntities1) {
|
||||
String name = dynamicObject.getDynamicObjectType().getName();
|
||||
if ("yem_es_salesorder".equals(name)) {
|
||||
// 合同提交云之家特殊处理。
|
||||
// 已经移动到插件 com.yem.wm.bc.bill.op.YemBillSubmitToYZJEndTransactionOp
|
||||
passDataEntitys.add(dynamicObject);
|
||||
continue;
|
||||
}
|
||||
dynamicObject = BusinessDataServiceHelper.loadSingle(dynamicObject.getPkValue(), name);
|
||||
|
||||
if ("yem_es_specialapplica".equals(name)) {
|
||||
|
Loading…
Reference in New Issue
Block a user