瀏覽代碼

提报时间不在阈值范围内

buzhanyi 2 年之前
父節點
當前提交
73d87d0eca

+ 1 - 1
purchase-admin/src/main/java/com/ozs/web/controller/plan/PlanQuarterController.java

@@ -173,7 +173,7 @@ public class PlanQuarterController extends BaseController {
 
     @ApiOperation(value = "提交季度计划")
     @PostMapping("/commit")
-    @PreAuthorize("@ss.hasPermi('plan:quarter:commit')")
+    //@PreAuthorize("@ss.hasPermi('plan:quarter:commit')")
     @Log(title = ModularConstans.planQuarter, businessType = BusinessType.UPDATE)
     public AjaxResult commit(@RequestBody PlanQuarterStandardVo quarterStandardVo) {
         return quarterService.commit(quarterStandardVo);

+ 1 - 1
purchase-admin/src/main/java/com/ozs/web/controller/plan/PlanYearsController.java

@@ -174,7 +174,7 @@ public class PlanYearsController extends BaseController {
 
     @ApiOperation(value = "提交年度计划")
     @PostMapping("/commit")
-    @PreAuthorize("@ss.hasPermi('plan:planYears:commit')")
+    //@PreAuthorize("@ss.hasPermi('plan:planYears:commit')")
     @Log(title = ModularConstans.planYear, businessType = BusinessType.UPDATE)
     public AjaxResult commit(@RequestBody PlanYearsStandardVo yearsStandardVo) {
         return planYearsService.commit(yearsStandardVo);

+ 1 - 1
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanQuarterServiceImpl.java

@@ -787,7 +787,7 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                 }
             }
             if (!ObjectUtils.isEmpty(thresholdTimeStart) && !ObjectUtils.isEmpty(thresholdTimeEnd)) {
-                if (!subTime.after(thresholdTimeStart) && !subTime.before(thresholdTimeEnd)) {
+                if (subTime.before(thresholdTimeStart) || subTime.after(thresholdTimeEnd)) {
                     return false;
                 }
             }

+ 4 - 5
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -341,14 +341,13 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
             thresholdMap.put(dictData.getDictLabel(), dictData.getDictValue());
         }
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-        Date thresholdTimeStart = null;
-        Date thresholdTimeEnd = null;
         Date subTime = planYear.getPlanDemandSubTime();
         try {
+            Date thresholdTimeStart = dateFormat.parse(thresholdMap.get("起止时间开始"));
+            Date thresholdTimeEnd = dateFormat.parse(thresholdMap.get("起止时间结束"));
+            ;
             if (!ObjectUtils.isEmpty(thresholdTimeStart) && !ObjectUtils.isEmpty(thresholdTimeEnd)) {
-                thresholdTimeStart = dateFormat.parse(thresholdMap.get("起止时间开始"));
-                thresholdTimeEnd = dateFormat.parse(thresholdMap.get("起止时间结束"));
-                if (!subTime.after(thresholdTimeStart) && !subTime.before(thresholdTimeEnd)) {
+                if (subTime.before(thresholdTimeStart) || subTime.after(thresholdTimeEnd)) {
                     return false;
                 }
             }