|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.tamguo.modules.sys.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
|
|
import com.tamguo.modules.sys.dao.SysPostMapper;
|
|
|
|
|
import com.tamguo.modules.sys.model.SysPostEntity;
|
|
|
|
|
import com.tamguo.modules.sys.model.condition.SysPostCondition;
|
|
|
|
|
import com.tamguo.modules.sys.model.enums.SysPostStatusEnum;
|
|
|
|
|
import com.tamguo.modules.sys.service.IPostService;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@ -26,12 +28,22 @@ public class PostServiceImpl extends ServiceImpl<SysPostMapper, SysPostEntity> i
|
|
|
|
|
@Transactional(readOnly=false)
|
|
|
|
|
@Override
|
|
|
|
|
public void add(SysPostEntity post) {
|
|
|
|
|
post.setCreateDate(new Date());
|
|
|
|
|
post.setUpdateDate(new Date());
|
|
|
|
|
post.setStatus(SysPostStatusEnum.NORMAL);
|
|
|
|
|
sysPostMapper.insert(post);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Transactional(readOnly=false)
|
|
|
|
|
@Override
|
|
|
|
|
public void update(SysPostEntity post) {
|
|
|
|
|
SysPostEntity entity = sysPostMapper.selectById(post.getId());
|
|
|
|
|
entity.setCode(post.getCode());
|
|
|
|
|
entity.setName(post.getName());
|
|
|
|
|
entity.setPostType(post.getPostType().getValue().toString());
|
|
|
|
|
entity.setRemarks(post.getRemarks());
|
|
|
|
|
entity.setSorts(post.getSorts());
|
|
|
|
|
post.setUpdateDate(new Date());
|
|
|
|
|
sysPostMapper.updateById(post);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|