|
|
@@ -42,6 +42,8 @@ import com.zhongzheng.modules.goods.service.*;
|
|
|
import com.zhongzheng.modules.goods.vo.*;
|
|
|
import com.zhongzheng.modules.grade.vo.ClassGradeVo;
|
|
|
import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
|
|
|
+import com.zhongzheng.modules.inform.domain.InformRemind;
|
|
|
+import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.pay.domain.PayServe;
|
|
|
@@ -239,6 +241,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
@Autowired
|
|
|
private IPayServeService iPayServeService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IInformRemindService iInformRemindService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ISysGoodsCopyRecordService iGoodsCopyRecordService;
|
|
|
|
|
|
@@ -1484,6 +1489,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
//商品课程
|
|
|
List<CourseMenuExam> newCourseMenuExamList = new ArrayList<>();
|
|
|
disposeGoodsCourse(oldGoodsId,newGoodsId,newTenantId,newCourseMenuExamList,recordList);
|
|
|
+ //课程双师
|
|
|
+ disposeGoodsCourseTeacher(oldGoodsId,newGoodsId,newTenantId);
|
|
|
//商品试卷
|
|
|
disposeGoodsAttached(oldGoodsId,newGoodsId,newTenantId,recordList);
|
|
|
|
|
|
@@ -1561,6 +1568,31 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ private void disposeGoodsCourseTeacher(Long oldGoodsId, Long newGoodsId, Long newTenantId) {
|
|
|
+ //双师关联
|
|
|
+ goodsCourseTeacherService.deleteByIdTeanant(newGoodsId,newTenantId);
|
|
|
+ List<GoodsCourseTeacher> list = goodsCourseTeacherService
|
|
|
+ .list(new LambdaQueryWrapper<GoodsCourseTeacher>()
|
|
|
+ .eq(GoodsCourseTeacher::getGoodsId, oldGoodsId));
|
|
|
+ if (CollectionUtils.isNotEmpty(list)){
|
|
|
+ for (GoodsCourseTeacher teacher : list) {
|
|
|
+ teacher.setId(null);
|
|
|
+ teacher.setTenantId(newTenantId);
|
|
|
+ teacher.setGoodsId(newGoodsId);
|
|
|
+ if (StringUtils.isNotBlank(teacher.getCourseIds())){
|
|
|
+ String ids = Arrays.asList(teacher.getCourseIds().split(",")).stream().map(x -> {
|
|
|
+ Long oid = Long.valueOf(x);
|
|
|
+ Long newId = getNewId(oid, GoodsCopyEnum.COURSE.getType());
|
|
|
+ return ObjectUtils.isNotNull(newId)?newId.toString() : "";
|
|
|
+ }).collect(Collectors.joining(","));
|
|
|
+ teacher.setCourseIds(ids);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ goodsCourseTeacherService.saveBatch(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private void addSysGoodsRecord(Long oldId,Long newId,Integer type,Long newTenantId,List<SysGoodsCopyRecord> array){
|
|
|
SysGoodsCopyRecord record = new SysGoodsCopyRecord();
|
|
|
record.setOldId(oldId);
|
|
|
@@ -3219,6 +3251,17 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ //通知规则
|
|
|
+ List<InformRemind> informRemindList = iInformRemindService.list();
|
|
|
+ if (CollectionUtils.isNotEmpty(informRemindList)){
|
|
|
+ List<InformRemind> newInformRemind = informRemindList.stream().map(x -> {
|
|
|
+ InformRemind informRemind = BeanUtil.toBean(x, InformRemind.class);
|
|
|
+ informRemind.setId(null);
|
|
|
+ informRemind.setTenantId(newTenantId);
|
|
|
+ return informRemind;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ iInformRemindService.saveBatch(newInformRemind);
|
|
|
+ }
|
|
|
//保存记录
|
|
|
iSysGoodsCopyRecordService.saveBatch(copyRecordList);
|
|
|
return true;
|