|
@@ -49,40 +49,42 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
|
|
private AMedicalRecordContentFacade aMedicalRecordContentFacade;
|
|
private AMedicalRecordContentFacade aMedicalRecordContentFacade;
|
|
@Autowired
|
|
@Autowired
|
|
private AMedicalRecordFacade aMedicalRecordFacade;
|
|
private AMedicalRecordFacade aMedicalRecordFacade;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 把得到的list变成一个对象
|
|
* 把得到的list变成一个对象
|
|
|
|
+ *
|
|
* @param
|
|
* @param
|
|
*/
|
|
*/
|
|
- public void getOneList(List<HisViewVo> hisViewVos,String modeId) {
|
|
|
|
|
|
+ public void getOneList(List<HisViewVo> hisViewVos, String modeId) {
|
|
try {
|
|
try {
|
|
- Map<String,Object> map =new HashMap<>();
|
|
|
|
- Map<String,Object> wholeData =new HashMap<>();
|
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ Map<String, Object> wholeData = new HashMap<>();
|
|
String modelName = ModeIdEnum.getName(Integer.parseInt(modeId));
|
|
String modelName = ModeIdEnum.getName(Integer.parseInt(modeId));
|
|
- Map<String,String> tableKey=columnFacade.getColumn(CacheKeyEnum.getName(modelName));
|
|
|
|
|
|
+ Map<String, String> tableKey = columnFacade.getColumn(CacheKeyEnum.getName(modelName));
|
|
//循环list根据咱字段的名称来跟得到的数据来做比较
|
|
//循环list根据咱字段的名称来跟得到的数据来做比较
|
|
- for (HisViewVo s: hisViewVos) {
|
|
|
|
- if (s.getKeyEn()!=null) {
|
|
|
|
|
|
+ for (HisViewVo s : hisViewVos) {
|
|
|
|
+ if (s.getKeyEn() != null) {
|
|
tableKey.forEach((k, v) -> {
|
|
tableKey.forEach((k, v) -> {
|
|
if (s.getKeyEn().equals(v)) {
|
|
if (s.getKeyEn().equals(v)) {
|
|
map.put(s.getKeyEn(), s.getDeValue());
|
|
map.put(s.getKeyEn(), s.getDeValue());
|
|
wholeData.put(k, s.getDeValue());
|
|
wholeData.put(k, s.getDeValue());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }else {
|
|
|
|
- wholeData.put(s.getKeyCN(),s.getDeValue());
|
|
|
|
|
|
+ } else {
|
|
|
|
+ wholeData.put(s.getKeyCN(), s.getDeValue());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- StrConsultationApply strConsultationApply =new StrConsultationApply();
|
|
|
|
|
|
+ StrConsultationApply strConsultationApply = new StrConsultationApply();
|
|
AStrConsultationApplyVO strConsultationApplyVo = (AStrConsultationApplyVO) MapUtil.mapToObject(map, AStrConsultationApplyVO.class);
|
|
AStrConsultationApplyVO strConsultationApplyVo = (AStrConsultationApplyVO) MapUtil.mapToObject(map, AStrConsultationApplyVO.class);
|
|
- BeanUtils.copyProperties(strConsultationApplyVo,strConsultationApply);
|
|
|
|
|
|
+ BeanUtils.copyProperties(strConsultationApplyVo, strConsultationApply);
|
|
|
|
|
|
- strConsultationApply.setConsultationDate(DateUtil.parseDate(strConsultationApplyVo.getConsultationDate(),"yyyy-MM-dd HH:mm"));//开始时间
|
|
|
|
|
|
+ strConsultationApply.setConsultationDate(DateUtil.parseDate(strConsultationApplyVo.getConsultationDate(), "yyyy-MM-dd HH:mm"));//开始时间
|
|
|
|
|
|
- BeanUtils.copyProperties(hisViewVos.get(0),strConsultationApply);
|
|
|
|
|
|
+ BeanUtils.copyProperties(hisViewVos.get(0), strConsultationApply);
|
|
strConsultationApply.setWholeData(JSON.toJSONString(wholeData));
|
|
strConsultationApply.setWholeData(JSON.toJSONString(wholeData));
|
|
|
|
|
|
aMedicalRecordContentFacade.executeByView(hisViewVos.get(0));
|
|
aMedicalRecordContentFacade.executeByView(hisViewVos.get(0));
|
|
- aMedicalRecordFacade.executeByView(hisViewVos.get(0),modeId);
|
|
|
|
|
|
+ aMedicalRecordFacade.executeByView(hisViewVos.get(0), modeId);
|
|
|
|
|
|
this.dealData(strConsultationApply);
|
|
this.dealData(strConsultationApply);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -91,28 +93,28 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void getColumnZhAndCh(){
|
|
|
|
- List<ColumnZhAndChDTO> list=this.baseMapper.getColumnZhAndCh();
|
|
|
|
- list.forEach(s->{
|
|
|
|
|
|
+ public void getColumnZhAndCh() {
|
|
|
|
+ List<ColumnZhAndChDTO> list = this.baseMapper.getColumnZhAndCh();
|
|
|
|
+ list.forEach(s -> {
|
|
s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
|
|
s.setEn(NamingStrategy.underlineToCamel(s.getEn()));
|
|
});
|
|
});
|
|
|
|
|
|
- Map<String, String> columnMap= EntityUtil.makeMapWithKeyValue(list,"ch","en");
|
|
|
|
- Boolean flag=columnFacade.createColumn(columnMap,"strConsultationApply");
|
|
|
|
|
|
+ Map<String, String> columnMap = EntityUtil.makeMapWithKeyValue(list, "ch", "en");
|
|
|
|
+ Boolean flag = columnFacade.createColumn(columnMap, "strConsultationApply");
|
|
|
|
|
|
//Map<String, String> map=columnFacade.getColumn("strConsultationNote");
|
|
//Map<String, String> map=columnFacade.getColumn("strConsultationNote");
|
|
- if(!flag){
|
|
|
|
|
|
+ if (!flag) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//会诊申请单
|
|
//会诊申请单
|
|
- public void dealData(String columnMap,Map<String, Object> entityMap,Long hospitalId){
|
|
|
|
- StrConsultationApply strConsultationApply=new StrConsultationApply();
|
|
|
|
|
|
+ public void dealData(String columnMap, Map<String, Object> entityMap, Long hospitalId) {
|
|
|
|
+ StrConsultationApply strConsultationApply = new StrConsultationApply();
|
|
try {
|
|
try {
|
|
- AStrConsultationApplyVO strConsultationApplyVO=(AStrConsultationApplyVO) MapUtil.mapToObject(entityMap, AStrConsultationApplyVO.class);
|
|
|
|
- BeanUtils.copyProperties(strConsultationApplyVO,strConsultationApply);
|
|
|
|
|
|
+ AStrConsultationApplyVO strConsultationApplyVO = (AStrConsultationApplyVO) MapUtil.mapToObject(entityMap, AStrConsultationApplyVO.class);
|
|
|
|
+ BeanUtils.copyProperties(strConsultationApplyVO, strConsultationApply);
|
|
strConsultationApply.setHospitalId(hospitalId);//医院编码
|
|
strConsultationApply.setHospitalId(hospitalId);//医院编码
|
|
|
|
|
|
strConsultationApply.setAuditDate(DateUtil.parseDateTime(strConsultationApplyVO.getAuditDate()));//审核时间
|
|
strConsultationApply.setAuditDate(DateUtil.parseDateTime(strConsultationApplyVO.getAuditDate()));//审核时间
|
|
@@ -123,33 +125,33 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
|
|
strConsultationApply.setConsultationDate(DateUtil.parseDateTime(strConsultationApplyVO.getConsultationDate()));//会诊时间
|
|
strConsultationApply.setConsultationDate(DateUtil.parseDateTime(strConsultationApplyVO.getConsultationDate()));//会诊时间
|
|
strConsultationApply.setWholeData(columnMap);
|
|
strConsultationApply.setWholeData(columnMap);
|
|
//判断数据库中是否存在,不存在insert
|
|
//判断数据库中是否存在,不存在insert
|
|
- if(isExist(strConsultationApply)){
|
|
|
|
|
|
+ if (isExist(strConsultationApply)) {
|
|
strConsultationApply.setGmtCreate(new Date());//记录创建时间
|
|
strConsultationApply.setGmtCreate(new Date());//记录创建时间
|
|
this.save(strConsultationApply);
|
|
this.save(strConsultationApply);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
strConsultationApply.setGmtModified(new Date());//记录修改时间
|
|
strConsultationApply.setGmtModified(new Date());//记录修改时间
|
|
- this.update(strConsultationApply,new QueryWrapper<StrConsultationApply>()
|
|
|
|
|
|
+ this.update(strConsultationApply, new QueryWrapper<StrConsultationApply>()
|
|
.eq("rec_id", strConsultationApply.getRecId())
|
|
.eq("rec_id", strConsultationApply.getRecId())
|
|
.eq("hospital_id", strConsultationApply.getHospitalId())
|
|
.eq("hospital_id", strConsultationApply.getHospitalId())
|
|
.eq("behospital_code", strConsultationApply.getBehospitalCode())
|
|
.eq("behospital_code", strConsultationApply.getBehospitalCode())
|
|
- .eq("is_deleted","N"));
|
|
|
|
|
|
+ .eq("is_deleted", "N"));
|
|
}
|
|
}
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
- log.error(e.getMessage(),e);
|
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单",strConsultationApply.getRecId(), JSON.toJSONString(entityMap),"",e.getMessage());
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", strConsultationApply.getRecId(), JSON.toJSONString(entityMap), "", e.getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public Boolean isExist(StrConsultationApply strConsultationApply){
|
|
|
|
- Boolean flag=true;
|
|
|
|
|
|
+ public Boolean isExist(StrConsultationApply strConsultationApply) {
|
|
|
|
+ Boolean flag = true;
|
|
int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationApply>()
|
|
int count = this.baseMapper.selectCount(new QueryWrapper<StrConsultationApply>()
|
|
.eq("rec_id", strConsultationApply.getRecId())
|
|
.eq("rec_id", strConsultationApply.getRecId())
|
|
.eq("hospital_id", strConsultationApply.getHospitalId())
|
|
.eq("hospital_id", strConsultationApply.getHospitalId())
|
|
.eq("behospital_code", strConsultationApply.getBehospitalCode()));
|
|
.eq("behospital_code", strConsultationApply.getBehospitalCode()));
|
|
- if(count>0){
|
|
|
|
- flag=false;
|
|
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ flag = false;
|
|
}
|
|
}
|
|
return flag;
|
|
return flag;
|
|
}
|
|
}
|
|
@@ -182,51 +184,53 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void dealData(StrConsultationApply medConsultationApply){
|
|
|
|
|
|
+ public void dealData(StrConsultationApply medConsultationApply) {
|
|
try {
|
|
try {
|
|
//判断数据库中是否存在,不存在insert
|
|
//判断数据库中是否存在,不存在insert
|
|
- if(isExist(medConsultationApply)){
|
|
|
|
|
|
+ if (isExist(medConsultationApply)) {
|
|
medConsultationApply.setGmtCreate(new Date());//记录创建时间
|
|
medConsultationApply.setGmtCreate(new Date());//记录创建时间
|
|
this.save(medConsultationApply);
|
|
this.save(medConsultationApply);
|
|
- }else{
|
|
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply), "", "新增会诊申请单");
|
|
|
|
+ } else {
|
|
medConsultationApply.setGmtModified(new Date());//记录修改时间
|
|
medConsultationApply.setGmtModified(new Date());//记录修改时间
|
|
- this.update(medConsultationApply,new QueryWrapper<StrConsultationApply>()
|
|
|
|
|
|
+ this.update(medConsultationApply, new QueryWrapper<StrConsultationApply>()
|
|
.eq("rec_id", medConsultationApply.getRecId())
|
|
.eq("rec_id", medConsultationApply.getRecId())
|
|
.eq("hospital_id", medConsultationApply.getHospitalId())
|
|
.eq("hospital_id", medConsultationApply.getHospitalId())
|
|
.eq("behospital_code", medConsultationApply.getBehospitalCode()));
|
|
.eq("behospital_code", medConsultationApply.getBehospitalCode()));
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply), "", "修改会诊申请单");
|
|
}
|
|
}
|
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
- log.error(e.getMessage(),e);
|
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单",medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply),"",e.getMessage());
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("会诊申请单", medConsultationApply.getRecId(), JSON.toJSONString(medConsultationApply), "", "会诊申请单出错:" + e.getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public RespDTO execDealData(List<StrConsultationApplyVO> list){
|
|
|
|
- if(list!=null && list.size()>0){
|
|
|
|
|
|
+ public RespDTO execDealData(List<StrConsultationApplyVO> list) {
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
//循环验证数据有效性
|
|
//循环验证数据有效性
|
|
- for (StrConsultationApplyVO strConsultationApplyVO:list) {
|
|
|
|
- if("".equals(strConsultationApplyVO.getRecId())) {
|
|
|
|
|
|
+ for (StrConsultationApplyVO strConsultationApplyVO : list) {
|
|
|
|
+ if ("".equals(strConsultationApplyVO.getRecId())) {
|
|
return RespDTO.onError("请输入记录编号!");
|
|
return RespDTO.onError("请输入记录编号!");
|
|
- }else if(strConsultationApplyVO.getHospitalId()==null){
|
|
|
|
|
|
+ } else if (strConsultationApplyVO.getHospitalId() == null) {
|
|
return RespDTO.onError("请输入医院编码!");
|
|
return RespDTO.onError("请输入医院编码!");
|
|
- }else if("".equals(strConsultationApplyVO.getBehospitalCode())){
|
|
|
|
|
|
+ } else if ("".equals(strConsultationApplyVO.getBehospitalCode())) {
|
|
return RespDTO.onError("请输入病人住院编码!");
|
|
return RespDTO.onError("请输入病人住院编码!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//初始、格式化数据
|
|
//初始、格式化数据
|
|
- List<StrConsultationApply> strConsultationApplyList= Lists.newArrayList();
|
|
|
|
- strConsultationApplyList= BeanUtil.listCopyTo(list,StrConsultationApply.class);
|
|
|
|
|
|
+ List<StrConsultationApply> strConsultationApplyList = Lists.newArrayList();
|
|
|
|
+ strConsultationApplyList = BeanUtil.listCopyTo(list, StrConsultationApply.class);
|
|
execute(strConsultationApplyList);
|
|
execute(strConsultationApplyList);
|
|
|
|
|
|
return RespDTO.onSuc(strConsultationApplyList);
|
|
return RespDTO.onSuc(strConsultationApplyList);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
return RespDTO.onError("未接收到数据!");
|
|
return RespDTO.onError("未接收到数据!");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void execute(List<StrConsultationApply> list){
|
|
|
|
|
|
+ public void execute(List<StrConsultationApply> list) {
|
|
try {
|
|
try {
|
|
List<StrConsultationApply> addE = Lists.newLinkedList();
|
|
List<StrConsultationApply> addE = Lists.newLinkedList();
|
|
List<StrConsultationApply> updateE = Lists.newLinkedList();
|
|
List<StrConsultationApply> updateE = Lists.newLinkedList();
|
|
@@ -235,7 +239,7 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
|
|
StrConsultationApply strConsultationApply = this.getOne(new QueryWrapper<StrConsultationApply>()
|
|
StrConsultationApply strConsultationApply = this.getOne(new QueryWrapper<StrConsultationApply>()
|
|
.eq("rec_id", s.getRecId())
|
|
.eq("rec_id", s.getRecId())
|
|
.eq("hospital_id", s.getHospitalId())
|
|
.eq("hospital_id", s.getHospitalId())
|
|
- .eq("behospital_code",s.getBehospitalCode()), false);
|
|
|
|
|
|
+ .eq("behospital_code", s.getBehospitalCode()), false);
|
|
if (strConsultationApply != null) {
|
|
if (strConsultationApply != null) {
|
|
s.setGmtModified(new Date());
|
|
s.setGmtModified(new Date());
|
|
updateE.add(s);
|
|
updateE.add(s);
|
|
@@ -245,15 +249,15 @@ public class AStrConsultationApplyFacade extends StrConsultationApplyServiceImpl
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- if(addE.size()>0){
|
|
|
|
|
|
+ if (addE.size() > 0) {
|
|
strConsultationApplyService.saveBatch(addE);
|
|
strConsultationApplyService.saveBatch(addE);
|
|
}
|
|
}
|
|
- if(updateE.size()>0){
|
|
|
|
|
|
+ if (updateE.size() > 0) {
|
|
this.baseMapper.updateBatchByKey(updateE);
|
|
this.baseMapper.updateBatchByKey(updateE);
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
- log.error(e.getMessage(),e);
|
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单","", JSON.toJSONString(list),"",e.getMessage());
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("结构化-会诊申请单", "", JSON.toJSONString(list), "", e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|