增加提交申请立刻通知

master
zengwh 6 years ago
parent 3ec1032d59
commit bc3865bb9b

@ -22,9 +22,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -41,8 +38,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -182,8 +177,10 @@ public class ApproveController {
} }
} }
//推送给权限系统下发审批人通知 //推送给权限系统下发审批人通知
String applyStateTemp = "2";
if(applyApprove.getApplyState().equals(applyStateTemp)){
sendPowerApproveInterface(applyApprove.getApplyType(),commomtables.size()); sendPowerApproveInterface(applyApprove.getApplyType(),commomtables.size());
}
} else { } else {
return ResultUtil.error("该病案另一个申请还处于有效期,无须重复申请!"); return ResultUtil.error("该病案另一个申请还处于有效期,无须重复申请!");
} }
@ -201,7 +198,7 @@ public class ApproveController {
private void sendPowerApproveInterface(String applyType,Integer count) throws Exception{ private void sendPowerApproveInterface(String applyType,Integer count) throws Exception{
//查询申请类型 //查询申请类型
List<Emr_Dictionary> dictionaryList = dictionaryMapper.selectDictionaryByTypeCode("apply_type"); List<Emr_Dictionary> dictionaryList = dictionaryMapper.selectDictionaryByTypeCode("apply_type");
/*String applyTypeName = ""; String applyTypeName = "";
if(null != dictionaryList && !dictionaryList.isEmpty()){ if(null != dictionaryList && !dictionaryList.isEmpty()){
for(Emr_Dictionary dictionary : dictionaryList){ for(Emr_Dictionary dictionary : dictionaryList){
if(dictionary.getCode().equals(applyType)){ if(dictionary.getCode().equals(applyType)){
@ -210,9 +207,8 @@ public class ApproveController {
} }
} }
} }
String url = POWER_URLHEAD+"/font/sendEmrRecordApproveNotice?applyType="+applyTypeName+"&count="+count; //发送通知
// 执行请求 applyApproveService.sendNotice(applyTypeName,count);
HttpClients.createDefault().execute(new HttpGet(url));*/
} }
/** /**
@ -349,15 +345,20 @@ public class ApproveController {
applyApprove.setApproveState(""); applyApprove.setApproveState("");
applyApprove.setApproveNotes(""); applyApprove.setApproveNotes("");
} }
applyApproveService.updateEmrApplyApprove(applyApprove); applyApproveService.updateEmrApplyApprove(applyApprove);
}else{ }else{
boolean flag = FormTokenFlagUtil.isFlag(request); boolean flag = FormTokenFlagUtil.isFlag(request);
if (flag) { if (flag) {
applyApproveService.addEmrApplyApprove(applyApprove,request); applyApproveService.addEmrApplyApprove(applyApprove,request);
//是确认提交情况下发送通知
String applyStateTemp = "2";
if(applyApprove.getApplyState().equals(applyStateTemp)){
sendPowerApproveInterface(applyApprove.getApplyType(),1);
}
}else{ }else{
return ResultUtil.error("请不要重复提交!"); return ResultUtil.error("请不要重复提交!");
} }
} }
return ResultUtil.ok(); return ResultUtil.ok();
}catch(Exception e){ }catch(Exception e){
@ -1067,6 +1068,8 @@ public class ApproveController {
}else{ }else{
//有出错数据 //有出错数据
String msgStr = excelEntity.getWorkBookKey()+"@已成功导入"+excelEntity.getSuccessCount()+"条,失败"+excelEntity.getWrongCount()+"条,随后将导出错误记录!"; String msgStr = excelEntity.getWorkBookKey()+"@已成功导入"+excelEntity.getSuccessCount()+"条,失败"+excelEntity.getWrongCount()+"条,随后将导出错误记录!";
//是确认提交情况下发送通知
sendPowerApproveInterface(applyType,excelEntity.getSuccessCount());
return new ResponseEntity<String>(msgStr, responseHeaders, HttpStatus.OK); return new ResponseEntity<String>(msgStr, responseHeaders, HttpStatus.OK);
} }
}catch (Exception e){ }catch (Exception e){
@ -1104,9 +1107,7 @@ public class ApproveController {
if (null != applyApproves && !applyApproves.isEmpty()) { if (null != applyApproves && !applyApproves.isEmpty()) {
//调用权限系统推送通知 //调用权限系统推送通知
String applyTypeName = "申请"; String applyTypeName = "申请";
String url = POWER_URLHEAD + "/font/sendEmrRecordApproveNotice?applyType=" + applyTypeName + "&count=" + applyApproves.size(); applyApproveService.sendNotice(applyTypeName,applyApproves.size());
// 执行请求
HttpClients.createDefault().execute(new HttpGet(url));
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();

@ -163,4 +163,11 @@ public class AppleApproveServiceImpl implements ApplyApproveService{
public int SimpleUpdate(Emr_Apply_Approve record, String idsStr) { public int SimpleUpdate(Emr_Apply_Approve record, String idsStr) {
return applyApproveMapper.SimpleUpdate(record,idsStr); return applyApproveMapper.SimpleUpdate(record,idsStr);
} }
@Override
public void sendNotice(String applyType, int count) throws Exception{
String url = POWER_URLHEAD + "/font/sendEmrRecordApproveNotice?applyType=" + applyType + "&count=" + count;
// 执行请求
HttpClients.createDefault().execute(new HttpGet(url));
}
} }

@ -23,4 +23,9 @@ public interface ApplyApproveService {
int SimpleInsert(List<Emr_Apply_Approve> list); int SimpleInsert(List<Emr_Apply_Approve> list);
int SimpleUpdate(Emr_Apply_Approve record,String idsStr); int SimpleUpdate(Emr_Apply_Approve record,String idsStr);
/**
*
* */
void sendNotice(String applyType,int count) throws Exception;
} }

@ -37,7 +37,6 @@
} }
.dateSearchInput{ .dateSearchInput{
width:30%; width:30%;
margin-left:2%;
} }
.dateLabelDiv{ .dateLabelDiv{
width: 30%; width: 30%;

Loading…
Cancel
Save