|
@@ -4,14 +4,17 @@ import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.ym.mec.biz.dal.dao.DegreeRegistrationDao;
|
|
import com.ym.mec.biz.dal.dao.DegreeRegistrationDao;
|
|
|
|
+import com.ym.mec.biz.dal.dao.OrganizationDao;
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
import com.ym.mec.biz.dal.dao.StudentPaymentOrderDetailDao;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
import com.ym.mec.biz.dal.enums.EDegreeStatus;
|
|
import com.ym.mec.biz.dal.enums.EDegreeStatus;
|
|
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
|
|
import com.ym.mec.biz.service.OrganizationService;
|
|
import com.ym.mec.biz.service.OrganizationService;
|
|
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
|
|
|
|
import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
|
|
+import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.joda.time.DateTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -47,6 +50,9 @@ public class DegreeServiceImpl extends ServiceImpl<DegreeMapper, Degree> impleme
|
|
@Autowired
|
|
@Autowired
|
|
private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
private StudentPaymentOrderDetailDao studentPaymentOrderDetailDao;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private OrganizationDao organizationDao;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询详情
|
|
* 查询详情
|
|
* @param id 详情ID
|
|
* @param id 详情ID
|
|
@@ -204,4 +210,46 @@ public class DegreeServiceImpl extends ServiceImpl<DegreeMapper, Degree> impleme
|
|
|
|
|
|
return statistical;
|
|
return statistical;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 学生考级信息查询
|
|
|
|
+ *
|
|
|
|
+ * @param id 考级ID
|
|
|
|
+ * @return DegreeWrapper.StudentDegreeInfo
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public DegreeWrapper.StudentDegreeInfo studentDegreeInfoById(Long id) {
|
|
|
|
+
|
|
|
|
+ Degree degree = getById(id);
|
|
|
|
+ // 考级信息不存在
|
|
|
|
+ if (Objects.isNull(degree)) {
|
|
|
|
+ throw new BizException("考级信息不存在");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Date currentDate = DateTime.now().toDate();
|
|
|
|
+ // 考级时间不匹配
|
|
|
|
+ if (degree.getStartTime().after(currentDate) || degree.getEndTime().before(currentDate)) {
|
|
|
|
+ throw new BizException("考级报名已经结束");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 考级分部信息
|
|
|
|
+ DegreeWrapper.StudentDegreeInfo wrapper = DegreeWrapper.StudentDegreeInfo.from(JSON.toJSONString(degree));
|
|
|
|
+
|
|
|
|
+ // 分部信息
|
|
|
|
+ if(StringUtils.isNotEmpty(wrapper.getOrganIds())){
|
|
|
|
+
|
|
|
|
+ // 考级分部ID
|
|
|
|
+ List<Integer> collect = Arrays.stream(wrapper.getOrganIds().split(","))
|
|
|
|
+ .mapToInt(Integer::valueOf).boxed()
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ List<Organization> organs = organizationDao.findOrgans(collect);
|
|
|
|
+
|
|
|
|
+ if (org.apache.commons.collections.CollectionUtils.isNotEmpty(organs)) {
|
|
|
|
+ wrapper.setDegreeCities(JSON.parseArray(JSON.toJSONString(organs), DegreeWrapper.DegreeCity.class));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return wrapper;
|
|
|
|
+ }
|
|
}
|
|
}
|