|
@@ -11,14 +11,8 @@ import com.yohobuy.platform.common.util.DateUtil; |
|
@@ -11,14 +11,8 @@ import com.yohobuy.platform.common.util.DateUtil; |
11
|
import com.yohobuy.platform.common.util.IntegerUtils;
|
11
|
import com.yohobuy.platform.common.util.IntegerUtils;
|
12
|
import com.yohobuy.platform.dal.cms.IWebShareDao;
|
12
|
import com.yohobuy.platform.dal.cms.IWebShareDao;
|
13
|
import com.yohobuy.platform.dal.cms.model.WebShare;
|
13
|
import com.yohobuy.platform.dal.cms.model.WebShare;
|
14
|
-import com.yohobuy.platform.dal.operations.ActivtyTemplatedFloorDetailMapper;
|
|
|
15
|
-import com.yohobuy.platform.dal.operations.ActivtyTemplatedFloorMapper;
|
|
|
16
|
-import com.yohobuy.platform.dal.operations.ActivtyTemplatedFloorTableMapper;
|
|
|
17
|
-import com.yohobuy.platform.dal.operations.ActivtyTemplatedMapper;
|
|
|
18
|
-import com.yohobuy.platform.dal.operations.model.ActivtyTemplated;
|
|
|
19
|
-import com.yohobuy.platform.dal.operations.model.ActivtyTemplatedFloor;
|
|
|
20
|
-import com.yohobuy.platform.dal.operations.model.ActivtyTemplatedFloorDetail;
|
|
|
21
|
-import com.yohobuy.platform.dal.operations.model.ActivtyTemplatedFloorTable;
|
14
|
+import com.yohobuy.platform.dal.operations.*;
|
|
|
15
|
+import com.yohobuy.platform.dal.operations.model.*;
|
22
|
import com.yohobuy.platform.model.cms.bo.WebShareBO;
|
16
|
import com.yohobuy.platform.model.cms.bo.WebShareBO;
|
23
|
import com.yohobuy.platform.model.common.CheckResult;
|
17
|
import com.yohobuy.platform.model.common.CheckResult;
|
24
|
import com.yohobuy.platform.model.common.PageResponseVO;
|
18
|
import com.yohobuy.platform.model.common.PageResponseVO;
|
|
@@ -27,6 +21,7 @@ import com.yohobuy.platform.model.operations.consistant.ActivtyTemplatedStatus; |
|
@@ -27,6 +21,7 @@ import com.yohobuy.platform.model.operations.consistant.ActivtyTemplatedStatus; |
27
|
import com.yohobuy.platform.model.operations.consistant.FloorDetailStatus;
|
21
|
import com.yohobuy.platform.model.operations.consistant.FloorDetailStatus;
|
28
|
import com.yohobuy.platform.model.operations.consistant.LogActionType;
|
22
|
import com.yohobuy.platform.model.operations.consistant.LogActionType;
|
29
|
import com.yohobuy.platform.model.operations.consistant.TempCompParamType;
|
23
|
import com.yohobuy.platform.model.operations.consistant.TempCompParamType;
|
|
|
24
|
+import com.yohobuy.platform.model.operations.request.ActivityTemplateLinkBo;
|
30
|
import com.yohobuy.platform.model.operations.request.ActivityTemplatedPageBo;
|
25
|
import com.yohobuy.platform.model.operations.request.ActivityTemplatedPageBo;
|
31
|
import com.yohobuy.platform.model.users.response.UserInfoResponseBO;
|
26
|
import com.yohobuy.platform.model.users.response.UserInfoResponseBO;
|
32
|
import com.yohobuy.platform.operations.constants.CommonStatus;
|
27
|
import com.yohobuy.platform.operations.constants.CommonStatus;
|
|
@@ -84,6 +79,9 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -84,6 +79,9 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
84
|
@Autowired
|
79
|
@Autowired
|
85
|
private ActivtyTemplatedFloorDetailMapper atfdMapper;
|
80
|
private ActivtyTemplatedFloorDetailMapper atfdMapper;
|
86
|
|
81
|
|
|
|
82
|
+ @Autowired
|
|
|
83
|
+ private ActivtyTemplateLinkMapper activityTemplateLinkMapper;
|
|
|
84
|
+
|
87
|
private static Convert convert = new BeanConvert();
|
85
|
private static Convert convert = new BeanConvert();
|
88
|
|
86
|
|
89
|
@Value("${activity.url:http://activity.yoho.cn/feature/}")
|
87
|
@Value("${activity.url:http://activity.yoho.cn/feature/}")
|
|
@@ -337,12 +335,43 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -337,12 +335,43 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
337
|
return null;
|
335
|
return null;
|
338
|
}
|
336
|
}
|
339
|
logger.info("in getById, ActivtyTemplated id {}, title {}, status {}", id, templated.getTitle(), templated.getStatus());
|
337
|
logger.info("in getById, ActivtyTemplated id {}, title {}, status {}", id, templated.getTitle(), templated.getStatus());
|
340
|
- List<ActivtyTemplatedFloorBo> floorBos = atfService.getByTemplatedId(templated.getId());
|
338
|
+ List<ActivtyTemplateLink> atlList = activityTemplateLinkMapper.selectActivityTemplateLinkList(id);
|
|
|
339
|
+ if (CollectionUtils.isEmpty(atlList)){
|
|
|
340
|
+ return null;
|
|
|
341
|
+ }
|
|
|
342
|
+ ActivtyTemplateLink activtyTemplateLink = getCurrentTemplateId(atlList);
|
|
|
343
|
+ List<ActivtyTemplatedFloorBo> floorBos = atfService.getByTemplatedId(activtyTemplateLink.getTemplateId());
|
341
|
ActivtyTemplatedBo templatedBo = ActivtyTemplatedConvert.do2Bo(templated);
|
344
|
ActivtyTemplatedBo templatedBo = ActivtyTemplatedConvert.do2Bo(templated);
|
342
|
templatedBo.setFloors(floorBos);
|
345
|
templatedBo.setFloors(floorBos);
|
|
|
346
|
+ List<ActivityTemplateLinkBo> linkList = convert.convertFromList(atlList,ActivityTemplateLinkBo.class);
|
|
|
347
|
+ ActivityTemplateLinkBo atlBo = new ActivityTemplateLinkBo();
|
|
|
348
|
+ convert.convertFrom(activtyTemplateLink, atlBo, ActivityTemplateLinkBo.class);
|
|
|
349
|
+ atlBo.setShowTimeStr(DateUtil.int2DateStr(atlBo.getShowTime(),DateUtil.DATE_TIME_FORMAT));
|
|
|
350
|
+ templatedBo.setLinkList(linkList);
|
|
|
351
|
+ templatedBo.setAtLink(atlBo);
|
343
|
return templatedBo;
|
352
|
return templatedBo;
|
344
|
}
|
353
|
}
|
345
|
|
354
|
|
|
|
355
|
+ public ActivtyTemplateLink getCurrentTemplateId(List<ActivtyTemplateLink> atlList){
|
|
|
356
|
+ Integer currentTime = DateUtil.getCurrentTimeSeconds();
|
|
|
357
|
+ ActivtyTemplateLink atl = null;
|
|
|
358
|
+ for (ActivtyTemplateLink activtyTemplateLink : atlList){
|
|
|
359
|
+ if (null != activtyTemplateLink.getShowTime() && activtyTemplateLink.getShowTime() < currentTime){
|
|
|
360
|
+ atl = activtyTemplateLink;
|
|
|
361
|
+ break;
|
|
|
362
|
+ }
|
|
|
363
|
+ }
|
|
|
364
|
+ if (atl == null){
|
|
|
365
|
+ for (ActivtyTemplateLink activtyTemplateLink : atlList){
|
|
|
366
|
+ if (null != activtyTemplateLink.getIsDefault() && activtyTemplateLink.getIsDefault() == 1){
|
|
|
367
|
+ atl = activtyTemplateLink;
|
|
|
368
|
+ break;
|
|
|
369
|
+ }
|
|
|
370
|
+ }
|
|
|
371
|
+ }
|
|
|
372
|
+ return atl;
|
|
|
373
|
+ }
|
|
|
374
|
+
|
346
|
|
375
|
|
347
|
public ActivtyTemplatedBo getBaseInfoById(Integer id) {
|
376
|
public ActivtyTemplatedBo getBaseInfoById(Integer id) {
|
348
|
if (!IntegerUtils.withInBizSign(id)){
|
377
|
if (!IntegerUtils.withInBizSign(id)){
|
|
@@ -471,9 +500,9 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -471,9 +500,9 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
471
|
activtyTemplated.setUpdateUser(this.buildOperatorInfo(bo.getUserInfoResponseBO()));
|
500
|
activtyTemplated.setUpdateUser(this.buildOperatorInfo(bo.getUserInfoResponseBO()));
|
472
|
activtyTemplatedMapper.updateByPrimaryKeySelective(activtyTemplated);
|
501
|
activtyTemplatedMapper.updateByPrimaryKeySelective(activtyTemplated);
|
473
|
//2.根据模板ID依次删除除主表外其他表的相关数据,activty_templated_floor,activty_templated_floor_detail,activty_templated_floor_table
|
502
|
//2.根据模板ID依次删除除主表外其他表的相关数据,activty_templated_floor,activty_templated_floor_detail,activty_templated_floor_table
|
474
|
- atfMapper.deleteByTempId(bo.getId());
|
|
|
475
|
- atftMapper.deleteByTempId(bo.getId());
|
|
|
476
|
- atfdMapper.deleteByTempId(bo.getId());
|
503
|
+ atfMapper.deleteByTempId(bo.getTemplateId());
|
|
|
504
|
+ atftMapper.deleteByTempId(bo.getTemplateId());
|
|
|
505
|
+ atfdMapper.deleteByTempId(bo.getTemplateId());
|
477
|
|
506
|
|
478
|
//3.依次将相关数据插入以上相关表中
|
507
|
//3.依次将相关数据插入以上相关表中
|
479
|
List<ActivtyTemplatedFloor> atfList = Lists.newArrayList();
|
508
|
List<ActivtyTemplatedFloor> atfList = Lists.newArrayList();
|
|
@@ -481,14 +510,14 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -481,14 +510,14 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
481
|
for(ActivtyTemplatedFloorBo floorBo: bo.getFloors()){
|
510
|
for(ActivtyTemplatedFloorBo floorBo: bo.getFloors()){
|
482
|
//处理activty_templated_floor表数据
|
511
|
//处理activty_templated_floor表数据
|
483
|
ActivtyTemplatedFloor atf = ActivtyTemplatedFloorConvert.bo2Do(floorBo);
|
512
|
ActivtyTemplatedFloor atf = ActivtyTemplatedFloorConvert.bo2Do(floorBo);
|
484
|
- atf.setActivtyTemplatedId(bo.getId());
|
513
|
+ atf.setActivtyTemplatedId(bo.getTemplateId());
|
485
|
//activty_templated_floor表数据入库
|
514
|
//activty_templated_floor表数据入库
|
486
|
atfMapper.insertSelective(atf);
|
515
|
atfMapper.insertSelective(atf);
|
487
|
//处理activty_templated_floor_table表数据
|
516
|
//处理activty_templated_floor_table表数据
|
488
|
if (StringUtils.isNotBlank(floorBo.getTableComp())){
|
517
|
if (StringUtils.isNotBlank(floorBo.getTableComp())){
|
489
|
ActivtyTemplatedFloorTable table = new ActivtyTemplatedFloorTable();
|
518
|
ActivtyTemplatedFloorTable table = new ActivtyTemplatedFloorTable();
|
490
|
table.setStatus(1);
|
519
|
table.setStatus(1);
|
491
|
- table.setActivtyTemplatedId(bo.getId());
|
520
|
+ table.setActivtyTemplatedId(bo.getTemplateId());
|
492
|
table.setFloorId(atf.getId());
|
521
|
table.setFloorId(atf.getId());
|
493
|
table.setTableComp(floorBo.getTableComp());
|
522
|
table.setTableComp(floorBo.getTableComp());
|
494
|
atftList.add(table);
|
523
|
atftList.add(table);
|
|
@@ -497,14 +526,14 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -497,14 +526,14 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
497
|
floorBo.setId(atf.getId());
|
526
|
floorBo.setId(atf.getId());
|
498
|
List<ActivtyTemplatedFloorDetail> atfdp = Lists.newArrayList();
|
527
|
List<ActivtyTemplatedFloorDetail> atfdp = Lists.newArrayList();
|
499
|
if (CollectionUtils.isNotEmpty(floorBo.getParams())) {
|
528
|
if (CollectionUtils.isNotEmpty(floorBo.getParams())) {
|
500
|
- atfdp = ActivityTemplatedFloorDetailHelper.buildDetailsOfFloor(bo.getId(), FloorDetailStatus.open.getIntVal(), floorBo);
|
529
|
+ atfdp = ActivityTemplatedFloorDetailHelper.buildDetailsOfFloor(bo.getTemplateId(), FloorDetailStatus.open.getIntVal(), floorBo);
|
501
|
}
|
530
|
}
|
502
|
if (CollectionUtils.isNotEmpty(atfdp)){
|
531
|
if (CollectionUtils.isNotEmpty(atfdp)){
|
503
|
atfdMapper.insertBatch(atfdp);
|
532
|
atfdMapper.insertBatch(atfdp);
|
504
|
}
|
533
|
}
|
505
|
List<ActivtyTemplatedFloorDetailBo> atfdc = Lists.newArrayList();
|
534
|
List<ActivtyTemplatedFloorDetailBo> atfdc = Lists.newArrayList();
|
506
|
if (CollectionUtils.isNotEmpty(floorBo.getComponents())){
|
535
|
if (CollectionUtils.isNotEmpty(floorBo.getComponents())){
|
507
|
- atfdc = buildDetailBo(bo.getId(), floorBo.getId(), floorBo.getComponents());
|
536
|
+ atfdc = buildDetailBo(bo.getTemplateId(), floorBo.getId(), floorBo.getComponents());
|
508
|
}
|
537
|
}
|
509
|
if (CollectionUtils.isNotEmpty(atfdc)){
|
538
|
if (CollectionUtils.isNotEmpty(atfdc)){
|
510
|
atfdService.insertDetailBatch(atfdc);
|
539
|
atfdService.insertDetailBatch(atfdc);
|
|
@@ -687,14 +716,36 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -687,14 +716,36 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
687
|
row += activtyTemplatedMapper.insertSelective(templated);
|
716
|
row += activtyTemplatedMapper.insertSelective(templated);
|
688
|
// clone activity templated id(new)
|
717
|
// clone activity templated id(new)
|
689
|
int cloneATId = templated.getId();
|
718
|
int cloneATId = templated.getId();
|
690
|
- //
|
|
|
691
|
- List<ActivtyTemplatedFloor> floors = atfMapper.selectByTemplatedId(id);
|
719
|
+ //根据原活动ID查询其默认模板
|
|
|
720
|
+ List<ActivtyTemplateLink> activtyTemplateLinkList = activityTemplateLinkMapper.selectActivityTemplateLinkList(id);
|
|
|
721
|
+ if (CollectionUtils.isEmpty(activtyTemplateLinkList)){
|
|
|
722
|
+ return 0;
|
|
|
723
|
+ }
|
|
|
724
|
+ Integer templateId = 0;
|
|
|
725
|
+ for (ActivtyTemplateLink activtyTemplateLink : activtyTemplateLinkList){
|
|
|
726
|
+ if (activtyTemplateLink.getIsDefault() == 1){
|
|
|
727
|
+ templateId = activtyTemplateLink.getTemplateId();
|
|
|
728
|
+ break;
|
|
|
729
|
+ }
|
|
|
730
|
+ }
|
|
|
731
|
+ if (templateId == 0){
|
|
|
732
|
+ return 0;
|
|
|
733
|
+ }
|
|
|
734
|
+ //生成颗粒活动的默认复制模板
|
|
|
735
|
+ ActivtyTemplateLink activtyTemplateLink = new ActivtyTemplateLink();
|
|
|
736
|
+ activtyTemplateLink.setActivityId(cloneATId);
|
|
|
737
|
+ activtyTemplateLink.setIsDefault(1);
|
|
|
738
|
+ activtyTemplateLink.setTemplateName("默认模板");
|
|
|
739
|
+ activtyTemplateLink.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
740
|
+ activtyTemplateLink.setShowTime(DateUtil.getCurrentTimeSeconds());
|
|
|
741
|
+ activityTemplateLinkMapper.insertActivityTemplateLink(activtyTemplateLink);
|
|
|
742
|
+ List<ActivtyTemplatedFloor> floors = atfMapper.selectByTemplatedId(templateId);
|
692
|
if (CollectionUtils.isEmpty(floors)){
|
743
|
if (CollectionUtils.isEmpty(floors)){
|
693
|
logger.warn("{}.deepClone floors of id {} is empty", getClass().getSimpleName(),id);
|
744
|
logger.warn("{}.deepClone floors of id {} is empty", getClass().getSimpleName(),id);
|
694
|
return row;
|
745
|
return row;
|
695
|
}
|
746
|
}
|
696
|
logger.warn("{}.deepClone floors of id {} size {}", getClass().getSimpleName(), id, floors.size());
|
747
|
logger.warn("{}.deepClone floors of id {} size {}", getClass().getSimpleName(), id, floors.size());
|
697
|
- row += atfService.cloneFloors(id, cloneATId, floors);
|
748
|
+ row += atfService.cloneFloors(templateId, activtyTemplateLink.getTemplateId(), floors);
|
698
|
//add log
|
749
|
//add log
|
699
|
if (row > 0) {
|
750
|
if (row > 0) {
|
700
|
logService.recordLog(id, LogActionType.clone, null, vo.getUserInfoResponseBO());
|
751
|
logService.recordLog(id, LogActionType.clone, null, vo.getUserInfoResponseBO());
|
|
@@ -833,4 +884,89 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
|
@@ -833,4 +884,89 @@ public class ActivtyTemplatedService implements BaseService<ActivtyTemplatedBo> |
833
|
return list;
|
884
|
return list;
|
834
|
}
|
885
|
}
|
835
|
|
886
|
|
|
|
887
|
+ /**
|
|
|
888
|
+ * 添加活动与模板的关联关系
|
|
|
889
|
+ *
|
|
|
890
|
+ * @param req
|
|
|
891
|
+ */
|
|
|
892
|
+ public Integer addActivityTemplateLink(ActivityTemplateLinkBo req) {
|
|
|
893
|
+ ActivtyTemplateLink activtyTemplateLink = new ActivtyTemplateLink();
|
|
|
894
|
+ convert.convertFrom(req, activtyTemplateLink, ActivtyTemplateLink.class);
|
|
|
895
|
+ activtyTemplateLink.setShowTime(DateUtil.getTimeSeconds(req.getShowTimeStr()));
|
|
|
896
|
+ ActivtyTemplateLink activtyTemplateLinkDefault = activityTemplateLinkMapper.selectDefaultTemplateById(req.getActivityId());
|
|
|
897
|
+ if (activtyTemplateLinkDefault != null){
|
|
|
898
|
+ activtyTemplateLink.setIsDefault(2);
|
|
|
899
|
+ }else {
|
|
|
900
|
+ activtyTemplateLink.setTemplateName("默认模板");
|
|
|
901
|
+ activtyTemplateLink.setIsDefault(1);
|
|
|
902
|
+ }
|
|
|
903
|
+ activtyTemplateLink.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
|
|
904
|
+ activityTemplateLinkMapper.insertActivityTemplateLink(activtyTemplateLink);
|
|
|
905
|
+ if (req.getCopy()){
|
|
|
906
|
+ req.setTemplateId(activtyTemplateLink.getTemplateId());
|
|
|
907
|
+ copyDefaultTemplate(req);
|
|
|
908
|
+ }
|
|
|
909
|
+ return activtyTemplateLink.getTemplateId();
|
|
|
910
|
+ }
|
|
|
911
|
+
|
|
|
912
|
+ public void copyDefaultTemplate(ActivityTemplateLinkBo req){
|
|
|
913
|
+ //查询出默认模板,对默认模板进行复制
|
|
|
914
|
+ ActivtyTemplateLink activtyTemplateLinkDefault = activityTemplateLinkMapper.selectDefaultTemplateById(req.getActivityId());
|
|
|
915
|
+ if (activtyTemplateLinkDefault != null){
|
|
|
916
|
+ List<ActivtyTemplatedFloor> floors = atfMapper.selectByTemplatedId(activtyTemplateLinkDefault.getTemplateId());
|
|
|
917
|
+ atfService.cloneFloors(activtyTemplateLinkDefault.getTemplateId(),req.getTemplateId(),floors);
|
|
|
918
|
+ }
|
|
|
919
|
+ }
|
|
|
920
|
+
|
|
|
921
|
+ public ActivtyTemplatedBo getTemplateInfoByTemplateId(Integer templateId) {
|
|
|
922
|
+ if (!IntegerUtils.withInBizSign(templateId)){
|
|
|
923
|
+ logger.warn("{}.getTemplateInfoByTemplateId param id {}", getClass().getSimpleName(), templateId);
|
|
|
924
|
+ return null;
|
|
|
925
|
+ }
|
|
|
926
|
+ ActivtyTemplateLink activtyTemplateLink = activityTemplateLinkMapper.selectTemplateInfoByTemplateId(templateId);
|
|
|
927
|
+ if (null == activtyTemplateLink){
|
|
|
928
|
+ logger.warn("ActivtyTemplatedService :: getTemplateInfoByTemplateId get no data!");
|
|
|
929
|
+ return null;
|
|
|
930
|
+ }
|
|
|
931
|
+ List<ActivtyTemplateLink> atlList = activityTemplateLinkMapper.selectActivityTemplateLinkList(activtyTemplateLink.getActivityId());
|
|
|
932
|
+ if (CollectionUtils.isEmpty(atlList)){
|
|
|
933
|
+ return null;
|
|
|
934
|
+ }
|
|
|
935
|
+ ActivtyTemplated templated = activtyTemplatedMapper.selectByPrimaryKey(activtyTemplateLink.getActivityId());
|
|
|
936
|
+ if (templated==null){
|
|
|
937
|
+ logger.warn("{}.getTemplateInfoByTemplateId param id {}, ActivtyTemplated not exist in db", getClass().getSimpleName(), activtyTemplateLink.getActivityId());
|
|
|
938
|
+ return null;
|
|
|
939
|
+ }
|
|
|
940
|
+ logger.info("in getTemplateInfoByTemplateId, ActivtyTemplated id {}, title {}, status {}", activtyTemplateLink.getActivityId(), templated.getTitle(), templated.getStatus());
|
|
|
941
|
+
|
|
|
942
|
+ List<ActivtyTemplatedFloorBo> floorBos = atfService.getByTemplatedId(activtyTemplateLink.getTemplateId());
|
|
|
943
|
+ ActivtyTemplatedBo templatedBo = ActivtyTemplatedConvert.do2Bo(templated);
|
|
|
944
|
+ templatedBo.setFloors(floorBos);
|
|
|
945
|
+ List<ActivityTemplateLinkBo> linkList = convert.convertFromList(atlList,ActivityTemplateLinkBo.class);
|
|
|
946
|
+ ActivityTemplateLinkBo atlBo = new ActivityTemplateLinkBo();
|
|
|
947
|
+ convert.convertFrom(activtyTemplateLink, atlBo, ActivityTemplateLinkBo.class);
|
|
|
948
|
+ atlBo.setShowTimeStr(DateUtil.int2DateStr(atlBo.getShowTime(),DateUtil.DATE_TIME_FORMAT));
|
|
|
949
|
+ templatedBo.setLinkList(linkList);
|
|
|
950
|
+ templatedBo.setAtLink(atlBo);
|
|
|
951
|
+ return templatedBo;
|
|
|
952
|
+ }
|
|
|
953
|
+
|
|
|
954
|
+ public void upateActivityTemplateLink(ActivityTemplateLinkBo req) {
|
|
|
955
|
+ ActivtyTemplateLink activtyTemplateLink = new ActivtyTemplateLink();
|
|
|
956
|
+ convert.convertFrom(req, activtyTemplateLink, ActivtyTemplateLink.class);
|
|
|
957
|
+ activtyTemplateLink.setShowTime(DateUtil.getTimeSeconds(req.getShowTimeStr()));
|
|
|
958
|
+ activityTemplateLinkMapper.upateActivityTemplateLink(activtyTemplateLink);
|
|
|
959
|
+ if (req.getCopy()){
|
|
|
960
|
+ copyDefaultTemplate(req);
|
|
|
961
|
+ }
|
|
|
962
|
+ }
|
|
|
963
|
+
|
|
|
964
|
+ public void deleteActivityTemplate(Integer templateId) {
|
|
|
965
|
+ //删除link表
|
|
|
966
|
+ activityTemplateLinkMapper.deleteByTempId(templateId);
|
|
|
967
|
+ //删除其他相关数据
|
|
|
968
|
+ atfMapper.deleteByTempId(templateId);
|
|
|
969
|
+ atftMapper.deleteByTempId(templateId);
|
|
|
970
|
+ atfdMapper.deleteByTempId(templateId);
|
|
|
971
|
+ }
|
836
|
} |
972
|
} |