public String updateStateShop() { String shopId = ServletActionContext.getRequest().getParameter("shopId"); Shop shop = shopService.get(Integer.parseInt(shopId)); if (shop.getShopstate().equals("0")) { shop.setShopstate("1"); } else { shop.setShopstate("0"); } shopService.update(shop); jsonMap.put("data", "right"); return "json"; }
// 审核时查找记录 public String searchMyCheckList() { // Shop shop = (Shop) session.get("shop"); String userId = req.getParameter("userId"); // String userId = Struts2Utils.getParameter("userId"); Shop shop = shopService.checkShopidByUserId(Integer.parseInt(userId)); int shopId = shop.getShopId(); page = prolongApplyService.getMyCheckListPhone(page, shopId, "0"); if (page.getTotalItems() > 0) { // String jsonList = JSONUtils.toJSONString(page); jsonMap.put("isResult", page); return "checkProlongApply"; } else { jsonMap.put("isResult", "false"); return "checkProlongApply"; } }
// 支付成功,更新店铺表,添加保证金记录表 public String updateAndSave() { int modelId = Integer.parseInt(req.getParameter("shopId")); Shop model = shopService.get(modelId); int money = model.getMargin() + Integer.parseInt(req.getParameter("money")); model.setMargin(money); model.setMarginstate("1"); // shopService.update(model);// 更新店铺表 Date now = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); MarginDetail modelMarginDetail = new MarginDetail(); modelMarginDetail.setUserinfo(model.getUserinfo()); modelMarginDetail.setUserTime(dateFormat.format(now)); modelMarginDetail.setShop(model); modelMarginDetail.setMoney(Integer.parseInt(req.getParameter("money"))); modelMarginDetail.setRemark(req.getParameter("remark")); // marginDetailService.save(modelMarginDetail);// 添加保证金记录表 shopService.updateAndSave(model, modelMarginDetail); return "viewMarginRedirect"; }
// zz for shopGoods public String updateG() { UserInfo userinfo = (UserInfo) session.get("userinfo"); String goodId = req.getParameter("goodId"); String sid = req.getParameter("shopId"); Shop shop = shopService.get(Integer.parseInt(sid)); session.put("shopid", shop.getShopId()); request.put("shop", shop); Goods good = goodsService.get(Integer.parseInt(goodId)); if (good.getState().equals("0")) { good.setState("2"); } else { good.setState("0"); } goodsService.updateGoods(good, messageService, userinfo, shop); // goodsService.update(good); // messageService.sendMessage(messageService,"您店铺的商品已被管理员下架,请点击查看!", userinfo.getUserinfoId(), // shop.getUserinfo().getUserinfoId(), // "goodsAction_queryById.action", "shopId", shop.getShopId()); jsonMap.put("data", "right"); return "json"; }