Forráskód Böngészése

Merge branch 'master' of http://124.70.58.209:3000/ytrd-project-management/purchase

 Conflicts:
	purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java
sunhh 2 éve
szülő
commit
51f5cceb29

+ 4 - 3
purchase-system/src/main/java/com/ozs/plan/doman/vo/responseVo/PlanYearsResponseVo.java

@@ -70,18 +70,19 @@ public class PlanYearsResponseVo implements Serializable {
     /**
      * 计划提报需求时间--->需求单位成功提报采购需求的日期(具体到月)
      */
-    @Excel(name = "提报需求时间", dateFormat = "yyyy-MM-dd")
+    @Excel(name = "计划提报需求时间", dateFormat = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date planDemandSubTime;
     /**
      * 计划完成采购时间--->公示中标结果的日期,即填制中标信息的日期(具体到月)
      */
-    @Excel(name = "完成采购时间", dateFormat = "yyyy-MM-dd")
+    @Excel(name = "计划完成采购时间", dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date planPurchaseFinishTime;
     /**
      * 计划交付时间--->供应商完成并交付后,使用单位收到标的日期,即填制建设文档的日期
      */
-    @Excel(name = "交付(实施)时间", dateFormat = "yyyy-MM-dd")
+    @Excel(name = "计划交付(实施)时间", dateFormat = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date planDeliverTime;
     /**

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

@@ -523,7 +523,22 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
 
     //字段赋值对应的名称
     public List<PlanQuarterResponseVo> changeTo(List<PlanQuarter> planQuarters) {
-
+        //获取季度计划各个季度提报时间的阈值
+        List<SysDictData> supTime = dictTypeService.selectDictDataByType("sys_quarterly_plan");
+        HashMap<String, String> thresholdMap = new LinkedHashMap<>();
+        //各个季度提报时间的阈值
+        for (SysDictData dictData : supTime) {
+            //    季度----阈值
+            thresholdMap.put(dictData.getDictLabel(), dictData.getDictValue());
+        } //提前或延后*天进行提醒
+        List<SysDictData> alertTime = dictTypeService.selectDictDataByType("alert_time_setting");
+        HashMap<String, String> alertTimeMap = new LinkedHashMap<>();
+        //根据时间类别设定的提醒时间
+        for (SysDictData dictData : alertTime) {
+            //    字段名称----阈值
+            alertTimeMap.put(dictData.getDictLabel(), dictData.getDictValue());
+        }
+        //获取字典数据
         HashMap<String, HashMap<String, String>> planEnums = dictTypeService.getAboutEnums();
         HashMap<String, String> projectTypesMap = planEnums.get("projectTypes");
         HashMap<String, String> planPurchaseModesMap = planEnums.get("planPurchaseModes");
@@ -582,16 +597,8 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
             }
             BeanUtils.copyProperties(planQuarter, responseVo);
 
-            //获取季度计划各个季度提报时间的阈值
-            List<SysDictData> supTime = dictTypeService.selectDictDataByType("sys_quarterly_plan");
-            HashMap<String, String> thresholdMap = new LinkedHashMap<>();
-            //各个季度提报时间的阈值
-            for (SysDictData dictData : supTime) {
-                //    季度----阈值
-                thresholdMap.put(dictData.getDictLabel(), dictData.getDictValue());
-            }
             try {
-                responseVo.setTipsMessage(planQuarterGetTips(thresholdMap));
+                responseVo.setTipsMessage(planQuarterGetTips(thresholdMap, alertTimeMap));
             } catch (ParseException e) {
                 e.printStackTrace();
             }
@@ -605,9 +612,11 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
      *
      * @return
      */
-    public String planQuarterGetTips(HashMap<String, String> thresholdMap) throws ParseException {
+    public String planQuarterGetTips(HashMap<String, String> thresholdMap, HashMap<String, String> alertTimeMap) throws ParseException {
+        //提示信息:定义距离结束时间*天内提示
+        int alertDay = Integer.parseInt(alertTimeMap.get("计划提报时间"));
         //提示信息:定义距离结束时间一周内提示
-        Integer remindTine = 1000 * 60 * 60 * 24 * 7;  //提示语
+        Integer remindTine = 1000 * 60 * 60 * 24 * alertDay;  //提示语
         String subTips = "";
         //季度提报时间的结束时间阈值
         Date thresholdTime = null;

+ 35 - 15
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -991,6 +991,22 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
 
     //字段赋值对应的名称
     public List<PlanYearsResponseVo> changeTo(List<PlanYears> planYears) {
+        //获取年度计划提报时间的阈值
+        List<SysDictData> supTime = dictTypeService.selectDictDataByType("sys_annual_plan");
+        HashMap<String, String> thresholdMap = new LinkedHashMap<>();
+        //年度提报时间的阈值
+        for (SysDictData dictData : supTime) {
+            //    字段名称----阈值
+            thresholdMap.put(dictData.getDictLabel(), dictData.getDictValue());
+        }
+        //提前或延后*天进行提醒
+        List<SysDictData> alertTime = dictTypeService.selectDictDataByType("alert_time_setting");
+        HashMap<String, String> alertTimeMap = new LinkedHashMap<>();
+        //根据时间类别设定的提醒时间
+        for (SysDictData dictData : alertTime) {
+            //    字段名称----阈值
+            alertTimeMap.put(dictData.getDictLabel(), dictData.getDictValue());
+        }
         //获取字典数据
         HashMap<String, HashMap<String, String>> planEnums = dictTypeService.getAboutEnums();
         HashMap<String, String> projectTypesMap = planEnums.get("projectTypes");
@@ -1049,17 +1065,8 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                 }
             }
             BeanUtils.copyProperties(planYear, responseVo);
-
-            //获取年度计划提报时间的阈值
-            List<SysDictData> supTime = dictTypeService.selectDictDataByType("sys_annual_plan");
-            HashMap<String, String> thresholdMap = new LinkedHashMap<>();
-            //年度提报时间的阈值
-            for (SysDictData dictData : supTime) {
-                //    字段名称----阈值
-                thresholdMap.put(dictData.getDictLabel(), dictData.getDictValue());
-            }
             try {
-                responseVo.setTipsMessage(planYearsGetTips(thresholdMap));
+                responseVo.setTipsMessage(planYearsGetTips(responseVo, thresholdMap, alertTimeMap));
             } catch (ParseException e) {
                 e.printStackTrace();
             }
@@ -1073,22 +1080,35 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
      *
      * @return
      */
-    public String planYearsGetTips(HashMap<String, String> thresholdMap) throws ParseException {
-        //提示信息:定义距离结束时间一周内提示
-        Integer remindTine = 1000 * 60 * 60 * 24 * 7;
+    public String planYearsGetTips(PlanYearsResponseVo responseVo, HashMap<String, String> thresholdMap, HashMap<String, String> alertTimeMap) throws ParseException {
+        //提示信息:定义距离结束时间*天内提示
+        int alertDay = Integer.parseInt(alertTimeMap.get("计划提报时间"));
+        Integer remindTime = 1000 * 60 * 60 * 24 * alertDay;
         //提报时间的结束时间阈值
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Date thresholdTime = dateFormat.parse(thresholdMap.get("起止时间结束"));
 
         double surplus = thresholdTime.getTime() - System.currentTimeMillis();
-        //少于一周便提醒
-        if (surplus < remindTine && surplus > 0) {
+        //少于设定阈值便提醒
+        if (surplus < remindTime && surplus > 0) {
             //剩余天数(向上取整)
             int i = new Double(Math.ceil(surplus / 1000 / 60 / 60 / 24)).intValue();
             if (i > 0) {
                 return "距离计划提报时间不足" + i + "天";
             }
         }
+        //距离计划完成采购时间一周内提醒
+        Integer alertTime = 1000 * 60 * 60 * 24 * 7;
+        double surplusTwo = responseVo.getPlanPurchaseFinishTime().getTime() - System.currentTimeMillis();
+        //少于设定阈值便提醒
+        if (surplusTwo < alertTime && surplusTwo > 0) {
+            //剩余天数(向上取整)
+            int i = new Double(Math.ceil(surplusTwo / 1000 / 60 / 60 / 24)).intValue();
+            if (i > 0) {
+                return "距离计划完成采购时间不足" + i + "天";
+            }
+        }
+
         return "";
     }
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 397 - 415
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java