/***文档注释***********************************************
 * 作者            ：
 * 创建日期     ：2018-07-21
 * 描述            ：复合牌号与炼钢牌号关系表
 * 注意事项     ：
 * 遗留BUG   ：
 * 修改日期     ：
 * 修改人员     ：
 * 修改内容     ：
***********************************************************/
package market.Qms.qcm.service.impl;
import java.util.List;

import market.Com.vo.CommonPage;
import market.Com.vo.ResultModel;
import market.Qms.qcm.mapper.ComBaseGradeCompDMapper;
import market.Qms.qcm.service.ComBaseGradeCompDService;
import market.Qms.qcm.vo.ComBaseGradeCompD;
import market.Qms.qcm.vo.ComBaseGradeCompM;

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

@RemoteService(path="ComBaseGradeCompDService")
public class ComBaseGradeCompDServiceImpl extends BaseServiceImpl<ComBaseGradeCompD,Object> implements ComBaseGradeCompDService {
	public ResultModel getDsample(CommonPage<ComBaseGradeCompM> sum){
		ResultModel rm=new ResultModel();
		ComBaseGradeCompM cbgm=sum.getObject();
		try {
			if (cbgm.getComp_grade_code()!=null&&!cbgm.getComp_grade_code().equals("")) {
				List<ComBaseGradeCompD> listD = this.getMapper(ComBaseGradeCompDMapper.class).findWithCondition(null, "COMP_GRADE_CODE='"+cbgm.getComp_grade_code()+"'", null, (sum.getPageIndex()-1)*sum.getPageSize(), sum.getPageSize());
			    for (ComBaseGradeCompD s : listD) {
					s.setStatus("1");
				}
				rm.setData(listD);
				rm.setState("200");
			}else {
				rm.setState("500");
				rm.setMsgInfo("无法查询对应炼钢牌号信息");
				return rm;
			}
		} catch (Exception e) {
			// TODO: handle exception
			rm.setState("500");
			rm.setMsgInfo("查询炼钢牌号失败");
			rm.setErrorInfo(e.getMessage());
		}
		return rm;
	}
}
