|
@@ -1,7 +1,13 @@
|
|
|
package afterserviceorder;
|
|
package afterserviceorder;
|
|
|
|
|
|
|
|
|
|
+import java.util.Calendar;
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
+
|
|
|
import baseclass.PaoCust;
|
|
import baseclass.PaoCust;
|
|
|
import baseclass.tools.GetFieldsName;
|
|
import baseclass.tools.GetFieldsName;
|
|
|
|
|
+import openapi.base.SQLFactory;
|
|
|
|
|
+import openapi.base.data.Rows;
|
|
|
|
|
+import openapi.base.data.db.DBConnect;
|
|
|
import p2.p2server.P2Server;
|
|
import p2.p2server.P2Server;
|
|
|
import p2.pao.PaoRemote;
|
|
import p2.pao.PaoRemote;
|
|
|
import p2.pao.PaoSet;
|
|
import p2.pao.PaoSet;
|
|
@@ -81,7 +87,63 @@ public class afterserviceorder extends PaoCust {
|
|
|
remote.setValue("scenephone",getString("scenephone"),11l);
|
|
remote.setValue("scenephone",getString("scenephone"),11l);
|
|
|
remote.setValue("errormsg",getString("error_msg"),11l);
|
|
remote.setValue("errormsg",getString("error_msg"),11l);
|
|
|
remote.setValue("ftext",getString("fnotes"),11l);
|
|
remote.setValue("ftext",getString("fnotes"),11l);
|
|
|
|
|
+ String fsonum=getString("fsonum");
|
|
|
|
|
+ DBConnect connect = new DBConnect();
|
|
|
|
|
+ SQLFactory factory = new SQLFactory(this, "查询订单收货日期");
|
|
|
|
|
+ factory.addParameter("fsonum", fsonum);
|
|
|
|
|
+ Rows rows = connect.runSqlQuery(factory.getSQL());
|
|
|
|
|
+ if(!rows.isEmpty()) {
|
|
|
|
|
+ System.out.println(888);
|
|
|
|
|
+ Date receivedate=rows.get(0).getDate("receivedate");
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ calendar.add(Calendar.YEAR, -2);
|
|
|
|
|
+ Date date =calendar.getTime();
|
|
|
|
|
+ if(date.before(receivedate)) {
|
|
|
|
|
+ System.out.println(999);
|
|
|
|
|
+ remote.setValue("FISPERIOD",true,11l);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ hyworkorder.save();
|
|
|
|
|
+ //return 1;
|
|
|
|
|
+ return remote.getUniqueIDValue();
|
|
|
|
|
+ }
|
|
|
|
|
+ /**生成海盐工单**/
|
|
|
|
|
+ public long createhyWorkorder(String ftype) throws P2Exception {
|
|
|
|
|
+
|
|
|
|
|
+ if(!getString("fstatus").equals("待处理")&&!getString("fstatus").equals("进行中"))throw new P2AppException("","非处理和进行中状态不可生成工单");
|
|
|
|
|
+ PaoSetRemote hyworkorder = P2Server.getP2Server().getPaoSet("HYWORKORDER", P2Server.getP2Server().getSystemUserInfo());
|
|
|
|
|
+ hyworkorder.setInsertSite(getSite());
|
|
|
|
|
+
|
|
|
|
|
+ PaoRemote remote = hyworkorder.addAtEnd();
|
|
|
|
|
+ remote.setValue("FAGENTNUM",getString("FAGENTNUM"),11l);
|
|
|
|
|
+ remote.setValue("servernum",getString("Servicenum"),11l);
|
|
|
|
|
+ remote.setValue("FPROVINCE",getString("FPROVINCE"),11l);
|
|
|
|
|
+ remote.setValue("FCITY",getString("FCITY"),11l);
|
|
|
|
|
+ remote.setValue("FCOUNTY",getString("FCOUNTY"),11l);
|
|
|
|
|
+ remote.setValue("FADDRESS",getString("FADDRESS"),11l);
|
|
|
|
|
+ remote.setValue("scenefname",getString("scenefname"),11l);
|
|
|
|
|
+ remote.setValue("scenephone",getString("scenephone"),11l);
|
|
|
|
|
+ remote.setValue("errormsg",getString("error_msg"),11l);
|
|
|
|
|
+ remote.setValue("ftext",getString("fnotes"),11l);
|
|
|
|
|
+ remote.setValue("ftype",ftype,11l);
|
|
|
|
|
+ String fsonum=getString("fsonum");
|
|
|
|
|
+ DBConnect connect = new DBConnect();
|
|
|
|
|
+ SQLFactory factory = new SQLFactory(this, "查询订单收货日期");
|
|
|
|
|
+ factory.addParameter("fsonum", fsonum);
|
|
|
|
|
+ Rows rows = connect.runSqlQuery(factory.getSQL());
|
|
|
|
|
+ if(!rows.isEmpty()) {
|
|
|
|
|
+ System.out.println(888);
|
|
|
|
|
+ Date receivedate=rows.get(0).getDate("receivedate");
|
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
|
+ calendar.add(Calendar.YEAR, -2);
|
|
|
|
|
+ Date date =calendar.getTime();
|
|
|
|
|
+ if(date.before(receivedate)) {
|
|
|
|
|
+ System.out.println(999);
|
|
|
|
|
+ remote.setValue("FISPERIOD",true,11l);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
hyworkorder.save();
|
|
hyworkorder.save();
|
|
|
|
|
+ //return 1;
|
|
|
return remote.getUniqueIDValue();
|
|
return remote.getUniqueIDValue();
|
|
|
}
|
|
}
|
|
|
|
|
|