| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import java.lang.reflect.Field; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.*; |
| | | import com.smartor.service.IServiceExternalService; |
| | | import com.smartor.service.IServiceSubtaskRecordService; |
| | | import com.smartor.service.IServiceSubtaskService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.security.auth.login.CredentialNotFoundException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private Icd10AssociationMapper icd10AssociationMapper; |
| | | |
| | | @Autowired |
| | | private IServiceSubtaskService iServiceSubtaskService; |
| | | |
| | | @Value("${defaultPwd}") |
| | | private String defaultPwd; |
| | | |
| | | public Boolean generalInterface(Map dataMap) { |
| | | Map XiaoXiTou = (Map) dataMap.get("XiaoXiTou"); |
| | |
| | | ExternalUserInfo externalUserInfo = BeanUtil.mapToBean(yongHuXX, ExternalUserInfo.class, true); |
| | | SysUser sysUser = new SysUser(); |
| | | sysUser.setGuid(externalUserInfo.getZuZhiJGID()); |
| | | sysUser.setUserName(externalUserInfo.getYongHuID()); |
| | | sysUser.setUserName(externalUserInfo.getYongHuDLM()); |
| | | sysUser.setNickName(externalUserInfo.getYongHuXM()); |
| | | sysUser.setUserType(""); |
| | | sysUser.setDeptId(null); |
| | | sysUser.setTitle(null); |
| | | |
| | | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | sysUser.setPassword(passwordEncoder.encode(defaultPwd)); |
| | | |
| | | sysUser.setHisUserId(externalUserInfo.getYongHuID()); |
| | | sysUser.setPhonenumber(externalUserInfo.getLianXiDH()); |
| | | sysUser.setJobPhone(externalUserInfo.getGongZuoDH()); |
| | |
| | | Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX"); |
| | | ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true); |
| | | |
| | | PatArchive patArchive = addPatArchive(externalInHospPatientInfo, null, null); |
| | | |
| | | |
| | | //手术信息新增 |
| | | Map<String, Object> ssxx = (Map<String, Object>) yeWuXX.get("ShouShuSQ"); |
| | | //手术更新 |
| | |
| | | else if (ObjectUtils.isNotEmpty(sscx)) |
| | | externalOperationInfo = BeanUtil.mapToBean(sscx, ExternalOperationInfo.class, true); |
| | | PatMedOperation patMedOperation = new PatMedOperation(); |
| | | patMedOperation.setPatid(null); |
| | | patMedOperation.setPatid(patArchive.getId()); |
| | | patMedOperation.setPatcode(externalInHospPatientInfo.getBingRenID()); |
| | | patMedOperation.setPaname(externalInHospPatientInfo.getXingMing()); |
| | | // patMedOperation.setOpreqid(externalOperationInfo.getShenQingDID()); |
| | |
| | | List<PatMedOperation> patMedOperations = patMedOperationMapper.selectPatMedOperationList(patMedOperation); |
| | | |
| | | patMedOperation.setOpsstatus(null); |
| | | patMedOperation.setOperationcode(externalOperationInfo.getShouShuLBDM()); |
| | | patMedOperation.setOperationname(externalOperationInfo.getShouShuLBMC()); |
| | | patMedOperation.setOptypecode(externalOperationInfo.getShouShuLBDM()); |
| | | patMedOperation.setOptypename(externalOperationInfo.getShouShuLBMC()); |
| | | patMedOperation.setOperatortime(externalOperationInfo.getYaoQiuSJ()); |
| | | patMedOperation.setOpreqtime(externalOperationInfo.getShenQingSJ()); |
| | | patMedOperation.setReqdoccode(externalOperationInfo.getShenQingYSID()); |
| | |
| | | if (CollectionUtils.isNotEmpty(patMedOperations)) { |
| | | Long id = patMedOperations.get(0).getId(); |
| | | patMedOperation.setId(id); |
| | | patMedOperation.setCheckFlag(patMedOperations.get(0).getCheckFlag()); |
| | | //如果手术撤销,直接删除该条手术信息 |
| | | if (ObjectUtils.isNotEmpty(sscx)) { |
| | | patMedOperation.setDelFlag("1"); |
| | | //同时去查询,是否在subtask中生成任务,如果生成出得立马删除 |
| | | } |
| | | patMedOperationMapper.updatePatMedOperation(patMedOperation); |
| | | } else patMedOperationMapper.insertPatMedOperation(patMedOperation); |
| | | log.error("-----patMedOperation的主键id为:{}", patMedOperation.getId()); |
| | |
| | | if (ObjectUtils.isNotEmpty(ssxx)) { |
| | | Map<String, Object> ShouShuMXList = (Map<String, Object>) ssxx.get("ShouShuMXList"); |
| | | List<ExternalOperationDetail> externalOperationDetails = BeanUtil.mapToBean(ShouShuMXList, List.class, true); |
| | | //addMianTableFalg是否需要将主手术的信息放到PatMedOperation表中(只有第一个主手术信息需要放,后面的都不需要放了,也就是说,第一个放完后,就要把这个flag改成false) |
| | | Boolean addMianTableFalg = true; |
| | | for (ExternalOperationDetail externalOperationDetail : externalOperationDetails) { |
| | | PatMedOperationItem patMedOperationItem = new PatMedOperationItem(); |
| | | patMedOperationItem.setOpid(patMedOperation.getId()); |
| | |
| | | patMedOperationItem.setOpposition(externalOperationDetail.getShouShuBW()); |
| | | patMedOperationItem.setDelFlag("0"); |
| | | patMedOperationItem.setOrgid(patMedOperation.getOrgid()); |
| | | if (externalOperationDetail.getZhuShouSBZ().equals("1") && addMianTableFalg == true) { |
| | | patMedOperation.setOpcode(externalOperationDetail.getShouShuMCID()); |
| | | patMedOperation.setOpdesc(externalOperationDetail.getShouShuMC()); |
| | | // patMedOperation.setOpid(externalOperationDetail.getShouShuJBDM()); |
| | | patMedOperationMapper.updatePatMedOperation(patMedOperation); |
| | | addMianTableFalg = false; |
| | | } |
| | | |
| | | patMedOperationItemMapper.insertPatMedOperationItem(patMedOperationItem); |
| | | } |
| | | } |