| | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.smartor.domain.PatUpInfoVO; |
| | | import com.smartor.mapper.BaseTagMapper; |
| | | import com.smartor.mapper.PatArchivetagMapper; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFDateUtil; |
| | | import org.apache.poi.ss.formula.functions.Now; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public PatUpInfoVO importFilehandle(String username, MultipartFile file) { |
| | | public PatUpInfoVO importFilehandle(SysUser user, String tags, MultipartFile file) { |
| | | PatUpInfoVO patUpInfoVO = new PatUpInfoVO(); |
| | | Integer successNum = 0; |
| | | Integer failNum = 0; |
| | |
| | | } |
| | | |
| | | //患都标签是否为空 |
| | | if (ObjectUtils.isEmpty(row.getCell(7))) { |
| | | if (ObjectUtils.isEmpty(row.getCell(7)) || StringUtils.isEmpty(row.getCell(7).toString())) { |
| | | if (StringUtils.isEmpty(tags)) { |
| | | addRemark("患者标签为空", patArchive); |
| | | } else { |
| | | patArchive.setTag(tags); |
| | | |
| | | } |
| | | } else { |
| | | if (StringUtils.isNotEmpty(tags)) { |
| | | patArchive.setTag(row.getCell(7).toString() + "," + tags); |
| | | } else { |
| | | patArchive.setTag(row.getCell(7).toString()); |
| | | } |
| | | } |
| | | |
| | | //判断备注是否为空 |
| | |
| | | patArchiveMapper.insertPatArchive(patArchive); |
| | | |
| | | //根据标签名查询出标签信息 |
| | | String s = row.getCell(7).toString(); |
| | | String s = patArchive.getTag(); |
| | | String[] split = s.split(","); |
| | | for (String tagName : split) { |
| | | BaseTag baseTag = new BaseTag(); |
| | | baseTag.setTagname(tagName); |
| | | List<BaseTag> baseTags = baseTagMapper.selectBaseTagList(baseTag); |
| | | BaseTag baseTag1 = baseTags.get(0); |
| | | |
| | | //如果该标签为空,现标签管理没有出现过的新标签时,自动将标签添加到"标签管理"未分类“中。编辑人为导入账号 |
| | | if (CollectionUtils.isEmpty(baseTags)) { |
| | | baseTag = new BaseTag(); |
| | | baseTag.setTagcategoryid(1L); |
| | | baseTag.setTagname(tagName); |
| | | baseTag.setOrgid(user.getDeptId().toString()); |
| | | baseTag.setDelFlag("0"); |
| | | baseTag.setCreateBy(user.getUserName()); |
| | | baseTag.setCreateTime(new Date()); |
| | | baseTag.setCreateBy(user.getUserName()); |
| | | baseTag.setCreateTime(new Date()); |
| | | baseTagMapper.insertBaseTag(baseTag); |
| | | } else { |
| | | baseTag = baseTags.get(0); |
| | | } |
| | | |
| | | // 新增患者档案标签 |
| | | PatArchivetag patArchivetag = DtoConversionUtils.sourceToTarget(baseTag1, PatArchivetag.class); |
| | | patArchivetag.setUpdateBy(username); |
| | | PatArchivetag patArchivetag = DtoConversionUtils.sourceToTarget(baseTag, PatArchivetag.class); |
| | | patArchivetag.setUpdateBy(user.getUserName()); |
| | | patArchivetag.setCreateTime(new Date()); |
| | | patArchivetag.setPatid(patArchive.getPatid()); |
| | | patArchivetagMapper.insertPatArchivetag(patArchivetag); |