|
|
@ -1,20 +1,26 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.dao.IcEventCategoryDao; |
|
|
|
import com.epmet.dto.IcEventCategoryDTO; |
|
|
|
import com.epmet.entity.IcEventCategoryEntity; |
|
|
|
import com.epmet.service.IcEventCategoryService; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
@ -26,7 +32,8 @@ import java.util.Map; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class IcEventCategoryServiceImpl extends BaseServiceImpl<IcEventCategoryDao, IcEventCategoryEntity> implements IcEventCategoryService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private LoginUserUtil loginUserUtil; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcEventCategoryDTO> page(Map<String, Object> params) { |
|
|
@ -88,8 +95,15 @@ public class IcEventCategoryServiceImpl extends BaseServiceImpl<IcEventCategoryD |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void delInsert(String icEventId, List<IcEventCategoryEntity> categoryEntities) { |
|
|
|
baseDao.deleteByIcEventId(icEventId); |
|
|
|
this.insertBatch(categoryEntities); |
|
|
|
LambdaUpdateWrapper<IcEventCategoryEntity> wrapper = new LambdaUpdateWrapper(); |
|
|
|
wrapper.eq(IcEventCategoryEntity::getIcEventId,icEventId) |
|
|
|
.set(IcEventCategoryEntity::getUpdatedTime,new Date()) |
|
|
|
.set(IcEventCategoryEntity::getUpdatedBy,loginUserUtil.getLoginUserId()) |
|
|
|
.set(IcEventCategoryEntity::getDelFlag, NumConstant.ONE_STR); |
|
|
|
baseDao.update(null,wrapper); |
|
|
|
if(CollectionUtils.isNotEmpty(categoryEntities)){ |
|
|
|
this.insertBatch(categoryEntities); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |