Kaynağa Gözat

订单.发货明细导出根据账号角色信息导出,经销商导出含单价金额全部,经销商员工导出不含单价金额

hu 2 yıl önce
ebeveyn
işleme
6e3cfc65be

+ 2 - 2
src/custom/restcontroller/webmanage/sale/dispatch/SQL/发货单明细所有列表查询.sql

@@ -16,12 +16,12 @@ SELECT t1.sa_dispatch_itemsid,
        t2.itemname,
        t2.itemname,
        t3.unitname,
        t3.unitname,
        ifnull(t1.qty, 0) qty,
        ifnull(t1.qty, 0) qty,
-       t1.remarks,
        ifnull(t1.outwarehouseqty, 0) outwarehouseqty,
        ifnull(t1.outwarehouseqty, 0) outwarehouseqty,
        t1.outwarehousedate,
        t1.outwarehousedate,
        t1.batchno,
        t1.batchno,
        t5.price,
        t5.price,
-       (ifnull(t1.qty, 0) * t5.price) amount,
+       cast((ifnull(t1.qty, 0) * t5.price) AS CHAR) amount,
+        t1.remarks,
        t5.undeliqty,
        t5.undeliqty,
        t5.deliedqty
        t5.deliedqty
 FROM sa_dispatch_items t1
 FROM sa_dispatch_items t1

+ 12 - 3
src/custom/restcontroller/webmanage/sale/dispatch/dispatchItems.java

@@ -375,10 +375,14 @@ public class dispatchItems extends Controller {
             rows.getFieldList().remove("rowno");
             rows.getFieldList().remove("rowno");
             rows.getFieldList().remove("itemid");
             rows.getFieldList().remove("itemid");
             rows.getFieldList().remove("batchno");
             rows.getFieldList().remove("batchno");
-            rows.getFieldList().remove("price");
-            rows.getFieldList().remove("amount");
+            Rows rowsrolename= dbConnect.runSqlQuery("select * from sys_userrole t1 inner join sys_role t2 on t1.roleid=t2.roleid and t1.siteid=t2.siteid where t2.rolename='经销商员工' and t1.userid="+userid);
+            if(!rowsrolename.isEmpty()){
+                rows.getFieldList().remove("price");
+                rows.getFieldList().remove("amount");
+            }
             rows.getFieldList().remove("undeliqty");
             rows.getFieldList().remove("undeliqty");
             rows.getFieldList().remove("deliedqty");
             rows.getFieldList().remove("deliedqty");
+            rows.getFieldList().remove("outwarehousedate");
             Rows uploadRows = uploadExcelToObs("dispatch", "发货单明细列表", rows, getTitleMap());
             Rows uploadRows = uploadExcelToObs("dispatch", "发货单明细列表", rows, getTitleMap());
             return getSucReturnObject().setData(uploadRows).toString();
             return getSucReturnObject().setData(uploadRows).toString();
         }
         }
@@ -386,7 +390,7 @@ public class dispatchItems extends Controller {
     }
     }
 
 
     //返回导出的标题
     //返回导出的标题
-    public HashMap<String, String> getTitleMap() {
+    public HashMap<String, String> getTitleMap() throws YosException {
         HashMap<String, String> titleMap = new HashMap<>();
         HashMap<String, String> titleMap = new HashMap<>();
         titleMap.put("billno", "发货单号");
         titleMap.put("billno", "发货单号");
         titleMap.put("status", "状态");
         titleMap.put("status", "状态");
@@ -401,6 +405,11 @@ public class dispatchItems extends Controller {
         titleMap.put("qty", "发货数量");
         titleMap.put("qty", "发货数量");
         titleMap.put("remarks", "发货行备注");
         titleMap.put("remarks", "发货行备注");
         titleMap.put("outwarehouseqty", "已出库数量");
         titleMap.put("outwarehouseqty", "已出库数量");
+        Rows rowsrolename= dbConnect.runSqlQuery("select * from sys_userrole t1 inner join sys_role t2 on t1.roleid=t2.roleid and t1.siteid=t2.siteid where t2.rolename='经销商员工' and t1.userid="+userid);
+        if(rowsrolename.isEmpty()){
+            titleMap.put("price", "单价");
+            titleMap.put("amount", "金额");
+        }
 
 
         return titleMap;
         return titleMap;
     }
     }

+ 15 - 4
src/custom/restcontroller/webmanage/sale/order/OrderItems.java

@@ -707,8 +707,15 @@ public class OrderItems extends Controller {
             rows.getFieldList().remove("standards");
             rows.getFieldList().remove("standards");
             rows.getFieldList().remove("agentnum");
             rows.getFieldList().remove("agentnum");
             rows.getFieldList().remove("enterprisename");
             rows.getFieldList().remove("enterprisename");
+            rows.getFieldList().remove("agentnum");
             rows.getFieldList().remove("stockstatus");
             rows.getFieldList().remove("stockstatus");
-
+            rows.getFieldList().remove("submitdate");
+            rows.getFieldList().remove("checkdate");
+            Rows rowsrolename= dbConnect.runSqlQuery("select * from sys_userrole t1 inner join sys_role t2 on t1.roleid=t2.roleid and t1.siteid=t2.siteid where t2.rolename='经销商员工' and t1.userid="+userid);
+            if(!rowsrolename.isEmpty()){
+                rows.getFieldList().remove("price");
+                rows.getFieldList().remove("amount");
+            }
 
 
             Rows uploadRows = uploadExcelToObs("orderdetail", "订单明细列表", rows, getTitleMapAgent());
             Rows uploadRows = uploadExcelToObs("orderdetail", "订单明细列表", rows, getTitleMapAgent());
             return getSucReturnObject().setData(uploadRows).toString();
             return getSucReturnObject().setData(uploadRows).toString();
@@ -752,7 +759,7 @@ public class OrderItems extends Controller {
     }
     }
 
 
     //返回导出的标题
     //返回导出的标题
-    public HashMap<String, String> getTitleMapAgent() {
+    public HashMap<String, String> getTitleMapAgent() throws YosException {
         HashMap<String, String> titleMap = new HashMap<>();
         HashMap<String, String> titleMap = new HashMap<>();
         titleMap.put("rowno", "行号");
         titleMap.put("rowno", "行号");
         titleMap.put("sonum", "订单号");
         titleMap.put("sonum", "订单号");
@@ -765,10 +772,14 @@ public class OrderItems extends Controller {
         titleMap.put("unit", "单位");
         titleMap.put("unit", "单位");
         titleMap.put("qty", "数量");
         titleMap.put("qty", "数量");
         titleMap.put("undeliqty", "未发货数量");
         titleMap.put("undeliqty", "未发货数量");
-        titleMap.put("price", "单价");
-        titleMap.put("amount", "金额");
+        Rows rowsrolename= dbConnect.runSqlQuery("select * from sys_userrole t1 inner join sys_role t2 on t1.roleid=t2.roleid and t1.siteid=t2.siteid where t2.rolename='经销商员工' and t1.userid="+userid);
+        if(rowsrolename.isEmpty()){
+            titleMap.put("price", "单价");
+            titleMap.put("amount", "金额");
+        }
         titleMap.put("remarks", "订单行备注");
         titleMap.put("remarks", "订单行备注");
 
 
+
         return titleMap;
         return titleMap;
     }
     }