实训草稿发布重命名
This commit is contained in:
parent
a1a6d69d8f
commit
9d0677cf51
@ -36,10 +36,13 @@ public class Training2DraftPublishService {
|
||||
DraftTraining2WithBLOBs draft = dtFinds.get(0);
|
||||
//
|
||||
PublishedTraining2WithBLOBs pub = Training2Convertor.convertFrom(draft);
|
||||
if(null!=req.getReName()&&req.getReName().trim().length()>0){
|
||||
pub.setName(req.getReName());
|
||||
}
|
||||
//根据要发布的草稿名称来查找已发布的实训
|
||||
//如果以有同名的则会被覆盖
|
||||
PublishedTraining2Example ptExample = new PublishedTraining2Example();
|
||||
ptExample.createCriteria().andNameEqualTo(draft.getName()).andMapIdEqualTo(draft.getMapId());
|
||||
ptExample.createCriteria().andNameEqualTo(pub.getName()).andMapIdEqualTo(pub.getMapId());
|
||||
List<PublishedTraining2> ptFinds = this.publishedDao.selectByExample(ptExample);
|
||||
//
|
||||
if (null != ptFinds && !ptFinds.isEmpty()) {//已发布实训存在时则直接删除
|
||||
|
@ -19,4 +19,12 @@ public class TrainingDraftPublishReqVo {
|
||||
*/
|
||||
@NotBlank(message = "实训草稿id不能为空")
|
||||
private String draftId;
|
||||
/**
|
||||
* 实训草稿发布时对实训重命名
|
||||
* <p>
|
||||
* 选填
|
||||
* <p>
|
||||
* 为空时,默认使用实训草稿名称作为发布名称
|
||||
*/
|
||||
private String reName;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user