|
@@ -18,6 +18,9 @@ import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
import java.util.Iterator;
|
|
import java.util.Iterator;
|
|
|
import java.util.Vector;
|
|
import java.util.Vector;
|
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
+
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
|
|
import com.sun.org.apache.xpath.internal.operations.And;
|
|
import com.sun.org.apache.xpath.internal.operations.And;
|
|
|
|
|
|
|
@@ -55,9 +58,9 @@ public class hyworkorder extends PaoCust {
|
|
|
super.add();
|
|
super.add();
|
|
|
|
|
|
|
|
setValue("fworknum", getBillNum("HYORDER"), 11l);
|
|
setValue("fworknum", getBillNum("HYORDER"), 11l);
|
|
|
- if(getSite().equals("HY")) {
|
|
|
|
|
|
|
+ if (getSite().equals("HY")) {
|
|
|
setValue("fstatus", "待开始", 11l);
|
|
setValue("fstatus", "待开始", 11l);
|
|
|
- }else if(getSite().equals("TZ")) {
|
|
|
|
|
|
|
+ } else if (getSite().equals("TZ")) {
|
|
|
setValue("fstatus", "待接单", 11l);
|
|
setValue("fstatus", "待接单", 11l);
|
|
|
}
|
|
}
|
|
|
setValue("progress", 0, 11l);
|
|
setValue("progress", 0, 11l);
|
|
@@ -119,12 +122,12 @@ public class hyworkorder extends PaoCust {
|
|
|
System.out.println(333);
|
|
System.out.println(333);
|
|
|
int index = 0;
|
|
int index = 0;
|
|
|
for (int i = 0; i < templatenode.count(); i++) {
|
|
for (int i = 0; i < templatenode.count(); i++) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
PaoRemote pao = templatenode.getPao(i);
|
|
PaoRemote pao = templatenode.getPao(i);
|
|
|
System.out.println(pao.getString("oneprocessname"));
|
|
System.out.println(pao.getString("oneprocessname"));
|
|
|
PaoSetRemote templatenode2 = pao.getPaoSet("hytemplatenode2");
|
|
PaoSetRemote templatenode2 = pao.getPaoSet("hytemplatenode2");
|
|
|
if (templatenode2.isEmpty()) {
|
|
if (templatenode2.isEmpty()) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
PaoRemote remote = ordernode.addAtEnd();
|
|
PaoRemote remote = ordernode.addAtEnd();
|
|
|
remote.setValue("FROWNUM", ++index, 11l);
|
|
remote.setValue("FROWNUM", ++index, 11l);
|
|
|
remote.setValue("oneprocessname", pao.getString("oneprocessname"), 11l);
|
|
remote.setValue("oneprocessname", pao.getString("oneprocessname"), 11l);
|
|
@@ -178,7 +181,8 @@ public class hyworkorder extends PaoCust {
|
|
|
remote2.setValue("fiscontract", templatenode2_pao.getString("fiscontract"), 11l);
|
|
remote2.setValue("fiscontract", templatenode2_pao.getString("fiscontract"), 11l);
|
|
|
remote2.setValue("FISCOMPLETE", templatenode2_pao.getString("FISCOMPLETE"), 11l);
|
|
remote2.setValue("FISCOMPLETE", templatenode2_pao.getString("FISCOMPLETE"), 11l);
|
|
|
remote2.setValue("FISADDTRAINING", templatenode2_pao.getString("FISADDTRAINING"), 11l);
|
|
remote2.setValue("FISADDTRAINING", templatenode2_pao.getString("FISADDTRAINING"), 11l);
|
|
|
- remote2.setValue("FISADDTRAININGTITEM", templatenode2_pao.getString("FISADDTRAININGTITEM"), 11l);
|
|
|
|
|
|
|
+ remote2.setValue("FISADDTRAININGTITEM",
|
|
|
|
|
+ templatenode2_pao.getString("FISADDTRAININGTITEM"), 11l);
|
|
|
remote2.setValue("FISPAID", templatenode2_pao.getString("FISPAID"), 11l);
|
|
remote2.setValue("FISPAID", templatenode2_pao.getString("FISPAID"), 11l);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -201,36 +205,72 @@ public class hyworkorder extends PaoCust {
|
|
|
remote.setValue("hyworkernum", getString("PROJECTLEADER"), 2l);
|
|
remote.setValue("hyworkernum", getString("PROJECTLEADER"), 2l);
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
|
- PaoSetRemote hyworker = P2Server.getP2Server().getPaoSet("hyworker", P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
- PaoSetRemote tagents = P2Server.getP2Server().getPaoSet("tagents", P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
- PaoSetRemote afterserviceorder = P2Server.getP2Server().getPaoSet("AFTERSERVICEORDER", P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
- afterserviceorder.setWhere("SERVICENUM='"+getString("SERVERNUM")+"'");
|
|
|
|
|
- tagents.setWhere("FAGENTNUM='"+getString("FAGENTNUM")+"'");
|
|
|
|
|
- hyworker.setWhere("HYWORKERNUM ='" + getString("PROJECTLEADER") + "'");
|
|
|
|
|
- hyworker.reset();
|
|
|
|
|
- if(!hyworker .isEmpty() && getSite().equals("HY")){
|
|
|
|
|
- String submitby = afterserviceorder.getPao(0).getString("SUBMITBY");
|
|
|
|
|
- String phone = hyworker.getPao(0).getString("WORKPHONE");
|
|
|
|
|
- String fagentshortname = tagents.getPao(0).getString("FAGENTSHORTNAME");
|
|
|
|
|
- HttpURLRest rest = new HttpURLRest("http://smssh1.253.com/msg/v1/send/json");
|
|
|
|
|
- rest.addHeader("Content-type", "application/json");
|
|
|
|
|
- org.json.JSONObject jsonObject = new org.json.JSONObject();
|
|
|
|
|
- jsonObject.put("account", "N3147701");
|
|
|
|
|
- jsonObject.put("password", "4ClGyab6fv6a87");
|
|
|
|
|
- jsonObject.put("msg", "【Banninger】工单号:" + getString("FWORKNUM") + "已指派请处理,客户名称:"+fagentshortname+",提交人:"+submitby+",备注:"+getString("FNOTES"));
|
|
|
|
|
- jsonObject.put("phone", phone);
|
|
|
|
|
- rest.addRawBody(jsonObject.toString());
|
|
|
|
|
- String s = rest.post();
|
|
|
|
|
- PaoSetRemote verCodehistory = P2Server.getP2Server().getPaoSet("VerCodehistory", P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
- PaoRemote remote = verCodehistory.addAtEnd();
|
|
|
|
|
- remote.setValue("phone", phone);
|
|
|
|
|
- remote.setValue("msg", "【Banninger】工单号:" + getString("FWORKNUM") + "已指派请处理,客户名称:"+fagentshortname+",提交人:"+submitby+",备注:"+getString("FNOTES"));
|
|
|
|
|
- remote.setValue("content", s);
|
|
|
|
|
- verCodehistory.save();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ PaoSetRemote hyworker = P2Server.getP2Server().getPaoSet("hyworker",
|
|
|
|
|
+ P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
+ PaoSetRemote tagents = P2Server.getP2Server().getPaoSet("tagents",
|
|
|
|
|
+ P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
+ PaoSetRemote afterserviceorder = P2Server.getP2Server().getPaoSet("AFTERSERVICEORDER",
|
|
|
|
|
+ P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
+ afterserviceorder.setWhere("SERVICENUM='" + getString("SERVERNUM") + "'");
|
|
|
|
|
+ tagents.setWhere("FAGENTNUM='" + getString("FAGENTNUM") + "'");
|
|
|
|
|
+ hyworker.setWhere("HYWORKERNUM ='" + getString("PROJECTLEADER") + "'");
|
|
|
|
|
+ hyworker.reset();
|
|
|
|
|
+ if (!hyworker.isEmpty() && getSite().equals("HY")) {
|
|
|
|
|
+ String submitby = afterserviceorder.getPao(0).getString("SUBMITBY");
|
|
|
|
|
+ String phone = hyworker.getPao(0).getString("WORKPHONE");
|
|
|
|
|
+ String fagentshortname = tagents.getPao(0).getString("FAGENTSHORTNAME");
|
|
|
|
|
+ HttpURLRest rest = new HttpURLRest("http://smssh1.253.com/msg/v1/send/json");
|
|
|
|
|
+ rest.addHeader("Content-type", "application/json");
|
|
|
|
|
+ org.json.JSONObject jsonObject = new org.json.JSONObject();
|
|
|
|
|
+ jsonObject.put("account", "N3147701");
|
|
|
|
|
+ jsonObject.put("password", "4ClGyab6fv6a87");
|
|
|
|
|
+ jsonObject.put("msg", "【Banninger】工单号:" + getString("FWORKNUM") + "已指派请处理,客户名称:" + fagentshortname
|
|
|
|
|
+ + ",提交人:" + submitby + ",备注:" + getString("FNOTES"));
|
|
|
|
|
+ jsonObject.put("phone", phone);
|
|
|
|
|
+ rest.addRawBody(jsonObject.toString());
|
|
|
|
|
+ String s = rest.post();
|
|
|
|
|
+ PaoSetRemote verCodehistory = P2Server.getP2Server().getPaoSet("VerCodehistory",
|
|
|
|
|
+ P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
+ PaoRemote remote = verCodehistory.addAtEnd();
|
|
|
|
|
+ remote.setValue("phone", phone);
|
|
|
|
|
+ remote.setValue("msg", "【Banninger】工单号:" + getString("FWORKNUM") + "已指派请处理,客户名称:" + fagentshortname
|
|
|
|
|
+ + ",提交人:" + submitby + ",备注:" + getString("FNOTES"));
|
|
|
|
|
+ remote.setValue("content", s);
|
|
|
|
|
+ verCodehistory.save();
|
|
|
|
|
+ }
|
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (fieldname.equalsIgnoreCase("SCENEPHONE")) {
|
|
|
|
|
+ if (!StringUtils.isBlank(getString("SCENEPHONE"))) {
|
|
|
|
|
+ if (!Pattern.matches("^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$", getString("SCENEPHONE"))) {
|
|
|
|
|
+ throw new P2AppException("", "手机格式有误");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (getSite().equals("TZ")) {
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ HttpURLRest rest = new HttpURLRest("http://smssh1.253.com/msg/v1/send/json");
|
|
|
|
|
+ rest.addHeader("Content-type", "application/json");
|
|
|
|
|
+ org.json.JSONObject jsonObject = new org.json.JSONObject();
|
|
|
|
|
+ jsonObject.put("account", "N3147701");
|
|
|
|
|
+ jsonObject.put("password", "4ClGyab6fv6a87");
|
|
|
|
|
+ jsonObject.put("msg", "【Banninger】工单号:" + getString("FWORKNUM") + "已创建,请处理,工单查询链接:" + "1234");
|
|
|
|
|
+ jsonObject.put("phone", getString("SCENEPHONE"));
|
|
|
|
|
+ rest.addRawBody(jsonObject.toString());
|
|
|
|
|
+ String s = rest.post();
|
|
|
|
|
+ PaoSetRemote verCodehistory = P2Server.getP2Server().getPaoSet("VerCodehistory",
|
|
|
|
|
+ P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
+ PaoRemote remote = verCodehistory.addAtEnd();
|
|
|
|
|
+ remote.setValue("phone", getString("SCENEPHONE"));
|
|
|
|
|
+ remote.setValue("msg", "【Banninger】工单号:" + getString("FWORKNUM") + "已创建,请处理,工单查询链接:" + "1234");
|
|
|
|
|
+ remote.setValue("content", s);
|
|
|
|
|
+ verCodehistory.save();
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ // TODO: handle exception
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -288,16 +328,16 @@ public class hyworkorder extends PaoCust {
|
|
|
serviceformPao.setValue("fstatus", "已完成", 11l);
|
|
serviceformPao.setValue("fstatus", "已完成", 11l);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if(getSite().equals("TZ")) {
|
|
|
|
|
|
|
+ if (getSite().equals("TZ")) {
|
|
|
/** 给经销商发送消息 **/
|
|
/** 给经销商发送消息 **/
|
|
|
- PaoSetRemote paoSet = getPaoSet("$workermassage", "workermassage", "");
|
|
|
|
|
- PaoRemote remote = paoSet.addAtEnd();
|
|
|
|
|
- remote.setValue("ftype","经销商消息",11l);
|
|
|
|
|
- remote.setValue("title","工单:"+getString("fworknum")+"已经完成",11l);
|
|
|
|
|
- remote.setValue("content","工单:"+getString("fworknum")+"已经完成",11l);
|
|
|
|
|
- remote.setValue("phone",getString("fagentnum"),11l);
|
|
|
|
|
|
|
+ PaoSetRemote paoSet = getPaoSet("$workermassage", "workermassage", "");
|
|
|
|
|
+ PaoRemote remote = paoSet.addAtEnd();
|
|
|
|
|
+ remote.setValue("ftype", "经销商消息", 11l);
|
|
|
|
|
+ remote.setValue("title", "工单:" + getString("fworknum") + "已经完成", 11l);
|
|
|
|
|
+ remote.setValue("content", "工单:" + getString("fworknum") + "已经完成", 11l);
|
|
|
|
|
+ remote.setValue("phone", getString("fagentnum"), 11l);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
setValue("Acceptancedate", new Date(), 11l);
|
|
setValue("Acceptancedate", new Date(), 11l);
|
|
|
PaoSetRemote paoSet1 = getPaoSet("$hyworker", "hyworker", "hyworkernum='" + hrid + "'");
|
|
PaoSetRemote paoSet1 = getPaoSet("$hyworker", "hyworker", "hyworkernum='" + hrid + "'");
|
|
|
if (!paoSet1.isEmpty()) {
|
|
if (!paoSet1.isEmpty()) {
|