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>