Просмотр исходного кода

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

shenjingwei 5 месяцев назад
Родитель
Сommit
8fc375550d

+ 2 - 2
src/custom/restcontroller/sale/cashbill/SQL/收支凭证新增.sql

@@ -1,7 +1,7 @@
 insert into sa_cashbill (siteid, sa_cashbillid, createuserid, createby, createdate, billno, changeuserid, changeby,
                          changedate,
                          sys_enterpriseid, sa_accountclassid, type, remarks, amount, status, source, sourcenote,
-                         subclass, class, ownertable, ownerid,period,discountamount)
+                         subclass, class, ownertable, ownerid,period,discountamount,billdate)
 values ($siteid$, $sa_cashbillid$, $userid$, $username$, CURRENT_TIME, $billno$, $userid$, $username$, CURRENT_TIME,
         $sys_enterpriseid$, $sa_accountclassid$, $type$, $remarks$,
-        $amount$, '新建', $source$, $sourcenote$, $subclass$, $class$, $ownertable$, $ownerid$,$period$,$discountamount$);
+        $amount$, '新建', $source$, $sourcenote$, $subclass$, $class$, $ownertable$, $ownerid$,$period$,$discountamount$,$billdate$);

+ 2 - 1
src/custom/restcontroller/sale/cashbill/SQL/收支凭证更新.sql

@@ -12,7 +12,8 @@ SET
     subclass=$subclass$,
     class=$class$,
     period=$period$,
-    discountamount=$discountamount$
+    discountamount=$discountamount$,
+    billdate=$billdate$
 WHERE sa_cashbillid= $sa_cashbillid$ and siteid=$siteid$
 
 

+ 1 - 0
src/custom/restcontroller/sale/cashbill/SQL/收支凭证详情查询.sql

@@ -26,6 +26,7 @@ SELECT t1.sa_cashbillid,
        t1.class,
        t1.balance,
        t1.period,
+       t1.billdate,
        (t1.amount - t1.writeoffamount) unwriteoffamount,
        t4.billno                       offsettingbillno
 FROM sa_cashbill t1

+ 4 - 0
src/custom/restcontroller/sale/cashbill/cashbill.java

@@ -315,6 +315,8 @@ public class cashbill extends Controller {
         String subclass = content.getStringValue("subclass");
         String class1 = content.getStringValue("class");
         String period = content.getStringValue("period");
+        String billdate = content.getStringValue("billdate");
+
         if (StringUtils.isEmpty(period)) {
             if (type == 1) {
                 return getErrReturnObject().setErrMsg("未填写归属日期").toString();
@@ -348,6 +350,7 @@ public class cashbill extends Controller {
             sqlFactory.addParameter("source", "");
             sqlFactory.addParameter("sourcenote", "");
             sqlFactory.addParameter("period", period);
+            sqlFactory.addParameter("billdate", StringUtils.isBlank(billdate)?"current_time":billdate);
             sqlFactory.addParameter("discountamount", discountamount);
 
             content.put("sa_cashbillid", sa_cashbillid);
@@ -378,6 +381,7 @@ public class cashbill extends Controller {
             sqlFactory.addParameter("source", "");
             sqlFactory.addParameter("sourcenote", "");
             sqlFactory.addParameter("period", period);
+            sqlFactory.addParameter("billdate",StringUtils.isBlank(billdate)?"current_time":billdate);
             sqlFactory.addParameter("discountamount", discountamount);
             sqlList.add(sqlFactory.getSQL());
             sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "更新", "收支凭证更新成功").getSQL());

+ 2 - 2
src/custom/restcontroller/webmanage/sale/accessoryorder/accessoryorder.java

@@ -152,7 +152,7 @@ public class accessoryorder extends Controller {
         RowsMap expressformrowsMap = expressformrows.toRowsMap("sa_orderid");
         //查询区域信息
         QuerySQL areaQuery = SQLFactory.createQuerySQL(this, "sa_salearea", "areanum","areaname","areafullname").setTableAlias("t1");
-        areaQuery.addJoinTable(JOINTYPE.inner, "sys_enterprise_tradefield ", "t2", "t2.sa_saleareaid = t1.sa_saleareaid");
+        areaQuery.addJoinTable(JOINTYPE.inner, "sys_enterprise_tradefield ", "t2", "t2.sa_saleareaid = t1.sa_saleareaid","sys_enterpriseid");
         areaQuery.setWhere("t2.sys_enterpriseid", rows.toArrayList("sys_enterpriseid"));
         Rows arearows = areaQuery.query();
         RowsMap arearowsrowsMap = arearows.toRowsMap("sys_enterpriseid");
@@ -388,7 +388,7 @@ public class accessoryorder 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","logisticsmethod", "tracknumber", "mailno"
-                ,"invoicetaxno","invoicename","invoiceaddress","contact","address","phonenumber","province","city","county");
+                ,"invoicetaxno","invoicename","invoiceaddress","contact","address","phonenumber","province","city","county","sys_enterpriseid");
         querySQL.setTableAlias("t1");
         querySQL.addJoinTable(JOINTYPE.left, "sys_enterprise", "t2", "t2.sys_enterpriseid = t1.sys_enterpriseid and t2.siteid = t1.siteid",
                 "enterprisename","abbreviation");

+ 2 - 2
src/custom/restcontroller/webmanage/sale/expressform/expressform.java

@@ -243,7 +243,7 @@ public class expressform extends Controller {
                     batchDeleteErr.addErr(expressformid, "非新建状态的快递信息无法删除");
                     continue;
                 }
-                if (!StringUtils.isNotBlank(RowsStatus.get(0).getString("mailno"))) {
+                if (StringUtils.isNotBlank(RowsStatus.get(0).getString("mailno"))) {
                     batchDeleteErr.addErr(expressformid, "该快递信息单已填写'电子面单号',无法删除!");
                     continue;
                 }
@@ -254,7 +254,7 @@ public class expressform extends Controller {
             }
             ArrayList<String> sqllist = new ArrayList<>();
             sqllist.add("delete from expressform where siteid='" + siteid + "' and expressformid=" + expressformid);
-            sqllist.add("update st_stockbill set txlogisticid='',mailno='' where siteid='" + siteid + "' and txlogisticid=" + RowsStatus.get(0).getString("txlogisticid"));
+            sqllist.add("delete from sa_expressform_stockbill where siteid='" + siteid + "' and expressformid="+expressformid);
             //sqllist.add("delete from expressformbillcodes where siteid='" + siteid + "' and expressformid=" + expressformid);
             dbConnect.runSqlUpdate(sqllist);
         }

+ 5 - 3
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -80,7 +80,6 @@ public class OrderItems extends Controller {
             JSONObject item = (JSONObject) obj;
             Long itemid = item.getLong("itemid");
             Long sa_orderitemsid = item.getLong("sa_orderitemsid");
-            long sa_customersid =item.getLongValue("sa_customersid");
             BigDecimal qty = item.getBigDecimal("qty");
             sumqty = sumqty.add(qty);
 
@@ -118,9 +117,12 @@ public class OrderItems extends Controller {
                 if(!type.equals("配件订单")){
                     rows= dbConnect.runSqlQuery("SELECT sa_orderitemsid,price from sa_orderitems WHERE siteid='" + siteid + "' and itemid=" + itemid + " and sa_orderid=" + sa_orderid + " and sa_promotion_itemsid=" + item.getLongValue("sa_promotion_itemsid"));
                 }else{
-                    if(sa_customersid!=0){
-                        rows= dbConnect.runSqlQuery("SELECT t1.sa_orderitemsid,qty from sa_orderitems t1 left join sa_warrantycard t2 on t1.cardno=t2.cardno  WHERE t1.siteid='" + siteid + "' and t1.itemid=" + itemid + " and t1.sa_orderid=" + sa_orderid + " and t2.sa_customersid=" +sa_customersid);
+                    if(StringUtils.isBlank(item.getStringValue("cardno"))){
+                        rows= dbConnect.runSqlQuery("SELECT t1.sa_orderitemsid,qty from sa_orderitems t1  WHERE t1.siteid='" + siteid + "' and t1.itemid=" + itemid + " and t1.sa_orderid=" + sa_orderid);
+                    }else{
+                        rows= dbConnect.runSqlQuery("SELECT t1.sa_orderitemsid,qty from sa_orderitems t1  WHERE t1.siteid='" + siteid + "' and t1.itemid=" + itemid + " and t1.sa_orderid=" + sa_orderid + " and ifnull(t1.cardno,'')='"+item.getStringValue("cardno")+"'");
                     }
+
                 }
 
                 if (rows.isEmpty()) {

+ 6 - 6
src/custom/restcontroller/webmanage/sale/period/SQL/获取暂存账户数据.sql

@@ -12,7 +12,7 @@ with
         select t3.agentnum fagentnum,t1.amount  from sa_cashbill  t1
                                                          inner join  sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid
                                                          left join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid
-        where t1.status='审核' and t1.type=0 and  t2.accountno='01' and t1.subclass='客户档案资料费'
+        where t1.status='审核' and t1.type=0 and  t2.accountno='01' and t1.class='客户档案资料费'
           and t1.checkdate>=  DATE_FORMAT($begindate$, '%Y-01-01')
           and t1.checkdate < $enddate$
     ),
@@ -21,7 +21,7 @@ with
                                                          inner join  sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid
                                                          left join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid
 
-        where t1.status='审核' and  t1.type=1 and  t2.accountno='01' and  t1.subclass = '客户档案资料费'
+        where t1.status='审核' and  t1.type=1 and  t2.accountno='01' and  t1.class = '客户档案资料费'
 
           and  t1.checkdate>=  DATE_FORMAT($begindate$, '%Y-01-01')
           and  t1.checkdate < $enddate$
@@ -30,7 +30,7 @@ with
         select t3.agentnum fagentnum,t1.amount  from sa_cashbill t1
                                                          inner join  sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid
                                                          left join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid
-        where t1.status='审核' and  t1.type=1 and  t2.accountno='01' and  t1.subclass = '客户档案资料费'  and
+        where t1.status='审核' and  t1.type=1 and  t2.accountno='01' and  t1.class = '客户档案资料费'  and
 
           and  t1.checkdate>= $begindate$
           and  t1.checkdate <= $enddate$
@@ -40,7 +40,7 @@ with
         select t3.agentnum fagentnum,t1.amount  from sa_cashbill t1
                                                          inner join  sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid
                                                          left join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid
-        where t1.status='审核' and  t2.accountno='01' and t1.subclass='客户档案资料费' and t1.ftype=0
+        where t1.status='审核' and  t2.accountno='01' and t1.class='客户档案资料费' and t1.ftype=0
           and  t1.checkdate>= $begindate$
           and  t1.checkdate <= $enddate$
     ),
@@ -48,7 +48,7 @@ with
         select t3.agentnum fagentnum,t1.amount  from sa_cashbill t1
                                                          inner join  sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid
                                                          left join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid
-        where t1.type =1 and t1.status ='审核' and t2.accountno='01' and ifnull(t1.subclass,'') != '客户档案资料费'
+        where t1.type =1 and t1.status ='审核' and t2.accountno='01' and ifnull(t1.class,'') != '客户档案资料费'
     and  t1.billdate>= $begindate$
     and  t1.billdate <= $enddate$
     ),
@@ -58,7 +58,7 @@ with
 select t3.agentnum fagentnum,t1.amount  from sa_cashbill t1
     inner join  sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid
     left join sa_agents t3 on t1.sys_enterpriseid=t3.sys_enterpriseid
-where t1.type =1  and t1.status ='审核' and  t2.accountno='01' and ifnull(t1.subclass,0) != '客户档案资料费'
+where t1.type =1  and t1.status ='审核' and  t2.accountno='01' and ifnull(t1.class,0) != '客户档案资料费'
   and t1.billdate>= DATE_FORMAT($begindate$, '%Y-01-01')
   and  t1.billdate < $enddate$
     ),

+ 3 - 3
src/custom/restcontroller/webmanage/sale/sendrepair/sendrepair_pj.java

@@ -59,10 +59,10 @@ public class sendrepair_pj extends Controller {
 
         HashMap<Long, ItemPrice> itemPriceRowsMap = ItemPrice.getItemPrice(this, sys_enterpriseid,rows.toArrayList("itemid", new ArrayList<>()));
         for (Row row :rows){
-            if (itemPriceRowsMap.containsKey(row.getString("itemid"))) {
-                row.put("saleprice", itemPriceRowsMap.get(row.getString("itemid")).getPrice());
+            if (itemPriceRowsMap.containsKey(row.getLong("itemid"))) {
+                row.put("price", itemPriceRowsMap.get(row.getLong("itemid")).getPrice());
             } else {
-                row.put("saleprice", 0);
+                row.put("price", 0);
             }
         }
 

+ 2 - 2
src/custom/restcontroller/webmanage/sale/stockbill/stockbill.java

@@ -372,8 +372,8 @@ public class stockbill extends Controller {
             }
         }
         if(billtypes.contains("返修出库")){
-            QuerySQL querySQLDatail = SQLFactory.createQuerySQL(this, "st_stockbill_items", "st_stockbillid").setTableAlias("t1");
-            querySQLDatail.addJoinTable(JOINTYPE.left, "st_stockbill_items_sku", "t2", "t1.st_stockbill_itemsid=t2.st_stockbill_itemsid and t1.siteid = t2.siteid ","sku");
+            QuerySQL querySQLDatail = SQLFactory.createQuerySQL(this, "st_stockbill_items","sku", "st_stockbillid").setTableAlias("t1");
+            querySQLDatail.addJoinTable(JOINTYPE.left, "st_stockbill_items_sku", "t2", "t1.st_stockbill_itemsid=t2.st_stockbill_itemsid and t1.siteid = t2.siteid");
             querySQLDatail.addJoinTable(JOINTYPE.left, "plm_item", "t3", "t3.itemid=t1.itemid and t3.siteid = t1.siteid ","itemno","itemname","spec","model");
             querySQLDatail.setWhere("t1.st_stockbillid",ids);
             Rows rowsdatail = querySQLDatail.query();

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

@@ -43,8 +43,13 @@ public class u8bills  extends Controller {
         }
         QuerySQL querySQL = SQLFactory.createQuerySQL(this, "u8bills","*");
         querySQL.setTableAlias("t1");
+        querySQL.addJoinTable(JOINTYPE.left, "sv_agents", "t2", "t1.sys_enterpriseid = t2.sys_enterpriseid AND t1.siteid = t2.siteid","agentnum","enterprisename","abbreviation");
+        querySQL.addJoinTable(JOINTYPE.left, "st_stockbill", "t3", "t3.st_stockbillid = t1.st_stockbillid AND t1.siteid = t3.siteid");
         querySQL.setWhere("t1.siteid", siteid);
         querySQL.setWhere("t1.u8id", u8id);
+        querySQL.addQueryFields("stockbill_name","t3.name");
+        querySQL.addQueryFields("stockbill_phonenumber","t3.phonenumber");
+        querySQL.addQueryFields("stockbill_address","t3.address");
         querySQL.setWhere(where);
         querySQL.setPage(pageSize, pageNumber);
         Rows rows = querySQL.query();