dealserviceimpl.java

来自「q企业web应用 q企业web应用 q企业web应用」· Java 代码 · 共 42 行

JAVA
42
字号
package com.meybosoft.microerp.business.impl;

import java.util.Collection;
import com.easyjf.util.Assert;
import com.easyjf.web.tools.DbPageList;
import com.easyjf.web.tools.IPageList;
import com.meybosoft.microerp.business.DealService;
import com.meybosoft.microerp.business.LogicException;
import com.meybosoft.microerp.domain.Deal;

public class DealServiceImpl extends AbstractDAOServiceSupport implements
		DealService {
	public boolean addDeal(Deal deal) {
		Assert.notNull(deal);
		if(deal.getCustomer()==null)throw new LogicException("客户不能为空!");		
		return this.dao.save(deal);
	}

	public boolean delDeal(Deal deal) {
		Assert.notNull(deal);
		return this.dao.del(deal);
	}

	public Deal getDeal(Long id) {
		Assert.notNull(id);
		return (Deal)this.dao.get(Deal.class, id);
	}

	public IPageList queryDeal(String scope, Collection paras, int currentPage, int pageSize) {
		DbPageList pageList=new DbPageList(Deal.class,scope,paras,dao);
		pageList.doList(currentPage, pageSize);	
		return pageList;
	}

	public boolean updateDeal(Deal deal) {
		Assert.notNull(deal);
		Assert.notNull(deal.getId());
		return this.dao.update(deal);
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?