BasicDataApi.java 3.69 KB
package com.huaheng.api.general.Controller;

import com.huaheng.api.general.service.BasicDataApiService;
import com.huaheng.framework.aspectj.lang.annotation.Log;
import com.huaheng.framework.aspectj.lang.constant.BusinessType;
import com.huaheng.framework.web.controller.BaseController;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.general.customer.domain.Customer;
import com.huaheng.pc.general.material.domain.Material;
import com.huaheng.pc.general.supplier.domain.Supplier;
import com.huaheng.pc.general.warehouse.domain.Warehouse;
import com.huaheng.pc.system.dept.domain.Dept;
import com.huaheng.pc.system.dict.domain.DictData;
import com.huaheng.pc.system.user.domain.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/basicData")
@Api(tags = {"basicData"}, description = "基础数据接口")
public class BasicDataApi extends BaseController {

    @Autowired
    private BasicDataApiService basicDataApiService;

    /**
     * 同步物料
     */
    @Log(title = "物料添加", action = BusinessType.INSERT)
    @PostMapping("/material")
    @ApiOperation("物料添加公共接口")
    @ResponseBody
    public AjaxResult MaterialApi(@RequestBody Material material)
    {
        AjaxResult ajaxResult = basicDataApiService.material(material);
        return ajaxResult;
    }

    /**
     * 同步字典
     */
    @Log(title = "字典添加", action = BusinessType.INSERT)
    @PostMapping("/dictData")
    @ApiOperation("字典添加公共接口")
    @ResponseBody
    public AjaxResult UnitlApi(@RequestBody DictData dictData)
    {
        AjaxResult ajaxResult = basicDataApiService.dict(dictData);
        return ajaxResult;
    }



    /**
     * 同步仓库和货主
     */
    @Log(title = "仓库添加", action = BusinessType.INSERT)
    @PostMapping("/warehouse")
    @ApiOperation("仓库添加公共接口")
    @ResponseBody
    public AjaxResult WarehouseApi(@RequestBody Warehouse warehouse)
    {
        AjaxResult ajaxResult = basicDataApiService.warehouse(warehouse);
        return ajaxResult;
    }

    /**
     * 同步客户档案
     */
    @Log(title = "客户档案添加", action = BusinessType.INSERT)
    @PostMapping("/customer")
    @ApiOperation("客户档案添加公共接口")
    @ResponseBody
    public AjaxResult CustomerApi(@RequestBody Customer customer)
    {
        AjaxResult ajaxResult = basicDataApiService.customer(customer);
        return ajaxResult;
    }

    /**
     * 同步部门档案
     */
    @Log(title = "部门档案添加", action = BusinessType.INSERT)
    @PostMapping("/dept")
    @ApiOperation("部门档案添加公共接口")
    @ResponseBody
    public AjaxResult DeptApi(@RequestBody Dept dept)
    {
        AjaxResult ajaxResult = basicDataApiService.dept(dept);
        return ajaxResult;
    }

    /**
     * 同步人员档案
     */
    @Log(title = "人员档案添加", action = BusinessType.INSERT)
    @PostMapping("/user")
    @ApiOperation("人员档案添加公共接口")
    @ResponseBody
    public AjaxResult UserApi(@RequestBody  User user)
    {
        AjaxResult ajaxResult = basicDataApiService.user(user);
        return ajaxResult;
    }

    /**
     * 同步供应商档案
     */
    @Log(title = "供应商档案添加", action = BusinessType.INSERT)
    @PostMapping("/supplier")
    @ApiOperation("供应商档案添加公共接口")
    @ResponseBody
    public AjaxResult SupplierApi(@RequestBody Supplier supplier){
        AjaxResult ajaxResult = basicDataApiService.supplier(supplier);
        return ajaxResult;
    }




}