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

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

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

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

@@ -17,6 +17,10 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.cxf.ws.security.wss4j.policyvalidators.UsernameTokenPolicyValidator;
 import org.sqlite.core.DB;
 import org.sqlite.date.DateFormatUtils;
+
+import com.sun.org.apache.bcel.internal.generic.NEW;
+import com.sun.org.apache.xpath.internal.operations.And;
+
 import p2.p2server.P2Server;
 import p2.pao.*;
 import p2.util.P2Exception;
@@ -179,7 +183,7 @@ public class HyWorkOrder extends Controller {
 								"fisupload", "fisaddtitem", "fiscomplete", "fisOperator", "fistext", "fisconfirmation",
 								"fiscontract", "confirmation", "fisaddtraining", "fisaddtrainingtitem", "fispaid" };
 						for (int i = 0; i < ordernode.count(); i++) {
-
+							System.out.println(111);
 							PaoRemote pao = ordernode.getPao(i);
 							Row row = getrow(from_nodes, to_nodes, pao);
 							// t.frownum,t.oneprocessname,t.twoprocessname,t.operating,substring(
@@ -201,6 +205,44 @@ public class HyWorkOrder extends Controller {
 							// ('MP4','mp4') then 'video' else 'file' end type2 from tattachment where
 							PaoSetRemote paoSet_url = pao.getPaoSet("$tattachment", "tattachment",
 									"ownertable='HYORDERNODE' and ownerid =" + pao.getInt("hyordernodeid"));
+							PaoSetRemote HYCONFIRMATIONORDER = workorderpao.getPaoSet("HYCONFIRMATIONORDER");
+							if(pao.getString("oneprocessname").equals("服务确认") && !HYCONFIRMATIONORDER.isEmpty()) {
+								System.out.println(paoSet_url.count());
+								Rows signaturerows = new Rows();
+								for (int index = 0; index < HYCONFIRMATIONORDER.count(); index++) {
+									PaoRemote pao1 = HYCONFIRMATIONORDER.getPao(index);
+									System.out.println(666);
+									PaoSetRemote confirmorder_url = pao.getPaoSet("$tattachment"+index, "tattachment",
+											"ownertable='HYCONFIRMATIONORDER' and type='客户签名' and ownerid =" + pao1.getInt("HYCONFIRMATIONORid"));
+									confirmorder_url.setOrderBy("createdate desc");
+									confirmorder_url.reset();
+									Row row1 = new Row();
+									System.out.println(!confirmorder_url.isEmpty());
+									if(!confirmorder_url.isEmpty()) {
+										String postfix = confirmorder_url.getPao(0).getString("postfix");
+										row1.put("tattachmentid", confirmorder_url.getPao(0).getInt("tattachmentid"));
+										row1.put("document", confirmorder_url.getPao(0).getString("fdocument"));
+										row1.put("postfix", postfix.toUpperCase());
+										row1.put("url", confirmorder_url.getPao(0).getString("fobsurl"));
+										row1.put("serialnumber", confirmorder_url.getPao(0).getString("serialnumber"));
+										row1.put("type", confirmorder_url.getPao(0).getString("type"));
+										if (postfix.equalsIgnoreCase("JPG") || postfix.equalsIgnoreCase("PNG")
+												|| postfix.equalsIgnoreCase("JEPG")) {
+											row1.put("type2", "image");
+										} else if (postfix.equalsIgnoreCase("mp4")) {
+											row1.put("type2", "video");
+										} else {
+											row1.put("type2", "file");
+										}
+										signaturerows.add(row1);
+									}
+									
+								}
+								row.put("signatureurl",signaturerows);
+							}else {
+								row.put("signatureurl",new Rows());
+							}
+							System.out.println("paoSet_url:"+paoSet_url.count());
 							if (!paoSet_url.isEmpty()) {
 								Rows rows = new Rows();
 								for (int index = 0; index < paoSet_url.count(); index++) {
@@ -259,6 +301,39 @@ public class HyWorkOrder extends Controller {
 								}
 								PaoSetRemote paoSet_url2 = pao.getPaoSet("$tattachment", "tattachment",
 										"ownertable='HYORDERNODE' and ownerid =" + pao1.getInt("hyordernodeid"));
+								
+								if((pao1.getString("twoprocessname").equals("出具安装培训记录单并与客户签字确认,服务完成") || pao1.getString("twoprocessname").equals("出具售后服务单并与客户签字确认,服务完成")) && !HYCONFIRMATIONORDER.isEmpty()) {
+									Rows signaturerows = new Rows();
+									for (int index = 0; index < HYCONFIRMATIONORDER.count(); index++) {
+										PaoRemote pao2 = HYCONFIRMATIONORDER.getPao(index);
+										PaoSetRemote confirmorder_url = pao.getPaoSet("$tattachment"+index, "tattachment",
+												"ownertable='HYCONFIRMATIONORDER' and type='客户签名' and ownerid =" + pao2.getInt("HYCONFIRMATIONORid"));
+										confirmorder_url.setOrderBy("createdate desc");
+										confirmorder_url.reset();
+										Row row2 = new Row();
+										if(!confirmorder_url.isEmpty()) {
+											String postfix = confirmorder_url.getPao(0).getString("postfix");
+											row2.put("tattachmentid", confirmorder_url.getPao(0).getInt("tattachmentid"));
+											row2.put("document", confirmorder_url.getPao(0).getString("fdocument"));
+											row2.put("postfix", postfix.toUpperCase());
+											row2.put("url", confirmorder_url.getPao(0).getString("fobsurl"));
+											row2.put("serialnumber", confirmorder_url.getPao(0).getString("serialnumber"));
+											row2.put("type", confirmorder_url.getPao(0).getString("type"));
+											if (postfix.equalsIgnoreCase("JPG") || postfix.equalsIgnoreCase("PNG")
+													|| postfix.equalsIgnoreCase("JEPG")) {
+												row2.put("type2", "image");
+											} else if (postfix.equalsIgnoreCase("mp4")) {
+												row2.put("type2", "video");
+											} else {
+												row2.put("type2", "file");
+											}
+											signaturerows.add(row2);
+										}	
+									}
+									row1.put("signatureurl", signaturerows);
+								}else {
+									row1.put("signatureurl", new Rows());
+								}
 								if (!paoSet_url.isEmpty()) {
 									Rows rows = new Rows();
 									for (int index = 0; index < paoSet_url2.count(); index++) {

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

@@ -8,13 +8,10 @@ select convert(varchar(10), t1.recheckdate, 120) fdate,
        t2.fspec,
        t2.fmodel,
        t2.fqty,
-       t4.frateprice,
-       t4.frateamount ,
-       t2.famount 
+       t3.fprojectnotes
 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$

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

@@ -26,6 +26,7 @@ select t1.fsonum,
        t2.fsaler,
        t4.displayname fsalername ,--ÇøÓò¾­ÀíÃû³Æ
        t2.fagentnum,
+       t2.fprojectnotes,
        t2.fagentshortname
 from saorderdetail t1
        inner join saorder t2 on t1.fparentid = t2.saorderid