Browse Source

订单新增字段及企业档案增加身份证号

hu 6 months ago
parent
commit
b2b7aed6b2

+ 2 - 1
src/custom/restcontroller/sale/enterprise/SQL/商户档案修改.sql

@@ -10,6 +10,7 @@ set changeuserid=$changeuserid$,
     province=$province$,
     city=$city$,
     county=$county$,
-    abbreviation=$abbreviation$
+    abbreviation=$abbreviation$,
+    idcard=$idcard$
 where siteid = $siteid$
   and sys_enterpriseid = $sys_enterpriseid$

+ 1 - 0
src/custom/restcontroller/sale/enterprise/SQL/商户档案详情查询.sql

@@ -20,6 +20,7 @@ select t1.siteid,
        t1.saleclassauth,
        t1.grade,
        t1.isorder,
+       t1.idcard,
        t9.erpagentnum
 from sys_enterprise t1
          LEFT JOIN sys_dataextend t9 ON t1.sys_enterpriseid = t9.ownerid  and ownertable='sys_enterprise' and  t1.siteid = t9.siteid

+ 2 - 0
src/custom/restcontroller/sale/enterprise/enterprise.java

@@ -59,6 +59,7 @@ public class enterprise extends Controller {
         String city = content.getString("city");
         String county = content.getString("county");
         String abbreviation = content.getString("abbreviation");
+        String idcard = content.getStringValue("idcard");
 
         ArrayList<String> sqllist = new ArrayList<>();
         SQLFactory sqlFactory = new SQLFactory(this, "商户档案修改");
@@ -75,6 +76,7 @@ public class enterprise extends Controller {
         sqlFactory.addParameter("county", county);
         sqlFactory.addParameter("taxno", taxno);
         sqlFactory.addParameter("abbreviation", abbreviation);
+        sqlFactory.addParameter("idcard", idcard);
         sqllist.add(sqlFactory.getSQL());
 
 

+ 2 - 1
src/custom/restcontroller/webmanage/sale/enterprise/SQL/商户档案修改.sql

@@ -18,6 +18,7 @@ set changeuserid=$changeuserid$,
     saleclassauth=$saleclassauth$,
     abbreviation=$abbreviation$,
     grade = $grade$,
-    isorder=$isorder$
+    isorder=$isorder$,
+    idcard=$idcard$
 where siteid = $siteid$
   and sys_enterpriseid = $sys_enterpriseid$

+ 1 - 0
src/custom/restcontroller/webmanage/sale/enterprise/SQL/商户档案列表查询.sql

@@ -20,6 +20,7 @@ select t1.siteid,
        t1.saleclassauth,
        t1.grade,
        t1.isorder,
+       t1.idcard,
        t2.sa_customersid,
        t2.type,
        t3.agentnum,

+ 3 - 2
src/custom/restcontroller/webmanage/sale/enterprise/SQL/商户档案新增.sql

@@ -1,6 +1,6 @@
 insert into sys_enterprise(siteid, sys_enterpriseid, createby, createdate, createuserid, authuserid, changeuserid,
                            changeby, changedate, city, county, address, phonenumber, province, contact, enterprisename,
-                           taxno,limitreturnday,freefreightamount,latitude,longitude,invoicingpoint,saleclassauth,grade,isorder)
+                           taxno,limitreturnday,freefreightamount,latitude,longitude,invoicingpoint,saleclassauth,grade,isorder,idcard)
 select $siteid$,
        $sys_enterpriseid$,
        $username$,
@@ -25,4 +25,5 @@ select $siteid$,
        $invoicingpoint$,
        $saleclassauth$,
        $grade$,
-       $isorder$
+       $isorder$,
+       $idcard$

+ 1 - 0
src/custom/restcontroller/webmanage/sale/enterprise/SQL/商户档案详情查询.sql

@@ -20,6 +20,7 @@ select t1.siteid,
        t1.saleclassauth,
        t1.grade,
        t1.isorder,
+       t1.idcard,
        t9.erpagentnum
 from sys_enterprise t1
          LEFT JOIN sys_dataextend t9 ON t1.sys_enterpriseid = t9.ownerid  and ownertable='sys_enterprise' and  t1.siteid = t9.siteid

+ 1 - 0
src/custom/restcontroller/webmanage/sale/enterprise/enterprise.java

@@ -449,6 +449,7 @@ public class enterprise extends Controller {
         sqlFactory.addParameter("latitude", content.getStringValue("latitude"));
         sqlFactory.addParameter("longitude", content.getStringValue("longitude"));
         sqlFactory.addParameter("abbreviation", content.getStringValue("abbreviation"));
+        sqlFactory.addParameter("idcard", content.getStringValue("idcard"));
 
         sqlFactory.addParameter("isorder", content.getLongValue("isorder"));
         //开票节点(1:订单审核:2:发货)

+ 55 - 1
src/custom/restcontroller/webmanage/sale/order/Order.java

@@ -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");

+ 4 - 3
src/custom/restcontroller/webmanage/sale/order/SQL/订单_新增.sql

@@ -2,10 +2,11 @@ insert into sa_order (sa_orderid, siteid, sonum, saler_hrid, type, typemx, sys_e
                       sa_brandid, sa_contractid, sa_projectid, sys_enterprise_financeid, rec_contactsid,
                       remarks, status, createuserid, createby, createdate, changeuserid, changeby, changedate,
                       createflag, tradefield, pay_enterpriseid, billdate, rebate_used, rebate_userate, signbacknum,
-                      tradefieldmx, sa_promotionid, freightstatus, saletype, signbackstatus,projectnote,abstract,delivery,tracknumber)
+                      tradefieldmx, sa_promotionid, freightstatus, saletype, signbackstatus,projectnote,abstract,delivery,
+                      tracknumber,mailno,invoicetaxno,invoicename,invoiceaddress,contact,address,phonenumber,province,city,county)
 values ($sa_orderid$, $siteid$, $sonum$, $saler_hrid$, $type$, $typemx$, $sys_enterpriseid$, $sa_accountclassid$,
         $sa_brandid$, $sa_contractid$, $sa_projectid$, $sys_enterprise_financeid$, $rec_contactsid$,
         $remarks$, '新建', $userid$, $username$, current_time, $userid$, $username$, current_time, $createflag$,
         $tradefield$, $pay_enterpriseid$, $billdate$, $rebate_used$,
-        (SELECT order_rebate_userate from sys_site_parameter WHERE siteid = $siteid$), $signbacknum$, $tradefieldmx$,
-        $sa_promotionid$, $freightstatus$, $saletype$, $signbackstatus$,$projectnote$,$abstract$,$delivery$,$tracknumber$);
+        $sa_promotionid$, $freightstatus$, $saletype$, $signbackstatus$,$projectnote$,$abstract$,$delivery$,
+        $tracknumber$,$mailno$,$invoicetaxno$,$invoicename$,$invoiceaddress$,$contact$,$address$,$phonenumber$,$province$,$city$,$county$);

+ 11 - 1
src/custom/restcontroller/webmanage/sale/order/SQL/订单_更新.sql

@@ -22,6 +22,16 @@ set changeuserid=$userid$,
     projectnote=$projectnote$,
     abstract=$abstract$,
     delivery=$delivery$,
-    tracknumber=$tracknumber$
+    tracknumber=$tracknumber$,
+    mailno=$mailno$,
+    invoicetaxno=$invoicetaxno$,
+    invoicename=$invoicename$,
+    invoiceaddress=$invoiceaddress$,
+    contact=$contact$,
+    address=$address$,
+    phonenumber=$phonenumber$,
+    province=$province$,
+    city=$city$,
+    county=$county$
 where siteid = $siteid$
   and sa_orderid = $sa_orderid$

+ 9 - 0
src/custom/restcontroller/webmanage/sale/order/SQL/订单_详情.sql

@@ -14,6 +14,15 @@ SELECT t1.sa_orderid,
        t1.delivery,
        t1.tracknumber,
        t1.mailno,
+       t1.invoicetaxno,
+       t1.invoicename,
+       t1.invoiceaddress,
+       t1.contact,
+       t1.address,
+       t1.phonenumber,
+       t1.province,
+       t1.city,
+       t1.county,
        t1.signbacknum,
        t1.sa_accountclassid,
        t1.sa_brandid,

+ 0 - 5
src/custom/restcontroller/webmanage/sale/workorder/workorder.java

@@ -498,23 +498,18 @@ public class workorder extends Controller {
                 } else {
                     row.put("curcontent", "");
                 }
-                System.err.println("needcode0000");
                 if(userrowsMap.containsKey(row.getString("serviceordercreateuserid"))){
                     if(userrowsMap.get(row.getString("serviceordercreateuserid")).get(0).getLong("usertype")==99){
-                        System.err.println("needcode11111");
                         row.put("needcode", true);
                     }else{
                         if(row.getString("type").equals("安装")){
-                            System.err.println("needcode2222");
                             row.put("needcode", true);
                         }else{
-                            System.err.println("needcode3333");
                             row.put("needcode", false);
                         }
                     }
 
                 }else{
-                    System.err.println("needcode4444");
                     row.put("needcode", true);
                 }