|

楼主 |
发表于 2014-6-16 09:42:49
|
显示全部楼层
本帖最后由 liuaqiuping 于 2014-6-16 09:46 编辑
zhaixin 发表于 2014-6-16 09:05 
测试没有发现这个问题,发一下js代码和java代码
另外,在setValue之后,输出bizdata的getJson方法的结果看 ...
public static void taskSourceMngProcessAfterSaveT_TaskSourceAction() {
Table table =(Table) ContextHelper.getActionContext().getParameter("table");
for(Iterator it = table.iterator(ModifyState.NEW); it.hasNext();){
Row r = (Row) it.next();
String id = r.getString("T_TaskSource");
String sqlString="Update T_TaskSource T Set T.fJD = 'PMC计划中' Where T=:id And T.fJD='新建任务'";
HashMap<String, Object> map= new HashMap<String, Object>();
map.put("id", id);
KSQL.executeUpdate(sqlString, map, "/TaskMng/Task/data" , null);
}
for(Iterator it = table.iterator(ModifyState.EDIT); it.hasNext();){
Row r = (Row) it.next();
String id = r.getString("T_TaskSource");
String zt = r.getString("fXMZT");
String oldZT = r.getOldValue("fXMZT").toString();//这里无法获取
System.out.println("编辑:"+ zt+" "+ oldZT);
if(!zt.equals(oldZT) && zt.equals("取消")){
//修改状态为取消,则将项目下所有的任务都设为取消状态
String sqlString = "Update T_Task set fRWZT='取消' where fsID='"+id+"'";
sqlString =sqlString + " Insert into T_TaskOptRecord(fID,fsTable,fsID,fContent,fCreateEmpCode,fCreateEmpName,fCreateDT,fType)"+
" Select newid(),?,fID,?,?,?,?,? from T_Task where fsID='"+id+"' ";
HashMap<String,String> map = new HashMap<String, String>();
map.put(DatabaseProduct.MSSQL.name(), sqlString);
ArrayList<Object> list = new ArrayList<Object>();
list.add("T_Task");
list.add("取消了任务");
list.add(ContextHelper.getPerson().getCode());
list.add(ContextHelper.getPerson().getName());
list.add(new Date(System.currentTimeMillis()).toLocaleString());
list.add("操作日志");
System.out.println("sqlstring:"+sqlString);
SQL.executeUpdate(map, list, "/TaskMng/Task/data");
}
}
} |
|