瀏覽代碼

修复bug

sola 1 年之前
父節點
當前提交
7951e60e99

+ 14 - 2
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxInsideInspectionServiceImpl.java

@@ -1445,7 +1445,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
      * @return
      */
     private String checkParam4Cancel(InsideOperDto operDto, InsideInspectionRequest dto) {
-
+        SysUserVo currUser = zhcxCommon.getCurrentUser();
         //报验完成
         if("30".equals(operDto.getInspection().getInspectionstatus())) {
             return "单据号:".concat(operDto.getInspection().getInspectioncode()).concat("检验员已提交报验结论不能取消,请刷新数据查看");
@@ -1457,9 +1457,21 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
         }
 
         // 待报验、已派单
+        // 允许主任、站长、检验员
         if("20".equals(operDto.getInspection().getInspectionstatus())
         && "20".equals(operDto.getDispatch().getDispatchstatus())) {
-            return "单据号:".concat(operDto.getInspection().getInspectioncode()).concat("该报验单已被派单,不能取消,请刷新数据查看");
+            boolean notAllow = true;
+            if (currUser.getId().equals(operDto.getDispatch().getSupervisionid())) {
+                notAllow = false;
+            }
+            for(SysRoleDo roleDo : currUser.getRoleDos()) {
+                if (roleDo.getCode().equals("role095") || roleDo.getCode().equals("role080")) {
+                    notAllow = false;
+                }
+            }
+            if (notAllow) {
+                return "单据号:".concat(operDto.getInspection().getInspectioncode()).concat("该报验单已被派单,不能取消,请刷新数据查看");
+            }
         }
 
         //取消