/** * 更新商品参数 * * @return */ @Action( value = "updateGoodsAttributeT", results = {@Result(name = "json", type = "json")}) public String updateGoodsAttributeT() { JSONArray ja = (JSONArray) JSONValue.parse(this.getRjson()); int jsonsize = ja.size(); GoodsAttributeT gat = new GoodsAttributeT(); for (int i = 0; i < jsonsize; i++) { gat.setCreatetime(BaseTools.systemtime()); gat.setState(StaticKey.ONE); gat.setCreatorid(BaseTools.adminCreateId()); gat.setGoodsTypeId(this.getGoodsTypeId()); gat.setGoodsTypeName(this.getGoodsTypeName()); gat.setAttributeIndex(this.getAttributeIndex()); JSONObject jo = (JSONObject) ja.get(i); gat.setGoodsattributename(jo.get(StaticKey.GOODSATTRIBUTENAME).toString()); gat.setAttributeType(jo.get(StaticKey.ATTRIBUTETYPE).toString()); gat.setAttributelist(jo.get(StaticKey.ATTRIBUTELIST).toString()); gat.setSort(jo.get(StaticKey.SORT).toString()); gat.setGoodsattributeid(jo.get(StaticKey.GOODSATTRIBUTEID).toString()); if (gat.getGoodsattributeid().length() == 0) { gat.setGoodsattributeid(this.getSerial().Serialid(Serial.GOODSATTRIBUTE)); this.getGoodsAttributeTService().save(gat); } else { this.getGoodsAttributeTService().updateGoodsAttributeT(gat); } } this.setSucflag(true); return "json"; }