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

海盐订单,发货明细接口增加搜索功能(按订单号,工单开始前详情接口增加服务单附件及字段

hu 4 лет назад
Родитель
Сommit
4477d215c3

+ 5 - 1
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/HyWorkOrder.java

@@ -982,7 +982,11 @@ public class HyWorkOrder extends Controller {
 						+ "when postfix in ('MP4','mp4') then 'video' else 'file' end type2 from tattachment where ownertable='HYWORKORDER' and ownerid="
 						+ row.getInteger("ownerid"));
 		row.put("url", url);
-
+		Rows afterserviceordeurl = dbConnect.runSqlQuery(
+				"select tattachmentid,fdocument,fobsurl url,type,UPPER(postfix) postfix,case when postfix in ('JPG','PNG','JEPG','jpg','png','jepg') then 'image'\n"
+						+ "when postfix in ('MP4','mp4') then 'video' else 'file' end type2 from tattachment where ownertable='AFTERSERVICEORDER' and ownerid="
+						+ row.getInteger("afterserviceordeid"));
+		row.put("afterserviceordeurl", afterserviceordeurl);
 		return getReturnObject_suc(row, false).toString();
 	}
 

+ 22 - 1
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/SQL/工单开始前确认.sql

@@ -1,2 +1,23 @@
-select fisscenefname,fistitem,fisperiod,fiserror,repairprice,errormsg,hyWorkorder.scenefname,hyWorkorder.scenephone,ftext,hyWorkorder.faddress,hyWorkorderid ownerid,AFTERSERVICEORDER.errcategory,AFTERSERVICEORDER.appsystem from hyWorkorder  left join AFTERSERVICEORDER on AFTERSERVICEORDER.Servicenum=hyworkorder.servernum
+select fisscenefname,
+       fistitem,
+       fisperiod,
+       fiserror,
+       repairprice,
+       errormsg,
+       hyWorkorder.scenefname,
+       hyWorkorder.scenephone,
+       ftext,
+       hyWorkorder.faddress,
+       hyWorkorderid ownerid,
+       AFTERSERVICEORDER.errcategory,
+       AFTERSERVICEORDER.appsystem,
+       afterserviceordeid,
+       hyWorkorder.fagentnum,
+       tagents.fagentname,
+       hyWorkorder.fprovince,
+       hyWorkorder.fcity,
+       hyWorkorder.fcounty
+from hyWorkorder  
+left join AFTERSERVICEORDER on AFTERSERVICEORDER.Servicenum=hyworkorder.servernum
+left join  tagents on tagents.fagentnum=hyWorkorder.fagentnum
 where hyWorkorder.fworknum=$fworknum$

+ 5 - 1
src/rest/openapi/restcontroller/wechatapp/saorder/SQL/订单发货明细列表查询.sql

@@ -7,10 +7,14 @@ select convert(varchar(10), t1.recheckdate, 120) fdate,
        t2.fitemname,
        t2.fspec,
        t2.fmodel,
-       t2.fqty
+       t2.fqty,
+       t4.frateprice,
+       t4.frateamount ,
+       t2.famount 
 from sainvoice t1
          inner join sainvoicedetail t2 on t1.siteid = t2.siteid and t1.sainvoiceid = t2.fparentid
          inner join saorder t3 on t1.siteid = t3.siteid and t1.fsonum = t3.fsonum
+         inner join saorderdetail t4 on t4.siteid = t2.siteid and t4.saorderdetailid = t2.fsourceid
 where t1.fstatus in ('¸´ºË', '¹Ø±Õ')
   and t3.ftype != '¹¤¾ß½è³öµ¥'
   and t1.siteid =$siteid$

+ 5 - 2
src/rest/openapi/restcontroller/wechatapp/saorder/Saorder.java

@@ -92,7 +92,7 @@ public class Saorder extends Controller {
                 where = where + " and exists(select *from saorderdetail where fparentid=t1.saorderid and (fitemname like'%" + whereObject.getString("fitemname") + "%' or fitemno like'%" + whereObject.getString("fitemname") + "%'))";
             }
             if (whereObject.containsKey("fsonum") && !"".equals(whereObject.getString("fsonum"))) {
-                where = where + " and t1.fsonum='" + whereObject.getString("fsonum") + "'";
+                where = where + " and t1.fsonum like '%"+ whereObject.getString("fsonum") + "%'";
             }
             if (whereObject.containsKey("fodertype") && !"".equals(whereObject.getString("fodertype"))) {
                 String fodertype = whereObject.getString("fodertype");
@@ -112,7 +112,7 @@ public class Saorder extends Controller {
         factory.addParameter_SQL("where", where);
         Rows rows = connect.runSqlQuery(factory.getSQL());
 
-        return getReturnObject_suc_page(rows, true, 1, sortmsg).toString();
+        return getReturnObject_suc_page(rows, false, 1, sortmsg).toString();
     }
 
     /**
@@ -837,6 +837,9 @@ public class Saorder extends Controller {
             if (whereObject.containsKey("fenddate") && !"".equals(whereObject.getString("fenddate"))) {
                 where = where + " and convert(varchar(10),t1.recheckdate,120)  <='" + whereObject.getString("fenddate") + "'";
             }
+            if (whereObject.containsKey("fsonum") && !"".equals(whereObject.getString("fsonum"))) {
+                where = where + " and t1.fsonum like '%" + whereObject.getString("fsonum") + "%'";
+            }
         }
         /**
          * SQL隆等蹈桶脤戙統杅扢离甜脤戙