Commit c350e90a authored by xiachenqi's avatar xiachenqi

支持港澳台0.7

parent e7b0c24b
......@@ -64,7 +64,10 @@ public class ReadExcelApi {
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType.APPLICATION_JSON)
@Transactional(rollbackFor = Exception.class)
public Map<String, String> ReadPersonPost(@RequestParam("formStartTime") String startDate, @RequestParam("formDeadLine") String endDate, HttpServletResponse resp, HttpServletRequest requ) {
public Map<String, String> ReadPersonPost(@RequestParam("formStartTime") String startDate,
@RequestParam("formDeadLine") String endDate,
@RequestParam(value = "isGAT", required = false, defaultValue = "false") Boolean isGAT,
HttpServletResponse resp, HttpServletRequest requ) {
String remoteAddr = requ.getRemoteAddr();
MDC.put("ip", remoteAddr);
YXJSONResponse yxresp = new YXJSONResponse();
......@@ -140,43 +143,83 @@ public class ReadExcelApi {
if (list2 == null || i == 0) {
continue;
}
personPostEntity.setWaybillNumber((String) list2.get(0));
personPostEntity.setBackWaybillNumber((String) list2.get(1));
personPostEntity.setOrderNumber((String) list2.get(2));
personPostEntity.setCreateDate((String) list2.get(3));
personPostEntity.setOpenid((String) list2.get(4));
personPostEntity.setWcPlayOrderNumber((String) list2.get(5));
personPostEntity.setPlayState((String) list2.get(6));
personPostEntity.setOrderState((String) list2.get(7));
personPostEntity.setApplicantName((String) list2.get(8));
if ("".equals(replaceDate((String)list2.get(9)))){
birthStr=birthStr+list2.get(2).toString()+"、";
birthDate++;
if (isGAT) {
personPostEntity.setWaybillNumber((String) list2.get(17));
// personPostEntity.setBackWaybillNumber((String) list2.get(1));
personPostEntity.setOrderNumber((String) list2.get(0));
personPostEntity.setCreateDate((String) list2.get(30));
// personPostEntity.setOpenid((String) list2.get(4));
// personPostEntity.setWcPlayOrderNumber((String) list2.get(5));
// personPostEntity.setPlayState((String) list2.get(6));
personPostEntity.setOrderState((String) list2.get(4));
personPostEntity.setApplicantName((String) list2.get(47));
if ("".equals(replaceDate((String)list2.get(9)))){
birthStr=birthStr+list2.get(2).toString()+"、";
birthDate++;
}
personPostEntity.setBirthDate(replaceDate((String)list2.get(48)));
personPostEntity.setSenderName((String) list2.get(18));
personPostEntity.setSenderPhone((String) list2.get(19));
//todo 地址格式
personPostEntity.setSenderAddress((String) list2.get(23));
personPostEntity.setRecipientName((String) list2.get(24));
personPostEntity.setRecipientPhone((String) list2.get(25));
//todo 地址格式
personPostEntity.setRecipientAddress((String)list2.get(29));
// personPostEntity.setOrderBlankNumber("");
personPostEntity.setGetToProvince((String) list2.get(26));
personPostEntity.setGetToCity((String) list2.get(27));
personPostEntity.setGetToCounty((String) list2.get(28));
personPostEntity.setBusinessType((String) list2.get(1));
//todo 格口信息
// personPostEntity.setLatticeMouthInformation((String) list2.get(21));
//内件性质
// personPostEntity.setNatureOfTheInternal((String) list2.get(22));
//内件信息
// personPostEntity.setNatureOfTheInformation((String) list2.get(23));
personPostEntity.setFirstWhite(list2.get(46).toString().substring(5, 27));
personPostEntity.setFileId(fileNameDicEntity.getFileId());
personPostEntity.setGk(gkMap);
} else {
personPostEntity.setWaybillNumber((String) list2.get(0));
personPostEntity.setBackWaybillNumber((String) list2.get(1));
personPostEntity.setOrderNumber((String) list2.get(2));
personPostEntity.setCreateDate((String) list2.get(3));
personPostEntity.setOpenid((String) list2.get(4));
personPostEntity.setWcPlayOrderNumber((String) list2.get(5));
personPostEntity.setPlayState((String) list2.get(6));
personPostEntity.setOrderState((String) list2.get(7));
personPostEntity.setApplicantName((String) list2.get(8));
if ("".equals(replaceDate((String)list2.get(9)))){
birthStr=birthStr+list2.get(2).toString()+"、";
birthDate++;
}
personPostEntity.setBirthDate(replaceDate((String)list2.get(9)));
personPostEntity.setSenderName((String) list2.get(10));
personPostEntity.setSenderPhone((String) list2.get(11));
personPostEntity.setSenderAddress((String) list2.get(12));
personPostEntity.setRecipientName((String) list2.get(13));
personPostEntity.setRecipientPhone((String) list2.get(14));
personPostEntity.setRecipientAddress((String) list2.get(15));
personPostEntity.setOrderBlankNumber("");
personPostEntity.setGetToProvince((String) list2.get(17));
personPostEntity.setGetToCity((String) list2.get(18));
personPostEntity.setGetToCounty((String) list2.get(19));
personPostEntity.setBusinessType((String) list2.get(20));
personPostEntity.setLatticeMouthInformation((String) list2.get(21));
personPostEntity.setNatureOfTheInternal((String) list2.get(22));
personPostEntity.setNatureOfTheInformation((String) list2.get(23));
personPostEntity.setFirstWhite(list2.get(24).toString().substring(5, 27));
personPostEntity.setFileId(fileNameDicEntity.getFileId());
personPostEntity.setGk(gkMap);
}
personPostEntity.setBirthDate(replaceDate((String)list2.get(9)));
personPostEntity.setSenderName((String) list2.get(10));
personPostEntity.setSenderPhone((String) list2.get(11));
personPostEntity.setSenderAddress((String) list2.get(12));
personPostEntity.setRecipientName((String) list2.get(13));
personPostEntity.setRecipientPhone((String) list2.get(14));
personPostEntity.setRecipientAddress((String) list2.get(15));
personPostEntity.setOrderBlankNumber("");
personPostEntity.setGetToProvince((String) list2.get(17));
personPostEntity.setGetToCity((String) list2.get(18));
personPostEntity.setGetToCounty((String) list2.get(19));
personPostEntity.setBusinessType((String) list2.get(20));
personPostEntity.setLatticeMouthInformation((String) list2.get(21));
personPostEntity.setNatureOfTheInternal((String) list2.get(22));
personPostEntity.setNatureOfTheInformation((String) list2.get(23));
personPostEntity.setFirstWhite(list2.get(24).toString().substring(5, 27));
personPostEntity.setFileId(fileNameDicEntity.getFileId());
personPostEntity.setGk(gkMap);
entityList.add(personPostEntity);
}
personPostService.savePersonPost(entityList);
//查询导入新格口文件邮件号是否使用过
post= personPostService.findWaybillNumber(fileNameDicEntity.getFileId()+"");
backPost= personPostService.findBackWaybillNumber(fileNameDicEntity.getFileId()+"");
post = personPostService.findWaybillNumber(fileNameDicEntity.getFileId()+"");
if (!isGAT) backPost = personPostService.findBackWaybillNumber(fileNameDicEntity.getFileId()+"");
} catch (Exception e) {
e.printStackTrace();
logger.error("上传文件名:" + filename + "起始时间" + startDate + "截止时间" + endDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment