package com.vincent.rsf.server.api.controller.erp; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.api.controller.erp.params.*; import com.vincent.rsf.server.api.service.ReceiveMsgService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; import java.util.Objects; @RestController @RequestMapping("/base") @Api(tags = "基础信息同步") public class BaseInfoController { @Autowired private ReceiveMsgService receiveMsgService; /** * @author Ryan * @date 2025/8/19 * @description: 物料信息同步 * @version 1.0 */ @ApiOperation(value = "基础物料信息同步", tags = "基础信息同步") @PostMapping("/sync/base/matnrs") public R syncMatnrs(@RequestBody List matnrs) { if (Objects.isNull(matnrs)) { return R.error("参数不能为空!"); } receiveMsgService.syncMatnrs(matnrs); return R.ok(); } /** * @author Ryan * @date 2025/8/18 * @description: 库位信息同步 * @version 1.0 */ @PostMapping("/sync/locs") @ApiOperation(value = "库位信息同步", tags = "基础信息同步") public R syncLocs(@RequestBody List locs) { if (locs.isEmpty()) { throw new CoolException("参数不能为空!!"); } return receiveMsgService.syncLocs(locs); } /** * @author Ryan * @date 2025/8/18 * @description: 物料分组信息同步 * @version 1.0 */ @PostMapping("/sync/matGroups") @ApiOperation(value = "物料分组信息同步", tags = "基础信息同步") public R syncMatGroup(@RequestBody List matGroupsParams) { if (matGroupsParams.isEmpty()) { throw new CoolException("参数不能为空!!"); } return receiveMsgService.syncMatGroups(matGroupsParams); } @ApiOperation(value = "库区数据同步", tags = "基础信息同步") @PostMapping("/sync/warehouse/areas") public R syncLocAreas(@RequestBody List areasParams) { if (areasParams.isEmpty()) { throw new CoolException("库区参数不能为空!!"); } return receiveMsgService.syncWarehouseAreas(areasParams); } @ApiOperation(value = "库区数据同步", tags = "基础信息同步") @PostMapping("/sync/warehouse") public R syncWarehouse(@RequestBody List warehouseParams) { if (warehouseParams.isEmpty()) { throw new CoolException("库区参数不能为空!!"); } return receiveMsgService.syncWarehouse(warehouseParams); } }