Prechádzať zdrojové kódy

项目计划变更详情修改

wangliang 1 rok pred
rodič
commit
ec19530ce0

+ 2 - 1
sop-api/src/main/java/com/qmth/sop/server/api/TBProjectExchangeController.java

@@ -4,6 +4,7 @@ package com.qmth.sop.server.api;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.sop.business.bean.result.ProjectExchangeResult;
+import com.qmth.sop.business.bean.result.TBProjectExchangeViewResult;
 import com.qmth.sop.business.entity.TBProjectExchange;
 import com.qmth.sop.business.service.TBProjectExchangeService;
 import com.qmth.sop.common.contant.SystemConstant;
@@ -78,7 +79,7 @@ public class TBProjectExchangeController {
 
     @ApiOperation(value = "项目变更计划详情接口")
     @RequestMapping(value = "/view", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = TBProjectExchangeViewResult.class)})
     public Result view(@ApiParam(value = "主键", required = true) @RequestParam Long id) {
         return ResultUtil.ok(tbProjectExchangeService.view(id));
     }

+ 47 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/TBProjectExchangeViewResult.java

@@ -0,0 +1,47 @@
+package com.qmth.sop.business.bean.result;
+
+import com.qmth.sop.business.entity.TBProjectExchange;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 项目计划变更view result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/2/17
+ */
+public class TBProjectExchangeViewResult implements Serializable {
+
+    @ApiModelProperty(value = "crm信息")
+    CrmProjectResult crmInfo;
+
+    @ApiModelProperty(value = "项目变更计划信息")
+    TBProjectExchange tbProjectExchange;
+
+    public TBProjectExchangeViewResult() {
+
+    }
+
+    public TBProjectExchangeViewResult(CrmProjectResult crmInfo, TBProjectExchange tbProjectExchange) {
+        this.crmInfo = crmInfo;
+        this.tbProjectExchange = tbProjectExchange;
+    }
+
+    public CrmProjectResult getCrmInfo() {
+        return crmInfo;
+    }
+
+    public void setCrmInfo(CrmProjectResult crmInfo) {
+        this.crmInfo = crmInfo;
+    }
+
+    public TBProjectExchange getTbProjectExchange() {
+        return tbProjectExchange;
+    }
+
+    public void setTbProjectExchange(TBProjectExchange tbProjectExchange) {
+        this.tbProjectExchange = tbProjectExchange;
+    }
+}

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/service/TBProjectExchangeService.java

@@ -3,6 +3,7 @@ package com.qmth.sop.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.bean.result.ProjectExchangeResult;
+import com.qmth.sop.business.bean.result.TBProjectExchangeViewResult;
 import com.qmth.sop.business.entity.TBProjectExchange;
 import com.qmth.sop.common.enums.*;
 
@@ -62,5 +63,5 @@ public interface TBProjectExchangeService extends IService<TBProjectExchange> {
      * @param id
      * @return
      */
-    Object view(Long id);
+    TBProjectExchangeViewResult view(Long id);
 }

+ 11 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBProjectExchangeServiceImpl.java

@@ -6,12 +6,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.sop.business.activiti.service.ActivitiService;
 import com.qmth.sop.business.bean.dto.UserDto;
 import com.qmth.sop.business.bean.params.FlowApproveParam;
+import com.qmth.sop.business.bean.result.CrmProjectResult;
 import com.qmth.sop.business.bean.result.ProjectExchangeResult;
+import com.qmth.sop.business.bean.result.TBProjectExchangeViewResult;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.business.entity.TBProjectExchange;
 import com.qmth.sop.business.entity.TFCustomFlowEntity;
 import com.qmth.sop.business.mapper.TBProjectExchangeMapper;
 import com.qmth.sop.business.service.SysUserRoleService;
+import com.qmth.sop.business.service.TBCrmService;
 import com.qmth.sop.business.service.TBProjectExchangeService;
 import com.qmth.sop.business.service.TFCustomFlowEntityService;
 import com.qmth.sop.common.contant.SystemConstant;
@@ -53,6 +56,9 @@ public class TBProjectExchangeServiceImpl extends ServiceImpl<TBProjectExchangeM
     @Resource
     SysUserRoleService sysUserRoleService;
 
+    @Resource
+    TBCrmService tbCrmService;
+
     /**
      * 新增项目变更计划申请
      *
@@ -146,11 +152,13 @@ public class TBProjectExchangeServiceImpl extends ServiceImpl<TBProjectExchangeM
      * @return
      */
     @Override
-    public Object view(Long id) {
+    public TBProjectExchangeViewResult view(Long id) {
         TBProjectExchange tbProjectExchange = this.getById(id);
         Optional.ofNullable(tbProjectExchange).orElseThrow(() -> ExceptionResultEnum.PROJECT_EXCHANGE_NO_DATA.exception());
 
-        //TODO 需要根据crm单号取crm相关信息
-        return tbProjectExchange;
+        CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectBySopNoOrCrmNo(tbProjectExchange.getSopNo(), tbProjectExchange.getCrmNo());
+        Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
+
+        return new TBProjectExchangeViewResult(crmProjectResult, tbProjectExchange);
     }
 }