| | |
| | | package com.ruoyi.system.service.impl.config; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.domain.dto.MgtCooperationEditDto; |
| | | import com.ruoyi.system.domain.pojo.config.Cooperation; |
| | | import com.ruoyi.system.domain.vo.MgtCooperationGetVo; |
| | | import com.ruoyi.system.mapper.config.CooperationMapper; |
| | | import com.ruoyi.system.service.config.CooperationService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Base64; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | Cooperation cooperation = new Cooperation(); |
| | | cooperation.setDelFlag(0); |
| | | cooperation.setTopPicture(mgtCooperationEditDto.getCooperationPicture()); |
| | | cooperation.setCooperDetail(mgtCooperationEditDto.getCooperationDetail()); |
| | | String cooperationDetail = mgtCooperationEditDto.getCooperationDetail(); |
| | | if(StringUtils.isNotBlank(cooperationDetail)){ |
| | | byte[] decodedBytes = Base64.getDecoder().decode(cooperationDetail); |
| | | cooperationDetail = new String(decodedBytes, StandardCharsets.UTF_8); |
| | | cooperation.setCooperDetail(cooperationDetail); |
| | | } |
| | | cooperation.setCreateTime(new Date()); |
| | | cooperation.setCreateUserId(mgtCooperationEditDto.getUserId()); |
| | | this.saveOrUpdate(cooperation); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/7/21 21:32 |
| | | * @param |
| | | * @return MgtCooperationGetVo |
| | | */ |
| | | @Override |
| | | public MgtCooperationGetVo getCooperation(){ |
| | | LambdaQueryWrapper<Cooperation> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Cooperation::getDelFlag,0); |
| | | Cooperation cooperation = this.getOne(queryWrapper,false); |
| | | MgtCooperationGetVo cooperationGetVo = new MgtCooperationGetVo(); |
| | | cooperationGetVo.setCooperationPicture(cooperation.getTopPicture()); |
| | | cooperationGetVo.setCooperationDetail(cooperation.getCooperDetail()); |
| | | return cooperationGetVo; |
| | | } |
| | | } |