|
发表于 2014-12-17 09:44:34
|
显示全部楼层
java 部分
//新增日志
public static void addCzrz(String orderID) {
String dataModel = "/YT_CXDA/YT_CXDAXT/data";
String ksql2 = "select a.sName from SA_OPPerson a where a = :currentPersonID()";
//System.out.println("语句"+ksql+"语句");
Table table2 = KSQL.select(ksql2, null, dataModel, null);
Iterator<Row> rows2 = table2.iterator();
Row rs2 = null;
if (rows2.hasNext()) {
rs2 = rows2.next();
}
String loginname = (String) rs2.getValue("sName");
String ksql3 = "select a.fFL as fFL, a.fMXL as fMXL, a.fQY as fQY, a.fKHJLXM as fKHJLXM, a.fYGH as fYGH, a.fXSDD as fXSDD,a.fCNRQ as fCNRQ,a.fSJRQ as fSJRQ, a.fBZ as fBZ from YT_CXDA_SJWH a where a ='"
+ orderID + "'";
Table table = KSQL.select(ksql3, null, dataModel, null);
;
Iterator<Row> rows = table.iterator();
Row row = null;
if (rows.hasNext()) {
row = rows.next();
//String id = (String) row.getValue("YT_CXDA_SJWH");
// String a=BizUtils.createNextSequenceString("CDRS"+date,"0000");
// row.setValue("fDX",a); //给列赋值
String fFL = (String) row.getValue("fFL");
String fMXL = (String) row.getValue("fMXL");
String fQY = (String) row.getValue("fQY");
String fKHJLXM = (String) row.getValue("fKHJLXM");
String fYGH = (String) row.getValue("fYGH");
String fXSDD = (String) row.getValue("fXSDD");
Date fCNRQ1 = (Date) row.getValue("fCNRQ");
System.out.println(fFL + "我进到新增日志了吗?");
Date fSJRQ1 = null;
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");
String fSJRQ = "";
if (!"".equals((Date) row.getValue("fSJRQ")) && null != (Date) row.getValue("fSJRQ")) {
fSJRQ1 = (Date) row.getValue("fSJRQ");
fSJRQ = sdf2.format(fSJRQ1);
}
String fBZ = (String) row.getValue("fBZ");
Date now = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
String nowdate = sdf.format(now);
String fCNRQ = sdf2.format(fCNRQ1);
KSQL.executeUpdate(
"insert into YT_CXDA_CZRZ bb(bb,bb.version,bb.fZXCZ,bb.fZXCZR,bb.fRZFL,bb.fRZMXL,bb.fRZJLXM,bb.fRZQY,bb.fRZYGH,bb.fRZCNRQ,bb.fRZSJRQ,bb.fRZXSDD,bb.fZXCZRQ,bb.fRZBZ,bb.fRZDYXXID) values "
+ "(:guid(),0,'新增数据','"
+ loginname
+ "','"
+ fFL
+ "','"
+ fMXL
+ "','"
+ fKHJLXM
+ "','"
+ fQY
+ "','"
+ fYGH
+ "','"
+ fCNRQ
+ "','"
+ fSJRQ
+ "','" + fXSDD + "','" + nowdate + "','" + fBZ + "','" + orderID + "')", null, dataModel, null);
}
} |
|