| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwProjectMapper; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.YwProject; |
| | | import com.doumee.service.business.YwProjectService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private YwProjectMapper ywProjectMapper; |
| | | |
| | | @Override |
| | | public Integer create(YwProject ywProject) { |
| | | ywProjectMapper.insert(ywProject); |
| | | return ywProject.getId(); |
| | | public Integer create(YwProject model) { |
| | | model.setCreator(model.getLoginUserInfo().getId()); |
| | | model.setIsdeleted(Constants.ZERO); |
| | | model.setCreateDate(new Date()); |
| | | model.setStatus(Constants.ZERO); |
| | | model.setEditDate(model.getCreateDate()); |
| | | model.setEditor(model.getCreator()); |
| | | ywProjectMapper.insert(model); |
| | | return model.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | ywProjectMapper.deleteById(id); |
| | | public void deleteById(Integer id, LoginUserInfo user) { |
| | | YwProject model = new YwProject(); |
| | | model.setId(id); |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(user.getId()); |
| | | model.setIsdeleted(Constants.ONE); |
| | | ywProjectMapper.updateById(model); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | public void deleteByIdInBatch(List<Integer> ids, LoginUserInfo user) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | ywProjectMapper.deleteBatchIds(ids); |
| | | for(Integer id : ids){ |
| | | this.deleteById(id,user); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(YwProject ywProject) { |
| | | ywProjectMapper.updateById(ywProject); |
| | | public void updateById(YwProject model) { |
| | | model.setEditDate(new Date()); |
| | | model.setEditor(model.getLoginUserInfo().getId()); |
| | | ywProjectMapper.updateById(model); |
| | | } |
| | | |
| | | @Override |