潮州人医批量申请页面
parent
7df296dbd3
commit
7ee38e14d4
@ -0,0 +1,115 @@
|
||||
package com.emr.controller;
|
||||
|
||||
import com.emr.entity.BatchApply;
|
||||
import com.emr.entity.Power_User;
|
||||
import com.emr.service.batchApply.BatchApplyService;
|
||||
import com.emr.util.ExceptionPrintUtil;
|
||||
import com.emr.vo.BatchApplyVo;
|
||||
import com.emr.vo.Msg;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
import com.github.pagehelper.IPage;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName BatchApplyController
|
||||
* @Description 批量申请借阅控制层
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 15:56
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("batchApply/")
|
||||
public class BatchApplyController {
|
||||
|
||||
@Autowired
|
||||
BatchApplyService batchApplyService;
|
||||
|
||||
|
||||
@RequestMapping(value = "batchApplication")
|
||||
public String batchApply(Model model) {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||
.getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
if (user != null) {
|
||||
Integer roleId = user.getRoleId();
|
||||
if (roleId == 0 || roleId == -100) {
|
||||
model.addAttribute("createNameFlag", "0");
|
||||
}
|
||||
}
|
||||
return "batchApply/batchApply";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 查看批量借阅审批数据
|
||||
* @author linjj
|
||||
* @date: 2023/8/28 17:02
|
||||
*/
|
||||
@RequestMapping("selectBatchApply")
|
||||
@ResponseBody
|
||||
public PageInfo selectBatchApply(Integer page, Integer limit, BatchApplyVo batchApplyVo) {
|
||||
if (null != page && null != limit) {
|
||||
PageHelper.startPage(page, limit);
|
||||
}
|
||||
try {
|
||||
//查询
|
||||
List<BatchApply> list = batchApplyService.selectBatchApply(batchApplyVo);
|
||||
return new PageInfo<>(list);
|
||||
} catch (Exception e) {
|
||||
ExceptionPrintUtil.printException(e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 新增批次
|
||||
* @params: batchApplyVo
|
||||
* @return: int
|
||||
* @author linjj
|
||||
* @date: 2023/8/31 14:29
|
||||
*/
|
||||
@RequestMapping("insertBatch")
|
||||
@ResponseBody
|
||||
public int insertBatch(BatchApplyVo batchApplyVo) {
|
||||
return batchApplyService.insertBatch(batchApplyVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 修改批次
|
||||
* @params: batchApplyVo
|
||||
* @author linjj
|
||||
* @date: 2023/9/1 14:40
|
||||
*/
|
||||
@RequestMapping("updateBatch")
|
||||
@ResponseBody
|
||||
public int updateBatch(BatchApplyVo batchApplyVo) {
|
||||
return batchApplyService.updateBatch(batchApplyVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除批次
|
||||
* @params: id
|
||||
* @return: int
|
||||
* @author linjj
|
||||
* @date: 2023/9/18 15:30
|
||||
*/
|
||||
@RequestMapping("deleteById")
|
||||
@ResponseBody
|
||||
public int deleteById(int id){
|
||||
return batchApplyService.deleteById(id);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.emr.controller;
|
||||
|
||||
import com.emr.entity.BatchApplyDetails;
|
||||
import com.emr.service.BatchApplyDetails.BatchApplyDetailsService;
|
||||
import com.emr.util.ExceptionPrintUtil;
|
||||
import com.emr.vo.BatchBorrowingVo;
|
||||
import com.emr.vo.Msg;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName BatchApplyController
|
||||
* @Description 批量申请借阅控制层
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 15:56
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("applyDetails/")
|
||||
public class BatchApplyDetailsController {
|
||||
|
||||
@Autowired
|
||||
BatchApplyDetailsService batchApplyDetailsService;
|
||||
|
||||
|
||||
@RequestMapping(value = "batchApplyDetails")
|
||||
public String batchApplyDetails(Model model) {
|
||||
return "batchApply/batchApplyDetails";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 借阅详情接口
|
||||
* @params: CommomVo
|
||||
* @author linjj
|
||||
* @date: 2023/9/4 9:02
|
||||
*/
|
||||
@RequestMapping("getCommomVo")
|
||||
@ResponseBody
|
||||
public PageInfo getCommomVo(Integer page, Integer limit, CommomVo commomVo) {
|
||||
if (null != page && null != limit) {
|
||||
PageHelper.startPage(page, limit);
|
||||
}
|
||||
try {
|
||||
//查询
|
||||
List<CommomVo> list = batchApplyDetailsService.addCommomVo(commomVo);
|
||||
return new PageInfo<>(list);
|
||||
} catch (Exception e) {
|
||||
ExceptionPrintUtil.printException(e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 申请借阅列表
|
||||
* @params: batchId
|
||||
* @return: BatchApplyDetails
|
||||
* @author linjj
|
||||
* @date: 2023/9/4 15:16
|
||||
*/
|
||||
@RequestMapping("getBatchApplyDetails")
|
||||
@ResponseBody
|
||||
public PageInfo getBatchApplyDetails(Integer page, Integer limit, int batchId,String inpatientNo) {
|
||||
if (null != page && null != limit) {
|
||||
PageHelper.startPage(page, limit);
|
||||
}
|
||||
try {
|
||||
//查询
|
||||
List<BatchApplyDetails> list = batchApplyDetailsService.getBatchApplyDetails(batchId,inpatientNo);
|
||||
return new PageInfo<>(list);
|
||||
} catch (Exception e) {
|
||||
ExceptionPrintUtil.printException(e);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 批量借阅接口
|
||||
* @params: BatchBorrowingVo
|
||||
* @author linjj
|
||||
* @date: 2023/9/6 15:15
|
||||
*/
|
||||
@RequestMapping("addBatchBorrowing")
|
||||
@ResponseBody
|
||||
public Msg addBatchBorrowing(BatchBorrowingVo batchBorrowingVo) {
|
||||
if (StringUtils.isBlank(batchBorrowingVo.getPatientIds())) {
|
||||
return Msg.fail("病案主键为空");
|
||||
}
|
||||
int i = batchApplyDetailsService.addBatchBorrowing(batchBorrowingVo);
|
||||
if (i == 0) {
|
||||
return Msg.fail("批量申请保存失败");
|
||||
}
|
||||
return Msg.success("批量申请保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 删除申请记录
|
||||
* @params: id
|
||||
* @return: int
|
||||
* @author linjj
|
||||
* @date: 2023/9/18 16:38
|
||||
*/
|
||||
@RequestMapping("deleteById")
|
||||
@ResponseBody
|
||||
public int deleteById(int id,int batchId) {
|
||||
return batchApplyDetailsService.deleteById(id,batchId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 驳回申请记录
|
||||
* @params: id
|
||||
* @return: int
|
||||
* @author linjj
|
||||
* @date: 2023/9/18 16:38
|
||||
*/
|
||||
@RequestMapping("rejectById")
|
||||
@ResponseBody
|
||||
public int rejectById(int id) {
|
||||
return batchApplyDetailsService.rejectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 审批接口
|
||||
* @params:
|
||||
* @return:
|
||||
* @author linjj
|
||||
* @date: 2023/9/20 14:54
|
||||
*/
|
||||
@RequestMapping("agreeById")
|
||||
@ResponseBody
|
||||
public int agreeById(String ids) {
|
||||
return batchApplyDetailsService.agreeById(ids);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.emr.dao;
|
||||
|
||||
import com.emr.entity.BatchApplyDetails;
|
||||
import com.emr.entity.EffectiveTimeVo;
|
||||
import com.emr.vo.BatchApplyDetailsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName BatchApplyDetailsMapper
|
||||
* @Description 借阅申请列表接口
|
||||
* @Author linjj
|
||||
* @Date 2023/9/4 11:19
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface BatchApplyDetailsMapper {
|
||||
|
||||
int addBatchApplyDetails(@Param("list")List<BatchApplyDetailsVo> list);
|
||||
|
||||
List<BatchApplyDetails> getBatchApplyDetails(@Param("batchId")int batchId, @Param("inpatientNo")String inpatientNo);
|
||||
|
||||
int deleteByBatchId(int batchId);
|
||||
|
||||
int deleteById(int id);
|
||||
|
||||
|
||||
int upadteApplyDetails(BatchApplyDetailsVo batchApplyDetailsVo);
|
||||
|
||||
int upadteApplyDetailsList(@Param("list") List<BatchApplyDetailsVo> list);
|
||||
|
||||
String getEffectiveTime(@Param("ids") Integer ids,@Param("examineTimes") String examineTimes);
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
package com.emr.dao;
|
||||
|
||||
import com.emr.entity.BatchApply;
|
||||
import com.emr.vo.BatchApplyVo;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName BatchApplyMapper
|
||||
* @Description 批量借阅申请接口
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 17:13
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface BatchApplyMapper {
|
||||
|
||||
List<BatchApply> selectBatchApply(BatchApplyVo batchApplyVo);
|
||||
|
||||
int insertBatch(BatchApplyVo batchApplyVo);
|
||||
|
||||
int updateBatch(BatchApplyVo batchApplyVo);
|
||||
|
||||
|
||||
List<CommomVo> getCommomVo(CommomVo commomVo);
|
||||
|
||||
List<CommomVo> getCommomVoByPatientIds(@Param(value = "patientIds")String patientIds);
|
||||
|
||||
BatchApplyVo getBorrowingNum(int batchId);
|
||||
|
||||
int updateBorrowingNum(@Param("borrowingNum") int borrowingNum, @Param("batchId") int batchId);
|
||||
|
||||
int deleteById(int id);
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.emr.dao;
|
||||
|
||||
import com.emr.vo.PushRcvBasicDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName PushRcvBasicMaooer
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2023/9/26 11:29
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface PushRcvBasicMapper {
|
||||
|
||||
int addRcvBasic(@Param(value = "pushRcvBasicDTOList") List<PushRcvBasicDTO> pushRcvBasicDTOList);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.emr.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName effectiveTimeVo
|
||||
* @Description 有效日期计算vo
|
||||
* @Author linjj
|
||||
* @Date 2023/9/20 16:46
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class EffectiveTimeVo {
|
||||
|
||||
private int id;
|
||||
|
||||
private String effectiveTime;
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.emr.service.BatchApplyDetails;
|
||||
|
||||
import com.emr.entity.BatchApplyDetails;
|
||||
import com.emr.vo.BatchBorrowingVo;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName BatchApplyService
|
||||
* @Description 批量借阅接口
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 17:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface BatchApplyDetailsService {
|
||||
|
||||
|
||||
|
||||
List<CommomVo> addCommomVo(CommomVo commomVo) throws Exception;
|
||||
|
||||
List<BatchApplyDetails> getBatchApplyDetails(int batchId,String inpatientNo);
|
||||
|
||||
int addBatchBorrowing(BatchBorrowingVo batchBorrowingVo);
|
||||
|
||||
int deleteById(int id,int batchId);
|
||||
|
||||
int rejectById(int id);
|
||||
|
||||
int agreeById(String ids);
|
||||
}
|
||||
@ -0,0 +1,249 @@
|
||||
package com.emr.service.BatchApplyDetails;
|
||||
|
||||
import com.emr.dao.BatchApplyDetailsMapper;
|
||||
import com.emr.dao.BatchApplyMapper;
|
||||
import com.emr.dao.EmrComomSetMapper;
|
||||
import com.emr.dao.Emr_DictionaryMapper;
|
||||
import com.emr.entity.*;
|
||||
import com.emr.util.ExceptionPrintUtil;
|
||||
import com.emr.util.ListUtils;
|
||||
import com.emr.util.Setters;
|
||||
import com.emr.vo.BatchApplyDetailsVo;
|
||||
import com.emr.vo.BatchApplyVo;
|
||||
import com.emr.vo.BatchBorrowingVo;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName BatchApplyServiceImpl
|
||||
* @Description 批量借阅实现类
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 17:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class BatchApplyDetailsServiceImpl implements BatchApplyDetailsService {
|
||||
@Autowired
|
||||
BatchApplyMapper batchApplyMapper;
|
||||
@Autowired
|
||||
Emr_DictionaryMapper emrDictionaryMapper;
|
||||
@Autowired
|
||||
BatchApplyDetailsMapper batchApplyDetailsMapper;
|
||||
@Autowired
|
||||
EmrComomSetMapper emrComomSetMapper;
|
||||
|
||||
@Override
|
||||
public List<CommomVo> addCommomVo(CommomVo commomVo) {
|
||||
List<CommomVo> list = batchApplyMapper.getCommomVo(commomVo);
|
||||
//转换科室
|
||||
convertDepartment(list);
|
||||
//当查询集合中只有一条记录时直接插入申请列表
|
||||
if (commomVo.getRefreshTable() == 1) {
|
||||
addApplyDetails(list, commomVo.getBatchId(),commomVo.getApplyName());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BatchApplyDetails> getBatchApplyDetails(int batchId,String inpatientNo) {
|
||||
//获取系统当前时间
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String format = fmt.format(new Date());
|
||||
List<BatchApplyDetails> batchApplyDetails = batchApplyDetailsMapper.getBatchApplyDetails(batchId,inpatientNo);
|
||||
for (BatchApplyDetails list : batchApplyDetails) {
|
||||
//判断是否过期如果过期状态为4
|
||||
String effectiveTime = list.getEffectiveTime();
|
||||
if (StringUtils.isNotBlank(effectiveTime) ) {
|
||||
if ((effectiveTime.compareTo(format)) == -1) {
|
||||
list.setApplyStatc(4);
|
||||
}
|
||||
}
|
||||
}
|
||||
return batchApplyDetails;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addBatchBorrowing(BatchBorrowingVo batchBorrowingVo) {
|
||||
//查询患者基础数据
|
||||
List<CommomVo> commomList = batchApplyMapper.getCommomVoByPatientIds(batchBorrowingVo.getPatientIds());
|
||||
return addApplyDetailsList(commomList, batchBorrowingVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteById(int id,int batchId) {
|
||||
//更新批次数量
|
||||
delBorrowingNum(batchId);
|
||||
return batchApplyDetailsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int rejectById(int id) {
|
||||
//获取系统当前时间
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//获取登录用户信息
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
BatchApplyDetailsVo batchApplyDetailsVo = new BatchApplyDetailsVo();
|
||||
batchApplyDetailsVo.setExamineName(user.getUserPosition());
|
||||
batchApplyDetailsVo.setExamineTime(fmt.format(new Date()));
|
||||
batchApplyDetailsVo.setId(id);
|
||||
batchApplyDetailsVo.setApplyStatc(3);
|
||||
return batchApplyDetailsMapper.upadteApplyDetails(batchApplyDetailsVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int agreeById(String ids) {
|
||||
//获取系统当前时间
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//获取登录用户信息
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
//声明一个BatchApplyDetailsVo对象
|
||||
BatchApplyDetailsVo batchApplyDetailsVo = new BatchApplyDetailsVo();
|
||||
//声明一个BatchApplyDetailsVo集合
|
||||
List<BatchApplyDetailsVo> list = Collections.synchronizedList(new ArrayList<>());
|
||||
//将字符串转为List<String>在转成List<Integer>
|
||||
List<Integer> idsList = Arrays.asList(ids.split(",")).stream().mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
|
||||
//遍历审核信息
|
||||
for (Integer id : idsList) {
|
||||
batchApplyDetailsVo.setExamineName(user.getUserPosition());
|
||||
batchApplyDetailsVo.setExamineTime(fmt.format(new Date()));
|
||||
batchApplyDetailsVo.setApplyStatc(1);
|
||||
batchApplyDetailsVo.setId(id);
|
||||
list.add(batchApplyDetailsVo);
|
||||
}
|
||||
//给有效时间赋值
|
||||
upDateEffectiveTimeList(list);
|
||||
return batchApplyDetailsMapper.upadteApplyDetailsList(list);
|
||||
}
|
||||
|
||||
|
||||
private void upDateEffectiveTimeList(List<BatchApplyDetailsVo> batchApplyDetailsVolist) {
|
||||
for (BatchApplyDetailsVo list : batchApplyDetailsVolist) {
|
||||
String effectiveTime = batchApplyDetailsMapper.getEffectiveTime(list.getId(), list.getExamineTime());
|
||||
list.setEffectiveTime(effectiveTime);
|
||||
}
|
||||
}
|
||||
|
||||
private int addApplyDetailsList(List<CommomVo> commomList, BatchBorrowingVo batchBorrowingVo) {
|
||||
//获取系统当前时间
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//获取登录用户信息
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
List<BatchApplyDetailsVo> list = Collections.synchronizedList(new ArrayList<>());
|
||||
for (CommomVo commomInfoList : commomList) {
|
||||
//插入申请借阅详情集合
|
||||
BatchApplyDetailsVo batchApplyDetailsVo = new BatchApplyDetailsVo();
|
||||
batchApplyDetailsVo.setBatchId(batchBorrowingVo.getBatchId());
|
||||
batchApplyDetailsVo.setApplyName(batchBorrowingVo.getApplyName());
|
||||
batchApplyDetailsVo.setApplyDate(user.getRemark());
|
||||
batchApplyDetailsVo.setApplyTime(fmt.format(new Date()));
|
||||
batchApplyDetailsVo.setEffectiveDay(batchBorrowingVo.getEffectiveDay());
|
||||
batchApplyDetailsVo.setInpatientNo(commomInfoList.getInpatientNo());
|
||||
batchApplyDetailsVo.setAdmissTimes(commomInfoList.getAdmissTimes());
|
||||
batchApplyDetailsVo.setPatientName(commomInfoList.getName());
|
||||
batchApplyDetailsVo.setDisTime(commomInfoList.getDisDate());
|
||||
batchApplyDetailsVo.setApplyReason(batchBorrowingVo.getApplyReason());
|
||||
batchApplyDetailsVo.setApplyFlag(batchBorrowingVo.getApplyFlag());
|
||||
batchApplyDetailsVo.setApplyStatc(2);
|
||||
batchApplyDetailsVo.setHandlingName(user.getUserName());
|
||||
//将对象传入集合
|
||||
list.add(batchApplyDetailsVo);
|
||||
}
|
||||
//同步数量
|
||||
updateNum(batchBorrowingVo.getBatchId(), list.size());
|
||||
return batchApplyDetailsMapper.addBatchApplyDetails(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 转换科室方法
|
||||
* @author linjj
|
||||
* @date: 2023/9/4 14:18
|
||||
*/
|
||||
private void convertDepartment(List<CommomVo> list) {
|
||||
//获取科室列表
|
||||
List<Emr_Dictionary> dicList = emrDictionaryMapper.selectDictionaryByTypeCode("dept_code");
|
||||
//转换科室
|
||||
Map<String, Emr_Dictionary> codeMap = ListUtils.toMap(dicList, Emr_Dictionary::getCode);
|
||||
Setters.<CommomVo>instance().list(list).cycleSetProperties(p -> {
|
||||
String deptCode = p.getDisDept();
|
||||
if (StringUtils.isNotBlank(deptCode) && codeMap.containsKey(deptCode)) {
|
||||
String deptName = codeMap.get(deptCode).getName();
|
||||
p.setDisDept(deptName);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void addApplyDetails(List<CommomVo> list, int batchId,String ApplyName) {
|
||||
//获取系统设置的默认参数
|
||||
EmrComomSet emrComomSet = emrComomSetMapper.selectByPrimaryKey(1);
|
||||
//获取登录用户信息
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
if (list.size() == 1) {
|
||||
BatchApplyDetailsVo batchApplyDetailsVo = new BatchApplyDetailsVo();
|
||||
batchApplyDetailsVo.setBatchId(batchId);
|
||||
batchApplyDetailsVo.setApplyName(ApplyName);
|
||||
batchApplyDetailsVo.setApplyDate(user.getRemark());
|
||||
//获取系统当前时间
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
batchApplyDetailsVo.setApplyTime(fmt.format(new Date()));
|
||||
batchApplyDetailsVo.setEffectiveDay(emrComomSet.getDefaultDay());
|
||||
batchApplyDetailsVo.setInpatientNo(list.get(0).getInpatientNo());
|
||||
batchApplyDetailsVo.setAdmissTimes(list.get(0).getAdmissTimes());
|
||||
batchApplyDetailsVo.setPatientName(list.get(0).getName());
|
||||
batchApplyDetailsVo.setHandlingName(user.getUserName());
|
||||
batchApplyDetailsVo.setDisTime(list.get(0).getDisDate());
|
||||
batchApplyDetailsVo.setApplyReason("需要借阅这份病历");
|
||||
batchApplyDetailsVo.setApplyFlag(1);
|
||||
batchApplyDetailsVo.setApplyStatc(2);
|
||||
List<BatchApplyDetailsVo> batchApplyDetailsList = Arrays.asList(batchApplyDetailsVo);
|
||||
batchApplyDetailsMapper.addBatchApplyDetails(batchApplyDetailsList);
|
||||
//新增时同步批次数量先获取原先数量
|
||||
updateBorrowingNum(batchId);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateBorrowingNum(int batchId) {
|
||||
BatchApplyVo batchApplyVo = batchApplyMapper.getBorrowingNum(batchId);
|
||||
Integer borrowingNum = batchApplyVo.getBorrowingNum();
|
||||
int i = borrowingNum + 1;
|
||||
batchApplyMapper.updateBorrowingNum(i, batchId);
|
||||
}
|
||||
|
||||
|
||||
private void delBorrowingNum(int batchId) {
|
||||
BatchApplyVo batchApplyVo = batchApplyMapper.getBorrowingNum(batchId);
|
||||
Integer borrowingNum = batchApplyVo.getBorrowingNum();
|
||||
int i = borrowingNum - 1;
|
||||
batchApplyMapper.updateBorrowingNum(i, batchId);
|
||||
}
|
||||
|
||||
|
||||
private void updateNum(int batchId, int listNum) {
|
||||
BatchApplyVo batchApplyVo = batchApplyMapper.getBorrowingNum(batchId);
|
||||
Integer borrowingNum = batchApplyVo.getBorrowingNum();
|
||||
int i = borrowingNum + listNum;
|
||||
batchApplyMapper.updateBorrowingNum(i, batchId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.emr.service.batchApply;
|
||||
|
||||
import com.emr.entity.BatchApply;
|
||||
import com.emr.vo.BatchApplyVo;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName BatchApplyService
|
||||
* @Description 批量借阅接口
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 17:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface BatchApplyService {
|
||||
|
||||
List<BatchApply> selectBatchApply(BatchApplyVo batchApplyVo);
|
||||
|
||||
int insertBatch(BatchApplyVo batchApplyVo);
|
||||
|
||||
int updateBatch(BatchApplyVo batchApplyVo);
|
||||
|
||||
int deleteById(int id);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package com.emr.service.batchApply;
|
||||
|
||||
import com.emr.dao.BatchApplyDetailsMapper;
|
||||
import com.emr.dao.BatchApplyMapper;
|
||||
import com.emr.dao.Emr_DictionaryMapper;
|
||||
import com.emr.entity.BatchApply;
|
||||
import com.emr.entity.BatchApplyDetails;
|
||||
import com.emr.entity.Emr_Dictionary;
|
||||
import com.emr.entity.Power_User;
|
||||
import com.emr.util.ListUtils;
|
||||
import com.emr.util.Setters;
|
||||
import com.emr.vo.BatchApplyDetailsVo;
|
||||
import com.emr.vo.BatchApplyVo;
|
||||
import com.emr.vo.commomSearch.CommomVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName BatchApplyServiceImpl
|
||||
* @Description 批量借阅实现类
|
||||
* @Author linjj
|
||||
* @Date 2023/8/28 17:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class BatchApplyServiceImpl implements BatchApplyService {
|
||||
@Autowired
|
||||
BatchApplyMapper batchApplyMapper;
|
||||
@Autowired
|
||||
Emr_DictionaryMapper emrDictionaryMapper;
|
||||
@Autowired
|
||||
BatchApplyDetailsMapper batchApplyDetailsMapper;
|
||||
@Override
|
||||
public List<BatchApply> selectBatchApply(BatchApplyVo batchApplyVo) {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||
.getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
if (user != null) {
|
||||
Integer roleId = user.getRoleId();
|
||||
if (roleId != 0 || roleId != -100) {
|
||||
batchApplyVo.setCreateName(user.getUserName());
|
||||
}
|
||||
}
|
||||
return batchApplyMapper.selectBatchApply(batchApplyVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBatch(BatchApplyVo batchApplyVo) {
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes())
|
||||
.getRequest();
|
||||
// 从session获取用户名
|
||||
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
||||
if (user != null) {
|
||||
//初始化批量申请
|
||||
String username = user.getUserName();
|
||||
batchApplyVo.setCreateName(username);
|
||||
batchApplyVo.setStatc(0);
|
||||
batchApplyVo.setReadNum(0);
|
||||
batchApplyVo.setBorrowingNum(0);
|
||||
//获取系统当前时间
|
||||
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
|
||||
batchApplyVo.setCreateDate(fmt.format(new Date()));
|
||||
}
|
||||
return batchApplyMapper.insertBatch(batchApplyVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBatch(BatchApplyVo batchApplyVo) {
|
||||
return batchApplyMapper.updateBatch(batchApplyVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteById(int id) {
|
||||
batchApplyDetailsMapper.deleteByBatchId(id);
|
||||
return batchApplyMapper.deleteById(id);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.emr.service.pushRcvBasic;
|
||||
|
||||
import com.emr.vo.Msg;
|
||||
import com.emr.vo.PushRcvBasicDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @InterfaceName PushRcvBasicService
|
||||
* @Description 病案回收
|
||||
* @Author linjj
|
||||
* @Date 2023/9/26 11:28
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface PushRcvBasicService {
|
||||
|
||||
int addRcvBasic(List<PushRcvBasicDTO> pushRcvBasicDTOList);
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package com.emr.service.pushRcvBasic;
|
||||
|
||||
import com.emr.dao.PushRcvBasicMapper;
|
||||
import com.emr.vo.PushRcvBasicDTO;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName PushRcvBasicServiceImpl
|
||||
* @Description 病案回收
|
||||
* @Author linjj
|
||||
* @Date 2023/9/26 11:28
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional
|
||||
public class PushRcvBasicServiceImpl implements PushRcvBasicService {
|
||||
@Autowired
|
||||
PushRcvBasicMapper pushRcvBasicMapper;
|
||||
@Override
|
||||
public int addRcvBasic(List<PushRcvBasicDTO> pushRcvBasicDTOList) {
|
||||
return pushRcvBasicMapper.addRcvBasic(pushRcvBasicDTOList);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.emr.util;
|
||||
|
||||
/**
|
||||
* @InterfaceName FieldSelector
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2023/6/29 16:41
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface FieldSelector<Type, FieldType> {
|
||||
FieldType select(Type type);
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.emr.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ListPropertySetter<T> {
|
||||
|
||||
private final List<T> values;
|
||||
|
||||
public ListPropertySetter(List<T> values) {
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public List<T> cycleSetProperties(PropertySetter<T> setter) {
|
||||
|
||||
if (null == values) return values;
|
||||
|
||||
for (T value : values) {
|
||||
setter.apply(value);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.emr.util;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public final class ListUtils {
|
||||
public static <T, K> Map<K, T> toMap(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
|
||||
Map<K, T> map = new HashMap<>(list.size());
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key != null) map.put(key, t);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static <T, K> Map<K, List<T>> groupBy(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyMap();
|
||||
Map<K, List<T>> map = new HashMap<>();
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key == null) continue;
|
||||
if (!map.containsKey(key)) {
|
||||
map.put(key, new ArrayList<T>());
|
||||
}
|
||||
map.get(key).add(t);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static <T, K> List<K> select(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
List<K> filedList = new ArrayList<>(list.size());
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key != null) filedList.add(key);
|
||||
}
|
||||
return filedList;
|
||||
}
|
||||
|
||||
public static <T, K> List<K> distinctSelect(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
Set<K> filedSet = new HashSet<>();
|
||||
for (T t : list) {
|
||||
K key = selector.select(t);
|
||||
if (key != null) filedSet.add(key);
|
||||
}
|
||||
return new ArrayList<>(filedSet);
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
public static <T> List<T> unionWithoutDuplicate(List<T>... values) {
|
||||
if (null == values || values.length <= 0) return Collections.emptyList();
|
||||
Set<T> unionFiledSet = new HashSet<>();
|
||||
for (List<T> value : values) {
|
||||
if (!CollectionUtils.isEmpty(value)) {
|
||||
unionFiledSet.addAll(value);
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(unionFiledSet);
|
||||
}
|
||||
|
||||
public static <T, K> List<T> skipDuplicateKey(List<T> list, FieldSelector<T, K> selector) {
|
||||
if (CollectionUtils.isEmpty(list)) return Collections.emptyList();
|
||||
List<T> filedList = new ArrayList<>(list.size());
|
||||
Map<K, T> map = toMap(list, selector);
|
||||
for (K key : map.keySet()) {
|
||||
filedList.add(map.get(key));
|
||||
}
|
||||
return filedList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.emr.util;
|
||||
|
||||
public interface PropertySetter<T> {
|
||||
|
||||
void apply(T t);
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.emr.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Setters<T> {
|
||||
|
||||
public static <T> Setters<T> instance() {
|
||||
return new Setters<>();
|
||||
}
|
||||
|
||||
public ListPropertySetter<T> list(List<T> values) {
|
||||
return new ListPropertySetter<>(values);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package com.emr.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName picListVo
|
||||
* @Description 珠海妇幼返回图片信息实体
|
||||
* @Author linjj
|
||||
* @Date 2023/9/8 10:48
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class PicListVo {
|
||||
|
||||
//图片路径
|
||||
private String picUrl;
|
||||
|
||||
|
||||
//分段id
|
||||
private String assortId;
|
||||
|
||||
|
||||
//分段名称
|
||||
private String assortName;
|
||||
|
||||
}
|
||||
@ -0,0 +1,81 @@
|
||||
package com.emr.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class PushRcvBasicDTO {
|
||||
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
private String patientId;
|
||||
|
||||
|
||||
private Integer admissTimes;
|
||||
|
||||
|
||||
private String inpatientNo;
|
||||
|
||||
|
||||
private String jzh;
|
||||
|
||||
|
||||
private String admissId;
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
private String serialNumber;
|
||||
|
||||
|
||||
private Date admissDate;
|
||||
|
||||
|
||||
private String admissDept;
|
||||
|
||||
|
||||
private String admissDeptName;
|
||||
|
||||
|
||||
private Date disDate;
|
||||
|
||||
|
||||
private String disDept;
|
||||
|
||||
|
||||
private String disDeptName;
|
||||
|
||||
|
||||
private Integer admissDays;
|
||||
|
||||
|
||||
private String attendingName;
|
||||
|
||||
|
||||
private Integer fileSource;
|
||||
|
||||
|
||||
private RecoveryStateEnum recoveryState;
|
||||
|
||||
|
||||
private PushStateEnum pushState;
|
||||
|
||||
|
||||
private Date revoveryTime;
|
||||
|
||||
|
||||
private String revoveryUser;
|
||||
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.emr.vo;
|
||||
|
||||
|
||||
/**
|
||||
* 回收状态
|
||||
*/
|
||||
public enum PushStateEnum {
|
||||
PUSH_WAITING(0, "待发布"),
|
||||
PUSH_ALREADY(1, "已发布");
|
||||
|
||||
private Integer value;
|
||||
private String display;
|
||||
|
||||
PushStateEnum(Integer value, String display) {
|
||||
this.value = value;
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package com.emr.vo;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 患者信息表
|
||||
*
|
||||
* @author AutoGenerator
|
||||
* @since 2023-09-13
|
||||
*/
|
||||
@Data
|
||||
public class RcvBasic implements Serializable {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
private String patientId;
|
||||
|
||||
|
||||
private Integer admissTimes;
|
||||
|
||||
|
||||
private String inpatientNo;
|
||||
|
||||
|
||||
private String jzh;
|
||||
|
||||
|
||||
private String admissId;
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
private String serialNumber;
|
||||
|
||||
|
||||
private Date admissDate;
|
||||
|
||||
|
||||
private String admissDept;
|
||||
|
||||
|
||||
private String admissDeptName;
|
||||
|
||||
|
||||
private Date disDate;
|
||||
|
||||
|
||||
private String disDept;
|
||||
|
||||
|
||||
private String disDeptName;
|
||||
|
||||
|
||||
private Integer admissDays;
|
||||
|
||||
|
||||
private String attendingName;
|
||||
|
||||
|
||||
private Integer fileSource;
|
||||
|
||||
|
||||
private RecoveryStateEnum recoveryState;
|
||||
|
||||
|
||||
private PushStateEnum pushState;
|
||||
|
||||
|
||||
private Date revoveryTime;
|
||||
|
||||
|
||||
private String revoveryUser;
|
||||
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.emr.vo;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 回收状态
|
||||
*/
|
||||
public enum RecoveryStateEnum {
|
||||
RECYCLED_WAITING(0, "待回收"),
|
||||
RECYCLED_ALREADY(1, "已回收");
|
||||
|
||||
private Integer value;
|
||||
private String display;
|
||||
|
||||
RecoveryStateEnum(Integer value, String display) {
|
||||
this.value = value;
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.emr.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ZhFyimageVo
|
||||
* @Description 珠海妇幼接口返回实体
|
||||
* @Author linjj
|
||||
* @Date 2023/9/8 10:46
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ZhFyImageVo {
|
||||
|
||||
//住院号
|
||||
private String inpatientNo;
|
||||
//住院次数
|
||||
private int admissTimes;
|
||||
|
||||
//出院时间
|
||||
private String disDate;
|
||||
//图片信息集合
|
||||
private List<PicListVo> picList;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.emr.dao.BatchApplyDetailsMapper">
|
||||
|
||||
<insert id="addBatchApplyDetails" parameterType="java.util.List">
|
||||
insert into batch_apply_details (batch_id,apply_name,apply_time,apply_reason,apply_flag,
|
||||
apply_date,apply_statc,dis_time,effective_day,patient_name,inpatient_no,admiss_times,handling_name
|
||||
)
|
||||
values
|
||||
<foreach collection="list" item="item" separator=",">(#{item.batchId},#{item.applyName},#{item.applyTime},
|
||||
#{item.applyReason},#{item.applyFlag},#{item.applyDate},#{item.applyStatc},
|
||||
#{item.disTime},#{item.effectiveDay},#{item.patientName},#{item.inpatientNo},#{item.admissTimes},#{item.handlingName}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="upadteApplyDetails">
|
||||
update batch_apply_details
|
||||
<set>
|
||||
<if test="effectiveTime != null">
|
||||
effective_time = #{effectiveTime},
|
||||
</if>
|
||||
<if test="handlingName != null">
|
||||
handling_name = #{handlingName},
|
||||
</if>
|
||||
<if test="examineName != null">
|
||||
examine_name = #{examineName},
|
||||
</if>
|
||||
<if test="examineTime != null">
|
||||
examine_time = #{examineTime},
|
||||
</if>
|
||||
<if test="applyStatc != null">
|
||||
apply_statc=#{applyStatc},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<update id="upadteApplyDetailsList">
|
||||
<foreach collection="list" item="item" index="index" separator=";">
|
||||
UPDATE batch_apply_details
|
||||
<set>
|
||||
<if test="item.effectiveTime != null and item.effectiveTime != ''" >
|
||||
effective_time = #{item.effectiveTime},
|
||||
</if>
|
||||
<if test="item.handlingName != null" >
|
||||
handling_name = #{item.handlingName},
|
||||
</if>
|
||||
<if test="item.examineName != null" >
|
||||
examine_name = #{item.examineName},
|
||||
</if>
|
||||
<if test="item.examineTime != null" >
|
||||
examine_time = #{item.examineTime},
|
||||
</if>
|
||||
<if test="item.applyStatc != null" >
|
||||
apply_statc = #{item.applyStatc},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- <update id="upadteApplyDetailsList">-->
|
||||
<!-- UPDATE batch_apply_details-->
|
||||
<!-- <set>-->
|
||||
<!-- <if test="effectiveTime != null and effectiveTime != ''">-->
|
||||
<!-- effective_time = #{item.effectiveTime},-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="handlingName != null">-->
|
||||
<!-- handling_name = #{handlingName},-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="examineName != null">-->
|
||||
<!-- examine_name = #{examineName},-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="examineTime != null">-->
|
||||
<!-- examine_time = #{examineTime},-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="applyStatc != null">-->
|
||||
<!-- apply_statc = #{applyStatc},-->
|
||||
<!-- </if>-->
|
||||
<!-- </set>-->
|
||||
<!-- where id = #{id}-->
|
||||
<!-- </update>-->
|
||||
|
||||
<delete id="deleteByBatchId">
|
||||
delete from batch_apply_details where batch_id=#{batchId}
|
||||
</delete>
|
||||
<delete id="deleteById">
|
||||
delete from batch_apply_details where id=#{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="getEffectiveTime" resultType="java.lang.String">
|
||||
SELECT MAX(b.date) effectiveTime
|
||||
FROM (SELECT TOP(SELECT effective_day FROM batch_apply_details WHERE id = #{ids} ) DATE
|
||||
FROM emr_holiday_set
|
||||
WHERE DATE > #{examineTimes} AND flag = 1) b
|
||||
</select>
|
||||
<select id="getBatchApplyDetails" resultType="com.emr.entity.BatchApplyDetails">
|
||||
select * from batch_apply_details
|
||||
<where> 1=1
|
||||
<if test="batchId !=null and batchId != ''">
|
||||
and batch_id=#{batchId}
|
||||
</if>
|
||||
<if test="inpatientNo != null and inpatientNo != ''">
|
||||
and inpatient_no=#{inpatientNo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.emr.dao.BatchApplyMapper">
|
||||
<insert id="insertBatch">
|
||||
insert into batch_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="batchName != null" >
|
||||
batch_name,
|
||||
</if>
|
||||
<if test="borrowingNum != null" >
|
||||
borrowing_num,
|
||||
</if>
|
||||
<if test="statc != null" >
|
||||
statc,
|
||||
</if>
|
||||
<if test="readNum != null" >
|
||||
read_num,
|
||||
</if>
|
||||
<if test="createName != null" >
|
||||
create_name,
|
||||
</if>
|
||||
<if test="createDate != null" >
|
||||
create_date,
|
||||
</if>
|
||||
<if test="applyName != null" >
|
||||
apply_name,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="batchName != null" >
|
||||
#{batchName},
|
||||
</if>
|
||||
<if test="borrowingNum != null" >
|
||||
#{borrowingNum},
|
||||
</if>
|
||||
<if test="statc != null" >
|
||||
#{statc},
|
||||
</if>
|
||||
<if test="readNum != null" >
|
||||
#{readNum},
|
||||
</if>
|
||||
<if test="createName != null" >
|
||||
#{createName},
|
||||
</if>
|
||||
<if test="createDate != null" >
|
||||
#{createDate},
|
||||
</if>
|
||||
<if test="applyName != null" >
|
||||
#{applyName},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateBatch">
|
||||
update batch_apply set batch_name=#{batchName} where id=#{id}
|
||||
</update>
|
||||
<update id="updateBorrowingNum">
|
||||
update batch_apply set borrowing_num=#{borrowingNum} where id=#{batchId}
|
||||
</update>
|
||||
<delete id="deleteById">
|
||||
DELETE FROM batch_apply WHERE id =#{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectBatchApply" resultType="com.emr.entity.BatchApply">
|
||||
select * from batch_apply
|
||||
<where> 1=1
|
||||
<if test="batchName != null and batchName != ''">
|
||||
and batch_name=#{batchName}
|
||||
</if>
|
||||
<if test="createName != null and createName != ''">
|
||||
AND create_name=#{createName}
|
||||
</if>
|
||||
<if test="startTime1 != null and startTime1 != ''">
|
||||
AND create_date > #{startTime1}
|
||||
</if>
|
||||
<if test="endTime1 != null and endTime1 != ''">
|
||||
AND create_date < #{endTime1}
|
||||
</if>
|
||||
</where>
|
||||
order by create_date DESC
|
||||
</select>
|
||||
<select id="getCommomVo" resultType="com.emr.vo.commomSearch.CommomVo">
|
||||
select patient_id,inpatient_no,admiss_times,dis_dept,dis_date,name from commomtable
|
||||
<where> 1=1
|
||||
<if test="inpatientNo != null and inpatientNo != ''">
|
||||
and inpatient_no=#{inpatientNo}
|
||||
</if>
|
||||
<if test="admissTimes != null and admissTimes != ''">
|
||||
and admiss_times=#{admissTimes}
|
||||
</if>
|
||||
<if test="disDept != null and disDept != ''">
|
||||
and dis_dept=#{disDept}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
AND dis_date > #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND dis_date < #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getBorrowingNum" resultType="com.emr.vo.BatchApplyVo">
|
||||
select borrowing_num from batch_apply where id=#{batchId}
|
||||
</select>
|
||||
<select id="getCommomVoByPatientIds" resultType="com.emr.vo.commomSearch.CommomVo">
|
||||
select patient_id,inpatient_no,admiss_times,dis_dept,dis_date,name from commomtable
|
||||
WHERE
|
||||
patient_id in
|
||||
<foreach item="item" collection="patientIds.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.emr.dao.PushRcvBasicMapper">
|
||||
|
||||
|
||||
<insert id="addRcvBasic">
|
||||
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -0,0 +1,235 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<c:set var="path" value="${pageContext.request.contextPath}"/>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>批量申请借阅</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.mainDiv {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.modal-header2 {
|
||||
height: 30px;
|
||||
text-align: center !important;
|
||||
vertical-align: middle !important;
|
||||
background-color: #3c8dbc !important;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding: 5px 5px 5px 5px !important;
|
||||
}
|
||||
|
||||
/**搜索区*/
|
||||
.searchDiv {
|
||||
padding-top: 1%;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.searchDiv1 {
|
||||
padding-top: 2%;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.tableDiv {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-left: 1%;
|
||||
}
|
||||
|
||||
.dateSearchDiv {
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
.dateSearchInput {
|
||||
width: 30%;
|
||||
margin-left: 3%;
|
||||
}
|
||||
|
||||
.dateLabelDiv {
|
||||
width: 30%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.searchInput {
|
||||
width: 22%;
|
||||
}
|
||||
|
||||
.searchElement {
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.searchInputElement {
|
||||
width: 60%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.labelDiv {
|
||||
padding-top: 4%;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
/**查询按钮组*/
|
||||
.btnsDiv {
|
||||
height: 5%;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 5px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/**批准驳回按钮组*/
|
||||
.approveBtns {
|
||||
margin-left: 110px;
|
||||
}
|
||||
|
||||
/*模态框头*/
|
||||
.modal-header {
|
||||
background-color: #199ED8;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="headDiv">
|
||||
<div class="headSpanDiv">
|
||||
<span class="headspan">
|
||||
批量申请借阅
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mainDiv">
|
||||
<!--搜索区-->
|
||||
<div class="searchDiv">
|
||||
<div class="searchInput left" style="margin-left: 10px;">
|
||||
<div class="searchElement left">
|
||||
<label class="labelDiv">批次名称:</label>
|
||||
</div>
|
||||
<div class="searchInputElement left">
|
||||
<input type="test" class="form-control input-sm" id="batchName" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${createNameFlag == '0'}">
|
||||
<div class="searchInput left" style="margin-left: 10px;">
|
||||
<div class="searchElement left">
|
||||
<label class="labelDiv">创建人:</label>
|
||||
</div>
|
||||
<div class="searchInputElement left">
|
||||
<input type="test" class="form-control input-sm" id="createName" maxlength="16">
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<div class="dateSearchDiv left">
|
||||
<div class="dateLabelDiv left">
|
||||
<label class="labelDiv">创建日期:</label>
|
||||
</div>
|
||||
<div class="dateSearchInput left">
|
||||
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
<div class="dateSearchInput left">
|
||||
<input type="text" class="form-control input-sm" id="endTime1" placeholder="结束时间"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnsDiv">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="empty()">清空</button>
|
||||
<button class="btn btn-sm btn-warning btns" data-toggle="modal" data-target="#myModal">新增批次</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tableDiv" class="table-responsive tableDiv">
|
||||
<table id="mytab" class="table text-nowrap table-bordered">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%--新增批次弹窗--%>
|
||||
<div class="modal fade" id="myModal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
<font size="30">×</font>
|
||||
</button>
|
||||
<h4 class="modal-title" style="font-weight: bold">
|
||||
新增批次
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="batchName" class="col-form-label">批次名称:</label>
|
||||
<input type="text" autofocus class="form-control" id="batchNotes">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="batchName" class="col-form-label">申请人工号:</label>
|
||||
<input type="text" autofocus class="form-control" id="applyName">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" onclick="insertBatch()">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%--修改批次弹窗--%>
|
||||
<div class="modal fade" id="myModal1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
<font size="30">×</font>
|
||||
</button>
|
||||
<h4 class="modal-title" style="font-weight: bold">
|
||||
修改批次
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="batchName" class="col-form-label">批次名称:</label>
|
||||
<input type="text" autofocus class="form-control" id="updateId" style="display: none" >
|
||||
<input type="text" autofocus class="form-control" id="updateBatchName" >
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" onclick="saveBatch()">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="${path}/static/js/batchApply/batchApply.js?t=2021-08-20"></script>
|
||||
<script src="${path}/static/js/commom.js"></script>
|
||||
<script src="${path}/static/js/approveManage/approveList/approveDateCommmomMethod.js"></script>
|
||||
<script src="${path}/static/js/dateUtil.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue