Просмотр исходного кода

Merge remote-tracking branch 'Gogs/develop' into develop

沈静伟 4 лет назад
Родитель
Сommit
9208b055f9

+ 2 - 2
src/rest/openapi/restcontroller/hyworkorder/web/afterserviceorder/Afterserviceorder.java

@@ -247,7 +247,7 @@ public class Afterserviceorder extends Controller {
                     PaoRemote remote = workorders.addAtEnd();
                     remote.setValue("FAGENTNUM",afterserviceorder.getPao(0).getString("FAGENTNUM"),11l);
                     remote.setValue("servernum",where.getString("servicenum"),11l);
-                    remote.setValue("PROJECTLEADER",where.getString("projectleader"),11l); 
+                    remote.setValue("PROJECTLEADER",where.getString("projectleader"),2l); 
                     remote.setValue("FPROVINCE",afterserviceorder.getPao(0).getString("FPROVINCE"),11l);
                     remote.setValue("FCITY",afterserviceorder.getPao(0).getString("FCITY"),11l);
                     remote.setValue("FCOUNTY",afterserviceorder.getPao(0).getString("FCOUNTY"),11l);
@@ -256,7 +256,7 @@ public class Afterserviceorder extends Controller {
                     remote.setValue("scenephone",afterserviceorder.getPao(0).getString("scenephone"),11l);
                     remote.setValue("errormsg",afterserviceorder.getPao(0).getString("error_msg"),11l);
                     remote.setValue("ftext",afterserviceorder.getPao(0).getString("fnotes"),11l);
-                    remote.setValue("ftype",where.getString("ftype"),11l);
+                    remote.setValue("ftype",where.getString("ftype"),2l);
                     remote.setValue("TEMPLATENUM",where.getString("fworknum"),2l);
                     String fsonum=afterserviceorder.getPao(0).getString("fsonum");
                     DBConnect connect = new DBConnect();

+ 37 - 2
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/HyWorkOrder.java

@@ -65,6 +65,41 @@ public class HyWorkOrder extends Controller {
 		}
 		return getReturnObject_err("缺少where参数").toString();
 	}
+	/** 服务管理查询工单列表 **/
+	public String list_manage() {
+		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("fstatus") && !StringUtils.isBlank(where.getString("fstatus"))) {
+				wherestr += " and t.fstatus ='" + where.getString("fstatus") + "' ";
+			}
+
+			SQLFactory factory = new SQLFactory(this, "服务管理工单列表查询", pageSize, pageNumber, "t.createdate desc");
+			//factory.addParameter("hrid", hrid);
+			factory.addParameter("siteid", siteid);
+			factory.addParameter_SQL("where", wherestr);
+			SQLFactory factory2 = new SQLFactory(this, "服务管理工单状态统计");
+			//factory2.addParameter("hrid", hrid);
+			factory2.addParameter("siteid", siteid);
+			Rows rows_total = dbConnect.runSqlQuery(factory2.getSQL());
+			Rows rows = dbConnect.runSqlQuery(factory.getSQL());
+			if (!rows_total.isEmpty())
+				returnObject.put("rows_total", rows_total.get(0));
+			return getReturnObject_suc_page(rows, false, 0).toString();
+		}
+		return getReturnObject_err("缺少where参数").toString();
+	}
 
 	/** 工单详情 **/
 	public String detail() {
@@ -192,11 +227,11 @@ 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" };
+									"fisconfirmation", "fiscontract","confirmation" };
 							String[] to_nodes2 = { "frownum", "oneprocessname", "twoprocessname", "operating",
 									"operatingtime", "fnotes", "hyordernodeid", "supid", "ischilden", "isconfirm",
 									"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext",
-									"fisconfirmation", "fiscontract" };
+									"fisconfirmation", "fiscontract","confirmation" };
 							for (int j = 0; j < ordernode2.count(); j++) {
 								PaoRemote pao1 = ordernode2.getPao(j);
 								Row row1 = getrow(from_nodes2, to_nodes2, pao1);

+ 7 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/SQL/服务管理工单列表查询.sql

@@ -0,0 +1,7 @@
+select t.fworknum,t.fstatus,t.ftype,t.faddress,convert(varchar,t.createdate,120)createdate,t.progress,
+(
+  select top 1 isnull(t1.oneprocessname,'')+isnull(t1.twoprocessname,'')  from hyordernode t1 where t1.fparentid=t.hyWorkorderid and t1.isconfirm=0 and t1.ischilden=0 order by t1.FROWNUM
+)curcontent
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where t1.fparentid=t.hyWorkorderid) and t.siteid=$siteid$ and t.fstatus<>'×÷·Ï'
+and $where$

+ 24 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/SQL/服务管理工单状态统计.sql

@@ -0,0 +1,24 @@
+DECLARE @siteid nvarchar(20)=$siteid$,@tostart int =0,@starting int=0,@complete int=0,@qualitycard int=0,@tostop int=0
+
+select @tostart=count(1)
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where  t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
+  and t.fstatus='待开始'
+select @starting=count(1)
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where  t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
+  and t.fstatus='进行中'
+select @complete=count(1)
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where  t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
+  and t.fstatus='已完成'
+select @tostop=count(1)
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where  t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
+  and t.fstatus='暂停'
+select @qualitycard=count(1)
+from hyWorkorder t
+where EXISTS(select 1 from hyworkorder_team t1 where  t1.fparentid=t.hyWorkorderid) and t.siteid=@siteid
+  and t.fstatus='质保卡审批'
+
+select @tostart tostart,@starting starting,@complete complete,@tostop tostop,@qualitycard qualitycard