作者 朱兆平

Merge remote-tracking branch 'origin/forWechatService' into forWechatService

... ... @@ -51,7 +51,7 @@ spring:
# url: jdbc:oracle:thin:@192.168.1.199:10069:CGODB
# username: CGONMS
# password: 1q2w3e4r
url: jdbc:oracle:thin:@192.168.1.253:1522:ORCLL
url: jdbc:oracle:thin:@118.31.66.166:17005:ORCLL
username: CGONMS
password: vmvnv1v2
#spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
... ... @@ -193,6 +193,10 @@ mq:
vHost: NMMS
username: admin
password: admin
feign:
hystrix:
enabled: true
inport-url: http://nmms1.15miaoo.com:17999
info:
version: 1.0
description: "新舱单辅助管理服务-统一认证、转运管理、提前运抵等"
... ...
... ... @@ -192,6 +192,11 @@
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
... ...
... ... @@ -10,6 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
... ... @@ -19,6 +20,7 @@ import org.springframework.web.client.RestTemplate;
//@EnableScheduling
@EnableDiscoveryClient
@EnableTransactionManagement
@EnableFeignClients
@MapperScan("com.tianbo.analysis.dao")
public class NmmsAdminApplication {
... ...
package com.tianbo.analysis.controller;
import com.tianbo.analysis.model.INPORTALLOCATE;
import com.tianbo.analysis.model.InportallocateMode;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.InportallcateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/inport")
public class InportallocateController {
@Autowired
InportallcateService inportallcateService;
@RequestMapping("/selectInportallocates")
public ResultJson getById(@RequestParam(value = "waybill",required = true) String waybill,
@RequestParam(value = "pageIndex",required = true) int pageIndex,
@RequestParam(value = "pageSize",required = true) int pageSize){
InportallocateMode mode=new InportallocateMode();
mode.setWaybill(waybill);
mode.setPageIndex(pageIndex);
mode.setPageSize(pageSize);
Map map=inportallcateService.selectAllocate(mode);
return new ResultJson<>("200","success",map);
}
}
... ...
... ... @@ -102,7 +102,7 @@ public class UpfileJsonController {
or.setConsigneeaddress(arr.get(47));//收货人地址
or.setCreatedate(new Date());//创建日期yyyy-MM-dd HH:mm:ss
or.setFlightDate(format.parse(arr.get(66)));//航班日期yyyy-MM-dd
or.setStatus("17");//操作状态
or.setStatus("01");//操作状态
or.setIsbatch("T");//分批标识
or.setShipperCountrycode(arr.get(86));//发货人国家代码
or.setShipperPhone(arr.get(106));//发货人联系电话
... ...
package com.tianbo.analysis.model;
import lombok.Data;
@Data
public class InportallocateMode {
private String waybill;
private int pageIndex;
private int pageSize;
}
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.InportallocateMode;
import com.tianbo.analysis.service.imp.InportallocateImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.Map;
@Component
@FeignClient(url="${inport-url}",fallback = InportallocateImpl.class,name = "InportFeign")
public interface InportallcateService {
@PostMapping("/Allocate/querypage_inportallocate")
Map selectAllocate(InportallocateMode mode);
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.model.InportallocateMode;
import com.tianbo.analysis.service.InportallcateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Map;
@Slf4j
@Service
public class InportallocateImpl implements InportallcateService {
@Override
public Map selectAllocate(InportallocateMode mode) {
log.info("调用分拨接口失败");
return null;
}
}
... ...
... ... @@ -22,8 +22,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static org.apache.poi.ss.usermodel.CellType.BLANK;
import static org.apache.poi.ss.usermodel.CellType.STRING;
import static org.apache.poi.ss.usermodel.CellType.*;
/**
* shenhailong
... ... @@ -59,7 +58,7 @@ public class ExcelUtils {
}
totoalRows = xssfSheet.getLastRowNum();
//读取row
for (int rowIndex = 2; rowIndex <= totoalRows; rowIndex++) {
for (int rowIndex = 1; rowIndex <= totoalRows; rowIndex++) {
XSSFRow xssfRow = xssfSheet.getRow(rowIndex);
if (xssfRow == null) {
... ... @@ -145,12 +144,12 @@ public class ExcelUtils {
//读取列
for (int cellIndex = 0; cellIndex < totalCells; cellIndex++) {
HSSFCell hssfCell = hssfRow.getCell(cellIndex);
if (hssfCell == null) {
if (hssfCell == null || String.valueOf(hssfCell)=="") {
rowList.add("");
} else {
// System.out.println(hssfCell.getCellType());
if(BLANK==hssfCell.getCellType()){
if(NUMERIC==hssfCell.getCellType()){
if(DateUtil.isCellDateFormatted(hssfCell)){
//用于转化为日期格式
Date d = hssfCell.getDateCellValue();
... ...