| | |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.project.domain.vo.DonateAnnexVO; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Map; |
| | | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.mapper.ServiceDonateannexMapper; |
| | | import com.ruoyi.project.domain.ServiceDonateannex; |
| | | import com.ruoyi.project.service.IServiceDonateannexService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * 捐献附件Service业务层处理 |
| | |
| | | * @date 2021-11-11 |
| | | */ |
| | | @Service |
| | | public class ServiceDonateannexServiceImpl extends ServiceImpl<ServiceDonateannexMapper, ServiceDonateannex> implements IServiceDonateannexService |
| | | { |
| | | public class ServiceDonateannexServiceImpl extends ServiceImpl<ServiceDonateannexMapper, ServiceDonateannex> implements IServiceDonateannexService { |
| | | |
| | | @Autowired |
| | | ServiceDonateannexMapper serviceDonateannexMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateOrSave(List<ServiceDonateannex> serviceDonateannexs) { |
| | | for (ServiceDonateannex serviceDonateannex : serviceDonateannexs) { |
| | | if (serviceDonateannex.getInfoid() == null || serviceDonateannex.getAnnexfilestype() == null) { |
| | | throw new BaseException("请检查主表id和附件类型是否为空!"); |
| | | } |
| | | if (serviceDonateannex.getId() == null) { |
| | | this.save(serviceDonateannex); |
| | | } else { |
| | | boolean b = this.updateById(serviceDonateannex); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<DonateAnnexVO> selectVOList(DonateAnnexVO donateAnnexVO) { |
| | | |
| | | SysUser user = SecurityUtils.getLoginUser().getUser(); |
| | |
| | | return serviceDonateannexMapper.selectVOList(donateAnnexVO); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean saveData(List<ServiceDonateannex> serviceDonateannexs) { |
| | | for (ServiceDonateannex serviceDonateannex : serviceDonateannexs) { |
| | | if (serviceDonateannex.getInfoid() == null || serviceDonateannex.getAnnexfilestype() == null) { |
| | | throw new BaseException("主表id或附件类型ID为空,请检查后再保存"); |
| | | } |
| | | this.save(serviceDonateannex); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |