jihs 4 years ago
parent
commit
dca199e892

+ 25 - 0
src/main/java/org/jeecg/common/dto/archives/ProPlanListReqDTO.java

@@ -0,0 +1,25 @@
+package org.jeecg.common.dto.archives;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import javax.validation.constraints.NotEmpty;
+
+/**
+   * @Author jihaosen
+   * @date 2021/3/9
+   */
+
+@ApiModel("项目档案计划列表参数请求")
+@Data
+public class ProPlanListReqDTO {
+    @NotEmpty(message = "参数id不为空")
+    @ApiModelProperty("主表id")
+    private String id;
+    @NotEmpty(message = "参数type不为空")
+    @ApiModelProperty("计划类型 1.商务 2.实施 3.开发 4.服务")
+    private String planType;
+
+    public ProPlanListReqDTO() {
+    }
+}

+ 30 - 0
src/main/java/org/jeecg/common/dto/archives/ProPlanListRespDTO.java

@@ -0,0 +1,30 @@
+package org.jeecg.common.dto.archives;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @Author jihaosen
+ * @date 2021/3/9
+ */
+
+@ApiModel("项目档案计划列表参数请求")
+@Data
+public class ProPlanListRespDTO {
+    @ApiModelProperty("id")
+    private String id;
+    @ApiModelProperty("里程碑id")
+    private String muilesId;
+    @ApiModelProperty("里程碑名称")
+    private String milesName;
+
+    public ProPlanListRespDTO() {
+    }
+
+    public ProPlanListRespDTO(String id, String muilesId, String milesName) {
+        this.id = id;
+        this.muilesId = muilesId;
+        this.milesName = milesName;
+    }
+}

+ 43 - 0
src/main/java/org/jeecg/modules/archives/controller/ProjectManageArchivesController.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.archives.controller;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
+import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -12,13 +13,17 @@ import org.jeecg.common.dto.archives.ExpensePriceReqDTO;
 import org.jeecg.common.dto.archives.ExpensePriceRespDTO;
 import org.jeecg.common.dto.archives.ProArchivesAddReqDTO;
 import org.jeecg.common.dto.archives.ProArchivesAddRespDTO;
+import org.jeecg.common.dto.archives.ProPlanListReqDTO;
+import org.jeecg.common.dto.archives.ProPlanListRespDTO;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.archives.entity.ProjectManageArchives;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.archives.entity.ProjectManageBusinessOther;
 import org.jeecg.modules.archives.service.ProjectManageArchivesService;
+import org.jeecg.modules.archives.service.ProjectManageBusinessOtherService;
 import org.jeecg.modules.payment.service.ManagerPaymentAndReceiptSlipService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
@@ -28,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
 
 /**
    * @Author jihaosen
@@ -42,6 +48,8 @@ public class ProjectManageArchivesController {
 	private ProjectManageArchivesService projectManageArchivesService;
 	@Autowired
 	private ManagerPaymentAndReceiptSlipService managerPaymentAndReceiptSlipService;
+	@Autowired
+	private ProjectManageBusinessOtherService projectManageBusinessOtherService;
 
 
 	@ApiOperation(value = "项目档案分页查询接口", notes = "项目档案分页查询")
@@ -284,4 +292,39 @@ public class ProjectManageArchivesController {
 		}
 		return result;
 	}
+
+	@ApiOperation(value = "项目档案计划列表查询", notes = "根据主表id查询项目档案计划列表")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name="id", value="id",required=true, dataType="String")
+	})
+	@GetMapping(value = "/getPlanListById")
+	public Result<List<ProPlanListRespDTO>> getListById(@Valid ProPlanListReqDTO reqDTO, BindingResult bindingResult) {
+		Result<List<ProPlanListRespDTO>> result = new Result<List<ProPlanListRespDTO>>();
+		try {
+			StringBuilder sb = new StringBuilder();
+			if(bindingResult.hasErrors()) {
+				//记录错误信息
+				bindingResult.getAllErrors().stream().forEach(error -> sb.append(error.getDefaultMessage() + "<br/>"));
+				result.error500(sb.toString());
+				return result;
+			}
+			QueryWrapper<ProjectManageBusinessOther> queryWrapper = new QueryWrapper<>();
+			queryWrapper.eq("del_flag", "0").eq("pro_archives_id", reqDTO.getId())
+					.eq("plan_type", reqDTO.getPlanType());
+
+			   List<ProjectManageBusinessOther> list = projectManageBusinessOtherService.list(queryWrapper);
+               List<ProPlanListRespDTO> respDTOS = Lists.newArrayList();
+               for(ProjectManageBusinessOther other : list){
+				   respDTOS.add(new ProPlanListRespDTO(other.getId(), other.getMuilesId(), other.getMuilesName()));
+			   }
+				result.setResult(respDTOS);
+				result.setSuccess(true);
+		}
+		catch (Exception e) {
+				e.printStackTrace();
+				log.info(e.getMessage());
+				result.error500("操作失败");
+			}
+		return result;
+	}
 }