| | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.project.domain.*; |
| | | import com.ruoyi.project.domain.vo.*; |
| | | import com.ruoyi.project.mapper.*; |
| | | import com.ruoyi.project.service.*; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * 捐献器官管理Service业务层处理 |
| | |
| | | * @author ruoyi |
| | | * @date 2021-11-10 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ServiceDonateorganServiceImpl extends ServiceImpl<ServiceDonateorganMapper, ServiceDonateorgan> implements IServiceDonateorganService { |
| | | |
| | |
| | | @Autowired |
| | | private SysDictDataMapper dictDataMapper; |
| | | |
| | | @Autowired |
| | | IServiceOrganallocationService serviceOrganallocationService; |
| | | |
| | | |
| | | /** |
| | |
| | | return l; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<ServiceDonateorgan> saveData(List<ServiceDonateorgan> serviceDonateorgans) { |
| | | for (ServiceDonateorgan serviceDonateorgan : serviceDonateorgans) { |
| | | String organNumber = serviceDonateorgan.getDonorno() + "." + serviceDonateorgan.getOrganno(); |
| | | if (StringUtils.isEmpty(serviceDonateorgan.getDonorno()) || StringUtils.isEmpty(serviceDonateorgan.getOrganno())) { |
| | | throw new BaseException("新增时生成的编号为空,创建失败(请检查捐献者编号和器官类别)! :" + serviceDonateorgan.toString()); |
| | | } else { |
| | | ServiceDonateorgan serviceDonateorgan1 = new ServiceDonateorgan(); |
| | | serviceDonateorgan1.setOrgannumber(organNumber); |
| | | List<ServiceDonateorgan> listrecord = this.queryList(serviceDonateorgan); |
| | | if (listrecord.size() > 0) { |
| | | continue; |
| | | } |
| | | } |
| | | serviceDonateorgan.setOrgannumber(organNumber); |
| | | log.info("serviceDonateorgan的数据为: {}", serviceDonateorgan); |
| | | boolean save = this.save(serviceDonateorgan); |
| | | |
| | | |
| | | //保存service_organallocation |
| | | ServiceOrganallocation serviceOrganallocation = new ServiceOrganallocation(); |
| | | serviceOrganallocation.setAgeunit(serviceDonateorgan.getAgeunit()); |
| | | serviceOrganallocation.setApplicanttime(serviceDonateorgan.getApplicanttime()); |
| | | serviceOrganallocation.setIdcardno(serviceDonateorgan.getIdcardno()); |
| | | serviceOrganallocation.setIdcardtype(Long.valueOf(serviceDonateorgan.getIdcardtype())); |
| | | serviceOrganallocation.setOrganid(serviceDonateorgan.getId()); |
| | | serviceOrganallocation.setOrgannumber(serviceDonateorgan.getOrgannumber()); |
| | | log.info("serviceOrganallocation的数据为: {}", serviceOrganallocation); |
| | | serviceOrganallocationService.save(serviceOrganallocation); |
| | | } |
| | | return serviceDonateorgans; |
| | | } |
| | | |
| | | |
| | | // @Override |