package com.hw.jindie.controller;

import com.hw.common.core.web.domain.AjaxResult;
import com.hw.common.log.annotation.Log;
import com.hw.common.log.enums.BusinessType;
import com.hw.jindie.service.IKingdeeErpSyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:
 * @ProjectName:HwMes
 * @Author:xins
 * @Date:2024-01-11 17:26
 * @Version:1.0
 */
@RestController
@RequestMapping("/jindie")
public class KingdeeErpSyncController {
    @Autowired
    private IKingdeeErpSyncService kingdeeErpSyncService;

    /**
     * 新增原材料入库记录
     */
//    @RequiresPermissions("wms:mobile:addrawinstock")
    @Log(title = "物料信息", businessType = BusinessType.INSERT)
    @GetMapping(("/syncMaterialInfo"))
    public AjaxResult syncMaterialInfo() {
        try{
            return AjaxResult.success(kingdeeErpSyncService.syncMaterialInfoFromErp());
        }catch(Exception e){
            e.printStackTrace();
            return AjaxResult.error();
        }

    }
}
