Jelajahi Sumber

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

lvy 6 hari lalu
induk
melakukan
3b350c0d04

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/ProfilerStandardSectionBean.java

@@ -74,7 +74,7 @@ public class ProfilerStandardSectionBean {
      * 圆心z(米)
      */
     @ApiModelProperty("圆心z(米)")
-    private String y;
+    private String z;
 
     /**
      *  创建时间

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/profiler/ProfilerOffsetPush.java

@@ -57,7 +57,7 @@ public class ProfilerOffsetPush {
         profilerOffsetPush.setReport_date(DateUtil.format(DateTime.now(),"yyyy-MM-dd"));
         profilerOffsetPush.setMeasurement_time(push.getDate());
         profilerOffsetPush.setMeasurement_person(push.getUserName());
-        profilerOffsetPush.setPile_number(null);
+        profilerOffsetPush.setPile_number(push.getMileageNumber());
         profilerOffsetPush.setX_offset(push.getX0());
         profilerOffsetPush.setY_offset(push.getZ0());
         profilerOffsetPush.setInstrument_height(push.getDeviceHeight());

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/entity/profiler/ProfilerSectionPush.java

@@ -45,7 +45,7 @@ public class ProfilerSectionPush {
             sectionPush.setStart_angle(f.getStartAngle());
             sectionPush.setRadius(f.getRadius());
             sectionPush.setCenter_x(f.getX());
-            sectionPush.setCenter_y(f.getY());
+            sectionPush.setCenter_y(f.getZ());
             return sectionPush;
         }).collect(Collectors.toList());
     }

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

@@ -5294,7 +5294,7 @@ public class ExcelTabController extends BladeController {
         return R.data(query);
     }
 
-    //@Scheduled(cron = "0 00 02 * * ?")
+    @Scheduled(cron = "0 0 1 ? * SAT")
     @GetMapping("/checkAllNodeDate")
     public void checkAllNodeDate() throws Exception {
         String updateSql="update m_wbs_tree_contract set date_is_complete=1 where is_deleted=0 and type=1";
@@ -5312,11 +5312,11 @@ public class ExcelTabController extends BladeController {
             if(parent==null){
                 continue;
             }
-//            String informationSql="select * from u_information_query where wbs_id="+parent.getPKeyId()+" and contract_id="+parent.getContractId()+" and is_deleted=0";
-//            List<InformationQuery> query = jdbcTemplate.query(informationSql, new BeanPropertyRowMapper<>(InformationQuery.class));
-//            if(query.isEmpty()||query.get(0).getStatus()!=0){
-//                continue;
-//            }
+            String informationSql="select * from u_information_query where wbs_id="+parent.getPKeyId()+" and contract_id="+parent.getContractId()+" and is_deleted=0";
+            List<InformationQuery> query = jdbcTemplate.query(informationSql, new BeanPropertyRowMapper<>(InformationQuery.class));
+            if(query.isEmpty()){
+                continue;
+            }
             List<WbsTreeContract> wbsTreeContractList = entry.getValue();
             boolean flag=true;
             for (WbsTreeContract contract : wbsTreeContractList) {

+ 7 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -1251,6 +1251,13 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     @Override
     public ContractInfoVO2 selectByCondition(ContractInfo contractInfo) {
         ContractInfo contractInfo1 = baseMapper.selectById(contractInfo.getId());
+        if(contractInfo1!=null&&StringUtils.isEmpty(contractInfo1.getProjectPlace())){
+            //查询area表里面的数据
+            ProjectContractArea projectContractArea = projectContractAreaMapper.selectOne(Wrappers.<ProjectContractArea>query().lambda().eq(ProjectContractArea::getContractId, contractInfo1.getId()).last("LIMIT 1"));
+            if(projectContractArea!=null){
+                contractInfo1.setProjectPlace(projectContractArea.getProvince()+projectContractArea.getCity()+projectContractArea.getCounty());
+            }
+        }
         ContractInfoVO2 contractInfoVO2 = new ContractInfoVO2();
         contractInfoVO2.setContractInfo(contractInfo1);
         Integer contractType = contractInfo1.getContractType();

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

@@ -1448,13 +1448,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
         if (resultData != null) {
             resultData = resultData.replaceAll("(_\\^_\\d+_\\d+☆?)",",");
-            if (resultData.charAt(resultData.length() - 1) == ',') {
+            if (!resultData.isEmpty() && resultData.charAt(resultData.length() - 1) == ',') {
                 resultData = resultData.substring(0, resultData.length() - 1);
             }
         }
         if (sourceData != null) {
             sourceData = sourceData.replaceAll("(\" *)","").replaceAll("(_\\^_\\d+_\\d+☆?)",",");
-            if (sourceData.charAt(sourceData.length() - 1) == ',') {
+            if (!sourceData.isEmpty() && sourceData.charAt(sourceData.length() - 1) == ',') {
                 sourceData = sourceData.substring(0, sourceData.length() - 1);
             }
         }

+ 62 - 17
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ProfilerOffsetServiceImpl.java

@@ -227,10 +227,15 @@ public class ProfilerOffsetServiceImpl extends ServiceImpl<ProfilerOffsetMapper,
 
 
         //从系统参数中获取配置信息
-        String sql = "select param_value from blade_param where param_key = 'profiler.isPush' and is_deleted = 0";
-        Integer isPush = jdbcTemplate.queryForObject(sql, Integer.class);
-        //判断是否上传数据
-        if(isPush != null && isPush == 0){
+        String sql = null;
+        try {
+            sql = "select param_value from blade_param where param_key = 'profiler.isPush' and is_deleted = 0";
+            Integer isPush = jdbcTemplate.queryForObject(sql, Integer.class);
+            //判断是否上传数据
+            if(isPush != null && isPush == 0){
+                return;
+            }
+        } catch (DataAccessException e) {
             return;
         }
 
@@ -243,36 +248,75 @@ public class ProfilerOffsetServiceImpl extends ServiceImpl<ProfilerOffsetMapper,
             log.error("系统参数未找到 profiler.baseUrl");
         }
 
-        String clientKey = null;
+        String clientLeftKey = null;
         try {
-            sql = "select param_value from blade_param where param_key = 'profiler.clientKey' and is_deleted = 0";
+            sql = "select param_value from blade_param where param_key = 'profiler.left.clientKey' and is_deleted = 0";
             //第三方提供的key
-            clientKey = jdbcTemplate.queryForObject(sql, String.class);
+            clientLeftKey = jdbcTemplate.queryForObject(sql, String.class);
         } catch (DataAccessException e) {
             log.error("系统参数未找到 profiler.clientKey");
             return;
         }
 
-        String secret = null;
+        String secretLeft = null;
+        try {
+            sql = "select param_value from blade_param where param_key = 'profiler.left.secret' and is_deleted = 0";
+            //第三方提供的key
+            secretLeft = jdbcTemplate.queryForObject(sql, String.class);
+        } catch (DataAccessException e) {
+            log.error("系统参数未找到 profiler.secret");
+            return;
+        }
+
+        String protocolLeftApiId = null;
+        try {
+            sql = "select param_value from blade_param where param_key = 'profiler.left.protocolApiId' and is_deleted = 0";
+            //第三方提供的key
+            protocolLeftApiId = jdbcTemplate.queryForObject(sql, String.class);
+        } catch (DataAccessException e) {
+            log.error("系统参数未找到 profiler.protocolApiId");
+            return;
+        }
+
+
+        String clientRightKey = null;
         try {
-            sql = "select param_value from blade_param where param_key = 'profiler.secret' and is_deleted = 0";
+            sql = "select param_value from blade_param where param_key = 'profiler.right.clientKey' and is_deleted = 0";
             //第三方提供的key
-            secret = jdbcTemplate.queryForObject(sql, String.class);
+            clientRightKey = jdbcTemplate.queryForObject(sql, String.class);
+        } catch (DataAccessException e) {
+            log.error("系统参数未找到 profiler.clientKey");
+            return;
+        }
+        String secretRight = null;
+        try {
+            sql = "select param_value from blade_param where param_key = 'profiler.right.secret' and is_deleted = 0";
+            //第三方提供的key
+            secretRight = jdbcTemplate.queryForObject(sql, String.class);
         } catch (DataAccessException e) {
             log.error("系统参数未找到 profiler.secret");
             return;
         }
 
-        String protocolApiId = null;
+
+
+        String protocolRightApiId = null;
         try {
-            sql = "select param_value from blade_param where param_key = 'profiler.protocolApiId' and is_deleted = 0";
+            sql = "select param_value from blade_param where param_key = 'profiler.right.protocolApiId' and is_deleted = 0";
             //第三方提供的key
-            protocolApiId = jdbcTemplate.queryForObject(sql, String.class);
+            protocolRightApiId = jdbcTemplate.queryForObject(sql, String.class);
         } catch (DataAccessException e) {
             log.error("系统参数未找到 profiler.protocolApiId");
             return;
         }
-        if(StringUtil.isBlank(baseUrl) || StringUtil.isBlank(clientKey) || StringUtil.isBlank(secret) || StringUtil.isBlank(protocolApiId)){
+        if(StringUtil.isBlank(baseUrl)
+                || StringUtil.isBlank(clientLeftKey)
+                || StringUtil.isBlank(clientRightKey)
+                || StringUtil.isBlank(secretLeft)
+                || StringUtil.isBlank(secretRight)
+                || StringUtil.isBlank(protocolLeftApiId)
+                || StringUtil.isBlank(protocolRightApiId)
+        ){
             log.error("系统参数未找到配置项");
             return;
         }
@@ -300,7 +344,7 @@ public class ProfilerOffsetServiceImpl extends ServiceImpl<ProfilerOffsetMapper,
             //设置不忽略空值
             JSONConfig config = JSONConfig.create().setIgnoreNullValue(false);
             JSONObject jsonObject = new JSONObject(config);
-            jsonObject.set("protocolApiId", protocolApiId);
+            jsonObject.set("protocolApiId", f.getChannelName().contains("左洞") ? protocolLeftApiId : protocolRightApiId);
             jsonObject.set("data", profilerOffsetPush);
 
             //数据json字符串
@@ -313,13 +357,13 @@ public class ProfilerOffsetServiceImpl extends ServiceImpl<ProfilerOffsetMapper,
             HashMap<String, String> catLogHeaders = new HashMap<>();
             catLogHeaders.put("Content-Type", "application/json");
             //应用ID
-            catLogHeaders.put("Sec-API-Key", clientKey);
+            catLogHeaders.put("Sec-API-Key", f.getChannelName().contains("左洞") ? clientLeftKey : clientRightKey);
             //当前时间 毫秒值
             catLogHeaders.put("Sec-Timestamp", secTimestamp);
             //请求发起时的随机字符串,需要保证唯一性
             catLogHeaders.put("Sec-Nonce", secNonce);
             //签名
-            catLogHeaders.put("Sec-Signature", new HmacUtils(HmacAlgorithms.HMAC_SHA_256, secret).hmacHex(sign));
+            catLogHeaders.put("Sec-Signature", new HmacUtils(HmacAlgorithms.HMAC_SHA_256, f.getChannelName().contains("左洞") ? secretLeft : secretRight).hmacHex(sign));
 
             try {
                 String catLogBody = post.addHeaders(catLogHeaders).body(catLog).contentType("application/json").execute().body();
@@ -334,6 +378,7 @@ public class ProfilerOffsetServiceImpl extends ServiceImpl<ProfilerOffsetMapper,
             } catch (HttpException e) {
                 f.setPush(2);
             }
+            f.setPushTime(DateTime.now().toLocalDateTime());
         }
         log.info("推送完成------{}", DateTime.now());
         this.updateBatchById(list);