Browse Source

Merge remote-tracking branch 'origin/master'

jzh 1 year ago
parent
commit
ebc03127db

+ 22 - 0
zjugis-business/src/main/java/com/zjugis/business/bean/response/ContractExistResp.java

@@ -0,0 +1,22 @@
+package com.zjugis.business.bean.response;
+
+import lombok.Data;
+
+/**
+ * @author ljy
+ * @version 1.0
+ * @date 2024/5/9 16:55
+ */
+@Data
+public class ContractExistResp {
+
+    private boolean exist;
+
+    private String contractId;
+
+    private String instanceId;
+
+    private int isvalid;
+
+    private int flowStatus;
+}

+ 5 - 0
zjugis-business/src/main/java/com/zjugis/business/controller/ProjectController.java

@@ -134,6 +134,11 @@ public class ProjectController{
         return CommonResult.success(projectService.countXmzt(projectDto));
     }
 
+    @GetMapping("/project/contract/exist")
+    public CommonResult<ContractExistResp> contractExist(@RequestParam String projectId) {
+        return CommonResult.success(projectService.contractExist(projectId));
+    }
+
     @GetMapping("/project/list/excel")
     public void export( ProjectDto projectDto,
                                HttpServletResponse response) throws IOException {

+ 3 - 0
zjugis-business/src/main/java/com/zjugis/business/mapper/ProjectMapper.java

@@ -5,6 +5,7 @@ import com.zjugis.business.bean.dto.AmountInfo;
 import com.zjugis.business.bean.dto.CountInfo;
 import com.zjugis.business.bean.dto.ProcessInfo;
 import com.zjugis.business.bean.dto.ProjectDto;
+import com.zjugis.business.bean.entity.Contract;
 import com.zjugis.business.bean.entity.Project;
 import com.zjugis.business.bean.response.ProjectCalculateResponse;
 import com.zjugis.business.bean.response.ProjectResponse;
@@ -56,5 +57,7 @@ public interface ProjectMapper extends BaseMapperX<Project> {
     ProcessInfo selectProcessInfo();
 
     List<String> selectAllIds();
+
+    List<Contract> contractExist(String projectId);
 }
 

+ 2 - 0
zjugis-business/src/main/java/com/zjugis/business/service/ProjectService.java

@@ -60,5 +60,7 @@ public interface ProjectService {
     ButtonResp infoButton(String projectId);
 
     void calcProject(String projectId);
+
+    ContractExistResp contractExist(String projectId);
 }
 

+ 21 - 0
zjugis-business/src/main/java/com/zjugis/business/service/impl/ProjectServiceImpl.java

@@ -400,5 +400,26 @@ public class ProjectServiceImpl implements ProjectService {
         }
 
     }
+
+    /**
+     * @param projectId
+     * @return
+     */
+    @Override
+    public ContractExistResp contractExist(String projectId) {
+        List<Contract> list = projectMapper.contractExist(projectId);
+        ContractExistResp res = new ContractExistResp();
+        if(list.isEmpty()){
+            res.setExist(false);
+        } else {
+            Contract contract = list.get(0);
+            res.setExist(true);
+            res.setContractId(contract.getId());
+            res.setInstanceId(contract.getInstanceId());
+            res.setFlowStatus(contract.getFlowStatus());
+            res.setIsvalid(contract.getIsvalid());
+        }
+        return res;
+    }
 }
 

+ 5 - 0
zjugis-business/src/main/resources/mapper/oracle/ProjectMapper.xml

@@ -266,4 +266,9 @@
         WHERE ISVALID = 1 AND FLOW_STATUS IN (90,99) and XMZT IN (1,4)
 
     </select>
+
+    <select id="contractExist" resultType="com.zjugis.business.bean.entity.Contract">
+        SELEC ID,INSTANCE_ID,FLOW_STATUS,ISVALID FROM CONTRACT
+        WHERE PROJECT_ID = #{projectId,jdbcType=VARCHAR}
+    </select>
 </mapper>