Browse Source

待办事项提示信息

buzhanyi 2 years ago
parent
commit
31858e3994

+ 4 - 4
purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java

@@ -110,7 +110,7 @@ public class PmPurchaseExecutionController extends BaseController {
         }
         PmDemand pmDemandUpdate = new PmDemand();
         pmDemandUpdate.setDemandId(demandId);
-        pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode()));
+        pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode());
         pmDemandUpdate.setAgencyId(agencyId);
         pmDemandUpdate.setExtractAgencyTime(new Date());
         pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
@@ -142,7 +142,7 @@ public class PmPurchaseExecutionController extends BaseController {
 
         PmDemand pmDemandUpdate = new PmDemand();
         pmDemandUpdate.setDemandId(demandId);
-        pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode()));
+        pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_UPLOAD_BID_FILE.getCode());
         pmDemandUpdate.setAgencyId(any.getId());
         pmDemandUpdate.setExtractAgencyTime(new Date());
         pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
@@ -170,7 +170,7 @@ public class PmPurchaseExecutionController extends BaseController {
         if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_FILE.getType(),sysFileRefs,getUserId().toString())) {
             PmDemand pmDemandUpdate = new PmDemand();
             pmDemandUpdate.setDemandId(demandId);
-            pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_ANNOUNCEMENT.getCode()));
+            pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_ANNOUNCEMENT.getCode());
             pmDemandUpdate.setUpdateTime(new Date());
             pmDemandUpdate.setUpdateBy(getUserId().toString());
             return success(pmDemandService.updateById(pmDemandUpdate));
@@ -429,7 +429,7 @@ public class PmPurchaseExecutionController extends BaseController {
         if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_WINNING_NOTIFICATION.getType(),sysFileRefs,getUserId().toString())) {
             PmDemand pmDemandUpdate = new PmDemand();
             pmDemandUpdate.setDemandId(demandId);
-            pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
+            pmDemandUpdate.setProjectStatus(PmProjectStatus.CONTRACT_WAIT_FILL.getCode());
             pmDemandUpdate.setUpdateTime(new Date());
             pmDemandUpdate.setUpdateBy(getUserId().toString());
             return success(pmDemandService.updateById(pmDemandUpdate));

+ 35 - 0
purchase-common/src/main/java/com/ozs/common/enums/QuarterEnum.java

@@ -0,0 +1,35 @@
+package com.ozs.common.enums;
+
+/**
+ * 项目审核状态
+ *
+ * @author buzhanyi
+ */
+public enum QuarterEnum {
+    FIRST("1", "1,2,3"),
+    SECOND("2", "4,5,6"),
+    THIRD("3", "7,8,9"),
+    FOURTH("4", "10,11,12");
+
+    /**
+     * 季度
+     */
+    private final String quarter;
+    /**
+     * 月份
+     */
+    private final String mounth;
+
+    QuarterEnum(String quarter, String mounth) {
+        this.quarter = quarter;
+        this.mounth = mounth;
+    }
+
+    public String getCode() {
+        return quarter;
+    }
+
+    public String getInfo() {
+        return mounth;
+    }
+}

+ 1 - 1
purchase-system/src/main/java/com/ozs/home/domain/vo/HomeToDoQueryResVo.java

@@ -113,7 +113,7 @@ public class HomeToDoQueryResVo implements Serializable {
      */
     private Integer planType;
     /**
-     * 提示信息
+     * 待办事项提示信息
      */
     private String tipsMessage;
 }

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

@@ -137,5 +137,8 @@ public class PlanQuarterResponseVo implements Serializable {
      * 已上传的关联附件信息
      */
     List<SysFileInfo> fileInfos;
-
+    /**
+     * 待办事项提示信息
+     */
+    private String tipsMessage;
 }

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

@@ -129,5 +129,8 @@ public class PlanYearsResponseVo implements Serializable {
      * 逻辑删除字段--->(0:正常,1:已删除)
      */
     private Integer delFlay;
-
+    /**
+     * 待办事项提示信息
+     */
+    private String tipsMessage;
 }

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

@@ -2,8 +2,6 @@ package com.ozs.plan.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.entity.SysDept;
 import com.ozs.common.core.domain.entity.SysDictData;
@@ -12,6 +10,7 @@ import com.ozs.common.enums.DataIsDelete;
 import com.ozs.common.enums.PmProjectStatus;
 import com.ozs.common.enums.ProjectStatus;
 import com.ozs.common.enums.ProjectTypes;
+import com.ozs.common.enums.QuarterEnum;
 import com.ozs.common.enums.SysFileRefEnum;
 import com.ozs.common.exception.ServiceException;
 import com.ozs.common.utils.PageUtils;
@@ -21,7 +20,6 @@ import com.ozs.plan.doman.PlanQuarter;
 import com.ozs.plan.doman.PlanYears;
 import com.ozs.plan.doman.vo.requestVo.PlanQuarterStandardVo;
 import com.ozs.plan.doman.vo.responseVo.PlanQuarterResponseVo;
-import com.ozs.plan.doman.vo.responseVo.PlanYearsResponseVo;
 import com.ozs.plan.mapper.PlanQuarterMapper;
 import com.ozs.plan.mapper.PlanYearsMapper;
 import com.ozs.plan.service.PlanQuarterService;
@@ -35,6 +33,7 @@ import com.ozs.system.mapper.SysFileRefMapper;
 import com.ozs.system.service.ISysDeptService;
 import com.ozs.system.service.ISysDictTypeService;
 import com.ozs.system.service.SysFileService;
+import com.sun.xml.internal.bind.util.Which;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -43,6 +42,8 @@ import org.springframework.util.ObjectUtils;
 
 import javax.validation.Validator;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -100,7 +101,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
             int num = 1;
             int size = 200;
             while (size == 200) {
-                LambdaQueryWrapper<PlanQuarter> lw = new LambdaQueryWrapper<PlanQuarter>();
+                LambdaQueryWrapper<PlanQuarter> lw = new LambdaQueryWrapper<>();
                 if (!ObjectUtils.isEmpty(vo.getProjectName())) {
                     lw.like(PlanQuarter::getProjectName, vo.getProjectName());
                 }
@@ -120,7 +121,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
                     lw.le(PlanQuarter::getPlanDemandSubTime, vo.getEndTime());
                 }
                 lw.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete);
-                Page<PlanQuarter> page = planQuarterMapper.selectPage(new Page<PlanQuarter>(num, size, false), lw);
+                Page<PlanQuarter> page = planQuarterMapper.selectPage(new Page<>(num, size, false), lw);
                 list.addAll(page.getRecords());
                 size = page.getRecords().size();
                 num++;
@@ -144,8 +145,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
         } catch (Exception e) {
             e.printStackTrace();
         }
-        Page pages = PageUtils.getPages(vo.getPageNum().intValue(), vo.getPageSize().intValue(), planQuarterList);
-        return pages;
+        return PageUtils.getPages(vo.getPageNum().intValue(), vo.getPageSize().intValue(), planQuarterList);
     }
 
     @Override
@@ -339,7 +339,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
                     if (planQuarter.getProjectAttr().contains(",")) {
                         String[] split = planQuarter.getProjectAttr().split(",");
                         for (String s : split) {
-                            if (planQuarter.getProjectAttr().endsWith(s)) {
+                            if (!planQuarter.getProjectAttr().endsWith(s)) {
                                 builder.append(projectAttributes.get(s) + ",");
                             } else {
                                 builder.append(projectAttributes.get(s));
@@ -356,14 +356,6 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
                     planQuarterMapper.insertPlanQuarter(planQuarter);
                     successNum++;
                     successMsg.append("*" + successNum + "、项目 " + planQuarter.getProjectName() + " 导入成功!");
-                    //} else if (isUpdateSupport) {
-                    //    PlanQuarter quarter = plan.get(0);
-                    //    BeanValidators.validateWithException(validator, planQuarter);
-                    //    quarter.setCreateTime(new Date());
-                    //    quarter.setProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
-                    //    planQuarterMapper.updateById(quarter);
-                    //    successNum++;
-                    //    successMsg.append("<br/>" + successNum + "、项目 " + planQuarter.getProjectName() + " 更新成功");
                 } else {
                     failureNum++;
                     failureMsg.append(failureNum + "*项目 " + planQuarter.getProjectName() + " 已存在!/n");
@@ -386,28 +378,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
 
     @Override
     public AjaxResult commit(PlanQuarterStandardVo quarterStandardVo) {
-        //PlanQuarter byId = PlanQuarterMapper.getById(quarterStandardVo.getPlanPracticalId());
-        //BigDecimal evaluation = byId.getEvaluation();
-        //BigDecimal threshold = new BigDecimal(0);
-        ////获取各个项目类型设定的概算金额阈值
-        //List<SysDictData> data = dictTypeService.selectDictDataByType("sys_over_limit_threshold");
-        //HashMap<String, String> thresholdMap = new LinkedHashMap<>();
-        ////各个类型的概算金额阈值
-        //for (SysDictData dictData : data) {
-        //    //    类型----阈值
-        //    thresholdMap.put(dictData.getDictLabel(), dictData.getDictValue());
-        //}
-        ////项目类型
-        //for (ProjectTypes value : ProjectTypes.values()) {
-        //    if (byId.getProjectType().equals(value.getCode())) {
-        //        threshold = BigDecimal.valueOf(Long.parseLong(thresholdMap.get(value.getInfo())));
-        //    }
-        //    break;
-        //}
-        //
-        //if (evaluation.compareTo(threshold) == 1) {
-        //    //是超额项目
-        //}
+
 
         int commit = planQuarterMapper.commit(quarterStandardVo.getPlanPracticalId());
         if (commit != 1) {
@@ -433,7 +404,7 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
         BeanUtils.copyProperties(byId, demand);
         demand.setPlanId(byId.getPlanPracticalId());
         //同步到项目管理状态为需求待填制
-        demand.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_FILL.getCode()));
+        demand.setProjectStatus(PmProjectStatus.DEMAND_WAIT_FILL.getCode());
         demand.setCreateTime(new Date());
         pmDemandMapper.insert(demand);
         //计划附件也进行同步---查询年度计划附件后复制一份改为项目需求附件
@@ -585,10 +556,10 @@ public class PlanQuarterServiceImpl implements PlanQuarterService {
                     for (String s : split) {
                         for (Map.Entry<String, String> entry : projectAttributes.entrySet()) {
                             if (s.equals(entry.getValue())) {
-                                if (planQuarter.getProjectAttr().endsWith(s)) {
-                                    builder.append(entry.getKey());
-                                } else {
+                                if (!planQuarter.getProjectAttr().endsWith(s)) {
                                     builder.append(entry.getKey() + ",");
+                                } else {
+                                    builder.append(entry.getKey());
                                 }
                                 break;
                             }
@@ -611,8 +582,65 @@ 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));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
             list.add(responseVo);
         }
         return list;
     }
+
+    /**
+     * 根据季度计划在各个季度提报时间的阈值进行提示
+     *
+     * @return
+     */
+    public String planQuarterGetTips(HashMap<String, String> thresholdMap) throws ParseException {
+        //提示信息:定义距离结束时间一周内提示
+        Integer remindTine = 1000 * 60 * 60 * 24 * 7;  //提示语
+        String subTips = "";
+        //季度提报时间的结束时间阈值
+        Date thresholdTime = null;
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date date = new Date();
+        for (QuarterEnum val : QuarterEnum.values()) {
+            if (val.getInfo().contains(date.getMonth() + "")) {
+                switch (val.getCode()) {
+                    case "1":
+                        thresholdTime = dateFormat.parse(thresholdMap.get("第一季度结束时间"));
+                    case "2":
+                        thresholdTime = dateFormat.parse(thresholdMap.get("第二季度结束时间"));
+                    case "3":
+                        thresholdTime = dateFormat.parse(thresholdMap.get("第三季度结束时间"));
+                    case "4":
+                        thresholdTime = dateFormat.parse(thresholdMap.get("第四季度结束时间"));
+                    default:
+                }
+                break;
+            }
+        }
+        double surplus = thresholdTime.getTime() - date.getTime();
+        //少于一周便提醒
+        if (surplus < remindTine && surplus > 0) {
+            //剩余天数(向上取整)
+            int i = new Double(Math.ceil(surplus / 1000 / 60 / 60 / 24)).intValue();
+            if (i > 0) {
+                subTips = "距离计划提报时间不足" + i + "天";
+            }
+        }
+        return subTips;
+    }
+
+
 }

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

@@ -52,6 +52,8 @@ import org.springframework.util.ObjectUtils;
 
 import javax.validation.Validator;
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -456,7 +458,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
             planQuarterMapper.insertPlanQuarter(quarters);
             //同步到项目管理状态为需求待填制
             demand.setPlanId(quarters.getPlanPracticalId());
-            demand.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_FILL.getCode()));
+            demand.setProjectStatus(PmProjectStatus.DEMAND_WAIT_FILL.getCode());
             demand.setCreateTime(new Date());
             pmDemandMapper.insert(demand);
             //计划附件也进行同步---查询年度计划附件后复制一份改为项目需求附件
@@ -846,6 +848,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
             for (PlanQuarterResponseVo planVo : planRes) {
                 HomeToDoQueryResVo home = new HomeToDoQueryResVo();
                 BeanUtils.copyProperties(planVo, home);
+
                 homeRes.add(home);
             }
         }
@@ -952,6 +955,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
         if (!ObjectUtils.isEmpty(yearsRes) && yearsRes.size() > 0) {
             for (PlanYearsResponseVo yearsRe : yearsRes) {
                 PlanQuarterResponseVo responseVo = new PlanQuarterResponseVo();
+
                 BeanUtils.copyProperties(yearsRe, responseVo);
                 quarterRes.add(responseVo);
             }
@@ -1045,8 +1049,47 @@ 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));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
             list.add(responseVo);
         }
         return list;
     }
+
+    /**
+     * 根据年度计划提报时间的阈值进行提示
+     *
+     * @return
+     */
+    public String planYearsGetTips(HashMap<String, String> thresholdMap) throws ParseException {
+        //提示信息:定义距离结束时间一周内提示
+        Integer remindTine = 1000 * 60 * 60 * 24 * 7;
+        //提报时间的结束时间阈值
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        Date thresholdTime = dateFormat.parse(thresholdMap.get("起止时间结束"));
+
+        double surplus = thresholdTime.getTime() - new Date().getTime();
+        //少于一周便提醒
+        if (surplus < remindTine && surplus > 0) {
+            //剩余天数(向上取整)
+            int i = new Double(Math.ceil(surplus / 1000 / 60 / 60 / 24)).intValue();
+            if (i > 0) {
+                return "距离计划提报时间不足" + i + "天";
+            }
+        }
+        return "";
+    }
+
 }

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

@@ -240,7 +240,7 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
         BeanUtils.copyProperties(byId, demand);
         demand.setPlanId(Long.valueOf(byId.getPlanPracticalId()));
         //同步到项目管理状态为需求待填制
-        demand.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_FILL.getCode()));
+        demand.setProjectStatus(PmProjectStatus.DEMAND_WAIT_FILL.getCode());
         demand.setCreateTime(new Date());
         pmDemandMapper.insert(demand);
         //计划附件也进行同步---查询年度计划附件后复制一份改为项目需求附件

+ 4 - 2
purchase-system/src/main/java/com/ozs/pm/doman/PmDemand.java

@@ -132,10 +132,12 @@ public class PmDemand implements Serializable {
     @TableField("WARN_STATUS")
     private String warnStatus;
 
-    /** 项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成) */
+    /**
+     * 项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)
+     */
     @ApiModelProperty("项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:需求已退回,8:任务待下达,9:待选取代理,10:待上传招标文件,11:待发布公告,12:待开标,13:待发布中标公告,14:中标公示中,15:合同待填制,16:项目建设中,17:项目已完成)")
     @TableField("PROJECT_STATUS")
-    private Long projectStatus;
+    private String projectStatus;
 
     /** 退回原因 */
     @ApiModelProperty("退回原因")

+ 8 - 2
purchase-system/src/main/java/com/ozs/pm/doman/vo/responseVo/PmDemandResVo.java

@@ -175,10 +175,12 @@ public class PmDemandResVo extends BaseEntity
     @ApiModelProperty("预警状态名(0:正常,1:预警)")
     private String warnStatusName;
 
-    /** 项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成) */
+    /**
+     * 项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)
+     */
     @Excel(name = "项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)")
     @ApiModelProperty("项目状态(4:需求待填制,5:需求待提交,6:需求待审核,7:任务待下达,8:任务已下达,9:中标信息待填制,10:中标信息已填制,11:合同待填制,12:合同已填制,13:项目建设中,14:项目建设完成)")
-    private Long projectStatus;
+    private String projectStatus;
 
     /** 项目状态名称 */
     @Excel(name = "项目状态名称")
@@ -233,4 +235,8 @@ public class PmDemandResVo extends BaseEntity
      */
     @ApiModelProperty("任务下达文件")
     HashMap<String, String> taskReleaseFileMap;
+    /**
+     * 待办事项提示信息
+     */
+    private String tipsMessage;
 }

+ 40 - 10
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -1,5 +1,7 @@
 package com.ozs.pm.service.impl;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.*;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -411,7 +413,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         List<SysFileRef> sysFileRefs = vo.getSysFileRefs();
         uploadFile(pmBookBuilding.getId(),SysFileRefEnum.PM_BOOK_BUILDING.getType(),sysFileRefs,vo.getUpdateBy());
 
-        pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
+        pmDemand.setProjectStatus(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode());
         pmDemand.setUpdateBy(vo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
         return this.updateById(pmDemand);
@@ -623,7 +625,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public boolean commit(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
-        pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_AUDIT.getCode()));
+        pmDemand.setProjectStatus(PmProjectStatus.DEMAND_WAIT_AUDIT.getCode());
         pmDemand.setUpdateBy(pmDemandReqVo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
         return this.updateById(pmDemand);
@@ -640,7 +642,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public boolean reviewTo(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
-        pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.TASK_WAIT_RELEASE.getCode()));
+        pmDemand.setProjectStatus(PmProjectStatus.TASK_WAIT_RELEASE.getCode());
         List<SysFileRef> sysFileRefs = pmDemandReqVo.getSysFileRefs();
         uploadFile(pmDemandReqVo.getDemandId(),SysFileRefEnum.PM_DEMAND_EXAMINE.getType(),sysFileRefs,pmDemandReqVo.getUpdateBy());
 
@@ -661,7 +663,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public boolean reviewReturn(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
-        pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
+        pmDemand.setProjectStatus(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode());
         pmDemand.setAdjustReason(pmDemandReqVo.getRefuseReason());
         pmDemand.setUpdateBy(pmDemandReqVo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
@@ -680,7 +682,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     public boolean releaseTask(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
-        pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_SELECT_AGENT.getCode()));
+        pmDemand.setProjectStatus(PmProjectStatus.WAIT_SELECT_AGENT.getCode());
         List<SysFileRef> sysFileRefs = pmDemandReqVo.getSysFileRefs();
 
         uploadFile(pmDemandReqVo.getDemandId(),SysFileRefEnum.PM_TAST_RELEASE.getType(),sysFileRefs,pmDemandReqVo.getUpdateBy());
@@ -735,7 +737,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             if (uploadFile(pmReleaseAnnouncement.getId(), SysFileRefEnum.PM_ANNOUNCEMENT_FILE.getType(),pmReleaseAnnouncementReqVo.getSysFileRefs(),pmReleaseAnnouncementReqVo.getUpdateBy())) {
                 PmDemand pmDemandUpdate = new PmDemand();
                 pmDemandUpdate.setDemandId(pmReleaseAnnouncementReqVo.getDemandId());
-                pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_OPEN_BID.getCode()));
+                pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
                 pmDemandUpdate.setUpdateTime(pmReleaseAnnouncementReqVo.getUpdateTime());
                 pmDemandUpdate.setUpdateBy(pmReleaseAnnouncementReqVo.getUpdateBy());
                 if(this.updateById(pmDemandUpdate)){
@@ -996,7 +998,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
        if(pmBidOpeningService.saveBatch(pmBidOpeningList)) {
            PmDemand pmDemandUpdate = new PmDemand();
            pmDemandUpdate.setDemandId(pmDemand.getDemandId());
-           pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_BID_ANNOUNCEMENT.getCode()));
+           pmDemandUpdate.setProjectStatus(PmProjectStatus.WAIT_BID_ANNOUNCEMENT.getCode());
            pmDemandUpdate.setUpdateTime(now);
            pmDemandUpdate.setUpdateBy(pmBidOpeningFillReqVo.getUpdateBy());
            return this.updateById(pmDemandUpdate);
@@ -1036,7 +1038,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
               if(uploadFile(pmBidWinning.getId(), SysFileRefEnum.PM_BID_WINNING_FILE.getType(),pmBidWinningReqVo.getSysFileRefs(),pmBidWinningReqVo.getUpdateBy())) {
                   PmDemand pmDemandUpdate = new PmDemand();
                   pmDemandUpdate.setDemandId(pmBidWinningReqVo.getDemandId());
-                  pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.BIDDING_PUBLICITY.getCode()));
+                  pmDemandUpdate.setProjectStatus(PmProjectStatus.BIDDING_PUBLICITY.getCode());
                   pmDemandUpdate.setUpdateTime(pmBidWinningReqVo.getUpdateTime());
                   pmDemandUpdate.setUpdateBy(pmBidWinningReqVo.getUpdateBy());
                   return this.updateById(pmDemandUpdate);
@@ -1142,7 +1144,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
 
                 PmDemand pmDemandUpdate = new PmDemand();
                 pmDemandUpdate.setDemandId(demandId);
-                pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.UNDER_CONSTRUCTION.getCode()));
+                pmDemandUpdate.setProjectStatus(PmProjectStatus.UNDER_CONSTRUCTION.getCode());
                 pmDemandUpdate.setUpdateTime(pmContractInfoReqVo.getUpdateTime());
                 pmDemandUpdate.setUpdateBy(pmContractInfoReqVo.getUpdateBy());
                 return this.updateById(pmDemandUpdate);
@@ -1179,7 +1181,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             if (this.uploadFile(pmProjectConstruction.getId(), SysFileRefEnum.PM_PROJECT_CONSTRUCTION.getType(),sysFileRefs,pmProjectConstructionReqVo.getUpdateBy())) {
                 PmDemand pmDemandUpdate = new PmDemand();
                 pmDemandUpdate.setDemandId(demandId);
-                pmDemandUpdate.setProjectStatus(Long.parseLong(PmProjectStatus.COMPLETION_CONSTRUCTION.getCode()));
+                pmDemandUpdate.setProjectStatus(PmProjectStatus.COMPLETION_CONSTRUCTION.getCode());
                 pmDemandUpdate.setUpdateTime(pmProjectConstructionReqVo.getUpdateTime());
                 pmDemandUpdate.setUpdateBy(pmProjectConstructionReqVo.getUpdateBy());
                 return this.updateById(pmDemandUpdate);
@@ -1369,8 +1371,36 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     break;
                 }
             }
+
+            try {
+                vo.setTipsMessage(pmDemandGetTips(vo.getPlanDeliverTime()));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
             pmDemandResponseVoList.add(vo);
         }
         return pmDemandResponseVoList;
     }
+
+    /**
+     * 根据年度计划提报时间的阈值进行提示
+     *
+     * @return
+     */
+    public String pmDemandGetTips(Date planDeliverTime) throws ParseException {
+        //提示信息:定义距离结束时间一周内提示
+        Integer remindTine = 1000 * 60 * 60 * 24 * 7;
+        //少于一周便提醒
+        double surplus = planDeliverTime.getTime() - new Date().getTime();
+        if (surplus < remindTine) {
+            int i = new Double(Math.ceil(surplus / 1000 / 60 / 60 / 24)).intValue();
+            //剩余天数(向上取整)
+            if (i > 0) {
+                return "距离计划交付时间不足" + i + "天";
+            } else {
+                return "已超过计划完成时间" + i + "天";
+            }
+        }
+        return "";
+    }
 }