liuyc před 2 roky
rodič
revize
085de72fed

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDataInfoRelationController.java

@@ -28,10 +28,10 @@ public class TrialDataInfoRelationController extends BladeController {
 
     private final ITrialSelfInspectionRecordService iTrialSelfInspectionRecordService;
 
-    @PostMapping("/data/page")
+    @PostMapping("/data/relation/page")
     @ApiOperationSupport(order = 1)
     @ApiOperation(value = "自检记录分页查询", notes = "传入TrialSelfInspectionRecordPageDTO")
-    public R<IPage<TrialSelfInspectionRecordVO>> selfPage(@RequestBody Query query, @RequestBody TrialSelfInspectionRecordPageDTO dto) {
+    public R<IPage<TrialSelfInspectionRecordVO>> trialDataRelationPage(@RequestBody Query query, @RequestBody TrialSelfInspectionRecordPageDTO dto) {
         return R.data(iTrialSelfInspectionRecordService.trialDataPage(Condition.getPage(query), dto));
     }
 

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

@@ -673,7 +673,7 @@ public class TrialSelfInspectionRecordServiceImpl
         IPage<TrialSelfInspectionRecordVO> trialSelfInspectionRecordVOIPage = TrialSelfInspectionRecordWarpper.build().pageVO(pages);
         List<TrialSelfInspectionRecordVO> records = trialSelfInspectionRecordVOIPage.getRecords();
 
-        List<WbsTreeContract> contractTreeList = wbsTreeContractClient.getContractWbsTreeByContractId(dto.getContractId());
+        //List<WbsTreeContract> contractTreeList = wbsTreeContractClient.getContractWbsTreeByContractId(dto.getContractId());
 
         //查询是否关联过
         List<String> selectedIds = baseMapper.selectSelectedStatusList(dto.getNodeId(), "1");
@@ -689,7 +689,7 @@ public class TrialSelfInspectionRecordServiceImpl
                 record.setIsSelectedStatus(0);
             }
 
-            //工程部位及用途名称
+            /*//工程部位及用途名称
             if (contractTreeList.size() > 0 && ObjectUtil.isNotEmpty(record.getProjectPosition())) {
                 List<String> projectPositionNames = new ArrayList<>();
                 for (WbsTreeContract wbsTreeContract : contractTreeList) {
@@ -703,7 +703,7 @@ public class TrialSelfInspectionRecordServiceImpl
                 } else {
                     record.setProjectPositionName(name);
                 }
-            }
+            }*/
 
         }
         return trialSelfInspectionRecordVOIPage.setRecords(records);

+ 13 - 12
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -795,7 +795,7 @@ public class ExcelTabController extends BladeController {
                     //x 移位 算法
                     String getRowInfo = rowData[y1];
 
-                    if(y1==9){
+                    if (y1 == 9) {
                         System.out.println("1");
                     }
                     if (getRowInfo != null) {
@@ -846,12 +846,12 @@ public class ExcelTabController extends BladeController {
                             x1 = x + 1;
                             x2 = x + 1;
                         } else {
-                            if(x==0){
+                            if (x == 0) {
                                 x1 = 1;
                                 x2 = colspan;
-                            }else {
-                                x1 = x+1;
-                                x2 = x+colspan;
+                            } else {
+                                x1 = x + 1;
+                                x2 = x + colspan;
                             }
                         }
                     } else {
@@ -898,7 +898,7 @@ public class ExcelTabController extends BladeController {
                     }
 
                     data.text(textInfo.replaceAll(" ", ""));
-                    if (textInfo.indexOf("□") < 0 && !textInfo.isEmpty() && !(textInfo.equals("/") && textInfo.length()<2) && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
+                    if (textInfo.indexOf("□") < 0 && !textInfo.isEmpty() && !(textInfo.equals("/") && textInfo.length() < 2) && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
                         Map<String, String> dataInfo = new HashMap<String, String>();
                         dataInfo.put("name", textInfo);
                         dataInfo.put("x1", x1 + "");
@@ -906,7 +906,7 @@ public class ExcelTabController extends BladeController {
                         dataInfo.put("y1", y1 + "");
                         dataInfo.put("y2", y2 + "");
                         dataInfo.put("xytype", xy_type + "");
-                        if (textInfo.indexOf("/") < 0 || (textInfo.indexOf("/")>=0 && textInfo.length()>1)) { // 带/为分割数据
+                        if (textInfo.indexOf("/") < 0 || (textInfo.indexOf("/") >= 0 && textInfo.length() > 1)) { // 带/为分割数据
                             zikey.add(dataInfo);
                         }
                     } else { //空行
@@ -1167,7 +1167,7 @@ public class ExcelTabController extends BladeController {
             }
             width += colspan;
 
-            if (!textInfo.isEmpty() && !(textInfo.equals("/") && textInfo.length()<=2 ) && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
+            if (!textInfo.isEmpty() && !(textInfo.equals("/") && textInfo.length() <= 2) && !(textInfo.indexOf("年") >= 0 && textInfo.indexOf("月") >= 0 && textInfo.indexOf("日") >= 0) && !textInfo.equals("—") && !textInfo.equals("-")) {  // 标题区域
                 val_count++;
             } else {
                 null_count++;
@@ -2580,8 +2580,8 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "type", value = "(1 元素表关联  2表示新增 3 表示项目节点关联)", required = true),
             @ApiImplicitParam(name = "wbsId", value = "关联树的wbsId", required = true)
     })
-    public R saveLinkeTableInfo(String tabId, String linkids, String type,String wbsId) {
-        return wbsTreePrivateService.saveLinkeTableInfo(tabId, linkids, type,wbsId);
+    public R saveLinkeTableInfo(String tabId, String linkids, String type, String wbsId) {
+        return wbsTreePrivateService.saveLinkeTableInfo(tabId, linkids, type, wbsId);
     }
 
 
@@ -2591,8 +2591,9 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public Object getBussDataInfoTrial(Long pkeyId) {
-        return excelTabService.getBussDataInfoTrial(pkeyId);
+    public R<List<Map<String, Object>>> getBussDataInfoTrial(Long pkeyId) {
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(pkeyId);
+        return R.data(bussDataInfoTrial);
     }
 
 

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

@@ -118,7 +118,7 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
     /**
      * 获取试验用户端 单个表单接口数据
      */
-    R getBussDataInfoTrial(Long pkeyId);
+    List<Map<String, Object>> getBussDataInfoTrial(Long pkeyId);
     /**
      * 单PDF 生成 - 试验
      */

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

@@ -345,7 +345,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 List<Formula> formulas = this.formulaService.getFormulaList(keyMappers);
                 WbsTreeContract wtc = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, nodeId));
                 CurrentNode currentNode = createCurrentNode(wtc);
-                TableElementConverter tec = new TableElementConverter(tableInfoList, keyMappers, formulas, coordinateMap,currentNode,tableAll);
+                TableElementConverter tec = new TableElementConverter(tableInfoList, keyMappers, formulas, coordinateMap, currentNode, tableAll);
                 if (tec.isPresent()) {
                     tec.before();
                     this.formulaService.execute(tec);
@@ -357,27 +357,27 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
     }
 
-    public CurrentNode createCurrentNode(WbsTreeContract wtc){
-        if(wtc!=null){
+    public CurrentNode createCurrentNode(WbsTreeContract wtc) {
+        if (wtc != null) {
             CurrentNode currentNode = new CurrentNode();
             currentNode.setPkId(wtc.getPKeyId());
             currentNode.setParentId(wtc.getParentId());
-            List<Long> ids=this.jdbcTemplate.queryForList("select id from m_wbs_tree where id in("+wtc.getId()+","+wtc.getOldId()+")",Long.class);
-            if(Func.isNotEmpty(ids)){
+            List<Long> ids = this.jdbcTemplate.queryForList("select id from m_wbs_tree where id in(" + wtc.getId() + "," + wtc.getOldId() + ")", Long.class);
+            if (Func.isNotEmpty(ids)) {
                 Long id = ids.get(0);
                 currentNode.setId(id);
-                if(id.equals(wtc.getId())){
-                    if(Func.isNotEmpty(wtc.getOldId())) {
+                if (id.equals(wtc.getId())) {
+                    if (Func.isNotEmpty(wtc.getOldId())) {
                         currentNode.setRelateId(Long.parseLong(wtc.getOldId()));
                     }
-                }else{
+                } else {
                     currentNode.setRelateId(wtc.getId());
                 }
-               List<Long> privateIds= this.jdbcTemplate.queryForList("select p_key_id from m_wbs_tree_private where id="+id+" and  project_id="+wtc.getProjectId(),Long.class);
-               if(Func.isNotEmpty(privateIds)){
-                   currentNode.setPrivateId(privateIds.get(0));
-                   return currentNode;
-               }
+                List<Long> privateIds = this.jdbcTemplate.queryForList("select p_key_id from m_wbs_tree_private where id=" + id + " and  project_id=" + wtc.getProjectId(), Long.class);
+                if (Func.isNotEmpty(privateIds)) {
+                    currentNode.setPrivateId(privateIds.get(0));
+                    return currentNode;
+                }
             }
         }
         return null;
@@ -736,8 +736,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             Elements xmtitle = doc.select("el-input[placeholder~=^项目名称]");
 
 
-
-
             // Elements title = doc.select("el-input[placeholder~=^编号]");
 
             /**
@@ -751,15 +749,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             ContractInfo contractInfo = contractInfoService.getById(wbsTreeContract.getContractId());
             // 施工单位名称
             if (dwtitle.size() >= 1) {
-                int y =Integer.parseInt(dwtitle.attr("trindex"));
-                if(y<=10){
+                int y = Integer.parseInt(dwtitle.attr("trindex"));
+                if (y <= 10) {
                     reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                 }
 
             }
             if (sgtitle.size() >= 1) {
-                int y =Integer.parseInt(sgtitle.attr("trindex"));
-                if(y<=10) {
+                int y = Integer.parseInt(sgtitle.attr("trindex"));
+                if (y <= 10) {
                     reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                 }
             }
@@ -794,7 +792,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
 
             // 项目名称
-            if (xmtitle.size() >= 1 ) {
+            if (xmtitle.size() >= 1) {
                 for (Element element : xmtitle) {
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     if (trindex <= 6) {
@@ -896,7 +894,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     @Override
     public R getBussPdfInfo(Long pkeyId) throws Exception {
 
-        String file_path =ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
 
         WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
                 .eq(WbsTreeContract::getPKeyId, pkeyId));
@@ -1062,7 +1060,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                 // 组装电签设置
                 QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
-                queryWrapper.in("type", 2,6);
+                queryWrapper.in("type", 2, 6);
                 queryWrapper.eq("tab_id", wbsTreeContract.getIsTypePrivatePid());
 
                 List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
@@ -1174,15 +1172,16 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 获取填报信息
      */
     @Override
-    public R getBussDataInfoTrial(Long pkeyId) {
+    public List<Map<String, Object>> getBussDataInfoTrial(Long pkeyId) {
+        List<Map<String, Object>> list = new ArrayList<>();
         Map<String, Object> reData = new HashMap<>();
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
         if (wbsTreePrivate == null) {
-            return R.data(reData);
+            return list;
         }
         if (wbsTreePrivate.getHtmlUrl() == null) {
-            return R.data(reData);
+            return list;
         }
 
         //表单是否存储在
@@ -1190,7 +1189,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         String isExitSql = " select * from information_schema.TABLES where TABLE_NAME='" + tabName + "'";
         List<Map<String, Object>> tabList = jdbcTemplate.queryForList(isExitSql);
         if (tabList == null || tabList.size() <= 0) {
-            return R.fail("无实体表对应");
+            throw new ServiceException("无实体表对应");
         }
 
         String querySql = "select * from " + wbsTreePrivate.getInitTableName() + " where p_key_id=" + pkeyId;
@@ -1294,7 +1293,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         reData.remove("contractId");
         reData.remove("pkeyId");
         reData.remove("projectId");
-        return R.data(reData);
+        list.add(reData);
+        return list;
     }
 
     /**
@@ -1326,7 +1326,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             throw new ServiceException("操作失败!");
         }
 
-        Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfoTrial(pkeyId).getData();
+        Map<String, Object> DataInfo = (Map<String, Object>) getBussDataInfoTrial(pkeyId);
 
         // 获取excel流 和 html流
         Workbook wb = new Workbook();