瀏覽代碼

Merge branch 'master' into prod

buzhanyi 2 年之前
父節點
當前提交
cf211e0418
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      purchase-system/src/main/java/com/ozs/plan/service/impl/PlanQuarterServiceImpl.java

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

@@ -972,10 +972,12 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Date thresholdTimeStart = null;
         Date thresholdTimeEnd = null;
-        Date subTime = planQuarter.getPlanDemandSubTime();
+        Calendar instance = Calendar.getInstance();
+        instance.setTime(planQuarter.getPlanDemandSubTime());
         try {
             for (QuarterEnum val : QuarterEnum.values()) {
-                if (val.getInfo().contains(subTime.getMonth() + "")) {
+                if (val.getInfo().contains((instance.get(Calendar.MONTH) + 1) + "")) {
+                    //System.err.println("MONTH" + (instance.get(Calendar.MONTH) + 1));
                     switch (val.getCode()) {
                         case "1":
                             thresholdTimeStart = dateFormat.parse(thresholdMap.get("第一季度开始时间"));
@@ -997,7 +999,7 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                 }
             }
             if (!ObjectUtils.isEmpty(thresholdTimeStart) && !ObjectUtils.isEmpty(thresholdTimeEnd)) {
-                if (subTime.before(thresholdTimeStart) || subTime.after(thresholdTimeEnd)) {
+                if (instance.before(thresholdTimeStart) || instance.after(thresholdTimeEnd)) {
                     return false;
                 }
             }