From ec38a7809e8cdb47ebf672451dee56e0ce2f91d2 Mon Sep 17 00:00:00 2001
From: xqs <ddxk91@qq.com>
Date: Mon, 7 Oct 2019 16:24:31 +0800
Subject: [PATCH] 库存查看,交易-权限,出库查看修复传参错误

---
 src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java           |  4 ++--
 src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java           | 10 +++++-----
 src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java | 14 ++++++++------
 src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java                            |  3 ++-
 src/main/resources/templates/check/checkHeader/checkHeader.html                                            |  6 ++++--
 src/main/resources/templates/inventory/adjustHeader/adjustHeader.html                                      |  6 +++---
 src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html                                |  4 ++--
 src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html                                | 15 ++++++++++-----
 src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html                      |  3 ++-
 src/main/resources/templates/inventory/inventoryTransaction/report.html                                    | 24 ++++++++++++------------
 10 files changed, 50 insertions(+), 39 deletions(-)

diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java
index 44213d6..7228398 100644
--- a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java
+++ b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java
@@ -18,6 +18,7 @@ import com.huaheng.pc.config.material.service.MaterialServiceImpl;
 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
 import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -160,9 +161,8 @@ public class InventoryDetailController extends BaseController
         return AjaxResult.success("库存明细出库查看任务下发成功!");
     }
 
-
     /**在库质检*/
-    //@RequiresPermissions("inventory:inventoryHeader:detailCheckTask")
+    @RequiresPermissions("inventory:inventoryDetail:detailCheckTask")
     @PostMapping("/detailCheckTask")
     @ResponseBody
     public AjaxResult detailCheckTask(String ids) throws InvocationTargetException, IllegalAccessException {
diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java b/src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
index 571ceb1..d05234a 100644
--- a/src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
+++ b/src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
@@ -95,7 +95,7 @@ public class InventoryHeaderController extends BaseController
 	}
 
 	/**移库*/
-	//@RequiresPermissions("inventory:inventoryHeader:transfer")
+	@RequiresPermissions("inventory:inventoryHeader:transfer")
 	@PostMapping("/transfer")
 	@ResponseBody
 	public AjaxResult transfer(String sourceLocation, String destinationLocation){
@@ -106,7 +106,7 @@ public class InventoryHeaderController extends BaseController
 	}
 
     /**出库查看*/
-	//@RequiresPermissions("inventory:inventoryHeader:seeOut")
+	@RequiresPermissions("inventory:inventoryHeader:seeOut")
 	@PostMapping("/createCheckOutTask")
 	@ResponseBody
 	public AjaxResult createCheckOutTask(String[] ids){
@@ -130,7 +130,7 @@ public class InventoryHeaderController extends BaseController
      * @param destinationLocation
      * @return
      */
-    //@RequiresPermissions("task:task:emptyIn")
+    @RequiresPermissions("inventory:inventoryHeader:emptyIn")
     @PostMapping("/emptyIn")
     @Log(title = "任务-任务管理", operating = "生成空托盘入库任务", action = BusinessType.INSERT)
     @ResponseBody
@@ -155,7 +155,7 @@ public class InventoryHeaderController extends BaseController
      * @param sourceLocation
      * @return
      */
-   //@RequiresPermissions("task:task:emptyOut")
+    @RequiresPermissions("inventory:inventoryHeader:emptyOut")
     @PostMapping("/emptyOut")
     @Log(title = "任务-任务管理", operating = "生成空托盘出库任务", action = BusinessType.INSERT)
     @ResponseBody
@@ -180,7 +180,7 @@ public class InventoryHeaderController extends BaseController
      * @param location
      * @return
      */
-    //@RequiresPermissions("task:task:emptyInOut")
+    @RequiresPermissions("inventory:inventoryHeader:emptyCheckOut")
     @PostMapping("/emptyCheckOut")
     @Log(title = "任务-任务管理", operating = "生成空托盘出库查看任务", action = BusinessType.INSERT)
     @ResponseBody
diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java b/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java
index 08cb6dd..02cf7c2 100644
--- a/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java
+++ b/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java
@@ -18,6 +18,7 @@ import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
 import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction;
 import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
 import io.swagger.models.auth.In;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
@@ -43,7 +44,7 @@ public class InventoryTransactionController extends BaseController{
 
     private String prefix = "inventory/inventoryTransaction";
 
-    //@RequiresPermissions("inventory:inventoryTransaction:view")
+    @RequiresPermissions("inventory:inventoryTransaction:view")
     @GetMapping()
     public String inventoryTransaction()
     {
@@ -53,7 +54,7 @@ public class InventoryTransactionController extends BaseController{
     /**
      * 查询库存交易列表
      */
-    //@RequiresPermissions("inventory:inventoryTransaction:inventoryTransactionList")
+    @RequiresPermissions("inventory:inventoryTransaction:inventoryTransactionList")
     @Log(title = "库存-库存交易",operating = "查看库存交易列表", action = BusinessType.GRANT)
     @PostMapping("/inventoryTransactionList")
     @ResponseBody
@@ -95,15 +96,16 @@ public class InventoryTransactionController extends BaseController{
         }
     }
 
-    //@RequiresPermissions("receipt:bill:report")
+    @RequiresPermissions("inventory:inventoryTransaction:view:report")
     @Log(title = "库存-库存交易明细", operating = "库存交易明细报表打印", action = BusinessType.OTHER)
     @GetMapping("/report/{ids}")
     public String report(@PathVariable("ids") Integer[] ids, ModelMap mmap)
     {
-        List<InventoryTransaction> list=new ArrayList<InventoryTransaction>();
+        List<InventoryTransaction> list = new ArrayList<>();
         for(Integer id:ids){
-            if(id!=null) {
-                //list.add(inventoryTransaction);
+            if(id != null) {
+                InventoryTransaction inventoryTransaction = inventoryTransactionService.getById(id);
+                list.add(inventoryTransaction);
             }
             mmap.put("inventoryTransaction", list);
         }
diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
index 6d08561..76e5524 100644
--- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
+++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
@@ -865,6 +865,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
 
         for (String id : ids) {
             InventoryHeader inventoryHeader = inventoryHeaderService.getById(Integer.parseInt(id));
+            //校验库位是否锁定
             //检查库位容器
             Location temp = new Location();
             temp.setCode(inventoryHeader.getLocationCode());
@@ -924,7 +925,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             }
             if (taskDetailService.saveBatch(taskDetails)) {
                 //锁定库位状态
-                locationService.updateStatus(loc.getContainerCode(), "lock");
+                locationService.updateStatus(inventoryHeader.getLocationCode(), "lock");
             } else {
                 throw new ServiceException("出库查看任务明细生成失败!");
             }
diff --git a/src/main/resources/templates/check/checkHeader/checkHeader.html b/src/main/resources/templates/check/checkHeader/checkHeader.html
index f11b78a..350d130 100644
--- a/src/main/resources/templates/check/checkHeader/checkHeader.html
+++ b/src/main/resources/templates/check/checkHeader/checkHeader.html
@@ -103,10 +103,12 @@
                     </div>
 
                     <div class="btn-group hidden-xs" id="toolbarReg" role="group">
-                        <a class="btn btn-outline btn-success btn-rounded" onclick="complete()" shiro:hasPermission="check:checkingRegister:remove">
+                        <a class="btn btn-outline btn-success btn-rounded" onclick="complete()"
+                           shiro:hasPermission="check:checkingRegister:remove">
                             <i class="fa fa-check-circle-o"></i> 质检完成
                         </a>
-                        <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="check:checkingRegister:remove">
+                        <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
+                           shiro:hasPermission="check:checkingRegister:remove">
                             <i class="fa fa-trash-o"></i> 删除
                         </a>
                     </div>
diff --git a/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html b/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
index 20b5684..1ab0768 100644
--- a/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
+++ b/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
@@ -180,9 +180,9 @@
                     align: 'center',
                     formatter: function (value, row, index) {
                         var actions = [];
-                        actions.push('<a class="btn btn-success btn-xs " href="#" onclick="adjustPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
-                       /* actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');*/
+                        /* actions.push('<a class="btn btn-success btn-xs " href="#" onclick="adjustPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
+                           actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> ');
+                         actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');*/
                         actions.push('<a style="background: #b5bdc0" class="btn btn-default btn-xs " href="#" onclick="detail(\'' + row.id + '\',\'' + row.code + '\')"><i class="fa fa-list-ul"></i>明细</a>');
                         return actions.join('');
                     }
diff --git a/src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html b/src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
index 8b59b6a..f7c4248 100644
--- a/src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
+++ b/src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
@@ -83,11 +83,11 @@
         </div>
         <div class="btn-group hidden-xs" id="toolbar" role="group">
             <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()"
-               shiro:hasPermission="inventory:inventory:seeOut">
+               shiro:hasPermission="inventory:inventoryHeader:seeOut">
                 <i class="fa fa-eye"></i> 出库查看
             </a>
             <a class="btn btn-outline btn-primary btn-rounded" onclick="check()"
-            >
+               shiro:hasPermission="inventory:inventoryDetail:detailCheckTask">
                 <i class="fa fa-eye"></i> 在库质检
             </a>
         </div>
diff --git a/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html b/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
index fba264f..81325e5 100644
--- a/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
+++ b/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
@@ -53,19 +53,24 @@
                         </form>
                     </div>
                     <div class="btn-group hidden-xs" id="toolbar" role="group">
-                        <a class="btn btn-outline btn-danger btn-rounded" onclick="transfer()">
+                        <a class="btn btn-outline btn-danger btn-rounded" onclick="transfer()"
+                           shiro:hasPermission="inventory:inventoryHeader:transfer">
                             <i class="fa fa-exchange"></i> 立库移库
                         </a>
-                        <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()">
+                        <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()"
+                           shiro:hasPermission="inventory:inventoryHeader:seeOut">
                             <i class="fa fa-eye"></i> 出库查看
                         </a>
-                        <a class="btn btn-outline btn-info btn-rounded" onclick="emptyIn()" shiro:hasPermission="task:task:emptyIn">
+                        <a class="btn btn-outline btn-info btn-rounded" onclick="emptyIn()"
+                           shiro:hasPermission="inventory:inventoryHeader:emptyIn">
                             <i class="fa fa-level-down"></i> 空托入库
                         </a>
-                        <a class="btn btn-outline btn-default btn-rounded" onclick="emptyCheckOut()" >
+                        <a class="btn btn-outline btn-default btn-rounded" onclick="emptyCheckOut()"
+                           shiro:hasPermission="inventory:inventoryHeader:emptyCheckOut">
                             <i class="fa fa fa-eye"></i> 空托出库查看
                         </a>
-                        <a class="btn btn-outline btn-info btn-rounded" onclick="emptyOut()" shiro:hasPermission="task:task:emptyOut">
+                        <a class="btn btn-outline btn-info btn-rounded" onclick="emptyOut()"
+                           shiro:hasPermission="inventory:inventoryHeader:emptyOut">
                             <i class="fa fa-level-up"></i> 空托出库
                         </a>
                     </div>
diff --git a/src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html b/src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html
index 5482699..8c83724 100644
--- a/src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html
+++ b/src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html
@@ -81,7 +81,8 @@
             </div>
             <div class="col-sm-12 select-info">
                 <div class="btn-group hidden-xs" id="toolbar" role="group">
-                    <a class="btn btn-outline btn-success btn-rounded" onclick="report()">
+                    <a class="btn btn-outline btn-success btn-rounded" onclick="report()"
+                       shiro:hasPermission="inventory:inventoryTransaction:report">
                         <i class="fa fa-plus"></i> 打印
                     </a>
                 </div>
diff --git a/src/main/resources/templates/inventory/inventoryTransaction/report.html b/src/main/resources/templates/inventory/inventoryTransaction/report.html
index 7ce9d62..3c7357a 100644
--- a/src/main/resources/templates/inventory/inventoryTransaction/report.html
+++ b/src/main/resources/templates/inventory/inventoryTransaction/report.html
@@ -4,7 +4,7 @@
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <head th:include="include :: header"></head>
-    <title>文字</title>
+    <title>库存交易明细</title>
     <!--<link href="css/bootstrap.min.css" rel="stylesheet" />-->
     <!--<link href="css/font-awesome.min.css" rel="stylesheet" />-->
     <!--&lt;!&ndash;[if IE]>-->
@@ -33,19 +33,19 @@
             <caption style="font-size:18px;text-align:center; color:#333; padding-bottom: 3px;">长沙华恒机器人系统有限公司</caption>
             <tbody>
             <tr>
-                <td width="20%" scope="col">存货编码</td>
+                <td width="20%" scope="col">物料编码</td>
                 <td colspan="2" scope="col" style="text-align:center">
                     <span th:text="${row.materialCode}" ></span>
                 </td>
             </tr>
             <tr>
-                <td scope="col">存货代码</td>
+                <td scope="col">重量</td>
                 <td colspan="2" scope="col" style="text-align:center">
-                    <span th:text="${row.userDef1}" ></span>
+                    <span th:text="${row.weight}" ></span>
                 </td>
             </tr>
             <tr style="vertical-align:middle">
-                <td>存货名称</td>
+                <td>物料名称</td>
                 <td style="text-align:center">
                     <span th:text="${row.materialName}"></span>
                 </td>
@@ -56,22 +56,22 @@
                 </td>
             </tr>
             <tr>
-                <td>规格型号</td>
+                <td>物料规格</td>
                 <td style="text-align:center">
                     <span th:text="${row.materialSpec}"></span>
                 </td>
             </tr>
             <tr>
-                <td>数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量</td>
+                <td>任务数量</td>
                 <td style="text-align:center; padding: 0">
                     <!--<input name="" type="text" style="line-height:18px;  border:0; text-align:center;" th:text="${receiptDetail.qty}"/>-->
-                    <input id="qty" name="qty" th:value="*{row.qty}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
+                    <input id="qty" name="qty" th:value="*{row.taskQty}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
                 </td>
             </tr>
             <tr>
-                <td scope="col">生产编号</td>
+                <td scope="col">项目号</td>
                 <td colspan="2" scope="col" style="text-align:center">
-                    <span th:text="${row.project}" ></span>
+                    <span th:text="${row.projectNo}" ></span>
                 </td>
             </tr>
             </tbody>
@@ -102,12 +102,12 @@
             var code16=$(this).children()[1].children[1].innerText;
             var name=$(this).children()[1].children[2].innerText;
             var spec=$(this).children()[1].children[3].innerText;
-            var project=$(this).children()[1].children[5].innerText;
+            var projectNo=$(this).children()[1].children[5].innerText;
             company=company.substring(5);
             code16=code16.substring(5);
             name=name.substring(5);
             spec=spec.substring(5);
-            project=project.substring(5);
+            projectNo=projectNo.substring(5);
             var reg=/\t/;
             name=name.replace(reg,"");
             var qty=$(this).find('input').val();
--
libgit2 0.22.2