|
@@ -3,6 +3,7 @@ package com.diagbot.facade.data;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.dto.data.ABehospitalInfoDTO;
|
|
|
import com.diagbot.entity.BehospitalInfo;
|
|
@@ -30,6 +31,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -47,6 +49,8 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
private boolean logSwitch;
|
|
|
@Autowired
|
|
|
private AMedicalRecordFacade aMedicalRecordFacade;
|
|
|
+ @Autowired
|
|
|
+ private SendDataDealFacade sendDataDealFacade;
|
|
|
|
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
|
|
|
@@ -236,6 +240,13 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
|
|
|
public RespDTO placeFileFlag(APlaceFileVO aPlaceFileVO){
|
|
|
try {
|
|
|
+ //从新拉取最新的入院登记
|
|
|
+ sendDataDealFacade.sendInfo(aPlaceFileVO.getBehospitalCode());
|
|
|
+ //时间转换
|
|
|
+ String date="";
|
|
|
+ if (StringUtils.isNotBlank(aPlaceFileVO.getPlaceFileDate())){
|
|
|
+ date=aPlaceFileVO.getPlaceFileDate().replace("/", "-");
|
|
|
+ }
|
|
|
//验证数据是否存在
|
|
|
if(StringUtil.isBlank(aPlaceFileVO.getBehospitalCode())){
|
|
|
return RespDTO.onError("请输入病人住院编码!");
|
|
@@ -247,14 +258,15 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
.eq("hospital_id", aPlaceFileVO.getHospitalId())
|
|
|
.eq("is_deleted",IsDeleteEnum.N)
|
|
|
.set("is_placefile","1")
|
|
|
- .set("placefile_date",aPlaceFileVO.getPlaceFileDate().isEmpty()?DateUtil.formatDateTime(DateUtil.now()):DateUtil.parseDateTime(aPlaceFileVO.getPlaceFileDate()))
|
|
|
+ .set("placefile_date",StringUtils.isNotEmpty(date)?DateUtil.parseDateTime(date):DateUtil.now())
|
|
|
.set("gmt_modified", DateUtil.now());
|
|
|
|
|
|
Boolean flag=update(new BehospitalInfo(),updateWrapper);
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("病人住院登记-归档 ","",JSON.toJSONString(aPlaceFileVO),flag.toString(),DateUtil.now()+"");
|
|
|
return RespDTO.onSuc(flag);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
- aMedAbnormalInfoFacade.saveAbnormalInfo("病人住院登记-归档","",JSON.toJSONString(aPlaceFileVO),"",e.getMessage());
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("病人住院登记-归档cuowu ","",JSON.toJSONString(aPlaceFileVO),"",e.getMessage());
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|