接⼝API常⽤代码(post、get)
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package zb.pc.web.api.pcbd;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
import java.util.Map.Entry;
import kd.bos.bill.IBillWebApiPlugin;
import kd.ity.DynamicObject;
import kd.adata.IDataEntityProperty;
import kd.adata.clr.DataEntityPropertyCollection;
import ity.api.ApiResult;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import zb.pcmon.utils.OperateUtils;
public class CardataSaveWebApiPlugin implements IBillWebApiPlugin {
private static final String SELECTPROPERTY =
"id,zb_cvrelationship,zb_filingunit,zb_carcode,zb_cartype,zb_tare,zb_carname,name,zb_fuelnum,zb_gaugescale,zb_excessivecause,zb_deviation,zb_in car,zb_changecauses,zb_eliminatetype,zb_issunshade,zb_licenseaddress,zb_undescription,zb_uncauses,zb_isqualified,zb_description,zb_high,zb_widt h,zb_length,zb_canvasnum,zb_sparenum,zb_fuelcapacity,zb_isagain,zb_version,enable,status,number";
public static final String FORMBILLID = "zb_pc_cardata";
public CardataSaveWebApiPlugin() {
}
public ApiResult doCustomService(Map<String, Object> params) {
try {
DynamicObject billInfo = null;
Object[] billIds = new Object[1];
if (("id") != null && !"".("id"))) {
billIds[0] = ("id");
billIds[0] = ("id");
billInfo = BusinessDataServiceHelper.loadSingle(billIds[0], "zb_pc_cardata",
"id,zb_cvrelationship,zb_filingunit,zb_carcode,zb_cartype,zb_tare,zb_carname,name,zb_fuelnum,zb_gaugescale,zb_excessivecause,zb_deviation,zb_in car,zb_changecauses,zb_eliminatetype,zb_issunshade,zb_licenseaddress,zb_undescription,zb_uncauses,zb_isqualified,zb_description,zb_high,zb_widt h,zb_length,zb_canvasnum,zb_sparenum,zb_fuelcapacity,zb_isagain,zb_version,enable,status,number");
} else {
billInfo = wDynamicObject("zb_pc_cardata");
this.SetInitDynamicObject(params, billInfo);
}
this.SetDynamicObject(params, billInfo);
OperateUtils.saveOperate(new DynamicObject[]{billInfo});
Map<String, Object> resultMap = new HashMap(16);
resultMap.put("id", PkValue());
return ApiResult.success(resultMap);
} catch (Exception var5) {
var5.printStackTrace();
return ApiResult.Message());
}
}
private void SetDynamicObject(Map<String, Object> params, DynamicObject billInfo) {
DataEntityPropertyCollection properties = DataEntityType().getProperties();
Iterator var4 = Set().iterator();
while(var4.hasNext()) {
Entry<String, Object> entry = (();
IDataEntityProperty iDataEntityProperty = ((Key());
if (!Objects.isNull(iDataEntityProperty) && !Objects.Value())) {
billInfo.set((Key(), Value());
}
}
}
private void SetInitDynamicObject(Map<String, Object> params, DynamicObject billInfo) {
Map<String, Object> creatorMap = (("creator");
billInfo.set("creator", this.mapToDynamicObject(creatorMap, "bos_user"));
billInfo.set("createtime", new Date());
billInfo.set("status", "A");
billInfo.set("enable", "1");
}
private DynamicObject mapToDynamicObject(Map<String, Object> map, String entityName) {
DynamicObject dynamicObject = wDynamicObject(entityName);
Iterator var4 = Set().iterator();
while(var4.hasNext()) {
Entry<String, Object> entry = (();
百度api接口
dynamicObject.set((Key(), Value());
}
return dynamicObject;
}
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。