|
|
|
@ -426,10 +426,13 @@ public class ApproveController {
|
|
|
|
PageHelper.startPage(page, limit);
|
|
|
|
PageHelper.startPage(page, limit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
List<Emr_Apply_Approve> approves = applyApproveService.selectAllApproveByCreater(approve,
|
|
|
|
|
|
|
|
startTime1, endTime1,null,null,request);
|
|
|
|
|
|
|
|
//匹配权限
|
|
|
|
//匹配权限
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
|
|
|
List<User> userList = commomService.getUserList(user.getUserName(), request);
|
|
|
|
|
|
|
|
//查询条件用户名转姓名
|
|
|
|
|
|
|
|
setSearchApplyerAndApprover(approve,userList);
|
|
|
|
|
|
|
|
List<Emr_Apply_Approve> approves = applyApproveService.selectAllApproveByCreater(approve,
|
|
|
|
|
|
|
|
startTime1, endTime1,null,null,request);
|
|
|
|
if(null != approves && !approves.isEmpty()){
|
|
|
|
if(null != approves && !approves.isEmpty()){
|
|
|
|
Set<String> menus = user.getMenus();
|
|
|
|
Set<String> menus = user.getMenus();
|
|
|
|
if(null != menus && !menus.isEmpty()){
|
|
|
|
if(null != menus && !menus.isEmpty()){
|
|
|
|
@ -454,7 +457,6 @@ public class ApproveController {
|
|
|
|
obj.setUpdateOper(updateOper);
|
|
|
|
obj.setUpdateOper(updateOper);
|
|
|
|
obj.setDeleteOper(deleteOper);
|
|
|
|
obj.setDeleteOper(deleteOper);
|
|
|
|
//转换用户名
|
|
|
|
//转换用户名
|
|
|
|
List<User> userList = commomService.getUserList(user.getUserName(), request);
|
|
|
|
|
|
|
|
//获取申请者工号
|
|
|
|
//获取申请者工号
|
|
|
|
String applyer = obj.getApplyer();
|
|
|
|
String applyer = obj.getApplyer();
|
|
|
|
if(!CollectionUtils.isEmpty(userList)){
|
|
|
|
if(!CollectionUtils.isEmpty(userList)){
|
|
|
|
@ -555,10 +557,15 @@ public class ApproveController {
|
|
|
|
String fieldCns = "applyer,applyTime,effeTime,effeDays,name,inpatientNo,admissTimes,disTime,applyReason,applyType,applyState,approveState,approveNotes";
|
|
|
|
String fieldCns = "applyer,applyTime,effeTime,effeDays,name,inpatientNo,admissTimes,disTime,applyReason,applyType,applyState,approveState,approveNotes";
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
List<Emr_Apply_Approve> approves = new ArrayList<>();
|
|
|
|
List<Emr_Apply_Approve> approves = new ArrayList<>();
|
|
|
|
|
|
|
|
//匹配权限
|
|
|
|
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
|
|
|
List<User> userList = commomService.getUserList(user.getUserName(), request);
|
|
|
|
//构造excel的数据
|
|
|
|
//构造excel的数据
|
|
|
|
if(StringUtils.isNotBlank(checks)){
|
|
|
|
if(StringUtils.isNotBlank(checks)){
|
|
|
|
approves = applyApproveMapper.selectAllByIds(checks);
|
|
|
|
approves = applyApproveMapper.selectAllByIds(checks);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
|
|
|
|
//查询条件用户名转姓名
|
|
|
|
|
|
|
|
setSearchApplyerAndApprover(approve,userList);
|
|
|
|
approves = applyApproveService.selectAllApproveByCreater(approve, startTime, endTime,null,null,request);
|
|
|
|
approves = applyApproveService.selectAllApproveByCreater(approve, startTime, endTime,null,null,request);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(null != approves && !approves.isEmpty()){
|
|
|
|
if(null != approves && !approves.isEmpty()){
|
|
|
|
@ -566,6 +573,17 @@ public class ApproveController {
|
|
|
|
for (Emr_Apply_Approve obj : approves) {
|
|
|
|
for (Emr_Apply_Approve obj : approves) {
|
|
|
|
if(null != obj.getDisDate()){
|
|
|
|
if(null != obj.getDisDate()){
|
|
|
|
obj.setDisTime(fmt.format(obj.getDisDate()));
|
|
|
|
obj.setDisTime(fmt.format(obj.getDisDate()));
|
|
|
|
|
|
|
|
//转换用户名
|
|
|
|
|
|
|
|
//获取申请者工号
|
|
|
|
|
|
|
|
String applyer = obj.getApplyer();
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(userList)){
|
|
|
|
|
|
|
|
for(User user1 : userList){
|
|
|
|
|
|
|
|
String name = user1.getName();
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(applyer) && user1.getUserName().equals(applyer)){
|
|
|
|
|
|
|
|
obj.setApplyer(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -623,6 +641,62 @@ public class ApproveController {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 查询条件用户名转姓名
|
|
|
|
|
|
|
|
* @param approve
|
|
|
|
|
|
|
|
* @param userList
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void setSearchApplyerAndApprover(Emr_Apply_Approve approve,List<User> userList){
|
|
|
|
|
|
|
|
String applyer1 = approve.getApplyer();
|
|
|
|
|
|
|
|
String approver1 = approve.getApprover();
|
|
|
|
|
|
|
|
String str = "\'abcxyz\'";
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(applyer1)){
|
|
|
|
|
|
|
|
StringBuilder applyerBuild = new StringBuilder();
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(userList)){
|
|
|
|
|
|
|
|
for(User userTemp : userList){
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(userTemp.getName())) {
|
|
|
|
|
|
|
|
if (userTemp.getName().contains(applyer1)) {
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(applyerBuild)) {
|
|
|
|
|
|
|
|
applyerBuild.append(",");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
applyerBuild.append("'").append(userTemp.getUserName()).append("'");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(applyerBuild)) {
|
|
|
|
|
|
|
|
approve.setApplyer(applyerBuild.toString());
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
approve.setApplyer(str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
approve.setApplyer("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(approver1)){
|
|
|
|
|
|
|
|
StringBuilder applyerBuild = new StringBuilder();
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(userList)){
|
|
|
|
|
|
|
|
for(User userTemp : userList){
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(userTemp.getName())) {
|
|
|
|
|
|
|
|
if (userTemp.getName().contains(approver1)) {
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(applyerBuild)) {
|
|
|
|
|
|
|
|
applyerBuild.append(",");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
applyerBuild.append("'").append(userTemp.getUserName()).append("'");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(applyerBuild)) {
|
|
|
|
|
|
|
|
approve.setApprover(applyerBuild.toString());
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
approve.setApprover(str);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
approve.setApprover("");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @MethodName: getApproveManageList
|
|
|
|
* @MethodName: getApproveManageList
|
|
|
|
* @Description: 获取审批列表分页数据
|
|
|
|
* @Description: 获取审批列表分页数据
|
|
|
|
@ -644,9 +718,12 @@ public class ApproveController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
approve.setApplyState("已提交");
|
|
|
|
approve.setApplyState("已提交");
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
List<Emr_Apply_Approve> approves = applyApproveService.selectAllApprove(approve, startTime1, endTime1,startTime2,endTime2,request);
|
|
|
|
|
|
|
|
//匹配权限
|
|
|
|
//匹配权限
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
|
|
|
List<User> userList = commomService.getUserList(user.getUserName(), request);
|
|
|
|
|
|
|
|
//查询条件用户名转姓名
|
|
|
|
|
|
|
|
setSearchApplyerAndApprover(approve,userList);
|
|
|
|
|
|
|
|
List<Emr_Apply_Approve> approves = applyApproveService.selectAllApprove(approve, startTime1, endTime1,startTime2,endTime2,request);
|
|
|
|
if(null != approves && !approves.isEmpty()){
|
|
|
|
if(null != approves && !approves.isEmpty()){
|
|
|
|
Set<String> menus = user.getMenus();
|
|
|
|
Set<String> menus = user.getMenus();
|
|
|
|
if(null != menus && !menus.isEmpty()){
|
|
|
|
if(null != menus && !menus.isEmpty()){
|
|
|
|
@ -661,7 +738,6 @@ public class ApproveController {
|
|
|
|
for (Emr_Apply_Approve obj : approves){
|
|
|
|
for (Emr_Apply_Approve obj : approves){
|
|
|
|
obj.setUpdateOper(updateOper);
|
|
|
|
obj.setUpdateOper(updateOper);
|
|
|
|
//转换用户名
|
|
|
|
//转换用户名
|
|
|
|
List<User> userList = commomService.getUserList(user.getUserName(), request);
|
|
|
|
|
|
|
|
//获取申请者工号
|
|
|
|
//获取申请者工号
|
|
|
|
String applyer = obj.getApplyer();
|
|
|
|
String applyer = obj.getApplyer();
|
|
|
|
//获取审批者工号
|
|
|
|
//获取审批者工号
|
|
|
|
@ -766,16 +842,21 @@ public class ApproveController {
|
|
|
|
@RequestMapping(value="exportExcelApproveList",produces = {"text/json;charset=UTF-8"})
|
|
|
|
@RequestMapping(value="exportExcelApproveList",produces = {"text/json;charset=UTF-8"})
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public void exportExcelApproveList(HttpServletResponse response, Emr_Apply_Approve approve,
|
|
|
|
public void exportExcelApproveList(HttpServletResponse response, Emr_Apply_Approve approve,
|
|
|
|
String startTime1, String endTime1,String startTime2, String endTime2,HttpServletRequest request,String checks){
|
|
|
|
String startTime1, String endTime1,String startTime2, String endTime2,HttpServletRequest request,String checks) throws Exception{
|
|
|
|
String tableThNames = "申请人,申请日期,有效日期,有效天数,姓名,病案号,住院次数,出院日期,申请原因,申请类型,审批状态,审批时间,审批人,批注内容";
|
|
|
|
String tableThNames = "申请人,申请日期,有效日期,有效天数,姓名,病案号,住院次数,出院日期,申请原因,申请类型,审批状态,审批时间,审批人,批注内容";
|
|
|
|
String fieldCns = "applyer,applyTime,effeTime,effeDays,name,inpatientNo,admissTimes,disTime,applyReason,applyType,approveState,approveTime,approver,approveNotes";
|
|
|
|
String fieldCns = "applyer,applyTime,effeTime,effeDays,name,inpatientNo,admissTimes,disTime,applyReason,applyType,approveState,approveTime,approver,approveNotes";
|
|
|
|
List<Emr_Apply_Approve> approves = new ArrayList<>();
|
|
|
|
List<Emr_Apply_Approve> approves = new ArrayList<>();
|
|
|
|
|
|
|
|
//匹配权限
|
|
|
|
|
|
|
|
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
|
|
|
List<User> userList = commomService.getUserList(user.getUserName(), request);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//构造excel的数据
|
|
|
|
//构造excel的数据
|
|
|
|
if(StringUtils.isNotBlank(checks)){
|
|
|
|
if(StringUtils.isNotBlank(checks)){
|
|
|
|
approves = applyApproveMapper.selectAllByIds(checks);
|
|
|
|
approves = applyApproveMapper.selectAllByIds(checks);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
approve.setApplyState("已提交");
|
|
|
|
approve.setApplyState("已提交");
|
|
|
|
|
|
|
|
//查询条件用户名转姓名
|
|
|
|
|
|
|
|
setSearchApplyerAndApprover(approve,userList);
|
|
|
|
approves = applyApproveService.selectAllApprove(approve, startTime1, endTime1,
|
|
|
|
approves = applyApproveService.selectAllApprove(approve, startTime1, endTime1,
|
|
|
|
startTime2,endTime2,request);
|
|
|
|
startTime2,endTime2,request);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -784,6 +865,22 @@ public class ApproveController {
|
|
|
|
for (Emr_Apply_Approve obj : approves) {
|
|
|
|
for (Emr_Apply_Approve obj : approves) {
|
|
|
|
if(null != obj.getDisDate()){
|
|
|
|
if(null != obj.getDisDate()){
|
|
|
|
obj.setDisTime(fmt.format(obj.getDisDate()));
|
|
|
|
obj.setDisTime(fmt.format(obj.getDisDate()));
|
|
|
|
|
|
|
|
//转换用户名
|
|
|
|
|
|
|
|
//获取申请者工号
|
|
|
|
|
|
|
|
String applyer = obj.getApplyer();
|
|
|
|
|
|
|
|
//获取审批者工号
|
|
|
|
|
|
|
|
String approver = obj.getApprover();
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(userList)){
|
|
|
|
|
|
|
|
for(User user1 : userList){
|
|
|
|
|
|
|
|
String name = user1.getName();
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(applyer) && user1.getUserName().equals(applyer)){
|
|
|
|
|
|
|
|
obj.setApplyer(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(approver) && user1.getUserName().equals(approver)){
|
|
|
|
|
|
|
|
obj.setApprover(name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|