|
@@ -193,10 +193,10 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
ClassGradeQueryBo classGradeQueryBo = new ClassGradeQueryBo();
|
|
ClassGradeQueryBo classGradeQueryBo = new ClassGradeQueryBo();
|
|
classGradeQueryBo.setGradeId(gradeId);
|
|
classGradeQueryBo.setGradeId(gradeId);
|
|
ClassGradeVo vo = entity2Vo(baseMapper.queryList(classGradeQueryBo)).get(0);
|
|
ClassGradeVo vo = entity2Vo(baseMapper.queryList(classGradeQueryBo)).get(0);
|
|
- if (ObjectUtil.isNotNull(vo) && StringUtils.isNotBlank(vo.getSevenCode())){
|
|
|
|
|
|
+ if (ObjectUtil.isNotNull(vo) && StringUtils.isNotBlank(vo.getSevenCode())) {
|
|
//七大员继教班级 获取年份
|
|
//七大员继教班级 获取年份
|
|
List<String> years = baseMapper.getSevenYearByCode(vo.getSevenCode());
|
|
List<String> years = baseMapper.getSevenYearByCode(vo.getSevenCode());
|
|
- if (CollectionUtils.isNotEmpty(years)){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(years)) {
|
|
vo.setSevenYear(years.stream().collect(Collectors.joining(",")));
|
|
vo.setSevenYear(years.stream().collect(Collectors.joining(",")));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -234,11 +234,11 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
@Override
|
|
@Override
|
|
public List<ClassGradeGoodsVo> listGoodsBatch(ClassGradeQueryBo bo) {
|
|
public List<ClassGradeGoodsVo> listGoodsBatch(ClassGradeQueryBo bo) {
|
|
List<ClassGradeGoodsVo> classGradeGoodsVos = baseMapper.listGoodsBatch(bo);
|
|
List<ClassGradeGoodsVo> classGradeGoodsVos = baseMapper.listGoodsBatch(bo);
|
|
- if (CollectionUtils.isEmpty(classGradeGoodsVos)){
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(classGradeGoodsVos)) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
classGradeGoodsVos.forEach(item -> {
|
|
classGradeGoodsVos.forEach(item -> {
|
|
- if (CollectionUtils.isNotEmpty(item.getGradeList())){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(item.getGradeList())) {
|
|
List<ClassGradeVo> collect = item.getGradeList().stream().filter(gradeVo -> {
|
|
List<ClassGradeVo> collect = item.getGradeList().stream().filter(gradeVo -> {
|
|
//班级人数是否满人
|
|
//班级人数是否满人
|
|
if (ObjectUtil.isNotNull(gradeVo.getSevenCode())) {
|
|
if (ObjectUtil.isNotNull(gradeVo.getSevenCode())) {
|
|
@@ -250,24 +250,24 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
|
|
|
//二建/二造继教班级过滤
|
|
//二建/二造继教班级过滤
|
|
String businessName = iGoodsService.getGoodsBusinessName(item.getGoodsId());
|
|
String businessName = iGoodsService.getGoodsBusinessName(item.getGoodsId());
|
|
- if (businessName.contains("继续教育二级建造师") || businessName.contains("继续教育二级造价师")){
|
|
|
|
- if (Validator.isNotEmpty(gradeVo.getClassStatus())&&gradeVo.getClassStatus() == 1 &&
|
|
|
|
- (gradeVo.getClassStartTime() > DateUtils.getNowTime() || gradeVo.getClassEndTime() < DateUtils.getNowTime())){
|
|
|
|
|
|
+ if (businessName.contains("继续教育二级建造师") || businessName.contains("继续教育二级造价师")) {
|
|
|
|
+ if (Validator.isNotEmpty(gradeVo.getClassStatus()) && gradeVo.getClassStatus() == 1 &&
|
|
|
|
+ (gradeVo.getClassStartTime() > DateUtils.getNowTime() || gradeVo.getClassEndTime() < DateUtils.getNowTime())) {
|
|
//过期班级
|
|
//过期班级
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
//班级人数
|
|
//班级人数
|
|
Goods goods = iGoodsService.getById(item.getGoodsId());
|
|
Goods goods = iGoodsService.getById(item.getGoodsId());
|
|
SysTenant tenant = iSysTenantService.getById(goods.getTenantId());
|
|
SysTenant tenant = iSysTenantService.getById(goods.getTenantId());
|
|
- if (tenant.getSevenClass() == 1){
|
|
|
|
|
|
+ if (tenant.getSevenClass() == 1) {
|
|
Integer numAll = getClassUserNumAll(gradeVo.getGradeId());
|
|
Integer numAll = getClassUserNumAll(gradeVo.getGradeId());
|
|
- if (gradeVo.getStudentUpper() <= numAll){
|
|
|
|
|
|
+ if (gradeVo.getStudentUpper() <= numAll) {
|
|
//班级人数已满
|
|
//班级人数已满
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
Long num = baseMapper.getClassUserNumByTenant(gradeVo.getGradeId());
|
|
Long num = baseMapper.getClassUserNumByTenant(gradeVo.getGradeId());
|
|
- if (gradeVo.getStudentUpper() <= num){
|
|
|
|
|
|
+ if (gradeVo.getStudentUpper() <= num) {
|
|
//班级人数已满
|
|
//班级人数已满
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -325,11 +325,11 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
List<ClassGradeInterface> list = iClassGradeInterfaceService.list(new LambdaQueryWrapper<ClassGradeInterface>()
|
|
List<ClassGradeInterface> list = iClassGradeInterfaceService.list(new LambdaQueryWrapper<ClassGradeInterface>()
|
|
.eq(ClassGradeInterface::getStatus, 1)
|
|
.eq(ClassGradeInterface::getStatus, 1)
|
|
.in(ClassGradeInterface::getType, Arrays.asList(1, 3)));
|
|
.in(ClassGradeInterface::getType, Arrays.asList(1, 3)));
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
list.forEach(item -> {
|
|
list.forEach(item -> {
|
|
- if (item.getType() == 1){
|
|
|
|
|
|
+ if (item.getType() == 1) {
|
|
add.setInterfacePushId(item.getId());
|
|
add.setInterfacePushId(item.getId());
|
|
- }else if(item.getType() == 3){
|
|
|
|
|
|
+ } else if (item.getType() == 3) {
|
|
add.setInterfacePeriodId(item.getId());
|
|
add.setInterfacePeriodId(item.getId());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -337,38 +337,37 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
Boolean erJfalg = false;
|
|
Boolean erJfalg = false;
|
|
Boolean ezJfalg = false;
|
|
Boolean ezJfalg = false;
|
|
//七大员继教班级默认学时推送和报名推送
|
|
//七大员继教班级默认学时推送和报名推送
|
|
- if (bo.getClassGradeGoodsAddBos() != null ) {
|
|
|
|
|
|
+ if (bo.getClassGradeGoodsAddBos() != null) {
|
|
Long goodsId = bo.getClassGradeGoodsAddBos()[0];
|
|
Long goodsId = bo.getClassGradeGoodsAddBos()[0];
|
|
Goods goods = iGoodsService.getById(goodsId);
|
|
Goods goods = iGoodsService.getById(goodsId);
|
|
String businessName = iGoodsService.getGoodsBusinessName(goodsId);
|
|
String businessName = iGoodsService.getGoodsBusinessName(goodsId);
|
|
if (businessName.contains("继续教育") && businessName.contains("施工现场专业人员")) {
|
|
if (businessName.contains("继续教育") && businessName.contains("施工现场专业人员")) {
|
|
String sevenYear = goods.getSevenYear();
|
|
String sevenYear = goods.getSevenYear();
|
|
- List<ClassGradeInterface> interfaceList = iClassGradeInterfaceService
|
|
|
|
- .list(new LambdaQueryWrapper<ClassGradeInterface>()
|
|
|
|
- .in(ClassGradeInterface::getType, Arrays.asList(1, 3))
|
|
|
|
- .eq(ClassGradeInterface::getStatus, 1));
|
|
|
|
- if (CollectionUtils.isNotEmpty(interfaceList)){
|
|
|
|
- interfaceList.forEach(item -> {
|
|
|
|
- if (item.getType() == 1){
|
|
|
|
- //官方信息推送
|
|
|
|
- add.setInterfacePushId(item.getId());
|
|
|
|
- }else if (item.getType() == 3){
|
|
|
|
- //学时推送
|
|
|
|
- add.setInterfacePeriodId(item.getId());
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotBlank(bo.getOfficialName()) && ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 1){
|
|
|
|
|
|
+ List<ClassGradeInterface> interfaceList = iClassGradeInterfaceService
|
|
|
|
+ .list(new LambdaQueryWrapper<ClassGradeInterface>()
|
|
|
|
+ .in(ClassGradeInterface::getType, Arrays.asList(1, 3))
|
|
|
|
+ .eq(ClassGradeInterface::getStatus, 1));
|
|
|
|
+ if (CollectionUtils.isNotEmpty(interfaceList)) {
|
|
|
|
+ interfaceList.forEach(item -> {
|
|
|
|
+ if (item.getType() == 1) {
|
|
|
|
+ //官方信息推送
|
|
|
|
+ add.setInterfacePushId(item.getId());
|
|
|
|
+ } else if (item.getType() == 3) {
|
|
|
|
+ //学时推送
|
|
|
|
+ add.setInterfacePeriodId(item.getId());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getOfficialName()) && ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 1) {
|
|
add.setSevenCode(ServletUtils.getEncoded("SEV"));
|
|
add.setSevenCode(ServletUtils.getEncoded("SEV"));
|
|
- }else {
|
|
|
|
- String sevenCode = getSevenCode(goodsId,add.getStudentUpper());
|
|
|
|
|
|
+ } else {
|
|
|
|
+ String sevenCode = getSevenCode(goodsId, add.getStudentUpper());
|
|
add.setSevenCode(sevenCode);
|
|
add.setSevenCode(sevenCode);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else if (("继续教育二级建造师".equals(businessName)|| ("继续教育二级造价师".equals(businessName))) && sysTenant.getShareClass() == 1){
|
|
|
|
|
|
+ } else if (("继续教育二级建造师".equals(businessName) || ("继续教育二级造价师".equals(businessName))) && sysTenant.getShareClass() == 1) {
|
|
erJfalg = true;
|
|
erJfalg = true;
|
|
ezJfalg = "继续教育二级造价师".equals(businessName);
|
|
ezJfalg = "继续教育二级造价师".equals(businessName);
|
|
- if (ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 0){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 0) {
|
|
//预开班
|
|
//预开班
|
|
add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
add.setOfficialName(ServletUtils.getEncoded("PIY"));
|
|
}
|
|
}
|
|
@@ -500,29 +499,29 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
classGradeSysService.save(classGradeSys);
|
|
classGradeSysService.save(classGradeSys);
|
|
}
|
|
}
|
|
|
|
|
|
- if (erJfalg && bo.getClassGradeGoodsAddBos() != null){
|
|
|
|
|
|
+ if (erJfalg && bo.getClassGradeGoodsAddBos() != null) {
|
|
//二建继教班级创建,所有共享班级机构同步创建
|
|
//二建继教班级创建,所有共享班级机构同步创建
|
|
- synchronousCreation(add,sysTenant,bo.getClassGradeGoodsAddBos()[0]);
|
|
|
|
|
|
+ synchronousCreation(add, sysTenant, bo.getClassGradeGoodsAddBos()[0]);
|
|
//通知旧系统
|
|
//通知旧系统
|
|
CreateSameClassBo classBo = new CreateSameClassBo();
|
|
CreateSameClassBo classBo = new CreateSameClassBo();
|
|
- if (ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 1){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(bo.getClassStatus()) && bo.getClassStatus() == 1) {
|
|
classBo.setClassNo(add.getOfficialName());
|
|
classBo.setClassNo(add.getOfficialName());
|
|
classBo.setOpenclassState(1);
|
|
classBo.setOpenclassState(1);
|
|
- classBo.setBeginTime(DateUtils.timestampToDateFormat(add.getClassStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
|
- classBo.setEndTime(DateUtils.timestampToDateFormat(add.getClassEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
|
- }else {
|
|
|
|
|
|
+ classBo.setBeginTime(DateUtils.timestampToDateFormat(add.getClassStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
+ classBo.setEndTime(DateUtils.timestampToDateFormat(add.getClassEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
+ } else {
|
|
classBo.setClassNo(add.getOfficialName());
|
|
classBo.setClassNo(add.getOfficialName());
|
|
classBo.setOpenclassState(0);
|
|
classBo.setOpenclassState(0);
|
|
}
|
|
}
|
|
classBo.setCategoryName(add.getClassName());
|
|
classBo.setCategoryName(add.getClassName());
|
|
- classBo.setPlatformId(ezJfalg?8:5);
|
|
|
|
|
|
+ classBo.setPlatformId(ezJfalg ? 8 : 5);
|
|
Goods goods = iGoodsService.getById(bo.getClassGradeGoodsAddBos()[0]);
|
|
Goods goods = iGoodsService.getById(bo.getClassGradeGoodsAddBos()[0]);
|
|
Major major = iMajorService.getById(goods.getMajorId());
|
|
Major major = iMajorService.getById(goods.getMajorId());
|
|
- if (ObjectUtils.isNotNull(major)){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(major)) {
|
|
classBo.setMajorName(major.getCategoryName());
|
|
classBo.setMajorName(major.getCategoryName());
|
|
}
|
|
}
|
|
Long nowTime = DateUtils.getNowTime();
|
|
Long nowTime = DateUtils.getNowTime();
|
|
- String sign = ToolsUtils.EncoderByMd5(classBo.getClassNo()+nowTime.toString() + "pubilc2022");
|
|
|
|
|
|
+ String sign = ToolsUtils.EncoderByMd5(classBo.getClassNo() + nowTime.toString() + "pubilc2022");
|
|
classBo.setSign(sign);
|
|
classBo.setSign(sign);
|
|
classBo.setStamp(nowTime);
|
|
classBo.setStamp(nowTime);
|
|
JSONObject param = JSONObject.parseObject(JSONObject.toJSONString(classBo));
|
|
JSONObject param = JSONObject.parseObject(JSONObject.toJSONString(classBo));
|
|
@@ -540,14 +539,14 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
return save;
|
|
return save;
|
|
}
|
|
}
|
|
|
|
|
|
- public void createSameClass(){
|
|
|
|
|
|
+ public void createSameClass() {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private void synchronousCreation(ClassGrade classGrade, SysTenant sysTenant,Long goodsId) {
|
|
|
|
|
|
+ private void synchronousCreation(ClassGrade classGrade, SysTenant sysTenant, Long goodsId) {
|
|
List<SysTenant> tenantList = sysTenantService.getListNoTenant(0L);
|
|
List<SysTenant> tenantList = sysTenantService.getListNoTenant(0L);
|
|
- if (CollectionUtils.isEmpty(tenantList)){
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(tenantList)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
Goods goods = iGoodsService.getById(goodsId);
|
|
Goods goods = iGoodsService.getById(goodsId);
|
|
@@ -555,19 +554,19 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
Major major = iMajorService.getById(goods.getMajorId());
|
|
Major major = iMajorService.getById(goods.getMajorId());
|
|
tenantList.forEach(tenant -> {
|
|
tenantList.forEach(tenant -> {
|
|
//是否存在对应课程商品
|
|
//是否存在对应课程商品
|
|
- List<Goods> relGoods = iGoodsService.getRelGoodsNoTenant(businessName,major.getCategoryName(),tenant.getTenantId());
|
|
|
|
- if (CollectionUtils.isEmpty(relGoods)){
|
|
|
|
|
|
+ List<Goods> relGoods = iGoodsService.getRelGoodsNoTenant(businessName, major.getCategoryName(), tenant.getTenantId());
|
|
|
|
+ if (CollectionUtils.isEmpty(relGoods)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//班级是否存在
|
|
//班级是否存在
|
|
- ClassGrade grade = baseMapper.getCodeNoTenant(classGrade.getOfficialName(),tenant.getTenantId());
|
|
|
|
- if (ObjectUtils.isNotNull(grade)){
|
|
|
|
|
|
+ ClassGrade grade = baseMapper.getCodeNoTenant(classGrade.getOfficialName(), tenant.getTenantId());
|
|
|
|
+ if (ObjectUtils.isNotNull(grade)) {
|
|
//已经存在 过滤已经创建过班级的商品
|
|
//已经存在 过滤已经创建过班级的商品
|
|
List<ClassGradeGoods> classGradeGoods = iClassGradeGoodsService.listByIdNoTenant(grade.getGradeId());
|
|
List<ClassGradeGoods> classGradeGoods = iClassGradeGoodsService.listByIdNoTenant(grade.getGradeId());
|
|
List<Long> goodsIds = classGradeGoods.stream().map(ClassGradeGoods::getGoodsId).collect(Collectors.toList());
|
|
List<Long> goodsIds = classGradeGoods.stream().map(ClassGradeGoods::getGoodsId).collect(Collectors.toList());
|
|
relGoods = relGoods.stream().filter(x -> !goodsIds.contains(x.getGoodsId())).collect(Collectors.toList());
|
|
relGoods = relGoods.stream().filter(x -> !goodsIds.contains(x.getGoodsId())).collect(Collectors.toList());
|
|
}
|
|
}
|
|
- if (CollectionUtils.isEmpty(relGoods)){
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(relGoods)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -589,7 +588,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- private String getSevenCode(Long goodsId,Integer studentUpper) {
|
|
|
|
|
|
+ private String getSevenCode(Long goodsId, Integer studentUpper) {
|
|
Goods g = iGoodsService.getById(goodsId);
|
|
Goods g = iGoodsService.getById(goodsId);
|
|
List<Goods> list = iGoodsService.list(new LambdaQueryWrapper<Goods>()
|
|
List<Goods> list = iGoodsService.list(new LambdaQueryWrapper<Goods>()
|
|
.eq(Goods::getEducationTypeId, g.getEducationTypeId())
|
|
.eq(Goods::getEducationTypeId, g.getEducationTypeId())
|
|
@@ -600,13 +599,13 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
.eq(Goods::getStatus, 1)
|
|
.eq(Goods::getStatus, 1)
|
|
.eq(Goods::getGoodsStatus, 1)
|
|
.eq(Goods::getGoodsStatus, 1)
|
|
.ne(Goods::getGoodsId, goodsId));
|
|
.ne(Goods::getGoodsId, goodsId));
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
List<ClassGradeGoods> classGradeList = iClassGradeGoodsService
|
|
List<ClassGradeGoods> classGradeList = iClassGradeGoodsService
|
|
.list(new LambdaQueryWrapper<ClassGradeGoods>()
|
|
.list(new LambdaQueryWrapper<ClassGradeGoods>()
|
|
.in(ClassGradeGoods::getGoodsId, list.stream().map(Goods::getGoodsId).collect(Collectors.toList())));
|
|
.in(ClassGradeGoods::getGoodsId, list.stream().map(Goods::getGoodsId).collect(Collectors.toList())));
|
|
- if (CollectionUtils.isNotEmpty(classGradeList)){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(classGradeList)) {
|
|
ClassGrade classGrade = baseMapper.getSevenGrade(classGradeList.stream().map(ClassGradeGoods::getGradeId).collect(Collectors.toList()));
|
|
ClassGrade classGrade = baseMapper.getSevenGrade(classGradeList.stream().map(ClassGradeGoods::getGradeId).collect(Collectors.toList()));
|
|
- if (ObjectUtils.isNotNull(classGrade)){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(classGrade)) {
|
|
//判断班级人数
|
|
//判断班级人数
|
|
Integer locakStudentNum = baseMapper.getStudeCountByCodeNoTenant(classGrade.getSevenCode());
|
|
Integer locakStudentNum = baseMapper.getStudeCountByCodeNoTenant(classGrade.getSevenCode());
|
|
if ((studentUpper - locakStudentNum) > 0) {
|
|
if ((studentUpper - locakStudentNum) > 0) {
|
|
@@ -626,7 +625,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
validEntityBeforeSave(update);
|
|
validEntityBeforeSave(update);
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
List<ClassGradeGoods> goodsList = iClassGradeGoodsService.list(new LambdaQueryWrapper<ClassGradeGoods>().eq(ClassGradeGoods::getGradeId, update.getGradeId()));
|
|
List<ClassGradeGoods> goodsList = iClassGradeGoodsService.list(new LambdaQueryWrapper<ClassGradeGoods>().eq(ClassGradeGoods::getGradeId, update.getGradeId()));
|
|
- for(ClassGradeGoods gradeGoods:goodsList){
|
|
|
|
|
|
+ for (ClassGradeGoods gradeGoods : goodsList) {
|
|
if (ObjectUtils.isNull(gradeGoods)) {
|
|
if (ObjectUtils.isNull(gradeGoods)) {
|
|
throw new RuntimeException("班级商品信息查询失败");
|
|
throw new RuntimeException("班级商品信息查询失败");
|
|
}
|
|
}
|
|
@@ -641,7 +640,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
businessQueryBo.setId(goods.getBusinessId());
|
|
businessQueryBo.setId(goods.getBusinessId());
|
|
String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
|
|
String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
|
|
|
|
|
|
- if ((("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName)))&& sysTenant.getShareClass() == 1) {
|
|
|
|
|
|
+ if ((("继续教育二级建造师".equals(fullName)) || ("继续教育二级造价师".equals(fullName))) && sysTenant.getShareClass() == 1) {
|
|
if (update.getClassStatus() != null && update.getClassStatus().equals(1)) {
|
|
if (update.getClassStatus() != null && update.getClassStatus().equals(1)) {
|
|
//二造和二建班级开班校验班级人数(300人)
|
|
//二造和二建班级开班校验班级人数(300人)
|
|
if (!checkClassUserNum(goods.getBusinessId(), update.getGradeId())) {
|
|
if (!checkClassUserNum(goods.getBusinessId(), update.getGradeId())) {
|
|
@@ -660,7 +659,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(Validator.isNotEmpty(bo.getStatus())){
|
|
|
|
|
|
+ if (Validator.isNotEmpty(bo.getStatus())) {
|
|
if (bo.getStatus() != -1) {
|
|
if (bo.getStatus() != -1) {
|
|
/* LambdaQueryWrapper<ClassGrade> lqw = Wrappers.lambdaQuery();
|
|
/* LambdaQueryWrapper<ClassGrade> lqw = Wrappers.lambdaQuery();
|
|
lqw.eq(ClassGrade::getClassName, update.getClassName());
|
|
lqw.eq(ClassGrade::getClassName, update.getClassName());
|
|
@@ -740,10 +739,10 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
sendClassSMS(classGradeVo);
|
|
sendClassSMS(classGradeVo);
|
|
}
|
|
}
|
|
this.updateById(update);
|
|
this.updateById(update);
|
|
- if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员") && StringUtils.isNotBlank(classGradeVo.getSevenCode())){
|
|
|
|
- List<ClassGrade> list = baseMapper.getListNoTenant(classGradeVo.getSevenCode(),update.getGradeId());
|
|
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
- list.forEach(item ->{
|
|
|
|
|
|
+ if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员") && StringUtils.isNotBlank(classGradeVo.getSevenCode())) {
|
|
|
|
+ List<ClassGrade> list = baseMapper.getListNoTenant(classGradeVo.getSevenCode(), update.getGradeId());
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
|
+ list.forEach(item -> {
|
|
update.setGradeId(item.getGradeId());
|
|
update.setGradeId(item.getGradeId());
|
|
updateByIdNoTenant(update);
|
|
updateByIdNoTenant(update);
|
|
});
|
|
});
|
|
@@ -874,10 +873,10 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
*/
|
|
*/
|
|
private void validEntityBeforeSave(ClassGrade entity) {
|
|
private void validEntityBeforeSave(ClassGrade entity) {
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
- if(Validator.isNotEmpty(entity.getOfficialName())){
|
|
|
|
|
|
+ if (Validator.isNotEmpty(entity.getOfficialName())) {
|
|
entity.setOfficialName(entity.getOfficialName().trim());
|
|
entity.setOfficialName(entity.getOfficialName().trim());
|
|
}
|
|
}
|
|
- if(Validator.isNotEmpty(entity.getPastDueDay())&&entity.getPastDueDay()<10){
|
|
|
|
|
|
+ if (Validator.isNotEmpty(entity.getPastDueDay()) && entity.getPastDueDay() < 10) {
|
|
throw new CustomException("班级提前截止天数错误");
|
|
throw new CustomException("班级提前截止天数错误");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -934,9 +933,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
|
|
if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
|
|
classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
|
|
classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
|
|
}
|
|
}
|
|
- if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())) {
|
|
SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
|
|
SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
|
|
- if (ObjectUtils.isNotNull(tenant)){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(tenant)) {
|
|
classGradeStudentVo.setTenantName(tenant.getTenantName());
|
|
classGradeStudentVo.setTenantName(tenant.getTenantName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -944,6 +943,23 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
return classGradeStudentVos;
|
|
return classGradeStudentVos;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public HashMap<String, Object> getPlush(ClassGradeUserQueryBo bo) {
|
|
|
|
+ HashMap<String, Object> stringObjectHashMap = new HashMap<>();
|
|
|
|
+ if (ObjectUtils.isNotEmpty(bo.getPeriodPlush()) && bo.getPeriodPlush() != 1) {
|
|
|
|
+ Integer notPlush = this.baseMapper.getPlush(bo);
|
|
|
|
+ stringObjectHashMap.put("notPlush", notPlush);
|
|
|
|
+ stringObjectHashMap.put("plush", 0);
|
|
|
|
+ } else {
|
|
|
|
+ Integer allPlush = this.baseMapper.getPlush(bo);
|
|
|
|
+ bo.setPeriodPlush(1);
|
|
|
|
+ Integer plush = this.baseMapper.getPlush(bo);
|
|
|
|
+ stringObjectHashMap.put("plush", plush);
|
|
|
|
+ stringObjectHashMap.put("notPlush", allPlush - plush);
|
|
|
|
+ }
|
|
|
|
+ return stringObjectHashMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<ClassGradeStudentVo> listGradeAll(ClassGradeUserQueryBo bo) {
|
|
public List<ClassGradeStudentVo> listGradeAll(ClassGradeUserQueryBo bo) {
|
|
//身份证去重
|
|
//身份证去重
|
|
@@ -1042,12 +1058,12 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- List<Long> timeList = classGradeUserMapper.selectStart(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId());
|
|
|
|
|
|
+ List<Long> timeList = classGradeUserMapper.selectStart(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(), classGradeStudentVo.getOrderGoodsId());
|
|
if (!org.springframework.util.CollectionUtils.isEmpty(timeList)) {
|
|
if (!org.springframework.util.CollectionUtils.isEmpty(timeList)) {
|
|
//查找开始学习时间
|
|
//查找开始学习时间
|
|
classGradeStudentVo.setStartTime(timeList.get(0));
|
|
classGradeStudentVo.setStartTime(timeList.get(0));
|
|
- }else{
|
|
|
|
- classGradeStudentVo.setStartTime(classGradeUserMapper.selectStartNoPhoto(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId())
|
|
|
|
|
|
+ } else {
|
|
|
|
+ classGradeStudentVo.setStartTime(classGradeUserMapper.selectStartNoPhoto(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(), classGradeStudentVo.getOrderGoodsId())
|
|
);
|
|
);
|
|
}
|
|
}
|
|
//BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
|
|
//BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
|
|
@@ -1060,49 +1076,49 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
/*if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
|
|
/*if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
|
|
classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
|
|
classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
|
|
}*/
|
|
}*/
|
|
- if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())) {
|
|
SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
|
|
SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
|
|
- if (ObjectUtils.isNotNull(tenant)){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(tenant)) {
|
|
classGradeStudentVo.setTenantName(tenant.getTenantName());
|
|
classGradeStudentVo.setTenantName(tenant.getTenantName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ClassGradeStudentAllExportVo exportVo = BeanUtil.toBean(classGradeStudentVo,ClassGradeStudentAllExportVo.class);
|
|
|
|
- exportVo.setHourStr((classGradeStudentVo.getRecordNum()+classGradeStudentVo.getStuAllNum())+"/"+(classGradeStudentVo.getExamNum()+classGradeStudentVo.getSecAllNum()));
|
|
|
|
- exportVo.setServiceTimeStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getServiceStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS)+"至"+DateUtils.timestampToDateFormat(classGradeStudentVo.getServiceEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
- exportVo.setVideoStr(classGradeStudentVo.getStuAllNum()+"/"+classGradeStudentVo.getSecAllNum());
|
|
|
|
- exportVo.setExamStr(classGradeStudentVo.getRecordNum()+"/"+classGradeStudentVo.getExamNum());
|
|
|
|
- exportVo.setStudyStartStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
- exportVo.setStudyEndStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
- if(classGradeStudentVo.getPeriodStatus()==-1||classGradeStudentVo.getPeriodStatus()==0){
|
|
|
|
|
|
+ ClassGradeStudentAllExportVo exportVo = BeanUtil.toBean(classGradeStudentVo, ClassGradeStudentAllExportVo.class);
|
|
|
|
+ exportVo.setHourStr((classGradeStudentVo.getRecordNum() + classGradeStudentVo.getStuAllNum()) + "/" + (classGradeStudentVo.getExamNum() + classGradeStudentVo.getSecAllNum()));
|
|
|
|
+ exportVo.setServiceTimeStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getServiceStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS) + "至" + DateUtils.timestampToDateFormat(classGradeStudentVo.getServiceEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
+ exportVo.setVideoStr(classGradeStudentVo.getStuAllNum() + "/" + classGradeStudentVo.getSecAllNum());
|
|
|
|
+ exportVo.setExamStr(classGradeStudentVo.getRecordNum() + "/" + classGradeStudentVo.getExamNum());
|
|
|
|
+ exportVo.setStudyStartStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getStartTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
+ exportVo.setStudyEndStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getEndTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
|
|
|
|
+ if (classGradeStudentVo.getPeriodStatus() == -1 || classGradeStudentVo.getPeriodStatus() == 0) {
|
|
exportVo.setStudyStatusStr("未学完");
|
|
exportVo.setStudyStatusStr("未学完");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
exportVo.setStudyStatusStr("已完成");
|
|
exportVo.setStudyStatusStr("已完成");
|
|
}
|
|
}
|
|
- if(Validator.isEmpty(classGradeStudentVo.getStudyCount())){
|
|
|
|
|
|
+ if (Validator.isEmpty(classGradeStudentVo.getStudyCount())) {
|
|
classGradeStudentVo.setStudyCount(0L);
|
|
classGradeStudentVo.setStudyCount(0L);
|
|
}
|
|
}
|
|
- if(Validator.isEmpty(classGradeStudentVo.getUseStudyCount())){
|
|
|
|
|
|
+ if (Validator.isEmpty(classGradeStudentVo.getUseStudyCount())) {
|
|
classGradeStudentVo.setUseStudyCount(0);
|
|
classGradeStudentVo.setUseStudyCount(0);
|
|
}
|
|
}
|
|
- exportVo.setTotalStudyCount(classGradeStudentVo.getUseStudyCount()+classGradeStudentVo.getStudyCount().intValue());
|
|
|
|
- if(Validator.isNotEmpty(classGradeStudentVo.getUserStatus())&&classGradeStudentVo.getUserStatus()==1){
|
|
|
|
|
|
+ exportVo.setTotalStudyCount(classGradeStudentVo.getUseStudyCount() + classGradeStudentVo.getStudyCount().intValue());
|
|
|
|
+ if (Validator.isNotEmpty(classGradeStudentVo.getUserStatus()) && classGradeStudentVo.getUserStatus() == 1) {
|
|
exportVo.setUserStatus("变更");
|
|
exportVo.setUserStatus("变更");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
exportVo.setUserStatus("未变更");
|
|
exportVo.setUserStatus("未变更");
|
|
}
|
|
}
|
|
- if(Validator.isNotEmpty(classGradeStudentVo.getOfficialStatus())&&classGradeStudentVo.getOfficialStatus()==1){
|
|
|
|
|
|
+ if (Validator.isNotEmpty(classGradeStudentVo.getOfficialStatus()) && classGradeStudentVo.getOfficialStatus() == 1) {
|
|
exportVo.setOfficialStatus("是");
|
|
exportVo.setOfficialStatus("是");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
exportVo.setOfficialStatus("否");
|
|
exportVo.setOfficialStatus("否");
|
|
}
|
|
}
|
|
- if(Validator.isNotEmpty(classGradeStudentVo.getPeriodStatus())&&classGradeStudentVo.getPeriodStatus()==1){
|
|
|
|
|
|
+ if (Validator.isNotEmpty(classGradeStudentVo.getPeriodStatus()) && classGradeStudentVo.getPeriodStatus() == 1) {
|
|
exportVo.setPeriodStatus("通过");
|
|
exportVo.setPeriodStatus("通过");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
exportVo.setPeriodStatus("未通过");
|
|
exportVo.setPeriodStatus("未通过");
|
|
}
|
|
}
|
|
- if(Validator.isNotEmpty(classGradeStudentVo.getPeriodPlush())&&classGradeStudentVo.getPeriodPlush()==1){
|
|
|
|
|
|
+ if (Validator.isNotEmpty(classGradeStudentVo.getPeriodPlush()) && classGradeStudentVo.getPeriodPlush() == 1) {
|
|
exportVo.setPeriodPlush("是");
|
|
exportVo.setPeriodPlush("是");
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
exportVo.setPeriodPlush("否");
|
|
exportVo.setPeriodPlush("否");
|
|
}
|
|
}
|
|
eList.add(exportVo);
|
|
eList.add(exportVo);
|
|
@@ -1279,7 +1295,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
throw new CustomException(studyAccountStatusQueryBo.getRealname() + "学员信息为空");
|
|
throw new CustomException(studyAccountStatusQueryBo.getRealname() + "学员信息为空");
|
|
}
|
|
}
|
|
CertInfoListItem certInfoListItem = new CertInfoListItem();
|
|
CertInfoListItem certInfoListItem = new CertInfoListItem();
|
|
- if(Validator.isEmpty(personRoot.getCertInfoList())||personRoot.getCertInfoList().size()==0){
|
|
|
|
|
|
+ if (Validator.isEmpty(personRoot.getCertInfoList()) || personRoot.getCertInfoList().size() == 0) {
|
|
throw new CustomException(studyAccountStatusQueryBo.getRealname() + "学员信息为空");
|
|
throw new CustomException(studyAccountStatusQueryBo.getRealname() + "学员信息为空");
|
|
}
|
|
}
|
|
for (CertInfoListItem certInfo : personRoot.getCertInfoList()) {
|
|
for (CertInfoListItem certInfo : personRoot.getCertInfoList()) {
|
|
@@ -1412,9 +1428,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
@Override
|
|
@Override
|
|
public Integer queryOfficialGradeCount(ClassGradeQueryBo bo) {
|
|
public Integer queryOfficialGradeCount(ClassGradeQueryBo bo) {
|
|
String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
- if (ObjectUtils.isNotNull(tenantId)){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(tenantId)) {
|
|
SysOldOrg one = iSysOldOrgService.getOne(new LambdaQueryWrapper<SysOldOrg>().eq(SysOldOrg::getTenantId, Long.valueOf(tenantId)).last("limit 1"));
|
|
SysOldOrg one = iSysOldOrgService.getOne(new LambdaQueryWrapper<SysOldOrg>().eq(SysOldOrg::getTenantId, Long.valueOf(tenantId)).last("limit 1"));
|
|
- if (ObjectUtils.isNotNull(one)){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(one)) {
|
|
bo.setClassSign(one.getShareClass());
|
|
bo.setClassSign(one.getShareClass());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1548,7 +1564,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
|
|
throw new CustomException("同步查询班级人数请求错误" + e.getMessage());
|
|
}
|
|
}
|
|
numAll = peopleNum + oldGradeNum;
|
|
numAll = peopleNum + oldGradeNum;
|
|
- } else if (Validator.isNotEmpty(gradeVo) && Validator.isNotEmpty(gradeVo.getSevenCode())){
|
|
|
|
|
|
+ } else if (Validator.isNotEmpty(gradeVo) && Validator.isNotEmpty(gradeVo.getSevenCode())) {
|
|
//七大员继教
|
|
//七大员继教
|
|
Long num = baseMapper.getStudeCountByCode(gradeVo.getSevenCode());
|
|
Long num = baseMapper.getStudeCountByCode(gradeVo.getSevenCode());
|
|
if (ObjectUtils.isNotNull(num)) {
|
|
if (ObjectUtils.isNotNull(num)) {
|
|
@@ -1645,7 +1661,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
UserStudyRecord startRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "ASC");
|
|
UserStudyRecord startRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "ASC");
|
|
if (ObjectUtils.isNotNull(startRecord)) {
|
|
if (ObjectUtils.isNotNull(startRecord)) {
|
|
item.setBeginTime(DateUtils.timestampToDateFormat(startRecord.getCreateTime(), date));
|
|
item.setBeginTime(DateUtils.timestampToDateFormat(startRecord.getCreateTime(), date));
|
|
- if (ObjectUtils.isNotNull(item.getFinishStatus()) && item.getFinishStatus() == 1){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getFinishStatus()) && item.getFinishStatus() == 1) {
|
|
//已学完
|
|
//已学完
|
|
UserStudyRecord endRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "DESC");
|
|
UserStudyRecord endRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "DESC");
|
|
item.setApplyTime(DateUtils.timestampToDateFormat(endRecord.getCreateTime(), date));
|
|
item.setApplyTime(DateUtils.timestampToDateFormat(endRecord.getCreateTime(), date));
|
|
@@ -1742,7 +1758,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
openUpBo.setClassName(bo.getClassName());
|
|
openUpBo.setClassName(bo.getClassName());
|
|
openUpBo.setClassStartTime(bo.getClassStartTime());
|
|
openUpBo.setClassStartTime(bo.getClassStartTime());
|
|
openUpBo.setClassEndTime(bo.getClassEndTime());
|
|
openUpBo.setClassEndTime(bo.getClassEndTime());
|
|
- openUpBo.setLearningStatus(ObjectUtils.isNotNull(bo.getLearningStatus())?bo.getLearningStatus():1);
|
|
|
|
|
|
+ openUpBo.setLearningStatus(ObjectUtils.isNotNull(bo.getLearningStatus()) ? bo.getLearningStatus() : 1);
|
|
openUpBo.setLearningTimeStart(bo.getLearningTimeStart());
|
|
openUpBo.setLearningTimeStart(bo.getLearningTimeStart());
|
|
baseMapper.UpGradeStatusByTenant(openUpBo);
|
|
baseMapper.UpGradeStatusByTenant(openUpBo);
|
|
|
|
|
|
@@ -1839,16 +1855,16 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
@Override
|
|
@Override
|
|
public List<ClassGradeVo> searchGradeList(ClassGradeQueryBo bo) {
|
|
public List<ClassGradeVo> searchGradeList(ClassGradeQueryBo bo) {
|
|
List<ClassGradeVo> classGradeVos = entity2Vo(baseMapper.searchGradeList(bo));
|
|
List<ClassGradeVo> classGradeVos = entity2Vo(baseMapper.searchGradeList(bo));
|
|
- if (Validator.isEmpty(classGradeVos)||CollectionUtils.isEmpty(classGradeVos)) {
|
|
|
|
|
|
+ if (Validator.isEmpty(classGradeVos) || CollectionUtils.isEmpty(classGradeVos)) {
|
|
return new ArrayList<>();
|
|
return new ArrayList<>();
|
|
}
|
|
}
|
|
classGradeVos.forEach(item -> {
|
|
classGradeVos.forEach(item -> {
|
|
//班级人数
|
|
//班级人数
|
|
- if (ObjectUtils.isNotNull(item.getSevenCode())){
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(item.getSevenCode())) {
|
|
List<ClassGrade> list = list(new LambdaQueryWrapper<ClassGrade>()
|
|
List<ClassGrade> list = list(new LambdaQueryWrapper<ClassGrade>()
|
|
.eq(ClassGrade::getSevenCode, item.getSevenCode())
|
|
.eq(ClassGrade::getSevenCode, item.getSevenCode())
|
|
.eq(ClassGrade::getStatus, 1));
|
|
.eq(ClassGrade::getStatus, 1));
|
|
- if (CollectionUtils.isNotEmpty(list)){
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
Integer count = iClassGradeUserService.count(new LambdaQueryWrapper<ClassGradeUser>()
|
|
Integer count = iClassGradeUserService.count(new LambdaQueryWrapper<ClassGradeUser>()
|
|
.in(ClassGradeUser::getGradeId, list.stream().map(ClassGrade::getGradeId).collect(Collectors.toList()))
|
|
.in(ClassGradeUser::getGradeId, list.stream().map(ClassGrade::getGradeId).collect(Collectors.toList()))
|
|
.eq(ClassGradeUser::getStatus, 1));
|
|
.eq(ClassGradeUser::getStatus, 1));
|
|
@@ -1868,38 +1884,38 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public ClassGrade getCodeNoTenant(String registerCode, Long tenantId) {
|
|
public ClassGrade getCodeNoTenant(String registerCode, Long tenantId) {
|
|
- return baseMapper.getCodeNoTenant(registerCode,tenantId);
|
|
|
|
|
|
+ return baseMapper.getCodeNoTenant(registerCode, tenantId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void openOfficialSaveGrade(ClassGradeOpenBo bo) {
|
|
public void openOfficialSaveGrade(ClassGradeOpenBo bo) {
|
|
List<SysTenant> tenantList = sysTenantService.getListNoTenant(0L);
|
|
List<SysTenant> tenantList = sysTenantService.getListNoTenant(0L);
|
|
- if (CollectionUtils.isEmpty(tenantList)){
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(tenantList)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
tenantList.forEach(tenant -> {
|
|
tenantList.forEach(tenant -> {
|
|
//是否存在对应课程商品
|
|
//是否存在对应课程商品
|
|
- List<Goods> relGoods = iGoodsService.getRelGoodsNoTenant(bo.getBusinessName(),bo.getMajorName(),tenant.getTenantId());
|
|
|
|
- if (CollectionUtils.isEmpty(relGoods)){
|
|
|
|
|
|
+ List<Goods> relGoods = iGoodsService.getRelGoodsNoTenant(bo.getBusinessName(), bo.getMajorName(), tenant.getTenantId());
|
|
|
|
+ if (CollectionUtils.isEmpty(relGoods)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
//班级是否存在
|
|
//班级是否存在
|
|
- if (StringUtils.isNotBlank(bo.getRegisterCode())){
|
|
|
|
- ClassGrade grade = baseMapper.getCodeNoTenant(bo.getRegisterCode(),tenant.getTenantId());
|
|
|
|
- if (ObjectUtils.isNotNull(grade)){
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(bo.getRegisterCode())) {
|
|
|
|
+ ClassGrade grade = baseMapper.getCodeNoTenant(bo.getRegisterCode(), tenant.getTenantId());
|
|
|
|
+ if (ObjectUtils.isNotNull(grade)) {
|
|
//已经存在 过滤已经创建过班级的商品
|
|
//已经存在 过滤已经创建过班级的商品
|
|
List<ClassGradeGoods> classGradeGoods = iClassGradeGoodsService.listByIdNoTenant(grade.getGradeId());
|
|
List<ClassGradeGoods> classGradeGoods = iClassGradeGoodsService.listByIdNoTenant(grade.getGradeId());
|
|
List<Long> goodsIds = classGradeGoods.stream().map(ClassGradeGoods::getGoodsId).collect(Collectors.toList());
|
|
List<Long> goodsIds = classGradeGoods.stream().map(ClassGradeGoods::getGoodsId).collect(Collectors.toList());
|
|
relGoods = relGoods.stream().filter(x -> !goodsIds.contains(x.getGoodsId())).collect(Collectors.toList());
|
|
relGoods = relGoods.stream().filter(x -> !goodsIds.contains(x.getGoodsId())).collect(Collectors.toList());
|
|
}
|
|
}
|
|
- if (CollectionUtils.isEmpty(relGoods)){
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(relGoods)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
relGoods.forEach(item -> {
|
|
relGoods.forEach(item -> {
|
|
ClassGrade classGrade = new ClassGrade();
|
|
ClassGrade classGrade = new ClassGrade();
|
|
classGrade.setCreateTime(DateUtils.getNowTime());
|
|
classGrade.setCreateTime(DateUtils.getNowTime());
|
|
- if (bo.getClassStatus() == 1){
|
|
|
|
|
|
+ if (bo.getClassStatus() == 1) {
|
|
//开班
|
|
//开班
|
|
classGrade.setClassStatus(1);
|
|
classGrade.setClassStatus(1);
|
|
classGrade.setOfficialName(bo.getOfficialName());
|
|
classGrade.setOfficialName(bo.getOfficialName());
|
|
@@ -1913,7 +1929,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
|
|
if (CollectionUtils.isNotEmpty(interfaceList)) {
|
|
if (CollectionUtils.isNotEmpty(interfaceList)) {
|
|
classGrade.setInterfacePushId(interfaceList.get(0).getId());
|
|
classGrade.setInterfacePushId(interfaceList.get(0).getId());
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
classGrade.setClassStatus(0);
|
|
classGrade.setClassStatus(0);
|
|
classGrade.setLearningStatus(2);//待定
|
|
classGrade.setLearningStatus(2);//待定
|
|
classGrade.setOfficialName(bo.getRegisterCode());
|
|
classGrade.setOfficialName(bo.getRegisterCode());
|