|
|
@@ -37,6 +37,10 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
// 插入
|
|
|
NotifyConfigDO notifyConfig = BeanUtils.toBean(createReqVO, NotifyConfigDO.class);
|
|
|
notifyConfigMapper.insert(notifyConfig);
|
|
|
+ // 开始新增detail
|
|
|
+ if (!createReqVO.getNotifyConfigDetailSaveReqVOS().isEmpty()) {
|
|
|
+ notifyConfigDetailService.insertOrUpdateList(BeanUtils.toBean(createReqVO.getNotifyConfigDetailSaveReqVOS(), NotifyConfigDetailDO.class));
|
|
|
+ }
|
|
|
|
|
|
// 返回
|
|
|
return notifyConfig.getId();
|
|
|
@@ -47,6 +51,10 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
// 更新
|
|
|
NotifyConfigDO updateObj = BeanUtils.toBean(updateReqVO, NotifyConfigDO.class);
|
|
|
notifyConfigMapper.updateById(updateObj);
|
|
|
+ // 开始新增detail
|
|
|
+ if (!updateReqVO.getNotifyConfigDetailSaveReqVOS().isEmpty()) {
|
|
|
+ notifyConfigDetailService.insertOrUpdateList(BeanUtils.toBean(updateReqVO.getNotifyConfigDetailSaveReqVOS(), NotifyConfigDetailDO.class));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -64,8 +72,14 @@ public class NotifyConfigServiceImpl extends ServiceImpl<NotifyConfigMapper, Not
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public NotifyConfigDO getNotifyConfig(Long id) {
|
|
|
- return notifyConfigMapper.selectById(id);
|
|
|
+ public NotifyConfigRespVO getNotifyConfig(Long id) {
|
|
|
+ NotifyConfigDO notifyConfigDO = notifyConfigMapper.selectById(id);
|
|
|
+ NotifyConfigRespVO bean = BeanUtils.toBean(notifyConfigDO, NotifyConfigRespVO.class);
|
|
|
+ // 查询detail
|
|
|
+ List<NotifyConfigDetailDO> list = notifyConfigDetailService.list(Wrappers.<NotifyConfigDetailDO>lambdaQuery()
|
|
|
+ .eq(NotifyConfigDetailDO::getConfigId, id));
|
|
|
+ bean.setNotifyConfigDetailRespVOList(BeanUtils.toBean(list, NotifyConfigDetailRespVO.class));
|
|
|
+ return bean;
|
|
|
}
|
|
|
|
|
|
@Override
|