Commit ef38926da1f8bd183519095844365e20e4a14e74

Authored by ljq
1 parent 02439161

删除部分文件初始化

Showing 45 changed files with 43 additions and 4595 deletions

Too many changes to show.

To preserve performance only 45 of 369 files are displayed.

src/main/java/com/bsth/XDApplication.java
... ... @@ -18,7 +18,6 @@ import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread;
18 18 import com.bsth.data.schedule.edit_logs.SeiPstThread;
19 19 import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
20 20 import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;
21   -import com.bsth.data.schedule.thread.CalcOilThread;
22 21 import com.bsth.data.schedule.thread.SchedulePstThread;
23 22 import com.bsth.data.schedule.thread.ScheduleRefreshThread;
24 23 import com.bsth.data.schedule.thread.SubmitToTrafficManage;
... ... @@ -55,8 +54,6 @@ public class XDApplication implements CommandLineRunner {
55 54 @Autowired
56 55 SubmitToTrafficManage submitToTrafficManage;
57 56 @Autowired
58   - CalcOilThread calcOilThread;
59   - @Autowired
60 57 DirectivesPstThread directivesPstThread;
61 58 @Autowired
62 59 ThreadMonotor threadMonotor;
... ... @@ -139,16 +136,16 @@ public class XDApplication implements CommandLineRunner {
139 136 //dayOfSchedule.dataRecovery();
140 137  
141 138 //安全驾驶
142   - sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
  139 + //sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
143 140  
144 141 /** 线调业务 */
145   - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
  142 + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 1, 120, TimeUnit.SECONDS);//班次更新线程
146 143 sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
147   - sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
148   - sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
  144 + //sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
  145 + //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
149 146 sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
150 147  
151   - sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
  148 + //sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
152 149 sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
153 150 sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
154 151 sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
... ... @@ -168,8 +165,6 @@ public class XDApplication implements CommandLineRunner {
168 165 //运管处静态数据提交
169 166 //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
170 167 //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
171   - //计算油、公里加注
172   - sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
173 168  
174 169 //线路版本更新
175 170 sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
... ... @@ -210,13 +205,11 @@ public class XDApplication implements CommandLineRunner {
210 205 sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
211 206  
212 207 //运管处静态数据提交
213   - log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
214   - sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
215   - //计算油、公里加注
216   - sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  208 + // log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
  209 + // sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
217 210  
218 211 //线路版本更新
219   - sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
  212 + // sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
220 213  
221 214 //线路版本更新
222 215 //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
... ... @@ -231,10 +224,10 @@ public class XDApplication implements CommandLineRunner {
231 224 GpsDataLoaderThread.setFlag(-1);
232 225 //dayOfSchedule.dataRecovery();
233 226 /** 线调业务 */
234   - sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
235   - sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
236   - sexec.scheduleWithFixedDelay(gpsDataLoader, 0, 2, TimeUnit.SECONDS);//抓取GPS数据
237   - sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
  227 + //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
  228 + //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
  229 + //sexec.scheduleWithFixedDelay(gpsDataLoader, 0, 2, TimeUnit.SECONDS);//抓取GPS数据
  230 + //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
238 231 sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
239 232  
240 233 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
... ... @@ -257,8 +250,6 @@ public class XDApplication implements CommandLineRunner {
257 250 //运管处静态数据提交
258 251 //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
259 252 //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
260   - //计算油、公里加注
261   - sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
262 253  
263 254 //线路版本更新
264 255 sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
... ...
src/main/java/com/bsth/controller/ddexam/DdexamController.java 0 → 100644
  1 +package com.bsth.controller.ddexam;
  2 +
  3 +import com.bsth.service.ddexam.DdexamService;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RequestParam;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +@RestController
  10 +@RequestMapping("ddexam")
  11 +public class DdexamController {
  12 + @Autowired
  13 + DdexamService ddexamService;
  14 +
  15 + //初始化
  16 + @RequestMapping("initialization")
  17 + public int initializationAll(@RequestParam Integer rs){
  18 + return ddexamService.initializationAll(rs);
  19 + }
  20 +}
... ...
src/main/java/com/bsth/controller/excep/AbnormalController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.util.HashMap;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.ResponseBody;
11   -import org.springframework.web.bind.annotation.RestController;
12   -
13   -import com.bsth.controller.BaseController;
14   -import com.bsth.entity.excep.Abnormal;
15   -import com.bsth.entity.sys.SysUser;
16   -import com.bsth.service.excep.AbnormalService;
17   -import com.bsth.util.PageObject;
18   -
19   -@RestController
20   -@RequestMapping("abnormal")
21   -public class AbnormalController extends BaseController<SysUser, Integer>{
22   - @Autowired
23   - private AbnormalService abnormalService;
24   -
25   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
26   - public PageObject<Abnormal> pagequery(@RequestParam Map<String, Object> map){
27   - PageObject<Abnormal> pageObject = null;
28   - map.put("curPage", map.get("page").toString());
29   - map.put("pageData","10");
30   - pageObject=abnormalService.Pagequery(map);
31   - return pageObject;
32   -
33   - }
34   -
35   -
36   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
37   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
38   - Map<String, Object> modelMap = new HashMap<String, Object>();
39   - try {
40   - map.put("isShow", 1);
41   -// modelMap = offlineService.getReport(map);
42   - } catch (Exception e) {
43   - e.printStackTrace();
44   - }
45   - return modelMap;
46   - }
47   -
48   -
49   -}
src/main/java/com/bsth/controller/excep/NowAbnormalController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.util.HashMap;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.RestController;
11   -
12   -import com.bsth.controller.BaseController;
13   -import com.bsth.entity.excep.Abnormal;
14   -import com.bsth.entity.sys.SysUser;
15   -import com.bsth.service.excep.NowAbnormalService;
16   -import com.bsth.util.PageObject;
17   -
18   -@RestController
19   -@RequestMapping("nowabnormal")
20   -public class NowAbnormalController extends BaseController<SysUser, Integer>{
21   - @Autowired
22   - private NowAbnormalService nowAbnormalService;
23   -
24   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
25   - public PageObject<Abnormal> pagequery(@RequestParam Map<String, Object> map){
26   - PageObject<Abnormal> pageObject = null;
27   - map.put("curPage", map.get("page").toString());
28   - map.put("pageData","10");
29   - pageObject=nowAbnormalService.Pagequery(map);
30   - return pageObject;
31   -
32   - }
33   -
34   -
35   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
36   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
37   - Map<String, Object> modelMap = new HashMap<String, Object>();
38   - try {
39   - map.put("isShow", 1);
40   -// modelMap = offlineService.getReport(map);
41   - } catch (Exception e) {
42   - e.printStackTrace();
43   - }
44   - return modelMap;
45   - }
46   -
47   -
48   -}
src/main/java/com/bsth/controller/excep/NowOfflineController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.util.HashMap;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.RestController;
11   -
12   -import com.bsth.controller.BaseController;
13   -import com.bsth.entity.excep.Offline;
14   -import com.bsth.entity.sys.SysUser;
15   -import com.bsth.service.excep.NowOfflineService;
16   -import com.bsth.util.PageObject;
17   -
18   -@RestController
19   -@RequestMapping("nowoffline")
20   -public class NowOfflineController extends BaseController<SysUser, Integer>{
21   - @Autowired
22   - private NowOfflineService nowOfflineService;
23   -
24   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
25   - public PageObject<Offline> pagequery(@RequestParam Map<String, Object> map){
26   - PageObject<Offline> pageObject = null;
27   - map.put("curPage", map.get("page").toString());
28   - map.put("pageData","10");
29   - pageObject=nowOfflineService.Pagequery(map);
30   - return pageObject;
31   -
32   - }
33   -
34   -
35   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
36   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
37   - Map<String, Object> modelMap = new HashMap<String, Object>();
38   - try {
39   - map.put("isShow", 1);
40   - modelMap = nowOfflineService.getReport(map);
41   - } catch (Exception e) {
42   - e.printStackTrace();
43   - }
44   - return modelMap;
45   - }
46   -
47   -
48   -}
src/main/java/com/bsth/controller/excep/NowOutboundController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.text.ParseException;
4   -import java.util.HashMap;
5   -import java.util.List;
6   -import java.util.Map;
7   -
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RequestParam;
12   -import org.springframework.web.bind.annotation.RestController;
13   -
14   -import com.bsth.controller.BaseController;
15   -import com.bsth.data.BasicData;
16   -import com.bsth.entity.excep.Outbound;
17   -import com.bsth.entity.excep.Speeding;
18   -import com.bsth.entity.sys.SysUser;
19   -import com.bsth.service.excep.NowOutboundService;
20   -import com.bsth.util.PageObject;
21   -
22   -@RestController
23   -@RequestMapping("nowbound")
24   -public class NowOutboundController extends BaseController<SysUser, Integer>{
25   - @Autowired
26   - private NowOutboundService nowOutboundService;
27   -
28   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
29   - public PageObject<Outbound> pagequery(@RequestParam Map<String, Object> map){
30   - PageObject<Outbound> pageObject = null;
31   - map.put("curPage", map.get("page").toString());
32   - map.put("pageData","10");
33   - pageObject=nowOutboundService.Pagequery(map);
34   - return pageObject;
35   -
36   - }
37   -
38   -
39   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
40   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
41   - Map<String, Object> modelMap = new HashMap<String, Object>();
42   - try {
43   - map.put("isShow", 1);
44   - modelMap = nowOutboundService.getReport(map);
45   - } catch (Exception e) {
46   - e.printStackTrace();
47   - }
48   - return modelMap;
49   - }
50   -
51   - @RequestMapping(value = "/findPosition", method = RequestMethod.GET)
52   - public List<Outbound> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
53   - String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
54   - List<Outbound> listOutbound = nowOutboundService.findPosition(deviceid,startdate,enddate);
55   - return listOutbound;
56   - }
57   -
58   -}
src/main/java/com/bsth/controller/excep/NowSpeedingController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.text.ParseException;
4   -import java.util.HashMap;
5   -import java.util.List;
6   -import java.util.Map;
7   -
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RequestParam;
12   -import org.springframework.web.bind.annotation.RestController;
13   -
14   -import com.bsth.controller.BaseController;
15   -import com.bsth.data.BasicData;
16   -import com.bsth.entity.excep.Speeding;
17   -import com.bsth.entity.sys.SysUser;
18   -import com.bsth.service.excep.NowSpeedingService;
19   -import com.bsth.util.PageObject;
20   -
21   -@RestController
22   -@RequestMapping("nowspeeding")
23   -public class NowSpeedingController extends BaseController<SysUser, Integer>{
24   -
25   - @Autowired
26   - private NowSpeedingService nowSpeedingService;
27   -
28   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
29   - public PageObject<Speeding> pagequery(@RequestParam Map<String, Object> map){
30   - PageObject<Speeding> pageObject = null;
31   - map.put("curPage", map.get("page").toString());
32   - map.put("pageData","10");
33   - pageObject=nowSpeedingService.Pagequery(map);
34   - return pageObject;
35   - }
36   -
37   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
38   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
39   - Map<String, Object> modelMap = new HashMap<String, Object>();
40   - try {
41   - map.put("isShow", 1);
42   - modelMap = nowSpeedingService.getReport(map);
43   - } catch (Exception e) {
44   - e.printStackTrace();
45   - }
46   - return modelMap;
47   - }
48   -
49   - @RequestMapping(value = "/findPosition", method = RequestMethod.GET)
50   - public List<Speeding> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
51   - String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
52   - List<Speeding> listSpeeding = nowSpeedingService.findPosition(deviceid,startdate,enddate);
53   - return listSpeeding;
54   - }
55   -
56   -}
src/main/java/com/bsth/controller/excep/OfflineController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.util.HashMap;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.ResponseBody;
11   -import org.springframework.web.bind.annotation.RestController;
12   -
13   -import com.bsth.controller.BaseController;
14   -import com.bsth.entity.excep.Offline;
15   -import com.bsth.entity.sys.SysUser;
16   -import com.bsth.service.excep.OfflineService;
17   -import com.bsth.util.PageObject;
18   -
19   -@RestController
20   -@RequestMapping("offline")
21   -public class OfflineController extends BaseController<SysUser, Integer>{
22   - @Autowired
23   - private OfflineService offlineService;
24   -
25   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
26   - public PageObject<Offline> pagequery(@RequestParam Map<String, Object> map){
27   - PageObject<Offline> pageObject = null;
28   - map.put("curPage", map.get("page").toString());
29   - map.put("pageData","10");
30   - pageObject=offlineService.Pagequery(map);
31   - return pageObject;
32   -
33   - }
34   -
35   -
36   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
37   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
38   - Map<String, Object> modelMap = new HashMap<String, Object>();
39   - try {
40   - map.put("isShow", 1);
41   - modelMap = offlineService.getReport(map);
42   - } catch (Exception e) {
43   - e.printStackTrace();
44   - }
45   - return modelMap;
46   - }
47   -
48   -
49   -}
src/main/java/com/bsth/controller/excep/OutboundController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.util.HashMap;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.RestController;
11   -
12   -import com.bsth.controller.BaseController;
13   -import com.bsth.entity.excep.Outbound;
14   -import com.bsth.entity.sys.SysUser;
15   -import com.bsth.service.excep.OutboundService;
16   -import com.bsth.util.PageObject;
17   -
18   -@RestController
19   -@RequestMapping("bound")
20   -public class OutboundController extends BaseController<SysUser, Integer>{
21   - @Autowired
22   - private OutboundService outboundService;
23   -
24   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
25   - public PageObject<Outbound> pagequery(@RequestParam Map<String, Object> map){
26   - PageObject<Outbound> pageObject = null;
27   - map.put("curPage", map.get("page").toString());
28   - map.put("pageData","10");
29   - pageObject=outboundService.Pagequery(map);
30   - return pageObject;
31   -
32   - }
33   -
34   -
35   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
36   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
37   - Map<String, Object> modelMap = new HashMap<String, Object>();
38   - try {
39   - map.put("isShow", 1);
40   - modelMap = outboundService.getReport(map);
41   - } catch (Exception e) {
42   - e.printStackTrace();
43   - }
44   - return modelMap;
45   - }
46   -
47   -
48   -}
src/main/java/com/bsth/controller/excep/SpeedingController.java deleted 100644 → 0
1   -package com.bsth.controller.excep;
2   -
3   -import java.text.ParseException;
4   -import java.util.HashMap;
5   -import java.util.List;
6   -import java.util.Map;
7   -
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RequestParam;
12   -import org.springframework.web.bind.annotation.RestController;
13   -
14   -import com.bsth.controller.BaseController;
15   -import com.bsth.data.BasicData;
16   -import com.bsth.entity.excep.Speeding;
17   -import com.bsth.entity.sys.SysUser;
18   -import com.bsth.service.excep.SpeedingService;
19   -import com.bsth.util.PageObject;
20   -
21   -@RestController
22   -@RequestMapping("speeding")
23   -public class SpeedingController extends BaseController<SysUser, Integer>{
24   - @Autowired
25   - private SpeedingService speedingService;
26   -
27   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
28   - public PageObject<Speeding> pagequery(@RequestParam Map<String, Object> map){
29   - PageObject<Speeding> pageObject = null;
30   - map.put("curPage", map.get("page").toString());
31   - map.put("pageData","10");
32   - pageObject=speedingService.Pagequery(map);
33   - return pageObject;
34   - }
35   -
36   - @RequestMapping(value = "/getReport", method = RequestMethod.POST)
37   - public Map<String, Object> getReport(@RequestParam Map<String, Object> map) {
38   - Map<String, Object> modelMap = new HashMap<String, Object>();
39   - try {
40   - map.put("isShow", 1);
41   - modelMap = speedingService.getReport(map);
42   - } catch (Exception e) {
43   - e.printStackTrace();
44   - }
45   - return modelMap;
46   - }
47   -
48   - @RequestMapping(value = "/findPosition", method = RequestMethod.GET)
49   - public List<Speeding> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
50   - String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
51   - List<Speeding> listSpeeding = speedingService.findPosition(deviceid,startdate,enddate);
52   - return listSpeeding;
53   - }
54   -
55   -}
src/main/java/com/bsth/controller/forms/ExportController.java deleted 100644 → 0
1   -package com.bsth.controller.forms;
2   -
3   -import java.text.SimpleDateFormat;
4   -import java.util.ArrayList;
5   -import java.util.HashMap;
6   -import java.util.Iterator;
7   -import java.util.List;
8   -import java.util.Map;
9   -
10   -import org.springframework.beans.factory.annotation.Autowired;
11   -import org.springframework.web.bind.annotation.RequestMapping;
12   -import org.springframework.web.bind.annotation.RequestMethod;
13   -import org.springframework.web.bind.annotation.RequestParam;
14   -import org.springframework.web.bind.annotation.RestController;
15   -
16   -import com.bsth.data.BasicData;
17   -import com.bsth.entity.mcy_forms.Allline;
18   -import com.bsth.entity.mcy_forms.Changetochange;
19   -import com.bsth.entity.mcy_forms.Daily;
20   -import com.bsth.entity.mcy_forms.Executionrate;
21   -import com.bsth.entity.mcy_forms.Linepasswengerflow;
22   -import com.bsth.entity.mcy_forms.Operationservice;
23   -import com.bsth.entity.mcy_forms.Shifday;
24   -import com.bsth.entity.mcy_forms.Shiftuehiclemanth;
25   -import com.bsth.entity.mcy_forms.Singledata;
26   -import com.bsth.entity.mcy_forms.Turnoutrate;
27   -import com.bsth.entity.mcy_forms.Vehicleloading;
28   -import com.bsth.entity.mcy_forms.Waybillday;
29   -import com.bsth.service.forms.ExportService;
30   -import com.bsth.service.forms.FormsService;
31   -import com.bsth.util.Arith;
32   -import com.bsth.util.ReportUtils;
33   -
34   -@RestController
35   -@RequestMapping("mcy_export")
36   -public class ExportController {
37   -
38   -
39   - @Autowired
40   - FormsService formsService;
41   -
42   - @Autowired
43   - ExportService exportService;
44   -
45   - // 行车路单日报表
46   - @RequestMapping(value = "/waybilldayExport", method = RequestMethod.POST)
47   - public List<Waybillday> waybilldayExport(@RequestParam Map<String, Object> map) {
48   - List<Waybillday> waybillday = formsService.waybillday(map);
49   - exportService.waybillday(map.get("date").toString(),
50   - map.get("lineName").toString(), waybillday);
51   - return waybillday;
52   - }
53   -
54   - // 线路客流量报表
55   - @RequestMapping(value = "/linepasswengerflowExport", method = RequestMethod.POST)
56   - public List<Map<String, Object>> linepasswengerflowExport(@RequestParam Map<String, Object> map) {
57   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
58   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
59   - ReportUtils ee = new ReportUtils();
60   - List<Linepasswengerflow> linepasswengerflow = formsService.linepasswengerflow(map);
61   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
62   - int i = 1;
63   - for (Linepasswengerflow l : linepasswengerflow) {
64   - Map<String, Object> m = new HashMap<String, Object>();
65   - m.put("i", i);
66   - m.put("stationName", l.getStationName());
67   - m.put("1", " ");
68   - m.put("2", " ");
69   - resList.add(m);
70   - i++;
71   - }
72   -
73   -
74   -
75   - try {
76   - listI.add(resList.iterator());
77   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
78   - ee.excelReplace(listI, new Object[] { map }, path + "mould/linepasswengerflow.xls",
79   - path + "export/线路客流量报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
80   - } catch (Exception e) {
81   - e.printStackTrace();
82   - }
83   - return resList;
84   - }
85   -
86   - // 班次车辆人员日统计
87   - @RequestMapping(value = "/shifdayExport", method = RequestMethod.GET)
88   - public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) {
89   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
90   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
91   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
92   - Map<String, Object> map2 = new HashMap<String, Object>();
93   - ReportUtils ee = new ReportUtils();
94   - List<Shifday> shifday = formsService.shifday(map);
95   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
96   - for (Shifday l : shifday) {
97   - Map<String, Object> m = new HashMap<String, Object>();
98   - m.put("jName", l.getjName());
99   - m.put("sName", l.getsName());
100   - m.put("lpName", l.getLpName());
101   - m.put("carPlate", l.getCarPlate());
102   - m.put("jhlc", l.getJhlc());
103   - m.put("sjjhlc", l.getSjjhlc());
104   - m.put("yygl", l.getYygl());
105   - m.put("emptMileage", l.getEmptMileage());
106   - m.put("remMileage", l.getRemMileage());
107   - m.put("addMileage", l.getAddMileage());
108   - m.put("totalm", l.getTotalm());
109   - m.put("jhbc", l.getJhbc());
110   - m.put("sjjhbc", l.getSjjhbc());
111   - m.put("cjbc", l.getCjbc());
112   - m.put("ljbc", l.getLjbc());
113   - m.put("sjbc", l.getSjbc());
114   - resList.add(m);
115   - }
116   - if(resList.size() > 0){
117   - map2 = resList.get(resList.size() - 1);
118   - resList.remove(map2);
119   - }
120   -
121   - try {
122   - String lineName = "";
123   - if(map.containsKey("lineName"))
124   - lineName = map.get("lineName").toString();
125   - listI.add(resList.iterator());
126   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
127   - ee.excelReplace(listI, new Object[] { map2 }, path + "mould/shifday.xls",
128   - path + "export/" + sdfSimple.format(sdfMonth.parse(map.get("date").toString()))
129   - + "-" + lineName + "-班次车辆人员日报表.xls");
130   - } catch (Exception e) {
131   - e.printStackTrace();
132   - }
133   - return resList;
134   - }
135   -
136   - // 班次车辆人员月统计
137   - @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.GET)
138   - public List<Map<String, Object>> shiftuehiclemanthExport(@RequestParam Map<String, Object> map) {
139   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
140   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
141   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
142   - ReportUtils ee = new ReportUtils();
143   - List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth(map);
144   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
145   - int i = 1;
146   - for (Shiftuehiclemanth l : shiftuehiclemanth) {
147   - Map<String, Object> m = new HashMap<String, Object>();
148   - m.put("i", i);
149   - m.put("jName", l.getjName());
150   - m.put("jhlc", l.getJhlc());
151   - m.put("emptMileage", l.getEmptMileage());
152   - m.put("remMileage", l.getRemMileage());
153   - m.put("addMileage", l.getAddMileage());
154   - m.put("totalm", l.getTotalm());
155   - m.put("cjbc", l.getCjbc());
156   - m.put("ljbc", l.getLjbc());
157   - m.put("sjbc", l.getSjbc());
158   - resList.add(m);
159   - i++;
160   - }
161   -
162   - try {
163   - String mouldurl = null, lineName = "", dateTime = ""
164   - , startDate = "", endDate = "";
165   - if(map.containsKey("lineName"))
166   - lineName = map.get("lineName").toString();
167   - if(map.containsKey("startDate"))
168   - startDate = map.get("startDate").toString();
169   - if(map.containsKey("endDate"))
170   - endDate = map.get("endDate").toString();
171   - if(startDate.equals(endDate)){
172   - dateTime = sdfSimple.format(sdfMonth.parse(startDate));
173   - } else {
174   - dateTime = sdfSimple.format(sdfMonth.parse(startDate))
175   - +"-"+sdfSimple.format(sdfMonth.parse(endDate));
176   - }
177   - if(map.get("empnames").equals("驾驶员")){
178   - mouldurl="mould/shiftuehiclemanth.xls";
179   - }else if(map.get("empnames").equals("售票员")){
180   - mouldurl="mould/shiftuehiclemanthspy.xls";
181   - }else if(map.get("empnames").equals("车辆自编号")){
182   - mouldurl="mould/shiftuehiclemanthclzbh.xls";
183   - }
184   - listI.add(resList.iterator());
185   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
186   - ee.excelReplace(listI, new Object[] { map }, path +mouldurl,
187   - path + "export/" + dateTime + "-" + lineName + "-班次车辆人员月报表.xls");
188   - } catch (Exception e) {
189   - e.printStackTrace();
190   - }
191   -
192   - return resList;
193   - }
194   -
195   - // 班次车辆人员月统计
196   - @RequestMapping(value = "/shiftuehiclemanthExport2", method = RequestMethod.GET)
197   - public List<Map<String, Object>> shiftuehiclemanthExport2(@RequestParam Map<String, Object> map) {
198   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
199   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
200   - ReportUtils ee = new ReportUtils();
201   - List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth2(map);
202   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
203   - int i = 1;
204   - for (Shiftuehiclemanth l : shiftuehiclemanth) {
205   - Map<String, Object> m = new HashMap<String, Object>();
206   - m.put("i", i);
207   - m.put("jName", l.getjName());
208   - m.put("jhlc", l.getJhlc());
209   - m.put("emptMileage", l.getEmptMileage());
210   - m.put("remMileage", l.getRemMileage());
211   - m.put("addMileage", l.getAddMileage());
212   - m.put("totalm", l.getTotalm());
213   - m.put("cjbc", l.getCjbc());
214   - m.put("ljbc", l.getLjbc());
215   - m.put("sjbc", l.getSjbc());
216   - resList.add(m);
217   - i++;
218   - }
219   -
220   - try {
221   - String mouldurl = null;
222   - if(map.get("empnames").equals("驾驶员")){
223   - mouldurl="mould/shiftuehiclemanth.xls";
224   - }else if(map.get("empnames").equals("售票员")){
225   - mouldurl="mould/shiftuehiclemanthspy.xls";
226   - }else if(map.get("empnames").equals("车辆自编号")){
227   - mouldurl="mould/shiftuehiclemanthclzbh.xls";
228   - }
229   - listI.add(resList.iterator());
230   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
231   - ee.excelReplace(listI, new Object[] { map }, path +mouldurl,
232   - path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
233   - } catch (Exception e) {
234   - e.printStackTrace();
235   - }
236   -
237   - return resList;
238   - }
239   -
240   - // 路单数据报表
241   - @RequestMapping(value = "/singledataExport", method = RequestMethod.GET)
242   - public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map) {
243   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
244   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
245   - ReportUtils ee = new ReportUtils();
246   - List<Singledata> singledata = formsService.singledata(map);
247   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
248   - int i = 1;
249   - for (Singledata l : singledata) {
250   - Map<String, Object> m = new HashMap<String, Object>();
251   - m.put("i", i);
252   - m.put("rQ", l.getrQ());
253   - m.put("gS", l.getgS());
254   - m.put("xL", l.getXlmc());
255   - m.put("clzbh", l.getClzbh());
256   - m.put("jsy", l.getJsy());
257   - m.put("jName", l.getjName());
258   - m.put("sgh", l.getSgh());
259   - m.put("sName", l.getsName());
260   - m.put("jhlc", l.getJhlc());
261   - m.put("emptMileage", l.getEmptMileage());
262   - m.put("hyl", l.getHyl());
263   - m.put("jzl", l.getJzl());
264   - m.put("unyyyl", l.getUnyyyl());
265   - m.put("jhjl", l.getJhjl());
266   - resList.add(m);
267   -
268   - i++;
269   - }
270   -
271   - try {
272   - listI.add(resList.iterator());
273   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
274   - ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
275   - path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
276   - } catch (Exception e) {
277   - e.printStackTrace();
278   - }
279   -
280   - return resList;
281   - }
282   -
283   - // 路单数据报表
284   - @RequestMapping(value = "/singledataExport2", method = RequestMethod.GET)
285   - public List<Map<String, Object>> singledataExport2(@RequestParam Map<String, Object> map) {
286   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
287   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
288   - ReportUtils ee = new ReportUtils();
289   - List<Singledata> singledata = formsService.singledata2(map);
290   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
291   - int i = 1;
292   - for (Singledata l : singledata) {
293   - Map<String, Object> m = new HashMap<String, Object>();
294   - m.put("i", i);
295   - m.put("rQ", l.getrQ());
296   - m.put("gS", l.getgS());
297   - m.put("xL", l.getXlmc());
298   - m.put("clzbh", l.getClzbh());
299   - m.put("jsy", l.getJsy());
300   - m.put("jName", l.getjName());
301   - m.put("sgh", l.getSgh());
302   - m.put("sName", l.getsName());
303   - m.put("jhlc", l.getJhlc());
304   - m.put("emptMileage", l.getEmptMileage());
305   - m.put("hyl", l.getHyl());
306   - m.put("jzl", l.getJzl());
307   - m.put("unyyyl", l.getUnyyyl());
308   - m.put("jhjl", l.getJhjl());
309   - resList.add(m);
310   -
311   - i++;
312   - }
313   -
314   - try {
315   - listI.add(resList.iterator());
316   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
317   - ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
318   - path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
319   - } catch (Exception e) {
320   - e.printStackTrace();
321   - }
322   -
323   - return resList;
324   - }
325   - @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET)
326   - public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) {
327   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
328   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
329   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
330   - ReportUtils ee = new ReportUtils();
331   - List<Singledata> singledata = formsService.singledatatj(map);
332   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
333   - int i = 1;
334   - for (Singledata l : singledata) {
335   - Map<String, Object> m = new HashMap<String, Object>();
336   - m.put("i", i);
337   - m.put("rQ", l.getrQ());
338   - m.put("gS", l.getgS());
339   - m.put("xL", l.getXlmc());
340   - m.put("clzbh", l.getClzbh());
341   - m.put("jsy", l.getJsy());
342   - m.put("jName", l.getjName());
343   - m.put("sgh", l.getSgh());
344   - m.put("sName", l.getsName());
345   - m.put("jhlc", l.getJhlc());
346   - m.put("emptMileage", l.getEmptMileage());
347   - m.put("hyl", l.getHyl());
348   - m.put("jzl", l.getJzl());
349   - m.put("unyyyl", l.getUnyyyl());
350   - m.put("jhjl", l.getJhjl());
351   - resList.add(m);
352   -
353   - i++;
354   - }
355   -
356   - try {
357   - String startDate = "", lineName = "";
358   - if(map.containsKey("startDate"))
359   - startDate = map.get("startDate").toString();
360   - if(map.containsKey("lineName"))
361   - lineName = map.get("lineName").toString();
362   - listI.add(resList.iterator());
363   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
364   - ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
365   - path + "export/" + sdfSimple.format(sdfMonth.parse(startDate))
366   - + "-" + lineName + "-路单数据.xls");
367   - } catch (Exception e) {
368   - e.printStackTrace();
369   - }
370   -
371   - return resList;
372   - }
373   -
374   - @RequestMapping(value = "/singledataExportTj2", method = RequestMethod.GET)
375   - public List<Map<String, Object>> singledataExportTj2(@RequestParam Map<String, Object> map) {
376   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
377   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
378   - ReportUtils ee = new ReportUtils();
379   - List<Singledata> singledata = formsService.singledatatj2(map);
380   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
381   - int i = 1;
382   - for (Singledata l : singledata) {
383   - Map<String, Object> m = new HashMap<String, Object>();
384   - m.put("i", i);
385   - m.put("rQ", l.getrQ());
386   - m.put("gS", l.getgS());
387   - m.put("xL", l.getXlmc());
388   - m.put("clzbh", l.getClzbh());
389   - m.put("jsy", l.getJsy());
390   - m.put("jName", l.getjName());
391   - m.put("sgh", l.getSgh());
392   - m.put("sName", l.getsName());
393   - m.put("jhlc", l.getJhlc());
394   - m.put("emptMileage", l.getEmptMileage());
395   - m.put("hyl", l.getHyl());
396   - m.put("jzl", l.getJzl());
397   - m.put("unyyyl", l.getUnyyyl());
398   - m.put("jhjl", l.getJhjl());
399   - resList.add(m);
400   -
401   - i++;
402   - }
403   -
404   - try {
405   - listI.add(resList.iterator());
406   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
407   - ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
408   - path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
409   - } catch (Exception e) {
410   - e.printStackTrace();
411   - }
412   -
413   - return resList;
414   - }
415   - // 车辆加注
416   - @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET)
417   - public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) {
418   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
419   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
420   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
421   - ReportUtils ee = new ReportUtils();
422   - List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(),
423   - map.get("data").toString());
424   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
425   - int i = 1;
426   - for (Vehicleloading l : vehicleloading) {
427   - Map<String, Object> m = new HashMap<String, Object>();
428   - m.put("i", i);
429   - m.put("rQ", l.getrQ());
430   - m.put("gS", l.getgS());
431   - m.put("xL", l.getxL());
432   - m.put("clzbh", l.getClzbh());
433   - m.put("jzl", l.getJzl());
434   - m.put("hyl", l.getHyl());
435   - m.put("ls", l.getLs());
436   - m.put("jhlc", l.getJhlc());
437   - m.put("unyyyl", l.getUnyyyl());
438   - m.put("jhbc", l.getJhbc());
439   - m.put("sjbc", l.getSjbc());
440   - resList.add(m);
441   - i++;
442   - }
443   -
444   - try {
445   - String date = "", lineName = "";
446   - if(map.containsKey("data"))
447   - date = map.get("data").toString();
448   - if(map.containsKey("lineName"))
449   - lineName = map.get("lineName").toString();
450   - listI.add(resList.iterator());
451   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
452   - ee.excelReplace(listI, new Object[] { map }, path + "mould/vehicleloading.xls",
453   - path + "export/" + sdfSimple.format(sdfMonth.parse(date)) + "-" + lineName + "-车辆加注.xls");
454   - } catch (Exception e) {
455   - e.printStackTrace();
456   - }
457   - return resList;
458   - }
459   -
460   - // 运营服务阶段报表
461   - @RequestMapping(value = "/operationserviceExport", method = RequestMethod.GET)
462   - public List<Map<String, Object>> operationserviceExport(@RequestParam Map<String, Object> map) {
463   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
464   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
465   - ReportUtils ee = new ReportUtils();
466   - List<Operationservice> operationservice = formsService.operationservice(map);
467   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
468   - int i = 1;
469   - for (Operationservice l : operationservice) {
470   - Map<String, Object> m = new HashMap<String, Object>();
471   - m.put("i", i);
472   - m.put("fgs", l.getFgs()!=null?l.getFgs():"");
473   - m.put("xlName", l.getXlName()!=null?l.getXlName():"");
474   - m.put("jzl", l.getJzl()!=null?l.getJzl():"");
475   - m.put("xhl", l.getXhl()!=null?l.getXhl():"");
476   - m.put("xsgl", l.getXsgl()!=null?l.getXsgl():"");
477   - m.put("emptMileage", l.getEmptMileage()!=null?l.getEmptMileage():"");
478   - m.put("sjbc", l.getSjbc()!=null?l.getSjbc():"");
479   - resList.add(m);
480   - i++;
481   - }
482   -
483   - try {
484   - String dateTime = "", startDate = "", endDate = "", lineName = "";
485   - if(map.containsKey("startDate"))
486   - startDate = map.get("startDate").toString();
487   - if(map.containsKey("endDate"))
488   - endDate = map.get("endDate").toString();
489   - if(map.containsKey("lineName"))
490   - lineName = map.get("lineName").toString();
491   - if(startDate.equals(endDate)){
492   - dateTime = sdfSimple.format(sdfMonth.parse(startDate));
493   - } else {
494   - dateTime = sdfSimple.format(sdfMonth.parse(startDate))
495   - +"-"+sdfSimple.format(sdfMonth.parse(endDate));
496   - }
497   - listI.add(resList.iterator());
498   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
499   - ee.excelReplace(listI, new Object[] { map }, path + "mould/operationservice.xls", path + "export/"
500   - + dateTime + "-" + lineName + "-运营服务阶段报表.xls");
501   - } catch (Exception e) {
502   - e.printStackTrace();
503   - }
504   - return resList;
505   - }
506   -
507   - // 换人换车情况日统计
508   - @RequestMapping(value = "/changetochangeExport", method = RequestMethod.POST)
509   - public List<Map<String, Object>> changetochangeExport(@RequestParam Map<String, Object> map) {
510   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
511   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
512   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
513   - ReportUtils ee = new ReportUtils();
514   - List<Changetochange> changetochange = formsService.changetochange(map);
515   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
516   - for (Changetochange l : changetochange) {
517   - Map<String, Object> m = new HashMap<String, Object>();
518   - m.put("rq", l.getRq());
519   - m.put("gs", l.getGs());
520   - m.put("fgs", l.getFgs());
521   - m.put("xl", l.getXl());
522   - m.put("lp", l.getLp());
523   - m.put("fssj", l.getFssj());
524   - m.put("xgsj", l.getXgsj());
525   - m.put("pcch", l.getPcch());
526   - m.put("sjch", l.getSjch());
527   - m.put("fcgh", l.getPcry());
528   - m.put("sjgh", l.getSjgh());
529   - m.put("yy", l.getYy()==null?"":l.getYy());
530   - m.put("xgr", l.getXgr());
531   - resList.add(m);
532   - }
533   -
534   - try {
535   - String dateTime = "", startDate = "", endDate = "", lineName = "";
536   - if(map.containsKey("startDate"))
537   - startDate = map.get("startDate").toString();
538   - if(map.containsKey("endDate"))
539   - endDate = map.get("endDate").toString();
540   - if(map.containsKey("lineName"))
541   - lineName = map.get("lineName").toString();
542   - if(startDate.equals(endDate)){
543   - dateTime = sdfSimple.format(sdfMonth.parse(startDate));
544   - } else {
545   - dateTime = sdfSimple.format(sdfMonth.parse(startDate))
546   - +"-"+sdfSimple.format(sdfMonth.parse(endDate));
547   - }
548   - listI.add(resList.iterator());
549   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
550   - ee.excelReplace(listI, new Object[] { map }, path + "mould/changetochange.xls", path + "export/"
551   - + dateTime + "-" + lineName + "-换人换车情况日统计.xls");
552   - } catch (Exception e) {
553   - e.printStackTrace();
554   - }
555   - return resList;
556   - }
557   -
558   - // 营运线路出车率统计表
559   - @RequestMapping(value = "/turnoutrateExport", method = RequestMethod.POST)
560   - public List<Map<String, Object>> turnoutrateExport(@RequestParam Map<String, Object> map) {
561   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
562   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
563   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
564   - ReportUtils ee = new ReportUtils();
565   - Map<String, Object> map1 = new HashMap<String, Object>();
566   -
567   - List<Map<String, Object>> resList = formsService.turnoutrate(map);
568   - Map<String, Object> m = resList.get(resList.size() - 1);
569   - map1.put("line", m.get("line"));
570   - map1.put("jhcc", m.get("jhcc"));
571   - map1.put("sjcc", m.get("sjcc"));
572   - map1.put("jhbc", m.get("jhbc"));
573   - map1.put("sjbc", m.get("sjbc"));
574   - map1.put("ccl", m.get("ccl"));
575   - map1.put("zxl", m.get("zxl"));
576   - map1.put("qz", m.get("qz"));
577   - map1.put("sm", m.get("sm"));
578   -
579   - resList.remove(m);
580   -
581   - try {
582   - String dateTime = "", startDate = "", endDate = "", lineName = "";
583   - if(map.containsKey("startDate"))
584   - startDate = map.get("startDate").toString();
585   - if(map.containsKey("endDate"))
586   - endDate = map.get("endDate").toString();
587   - if(map.containsKey("lineName"))
588   - lineName = map.get("lineName").toString();
589   - if(startDate.equals(endDate)){
590   - dateTime = sdfSimple.format(sdfMonth.parse(startDate));
591   - } else {
592   - dateTime = sdfSimple.format(sdfMonth.parse(startDate))
593   - +"-"+sdfSimple.format(sdfMonth.parse(endDate));
594   - }
595   - listI.add(resList.iterator());
596   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
597   - ee.excelReplace(listI, new Object[] { map1 }, path + "mould/turnoutrate.xls", path + "export/"
598   - + dateTime + "-" + lineName + "-营运线路出车率统计表.xls");
599   - } catch (Exception e) {
600   - e.printStackTrace();
601   - }
602   - return resList;
603   - }
604   -
605   - //班次执行率统计表
606   - @RequestMapping(value = "/executionrateExport", method = RequestMethod.POST)
607   - public List<Map<String, Object>> executionrateExport(@RequestParam Map<String, Object> map) {
608   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
609   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
610   - ReportUtils ee = new ReportUtils();
611   - List<Executionrate> executionrate = formsService.executionrate(map);
612   - Map<String, Object> map1 = new HashMap<String, Object>();
613   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
614   - String xlts="";
615   - String zsgs="";
616   - String jh="";
617   - Float sj=0f;
618   - Float ccl=0f;
619   - Float bcjh=0f;
620   - String bcsj="";
621   - Float bczxl=0f;
622   - String gs="";
623   - String zhgs="";
624   -
625   - Map<String, Object> m = new HashMap<String, Object>();
626   -
627   - for (Executionrate l : executionrate) {
628   -
629   - xlts +=l.getGsgs()==""?0:String.valueOf(l.getGsgs());
630   - zsgs +=l.getFgsgs()==""?0:String.valueOf(l.getFgsgs());
631   - jh +=l.getXl()==""?0:String.valueOf(l.getXl());
632   - sj +=l.getCchjh()==""?0f:Float.valueOf(l.getCchjh());
633   - ccl +=l.getCchsj()==""?0f:Float.valueOf(l.getCchsj());
634   - bcsj +=l.getChl()==""?0:String.valueOf(l.getChl());
635   - bczxl +=l.getBcjh()==""?0f:Float.valueOf(l.getBcjh());
636   - gs +=l.getBcsj()==""?0:String.valueOf(l.getBcsj());
637   - zhgs +=l.getBbzxl()==""?0:String.valueOf(l.getBbzxl());
638   -
639   -
640   -
641   - m.put("rq", l.getRq());
642   - m.put("gs", l.getGs());
643   - m.put("zhgs", l.getZhgs());
644   - m.put("xl", l.getXl());
645   - m.put("cchjh", l.getCchjh());
646   - m.put("cchsj", l.getCchsj());
647   - m.put("chl", l.getChl());
648   - m.put("bcjh", l.getBcjh());
649   - m.put("bcsj", l.getBcsj());
650   - m.put("bbzxl", l.getBbzxl());
651   - m.put("sm", l.getSm());
652   - resList.add(m);
653   -
654   -
655   - m=new HashMap<String,Object>();
656   - m.put("total_gs", xlts);
657   - m.put("total_zhgs", zsgs);
658   - m.put("total_xlts", jh);
659   - m.put("total_jh", sj);
660   - m.put("total_sj", ccl);
661   - m.put("total_ccl",bcsj);
662   - m.put("total_bcjh", bczxl);
663   - m.put("total_bcsj", gs);
664   - m.put("total_bczxl", zhgs);
665   -
666   - map1 = m;
667   - }
668   -
669   - try {
670   - listI.add(resList.iterator());
671   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
672   - ee.excelReplace(listI, new Object[] { map1 }, path + "mould/executionrate.xls", path + "export/班次执行率统计表"
673   - + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
674   - } catch (Exception e) {
675   - e.printStackTrace();
676   - }
677   - return resList;
678   - }
679   -
680   -
681   - ////营运线路名称统计表
682   - @RequestMapping(value = "/alllineExport", method = RequestMethod.POST)
683   - public List<Map<String, Object>> alllineExport(@RequestParam Map<String, Object> map) {
684   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
685   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
686   - ReportUtils ee = new ReportUtils();
687   - List<Allline> allline = formsService.allline(map);
688   - Map<String, Object> map1 = new HashMap<String, Object>();
689   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
690   - Integer jh=0;
691   - Integer sj=0;
692   - Integer ccl=0;
693   - Double bcjh=0.0;
694   - String bcsj="";
695   - Integer bczxl=0;
696   - String gs="";
697   - String zhgs="";
698   - Map<String, Object> m ;
699   - for (Allline l : allline) {
700   - m = new HashMap<String, Object>();
701   -
702   - jh +=l.getGsgs()=="" ? 0: Integer.valueOf(l.getGsgs());
703   - sj +=l.getFgsgs()==""?0: Integer.valueOf(l.getFgsgs());
704   - ccl +=l.getCchjh()==""?0: Integer.valueOf(l.getCchjh());
705   - bcjh +=l.getCchsj()==""?0: Double.valueOf(l.getCchsj());
706   -
707   - bcsj +=l.getChl()==""? 0:String.valueOf(l.getChl());
708   - bczxl +=l.getBcjh()==""?0: Integer.valueOf(l.getBcjh());
709   - gs +=l.getBcsj()==""?0: String.valueOf(l.getBcsj());
710   - zhgs +=l.getBbzxl()==""?0:String.valueOf(l.getBbzxl());
711   -
712   - m.put("rq", l.getRq());
713   - m.put("gs", l.getGs());
714   - m.put("zhgs", l.getZhgs());
715   - m.put("xl", l.getXl());
716   - m.put("cchjh", l.getCchjh());
717   - m.put("cchsj", l.getCchsj());
718   - m.put("chl", l.getChl());
719   - m.put("bcjh", l.getBcjh());
720   - m.put("bcsj", l.getBcsj());
721   - m.put("bbzxl", l.getBbzxl());
722   - m.put("sm", l.getSm());
723   - resList.add(m);
724   -
725   - m=new HashMap<String,Object>();
726   - m.put("total_jh", jh);
727   - m.put("total_sj", sj);
728   - m.put("total_ccl", ccl);
729   - m.put("total_bcjh", bcjh);
730   - m.put("total_bcsj", bcsj);
731   - m.put("total_bczxl", bczxl);
732   - m.put("total_gs", gs);
733   - m.put("total_zhgs", zhgs);
734   - map1 = m;
735   -
736   - }
737   -
738   - try {
739   - listI.add(resList.iterator());
740   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
741   - ee.excelReplace(listI, new Object[] { map1 }, path + "mould/allline.xls", path + "export/营运线路名称统计表"
742   - + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
743   - } catch (Exception e) {
744   - e.printStackTrace();
745   - }
746   - return resList;
747   - }
748   -
749   -
750   -
751   - //班次日报表
752   - @RequestMapping(value = "/dailyExport", method = RequestMethod.POST)
753   - public List<Map<String, Object>> dailyExport(@RequestParam Map<String, Object> map) {
754   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
755   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
756   - ReportUtils ee = new ReportUtils();
757   - List<Daily> allline = formsService.daily(map);
758   -
759   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
760   - double zgl=0.0;
761   - double ks=0.0;
762   - double yh=0.0;
763   - int bc=0;
764   - Map<String, Object> m ;
765   - for (Daily d : allline) {
766   - m = new HashMap<String, Object>();
767   - m.put("zbh", d.getZbh());
768   - m.put("jgh",d.getJgh());
769   - m.put("jName", d.getjName());
770   - m.put("zlc", d.getZlc());
771   - m.put("jzl1", d.getJzl1());
772   - m.put("yh", d.getYh());
773   - m.put("bc", d.getBc());
774   - zgl =Arith.add(zgl, d.getZlc());
775   - ks =Arith.add(ks, d.getJzl1());
776   - yh =Arith.add(yh, d.getYh());
777   - bc +=Integer.parseInt(d.getBc());
778   -
779   - resList.add(m);
780   - }
781   -
782   - m=new HashMap<String,Object>();
783   - m.put("total_zgl", zgl);
784   - m.put("total_ks", ks);
785   - m.put("total_yh", yh);
786   - m.put("total_bc", bc);
787   -
788   - m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString()));
789   - m.put("date", map.get("date").toString());
790   - try {
791   - String lineName = map.get("lineName").toString();
792   - String date = map.get("date").toString();
793   - listI.add(resList.iterator());
794   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
795   - ee.excelReplace(listI, new Object[] { m }, path + "mould/daily.xls",
796   - path + "export/" + sdfSimple.format(sdfMonth.parse(date))
797   - + "-" + lineName + "-班次日报表.xls");
798   - } catch (Exception e) {
799   - e.printStackTrace();
800   - }
801   - return resList;
802   - }
803   -
804   -
805   -
806   -}
src/main/java/com/bsth/controller/forms/MCY_FormsController.java deleted 100644 → 0
1   -package com.bsth.controller.forms;
2   -
3   -import java.util.List;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.RestController;
11   -
12   -import com.bsth.entity.mcy_forms.Allline;
13   -import com.bsth.entity.mcy_forms.Changetochange;
14   -import com.bsth.entity.mcy_forms.Daily;
15   -import com.bsth.entity.mcy_forms.Executionrate;
16   -import com.bsth.entity.mcy_forms.Linepasswengerflow;
17   -import com.bsth.entity.mcy_forms.Operationservice;
18   -import com.bsth.entity.mcy_forms.Shifday;
19   -import com.bsth.entity.mcy_forms.Shiftuehiclemanth;
20   -import com.bsth.entity.mcy_forms.Singledata;
21   -import com.bsth.entity.mcy_forms.Turnoutrate;
22   -import com.bsth.entity.mcy_forms.Vehicleloading;
23   -import com.bsth.entity.mcy_forms.Waybillday;
24   -import com.bsth.service.forms.FormsService;
25   -import com.bsth.service.realcontrol.ScheduleRealInfoService;
26   -
27   -@RestController
28   -@RequestMapping("mcy_forms")
29   -public class MCY_FormsController {
30   -
31   - @Autowired
32   - FormsService formsService;
33   -
34   - @Autowired
35   - ScheduleRealInfoService scheduleRealInfoService;
36   -
37   - // 行车路单日报表
38   -
39   - @RequestMapping(value = "/waybillday", method = RequestMethod.POST)
40   - public List<Waybillday> waybillday(@RequestParam Map<String, Object> map) {
41   -
42   - // scheduleRealInfoService.findKMBC(jName, clZbh, lpName, date)
43   - return formsService.waybillday(map);
44   - }
45   -
46   - // 线路客流量报表
47   -
48   - @RequestMapping(value = "/linepasswengerflow", method = RequestMethod.POST)
49   - public List<Linepasswengerflow> linepasswengerflow(@RequestParam Map<String, Object> map) {
50   -
51   - return formsService.linepasswengerflow(map);
52   - }
53   -
54   - // 班次车辆人员月报表
55   - @RequestMapping(value = "/shiftuehiclemanth", method = RequestMethod.GET)
56   - public List<Shiftuehiclemanth> shiftuehiclemanth(@RequestParam Map<String, Object> map) {
57   -
58   - return formsService.shiftuehiclemanth(map);
59   - }
60   -
61   - // 班次车辆人员月报表
62   - @RequestMapping(value = "/shiftuehiclemanth2", method = RequestMethod.GET)
63   - public List<Shiftuehiclemanth> shiftuehiclemanth2(@RequestParam Map<String, Object> map) {
64   -
65   - return formsService.shiftuehiclemanth2(map);
66   - }
67   -
68   - // 班次车辆人员日统计
69   - @RequestMapping(value = "/shifday", method = RequestMethod.GET)
70   - public List<Shifday> shifday(@RequestParam Map<String, Object> map) {
71   -
72   - return formsService.shifday(map);
73   - }
74   -
75   - // 换人换车情况统计表
76   - @RequestMapping(value = "/changetochange", method = RequestMethod.GET)
77   - public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) {
78   -
79   - return formsService.changetochange(map);
80   - }
81   -
82   - // 路单数据
83   - @RequestMapping(value = "/singledata", method = RequestMethod.GET)
84   - public List<Singledata> singledata(@RequestParam Map<String, Object> map) {
85   -
86   - return formsService.singledata(map);
87   - }
88   -
89   - // 路单数据
90   - @RequestMapping(value = "/singledata2", method = RequestMethod.GET)
91   - public List<Singledata> singledata2(@RequestParam Map<String, Object> map) {
92   -
93   - return formsService.singledata2(map);
94   - }
95   -
96   - // 路单数据
97   - @RequestMapping(value = "/singledatanew", method = RequestMethod.GET)
98   - public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) {
99   -
100   - return formsService.singledatanew(map);
101   - }
102   -
103   - @RequestMapping(value = "/singledatatj", method = RequestMethod.GET)
104   - public List<Singledata> singledatatj(@RequestParam Map<String, Object> map) {
105   -
106   - return formsService.singledatatj(map);
107   - }
108   -
109   -
110   - @RequestMapping(value = "/singledatatj2", method = RequestMethod.GET)
111   - public List<Singledata> singledatatj2(@RequestParam Map<String, Object> map) {
112   -
113   - return formsService.singledatatj2(map);
114   - }
115   - // 车辆加注
116   - @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET)
117   - public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) {
118   - return formsService.vehicleloading(line, data);
119   - }
120   -
121   - // 运营服务阶段报表
122   - @RequestMapping(value = "/operationservice", method = RequestMethod.GET)
123   - public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) {
124   -
125   - return formsService.operationservice(map);
126   - }
127   -
128   - // 营运线路出车率统计表
129   - @RequestMapping(value = "/turnoutrate", method = RequestMethod.POST)
130   - public List<Map<String, Object>> turnoutrate(@RequestParam Map<String, Object> map) {
131   -
132   - return formsService.turnoutrate(map);
133   - }
134   -
135   - // 班次执行率统计表
136   - @RequestMapping(value = "/executionrate", method = RequestMethod.POST)
137   - public List<Executionrate> executionrate(@RequestParam Map<String, Object> map) {
138   -
139   - return formsService.executionrate(map);
140   - }
141   -
142   - // 营运线路名称统计表
143   - @RequestMapping(value = "/allline", method = RequestMethod.POST)
144   - public List<Allline> allline(@RequestParam Map<String, Object> map) {
145   -
146   - return formsService.allline(map);
147   - }
148   -
149   - // 营运线路名称统计表
150   - @RequestMapping(value = "/daily", method = RequestMethod.GET)
151   - public List<Daily> daily(@RequestParam Map<String, Object> map) {
152   -
153   - return formsService.daily(map);
154   - }
155   -
156   -}
src/main/java/com/bsth/controller/jdtest/JdTestController.java deleted 100644 → 0
1   -package com.bsth.controller.jdtest;
2   -
3   -import java.text.SimpleDateFormat;
4   -import java.util.ArrayList;
5   -import java.util.HashMap;
6   -import java.util.Iterator;
7   -import java.util.List;
8   -import java.util.Map;
9   -import org.springframework.beans.factory.annotation.Autowired;
10   -import org.springframework.web.bind.annotation.RequestMapping;
11   -import org.springframework.web.bind.annotation.RequestMethod;
12   -import org.springframework.web.bind.annotation.RequestParam;
13   -import org.springframework.web.bind.annotation.RestController;
14   -import com.bsth.controller.BaseController;
15   -import com.bsth.data.BasicData;
16   -import com.bsth.entity.oil.Ylb;
17   -import com.bsth.entity.oil.Ylxxb;
18   -import com.bsth.entity.sys.Dictionary;
19   -import com.bsth.service.jdtest.JdtestService;
20   -import com.bsth.service.oil.YlbService;
21   -import com.bsth.service.sys.DictionaryService;
22   -import com.bsth.util.Arith;
23   -import com.bsth.util.ReportUtils;
24   -
25   -@RestController
26   -@RequestMapping("jdtest")
27   -public class JdTestController extends BaseController<Ylb, Integer>{
28   - @Autowired
29   - YlbService ylbService;
30   - @Autowired
31   - DictionaryService dictionaryService;
32   - @Autowired
33   - JdtestService jdtestService;
34   -
35   - /*
36   - * 油量平衡表导出
37   - */
38   - @RequestMapping(value = "/listExport",method = RequestMethod.POST)
39   - public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
40   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
41   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
42   - Map<String, Object> dMap=new HashMap<>();
43   - dMap.put("dGroup_eq", "oilType");
44   - Iterator<Dictionary> it= dictionaryService.list(dMap).iterator();
45   - while (it.hasNext()) {
46   - Dictionary d=it.next();
47   - dMap.put(d.getdCode(), d.getdName());
48   - }
49   -
50   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
51   - ReportUtils ee = new ReportUtils();
52   - List<Ylb> ylb= ylbService.listYlb(map);
53   -// (new CustomerSpecs<Ylb>(map)).iterator();
54   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
55   - for (Ylb y : ylb) {
56   - Map<String, Object> m = new HashMap<String, Object>();
57   - m.put("rq", sdfMonth.format(y.getRq()));
58   - m.put("gsname",y.getGsname() );
59   - m.put("fgsname", y.getFgsname());
60   - m.put("xlname", y.getXlname()==null?"":y.getXlname());
61   - m.put("nbbm", y.getNbbm());
62   - m.put("jsy", y.getJsy());
63   - m.put("name", y.getName());
64   - m.put("jzl", y.getJzl()<=0?"0":y.getJzl());
65   - m.put("czlc", "0");
66   - m.put("jzlc", "0");
67   - m.put("czyl", y.getCzyl()<=0?"0":y.getCzyl());
68   - m.put("jzyl", y.getJzyl()<=0?"0":y.getJzyl());
69   - m.put("yh", y.getYh()<=0?"0":y.getYh());
70   - String rylx="";
71   - if(y.getRylx()!=null){
72   - if(dMap.get(y.getRylx())==null){
73   - rylx="";
74   - }else{
75   - rylx=dMap.get(y.getRylx()).toString();
76   - }
77   - }
78   - m.put("rylx", rylx);
79   - m.put("ns", y.getNs()==null?"0":y.getNs());
80   - String shyy ="无";
81   - if(y.getShyy()!=null){
82   - shyy=y.getShyy();
83   - if(shyy.equals("1")){shyy="票务用油";}
84   - else if(shyy.equals("2")){shyy="保养用油";}
85   - else if(shyy.equals("3")){shyy="报废车用油";}
86   - else if(shyy.equals("4")){shyy="其它用油";}
87   - else if(shyy.equals("5")){shyy="人保部";}
88   - else if(shyy.equals("6")){shyy="车队";}
89   - else if(shyy.equals("7")){shyy="车间(高保)";}
90   - else if(shyy.equals("8")){shyy="车间(小修)";}
91   - else{shyy ="无";}
92   - }
93   - m.put("shyy", shyy);
94   - m.put("sh", y.getSh()<=0?"0":y.getSh());
95   - m.put("zlc", y.getZlc()<=0?"0":y.getZlc());
96   - m.put("bglyh", y.getBglyh());
97   - m.put("zyh", Arith.add(y.getSh(), y.getYh()));
98   - resList.add(m);
99   - }
100   - try {
101   - map.put("sheetName", map.get("rq"));
102   - listI.add(resList.iterator());
103   - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
104   - ee.excelReplace(listI, new Object[] { map }, path+"mould/list.xls",
105   - path+"export/"+map.get("rq").toString()+ "进出场存油量.xls");
106   - } catch (Exception e) {
107   - e.printStackTrace();
108   - }
109   -
110   - return resList;
111   -
112   - }
113   -
114   - /*
115   - * 场外加油匹配当天线路数据
116   - */
117   - @RequestMapping(value = "/cwjyList",method = RequestMethod.GET)
118   - public List<Ylxxb> cwjyList(@RequestParam Map<String, Object> map){
119   - List<Ylxxb> cwjyList=jdtestService.cwjyList(map);
120   - return cwjyList;
121   - }
122   -
123   - /*
124   - * 油量路单报表
125   - */
126   - @RequestMapping(value="/daily",method = RequestMethod.GET)
127   - public List<Map<String, Object>> daily(@RequestParam Map<String, Object> map){
128   - List<Map<String, Object>> list=jdtestService.daily(map);
129   -
130   - if(map.get("type").toString().equals("export")){
131   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
132   - ReportUtils ee = new ReportUtils();
133   - Map<String, Object> m=new HashMap<>();
134   -
135   - try {
136   - String lineName = map.get("lineName").toString();
137   - String date = map.get("date").toString();
138   - m.put("line", lineName);
139   - m.put("date", date);
140   - listI.add(list.iterator());
141   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
142   - ee.excelReplace(listI, new Object[] { m }, path + "mould/jd_daily.xls",
143   - path + "export/" + date
144   - + "-" + lineName + "-班次日报表.xls");
145   - } catch (Exception e) {
146   - e.printStackTrace();
147   - }
148   - }
149   - return list;
150   - }
151   -
152   -}
src/main/java/com/bsth/controller/oil/CdlController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.util.Date;
4   -import java.util.Map;
5   -
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestMethod;
9   -import org.springframework.web.bind.annotation.RestController;
10   -
11   -import com.bsth.controller.BaseController;
12   -import com.bsth.entity.oil.Cdl;
13   -import com.bsth.service.oil.CdlService;
14   -
15   -@RestController
16   -@RequestMapping("cdl")
17   -public class CdlController extends BaseController<Cdl, Integer>{
18   - @Autowired
19   - CdlService service;
20   - @RequestMapping(value = "/save",method = RequestMethod.POST)
21   - public Map<String, Object> saveCdl(Cdl t){
22   -// SysUser user = SecurityUtils.getCurrentUser();
23   - t.setUpdatetime(new Date());
24   - /*SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
25   - try {
26   - t.setUpdatetime(sdf.parse("2016-10-13"));
27   - } catch (ParseException e) {
28   - // TODO Auto-generated catch block
29   - e.printStackTrace();
30   - }*/
31   - return service.save(t);
32   - }
33   -}
src/main/java/com/bsth/controller/oil/CwjyController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -
4   -import java.io.File;
5   -import java.util.Date;
6   -import java.util.HashMap;
7   -import java.util.List;
8   -import java.util.Map;
9   -
10   -import org.springframework.beans.factory.annotation.Autowired;
11   -import org.springframework.web.bind.annotation.RequestMapping;
12   -import org.springframework.web.bind.annotation.RequestMethod;
13   -import org.springframework.web.bind.annotation.RequestParam;
14   -import org.springframework.web.bind.annotation.RestController;
15   -import org.springframework.web.multipart.MultipartFile;
16   -
17   -import com.bsth.common.ResponseCode;
18   -import com.bsth.controller.BaseController;
19   -import com.bsth.data.BasicData;
20   -import com.bsth.entity.Line;
21   -import com.bsth.entity.oil.Cwjy;
22   -import com.bsth.entity.oil.Ylxxb;
23   -import com.bsth.entity.sys.SysUser;
24   -import com.bsth.security.util.SecurityUtils;
25   -import com.bsth.service.oil.CwjyService;
26   -import com.bsth.util.PageObject;
27   -import com.google.common.io.Files;
28   -
29   -@RestController
30   -@RequestMapping("cwjy")
31   -public class CwjyController extends BaseController<Cwjy, Integer>{
32   - @Autowired
33   - private CwjyService service;
34   - @RequestMapping(method = RequestMethod.POST)
35   - public Map<String, Object> save(Cwjy t){
36   - SysUser sysUser = SecurityUtils.getCurrentUser();
37   - t.setCreateDate(new Date());
38   - t.setXgr(sysUser.getUserName());
39   - t.setNbbm(t.getNbbm().trim().toUpperCase());
40   - Line line=BasicData.nbbm2LineMap.get(t.getNbbm());
41   - t.setLine(line == null?"" : line.getLineCode());
42   - Map<String, Object> map = new HashMap<>();
43   - try {
44   - map=service.save(t);
45   - }catch (Exception e) {
46   - // TODO: handle exception
47   - if(e.getMessage().indexOf("PK_CWJYUK")>0){
48   - map.put("fage", "存在相同数据,数据已经过滤");
49   - }
50   - }
51   - return map;
52   - }
53   -
54   - @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET)
55   - public int checkNbbm(Cwjy t){
56   - return service.checkNbbm(t);
57   - }
58   -
59   - @RequestMapping(value = "/queryList",method = RequestMethod.GET)
60   - public List<Ylxxb> queryList(@RequestParam Map<String, Object> map){
61   - List<Ylxxb> pagequery=null;
62   - map.put("curPage", map.get("page").toString());
63   - map.put("pageData","10");
64   - pagequery=service.Pagequery(map);
65   - return pagequery;
66   - }
67   -
68   - @RequestMapping(value = "/cwjyList",method = RequestMethod.GET)
69   - public List<Ylxxb> cwjyList(@RequestParam Map<String, Object> map){
70   - List<Ylxxb> cwjyList=service.cwjyList(map);
71   - return cwjyList;
72   - }
73   -
74   - @RequestMapping(value="/bynbbm",method = RequestMethod.GET)
75   - public Ylxxb bynbbm(@RequestParam Map<String, Object> map){
76   -
77   - return service.bynbbm(map);
78   - }
79   -
80   - /**
81   - *
82   - * @Title: save
83   - * @Description: TODO(持久化对象)
84   - * @param @param t
85   - * @param @return 设定文件
86   - * @return Map<String,Object> {status: 1(成功),-1(失败)}
87   - * @throws
88   - */
89   - @RequestMapping(value="/savejzl",method = RequestMethod.POST)
90   - public Map<String, Object> savejzl(@RequestParam Map<String, Object> map){
91   - Map<String, Object> maps=new HashMap<>();
92   - try {
93   - maps = service.savejzl(map);
94   - } catch (Exception e) {
95   - // TODO Auto-generated catch block
96   - e.printStackTrace();
97   - }
98   - return maps;
99   - }
100   -
101   - /*
102   - * 场外加油导入
103   - */
104   - @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
105   - public String uploadFile(MultipartFile file, String gsbm_, String gsName,
106   - String fgsbm_, String fgsName) throws Exception{
107   - Map<String, Object> map = new HashMap<String, Object>();
108   - File newFile = new File(
109   - getDataImportClasspath() + File.separator +
110   - file.getOriginalFilename());
111   - Files.write(file.getBytes(), newFile);
112   - String result = service.importExcel(newFile, gsbm_, gsName);
113   - return "{\"result\":" + "\""+result+"\"}";
114   - }
115   -
116   - public String getDataImportClasspath(){
117   - return this.getClass().getResource("/").getPath() + "/static/pages/oil";
118   - }
119   -
120   -}
src/main/java/com/bsth/controller/oil/CylController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.text.ParseException;
4   -import java.text.SimpleDateFormat;
5   -import java.util.Date;
6   -import java.util.Map;
7   -
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.web.bind.annotation.RequestMapping;
10   -import org.springframework.web.bind.annotation.RequestMethod;
11   -import org.springframework.web.bind.annotation.RestController;
12   -
13   -import com.bsth.controller.BaseController;
14   -import com.bsth.entity.oil.Cyl;
15   -import com.bsth.service.oil.CylService;
16   -
17   -@RestController
18   -@RequestMapping("cyl")
19   -public class CylController extends BaseController<Cyl, Integer>{
20   - @Autowired
21   - CylService service;
22   - @RequestMapping(value = "/save",method = RequestMethod.POST)
23   - public Map<String, Object> saveYlb(Cyl t){
24   -// SysUser user = SecurityUtils.getCurrentUser();
25   - t.setUpdatetime(new Date());
26   - /*SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
27   - try {
28   - t.setUpdatetime(sdf.parse("2016-10-13"));
29   - } catch (ParseException e) {
30   - // TODO Auto-generated catch block
31   - e.printStackTrace();
32   - }*/
33   - return service.save(t);
34   - }
35   -}
src/main/java/com/bsth/controller/oil/DlbController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.text.SimpleDateFormat;
4   -import java.util.ArrayList;
5   -import java.util.Date;
6   -import java.util.HashMap;
7   -import java.util.Iterator;
8   -import java.util.List;
9   -import java.util.Map;
10   -
11   -import org.springframework.beans.factory.annotation.Autowired;
12   -import org.springframework.data.domain.Page;
13   -import org.springframework.data.domain.PageRequest;
14   -import org.springframework.data.domain.Sort;
15   -import org.springframework.data.domain.Sort.Direction;
16   -import org.springframework.web.bind.annotation.RequestMapping;
17   -import org.springframework.web.bind.annotation.RequestMethod;
18   -import org.springframework.web.bind.annotation.RequestParam;
19   -import org.springframework.web.bind.annotation.RestController;
20   -import com.bsth.controller.BaseController;
21   -import com.bsth.entity.oil.Dlb;
22   -import com.bsth.entity.oil.Ylb;
23   -import com.bsth.service.oil.DlbService;
24   -import com.bsth.util.Arith;
25   -import com.bsth.util.ReportUtils;
26   -import com.google.common.base.Splitter;
27   -
28   -@RestController
29   -@RequestMapping("dlb")
30   -public class DlbController extends BaseController<Dlb, Integer>{
31   - @Autowired
32   - DlbService service;
33   - /**
34   - *
35   - * @Title: list
36   - * @Description: TODO(多条件分页查询)
37   - * @param @param map 查询条件
38   - * @param @param page 页码
39   - * @param @param size 每页显示数量
40   - * @throws
41   - */
42   - @RequestMapping(method = RequestMethod.GET)
43   - public Page<Dlb> list(@RequestParam Map<String, Object> map,
44   - @RequestParam(defaultValue = "0") int page,
45   - @RequestParam(defaultValue = "10") int size,
46   - @RequestParam(defaultValue = "id") String order,
47   - @RequestParam(defaultValue = "DESC") String direction){
48   -
49   - Direction d;
50   -// map.put("xlbm_like", map.get("xlbm_like").toString().trim());
51   -// try {
52   - String rq=map.get("rq").toString();
53   - if(!(rq=="")){
54   -//
55   -// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
56   -// Calendar calendar = new GregorianCalendar();
57   -// calendar.setTime(sdf.parse(rq));
58   -// calendar.add(calendar.DATE,1);
59   -// Date date=calendar.getTime();
60   - map.put("rq_eq", rq);
61   -// map.put("rq_lt", sdf.format(date));
62   -// System.out.println(rq);
63   -// System.out.println(sdf.format(date));
64   - }
65   -// } catch (ParseException e) {
66   -// // TODO Auto-generated catch block
67   -// e.printStackTrace();
68   -// }
69   - if(null != direction && direction.equals("ASC"))
70   - d = Direction.ASC;
71   - else
72   - d = Direction.DESC;
73   -
74   - // 允许多个字段排序,order可以写单个字段,也可以写多个字段
75   - // 多个字段格式:{col1},{col2},{col3},....,{coln}
76   - // 每个字段的排序方向都是一致,这个以后再看要不要改
77   - List<String> list = Splitter.on(",").trimResults().splitToList(order);
78   - return baseService.list(map, new PageRequest(page, size, new Sort(d, list)));
79   - }
80   - @RequestMapping(value = "/dlbList",method = RequestMethod.GET)
81   - public List<Dlb> dlbList(@RequestParam Map<String, Object> map){
82   - List<Dlb> list=service.listDlb(map);
83   - return list;
84   - }
85   -
86   -
87   -
88   - @RequestMapping(value = "/obtain",method = RequestMethod.GET)
89   - public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{
90   - Map<String, Object> list=new HashMap<String, Object>();
91   - try {
92   - list = service.obtain(map);
93   - } catch (Exception e) {
94   - // TODO Auto-generated catch block
95   - throw e;
96   - }
97   - return list;
98   - }
99   -
100   - /**
101   - * 保存电量
102   - * @param map
103   - * @return
104   - */
105   - @RequestMapping(value = "/sort",method = RequestMethod.GET)
106   - public Map<String, Object> sort(@RequestParam Map<String, Object> map){
107   - Map<String, Object> list=service.sort(map);
108   - return list;
109   - }
110   -
111   - /**
112   - * 核对电量(有加电没里程)
113   - * @param map
114   - * @return
115   - */
116   - @RequestMapping(value = "/checkDl",method = RequestMethod.GET)
117   - public Map<String, Object> checkDl(@RequestParam Map<String, Object> map){
118   - Map<String, Object> list=service.checkDl(map);
119   - return list;
120   - }
121   -
122   - @RequestMapping(value = "/sumYlb",method = RequestMethod.GET)
123   - public Map<String, Object> sumYlb(@RequestParam Map<String, Object> map){
124   - Map<String, Object> list=service.sumYlb(map);
125   - return list;
126   - }
127   -
128   - @RequestMapping(value = "/saveDlbList",method = RequestMethod.POST)
129   - public Map<String, Object> saveDlbList(@RequestParam Map<String, Object> map){
130   - Map<String, Object> list=new HashMap<String, Object>();
131   - try {
132   - list = service.saveDlbList(map);
133   - } catch (Exception e) {
134   - // TODO Auto-generated catch block
135   - e.printStackTrace();
136   - }
137   - return list;
138   - }
139   -
140   -
141   - @RequestMapping(value = "/listExport",method = RequestMethod.POST)
142   - public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
143   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
144   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
145   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
146   - ReportUtils ee = new ReportUtils();
147   - List<Dlb> dlb= service.listDlb(map);
148   -// (new CustomerSpecs<Ylb>(map)).iterator();
149   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
150   - for (Dlb y : dlb) {
151   - Map<String, Object> m = new HashMap<String, Object>();
152   - m.put("rq", y.getRq());
153   - m.put("gsname",y.getGsname() );
154   - m.put("fgsname", y.getFgsname());
155   - if(y.getLinename()==null){
156   - m.put("xlname", y.getXlname()==null?"":y.getXlname());
157   - }else{
158   - m.put("xlname", y.getLinename());
159   - }
160   - m.put("nbbm", y.getNbbm());
161   - m.put("jsy", y.getJsy());
162   - m.put("name", y.getName());
163   - m.put("cdl", y.getCdl()<=0?"0":y.getCdl());
164   - m.put("czcd", y.getCzcd()<=0?"0":y.getCzcd()+"%");
165   - m.put("jzcd", y.getJzcd()<=0?"0":y.getJzcd()+"%");
166   - m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc());
167   - m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc());
168   - m.put("hd", y.getHd()<=0?"0":y.getHd());
169   - String shyy ="无";
170   - if(y.getShyy()!=null){
171   - shyy=y.getShyy();
172   - if(shyy.equals("1")){shyy="票务用电";}
173   - else if(shyy.equals("2")){shyy="保养用电";}
174   - else if(shyy.equals("3")){shyy="报废车用电";}
175   - else if(shyy.equals("4")){shyy="其它用电";}
176   - else if(shyy.equals("5")){shyy="人保部";}
177   - else if(shyy.equals("6")){shyy="车队";}
178   - else if(shyy.equals("7")){shyy="车间(高保)";}
179   - else if(shyy.equals("8")){shyy="车间(小修)";}
180   - else{shyy ="无";}
181   - }
182   - m.put("ns", y.getNs()<=0?"0":y.getNs());
183   - m.put("shyy", shyy);
184   - m.put("sh", y.getSh()<=0?"0":y.getSh());
185   - m.put("zlc", y.getZlc()<=0?"0":y.getZlc());
186   - m.put("rdlx", "");
187   - m.put("bglyh", y.getBglyh());
188   - m.put("zdh", Arith.add(y.getSh(), y.getHd()));
189   - resList.add(m);
190   - }
191   - try {
192   - map.put("sheetName", map.get("rq"));
193   - listI.add(resList.iterator());
194   - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
195   - ee.excelReplace(listI, new Object[] { map }, path+"mould/listDl.xls",
196   - path+"export/"+map.get("rq").toString()+ "进出场存电量.xls");
197   - } catch (Exception e) {
198   - e.printStackTrace();
199   - }
200   -
201   - return resList;
202   -
203   - }
204   -
205   -
206   - @RequestMapping(value = "/checkJsy",method = RequestMethod.GET)
207   - public String checkJsy(@RequestParam Map<String, Object> map){
208   - String list=service.checkJsy(map);
209   - return list;
210   - }
211   -
212   - @RequestMapping(value = "/deleteIds", method = RequestMethod.POST)
213   - public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) {
214   - Map<String, Object> maps=new HashMap<String, Object>();
215   - try {
216   - maps= service.deleteIds(map);
217   - } catch (Exception e) {
218   - // TODO Auto-generated catch block
219   - e.printStackTrace();
220   - }
221   - return maps;
222   - }
223   -
224   - @RequestMapping(value = "/saveDlb",method = RequestMethod.POST)
225   - public Map<String, Object> saveDlb(Dlb t){
226   -// SysUser user = SecurityUtils.getCurrentUser();
227   - t.setCreatetime(new Date());
228   -// Ylb t=new Ylb();
229   - return service.saveDlb(t);
230   - }
231   -
232   - @RequestMapping(value = "/updateJsy",method = RequestMethod.GET)
233   - public Map<String, Object> updateJsy(@RequestParam Map<String, Object> map){
234   - return service.update(map);
235   - }
236   -}
src/main/java/com/bsth/controller/oil/JdlController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.io.File;
4   -import java.util.HashMap;
5   -import java.util.Map;
6   -
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestMethod;
10   -import org.springframework.web.bind.annotation.RequestParam;
11   -import org.springframework.web.bind.annotation.RestController;
12   -import org.springframework.web.multipart.MultipartFile;
13   -import org.springframework.web.servlet.ModelAndView;
14   -
15   -import com.alibaba.fastjson.JSON;
16   -import com.alibaba.fastjson.JSONArray;
17   -import com.alibaba.fastjson.JSONObject;
18   -import com.bsth.controller.BaseController;
19   -import com.bsth.entity.oil.Jdl;
20   -import com.bsth.service.oil.JdlService;
21   -import com.google.common.io.Files;
22   -
23   -@RestController
24   -@RequestMapping("jdl")
25   -public class JdlController extends BaseController<Jdl, Integer> {
26   -
27   - @Autowired
28   - JdlService jdlService;
29   -
30   - public String getDataImportClasspath(){
31   - return this.getClass().getResource("/").getPath() + "/static/pages/electricity/jdl";
32   - }
33   -
34   - @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
35   - public String uploadFile(MultipartFile file, String gsbm_, String gsName,
36   - String fgsbm_, String fgsName) throws Exception{
37   - Map<String, Object> map = new HashMap<String, Object>();
38   -// File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI());
39   -// System.out.println(ktrfile.getAbsolutePath());
40   - System.out.println(file.getSize());
41   - File newFile = new File(
42   - getDataImportClasspath() + File.separator +
43   - file.getOriginalFilename());
44   - Files.write(file.getBytes(), newFile);
45   - String result = jdlService.importExcel(newFile, gsbm_, gsName, fgsbm_, fgsName);
46   - return "{\"result\":" + "\""+result+"\"}";
47   - }
48   -
49   - @RequestMapping(value = "/query",method = RequestMethod.GET)
50   - public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{
51   - return jdlService.query(map);
52   - }
53   -
54   -}
src/main/java/com/bsth/controller/oil/LsylbController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.text.SimpleDateFormat;
4   -import java.util.ArrayList;
5   -import java.util.HashMap;
6   -import java.util.Iterator;
7   -import java.util.List;
8   -import java.util.Map;
9   -
10   -import org.springframework.beans.factory.annotation.Autowired;
11   -import org.springframework.web.bind.annotation.RequestMapping;
12   -import org.springframework.web.bind.annotation.RequestMethod;
13   -import org.springframework.web.bind.annotation.RequestParam;
14   -import org.springframework.web.bind.annotation.RestController;
15   -
16   -import com.bsth.controller.BaseController;
17   -import com.bsth.entity.oil.Lsylb;
18   -import com.bsth.entity.oil.Ylb;
19   -import com.bsth.service.oil.LsylbService;
20   -import com.bsth.util.Arith;
21   -import com.bsth.util.ReportUtils;
22   -
23   -@RestController
24   -@RequestMapping("lsylb")
25   -public class LsylbController extends BaseController<Ylb, Integer>{
26   - @Autowired
27   - LsylbService lsylbService;
28   -
29   - @RequestMapping(value = "/lsylbList",method = RequestMethod.GET)
30   - public List<Lsylb> lsylbList(@RequestParam Map<String, Object> map){
31   - List<Lsylb> ylbList=lsylbService.listYlb(map);
32   - return ylbList;
33   - }
34   -
35   - @RequestMapping(value = "/sumLsylb",method = RequestMethod.GET)
36   - public Map<String, Object> sumLsylb(@RequestParam Map<String, Object> map){
37   - Map<String, Object> list=lsylbService.sumYlb(map);
38   - return list;
39   - }
40   -
41   - @RequestMapping(value = "/listExport",method = RequestMethod.POST)
42   - public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
43   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
44   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
45   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
46   - ReportUtils ee = new ReportUtils();
47   - List<Lsylb> lsylb= lsylbService.listYlb(map);
48   - String nylx=map.get("nylx").toString();
49   -// (new CustomerSpecs<Ylb>(map)).iterator();
50   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
51   - for (Lsylb y : lsylb) {
52   - Map<String, Object> m = new HashMap<String, Object>();
53   - m.put("rq", sdfMonth.format(y.getRq()));
54   - m.put("gsname",y.getGsname() );
55   - m.put("fgsname", y.getFgsname());
56   - m.put("xlname", y.getXlname()==null?"":y.getXlname());
57   - m.put("nbbm", y.getNbbm());
58   - m.put("jsy", y.getJsy());
59   - m.put("name", y.getName());
60   - m.put("czlc", "0");
61   - m.put("jzlc", "0");
62   - m.put("sh", y.getSh()==null?"0":y.getSh());
63   -
64   - String shyy ="无";
65   -
66   - if(nylx.equals("0")){
67   - m.put("jzl", y.getJzl()==null?"0":y.getJzl());
68   - m.put("czyl", y.getCzyl()==null?"0":y.getCzyl());
69   - m.put("jzyl", y.getJzyl()==null?"0":y.getJzyl());
70   - m.put("yh", y.getYh()==null?"0":y.getYh());
71   -
72   - if(y.getShyy()!=null){
73   - shyy=y.getShyy();
74   - if(shyy.equals("1")){shyy="票务用油";}
75   - else if(shyy.equals("2")){shyy="保养用油";}
76   - else if(shyy.equals("3")){shyy="报废车用油";}
77   - else if(shyy.equals("4")){shyy="其它用油";}
78   - else if(shyy.equals("5")){shyy="人保部";}
79   - else if(shyy.equals("6")){shyy="车队";}
80   - else if(shyy.equals("7")){shyy="车间(高保)";}
81   - else if(shyy.equals("8")){shyy="车间(小修)";}
82   - else{shyy ="无";}
83   - }
84   - m.put("zyh", Arith.add(m.get("sh"), m.get("yh")));
85   -
86   - String rylx="";
87   - if(y.getRylx()!=null){
88   - if(y.getRylx().equals("0")){rylx="0号柴油";}
89   - if(y.getRylx().equals("1")){rylx="负10号柴油";}
90   - }
91   - m.put("rylx", rylx);
92   - }else{
93   - m.put("cdl", y.getJzl()==null?"0":y.getJzl());
94   - m.put("czcd", y.getCzyl()==null?"0":y.getCzyl());
95   - m.put("jzcd", y.getJzyl()==null?"0":y.getJzyl());
96   - m.put("hd", y.getYh()==null?"0":y.getYh());
97   - if(y.getShyy()!=null){
98   - shyy=y.getShyy();
99   - if(shyy.equals("1")){shyy="票务用电";}
100   - else if(shyy.equals("2")){shyy="保养用电";}
101   - else if(shyy.equals("3")){shyy="报废车用电";}
102   - else if(shyy.equals("4")){shyy="其它用电";}
103   - else if(shyy.equals("5")){shyy="人保部";}
104   - else if(shyy.equals("6")){shyy="车队";}
105   - else if(shyy.equals("7")){shyy="车间(高保)";}
106   - else if(shyy.equals("8")){shyy="车间(小修)";}
107   - else{shyy ="无";}
108   - }
109   - m.put("zyh", Arith.add(m.get("sh"), m.get("hd")));
110   - m.put("rdlx", "");
111   -
112   - }
113   - m.put("shyy", shyy);
114   - m.put("ns", y.getNs()==null?"0":y.getNs());
115   - m.put("zlc", y.getZlc()==null?"0":y.getZlc());
116   - m.put("bglyh", y.getBglyh());
117   - resList.add(m);
118   - }
119   - try {
120   - map.put("sheetName", map.get("rq"));
121   - listI.add(resList.iterator());
122   - String xls="";
123   - String name="";
124   -
125   - if(nylx.equals("0")){
126   - xls="list.xls";
127   - name="进出场存油量.xls";
128   - }else{
129   - xls="listDl.xls";
130   - name="进出场存电量.xls";
131   - }
132   - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
133   - ee.excelReplace(listI, new Object[] { map }, path+"mould/"+xls,
134   - path+"export/"+map.get("rq").toString()+ name);
135   - } catch (Exception e) {
136   - e.printStackTrace();
137   - }
138   -
139   - return resList;
140   -
141   - }
142   -}
src/main/java/com/bsth/controller/oil/YlbController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.text.ParseException;
4   -import java.text.SimpleDateFormat;
5   -import java.util.ArrayList;
6   -import java.util.Calendar;
7   -import java.util.Date;
8   -import java.util.GregorianCalendar;
9   -import java.util.HashMap;
10   -import java.util.Iterator;
11   -import java.util.List;
12   -import java.util.Map;
13   -
14   -import javax.servlet.http.HttpServletRequest;
15   -
16   -import org.springframework.beans.factory.annotation.Autowired;
17   -import org.springframework.data.domain.Page;
18   -import org.springframework.data.domain.PageRequest;
19   -import org.springframework.data.domain.Sort;
20   -import org.springframework.data.domain.Sort.Direction;
21   -import org.springframework.web.bind.annotation.PathVariable;
22   -import org.springframework.web.bind.annotation.RequestMapping;
23   -import org.springframework.web.bind.annotation.RequestMethod;
24   -import org.springframework.web.bind.annotation.RequestParam;
25   -import org.springframework.web.bind.annotation.RestController;
26   -
27   -import com.bsth.controller.BaseController;
28   -import com.bsth.entity.oil.Ylb;
29   -import com.bsth.entity.sys.Dictionary;
30   -import com.bsth.entity.sys.SysUser;
31   -import com.bsth.security.util.SecurityUtils;
32   -import com.bsth.service.oil.YlbService;
33   -import com.bsth.service.sys.DictionaryService;
34   -import com.bsth.util.Arith;
35   -import com.bsth.util.ReportUtils;
36   -import com.google.common.base.Splitter;
37   -
38   -@RestController
39   -@RequestMapping("ylb")
40   -public class YlbController extends BaseController<Ylb, Integer>{
41   - @Autowired
42   - YlbService ylbService;
43   - @Autowired
44   - DictionaryService dictionaryService;
45   - @RequestMapping(value = "/saveYlb",method = RequestMethod.POST)
46   - public Map<String, Object> saveYlb(Ylb t){
47   -// SysUser user = SecurityUtils.getCurrentUser();
48   - t.setCreatetime(new Date());
49   -// Ylb t=new Ylb();
50   - return ylbService.saveYlb(t);
51   - }
52   -
53   - @RequestMapping(value = "/updateJsy",method = RequestMethod.GET)
54   - public Map<String, Object> updateJsy(@RequestParam Map<String, Object> map){
55   - return ylbService.update(map);
56   - }
57   -
58   -
59   - /**
60   - * 把加油(YLXXB)的数据加入
61   - * @param map
62   - * @return
63   - */
64   - @RequestMapping(value = "/obtain",method = RequestMethod.GET)
65   - public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{
66   - Map<String, Object> list =new HashMap<String, Object>();
67   - try {
68   -
69   - list = ylbService.obtain(map);
70   - } catch (Exception e) {
71   - // TODO Auto-generated catch block
72   - throw e;
73   - }
74   - System.out.println();
75   - return list;
76   - }
77   -
78   -
79   - @RequestMapping(value = "/saveYlbList",method = RequestMethod.POST)
80   - public Map<String, Object> saveYlbList(@RequestParam Map<String, Object> map){
81   - Map<String, Object> list=new HashMap<String, Object>();
82   - try {
83   - list = ylbService.saveYlbList(map);
84   - } catch (Exception e) {
85   - // TODO Auto-generated catch block
86   - e.printStackTrace();
87   - }
88   - return list;
89   - }
90   - /**
91   - * 拆分油量
92   - * @param map
93   - * @return
94   - */
95   - @RequestMapping(value = "/sort",method = RequestMethod.POST)
96   - public Map<String, Object> sort(@RequestParam Map<String, Object> map){
97   - Map<String, Object> list=new HashMap<String, Object>();
98   - try {
99   - list=ylbService.sort(map);
100   - } catch (Exception e) {
101   - // TODO: handle exception
102   - }
103   - return list;
104   - }
105   -
106   - /**
107   - * 进场油量等于出场油量
108   - * @param map
109   - * @return
110   - */
111   - @RequestMapping(value = "/outAndIn",method = RequestMethod.GET)
112   - public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map) throws Exception{
113   - Map<String, Object> list=new HashMap<String, Object>();
114   - try {
115   -
116   - list=ylbService.outAndIn(map);
117   - } catch (Exception e) {
118   - // TODO: handle exception
119   - }
120   -
121   - return list;
122   - }
123   -
124   - /**
125   - * 核对油量(有加油没里程)
126   - * @param map
127   - * @return
128   - */
129   - @RequestMapping(value = "/checkYl",method = RequestMethod.GET)
130   - public Map<String, Object> checkYl(@RequestParam Map<String, Object> map){
131   - Map<String, Object> list=new HashMap<String, Object>();
132   - try {
133   - list=ylbService.checkYl(map);
134   - } catch (Exception e) {
135   - // TODO: handle exception
136   - }
137   - return list;
138   - }
139   -
140   - /**
141   - *
142   - * @Title: list
143   - * @Description: TODO(多条件分页查询)
144   - * @param @param map 查询条件
145   - * @param @param page 页码
146   - * @param @param size 每页显示数量
147   - * @throws
148   - */
149   - @RequestMapping(method = RequestMethod.GET)
150   - public Page<Ylb> list(@RequestParam Map<String, Object> map,
151   - @RequestParam(defaultValue = "0") int page,
152   - @RequestParam(defaultValue = "10") int size,
153   - @RequestParam(defaultValue = "id") String order,
154   - @RequestParam(defaultValue = "DESC") String direction){
155   -
156   - Direction d;
157   - map.put("xlbm_like", map.get("xlbm_like").toString().trim());
158   - String rq=map.get("rq").toString();
159   - int lx=Integer.parseInt(map.get("sxtj").toString().trim());
160   - if(lx>0){
161   - map.put("nbbm_in", ylbService.checkNbmmNum(rq, map.get("ssgsdm_like").toString(),
162   - map.get("fgsdm_like").toString(), map.get("xlbm_like").toString(),
163   - map.get("nbbm_eq").toString(),lx));
164   - }
165   -// try {
166   -
167   - if(!(rq=="")){
168   -//
169   -// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
170   -// Calendar calendar = new GregorianCalendar();
171   -// calendar.setTime(sdf.parse(rq));
172   -// calendar.add(calendar.DATE,1);
173   -// Date date=calendar.getTime();
174   - map.put("rq_eq", rq);
175   -// map.put("rq_lt", sdf.format(date));
176   -// System.out.println(rq);
177   -// System.out.println(sdf.format(date));
178   - }
179   -// } catch (ParseException e) {
180   -// // TODO Auto-generated catch block
181   -// e.printStackTrace();
182   -// }
183   - if(null != direction && direction.equals("ASC"))
184   - d = Direction.ASC;
185   - else
186   - d = Direction.DESC;
187   -
188   - // 允许多个字段排序,order可以写单个字段,也可以写多个字段
189   - // 多个字段格式:{col1},{col2},{col3},....,{coln}
190   - // 每个字段的排序方向都是一致,这个以后再看要不要改
191   - List<String> list = Splitter.on(",").trimResults().splitToList(order);
192   - return baseService.list(map, new PageRequest(page, size, new Sort(d, list)));
193   - }
194   -
195   -
196   -
197   -
198   - /**
199   - *
200   - * @Title: list
201   - * @Description: TODO(多条件分页查询)
202   - * @param @param map 查询条件
203   - * @param @param page 页码
204   - * @param @param size 每页显示数量
205   - * @throws
206   - */
207   - @RequestMapping(value = "/ylbList",method = RequestMethod.GET)
208   - public List<Ylb> ylbList(@RequestParam Map<String, Object> map){
209   - List<Ylb> ylbList=ylbService.listYlb(map);
210   - return ylbList;
211   - }
212   -
213   - @RequestMapping(value = "/deleteIds", method = RequestMethod.POST)
214   - public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) {
215   - Map<String, Object> maps=new HashMap<String, Object>();
216   - try {
217   - maps= ylbService.deleteIds(map);
218   - } catch (Exception e) {
219   - // TODO Auto-generated catch block
220   - e.printStackTrace();
221   - }
222   - return maps;
223   - }
224   - @RequestMapping(value="/oilListMonth")
225   - public List<Map<String, Object>> oilListMonth(@RequestParam Map<String, Object> map){
226   - return ylbService.oilListMonth(map);
227   - }
228   -
229   - @RequestMapping(value = "/checkJsy",method = RequestMethod.GET)
230   - public String checkJsy(@RequestParam Map<String, Object> map){
231   - String list=ylbService.checkJsy(map);
232   - return list;
233   - }
234   -
235   - @RequestMapping(value = "/checkDate",method = RequestMethod.GET)
236   - public String checkDate(@RequestParam Map<String, Object> map){
237   - String list=ylbService.checkDate(map);
238   - return list;
239   - }
240   -
241   - @RequestMapping(value = "/sumYlb",method = RequestMethod.GET)
242   - public Map<String, Object> sumYlb(@RequestParam Map<String, Object> map){
243   - Map<String, Object> list=ylbService.sumYlb(map);
244   - return list;
245   - }
246   -
247   - @RequestMapping(value = "/listExport",method = RequestMethod.POST)
248   - public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
249   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
250   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
251   - Map<String, Object> dMap=new HashMap<>();
252   - dMap.put("dGroup_eq", "oilType");
253   - Iterator<Dictionary> it= dictionaryService.list(dMap).iterator();
254   - while (it.hasNext()) {
255   - Dictionary d=it.next();
256   - dMap.put(d.getdCode(), d.getdName());
257   - }
258   -
259   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
260   - ReportUtils ee = new ReportUtils();
261   - List<Ylb> ylb= ylbService.listYlb(map);
262   -
263   -// (new CustomerSpecs<Ylb>(map)).iterator();
264   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
265   - for (Ylb y : ylb) {
266   - Map<String, Object> m = new HashMap<String, Object>();
267   - m.put("rq", sdfMonth.format(y.getRq()));
268   - m.put("gsname",y.getGsname() );
269   - m.put("fgsname", y.getFgsname());
270   - if(y.getLinename()==null){
271   - m.put("xlname", y.getXlname()==null?"":y.getXlname());
272   - }else{
273   - m.put("xlname", y.getLinename());
274   - }
275   - m.put("nbbm", y.getNbbm());
276   - m.put("jsy", y.getJsy());
277   - m.put("name", y.getName());
278   - m.put("jzl", y.getJzl()<=0?"0":y.getJzl());
279   - m.put("czlc", "0");
280   - m.put("jzlc", "0");
281   - m.put("czyl", y.getCzyl()<=0?"0":y.getCzyl());
282   - m.put("jzyl", y.getJzyl()<=0?"0":y.getJzyl());
283   - m.put("yh", y.getYh()<=0?"0":y.getYh());
284   - String rylx="";
285   - if(y.getRylx()!=null){
286   - /*if(y.getRylx().equals("0")){rylx="0号柴油";}
287   - if(y.getRylx().equals("1")){rylx="负10号柴油";}*/
288   - if(dMap.get(y.getRylx())==null){
289   - rylx="";
290   - }else{
291   - rylx=dMap.get(y.getRylx()).toString();
292   - }
293   - }
294   - m.put("rylx", rylx);
295   - m.put("ns", y.getNs()==null?"0":y.getNs());
296   - String shyy ="无";
297   - if(y.getShyy()!=null){
298   - shyy=y.getShyy();
299   - if(shyy.equals("1")){shyy="票务用油";}
300   - else if(shyy.equals("2")){shyy="保养用油";}
301   - else if(shyy.equals("3")){shyy="报废车用油";}
302   - else if(shyy.equals("4")){shyy="其它用油";}
303   - else if(shyy.equals("5")){shyy="人保部";}
304   - else if(shyy.equals("6")){shyy="车队";}
305   - else if(shyy.equals("7")){shyy="车间(高保)";}
306   - else if(shyy.equals("8")){shyy="车间(小修)";}
307   - else{shyy ="无";}
308   - }
309   - m.put("shyy", shyy);
310   - m.put("sh", y.getSh()<=0?"0":y.getSh());
311   - m.put("zlc", y.getZlc()<=0?"0":y.getZlc());
312   - m.put("bglyh", y.getBglyh());
313   - m.put("zyh", Arith.add(y.getSh(), y.getYh()));
314   - resList.add(m);
315   - }
316   - try {
317   - map.put("sheetName", map.get("rq"));
318   - listI.add(resList.iterator());
319   - String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
320   - ee.excelReplace(listI, new Object[] { map }, path+"mould/list.xls",
321   - path+"export/"+map.get("rq").toString()+ "进出场存油量.xls");
322   - } catch (Exception e) {
323   - e.printStackTrace();
324   - }
325   -
326   - return resList;
327   -
328   - }
329   -
330   - /*
331   - * 历史修改行车路单后重新统计油量信息 (传参:line --线路编码 date --日期)
332   - */
333   -
334   - @RequestMapping(value = "/updateHistory",method = RequestMethod.POST)
335   - public Map<String, Object> updateHistory(@RequestParam Map<String, Object> map) throws Exception{
336   - Map<String, Object> list =new HashMap<String, Object>();
337   - try {
338   - list = ylbService.updateHistory(map);
339   - } catch (Exception e) {
340   - // TODO Auto-generated catch block
341   - throw e;
342   - }
343   - return list;
344   - }
345   -
346   -
347   -}
src/main/java/com/bsth/controller/oil/YlxxbController.java deleted 100644 → 0
1   -package com.bsth.controller.oil;
2   -
3   -import java.util.HashMap;
4   -import java.util.List;
5   -import java.util.Map;
6   -
7   -import org.springframework.beans.factory.annotation.Autowired;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestMethod;
10   -import org.springframework.web.bind.annotation.RequestParam;
11   -import org.springframework.web.bind.annotation.RestController;
12   -
13   -import com.bsth.controller.BaseController;
14   -import com.bsth.entity.oil.Ylxxb;
15   -import com.bsth.service.oil.YlxxbService;
16   -import com.bsth.util.PageObject;
17   -
18   -@RestController
19   -@RequestMapping("ylxxb")
20   -public class YlxxbController extends BaseController<Ylxxb, Integer>{
21   - @Autowired
22   - private YlxxbService service;
23   - @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
24   - public PageObject<Ylxxb> pagequery(@RequestParam Map<String, Object> map){
25   - PageObject<Ylxxb> pagequery=null;
26   - map.put("curPage", map.get("page").toString());
27   - map.put("pageData","10");
28   - pagequery=service.Pagequery(map);
29   - return pagequery;
30   - }
31   -
32   - @RequestMapping(value = "/listNbbm",method = RequestMethod.GET)
33   - public List<Ylxxb> listNbbm(@RequestParam Map<String, Object> map){
34   - List<Ylxxb> list=service.Pagequery_nbbm(map);
35   - return list;
36   - }
37   -
38   -
39   - /**
40   - * 核对油量(有加油没里程)
41   - * @param map
42   - * @return
43   - */
44   - @RequestMapping(value = "/check",method = RequestMethod.POST)
45   - public Map<String, Object> check(@RequestParam Map<String, Object> map){
46   - Map<String, Object> list=new HashMap<>();
47   - try {
48   - list = service.checkJsy(map);
49   - } catch (Exception e) {
50   - // TODO Auto-generated catch block
51   - e.printStackTrace();
52   - }
53   - return list;
54   - }
55   -
56   - @RequestMapping(value = "/checkNbbm",method = RequestMethod.POST)
57   - public Map<String, Object> checkNbbm(@RequestParam Map<String, Object> map){
58   - Map<String, Object> list=new HashMap<>();
59   - try {
60   - list = service.checkNbbm(map);
61   - } catch (Exception e) {
62   - // TODO Auto-generated catch block
63   - e.printStackTrace();
64   - }
65   - return list;
66   - }
67   -
68   - @RequestMapping(value="/saveYlxxb",method = RequestMethod.POST)
69   - public Map<String, Object> savejzl(@RequestParam Map<String, Object> map){
70   - Map<String, Object> maps=new HashMap<>();
71   - try {
72   - maps = service.saveYlxxb(map);
73   - } catch (Exception e) {
74   - // TODO Auto-generated catch block
75   - e.printStackTrace();
76   - }
77   - return maps;
78   - }
79   -
80   -}
src/main/java/com/bsth/controller/realcontrol/summary/DestroySituationController.java deleted 100644 → 0
1   -package com.bsth.controller.realcontrol.summary;
2   -
3   -import com.bsth.controller.BaseController;
4   -import com.bsth.data.summary.entity.DestroySituation;
5   -import com.bsth.data.summary.service.DestroySituationService;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestParam;
9   -import org.springframework.web.bind.annotation.RestController;
10   -
11   -import javax.servlet.http.HttpServletRequest;
12   -import javax.servlet.http.HttpServletResponse;
13   -import java.util.Map;
14   -
15   -/**
16   - * Created by panzhao on 2017/11/1.
17   - */
18   -@RestController
19   -@RequestMapping("/summary/destroy_detail")
20   -public class DestroySituationController extends BaseController<DestroySituation, Long> {
21   -
22   - @Autowired
23   - DestroySituationService destroySituationService;
24   -
25   - @RequestMapping("excel")
26   - public void excel(@RequestParam Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) {
27   - destroySituationService.excel(map, request, response);
28   - }
29   -}
src/main/java/com/bsth/controller/realcontrol/summary/FastAndSlowController.java deleted 100644 → 0
1   -package com.bsth.controller.realcontrol.summary;
2   -
3   -import com.bsth.controller.BaseController;
4   -import com.bsth.data.summary.entity.FastAndSlow;
5   -import com.bsth.data.summary.service.FastAndSlowService;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.PathVariable;
8   -import org.springframework.web.bind.annotation.RequestMapping;
9   -import org.springframework.web.bind.annotation.RequestParam;
10   -import org.springframework.web.bind.annotation.RestController;
11   -
12   -import javax.servlet.http.HttpServletRequest;
13   -import javax.servlet.http.HttpServletResponse;
14   -
15   -/**
16   - * 快慢误点统计
17   - * Created by panzhao on 2017/10/24.
18   - */
19   -@RestController
20   -@RequestMapping("/summary/fastAndSlow")
21   -public class FastAndSlowController extends BaseController<FastAndSlow, Long> {
22   -
23   - @Autowired
24   - FastAndSlowService fastAndSlowService;
25   -
26   - @RequestMapping("/excel/{lineCode}")
27   - public void excel(@PathVariable("lineCode") String lineCode, @RequestParam String st
28   - , @RequestParam String et, @RequestParam int type, HttpServletRequest request, HttpServletResponse response) {
29   - fastAndSlowService.excel(lineCode, st, et, type, request, response);
30   - }
31   -}
32 0 \ No newline at end of file
src/main/java/com/bsth/controller/realcontrol/summary/HoursController.java deleted 100644 → 0
1   -package com.bsth.controller.realcontrol.summary;
2   -
3   -import com.bsth.controller.BaseController;
4   -import com.bsth.data.summary.entity.Hours_jsy;
5   -import org.springframework.web.bind.annotation.RequestMapping;
6   -import org.springframework.web.bind.annotation.RestController;
7   -
8   -/**
9   - * 汇总数据 -工时
10   - * Created by panzhao on 2017/7/27.
11   - */
12   -@RestController
13   -@RequestMapping("/summary/hours")
14   -public class HoursController extends BaseController<Hours_jsy, Long>{
15   -}
src/main/java/com/bsth/controller/realcontrol/summary/TempSchSituationController.java deleted 100644 → 0
1   -package com.bsth.controller.realcontrol.summary;
2   -
3   -import com.bsth.controller.BaseController;
4   -import com.bsth.data.summary.entity.TempSchSituation;
5   -import com.bsth.data.summary.service.TempSchSituationService;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestMapping;
8   -import org.springframework.web.bind.annotation.RequestParam;
9   -import org.springframework.web.bind.annotation.RestController;
10   -
11   -import javax.servlet.http.HttpServletRequest;
12   -import javax.servlet.http.HttpServletResponse;
13   -import java.util.Map;
14   -
15   -/**
16   - * Created by panzhao on 2017/11/1.
17   - */
18   -@RestController
19   -@RequestMapping("/summary/temp_sch")
20   -public class TempSchSituationController extends BaseController<TempSchSituation, Long> {
21   -
22   - @Autowired
23   - TempSchSituationService tempSchSituationService;
24   -
25   - @RequestMapping("excel")
26   - public void excel(@RequestParam Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) {
27   - tempSchSituationService.excel(map, request, response);
28   - }
29   -}
src/main/java/com/bsth/controller/report/CalcSheetController.java deleted 100644 → 0
1   -package com.bsth.controller.report;
2   -import java.util.List;
3   -import java.util.Map;
4   -
5   -import org.springframework.beans.factory.annotation.Autowired;
6   -import org.springframework.web.bind.annotation.RequestMapping;
7   -import org.springframework.web.bind.annotation.RequestMethod;
8   -import org.springframework.web.bind.annotation.RequestParam;
9   -import org.springframework.web.bind.annotation.RestController;
10   -import com.bsth.controller.BaseController;
11   -import com.bsth.entity.sheet.CalcSheet;
12   -import com.bsth.entity.sheet.Sheet;
13   -import com.bsth.service.report.CalcSheetService;
14   -
15   -@RestController
16   -@RequestMapping("calcSheet")
17   -public class CalcSheetController extends BaseController<CalcSheet, Integer>{
18   - @Autowired
19   - CalcSheetService calcSheetService;
20   - //发车到站准点率统计
21   - @RequestMapping(value = "/countList",method = RequestMethod.GET)
22   - public List<CalcSheet> countList(@RequestParam Map<String, Object> map){
23   - List<CalcSheet> list=calcSheetService.countListCalcSheet(map);
24   - return list;
25   - }
26   - //发车到站准点率列表
27   - @RequestMapping(value = "/calcListSheet",method = RequestMethod.GET)
28   - public List<CalcSheet> calcListSheet(@RequestParam Map<String, Object> map){
29   - List<CalcSheet> list=calcSheetService.calcListSheet(map);
30   - return list;
31   - }
32   -
33   - //D级别线路发车到站准点率列表
34   - @RequestMapping(value = "/calcListSheet_d",method = RequestMethod.GET)
35   - public List<CalcSheet> calcListSheet_d(@RequestParam Map<String, Object> map){
36   - List<CalcSheet> list=calcSheetService.calcListSheet_d(map);
37   - return list;
38   - }
39   -
40   - //发车站点准点率详细
41   - @RequestMapping(value = "/calcSheet",method = RequestMethod.GET)
42   - public List<Sheet> calcSheet(@RequestParam Map<String, Object> map){
43   - List<Sheet> list=calcSheetService.calcSheet(map);
44   - return list;
45   - }
46   -
47   - //营运线路出车率统计
48   - @RequestMapping(value = "/calcTurnoutrate",method = RequestMethod.GET)
49   - public List<Map<String, Object>> calcTurnoutrate(@RequestParam Map<String, Object> map){
50   - List<Map<String, Object>> list=calcSheetService.calcTurnoutrate(map);
51   - return list;
52   - }
53   -
54   -
55   - @RequestMapping(value = "/calcTurnoutrateZgf",method = RequestMethod.GET)
56   - public List<Map<String, Object>> calcTurnoutrateZgf(@RequestParam Map<String, Object> map){
57   - List<Map<String, Object>> list=calcSheetService.calcTurnoutrateZgf(map);
58   - return list;
59   - }
60   -}
src/main/java/com/bsth/controller/report/CardIsingningController.java deleted 100644 → 0
1   -package com.bsth.controller.report;
2   -
3   -
4   -import com.bsth.entity.card_signing.CardSigning;
5   -import com.bsth.service.report.CardSigningService;
6   -import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.*;
8   -
9   -import java.util.List;
10   -import java.util.Map;
11   -
12   -@RestController
13   -@RequestMapping("CardSigning")
14   -public class CardIsingningController {
15   - @Autowired
16   - CardSigningService cardSigningService;
17   -
18   - //线路插卡率列表
19   - @RequestMapping(value = "/cardList",method = RequestMethod.GET)
20   - public List<CardSigning> sheetList(@RequestParam Map<String, Object> map){
21   - List<CardSigning> list= cardSigningService.cardList(map);
22   - return list;
23   - }
24   -
25   - //线路插卡率 线路详细列表第二级
26   - @RequestMapping(value = "/calcListSheet",method = RequestMethod.GET)
27   - public List<CardSigning> calcListSheet(@RequestParam Map<String, Object> map){
28   - List<CardSigning> list= cardSigningService.calcListSheet(map);
29   - return list;
30   - }
31   -
32   - //线路插卡率 线路详细列表第二级
33   - @RequestMapping(value = "/calcSheet",method = RequestMethod.GET)
34   - public List<CardSigning> calcSheet(@RequestParam Map<String, Object> map){
35   - List<CardSigning> list= cardSigningService.calcSheet(map);
36   - return list;
37   - }
38   -
39   -
40   -
41   -
42   -}
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java deleted 100644 → 0
1   -package com.bsth.data.schedule.thread;
2   -
3   -import com.bsth.data.directive.DayOfDirectives;
4   -import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
5   -import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
6   -import com.bsth.service.calc.CalcWaybillService;
7   -import com.bsth.service.oil.DlbService;
8   -import com.bsth.data.safe_driv.SafeDrivCenter;
9   -import com.bsth.service.oil.YlbService;
10   -import com.bsth.service.report.SheetService;
11   -
12   -import org.slf4j.Logger;
13   -import org.slf4j.LoggerFactory;
14   -import org.springframework.beans.factory.annotation.Autowired;
15   -import org.springframework.stereotype.Component;
16   -
17   -/**
18   - * 计算油、公里加注量 线程
19   - * Created by panzhao on 2017/3/7.
20   - */
21   -@Component
22   -public class CalcOilThread extends Thread{
23   -
24   - @Autowired
25   - YlbService ylbService;
26   - @Autowired
27   - DlbService dlbService;
28   -
29   - @Autowired
30   - SheetService sheetService;
31   - Logger logger = LoggerFactory.getLogger(this.getClass());
32   -
33   - @Autowired
34   - DayOfDirectives dayOfDirectives;
35   -
36   - @Autowired
37   - CalcWaybillService calcWaybillService;
38   -
39   - @Override
40   - public void run() {
41   - logger.info("开始计算油量平衡表....");
42   - try{
43   - ylbService.obtainDsq();
44   -// logger.info("开始计算班次准点率....");
45   -// sheetService.saveSheetList("");
46   -// logger.info("计算班次准点率结束!");
47   - } catch(Exception e){
48   - logger.error("计算油量平衡表失败",e);
49   - }
50   - try{
51   - logger.info("开始计算电量平衡表....");
52   - dlbService.obtainDsq();
53   - } catch(Exception e){
54   - logger.error("计算电量平衡表失败",e);
55   - }
56   -
57   - try{
58   - logger.info("计算路单里程加注量结束!");
59   - calcWaybillService.autoGenerate("", "");
60   - }catch(Exception e){
61   - logger.error("计算路单里程失败",e);
62   - }
63   -
64   - logger.info("开始保存统计日报....");
65   - try{
66   - calcWaybillService.calcDaily("", "");
67   - }catch(Exception e){
68   - logger.error("统计日报失败",e);
69   - }
70   - //清除指令数据
71   - dayOfDirectives.clearAll();
72   - //清除安全驾驶数据
73   - SafeDrivCenter.clear();
74   - //清除超速缓存数据
75   - OverspeedProcess.clear();
76   -
77   - GpsDataLoaderThread.setFlag(0);
78   -
79   - }
80   -}
src/main/java/com/bsth/data/summary/entity/DestroySituation.java deleted 100644 → 0
1   -package com.bsth.data.summary.entity;
2   -
3   -import javax.persistence.Entity;
4   -import javax.persistence.Id;
5   -import javax.persistence.Table;
6   -
7   -/**
8   - * 烂班情况
9   - * Created by panzhao on 2017/10/31.
10   - */
11   -@Entity
12   -@Table(name = "z_calc_destroy_detail")
13   -public class DestroySituation {
14   -
15   - @Id
16   - private Long id;
17   -
18   - private String rq;
19   -
20   - private String gsBm;
21   -
22   - private String fgsBm;
23   -
24   - private String lineCode;
25   -
26   - private String lineName;
27   -
28   - private String nbbm;
29   -
30   - private String jGh;
31   -
32   - private String sGh;
33   -
34   - private String reason;
35   -
36   - private int size;
37   -
38   - private Double mileage;
39   -
40   - private Long t;
41   -
42   - private String remark;
43   -
44   - private String idsStr;
45   -
46   - public Long getId() {
47   - return id;
48   - }
49   -
50   - public void setId(Long id) {
51   - this.id = id;
52   - }
53   -
54   - public String getRq() {
55   - return rq;
56   - }
57   -
58   - public void setRq(String rq) {
59   - this.rq = rq;
60   - }
61   -
62   - public String getLineCode() {
63   - return lineCode;
64   - }
65   -
66   - public void setLineCode(String lineCode) {
67   - this.lineCode = lineCode;
68   - }
69   -
70   - public String getLineName() {
71   - return lineName;
72   - }
73   -
74   - public void setLineName(String lineName) {
75   - this.lineName = lineName;
76   - }
77   -
78   - public String getNbbm() {
79   - return nbbm;
80   - }
81   -
82   - public void setNbbm(String nbbm) {
83   - this.nbbm = nbbm;
84   - }
85   -
86   - public String getjGh() {
87   - return jGh;
88   - }
89   -
90   - public void setjGh(String jGh) {
91   - this.jGh = jGh;
92   - }
93   -
94   - public String getsGh() {
95   - return sGh;
96   - }
97   -
98   - public void setsGh(String sGh) {
99   - this.sGh = sGh;
100   - }
101   -
102   - public String getReason() {
103   - return reason;
104   - }
105   -
106   - public void setReason(String reason) {
107   - this.reason = reason;
108   - }
109   -
110   - public int getSize() {
111   - return size;
112   - }
113   -
114   - public void setSize(int size) {
115   - this.size = size;
116   - }
117   -
118   - public Double getMileage() {
119   - return mileage;
120   - }
121   -
122   - public void setMileage(Double mileage) {
123   - this.mileage = mileage;
124   - }
125   -
126   - public Long getT() {
127   - return t;
128   - }
129   -
130   - public void setT(Long t) {
131   - this.t = t;
132   - }
133   -
134   - public String getRemark() {
135   - return remark;
136   - }
137   -
138   - public void setRemark(String remark) {
139   - this.remark = remark;
140   - }
141   -
142   - public String getIdsStr() {
143   - return idsStr;
144   - }
145   -
146   - public void setIdsStr(String idsStr) {
147   - this.idsStr = idsStr;
148   - }
149   -
150   - public String getGsBm() {
151   - return gsBm;
152   - }
153   -
154   - public void setGsBm(String gsBm) {
155   - this.gsBm = gsBm;
156   - }
157   -
158   - public String getFgsBm() {
159   - return fgsBm;
160   - }
161   -
162   - public void setFgsBm(String fgsBm) {
163   - this.fgsBm = fgsBm;
164   - }
165   -}
src/main/java/com/bsth/data/summary/entity/FastAndSlow.java deleted 100644 → 0
1   -package com.bsth.data.summary.entity;
2   -
3   -import javax.persistence.Column;
4   -import javax.persistence.Entity;
5   -import javax.persistence.Id;
6   -import javax.persistence.Table;
7   -
8   -/**
9   - * 快慢误点
10   - * Created by panzhao on 2017/10/24.
11   - */
12   -@Entity
13   -@Table(name = "z_calc_fast_slow")
14   -public class FastAndSlow {
15   -
16   - /**
17   - * 班次ID
18   - */
19   - @Id
20   - @Column(name = "s_id")
21   - private Long id;
22   -
23   - /**
24   - * 驾驶员
25   - */
26   - private String jsy;
27   -
28   - /**
29   - * 车辆自编号
30   - */
31   - private String nbbm;
32   -
33   - /**
34   - * 路牌名称
35   - */
36   - @Column(name = "lp_name")
37   - private String lpName;
38   -
39   - /**
40   - * 发车站点
41   - */
42   - private String stationName;
43   -
44   - /**
45   - * 日期
46   - */
47   - @Column(name = "rq")
48   - private String rq;
49   -
50   - /**
51   - * 上下行
52   - */
53   - private int upDown;
54   -
55   - /**
56   - * 计发时间
57   - * HH:mm
58   - */
59   - private String fcsj;
60   -
61   - /**
62   - * 待发时间
63   - * HH:mm
64   - */
65   - private String dfsj;
66   -
67   - /**
68   - * 实际发车时间
69   - * HH:mm
70   - */
71   - private String fcsjActual;
72   -
73   - /**
74   - * 计发快误点
75   - */
76   - private int fcsjFast;
77   -
78   - /**
79   - * 计发慢误点
80   - */
81   - private int fcsjSlow;
82   -
83   - /**
84   - * 待发快误点
85   - */
86   - private int dfsjFast;
87   -
88   - /**
89   - * 待发慢误点
90   - */
91   - private int dfsjSlow;
92   -
93   - /**
94   - * 计划终点时间
95   - */
96   - private String zdsj;
97   -
98   - /**
99   - * 待发终点时间
100   - */
101   - private String zdsjDf;
102   -
103   - /**
104   - * 实际终点时间
105   - */
106   - private String zdsjActual;
107   -
108   - /**
109   - * 计发终点快误点
110   - */
111   - private int zdsjFast;
112   -
113   - /**
114   - * 计发终点慢误点
115   - */
116   - private int zdsjSlow;
117   -
118   - /**
119   - * 待发终点快误点
120   - */
121   - private int zdsjDfFast;
122   -
123   - /**
124   - * 待发终点慢误点
125   - */
126   - private int zdsjDfSlow;
127   -
128   - @Column(name = "line_code")
129   - private String lineCode;
130   -
131   - private Long t;
132   -
133   - public String getStationName() {
134   - return stationName;
135   - }
136   -
137   - public void setStationName(String stationName) {
138   - this.stationName = stationName;
139   - }
140   -
141   - public String getRq() {
142   - return rq;
143   - }
144   -
145   - public void setRq(String rq) {
146   - this.rq = rq;
147   - }
148   -
149   - public int getUpDown() {
150   - return upDown;
151   - }
152   -
153   - public void setUpDown(int upDown) {
154   - this.upDown = upDown;
155   - }
156   -
157   - public String getFcsj() {
158   - return fcsj;
159   - }
160   -
161   - public void setFcsj(String fcsj) {
162   - this.fcsj = fcsj;
163   - }
164   -
165   - public String getDfsj() {
166   - return dfsj;
167   - }
168   -
169   - public void setDfsj(String dfsj) {
170   - this.dfsj = dfsj;
171   - }
172   -
173   - public String getFcsjActual() {
174   - return fcsjActual;
175   - }
176   -
177   - public void setFcsjActual(String fcsjActual) {
178   - this.fcsjActual = fcsjActual;
179   - }
180   -
181   - public int getFcsjFast() {
182   - return fcsjFast;
183   - }
184   -
185   - public void setFcsjFast(int fcsjFast) {
186   - this.fcsjFast = fcsjFast;
187   - }
188   -
189   - public int getFcsjSlow() {
190   - return fcsjSlow;
191   - }
192   -
193   - public void setFcsjSlow(int fcsjSlow) {
194   - this.fcsjSlow = fcsjSlow;
195   - }
196   -
197   - public int getDfsjFast() {
198   - return dfsjFast;
199   - }
200   -
201   - public void setDfsjFast(int dfsjFast) {
202   - this.dfsjFast = dfsjFast;
203   - }
204   -
205   - public int getDfsjSlow() {
206   - return dfsjSlow;
207   - }
208   -
209   - public void setDfsjSlow(int dfsjSlow) {
210   - this.dfsjSlow = dfsjSlow;
211   - }
212   -
213   - public String getZdsj() {
214   - return zdsj;
215   - }
216   -
217   - public void setZdsj(String zdsj) {
218   - this.zdsj = zdsj;
219   - }
220   -
221   - public String getZdsjDf() {
222   - return zdsjDf;
223   - }
224   -
225   - public void setZdsjDf(String zdsjDf) {
226   - this.zdsjDf = zdsjDf;
227   - }
228   -
229   - public String getZdsjActual() {
230   - return zdsjActual;
231   - }
232   -
233   - public void setZdsjActual(String zdsjActual) {
234   - this.zdsjActual = zdsjActual;
235   - }
236   -
237   - public int getZdsjFast() {
238   - return zdsjFast;
239   - }
240   -
241   - public void setZdsjFast(int zdsjFast) {
242   - this.zdsjFast = zdsjFast;
243   - }
244   -
245   - public int getZdsjSlow() {
246   - return zdsjSlow;
247   - }
248   -
249   - public void setZdsjSlow(int zdsjSlow) {
250   - this.zdsjSlow = zdsjSlow;
251   - }
252   -
253   - public int getZdsjDfFast() {
254   - return zdsjDfFast;
255   - }
256   -
257   - public void setZdsjDfFast(int zdsjDfFast) {
258   - this.zdsjDfFast = zdsjDfFast;
259   - }
260   -
261   - public int getZdsjDfSlow() {
262   - return zdsjDfSlow;
263   - }
264   -
265   - public void setZdsjDfSlow(int zdsjDfSlow) {
266   - this.zdsjDfSlow = zdsjDfSlow;
267   - }
268   -
269   - public String getLineCode() {
270   - return lineCode;
271   - }
272   -
273   - public void setLineCode(String lineCode) {
274   - this.lineCode = lineCode;
275   - }
276   -
277   - public Long getId() {
278   - return id;
279   - }
280   -
281   - public void setId(Long id) {
282   - this.id = id;
283   - }
284   -
285   - public Long getT() {
286   - return t;
287   - }
288   -
289   - public void setT(Long t) {
290   - this.t = t;
291   - }
292   -
293   - public boolean isSlow() {
294   - return this.fcsjSlow>0 || this.dfsjSlow>0 || this.zdsjSlow>0 || this.zdsjDfSlow>0;
295   - }
296   -
297   - public boolean isFast() {
298   - return this.fcsjFast>0 || this.dfsjFast>0 || this.zdsjFast>0 || this.zdsjDfFast>0;
299   - }
300   -
301   - public String getLpName() {
302   - return lpName;
303   - }
304   -
305   - public void setLpName(String lpName) {
306   - this.lpName = lpName;
307   - }
308   -
309   - public String getNbbm() {
310   - return nbbm;
311   - }
312   -
313   - public void setNbbm(String nbbm) {
314   - this.nbbm = nbbm;
315   - }
316   -
317   - public String getJsy() {
318   - return jsy;
319   - }
320   -
321   - public void setJsy(String jsy) {
322   - this.jsy = jsy;
323   - }
324   -}
325 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/entity/Hours_jsy.java deleted 100644 → 0
1   -package com.bsth.data.summary.entity;
2   -
3   -import javax.persistence.Entity;
4   -import javax.persistence.Id;
5   -import javax.persistence.Table;
6   -import javax.persistence.Transient;
7   -import java.util.Date;
8   -
9   -/**
10   - * Created by panzhao on 2017/7/26.
11   - * table:
12   - * 驾驶员工时
13   - */
14   -@Entity
15   -@Table(name = "z_calc_hoursjsy")
16   -public class Hours_jsy {
17   -
18   - @Id
19   - private Long id;
20   -
21   - /** 公司编码 */
22   - private String companyId;
23   -
24   - /** 分公司编码 */
25   - private String subCompanyId;
26   -
27   - /** 公司名称 */
28   - @Transient
29   - private String companyName;
30   - /** 分公司名称 */
31   - @Transient
32   - private String subCompanyName;
33   -
34   - /** 线路编码 */
35   - private String lineCode;
36   -
37   - /** 线路名称 */
38   - private String lineName;
39   -
40   - /** 驾驶员工号 */
41   - private String jsy;
42   -
43   - /** 驾驶员姓名 */
44   - private String jsyName;
45   -
46   - /** 车辆自编号 */
47   - private String nbbm;
48   -
49   - /** 路牌 */
50   - private String lpName;
51   -
52   - /** 日期 (班次日期) */
53   - private String rq;
54   -
55   - /** 计划工时(分钟) */
56   - private Integer hoursJh;
57   - @Transient
58   - private String hoursJhStr;
59   -
60   - /** 实际工时(分钟) */
61   - private Integer hoursSj;
62   - @Transient
63   - private String hoursSjStr;
64   -
65   - /** 来源 0: 从路单结算、 1:人工录入 */
66   - private int source;
67   -
68   - /** 备注 */
69   - private String remarks;
70   -
71   - private Date createDate;
72   -
73   - public String getCompanyId() {
74   - return companyId;
75   - }
76   -
77   - public void setCompanyId(String companyId) {
78   - this.companyId = companyId;
79   - }
80   -
81   - public String getSubCompanyId() {
82   - return subCompanyId;
83   - }
84   -
85   - public void setSubCompanyId(String subCompanyId) {
86   - this.subCompanyId = subCompanyId;
87   - }
88   -
89   - public String getLineCode() {
90   - return lineCode;
91   - }
92   -
93   - public void setLineCode(String lineCode) {
94   - this.lineCode = lineCode;
95   - }
96   -
97   - public String getLineName() {
98   - return lineName;
99   - }
100   -
101   - public void setLineName(String lineName) {
102   - this.lineName = lineName;
103   - }
104   -
105   - public String getJsy() {
106   - return jsy;
107   - }
108   -
109   - public void setJsy(String jsy) {
110   - this.jsy = jsy;
111   - }
112   -
113   - public String getJsyName() {
114   - return jsyName;
115   - }
116   -
117   - public void setJsyName(String jsyName) {
118   - this.jsyName = jsyName;
119   - }
120   -
121   - public String getNbbm() {
122   - return nbbm;
123   - }
124   -
125   - public void setNbbm(String nbbm) {
126   - this.nbbm = nbbm;
127   - }
128   -
129   - public String getLpName() {
130   - return lpName;
131   - }
132   -
133   - public void setLpName(String lpName) {
134   - this.lpName = lpName;
135   - }
136   -
137   - public String getRq() {
138   - return rq;
139   - }
140   -
141   - public void setRq(String rq) {
142   - this.rq = rq;
143   - }
144   -
145   -
146   - public int getSource() {
147   - return source;
148   - }
149   -
150   - public void setSource(int source) {
151   - this.source = source;
152   - }
153   -
154   - public String getRemarks() {
155   - return remarks;
156   - }
157   -
158   - public void setRemarks(String remarks) {
159   - this.remarks = remarks;
160   - }
161   -
162   - public Date getCreateDate() {
163   - return createDate;
164   - }
165   -
166   - public void setCreateDate(Date createDate) {
167   - this.createDate = createDate;
168   - }
169   -
170   - public Integer getHoursJh() {
171   - return hoursJh;
172   - }
173   -
174   - public void setHoursJh(Integer hoursJh) {
175   - this.hoursJh = hoursJh;
176   - }
177   -
178   - public Integer getHoursSj() {
179   - return hoursSj;
180   - }
181   -
182   - public void setHoursSj(Integer hoursSj) {
183   - this.hoursSj = hoursSj;
184   - }
185   -
186   - public String keys() {
187   - return this.getLineCode() + "_" + this.getLpName() + "_" + this.getJsy() + "_" + this.getNbbm();
188   - }
189   -
190   - public long getId() {
191   - return id;
192   - }
193   -
194   - public void setId(long id) {
195   - this.id = id;
196   - }
197   -
198   - public String getCompanyName() {
199   - return companyName;
200   - }
201   -
202   - public void setCompanyName(String companyName) {
203   - this.companyName = companyName;
204   - }
205   -
206   - public String getSubCompanyName() {
207   - return subCompanyName;
208   - }
209   -
210   - public void setSubCompanyName(String subCompanyName) {
211   - this.subCompanyName = subCompanyName;
212   - }
213   -
214   - public String getHoursJhStr() {
215   - return hoursJhStr;
216   - }
217   -
218   - public void setHoursJhStr(String hoursJhStr) {
219   - this.hoursJhStr = hoursJhStr;
220   - }
221   -
222   - public String getHoursSjStr() {
223   - return hoursSjStr;
224   - }
225   -
226   - public void setHoursSjStr(String hoursSjStr) {
227   - this.hoursSjStr = hoursSjStr;
228   - }
229   -}
src/main/java/com/bsth/data/summary/entity/TempSchSituation.java deleted 100644 → 0
1   -package com.bsth.data.summary.entity;
2   -
3   -import javax.persistence.Entity;
4   -import javax.persistence.Id;
5   -import javax.persistence.Table;
6   -
7   -/**
8   - * 临加情况
9   - * Created by panzhao on 2017/10/31.
10   - */
11   -@Entity
12   -@Table(name = "z_calc_temp_detail")
13   -public class TempSchSituation {
14   -
15   - @Id
16   - private Long id;
17   -
18   - private String rq;
19   -
20   - private String gsBm;
21   -
22   - private String fgsBm;
23   -
24   - private String lineCode;
25   -
26   - private String lineName;
27   -
28   - private String nbbm;
29   -
30   - private String jGh;
31   -
32   - private String sGh;
33   -
34   - private int size;
35   -
36   - private Double mileage;
37   -
38   - private Long t;
39   -
40   - private String remark;
41   -
42   - private String idsStr;
43   -
44   - public Long getId() {
45   - return id;
46   - }
47   -
48   - public void setId(Long id) {
49   - this.id = id;
50   - }
51   -
52   - public String getRq() {
53   - return rq;
54   - }
55   -
56   - public void setRq(String rq) {
57   - this.rq = rq;
58   - }
59   -
60   - public String getLineCode() {
61   - return lineCode;
62   - }
63   -
64   - public void setLineCode(String lineCode) {
65   - this.lineCode = lineCode;
66   - }
67   -
68   - public String getLineName() {
69   - return lineName;
70   - }
71   -
72   - public void setLineName(String lineName) {
73   - this.lineName = lineName;
74   - }
75   -
76   - public String getNbbm() {
77   - return nbbm;
78   - }
79   -
80   - public void setNbbm(String nbbm) {
81   - this.nbbm = nbbm;
82   - }
83   -
84   - public String getjGh() {
85   - return jGh;
86   - }
87   -
88   - public void setjGh(String jGh) {
89   - this.jGh = jGh;
90   - }
91   -
92   - public String getsGh() {
93   - return sGh;
94   - }
95   -
96   - public void setsGh(String sGh) {
97   - this.sGh = sGh;
98   - }
99   -
100   - public int getSize() {
101   - return size;
102   - }
103   -
104   - public void setSize(int size) {
105   - this.size = size;
106   - }
107   -
108   - public Double getMileage() {
109   - return mileage;
110   - }
111   -
112   - public void setMileage(Double mileage) {
113   - this.mileage = mileage;
114   - }
115   -
116   - public Long getT() {
117   - return t;
118   - }
119   -
120   - public void setT(Long t) {
121   - this.t = t;
122   - }
123   -
124   - public String getRemark() {
125   - return remark;
126   - }
127   -
128   - public void setRemark(String remark) {
129   - this.remark = remark;
130   - }
131   -
132   - public String getIdsStr() {
133   - return idsStr;
134   - }
135   -
136   - public void setIdsStr(String idsStr) {
137   - this.idsStr = idsStr;
138   - }
139   -
140   - public String getGsBm() {
141   - return gsBm;
142   - }
143   -
144   - public void setGsBm(String gsBm) {
145   - this.gsBm = gsBm;
146   - }
147   -
148   - public String getFgsBm() {
149   - return fgsBm;
150   - }
151   -
152   - public void setFgsBm(String fgsBm) {
153   - this.fgsBm = fgsBm;
154   - }
155   -}
156 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/repository/DestroySituationRepository.java deleted 100644 → 0
1   -package com.bsth.data.summary.repository;
2   -
3   -import com.bsth.data.summary.entity.DestroySituation;
4   -import com.bsth.repository.BaseRepository;
5   -import org.springframework.stereotype.Repository;
6   -
7   -/**
8   - * Created by panzhao on 2017/11/1.
9   - */
10   -@Repository
11   -public interface DestroySituationRepository extends BaseRepository<DestroySituation, Long> {
12   -}
src/main/java/com/bsth/data/summary/repository/FastAndSlowRepository.java deleted 100644 → 0
1   -package com.bsth.data.summary.repository;
2   -
3   -import com.bsth.data.summary.entity.FastAndSlow;
4   -import com.bsth.repository.BaseRepository;
5   -import org.springframework.stereotype.Repository;
6   -
7   -/**
8   - * Created by panzhao on 2017/10/24.
9   - */
10   -@Repository
11   -public interface FastAndSlowRepository extends BaseRepository<FastAndSlow, Long> {
12   -}
src/main/java/com/bsth/data/summary/repository/HoursRepository.java deleted 100644 → 0
1   -package com.bsth.data.summary.repository;
2   -
3   -import com.bsth.data.summary.entity.Hours_jsy;
4   -import com.bsth.repository.BaseRepository;
5   -import org.springframework.stereotype.Repository;
6   -
7   -/**
8   - * Created by panzhao on 2017/7/27.
9   - */
10   -@Repository
11   -public interface HoursRepository extends BaseRepository<Hours_jsy, Long> {
12   -}
src/main/java/com/bsth/data/summary/repository/TempSchSituationRepository.java deleted 100644 → 0
1   -package com.bsth.data.summary.repository;
2   -
3   -import com.bsth.data.summary.entity.TempSchSituation;
4   -import com.bsth.repository.BaseRepository;
5   -import org.springframework.stereotype.Repository;
6   -
7   -/**
8   - * Created by panzhao on 2017/11/1.
9   - */
10   -@Repository
11   -public interface TempSchSituationRepository extends BaseRepository<TempSchSituation, Long> {
12   -}
src/main/java/com/bsth/data/summary/service/DestroySituationService.java deleted 100644 → 0
1   -package com.bsth.data.summary.service;
2   -
3   -import com.bsth.data.summary.entity.DestroySituation;
4   -import com.bsth.service.BaseService;
5   -
6   -import javax.servlet.http.HttpServletRequest;
7   -import javax.servlet.http.HttpServletResponse;
8   -import java.util.Map;
9   -
10   -/**
11   - * Created by panzhao on 2017/11/1.
12   - */
13   -public interface DestroySituationService extends BaseService<DestroySituation, Long> {
14   - void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response);
15   -}
16 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/service/FastAndSlowService.java deleted 100644 → 0
1   -package com.bsth.data.summary.service;
2   -
3   -import com.bsth.data.summary.entity.FastAndSlow;
4   -import com.bsth.service.BaseService;
5   -
6   -import javax.servlet.http.HttpServletRequest;
7   -import javax.servlet.http.HttpServletResponse;
8   -
9   -/**
10   - * Created by panzhao on 2017/10/24.
11   - */
12   -public interface FastAndSlowService extends BaseService<FastAndSlow, Long>{
13   - void excel(String lineCode, String st, String et, int type, HttpServletRequest request, HttpServletResponse response);
14   -}
15 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/service/HoursService.java deleted 100644 → 0
1   -package com.bsth.data.summary.service;
2   -
3   -import com.bsth.data.summary.entity.Hours_jsy;
4   -import com.bsth.service.BaseService;
5   -
6   -/**
7   - * Created by panzhao on 2017/7/27.
8   - */
9   -public interface HoursService extends BaseService<Hours_jsy, Long>{
10   -}
src/main/java/com/bsth/data/summary/service/TempSchSituationService.java deleted 100644 → 0
1   -package com.bsth.data.summary.service;
2   -
3   -import com.bsth.data.summary.entity.TempSchSituation;
4   -import com.bsth.service.BaseService;
5   -
6   -import javax.servlet.http.HttpServletRequest;
7   -import javax.servlet.http.HttpServletResponse;
8   -import java.util.Map;
9   -
10   -/**
11   - * Created by panzhao on 2017/11/1.
12   - */
13   -public interface TempSchSituationService extends BaseService<TempSchSituation, Long> {
14   - void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response);
15   -}
16 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/service/impl/DestroySituationServiceImpl.java deleted 100644 → 0
1   -package com.bsth.data.summary.service.impl;
2   -
3   -import com.bsth.data.summary.entity.DestroySituation;
4   -import com.bsth.data.summary.service.DestroySituationService;
5   -import com.bsth.data.utils.CustomStringUtils;
6   -import com.bsth.service.impl.BaseServiceImpl;
7   -import org.apache.poi.hssf.usermodel.HSSFWorkbook;
8   -import org.apache.poi.poifs.filesystem.POIFSFileSystem;
9   -import org.apache.poi.ss.usermodel.Row;
10   -import org.apache.poi.ss.usermodel.Sheet;
11   -import org.slf4j.Logger;
12   -import org.slf4j.LoggerFactory;
13   -import org.springframework.stereotype.Service;
14   -
15   -import javax.servlet.http.HttpServletRequest;
16   -import javax.servlet.http.HttpServletResponse;
17   -import java.io.FileInputStream;
18   -import java.io.OutputStream;
19   -import java.net.URLEncoder;
20   -import java.text.SimpleDateFormat;
21   -import java.util.*;
22   -
23   -/**
24   - * Created by panzhao on 2017/11/1.
25   - */
26   -@Service
27   -public class DestroySituationServiceImpl extends BaseServiceImpl<DestroySituation, Long> implements DestroySituationService {
28   -
29   - Logger logger = LoggerFactory.getLogger(this.getClass());
30   -
31   - @Override
32   - public Iterable<DestroySituation> list(Map<String, Object> map) {
33   - List<DestroySituation> list = (List<DestroySituation>) super.list(map);
34   -
35   - //排序
36   - Collections.sort(list, new Comparator<DestroySituation>() {
37   - @Override
38   - public int compare(DestroySituation o1, DestroySituation o2) {
39   - int i = o1.getRq().compareTo(o2.getRq());
40   - if(i != 0)
41   - return i;
42   -
43   - i = o1.getLineName().compareTo(o2.getLineName());
44   - if(i != 0)
45   - return i;
46   -
47   - i = (int) (o1.getT() - o2.getT());
48   - if(i != 0)
49   - return i;
50   -
51   - i = o1.getReason().compareTo(o2.getReason());
52   -
53   - return i;
54   - }
55   - });
56   - return list;
57   - }
58   -
59   - @Override
60   - public void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) {
61   - try {
62   - map.put("rq_le", CustomStringUtils.maxEndTime(map.get("rq_ge").toString()
63   - , map.get("rq_le").toString(), 62));
64   -
65   - List<DestroySituation> list = (List<DestroySituation>) super.list(map);
66   -
67   - if(list.size() == 0){
68   - response.setHeader("Content-type", "text/html;charset=UTF-8");
69   - response.getWriter().print("<span style='color:red;font-size:24px;'>根据查询条件没有搜索到数据,别导了!</span>");
70   - return ;
71   - }
72   -
73   - //排序
74   - Collections.sort(list, new Comparator<DestroySituation>() {
75   - @Override
76   - public int compare(DestroySituation o1, DestroySituation o2) {
77   - int i = o1.getRq().compareTo(o2.getRq());
78   - if(i != 0)
79   - return i;
80   -
81   - i = o1.getLineName().compareTo(o2.getLineName());
82   - if(i != 0)
83   - return i;
84   -
85   - i = (int) (o1.getT() - o2.getT());
86   - if(i != 0)
87   - return i;
88   -
89   - i = o1.getReason().compareTo(o2.getReason());
90   -
91   - return i;
92   - }
93   - });
94   -
95   - //输出excel
96   - String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
97   - String filePath = basePath + "/static/pages/summary/excel/烂班明细情况.xls";
98   - POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(filePath));
99   - HSSFWorkbook wb = new HSSFWorkbook(fs);
100   -
101   - //写入数据
102   - Sheet sheet = wb.getSheetAt(0);
103   - Row row;
104   - DestroySituation dys;
105   - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
106   - for(int i = 0; i < list.size(); i++){
107   - dys = list.get(i);
108   - row = sheet.createRow(i + 1);
109   - row.createCell(0).setCellValue(dys.getRq());
110   - row.createCell(1).setCellValue(dys.getLineName());
111   - row.createCell(2).setCellValue(dys.getNbbm());
112   - row.createCell(3).setCellValue(dys.getjGh());
113   - row.createCell(4).setCellValue(dys.getsGh());
114   - row.createCell(5).setCellValue(dys.getReason());
115   - row.createCell(6).setCellValue(dys.getSize());
116   - row.createCell(7).setCellValue(dys.getMileage());
117   - row.createCell(8).setCellValue(sdf.format(new Date(dys.getT())));
118   - row.createCell(9).setCellValue(dys.getRemark());
119   - }
120   -
121   - String name = "";//list.get(0).getLineName();
122   - wb.setSheetName(0, name + "烂班明细");
123   - //response 输出
124   - String filename = name + map.get("rq_ge") + "至" + map.get("rq_le") + "烂班明细情况.xls";
125   - response.setContentType("application/x-msdownload");
126   - response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
127   -
128   - OutputStream os = response.getOutputStream();
129   - wb.write(os);
130   - os.flush();
131   - os.close();
132   - } catch (Exception e) {
133   - logger.error("", e);
134   - }
135   - }
136   -
137   -}
138 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/service/impl/FastAndSlowServiceImpl.java deleted 100644 → 0
1   -package com.bsth.data.summary.service.impl;
2   -
3   -import com.bsth.data.BasicData;
4   -import com.bsth.data.summary.entity.FastAndSlow;
5   -import com.bsth.data.summary.service.FastAndSlowService;
6   -import com.bsth.data.utils.ConvertUtil;
7   -import com.bsth.data.utils.CustomStringUtils;
8   -import com.bsth.service.impl.BaseServiceImpl;
9   -import com.google.common.collect.ArrayListMultimap;
10   -import org.apache.poi.hssf.usermodel.HSSFWorkbook;
11   -import org.apache.poi.poifs.filesystem.POIFSFileSystem;
12   -import org.apache.poi.ss.usermodel.Row;
13   -import org.apache.poi.ss.usermodel.Sheet;
14   -import org.apache.poi.ss.util.CellRangeAddress;
15   -import org.joda.time.format.DateTimeFormat;
16   -import org.joda.time.format.DateTimeFormatter;
17   -import org.slf4j.Logger;
18   -import org.slf4j.LoggerFactory;
19   -import org.springframework.stereotype.Service;
20   -
21   -import javax.servlet.http.HttpServletRequest;
22   -import javax.servlet.http.HttpServletResponse;
23   -import java.io.FileInputStream;
24   -import java.io.OutputStream;
25   -import java.net.URLEncoder;
26   -import java.util.*;
27   -
28   -/**
29   - * Created by panzhao on 2017/10/24.
30   - */
31   -@Service
32   -public class FastAndSlowServiceImpl extends BaseServiceImpl<FastAndSlow, Long> implements FastAndSlowService {
33   -
34   - Logger logger = LoggerFactory.getLogger(this.getClass());
35   -
36   - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
37   -
38   - @Override
39   - public Iterable<FastAndSlow> list(Map<String, Object> map) {
40   - try {
41   - //最多5天
42   - map.put("rq_le", CustomStringUtils.maxEndTime(map.get("rq_ge").toString()
43   - , map.get("rq_le").toString(), 4));
44   -
45   - List<FastAndSlow> list = (List) super.list(map);
46   - String type = String.valueOf(map.get("type"));
47   -
48   - return filterByType(list, type);
49   - } catch (Exception e) {
50   - logger.error("", e);
51   - }
52   - return null;
53   - }
54   -
55   - @Override
56   - public void excel(String lineCode, String st, String et, int type, HttpServletRequest request, HttpServletResponse response) {
57   - try {
58   - Map<String, Object> params = new HashMap();
59   - //最多31天
60   - et = CustomStringUtils.maxEndTime(st, et, 31);
61   - params.put("rq_ge", st);
62   - params.put("rq_le", et);
63   - params.put("lineCode_eq", lineCode);
64   - List<FastAndSlow> list = filterByType((List) super.list(params), type + "");
65   -
66   - if(list.size() == 0){
67   - response.setHeader("Content-type", "text/html;charset=UTF-8");
68   - response.getWriter().print("<span style='color:red;font-size:24px;'>根据查询条件没有搜索到数据,别导了!</span>");
69   - return ;
70   - }
71   - //排序
72   - Collections.sort(list, new Comparator<FastAndSlow>() {
73   - @Override
74   - public int compare(FastAndSlow fas1, FastAndSlow fas2) {
75   - return (int) (fas1.getT() - fas2.getT());
76   - }
77   - });
78   - //按日期分组
79   - ArrayListMultimap<String, FastAndSlow> multimap =
80   - new ConvertUtil<FastAndSlow>().groupMultiList(list, "_", FastAndSlow.class.getDeclaredField("rq"));
81   - //输出excel
82   - String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
83   - String filePath = basePath + "/static/pages/summary/excel/快慢误点报表.xls";
84   - POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(filePath));
85   - HSSFWorkbook wb = new HSSFWorkbook(fs);
86   -
87   - //写入数据
88   - List<String> ks = new ArrayList<>(multimap.keySet());
89   - Collections.sort(ks);
90   - for(int i = 0; i < ks.size(); i++){
91   - Sheet sheet = wb.getSheetAt(i);
92   - writeData(sheet, multimap.get(ks.get(i)));
93   - //sheet name
94   - wb.setSheetName(i, ks.get(i));
95   - }
96   - //删除多余的sheet
97   - for(int i = ks.size(); i <32; i++){
98   - wb.removeSheetAt(ks.size());
99   - }
100   -
101   - //response 输出
102   - String filename = BasicData.lineCode2NameMap.get(lineCode) + st + "至" + et + "快慢误点明细.xls";
103   - response.setContentType("application/x-msdownload");
104   - response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
105   -
106   - OutputStream os = response.getOutputStream();
107   - wb.write(os);
108   - os.flush();
109   - os.close();
110   - } catch (Exception e) {
111   - logger.error("", e);
112   - }
113   - }
114   -
115   - private void writeData(Sheet sheet, List<FastAndSlow> list) {
116   - List<FastAndSlow> ups = new ArrayList<>()
117   - ,downs = new ArrayList<>();
118   - //前4行是表头
119   - Row row;
120   - row = sheet.getRow(0);
121   - row.getCell(0).setCellValue(list.get(0).getRq());
122   - row.getCell(13).setCellValue(BasicData.lineCode2NameMap.get(list.get(0).getLineCode()));
123   - FastAndSlow fas;
124   - for(int i = 0; i < list.size(); i++){
125   - fas = list.get(i);
126   - row = sheet.createRow(i + 4);
127   - row.createCell(0).setCellValue(i + 1);
128   - row.createCell(1).setCellValue(fas.getLpName());
129   - row.createCell(2).setCellValue(fas.getNbbm());
130   - row.createCell(3).setCellValue(fas.getJsy());
131   -
132   - row.createCell(4).setCellValue(fas.getStationName());
133   - row.createCell(5).setCellValue(fas.getUpDown());
134   - row.createCell(6).setCellValue(fas.getFcsj());
135   - row.createCell(7).setCellValue(fas.getDfsj());
136   - row.createCell(8).setCellValue(fas.getFcsjActual());
137   - row.createCell(9).setCellValue(fas.getFcsjFast());
138   - row.createCell(10).setCellValue(fas.getFcsjSlow());
139   - row.createCell(11).setCellValue(fas.getDfsjFast());
140   - row.createCell(12).setCellValue(fas.getDfsjSlow());
141   - row.createCell(13).setCellValue(fas.getZdsj());
142   - row.createCell(14).setCellValue(fas.getZdsjDf());
143   - row.createCell(15).setCellValue(fas.getZdsjActual());
144   - row.createCell(16).setCellValue(fas.getZdsjFast());
145   - row.createCell(17).setCellValue(fas.getZdsjSlow());
146   - row.createCell(18).setCellValue(fas.getZdsjDfFast());
147   - row.createCell(19).setCellValue(fas.getZdsjDfSlow());
148   -
149   - if(fas.getUpDown()==0)
150   - ups.add(fas);
151   - else
152   - downs.add(fas);
153   - }
154   - //合计
155   - int size = list.size();
156   - row = sheet.createRow(size + 4);
157   - row.createCell(2).setCellValue("发车:上行(计划快误点:"+jhfcFast(ups)+" 累计时间:"+jhfcFastTime(ups)+" 待发快误点:"+dffcFast(ups)+" 累计时间:"+dffcFastTime(ups)+") ");
158   - row.createCell(12).setCellValue("下行(计划快误点:"+jhfcFast(downs)+" 累计时间:"+jhfcFastTime(downs)+" 待发快误点:"+dffcFast(downs)+" 累计时间:"+dffcFastTime(downs)+")");
159   - row = sheet.createRow(size + 5);
160   - row.createCell(2).setCellValue("发车:上行(计划慢误点:"+jhfcSlow(ups)+" 累计时间:"+jhfcSlowTime(ups)+" 待发慢误点:"+dffcSlow(ups)+" 累计时间:"+dffcSlowTime(ups)+") ");
161   - row.createCell(12).setCellValue("下行(计划慢误点:"+jhfcSlow(downs)+" 累计时间:"+jhfcSlowTime(downs)+" 待发慢误点:"+dffcSlow(downs)+" 累计时间:"+dffcSlowTime(downs)+")");
162   - row = sheet.createRow(size + 6);
163   - row.createCell(2).setCellValue("到达:上行(计划快误点:"+jhzdFast(ups)+" 累计时间:"+jhzdFastTime(ups)+" 待发快误点:"+dfzdFast(ups)+" 累计时间:"+dfzdFastTime(ups)+") ");
164   - row.createCell(12).setCellValue("下行(计划快误点:"+jhzdFast(downs)+" 累计时间:"+jhzdFastTime(downs)+" 待发快误点:"+dfzdFast(downs)+" 累计时间:"+dfzdFastTime(downs)+")");
165   - row = sheet.createRow(size + 7);
166   - row.createCell(2).setCellValue("到达:上行(计划慢误点:"+jhzdSlow(ups)+" 累计时间:"+jhzdSlowTime(ups)+" 待发慢误点:"+dfzdSlow(ups)+" 累计时间:"+dfzdSlowTime(ups)+") ");
167   - row.createCell(12).setCellValue("下行(计划慢误点:"+jhzdSlow(downs)+" 累计时间:"+jhzdSlowTime(downs)+" 待发慢误点:"+dfzdSlow(downs)+" 累计时间:"+dfzdSlowTime(downs)+")");
168   - //合并单元格
169   - sheet.addMergedRegion(new CellRangeAddress(size + 4, size + 4, 2, 11));
170   - sheet.addMergedRegion(new CellRangeAddress(size + 4, size + 4, 12, 19));
171   - sheet.addMergedRegion(new CellRangeAddress(size + 5, size + 5, 2, 11));
172   - sheet.addMergedRegion(new CellRangeAddress(size + 5, size + 5, 12, 19));
173   - sheet.addMergedRegion(new CellRangeAddress(size + 6, size + 6, 2, 11));
174   - sheet.addMergedRegion(new CellRangeAddress(size + 6, size + 6, 12, 19));
175   - sheet.addMergedRegion(new CellRangeAddress(size + 7, size + 7, 2, 11));
176   - sheet.addMergedRegion(new CellRangeAddress(size + 7, size + 7, 12, 19));
177   -
178   - sheet.addMergedRegion(new CellRangeAddress(size + 4, size + 7, 0, 1));
179   - }
180   -
181   - private List<FastAndSlow> filterByType(List<FastAndSlow> all, String type) {
182   - List rsList = new ArrayList();
183   - if ("-1".equals(type)) {//慢误
184   - for (FastAndSlow fas : all) {
185   - if (fas.isSlow())
186   - rsList.add(fas);
187   - }
188   - return rsList;
189   - } else if ("1".equals(type)) {//快误
190   - for (FastAndSlow fas : all) {
191   - if (fas.isFast())
192   - rsList.add(fas);
193   - }
194   - return rsList;
195   - }
196   - return all;
197   - }
198   -
199   -
200   - /**
201   - * 计划发出快误点
202   - * @param list
203   - * @return
204   - */
205   - private int jhfcFast(List<FastAndSlow> list){
206   - int count=0;
207   - for(FastAndSlow fas : list){
208   - if(fas.getFcsjFast() > 0)
209   - count++;
210   - }
211   - return count;
212   - }
213   -
214   - /**
215   - * 计划终点快误点
216   - * @param list
217   - * @return
218   - */
219   - private int jhzdFast(List<FastAndSlow> list){
220   - int count=0;
221   - for(FastAndSlow fas : list){
222   - if(fas.getZdsjFast() > 0)
223   - count++;
224   - }
225   - return count;
226   - }
227   -
228   - /**
229   - * 待发发出快误点
230   - * @param list
231   - * @return
232   - */
233   - private int dffcFast(List<FastAndSlow> list){
234   - int count=0;
235   - for(FastAndSlow fas : list){
236   - if(fas.getDfsjFast() > 0)
237   - count++;
238   - }
239   - return count;
240   - }
241   -
242   - /**
243   - * 待发终点快误点
244   - * @param list
245   - * @return
246   - */
247   - private int dfzdFast(List<FastAndSlow> list){
248   - int count=0;
249   - for(FastAndSlow fas : list){
250   - if(fas.getZdsjDfFast() > 0)
251   - count++;
252   - }
253   - return count;
254   - }
255   -
256   - //----------
257   -
258   - /**
259   - * 计划发出慢误点
260   - * @param list
261   - * @return
262   - */
263   - private int jhfcSlow(List<FastAndSlow> list){
264   - int count=0;
265   - for(FastAndSlow fas : list){
266   - if(fas.getFcsjSlow() > 0)
267   - count++;
268   - }
269   - return count;
270   - }
271   -
272   - /**
273   - * 计划终点慢误点
274   - * @param list
275   - * @return
276   - */
277   - private int jhzdSlow(List<FastAndSlow> list){
278   - int count=0;
279   - for(FastAndSlow fas : list){
280   - if(fas.getZdsjSlow() > 0)
281   - count++;
282   - }
283   - return count;
284   - }
285   -
286   - /**
287   - * 待发发出慢误点
288   - * @param list
289   - * @return
290   - */
291   - private int dffcSlow(List<FastAndSlow> list){
292   - int count=0;
293   - for(FastAndSlow fas : list){
294   - if(fas.getDfsjSlow() > 0)
295   - count++;
296   - }
297   - return count;
298   - }
299   -
300   - /**
301   - * 待发终点慢误点
302   - * @param list
303   - * @return
304   - */
305   - private int dfzdSlow(List<FastAndSlow> list){
306   - int count=0;
307   - for(FastAndSlow fas : list){
308   - if(fas.getZdsjDfSlow() > 0)
309   - count++;
310   - }
311   - return count;
312   - }
313   - /**
314   - * ################
315   - */
316   - /**
317   - * 计划发出快误点
318   - * @param list
319   - * @return
320   - */
321   - private int jhfcFastTime(List<FastAndSlow> list){
322   - int sum=0;
323   - for(FastAndSlow fas : list){
324   - sum+=fas.getFcsjFast();
325   - }
326   - return sum;
327   - }
328   -
329   - /**
330   - * 计划终点快误点
331   - * @param list
332   - * @return
333   - */
334   - private int jhzdFastTime(List<FastAndSlow> list){
335   - int sum=0;
336   - for(FastAndSlow fas : list){
337   - sum+=fas.getZdsjFast();
338   - }
339   - return sum;
340   - }
341   -
342   - /**
343   - * 待发发出快误点
344   - * @param list
345   - * @return
346   - */
347   - private int dffcFastTime(List<FastAndSlow> list){
348   - int sum=0;
349   - for(FastAndSlow fas : list){
350   - sum+=fas.getDfsjFast();
351   - }
352   - return sum;
353   - }
354   -
355   - /**
356   - * 待发终点快误点
357   - * @param list
358   - * @return
359   - */
360   - private int dfzdFastTime(List<FastAndSlow> list){
361   - int sum=0;
362   - for(FastAndSlow fas : list){
363   - sum+=fas.getZdsjDfFast();
364   - }
365   - return sum;
366   - }
367   -
368   - //----------
369   -
370   - /**
371   - * 计划发出慢误点
372   - * @param list
373   - * @return
374   - */
375   - private int jhfcSlowTime(List<FastAndSlow> list){
376   - int sum=0;
377   - for(FastAndSlow fas : list){
378   - sum+=fas.getFcsjSlow();
379   - }
380   - return sum;
381   - }
382   -
383   - /**
384   - * 计划终点慢误点
385   - * @param list
386   - * @return
387   - */
388   - private int jhzdSlowTime(List<FastAndSlow> list){
389   - int sum=0;
390   - for(FastAndSlow fas : list){
391   - sum+=fas.getZdsjSlow();
392   - }
393   - return sum;
394   - }
395   -
396   - /**
397   - * 待发发出慢误点
398   - * @param list
399   - * @return
400   - */
401   - private int dffcSlowTime(List<FastAndSlow> list){
402   - int sum=0;
403   - for(FastAndSlow fas : list){
404   - sum+=fas.getDfsjSlow();
405   - }
406   - return sum;
407   - }
408   -
409   - /**
410   - * 待发终点慢误点
411   - * @param list
412   - * @return
413   - */
414   - private int dfzdSlowTime(List<FastAndSlow> list){
415   - int sum=0;
416   - for(FastAndSlow fas : list){
417   - sum+=fas.getZdsjDfSlow();
418   - }
419   - return sum;
420   - }
421   -}
422 0 \ No newline at end of file
src/main/java/com/bsth/data/summary/service/impl/HoursServiceImpl.java deleted 100644 → 0
1   -package com.bsth.data.summary.service.impl;
2   -
3   -import com.bsth.data.BasicData;
4   -import com.bsth.data.summary.entity.Hours_jsy;
5   -import com.bsth.data.summary.service.HoursService;
6   -import com.bsth.service.impl.BaseServiceImpl;
7   -import org.springframework.data.domain.Page;
8   -import org.springframework.data.domain.PageRequest;
9   -import org.springframework.data.domain.Pageable;
10   -import org.springframework.data.domain.Sort;
11   -import org.springframework.stereotype.Service;
12   -
13   -import java.util.ArrayList;
14   -import java.util.List;
15   -import java.util.Map;
16   -
17   -/**
18   - * Created by panzhao on 2017/7/27.
19   - */
20   -@Service
21   -public class HoursServiceImpl extends BaseServiceImpl<Hours_jsy, Long> implements HoursService {
22   -
23   - @Override
24   - public Page<Hours_jsy> list(Map<String, Object> map, Pageable pageable) {
25   - //排序
26   - List<Sort.Order> orderList = new ArrayList<>();
27   - orderList.add(new Sort.Order(Sort.Direction.ASC,"rq"));
28   - orderList.add(new Sort.Order(Sort.Direction.ASC,"lineName"));
29   - orderList.add(new Sort.Order(Sort.Direction.ASC,"jsy"));
30   - orderList.add(new Sort.Order(Sort.Direction.ASC,"nbbm"));
31   -
32   - Page<Hours_jsy> page = super.list(map, new PageRequest(pageable.getPageNumber(), pageable.getPageSize(), new Sort(orderList)));
33   -
34   - //公司编码转名称
35   - List<Hours_jsy> list = page.getContent();
36   - for(Hours_jsy h : list){
37   - h.setCompanyName(BasicData.businessCodeNameMap.get(h.getCompanyId()));
38   - h.setSubCompanyName(BasicData.businessFgsCodeNameMap.get(h.getSubCompanyId()+"_"+h.getCompanyId()));
39   -
40   - //时间字符串
41   - h.setHoursJhStr(hoursToString(h.getHoursJh()));
42   - h.setHoursSjStr(hoursToString(h.getHoursSj()));
43   - }
44   - return page;
45   - }
46   -
47   - private String hoursToString(Integer minute){
48   - if(minute==0)
49   - return "0";
50   - int h = minute / 60;
51   - String str = (h<10?"0"+h:h) + "";
52   -
53   - int m = minute % 60;
54   - if(m != 0)
55   - str += ("." + (m<10?"0"+m:m));
56   - return str;
57   - }
58   -}
src/main/java/com/bsth/data/summary/service/impl/TempSchSituationServiceImpl.java deleted 100644 → 0
1   -package com.bsth.data.summary.service.impl;
2   -
3   -import com.bsth.data.summary.entity.TempSchSituation;
4   -import com.bsth.data.summary.service.TempSchSituationService;
5   -import com.bsth.data.utils.CustomStringUtils;
6   -import com.bsth.service.impl.BaseServiceImpl;
7   -import org.apache.poi.hssf.usermodel.HSSFWorkbook;
8   -import org.apache.poi.poifs.filesystem.POIFSFileSystem;
9   -import org.apache.poi.ss.usermodel.Row;
10   -import org.apache.poi.ss.usermodel.Sheet;
11   -import org.slf4j.Logger;
12   -import org.slf4j.LoggerFactory;
13   -import org.springframework.stereotype.Service;
14   -
15   -import javax.servlet.http.HttpServletRequest;
16   -import javax.servlet.http.HttpServletResponse;
17   -import java.io.FileInputStream;
18   -import java.io.OutputStream;
19   -import java.net.URLEncoder;
20   -import java.text.SimpleDateFormat;
21   -import java.util.*;
22   -
23   -/**
24   - * Created by panzhao on 2017/11/1.
25   - */
26   -@Service
27   -public class TempSchSituationServiceImpl extends BaseServiceImpl<TempSchSituation, Long> implements TempSchSituationService {
28   -
29   - Logger logger = LoggerFactory.getLogger(this.getClass());
30   -
31   - @Override
32   - public Iterable<TempSchSituation> list(Map<String, Object> map) {
33   - List<TempSchSituation> list = (List<TempSchSituation>) super.list(map);
34   -
35   - //排序
36   - Collections.sort(list, new Comparator<TempSchSituation>() {
37   - @Override
38   - public int compare(TempSchSituation o1, TempSchSituation o2) {
39   - int i = o1.getRq().compareTo(o2.getRq());
40   - if (i != 0)
41   - return i;
42   -
43   - i = o1.getLineName().compareTo(o2.getLineName());
44   - if (i != 0)
45   - return i;
46   -
47   - i = (int) (o1.getT() - o2.getT());
48   - return i;
49   - }
50   - });
51   - return list;
52   - }
53   -
54   - @Override
55   - public void excel(Map<String, Object> map, HttpServletRequest request, HttpServletResponse response) {
56   - try {
57   - map.put("rq_le", CustomStringUtils.maxEndTime(map.get("rq_ge").toString()
58   - , map.get("rq_le").toString(), 62));
59   -
60   - List<TempSchSituation> list = (List<TempSchSituation>) super.list(map);
61   -
62   - if (list.size() == 0) {
63   - response.setHeader("Content-type", "text/html;charset=UTF-8");
64   - response.getWriter().print("<span style='color:red;font-size:24px;'>根据查询条件没有搜索到数据,别导了!</span>");
65   - return;
66   - }
67   -
68   - //排序
69   - Collections.sort(list, new Comparator<TempSchSituation>() {
70   - @Override
71   - public int compare(TempSchSituation o1, TempSchSituation o2) {
72   - int i = o1.getRq().compareTo(o2.getRq());
73   - if (i != 0)
74   - return i;
75   -
76   - i = o1.getLineName().compareTo(o2.getLineName());
77   - if (i != 0)
78   - return i;
79   -
80   - i = (int) (o1.getT() - o2.getT());
81   - return i;
82   - }
83   - });
84   -
85   - //输出excel
86   - String basePath = Thread.currentThread().getContextClassLoader().getResource("").getPath();
87   - String filePath = basePath + "/static/pages/summary/excel/临加明细情况.xls";
88   - POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(filePath));
89   - HSSFWorkbook wb = new HSSFWorkbook(fs);
90   -
91   - //写入数据
92   - Sheet sheet = wb.getSheetAt(0);
93   - Row row;
94   - TempSchSituation tss;
95   - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
96   - for (int i = 0; i < list.size(); i++) {
97   - tss = list.get(i);
98   - row = sheet.createRow(i + 1);
99   - row.createCell(0).setCellValue(tss.getRq());
100   - row.createCell(1).setCellValue(tss.getLineName());
101   - row.createCell(2).setCellValue(tss.getNbbm());
102   - row.createCell(3).setCellValue(tss.getjGh());
103   - row.createCell(4).setCellValue(tss.getsGh());
104   - row.createCell(5).setCellValue(tss.getSize());
105   - row.createCell(6).setCellValue(tss.getMileage());
106   - row.createCell(7).setCellValue(sdf.format(new Date(tss.getT())));
107   - row.createCell(8).setCellValue(tss.getRemark());
108   - }
109   -
110   - String name = "";//list.get(0).getLineName();
111   - wb.setSheetName(0, name + "临加明细");
112   - //response 输出
113   - String filename = name + map.get("rq_ge") + "至" + map.get("rq_le") + "临加明细情况.xls";
114   - response.setContentType("application/x-msdownload");
115   - response.setHeader("content-disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));
116   -
117   - OutputStream os = response.getOutputStream();
118   - wb.write(os);
119   - os.flush();
120   - os.close();
121   - } catch (Exception e) {
122   - logger.error("", e);
123   - }
124   - }
125   -}
126 0 \ No newline at end of file
src/main/java/com/bsth/entity/Line.java
... ... @@ -169,6 +169,9 @@ public class Line implements Serializable {
169 169 */
170 170 private Integer remove = 0;
171 171  
  172 +
  173 + private String coLineCode; //旧线路code
  174 +
172 175 public Integer getSpacGrade() {
173 176 return spacGrade;
174 177 }
... ... @@ -516,4 +519,12 @@ public class Line implements Serializable {
516 519 public void setRemove(Integer remove) {
517 520 this.remove = remove;
518 521 }
  522 +
  523 + public String getCoLineCode() {
  524 + return coLineCode;
  525 + }
  526 +
  527 + public void setCoLineCode(String coLineCode) {
  528 + this.coLineCode = coLineCode;
  529 + }
519 530 }
... ...