Commit 077258eea2c482728c41d2843f1254f349be160c

Authored by 王通
1 parent 5ced9aa1

1.

src/main/java/com/bsth/CXFConfig.java
@@ -22,7 +22,6 @@ import com.bsth.server_rs.exception.AesExceptionMapper; @@ -22,7 +22,6 @@ import com.bsth.server_rs.exception.AesExceptionMapper;
22 import com.bsth.server_rs.gps.GpsRestService; 22 import com.bsth.server_rs.gps.GpsRestService;
23 import com.bsth.server_rs.info_publish.XxfbRestService; 23 import com.bsth.server_rs.info_publish.XxfbRestService;
24 import com.bsth.server_rs.logs.RealLogRestService; 24 import com.bsth.server_rs.logs.RealLogRestService;
25 -import com.bsth.server_rs.man_hours.ManHoursRestService;  
26 import com.bsth.server_rs.rate.RateService; 25 import com.bsth.server_rs.rate.RateService;
27 import com.bsth.server_rs.schedule.plan.SchedulePlanService; 26 import com.bsth.server_rs.schedule.plan.SchedulePlanService;
28 import com.bsth.server_rs.schedule.real.ScheduleRealService; 27 import com.bsth.server_rs.schedule.real.ScheduleRealService;
@@ -138,8 +137,6 @@ public class CXFConfig { @@ -138,8 +137,6 @@ public class CXFConfig {
138 private DksRestService dksRestService; 137 private DksRestService dksRestService;
139 @Autowired 138 @Autowired
140 private XxfbRestService xxfbRestService; 139 private XxfbRestService xxfbRestService;
141 - @Autowired  
142 - private ManHoursRestService manHoursRestService;  
143 140
144 @Autowired 141 @Autowired
145 private BxRestService bxRestService; 142 private BxRestService bxRestService;
@@ -175,7 +172,6 @@ public class CXFConfig { @@ -175,7 +172,6 @@ public class CXFConfig {
175 departureRestService, 172 departureRestService,
176 dksRestService, 173 dksRestService,
177 xxfbRestService, 174 xxfbRestService,
178 - manHoursRestService,  
179 bxRestService, 175 bxRestService,
180 externalRestService)); 176 externalRestService));
181 endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(), new AesExceptionMapper())); 177 endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(), new AesExceptionMapper()));
src/main/java/com/bsth/StartCommand.java
@@ -3,7 +3,6 @@ package com.bsth; @@ -3,7 +3,6 @@ package com.bsth;
3 3
4 import com.bsth.server_rs.gps.buffer.BasicDataRefreshThread; 4 import com.bsth.server_rs.gps.buffer.BasicDataRefreshThread;
5 import com.bsth.server_rs.gps.buffer.GpsRefreshThread; 5 import com.bsth.server_rs.gps.buffer.GpsRefreshThread;
6 -import com.bsth.server_rs.man_hours.ManHoursRefreshScheduler;  
7 import com.bsth.server_rs.schedule.real.thread.ExecSchDataRefreshThread; 6 import com.bsth.server_rs.schedule.real.thread.ExecSchDataRefreshThread;
8 import com.bsth.server_rs.schedule.real.thread.SchInOutDataRefreshThread; 7 import com.bsth.server_rs.schedule.real.thread.SchInOutDataRefreshThread;
9 import com.bsth.server_rs.thread.RfidCardInfoPersistenceThread; 8 import com.bsth.server_rs.thread.RfidCardInfoPersistenceThread;
@@ -35,8 +34,6 @@ public class StartCommand implements CommandLineRunner{ @@ -35,8 +34,6 @@ public class StartCommand implements CommandLineRunner{
35 GpsRefreshThread gpsRefreshThread; 34 GpsRefreshThread gpsRefreshThread;
36 @Autowired 35 @Autowired
37 BasicDataRefreshThread basicDataRefreshThread; 36 BasicDataRefreshThread basicDataRefreshThread;
38 - @Autowired  
39 - ManHoursRefreshScheduler manHoursRefreshScheduler;  
40 37
41 @Autowired 38 @Autowired
42 SystemParamService systemParamService; 39 SystemParamService systemParamService;
@@ -56,7 +53,6 @@ public class StartCommand implements CommandLineRunner{ @@ -56,7 +53,6 @@ public class StartCommand implements CommandLineRunner{
56 Application.mainServices.scheduleWithFixedDelay(gpsRefreshThread, 10, 7, TimeUnit.SECONDS); 53 Application.mainServices.scheduleWithFixedDelay(gpsRefreshThread, 10, 7, TimeUnit.SECONDS);
57 //定时刷新基础信息 54 //定时刷新基础信息
58 Application.mainServices.scheduleWithFixedDelay(basicDataRefreshThread, 30, 30, TimeUnit.MINUTES); 55 Application.mainServices.scheduleWithFixedDelay(basicDataRefreshThread, 30, 30, TimeUnit.MINUTES);
59 - manHoursRefreshScheduler.refresh();  
60 systemParamService.refresh(); 56 systemParamService.refresh();
61 } catch (Exception e) { 57 } catch (Exception e) {
62 e.printStackTrace(); 58 e.printStackTrace();
src/main/java/com/bsth/server_rs/man_hours/ManHoursRefreshScheduler.java deleted 100644 → 0
1 -package com.bsth.server_rs.man_hours;  
2 -  
3 -import com.bsth.entity.ManHours;  
4 -import org.joda.time.DateTime;  
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.jdbc.core.BeanPropertyRowMapper;  
7 -import org.springframework.jdbc.core.JdbcTemplate;  
8 -import org.springframework.scheduling.annotation.EnableScheduling;  
9 -import org.springframework.scheduling.annotation.Scheduled;  
10 -import org.springframework.stereotype.Component;  
11 -  
12 -import java.util.HashMap;  
13 -import java.util.List;  
14 -import java.util.Map;  
15 -  
16 -/**  
17 - * @author Hill  
18 - */  
19 -@Component  
20 -@EnableScheduling  
21 -public class ManHoursRefreshScheduler {  
22 -  
23 - @Autowired  
24 - private JdbcTemplate jdbcTemplate;  
25 -  
26 - @Autowired  
27 - private ManHoursRestService manHoursRestService;  
28 -  
29 - @Scheduled(cron = "0 0/25 3 * * ?")  
30 - public void refresh() {  
31 - Map<String, Float> linelp2mh = new HashMap<>();  
32 - DateTime dateTime = DateTime.now().withTime(0,0,0,0);  
33 - List<ManHours> manHoursList = jdbcTemplate.query("select d.xl xl_bm,d.lp,d.gs man_hours,e.lp_name from (SELECT DISTINCT c.xl,c.lp,c.gs FROM `bsth_c_s_sp_info` a join bsth_c_s_ttinfo b on a.tt_info = b.id join bsth_c_s_ttinfo_bx_detail c on b.id = c.ttinfo where a.schedule_date = FROM_UNIXTIME(?)) d join bsth_c_s_gbi e on d.lp = e.id",new Object[]{ dateTime.getMillis() / 1000 }, BeanPropertyRowMapper.newInstance(ManHours.class));  
34 - for (ManHours manHours : manHoursList) {  
35 - linelp2mh.put(String.format("%s_%s", manHours.getXlBm(), manHours.getLpName()), manHours.getManHours());  
36 - }  
37 - manHoursRestService.setLinelp2mh(linelp2mh);  
38 - }  
39 -}  
src/main/java/com/bsth/server_rs/man_hours/ManHoursRestService.java deleted 100644 → 0
1 -package com.bsth.server_rs.man_hours;  
2 -  
3 -import org.springframework.stereotype.Component;  
4 -  
5 -import javax.ws.rs.GET;  
6 -import javax.ws.rs.Path;  
7 -import javax.ws.rs.PathParam;  
8 -import javax.ws.rs.Produces;  
9 -import javax.ws.rs.core.MediaType;  
10 -import java.util.HashMap;  
11 -import java.util.Map;  
12 -  
13 -/**  
14 - * @author hill  
15 - * @date  
16 - */  
17 -@Component  
18 -@Path("/manHours")  
19 -@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})  
20 -public class ManHoursRestService {  
21 -  
22 - private Map<String, Float> linelp2mh = new HashMap<>();  
23 -  
24 - @GET  
25 - @Path("/{xlBm}/{lpName}")  
26 - public Float manHours(@PathParam("xlBm") String xlBm, @PathParam("lpName") String lpName) {  
27 - return linelp2mh.get(String.format("%s_%s", xlBm, lpName));  
28 - }  
29 -  
30 - public void setLinelp2mh(Map<String, Float> linelp2mh) {  
31 - this.linelp2mh = linelp2mh;  
32 - }  
33 -}