|
@@ -17,6 +17,7 @@ import kd.bos.openapi.common.result.CustomApiResult;
|
|
|
import kd.bos.orm.query.QCP;
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
|
|
+import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
|
|
import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
|
|
|
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|
@@ -377,7 +378,7 @@ public class SynSupplierApiPlugin implements Serializable {
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
//判断是否更新与新增,通过不同方法处理,保存操作会变更状态为保存
|
|
//判断是否更新与新增,通过不同方法处理,保存操作会变更状态为保存
|
|
|
- if(isUpdate) {
|
|
|
|
|
|
|
+ if(!isUpdate) {
|
|
|
// SaveServiceHelper.update(new DynamicObject[]{customer});
|
|
// SaveServiceHelper.update(new DynamicObject[]{customer});
|
|
|
OperationResult resultSave = SaveServiceHelper.saveOperate(ENTITY_SUPPLIER, new DynamicObject[]{supplier}, OperateOption.create());
|
|
OperationResult resultSave = SaveServiceHelper.saveOperate(ENTITY_SUPPLIER, new DynamicObject[]{supplier}, OperateOption.create());
|
|
|
|
|
|
|
@@ -395,6 +396,15 @@ public class SynSupplierApiPlugin implements Serializable {
|
|
|
}
|
|
}
|
|
|
supplierId = supplier.getLong("id");
|
|
supplierId = supplier.getLong("id");
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ //并发问题,保存前再校验一次
|
|
|
|
|
+ boolean exists = QueryServiceHelper.exists(ENTITY_SUPPLIER, qFilter.toArray());
|
|
|
|
|
+ if(exists){
|
|
|
|
|
+ returnMap.put("code", "500");
|
|
|
|
|
+ returnMap.put("msg", "出现并发问题,当前调用取消执行");
|
|
|
|
|
+
|
|
|
|
|
+ return returnMap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//新增保存供应商对象
|
|
//新增保存供应商对象
|
|
|
OperationResult resultSave = SaveServiceHelper.saveOperate(ENTITY_SUPPLIER, new DynamicObject[]{supplier}, OperateOption.create());
|
|
OperationResult resultSave = SaveServiceHelper.saveOperate(ENTITY_SUPPLIER, new DynamicObject[]{supplier}, OperateOption.create());
|
|
|
|
|
|