jiangping
2024-07-10 0ad53b755fb839f3275940530229d4705824e7e0
修复bug
已添加3个文件
已删除1个文件
已修改6个文件
已重命名1个文件
320 ■■■■■ 文件已修改
server/admin_sys_timer/src/main/java/com/doumee/Main.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin_sys_timer/src/main/java/com/doumee/SysTimerApplication.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin_sys_timer/src/main/java/com/doumee/task/ScheduleTool.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin_sys_timer/src/main/resources/application.yml 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/core/erp/ErpTool.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/pom.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/admin_sys_timer/src/main/java/com/doumee/Main.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package com.doumee;
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}
server/admin_sys_timer/src/main/java/com/doumee/SysTimerApplication.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package com.doumee;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
/**
 * å¯åŠ¨ç±»
 * @author Eva.Caesar Liu
 * @date 2023/03/21 14:49
 */
@Slf4j
@EnableAsync
@SpringBootApplication
@MapperScan("com.doumee.dao.*")
public class SysTimerApplication {
    public static void main(String[] args) {
        ApplicationContext context = SpringApplication.run(SysTimerApplication.class);
        context.getEnvironment();
    }
}
server/admin_sys_timer/src/main/java/com/doumee/task/ScheduleTool.java
ÎļþÃû´Ó server/admin_timer/src/main/java/com/doumee/task/ScheduleCommonTool.java ÐÞ¸Ä
@@ -20,17 +20,21 @@
import java.util.Date;
/**
 * å®šæ—¶ä»»åŠ¡
 * å®šæ—¶ä»»åŠ¡ï¼ˆåºŸå¼ƒï¼‰
 * @author jiangping
 * @date 2021-10-10 14:40:35
 * https://www.bejson.com/othertools/cron/  cron è¡¨è¾¾å¼ç”Ÿæˆåœ°å€
 */
//@Component
//@EnableScheduling
public class ScheduleCommonTool {
@Component
@EnableScheduling
public class ScheduleTool {
    @Autowired
    private HkSyncParkServiceImpl hkSyncParkService;
    @Autowired
    private HkSyncImgServiceImpl hkSyncImgService;
    @Autowired
    private HkSyncEmpowerServiceImpl hkSyncEmpowerService;
    @Autowired
    private HkSyncOrgUserToHKServiceImpl hkSyncOrgUserService;
    @Autowired
@@ -61,7 +65,7 @@
     * æ¯åˆ†é’Ÿæ‹‰å–一次今日的访客预约数据
     * @throws Exception
     */
    @Scheduled(fixedRate= 30*1000)
    @Scheduled(fixedRate= 3*60*1000)
    public void syncVistAppointData() throws Exception {
        if(Constants.DEALING_FROM_HK_VISIT){
            return ;
@@ -126,6 +130,7 @@
    }
    /**
     * å®šæ—¶å†»ç»“内部人员
     */
@@ -137,7 +142,7 @@
     * æ¯å¤©æ¸…理超过一周的接口日志数据(清除和安防平台对接的接口数据)
     * @throws Exception
     */
    @Scheduled(cron= "0 0 23 * * ?")
//    @Scheduled(cron= "0 0 23 * * ?")
    public void clearThreeMonthLog() throws Exception {
        interfaceLogService.clearThreeMonthLog();
    }
server/admin_sys_timer/src/main/resources/application.yml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
# é¡¹ç›®ä¿¡æ¯é…ç½®
project:
  name: è®¿å®¢ç³»ç»Ÿ
  version: 1.0.0
  env: development
#  env: production
spring:
  #  application:
  #    name: doumeevisit
  profiles:
    active: proHS
  # JSON返回配置
  jackson:
    # é»˜è®¤æ—¶åŒº
    time-zone: GMT+8
    # é»˜è®¤æ—¥æœŸæ ¼å¼åŒ–
    date-format: yyyy-MM-dd HH:mm:ss
  servlet:
    multipart:
      max-file-size: 200MB
      max-request-size: 200MB
      enabled: true
# MyBatis配置
mybatis-plus:
  mapper-locations: classpath*:/mappers/**/*.xml
  configuration:
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# ç¼“存内容设置
cache:
  session:
    # ä¼šè¯è¿‡æœŸæ—¶é•¿(s)
    expire: 18000
  captcha:
    # éªŒè¯ç è¿‡æœŸæ—¶é•¿(s)
    expire: 300
# è·Ÿè¸ªæ—¥å¿—
trace:
  # å¼€å¯æ™ºèƒ½è·Ÿè¸ªæ¨¡å¼
  smart: true
  # æŽ’除跟踪的URL正则
  exclude-patterns: .+/list[a-zA-Z0-9\-\_]*$, .+/tree[a-zA-Z0-9\-\_]*$, .+/page[a-zA-Z0-9\-\_]*$, .+/all[a-zA-Z0-9\-\_]*$, /swagger-resources.*
# æ—¥å¿—配置
logback:
  level: INFO
  appender: ${project.env}
# dao层的日志设置为debug,方便查看sql
logging:
  level:
    com.doumee.dao: debug
knife4j:
  enable: true
  basic:
    enable: true
    username: admin
    password: 111111
# WEB服务器配置
server:
  compression:
    enabled: true
    mime-types: application/json
  port: 10031
  tomcat:
    max-swallow-size: -1
  servlet:
    session:
      timeout: PT3H  #表示12小时
server/dmvisit_admin/src/main/java/com/doumee/service/impl/HkSyncEventServiceImpl.java
@@ -1,6 +1,7 @@
package com.doumee.service.impl;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.erp.ErpTool;
import com.doumee.core.haikang.model.HKConstants;
import com.doumee.core.haikang.model.HKTools;
import com.doumee.core.haikang.model.param.BaseResponse;
@@ -34,6 +35,12 @@
    @PostConstruct
    public  int  initHkConfig(){
        ArtemisConfig.host = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HOST).getCode();
        ArtemisConfig.appKey = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPKEY).getCode();
        ArtemisConfig.appSecret = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_APPSECRET).getCode();
        HKConstants.https = systemDictDataBiz.queryByCode(Constants.HK_PARAM, Constants.HK_HTTPS).getCode();
        HKTools.interfaceLogService=interfaceLogService;
        ErpTool.interfaceLogService=interfaceLogService;
        //获取根组织编码
        getRootOrgCode();
        //开始订阅门禁事件、访客事件、和停车场事件
server/dmvisit_admin/src/main/java/com/doumee/task/ScheduleTool.java
ÎļþÒÑɾ³ý
server/dmvisit_service/src/main/java/com/doumee/core/erp/ErpTool.java
@@ -37,6 +37,7 @@
    public static  InterfaceLogService interfaceLogService;
    public void saveInterfaceLog(Object param, String path,String result,Integer type) {
        try {
        if(interfaceLogService !=null) {
            InterfaceLog interfaceLog = new InterfaceLog();
            interfaceLog.setType(type);
@@ -51,7 +52,9 @@
            interfaceLog.setUrl(path);
            interfaceLogService.create(interfaceLog);
        }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -167,7 +167,6 @@
            this.createFk(visits,true);
    }
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    void saveInterfaceLog(Object param, String path, String result, Integer type) {
        InterfaceLog interfaceLog=new InterfaceLog();
        interfaceLog.setType(type);
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/erp/ErpSyncServiceImpl.java
@@ -1167,6 +1167,7 @@
    @Override
    public void saveInterfaceLog(Object param, String path, String result, Integer type) {
        try {
        InterfaceLog interfaceLog=new InterfaceLog();
        interfaceLog.setType(type);
        interfaceLog.setCreateDate(new Date());
@@ -1179,6 +1180,10 @@
        interfaceLog.setName(path);
        interfaceLog.setUrl(path);
        interfaceLogService.create(interfaceLog);
        }catch (Exception e){
e.printStackTrace();
        }
    }
}
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -590,6 +590,7 @@
        if(!need){
            return;
        }
        try {
        InterfaceLog hkMonitoryLogDO=new InterfaceLog();
        hkMonitoryLogDO.setType(1);
        hkMonitoryLogDO.setCreateDate(new Date());
@@ -601,6 +602,10 @@
        hkMonitoryLogDO.setName(path);
        hkMonitoryLogDO.setUrl(path);
        interfaceLogMapper.insert(hkMonitoryLogDO);
        }catch (Exception e){
        }
    }
server/pom.xml
@@ -16,6 +16,7 @@
    <module>dmvisit_web</module>
    <module>openapi</module>
      <module>admin_timer</module>
      <module>admin_sys_timer</module>
  </modules>