|
@@ -43,7 +43,9 @@ import com.zhongzheng.modules.goods.domain.*;
|
|
|
import com.zhongzheng.modules.goods.mapper.GoodsMapper;
|
|
|
import com.zhongzheng.modules.goods.service.*;
|
|
|
import com.zhongzheng.modules.goods.vo.*;
|
|
|
+import com.zhongzheng.modules.grade.domain.ClassGradeGoods;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeInterface;
|
|
|
+import com.zhongzheng.modules.grade.service.IClassGradeGoodsService;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeVo;
|
|
|
import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
|
|
@@ -129,7 +131,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
private IOrderInputTemplateService iOrderInputTemplateService;
|
|
|
@Autowired
|
|
|
private IClassGradeInterfaceService iClassGradeInterfaceService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private IClassGradeGoodsService iClassGradeGoodsService;
|
|
|
@Autowired
|
|
|
private ICourseMenuService iCourseMenuService;
|
|
|
@Autowired
|
|
@@ -581,9 +584,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
}
|
|
|
Long goodsId = add.getGoodsId();
|
|
|
//七大员商品,默认绑定七大员学员资料模板
|
|
|
- CourseEducationType educationType = iCourseEducationTypeService.getById(add.getEducationTypeId());
|
|
|
- CourseBusiness business = iCourseBusinessService.getById(add.getBusinessId());
|
|
|
- if (educationType.getEducationName().contains("考前培训") && business.getBusinessName().contains("七大员")){
|
|
|
+ String businessName = baseMapper.getBusinessName(goodsId);
|
|
|
+ if (businessName.contains("考前培训") && businessName.contains("施工现场专业人员")){
|
|
|
//获取七大员学员资料模版
|
|
|
List<ProfileTpBusiness> tpBusinessList = iProfileTpBusinessService.list(new LambdaQueryWrapper<ProfileTpBusiness>()
|
|
|
.eq(ProfileTpBusiness::getEducationTypeId, add.getEducationTypeId())
|
|
@@ -601,6 +603,27 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
});
|
|
|
iProfileTpService.updateBatchById(profileTpList);
|
|
|
}
|
|
|
+ }else if (businessName.contains("继续教育") && businessName.contains("施工现场专业人员")){
|
|
|
+ //七大员继教同专业下共用一个班级
|
|
|
+ Goods oneGoods = getOne(new LambdaQueryWrapper<Goods>()
|
|
|
+ .eq(Goods::getEducationTypeId, add.getEducationTypeId())
|
|
|
+ .eq(Goods::getProjectId, add.getProjectId())
|
|
|
+ .eq(Goods::getBusinessId, add.getBusinessId())
|
|
|
+ .eq(ObjectUtils.isNotNull(add.getMajorId()), Goods::getMajorId, add.getMajorId())
|
|
|
+ .eq(Goods::getSubjectIds, add.getSubjectIds())
|
|
|
+ .eq(Goods::getStatus, 1)
|
|
|
+ .eq(Goods::getGoodsStatus,1)
|
|
|
+ .ne(Goods::getGoodsId, goodsId)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (ObjectUtils.isNotNull(oneGoods)){
|
|
|
+ List<ClassGradeGoods> classGradeList = iClassGradeGoodsService
|
|
|
+ .list(new LambdaQueryWrapper<ClassGradeGoods>()
|
|
|
+ .eq(ClassGradeGoods::getGoodsId, oneGoods.getGoodsId()));
|
|
|
+ if (CollectionUtils.isNotEmpty(classGradeList)){
|
|
|
+ classGradeList.forEach(item -> item.setGoodsId(goodsId));
|
|
|
+ iClassGradeGoodsService.saveBatch(classGradeList);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
return result;
|
|
|
}
|