修改取消审核时选择来函
This commit is contained in:
@@ -3,10 +3,12 @@
|
||||
*/
|
||||
package com.nis.domain;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -417,10 +419,83 @@ public class Page<T> {
|
||||
sb.append("<div style=\"clear:both;\"></div>");
|
||||
|
||||
// sb.insert(0,"<div class=\"page\">\n").append("</div>\n");
|
||||
|
||||
Map cancelMap = validateCancelService();
|
||||
if(cancelMap!=null) {
|
||||
String requestName = (String)cancelMap.get("requestName");
|
||||
String indexTable = (String)cancelMap.get("indexTable");
|
||||
sb.append("<input type=\"hidden\" id=\"ifCancelRequestInfo\" requestName=\""+requestName+"\" indexTable=\""+indexTable+"\" \"/>");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
//判断是否有requestName indexTableName
|
||||
public Map validateCancelService() {
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
if(list != null && !list.isEmpty()) {
|
||||
Object obj = (Object) list.get(0);
|
||||
Class<?> clazz = obj.getClass();
|
||||
tab: for (; clazz != Object.class; clazz = clazz.getSuperclass()) {//向上循环 遍历父类
|
||||
Field[] field = clazz.getDeclaredFields();
|
||||
for (Field f : field) {
|
||||
String name = f.getName();
|
||||
if(name!=null&&name.equals("requestName")) {
|
||||
|
||||
Object v = invokeMethod(obj, name);
|
||||
if(v!=null) {
|
||||
map.put("requestName", v);
|
||||
}
|
||||
}
|
||||
if(name!=null&&name.equals("indexTable")) {
|
||||
|
||||
Object v = invokeMethod(obj, name);
|
||||
if(v!=null) {
|
||||
map.put("indexTable", v);
|
||||
}
|
||||
}
|
||||
if(map.containsKey("requestName")&&map.containsKey("indexTable")) {
|
||||
break tab;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* 执行某个Field的getField方法
|
||||
*
|
||||
* @param owner 类
|
||||
* @param fieldName 类的属性名称
|
||||
* @param args 参数,默认为null
|
||||
* @return
|
||||
*/
|
||||
private Object invokeMethod(Object owner, String fieldName)
|
||||
{
|
||||
Class<? extends Object> ownerClass = owner.getClass();
|
||||
|
||||
//fieldName -> FieldName
|
||||
String methodName = fieldName.substring(0, 1).toUpperCase()+ fieldName.substring(1);
|
||||
|
||||
Method method = null;
|
||||
|
||||
|
||||
|
||||
//invoke getMethod
|
||||
try
|
||||
{
|
||||
method = ownerClass.getMethod("get" + methodName);
|
||||
if (method!=null) {
|
||||
|
||||
return method.invoke(owner);
|
||||
}else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取分页HTML代码
|
||||
* @return
|
||||
|
||||
@@ -51,13 +51,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value="requestSelectInfo")
|
||||
public String requestSelectInfo(Model model){
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
return "/basics/requestSelectInfo";
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value="requestCancleInfoAjax", method = RequestMethod.POST)
|
||||
public String requestCancleInfoAjax(Integer cancelRequestId,String ids,String indexTable){
|
||||
|
||||
@@ -162,4 +162,15 @@ public class RequestInfoController extends BaseController{
|
||||
model.addAttribute("taskInfos", taskInfos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置取消审核操作时选择来函
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="requestSelectInfo")
|
||||
public String requestSelectInfo(Model model){
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
return "/basics/requestSelectInfo";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,21 +199,14 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
|
||||
if((url.indexOf("?isAudit=3") > 1)){
|
||||
// 审核中区分是否有添加取消来函
|
||||
|
||||
var reobj=JSON.parse(JSON.stringify("${page.list[0]}"));
|
||||
var indexTableNameArr=reobj.match(/indexTable=(\w*),/);
|
||||
var requestNameArr=reobj.match(/requestName=(\w*),/);
|
||||
var requestName=$("#ifCancelRequestInfo").attr("requestName");
|
||||
var indexTable=$("#ifCancelRequestInfo").attr("indexTable");
|
||||
// 有来函业务的取消审核
|
||||
if(reobj!=null&&reobj.indexOf("requestName")!=-1&&requestNameArr!=null&&requestNameArr.length>1&&indexTableNameArr!=null&&indexTableNameArr.length>1){
|
||||
var indexTableName =indexTableNameArr[1];
|
||||
var requestName =requestNameArr[1];
|
||||
|
||||
if(requestName.indexOf("null")==-1&&typeof(indexTableName)!="undefined"&&indexTableName!=null&&indexTableName!=''&&indexTableName.indexOf("null")==-1){
|
||||
/****************************************** */
|
||||
$.jBox.open("iframe:${ctx}/basics/serviceDictInfo/requestSelectInfo", "<spring:message code='cancel_approved'/>",500, 400, { buttons: { '<spring:message code="ok"/>': 1, '<spring:message code="cancel"/>': 0 },
|
||||
if(requestName!=null&&indexTable!=null&&requestName.indexOf("null")==-1&&indexTable.indexOf("null")==-1){
|
||||
/****************取消审核时增加来函************************** */
|
||||
$.jBox.open("iframe:${ctx}/cfg/request/requestSelectInfo", "<spring:message code='cancel_approved'/>",500, 400, { buttons: { '<spring:message code="ok"/>': 1, '<spring:message code="cancel"/>': 0 },
|
||||
submit: function (v, h, f) {
|
||||
if (v == 0) {
|
||||
return true; // close the window
|
||||
@@ -228,7 +221,7 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/serviceDictInfo/requestCancleInfoAjax',
|
||||
data:{"cancelRequestId":cancelRequestId,"ids":ids,"indexTable":indexTableName},
|
||||
data:{"cancelRequestId":cancelRequestId,"ids":ids,"indexTable":indexTable},
|
||||
async:false,
|
||||
success:function(data,textStatus){//处理返回结果
|
||||
window.location = url+"&ids="+ids+"&compileIds="+compileIds;
|
||||
@@ -261,26 +254,6 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||
|
||||
|
||||
/****************************************** */
|
||||
}else{
|
||||
// 防止有来函无表名的取消审核操作
|
||||
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
|
||||
if(v=="ok"){
|
||||
if(url.indexOf("?")>0){
|
||||
window.location = url+"&ids="+ids+"&compileIds="+compileIds;
|
||||
}else{
|
||||
window.location = url+"?ids="+ids+"&compileIds="+compileIds;
|
||||
}
|
||||
if(url.indexOf("?isAudit") > 1){
|
||||
loading('<spring:message code="onloading"/>');
|
||||
}else if(url.indexOf("export") > 1){
|
||||
closeTip();
|
||||
}
|
||||
//$("#searchForm").submit();
|
||||
}
|
||||
},{buttonsFocus:1});
|
||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||
}
|
||||
}else{
|
||||
// 无来函选项的取消审核操作
|
||||
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
|
||||
Reference in New Issue
Block a user