Commit f2619bc31d11df3b22598207c577bc6773f75c48
1 parent
d7b15c11
update...
Showing
2 changed files
with
8 additions
and
2 deletions
src/main/java/com/bsth/server_ws/WebServiceProxy.java
| @@ -6,8 +6,9 @@ import com.bsth.Application; | @@ -6,8 +6,9 @@ import com.bsth.Application; | ||
| 6 | import com.bsth.entity.Line2System; | 6 | import com.bsth.entity.Line2System; |
| 7 | import com.bsth.old_sys_wsclient.nh_ld.ClsLDInfo; | 7 | import com.bsth.old_sys_wsclient.nh_ld.ClsLDInfo; |
| 8 | import com.bsth.repository.Line2SystemRepository; | 8 | import com.bsth.repository.Line2SystemRepository; |
| 9 | -import com.bsth.util.ConvertUtil; | ||
| 10 | import com.bsth.server_ws.waybill.entity.NH_waybill; | 9 | import com.bsth.server_ws.waybill.entity.NH_waybill; |
| 10 | +import com.bsth.service.Line2SystemService; | ||
| 11 | +import com.bsth.util.ConvertUtil; | ||
| 11 | import com.google.common.collect.ArrayListMultimap; | 12 | import com.google.common.collect.ArrayListMultimap; |
| 12 | import org.apache.commons.lang3.StringUtils; | 13 | import org.apache.commons.lang3.StringUtils; |
| 13 | import org.slf4j.Logger; | 14 | import org.slf4j.Logger; |
| @@ -199,7 +200,11 @@ public class WebServiceProxy implements CommandLineRunner { | @@ -199,7 +200,11 @@ public class WebServiceProxy implements CommandLineRunner { | ||
| 199 | } | 200 | } |
| 200 | } | 201 | } |
| 201 | 202 | ||
| 203 | + @Autowired | ||
| 204 | + Line2SystemService line2SystemService; | ||
| 205 | + | ||
| 202 | public void refreshData() { | 206 | public void refreshData() { |
| 207 | + line2SystemService.loadByLineInfo(); | ||
| 203 | List<Map<String, Object>> list = jdbcTemplate.queryForList("select p.JOB_CODE,L.LINE_CODE from bsth_c_s_ecinfo c left join bsth_c_personnel p on c.jsy=p.id left join bsth_c_line L on c.xl=L.id where c.is_cancel=0 "); | 208 | List<Map<String, Object>> list = jdbcTemplate.queryForList("select p.JOB_CODE,L.LINE_CODE from bsth_c_s_ecinfo c left join bsth_c_personnel p on c.jsy=p.id left join bsth_c_line L on c.xl=L.id where c.is_cancel=0 "); |
| 204 | Map<String, String> plMap = new HashMap<>(); | 209 | Map<String, String> plMap = new HashMap<>(); |
| 205 | for (Map<String, Object> map : list) { | 210 | for (Map<String, Object> map : list) { |
src/main/java/com/bsth/service/impl/Line2SystemServiceImpl.java
| @@ -36,6 +36,7 @@ public class Line2SystemServiceImpl implements Line2SystemService { | @@ -36,6 +36,7 @@ public class Line2SystemServiceImpl implements Line2SystemService { | ||
| 36 | @Override | 36 | @Override |
| 37 | public void loadByLineInfo() { | 37 | public void loadByLineInfo() { |
| 38 | List<Line2System> list = line2SystemRepository.loadByLineInfo(); | 38 | List<Line2System> list = line2SystemRepository.loadByLineInfo(); |
| 39 | - line2SystemRepository.save(list); | 39 | + if(list != null && list.size() > 0) |
| 40 | + line2SystemRepository.save(list); | ||
| 40 | } | 41 | } |
| 41 | } | 42 | } |