bom接口源码
This commit is contained in:
parent
0a7bdc4334
commit
42bed41623
|
@ -0,0 +1,102 @@
|
|||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by FernFlower decompiler)
|
||||
//
|
||||
|
||||
package nccloud.openapi.mmbd.bom;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import nc.bs.framework.common.NCLocator;
|
||||
import nc.util.mmf.framework.base.MMValueCheck;
|
||||
import nccloud.api.mmbd.bom.IAPIBomBusinessService;
|
||||
import nccloud.api.rest.utils.ResultMessageUtil;
|
||||
import nccloud.ws.rest.resource.AbstractNCCRestResource;
|
||||
import org.json.JSONString;
|
||||
|
||||
@Path("mmbd/bom")
|
||||
public class BomResource extends AbstractNCCRestResource {
|
||||
public BomResource() {
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("operation/add")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString insert(JSONObject para) {
|
||||
List<Map<String, Object>> paramList = (List)para.get("data");
|
||||
if (MMValueCheck.isEmpty(paramList)) {
|
||||
return ResultMessageUtil.exceptionToJSON("传入数据异常,参数要包含表头信息和表体信息", "1");
|
||||
} else {
|
||||
IAPIBomBusinessService service = (IAPIBomBusinessService)NCLocator.getInstance().lookup(IAPIBomBusinessService.class);
|
||||
JSONString result = service.insert(paramList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("add")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString insert(List<Map<String, Object>> paramList) {
|
||||
if (MMValueCheck.isEmpty(paramList)) {
|
||||
return ResultMessageUtil.exceptionToJSON("传入数据异常,参数要包含表头信息和表体信息", "1");
|
||||
} else {
|
||||
IAPIBomBusinessService service = (IAPIBomBusinessService)NCLocator.getInstance().lookup(IAPIBomBusinessService.class);
|
||||
JSONString result = service.insert(paramList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("operation/update")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString update(JSONObject para) {
|
||||
List<Map<String, Object>> paramList = (List)para.get("data");
|
||||
if (MMValueCheck.isEmpty(paramList)) {
|
||||
return ResultMessageUtil.exceptionToJSON("传入数据异常,参数要包含表头信息和表体信息", "1");
|
||||
} else {
|
||||
IAPIBomBusinessService service = (IAPIBomBusinessService)NCLocator.getInstance().lookup(IAPIBomBusinessService.class);
|
||||
JSONString result = service.update(paramList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("update")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString update(List<Map<String, Object>> paramList) {
|
||||
if (MMValueCheck.isEmpty(paramList)) {
|
||||
return ResultMessageUtil.exceptionToJSON("传入数据异常,参数要包含表头信息和表体信息", "1");
|
||||
} else {
|
||||
IAPIBomBusinessService service = (IAPIBomBusinessService)NCLocator.getInstance().lookup(IAPIBomBusinessService.class);
|
||||
JSONString result = service.update(paramList);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("query")
|
||||
@Consumes({"application/json"})
|
||||
@Produces({"application/json"})
|
||||
public JSONString query(Map<String, Object> paramMap) {
|
||||
if (MMValueCheck.isEmpty(paramMap)) {
|
||||
return ResultMessageUtil.exceptionToJSON("传入数据异常,未传入查询条件", "1");
|
||||
} else {
|
||||
IAPIBomBusinessService service = (IAPIBomBusinessService)NCLocator.getInstance().lookup(IAPIBomBusinessService.class);
|
||||
JSONString result = service.query(paramMap);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public String getModule() {
|
||||
return "mmbd";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue