|
|
@@ -65,6 +65,7 @@ public class HyWorkOrder extends Controller {
|
|
|
}
|
|
|
return getReturnObject_err("缺少where参数").toString();
|
|
|
}
|
|
|
+
|
|
|
/** 服务管理查询工单列表 **/
|
|
|
public String list_manage() {
|
|
|
if (StringUtils.isBlank(hrid))
|
|
|
@@ -86,11 +87,11 @@ public class HyWorkOrder extends Controller {
|
|
|
}
|
|
|
|
|
|
SQLFactory factory = new SQLFactory(this, "服务管理工单列表查询", pageSize, pageNumber, "t.createdate desc");
|
|
|
- //factory.addParameter("hrid", hrid);
|
|
|
+ // factory.addParameter("hrid", hrid);
|
|
|
factory.addParameter("siteid", siteid);
|
|
|
factory.addParameter_SQL("where", wherestr);
|
|
|
SQLFactory factory2 = new SQLFactory(this, "服务管理工单状态统计");
|
|
|
- //factory2.addParameter("hrid", hrid);
|
|
|
+ // factory2.addParameter("hrid", hrid);
|
|
|
factory2.addParameter("siteid", siteid);
|
|
|
Rows rows_total = dbConnect.runSqlQuery(factory2.getSQL());
|
|
|
Rows rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
@@ -139,19 +140,20 @@ public class HyWorkOrder extends Controller {
|
|
|
if (!workorder_team.isEmpty()) {
|
|
|
for (int i = 0; i < workorder_team.count(); i++) {
|
|
|
Row row = new Row();
|
|
|
- if(workorderpao.getString("PROJECTLEADER").equals(workorder_team.getPao(i).getString("hyworkernum"))) {
|
|
|
+ if (workorderpao.getString("PROJECTLEADER")
|
|
|
+ .equals(workorder_team.getPao(i).getString("hyworkernum"))) {
|
|
|
row.put("workername", workorder_team.getPao(i).getString("workername"));
|
|
|
row.put("role", workorder_team.getPao(i).getString("ftype"));
|
|
|
row.put("workerllphone", workorder_team.getPao(i).getString("workephone"));
|
|
|
row.put("hyworkernum", workorder_team.getPao(i).getString("hyworkernum"));
|
|
|
- row.put("fisdefault",1);
|
|
|
- }else {
|
|
|
+ row.put("fisdefault", 1);
|
|
|
+ } else {
|
|
|
// t.workername,t.ftype role,t.workephone workerllphone
|
|
|
row.put("workername", workorder_team.getPao(i).getString("workername"));
|
|
|
row.put("role", workorder_team.getPao(i).getString("ftype"));
|
|
|
row.put("workerllphone", workorder_team.getPao(i).getString("workephone"));
|
|
|
row.put("hyworkernum", workorder_team.getPao(i).getString("hyworkernum"));
|
|
|
- row.put("fisdefault",0);
|
|
|
+ row.put("fisdefault", 0);
|
|
|
}
|
|
|
rows_team.add(row);
|
|
|
}
|
|
|
@@ -170,11 +172,11 @@ public class HyWorkOrder extends Controller {
|
|
|
String[] from_nodes = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "ownerid", "supid", "ischilden", "isconfirm", "fisupload",
|
|
|
"fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
|
|
|
- "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem","fispaid"};
|
|
|
+ "fiscontract", "confirmation", "fisaddtraining", "fisaddtrainingtitem", "fispaid" };
|
|
|
String[] to_nodes = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
|
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
|
|
|
- "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem","fispaid"};
|
|
|
+ "fiscontract", "confirmation", "fisaddtraining", "fisaddtrainingtitem", "fispaid" };
|
|
|
for (int i = 0; i < ordernode.count(); i++) {
|
|
|
|
|
|
PaoRemote pao = ordernode.getPao(i);
|
|
|
@@ -236,11 +238,13 @@ public class HyWorkOrder extends Controller {
|
|
|
String[] from_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "ownerid", "supid", "ischilden", "isconfirm",
|
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
|
|
|
- "fisconfirmation", "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem","fispaid"};
|
|
|
+ "fisconfirmation", "fiscontract", "confirmation", "fisaddtraining",
|
|
|
+ "fisaddtrainingtitem", "fispaid" };
|
|
|
String[] to_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
|
|
|
"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
|
|
|
"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
|
|
|
- "fisconfirmation", "fiscontract","confirmation","fisaddtraining","fisaddtrainingtitem","fispaid"};
|
|
|
+ "fisconfirmation", "fiscontract", "confirmation", "fisaddtraining",
|
|
|
+ "fisaddtrainingtitem", "fispaid" };
|
|
|
for (int j = 0; j < ordernode2.count(); j++) {
|
|
|
PaoRemote pao1 = ordernode2.getPao(j);
|
|
|
Row row1 = getrow(from_nodes2, to_nodes2, pao1);
|
|
|
@@ -424,16 +428,18 @@ public class HyWorkOrder extends Controller {
|
|
|
+ "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("frownum") + "'");
|
|
|
-
|
|
|
+
|
|
|
/** 节点关联培训物料查询 **/
|
|
|
- Rows rows_traintitem = dbConnect.runSqlQuery("select t.fitemno,t.fitemname,t.fmodel,t.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_traintitem = dbConnect.runSqlQuery(
|
|
|
+ "select t.fitemno,t.fitemname,t.fmodel,t.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 + "'");
|
|
|
+ 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, "物料图片查询");
|
|
|
// factory_imgurl.addParameter("fagentnum", rowdetail.getString("fagentnum"));
|
|
|
@@ -519,7 +525,7 @@ public class HyWorkOrder extends Controller {
|
|
|
remote.setValue("hyworkernum", s1, 2l);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/** 添加培训人员 **/
|
|
|
if (where.containsKey("trainers")) {
|
|
|
JSONArray trainers = where.getJSONArray("trainers");
|
|
|
@@ -527,27 +533,31 @@ public class HyWorkOrder extends Controller {
|
|
|
ordernode_trainers.deleteAll();
|
|
|
|
|
|
for (Object o : trainers) {
|
|
|
- JSONObject resultObject = (JSONObject) o;
|
|
|
+ JSONObject resultObject = (JSONObject) o;
|
|
|
PaoSetRemote ordernode_trainers1 = ordernodePao.getPaoSet("HYORDERNODE_TRAINERS");
|
|
|
PaoRemote remote = ordernode_trainers1.addAtEnd();
|
|
|
- remote.setValue("fworknum",where.getString("fworknum"),11l);
|
|
|
+ remote.setValue("fworknum", where.getString("fworknum"), 11l);
|
|
|
System.out.println(555);
|
|
|
- if(resultObject.containsKey("fname") && resultObject.getString("fname")!=null && resultObject.getString("fname").length()!=0) {
|
|
|
+ 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) {
|
|
|
+ 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) {
|
|
|
+ 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) {
|
|
|
+ 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");
|
|
|
@@ -555,27 +565,31 @@ public class HyWorkOrder extends Controller {
|
|
|
ordernode_traintitem.deleteAll();
|
|
|
|
|
|
for (Object o : traintitem) {
|
|
|
- JSONObject resultObject = (JSONObject) o;
|
|
|
+ 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("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("fitemname") && resultObject.getString("fitemname")!=null && resultObject.getString("fitemname").length()!=0) {
|
|
|
+ if (resultObject.containsKey("fitemname") && resultObject.getString("fitemname") != null
|
|
|
+ && resultObject.getString("fitemname").length() != 0) {
|
|
|
remote.setValue("fitemname", resultObject.getString("fitemname"), 2l);
|
|
|
}
|
|
|
- if(resultObject.containsKey("fmodel") && resultObject.getString("fmodel")!=null && resultObject.getString("fmodel").length()!=0) {
|
|
|
+ if (resultObject.containsKey("fmodel") && resultObject.getString("fmodel") != null
|
|
|
+ && resultObject.getString("fmodel").length() != 0) {
|
|
|
remote.setValue("fmodel", resultObject.getString("fmodel"), 2l);
|
|
|
}
|
|
|
- if(resultObject.containsKey("fspec") && resultObject.getString("fspec")!=null && resultObject.getString("fspec").length()!=0) {
|
|
|
+ if (resultObject.containsKey("fspec") && resultObject.getString("fspec") != null
|
|
|
+ && resultObject.getString("fspec").length() != 0) {
|
|
|
remote.setValue("fspec", resultObject.getString("fspec"), 2l);
|
|
|
}
|
|
|
- if(resultObject.containsKey("fqty") && resultObject.getString("fqty")!=null && resultObject.getString("fqty").length()!=0) {
|
|
|
+ if (resultObject.containsKey("fqty") && resultObject.getString("fqty") != null
|
|
|
+ && resultObject.getString("fqty").length() != 0) {
|
|
|
remote.setValue("fqty", resultObject.getString("fqty"), 2l);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
/** 添加是否合格项 **/
|
|
|
@@ -792,6 +806,15 @@ public class HyWorkOrder extends Controller {
|
|
|
return getReturnObject_err("非进行中不可暂停").toString();
|
|
|
}
|
|
|
hyworkorder.setValue("fstatus", "暂停", 11L);
|
|
|
+ if (hyworkorder.getSite().equals("TZ")) {
|
|
|
+
|
|
|
+ PaoSetRemote workermassage = hyworkorder.getPaoSet("$workermassage", "workermassage", "");
|
|
|
+ PaoRemote remote1 = workermassage.addAtEnd();
|
|
|
+ remote1.setValue("ftype", "工单消息", 11l);
|
|
|
+ remote1.setValue("title", "服务工单:" + hyworkorder.getString("FWORKNUM") + "已暂停", 11l);
|
|
|
+ remote1.setValue("content", "服务工单:" + hyworkorder.getString("FWORKNUM") + "已暂停", 11l);
|
|
|
+ remote1.setValue("phone", hyworkorder.getString("PROJECTLEADER"), 11l);
|
|
|
+ }
|
|
|
workorders.save();
|
|
|
return getReturnObject_suc().toString();
|
|
|
} catch (P2Exception e) {
|
|
|
@@ -803,7 +826,8 @@ public class HyWorkOrder extends Controller {
|
|
|
|
|
|
return getReturnObject_err("where参数不存在").toString();
|
|
|
}
|
|
|
- /** 工单启用**/
|
|
|
+
|
|
|
+ /** 工单启用 **/
|
|
|
public String used() {
|
|
|
if (StringUtils.isBlank(hrid))
|
|
|
return getReturnObject_err("hrid为空").toString();
|
|
|
@@ -833,6 +857,15 @@ public class HyWorkOrder extends Controller {
|
|
|
return getReturnObject_err("非暂停不可启用").toString();
|
|
|
}
|
|
|
hyworkorder.setValue("fstatus", "进行中", 11L);
|
|
|
+ if (hyworkorder.getSite().equals("TZ")) {
|
|
|
+
|
|
|
+ PaoSetRemote workermassage = hyworkorder.getPaoSet("$workermassage", "workermassage", "");
|
|
|
+ PaoRemote remote1 = workermassage.addAtEnd();
|
|
|
+ remote1.setValue("ftype", "工单消息", 11l);
|
|
|
+ remote1.setValue("title", "服务工单:" + hyworkorder.getString("FWORKNUM") + "已启用请处理", 11l);
|
|
|
+ remote1.setValue("content", "服务工单:" + hyworkorder.getString("FWORKNUM") + "已启用请处理", 11l);
|
|
|
+ remote1.setValue("phone", hyworkorder.getString("PROJECTLEADER"), 11l);
|
|
|
+ }
|
|
|
workorders.save();
|
|
|
return getReturnObject_suc().toString();
|
|
|
} catch (P2Exception e) {
|
|
|
@@ -844,6 +877,7 @@ public class HyWorkOrder extends Controller {
|
|
|
|
|
|
return getReturnObject_err("where参数不存在").toString();
|
|
|
}
|
|
|
+
|
|
|
/** 工单作废 **/
|
|
|
public String cancel() {
|
|
|
if (StringUtils.isBlank(hrid))
|
|
|
@@ -874,6 +908,15 @@ public class HyWorkOrder extends Controller {
|
|
|
return getReturnObject_err("已完成不可作废").toString();
|
|
|
}
|
|
|
hyworkorder.setValue("fstatus", "作废", 11L);
|
|
|
+ if (hyworkorder.getSite().equals("TZ")) {
|
|
|
+
|
|
|
+ PaoSetRemote workermassage = hyworkorder.getPaoSet("$workermassage", "workermassage", "");
|
|
|
+ PaoRemote remote1 = workermassage.addAtEnd();
|
|
|
+ remote1.setValue("ftype", "工单消息", 11l);
|
|
|
+ remote1.setValue("title", "服务工单:" + hyworkorder.getString("FWORKNUM") + "已作废", 11l);
|
|
|
+ remote1.setValue("content", "服务工单:" + hyworkorder.getString("FWORKNUM") + "已作废", 11l);
|
|
|
+ remote1.setValue("phone", hyworkorder.getString("PROJECTLEADER"), 11l);
|
|
|
+ }
|
|
|
workorders.save();
|
|
|
return getReturnObject_suc().toString();
|
|
|
} catch (P2Exception e) {
|
|
|
@@ -997,15 +1040,15 @@ public class HyWorkOrder extends Controller {
|
|
|
PaoSetRemote paoSetRemote = pao.getPaoSet("AFTERSERVICEORDER");
|
|
|
pao.setValue("fisscenefname", true, 11l);
|
|
|
pao.setValue("fistitem", where.getString("fistitem"), 11l);
|
|
|
- pao.setValue("fisperiod",where.getBoolean("fisperiod"),11l);
|
|
|
+ pao.setValue("fisperiod", where.getBoolean("fisperiod"), 11l);
|
|
|
pao.setValue("fiserror", where.getString("fiserror"), 11l);
|
|
|
- if(where.containsKey("appsystem")) {
|
|
|
- if(!paoSetRemote.isEmpty()) {
|
|
|
+ if (where.containsKey("appsystem")) {
|
|
|
+ if (!paoSetRemote.isEmpty()) {
|
|
|
paoSetRemote.getPao(0).setValue("appsystem", where.getString("appsystem"));
|
|
|
}
|
|
|
}
|
|
|
- if(where.containsKey("errcategory")) {
|
|
|
- if(!paoSetRemote.isEmpty()) {
|
|
|
+ if (where.containsKey("errcategory")) {
|
|
|
+ if (!paoSetRemote.isEmpty()) {
|
|
|
paoSetRemote.getPao(0).setValue("errcategory", where.getString("errcategory"));
|
|
|
}
|
|
|
}
|
|
|
@@ -1134,71 +1177,73 @@ public class HyWorkOrder extends Controller {
|
|
|
}
|
|
|
return getReturnObject_err("where参数不存在").toString();
|
|
|
}
|
|
|
- /**售后应用系统列表**/
|
|
|
- public String appsystemList(){
|
|
|
- Rows rows=new Rows();
|
|
|
- Row row1=new Row();
|
|
|
- row1.put("value","暖通系统");
|
|
|
- Row row2=new Row();
|
|
|
- row2.put("value","消防系统");
|
|
|
- Row row3=new Row();
|
|
|
- row3.put("value","排水系统");
|
|
|
- Row row4=new Row();
|
|
|
- row4.put("value","引调水");
|
|
|
- Row row5=new Row();
|
|
|
- row5.put("value","制水厂");
|
|
|
- Row row6=new Row();
|
|
|
- row6.put("value","自来水管网");
|
|
|
- Row row7=new Row();
|
|
|
- row7.put("value","污水处理厂");
|
|
|
- Row row8=new Row();
|
|
|
- row8.put("value","其他");
|
|
|
-
|
|
|
- rows.add(row1);
|
|
|
- rows.add(row2);
|
|
|
- rows.add(row3);
|
|
|
- rows.add(row4);
|
|
|
- rows.add(row5);
|
|
|
- rows.add(row6);
|
|
|
- rows.add(row7);
|
|
|
- rows.add(row8);
|
|
|
-
|
|
|
- return getReturnObject_suc(rows,true).toString();
|
|
|
- }
|
|
|
-
|
|
|
- /**客诉大类列表**/
|
|
|
- public String errcategoryList(){
|
|
|
- Rows rows=new Rows();
|
|
|
- Row row1=new Row();
|
|
|
- row1.put("value","内漏");
|
|
|
- Row row2=new Row();
|
|
|
- row2.put("value","外漏");
|
|
|
- Row row3=new Row();
|
|
|
- row3.put("value","性能失效");
|
|
|
- Row row4=new Row();
|
|
|
- row4.put("value","配件损坏或遗失");
|
|
|
- Row row5=new Row();
|
|
|
- row5.put("value","外观问题");
|
|
|
- Row row6=new Row();
|
|
|
- row6.put("value","异响或抖动");
|
|
|
- Row row7=new Row();
|
|
|
- row7.put("value","打不开/不通水");
|
|
|
- Row row8=new Row();
|
|
|
- row8.put("value","扭矩大");
|
|
|
- Row row9=new Row();
|
|
|
- row9.put("value","其他");
|
|
|
- rows.add(row1);
|
|
|
- rows.add(row2);
|
|
|
- rows.add(row3);
|
|
|
- rows.add(row4);
|
|
|
- rows.add(row5);
|
|
|
- rows.add(row6);
|
|
|
- rows.add(row7);
|
|
|
- rows.add(row8);
|
|
|
- rows.add(row9);
|
|
|
- return getReturnObject_suc(rows,true).toString();
|
|
|
- }
|
|
|
- /** 经销商列表 **/
|
|
|
+
|
|
|
+ /** 售后应用系统列表 **/
|
|
|
+ public String appsystemList() {
|
|
|
+ Rows rows = new Rows();
|
|
|
+ Row row1 = new Row();
|
|
|
+ row1.put("value", "暖通系统");
|
|
|
+ Row row2 = new Row();
|
|
|
+ row2.put("value", "消防系统");
|
|
|
+ Row row3 = new Row();
|
|
|
+ row3.put("value", "排水系统");
|
|
|
+ Row row4 = new Row();
|
|
|
+ row4.put("value", "引调水");
|
|
|
+ Row row5 = new Row();
|
|
|
+ row5.put("value", "制水厂");
|
|
|
+ Row row6 = new Row();
|
|
|
+ row6.put("value", "自来水管网");
|
|
|
+ Row row7 = new Row();
|
|
|
+ row7.put("value", "污水处理厂");
|
|
|
+ Row row8 = new Row();
|
|
|
+ row8.put("value", "其他");
|
|
|
+
|
|
|
+ rows.add(row1);
|
|
|
+ rows.add(row2);
|
|
|
+ rows.add(row3);
|
|
|
+ rows.add(row4);
|
|
|
+ rows.add(row5);
|
|
|
+ rows.add(row6);
|
|
|
+ rows.add(row7);
|
|
|
+ rows.add(row8);
|
|
|
+
|
|
|
+ return getReturnObject_suc(rows, true).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 客诉大类列表 **/
|
|
|
+ public String errcategoryList() {
|
|
|
+ Rows rows = new Rows();
|
|
|
+ Row row1 = new Row();
|
|
|
+ row1.put("value", "内漏");
|
|
|
+ Row row2 = new Row();
|
|
|
+ row2.put("value", "外漏");
|
|
|
+ Row row3 = new Row();
|
|
|
+ row3.put("value", "性能失效");
|
|
|
+ Row row4 = new Row();
|
|
|
+ row4.put("value", "配件损坏或遗失");
|
|
|
+ Row row5 = new Row();
|
|
|
+ row5.put("value", "外观问题");
|
|
|
+ Row row6 = new Row();
|
|
|
+ row6.put("value", "异响或抖动");
|
|
|
+ Row row7 = new Row();
|
|
|
+ row7.put("value", "打不开/不通水");
|
|
|
+ Row row8 = new Row();
|
|
|
+ row8.put("value", "扭矩大");
|
|
|
+ Row row9 = new Row();
|
|
|
+ row9.put("value", "其他");
|
|
|
+ rows.add(row1);
|
|
|
+ rows.add(row2);
|
|
|
+ rows.add(row3);
|
|
|
+ rows.add(row4);
|
|
|
+ rows.add(row5);
|
|
|
+ rows.add(row6);
|
|
|
+ rows.add(row7);
|
|
|
+ rows.add(row8);
|
|
|
+ rows.add(row9);
|
|
|
+ return getReturnObject_suc(rows, true).toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 经销商列表 **/
|
|
|
public String querytagents() {
|
|
|
if (StringUtils.isBlank(hrid))
|
|
|
return getReturnObject_err("hrid为空").toString();
|
|
|
@@ -1215,11 +1260,12 @@ public class HyWorkOrder extends Controller {
|
|
|
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") +"%')";
|
|
|
+ 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);
|
|
|
+
|
|
|
+ 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());
|
|
|
@@ -1227,35 +1273,80 @@ public class HyWorkOrder extends Controller {
|
|
|
}
|
|
|
return getReturnObject_err("缺少where参数").toString();
|
|
|
}
|
|
|
- /** 经销商列表 **/
|
|
|
- public String querytitem() {
|
|
|
- if (StringUtils.isBlank(hrid))
|
|
|
- return getReturnObject_err("hrid为空").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";
|
|
|
+ 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();
|
|
|
+ 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")
|
|
|
+ + "%')";
|
|
|
}
|
|
|
- return getReturnObject_err("缺少where参数").toString();
|
|
|
+
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 系统消息查询 **/
|
|
|
+ public String messagelist() {
|
|
|
+ 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");
|
|
|
+ DBConnect connect = new DBConnect();
|
|
|
+ SQLFactory factory = new SQLFactory(this, "工单消息查询", pageSize, pageNumber, "fisread,createdate desc");
|
|
|
+ factory.addParameter("phone", hrid);
|
|
|
+ Rows rows = connect.runSqlQuery(factory.getSQL());
|
|
|
+ // String workermassageid = connect.runSqlUpdate("update workermassage set
|
|
|
+ // fisread=1 where phone=" + hrid + " and workermassageid in " +
|
|
|
+ // rows.getInWhere("workermassageid"));
|
|
|
+ return getReturnObject_suc_page(rows, false, 0).toString();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 更新消息已读 **/
|
|
|
+ public String messageread() {
|
|
|
+ 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 s[] = { "workermassageid" };
|
|
|
+ for (String s1 : s) {
|
|
|
+ if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
|
|
|
+ return getReturnObject_err("缺少" + s1 + "参数").toString();
|
|
|
+ }
|
|
|
+ if (where != null) {
|
|
|
+ DBConnect connect = new DBConnect();
|
|
|
+ String workermassageid = connect.runSqlUpdate(
|
|
|
+ "update workermassage set fisread=1 where workermassageid =" + where.getInt("workermassageid"));
|
|
|
+ return getReturnObject_suc().toString();
|
|
|
}
|
|
|
+ return getReturnObject_err("缺少where参数").toString();
|
|
|
+
|
|
|
+ }
|
|
|
}
|