Sfoglia il codice sorgente

海盐台州工单完工,服务单提交发送邮件

hu 4 anni fa
parent
commit
bc916f565c

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

@@ -17,6 +17,7 @@ import p2.pao.PaoRemote;
 import p2.pao.PaoSetRemote;
 import p2.util.P2AppException;
 import p2.util.P2Exception;
+import tagents.tagents;
 
 import java.util.Calendar;
 import java.util.Date;
@@ -442,6 +443,26 @@ public class Afterserviceorder extends Controller {
                 afterserviceorder.setValue("submitby",hrid,11l);
                 afterserviceorder.setValue("submitdate",new Date(),11l);
                 afterserviceorder.submit(true);
+                /*
+        		 * 发送邮件
+        		 */
+        		PaoSetRemote tagents = afterserviceorder.getPaoSet("TAGENTS");
+        		String fagentname="";
+        		if (!tagents.isEmpty()) {
+        			fagentname=tagents.getPao(0).getString("fagentname");
+        		}
+        		 PaoSetRemote paoSet = P2Server.getP2Server().getPaoSet("tagents", P2Server.getP2Server().getUserInfo(siteid.toUpperCase()+"ADMIN"));
+                 tagents pao = (tagents)paoSet.getPao(0);
+                 String fprovince="";
+                 String fcity="";
+                 String fcounty="";
+                 String faddress="";
+                 if(!StringUtils.isBlank(afterserviceorder.getString("fprovince"))) fprovince=afterserviceorder.getString("fprovince");
+                 if(!StringUtils.isBlank(afterserviceorder.getString("fcity"))) fcity=afterserviceorder.getString("fcity");
+                 if(!StringUtils.isBlank(afterserviceorder.getString("fcounty"))) fcounty=afterserviceorder.getString("fcounty");
+                 if(!StringUtils.isBlank(afterserviceorder.getString("faddress"))) faddress=afterserviceorder.getString("faddress");
+                 pao.sendEmail(pao.getMailByHrGroup(siteid + "1011"), "服务申请单提交", "客户:"+fagentname+",已提交服务申请:"+afterserviceorder.getString("Servicenum")+",服务地址:"+fprovince+fcity+fcounty+faddress+",请及时处理");
+
                 getpaoset.save();
 
                 return getReturnObject_suc().toString();

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

@@ -20,6 +20,7 @@ import org.sqlite.date.DateFormatUtils;
 import p2.p2server.P2Server;
 import p2.pao.*;
 import p2.util.P2Exception;
+import tagents.tagents;
 import workorder.workorder;
 
 import java.util.*;
@@ -734,7 +735,23 @@ public class HyWorkOrder extends Controller {
 //                    }
 
 					workorderPao.complete(true, hrid);
-					/** 客户积分更新 **/
+					/** 发送邮件 **/
+					PaoSetRemote tagents = workorderPao.getPaoSet("TAGENTS");
+					String fagentname="";
+					if (!tagents.isEmpty()) {
+						fagentname=tagents.getPao(0).getString("fagentname");
+					}
+					 PaoSetRemote paoSet = P2Server.getP2Server().getPaoSet("tagents", P2Server.getP2Server().getUserInfo(siteid.toUpperCase()+"ADMIN"));
+	                 tagents pao = (tagents)paoSet.getPao(0);
+	                 String fprovince="";
+	                 String fcity="";
+	                 String fcounty="";
+	                 String faddress="";
+	                 if(!StringUtils.isBlank(workorderPao.getString("fprovince"))) fprovince=workorderPao.getString("fprovince");
+	                 if(!StringUtils.isBlank(workorderPao.getString("fcity"))) fcity=workorderPao.getString("fcity");
+	                 if(!StringUtils.isBlank(workorderPao.getString("fcounty"))) fcounty=workorderPao.getString("fcounty");
+	                 if(!StringUtils.isBlank(workorderPao.getString("faddress"))) faddress=workorderPao.getString("faddress");
+	                 pao.sendEmail(pao.getMailByHrGroup(siteid + "1011"), "工单完结","客户:"+fagentname+",服务工单:"+workorderPao.getString("fworknum")+",服务地址:"+fprovince+fcity+fcounty+faddress+",已完成服务");
 					workorder.save();
 					return getReturnObject_suc().toString();