| | |
| | | package com.ruoyi.project.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | 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.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import com.ruoyi.project.mapper.ServiceOrganallocationMapper; |
| | | import com.ruoyi.project.domain.ServiceOrganallocation; |
| | | import com.ruoyi.project.service.IServiceOrganallocationService; |
| | | import org.springframework.transaction.PlatformTransactionManager; |
| | | import org.springframework.transaction.TransactionDefinition; |
| | | import org.springframework.transaction.TransactionStatus; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.support.DefaultTransactionDefinition; |
| | | |
| | | /** |
| | | * 器官分配Service业务层处理 |
| | |
| | | * @date 2021-11-10 |
| | | */ |
| | | @Service |
| | | public class ServiceOrganallocationServiceImpl extends ServiceImpl<ServiceOrganallocationMapper, ServiceOrganallocation> implements IServiceOrganallocationService |
| | | { |
| | | public class ServiceOrganallocationServiceImpl extends ServiceImpl<ServiceOrganallocationMapper, ServiceOrganallocation> implements IServiceOrganallocationService { |
| | | |
| | | @Autowired |
| | | ServiceOrganallocationMapper serviceOrganallocationMapper; |
| | |
| | | return serviceOrganallocationMapper.selectServiceOrganallocationList(serviceOrganallocation); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<ServiceOrganallocation> saveDate(List<ServiceOrganallocation> serviceOrganallocations) { |
| | | |
| | | for (ServiceOrganallocation serviceOrganallocation : serviceOrganallocations) { |
| | | this.save(serviceOrganallocation); |
| | | } |
| | | //将带ID的数据返回 |
| | | return serviceOrganallocations; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean editArrayData(List<ServiceOrganallocation> serviceOrganallocations) { |
| | | for (ServiceOrganallocation serviceOrganallocation : serviceOrganallocations) { |
| | | if (serviceOrganallocation.getId() == null) { |
| | | throw new BaseException("id为空了 :" + serviceOrganallocation); |
| | | } |
| | | this.updateById(serviceOrganallocation); |
| | | } |
| | | //将带ID的数据返回 |
| | | return true; |
| | | } |
| | | |
| | | } |