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); }