Browse Source

Merge branch 'lihb' of http://219.151.181.73:3000/zhuwei/bladex into test-merge

LHB 2 months ago
parent
commit
178bf039aa

+ 7 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsSynchronousServiceImpl.java

@@ -442,7 +442,10 @@ public class WbsSynchronousServiceImpl {
                             if (collect.contains(3)) {
                                 editPrivateNode.setInitTableName(templateNode.getInitTableName());
                             }
-
+                            //公式 根据init_table_id去查询的
+                            if (collect.contains(5)) {
+                                editPrivateNode.setInitTableId(templateNode.getInitTableId());
+                            }
 
                             //排序
                             if (collect.contains(7)) {
@@ -1050,7 +1053,9 @@ public class WbsSynchronousServiceImpl {
                     .eq(TextdictInfo::getProjectId, templateId)
                     .eq(TextdictInfo::getIsDeleted, 0)
                     .in(TextdictInfo::getTabId, tempPKeyIds)
-                    .in(TextdictInfo::getType, 2, 4, 6));
+                    .in(TextdictInfo::getType, 4));
+            //当前值同步默认值
+//                    .in(TextdictInfo::getType, 2, 4, 6));
             if (CollectionUtil.isEmpty(tempTextDictInfo)) {
                 throw new ServiceException("源数据无电签及默认值配置");
             }

+ 69 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreeContractServiceImpl.java

@@ -20,6 +20,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Table;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.jsoup.Jsoup;
@@ -110,6 +111,8 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
     private final InformationQueryClient informationQueryClient;
     private final ContractClient contractClient;
     private final ITableFileService tableFileService;
+    private final TableInfoMapper  tableInfoMapper;
+    private final WbsFormElementMapper wbsFormElementMapper;
 
 
     @Autowired
@@ -1653,12 +1656,78 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
                     sgTabMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
                 }
             }
+            //获取 CL08水准测量记录表(监理)的 实际标高、高程偏差 对应字段
+            String leveling = "CL08水准测量记录表(监理)";
+
+            String designedElevation = "设置标高";
+            //负值+0/1 正值-0/1
+            String heightDeviation = "高度偏差";
+            //设置标高 + (高度偏差 / 100)
+            String actualElevation = "实际标高";
+
+
+            String planePosition = "CL10平面位置检测记录表(监理)";
+
+            //负值+0/1 正值-0/1
+            String difference = "差值";
+            //差值X + 差值Y 的开平方
+            String deviation = "偏差";
+            //指定表单和指定字段
+            Map<String, Map<String, String>> dataMaps = new HashMap<>();
+
             for (WbsTreeContract wbsTreeContract : jlTabSort) {
                 //监理表
                 String s = extractAlphameric(wbsTreeContract.getNodeName());
                 if (StringUtils.isNotEmpty(s)) {
                     jlTabMaps.put(s + "---" + wbsTreeContract.getPKeyId(), wbsTreeContract.getInitTableName());
                 }
+
+
+                /**
+                 * 如果是
+                 *  CL08水准测量记录表(监理)
+                 *      1、“实际标高”不获取数据,改为计算得来,计算规则为:实际标高 = 设计标高 + (高程偏差 / 100)。其中高程偏差需带符号进行计算,特别是负号;
+                 *      2、获取的【高程偏差】需要做随机加减(规则为:如果是负数则+0/1,如果是正数则-0/1)
+                 *  CL10平面位置检测记录表(监理)
+                 *      1、“差值”的两列和“偏位”数据不获取
+                 *      2、获取的【差值】两列 需要做随机加减(规则为:如果是负数则+0/1,如果是正数则-0/1)
+                 *      3、“偏差”不获取数据,改为计算得来,计算规则为:(差值x的平方 + 差值y的平方)的和开平方,四舍五入保留整数。
+                 */
+                HashMap<String, String> map = new HashMap<>();
+
+                //判断当前表单是否是CL08、CL10
+                if (wbsTreeContract.getNodeName().contains(leveling) || wbsTreeContract.getNodeName().contains(planePosition)) {
+                    TableInfo tableInfo = tableInfoMapper.selectOne(Wrappers.<TableInfo>lambdaQuery()
+                            .eq(TableInfo::getTabEnName, wbsTreeContract.getInitTableName()));
+                    List<WbsFormElement> wbsFormElements = wbsFormElementMapper.selectList(Wrappers.<WbsFormElement>lambdaQuery()
+                            .eq(WbsFormElement::getFId, tableInfo.getId()));
+                    for (WbsFormElement wbsFormElement : wbsFormElements) {
+                        String eName = wbsFormElement.getEName();
+                        if(eName.contains(designedElevation)){
+                            //设置标高
+                            map.put(designedElevation, wbsFormElement.getEKey());
+                        }else if(eName.contains(heightDeviation)){
+                            //高度偏差
+                            map.put(heightDeviation, wbsFormElement.getEKey());
+                        }else if(eName.contains(actualElevation)){
+                            //实际标高
+                            map.put(actualElevation, wbsFormElement.getEKey());
+                        }else if(eName.contains(difference)){
+                            //差值
+                            if(eName.contains("X")){
+                                map.put(difference + "X", wbsFormElement.getEKey());
+                            }else if (eName.contains("Y")){
+                                map.put(difference + "Y", wbsFormElement.getEKey());
+                            }
+                        }else if(eName.contains(deviation)){
+                            //偏差
+                            map.put(deviation, wbsFormElement.getEKey());
+                        }
+                    }
+
+                    //存储
+                    dataMaps.put(wbsTreeContract.getNodeName(),map);
+                }
             }
 
             //构造表数据