|
@@ -170,11 +170,11 @@ public class HyWorkOrder extends Controller {
|
|
|
String[] from_nodes = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
String[] from_nodes = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "ownerid", "supid", "ischilden", "isconfirm", "fisupload",
|
|
"operatingtime", "fnotes", "ownerid", "supid", "ischilden", "isconfirm", "fisupload",
|
|
|
"fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
|
|
"fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
|
|
|
- "fiscontract","confirmation" };
|
|
|
|
|
|
|
+ "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem"};
|
|
|
String[] to_nodes = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
String[] to_nodes = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
|
|
"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
|
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
|
|
|
- "fiscontract","confirmation"};
|
|
|
|
|
|
|
+ "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem"};
|
|
|
for (int i = 0; i < ordernode.count(); i++) {
|
|
for (int i = 0; i < ordernode.count(); i++) {
|
|
|
|
|
|
|
|
PaoRemote pao = ordernode.getPao(i);
|
|
PaoRemote pao = ordernode.getPao(i);
|
|
@@ -236,11 +236,11 @@ public class HyWorkOrder extends Controller {
|
|
|
String[] from_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
String[] from_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "ownerid", "supid", "ischilden", "isconfirm",
|
|
"operatingtime", "fnotes", "ownerid", "supid", "ischilden", "isconfirm",
|
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
|
|
|
- "fisconfirmation", "fiscontract","confirmation" };
|
|
|
|
|
|
|
+ "fisconfirmation", "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem"};
|
|
|
String[] to_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
String[] to_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
|
|
"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
|
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
|
|
|
- "fisconfirmation", "fiscontract","confirmation" };
|
|
|
|
|
|
|
+ "fisconfirmation", "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem"};
|
|
|
for (int j = 0; j < ordernode2.count(); j++) {
|
|
for (int j = 0; j < ordernode2.count(); j++) {
|
|
|
PaoRemote pao1 = ordernode2.getPao(j);
|
|
PaoRemote pao1 = ordernode2.getPao(j);
|
|
|
Row row1 = getrow(from_nodes2, to_nodes2, pao1);
|
|
Row row1 = getrow(from_nodes2, to_nodes2, pao1);
|
|
@@ -424,6 +424,16 @@ public class HyWorkOrder extends Controller {
|
|
|
+ "hyworkorder_titem t\n" + "where EXISTS(select 1 from hyWorkorder t1 where t1.fworknum='"
|
|
+ "hyworkorder_titem t\n" + "where EXISTS(select 1 from hyWorkorder t1 where t1.fworknum='"
|
|
|
+ where.getString("fworknum") + "' and t1.hyWorkorderid=t.fparentid)\n" + " and t.sourcenode='"
|
|
+ where.getString("fworknum") + "' and t1.hyWorkorderid=t.fparentid)\n" + " and t.sourcenode='"
|
|
|
+ where.getString("frownum") + "'");
|
|
+ where.getString("frownum") + "'");
|
|
|
|
|
+
|
|
|
|
|
+ /** 节点关联培训物料查询 **/
|
|
|
|
|
+ Rows rows_traintitem = dbConnect.runSqlQuery("select t.fitemno,t2.fitemname,t2.fmodel,t2.fspec,t.fqty from HYORDERNODE_TITEM t left join titem t2 on t.fitemno=t2.fitemno and t.siteid=t2.siteid\n"
|
|
|
|
|
+ + "where EXISTS(select 1 from hyordernode t1 where t1.hyordernodeid=t.fparentid and t1.hyordernodeid="
|
|
|
|
|
+ + rowdetail.getInteger("ownerid") + ") and t.siteid='" + siteid + "'");
|
|
|
|
|
+
|
|
|
|
|
+ /** 节点关联培训人员查询 **/
|
|
|
|
|
+ Rows rows_trainers= dbConnect.runSqlQuery("select t.fname,t.job,t.phone,t.fagentnum,t2.fagentshortname from HYORDERNODE_trainers t left join tagents t2 on t.fagentnum=t2.fagentnum and t.siteid=t2.siteid\n"
|
|
|
|
|
+ + "where EXISTS(select 1 from hyordernode t1 where t1.hyordernodeid=t.fparentid and t1.hyordernodeid="
|
|
|
|
|
+ + rowdetail.getInteger("ownerid") + ") and t.siteid='" + siteid + "'");
|
|
|
|
|
|
|
|
// SQLFactory factory_imgurl = new SQLFactory(this, "物料图片查询");
|
|
// SQLFactory factory_imgurl = new SQLFactory(this, "物料图片查询");
|
|
|
// factory_imgurl.addParameter("fagentnum", rowdetail.getString("fagentnum"));
|
|
// factory_imgurl.addParameter("fagentnum", rowdetail.getString("fagentnum"));
|
|
@@ -441,7 +451,8 @@ public class HyWorkOrder extends Controller {
|
|
|
|
|
|
|
|
rowdetail.put("team", rows_team);
|
|
rowdetail.put("team", rows_team);
|
|
|
rowdetail.put("titem", rows_titem);
|
|
rowdetail.put("titem", rows_titem);
|
|
|
-
|
|
|
|
|
|
|
+ rowdetail.put("traintitem", rows_traintitem);
|
|
|
|
|
+ rowdetail.put("trainers", rows_trainers);
|
|
|
return getReturnObject_suc(rowdetail, false).toString();
|
|
return getReturnObject_suc(rowdetail, false).toString();
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -508,6 +519,56 @@ public class HyWorkOrder extends Controller {
|
|
|
remote.setValue("hyworkernum", s1, 2l);
|
|
remote.setValue("hyworkernum", s1, 2l);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /** 添加培训人员 **/
|
|
|
|
|
+ if (where.containsKey("trainers")) {
|
|
|
|
|
+ JSONArray trainers = where.getJSONArray("trainers");
|
|
|
|
|
+ PaoSetRemote ordernode_trainers = ordernodePao.getPaoSet("HYORDERNODE_TRAINERS");
|
|
|
|
|
+ ordernode_trainers.deleteAll();
|
|
|
|
|
+
|
|
|
|
|
+ for (Object o : trainers) {
|
|
|
|
|
+ JSONObject resultObject = (JSONObject) o;
|
|
|
|
|
+ PaoSetRemote ordernode_trainers1 = ordernodePao.getPaoSet("HYORDERNODE_TRAINERS");
|
|
|
|
|
+ PaoRemote remote = ordernode_trainers1.addAtEnd();
|
|
|
|
|
+ remote.setValue("fworknum",where.getString("fworknum"),11l);
|
|
|
|
|
+ System.out.println(555);
|
|
|
|
|
+ if(resultObject.containsKey("fname") && resultObject.getString("fname")!=null && resultObject.getString("fname").length()!=0) {
|
|
|
|
|
+ remote.setValue("fname", resultObject.getString("fname"), 2l);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(resultObject.containsKey("job") && resultObject.getString("job")!=null && resultObject.getString("job").length()!=0) {
|
|
|
|
|
+ remote.setValue("job", resultObject.getString("job"), 2l);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(resultObject.containsKey("phone") && resultObject.getString("phone")!=null && resultObject.getString("phone").length()!=0) {
|
|
|
|
|
+ remote.setValue("phone", resultObject.getString("phone"), 2l);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(resultObject.containsKey("fagentnum") && resultObject.getString("fagentnum")!=null && resultObject.getString("fagentnum").length()!=0) {
|
|
|
|
|
+ remote.setValue("fagentnum", resultObject.getString("fagentnum"), 2l);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /** 添加培训商品 **/
|
|
|
|
|
+ if (where.containsKey("traintitem")) {
|
|
|
|
|
+ JSONArray traintitem = where.getJSONArray("traintitem");
|
|
|
|
|
+ PaoSetRemote ordernode_traintitem = ordernodePao.getPaoSet("HYORDERNODE_TITEM");
|
|
|
|
|
+ ordernode_traintitem.deleteAll();
|
|
|
|
|
+
|
|
|
|
|
+ for (Object o : traintitem) {
|
|
|
|
|
+ JSONObject resultObject = (JSONObject) o;
|
|
|
|
|
+ PaoSetRemote ordernode_traintitem1 = ordernodePao.getPaoSet("HYORDERNODE_TITEM");
|
|
|
|
|
+ PaoRemote remote = ordernode_traintitem1.addAtEnd();
|
|
|
|
|
+ remote.setValue("fworknum",where.getString("fworknum"),11l);
|
|
|
|
|
+ if(resultObject.containsKey("fitemno") && resultObject.getString("fitemno")!=null && resultObject.getString("fitemno").length()!=0) {
|
|
|
|
|
+ remote.setValue("fitemno", resultObject.getString("fitemno"), 2l);
|
|
|
|
|
+ }
|
|
|
|
|
+ if(resultObject.containsKey("fqty") && resultObject.getString("fqty")!=null && resultObject.getString("fqty").length()!=0) {
|
|
|
|
|
+ remote.setValue("fqty", resultObject.getString("fqty"), 2l);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
/** 添加是否合格项 **/
|
|
/** 添加是否合格项 **/
|
|
|
// if(where.containsKey("qualified")){
|
|
// if(where.containsKey("qualified")){
|
|
|
// ordernodePao.setValue("qualified",where.getBoolean("qualified"),11l);
|
|
// ordernodePao.setValue("qualified",where.getBoolean("qualified"),11l);
|
|
@@ -1122,5 +1183,64 @@ public class HyWorkOrder extends Controller {
|
|
|
rows.add(row9);
|
|
rows.add(row9);
|
|
|
return getReturnObject_suc(rows,true).toString();
|
|
return getReturnObject_suc(rows,true).toString();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /** 经销商列表 **/
|
|
|
|
|
+ public String querytagents() {
|
|
|
|
|
+ if (StringUtils.isBlank(hrid))
|
|
|
|
|
+ return getReturnObject_err("hrid为空").toString();
|
|
|
|
|
+// if(StringUtils.isBlank(fagentnum))return getReturnObject_err("fagentnum为空").toString();
|
|
|
|
|
+ if (StringUtils.isBlank(siteid))
|
|
|
|
|
+ return getReturnObject_err("siteid为空").toString();
|
|
|
|
|
+ JSONObject where = content.getJSONObject("where");
|
|
|
|
|
+ String wherestr = "1=1";
|
|
|
|
|
+// String s[] = { "fstatus" };
|
|
|
|
|
+// for (String s1 : s) {
|
|
|
|
|
+// if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
|
|
|
|
|
+// return getReturnObject_err("缺少" + s1 + "参数").toString();
|
|
|
|
|
+// }
|
|
|
|
|
+ if (where != null) {
|
|
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
|
|
+ if (where.containsKey("condtion") && !StringUtils.isBlank(where.getString("condtion"))) {
|
|
|
|
|
+ wherestr += " and (fagentnum like '%" + where.getString("condtion") + "%' or fagentshortname like '%" + where.getString("condtion") +"%')";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ SQLFactory factory = new SQLFactory(this, "经销商查询", pageSize, pageNumber,"fagentnum asc");
|
|
|
|
|
+ //factory.addParameter("hrid", hrid);
|
|
|
|
|
+ factory.addParameter("siteid", siteid);
|
|
|
|
|
+ factory.addParameter_SQL("where", wherestr);
|
|
|
|
|
+ Rows rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
|
|
+ return getReturnObject_suc_page(rows, true, 0).toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ return getReturnObject_err("缺少where参数").toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ /** 经销商列表 **/
|
|
|
|
|
+ public String querytitem() {
|
|
|
|
|
+ if (StringUtils.isBlank(hrid))
|
|
|
|
|
+ return getReturnObject_err("hrid为空").toString();
|
|
|
|
|
+// if(StringUtils.isBlank(fagentnum))return getReturnObject_err("fagentnum为空").toString();
|
|
|
|
|
+ if (StringUtils.isBlank(siteid))
|
|
|
|
|
+ return getReturnObject_err("siteid为空").toString();
|
|
|
|
|
+ JSONObject where = content.getJSONObject("where");
|
|
|
|
|
+ String wherestr = "1=1";
|
|
|
|
|
+// String s[] = { "fstatus" };
|
|
|
|
|
+// for (String s1 : s) {
|
|
|
|
|
+// if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
|
|
|
|
|
+// return getReturnObject_err("缺少" + s1 + "参数").toString();
|
|
|
|
|
+// }
|
|
|
|
|
+ if (where != null) {
|
|
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
|
|
+ if (where.containsKey("condtion") && !StringUtils.isBlank(where.getString("condtion"))) {
|
|
|
|
|
+ wherestr += " and (fitemno like '%" + where.getString("condtion") + "%' "
|
|
|
|
|
+ + "or fitemname like '%" + where.getString("condtion") +"%' "
|
|
|
|
|
+ + "or fmodel like '%" + where.getString("condtion") +"%')";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ SQLFactory factory = new SQLFactory(this, "培训物料查询", pageSize, pageNumber,"fitemno asc");
|
|
|
|
|
+ //factory.addParameter("hrid", hrid);
|
|
|
|
|
+ factory.addParameter("siteid", siteid);
|
|
|
|
|
+ factory.addParameter_SQL("where", wherestr);
|
|
|
|
|
+ Rows rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
|
|
+ return getReturnObject_suc_page(rows, true, 0).toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ return getReturnObject_err("缺少where参数").toString();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|