Explorar o código

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

沈静伟 %!s(int64=4) %!d(string=hai) anos
pai
achega
f994b5246f

+ 1 - 1
src/apps/ficashbill/ficashbill.java

@@ -352,7 +352,7 @@ public class ficashbill extends PaoCust {
 
         if ((isincom && "收入".equals(getString("ftype"))) || (!isincom && "支出".equals(getString("ftype")))) {
         	if(famount > 0){
-        		sendEmail(getMailBySalesGroup(getString("fagentnum"),getString("siteid")), "经销商有新的收入到账", "经销商有新的收入凭证,收入金额:"+famount);
+        		sendEmail(getMailBySalesGroup(getString("fagentnum"),getString("siteid")), "收入凭证", "经销商编号:"+getString("FAGENTNUM")+",客户名称:"+getString("FAGENTSHORTNAME")+",客户有新的收入,收入金额:"+famount);
         	}
             setValue("ftaccbalbalance", taccbal.getDouble("fbalance"), 11L);
             setValue("fstatus", "审核", 11L);

+ 21 - 0
src/apps/salesassistant/salesassistant.java

@@ -1,7 +1,9 @@
 package salesassistant;
 
 import baseclass.PaoCust;
+import p2.p2server.P2Server;
 import p2.pao.PaoSet;
+import p2.pao.PaoSetRemote;
 import p2.util.P2Exception;
 
 public class salesassistant extends PaoCust{
@@ -19,4 +21,23 @@ public class salesassistant extends PaoCust{
 	        distinctfieldcheckfsalenum("FSALENUM");
 	    }
 	}
+		@Override
+		public void fieldAction(Object paoField, String fieldname) throws P2Exception {
+		    super.fieldAction(paoField, fieldname);
+		    if(fieldname.equalsIgnoreCase("FSALENUM")){
+		        String fsalenum = getString("FSALENUM");
+		        PaoSetRemote pp_hrs = P2Server.getP2Server().getPaoSet("pp_hr", P2Server.getP2Server().getSystemUserInfo());
+		        pp_hrs.setWhere("siteid='HY' and hrid='"+fsalenum+"'");
+		        pp_hrs.reset();
+		        if(!pp_hrs.isEmpty()) {
+		            if(pp_hrs.getPao(0).getString("DISPLAYNAME")!=null && pp_hrs.getPao(0).getString("DISPLAYNAME").length()!=0){
+		                setValue("sales_fname", pp_hrs.getPao(0).getString("DISPLAYNAME"),11l);
+		            }
+		            if(pp_hrs.getPao(0).getString("PRIMARYEMAIL")!=null && pp_hrs.getPao(0).getString("PRIMARYEMAIL").length()!=0){
+		                setValue("sales_email", pp_hrs.getPao(0).getString("PRIMARYEMAIL"), 11l);
+		            }
+		        }
+
+		    }
+		}	
 }

+ 4 - 3
src/apps/tinvoiceapply/tinvoiceapply.java

@@ -131,6 +131,9 @@ public class tinvoiceapply extends PaoCust {
     @Override
     public void submit(boolean issubmit) throws P2Exception {
         super.submit(issubmit);
+        setValue("fstatus", issubmit ? "提交" : "新建", 11L);
+        setValue("submitby", issubmit ? getUserName() : "", 11L);
+        setValue("submitdate", issubmit ? getDateTime() : null, 11L);
         if (issubmit) {
             if (!orderinvoicecheck.equals("")) {
                 PaoSetRemote tinvoiceapplyorderSet = getPaoSet("tinvoiceapplyorder");
@@ -148,9 +151,7 @@ public class tinvoiceapply extends PaoCust {
             String fagentshortname = tagents.getPao(0).getString("FAGENTSHORTNAME");
             sendEmail(getMailByHrGroup(getString("siteid") + "1010"), "开票申请", "开票申请单号:" + getString("FBILLNUM") + "已提交请处理,客户名称:" +fagentshortname+ ",提交人:" + getString("SUBMITBY") + ",备注:" + getString("FNOTES"));
         }
-        setValue("fstatus", issubmit ? "提交" : "新建", 11L);
-        setValue("submitby", issubmit ? getUserName() : "", 11L);
-        setValue("submitdate", issubmit ? getDateTime() : null, 11L);
+       
     }
 
     public void checkvalidate(boolean ischeck) throws P2Exception {

+ 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隆等蹈桶脤戙統杅扢离甜脤戙