| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.dto.MgtCooperationEditDto; |
| | | import com.ruoyi.system.domain.pojo.config.Cooperation; |
| | | import com.ruoyi.system.mapper.config.CooperationMapper; |
| | | import com.ruoyi.system.service.config.CooperationService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class CooperationServiceImpl extends ServiceImpl<CooperationMapper, Cooperation> implements CooperationService { |
| | | |
| | | @Resource |
| | | private CooperationMapper cooperationMapper; |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/6/6 9:24 |
| | | * @param mgtCooperationEditDto |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editCooperation(MgtCooperationEditDto mgtCooperationEditDto){ |
| | | //将旧的置为删除 |
| | | UpdateWrapper<Cooperation> updateWrapper = new UpdateWrapper<>(); |
| | | updateWrapper.lambda().eq(Cooperation::getDelFlag, 0).set(Cooperation::getDelFlag, 1); |
| | | cooperationMapper.update(null, updateWrapper); |
| | | //创建新的Cooperation |
| | | Cooperation cooperation = new Cooperation(); |
| | | cooperation.setDelFlag(0); |
| | | cooperation.setTopPicture(mgtCooperationEditDto.getCooperationPicture()); |
| | | cooperation.setCooperDetail(mgtCooperationEditDto.getCooperationDetail()); |
| | | cooperation.setCreateTime(new Date()); |
| | | cooperation.setCreateUserId(mgtCooperationEditDto.getUserId()); |
| | | this.saveOrUpdate(cooperation); |
| | | } |
| | | |
| | | |
| | | } |