liuyc 2 年之前
父節點
當前提交
1a5da972b3

+ 35 - 27
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -127,25 +127,29 @@ public class TrialSelfInspectionRecordServiceImpl
 
     @Override
     public List<SampleAncillaryDocumentsVO> selfAncillaryDocumentsList(String id) {
-        //获取样品ids
-        List<String> sampleIds = baseMapper.selectSelfSampleRecord(id);
-        //获取材料ids
-        List<String> mobilizationIds = new ArrayList<>();
-        for (String sampleId : sampleIds) {
-            String mobilizationId = baseMapper.selectMobilizationRecord(sampleId);
-            mobilizationIds.add(mobilizationId);
-        }
         //获取材料附件信息
         List<SampleAncillaryDocumentsVO> result = new ArrayList<>();
-        List<TrialMaterialMobilization> trialMaterialMobilizations = trialMaterialMobilizationMapper.selectBatchIds(mobilizationIds);
-        for (TrialMaterialMobilization trialMaterialMobilization : trialMaterialMobilizations) {
-            SampleAncillaryDocumentsVO obj = new SampleAncillaryDocumentsVO();
-            obj.setId(trialMaterialMobilization.getId());
-            obj.setName(trialMaterialMobilization.getMaterialName());
-            obj.setOtherAccessories(trialMaterialMobilization.getOtherAccessories());
-            obj.setProductionCertificate(trialMaterialMobilization.getProductionCertificate());
-            obj.setQualityInspectionReport(trialMaterialMobilization.getQualityInspectionReport());
-            result.add(obj);
+        //获取样品ids
+        List<String> sampleIds = baseMapper.selectSelfSampleRecord(id);
+        if (sampleIds.size() > 0) {
+            //获取材料ids
+            List<String> mobilizationIds = new ArrayList<>();
+            for (String sampleId : sampleIds) {
+                String mobilizationId = baseMapper.selectMobilizationRecord(sampleId);
+                mobilizationIds.add(mobilizationId);
+            }
+            if (mobilizationIds.size() > 0) {
+                List<TrialMaterialMobilization> trialMaterialMobilizations = trialMaterialMobilizationMapper.selectBatchIds(mobilizationIds);
+                for (TrialMaterialMobilization trialMaterialMobilization : trialMaterialMobilizations) {
+                    SampleAncillaryDocumentsVO obj = new SampleAncillaryDocumentsVO();
+                    obj.setId(trialMaterialMobilization.getId());
+                    obj.setName(trialMaterialMobilization.getMaterialName());
+                    obj.setOtherAccessories(trialMaterialMobilization.getOtherAccessories());
+                    obj.setProductionCertificate(trialMaterialMobilization.getProductionCertificate());
+                    obj.setQualityInspectionReport(trialMaterialMobilization.getQualityInspectionReport());
+                    result.add(obj);
+                }
+            }
         }
         return result;
     }
@@ -411,17 +415,21 @@ public class TrialSelfInspectionRecordServiceImpl
 
     @Override
     public List<TrialSampleInfoVO> selfSampleList(String id) {
-        List<String> sampleIds = baseMapper.selectSelfSampleRecord(id);
-        List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectBatchIds(sampleIds);
-        List<User> users = iUserClient.selectUserAll();
         List<TrialSampleInfoVO> result = new ArrayList<>();
-        for (TrialSampleInfo trialSampleInfo : trialSampleInfos) {
-            for (User user : users) {
-                if (trialSampleInfo.getUserId().equals(user.getId())) {
-                    TrialSampleInfoVO trialSampleInfoVO = BeanUtil.copyProperties(trialSampleInfo, TrialSampleInfoVO.class);
-                    if (trialSampleInfoVO != null) {
-                        trialSampleInfoVO.setUserName(ObjectUtil.isNotEmpty(user.getName()) ? user.getName() : user.getRealName());
-                        result.add(trialSampleInfoVO);
+        List<String> sampleIds = baseMapper.selectSelfSampleRecord(id);
+        if (sampleIds.size() > 0) {
+            List<TrialSampleInfo> trialSampleInfos = trialSampleInfoMapper.selectBatchIds(sampleIds);
+            List<User> users = iUserClient.selectUserAll();
+            if (trialSampleInfos.size() > 0){
+                for (TrialSampleInfo trialSampleInfo : trialSampleInfos) {
+                    for (User user : users) {
+                        if (trialSampleInfo.getUserId().equals(user.getId())) {
+                            TrialSampleInfoVO trialSampleInfoVO = BeanUtil.copyProperties(trialSampleInfo, TrialSampleInfoVO.class);
+                            if (trialSampleInfoVO != null) {
+                                trialSampleInfoVO.setUserName(ObjectUtil.isNotEmpty(user.getName()) ? user.getName() : user.getRealName());
+                                result.add(trialSampleInfoVO);
+                            }
+                        }
                     }
                 }
             }

+ 2 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -456,6 +456,7 @@ public class ExcelTabController extends BladeController {
         WbsTreePrivate wbsTree = new WbsTreePrivate();
         wbsTree.setPKeyId(tabId);
         WbsTreePrivate aPrivate = wbsTreePrivateService.getOne(Condition.getQueryWrapper(wbsTree));
+
         aPrivate.setExcelId(exceTabId);
 
         // 获取excel 基本信息
@@ -2575,7 +2576,7 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R getBussDataInfoTrial(Long pkeyId) {
+    public Object getBussDataInfoTrial(Long pkeyId) {
         return excelTabService.getBussDataInfoTrial(pkeyId);
     }
 

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -585,8 +585,8 @@ public class WbsTreePrivateController extends BladeController {
     @GetMapping("/get-excel-html")
     @ApiOperationSupport(order = 23)
     @ApiOperation(value = "试验-客户端获取表的HTML", notes = "传入节点primaryKeyId")
-    public R<Object> getExcelHtml(@RequestParam String primaryKeyId) throws IOException {
-        return R.data(wbsTreePrivateService.getExcelHtml(primaryKeyId));
+    public Object getExcelHtml(@RequestParam String primaryKeyId) throws IOException {
+        return wbsTreePrivateService.getExcelHtml(primaryKeyId);
     }
 
 

+ 3 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -63,7 +63,9 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                     tableType, //tableType = 表类型 1=记录表 2=报告单
                     String.valueOf(type), //type = 所属方 1=施工质检 2=监理抽检
                     contractId,
-                    projectId);
+                    projectId,
+                    id //记录id
+            );
         }
         return pdfUrl;
     }

+ 8 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -547,7 +547,8 @@
         (SELECT count(1) FROM m_wbs_form_element WHERE f_id = initTableId and is_deleted=0) AS "elementTotal",
         (SELECT dict_value from blade_dict where code='owner_type' and dict_key not in(-1,0) and dict_key=table_owner )
         as tabOwner,
-        (SELECT sort FROM m_wbs_node_sort c WHERE a.p_key_id = c.p_key_id) AS sort,
+        /*排序*/
+        -- (SELECT sort FROM m_wbs_node_sort c WHERE a.p_key_id = c.p_key_id) AS sort,
         (
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
@@ -581,8 +582,8 @@
         <if test="titleName != null and titleName != ''">
             and a.title like concat('%',#{titleName},'%') and LENGTH(a.p_key_id)>11
         </if>
-
-        order by sort
+        /*排序*/
+        -- order by sort,title
     </select>
 
     <!-- 项目级 表单类型分类 wbs树 -->
@@ -593,7 +594,8 @@
         (SELECT count(1) FROM m_wbs_form_element WHERE f_id = initTableId and is_deleted=0) AS "elementTotal",
         (SELECT dict_value from blade_dict where code='owner_type' and dict_key not in(-1,0) and dict_key=table_owner )
         as tabOwner,
-        (SELECT sort FROM m_wbs_node_sort c WHERE a.p_key_id = c.p_key_id) AS sort,
+        /*排序*/
+        -- (SELECT sort FROM m_wbs_node_sort c WHERE a.p_key_id = c.p_key_id) AS sort,
         (
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
@@ -625,7 +627,8 @@
         <if test="titleName != null and titleName != ''">
             and a.title like concat('%',#{titleName},'%') and LENGTH(a.p_key_id)>11
         </if>
-        order by sort
+        /*排序*/
+        -- order by sort,title
     </select>
 
     <select id="selectWbsTreeContractList" resultType="org.springblade.manager.entity.WbsTreePrivate">

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java

@@ -126,7 +126,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
      * 多PDF 合并 - 试验
      */
-    String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId) throws Exception;
+    String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId, Long id) throws Exception;
 
 
     /**

+ 4 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -1452,7 +1452,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 多pdf
      */
     @Override
-    public String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId) throws Exception {
+    public String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId, Long id) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //获取有权限的节点信息
         List<WbsTreePrivate> wbsTreePrivateList = wbsTreePrivateService.searchNodeAllTable(nodeId, classify, String.valueOf(tableType), contractId, projectId);
@@ -1483,12 +1483,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
 
         //合并PDF集合
-        String querySql = "select * from u_information_query where classify='" + classify + "' and  wbs_id='" + nodeId + "' and contract_id ='" + contractId + "'";
+        String querySql = "select * from u_information_query where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
         List<Map<String, Object>> resultSQL = jdbcTemplate.queryForList(querySql);
         if (resultSQL.size() > 0) {
-            informationQueryClient.updateInformationQuery(bladeFile.getLink(), classify, nodeId, contractId);
+            informationQueryClient.updateInformationQuery(bladeFile.getLink(), classify, id.toString(), contractId);
         } else {
-            informationQueryClient.saveData(nodeId, projectId, contractId, classify, bladeFile.getLink());
+            informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink());
         }
         return bladeFile.getLink();
     }