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

临时计划 接口修改

sunhh 2 éve
szülő
commit
9406737f7f

+ 5 - 2
purchase-admin/src/main/java/com/ozs/web/controller/plan/ProvisionalPlanController.java

@@ -64,7 +64,7 @@ public class ProvisionalPlanController extends BaseController {
         if (StringUtils.isNull(provisionalPlan) || StringUtils.isNull(provisionalPlan.getPlanYearId())) {
             return error("专家库id不能为空");
         }
-        return toAjax(provisionalPlanService.removeById(provisionalPlan.getPlanYearId()));
+        return toAjax(provisionalPlanService.deleteProvisionalPlanById(provisionalPlan.getPlanYearId()));
     }
 
     @ApiOperation(value = "修改临时计划", notes = "必传 plan_year_id 及修改数据")
@@ -73,7 +73,7 @@ public class ProvisionalPlanController extends BaseController {
         if (StringUtils.isNull(provisionalPlan) || StringUtils.isNull(provisionalPlan.getPlanYearId())) {
             return error("专家库id和修改数据不能为空");
         }
-        return toAjax(provisionalPlanService.updateById(provisionalPlan));
+        return toAjax(provisionalPlanService.updateProvisionalPlanById(provisionalPlan));
     }
 
     @ApiOperation(value = "查询临时计划")
@@ -91,6 +91,9 @@ public class ProvisionalPlanController extends BaseController {
         if (!ObjectUtils.isEmpty(provisionalPlanVo.getProjectStatus())) {
             lw.eq(ProvisionalPlan::getProjectStatus, provisionalPlanVo.getProjectStatus());
         }
+        if (!ObjectUtils.isEmpty(provisionalPlanVo.getStartTime()) || !ObjectUtils.isEmpty(provisionalPlanVo.getEndTime())) {
+            lw.between(ProvisionalPlan::getPlanDemandSubTime, provisionalPlanVo.getStartTime(), provisionalPlanVo.getEndTime());
+        }
         IPage<ProvisionalPlan> page = provisionalPlanService.page(new Page<ProvisionalPlan>(provisionalPlanVo.getPageNum(), provisionalPlanVo.getPageSize()), lw);
         return success(page);
     }

+ 1 - 2
purchase-system/src/main/java/com/ozs/plan/doman/ProvisionalPlan.java

@@ -2,7 +2,6 @@ package com.ozs.plan.doman;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.ozs.common.vo.PageVo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -16,7 +15,7 @@ public class ProvisionalPlan {
 
     @ApiModelProperty(value = "主键ID")
     @TableField("plan_year_id")
-    private Long planYearId;
+    private Integer planYearId;
 
     @NotNull(message = "采购单位不能为空")
     @ApiModelProperty(value = "采购单位(登录账号的单位)")

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

@@ -11,6 +11,10 @@ import java.util.Date;
 
 @Data
 public class ProvisionalPlanVo extends PageVo {
+
+    private Date startTime;
+    private Date endTime;
+
     @ApiModelProperty(value = "主键ID")
     private Long planYearId;
 

+ 4 - 0
purchase-system/src/main/java/com/ozs/plan/mapper/ProvisionalPlanMapper.java

@@ -4,7 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.base.domain.BaseExpert;
 import com.ozs.plan.doman.ProvisionalPlan;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 @Mapper
 public interface ProvisionalPlanMapper extends BaseMapper<ProvisionalPlan> {
+    int deleteProvisionalPlanById(@Param("planYearId") Integer planYearId);
+
+    int updateProvisionalPlanById(ProvisionalPlan provisionalPlan);
 }

+ 3 - 1
purchase-system/src/main/java/com/ozs/plan/service/ProvisionalPlanService.java

@@ -1,8 +1,10 @@
 package com.ozs.plan.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ozs.base.domain.BaseExpert;
 import com.ozs.plan.doman.ProvisionalPlan;
 
 public interface ProvisionalPlanService extends IService<ProvisionalPlan> {
+    int deleteProvisionalPlanById(Integer planYearId);
+
+    int updateProvisionalPlanById(ProvisionalPlan provisionalPlan);
 }

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

@@ -2,10 +2,25 @@ package com.ozs.plan.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.plan.doman.ProvisionalPlan;
+import com.ozs.plan.mapper.PlanYearsMapper;
 import com.ozs.plan.mapper.ProvisionalPlanMapper;
 import com.ozs.plan.service.ProvisionalPlanService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service
 public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMapper, ProvisionalPlan> implements ProvisionalPlanService {
+
+    @Autowired
+    private ProvisionalPlanMapper provisionalPlanMapper;
+
+    @Override
+    public int deleteProvisionalPlanById(Integer planYearId) {
+        return provisionalPlanMapper.deleteProvisionalPlanById(planYearId);
+    }
+
+    @Override
+    public int updateProvisionalPlanById(ProvisionalPlan provisionalPlan) {
+        return provisionalPlanMapper.updateProvisionalPlanById(provisionalPlan);
+    }
 }

+ 0 - 30
purchase-system/src/main/resources/mapper/plan/ProvisionalPlan.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-		PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-		"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ozs.plan.mapper.ProvisionalPlanMapper">
-	<resultMap type="com.ozs.plan.doman.PlanYears" id="PlanYearsResult">
-		<id property="plan_year_id" column="planYearId"/>
-		<result property="purchase_dept_id" column="purchaseDeptId"/>
-		<result property="project_name" column="projectName"/>
-		<result property="project_type" column="projectType"/>
-		<result property="demand_overview" column="demandOverview"/>
-		<result property="evaluation" column="evaluation"/>
-		<result property="is_excess" column="isExcess"/>
-		<result property="purchase_services" column="purchaseServices"/>
-		<result property="purchase_mode" column="purchaseMode"/>
-		<result property="plan_demand_sub_time" column="planDemandSubTime"/>
-		<result property="plan_purchase_finish_time" column="planPurchaseFinishTime"/>
-		<result property="plan_deliver_time" column="planDeliverTime"/>
-		<result property="project_attr" column="projectAtt"/>
-		<result property="adjust_reason" column="adjustReason"/>
-		<result property="remarks" column="remarks"/>
-		<result property="project_status" column="projectStatus"/>
-		<result property="created" column="created"/>
-		<result property="create_time" column="createTime"/>
-		<result property="updated" column="updated"/>
-		<result property="update_time" column="updateTime"/>
-		<result property="refuse_reason" column="refuseReason"/>
-		<result property="del_flay" column="delFlay"/>
-	</resultMap>
-</mapper>

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

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+		PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+		"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ozs.plan.mapper.ProvisionalPlanMapper">
+	<resultMap type="com.ozs.plan.doman.ProvisionalPlan" id="ProvisionalPlanResult">
+		<id property="plan_year_id" column="planYearId"/>
+		<result property="plan_year_id" column="planYearId"/>
+		<result property="purchase_dept_id" column="purchaseDeptId"/>
+		<result property="project_name" column="projectName"/>
+		<result property="project_type" column="projectType"/>
+		<result property="demand_overview" column="demandOverview"/>
+		<result property="evaluation" column="evaluation"/>
+		<result property="is_excess" column="isExcess"/>
+		<result property="purchase_services" column="purchaseServices"/>
+		<result property="purchase_mode" column="purchaseMode"/>
+		<result property="plan_demand_sub_time" column="planDemandSubTime"/>
+		<result property="plan_purchase_finish_time" column="planPurchaseFinishTime"/>
+		<result property="plan_deliver_time" column="planDeliverTime"/>
+		<result property="project_attr" column="projectAttr"/>
+		<result property="adjust_reason" column="adjustReason"/>
+		<result property="remarks" column="remarks"/>
+		<result property="project_status" column="projectStatus"/>
+		<result property="refuse_reason" column="refuseReason"/>
+		<result property="del_flay" column="delFlay"/>
+		<result property="plan_type" column="planType"/>
+		<result property="created" column="created"/>
+		<result property="create_time" column="createTime"/>
+		<result property="updated" column="updated"/>
+		<result property="update_time" column="updateTime"/>
+	</resultMap>
+
+	<delete id="deleteProvisionalPlanById" parameterType="java.lang.Integer">
+		delete from plan_practical where plan_year_id = #{planYearId}
+	</delete>
+
+	<update id="updateProvisionalPlanById" parameterType="com.ozs.plan.doman.ProvisionalPlan">
+		update plan_practical
+		<set>
+			<if test="purchaseDeptId != null and purchaseDeptId != ''">
+				purchase_dept_id = #{purchaseDeptId},
+			</if>
+			<if test="projectName != null and projectName != ''">
+				project_name = #{projectName},
+			</if>
+			<if test="projectType != null and projectType != ''">
+				project_type = #{projectType},
+			</if>
+			<if test="demandOverview != null and demandOverview != ''">
+				demand_overview = #{demandOverview},
+			</if>
+			<if test="evaluation != null and evaluation != ''">
+				evaluation = #{evaluation},
+			</if>
+			<if test="isExcess != null and isExcess != '' ">
+				is_excess = #{isExcess},
+			</if>
+			<if test="purchaseServices != null and purchaseServices != '' ">
+				purchase_services = #{purchaseServices},
+			</if>
+			<if test="purchaseMode != null and purchaseMode != '' ">
+				purchase_mode = #{purchaseMode},
+			</if>
+			<if test="planDemandSubTime != null and planDemandSubTime != '' ">
+				plan_demand_sub_time = #{planDemandSubTime},
+			</if>
+			<if test="planPurchaseFinishTime != null and planPurchaseFinishTime != '' ">
+				plan_purchase_finish_time = #{planPurchaseFinishTime},
+			</if>
+			<if test="planDeliverTime != null and planDeliverTime != '' ">
+				plan_deliver_time = #{planDeliverTime},
+			</if>
+			<if test="projectAttr != null and projectAttr != '' ">
+				project_attr = #{projectAttr},
+			</if>
+			<if test="adjustReason != null and adjustReason != '' ">
+				adjust_reason = #{adjustReason},
+			</if>
+			<if test="remarks != null and remarks != '' ">
+				remarks = #{remarks},
+			</if>
+			<if test="projectStatus != null and projectStatus != '' ">
+				project_status = #{projectStatus},
+			</if>
+			<if test="refuseReason != null and refuseReason != '' ">
+				refuse_reason = #{refuseReason},
+			</if>
+			<if test="delFlay != null and delFlay != '' ">
+				del_flay = #{delFlay},
+			</if>
+			<if test="planType != null and planType != '' ">
+				plan_type = #{planType},
+			</if>
+			<if test="updated != null and updated != '' ">
+				updated = #{updated},
+			</if>
+			<if test="updateTime != null and updateTime != '' ">
+				update_time = #{updateTime},
+			</if>
+		</set>
+		where plan_year_id = #{planYearId}
+	</update>
+</mapper>