Parcourir la source

update akds project

CRK il y a 4 semaines
Parent
commit
c9c25e9157
31 fichiers modifiés avec 754 ajouts et 8703 suppressions
  1. BIN
      log.path_IS_UNDEFINED/2026-03-09/point-0.log.gz
  2. 11 37
      mjava-paineng/pom.xml
  3. 35 0
      mjava-akdsbeisen/src/main/java/com/malk/BeisenApplication.java
  4. 31 0
      mjava-akdsbeisen/src/main/java/com/malk/server/beisen/BSConf.java
  5. 24 0
      mjava-akdsbeisen/src/main/java/com/malk/service/beisen/BSClient.java
  6. 394 0
      mjava-akdsbeisen/src/main/java/com/malk/service/beisen/BSDataSyncService.java
  7. 194 0
      mjava-akdsbeisen/src/main/java/com/malk/service/beisen/impl/BSClientImpl.java
  8. 32 0
      mjava-akdsbeisen/src/main/java/com/malk/timer/BeisenSyncTimer.java
  9. 16 12
      mjava-paineng/src/main/resources/application-dev.yml
  10. 16 11
      mjava-paineng/src/main/resources/application-prod.yml
  11. BIN
      mjava-paineng/log/2024-10-22/error-0.log.gz
  12. BIN
      mjava-paineng/log/2024-10-22/info-0.log.gz
  13. BIN
      mjava-paineng/log/2024-10-22/point-0.log.gz
  14. BIN
      mjava-paineng/log/2024-10-22/warn-0.log.gz
  15. BIN
      mjava-paineng/log/2024-10-28/info-0.log.gz
  16. BIN
      mjava-paineng/log/2024-10-28/point-0.log.gz
  17. 0 30
      mjava-paineng/src/main/java/com/malk/paineng/Boot.java
  18. 0 337
      mjava-paineng/src/main/java/com/malk/paineng/Timers/timer1.java
  19. 0 69
      mjava-paineng/src/main/java/com/malk/paineng/controller/DDController.java
  20. 0 51
      mjava-paineng/src/main/java/com/malk/paineng/controller/GZTController.java
  21. 0 10
      mjava-paineng/src/main/java/com/malk/paineng/service/GZT_PN.java
  22. 0 24
      mjava-paineng/src/main/java/com/malk/paineng/service/YD_PN.java
  23. 0 50
      mjava-paineng/src/main/java/com/malk/paineng/service/ZT_PN.java
  24. 0 24
      mjava-paineng/src/main/java/com/malk/paineng/service/ZhongTai_All.java
  25. 0 91
      mjava-paineng/src/main/java/com/malk/paineng/service/impl/GZT_PNImpl.java
  26. 0 533
      mjava-paineng/src/main/java/com/malk/paineng/service/impl/YD_PNImpl.java
  27. 0 5504
      mjava-paineng/src/main/java/com/malk/paineng/service/impl/ZT_PNImpl.java
  28. 0 1744
      mjava-paineng/src/main/java/com/malk/paineng/service/impl/ZhongTai_AllImpl.java
  29. 0 142
      mjava-paineng/src/main/java/com/malk/paineng/util/HttpUtil.java
  30. 0 31
      mjava-paineng/src/test/java/test.java
  31. 1 3
      pom.xml

BIN
log.path_IS_UNDEFINED/2026-03-09/point-0.log.gz


+ 11 - 37
mjava-paineng/pom.xml

@@ -9,57 +9,33 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>mjava-paineng</artifactId>
-    <description>派能项目</description>
+    <artifactId>mjava-akdsbeisen</artifactId>
+    <description>北森数据同步模块</description>
 
     <properties>
         <maven.compiler.source>8</maven.compiler.source>
         <maven.compiler.target>8</maven.compiler.target>
-        <sqlserver-jdbc.version>6.4.0.jre8</sqlserver-jdbc.version>
     </properties>
 
     <dependencies>
-        <!-- 核心模块-->
         <dependency>
             <groupId>com.malk</groupId>
             <artifactId>mjava</artifactId>
             <version>${mjava.version}</version>
         </dependency>
-
-        <!-- sqlserver依赖 -->
-        <dependency>
-            <groupId>com.microsoft.sqlserver</groupId>
-            <artifactId>mssql-jdbc</artifactId>
-            <scope>runtime</scope>
-            <version>${sqlserver-jdbc.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.jetbrains</groupId>
-            <artifactId>annotations</artifactId>
-            <version>RELEASE</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>com.googlecode.json-simple</groupId>
-            <artifactId>json-simple</artifactId>
-            <version>1.1</version>
-        </dependency>
         <dependency>
-            <groupId>com.squareup.okhttp3</groupId>
-            <artifactId>okhttp</artifactId>
-            <version>3.14.9</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpasyncclient</artifactId>
-            <version>4.1</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-core</artifactId>
-            <version>3.5.7</version>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
         </dependency>
-
     </dependencies>
 
     <build>
@@ -69,13 +45,11 @@
                 <artifactId>spring-boot-maven-plugin</artifactId>
                 <version>2.1.1.RELEASE</version>
                 <configuration>
+                    <mainClass>com.malk.BeisenApplication</mainClass>
                     <includeSystemScope>true</includeSystemScope>
-                    <!-- 如果没有该配置,devtools不会生效: 打包时关闭 -->
                     <fork>false</fork>
-                    <!-- 避免中文乱码 -->
                     <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
                 </configuration>
-                <!-- 允许生成可运行jar -->
                 <executions>
                     <execution>
                         <goals>
@@ -87,4 +61,4 @@
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>
-</project>
+</project>

+ 35 - 0
mjava-akdsbeisen/src/main/java/com/malk/BeisenApplication.java

@@ -0,0 +1,35 @@
+package com.malk;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication(exclude = {
+    DataSourceAutoConfiguration.class,
+    HibernateJpaAutoConfiguration.class,
+    org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration.class
+})
+@EnableScheduling
+@EnableConfigurationProperties
+@ComponentScan(basePackages = {
+    "com.malk.service.beisen",
+    "com.malk.service.aliwork",
+    "com.malk.service.dingtalk",
+    "com.malk.server.beisen",
+    "com.malk.server.aliwork",
+    "com.malk.server.dingtalk",
+    "com.malk.server.common",
+    "com.malk.delegate",
+    "com.malk.timer",
+    "com.malk.utils"
+})
+public class BeisenApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(BeisenApplication.class, args);
+    }
+}

+ 31 - 0
mjava-akdsbeisen/src/main/java/com/malk/server/beisen/BSConf.java

@@ -0,0 +1,31 @@
+package com.malk.server.beisen;
+
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Data
+@Component
+@ConfigurationProperties(prefix = "beisen")
+@Slf4j
+public class BSConf {
+
+    private String appKey;
+
+    private String appSecret;
+
+    private String baseUrl;
+
+    private String formUuidAttendance;
+
+    private String formUuidOvertime;
+
+    private String formUuidBusinessTrip;
+
+    private String formUuidLeave;
+
+    private String yidaAppType;
+
+    private String yidaSystemToken;
+}

+ 24 - 0
mjava-akdsbeisen/src/main/java/com/malk/service/beisen/BSClient.java

@@ -0,0 +1,24 @@
+package com.malk.service.beisen;
+
+import java.util.Map;
+
+public interface BSClient {
+
+    String getAccessToken();
+
+    Map<String, Object> getAttendanceData(String month);
+
+    Map<String, Object> getOvertimeData(String month);
+
+    Map<String, Object> getBusinessTripData(String month);
+
+    Map<String, Object> getLeaveData(String month);
+
+    Map<String, Object> getAttendanceDataByDate(String startDate, String endDate);
+
+    Map<String, Object> getOvertimeDataByDate(String startDate, String endDate);
+
+    Map<String, Object> getBusinessTripDataByDate(String startDate, String endDate);
+
+    Map<String, Object> getLeaveDataByDate(String day);
+}

+ 394 - 0
mjava-akdsbeisen/src/main/java/com/malk/service/beisen/BSDataSyncService.java

@@ -0,0 +1,394 @@
+package com.malk.service.beisen;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.malk.server.aliwork.YDConf;
+import com.malk.server.aliwork.YDParam;
+import com.malk.server.beisen.BSConf;
+import com.malk.service.aliwork.YDClient;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Slf4j
+@Service
+public class BSDataSyncService {
+
+    @Autowired
+    private BSClient bsClient;
+
+    @Autowired
+    private YDClient ydClient;
+
+    @Autowired
+    private BSConf bsConf;
+
+    private static final DateTimeFormatter MONTH_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM");
+
+    public void syncCurrentMonthData() {
+        LocalDate now = LocalDate.now();
+        LocalDate lastDayOfMonth = now.withDayOfMonth(now.lengthOfMonth());
+        int daysInMonth = lastDayOfMonth.getDayOfMonth();
+        
+        log.info("开始同步{}年{}月数据,共{}天", now.getYear(), now.getMonthValue(), daysInMonth);
+
+        for (int day = 1; day <= daysInMonth; day++) {
+            String date = String.format("%04d-%02d-%02d", now.getYear(), now.getMonthValue(), day);
+            syncAttendanceDataByDay(date);//打卡数据
+          syncOvertimeDataByDay(date); //加班数据
+           syncBusinessTripDataByDay(date);//出差数据
+           syncLeaveDataByDay(date);//请假数据
+        }
+
+        log.info("{}月数据同步完成", now.format(MONTH_FORMATTER));
+    }
+
+    private void syncAttendanceDataByDay(String date) {
+        log.info("开始同步{}打卡数据", date);
+        Map<String, Object> data = bsClient.getAttendanceDataByDate(date, date);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "swipingCardDetails");
+            if (!dataList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidAttendance(), dataList, "打卡数据");
+            } else {
+                log.info("{}打卡数据为空", date);
+            }
+        }
+    }
+
+    private void syncOvertimeDataByDay(String date) {
+        log.info("开始同步{}加班数据", date);
+        Map<String, Object> data = bsClient.getOvertimeDataByDate(date, date);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "overTimeList");
+            List<Map> filteredList = filterByApproStatus(dataList);
+            if (!filteredList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidOvertime(), filteredList, "加班数据");
+            } else {
+                log.info("{}加班数据为空或无审批通过记录", date);
+            }
+        }
+    }
+
+    private void syncBusinessTripDataByDay(String date) {
+        log.info("开始同步{}出差数据", date);
+        Map<String, Object> data = bsClient.getBusinessTripDataByDate(date, date);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "businessList");
+            List<Map> filteredList = filterByApproStatus(dataList);
+            if (!filteredList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidBusinessTrip(), filteredList, "出差数据");
+            } else {
+                log.info("{}出差数据为空或无审批通过记录", date);
+            }
+        }
+    }
+
+    private void syncLeaveDataByDay(String date) {
+        log.info("开始同步{}请假数据", date);
+        Map<String, Object> data = bsClient.getLeaveDataByDate(date);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "vacationList");
+            List<Map> filteredList = filterByApproStatus(dataList);
+            if (!filteredList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidLeave(), filteredList, "请假数据");
+            } else {
+                log.info("{}请假数据为空或无审批通过记录", date);
+            }
+        }
+    }
+
+    @Deprecated
+    private void syncAttendanceData(String month) {
+        log.info("开始同步{}月打卡数据", month);
+        Map<String, Object> data = bsClient.getAttendanceData(month);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "swipingCardDetails");
+            if (!dataList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidAttendance(), dataList, "打卡数据");
+            } else {
+                log.info("{}月打卡数据为空", month);
+            }
+        }
+    }
+
+    private void syncOvertimeData(String month) {
+        log.info("开始同步{}月加班数据", month);
+        Map<String, Object> data = bsClient.getOvertimeData(month);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "overTimeList");
+            List<Map> filteredList = filterByApproStatus(dataList);
+            if (!filteredList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidOvertime(), filteredList, "加班数据");
+            } else {
+                log.info("{}月加班数据为空或无审批通过记录", month);
+            }
+        }
+    }
+
+    private void syncBusinessTripData(String month) {
+        log.info("开始同步{}月出差数据", month);
+        Map<String, Object> data = bsClient.getBusinessTripData(month);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "businessList");
+            List<Map> filteredList = filterByApproStatus(dataList);
+            if (!filteredList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidBusinessTrip(), filteredList, "出差数据");
+            } else {
+                log.info("{}月出差数据为空或无审批通过记录", month);
+            }
+        }
+    }
+
+    private void syncLeaveData(String month) {
+        log.info("开始同步{}月请假数据", month);
+        Map<String, Object> data = bsClient.getLeaveData(month);
+        if (data != null) {
+            List<Map> dataList = extractDataList(data, "vacationList");
+            List<Map> filteredList = filterByApproStatus(dataList);
+            if (!filteredList.isEmpty()) {
+                saveBatchToYida(bsConf.getFormUuidLeave(), filteredList, "请假数据");
+            } else {
+                log.info("{}月请假数据为空或无审批通过记录", month);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private List<Map> filterByApproStatus(List<Map> dataList) {
+        List<Map> filteredList = new ArrayList<>();
+        if (dataList == null || dataList.isEmpty()) {
+            return filteredList;
+        }
+        for (Map<String, Object> item : dataList) {
+            Object approStatus = item.get("approveStatus");
+            if (approStatus != null && ("通过".equals(approStatus.toString()) || "2".equals(approStatus.toString()))) {
+                filteredList.add(item);
+            }
+        }
+        return filteredList;
+    }
+
+    @SuppressWarnings("unchecked")
+    private List<Map> extractDataList(Map<String, Object> data, String listKey) {
+        List<Map> result = new ArrayList<>();
+        try {
+            Map<String, Object> dataMap = (Map<String, Object>) data.get("data");
+            if (dataMap != null && dataMap.containsKey(listKey)) {
+                Object listObj = dataMap.get(listKey);
+                if (listObj instanceof List) {
+                    result = (List<Map>) listObj;
+                }
+            }
+        } catch (Exception e) {
+            log.error("解析数据列表失败, key={}", listKey, e);
+        }
+        return result;
+    }
+
+    private void saveBatchToYida(String formUuid, List<Map> dataList, String dataType) {
+        if (formUuid == null || formUuid.isEmpty()) {
+            log.warn("宜搭表单UUID未配置,跳过写入{}: formUuid={}", dataType, formUuid);
+            return;
+        }
+
+        if (dataList.isEmpty()) {
+            log.info("数据为空,跳过写入{}", dataType);
+            return;
+        }
+
+        String appType = bsConf.getYidaAppType();
+        String systemToken = bsConf.getYidaSystemToken();
+        String idField = getIdField(dataType);
+
+        try {
+            for (Map<String, Object> item : dataList) {
+                JSONObject formData = convertToYidaFormat(item, dataType);
+                String bsId = (String) formData.get(idField);
+                
+                if (bsId == null || bsId.isEmpty()) {
+                    log.warn("{}缺少北森ID字段,跳过: {}", dataType, idField);
+                    continue;
+                }
+
+                cn.hutool.json.JSONObject searchCondition = new cn.hutool.json.JSONObject();
+                searchCondition.put(idField, bsId);
+                List<Map> existList = (List<Map>) ydClient.queryData(
+                        YDParam.builder()
+                                .appType(appType)
+                                .systemToken(systemToken)
+                                .formUuid(formUuid)
+                                .searchCondition(JSON.toJSONString(searchCondition))
+                                .build(),
+                        YDConf.FORM_QUERY.retrieve_list).getData();
+
+                if (existList != null && !existList.isEmpty()) {
+                    log.info("{}数据已存在,执行更新: id={}", dataType, bsId);
+                    YDParam updateParam = YDParam.builder()
+                            .appType(appType)
+                            .systemToken(systemToken)
+                            .formUuid(formUuid)
+                            .noExecuteExpression(false)
+                            .searchCondition(JSON.toJSONString(searchCondition))
+                            .formDataJson(formData.toJSONString())
+                            .build();
+                    Object result = ydClient.operateData(updateParam, YDConf.FORM_OPERATION.upsert);
+                    log.info("{}更新宜搭成功: {}", dataType, JSON.toJSONString(result));
+                } else {
+                    log.info("{}数据不存在,执行新增: id={}", dataType, bsId);
+                    YDParam param = YDParam.builder()
+                            .appType(appType)
+                            .systemToken(systemToken)
+                            .formUuid(formUuid)
+                            .formDataJson(formData.toJSONString())
+                            .build();
+                    Object result = ydClient.operateData(param, YDConf.FORM_OPERATION.create);
+                    log.info("{}写入宜搭成功: {}", dataType, JSON.toJSONString(result));
+                }
+            }
+        } catch (Exception e) {
+            log.error("{}写入宜搭失败", dataType, e);
+        }
+    }
+
+    private String getIdField(String dataType) {
+        switch (dataType) {
+            case "打卡数据":
+                return "textField_mmk1vzvn";
+            case "加班数据":
+                return "textField_mmk1vzvn";
+            case "出差数据":
+                return "textField_mmk1vzvn";
+            case "请假数据":
+                return "textField_mmk1vzvn";
+            default:
+                return "textField_mmk1vzvn";
+        }
+    }
+
+
+
+    // 缓存员工工号->钉钉ID的映射
+    private final Map<String, String> staffIdCache = new ConcurrentHashMap<>();
+
+    private JSONObject convertToYidaFormat(Map<String, Object> data, String dataType) {
+        JSONObject formData = new JSONObject();
+        Object staffIdObj = data.get("staffId");
+        String staffId = staffIdObj != null ? staffIdObj.toString() : null;
+        switch (dataType) {
+            case "打卡数据":
+                formData.put("textField_mmk1vzvn", toStringValue(data.get("objectId")));
+                formData.put("employeeField_mmizoplw", staffId);
+                formData.put("dateField_mmk1vzvt", dateToTimestamp(data.get("punchCardDate")));
+                formData.put("dateField_mmlhvg88", dateToTimestamp(data.get("swipingCardDateTime")));
+                formData.put("textField_mmk2b4os", toStringValue(data.get("locationDetail")));
+               formData.put("textField_mmk1vzvo",  SXW(dateToTimestamp(data.get("swipingCardDateTime"))));
+                formData.put("textField_mmk2b4or", toStringValue(data.get("signinResult")));
+                break;
+            case "加班数据":
+                formData.put("textField_mmk1vzvn", toStringValue(data.get("oId")));
+                formData.put("employeeField_mmizoplw", staffId);
+                formData.put("dateField_mmk1vzvt", dateToTimestamp(data.get("startDate")));
+                formData.put("dateField_mmk1vzvu", dateToTimestamp(data.get("stopDate")));
+                formData.put("numberField_mmk1vzvv", toStringValue(data.get("overTimeDuration")));
+
+                break;
+            case "出差数据":
+                formData.put("textField_mmk1vzvn",  toStringValue(data.get("objectId")));
+
+                formData.put("employeeField_mmizoplw", staffId);
+                formData.put("dateField_mmk1vzvt", dateToTimestamp(data.get("startDateTime")));
+                formData.put("dateField_mmk1vzvu", dateToTimestamp(data.get("stopDateTime")));
+                formData.put("numberField_mmk1vzvv", toStringValue(data.get("businessDuration")));
+                formData.put("numberField_mmlsurjx", toStringValue(data.get("dayValOfDuration")));
+                break;
+            case "请假数据":
+                formData.put("textField_mmk1vzvn",  toStringValue(data.get("vacationId")));
+                formData.put("employeeField_mmizoplw", staffId);
+                formData.put("textField_mmk1vzvo", toStringValue(data.get("vacationType")));
+
+                formData.put("dateField_mmk1vzvt", dateToTimestamp(data.get("vacationStartDateTime")));
+                formData.put("dateField_mmk1vzvu", dateToTimestamp(data.get("vacationStopDateTime")));
+                formData.put("numberField_mmk1vzvv", toStringValue(data.get("dayValueOfDuration")));
+
+                break;
+
+        }
+        
+
+        return formData;
+    }
+
+    private Long dateToTimestamp(Object dateObj) {
+        if (dateObj == null) {
+            return null;
+        }
+        try {
+            String dateStr = dateObj.toString().trim();
+            if (dateStr.isEmpty()) {
+                return null;
+            }
+            if (dateStr.matches("\\d+")) {
+                return Long.parseLong(dateStr);
+            }
+            String[] patterns = {
+                "yyyy-MM-dd HH:mm:ss",
+                "yyyy-MM-dd HH:mm",
+                "yyyy-MM-dd'T'HH:mm:ss",
+                "yyyy-MM-dd"
+            };
+            for (String pattern : patterns) {
+                try {
+                    java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern(pattern);
+                    if (pattern.contains(" ")) {
+                        java.time.LocalDateTime ldt = java.time.LocalDateTime.parse(dateStr, formatter);
+                        return ldt.atZone(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli();
+                    } else {
+                        java.time.LocalDate ld = java.time.LocalDate.parse(dateStr, formatter);
+                        return ld.atStartOfDay(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli();
+                    }
+                } catch (Exception ignored) {
+                }
+            }
+            log.warn("无法解析日期格式: {}", dateStr);
+            return null;
+        } catch (Exception e) {
+            log.warn("日期转时间戳失败: {}", dateObj, e);
+            return null;
+        }
+    }
+
+    private String SXW(long  timestamp) {
+     String  SXW="";
+        Instant instant = Instant.ofEpochMilli(timestamp);
+// 需要时区上下文来进行有意义的“上午/下午”判断
+        ZonedDateTime zdt = instant.atZone(ZoneId.systemDefault());
+        int hour = zdt.getHour();
+        if (hour < 12) {
+            SXW= "上午";
+        } else {
+            SXW="下午";
+        }
+        return  SXW;
+    }
+
+
+    private String toStringValue(Object obj) {
+        if (obj == null) {
+            return null;
+        }
+        return obj.toString();
+    }
+
+
+}

+ 194 - 0
mjava-akdsbeisen/src/main/java/com/malk/service/beisen/impl/BSClientImpl.java

@@ -0,0 +1,194 @@
+package com.malk.service.beisen.impl;
+
+import com.alibaba.fastjson.JSON;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSONObject;
+import com.malk.server.beisen.BSConf;
+import com.malk.service.beisen.BSClient;
+import com.malk.utils.UtilHttp;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Slf4j
+@Service
+public class BSClientImpl implements BSClient {
+
+    @Autowired
+    private BSConf bsConf;
+
+    private String accessToken;
+    private long tokenExpireTime;
+
+    private static final String TOKEN_PATH = "/token";
+    private static final String VACATION_PATH = "/AttendanceOpen/api/v1/Vacation/GetListByDate";
+    private static final String BUSINESS_TRIP_PATH = "/AttendanceOpen/api/v1/Business/GetStartDateTimeBusinessListByDate";
+    private static final String OVERTIME_PATH = "/AttendanceOpen/api/v1/AttendanceOvertime/GetOverTimeListByDate";
+    private static final String ATTENDANCE_PATH = "/AttendanceOpen/api/v1/SwipingCardData/GetSwipingCardsByDate";
+
+    @Override
+    public String getAccessToken() {
+        if (StringUtils.isNotBlank(accessToken) && System.currentTimeMillis() < tokenExpireTime) {
+            return accessToken;
+        }
+
+        try {
+            Map<String, Object> params = new HashMap<>();
+            params.put("grant_type", "client_credentials");
+            params.put("APP_KEY", bsConf.getAppKey());
+            params.put("APP_SECRET", bsConf.getAppSecret());
+
+            String url = bsConf.getBaseUrl() + TOKEN_PATH;
+            HttpResponse rsp = HttpRequest.post(url)
+                    .header("Content-Type", "application/json")
+                    .body(JSON.toJSONString(params))
+                    .execute();
+            Map resultMap = JSON.parseObject(rsp.body(), Map.class);
+
+            if (resultMap != null) {
+                accessToken = (String) resultMap.get("access_token");
+                Long expiresIn = ((Number) resultMap.get("expires_in")).longValue();
+                tokenExpireTime = System.currentTimeMillis() + (expiresIn - 300) * 1000;
+                log.info("北森AccessToken获取成功");
+                return accessToken;
+            }
+        } catch (Exception e) {
+            log.error("获取北森AccessToken失败", e);
+        }
+        return null;
+    }
+
+    @Override
+    public Map<String, Object> getAttendanceData(String month) {
+        String[] dates = getMonthDateRange(month);
+        return getAttendanceDataByDate(dates[0], dates[1]);
+    }
+
+    @Override
+    public Map<String, Object> getOvertimeData(String month) {
+        String[] dates = getMonthDateRange(month);
+        return getOvertimeDataByDate(dates[0], dates[1]);
+    }
+
+    @Override
+    public Map<String, Object> getBusinessTripData(String month) {
+        String[] dates = getMonthDateRange(month);
+        return getBusinessTripDataByDate(dates[0], dates[1]);
+    }
+
+    @Override
+    public Map<String, Object> getLeaveData(String month) {
+        String[] dates = getMonthDateRange(month);
+        return getLeaveDataByDate(dates[0]);
+    }
+
+    @Override
+    public Map<String, Object> getAttendanceDataByDate(String startDate, String endDate) {
+        return getDataByDateRange(ATTENDANCE_PATH, startDate, endDate, "打卡");
+    }
+
+    @Override
+    public Map<String, Object> getOvertimeDataByDate(String startDate, String endDate) {
+        return getDataByDateRange(OVERTIME_PATH, startDate, endDate, "加班");
+    }
+
+    @Override
+    public Map<String, Object> getBusinessTripDataByDate(String startDate, String endDate) {
+        return getDataByDateRange(BUSINESS_TRIP_PATH, startDate, endDate, "出差");
+    }
+
+    @Override
+    public Map<String, Object> getLeaveDataByDate(String day) {
+        try {
+            String token = getAccessToken();
+            if (StringUtils.isBlank(token)) {
+                log.error("获取请假数据失败:无法获取accessToken");
+                return null;
+            }
+
+            Map<String, Object> params = new HashMap<>();
+            params.put("day", day);
+
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Authorization", "Bearer " + token);
+            headers.put("Content-Type", "application/json");
+
+            String url = bsConf.getBaseUrl() + VACATION_PATH;
+            HttpResponse rsp = HttpRequest.post(url)
+                    .headerMap(headers, false)
+                    .body(JSON.toJSONString(params))
+                    .execute();
+            Map resultMap = JSON.parseObject(rsp.body(), Map.class);
+
+            if (resultMap != null) {
+                log.info("获取请假数据成功: {}", JSON.toJSONString(resultMap));
+                return resultMap;
+            }
+        } catch (Exception e) {
+            log.error("获取请假数据失败", e);
+        }
+        return null;
+    }
+
+    private Map<String, Object> getDataByDateRange(String path, String startDate, String endDate, String dataType) {
+        try {
+            String token = getAccessToken();
+            if (StringUtils.isBlank(token)) {
+                log.error("获取{}数据失败:无法获取accessToken", dataType);
+                return null;
+            }
+
+            Map<String, Object> params = new HashMap<>();
+            if(dataType.equals("打卡")){
+                params.put("punchCardDate", startDate);
+            }else if(dataType.equals("加班")) {
+                params.put("overTimeDate", startDate);
+            }else if(dataType.equals("出差")) {
+                params.put("startDate", startDate);
+                params.put("endDate", endDate);
+            }
+
+            Map<String, String> headers = new HashMap<>();
+            headers.put("Authorization", token);
+            headers.put("Content-Type", "application/json");
+
+            String url = bsConf.getBaseUrl() + path;
+            log.info("请求{}数据, url={}, params={}, headers={}", dataType, url, JSON.toJSONString(params), JSON.toJSONString(headers));
+            HttpResponse rsp = HttpRequest.post(url)
+                    .headerMap(headers, false)
+                    .body(JSON.toJSONString(params))
+                    .execute();
+            log.info("响应: {}", rsp.body());
+            Map resultMap = JSON.parseObject(rsp.body(), Map.class);
+
+            if (resultMap != null) {
+                log.info("获取{}数据成功: {}", dataType, JSON.toJSONString(resultMap));
+                return resultMap;
+            }
+        } catch (Exception e) {
+            log.error("获取{}数据失败", dataType, e);
+        }
+        return null;
+    }
+
+    private String[] getMonthDateRange(String month) {
+        String[] parts = month.split("-");
+        int year = Integer.parseInt(parts[0]);
+        int monthNum = Integer.parseInt(parts[1]);
+
+        String startDate = String.format("%04d-%02d-01", year, monthNum);
+        String endDate;
+        if (monthNum == 12) {
+            endDate = String.format("%04d-01-01", year + 1);
+        } else {
+            endDate = String.format("%04d-%02d-01", year, monthNum + 1);
+        }
+
+        return new String[]{startDate, endDate};
+    }
+}

+ 32 - 0
mjava-akdsbeisen/src/main/java/com/malk/timer/BeisenSyncTimer.java

@@ -0,0 +1,32 @@
+package com.malk.timer;
+
+import com.malk.service.beisen.BSDataSyncService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+@Slf4j
+@Configuration
+@EnableScheduling
+public class BeisenSyncTimer {
+
+    @Autowired
+    private BSDataSyncService bsDataSyncService;
+
+    @Scheduled(cron = "0 0 5,21 * * ?")
+ // @Scheduled(cron = "0/10 * * * * ?")
+    public void syncBeisenDataToYida() {
+        log.info("开始执行北森数据同步任务");
+      System.out.println("开始执行北森数据同步任务");
+        try {
+            bsDataSyncService.syncCurrentMonthData();
+            log.info("北森数据同步任务执行完成");
+            System.out.println("北森数据同步任务执行完成");
+        } catch (Exception e) {
+            log.error("北森数据同步任务执行失败", e);
+            System.out.println("北森数据同步任务执行失败:"+e);
+        }
+    }
+}

+ 16 - 12
mjava-paineng/src/main/resources/application-dev.yml

@@ -1,8 +1,8 @@
 # 环境配置
 server:
-  port: 8110
+  port: 9055
   servlet:
-    context-path: /api/paineng
+    context-path: /api/akds
 
 
 enable:
@@ -47,17 +47,21 @@ logging:
 
 # dingtalk
 dingtalk:
-  agentId: 3280128891
-  appKey: dingmpxci8bolc3jpima
-  appSecret: Y_k3jpKNHbGvb9S9As2Y61ZaUFNglm7SCqquIkcowLBRoc4ZpH7DG0ZTn8LyHMwI
-  corpId: ding6d0de5f5de58a80c35c2f4657eb6378f
+  agentId: 4310055556
+  appKey: dingkn5sejssd2cyokxn
+  appSecret: bw-iCUwgtcVQ9t0FDB0tllsfOJDvJN5qoOI4AipuxCaPZ1cK9HpZ8aUCElJuHBLm
+  corpId: ding52ae7f09b9166798a39a90f97fcb1e09
   aesKey:
   token:
   operator: ""   # OA管理员账号 [首字符若为0需要转一下字符串]
 
-
-#SqlServer
-sqlserver:
-  url: jdbc:sqlserver://58.246.128.122:2433;databaseName=lanyun
-  username: sa
-  password: "!lanyunnc@2023#"
+beisen:
+  appKey: "619FF6F9C1904C6E968AEA00C900DD1A"
+  appSecret: "D41277DBDBD94F3593669EC5977B77A0A7AC436D3BE141BD8E6C2EF42BE544E1"
+  baseUrl: "https://openapi.italent.cn"
+  formUuidAttendance: "FORM-16DC9608752F44158AB1CE8103B685D6IIYB"
+  formUuidOvertime: "FORM-988A166A9C0A4738A748B6EC1F888A0D7KYB"
+  formUuidBusinessTrip: "FORM-FED49751A6D74700A1A54C0E04E52ED0B7FM"
+  formUuidLeave: "FORM-D15D90EA85234A77B94564110F5D24424ERL"
+  yidaAppType: "APP_ZQ3I7XO2RSHDJ4QDEVNB"
+  yidaSystemToken: "FOD66381NOS25MERLN2UK92FY96Y21UMHD7LM36S"

+ 16 - 11
mjava-paineng/src/main/resources/application-prod.yml

@@ -1,8 +1,8 @@
 # 环境配置
 server:
-  port: 8110
+  port: 9055
   servlet:
-    context-path: /api/paineng
+    context-path: /api/akds
 
 enable:
   scheduling: true
@@ -32,16 +32,21 @@ spring:
 
 # dingtalk
 dingtalk:
-  agentId: 3280128891
-  appKey: dingmpxci8bolc3jpima
-  appSecret: Y_k3jpKNHbGvb9S9As2Y61ZaUFNglm7SCqquIkcowLBRoc4ZpH7DG0ZTn8LyHMwI
-  corpId: ding6d0de5f5de58a80c35c2f4657eb6378f
+  agentId: 4310055556
+  appKey: dingkn5sejssd2cyokxn
+  appSecret: bw-iCUwgtcVQ9t0FDB0tllsfOJDvJN5qoOI4AipuxCaPZ1cK9HpZ8aUCElJuHBLm
+  corpId: ding52ae7f09b9166798a39a90f97fcb1e09
   aesKey:
   token:
   operator: ""   # OA管理员账号 [首字符若为0需要转一下字符串]
 
-
-sqlserver:
-  url: jdbc:sqlserver://192.168.0.237:1433;databaseName=lanyun
-  userName: sa
-  password: "LANyunnc!2024#"
+beisen:
+  appKey: "619FF6F9C1904C6E968AEA00C900DD1A"
+  appSecret: "D41277DBDBD94F3593669EC5977B77A0A7AC436D3BE141BD8E6C2EF42BE544E1"
+  baseUrl: "https://openapi.italent.cn"
+  formUuidAttendance: "FORM-16DC9608752F44158AB1CE8103B685D6IIYB"
+  formUuidOvertime: "FORM-988A166A9C0A4738A748B6EC1F888A0D7KYB"
+  formUuidBusinessTrip: "FORM-FED49751A6D74700A1A54C0E04E52ED0B7FM"
+  formUuidLeave: "FORM-D15D90EA85234A77B94564110F5D24424ERL"
+  yidaAppType: "APP_ZQ3I7XO2RSHDJ4QDEVNB"
+  yidaSystemToken: "FOD66381NOS25MERLN2UK92FY96Y21UMHD7LM36S"

BIN
mjava-paineng/log/2024-10-22/error-0.log.gz


BIN
mjava-paineng/log/2024-10-22/info-0.log.gz


BIN
mjava-paineng/log/2024-10-22/point-0.log.gz


BIN
mjava-paineng/log/2024-10-22/warn-0.log.gz


BIN
mjava-paineng/log/2024-10-28/info-0.log.gz


BIN
mjava-paineng/log/2024-10-28/point-0.log.gz


+ 0 - 30
mjava-paineng/src/main/java/com/malk/paineng/Boot.java

@@ -1,30 +0,0 @@
-package com.malk.paineng;
-
-import com.querydsl.jpa.impl.JPAQueryFactory;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
-import org.springframework.scheduling.annotation.EnableAsync;
-
-import javax.persistence.EntityManager;
-
-
-@EnableAsync
-@EnableJpaAuditing
-@SpringBootApplication(scanBasePackages = {"com.malk"})
-public class Boot {
-
-    public static void main(String... args) {
-        SpringApplication.run(Boot.class, args);
-    }
-
-    /**
-     * 让Spring管理JPAQueryFactory [不使用Qualifier详见mjava-Boot]
-     */
-    @Bean
-    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
-        
-        return new JPAQueryFactory(entityManager);
-    }
-}

+ 0 - 337
mjava-paineng/src/main/java/com/malk/paineng/Timers/timer1.java

@@ -1,337 +0,0 @@
-package com.malk.paineng.Timers;
-
-import cn.hutool.core.date.DateTime;
-import com.malk.paineng.controller.DDController;
-import com.malk.paineng.service.GZT_PN;
-import com.malk.paineng.service.YD_PN;
-import com.malk.paineng.service.ZT_PN;
-import com.malk.server.aliwork.YDConf;
-import com.malk.server.aliwork.YDParam;
-import com.malk.server.dingtalk.DDR_New;
-import com.malk.service.aliwork.YDClient;
-import com.malk.service.dingtalk.DDClient;
-import com.malk.service.dingtalk.DDClient_Contacts;
-import com.malk.service.dingtalk.DDClient_Workflow;
-import com.malk.utils.UtilMap;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-@Configuration
-@EnableScheduling
-public class timer1 {
-    @Autowired
-    private DDController Controller1;
-    @Autowired
-    private YD_PN yd_pnServer;
-    @Autowired
-    private ZT_PN zt_pnServer;
-    @Autowired
-    private DDClient ddClient;
-
-    @Autowired
-    private YDClient ydClient;
-    @Autowired
-    private GZT_PN gzt_pn;
-
-
-    @Autowired
-    private DDClient_Workflow ddClient_workflow;
-    boolean ifss = true;
-
-    //@Scheduled(fixedRate = 100)
-    @Async
-    @Scheduled(cron = "0 0 4 * * ?")
-    public void LegalEntityList() throws Exception {
-
-        if (true) {
-            if (true) {
-                log.info("开启派能数据同步!");
-                System.out.println("开启派能数据同步!");
-                if (true) {
-                    zt_pnServer.ads_fin_gross_profit_margin_i();//收入毛利率分析
-                    zt_pnServer.dwd_sal_ship_order_det_i();//瓦时数据
-                    zt_pnServer.Purchasing_analysis();//采购明细
-                    zt_pnServer.ads_fina_gen_accoutbook_detail_i();//只同步库数据, 先不同步指标
-                    System.out.println("同步结束时间:" + DateTime.now());
-                }
-                if (false) {
-
-                    yd_pnServer.syncYD_GSSJ();//工时-天数据  数据量太大暂不同步
-                }
-                System.out.println("派能数据同步结束!");
-
-            }
-        }
-    }
-
-    /**
-     * 销售明细数据-凌晨6点执行
-     */
-
- // @Scheduled(fixedRate = 100)
-    @Async
-  @Scheduled(cron = "0 0 6 * * ?")
-    public void LegalEntityList_XSMX() throws Exception {
-        if (true) {
-                log.info("开启派能数据同步!销售明细");
-                System.out.println("开启派能数据同步!");
-                zt_pnServer.ads_fin_gross_profit_margin_i_XSMX();
-                System.out.println("派能数据同步结束!销售明细");
-        }
-    }
-    /**
-     * 碳排放月度工时数据-凌晨4点执行
-     */
-    //@Scheduled(fixedRate = 500)
-     @Async
-    @Scheduled(cron = "0 0 4 * * ?")
-    public void LegalEntityList_TPF() throws Exception {
-        if (true) {
-            log.info("开启碳排放月度工时同步!");
-            System.out.println("开启碳排放月度工时同步!");
-            yd_pnServer.syncYD_GSSJTOMonth();//碳排放月度工时数据
-            System.out.println("碳排放月度工时同步结束!");
-        }
-    }
-
-
-
-    /*批量删除宜搭表单数据  -运营平台数据*/
-//    @Scheduled(fixedRate = 1000 )
-//    public void DeleteYDData() {
-//        log.info("开始批量删除宜搭数据");
-//        System.out.println("开始批量删除宜搭数据");
-//        try {
-//            //一次100条,并非全部删除
-//            DDR_New ddrNew = ydClient.queryData(YDParam.builder()
-//                    .appType("APP_U3W7R66HBXPW5T4LETZ7")
-//                    .systemToken("LG9663B1RMIPG2PGDDLEEB0DK2GK3DRFWGI2ME2N")
-//                    .formUuid("FORM-AE6B2FCDF9E244BB8C4EC2B8DFDBEFFAC6CN")
-//                    .build(), YDConf.FORM_QUERY.retrieve_search_form_id);
-//
-//            System.out.println(ddrNew.getTotalCount());
-//
-//            ydClient.operateData(YDParam.builder()
-//                    .appType("APP_U3W7R66HBXPW5T4LETZ7")
-//                    .systemToken("LG9663B1RMIPG2PGDDLEEB0DK2GK3DRFWGI2ME2N")
-//                    .formUuid("FORM-AE6B2FCDF9E244BB8C4EC2B8DFDBEFFAC6CN")
-//                    .asynchronousExecution(true)
-//                    .formInstanceIdList((List<String>) ddrNew.getData())
-//                    .build(), YDConf.FORM_OPERATION.delete_batch);
-//            System.out.println("宜搭数据删除完毕!");
-//
-//        } catch (Exception e) {
-//            //记录错误数据
-//            e.printStackTrace();
-//        }
-//    }
-    /*批量删除宜搭表单数据  -碳排放-上海*/
-     @Scheduled(fixedRate = 500 )
-    public void DeleteYDData() {
-         yd_pnServer.syncYD_GSSJTOMonth();//碳排放月度工时数据
-
-//        log.info("开始批量删除宜搭数据");
-//        System.out.println("开始批量删除宜搭数据");
-//        try {
-//            //一次100条,并非全部删除
-//            DDR_New ddrNew = ydClient.queryData(YDParam.builder()
-//                    .appType("APP_U4GYY20ZKB7REZKT8586")
-//                    .systemToken("9Z766DC19KWMUGCK7OQ8Z8UQ30YB2VVY74PYLCI3")
-//                    .formUuid("FORM-A7F0FB903B7242F68FB99D6E81192C5B6BNE")//工时计算数据
-//                    .build(), YDConf.FORM_QUERY.retrieve_search_form_id);
-//
-//            System.out.println(ddrNew.getTotalCount());
-//
-//            ydClient.operateData(YDParam.builder()
-//                    .appType("APP_U4GYY20ZKB7REZKT8586")
-//                    .systemToken("9Z766DC19KWMUGCK7OQ8Z8UQ30YB2VVY74PYLCI3")
-//                    .formUuid("FORM-A7F0FB903B7242F68FB99D6E81192C5B6BNE")
-//                    .asynchronousExecution(true)
-//                    .formInstanceIdList((List<String>) ddrNew.getData())
-//                    .build(), YDConf.FORM_OPERATION.delete_batch);
-//            System.out.println("宜搭数据删除完毕!");
-//
-//        } catch (Exception e) {
-//            //记录错误数据
-//            e.printStackTrace();
-//        }
-    }
-
-
-    /**
-     * 常开
-     * 工作台数据5分钟更新一次
- */
-    @Async
-    @Scheduled(cron = "0 */5 * * * ?")
-    // @Scheduled(fixedRate = 500 )
-    public void hzmhByType() {
-        if (true) {
-            try {
-                log.info("工作台数据刷新开始!");
-                gzt_pn.getDataList();
-                log.info("工作台数据刷新结束!");
-            } catch (Exception e) {
-                // 记录错误信息
-                e.printStackTrace();
-                log.info("工作台数据异常: " + e.toString());
-            }
-        }
-    }
-
-
-    /**
-     * 常开
-     * 出差数据10分种同步到处理库
-     */
-    @Async
-    @Scheduled(fixedRate = 1000 * 60 * 10)// 1000 * 60 * 10
-    public void CCYdtoYd() {
-        if (true) {
-            try {
-                log.info("出差数据写入宜搭开始!");
-                if (true) {
-                    yd_pnServer.CCSJtoYD();
-                }
-
-                if (false) {//抓取OA数据写入宜搭,不执行
-                    String APP_EKY = "dingmpxci8bolc3jpima";
-                    String APP_SECRET = "Y_k3jpKNHbGvb9S9As2Y61ZaUFNglm7SCqquIkcowLBRoc4ZpH7DG0ZTn8LyHMwI";
-                    //派能出差PROC-83B26FB1-717C-4F64-B4C6-2869ED5C301E
-                    //外出PROC-F7955C22-C8E6-45B1-B143-5518EF04EBF0
-                    String token = ddClient.getAccessToken(APP_EKY, APP_SECRET);
-                    String access_token = "PROC-83B26FB1-717C-4F64-B4C6-2869ED5C301E";
-                    Calendar calendar = Calendar.getInstance();
-                    calendar.add(Calendar.DAY_OF_YEAR, -42); // 设置为前120天的时间
-                    long startTime = calendar.getTimeInMillis(); // 获取时间戳
-//    Calendar calendarss = Calendar.getInstance();
-//    calendarss.add(Calendar.DAY_OF_YEAR, -280); // 设置为前120天的时间
-//    long endTime = calendarss.getTimeInMillis(); // 获取时间戳
-                    long endTime = System.currentTimeMillis();
-                    Map param_post = new HashMap();
-                    // param_post.put("statuses","COMPLETED");//审批完成
-//        param_post.put("startTime",startTime);
-//        param_post.put("nextToken",nextToken);
-//        param_post.put("maxResults",maxResults);
-                    List<String> processData = (List<String>) ddClient_workflow.getInstanceIds_all(token, access_token, startTime, endTime, param_post);
-                    System.out.println(processData);
-                    if (processData != null && processData.size() > 0) {
-                        for (int i = 0; i < processData.size(); i++) {
-
-                            String sss = processData.get(i);
-                            System.out.println("正在同步派能出差第:" + i + "/" + processData.size() + " 条数据!" + sss);
-                            String obj_log = yd_pnServer.syncYD_PN(sss, "出差", "");
-
-                        }
-                    }
-                }
-
-                log.info("出差数据写入宜搭结束!");
-
-            } catch (Exception e) {
-                // 记录错误信息
-                e.printStackTrace();
-                log.info("出差数据写入宜搭异常: " + e.toString());
-            }
-        }
-    }
-
-
-//        log.info("k");
-//        System.out.println("开始同步");
-//        String APP_EKY = "dingmpxci8bolc3jpima";
-//        String APP_SECRET = "Y_k3jpKNHbGvb9S9As2Y61ZaUFNglm7SCqquIkcowLBRoc4ZpH7DG0ZTn8LyHMwI";
-//        try {//派能批量刷数据
-//            System.out.println(DateTime.now()+"!开始同步派能出差:"+"B6CwTTjOTvK8UZOXPGXhQg01291728518733");
-//            String obj_log= yd_pnServer.syncYD_PN("B6CwTTjOTvK8UZOXPGXhQg01291728518733", "出差" );
-//
-//            if (false) {
-//                //派能出差PROC-83B26FB1-717C-4F64-B4C6-2869ED5C301E
-//                //外出PROC-F7955C22-C8E6-45B1-B143-5518EF04EBF0
-//                String token = ddClient.getAccessToken(APP_EKY, APP_SECRET);
-//                String access_token = "PROC-83B26FB1-717C-4F64-B4C6-2869ED5C301E";
-//                Calendar calendar = Calendar.getInstance();
-//                calendar.add(Calendar.DAY_OF_YEAR, -10); // 设置为前120天的时间
-//                long startTime = calendar.getTimeInMillis(); // 获取时间戳
-////    Calendar calendarss = Calendar.getInstance();
-////    calendarss.add(Calendar.DAY_OF_YEAR, -280); // 设置为前120天的时间
-////    long endTime = calendarss.getTimeInMillis(); // 获取时间戳
-//                long endTime = System.currentTimeMillis();
-//                Map param_post = new HashMap();
-//                // param_post.put("statuses","COMPLETED");//审批完成
-////        param_post.put("startTime",startTime);
-////        param_post.put("nextToken",nextToken);
-////        param_post.put("maxResults",maxResults);
-//                List<String> processData = (List<String>) ddClient_workflow.getInstanceIds_all(token, access_token, startTime, endTime, param_post);
-//                System.out.println(processData);
-//                if (processData != null && processData.size() > 0) {
-//                    for (int i = 0; i < processData.size(); i++) {
-//
-//                        String sss = processData.get(i);
-//                        System.out.println("正在同步派能出差第:" + i + "/" + processData.size() + " 条数据!" + sss);
-//                         obj_log= yd_pnServer.syncYD_PN(sss, "出差" );
-//
-//                    }
-//                }
-//            }
-//            if (false) {
-//                String token = ddClient.getAccessToken(APP_EKY, APP_SECRET);
-//                String access_token = "PROC-83B26FB1-717C-4F64-B4C6-2869ED5C301E";
-//                Calendar calendar = Calendar.getInstance();
-//                calendar.add(Calendar.DAY_OF_YEAR, -241); // 设置为前120天的时间
-//                long startTime = calendar.getTimeInMillis(); // 获取时间戳
-//                Calendar calendarss = Calendar.getInstance();
-//                calendarss.add(Calendar.DAY_OF_YEAR, -121); // 设置为前120天的时间
-//                long endTime = calendarss.getTimeInMillis(); // 获取时间戳
-//                Map param_post = new HashMap();
-//                List<String> processData = (List<String>) ddClient_workflow.getInstanceIds_all(token, access_token, startTime, endTime, param_post);
-//                System.out.println(processData);
-//                if (processData != null && processData.size() > 0) {
-//                    for (int i = 0; i < processData.size(); i++) {
-//                        String sss = processData.get(i);
-//                        System.out.println("正在同步派能出差第:" + i + "/" + processData.size() + " 条数据!" + sss);
-//                          obj_log= yd_pnServer.syncYD_PN(sss, "出差" );
-//                    }
-//                }
-//            }
-//            if (false) {
-//                String token = ddClient.getAccessToken(APP_EKY, APP_SECRET);
-//                String access_token = "PROC-83B26FB1-717C-4F64-B4C6-2869ED5C301E";
-//                Calendar calendar = Calendar.getInstance();
-//                calendar.add(Calendar.DAY_OF_YEAR, -363); // 设置为前120天的时间
-//                long startTime = calendar.getTimeInMillis(); // 获取时间戳
-//                Calendar calendarss = Calendar.getInstance();
-//                calendarss.add(Calendar.DAY_OF_YEAR, -242); // 设置为前120天的时间
-//                long endTime = calendarss.getTimeInMillis(); // 获取时间戳
-//                Map param_post = new HashMap();
-//                List<String> processData = (List<String>) ddClient_workflow.getInstanceIds_all(token, access_token, startTime, endTime, param_post);
-//                System.out.println(processData);
-//                if (processData != null && processData.size() > 0) {
-//                    for (int i = 0; i < processData.size(); i++) {
-//                        String sss = processData.get(i);
-//                        System.out.println("正在同步派能出差第:" + i + "/" + processData.size() + " 条数据!" + sss);
-//                          obj_log= yd_pnServer.syncYD_PN(sss, "出差" );
-//
-//                    }
-//                }
-//            }
-//            System.out.println("同步结束");
-//        } catch (Exception e) {
-//            //记录错误信息
-//            e.printStackTrace();
-//        }
-//    }
-
-
-}

+ 0 - 69
mjava-paineng/src/main/java/com/malk/paineng/controller/DDController.java

@@ -1,69 +0,0 @@
-package com.malk.paineng.controller;
-
-import cn.hutool.core.date.DateTime;
-import cn.hutool.json.JSONObject;
-import com.alibaba.fastjson.JSON;
-import com.malk.paineng.service.YD_PN;
-import com.malk.server.aliwork.YDConf;
-import com.malk.server.aliwork.YDParam;
-import com.malk.server.common.McR;
-import com.malk.service.aliwork.YDClient;
-import com.malk.service.dingtalk.DDClient;
-import com.malk.service.dingtalk.DDClient_Workflow;
-import com.malk.utils.UtilDateTime;
-import com.malk.utils.UtilMap;
-import com.malk.utils.UtilServlet;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.map.HashedMap;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.time.Duration;
-import java.time.LocalDateTime;
-import java.util.*;
-import java.util.regex.Pattern;
-
-@Slf4j
-@RestController
-@RequestMapping("oa")
-public class DDController {
-    @Autowired
-    private YD_PN yd_pnServer;
-    @Autowired
-    private YDClient ydClient;
-
-    @PostMapping("do-approve")//钉钉OA出差单数据同步到宜搭碳排放应用
-    // public McR doApprove_PN(String processInstanceId, String type) {
-    public McR doApprove_PN(@RequestBody JSONObject obj) throws IOException {
-
-        String type = obj.get("type").toString();
-        String processInstanceId = obj.get("processInstanceId").toString();
-        if (type != "" && processInstanceId != "") {
-            if (true) {
-                Map hashMap = new HashMap();
-                hashMap.put("textField_m3wod35r", processInstanceId);//processInstanceId
-                hashMap.put("textField_m3wod35s", type);//type
-                hashMap.put("textField_m3wod35t", "未同步" );//IF
-                ydClient.operateData(YDParam.builder()
-                        .appType("APP_Z4YYJI3LG8WXWY51L4B2")
-                        .systemToken("KMC66FA18ZEQU27NCQKE3982F2JH3NF4NHM3MW2")
-                        .formUuid("FORM-8E9F37B1CCD34F708D560ED0CF59CC27TW5C")
-                        .formDataJson(JSON.toJSONString(hashMap))
-                        .build(), YDConf.FORM_OPERATION.create);
-            }
-            System.out.println(DateTime.now()   + processInstanceId+"写入宜搭待同步成功!");
-        }
-        return McR.success();
-    }
-
-
-}

+ 0 - 51
mjava-paineng/src/main/java/com/malk/paineng/controller/GZTController.java

@@ -1,51 +0,0 @@
-package com.malk.paineng.controller;
-
-import com.malk.paineng.service.GZT_PN;
-import com.malk.utils.UtilServlet;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Map;
-
-@Slf4j
-@RestController
-@RequestMapping
-public class GZTController {
-
-    @Autowired
-    private GZT_PN gzt_pn;
-
-    @PostMapping("portal/PNZX")
-    List<Map> portal_PNZX(HttpServletRequest request) {
-
-        Map data = UtilServlet.getParamMap(request);
-        log.info("工作台数据, {}", data);
-        return gzt_pn.getPortalList("派能资讯");
-    }
-    @PostMapping("portal/NLPS")
-    List<Map> portal_NLPS(HttpServletRequest request) {
-
-        Map data = UtilServlet.getParamMap(request);
-        log.info("工作台数据, {}", data);
-        return gzt_pn.getPortalList("能量派送");
-    }
-    @PostMapping("portal/RZZX")
-    List<Map> portal_RZZX(HttpServletRequest request) {
-
-        Map data = UtilServlet.getParamMap(request);
-        log.info("工作台数据, {}", data);
-        return gzt_pn.getPortalList("人资资讯");
-    }
-    @PostMapping("portal/NBZX")
-    List<Map> portal_NBZX(HttpServletRequest request) {
-
-        Map data = UtilServlet.getParamMap(request);
-        log.info("工作台数据, {}", data);
-        return gzt_pn.getPortalList("内部资讯");
-    }
-}

+ 0 - 10
mjava-paineng/src/main/java/com/malk/paineng/service/GZT_PN.java

@@ -1,10 +0,0 @@
-package com.malk.paineng.service;
-
-import java.util.List;
-import java.util.Map;
-
-public interface GZT_PN
-{
-    List<Map> getPortalList(String section);
-    void getDataList();
-}

+ 0 - 24
mjava-paineng/src/main/java/com/malk/paineng/service/YD_PN.java

@@ -1,24 +0,0 @@
-package com.malk.paineng.service;
-
-import java.io.IOException;
-import java.util.Map;
-
-public interface YD_PN {
-
-
-    //根据OA数据ID 和传过来的类型,判断往宜搭写入出差数据
-    String syncYD_PN(String processInstanceId, String type, String SSGS) throws IOException;
-
-
-    //方法syncYD_PN() 的具体实现
-      void syncYD_PN_impl(String processInstanceId, Map<String, String> compsId_main, Map<String, String> compsId_itinerary, String compId_sub_oa,String SSGS) throws IOException;
-
-
-
-    //获取工时数据 按天
-      void  syncYD_GSSJ();
-
-    void  syncYD_GSSJTOMonth();
-
-      void CCSJtoYD() throws IOException;
-}

+ 0 - 50
mjava-paineng/src/main/java/com/malk/paineng/service/ZT_PN.java

@@ -1,50 +0,0 @@
-package com.malk.paineng.service;
-
-import java.util.Map;
-
-public interface ZT_PN {
-    /**
-     * 瓦时出货量写入本地库
-     * @throws Exception
-     */
-    void  dwd_sal_ship_order_det_i() throws Exception;
-    /**
-     * 本地库瓦时出货量写入 宜搭
-     * @throws Exception
-     */
-  void  dwd_sal_ship_order_det_i_TOOA() throws Exception;
-
-
-    /**
-     * 收入毛利率分析写入本地库
-     * @throws Exception
-     */
-    void  ads_fin_gross_profit_margin_i() throws Exception;
-
-    /**
-     * 抓取销售明细入本地库
-     * @throws Exception
-     */
-    void  ads_fin_gross_profit_margin_i_XSMX() throws Exception;
-
-
-
-    /**
-     *费用明细表 写入本地库
-     * @throws Exception
-     */
-    void  ads_fina_gen_accoutbook_detail_i( ) throws Exception;
-
-    void HRUserToLC();
-
-
-    /**
-     * 采购明细写入宜搭
-     */
-    void  Purchasing_analysis( ) throws Exception;
-
-
-
-}
-
-

+ 0 - 24
mjava-paineng/src/main/java/com/malk/paineng/service/ZhongTai_All.java

@@ -1,24 +0,0 @@
-package com.malk.paineng.service;
-
-import java.util.List;
-import java.util.Map;
-
-public interface ZhongTai_All {
-
-
-
-    void  ads_hr_work_hours_sub_o( List<Map<Object, Object>> mso);
-    void  dwd_sal_ship_order_det_i( List<Map<Object, Object>> mso);
-    void  ads_fin_gross_profit_margin_i( List<Map<Object, Object>> mso);
-    void  ads_fina_gen_accoutbook_detail_i( List<Map<Object, Object>> mso);
-
-    /**
-     * 采购数据写入数据库
-     * @param mso
-     */
-    void  ads_ai_pr_allbom_cost_trend_i( List<Map<Object, Object>> mso);
-    void  ads_pr_purchase_details_o( List<Map<Object, Object>> mso);
-    void  ads_ai_pro_raw_material_i( List<Map<Object, Object>> mso);
-    void  ads_pr_application_details_i( List<Map<Object, Object>> mso);
-
-}

+ 0 - 91
mjava-paineng/src/main/java/com/malk/paineng/service/impl/GZT_PNImpl.java

@@ -1,91 +0,0 @@
-package com.malk.paineng.service.impl;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.malk.paineng.service.GZT_PN;
-import com.malk.server.aliwork.YDConf;
-import com.malk.server.aliwork.YDParam;
-import com.malk.service.aliwork.YDClient;
-import com.malk.utils.UtilDateTime;
-import com.malk.utils.UtilMap;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.stereotype.Service;
-
-import java.util.*;
-import java.util.stream.Collectors;
-
-@EnableScheduling
-@Service
-@Slf4j
-public class GZT_PNImpl implements GZT_PN {
-    private Map portal_cache = new HashMap();
-    @Autowired
-    private YDClient ydClient;
-
-    @Override
-    public List<Map> getPortalList(String section) {
-        return _portalList(section);
-    }
-
-    @Override
-    public void getDataList() {
-        try {
-
-            portal_cache = new HashMap();
-            getPortalList("派能资讯");
-            getPortalList("能量派送");
-            getPortalList("人资资讯");
-            getPortalList("内部资讯");
-//            getPortalList("规章制度");
-
-        } catch (Exception e) {
-            // 记录错误信息
-            e.printStackTrace();
-        }
-    }
-
-    private List<Map> _portalList(String type) {
-        List<Map> pList = UtilMap.getList(portal_cache, type);
-        try {
-            if (pList.isEmpty()) {
-                List<Map> dataList = (List<Map>) ydClient.queryData(YDParam.builder()
-                        .appType("APP_OM7HTYCXYQYCKJ046D9V")
-                        .systemToken("BN766KC1CS9Q2LJQDAKIN82VVUHT2J07ALF3M7R2")
-                        .formUuid("FORM-918FE77C2E8248069B7CA497C6B2E4C6XD4B")
-                        .pageSize(5)
-                        .searchFieldJson(JSONObject.toJSONString(UtilMap.map("selectField_m17kv4an", type)))
-                        .build(), YDConf.FORM_QUERY.retrieve_search_form).getData();
-
-                dataList.sort(Comparator.comparingInt(item -> UtilMap.getInt(item, "numberField_m3s6swzt"))); // 排序
-                pList = dataList.stream().map(item -> {
-                    Map formData = UtilMap.getMap(item, "formData");
-
-                    Map row = UtilMap.map("title, source, link", UtilMap.getString(formData, "textField_m17kv4aq"), UtilMap.getString(formData, "textField_m17kv4as"), UtilMap.getString(formData, "textField_m17kv4at"));
-                    long date = UtilMap.getLong(formData, "dateField_m17kv4ar");
-                    if (date > 0L) {
-                        row.put("dateTime", UtilDateTime.format(new Date(date), "yyyy-MM-dd HH:mm"));
-                    }
-                    // 图片免登处理
-                    String image = UtilMap.getString(formData, "imageField_m1abjxl0");
-                    if (StringUtils.isNotBlank(image)) {
-                        List<Map> attas = (List<Map>) JSON.parse(image);
-                        row.put("image", ydClient.convertTemporaryUrl_PN(UtilMap.getString(attas.get(0), "url")));
-                        Object image1 = row.get("image");
-                        //   System.out.println("image=========" + UtilMap.getString(attas.get(0), "url"));
-//                    System.out.println("image1========="+image1);
-                    }
-                    return row;
-                }).collect(Collectors.toList());
-                portal_cache.put(type, pList);
-            }
-        } catch (Exception e) {
-
-        }
-        log.info("type: {},list:{}", type, pList);
-        return pList;
-    }
-
-}

+ 0 - 533
mjava-paineng/src/main/java/com/malk/paineng/service/impl/YD_PNImpl.java

@@ -1,533 +0,0 @@
-package com.malk.paineng.service.impl;
-
-import cn.hutool.json.JSONObject;
-import com.alibaba.fastjson.JSON;
-import com.malk.paineng.service.YD_PN;
-import com.malk.server.aliwork.YDConf;
-import com.malk.server.aliwork.YDParam;
-import com.malk.server.dingtalk.DDR_New;
-import com.malk.service.aliwork.YDClient;
-import com.malk.service.dingtalk.DDClient;
-import com.malk.service.dingtalk.DDClient_Workflow;
-import com.malk.utils.UtilDateTime;
-import com.malk.utils.UtilMap;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections4.map.HashedMap;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.*;
-import java.nio.charset.StandardCharsets;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.util.*;
-
-
-@Slf4j
-@Service
-public class YD_PNImpl implements YD_PN {
-
-    @Autowired
-    private DDClient ddClient;
-
-    @Autowired
-    private YDClient ydClient;
-
-    @Autowired
-    private DDClient_Workflow ddClient_workflow;
-
-    @Autowired
-    private ZT_PNImpl ZT_PNImpl;
-    @Autowired
-    private ZhongTai_AllImpl ZhongTai_AllImpl;
-
-    @Override
-    public String syncYD_PN(String processInstanceId, String type, String SSGS) throws IOException {
-        if ("出差".equals(type) && processInstanceId != "") {
-            System.out.println("正在同步派能出差:" + processInstanceId + "   !!!");
-            Map<String, String> compsId_main = UtilMap.map("出差事由, 所属公司", "textareaField_lygo9owv, textField_m2sdke9h");
-            Map<String, String> compsId_itinerary = UtilMap.map("交通工具, 单程往返, 出发城市, 目的城市, 开始时间, 结束时间, 时长", "textField_m2sdke90, textField_m2sdke91, textField_m2sdke92, textField_m2sdke93, textField_m2sdke94, textField_m2sdke95, numberField_m2sdke96");
-            compsId_main.put("出差明细", "tableField_lygo9owu"); // 子表组件
-            syncYD_PN_impl(processInstanceId, compsId_main, compsId_itinerary, "itinerary", SSGS);
-        }
-        return null;
-    }
-
-    /**
-     * 派能出差数据通过钉钉连接器同步到宜搭
-     *
-     * @param processInstanceId
-     * @param compsId_main
-     * @param compsId_itinerary
-     * @param compId_sub_oa
-     * @throws IOException
-     */
-    public void syncYD_PN_impl(String processInstanceId, Map<String, String> compsId_main, Map<String, String> compsId_itinerary, String compId_sub_oa, String SSGS) throws IOException {
-        /// dingtalk——派能
-        String APP_EKY = "dingmpxci8bolc3jpima";
-        String APP_SECRET = "Y_k3jpKNHbGvb9S9As2Y61ZaUFNglm7SCqquIkcowLBRoc4ZpH7DG0ZTn8LyHMwI";
-        String token = ddClient.getAccessToken(APP_EKY, APP_SECRET);//ddtokken
-        Map processData = ddClient_workflow.getProcessInstanceId(token, processInstanceId);//通过instanceID ID获取钉钉数据
-        List<Map> formComponentValues = (List<Map>) processData.get("formComponentValues");
-        String ifagree = processData.get("result").toString();
-        String ifstatus = processData.get("status").toString();
-
-        if (ifagree.equals("agree") && ifstatus.equals("COMPLETED")) {//status为COMPLETED且result为agree时,表示审批单完结并审批通过。
-            String userId = String.valueOf(processData.get("originatorUserId"));
-            long cDate = UtilDateTime.parse(UtilMap.getString(processData, "createTime"), "yyyy-MM-dd'T'HH:mm").getTime();//chuangajin
-            LocalDateTime dateTime = LocalDateTime.ofInstant(new Date(cDate).toInstant(), ZoneId.systemDefault());
-            int nianyue = dateTime.getYear();//所属年份
-            double HCGLS = 0;//火车公里数
-            double QCGLS = 0;//汽车公里数
-            double CZCGLS = 0;//出租车公里数
-            double FJGLS = 0;//飞机单程公里数
-
-
-            Map formData = UtilMap.map("employeeField_ltxqs53k, departmentSelectField_lu20ayky, dateField_ltxqs53j, textField_lygnetw9, dateField_m3pl2xmv, textField_m4118cyp", Arrays.asList(userId), Arrays.asList(processData.get("originatorDeptId")), cDate, UtilMap.getString(processData, "businessId"), cDate, nianyue);
-            String ssgs = "";
-            if (SSGS.equals("")) {
-                Map formComp_SSGS = formComponentValues.stream().filter(item -> "所属公司".equals(item.get("name"))).findAny().get();
-                ssgs = (String) formComp_SSGS.get("value");
-            } else {
-                ssgs = SSGS;
-
-            }
-
-
-            for (String name : compsId_main.keySet()) {
-                String compId = compsId_main.get(name);
-                // 判定是否子表 [宜搭]
-                if (compId.startsWith("tableField_")) {
-                    List<Map> details = new ArrayList<>();
-                    // 兼容明细组件, 存在多条情况 [加班跨天才有有明细]
-                    Optional optional = formComponentValues.stream().filter(item -> compId_sub_oa.equals(item.get("bizAlias"))).findAny();
-                    if (!optional.isPresent()) {
-                        continue;
-                    }
-                    String schedule = UtilMap.getString((Map) optional.get(), "value");
-                    List<Map> itineraryList = ((List<Map>) JSON.parse(schedule));
-                    // 循环明细数据
-                    String dizhiA = "";
-                    String dizhiB = "";
-                    String dcwf = "";//单程往返
-                    String jtgj = "";//交通工具
-                    for (Map itinerary : itineraryList) {
-                        List<Map> rowValue = (List<Map>) itinerary.get("rowValue");
-                        Map rowData = new HashedMap();
-                        // 循环子表组件
-                        for (String subName : compsId_itinerary.keySet()) {
-                            log.info("子表字段, {}", subName);
-                            //  加班单跨天 [子表label为空]
-
-                            rowData.put(compsId_itinerary.get(subName), rowValue.stream().filter(item -> subName.equals(item.get("bizAlias")) || subName.equals(item.get("label"))).findAny().get().get("value"));
-                            if (subName.equals("出发城市")) {
-                                dizhiA = (String) rowValue.stream().filter(item -> "出发城市".equals(item.get("bizAlias")) || "出发城市".equals(item.get("label"))).findAny().get().get("value");
-                            }
-                            if (subName.equals("目的城市")) {
-                                dizhiB = (String) rowValue.stream().filter(item -> "目的城市".equals(item.get("bizAlias")) || "目的城市".equals(item.get("label"))).findAny().get().get("value");
-                            }
-                            if (subName.equals("交通工具")) {
-                                jtgj = (String) rowValue.stream().filter(item -> "交通工具".equals(item.get("bizAlias")) || "交通工具".equals(item.get("label"))).findAny().get().get("value");
-                            }
-                            if (subName.equals("单程往返")) {
-                                dcwf = (String) rowValue.stream().filter(item -> "单程往返".equals(item.get("bizAlias")) || "单程往返".equals(item.get("label"))).findAny().get().get("value");
-                            }
-                            if (jtgj.contains("其他") && subName.equals("交通工具")) {
-                                rowData.put(compsId_itinerary.get(subName), "其他");
-                                String[] parts = jtgj.split("[()]");
-                                String result = jtgj;
-                                // 提取括号内的内容(跳过第一个空字符串)
-                                if (parts.length > 1) {
-                                    result = parts[1];
-                                    System.out.println(result);  // 输出: 公车 火车
-                                }
-                                rowData.put("textField_m2wrpa40", result);
-
-                            } else {
-                                rowData.put(compsId_itinerary.get(subName), rowValue.stream().filter(item -> subName.equals(item.get("bizAlias")) || subName.equals(item.get("label"))).findAny().get().get("value"));
-                            }
-
-                        }
-
-                        double ipdiz = 0;
-                        ipdiz = getdizhibyYD(dizhiA, dizhiB);//通过表单源获取计算
-
-                        if (ipdiz == 0) {
-                            ipdiz = getdizhi(dizhiA, dizhiB);//通过API计算
-                        }
-
-
-                        double leiji = 0;
-                        double fjleiji = 0;
-                        rowData.put("numberField_m2sdke98", ipdiz);
-                        if (dcwf.equals("往返")) {
-                            rowData.put("numberField_m2wrpa42", ipdiz * 2);
-                            leiji = ipdiz * 2;
-                            fjleiji = ipdiz*2;
-                        } else {
-                            rowData.put("numberField_m2wrpa42", ipdiz);
-                            leiji = ipdiz;
-                            fjleiji = ipdiz;
-
-
-                        }
-
-
-                        if (jtgj.contains("汽车")) {
-                            QCGLS += leiji;
-                        }
-                        if (jtgj.contains("火车")) {
-                            HCGLS += leiji;
-                        }
-                        if (jtgj.contains("出租车")) {
-                            CZCGLS += leiji;
-                        }
-                        if (jtgj.contains("飞机")) {
-                            FJGLS += fjleiji;
-                        }
-                        details.add(rowData);
-                    }
-                    formData.put(compId, details);
-                    continue;
-                }
-                log.info("主表字段, {}", name);
-                // 请假套件: 开始时间 / 结束时间 / 时长 / 单位 / 请假类型
-                if ("DDHolidayField".equals(name)) {
-                    Optional optional = formComponentValues.stream().filter(item -> "DDHolidayField".equals(item.get("componentType"))).findAny();
-                    if (optional.isPresent()) {
-                        String[] ids = compId.split(" / ");
-                        List vas = (List) JSON.parse(UtilMap.getString((Map) optional.get(), "value"));
-                        for (int i = 0; i < ids.length; i++) {
-                            formData.put(ids[i], vas.get(i));
-                        }
-                    }
-                    continue;
-                }
-
-                //是否为国际差旅  为否才计算 1106先不动
-                // 成员组件, 数据处理
-                if (name.equals("所属公司") && !SSGS.equals("")){
-                    formData.put(compId, SSGS);
-                }else {
-                    Map formComp = formComponentValues.stream().filter(item -> name.equals(item.get("name"))).findAny().get();
-                    Object value = formComp.get("value");
-                    if ("InnerContactField".equals(formComp.get("componentType")) && formComp.containsKey("value")) {
-                        List<Map> empInfos = (List<Map>) JSON.parse(String.valueOf(formComp.get("extValue")));
-                        List<String> emplsId = new ArrayList<>();
-                        for (Map empInfo : empInfos) {
-                            emplsId.add(String.valueOf(empInfo.get("emplId")));
-                        }
-                        value = emplsId; // 成员多选
-                    }
-                    formData.put(compId, value);
-                }
-
-            }
-
-            // 用于审批回传
-            List<Map> tasks = UtilMap.getList(processData, "tasks");
-            formData.put("textField_lygvvyd9", tasks.get(0).get("taskId"));
-            formData.put("textField_lygvvyda", tasks.get(0).get("userId"));
-            formData.put("textField_lyh4y3th", processInstanceId);
-            formData.put("numberField_m3pl2xm6", HCGLS);
-            formData.put("numberField_m3pl2xm8", QCGLS);
-            formData.put("numberField_m3pl2xme", CZCGLS);
-            if (FJGLS > 3700) {
-                formData.put("numberField_m3pl2xmc", FJGLS);
-            } else {
-                formData.put("numberField_m3pl2xma", FJGLS);
-            }
-
-
-//            formData.put("selectField_lyo1uao4", "否"); // 出差是否报销, 否
-//            formData.put("selectField_lyo1zprd", "是"); // 同步存量数据, 否
-
-            log.info("审批数据, {}", JSON.toJSONString(formData));
-            if (ssgs.equals("上海派能")) {
-                ydClient.operateData(YDParam.builder()
-                        .appType("APP_U4GYY20ZKB7REZKT8586")
-                        .systemToken("9Z766DC19KWMUGCK7OQ8Z8UQ30YB2VVY74PYLCI3")
-                        .formUuid("FORM-E41AE15E41CA46D6A245AA1C5E7DFB15D622")
-                        .formDataJson(JSON.toJSONString(formData))
-                        .userId(userId)
-                        .build(), YDConf.FORM_OPERATION.create);
-            }
-            if (ssgs.equals("扬州派能")) {
-                ydClient.operateData(YDParam.builder()
-                        .appType("APP_LECHEG4IXU554WD3BOUB")
-                        .systemToken("5H9662C1TMHPRLFDANK0ZCOVUF4I3WOLUMB2MG")
-                        .formUuid("FORM-65EFD9616EF54386AEDE6F064BC53DE22XGG")
-                        .formDataJson(JSON.toJSONString(formData))
-                        .userId(userId)
-                        .build(), YDConf.FORM_OPERATION.create);
-            }
-            if (ssgs.equals("安徽派能能源科技有限公司") || ssgs.equals("安徽派能能源技术有限公司") || ssgs.equals("安徽派能")) {
-                ydClient.operateData(YDParam.builder()
-                        .appType("APP_IEZRE28YCR3DE8EFOMG3")
-                        .systemToken("F2766O915RHP3GY2E4K3M9PF82S92HGY8RC2M122")
-                        .formUuid("FORM-8ADBE73416E84A65ACBF2AAD81089A50HFM9")
-                        .formDataJson(JSON.toJSONString(formData))
-                        .userId(userId)
-                        .build(), YDConf.FORM_OPERATION.create);
-            }
-
-
-        }
-    }
-
-
-    /**
-     * 获取工时数据 到宜搭碳排放后台,根据公司区别
-     */
-    @Override
-    public void syncYD_GSSJ() {
-        try {
-            log.info("执行!工时数据");
-            System.out.println("执行!工时数据");
-            Map<String, String> params = new HashMap<>();
-            params.put("appId", "1");
-            params.put("tablename", "ads_hr_work_hours_sub_o");
-            params.put("schemalname", "ads");
-            params.put("connectortype", "ads_hr_total_api_i");
-            params.put("appToken", "Qu9JsOqZ9UJEgMklqr+wlLHAkaSjLCno9YIy34QpT8pG473Z2giJJwA1PZPIUSXO");
-            ZhongTai_AllImpl.sendGetRequest_ALL(params);
-            log.info("同步结束!工时数据:");
-            System.out.println("同步结束!工时数据:");
-        } catch (Exception e) {
-            log.info(e.toString());
-            System.out.println(e.toString());
-            e.printStackTrace();
-        }
-
-
-    }
-
-    public void syncYD_GSSJTOMonth() {
-        try {
-            log.info("执行!月度工时数据");
-            System.out.println("执行!月度工时数据");
-            Map<String, String> params = new HashMap<>();
-            params.put("appId", "1");
-            params.put("tablename", "ads_hr_work_hours_sum_o");
-            params.put("schemalname", "ads");
-            params.put("connectortype", "ads_hr_total_api_i");
-            params.put("appToken", "Qu9JsOqZ9UJEgMklqr+wlLHAkaSjLCno9YIy34QpT8pG473Z2giJJwA1PZPIUSXO");
-            ZhongTai_AllImpl.sendGetRequest_ALL(params);
-            log.info("同步结束!月度工时数据:");
-            System.out.println("同步结束!月度工时数据:");
-        } catch (Exception e) {
-            log.info(e.toString());
-            System.out.println(e.toString());
-            e.printStackTrace();
-        }
-
-
-    }
-
-    /**
-     * 执行抓取未处理的数据处理写入碳排放
-     */
-    @Override
-    public void CCSJtoYD() throws IOException {
-        cn.hutool.json.JSONObject searchCondition = new cn.hutool.json.JSONObject();
-        searchCondition.put("textField_m3wod35s", "出差");
-        searchCondition.put("textField_m3wod35t", "未同步");
-        List<Map> list = (List<Map>) ydClient.queryData(
-                YDParam.builder()
-                        .appType("APP_Z4YYJI3LG8WXWY51L4B2")
-                        .systemToken("KMC66FA18ZEQU27NCQKE3982F2JH3NF4NHM3MW2")
-                        .formUuid("FORM-8E9F37B1CCD34F708D560ED0CF59CC27TW5C")
-                        .searchCondition(JSON.toJSONString(searchCondition))
-                        .build(),
-                YDConf.FORM_QUERY.retrieve_list).getData();
-        if (list.size() > 0) {
-            for (Map formData : list) {
-                String formInstanceId = formData.get("formInstanceId").toString();
-                String processInstanceId = String.valueOf(UtilMap.getMap(formData, "formData").get("textField_m3wod35r"));
-                String SSGS = String.valueOf(UtilMap.getMap(formData, "formData").get("textField_m4kqfmd9"));
-                if (!processInstanceId.equals("")) {
-                    syncYD_PN(processInstanceId, "出差", SSGS);
-                    ydClient.operateData(YDParam.builder()
-                            .appType("APP_Z4YYJI3LG8WXWY51L4B2")
-                            .systemToken("KMC66FA18ZEQU27NCQKE3982F2JH3NF4NHM3MW2")
-                            .formInstanceId(String.valueOf(formInstanceId))
-                            .updateFormDataJson(JSON.toJSONString(UtilMap.map("textField_m3wod35t", "已同步")))
-                            .build(), YDConf.FORM_OPERATION.update);
-                }
-            }
-        }
-    }
-
-    /***
-     * 通过两个地址,获取两点之间距离
-     * @param STR_DZ
-     * @param END_DZ
-     * @return
-     */
-
-    private static final String GEOCODING_API_URL = "https://restapi.amap.com/v3/geocode/geo";
-
-    private static final String YOUR_AMAP_KEY = "f26ada1decb558baa08accd1a43913c5"; // 高德地图API Key yp的账号
-
-    private static final String API_KEY = "f26ada1decb558baa08accd1a43913c5";
-    private static final String GEOCODING_API = "http://api.amap.com/v3/geocode/geo?key=%s&address=%s";
-
-
-    public double getdizhi(String STR_DZ, String END_DZ) throws IOException {
-        double tt = 0;
-        try {
-            // 第一个位置获取
-            double lng_A = 0;
-            double lat_A = 0;
-//             String API_KEY = "f26ada1decb558baa08accd1a43913c5";
-//            String GEOCODING_API = "https://restapi.amap.com/v3/geocode/geo?key=%s&address=%s";
-//
-//            String apiUrl = String.format(GEOCODING_API, API_KEY, END_DZ);
-//
-//            URL url = new URL(apiUrl);
-//            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8));
-//
-//            String inputLine;
-//            StringBuilder content = new StringBuilder();
-//            while ((inputLine = in.readLine()) != null) {
-//                content.append(inputLine);
-//            }
-//            in.close();
-//
-//            // 解析JSON或者XML来获取经纬度
-//            // 示例中省略了解析过程,直接打印结果
-//            System.out.println(content.toString());
-
-            if (true) {
-                String encodedCityName = URLEncoder.encode(STR_DZ, String.valueOf(StandardCharsets.UTF_8));
-                String requestUrl = GEOCODING_API_URL + "?key=" + YOUR_AMAP_KEY + "&address=" + encodedCityName + "&city=" + encodedCityName;
-                URL url = new URL(requestUrl);
-                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-                connection.setRequestMethod("GET");
-                connection.connect();
-
-                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-                String inputLine;
-                StringBuffer content = new StringBuffer();
-                while ((inputLine = in.readLine()) != null) {
-                    content.append(inputLine);
-                }
-                in.close();
-                connection.disconnect();
-                JSONObject jsonObject = new JSONObject(content.toString());
-                if ("1".equals(jsonObject.get("status"))) {
-                    JSONObject geocodes = jsonObject.getJSONArray("geocodes").getJSONObject(0);
-                    //  String sss=geocodes.get("location").toString();
-                    lng_A = Double.parseDouble(geocodes.get("location").toString().split(",")[0]);
-                    lat_A = Double.parseDouble(geocodes.get("location").toString().split(",")[1]);
-                    System.out.println("A经度:" + lng_A + ", A纬度:" + lat_A);
-
-                } else {
-                    System.out.println("未能成功获取经纬度");
-                }
-            }
-            double lng_B = 0;
-            double lat_B = 0;
-            if (true) {
-                String encodedCityName = URLEncoder.encode(END_DZ, String.valueOf(StandardCharsets.UTF_8));
-                String requestUrl = GEOCODING_API_URL + "?key=" + YOUR_AMAP_KEY + "&address=" + encodedCityName + "&city=" + encodedCityName;
-                URL url = new URL(requestUrl);
-                HttpURLConnection connection = (HttpURLConnection) url.openConnection();
-                connection.setRequestMethod("GET");
-                connection.connect();
-                BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-                String inputLine;
-                StringBuffer content = new StringBuffer();
-                while ((inputLine = in.readLine()) != null) {
-                    content.append(inputLine);
-                }
-                in.close();
-                connection.disconnect();
-                JSONObject jsonObject = new JSONObject(content.toString());
-                if ("1".equals(jsonObject.get("status"))) {
-                    JSONObject geocodes = jsonObject.getJSONArray("geocodes").getJSONObject(0);
-                    //  String sss=geocodes.get("location").toString();
-                    lng_B = Double.parseDouble(geocodes.get("location").toString().split(",")[0]);
-                    lat_B = Double.parseDouble(geocodes.get("location").toString().split(",")[1]);
-                    System.out.println("A经度:" + lng_B + ", A纬度:" + lat_B);
-
-                } else {
-                    System.out.println("未能成功获取经纬度");
-                }
-            }
-//            double EARTH_RADIUS = 6371; // 地球半径,单位为公里
-//
-//            double latDistance = toRadians(lat_B - lat_A);
-//            double lonDistance = toRadians(lng_B - lng_A);
-//            double a = sin(latDistance / 2) * sin(latDistance / 2) +
-//                    cos(toRadians(lat_A)) * cos(toRadians(lat_B)) *
-//                            sin(lonDistance / 2) * sin(lonDistance / 2);
-//            double c = 2 * atan2(sqrt(a), sqrt(1 - a));
-//          tt= EARTH_RADIUS * c;
-
-            if (lng_A > 0 && lng_B > 0 && lat_A > 0 && lat_B > 0) {
-                double pk = 180 / 3.14169;  // 地球周长与直径的比例
-                // a1、a2、b1、b2:将纬度和经度转换为弧度后的值
-                double a1 = lat_A / pk;
-                double a2 = lng_A / pk;
-                double b1 = lat_B / pk;
-                double b2 = lng_B / pk;
-                //  t1、t2、t3:三个余弦值,用于后续计算
-                double t1 = Math.cos(a1) * Math.cos(a2) * Math.cos(b1) * Math.cos(b2);
-                double t2 = Math.cos(a1) * Math.sin(a2) * Math.cos(b1) * Math.sin(b2);
-                double t3 = Math.sin(a1) * Math.sin(b1);
-                // 两个坐标之间的距离(弧度)
-                tt = Math.acos(t1 + t2 + t3) / 1000 * 6371000;
-            }
-
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return tt;
-
-
-    }
-
-    public double getdizhibyYD(String STR_DZ, String END_DZ) {
-        double tt = 0;
-        try {
-            if (!STR_DZ.equals("") && !END_DZ.equals("")) {
-                List<Map> dataList = (List<Map>) ydClient.queryData(YDParam.builder()
-                        .appType("APP_Z4YYJI3LG8WXWY51L4B2")
-                        .systemToken("KMC66FA18ZEQU27NCQKE3982F2JH3NF4NHM3MW2")
-                        .formUuid("FORM-6340D2874C3347CA85840D2E55731FB81CZI")
-                        .searchFieldJson(JSON.toJSONString(UtilMap.map("textField_m3mhndep, textField_m3mhndeq", STR_DZ, END_DZ)))//D041P16
-                        .build(), YDConf.FORM_QUERY.retrieve_search_form).getData();
-                if (dataList != null && dataList.size() > 0) {
-                    for (Map formData : dataList) {
-                        tt = Double.parseDouble(String.valueOf(UtilMap.getMap(formData, "formData").get("numberField_m3mhnder")));
-                    }
-                }
-
-                if (tt == 0) {
-                    dataList = (List<Map>) ydClient.queryData(YDParam.builder()
-                            .appType("APP_Z4YYJI3LG8WXWY51L4B2")
-                            .systemToken("KMC66FA18ZEQU27NCQKE3982F2JH3NF4NHM3MW2")
-                            .formUuid("FORM-6340D2874C3347CA85840D2E55731FB81CZI")
-                            .searchFieldJson(JSON.toJSONString(UtilMap.map("textField_m3mhndep, textField_m3mhndeq", END_DZ, STR_DZ)))//D041P16
-                            .build(), YDConf.FORM_QUERY.retrieve_search_form).getData();
-                    if (dataList != null && dataList.size() > 0) {
-                        for (Map formData : dataList) {
-                            tt = Double.parseDouble(String.valueOf(UtilMap.getMap(formData, "formData").get("numberField_m3mhnder")));
-                        }
-                    }
-                }
-            }
-
-        } catch (Exception e) {
-
-        }
-        return tt;
-
-    }
-}

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 5504
mjava-paineng/src/main/java/com/malk/paineng/service/impl/ZT_PNImpl.java


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 1744
mjava-paineng/src/main/java/com/malk/paineng/service/impl/ZhongTai_AllImpl.java


+ 0 - 142
mjava-paineng/src/main/java/com/malk/paineng/util/HttpUtil.java

@@ -1,142 +0,0 @@
-package com.malk.paineng.util;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestTemplate;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.nio.channels.Channels;
-import java.nio.channels.ReadableByteChannel;
-import java.util.Map;
-
-/**
- * Decription:
- *
- * @author crk
- * @ClassName HttpUtil
- * @Date 2024/11/05 11:04
- */
-public class HttpUtil {
-
-    @Qualifier("permissionRestTemplate")
-   // @Autowired
-    private RestTemplate restTemplate;
-
-    public static  String get(String url){
-        RestTemplate restTemplate = new RestTemplate();
-        ResponseEntity<String> stringResponseEntity = restTemplate.getForEntity(url, String.class);
-        return stringResponseEntity.getBody();
-    }
-
-    public static String post(String url,String AcceptType,String body,Map<String,String> headersMap){
-        RestTemplate restTemplate = new RestTemplate();
-
-        HttpHeaders headers = new HttpHeaders();
-        MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
-        headers.setContentType(type);
-
-        if(AcceptType == null || AcceptType.equals("")){
-            headers.add("Accept", MediaType.APPLICATION_JSON.toString());
-        }else{
-            headers.add("Accept", AcceptType);
-        }
-        if(headersMap != null) {
-            for (String key : headersMap.keySet()) {
-                headers.add(key, headersMap.get(key));
-            }
-        }
-        //指定格式
-        HttpEntity<String> formEntity = new HttpEntity<String>(body, headers);
-        ResponseEntity<String> stringResponseEntity = null;
-        int index = 0;
-        while (true) {
-            try {
-                stringResponseEntity = restTemplate.postForEntity(url, formEntity, String.class);
-                break;
-            } catch (Exception ex) {
-                index++;
-                if(index > 2)
-                {
-                    break;
-                }
-                continue;
-            }
-        }
-        return stringResponseEntity.getBody();
-    }
-
-
-
-    public static void downloadUsingStream(String urlStr, String file) throws IOException{
-
-        URL url = new URL(urlStr);
-
-        BufferedInputStream bis = new BufferedInputStream(url.openStream());
-
-        FileOutputStream fis = new FileOutputStream(file);
-
-        byte[] buffer = new byte[1024];
-
-        int count=0;
-
-        while((count = bis.read(buffer,0,1024)) != -1)
-
-        {
-
-            fis.write(buffer, 0, count);
-
-        }
-
-        fis.close();
-
-        bis.close();
-
-    }
-
-    public static void downloadUsingNIO(String urlStr, String file) throws IOException {
-
-        URL url = new URL(urlStr);
-
-        ReadableByteChannel rbc = Channels.newChannel(url.openStream());
-
-        FileOutputStream fos = new FileOutputStream(file);
-
-        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
-
-        fos.close();
-
-        rbc.close();
-
-    }
-
-
-    public static String doPostFile2(String url, MultiValueMap<String, Object> param, File file) {
-        ResponseEntity<String> stringResponseEntity = null;
-        try {
-            HttpHeaders headers = new HttpHeaders();
-            headers.add("Accept",MediaType.APPLICATION_JSON.toString());
-            headers.setContentType(MediaType.parseMediaType("multipart/form-data;charset=UTF-8"));
-
-            FileSystemResource resource = new FileSystemResource(file);
-            param.add("img",resource);
-
-            HttpEntity<MultiValueMap<String,Object>> formEntity = new HttpEntity<>(param,headers);
-            stringResponseEntity = new RestTemplate().postForEntity(url, formEntity, String.class);
-        } catch (Exception exception) {
-            exception.printStackTrace();
-        }
-        return stringResponseEntity.getBody();
-    }
-
-
-
-}

+ 0 - 31
mjava-paineng/src/test/java/test.java

@@ -1,31 +0,0 @@
-import com.malk.paineng.Boot;
-import com.mysql.cj.x.protobuf.MysqlxExpr;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@Slf4j
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Boot.class)
-public class test {
-
-    @Test
-    public void testService(){
-        System.out.println("sdafasdfas");
-    }
-}
-//import org.apache.commons.text.similarity.LevenshteinDistance;
-//
-//public class FuzzyDistanceExample {
-//    public static void main(String[] args) {
-//        String str1 = "example";
-//        String str2 = "samples";
-//
-//
-//        int distance = LevenshteinDistance.getDefaultInstance().apply(str1, str2);
-//
-//        System.out.println("The fuzzy distance between '" + str1 + "' and '" + str2 + "' is: " + distance);
-//    }
-//}

+ 1 - 3
pom.xml

@@ -10,9 +10,7 @@
 
     <modules>
         <module>mjava</module>
-
-        <module>mjava-paineng</module>
-
+        <module>mjava-akdsbeisen</module>
     </modules>
     <packaging>pom</packaging>