/***文档注释***********************************************
 * 作者               :                   易鑫
 * 创建日期      :                   2017.10.24
 * 描述               :        			合同指定产线信息
 * 注意事项      :                   无
 * 遗留BUG :                   无
 * 修改日期      :                   
 * 修改人员      :                   
 * 修改内容      :                   
***********************************************************/
package market.Slm.ContractManagement.impl;

import java.util.ArrayList;
import java.util.List;

import market.Com.vo.CommonPage;
import market.Com.vo.ResultModel;
import market.Slm.ContractManagement.mapper.SlmCustAlphaUseMapper;
import market.Slm.ContractManagement.service.SlmCustAlphaUseService;
import market.Slm.ContractManagement.vo.SlmCustAlphaUse;

import com.hnshituo.basic.service.impl.BaseServiceImpl;
import com.hnshituo.basic.spring.remoting.annotation.RemoteService;

@RemoteService(path="SlmCustAlphaUseService")
public class SlmCustAlphaUseServiceImpl extends BaseServiceImpl<SlmCustAlphaUse,Object> implements SlmCustAlphaUseService {
	/**
	 * 查询某个客户下录入的客户ALPHA码
	 * chem_alpha_no客户编号，memo1产品名称
	 * */
	public ResultModel doQueryWeb(CommonPage<SlmCustAlphaUse> sum){
		ResultModel rm=new ResultModel();
		SlmCustAlphaUse use=sum.getObject();
		String productName=sum.getMemo1();
		List<SlmCustAlphaUse> list=new ArrayList<SlmCustAlphaUse>();
		try{
			//标准模板
			List<SlmCustAlphaUse> stdList=this.getMapper(SlmCustAlphaUseMapper.class).doQueryStd(productName); 
			List<SlmCustAlphaUse> useList=this.getMapper(SlmCustAlphaUseMapper.class).doQuery(use.getChem_alpha_no()); 
			list.addAll(stdList);
			list.addAll(useList);
			rm.setState("200");
			rm.setData(list);
		}catch(Exception ex){
			rm.setState("500");
			rm.setMsgInfo("查询失败!");
			ex.printStackTrace();
		}
		return rm;
	}
}
