作者 xudada

查询分拨申请

... ... @@ -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);
}
}
... ...
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;
}
}
... ...