|
|
|
@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.text.CollationElementIterator;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
@ -56,6 +57,8 @@ public class ArchiveOtherExtService {
|
|
|
|
|
String maxETime = archiveOtherExtMapper.selectMaxETimeByNursingAndJzh(archiveOtherExtVo.getJzh());
|
|
|
|
|
archiveOtherExtVo.setNursingEndTime(maxETime);
|
|
|
|
|
for (ArchiveOtherExtVo vo : list) {
|
|
|
|
|
//遗嘱特殊处理结束时间
|
|
|
|
|
operYizhuETime(vo);
|
|
|
|
|
if (vo.getSysflag().equals(1)) {
|
|
|
|
|
if (StringUtils.isNotBlank(maxETime)) {
|
|
|
|
|
vo.setNursingEndTime(maxETime);
|
|
|
|
@ -99,6 +102,27 @@ public class ArchiveOtherExtService {
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: operYizhuETime方法是遗嘱完成的话eTime使用按需表archive_other的T2
|
|
|
|
|
* @param: [vo]
|
|
|
|
|
* @return: void
|
|
|
|
|
* @author 曾文和
|
|
|
|
|
* @createTime 2022/5/21 22:29
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
private void operYizhuETime(ArchiveOtherExtVo vo) {
|
|
|
|
|
Integer sysflag = vo.getSysflag();
|
|
|
|
|
if(null != sysflag && sysflag == 8){
|
|
|
|
|
String extId = "'" + vo.getIdTemp() + "'";
|
|
|
|
|
//查询该archive_other
|
|
|
|
|
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(extId.toString(),"Done",-8);
|
|
|
|
|
if(!CollectionUtils.isEmpty(archiveOthers)){
|
|
|
|
|
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
vo.setEtimeStr(fmt.format(archiveOthers.get(0).getT2()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 读取json文件方法
|
|
|
|
|
* @param request
|
|
|
|
@ -138,7 +162,7 @@ public class ArchiveOtherExtService {
|
|
|
|
|
//存在护理记录则调用护理按需采集功能
|
|
|
|
|
if(null != sysFlag && sysFlag == 1) {
|
|
|
|
|
//调用护理按需采集功能
|
|
|
|
|
archiveOtherService.updateArchiveOther(jzh, masterId);
|
|
|
|
|
archiveOtherService.updateArchiveOther(jzh, masterId,null,null);
|
|
|
|
|
//ext表更新非护理记录
|
|
|
|
|
if(StringUtils.isNotBlank(notNursingIds)){
|
|
|
|
|
idsTemp = splitString2String(notNursingIds);
|
|
|
|
@ -146,7 +170,7 @@ public class ArchiveOtherExtService {
|
|
|
|
|
}
|
|
|
|
|
//ext表更新非护理记录
|
|
|
|
|
if(StringUtils.isNotBlank(notNursingIds)){
|
|
|
|
|
updateCommomSubmit(idsTemp);
|
|
|
|
|
updateCommomSubmit(jzh, masterId,idsTemp);
|
|
|
|
|
}
|
|
|
|
|
//操作提交信息表
|
|
|
|
|
operOtherExtSubmitInfo(ids,idsStr,detailIds,request);
|
|
|
|
@ -159,9 +183,66 @@ public class ArchiveOtherExtService {
|
|
|
|
|
* 3.不存在按各自系统的标识插入数据
|
|
|
|
|
* @param idsTemp
|
|
|
|
|
*/
|
|
|
|
|
private void updateCommomSubmit(String idsTemp) throws Exception {
|
|
|
|
|
private void updateCommomSubmit(String jzh,String masterId,String idsTemp) throws Exception {
|
|
|
|
|
//判断是存在遗嘱sysFlag = 8
|
|
|
|
|
//查询是否存在遗嘱集合
|
|
|
|
|
List<ArchiveOtherExt> yizhuOtherExts = archiveOtherExtMapper.selectListBySysFlagAndIds(8, idsTemp);
|
|
|
|
|
//定义非护理和遗嘱的id集合
|
|
|
|
|
StringBuilder notNurseAndYizhuIds = new StringBuilder();
|
|
|
|
|
if(CollectionUtils.isEmpty(yizhuOtherExts)){
|
|
|
|
|
notNurseAndYizhuIds = new StringBuilder(idsTemp);
|
|
|
|
|
}else{
|
|
|
|
|
String[] extIdArr = idsTemp.split(",");
|
|
|
|
|
//定义遗嘱id
|
|
|
|
|
StringBuilder yizhuExtIds = new StringBuilder();
|
|
|
|
|
//定义遗嘱的extId
|
|
|
|
|
Long yizhuExtIdLong = null;
|
|
|
|
|
for(String extId : extIdArr){
|
|
|
|
|
//定义是否是遗嘱id
|
|
|
|
|
boolean flag = false;
|
|
|
|
|
//遍历遗嘱任务集合
|
|
|
|
|
for(ArchiveOtherExt ext : yizhuOtherExts){
|
|
|
|
|
String yizhuExtId = "'" + ext.getId() + "'";
|
|
|
|
|
if(extId.equals(yizhuExtId)){
|
|
|
|
|
if(StringUtils.isNotBlank(yizhuExtIds)){
|
|
|
|
|
yizhuExtIds.append(",");
|
|
|
|
|
}
|
|
|
|
|
yizhuExtIds.append("'").append(extId).append("'");
|
|
|
|
|
flag = true;
|
|
|
|
|
//接收遗嘱id
|
|
|
|
|
yizhuExtIdLong = ext.getId();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!flag){
|
|
|
|
|
if(StringUtils.isNotBlank(notNurseAndYizhuIds)){
|
|
|
|
|
notNurseAndYizhuIds.append(",");
|
|
|
|
|
}
|
|
|
|
|
notNurseAndYizhuIds.append("'").append(extId).append("'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(yizhuExtIds)){
|
|
|
|
|
archiveOtherService.updateArchiveOther(jzh, masterId,-8,yizhuExtIdLong);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(notNurseAndYizhuIds)){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//同步更新非护理和遗嘱部分
|
|
|
|
|
updateNotNurseAndYizhu(notNurseAndYizhuIds.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Description: updateNotNurseAndYizhu方法是同步更新非护理和遗嘱部分
|
|
|
|
|
* @param: [idsTemp]
|
|
|
|
|
* @return: void
|
|
|
|
|
* @author 曾文和
|
|
|
|
|
* @createTime 2022/5/21 20:19
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
private void updateNotNurseAndYizhu(String idsTemp) throws Exception {
|
|
|
|
|
//根据other_ext的id查询存在c2字段值的集合
|
|
|
|
|
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(idsTemp,null);
|
|
|
|
|
List<ArchiveOther> archiveOthers = archiveOtherService.selectAllByC2(idsTemp,null,null);
|
|
|
|
|
//定义需要新增的id集合
|
|
|
|
|
String notExistTemp = "";
|
|
|
|
|
if(!CollectionUtils.isEmpty(archiveOthers)){
|
|
|
|
|