客户接口分类标准处理1
This commit is contained in:
parent
ee2781bac8
commit
468c603d30
|
|
@ -21,9 +21,7 @@ import kd.bos.openapi.common.result.CustomApiResult;
|
|||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import shjh.jhzj7.fi.fi.utils.EsbUtils;
|
||||
import shjh.jhzj7.fi.fi.utils.JhzjUtils;
|
||||
import shjh.jhzj7.fi.fi.webapi.model.CustomerModel;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
|
@ -144,14 +142,6 @@ public class CustomerControler {
|
|||
//处理 客户组5
|
||||
handleFive(customerfivesJson,currentCus.getDynamicObjectCollection("shjh_entry_five"),cusnumber);
|
||||
|
||||
//处理分类
|
||||
custgroupdetail = BusinessDataServiceHelper.newDynamicObject(gdName);
|
||||
custgroupdetail.set("createorg", JhzjUtils.GROUPID);//创建组织
|
||||
custgroupdetail.set("standard",EsbUtils.CUSTOMERSTAND);//客户分类标准
|
||||
custgroupdetail.set("group",custype);//具体分类
|
||||
custgroupdetail.set("customer",currentCustId);//客户
|
||||
SaveServiceHelper.save(new DynamicObject[]{custgroupdetail});
|
||||
|
||||
//保存客户-必须调用保存操作,否则不符合受控基础资料开发规范
|
||||
// SaveServiceHelper.save(new DynamicObject[]{currentCus});
|
||||
operResult = OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{currentCus}, oop);
|
||||
|
|
@ -162,6 +152,26 @@ public class CustomerControler {
|
|||
itemInfo.put("error","客户保存失败"+operResult.getMessage());
|
||||
itemsJson.add(itemInfo);
|
||||
}
|
||||
//处理分类-客户只有一个分类
|
||||
custgroupdetail = BusinessDataServiceHelper.loadSingle(gdName,new QFilter[]{
|
||||
new QFilter("customer.id","=",currentCustId)});
|
||||
if(custgroupdetail == null){
|
||||
custgroupdetail = BusinessDataServiceHelper.newDynamicObject(gdName);
|
||||
custgroupdetail.set("createorg", grouporginfo);//创建组织
|
||||
custgroupdetail.set("standard",EsbUtils.CUSTOMERSTAND);//客户分类标准
|
||||
custgroupdetail.set("customer",currentCus);//客户
|
||||
}
|
||||
|
||||
custgroupdetail.set("group",custype);//具体分类
|
||||
// SaveServiceHelper.save(new DynamicObject[]{custgroupdetail});
|
||||
operResult = OperationServiceHelper.executeOperate("save", gdName, new DynamicObject[]{custgroupdetail}, oop);
|
||||
if(!operResult.isSuccess()){
|
||||
log.error(String.format("客户分类保存失败:%s", json_body.toJSONString()));
|
||||
itemInfo = new JSONObject();
|
||||
itemInfo.put("code",cusnumber);
|
||||
itemInfo.put("error","客户分类保存失败"+operResult.getMessage());
|
||||
itemsJson.add(itemInfo);
|
||||
}
|
||||
}else{
|
||||
//修改客户 名称 税务登记号 联系人 联系电话 银行信息 客户组5
|
||||
currentCustId = currentCus.getLong("id");
|
||||
|
|
|
|||
Loading…
Reference in New Issue