Bladeren bron

Merge remote-tracking branch 'origin/master' into master

yangyj 3 maanden geleden
bovenliggende
commit
e3f5d22ffd

+ 12 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/MiddleMeterApplyController.java

@@ -27,6 +27,7 @@ import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.meter.dto.MiddleMeterApplyDTO;
 import org.springblade.meter.dto.WbsNodeDTO;
+import org.springblade.meter.entity.AttachmentForm;
 import org.springblade.meter.vo.*;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -318,4 +319,15 @@ public class MiddleMeterApplyController extends BladeController {
         String info = middleMeterApplyService.autoBatchMeter(projectId,contractId,PeriodId);
         return R.success("计量完成:"+info);
     }
+
+    @GetMapping("/addGetWbsFiles")
+    @ApiOperationSupport(order = 18)
+    @ApiOperation(value = "新增时获取计量单元关联的质检节点已审批的资料", notes = "传入合同计量单元id")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
+    })
+    public R<List<AttachmentForm>> addGetWbsFiles(Long nodeId) {
+        List<AttachmentForm> forms = middleMeterApplyService.addGetWbsFiles(nodeId);
+        return R.data(forms);
+    }
 }

+ 2 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.java

@@ -119,4 +119,6 @@ public interface MiddleMeterApplyMapper extends BaseMapper<MiddleMeterApply> {
     NodeSortVO getMeterById(@Param("meterId") Long contractUnitId,@Param("periodId") Long periodId);
 
     List<NodeSortVO> getAllMeter(@Param("contractId") Long contractId,@Param("periodId") Long periodId);
+
+    List<AttachmentForm> getWbsFiles(@Param("nodeId") Long nodeId);
 }

+ 6 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/mapper/MiddleMeterApplyMapper.xml

@@ -441,6 +441,12 @@
         WHERE contract_id = #{contractId} and is_deleted = 0
         ORDER BY -sort desc,create_time,node_name
     </select>
+    <select id="getWbsFiles" resultType="org.springblade.meter.entity.AttachmentForm">
+        SELECT name as fileName, node_pdf_url as fileUrl, node_pdf_url as filePdfUrl, 1 as fileType
+        from u_information_query
+        WHERE classify = 1 and `type` = 1 and status = 2
+          and wbs_id in (SELECT wbs_tree_id from s_meter_tree_link_wbs_tree WHERE meter_tree_id = #{nodeId})
+    </select>
 
 
 </mapper>

+ 3 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/IMiddleMeterApplyService.java

@@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.core.mp.support.Query;
 import org.springblade.meter.dto.MiddleMeterApplyDTO;
 import org.springblade.meter.dto.WbsNodeDTO;
+import org.springblade.meter.entity.AttachmentForm;
 import org.springblade.meter.entity.MiddleMeterApply;
 import org.springblade.core.mp.base.BaseService;
 import org.springblade.meter.vo.*;
@@ -90,4 +91,6 @@ public interface IMiddleMeterApplyService extends BaseService<MiddleMeterApply>
      * 自动批量计量
      */
     String autoBatchMeter(Long projectId,Long contractId, Long periodId);
+
+    List<AttachmentForm> addGetWbsFiles(Long nodeId);
 }

+ 7 - 0
blade-service/blade-meter/src/main/java/org/springblade/meter/service/impl/MiddleMeterApplyServiceImpl.java

@@ -1402,6 +1402,13 @@ public class MiddleMeterApplyServiceImpl extends BaseServiceImpl<MiddleMeterAppl
         
     }
 
+    @Override
+    public List<AttachmentForm> addGetWbsFiles(Long nodeId) {
+        //查询当前计量单元节点关联的WBS节点,已经审批的
+        List<AttachmentForm> forms = baseMapper.getWbsFiles(nodeId);
+        return forms;
+    }
+
     /**
      *  获取当前计量期计量单前缀
      */