/***文档注释***********************************************
 * 作者            ：
 * 创建日期     ：2018-01-13
 * 描述            ：客户发票管理表
 * 注意事项     ：
 * 遗留BUG   ：
 * 修改日期     ：
 * 修改人员     ：
 * 修改内容     ：
 ***********************************************************/
package market.Slm.FundManagement.impl;
import java.util.ArrayList;
import java.util.List;

import market.Com.vo.CommonPage;
import market.Com.vo.ResultModel;
import market.Slm.FundManagement.mapper.SlmFundInvoiceApplyDetailMapper;
import market.Slm.FundManagement.service.SlmFundInvoiceApplyDetailService;
import market.Slm.FundManagement.vo.SlmFundInvoiceApplyDetail;

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

@RemoteService(path="SlmFundInvoiceApplyDetailService")
public class SlmFundInvoiceApplyDetailServiceImpl extends BaseServiceImpl<SlmFundInvoiceApplyDetail,Object> implements SlmFundInvoiceApplyDetailService {

	/**
	 * 查看发票明细
	 * */
	public ResultModel doQueryWeb(CommonPage<SlmFundInvoiceApplyDetail> sum){
		ResultModel rm=new ResultModel();
		SlmFundInvoiceApplyDetail invoice=sum.getObject();
		try{
			List<SlmFundInvoiceApplyDetail> temp_list=new ArrayList<SlmFundInvoiceApplyDetail>();
			List<SlmFundInvoiceApplyDetail> list=this.getMapper(SlmFundInvoiceApplyDetailMapper.class).findWithCondition(invoice, null, " seq desc", 0, 0);
			for(SlmFundInvoiceApplyDetail details:list){
				if(details.getWeight()!=null){
					double weight=Double.parseDouble(details.getWeight());
					if(weight==0){
					}else{
						temp_list.add(details);
					}
				}
			}
			rm.setState("200");
			rm.setData(temp_list);
		}catch(Exception e){
			rm.setState("500");
			rm.setMsgInfo(e.getMessage());
		}
		return rm;
	}
	
	//=================APP eason add 2019-07-15===========================
	/**
	 * 查看发票明细
	 * */
	public ResultModel doQueryApp(CommonPage<SlmFundInvoiceApplyDetail> sum){
		ResultModel rm=new ResultModel();
		SlmFundInvoiceApplyDetail invoice=sum.getObject();
		try{
			List<SlmFundInvoiceApplyDetail> temp_list=new ArrayList<SlmFundInvoiceApplyDetail>();
			List<SlmFundInvoiceApplyDetail> list=this.getMapper(SlmFundInvoiceApplyDetailMapper.class).findWithCondition(invoice, null, " seq desc", 0, 0);
			for(SlmFundInvoiceApplyDetail details:list){
				if(details.getWeight()!=null){
					double weight=Double.parseDouble(details.getWeight());
					if(weight==0){
					}else{
						temp_list.add(details);
					}
				}
			}
			rm.setState("200");
			rm.setData(temp_list);
		}catch(Exception e){
			rm.setState("500");
			rm.setMsgInfo(e.getMessage());
		}
		return rm;
	}
}
