package com.changhong.epc.admin.service.cost.impl; import com.changhong.epc.admin.mapper.centen.cost.CostTypeTemplateMapper; import com.changhong.epc.admin.service.cost.SuppStanderTemplateService; import com.changhong.epc.bean.admin.SuppStanderTemplate; import com.changhong.epc.bean.admin.extend.SuppStanderTemplateDto; import com.changhong.epc.bean.admin.extend.SuppStanderTemplateExtend; import com.changhong.epc.bean.tenant.norm.extend.AppStanderExtend; import com.changhong.epc.bean.tenant.norm.extend.SuppStanderExtend; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import sun.misc.Regexp; import javax.annotation.Resource; import java.util.List; @Service @Slf4j public class SuppStanderTemplateServiceImpl implements SuppStanderTemplateService { @Resource private CostTypeTemplateMapper costTypeTemplateMapper; @Override public List selectByid(SuppStanderTemplate suppStander) { return costTypeTemplateMapper.selectByid(suppStander); } @Override public int saveSupp(SuppStanderTemplateDto suppStander) { int count = 0; List suppStanderExtend = suppStander.getSuppStanderExtend(); costTypeTemplateMapper.suppStanderUpdate(suppStanderExtend); costTypeTemplateMapper.appStanderDefUpdate(suppStanderExtend); for(SuppStanderTemplateExtend sse : suppStanderExtend){ sse.initParam(); count += costTypeTemplateMapper.suppStanderSave(sse); for(AppStanderExtend appStanderExtend: sse.getAppStanderDefs()) { count += costTypeTemplateMapper.appStanderDefSaveOne(appStanderExtend, sse); } } return count; } }