泛微非采购供应商接口,控制策略为自由分配
This commit is contained in:
parent
572dace97a
commit
291ddc79e6
|
|
@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.basedata.BaseDataResponse;
|
||||
import kd.bos.entity.operate.result.IOperateInfo;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.logging.Log;
|
||||
|
|
@ -16,6 +17,7 @@ import kd.bos.openapi.common.result.CustomApiResult;
|
|||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.bos.util.StringUtils;
|
||||
|
|
@ -27,10 +29,7 @@ import javax.validation.Valid;
|
|||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
//非采供应商
|
||||
@ApiController(value = "SupplierControl", desc = "泛微非采购供应商导入")
|
||||
|
|
@ -206,8 +205,7 @@ public class SupplierControl implements Serializable {
|
|||
} else {
|
||||
DynamicObject bd_supplier = BusinessDataServiceHelper.newDynamicObject(entityName);
|
||||
bd_supplier.set("number", number);
|
||||
bd_supplier.set("tqq9_ispur",false);//非采购供应商
|
||||
bd_supplier.set("ctrlstrategy","2");//控制策略为自由分配
|
||||
bd_supplier.set("tqq9_ispur", false);//非采购供应商
|
||||
bd_supplier.set("name", name);
|
||||
bd_supplier.set("simplename", simplename);
|
||||
bd_supplier.set("tqq9_combofield3_jyzt", tqq9_combofield3_jyzt);
|
||||
|
|
@ -254,7 +252,7 @@ public class SupplierControl implements Serializable {
|
|||
if (null != org) {
|
||||
bd_supplier.set("createorg", org);
|
||||
bd_supplier.set("org", org);
|
||||
bd_supplier.set("useorg", org);//组织
|
||||
// bd_supplier.set("useorg", org);//组织
|
||||
}
|
||||
|
||||
//供应商状态——正常
|
||||
|
|
@ -287,6 +285,7 @@ public class SupplierControl implements Serializable {
|
|||
|
||||
SaveServiceHelper.save(new DynamicObject[]{bd_suppliergroupdetails});
|
||||
|
||||
bd_supplier.set("useorg", org);//组织
|
||||
OperationResult operationResult = OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{bd_supplier}, OperateOption.create());
|
||||
if (!operationResult.isSuccess()) {
|
||||
List<IOperateInfo> allErrorOrValidateInfo = operationResult.getAllErrorOrValidateInfo();
|
||||
|
|
@ -376,6 +375,22 @@ public class SupplierControl implements Serializable {
|
|||
resultExt.setFailCount(1);
|
||||
resultExt.setSuccessCount(0);
|
||||
} else {
|
||||
Set<Long> dataIds = new HashSet<>();
|
||||
dataIds.add(bd_supplier.getLong("id"));
|
||||
BaseDataResponse baseDataResponse = BaseDataServiceHelper.changeCtrlStrategy("bd_supplier", dataIds, "2", "basedata", org.getLong("id"));
|
||||
boolean success = baseDataResponse.isSuccess();
|
||||
if (!success) {
|
||||
rowMsg.add(baseDataResponse.getErrorMsg());
|
||||
error.setKeys(keys);
|
||||
error.setRowMsg(rowMsg);
|
||||
error.setEntityKey(entityName);
|
||||
resultBean.setId(bd_supplier.getString("id"));
|
||||
resultBean.setBillStatus(false);
|
||||
resultBean.setErrors(error);
|
||||
results.add(resultBean);
|
||||
resultExt.setFailCount(1);
|
||||
resultExt.setSuccessCount(0);
|
||||
}
|
||||
resultBean.setId(bd_supplier.getString("id"));
|
||||
resultBean.setBillStatus(true);
|
||||
results.add(resultBean);
|
||||
|
|
|
|||
Loading…
Reference in New Issue