/***文档注释***********************************************
 * 作者            ：
 * 创建日期     ：2018-01-23
 * 描述            ：全程产线号与钢种对应表
 * 注意事项     ：
 * 遗留BUG   ：
 * 修改日期     ：
 * 修改人员     ：
 * 修改内容     ：
***********************************************************/
package market.Qms.metallurgy.impl;
import market.Com.vo.CommonPage;
import market.Com.vo.ResultModel;
import market.Qms.metallurgy.mapper.ComMscGradeMapper;
import market.Qms.metallurgy.mapper.ComMscGradeRDeliverystateMapper;
import market.Qms.metallurgy.mapper.ComMscGradeRSpecMapper;
import market.Qms.metallurgy.service.ComMscGradeService;
import market.Qms.metallurgy.vo.ComMscGrade;
import market.Qms.metallurgy.vo.ComMscGradeRDeliverystate;

import org.springframework.transaction.annotation.Transactional;

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

@RemoteService(path="ComMscGradeService")
public class ComMscGradeServiceImpl extends BaseServiceImpl<ComMscGrade,Object> implements ComMscGradeService {
	
	/**
	 *级联删除--制程炼钢牌号
	 * @param com
	 * @return
	 */
	@Transactional(value="tm", rollbackFor=Exception.class)
	public ResultModel DelMscGrade(CommonPage<ComMscGrade> com){
		ResultModel rm=new ResultModel();
		ComMscGrade grade=com.getObject();
		this.getMapper(ComMscGradeMapper.class).delete(grade.getMsc(),grade.getMsc_pline(),grade.getGrade_code());
		ComMscGradeRDeliverystate state=new ComMscGradeRDeliverystate();
		state.setGrade_code(grade.getGrade_code());
		state.setMsc(grade.getMsc());
		state.setMsc_pline(grade.getMsc_pline());
		this.getMapper(ComMscGradeRDeliverystateMapper.class).doDelete(state);
		this.getMapper(ComMscGradeRSpecMapper.class).doDelete(grade.getMsc(),grade.getMsc_pline(),grade.getGrade_code());
		rm.setMsgInfo("删除成功");
		rm.setState("200");
		return rm;
		
	}
}
