Commit 3be160638fc53ae7785eeba918748b827cb7ec5b
1 parent
b903250a
1.从金蝶人事库更新人员数据逻辑优化
Showing
2 changed files
with
4 additions
and
9 deletions
src/main/java/com/bsth/handler/PersonnelUpdateHandler.java
| ... | ... | @@ -24,14 +24,9 @@ import org.springframework.transaction.TransactionStatus; |
| 24 | 24 | import org.springframework.transaction.support.DefaultTransactionDefinition; |
| 25 | 25 | |
| 26 | 26 | import javax.xml.namespace.QName; |
| 27 | -import java.net.URL; | |
| 28 | -import java.sql.Connection; | |
| 29 | 27 | import java.sql.PreparedStatement; |
| 30 | -import java.sql.ResultSet; | |
| 31 | 28 | import java.sql.SQLException; |
| 32 | -import java.util.ArrayList; | |
| 33 | 29 | import java.util.HashMap; |
| 34 | -import java.util.Iterator; | |
| 35 | 30 | import java.util.List; |
| 36 | 31 | import java.util.Map; |
| 37 | 32 | |
| ... | ... | @@ -66,7 +61,7 @@ public class PersonnelUpdateHandler { |
| 66 | 61 | } |
| 67 | 62 | |
| 68 | 63 | @Scheduled(cron = "0 0 4-23 * * *") |
| 69 | - public void sync(String s) { | |
| 64 | + public void sync() { | |
| 70 | 65 | final Map<String, String> unit2company = new HashMap<>(4); |
| 71 | 66 | unit2company.put("KD01.0110", "55-上南公司"); |
| 72 | 67 | unit2company.put("KD01.0111", "22-金高公司"); | ... | ... |
src/main/java/com/bsth/thread/PersonnelUpdateThread.java
| 1 | 1 | package com.bsth.thread; |
| 2 | 2 | |
| 3 | -import com.bsth.handler.personnelUpdateHandler; | |
| 3 | +import com.bsth.handler.PersonnelUpdateHandler; | |
| 4 | 4 | import org.slf4j.Logger; |
| 5 | 5 | import org.slf4j.LoggerFactory; |
| 6 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -16,14 +16,14 @@ import org.springframework.stereotype.Component; |
| 16 | 16 | @Component |
| 17 | 17 | public class PersonnelUpdateThread extends Thread { |
| 18 | 18 | @Autowired |
| 19 | - personnelUpdateHandler personnelUpdateHandler; | |
| 19 | + PersonnelUpdateHandler personnelUpdateHandler; | |
| 20 | 20 | |
| 21 | 21 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 22 | 22 | |
| 23 | 23 | @Override |
| 24 | 24 | public void run() { |
| 25 | 25 | try { |
| 26 | - personnelUpdateHandler.sync(""); | |
| 26 | + personnelUpdateHandler.sync(); | |
| 27 | 27 | } catch (Exception e) { |
| 28 | 28 | logger.error("", e); |
| 29 | 29 | } | ... | ... |