|
@@ -8,7 +8,9 @@ import com.ym.mec.biz.dal.dao.SubjectDao;
|
|
|
import com.ym.mec.biz.dal.entity.DegreeLevelFeeNew;
|
|
|
import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.enums.DegreeTypeEnum;
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import com.ym.mec.biz.dal.vo.DegreeLevelFeeNewVo;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -16,6 +18,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import com.ym.mec.biz.dal.wrapper.DegreeLevelFeeWrapper;
|
|
|
import com.ym.mec.biz.dal.mapper.DegreeLevelFeeMapper;
|
|
|
import com.ym.mec.biz.service.DegreeLevelFeeService;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -154,4 +157,18 @@ public class DegreeLevelFeeServiceImpl extends ServiceImpl<DegreeLevelFeeMapper,
|
|
|
|
|
|
return degreeLevelFee;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void batchSave(List<DegreeLevelFeeNew> degreeLevelFees) {
|
|
|
+ DegreeLevelFeeNew degreeLevelFeeNew = degreeLevelFees.get(0);
|
|
|
+ Integer subjectId = degreeLevelFeeNew.getSubjectId();
|
|
|
+ DegreeTypeEnum degreeType = degreeLevelFeeNew.getDegreeType();
|
|
|
+ String levels = degreeLevelFees.stream().map(e -> e.getLevel().toString()).collect(Collectors.joining(","));
|
|
|
+ String level = baseMapper.checkSave(subjectId,degreeType.getCode(),levels);
|
|
|
+ if(StringUtils.isNotEmpty(level)){
|
|
|
+ throw new BizException(level + "配置已存在");
|
|
|
+ }
|
|
|
+ this.saveBatch(degreeLevelFees);
|
|
|
+ }
|
|
|
}
|