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

import market.Com.vo.ResultModel;
import market.Slm.FundManagement.mapper.SlmFundSettleBillLineMapper;
import market.Slm.FundManagement.service.SlmFundSettleBillLineService;
import market.Slm.FundManagement.vo.SlmFundSettleBillLine;

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

@RemoteService(path="SlmFundSettleBillLineService")
public class SlmFundSettleBillLineServiceImpl extends BaseServiceImpl<SlmFundSettleBillLine,Object> implements SlmFundSettleBillLineService {

	/**
	 * 结算子单 - 新增
	 * */
	public ResultModel doAddWeb(SlmFundSettleBillLine lines) {
		ResultModel rm=new ResultModel();
		if(lines.getSettle_bill_line_no()==null||"".equals(lines.getSettle_bill_line_no())){
			List<SlmFundSettleBillLine> list=this.getMapper(SlmFundSettleBillLineMapper.class).findWithCondition(null, " settle_bill_no='"+lines.getSettle_bill_no()+"'"," settle_bill_line_no desc",0,1);
			if(list.size()>0){
				long Lid=Long.parseLong(list.get(0).getSettle_bill_line_no());
				lines.setSettle_bill_line_no(String.valueOf(Lid+1));
			}else{
				lines.setSettle_bill_line_no(lines.getSettle_bill_no()+"001");
			}
		}
		this.getMapper(SlmFundSettleBillLineMapper.class).insert(lines);
		return rm;
	}
	
}
