public void modifRetuenDefary(int i) { Defray def = defaryDao.findById(i); User user = def.getShopId().getUsers(); user.setMoney(user.getMoney() + (long) (def.getMoney())); // 虚拟币退还 userDao.save(user); // 保存用户信息 defaryDao.delete(def); // 删除本次申请 }
public int getDefarysByShop(int shopId, int state) { if (shopId != 0) { return defaryDao.getPropertyCount( new String[] {DefrayDAO.SHOP_ID, DefrayDAO.STATE}, new Integer[] {shopId, state}); } else { return defaryDao.getPropertyCount(new String[] {DefrayDAO.STATE}, new Integer[] {state}); } }
public List<Defray> findDefarysByShop(int shopId, int state, int pageSize, int startRow) { if (shopId != 0) { return defaryDao.findByProperty( new String[] {DefrayDAO.SHOP_ID, DefrayDAO.STATE}, new Integer[] {shopId, state}, pageSize, startRow, null, null); } else { return defaryDao.findByProperty( new String[] {DefrayDAO.STATE}, new Integer[] {state}, pageSize, startRow, null, null); } }
public void addDefarys(Defray obj, int shopId) { Shop shop = shopDao.findById(shopId); if (shop != null) { obj.setShopId(shop); User user = shop.getUsers(); user.setMoney(user.getMoney() - (long) (PriceFormat.formateFen(obj.getMoney()))); // 先减去申请的利润 userDao.save(user); obj.setMoney(PriceFormat.formateFen(obj.getMoney())); // 把单位元转为分 obj.setState(Constants.DEF_NO); obj.setCreateDate(System.currentTimeMillis()); defaryDao.save(obj); } }
public void modifOverDefary(int i) { Defray def = defaryDao.findById(i); def.setState(Constants.DEF_OK); def.setUpdateDate(System.currentTimeMillis()); defaryDao.save(def); }