Parcourir la source

DeBugDeBugDeBug

buzhanyi il y a 2 ans
Parent
commit
54ec97f4aa

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

@@ -19,6 +19,7 @@ import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.file.FileUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
 import com.ozs.framework.web.service.TokenService;
+import com.ozs.plan.doman.PlanQuarter;
 import com.ozs.plan.doman.PlanYears;
 import com.ozs.plan.doman.vo.requestVo.PlanYearsStandardVo;
 import com.ozs.plan.doman.vo.responseVo.PlanYearsResponseVo;
@@ -95,15 +96,16 @@ public class PlanYearsController extends BaseController {
             if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
                 lw.eq(PlanYears::getProjectStatus, vo.getProjectStatus());
             }
-            if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                lw.ge(PlanYears::getPlanDemandSubTime, vo.getBeginTime());
-            }
-            if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                Date ofMonth = DateUtils.getLastDayOfMonth(vo.getEndTime());
-                SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
-                lw.le(PlanYears::getPlanDemandSubTime, parse);
+            if (!ObjectUtils.isEmpty(vo.getParams())) {
+                if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                    lw.ge(PlanYears::getPlanDemandSubTime, vo.getParams().get("beginTime"));
+                }
+                if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                    Date parse = dateFormatT.parse(dateFormat.format(vo.getParams().get("endTime")) + " 23:59:59:999");
+                    lw.le(PlanYears::getPlanDemandSubTime, parse);
+                }
             }
             lw.eq(PlanYears::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
             lw.orderBy(true, false, PlanYears::getCreateTime);

+ 2 - 2
purchase-common/src/main/java/com/ozs/common/utils/DateUtils.java

@@ -197,8 +197,8 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         calendar.add(Calendar.MONTH, 1);//月增加1天
         calendar.add(Calendar.DAY_OF_MONTH, -1);//日期倒数一日,既得到本月最后一天
         Date voucherDate = calendar.getTime();
-        System.out.println(dateFormatT.format(voucherDate));
-        System.out.println(dateFormatT.format(voucherDate).substring(8));
+        //System.out.println(dateFormatT.format(voucherDate));
+        //System.out.println(dateFormatT.format(voucherDate).substring(8));
         return voucherDate;
     }
 

+ 8 - 2
purchase-system/src/main/java/com/ozs/plan/doman/vo/requestVo/PlanQuarterStandardVo.java

@@ -2,16 +2,17 @@ package com.ozs.plan.doman.vo.requestVo;
 
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.vo.PageVo;
 import com.ozs.system.domain.SysFileRef;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author buzhanyi
@@ -165,5 +166,10 @@ public class PlanQuarterStandardVo extends PageVo {
     private Date beginTime;
     @JsonFormat(pattern = "yyyy-MM")
     private Date endTime;
-
+    /**
+     * 请求参数
+     */
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    @ApiModelProperty("请求参数")
+    private Map<String, Object> params;
 }

+ 17 - 7
purchase-system/src/main/java/com/ozs/plan/doman/vo/requestVo/PlanYearsStandardVo.java

@@ -3,6 +3,7 @@ package com.ozs.plan.doman.vo.requestVo;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.ozs.common.annotation.Excel;
 import com.ozs.common.vo.PageVo;
 import com.ozs.system.domain.SysFileRef;
@@ -13,6 +14,7 @@ import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author buzhanyi
@@ -156,13 +158,6 @@ public class PlanYearsStandardVo extends PageVo {
      */
     List<SysFileRef> sysFileRefs;
 
-    /**
-     * 查询参数开始时间和结束时间
-     */
-    @JsonFormat(pattern = "yyyy-MM")
-    private Date beginTime;
-    @JsonFormat(pattern = "yyyy-MM")
-    private Date endTime;
 
     /**
      * 查看详情的类型
@@ -174,4 +169,19 @@ public class PlanYearsStandardVo extends PageVo {
      * 是否是拉取到季度计划 true:是
      */
     private String isToQuarter;
+
+    /**
+     * 请求参数
+     */
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    @ApiModelProperty("请求参数")
+    private Map<String, Object> params;
+    ///**
+    // * 查询参数开始时间和结束时间
+    // */
+    //@JsonFormat(pattern = "yyyy-MM")
+    //private Date beginTime;
+    //@JsonFormat(pattern = "yyyy-MM")
+    //private Date endTime;
+
 }

+ 10 - 2
purchase-system/src/main/java/com/ozs/plan/doman/vo/requestVo/ProvisionalPlanVo.java

@@ -2,6 +2,7 @@ package com.ozs.plan.doman.vo.requestVo;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.ozs.common.vo.PageVo;
 import com.ozs.system.domain.SysFileInfo;
 import com.ozs.system.domain.SysFileRef;
@@ -12,12 +13,19 @@ import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 @Data
 public class ProvisionalPlanVo extends PageVo {
 
-    private Date beginTime;
-    private Date endTime;
+    //private Date beginTime;
+    //private Date endTime;
+    /**
+     * 请求参数
+     */
+    @JsonInclude(JsonInclude.Include.NON_EMPTY)
+    @ApiModelProperty("请求参数")
+    private Map<String, Object> params;
     /**
      * 上传附件
      */

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

@@ -118,15 +118,21 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                 if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
                     lw.eq(PlanQuarter::getProjectStatus, vo.getProjectStatus());
                 }
-                if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                    lw.ge(PlanQuarter::getPlanDemandSubTime, vo.getBeginTime());
-                }
-                if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                    Date ofMonth = DateUtils.getLastDayOfMonth(vo.getEndTime());
-                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
-                    lw.le(PlanQuarter::getPlanDemandSubTime, parse);
+                if (!ObjectUtils.isEmpty(vo.getParams())) {
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date beginTime = dateFormat.parse(vo.getParams().get("beginTime").toString() + "-01");
+                        //Date ofMonth = dateFormat.parse(date + "-01");
+                        lw.ge(PlanQuarter::getPlanDemandSubTime, beginTime);
+                    }
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
+                        SimpleDateFormat dateFormaH = new SimpleDateFormat("yyyy-MM-dd");
+                        Date ofMonth = DateUtils.getLastDayOfMonth(dateFormat.parse(vo.getParams().get("endTime").toString()));
+                        SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                        Date parse = dateFormatT.parse(dateFormaH.format(ofMonth) + " 23:59:59:999");
+                        lw.le(PlanQuarter::getPlanDemandSubTime, parse);
+                    }
                 }
                 lw.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
                 Page<PlanQuarter> page = planQuarterMapper.selectPage(new Page<>(num, size, false), lw);
@@ -165,15 +171,16 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                 } else {
                     lw.in(PlanQuarter::getProjectStatus, "1,3");
                 }
-                if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                    lw.ge(PlanQuarter::getPlanDemandSubTime, vo.getBeginTime());
-                }
-                if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                    Date ofMonth = DateUtils.getLastDayOfMonth(vo.getEndTime());
-                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
-                    lw.le(PlanQuarter::getPlanDemandSubTime, parse);
+                if (!ObjectUtils.isEmpty(vo.getParams())) {
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                        lw.ge(PlanQuarter::getPlanDemandSubTime, vo.getParams().get("beginTime"));
+                    }
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                        SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date parse = dateFormatT.parse(dateFormat.format(vo.getParams().get("endTime")) + " 23:59:59:999");
+                        lw.le(PlanQuarter::getPlanDemandSubTime, parse);
+                    }
                 }
                 lw.eq(PlanQuarter::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
                 Page<PlanQuarter> page = planQuarterMapper.selectPage(new Page<PlanQuarter>(num, size, false), lw);

+ 28 - 18
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -52,6 +52,7 @@ import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -122,15 +123,16 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                 if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
                     lw.eq(PlanYears::getProjectStatus, vo.getProjectStatus());
                 }
-                if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                    lw.ge(PlanYears::getPlanDemandSubTime, vo.getBeginTime());
-                }
-                if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                    Date ofMonth = DateUtils.getLastDayOfMonth(vo.getEndTime());
-                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
-                    lw.le(PlanYears::getPlanDemandSubTime, parse);
+                if (!ObjectUtils.isEmpty(vo.getParams())) {
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                        lw.ge(PlanYears::getPlanDemandSubTime, vo.getParams().get("beginTime"));
+                    }
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                        SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date parse = dateFormatT.parse(dateFormat.format(vo.getParams().get("endTime")) + " 23:59:59:999");
+                        lw.le(PlanYears::getPlanDemandSubTime, parse);
+                    }
                 }
                 lw.eq(PlanYears::getDelFlay, DataIsDelete.DataNOTDelete.getCode());
                 Page<PlanYears> page = planYearsMapper.selectPage(new Page<PlanYears>(num, size, false), lw);
@@ -168,15 +170,23 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                 } else {
                     lw.in(PlanYears::getProjectStatus, "1,3");
                 }
-                if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                    lw.ge(PlanYears::getPlanDemandSubTime, vo.getBeginTime());
-                }
-                if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                    Date ofMonth = DateUtils.getLastDayOfMonth(vo.getEndTime());
-                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
-                    lw.le(PlanYears::getPlanDemandSubTime, parse);
+                if (!ObjectUtils.isEmpty(vo.getParams())) {
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                        String beginTime = vo.getParams().get("beginTime").toString();
+                        Date date = new Date();
+                        date.setYear(Integer.parseInt(beginTime.substring(0, 4)));
+                        date.setMonth(Integer.parseInt(beginTime.substring(5, 7)));
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");
+                        Date ofMonth = dateFormat.parse(date + "-01");
+                        lw.ge(PlanYears::getPlanDemandSubTime, ofMonth);
+                    }
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                        SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date ofMonth = DateUtils.getLastDayOfMonth(dateFormat.parse(vo.getParams().get("endTime").toString()));
+                        Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
+                        lw.le(PlanYears::getPlanDemandSubTime, parse);
+                    }
                 }
                 lw.eq(PlanYears::getDelFlay, DataIsDelete.DataNOTDelete);
                 Page<PlanYears> page = planYearsMapper.selectPage(new Page<PlanYears>(num, size, false), lw);

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

@@ -18,6 +18,7 @@ import com.ozs.common.utils.PageUtils;
 import com.ozs.common.utils.SecurityUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.bean.BeanUtils;
+import com.ozs.plan.doman.PlanQuarter;
 import com.ozs.plan.doman.PlanYears;
 import com.ozs.plan.doman.ProvisionalPlan;
 import com.ozs.plan.doman.vo.requestVo.PlanQuarterStandardVo;
@@ -210,15 +211,17 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
                 if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
                     lw.eq(ProvisionalPlan::getProjectStatus, vo.getProjectStatus());
                 }
-                if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                    lw.ge(ProvisionalPlan::getPlanDemandSubTime, vo.getBeginTime());
-                }
-                if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                    Date ofMonth = DateUtils.getLastDayOfMonth(vo.getEndTime());
-                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
-                    lw.le(ProvisionalPlan::getPlanDemandSubTime, parse);
+                if (!ObjectUtils.isEmpty(vo.getParams())) {
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                        lw.ge(ProvisionalPlan::getPlanDemandSubTime, vo.getParams().get("beginTime"));
+                    }
+                    if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                        SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                        Date ofMonth = DateUtils.getLastDayOfMonth(dateFormat.parse(vo.getParams().get("endTime").toString()));
+                        Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
+                        lw.le(ProvisionalPlan::getPlanDemandSubTime, parse);
+                    }
                 }
 
                 Page<ProvisionalPlan> page = provisionalPlanMapper.selectPage(new Page<ProvisionalPlan>(num, size, false), lw);
@@ -294,14 +297,17 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
             if (!ObjectUtils.isEmpty(vo.getProjectStatus())) {
                 lw.eq(ProvisionalPlan::getProjectStatus, vo.getProjectStatus());
             }
-            if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                lw.ge(ProvisionalPlan::getPlanDemandSubTime, vo.getBeginTime());
-            }
-            if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                Date parse = dateFormatT.parse(dateFormat.format(vo.getEndTime()) + " 23:59:59:999");
-                lw.le(ProvisionalPlan::getPlanDemandSubTime, parse);
+            if (!ObjectUtils.isEmpty(vo.getParams())) {
+                if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                    lw.ge(ProvisionalPlan::getPlanDemandSubTime, vo.getParams().get("beginTime"));
+                }
+                if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                    Date ofMonth = DateUtils.getLastDayOfMonth(dateFormat.parse(vo.getParams().get("endTime").toString()));
+                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
+                    lw.le(ProvisionalPlan::getPlanDemandSubTime, parse);
+                }
             }
             lw.orderBy(true, false, ProvisionalPlan::getCreateTime);
             List<ProvisionalPlan> list = provisionalPlanMapper.selectList(lw);
@@ -345,16 +351,18 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
             } else {
                 lw.apply("  project_status IN (1,3)", "");
             }
-            if (!ObjectUtils.isEmpty(vo.getBeginTime())) {
-                lw.ge(ProvisionalPlan::getPlanDemandSubTime, vo.getBeginTime());
-            }
-            if (!ObjectUtils.isEmpty(vo.getEndTime())) {
-                SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-                SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
-                Date parse = dateFormatT.parse(dateFormat.format(vo.getEndTime()) + " 23:59:59:999");
-                lw.le(ProvisionalPlan::getPlanDemandSubTime, parse);
+            if (!ObjectUtils.isEmpty(vo.getParams())) {
+                if (!ObjectUtils.isEmpty(vo.getParams().get("beginTime"))) {
+                    lw.ge(ProvisionalPlan::getPlanDemandSubTime, vo.getParams().get("beginTime"));
+                }
+                if (!ObjectUtils.isEmpty(vo.getParams().get("endTime"))) {
+                    SimpleDateFormat dateFormatT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
+                    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                    Date ofMonth = DateUtils.getLastDayOfMonth(dateFormat.parse(vo.getParams().get("endTime").toString()));
+                    Date parse = dateFormatT.parse(dateFormat.format(ofMonth) + " 23:59:59:999");
+                    lw.le(ProvisionalPlan::getPlanDemandSubTime, parse);
+                }
             }
-
             lw.orderBy(true, false, ProvisionalPlan::getCreateTime);
             List<ProvisionalPlan> list = provisionalPlanMapper.selectList(lw);
             provisionalPlanList = changeTo(list);

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

@@ -2283,10 +2283,16 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         yearLastZ.add(PmProjectStatus.WASTE_BID_RETURN.getCode());
         pmDemandReqVo.setProjectStatusList(yearLastZ);
         StatisticalChartsResVo resVo7 = pmDemandMapper.majorProjectByStatusLastYear(pmDemandReqVo);
-        resVo7.setColumnName("上年度结转和本年度新提报");
-        resVo7.setColumnNamePlus("重大规划采购任务累计数量");
+        if (ObjectUtils.isEmpty(resVo7)) {
+            resVo7 = new StatisticalChartsResVo();
+            resVo7.setNum(0);
+            resVo7.setEvaluationTotal(BigDecimal.ZERO);
+            resVo7.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         resVo7.setNum(resVo7.getNum() + resVo3.getNum());
         resVo7.setEvaluationTotal(resVo7.getEvaluationTotal().add(resVo3.getEvaluationTotal()));
+        resVo7.setColumnName("上年度结转和本年度新提报");
+        resVo7.setColumnNamePlus("重大规划采购任务累计数量");
         resVos.add(resVo7);
         //今年以来累计完成数量
         pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
@@ -2348,31 +2354,55 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         yearLastZ.add(PmProjectStatus.WASTE_BID_RETURN.getCode());
         pmDemandReqVo.setProjectStatusList(yearLastZ);
         StatisticalChartsResVo resVo7 = pmDemandMapper.majorProjectByStatusLastYear(pmDemandReqVo);
+        if (ObjectUtils.isEmpty(resVo7)) {
+            resVo7 = new StatisticalChartsResVo();
+            resVo7.setNum(0);
+            resVo7.setEvaluationTotal(BigDecimal.ZERO);
+            resVo7.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         resVo7.setColumnName("上年度结转和本年度新提报");
         resVo7.setColumnNamePlus("累计项目数量");
         //上年度结转和本月度新受领重大规划采购任务累计项目数量预算金额
         pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
         StatisticalChartsResVo resVo4 = pmDemandMapper.majorProjectByStatusThisMonthFiCGB(pmDemandReqVo);
-        resVo4.setColumnName("上年度结转和本月度新受领");
-        resVo4.setColumnNamePlus("累计项目数量");
+        if (ObjectUtils.isEmpty(resVo4)) {
+            resVo4 = new StatisticalChartsResVo();
+            resVo4.setNum(0);
+            resVo4.setEvaluationTotal(BigDecimal.ZERO);
+            resVo4.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         resVo4.setNum(resVo4.getNum() + resVo7.getNum());
         resVo4.setEvaluationTotal(resVo4.getEvaluationTotal().add(resVo7.getEvaluationTotal()));
+        resVo4.setColumnName("上年度结转和本月度新受领");
+        resVo4.setColumnNamePlus("累计项目数量");
         resVos.add(resVo4);
         //上年度结转和本季度新受领重大规划采购任务累计项目数量预算金额
         pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
         StatisticalChartsResVo resVo5 = pmDemandMapper.majorProjectByStatusThisQuaFiCGB(pmDemandReqVo);
-        resVo5.setColumnName("上年度结转和本季度新受领");
-        resVo5.setColumnNamePlus("累计项目数量");
+        if (ObjectUtils.isEmpty(resVo5)) {
+            resVo5 = new StatisticalChartsResVo();
+            resVo5.setNum(0);
+            resVo5.setEvaluationTotal(BigDecimal.ZERO);
+            resVo5.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         resVo5.setNum(resVo5.getNum() + resVo7.getNum());
         resVo5.setEvaluationTotal(resVo5.getEvaluationTotal().add(resVo7.getEvaluationTotal()));
+        resVo5.setColumnName("上年度结转和本季度新受领");
+        resVo5.setColumnNamePlus("累计项目数量");
         resVos.add(resVo5);
         //上年度结转和本年度新受领重大规划采购任务累计项目数量预算金额
         pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
         StatisticalChartsResVo resVo6 = pmDemandMapper.majorProjectByStatusThisYearFiCGB(pmDemandReqVo);
-        resVo6.setColumnName("上年度结转和本年度新受领");
-        resVo6.setColumnNamePlus("累计项目数量");
+        if (ObjectUtils.isEmpty(resVo6)) {
+            resVo6 = new StatisticalChartsResVo();
+            resVo6.setNum(0);
+            resVo6.setEvaluationTotal(BigDecimal.ZERO);
+            resVo6.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         resVo6.setNum(resVo6.getNum() + resVo7.getNum());
         resVo6.setEvaluationTotal(resVo6.getEvaluationTotal().add(resVo7.getEvaluationTotal()));
+        resVo6.setColumnName("上年度结转和本年度新受领");
+        resVo6.setColumnNamePlus("累计项目数量");
         resVos.add(resVo6);
         //本月度完成重大规划采购任务数量
         pmDemandReqVo.setProjectStatus(Long.valueOf(PmProjectStatus.CONTRACT_WAIT_FILL.getCode()));
@@ -3373,10 +3403,22 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         //2.本年度提报:指本年度“需求待提交”之后状态的数据
         StatisticalChartsResVo lastYear = pmDemandMapper.selectSTSLastYear(pmDemandReqVo);
         StatisticalChartsResVo thisYear = pmDemandMapper.selectSTSThisYear(pmDemandReqVo);
-        lastYear.setColumnName("上年度结转和本年度提报");
-        lastYear.setColumnNamePlus("采购需求累计数量");
+        if (ObjectUtils.isEmpty(lastYear)) {
+            lastYear = new StatisticalChartsResVo();
+            lastYear.setNum(0);
+            lastYear.setEvaluationTotal(BigDecimal.ZERO);
+            lastYear.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
+        if (ObjectUtils.isEmpty(thisYear)) {
+            thisYear = new StatisticalChartsResVo();
+            thisYear.setNum(0);
+            thisYear.setEvaluationTotal(BigDecimal.ZERO);
+            thisYear.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         lastYear.setNum(lastYear.getNum() + thisYear.getNum());
         lastYear.setEvaluationTotal(lastYear.getEvaluationTotal().add(thisYear.getEvaluationTotal()));
+        lastYear.setColumnName("上年度结转和本年度提报");
+        lastYear.setColumnNamePlus("采购需求累计数量");
         resVos.add(lastYear);
         //未按季度采购明细计划提报或调整延迟的数量--超过计划需求提报时间的项目
         StatisticalChartsResVo meiJiDu = pmDemandMapper.selectmeiJiDu(pmDemandReqVo);
@@ -3439,6 +3481,18 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         //本年度提报:状态为“标后质疑”后的数据
         StatisticalChartsResVo zLastYear = pmDemandMapper.selectZJLastYear(pmDemandReqVo);
         StatisticalChartsResVo tThisYear = pmDemandMapper.selectTBThisYear(pmDemandReqVo);
+        if (ObjectUtils.isEmpty(zLastYear)) {
+            zLastYear = new StatisticalChartsResVo();
+            zLastYear.setNum(0);
+            zLastYear.setEvaluationTotal(BigDecimal.ZERO);
+            zLastYear.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
+        if (ObjectUtils.isEmpty(tThisYear)) {
+            tThisYear = new StatisticalChartsResVo();
+            tThisYear.setNum(0);
+            tThisYear.setEvaluationTotal(BigDecimal.ZERO);
+            tThisYear.setEvaluationContractTotal(BigDecimal.ZERO);
+        }
         tThisYear.setNum(tThisYear.getNum() + zLastYear.getNum());
         tThisYear.setEvaluationTotal(tThisYear.getEvaluationTotal().add(zLastYear.getEvaluationTotal()));
         tThisYear.setEvaluationContractTotal(tThisYear.getEvaluationContractTotal().add(zLastYear.getEvaluationContractTotal()));

+ 12 - 12
purchase-system/src/main/resources/mapper/plan/PlanQuarterMapper.xml

@@ -67,11 +67,11 @@
             <if test="projectStatus != null and projectStatus != ''">
                 AND project_status = #{projectStatus}
             </if>
-            <if test="beginTime != null  "><!-- 开始时间检索 -->
-                and date_format(plan_demand_sub_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+            <if test="params.beginTime != null "><!-- 开始时间检索 -->
+                and date_format(p.plan_demand_sub_time,'%y%m') &gt;= date_format(#{params.beginTime},'%y%m')
             </if>
-            <if test="endTime != null  "><!-- 结束时间检索 -->
-                and date_format(plan_demand_sub_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+            <if test="params.endTime != null "><!-- 结束时间检索 -->
+                and date_format(p.plan_demand_sub_time,'%y%m') &lt;= date_format(#{params.endTime},'%y%m')
             </if>
             and plan_type=0
             and del_flay=0
@@ -98,11 +98,11 @@
             <if test="projectStatus != null and projectStatus != ''">
                 AND project_status = #{projectStatus}
             </if>
-            <if test="beginTime != null "><!-- 开始时间检索 -->
-                and date_format(plan_demand_sub_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+            <if test="params.beginTime != null "><!-- 开始时间检索 -->
+                and date_format(plan_demand_sub_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
             </if>
-            <if test="endTime != null "><!-- 结束时间检索 -->
-                and date_format(plan_demand_sub_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+            <if test="params.endTime != null "><!-- 结束时间检索 -->
+                and date_format(plan_demand_sub_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
             </if>
             and plan_type=0
             and del_flay=0
@@ -160,11 +160,11 @@
             <if test="projectStatus != null and projectStatus != ''">
                 AND p.project_status = #{projectStatus}
             </if>
-            <if test="beginTime != null "><!-- 开始时间检索 -->
-                and date_format(p.plan_demand_sub_time,'%y%m') &gt;= date_format(#{beginTime},'%y%m')
+            <if test="params.beginTime != null "><!-- 开始时间检索 -->
+                and date_format(p.plan_demand_sub_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
             </if>
-            <if test="endTime != null "><!-- 结束时间检索 -->
-                and date_format(p.plan_demand_sub_time,'%y%m') &lt;= date_format(#{endTime},'%y%m')
+            <if test="params.endTime != null "><!-- 结束时间检索 -->
+                and date_format(p.plan_demand_sub_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
             </if>
             and p.del_flay=0
         </where>

+ 8 - 8
purchase-system/src/main/resources/mapper/plan/PlanYearsMapper.xml

@@ -65,11 +65,11 @@
 			<if test="projectStatus != null and projectStatus != ''">
 				AND project_status = #{projectStatus}
 			</if>
-			<if test="beginTime != null  "><!-- 开始时间检索 -->
-				and date_format(plan_demand_sub_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
+			<if test="params!= null and params.beginTime != null  "><!-- 开始时间检索 -->
+				and date_format(plan_demand_sub_time,'%y%m') &gt;= date_format(#{params.beginTime},'%y%m')
 			</if>
-			<if test="endTime != null  "><!-- 结束时间检索 -->
-				and date_format(plan_demand_sub_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
+			<if test="params!= null and params.endTime != null  "><!-- 结束时间检索 -->
+				and date_format(plan_demand_sub_time,'%y%m') &lt;= date_format(#{params.endTime},'%y%m')
 			</if>
 			and del_flay=0
 		</where>
@@ -119,11 +119,11 @@
 			<if test="projectStatus != null and projectStatus != ''">
 				AND p.project_status = #{projectStatus}
 			</if>
-			<if test="beginTime != null "><!-- 开始时间检索 -->
-				and date_format(p.plan_demand_sub_time,'%y%m') &gt;= date_format(#{beginTime},'%y%m')
+			<if test="params!= null and params.beginTime != null"><!-- 开始时间检索 -->
+				and date_format(p.plan_demand_sub_time,'%y%m') &gt;= date_format(#{params.beginTime},'%y%m')
 			</if>
-			<if test="endTime != null "><!-- 结束时间检索 -->
-				and date_format(p.plan_demand_sub_time,'%y%m') &lt;= date_format(#{endTime},'%y%m')
+			<if test="params!= null and params.endTime != null "><!-- 结束时间检索 -->
+				and date_format(p.plan_demand_sub_time,'%y%m') &lt;= date_format(#{params.endTime},'%y%m')
 			</if>
 			and p.del_flay=0
 		</where>

+ 2 - 2
purchase-system/src/main/resources/mapper/plan/ProvisionalPlanMapper.xml

@@ -226,10 +226,10 @@
             <if test="projectStatus != null and projectStatus != ''">
                 AND p.project_status = #{projectStatus}
             </if>
-            <if test="beginTime != null "><!-- 开始时间检索 -->
+            <if test="params.beginTime != null "><!-- 开始时间检索 -->
                 and date_format(p.plan_demand_sub_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
             </if>
-            <if test="endTime != null "><!-- 结束时间检索 -->
+            <if test="params.endTime != null "><!-- 结束时间检索 -->
                 and date_format(p.plan_demand_sub_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
             </if>
             and p.del_flay=0

+ 1 - 1
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml

@@ -475,7 +475,7 @@
     </select>
 
     <select id="selectMinYear" resultType="java.lang.Integer">
-        select min(year(create_time))
+        select ifnull(min(year(create_time)), year(now()))
         from pm_demand
     </select>