增加提交申请立刻通知

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

@ -163,4 +163,11 @@ public class AppleApproveServiceImpl implements ApplyApproveService{
public int SimpleUpdate(Emr_Apply_Approve record, String 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 SimpleUpdate(Emr_Apply_Approve record,String idsStr);
/**
*
* */
void sendNotice(String applyType,int count) throws Exception;
}

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

Loading…
Cancel
Save