|
|
@@ -161,7 +161,17 @@ public class Order extends Controller {
|
|
|
if (sys_enterprise_financeid <= 0 && isAdd) {
|
|
|
sys_enterprise_financeid = getDefaultEnterpriseFinanceid(sys_enterpriseid);
|
|
|
}
|
|
|
+ Rows enterprisefinancerows = dbConnect.runSqlQuery("select * from sys_enterprise_finance where sys_enterprise_financeid="+sys_enterprise_financeid);
|
|
|
sqlFactory.addParameter("sys_enterprise_financeid", sys_enterprise_financeid);
|
|
|
+ if(enterprisefinancerows.isNotEmpty()){
|
|
|
+ sqlFactory.addParameter("invoicetaxno", enterprisefinancerows.get(0).getString("taxno"));
|
|
|
+ sqlFactory.addParameter("invoicename", enterprisefinancerows.get(0).getString("enterprisename"));
|
|
|
+ sqlFactory.addParameter("invoiceaddress", enterprisefinancerows.get(0).getString("address"));
|
|
|
+ }else{
|
|
|
+ sqlFactory.addParameter("invoicetaxno", "");
|
|
|
+ sqlFactory.addParameter("invoicename", "");
|
|
|
+ sqlFactory.addParameter("invoiceaddress", "");
|
|
|
+ }
|
|
|
//物流公司档案ID
|
|
|
sqlFactory.addParameter("sa_logiscompid", content.getLongValue("sa_logiscompid"));
|
|
|
//合作企业联系人表ID(收货信息)
|
|
|
@@ -171,6 +181,22 @@ public class Order extends Controller {
|
|
|
rec_contactsid = getDefaultContactsid(sys_enterpriseid);
|
|
|
}
|
|
|
sqlFactory.addParameter("rec_contactsid", rec_contactsid);
|
|
|
+ Rows contactsrows = dbConnect.runSqlQuery("select * from sys_enterprise_contacts where contactsid="+rec_contactsid);
|
|
|
+ if(contactsrows.isNotEmpty()){
|
|
|
+ sqlFactory.addParameter("contact", contactsrows.get(0).getString("name"));
|
|
|
+ sqlFactory.addParameter("address", contactsrows.get(0).getString("address"));
|
|
|
+ sqlFactory.addParameter("phonenumber", contactsrows.get(0).getString("phonenumber"));
|
|
|
+ sqlFactory.addParameter("province", contactsrows.get(0).getString("province"));
|
|
|
+ sqlFactory.addParameter("city", contactsrows.get(0).getString("city"));
|
|
|
+ sqlFactory.addParameter("county", contactsrows.get(0).getString("county"));
|
|
|
+ }else{
|
|
|
+ sqlFactory.addParameter("contact", "");
|
|
|
+ sqlFactory.addParameter("address", "");
|
|
|
+ sqlFactory.addParameter("phonenumber", "");
|
|
|
+ sqlFactory.addParameter("province", "");
|
|
|
+ sqlFactory.addParameter("city", "");
|
|
|
+ sqlFactory.addParameter("county", "");
|
|
|
+ }
|
|
|
//备注说明
|
|
|
sqlFactory.addParameter("remarks", content.getStringValue("remarks"));
|
|
|
//销售人员hrid,业务员hrid
|
|
|
@@ -262,6 +288,7 @@ public class Order extends Controller {
|
|
|
|
|
|
sqlFactory.addParameter("delivery", StringUtils.isBlank(agentRows.get(0).getString("delivery"))?content.getStringValue("delivery"):agentRows.get(0).getString("delivery"));
|
|
|
sqlFactory.addParameter("tracknumber", content.getStringValue("tracknumber"));
|
|
|
+ sqlFactory.addParameter("mailno", content.getStringValue("mailno"));
|
|
|
|
|
|
String sql = sqlFactory.getSQL();
|
|
|
|
|
|
@@ -418,6 +445,16 @@ public class Order extends Controller {
|
|
|
sys_enterprise_financeid = getDefaultEnterpriseFinanceid(sys_enterpriseid);
|
|
|
}
|
|
|
sqlFactory.addParameter("sys_enterprise_financeid", sys_enterprise_financeid);
|
|
|
+ Rows enterprisefinancerows = dbConnect.runSqlQuery("select * from sys_enterprise_finance where sys_enterprise_financeid="+sys_enterprise_financeid);
|
|
|
+ if(enterprisefinancerows.isNotEmpty()){
|
|
|
+ sqlFactory.addParameter("invoicetaxno", enterprisefinancerows.get(0).getString("taxno"));
|
|
|
+ sqlFactory.addParameter("invoicename", enterprisefinancerows.get(0).getString("enterprisename"));
|
|
|
+ sqlFactory.addParameter("invoiceaddress", enterprisefinancerows.get(0).getString("address"));
|
|
|
+ }else{
|
|
|
+ sqlFactory.addParameter("invoicetaxno", "");
|
|
|
+ sqlFactory.addParameter("invoicename", "");
|
|
|
+ sqlFactory.addParameter("invoiceaddress", "");
|
|
|
+ }
|
|
|
//物流公司档案ID
|
|
|
//sqlFactory.addParameter("sa_logiscompid", content.getLongValue("sa_logiscompid"));
|
|
|
//合作企业联系人表ID(收货信息),设置默认
|
|
|
@@ -427,6 +464,22 @@ public class Order extends Controller {
|
|
|
}
|
|
|
|
|
|
sqlFactory.addParameter("rec_contactsid", rec_contactsid);
|
|
|
+ Rows contactsrows = dbConnect.runSqlQuery("select * from sys_enterprise_contacts where contactsid="+rec_contactsid);
|
|
|
+ if(contactsrows.isNotEmpty()){
|
|
|
+ sqlFactory.addParameter("contact", contactsrows.get(0).getString("name"));
|
|
|
+ sqlFactory.addParameter("address", contactsrows.get(0).getString("address"));
|
|
|
+ sqlFactory.addParameter("phonenumber", contactsrows.get(0).getString("phonenumber"));
|
|
|
+ sqlFactory.addParameter("province", contactsrows.get(0).getString("province"));
|
|
|
+ sqlFactory.addParameter("city", contactsrows.get(0).getString("city"));
|
|
|
+ sqlFactory.addParameter("county", contactsrows.get(0).getString("county"));
|
|
|
+ }else{
|
|
|
+ sqlFactory.addParameter("contact", "");
|
|
|
+ sqlFactory.addParameter("address", "");
|
|
|
+ sqlFactory.addParameter("phonenumber", "");
|
|
|
+ sqlFactory.addParameter("province", "");
|
|
|
+ sqlFactory.addParameter("city", "");
|
|
|
+ sqlFactory.addParameter("county", "");
|
|
|
+ }
|
|
|
//备注说明
|
|
|
sqlFactory.addParameter("remarks", content.getStringValue("remarks"));
|
|
|
//销售人员hrid,业务员hrid
|
|
|
@@ -1116,7 +1169,8 @@ public class Order extends Controller {
|
|
|
//查询订单列表(管理端)
|
|
|
public QuerySQL queryListManage(String where) throws YosException {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_order",
|
|
|
- "sa_orderid", "sonum", "type", "status", "submitdate", "checkdate", "remarks", "createby", "checkby", "billdate", "tradefield", "rec_contactsid", "delivery", "tracknumber", "mailno");
|
|
|
+ "sa_orderid", "sonum", "type", "status", "submitdate", "checkdate", "remarks", "createby", "checkby", "billdate", "tradefield", "rec_contactsid", "delivery", "tracknumber", "mailno"
|
|
|
+ ,"invoicetaxno","invoicename","invoiceaddress","contact","address","phonenumber","province","city","county");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t2", "t2.sys_enterpriseid = t1.sys_enterpriseid and t2.siteid = t1.siteid",
|
|
|
"enterprisename", "abbreviation");
|