|

楼主 |
发表于 2017-5-31 16:13:05
|
显示全部楼层
public static void businessActivity2AfterAdvance() {
/**当前ServersApply主键*/
String key = ProcessUtils.getProcessData1();
/**当前人姓名、单位*/
Person person = ContextHelper.getPerson();
String personName = person.getName();
String personDanweiKey = (String) person.getAttribute("sDanwei");
String ksqlPerson = "select d.* from T_Danwei d where d = '"+personDanweiKey+"'";
Table danweiTable = KSQL.select(ksqlPerson, null, "/dzzw/dzzw/model/data", null);
Iterator<Row> rowDanweis = danweiTable.iterator();
Row rowDanwei = rowDanweis.next();
/**获取当前任务以获取附言*/
String taskid=ContextHelper.getActionContext().getParameter("task").toString();//任务id
String ksqlTask = "select s.* from SA_Task s where s='"+taskid+"'";
Table tableTask = KSQL.select(ksqlTask,null,"/system/data",null);
Iterator<Row> rowTasks = tableTask.iterator();
Row rowTask = rowTasks.next();
// 增加审核历史信息
String stateBefore = "托管申请技术科未审核";
String stateAfter = "托管申请技术科已审核";
/**保存审核记录*/
String ksqlInsertHis = "insert into T_TainApplyHistory th (th , th.tainApplyHistory_tainApply , th.tainApplyHistory_dwmingchen ,"
+"th.tainApplyHistory_drawer , th.tainApplyHistory_drawDate , th.tainApplyHistory_describe , th.tainApplyHistory_stateBefore , "
+"th.tainApplyHistory_stateAfter , th.tainApplyHistory_deleteFlag , th.version) values "
+"('"+createUUID()+"' , '"+key+"' , '"+rowDanwei.getString("dwmingchen")+"' , '"+personName+"' , '"+formatDate(new Date())+"' , '"+rowTask.getString("sContent")+"' , '"+stateBefore+"' , '"+stateAfter+"' ,0,0)";
KSQL.executeUpdate(ksqlInsertHis, null, "/dzzw/dzzw/model/data", null);
/**产生随即码以及短信信息*/
//产生验证码
String str = "0,1,2,3,4,5,6,7,8,9";
String str2[] = str.split(",");
Random rand = new Random();
int index = 0;
String randStr = "";
for (int i = 0; i < 4; ++i) {
index = rand.nextInt(str2.length - 1);
randStr += str2[index];
}
/**生成一条短信验证信息*/
String describe = "测试设备维护申请技术科短信验证审核!";
String ksqlInsertNote = "insert into T_Note th (th , th.note_authCode , th.note_sendDate ,"
+"th.note_describe , th.note_sendlag , th.note_tainApply , th.note_drawer , "
+"th.note_drawDate , th.note_deleteFlag , th.version) values "
+"('"+createUUID()+"' , '"+randStr+"' , '"+formatDate(new Date())+"' , '"+describe+"' , -1 , '"+key+"' , '"+personName+"' , '"+formatDate(new Date())+"' ,0,0)";
KSQL.executeUpdate(ksqlInsertNote, null, "/dzzw/dzzw/model/data", null);
/**更新审核状态并生成最后的验证码*/
String ksqlUpdate = "update T_TainApply t set t.tainApply_skillFlag = -1 , t.tainApply_skiller = '"+personName+"' , " +
"t.tainApply_skillDate = '"+(formatDate(new Date()))+"' , t.tainApply_authCode = '"+randStr+"' where t = '"+key+"'";
KSQL.executeUpdate(ksqlUpdate, null, "/dzzw/dzzw/model/data", null);
}
|
|