|
@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -145,7 +146,7 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
updateE.add(s);
|
|
|
} else {
|
|
|
s.setGmtCreate(new Date());
|
|
|
- //s.setQcTypeId(initQcTypeId(s));
|
|
|
+ s.setQcTypeId(initQcTypeId(s));
|
|
|
addE.add(s);
|
|
|
}
|
|
|
});
|
|
@@ -238,4 +239,112 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public RespDTO updatePlace(String startDate, String endDate){
|
|
|
+ try {
|
|
|
+ //验证数据是否存在
|
|
|
+ if(StringUtil.isBlank(startDate)){
|
|
|
+ return RespDTO.onError("请输入开始时间!");
|
|
|
+ }else if(StringUtil.isBlank(endDate)){
|
|
|
+ return RespDTO.onError("请输入截止时间!");
|
|
|
+ }else{
|
|
|
+ String sql = "SELECT t.behospitalCode FROM AI_V_SENDPATIENTINFO t WHERE t.isPlacefile='1' and to_char(t.behospitalDate,'yyyy-mm-dd') >='" + startDate
|
|
|
+ + "' and to_char(t.behospitalDate,'yyyy-mm-dd') < '" + endDate + "'";
|
|
|
+ sql = sql.replace("\"","");
|
|
|
+ List<String> isPlaceFileInfoList = tzDBConn.getBeHospitalCode(sql);
|
|
|
+ if(isPlaceFileInfoList.size() == 0){
|
|
|
+ return RespDTO.onError("未找到病历!");
|
|
|
+ }
|
|
|
+ UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("hospital_id", "5")
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N)
|
|
|
+ .in("behospital_code", isPlaceFileInfoList)
|
|
|
+ .set("is_placefile","1")
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
+
|
|
|
+ Boolean flag=update(new BehospitalInfo(),updateWrapper);
|
|
|
+ return RespDTO.onSuc(flag);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public RespDTO sendDateInfo(String startDate, String endDate){
|
|
|
+ try {
|
|
|
+ //验证数据是否存在
|
|
|
+ if(StringUtil.isBlank(startDate)){
|
|
|
+ return RespDTO.onError("请输入开始时间!");
|
|
|
+ }else if(StringUtil.isBlank(endDate)){
|
|
|
+ return RespDTO.onError("请输入截止时间!");
|
|
|
+ }else{
|
|
|
+ String sql = "SELECT * FROM AI_V_SENDPATIENTINFO t WHERE to_char(t.behospitalDate,'yyyy-mm-dd') >='" + startDate
|
|
|
+ + "' and to_char(t.behospitalDate,'yyyy-mm-dd') < '" + endDate + "'";
|
|
|
+ sql = sql.replace("\"","");
|
|
|
+ List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
|
|
|
+ if(behospitalInfoList.size() == 0){
|
|
|
+ return RespDTO.onError("未找到病历!");
|
|
|
+ }
|
|
|
+ execute(behospitalInfoList);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc("入院信息更新成功!");
|
|
|
+ }catch (Exception e){
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public RespDTO sendDateInfoOne(String behospitalCode){
|
|
|
+ try {
|
|
|
+ //验证数据是否存在
|
|
|
+ if(StringUtil.isBlank(behospitalCode)){
|
|
|
+ return RespDTO.onError("请输入病历号");
|
|
|
+ }else{
|
|
|
+ String sql = "SELECT * FROM AI_V_SENDPATIENTINFO t WHERE t.behospitalCode ='" + behospitalCode + "'";
|
|
|
+ sql = sql.replace("\"","");
|
|
|
+ List<BehospitalInfo> behospitalInfoList = tzDBConn.getBehospitalInfo(sql);
|
|
|
+ if(behospitalInfoList.size() == 0){
|
|
|
+ return RespDTO.onError("未找到病历!");
|
|
|
+ }
|
|
|
+ execute(behospitalInfoList);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc(behospitalCode + "入院信息更新成功!");
|
|
|
+ }catch (Exception e){
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 更新婴儿标志(义乌妇保专用)
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public RespDTO updateBaby(String startDate, String endDate){
|
|
|
+ try {
|
|
|
+ //验证数据是否存在
|
|
|
+ if(StringUtil.isBlank(startDate)){
|
|
|
+ return RespDTO.onError("请输入开始时间!");
|
|
|
+ }else if(StringUtil.isBlank(endDate)){
|
|
|
+ return RespDTO.onError("请输入截止时间!");
|
|
|
+ }else{
|
|
|
+ String sql = "SELECT t.behospitalCode FROM AI_V_SENDPATIENTINFO t WHERE t.YINGERBZ='1' and to_char(t.behospitalDate,'yyyy-mm-dd') >='" + startDate
|
|
|
+ + "' and to_char(t.behospitalDate,'yyyy-mm-dd') < '" + endDate + "'";
|
|
|
+ sql = sql.replace("\"","");
|
|
|
+ //获取病人的住院号
|
|
|
+ List<String> isPlaceFileInfoList = tzDBConn.getBeHospitalCode(sql);
|
|
|
+ if(isPlaceFileInfoList.size() == 0){
|
|
|
+ return RespDTO.onError("未找到病历!");
|
|
|
+ }
|
|
|
+ UpdateWrapper<BehospitalInfo> updateWrapper=new UpdateWrapper<>();
|
|
|
+ updateWrapper.eq("hospital_id", "5")
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N)
|
|
|
+ .in("behospital_code", isPlaceFileInfoList)
|
|
|
+ .set("is_baby","1")
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
+
|
|
|
+ Boolean flag=update(new BehospitalInfo(),updateWrapper);
|
|
|
+ return RespDTO.onSuc(flag);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|