Controller.java 1.54 KB
package com.huaheng.pc.U8.service;

import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.page.TableDataInfo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.ParseException;
import java.util.List;

@RestController
@RequestMapping("/u8")
public class Controller extends BaseController {

    @Resource
    private U8VendorService u8VendorService;
    @Resource
    private U8CustomerService u8CustomerService;
    @Resource
    private U8InventoryClassService u8InventoryClassService;
    @Resource
    private U8InventoryService inventoryService;

    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list() throws ParseException {
        List list = u8VendorService.sync();
        return getDataTable(list);
    }

    @PostMapping("/cus")
    @ResponseBody
    public TableDataInfo cus() throws ParseException {
        List list = u8CustomerService.sync();
        return getDataTable(list);
    }

    @PostMapping("/type")
    @ResponseBody
    public TableDataInfo type() {
        List list = u8InventoryClassService.sync();
        return getDataTable(list);
    }

    @PostMapping("/material")
    @ResponseBody
    public TableDataInfo material() throws ParseException {
        List list = inventoryService.sync();
        return getDataTable(list);
    }
}