| | |
| | |
|
| | | return tranReq.returnJson(jsonWr);
|
| | | }
|
| | | |
| | | public ModelAndView createOrder(SMTAIServerRequest tranReq) throws Exception
|
| | | {
|
| | |
|
| | | public ModelAndView createOrder(SMTAIServerRequest tranReq) throws Exception {
|
| | | // String title = tranReq.convParamToString("title", true);
|
| | | // String wstypeid = tranReq.convParamToString("wstypeid", false);
|
| | | // String wstypename = tranReq.convParamToString("wstypename", false);
|
| | | // String urgencylevel = tranReq.convParamToString("urgencylevel", false);
|
| | | // String shape = tranReq.convParamToString("shape", false);
|
| | | // String deadline = tranReq.convParamToString("deadline", false);
|
| | | // String stepstatus = tranReq.convParamToString("stepstatus", false);
|
| | | // String originatetypetext = tranReq.convParamToString("originatetypetext", false);
|
| | | // String content = tranReq.convParamToString("content", false);
|
| | | // String address = tranReq.convParamToString("address", false);
|
| | | // String stepid = tranReq.convParamToString("stepid", false);
|
| | | // String org = tranReq.convParamToString("org", false);
|
| | | // String deptname = tranReq.convParamToString("deptname", false);
|
| | | // String dealtime = tranReq.convParamToString("dealtime", false);
|
| | | // String username = tranReq.convParamToString("username", false);
|
| | | // String contactname = tranReq.convParamToString("contactname", false);
|
| | | // String contactphone = tranReq.convParamToString("contactphone", false);
|
| | | // String acceptuserid = tranReq.convParamToString("acceptuserid", false);
|
| | | // String acceptusername = tranReq.convParamToString("acceptusername", false);
|
| | | // String acceptuseraccount = tranReq.convParamToString("acceptuseraccount", false);
|
| | | // String dealuserid = tranReq.convParamToString("dealuserid", false);
|
| | | // String dealusername = tranReq.convParamToString("dealusername", false);
|
| | | // String dealuseraccount = tranReq.convParamToString("dealuseraccount", false);
|
| | | // String flowstatus = tranReq.convParamToString("flowstatus", false);
|
| | | // String attachment = tranReq.convParamToString("attachment", false);
|
| | | // String creator = tranReq.convParamToString("creator", false);
|
| | | // String createtime = tranReq.convParamToString("createtime", false);
|
| | | // String isplan = tranReq.convParamToString("isplan", false);
|
| | | // String originateid = tranReq.convParamToString("originateid", false);
|
| | | // String appointstarttime = tranReq.convParamToString("appointstarttime", false);
|
| | | // String appointendtime = tranReq.convParamToString("appointendtime", false);
|
| | | // String parentid = tranReq.convParamToString("parentid", false);
|
| | | // String relateids = tranReq.convParamToString("relateids", false);
|
| | | // String oname = tranReq.convParamToString("oname", false);
|
| | | // String otype = tranReq.convParamToString("otype", false);
|
| | | //
|
| | | // SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | // try {
|
| | | // db.executeSQL(
|
| | | // "INSERT INTO work_order_list("
|
| | | // + "order_id, title, wstypeid, wstypename, urgencylevel, shape, deadline, stepstatus, "
|
| | | // + "originatetypetext, content, address, step_id, org, deptname, dealtime, username, contactname, "
|
| | | // + "contactphone, acceptuserid, acceptusername, acceptuseraccount, dealuserid, dealusername, "
|
| | | // + "dealuseraccount, flowstatus, attachment, creator, createtime, isplan, originateid, "
|
| | | // + "appointstarttime, appointendtime, parentid, relateids,is_notify,oname,otype"
|
| | | // + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)",
|
| | | // new Object[] {
|
| | | // SMTStatic.newUUID(),
|
| | | // title,
|
| | | // wstypeid,
|
| | | // wstypename,
|
| | | // urgencylevel,
|
| | | // shape,
|
| | | // deadline,
|
| | | // stepstatus,
|
| | | // originatetypetext,
|
| | | // content,
|
| | | // address,
|
| | | // stepid,
|
| | | // org,
|
| | | // deptname,
|
| | | // dealtime,
|
| | | // username,
|
| | | // contactname,
|
| | | // contactphone,
|
| | | // acceptuserid,
|
| | | // acceptusername,
|
| | | // acceptuseraccount,
|
| | | // dealuserid,
|
| | | // dealusername,
|
| | | // dealuseraccount,
|
| | | // flowstatus,
|
| | | // attachment,
|
| | | // creator,
|
| | | // new Date(),
|
| | | // isplan,
|
| | | // originateid,
|
| | | // appointstarttime,
|
| | | // appointendtime,
|
| | | // parentid,
|
| | | // relateids,
|
| | | // "N",
|
| | | // oname,
|
| | | // otype
|
| | | // });
|
| | | // } catch (Exception e) {
|
| | | // throw new Exception("数据库错误", e);
|
| | | // }
|
| | | //
|
| | | // return tranReq.returnJsonState(true, null, null);
|
| | | return tranReq.returnJsonState(true, null, null);
|
| | | }
|
| | |
|
| | | public ModelAndView updateOrderStatus(SMTAIServerRequest tranReq) throws Exception {
|
| | | String id = tranReq.convParamToString("id", true);
|
| | | Integer stepstatus = tranReq.convParamToInteger("stepstatus", true); // 状态代号,如已完成
|
| | |
|
| | | SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | try {
|
| | | DBRecords dbRecords = db.querySQL("select * from work_order_list where order_id = ?", new Object[]{id});
|
| | | Integer statusBeforeModification = dbRecords.getRecords().get(0).getInteger("stepstatus");
|
| | | db.executeSQL(
|
| | | "UPDATE work_order_list SET stepstatus = ? , status_update_time = ? , is_notify = 'N' WHERE order_id = ?",
|
| | | new Object[] {stepstatus, new Date(),id});
|
| | | String sql = "INSERT INTO ai_sys.work_order_detail (order_id, status_before_modification, status_after_modification,createTime) VALUES (?, ?, ?, ?)";
|
| | | db.executeSQL(sql, new Object[] {id, statusBeforeModification, stepstatus, new Date()});
|
| | |
|
| | |
|
| | | } catch (Exception e) {
|
| | | throw new Exception("更新工单状态失败", e);
|
| | | }
|
| | |
|
| | | return tranReq.returnJsonState(true, null, null);
|
| | | }
|
| | |
|
| | | public ModelAndView updateOrder(SMTAIServerRequest tranReq) throws Exception {
|
| | | String title = tranReq.convParamToString("title", true);
|
| | | String orderId = tranReq.convParamToString("orderId", true);
|
| | | String wstypeid = tranReq.convParamToString("wstypeid", false);
|
| | | String wstypename = tranReq.convParamToString("wstypename", false);
|
| | | String urgencylevel = tranReq.convParamToString("urgencylevel", false);
|
| | |
| | | String flowstatus = tranReq.convParamToString("flowstatus", false);
|
| | | String attachment = tranReq.convParamToString("attachment", false);
|
| | | String creator = tranReq.convParamToString("creator", false);
|
| | | String createtime = tranReq.convParamToString("createtime", false);
|
| | | String isplan = tranReq.convParamToString("isplan", false);
|
| | | String originateid = tranReq.convParamToString("originateid", false);
|
| | | String appointstarttime = tranReq.convParamToString("appointstarttime", false);
|
| | | String appointendtime = tranReq.convParamToString("appointendtime", false);
|
| | | String parentid = tranReq.convParamToString("parentid", false);
|
| | | String relateids = tranReq.convParamToString("relateids", false);
|
| | | String oname = tranReq.convParamToString("oname", false);
|
| | | String otype = tranReq.convParamToString("otype", false);
|
| | | SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | try {
|
| | |
|
| | | SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | try
|
| | | {
|
| | | db.executeSQL(
|
| | | "INSERT INTO work_order_list("
|
| | | + "order_id, title, wstypeid, wstypename, urgencylevel, shape, deadline, stepstatus, "
|
| | | + "originatetypetext, content, address, stepid, org, deptname, dealtime, username, contactname, "
|
| | | + "contactphone, acceptuserid, acceptusername, acceptuseraccount, dealuserid, dealusername, "
|
| | | + "dealuseraccount, flowstatus, attachment, creator, createtime, isplan, originateid, "
|
| | | + "appointstarttime, appointendtime, parentid, relateids,is_notify"
|
| | | + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)",
|
| | | new Object[] {
|
| | | SMTStatic.newUUID(),
|
| | | title,
|
| | | wstypeid,
|
| | | wstypename,
|
| | | urgencylevel,
|
| | | shape,
|
| | | deadline,
|
| | | stepstatus,
|
| | | originatetypetext,
|
| | | content,
|
| | | address,
|
| | | stepid,
|
| | | org,
|
| | | deptname,
|
| | | dealtime,
|
| | | username,
|
| | | contactname,
|
| | | contactphone,
|
| | | acceptuserid,
|
| | | acceptusername,
|
| | | acceptuseraccount,
|
| | | dealuserid,
|
| | | dealusername,
|
| | | dealuseraccount,
|
| | | flowstatus,
|
| | | attachment,
|
| | | creator,
|
| | | new Date(),
|
| | | isplan,
|
| | | originateid,
|
| | | appointstarttime,
|
| | | appointendtime,
|
| | | parentid,
|
| | | relateids,
|
| | | "N"
|
| | | });
|
| | | }catch (Exception e){
|
| | | throw new Exception("数据库错误", e);
|
| | | }
|
| | | db.executeSQL(
|
| | | "UPDATE work_order_list SET "
|
| | | + "title = ?, "
|
| | | + "wstypeid = ?, "
|
| | | + "wstypename = ?, "
|
| | | + "urgencylevel = ?, "
|
| | | + "shape = ?, "
|
| | | + "deadline = ?, "
|
| | | + "stepstatus = ?, "
|
| | | + "originatetypetext = ?, "
|
| | | + "content = ?, "
|
| | | + "address = ?, "
|
| | | + "step_id = ?, "
|
| | | + "org = ?, "
|
| | | + "deptname = ?, "
|
| | | + "dealtime = ?, "
|
| | | + "username = ?, "
|
| | | + "contactname = ?, "
|
| | | + "contactphone = ?, "
|
| | | + "acceptuserid = ?, "
|
| | | + "acceptusername = ?, "
|
| | | + "acceptuseraccount = ?, "
|
| | | + "dealuserid = ?, "
|
| | | + "dealusername = ?, "
|
| | | + "dealuseraccount = ?, "
|
| | | + "flowstatus = ?, "
|
| | | + "attachment = ?, "
|
| | | + "creator = ?, "
|
| | | + "createtime = ?, "
|
| | | + "isplan = ?, "
|
| | | + "originateid = ?, "
|
| | | + "appointstarttime = ?, "
|
| | | + "appointendtime = ?, "
|
| | | + "parentid = ?, "
|
| | | + "relateids = ?, "
|
| | | + "is_notify = ?, "
|
| | | + "oname = ?, "
|
| | | + "otype = ? "
|
| | | + "WHERE order_id = ?",
|
| | | new Object[]{
|
| | | title,
|
| | | wstypeid,
|
| | | wstypename,
|
| | | urgencylevel,
|
| | | shape,
|
| | | deadline,
|
| | | stepstatus,
|
| | | originatetypetext,
|
| | | content,
|
| | | address,
|
| | | stepid,
|
| | | org,
|
| | | deptname,
|
| | | dealtime,
|
| | | username,
|
| | | contactname,
|
| | | contactphone,
|
| | | acceptuserid,
|
| | | acceptusername,
|
| | | acceptuseraccount,
|
| | | dealuserid,
|
| | | dealusername,
|
| | | dealuseraccount,
|
| | | flowstatus,
|
| | | attachment,
|
| | | creator,
|
| | | new Date(),
|
| | | isplan,
|
| | | originateid,
|
| | | appointstarttime,
|
| | | appointendtime,
|
| | | parentid,
|
| | | relateids,
|
| | | "N",
|
| | | oname,
|
| | | otype,
|
| | | orderId
|
| | | });
|
| | |
|
| | | return tranReq.returnJsonState(true, null, null);
|
| | |
|
| | | } finally {
|
| | | db.close();
|
| | | }
|
| | |
|
| | | return tranReq.returnJsonState(true, null, null);
|
| | | }
|
| | |
|
| | | public ModelAndView updateOrderStatus(SMTAIServerRequest tranReq) throws Exception {
|
| | | String id = tranReq.convParamToString("id", true);
|
| | | Integer stepstatus = tranReq.convParamToInteger("stepstatus", true); // 状态代号,如已完成
|
| | |
|
| | | SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | try {
|
| | | db.executeSQL(
|
| | | "UPDATE work_order_list SET stepstatus = ? and status_update_time = ? WHERE id = ?",
|
| | | new Object[] {stepstatus, new Date(),id});
|
| | | } catch (Exception e) {
|
| | | throw new Exception("更新工单状态失败", e);
|
| | | }
|
| | |
|
| | | return tranReq.returnJsonState(true, null, null);
|
| | | }
|
| | |
|
| | | public ModelAndView getOrderList(SMTAIServerRequest tranReq) throws Exception {
|
| | | SMTJsonWriter jsonWr = tranReq.newReturnJsonWriter(true, null, null);
|
| | | SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | try {
|
| | | DBRecords recs = db.querySQL("SELECT * FROM work_order_list", null);
|
| | | if (recs.getRowCount() != 0) {
|
| | | SMTJsonWriter jsonWr = new SMTJsonWriter(false);
|
| | | jsonWr.beginArray("values"); // 开始一个数组,key为 "values"
|
| | |
|
| | | for (DBRecord rec : recs.getRecords()) {
|
| | |
| | |
|
| | | jsonWr.endArray(); // 结束数组
|
| | |
|
| | | return tranReq.returnJson(jsonWr); // 返回整个结构
|
| | | return tranReq.returnJson(jsonWr);
|
| | | // return tranReq.returnJsonState(true, "成功", jsonWr.getRootJson());
|
| | |
|
| | | } else {
|
| | | return tranReq.returnJsonState(false, "未找到工单", null);
|