|
@@ -49,6 +49,36 @@ public class OutStockController {
|
|
|
private RestTemplate restTemplate;
|
|
|
@Autowired
|
|
|
private SysFarmService farmService;
|
|
|
+ @PostMapping("/getOutStockScreen")
|
|
|
+ public Result getListScreen(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
|
|
|
+ String farmCode = FarmCodeUtils.getFarmCode(paramsMap.get("farmCode"), httpServletRequest);
|
|
|
+ // //读取模式切换
|
|
|
+ DataSource dataSource = dataSourceService.getDataSourceStatus();
|
|
|
+ if (dataSource.getViewType() == 1) {
|
|
|
+ //view=1,显示县填写数据
|
|
|
+ return outStockService.listOutStock(httpServletRequest,paramsMap);
|
|
|
+ } else if (dataSource.getViewType() == 2){
|
|
|
+ //view=2,显示镇汇总数据
|
|
|
+ return outStockService.listOutStock(httpServletRequest,paramsMap);
|
|
|
+ }else {
|
|
|
+ //view=3,显示村汇总数据
|
|
|
+ if (dataSource.getDsStatus() == 1) {
|
|
|
+ //status=1,显示村汇总(手填)数据
|
|
|
+ return outStockService.listVillageOutStock(httpServletRequest,paramsMap);
|
|
|
+ } else {
|
|
|
+ //status=2,显示村汇总(养殖云)数据
|
|
|
+ System.out.println("status=2,显示村汇总(养殖云)数据");
|
|
|
+ String farmCodes = getFarmCodeByAdcode(farmCode);
|
|
|
+ System.out.println(farmCodes);
|
|
|
+ if (StringUtils.isBlank(farmCodes)){
|
|
|
+ return new Result(ResultCode.SUCCESS,new ArrayList<>());
|
|
|
+ }
|
|
|
+ return getStockFromBreedCloud(farmCodes);
|
|
|
+ //++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/getOutStock")
|
|
|
public Result getList(HttpServletRequest httpServletRequest, @RequestBody Map<String, String> paramsMap) {
|
|
|
String farmCode = FarmCodeUtils.getFarmCode(paramsMap.get("farmCode"), httpServletRequest);
|