版本20201013_1同步更新增加监听后台采集完成

master
zengwh 5 years ago
parent 07358d5235
commit 299fe37503

@ -1,10 +1,10 @@
package com.emr.controller;
import com.emr.entity.ArchiveOtherExtSubmittime;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.ipml.ArchiveOtherExtService;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.Msg;
import com.emr.vo.ArchiveFlowInfoVo;
import com.emr.vo.ArchiveOtherExtVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@ -82,4 +82,17 @@ public class ArchiveOtherExtController {
archiveOtherExtService.updateSubmit(ids,notNursingIds,jzh,masterId,sysFlag);
return Msg.success();
}
/**
* id
* @param ids ext_id
* @return
* @throws Exception
*/
@RequestMapping("selectSuccessByExtIds")
@ResponseBody
public Msg selectSuccessByExtIds(String ids) throws Exception{
List<ArchiveOtherExtSubmittime> list = archiveOtherExtService.selectSuccessByExtIds(ids);
return Msg.success().add("list",list);
}
}

@ -23,4 +23,6 @@ public interface ArchiveOtherExtSubmittimeMapper {
int createInfo(@Param("ids") String ids);
int updateInfo(@Param("ids") String ids);
List<ArchiveOtherExtSubmittime> selectSuccessByExtIds(@Param("ids")String ids);
}

@ -2,6 +2,7 @@ package com.emr.service.ipml;
import com.emr.dao.ArchiveOtherExtMapper;
import com.emr.dao.ArchiveOtherExtSubmittimeMapper;
import com.emr.entity.ArchiveOtherExt;
import com.emr.entity.ArchiveOtherExtSubmittime;
import com.emr.vo.ArchiveOtherExtVo;
import com.emr.vo.KeyValue;
@ -194,4 +195,8 @@ public class ArchiveOtherExtService {
archiveOtherExtSubmittimeMapper.createInfo(createStr.toString());
}
}
public List<ArchiveOtherExtSubmittime> selectSuccessByExtIds(String ids) {
return archiveOtherExtSubmittimeMapper.selectSuccessByExtIds(ids);
}
}

@ -337,7 +337,13 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
dictionary.setTypecode("dept_code");
List<Emr_Dictionary> dictionaries = dictionaryMapper.dicByTypeCode(dictionary);
//查询出院天数
List<Archive_Master_Vo> selectDays = archiveMasterMapper.selectDaysByMasterIds(list);
List<Archive_Master_Vo> selectDays = new ArrayList<>();
if(list.size() > 200){
selectDays = archiveMasterMapper.selectDaysByMasterIds(null);
}else{
selectDays = archiveMasterMapper.selectDaysByMasterIds(list);
}
for (Archive_Master_Vo vo:list) {
//科室名称编码转名称
DeptNameCode2Name(dictionaries, vo);

@ -161,4 +161,19 @@
update archive_other_ext_submitTime set create_time = CONVERT(varchar(19),GETDATE(),120)
where other_ext_id in (${ids})
</update>
<!--根据ids查询采集成功比较提交时间和结束时间-->
<select id="selectSuccessByExtIds" resultMap="BaseResultMap">
SELECT
archive_other_ext_submitTime.other_ext_id
FROM
archive_other_ext_submitTime
INNER JOIN archive_other_ext ON archive_other_ext_submitTime.other_ext_id = archive_other_ext.ID
WHERE
archive_other_ext_submitTime.create_time &lt;= archive_other_ext.eTime
AND archive_other_ext.ID in (
<foreach collection="ids.split(',')" item="item" separator=",">
'${item}'
</foreach>
)
</select>
</mapper>

@ -1060,10 +1060,13 @@
) days
FROM
archive_master m
WHERE
m.id IN(
<foreach collection="list" item="item" separator=",">#{item.id,jdbcType=NVARCHAR}</foreach>
)
<where>
<if test="list != null">
and m.id IN(
<foreach collection="list" item="item" separator=",">#{item.id,jdbcType=NVARCHAR}</foreach>
)
</if>
</where>
</select>
<!--根据科室权限查询主管医生列表-->
<select id="loadDoctorInCharge" resultMap="BaseResultMap">

@ -101,6 +101,24 @@
.filter-option-inner-inner {
font-size: 12px;
}
.loading {
width: 148px;
height: 56px;
position: absolute;
top: 7px;
right: 16px;
line-height: 56px;
color: red;
padding-left: 60px;
font-size: 7px;
background: #000;
opacity: 0.7;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=70);
display: none;
}
</style>
<script>
var path = "${path}";
@ -697,6 +715,7 @@
</h4>
</div>
<div class="modal-body divCss2">
<div id="loading" class="loading">正在采集,请稍等</div>
<div class="row">
<div class="col-sm-12">
<div class="form-inline">
@ -753,6 +772,6 @@
</div>
</body>
<script src="${path}/static/js/beHospList/beHospList.js?time=2020-10-13"></script>
<script src="${path}/static/js/hospitalCommom/hospitalCommom.js?time=2020-10-13"></script>
<script src="${path}/static/js/hospitalCommom/hospitalCommom.js?time=2020-10-13_1"></script>
<script src="${path}/static/js/hospitalLoadPdf/loadPdf.js?time=2020-10-09"></script>
</html>

@ -354,7 +354,7 @@
</div>
<footer class="main-footer">
<div class="pull-right">
<b>Version</b> 20201012
<b>Version</b> 20201013_1
</div>
<strong>Copyright &copy; 2019-2090 厦门嘉时软件.</strong> All rights
reserved.

@ -1291,24 +1291,127 @@ function initTable5(data,sidePagination) {
}
$("#table5").bootstrapTable(option);
}
//定义刷新开始计时到超时时间为10分钟
var timeOut = 10 * 60 * 1000;
//定义查询间隔时间默认10秒
var intervalTime = 10 * 1000;
//定义倒计时刷新秒数默认5秒
var times = 5;
$("#loading").css("background","url("+path+"/static/img/load.gif) no-repeat 10px 50%");
//同步更新
var timeInterval;
function submitUpdate(ids,notNursingIds,sysFlag) {
var idsArr = ids.split(",");
var jzh = $("#patientId").val();
$.ajax({
type:'post',
url:path+'/archiveExt/submitUpdate',
data:{ids:ids,notNursingIds:notNursingIds,jzh:$("#patientId").val(),masterId:$("#idLab").text(),sysFlag:sysFlag},
data:{ids:ids,notNursingIds:notNursingIds,jzh:jzh,masterId:$("#idLab").text(),sysFlag:sysFlag},
dataType:'json',
success:function (data) {
if(data.code == 100){
toastr.success("同步更新已发送,请耐心等待!");
//刷新列表
initTable5('','server');
$("#loading").show();
var timeInterval = setInterval(function () {
//10秒查询一次
if(sysFlag == 1){
//护理记录
$.ajax({
type:'get',
url:path+'/font/selectC1ByPatientId',
data:{patientId:jzh},
dataType:'json',
async:false,
success:function(result){
if(result.code == 100){
sysFlag = '';
ids = successMethod(idsArr,'',notNursingIds,sysFlag);
}
}
})
}
if(ids != '') {
//其他
$.ajax({
type: 'get',
url: path + '/archiveExt/selectSuccessByExtIds',
data: {ids: ids},
dataType: 'json',
success: function (result) {
if (result.code == 100) {
var successIds = result.extend.list;
if (successIds.length > 0) {
//返回成功id集合
ids = successMethod(ids.split(","), successIds, notNursingIds, sysFlag);
}
}
}
})
}
},intervalTime);
setTimeout(function(){
toastr.error("后台按需采集超时,请联系系统运维人员");
//隐藏加载控件
$("#loading").hide();
},timeOut);
}else{
toastr.error(data.msg);
}
}
})
}
//采集完成执行代码
function successMethod(idsArr,successIds,notNursingIds,sysFlag){
setTimeout(function(){
//刷新列表
initTable5('','server');
},times*1000);
var idsList = [];
//原来的个数
var idsArrLen = idsArr.length;
if(successIds != ''){
//不存在护理idsList = idsArr-successIds
idsList = getIdArr(idsArr,successIds);
}else{
//存在护理idsList = idsArr∩notNursingIds
var list2 = notNursingIds.split(",");
for (var i = 0; i < idsArr.length; i++) {
//定义是否包含关系
var idFlag = false;
for (var j = 0; j < list2.length; j++) {
if(idsArr[i] == list2[j]){
idsList.push(idsArr[i]);
idFlag = true;
}
}
//成功
if(!idFlag) {
toastr.warning("按需采集完成1个,剩余" + (idsArr.length - 1) + "个,页面将在" + times + "秒后自动刷新");
}
}
}
idsArr = idsList;
if(idsArr.length == 0){
//隐藏加载控件
$("#loading").hide();
clearInterval(timeInterval);
}
return idsArr.toString();
}
function getIdArr(idsArr,successIds){
for (var i = 0; i < idsArr.length; i++) {
for (var j = 0; j < successIds.length; j++) {
if(idsArr[i] == successIds[j].otherExtId){
//成功
toastr.warning("按需采集完成1个,剩余"+(idsArr.length-1)+"个,页面将在"+times+"秒后自动刷新");
idsArr.splice(i,1);
}
}
}
return idsArr;
}
//批量更新
$("#searchBtn6").click(function(){
var data =$("#table5").bootstrapTable('getSelections');

Loading…
Cancel
Save