81,092
社区成员
发帖
与我相关
我的任务
分享
public ActionForward saveItemContents(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws JSONException{
JSONObject json = new JSONObject();
json.put("result", true);
try {
Long contractorId = RequestUtils.getLongParameter(request, "contractorId", -1L);
System.out.println("id===========>>>"+contractorId);
String itemContents = RequestUtils.getStringParameter(request, "itemContents", "");
JSONArray array = new JSONArray(itemContents);
Set<ContractorItem> itemSet = new HashSet<ContractorItem>();
for (int i = 0; i < array.length(); i++) {
JSONObject obj = array.getJSONObject(i);
String id = obj.get("id").toString();
String supplierNameFull = obj.get("supplierNameFull").toString();
String companyProperty = obj.get("companyProperty").toString();
String procurementType = obj.get("procurementType").toString();
String wareHousingReason = obj.get("wareHousingReason").toString();
}
} catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
json.put("result", false);
}
return this.renderJson(response, json.toString());
}