正在显示
7 个修改的文件
包含
420 行增加
和
15 行删除
| @@ -31,15 +31,15 @@ spring: | @@ -31,15 +31,15 @@ spring: | ||
| 31 | # mybatis配置 | 31 | # mybatis配置 |
| 32 | mybatis: | 32 | mybatis: |
| 33 | mapper-locations: classpath:mapper/*.xml | 33 | mapper-locations: classpath:mapper/*.xml |
| 34 | - type-aliases-package: com.sunyo.wlpt.cgonms.provide.domain | 34 | + type-aliases-package: com.sunyo.wlpt.cgonms.arrival.domain |
| 35 | 35 | ||
| 36 | # 日志配置 | 36 | # 日志配置 |
| 37 | logging: | 37 | logging: |
| 38 | config: config/logback-dev.xml | 38 | config: config/logback-dev.xml |
| 39 | level: | 39 | level: |
| 40 | - com.sunyo.wlpt.cgonms.provide.mapper: debug | 40 | + com.sunyo.wlpt.cgonms.arrival.mapper: debug |
| 41 | logback: | 41 | logback: |
| 42 | - appname: cgonms-provide | 42 | + appname: cgonms-arrival |
| 43 | logdir: ./log | 43 | logdir: ./log |
| 44 | 44 | ||
| 45 | 45 |
| @@ -3,6 +3,7 @@ package com.sunyo.wlpt.cgonms.arrival.controller; | @@ -3,6 +3,7 @@ package com.sunyo.wlpt.cgonms.arrival.controller; | ||
| 3 | import com.sunyo.wlpt.cgonms.arrival.domain.*; | 3 | import com.sunyo.wlpt.cgonms.arrival.domain.*; |
| 4 | import com.sunyo.wlpt.cgonms.arrival.feign.GetCgoAsmFeign; | 4 | import com.sunyo.wlpt.cgonms.arrival.feign.GetCgoAsmFeign; |
| 5 | import com.sunyo.wlpt.cgonms.arrival.feign.GetTransportFeign; | 5 | import com.sunyo.wlpt.cgonms.arrival.feign.GetTransportFeign; |
| 6 | +import com.sunyo.wlpt.cgonms.arrival.response.ResultJson; | ||
| 6 | import com.sunyo.wlpt.cgonms.arrival.response.ResultWs; | 7 | import com.sunyo.wlpt.cgonms.arrival.response.ResultWs; |
| 7 | import com.sunyo.wlpt.cgonms.arrival.service.*; | 8 | import com.sunyo.wlpt.cgonms.arrival.service.*; |
| 8 | import com.sunyo.wlpt.cgonms.arrival.thread.ExitThreadPoolFactory; | 9 | import com.sunyo.wlpt.cgonms.arrival.thread.ExitThreadPoolFactory; |
| @@ -70,10 +71,11 @@ public class NmsController { | @@ -70,10 +71,11 @@ public class NmsController { | ||
| 70 | final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 71 | final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 71 | 72 | ||
| 72 | @GetMapping("/getInfo") | 73 | @GetMapping("/getInfo") |
| 73 | - public void getData( | 74 | + public ResultJson getData( |
| 74 | @RequestParam(value = "flightDate", required = false) Date flightDate, | 75 | @RequestParam(value = "flightDate", required = false) Date flightDate, |
| 75 | @RequestParam(value = "flightNo", required = false) String flightNo, | 76 | @RequestParam(value = "flightNo", required = false) String flightNo, |
| 76 | HttpServletRequest request) { | 77 | HttpServletRequest request) { |
| 78 | + ResultJson resultJson = new ResultJson(); | ||
| 77 | /* 获取token */ | 79 | /* 获取token */ |
| 78 | String sid = request.getHeader("Authorization"); | 80 | String sid = request.getHeader("Authorization"); |
| 79 | log.info("token的值:" + sid); | 81 | log.info("token的值:" + sid); |
| @@ -160,6 +162,10 @@ public class NmsController { | @@ -160,6 +162,10 @@ public class NmsController { | ||
| 160 | /*websocket,发送全部数据 */ | 162 | /*websocket,发送全部数据 */ |
| 161 | String resultJs = GsonUtils.toJsonStr(new ResultWs("获取数据,完成", resultList, "200", resultList.size(), resultList.size())); | 163 | String resultJs = GsonUtils.toJsonStr(new ResultWs("获取数据,完成", resultList, "200", resultList.size(), resultList.size())); |
| 162 | sendMsgByWebsocket(resultJs, sid); | 164 | sendMsgByWebsocket(resultJs, sid); |
| 165 | + | ||
| 166 | + resultJson.setCode("200"); | ||
| 167 | + resultJson.setData(resultList); | ||
| 168 | + return resultJson; | ||
| 163 | } | 169 | } |
| 164 | 170 | ||
| 165 | /** | 171 | /** |
| @@ -170,7 +176,7 @@ public class NmsController { | @@ -170,7 +176,7 @@ public class NmsController { | ||
| 170 | * @param threadPool 线程池 | 176 | * @param threadPool 线程池 |
| 171 | * @return | 177 | * @return |
| 172 | */ | 178 | */ |
| 173 | - private ResultArrivalData threadJob(ResultArrivalData result, CountDownLatch latch, ThreadPoolExecutor threadPool) { | 179 | + public ResultArrivalData threadJob(ResultArrivalData result, CountDownLatch latch, ThreadPoolExecutor threadPool) { |
| 174 | Runnable run = new Runnable() { | 180 | Runnable run = new Runnable() { |
| 175 | @Override | 181 | @Override |
| 176 | public void run() { | 182 | public void run() { |
| @@ -222,7 +228,7 @@ public class NmsController { | @@ -222,7 +228,7 @@ public class NmsController { | ||
| 222 | 228 | ||
| 223 | /** | 229 | /** |
| 224 | * 获取代理人的相关数据 | 230 | * 获取代理人的相关数据 |
| 225 | - */ | 231 | + |
| 226 | ResultArrivalData asmInfo = new ResultArrivalData(); | 232 | ResultArrivalData asmInfo = new ResultArrivalData(); |
| 227 | asmInfo = getCgoAsmFeign.getInfo(result.getWaybillNoMaster()); | 233 | asmInfo = getCgoAsmFeign.getInfo(result.getWaybillNoMaster()); |
| 228 | //设置结算代理人 | 234 | //设置结算代理人 |
| @@ -234,7 +240,7 @@ public class NmsController { | @@ -234,7 +240,7 @@ public class NmsController { | ||
| 234 | //设置二级类名称 | 240 | //设置二级类名称 |
| 235 | result.setTwoTypeName(asmInfo.getTwoTypeName()); | 241 | result.setTwoTypeName(asmInfo.getTwoTypeName()); |
| 236 | //设置一级类名称 | 242 | //设置一级类名称 |
| 237 | - result.setTypeName(asmInfo.getTypeName()); | 243 | + result.setTypeName(asmInfo.getTypeName());*/ |
| 238 | } catch (Exception e) { | 244 | } catch (Exception e) { |
| 239 | latch.countDown(); | 245 | latch.countDown(); |
| 240 | e.printStackTrace(); | 246 | e.printStackTrace(); |
| 1 | +package com.sunyo.wlpt.cgonms.arrival.excle; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.sunyo.wlpt.cgonms.arrival.response.ResultJson; | ||
| 5 | +import org.springframework.scheduling.annotation.Scheduled; | ||
| 6 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RestController; | ||
| 9 | + | ||
| 10 | +import javax.annotation.Resource; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * @author 子诚 | ||
| 14 | + * Description:定时任务每天凌晨4点,删除一周前的excel文件夹下的excel文件 | ||
| 15 | + * 时间:2020/6/5 17:11 | ||
| 16 | + */ | ||
| 17 | +@RequestMapping("/arrival") | ||
| 18 | +@RestController | ||
| 19 | +public class DeleteExcel { | ||
| 20 | + | ||
| 21 | + @Resource | ||
| 22 | + private DeleteExpiredFile deleteExpiredFile; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 每天凌晨4点,执行定时任务,删除缓存的文件 | ||
| 26 | + * | ||
| 27 | + * @return | ||
| 28 | + */ | ||
| 29 | + @Scheduled(cron = "0 0 4 * * ? ") | ||
| 30 | + @GetMapping("/delete") | ||
| 31 | + public ResultJson deleteExcel() { | ||
| 32 | + ResultJson result = new ResultJson(); | ||
| 33 | + try { | ||
| 34 | + deleteExpiredFile.deleteExpiredFileTask(); | ||
| 35 | + result.setMsg("清除一周前的文件,成功"); | ||
| 36 | + result.setCode("200"); | ||
| 37 | + } catch (Exception e) { | ||
| 38 | + result.setMsg("清除一周前的文件,失败"); | ||
| 39 | + result.setCode("400"); | ||
| 40 | + } | ||
| 41 | + return result; | ||
| 42 | + } | ||
| 43 | +} |
| 1 | +package com.sunyo.wlpt.cgonms.arrival.excle; | ||
| 2 | + | ||
| 3 | +import lombok.extern.slf4j.Slf4j; | ||
| 4 | +import org.springframework.beans.factory.annotation.Value; | ||
| 5 | +import org.springframework.stereotype.Component; | ||
| 6 | + | ||
| 7 | +import java.io.File; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * @author 子诚 | ||
| 11 | + * Description:删除静态资源文件夹excel(与src同级)下的一个星期之前的excel文件 | ||
| 12 | + * 时间:2020/6/5 16:47 | ||
| 13 | + */ | ||
| 14 | +@Slf4j | ||
| 15 | +@Component | ||
| 16 | +public class DeleteExpiredFile { | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 文件夹地址 | ||
| 20 | + */ | ||
| 21 | + @Value("${path.dir}") | ||
| 22 | + private String dir; | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 设置时间间隔 | ||
| 26 | + */ | ||
| 27 | + @Value("${delete.timeInterval}") | ||
| 28 | + long timeInterval; | ||
| 29 | + | ||
| 30 | + public void deleteExpiredFileTask() { | ||
| 31 | + String path = dir + "/"; | ||
| 32 | + File file = new File(path); | ||
| 33 | + deleteExpiredFile(file); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + /** | ||
| 37 | + * 判断是文件还是文件夹? | ||
| 38 | + * | ||
| 39 | + * @param file 文件或者文件夹 | ||
| 40 | + */ | ||
| 41 | + private void deleteExpiredFile(File file) { | ||
| 42 | + //如果文件或者文件夹不存在 | ||
| 43 | + if (!file.exists()) { | ||
| 44 | + return; | ||
| 45 | + } | ||
| 46 | + // 如果不是文件夹 | ||
| 47 | + if (!file.isDirectory()) { | ||
| 48 | + determineExpiredFile(file); | ||
| 49 | + } | ||
| 50 | + // 如果是文件夹,遍历文件夹中的所有文件 | ||
| 51 | + else { | ||
| 52 | + for (File f : file.listFiles()) { | ||
| 53 | + deleteExpiredFile(f); | ||
| 54 | + log.info("删除了文件" + f); | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 删除七天(一周)前的所有文件 | ||
| 61 | + * | ||
| 62 | + * @param file 文件 | ||
| 63 | + */ | ||
| 64 | + private void determineExpiredFile(File file) { | ||
| 65 | + // 取出存在文件最后的操作时间 | ||
| 66 | + long lastModifiedTime = file.lastModified(); | ||
| 67 | + // 当前时间的时间戳 | ||
| 68 | + long currentTime = System.currentTimeMillis(); | ||
| 69 | + // 设置时间范围 | ||
| 70 | + // long timeInterval = 7 * 24 * 60 * 60 * 1000; | ||
| 71 | + // 删除七天(一周)前的所有文件 | ||
| 72 | + if (currentTime - lastModifiedTime > timeInterval) { | ||
| 73 | + file.delete(); | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | +} |
| 1 | +package com.sunyo.wlpt.cgonms.arrival.excle; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.sunyo.wlpt.cgonms.arrival.response.ResultJson; | ||
| 5 | +import lombok.extern.slf4j.Slf4j; | ||
| 6 | +import org.springframework.beans.factory.annotation.Value; | ||
| 7 | +import org.springframework.web.bind.annotation.GetMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 9 | +import org.springframework.web.bind.annotation.RestController; | ||
| 10 | + | ||
| 11 | +import java.net.InetAddress; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * @author 子诚 | ||
| 15 | + * Description: | ||
| 16 | + * 时间:2020/6/4 19:10 | ||
| 17 | + */ | ||
| 18 | +@Slf4j | ||
| 19 | +@RestController | ||
| 20 | +@RequestMapping("/arrival") | ||
| 21 | +public class DownExcel { | ||
| 22 | + | ||
| 23 | + @Value("${server.port}") | ||
| 24 | + private String port; | ||
| 25 | + | ||
| 26 | + @GetMapping("/downExcel") | ||
| 27 | + public ResultJson downExcel() throws Exception { | ||
| 28 | + ResultJson result = new ResultJson(); | ||
| 29 | + //获取当前服务器的ip地址 | ||
| 30 | + String ip = InetAddress.getLocalHost().getHostAddress(); | ||
| 31 | + String address = "http://" + ip + ":" + port + "/exit/"; | ||
| 32 | + result.setCode("200"); | ||
| 33 | + result.setMsg(address); | ||
| 34 | + return result; | ||
| 35 | + } | ||
| 36 | +} |
| 1 | +package com.sunyo.wlpt.cgonms.arrival.excle; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.sunyo.wlpt.cgonms.arrival.domain.ResultArrivalData; | ||
| 5 | +import com.sunyo.wlpt.cgonms.arrival.response.ResultJson; | ||
| 6 | +import lombok.extern.slf4j.Slf4j; | ||
| 7 | +import org.apache.poi.hssf.usermodel.*; | ||
| 8 | +import org.springframework.beans.factory.annotation.Value; | ||
| 9 | +import org.springframework.web.bind.annotation.PostMapping; | ||
| 10 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 12 | +import org.springframework.web.bind.annotation.RestController; | ||
| 13 | + | ||
| 14 | +import javax.servlet.http.HttpServletResponse; | ||
| 15 | +import java.io.File; | ||
| 16 | +import java.io.FileNotFoundException; | ||
| 17 | +import java.io.FileOutputStream; | ||
| 18 | +import java.io.IOException; | ||
| 19 | +import java.text.SimpleDateFormat; | ||
| 20 | +import java.util.Date; | ||
| 21 | +import java.util.List; | ||
| 22 | +import java.util.UUID; | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * @author 子诚 | ||
| 27 | + * Description:导入Excel到静态资源文件夹excel(与src同级) | ||
| 28 | + * 时间:2020/5/29 10:04 | ||
| 29 | + */ | ||
| 30 | +@Slf4j | ||
| 31 | +@RestController | ||
| 32 | +@RequestMapping("/arrival") | ||
| 33 | +public class ExitExcel { | ||
| 34 | + | ||
| 35 | + @Value("${path.dir}") | ||
| 36 | + private String dir; | ||
| 37 | + | ||
| 38 | + @PostMapping("/excel") | ||
| 39 | + public ResultJson getExit(@RequestBody List<ResultArrivalData> exitInfoList, HttpServletResponse httpServletResponse) { | ||
| 40 | + ResultJson result = new ResultJson(); | ||
| 41 | + String title = exportExcel(exitInfoList, httpServletResponse); | ||
| 42 | + result.setMsg(title); | ||
| 43 | + result.setCode("200"); | ||
| 44 | + return result; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + private String exportExcel(List<ResultArrivalData> exitInfoList, HttpServletResponse response) { | ||
| 48 | + // 设置文件名 | ||
| 49 | + String title = ""; | ||
| 50 | + try { | ||
| 51 | + // 创建工作簿 | ||
| 52 | + HSSFWorkbook workbook = new HSSFWorkbook(); | ||
| 53 | + // 创建表 | ||
| 54 | + HSSFSheet sheet = workbook.createSheet("export"); | ||
| 55 | + // 创建行 | ||
| 56 | + HSSFRow row = sheet.createRow(0); | ||
| 57 | + // 创建单元格样式 | ||
| 58 | + HSSFCellStyle cellStyle = workbook.createCellStyle(); | ||
| 59 | + // 表头 | ||
| 60 | + String[] head = { | ||
| 61 | + "运单号", | ||
| 62 | + "件数", | ||
| 63 | + "重量", | ||
| 64 | + "计费重量", | ||
| 65 | + "体积", | ||
| 66 | + "品名", | ||
| 67 | + "二级品类", | ||
| 68 | + "一级品类", | ||
| 69 | + "货物目的站", | ||
| 70 | + "货物目的国家/地区", | ||
| 71 | + "所属洲", | ||
| 72 | + "航空公司", | ||
| 73 | + "航班号", | ||
| 74 | + "航班日期", | ||
| 75 | + "航班时间", | ||
| 76 | + "航班计划日期", | ||
| 77 | + "航班计划时间", | ||
| 78 | + "航段", | ||
| 79 | + "机号", | ||
| 80 | + "机型", | ||
| 81 | + "最大业载", | ||
| 82 | + "运单发货人", | ||
| 83 | + "运单收货人", | ||
| 84 | + "订舱代理人", | ||
| 85 | + "结算代理人", | ||
| 86 | + "自定义项" | ||
| 87 | + }; | ||
| 88 | + HSSFCell cell; | ||
| 89 | + // 设置表头 | ||
| 90 | + for (Integer i = 0; i < head.length; i++) { | ||
| 91 | + cell = row.createCell(i); | ||
| 92 | + cell.setCellValue(head[i]); | ||
| 93 | + cell.setCellStyle(cellStyle); | ||
| 94 | + // 设置单元格宽度 | ||
| 95 | + // 256*width+184 | ||
| 96 | + sheet.setColumnWidth(i, 4000); | ||
| 97 | + if (i == 14 || i == 16) { | ||
| 98 | + sheet.setColumnWidth(i, 6000); | ||
| 99 | + } | ||
| 100 | + if (i == 21 || i == 22) { | ||
| 101 | + sheet.setColumnWidth(i, 10000); | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + // 设置表格内容 | ||
| 105 | +// for (Integer i = 0; i < exitInfoList.size(); i++) { | ||
| 106 | +// row = sheet.createRow(i + 1); | ||
| 107 | +// ResultArrivalData resultExitData = exitInfoList.get(i); | ||
| 108 | +// // 这里是内容设置,替换则自己的数据即可 | ||
| 109 | +// String[] excelTitle = new String[27]; | ||
| 110 | +// | ||
| 111 | +// //取出数据,运单号 | ||
| 112 | +// excelTitle[0] = resultExitData.getWaybillNoMaster(); | ||
| 113 | +// //件数 | ||
| 114 | +// excelTitle[1] = resultExitData.getTallyTotalPiece(); | ||
| 115 | +// //重量 | ||
| 116 | +// excelTitle[2] = resultExitData.getTallyTotalWeight(); | ||
| 117 | +// //计费重量 | ||
| 118 | +// excelTitle[3] = String.valueOf(resultExitData.getTotalGrossWeightMeasure()); | ||
| 119 | +// //体积 | ||
| 120 | +// excelTitle[4] = String.valueOf(resultExitData.getVolumeMeasure()); | ||
| 121 | +// //品名 | ||
| 122 | +// excelTitle[5] = resultExitData.getSdCargoName(); | ||
| 123 | +// //二级品类 | ||
| 124 | +// excelTitle[6] = resultExitData.getTwoTypeName(); | ||
| 125 | +// //一级品类 | ||
| 126 | +// excelTitle[7] = resultExitData.getTypeName(); | ||
| 127 | +// //货物目的站 | ||
| 128 | +// excelTitle[8] = resultExitData.getAimStation(); | ||
| 129 | +// //货物目的国家/地区 | ||
| 130 | +// excelTitle[9] = resultExitData.getCountry(); | ||
| 131 | +// //所属洲 | ||
| 132 | +// excelTitle[10] = resultExitData.getAreaDescChn(); | ||
| 133 | +// //航空公司 | ||
| 134 | +// excelTitle[11] = resultExitData.getAirCompany(); | ||
| 135 | +// //航班号 | ||
| 136 | +// excelTitle[12] = resultExitData.getFlightNo(); | ||
| 137 | +// //航班日期 | ||
| 138 | +// excelTitle[13] = isNullShort(resultExitData.getFlightDate()); | ||
| 139 | +// //航班时间 | ||
| 140 | +// excelTitle[14] = isNullLong(resultExitData.getFlightTime()); | ||
| 141 | +// //航班计划日期 | ||
| 142 | +// excelTitle[15] = isNullShort(resultExitData.getFlightPlanDate()); | ||
| 143 | +// //航班计划时间 | ||
| 144 | +// excelTitle[16] = isNullLong(resultExitData.getFlightPlanTime()); | ||
| 145 | +// //航段 | ||
| 146 | +// excelTitle[17] = resultExitData.getSegment(); | ||
| 147 | +// //机号 | ||
| 148 | +// excelTitle[18] = resultExitData.getCfNo(); | ||
| 149 | +// //机型 | ||
| 150 | +// excelTitle[19] = resultExitData.getCfTp(); | ||
| 151 | +// //最大业载 | ||
| 152 | +// excelTitle[20] = ""; | ||
| 153 | +// //运单发货人 | ||
| 154 | +// excelTitle[21] = resultExitData.getShipperName(); | ||
| 155 | +// //运单收货人 | ||
| 156 | +// excelTitle[22] = resultExitData.getConsigneeName(); | ||
| 157 | +// //订舱代理人(代理人全称) | ||
| 158 | +// excelTitle[23] = resultExitData.getOrderName(); | ||
| 159 | +// //结算代理人(代理人全程) | ||
| 160 | +// excelTitle[24] = resultExitData.getCountName(); | ||
| 161 | +// //自定义项 | ||
| 162 | +// excelTitle[25] = ""; | ||
| 163 | +// | ||
| 164 | +// for (Integer j = 0; j < excelTitle.length; j++) { | ||
| 165 | +// row.createCell(j).setCellValue(excelTitle[j]); | ||
| 166 | +// } | ||
| 167 | +// } | ||
| 168 | + | ||
| 169 | + String file_name = UUID.randomUUID().toString().replaceAll("-", ""); | ||
| 170 | + // 设置文件名 | ||
| 171 | + title = file_name + ".xls"; | ||
| 172 | + | ||
| 173 | + String filePath = dir + "/" + title; | ||
| 174 | + /** | ||
| 175 | + * 创建文件夹 | ||
| 176 | + */ | ||
| 177 | + File testFile = new File(filePath); | ||
| 178 | + File fileParent = testFile.getParentFile(); | ||
| 179 | + if (!fileParent.exists()) { | ||
| 180 | + // 能创建多级目录 | ||
| 181 | + fileParent.mkdirs(); | ||
| 182 | + } | ||
| 183 | + try { | ||
| 184 | + FileOutputStream fos = new FileOutputStream(filePath); | ||
| 185 | + workbook.write(fos); | ||
| 186 | + fos.flush(); | ||
| 187 | + fos.close(); | ||
| 188 | + } catch (FileNotFoundException e) { | ||
| 189 | + e.printStackTrace(); | ||
| 190 | + } catch (IOException e) { | ||
| 191 | + e.printStackTrace(); | ||
| 192 | + } | ||
| 193 | + } catch (Exception e) { | ||
| 194 | + e.printStackTrace(); | ||
| 195 | + } | ||
| 196 | + return title; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + /** | ||
| 200 | + * 时间戳转换成字符串 | ||
| 201 | + */ | ||
| 202 | + public static String getDateToLong(long time) { | ||
| 203 | + Date d = new Date(time); | ||
| 204 | + SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 205 | + return sf.format(d); | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + /** | ||
| 209 | + * 时间戳转换成字符串 | ||
| 210 | + */ | ||
| 211 | + public static String getDateToShort(long time) { | ||
| 212 | + Date d = new Date(time); | ||
| 213 | + SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 214 | + return sf.format(d); | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + /** | ||
| 218 | + * 判断传递来的时间,是否为空,为null,则返回"",不为空,则规范格式 "yyyy-MM-dd" | ||
| 219 | + * | ||
| 220 | + * @param time Date类型时间 | ||
| 221 | + * @return | ||
| 222 | + */ | ||
| 223 | + public static String isNullShort(Date time) { | ||
| 224 | + if (null == time) { | ||
| 225 | + return ""; | ||
| 226 | + } else { | ||
| 227 | + return getDateToShort(time.getTime()); | ||
| 228 | + } | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + /** | ||
| 232 | + * 判断传递来的时间,是否为空,为null,则返回"",不为空,则规范格式 "yyyy-MM-dd HH:mm:ss" | ||
| 233 | + * | ||
| 234 | + * @param time Date类型时间 | ||
| 235 | + * @return | ||
| 236 | + */ | ||
| 237 | + public static String isNullLong(Date time) { | ||
| 238 | + if (null == time) { | ||
| 239 | + return ""; | ||
| 240 | + } else { | ||
| 241 | + return getDateToLong(time.getTime()); | ||
| 242 | + } | ||
| 243 | + } | ||
| 244 | +} |
| @@ -3,26 +3,26 @@ | @@ -3,26 +3,26 @@ | ||
| 3 | <mapper namespace="com.sunyo.wlpt.cgonms.arrival.mapper.ResultArrivalDataMapper"> | 3 | <mapper namespace="com.sunyo.wlpt.cgonms.arrival.mapper.ResultArrivalDataMapper"> |
| 4 | <resultMap id="BaseResultMap" type="com.sunyo.wlpt.cgonms.arrival.domain.ResultArrivalData"> | 4 | <resultMap id="BaseResultMap" type="com.sunyo.wlpt.cgonms.arrival.domain.ResultArrivalData"> |
| 5 | <!--@mbg.generated--> | 5 | <!--@mbg.generated--> |
| 6 | - <!--@Table ARRIVEDMASTER--> | 6 | + <!--@Table ORIGINMANIFESTMASTER--> |
| 7 | <result column="AUTOID" jdbcType="VARCHAR" property="autoId"/> | 7 | <result column="AUTOID" jdbcType="VARCHAR" property="autoId"/> |
| 8 | <result column="WAYBILLNOMASTER" jdbcType="VARCHAR" property="waybillNoMaster"/> | 8 | <result column="WAYBILLNOMASTER" jdbcType="VARCHAR" property="waybillNoMaster"/> |
| 9 | <result column="FLIGHTNO" jdbcType="VARCHAR" property="flightNo"/> | 9 | <result column="FLIGHTNO" jdbcType="VARCHAR" property="flightNo"/> |
| 10 | - <result column="FLIGHTDATE" jdbcType="TIMESTAMP" property="flightDate"/> | 10 | + <result column="FLIGHT_DATE" jdbcType="TIMESTAMP" property="flightDate"/> |
| 11 | <result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingStation"/> | 11 | <result column="ORIGINATINGSTATION" jdbcType="VARCHAR" property="originatingStation"/> |
| 12 | <result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationStation"/> | 12 | <result column="DESTINATIONSTATION" jdbcType="VARCHAR" property="destinationStation"/> |
| 13 | - <result column="TOTALPIECEQUANTITY" jdbcType="VARCHAR" property="totalPiece"/> | ||
| 14 | - <result column="ARRIVEDTOTALWEIGHT" jdbcType="VARCHAR" property="totalWeight"/> | 13 | + <result column="TOTALPIECE" jdbcType="VARCHAR" property="totalPiece"/> |
| 14 | + <result column="TOTALWEIGHT" jdbcType="VARCHAR" property="totalWeight"/> | ||
| 15 | </resultMap> | 15 | </resultMap> |
| 16 | <sql id="Base_Column_List"> | 16 | <sql id="Base_Column_List"> |
| 17 | <!--@mbg.generated--> | 17 | <!--@mbg.generated--> |
| 18 | - AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHTDATE, ORIGINATINGSTATION, DESTINATIONSTATION, | ||
| 19 | - TOTALPIECEQUANTITY, ARRIVEDTOTALWEIGHT | 18 | + AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHT_DATE, ORIGINATINGSTATION, DESTINATIONSTATION, |
| 19 | + TOTALPIECE, TOTALWEIGHT | ||
| 20 | </sql> | 20 | </sql> |
| 21 | <select id="getResultArrivalDataInfo" parameterType="com.sunyo.wlpt.cgonms.arrival.domain.ResultArrivalData" | 21 | <select id="getResultArrivalDataInfo" parameterType="com.sunyo.wlpt.cgonms.arrival.domain.ResultArrivalData" |
| 22 | resultMap="BaseResultMap"> | 22 | resultMap="BaseResultMap"> |
| 23 | select | 23 | select |
| 24 | <include refid="Base_Column_List"/> | 24 | <include refid="Base_Column_List"/> |
| 25 | - from ARRIVEDMASTER | 25 | + from ORIGINMANIFESTMASTER |
| 26 | where 1=1 | 26 | where 1=1 |
| 27 | <!-- 航班号 --> | 27 | <!-- 航班号 --> |
| 28 | <if test="flightNo!=null and flightNo!=''"> | 28 | <if test="flightNo!=null and flightNo!=''"> |
| @@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
| 30 | </if> | 30 | </if> |
| 31 | <!-- 航班日期 --> | 31 | <!-- 航班日期 --> |
| 32 | <if test="flightDate!=null"> | 32 | <if test="flightDate!=null"> |
| 33 | - AND FLIGHTDATE = #{flightDate,jdbcType=DATE} | 33 | + AND FLIGHT_DATE = #{flightDate,jdbcType=DATE} |
| 34 | </if> | 34 | </if> |
| 35 | </select> | 35 | </select> |
| 36 | </mapper> | 36 | </mapper> |
-
请 注册 或 登录 后发表评论