首次病程记录排前面

master
zengwh 6 years ago
parent 0040e107f5
commit 64eacbf7f5

@ -15,6 +15,7 @@ import com.emr.util.Jpg2PdfUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -37,7 +38,41 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
public OffsetLimitPage detailByClo(Archive_Detail_Vo record, Integer offset, Integer limit) {
PageHelper.offsetPage(offset, limit);
List<Archive_Detail_Vo> list = archiveDetailMapper.detailByClo(record);
return new OffsetLimitPage((Page) list);
OffsetLimitPage offsetLimitPage = new OffsetLimitPage((Page) list);
if(!CollectionUtils.isEmpty(list)){
//定义新的集合。病程记录分类中的首次病程记录排前头
String strTemp = "首次病程";
String assortId = "AFB9FBE656D7492C80AEDE6E685A851A";
List<Archive_Detail_Vo> returnList = new Page<>();
//定义接收首次病程记录的对象
Archive_Detail_Vo detailVoTemp = new Archive_Detail_Vo();
for (int i = 0; i < list.size(); i++) {
if(list.get(i).getAssortId().equals(assortId) && list.get(i).getTitle().contains(strTemp)){
detailVoTemp = list.get(i);
list.remove(i);
break;
}
}
if(!CollectionUtils.isEmpty(list)) {
//重新排序
//定义是否已添加首次病程
boolean flag = false;
for (Archive_Detail_Vo detailVo : list) {
if (StringUtils.isNotBlank(detailVo.getAssortId()) && detailVo.getAssortId().equals(assortId) && !flag) {
returnList.add(detailVoTemp);
flag = true;
}
returnList.add(detailVo);
}
}else{
//只有首次病程记录的情况
returnList.add(detailVoTemp);
}
((Page<Archive_Detail_Vo>) returnList).setTotal(offsetLimitPage.getTotal());
return new OffsetLimitPage((Page) returnList);
}else{
return offsetLimitPage;
}
}
@Override
@ -98,11 +133,35 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
public void mulFile2OneById(HttpServletResponse response, String pdfWater, List<Archive_Detail> arList) {
List<String> pdfList = new ArrayList<>();
if (arList != null && !arList.isEmpty()) {
for (Archive_Detail detail : arList) {
String str = detail.getPdfPath();
if (StringUtils.isNoneBlank(str)) {
pdfList.add(str);
//抽取首次病程记录
String strTemp = "首次病程";
String assortId = "AFB9FBE656D7492C80AEDE6E685A851A";
String strPath = "";
for (int i = 0; i < arList.size(); i++) {
String assortid = arList.get(i).getAssortid();
if(StringUtils.isNotBlank(assortid) && assortid.equals(assortId) && arList.get(i).getTitle().contains(strTemp)){
strPath = arList.get(i).getPdfPath();
arList.remove(i);
break;
}
}
if(!CollectionUtils.isEmpty(arList)) {
//定义是否添加首次病程
boolean flag = false;
for (Archive_Detail detail : arList) {
String str = detail.getPdfPath();
if (StringUtils.isNoneBlank(str)) {
//病程分类先添加首次病程
if (detail.getAssortid().equals(assortId) && !flag) {
pdfList.add(strPath);
flag = true;
}
pdfList.add(str);
}
}
}else{
//只有首次病程记录的情况
pdfList.add(strPath);
}
}
Jpg2PdfUtil.mulFile2One(response, pdfList, pdfWater);

@ -80,7 +80,7 @@
</select>
<select id="selectByIdStr" parameterType="com.emr.entity.Archive_Detail" resultMap="BaseResultMap">
select
PDF_PATH
PDF_PATH,archive_detail.AssortID,archive_detail.title
from archive_detail
left join zd_assort
on zd_assort.assort_id = archive_detail.AssortID
@ -128,7 +128,7 @@
order by UpLoadDateTime
</select>
<select id="selectByCol" parameterType="com.emr.entity.Archive_Detail" resultMap="BaseResultMap">
select d.PDF_PATH
select d.PDF_PATH,d.AssortID,d.title
from archive_detail d
LEFT JOIN zd_assort z
on d.AssortID=z.assort_id

@ -101,7 +101,8 @@ function getHeight(height) {
}
//重设表格高度
function reloadTableHeight(tableId) {
$("#"+tableId+".fixed-table-container").css({ "padding-bottom": "0px", height: $("#"+tableId+".fixed-table-body table").height() + 20 });
var height = $(".fixed-table-body #"+tableId).height();
$("#"+tableId+".fixed-table-container").css({ "padding-bottom": "0px", height: height + 20 });
$('#'+tableId).bootstrapTable('resetView', { height: "auto" });
}

@ -73,7 +73,6 @@ $("#pdfBtn").click(function () {
var imgStr = "";
var zTree = $.fn.zTree.getZTreeObj("ztree");//换成实际的图层的id
var changedNodes = zTree.getChangeCheckedNodes(); //获取改变的全部结点
debugger
for (var i = 0; i < changedNodes.length; i++) {
var treeNode = changedNodes[i];
if (treeNode.id != 0) {

Loading…
Cancel
Save